<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.19328"></HEAD>
<BODY bgColor=#ffffff text=#000000>
<DIV dir=ltr align=left><FONT face=Arial><FONT color=#0000ff><FONT 
size=2>OpenLayers.Util.getFormattedLonLat(lat)<SPAN class=640170819-21112012> is 
for formating geographic coordinates,</SPAN></FONT></FONT></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN 
class=640170819-21112012>but you pass projected coordinates to the function. 
That's the reason for the strange output.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN 
class=640170819-21112012></SPAN></FONT> </DIV></FONT></DIV>
<DIV dir=ltr align=left><SPAN class=640170819-21112012><FONT color=#0000ff 
size=2 face=Arial>Util.js:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><FONT face=Arial><FONT color=#0000ff><FONT 
size=2>OpenLayers.Util.getFormattedLonLat = function(coordinate, axis, 
dmsOption) {<BR>    if (!dmsOption) 
{<BR>        dmsOption = 
'dms';    //default to show degree, minutes, 
seconds<BR>    }<BR> <BR> coordinate = 
(coordinate+540)%360 - 180; // normalize for sphere being round<BR><SPAN 
class=640170819-21112012>...</SPAN></FONT></FONT></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN 
class=640170819-21112012></SPAN></FONT></FONT></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN 
class=640170819-21112012>Choose displayProjection: geographic 
</SPAN></FONT></FONT></FONT><FONT face=Arial><FONT color=#0000ff><FONT 
size=2><SPAN class=640170819-21112012>and if you want to output your mousemove 
coordinates also in the projected coordinates,</SPAN></FONT></FONT></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN 
class=640170819-21112012>you have to transform 
them.</SPAN></FONT></FONT></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN 
class=640170819-21112012></SPAN></FONT></FONT></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN 
class=640170819-21112012>            
formatOutput: function(lonLat) 
{<BR>                
var geoCoor = lonLat.clone().transform(geographic, 
mercator);<BR>                
var lat = lonLat.lat;<BR>...</SPAN></FONT></FONT></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN 
class=640170819-21112012></SPAN></FONT></FONT></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN 
class=640170819-21112012></SPAN></FONT></FONT></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN 
class=640170819-21112012>see:</SPAN></FONT></FONT></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><A 
href="http://gis.ibbeck.de/ginfo/apps/OLExamples/OL212/PointTrack_Boaga_Projection.asp">http://gis.ibbeck.de/ginfo/apps/OLExamples/OL212/PointTrack_Boaga_Projection.asp</A></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 
face=Arial></FONT> </DIV>
<DIV dir=ltr align=left><SPAN class=640170819-21112012><FONT color=#0000ff 
size=2 face=Arial>Regard,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=640170819-21112012><FONT color=#0000ff 
size=2 face=Arial>Arnd</FONT></SPAN></DIV><BR>
<DIV dir=ltr lang=de class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>Von:</B> openlayers-users-bounces@lists.osgeo.org 
[mailto:openlayers-users-bounces@lists.osgeo.org] <B>Im Auftrag von </B>Riggi 
Valerio<BR><B>Gesendet:</B> Mittwoch, 21. November 2012 11:30<BR><B>An:</B> 
openlayers-users@lists.osgeo.org<BR><B>Betreff:</B> Re: [OpenLayers-Users] 
Display Coordinates<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV class=moz-cite-prefix>Cit.:<BR><SPAN 
style="WIDOWS: 2; TEXT-TRANSFORM: none; BACKGROUND-COLOR: rgb(255,255,255); TEXT-INDENT: 0px; DISPLAY: inline !important; FONT: 13px Verdana, Geneva,
        Helvetica, Arial, sans-serif; WHITE-SPACE: normal; ORPHANS: 2; FLOAT: none; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">Set 
the displayProjection property when you create the map to the projection (not 
the projection code) that you want the coordinates to be in.  (looks like 
it should be a projection created from EPSG:4326) The lat/lon being passed into 
the mousecontrol event will be in this projection. It look to me like you are 
getting in projected coordinates but trying to use them as 
lat/long.</SPAN><BR><BR>Done but the problem remains.<BR><BR>Il 20/11/2012 
15:28, Riggi Valerio ha scritto:<BR></DIV>
<BLOCKQUOTE cite=mid:50AB93A1.8080209@virgilio.it type="cite">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:<BR><BR>This is the <A 
  href="http://www.intornoamessina.it/tracking/index.php" 
  moz-do-not-send="true">WGS84 map</A> and this is the <A 
  href="http://www.intornoamessina.it/tracking/index.php?gauss" 
  moz-do-not-send="true">Gauss-Boaga Map</A><BR><BR>And this is the <B>example 
  code</B> I used:<BR><BR>    
  map.addControl(<BR>                
  new 
  OpenLayers.Control.MousePosition({<BR>                    
  prefix: '<div style=\"color: green; font-size: 14px; font-weight: bold; 
  background-color: white; width: 500px; text-align: left;\">Coordinate: 
  ',<BR>                    
  suffix: 
  '</div>',<BR>                    
  separator: ' | 
  ',<BR>                    
  numDigits: 
  2,<BR>                    
  emptyString: '<div style=\"color: red; font-size: 14px; font-weight: bold; 
  background-color: white; width: 500px; text-align: left;\">Mouse non sulla 
  mappa.</div>'<BR>                
  })<BR>            
  );<BR>    map.events.register("mousemove", map, function(e) 
  {<BR>                
  var position = 
  this.events.getMousePosition(e);<BR>                
  OpenLayers.Util.getElement("coords").innerHTML = 
  position;<BR>            
  });<BR>    map.addControl(new 
  OpenLayers.Control.Attribution());<BR><BR><B>Thanks</B><B><BR></B><B>Valerio</B><BR><BR>
  <FIELDSET class=mimeAttachmentHeader></FIELDSET> <BR><PRE wrap="">_______________________________________________
Users mailing list
<A class=moz-txt-link-abbreviated href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</A>
<A class=moz-txt-link-freetext href="http://lists.osgeo.org/mailman/listinfo/openlayers-users">http://lists.osgeo.org/mailman/listinfo/openlayers-users</A>
</PRE></BLOCKQUOTE><BR></BODY></HTML>