magnuse

TiledMapServiceLayer:s with different lods

Discussion created by magnuse on Nov 22, 2012
Hi

Im using two TileMapServiceLayers with different number of levels (8 and 9).

I then want to be able to zoom to the max level individually on the active layer and depending on if the maxlevel is 8 or 9.

My problem is that it seem the lods in the layer is not updated when changing layer.

The first layer loaded get its lods put in the map and the second is ignored.
So if i load the layer1 with 8 lods , and change to layer2 i cant zoom to level9 and if i load layer2 first
when layer1 is active i zoom to level9 and there i dont have any tiles.

I found in the map that there is an instance of TileInfo in map (map.__tileInfo)  that holds the lods and this object is not updated when changing layers.

im changing layers by calling.
layer1.show();
layer2.hide();


Ive managed to get it to work by setting __tileInfo.lods to my active layers infoTile.lods but this seem like a ugly workaround and i dont want to change the internal of map , the instance is named __infoTile for a reason.

Is there a way to trigger the __tileInfo instance to update when changing layers?.


Best regards
Magnus

Outcomes