开发者

Google Maps API Driving Directions

开发者 https://www.devze.com 2022-12-15 01:51 出处:网络
I use Google Maps API and I have a map with 20 points on it. Can I find an API call to give me driving directions and draw lines between them?开发者_JAVA技巧Yes, it can be done. The Google Maps API D

I use Google Maps API and I have a map with 20 points on it.

Can I find an API call to give me driving directions and draw lines between them?开发者_JAVA技巧


Yes, it can be done. The Google Maps API Documentation describes how to this very accurately:

"You can add the ability to calculate directions (using a variety of methods of transportation) by using the GDirections object. The GDirections object requests and receives direction results using either query strings (e.g. "New York, NY to Chicago, IL") or textual lat/lons.

The GDirections object also supports multi-part directions using a series of waypoints. Directions may be displayed as either a polyline drawing the route on a map, as a series of textual description within a <div> element (e.g. "Turn right onto the Williamsburg Bridge ramp") or both."

Unfortunately driving directions are not yet available for all countries. You may want to check the following spreadsheet to see if driving directions are available for a particular location:

Google Code - Map Coverage Filtered

0

精彩评论

暂无评论...
验证码 换一张
取 消