PDA

View Full Version : Getting the Lat and Long seperately



Subby
24 Aug 2011, 5:44 AM
Hi everyone,

I am trying to send Lat and Long values seperately to a server but I'm not sure how to do it.

I have a map created, typically something like:


_mapGoogle = new Ext.Map({
useCurrentLocation: true,
zoom: 15
});

(_mapGoogle is a global variable)

The map renders perfectly fine and works perfectly...

All I want to do now, like I mentioned, Is just to get the Lat from the center of the map and the Long from the the center of the map. So basically, whatever the center is...the current location etc.... How do I get these values?

I have tried the following: _mapGoogle.getCenter().lat() and google.maps.Map.lat() etc.... I can't seem to get it working.

Any help is VERY VERY VERY appreciated.

Thank you.

NickT
25 Aug 2011, 4:04 AM
the google.maps.Map is a property of the Ext.Map so I think you just need to do this...

_mapGoogle.map.getCenter().lat()