[OpenLayers-Users] Display Coordinates

Riggi Valerio vash.84 at virgilio.it
Tue Nov 20 06:28:49 PST 2012


Hi, I'm tryng to display the coordinates on mouse over the map, on a 
WGS84 map and on a Gauss-Boaga map but coordinate seems strange to me, 
is there some error? I'm using the example bellow:

This is the WGS84 map <http://www.intornoamessina.it/tracking/index.php> 
and this is the Gauss-Boaga Map 
<http://www.intornoamessina.it/tracking/index.php?gauss>

And this is the *example code* I used:

     map.addControl(
                 new OpenLayers.Control.MousePosition({
                     prefix: '<div style=\"color: green; font-size: 
14px; font-weight: bold; background-color: white; width: 500px; 
text-align: left;\">Coordinate: ',
                     suffix: '</div>',
                     separator: ' | ',
                     numDigits: 2,
                     emptyString: '<div style=\"color: red; font-size: 
14px; font-weight: bold; background-color: white; width: 500px; 
text-align: left;\">Mouse non sulla mappa.</div>'
                 })
             );
     map.events.register("mousemove", map, function(e) {
                 var position = this.events.getMousePosition(e);
                 OpenLayers.Util.getElement("coords").innerHTML = position;
             });
     map.addControl(new OpenLayers.Control.Attribution());

*Thanks**
**Valerio*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20121120/43058c53/attachment.html>


More information about the Users mailing list