You don't even need a scale control for that. Just register with "zoomend" 
event of your map object and add the scale to any div element you need.

map.events.register("zoomend", map, function () {
document.getElementById('scale_div').innerHTML = map.getScale().toFixed(0);
});





Von: [email protected] [mailto:[email protected]] Im 
Auftrag von Rahn Hanno (rahn)
Gesendet: Donnerstag, 6. August 2009 08:05
An: [email protected]
Betreff: [OpenLayers-Users] Scale text outside the map

Hello list,

I have another question. Perhaps somebody can help me.
I try to realise a Sclae text. It should be something like this 1:25000. For 
this I use the Scale Control.

var scale = new OpenLayers.Control.Scale({
            div: document.getElementById("kartenElemente")
});

map.addControl(scale);

I want to place the Scaletext outside the map. For this I use the div Option. 
But it doesn't work. Can somebody please help me? Is there a possibility to 
place the control outside the map in an extra div?

Thank you a lot for your help.

Greetings
Hanno Rahn

------------------------------------------
Hanno Rahn, Dipl.-Ing. (FH) Geoinformatik
ZHAW Zürcher Hochschule für Angewandte Wissenschaften Umwelt und Natürliche 
Ressourcen
Fachstelle Geoinformatik
Grüental, Postfach CH-8820 Wädenswil
Tel +41 (0)58 934 5592
Fax +41 (0)58 934 5580
[email protected]

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

Reply via email to