[OpenLayers-Users] Scale text outside the map
Marc Jansen
jansen at terrestris.de
Thu Aug 6 03:11:33 EDT 2009
Hi Hanno,
you need to pass in two parameters to the constructor of
OpenLayers.Control.Scale:
1. the div
2. the options-object
In your case this should work:
var scale = new OpenLayers.Control.Scale(
document.getElementById("kartenElemente"),
{
// other options
}
);
map.addControl(scale);
Regards,
Marc
Rahn Hanno (rahn) schrieb:
>
> 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
>
> hanno.rahn at zhaw.ch
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
More information about the Users
mailing list