Hi MT You can't exactly "alert" at LatLng as it is still an javascript object. You could however alert the individual elements (lat, lng) by doing the following:
alert(latLng.lat()); or alert(latLng.lng()); I hope that helps. Jason On Mon, May 10, 2010 at 4:43 AM, Mattias Nordin <[email protected]>wrote: > Hi. > > Im trying to call a function where i need the coordinate as input but > i cant figure out how to do this. I was hoping the the following > syntax would be possible. > > Is this a limitation in API3 or am i doing it wrong? > > var map; > function initialize() { > var myLatlng = new google.maps.LatLng(-25.363882,131.044922); > var myOptions = { > zoom: 4, > center: myLatlng, > mapTypeId: google.maps.MapTypeId.ROADMAP > } > map = new google.maps.Map(document.getElementById("map_canvas"), > myOptions); > > google.maps.event.addListener(map, 'dragstart', function(event) { > test(event.latLng); > }); > > } > > > function test(location) { > alert(location) > } > > > *** The alert is not returning the LatLng position *** > > -- > You received this message because you are subscribed to the Google Groups > "Google Maps JavaScript API v3" group. > To post to this group, send email to > [email protected]. > To unsubscribe from this group, send email to > [email protected]<google-maps-js-api-v3%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-maps-js-api-v3?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
