<br><font size=2 face="sans-serif">Setting geodesic: true fixed it.</font>
<br><font size=2 face="sans-serif">I misunderstood this property.</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>&nbsp; </font>
<p>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Steve Toutant/INSPQ/SSSS</b></font>
<p><font size=1 face="sans-serif">03/08/2009 11:01 AM</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">Kwong Hu Kiu &lt;kwonghu@hotmail.com&gt;</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] Measure control
problem</font><a href=Notes://INS03INSPQ00001/85256FDD006242B0/DABA975B9FB113EB852564B5001283EA/4F12B519B6B85AF08525760700514BFA>Lien</a></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br><font size=2 face="sans-serif"><br>
</font>
<br>
<br><font size=2 face="sans-serif">No, I need planar distance since my
map is in Mercator projection.</font>
<br><font size=2 face="sans-serif">I provided The coordinates of point
1 and point 2 in lat/long just for test purpose.</font>
<br>
<br><font size=2 face="sans-serif">Sorry for the confusion.</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>&nbsp; </font>
<p>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Kwong Hu Kiu &lt;kwonghu@hotmail.com&gt;</b>
</font>
<p><font size=1 face="sans-serif">03/08/2009 10:47 AM</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">&lt;steve.toutant@inspq.qc.ca&gt;, &lt;users@openlayers.org&gt;</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td>
<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] Measure control
problem</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br>
<br>
<br><font size=2 face="Verdana"><br>
I think you are looking for the Vincenty distance formula.<br>
It's included in the examples as well.<br>
<br>
</font>
<hr><font size=2 face="Verdana">To: users@openlayers.org<br>
From: Steve.Toutant@inspq.qc.ca<br>
Date: Mon, 3 Aug 2009 10:44:10 -0400<br>
Subject: [OpenLayers-Users] Measure control problem<br>
<br>
</font><font size=2 face="sans-serif"><br>
Hello,</font><font size=2 face="Verdana"> </font><font size=2 face="sans-serif"><br>
I created a measure control based on the measure.js example</font><font size=2 face="Verdana">
</font><font size=2 face="sans-serif"><br>
My measure control doesn't display the good distance. The distance is longer
than expected.</font><font size=2 face="Verdana"> </font><font size=2 face="sans-serif"><br>
I tried with these coordinates</font><font size=2 face="Verdana"> </font><font size=2 face="sans-serif"><br>
# : lat, long</font><font size=2 face="Verdana"> </font><font size=2 face="sans-serif"><br>
Point 1 : 46.81509864093307, -71.22436522446064</font><font size=2 face="Verdana">
</font><font size=2 face="sans-serif"><br>
Point 2 : &nbsp;45.54483148742626, -73.63037108350094</font><font size=2 face="Verdana">
</font><font size=2 face="sans-serif"><br>
The control gives 336.824 km</font><font size=2 face="Verdana"> </font><font size=2 face="sans-serif"><br>
It should be around 233 km</font><font size=2 face="Verdana"> <br>
</font><font size=2 face="sans-serif"><br>
Do you have an idea on what could be the cause of this error?</font><font size=2 face="Verdana">
<br>
</font><font size=2 face="sans-serif"><br>
Here is my code</font><font size=2 face="Verdana"> </font><font size=2 face="sans-serif"><br>
//the mapOptions of OL are</font><font size=2 face="Verdana"> </font><font size=2 face="sans-serif"><br>
projection: &quot;EPSG:900913&quot;,</font><font size=2 face="Verdana">
</font><font size=2 face="sans-serif"><br>
displayProjection: new OpenLayers.Projection(&quot;EPSG:4326&quot;), //Pour
afficher les coord lat long</font><font size=2 face="Verdana"> </font><font size=2 face="sans-serif"><br>
units: &quot;m&quot;,</font><font size=2 face="Verdana"> <br>
</font><font size=2 face="sans-serif"><br>
var mesureControl = new OpenLayers.Control.Measure(</font><font size=2 face="Verdana">
</font><font size=2 face="sans-serif"><br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; OpenLayers.Handler.Path, <br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</font><font size=2 face="Verdana">
</font><font size=2 face="sans-serif"><br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; persist: true,</font><font size=2 face="Verdana">
</font><font size=2 face="sans-serif"><br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;geodesic: false,</font><font size=2 face="Verdana">
</font><font size=2 face="sans-serif"><br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; handlerOptions: <br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp;{</font><font size=2 face="Verdana"> </font><font size=2 face="sans-serif"><br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp;// &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; layerOptions: {styleMap:
styleMap}</font><font size=2 face="Verdana"> </font><font size=2 face="sans-serif"><br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</font><font size=2 face="Verdana">
</font><font size=2 face="sans-serif"><br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; }</font><font size=2 face="Verdana"> </font><font size=2 face="sans-serif"><br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; );</font><font size=2 face="Verdana">
</font><font size=2 face="sans-serif"><br>
mesureControl.events.on</font><font size=2 face="Verdana"> </font><font size=2 face="sans-serif"><br>
({</font><font size=2 face="Verdana"> </font><font size=2 face="sans-serif"><br>
 &nbsp; &nbsp;&quot;measure&quot;: handleMeasurements,</font><font size=2 face="Verdana">
</font><font size=2 face="sans-serif"><br>
 &nbsp; &nbsp; &nbsp; &nbsp;&quot;measurepartial&quot;: handleMeasurements</font><font size=2 face="Verdana">
</font><font size=2 face="sans-serif"><br>
});</font><font size=2 face="Verdana"> </font><font size=2 face="sans-serif"><br>
map.addControl(mesureControl);</font><font size=2 face="Verdana"> </font><font size=2 face="sans-serif"><br>
 &nbsp; &nbsp; &nbsp; &nbsp;<br>
