Re: [Google Maps API v2] Storing Lat/Long values in an array
var points = new Array();
GEvent.addListener(map, "click", function(overlay,latlng) {
points.push(latlng.toUrlValue(6));
if (points.length == 2) {
directions.loadFromWaypoints(points);
}
});
You of course need to have setup a "GMap2" object, and a GDirections object.
On Thu, Sep 8, 2011 at 11:23 PM, ammu <artiamu@gmail.com> wrote:
> Hi,
>
> Can anyone please let me know a sample code to store the lat/lng
> values in an array and then showing the directions between those
> points?
>
> When user clicks on one point in a map I will store that value and
> then user clicks on another map I will store that as well and then
> display the directions from point 1 to point 2.
>
> Thanks in advance.
>
> --
> You received this message because you are subscribed to the Google Groups "Google Maps API V2" group.
> To post to this group, send email to google-maps-api@googlegroups.com.
> To unsubscribe from this group, send email to google-maps-api+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups "Google Maps API V2" group.
To post to this group, send email to google-maps-api@googlegroups.com.
To unsubscribe from this group, send email to google-maps-api+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home