As far as I know that openlayers can display our mouse coordinate position. However, I do not know how to display map center coordinate? Can anyone help me?
thanks for your helping guys!
|
As far as I know that openlayers can display our mouse coordinate position. However, I do not know how to display map center coordinate? Can anyone help me? thanks for your helping guys! |
|||
|
|
|
The easiest way would be to add an event to the map object so that on
|
|||||
|
|
You need to build a new Control, say OpenLayers.Control.MapCenter(). You can take OpenLayers.Control.MousePosition, rename it and change the registering of the events in the activate method. Remember also to change the unregistering in the deactivate method. Then you need to include js file with the definition of the new control and add it to you map: map.addControl(new OpenLayers.Control.MapCenter()) |
|||
|
|