[OpenLayers-Users] LayerSwitcher - Panel show and disable layerentry - additional

Jan Tappenbeck osm at tappenbeck.net
Sat Aug 21 04:05:12 EDT 2010


Am 20.08.2010 21:40, schrieb Marc Jansen:
> Hi Jan,
>
> looks as if you are still adding two LayerSwitcher Controls:
>
>    1. in the Map-Constructor (new OpenLayers.Map(...))
>    2. and one in line 219 (map.addControl(new
>       OpenLayers.Control.LayerSwitcher());)
>
> I'd suggest getting rid of the second one.
>
> What exactly do you mean by deactivate the checkbox? Adding
> displayInLayerSwitcher : false to a layers options-object will result in
> a layer not being shon in the LayerSwitcher.
>
> Regards,
> Marc
>
>
> Am 20.08.2010 16:37, schrieb Jan Tappenbeck:
>> Am 20.08.2010 15:05, schrieb BMcBride:
>>
>>> OK- So it looks like you have several instances of the LayerSwitcher control
>>> in your code (see lines 46, 62, 219). This is why it does not appear to hide
>>> correctly.  Remove 2 of these controls and you should be all set.
>>>
>>> As for your "layer not defined" error...  I was assuming that you were
>>> trying to hide a layer when the map initially loads.  So if you wanted the
>>> "Hofladen" layer to be initially hidden and unchecked, you would have to set
>>> the layer as a variable and use setVisibility(false);.
>>>
>>>
>>> var hofladen =  new OpenLayers.Layer.PopupMarker("Hofladen", {  ...
>>>
>>> map.addLayer(hofladen);
>>> hofladen.setVisibility(false);
>>>
>>>
>>> -----
>>> Bryan R. McBride, GISP
>>> http://www.bryanmcbride.com  bryanmcbride.com
>>> http://geoserving.net/  geoserving.net
>>>
>> thanks for response.
>>
>> now i kill a double layers switch in
>>
>> http://www.tappenbeck.net/osm/maps/deu/index_new.php?id=1017
>>
>> but when you click "+" only an other layerpanel will show - like a
>> overlay to the other. but i see no possiblity to hide the hole panel again !
>>
>> can you give me more detail because my englisch is not very well and i
>> am a beginner of ol!!
>>
>> this was one question - the other is how to deactive a layer-checkbox in
>> the panel by default ??!?!?
>>
>> can you help me more ??
>>
>> regards Jan :-)
>>
>> _______________________________________________
>> Users mailing list
>> Users at openlayers.org
>> http://openlayers.org/mailman/listinfo/users
>>
>>
>
>
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users


Hi Marc !

ich schreibe mal in Deutsch weiter - das ist für mich etwas einfacher 
und wir verstehen uns dann wohl besser.

Zeile 219 habe ich deaktiviert - dann hat es auch geklappt. Kommt davon 
wenn man einfach Code C&P macht. Nur ist die Reihenfolge jetzt erst 
meine Karte und dann die Hintergrundlayer. Besser wäre natürlich, in 
Anlehnun der Standardausgabe die Reihenfolge zumzukehren. Geht das auch ??

Die zweite Frage bezog sich auf die Layer - die sind normalerweise immer 
per Default aktiv. Ich möchte per Default einen oder mehrere bestimmte 
Layer deaktivieren - quasi per Code den Haken aus dem Layerpanel entfernen.

Gruß aus Lübeck
Jan :-)




More information about the Users mailing list