<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">I corrected the code but still I don't
understand a thing.. when I go on the WGS-84 map (<a
href="http://www.intornoamessina.it/tracking/">http://www.intornoamessina.it/tracking/</a>)
and I point the mouse at a certain point of coordinate -93.2735,
44.8349 the result is like 4613718.1118, 1718560.9374, should not
be like the coordinates before?<br>
<br>
Many Thanks<br>
Valerio<br>
<br>
Il 21/11/2012 20:16, Arnd Wippermann ha scritto:<br>
</div>
<blockquote cite="mid:5F57403BAF2B4531B0DEEE2ABCF8FAE0@pcawh2"
type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<meta name="GENERATOR" content="MSHTML 8.00.6001.19328">
<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" face="Arial"
size="2">
<div dir="ltr" align="left"><font color="#0000ff" face="Arial"
size="2"><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" face="Arial"
size="2"><span class="640170819-21112012"></span></font> </div>
</font></div>
<div dir="ltr" align="left"><span class="640170819-21112012"><font
color="#0000ff" face="Arial" size="2">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" face="Arial"
size="2"><a moz-do-not-send="true"
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"> </div>
<div dir="ltr" align="left"><span class="640170819-21112012"><font
color="#0000ff" face="Arial" size="2">Regard,</font></span></div>
<div dir="ltr" align="left"><span class="640170819-21112012"><font
color="#0000ff" face="Arial" size="2">Arnd</font></span></div>
<br>
<div dir="ltr" class="OutlookMessageHeader" align="left" lang="de">
<hr tabindex="-1">
<font face="Tahoma" size="2"><b>Von:</b>
<a class="moz-txt-link-abbreviated" href="mailto:openlayers-users-bounces@lists.osgeo.org">openlayers-users-bounces@lists.osgeo.org</a>
[<a class="moz-txt-link-freetext" href="mailto:openlayers-users-bounces@lists.osgeo.org">mailto:openlayers-users-bounces@lists.osgeo.org</a>] <b>Im
Auftrag von </b>Riggi Valerio<br>
<b>Gesendet:</b> Mittwoch, 21. November 2012 11:30<br>
<b>An:</b> <a class="moz-txt-link-abbreviated" href="mailto:openlayers-users@lists.osgeo.org">openlayers-users@lists.osgeo.org</a><br>
<b>Betreff:</b> Re: [OpenLayers-Users] Display Coordinates<br>
</font><br>
</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 moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a>
<a moz-do-not-send="true" 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>
</blockquote>
<br>
</body>
</html>