[OpenLayers-Users] Get the center of the map in meters

Tim Schaub noreply at geocartic.com
Thu Mar 29 19:58:29 EDT 2007


Hey-

Jacopo Boari wrote:
> Hi All,
> I need to get the center of the map, I've tried with map.getCenter(), 
> but this method return a LatLon object.
> Can I obtain the center of the map in meters and not in degrees units?

Ignore the name LonLat.  The coordinates that are returned are in map 
units.  If your map units are meters, then the result of map.getCenter() 
will be in meters.

If you wish to transform coordinates (to go from one coordinate system 
to another), there is not currently support in OpenLayers to do so.

There are libraryish things out there to do this in JavaScript - but 
none have made it into OpenLayers yet.

Tim



More information about the Users mailing list