Thanks to your sample I managed to make my area calculation on the server work with the help of proj4 projection. Now I have to make the measure tools work but they are on the client side in javascript so I don't know how to do that, here is my code:
var OnMapCreated = function (map) {
// Gestion des mesures
handleMeasurements = function (feature) {
var units = feature.units;
var measure = feature.measure;
measure = measure.toFixed(3);
if (feature.order == 1) {
html = String.format("Longueur: {0} {1}", measure.toString(), units.toString());
}
else {
html = String.format("Surface: {0} {1}<sup>2<sup>", measure.toString(), units.toString());
}
if (feature.geometry.CLASS_NAME.indexOf('LineString') > -1) {
var length = feature.geometry.components.length;
lonLat = { lon: feature.geometry.components[length - 1].x, lat: feature.geometry.components[length - 1].y };
}
else {
var length = feature.geometry.components[0].components.length;
lonLat = { lon: feature.geometry.components[0].components[length - 2].x, lat: feature.geometry.components[0].components[length - 2].y };
}
var size = new OpenLayers.Size(450, 200);
var popup = new OpenLayers.Popup.FramedCloud('DistancePopup', lonLat, size, html, null, true);
popup.isAlphaImage = true; // fix IE 6.0 problem
this.map.addPopup(popup);
}
}
Can you help please ?