function handleMeasurements(event) <br>
{</font><font size=2 face="Verdana"> </font><font size=2 face="sans-serif"><br>
 &nbsp; &nbsp; &nbsp; &nbsp;var geometry = event.geometry;</font><font size=2 face="Verdana">
</font><font size=2 face="sans-serif"><br>
 &nbsp; &nbsp; &nbsp; &nbsp;var units = event.units;</font><font size=2 face="Verdana">
</font><font size=2 face="sans-serif"><br>
 &nbsp; &nbsp; &nbsp; &nbsp;var measure = event.measure;</font><font size=2 face="Verdana">
</font><font size=2 face="sans-serif"><br>
 &nbsp; &nbsp; &nbsp; &nbsp;<br>
 &nbsp; &nbsp; &nbsp; &nbsp;alert( measure.toFixed(3) + &quot; &quot; +
units, &quot;&quot; );</font><font size=2 face="Verdana"> </font><font size=2 face="sans-serif"><br>
}</font><font size=2 face="Verdana"> <br>
</font><font size=2 face="sans-serif"><br>
//geoExt toolbar</font><font size=2 face="Verdana"> </font><font size=2 face="sans-serif"><br>
action = new GeoExt.Action({</font><font size=2 face="Verdana"> </font><font size=2 face="sans-serif"><br>
 &nbsp; &nbsp; &nbsp; &nbsp;control: mesureControl,</font><font size=2 face="Verdana">
</font><font size=2 face="sans-serif"><br>
 &nbsp; &nbsp;map: map,</font><font size=2 face="Verdana"> </font><font size=2 face="sans-serif"><br>
 &nbsp; &nbsp;toggleGroup: &quot;map&quot;,</font><font size=2 face="Verdana">
</font><font size=2 face="sans-serif"><br>
 &nbsp; &nbsp; &nbsp; &nbsp;iconCls: 'measure',</font><font size=2 face="Verdana">
</font><font size=2 face="sans-serif"><br>
 &nbsp; &nbsp; &nbsp; &nbsp;tooltip: 'Mesure linéaire'</font><font size=2 face="Verdana">
</font><font size=2 face="sans-serif"><br>
 &nbsp; &nbsp;});</font><font size=2 face="Verdana"> </font><font size=2 face="sans-serif"><br>
 &nbsp; &nbsp;toolbar.push(action); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp;</font><font size=2 face="Verdana"> <br>
</font><font size=2 face="sans-serif"><br>
Thanks for your help,</font><font size=2 face="Verdana"> </font><font size=2 face="sans-serif"><br>
Steve</font><font size=2 face="Verdana"> </font><font size=2 face="sans-serif"><br>
</font><font size=3 color=#0066ff face="Verdana"><i><br>
Steve Toutant, M. Sc.</i></font><font size=3 face="Verdana"><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 Tél.: (418) 650-5115 #5281<br>
Fax.: (418) 654-3144</font><font size=2 color=blue face="Verdana"><u><br>
</u></font><a href=mailto:steve.toutant@inspq.qc.ca><font size=3 color=blue face="Verdana"><u>steve.toutant@inspq.qc.ca</u></font></a><font size=2 color=blue face="Verdana"><u><br>
</u></font><a href=http://www.inspq.qc.ca/><font size=3 color=blue face="Verdana"><u>http://www.inspq.qc.ca</u></font></a><font size=2 face="Verdana">
</font><font size=3 face="Verdana"><br>
 &nbsp;</font><font size=2 face="Verdana"><br>
</font>
<br>
<br>
<br>
<br>
<br>
<br>