原文地址:Example of using JavaScript for Google maps in the Delphi XE6
setPanel()
‘WebBrowser1.LoadFromStrings(cRoute, ‘‘);
再声明两个常量:
cChicagoWinona =
‘document.getElementByIdx_x(‘‘start‘‘).value = "chicago, il";‘
+ ‘document.getElementByIdx_x(‘‘end‘‘).value = "winona, az";‘
+ ‘calcRoute();‘;
cStLouisGallupNM =
‘document.getElementByIdx_x(‘‘start‘‘).value = "st louis, mo";‘
+ ‘document.getElementByIdx_x(‘‘end‘‘).value = "gallup, nm";‘
+ ‘calcRoute();‘;
用两个按钮调用:
procedure TForm1.Button1Click(Sender: TObject);
begin
WebBrowser1.EvaluateJavaScript(cChicagoWinona);
end;
http://blog.sina.com.cn/s/blog_44fa172f0101rhfz.html
原文:http://www.cnblogs.com/findumars/p/4999077.html