I added mouse control on the map with Lat/Long as display projection.I added a dropbox on the map for the user to choose a coordinate system (3 choices).Depending on the selection, I would like to change the displayed coordinates. What I'm missing is the syntax to do that.
This is my initial coordinate system:
map.addControl(new OpenLayers.Control.MousePosition({displayProjection: 'EPSG:4326'}));If the choice is EPSG:32187, I tried to change it:
displayProjection: new OpenLayers.Projection("EPSG:32187") });OpenLayers.Control.MousePosition({displayProjection: 'EPSG:32187'});map.displayProjection = new OpenLayers.Projection("EPSG:32187"); map.MousePosition = new OpenLayers.Projection("EPSG:32187");Nothing works.
The only thing it worked is if I add another MousePosition control:
map.addControl(new OpenLayers.Control.MousePosition({displayProjection: 'EPSG:32187'}));But that they are on on top of the other and I would like to reuse the existing Mouse control.
أكثر...
This is my initial coordinate system:
map.addControl(new OpenLayers.Control.MousePosition({displayProjection: 'EPSG:4326'}));If the choice is EPSG:32187, I tried to change it:
displayProjection: new OpenLayers.Projection("EPSG:32187") });OpenLayers.Control.MousePosition({displayProjection: 'EPSG:32187'});map.displayProjection = new OpenLayers.Projection("EPSG:32187"); map.MousePosition = new OpenLayers.Projection("EPSG:32187");Nothing works.
The only thing it worked is if I add another MousePosition control:
map.addControl(new OpenLayers.Control.MousePosition({displayProjection: 'EPSG:32187'}));But that they are on on top of the other and I would like to reuse the existing Mouse control.
أكثر...