<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">You could override the toString method of LonLat:<div><br></div><div>OpenLayers.LonLat.prototype.toString = function() {</div><div> return ("N " + this.lat.toFixed() + ", E " + this.lon.toFixed());</div><div>}</div><div><br></div><div>Best regards,</div><div>Bart<br><div><br><div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div><div>-- <br>Bart van den Eijnden<br>OSGIS - <a href="http://opengeo.org/">http://osgis.nl</a></div></div></div></div></span></div></span></div></span></div></span></div>
</div>
<br><div><div>On Aug 16, 2011, at 7:21 PM, Joel Leininger wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>How do I go about reformatting the text output from a coordinate<br>variable?<br><br>In other words, I have output from a mouse position which has been<br>transformed into different coordinate systems, and then gets displayed<br>on the screen.<br><br>It now looks something like this:<br><br>lon=414614.58552010887,lat=164066.82345258445<br><br>In reality, the values are x and y coords in feet or meters, not lonlat<br>coords. I'd like them to look like this:<br><br>N 164066, E 414614<br><br>Note the truncation of the digits and switching of the x, y (which is<br>customary in my field). Not being a JS expert, I can't figure out how to<br>get at the variable to massage the format prior to display on the<br>screen.<br><br>Here's the code leading up to the display (inside of a mousemove<br>function):<br><br>mousepos = map.getLonLatFromViewPortPx(e);<br>var NAD83ft_values = mousepos.clone(); // done several times for<br>different coord translations<br><br>NAD83ft_values.transform(WGS84_google_mercator, NAD83ft_proj);<br>document.getElementById("NAD83feet").innerHTML = NAD83ft_values;<br><br><br>It's unpacking NAD83ft_values that has me thrown. Any help?<br><br>-J.<br><br><br><br>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a><br>http://lists.osgeo.org/mailman/listinfo/openlayers-users<br><br></div></blockquote></div><br></div></div></body></html>