I have a problem related to "ArcGISTiledMapServiceLayer". I have an ArcGISTiledMapServiceLayer map service, which I have added to Map object. This service work as BaseMap. Now I want to add another ArcGISTiledMapServiceLayer map service layer to the same Map object. Before adding the new layer, I just removed the previous tiled map service layer by using method objMap.removeAllLayers()
. But this method only removes the layer not the extent and it create problem when I add a new layer.
So I want to remove completely the ArcGISTiledMapServiceLayer (layer, extent, scale etc.).
I have tried all the below methods
objMap.removeAllLayers();
objMap.removeLayer(objMap.getLayer('myLayerID'));