Hi,
Try to add geodesic: true as an option.
Is EPSG:2398, the projection defined in the option of the map object?
Steve





Tim Balschmiter <[email protected]>@openlayers.org 
Envoyé par : [email protected]
24/09/2009 02:17 AM

A
[email protected]
cc

Objet
[OpenLayers-Users] measure with 2398








Hello list, i am using the measure-option, but i get wrong  distance, if i 
am using projection 2398.
What can i do to get the right values?!
thanks for helping me
tim
code:

var measureOptions = {
 handlerOptions : {
   style :"default",
 persist :true,
 projection: "EPSG:2398"
}
}
var lineMeasure = new OpenLayers.Control.Measure(
OpenLayers.Handler.Path, measureOptions);
var polygonMeasure = new OpenLayers.Control.Measure(
OpenLayers.Handler.Polygon, measureOptions);

lineMeasure.events.on( {
"measure" :handleDistanceMeasurements,
"measurepartial" :handleDistanceMeasurements
});
polygonMeasure.events.on( {
"measure" :handleAreaMeasurements,
"measurepartial" :handleAreaMeasurements
});

function handleAreaMeasurements(event) {
var units = event.units;
var measure = event.measure;
var element = document.getElementById('messung');
var out = "";
out += "Fläche: " + measure.toFixed(3) + " " + units
+ "<sup>2</sup>";
element.innerHTML = out;
}
function handleDistanceMeasurements(event) {
          var units = event.units;
var measure = event.measure;
var element = document.getElementById('messung');
var out = "";
out += "Distanz: " + measure.toFixed(3) + " " + units;
element.innerHTML = out;
};_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users



_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to