Hi all,<br><br>I'm using spherical and cartesian measurements,<br>Why i'm getting so different results?<br><br><br>Code;<br><br>function calcVincenty(geometry) <br> {<br> var dist = 0;<br> for (var i = 1; i < geometry.components.length; i++) {<br>
var first = geometry.components[i-1];<br> var second = geometry.components[i];<br><br> first_ll = OpenLayers.Layer.SphericalMercator.inverseMercator(first.x, first.y);<br> second_ll = OpenLayers.Layer.SphericalMercator.inverseMercator(second.x, second.y);<br>
<br> dist += OpenLayers.Util.distVincenty(<br> {lon: first_ll.lon, lat: first_ll.lat},<br> {lon: second_ll.lon, lat: second_ll.lat}<br>
);<br> }<br> return dist;<br> }<br><br> function handleMeasurements(event) <br> {<br> var geometry = event.geometry;<br> var units = event.units;<br> var order = event.order;<br>
var measure = event.measure;<br> var element = document.getElementById('output');<br> var out = "";<br> if(order == 1) {<br> out += cartesian + " : " + measure.toFixed(3) + " " + units;<br>
out += "<br />" + spherical + " : " +<br> calcVincenty(geometry).toFixed(3) + " km ";<br> } <br> else <br> {<br> out += area + " : " + measure.toFixed(3) + " " + units + "<sup>2</" + "sup>";<br>
}<br>