<br><font size=2 face="sans-serif">Hello,</font>
<br><font size=2 face="sans-serif">I created a measure control based on
the measure.js example</font>
<br><font size=2 face="sans-serif">My measure control doesn't display the
good distance. The distance is longer than expected.</font>
<br><font size=2 face="sans-serif">I tried with these coordinates</font>
<br><font size=2 face="sans-serif"># : lat, long</font>
<br><font size=2 face="sans-serif">Point 1 : 46.81509864093307, -71.22436522446064</font>
<br><font size=2 face="sans-serif">Point 2 : 45.54483148742626, -73.63037108350094</font>
<br><font size=2 face="sans-serif">The control gives 336.824 km</font>
<br><font size=2 face="sans-serif">It should be around 233 km</font>
<br>
<br><font size=2 face="sans-serif">Do you have an idea on what could be
the cause of this error?</font>
<br>
<br><font size=2 face="sans-serif">Here is my code</font>
<br><font size=2 face="sans-serif">//the mapOptions of OL are</font>
<br><font size=2 face="sans-serif">projection: "EPSG:900913",</font>
<br><font size=2 face="sans-serif">displayProjection: new OpenLayers.Projection("EPSG:4326"),
//Pour afficher les coord lat long</font>
<br><font size=2 face="sans-serif">units: "m",</font>
<br>
<br><font size=2 face="sans-serif">var mesureControl = new OpenLayers.Control.Measure(</font>
<br><font size=2 face="sans-serif">
OpenLayers.Handler.Path,
</font>
<br><font size=2 face="sans-serif">
{</font>
<br><font size=2 face="sans-serif">
persist:
true,</font>
<br><font size=2 face="sans-serif">
geodesic: false,</font>
<br><font size=2 face="sans-serif">
handlerOptions:
</font>
<br><font size=2 face="sans-serif">
{</font>
<br><font size=2 face="sans-serif">
//
layerOptions: {styleMap: styleMap}</font>
<br><font size=2 face="sans-serif">
}</font>
<br><font size=2 face="sans-serif">
}</font>
<br><font size=2 face="sans-serif">
);</font>
<br><font size=2 face="sans-serif">mesureControl.events.on</font>
<br><font size=2 face="sans-serif">({</font>
<br><font size=2 face="sans-serif"> "measure": handleMeasurements,</font>
<br><font size=2 face="sans-serif"> "measurepartial":
handleMeasurements</font>
<br><font size=2 face="sans-serif">});</font>
<br><font size=2 face="sans-serif">map.addControl(mesureControl);</font>
<br><font size=2 face="sans-serif"> </font>
<br><font size=2 face="sans-serif">function handleMeasurements(event) </font>
<br><font size=2 face="sans-serif">{</font>
<br><font size=2 face="sans-serif"> var
geometry = event.geometry;</font>
<br><font size=2 face="sans-serif"> var
units = event.units;</font>
<br><font size=2 face="sans-serif"> var
measure = event.measure;</font>
<br><font size=2 face="sans-serif"> </font>
<br><font size=2 face="sans-serif"> alert(
measure.toFixed(3) + " " + units, "" );</font>
<br><font size=2 face="sans-serif">}</font>
<br>
<br><font size=2 face="sans-serif">//geoExt toolbar</font>
<br><font size=2 face="sans-serif">action = new GeoExt.Action({</font>
<br><font size=2 face="sans-serif"> control:
mesureControl,</font>
<br><font size=2 face="sans-serif"> map: map,</font>
<br><font size=2 face="sans-serif"> toggleGroup: "map",</font>
<br><font size=2 face="sans-serif"> iconCls:
'measure',</font>
<br><font size=2 face="sans-serif"> tooltip:
'Mesure linéaire'</font>
<br><font size=2 face="sans-serif"> });</font>
<br><font size=2 face="sans-serif"> toolbar.push(action);
</font>
<br>
<br><font size=2 face="sans-serif">Thanks for your help,</font>
<br><font size=2 face="sans-serif">Steve</font>
<br><font size=2 face="sans-serif"><br>
</font><font size=3 color=#0066ff><i>Steve Toutant, M. Sc.</i></font><font size=3><br>
Analyste en géomatique<br>
Secteur environnement<br>
Direction des risques biologiques, environnementaux et occupationnels<br>
Institut national de santé publique du Québec<br>
945, avenue Wolfe<br>
Québec, Qc G1V 5B3 </font>
<p><font size=3>Tél.: (418) 650-5115 #5281<br>
Fax.: (418) 654-3144</font><font size=3 color=blue><u><br>
</u></font><a href=mailto:steve.toutant@inspq.qc.ca><font size=3 color=blue><u>steve.toutant@inspq.qc.ca</u></font></a><font size=3 color=blue><u><br>
</u></font><a href=http://www.inspq.qc.ca/><font size=3 color=blue><u>http://www.inspq.qc.ca</u></font></a>
<p><font size=3> </font>
<p>