plotting a route on Google Maps -
How do I use the Google Maps API to plot a route? For example, a bunch of tracks loaded on the map (I currently have this) and draw a line from each of them, so that the user can find a way to see them all? How do I load the map when the user sees the map?
You can placepoints property on an object and this route from source to destination You must hide through all the points in your area:
The array of intermediate routing points. In this array, the directions from the origin of the directions will be calculated through the destination.
Once you set up the waypoint property, you call the route method to calculate the guidelines:
< Previous> route (request: directions request, callback: function (direction result, direction status))
Once you get your directions, / P>
Update with work examples
The following code is a direction between the hardcod start and the end points. The block creates three types of points:
// three points through which point point 1 = new google.maps.LatLng (-33.89750 9 8545041,151.09962701797485); Var point 2 = new google.maps.LatLng (-33.8584421519279,151.0693073272705); Var point3 = new google.maps.LatLng (-33.84525521656404,151.0421848297119); // Create an array of digits var wps = [{location: point1}, {location: point2}, {location: point3}]; // Original Set and Destination var org = new google.maps.LatLng (-33.89192157947345,151.13604068756104); Var dest = new google.maps.LatLng (-33.69727974097957,150.29047966003418); Var Request = {origin: org, destination: dest, waypoints: wps, travelmode: google.maps.DirectationsTravelMode.DRIVING};
You can get an example of this code ().
NB Keep in mind that you have only eight methods in your array, as long as you do not switch to a business account.
Comments
Post a Comment