<br><font size=2 face="sans-serif">Hi,</font>
<br><font size=2 face="sans-serif">Yes you can get the correct length setting
the geodesic properties of the measure control to true.</font>
<br><font size=2 face="sans-serif">But this measure won't fit with the
scaleline.</font>
<br><font size=2 face="sans-serif"><br>
I might be wrong but I think there is no such geodesic property for the
scaleline.</font>
<br><font size=2 face="sans-serif">Steve</font>
<p>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>"Arnd Wippermann"
<arnd.wippermann@web.de>@openlayers.org</b> </font>
<br><font size=1 face="sans-serif">Envoyé par : users-bounces@openlayers.org</font>
<p><font size=1 face="sans-serif">25/11/2009 05:47 PM</font>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">A</font></div>
<td><font size=1 face="sans-serif">"'Nicolas Noe'" <niconoe@ulb.ac.be></font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td><font size=1 face="sans-serif">users@openlayers.org</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Objet</font></div>
<td><font size=1 face="sans-serif">Re: [OpenLayers-Users] Distance problem</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br>
<br>
<br><tt><font size=2>Hi,<br>
<br>
Also the map units are in meters, doesn't mean that you can measure real<br>
length. EPSG:900913 is not a length-preserving projection. As you can see<br>
that the equator have the same lenght as the north or south pole! With
the<br>
OpenLayers measure control you can get probably the correct length.<br>
<br>
Arnd<br>
<br>
-----Ursprüngliche Nachricht-----<br>
Von: users-bounces@openlayers.org [mailto:users-bounces@openlayers.org]
Im<br>
Auftrag von Nicolas Noe<br>
Gesendet: Mittwoch, 25. November 2009 12:01<br>
An: users@openlayers.org<br>
Betreff: [OpenLayers-Users] Distance problem<br>
<br>
Hi everyone,<br>
<br>
I have a simple problem, bit I can't figure it. I'm probably missing<br>
something very simple and stupid !<br>
<br>
I have an OL map with google background. The projection is EPSG:900913,
so<br>
the map unit is meters (right?).<br>
I have a marker layer, on which I add a first marker. Then I ask OL to<br>
compute a second marker 1 kilometer on the east, and display it.<br>
<br>
It seems to work, except of my distance problem : if I check with the OL<br>
scaleline, there's 1 KM between both markers (which is correct). <br>
However, if I use the ruler tool of Google Earth, I can see there is only<br>
about 650 meters between these 2 points.<br>
<br>
Do you have any idea of where my error is ?<br>
Thanks in advance,<br>
<br>
Here is my code :<br>
<br>
var BeBounds = new OpenLayers.Bounds(2.5, 49.5, 6.5, 51.5);<br>
<br>
function mapInit() {<br>
<br>
var map = new OpenLayers.Map('map', {<br>
projection: new OpenLayers.Projection("EPSG:900913"),<br>
controls: [<br>
new OpenLayers.Control.Navigation(),<br>
new OpenLayers.Control.PanZoomBar(),<br>
new<br>
OpenLayers.Control.LayerSwitcher({'ascending':false}),<br>
new OpenLayers.Control.Permalink(),<br>
new OpenLayers.Control.ScaleLine(),<br>
new OpenLayers.Control.Permalink('permalink'),<br>
new OpenLayers.Control.MousePosition(),<br>
new OpenLayers.Control.OverviewMap(),<br>
new OpenLayers.Control.KeyboardDefaults()<br>
]<br>
});<br>
<br>
var gsat = new OpenLayers.Layer.Google("Google Hybrid",<br>
{<br>
type: G_HYBRID_MAP,<br>
'sphericalMercator':true,<br>
maxExtent: new<br>
OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34)<br>
/*, numZoomLevels: 20*/ });<br>
<br>
var markers = new OpenLayers.Layer.Markers("Markers");<br>
<br>
map.addLayer(gsat);<br>
map.addLayer(markers);<br>
<br>
// Add a marker<br>
var myPoint = new OpenLayers.LonLat(5.080646954,50.49373471);<br>
var myPointInMeters = myPoint.transform(new<br>
OpenLayers.Projection("EPSG:4326"), map.projection);<br>
<br>
var pt2 = myPointInMeters.add(1000,0);<br>
<br>
var mymark = new OpenLayers.Marker(myPointInMeters);<br>
var mymark2 = new OpenLayers.Marker(pt2);<br>
<br>
markers.addMarker(mymark);<br>
markers.addMarker(mymark2);<br>
<br>
map.zoomToExtent(BeBounds.transform(new<br>
OpenLayers.Projection("EPSG:4326"), map.projection)); }<br>
_______________________________________________<br>
Users mailing list<br>
Users@openlayers.org<br>
http://openlayers.org/mailman/listinfo/users<br>
<br>
_______________________________________________<br>
Users mailing list<br>
Users@openlayers.org<br>
http://openlayers.org/mailman/listinfo/users<br>
</font></tt>
<br>
<br>
<br>