[OpenLayers-Users] RE measure with 2398
Steve.Toutant at inspq.qc.ca
Steve.Toutant at inspq.qc.ca
Thu Sep 24 08:41:43 EDT 2009
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 <tb.rostock at googlemail.com>@openlayers.org
Envoyé par : users-bounces at openlayers.org
24/09/2009 02:17 AM
A
Users at openlayers.org
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
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090924/c3ec5204/attachment.html
More information about the Users
mailing list