[OpenLayers-Users] measure immediate problem
Meine Toonen
meinetoonen at b3partners.nl
Wed Aug 17 06:13:49 EDT 2011
Try removing the comma from this line:
div: document.getElementById("bp"),
Firefox usually does handle this without errors, but IE gives some problems.
Met vriendelijke groet,
Meine Toonen
B3Partners BV
Tel: 030 214 2083
_____
From: tvnc [mailto:tvnc1979 at gmail.com]
To: openlayers-users at lists.osgeo.org
Sent: Wed, 17 Aug 2011 12:08:48 +0200
Subject: [OpenLayers-Users] measure immediate problem
i want to show measured distance on mouse move, but can't get to work. maybe
someone can see mistake
var bot = new OpenLayers.Control.Button({
displayClass: 'olIkonaUdalj',
eventListeners: {
'activate': klikLivo,
'deactivate': brisMarkera},
type: 2
});
var kontr = new OpenLayers.Control.Panel
({
div: document.getElementById("bp"),
//defaultControl: bot
});
kontr.addControls([bot]);
map.addControl(kontr);
function klikLivo(event) {
var crta = new OpenLayers.Control.Measure(OpenLayers.Handler.Path, {persist:
true, immediate: true});
crta.events.on({
"measure": handleMeasurements,
"measurepartial": handleMeasurements
});
map.addControl(crta);
crta.activate();
}
}
function handleMeasurements(event) {
var geometry = event.geometry;
var units = event.units;
var order = event.order;
var measure = event.measure;
var element = document.getElementById('au');
var out = "";
if(order == 1) {
out += "measure: " + measure.toFixed(3) + " " + units;
} else {
out += "measure: " + measure.toFixed(3) + " " + units +
"<sup>2</" + "sup>";
}
element.innerHTML = out;
}
function brisMarkera(){alert("Brišemo markere");}
_______________________________________________
Users mailing list
Users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110817/bd2ad074/attachment.html
More information about the Users
mailing list