switch layers on and off with function handleSelectedLayer()

Leonhard Dietze dietze at geoinform.fh-mainz.de
Fri Mar 17 06:25:23 EST 2006


Hi,

I currently have 400 layers in Mapbender. I have
to administrate data over the period of 50 years,
and there are 8 layer per year. I therefore do not
use the Mapbender-checkboxes for switching layers
on and off (within the treeGDE-element), but do
this directly with the handleSelectedLayer()
function (from map.php).

As it takes too long to do a for(..)-Loop with
these 400 Layers and switch them off, I read
all the active layers from the Map-Object
(parent.mb_mapObj[i].layers[0]) and switch only
these off.
This works perfectly in Firefox/Mozilla and
Opera but not always in IE5/IE6/IE7. Sometimes
it works when I insert an alert(), but sometimes
not. Do i have to "refresh" the map-obj somehow?
Does anybody have a clue what to do?

Leo

----------------------------------------------------
Hallo,

ich verwalte mit Mapbender momentan ungefähr
400 Layer. Ich habe Daten über einen Zeitraum
von momentan 50 Jahren und habe für jedes Jahr
8 Layer. Daher verwende ich nicht die Mapbender-
Checkboxen aus dem treeGDE-Element sondern schalte
die Layer direkt mit der Funktion
handleSelectedLayer() (aus der map.php)
ein und aus (um nur jeweils ein Jahr eingeschaltet
zu haben).

Da es aber zu lange dauert, in einer Schleife alle
Layer auszuschalten, lese ich die eingeschalteten
Layer (und auch die Querylayer) aus dem Map-Object
(parent.mb_mapObj[0].layers[0]) aus und übergebe
nur die Unerwünschten der Funktion
handleSelectedLayer(). Das klappt wunderbar im
Firefox und Opera aber beim IE klappt es manchmal,
ein anderes Mal nicht (da bleiben alle Layer an).
Manchmal hilft ein alert(). Muss ich da irgendwie
noch ein refresh machen (dass das Map-Obj neu
geladen wird)? Hat mir jemand einen Tip, was ich
machen kann - oder ob ich einen komplett anderen
Ansatz nehmen sollte?


Gruß von
Leo

* * * * * * * * * * * * * * * * * * * *
Institut i3mainz
Fachhochschule Mainz
Leonhard Dietze
Holzstraße 36
55116 Mainz
Tel.: 06131-2859-686
http://www.hgis-germany.de
dietze at geoinform.fh-mainz.de
* * * * * * * * * * * * * * * * * * * *





More information about the Mapbender_dev mailing list