[ka-Map-users] Changing map layer dinamically

Damiano Morosi damiano.morosi at atac.roma.it
Fri Nov 24 03:56:27 EST 2006


Thank you Ravi, your function suit my needs perfectly (with some
adjustments of course!)

Damiano

Ravi ha scritto:
> 
> 
> Hi Damiano, I am already doing this. Here is some of my code, hope that
> helps.
> 
> function showLayer(layerName) {
> 
> var allLayers = myKaMap.getCurrentMap().getAllLayers();
> 
> for (var i=0; i<allLayers.length; i++) {
>    if(allLayers[i].name == layerName) {
>      myKaMap.setLayerVisibility( allLayers[i].name, true );
>      // allLayers[i].setVisibility(true) // this has some bug
>    } else {
>      myKaMap.setLayerVisibility( allLayers[i].name, false );
>      // allLayers[i].setVisibility(false) // this has some bug
>    }
> }
> 
> Also, you can set a layer on/off using
>    allLayers[i].setVisibility(booleanValue)
> but somehow that API was not working very well. Sometimes it will
> display a layer, sometimes it will not.
> 
> - Ravi
> 
> 
> Damiano Morosi wrote:
>> Hi,
>>
>> I would like to change the layer in my kaMap by clicking on a link or
>> selecting a voice in a combobox.
>> Is there some javascript API to do such thing without too much reverse
>> engineering of ka-map?
>> Thanks,
>>
>> Damiano
> 


More information about the ka-Map-users mailing list