How to extract Lat and Long values from map.GetCenter();

Hi, I need to extract lat and long from map.GetCenter(); as separate values but I'm not sure exactly how, or if it is possible at all. The following returns "undefined":

var ctr = map.GetCenter();
var lt= ctr.latitude;

alert (lt);

As well, is there any way to identify lat and long values of the corners of the map I need at least one long value...

Any suggestions much appreciated.



Answer this question

How to extract Lat and Long values from map.GetCenter();

  • MylesM

    ..and for the corners of the map, use map.GetMapView(). It returns a VELatLongRectangle object, which has 2 properties: TopLeftLatLong and BottomRightLatLong.


  • rgalgon

    So simple,

    Thanks pire!


  • Adam Lofts

    capital L's me friend =)

    var ctr = map.GetCenter();
    var lt =ctr.Longitude;
    var lng=ctr.Latitude;


  • Pr0fess0rX

    Thanks Caleb,  this info will be very handy!

    Cheers


  • How to extract Lat and Long values from map.GetCenter();