As far as I know OpenLayers can display our mouse coordinate position. However, I do not know how to display map center coordinate?
Can anyone help me?
[GIS] how to display map center coordinate using OpenLayers
openlayers-2
openlayers-2
As far as I know OpenLayers can display our mouse coordinate position. However, I do not know how to display map center coordinate?
Can anyone help me?
Best Answer
The easiest way would be to add an event to the map object so that on
moveend
somediv
(or something else) is updated. The map center itself can easily be retrieved from the map object withgetCenter
. For example: