简体   繁体   English

Google Maps WebService API-在地图上显示路线结果

[英]Google Maps WebService API - show directions result on map

EDIT: 编辑:

  1. How is it possible to get a DirectionsResult json object from Google maps Web Service APIv3 without breaking the "laws" of xss? 如何在不违反xss的“法则”的情况下从Google Maps Web Service APIv3获取DirectionsResult json对象?

  2. if so, how is it possible to parse that result and show it on a map (in the js API I use DirectionsRenderer) ? 如果是这样,如何解析该结果并将其显示在地图上(在我使用DirectionsRenderer的js API中)?

I can do the above with the js API, but am failing miserably with the Web Service. 我可以使用js API进行上述操作,但Web服务却失败了。 also, use of JQuery / JQM is available. 此外,还可以使用JQuery / JQM。

Any ideas? 有任何想法吗?

Sounds like you don't actually want to execute Javascript, you just want to parse JSON. 听起来您实际上并不想执行Javascript,而只是想解析JSON。 There are many libraries available to do this. 许多库可以执行此操作。

I recommend you to use Javascript OpenLayers Library displaying map data including Google Maps in most modern web browsers, with no server-side dependencies and Vaadin 's OpenLayers Wrapper which contains server side wrapper component for OpenLayers Maps. 我建议您使用Javascript OpenLayers Library在大多数现代Web浏览器中显示包括Google Maps在内的地图数据,并且不依赖服务器端,并且使用Vaadin的OpenLayers Wrapper,其中包含OpenLayers Maps的服务器端包装器组件。

Check out some of the applications that were built using these tools: 查看使用以下工具构建的一些应用程序:

http://trac.osgeo.org/openlayers/wiki/Gallery http://trac.osgeo.org/openlayers/wiki/图库

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM