Remove LayerInfo from TiledMapServiceLayer at run time

558
2
Jump to solution
10-29-2012 03:24 PM
AaronConnolly
Occasional Contributor
Hello,

I'm having an interesting issue with the World Satellite Imagery and Transportation services:

http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer
http://server.arcgisonline.com/ArcGIS/rest/services/Reference/World_Transportation/MapServer

When I overlay the transportation layer over the imagery I get a zoom slider that has 20 levels of detail. The transportation service layer seems to have images for some cities when zoomed all the way in, when the imagery service layer does not. Specifically Lincoln, NE has no imagery at the 1st zoom level (or is it 20th?) but there are street transportation images.

Is it possible to remove a LayerInfo object from a TiledMapServiceLayer object in javascript and thus have the zoom slider work properly and restrict the user from zooming in completely in these areas?

Thanks,
- Aaron
0 Kudos
1 Solution

Accepted Solutions
AndyBurns
Occasional Contributor
Hi

The API always bases the slider and scales available based on the first tiled map service added to the code.

We got around this by setting the best scales that matched all the mapping we had.

You can change this by hard coding levels of detail - http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples/map_customtilelevels.html

I have seen something in another API that actually changes the silder when you switch basemaps but i dont think this functionality is available currently (i might be wrong though but when i looked for it is wasnt about!)

Hope this helps

View solution in original post

0 Kudos
2 Replies
AndyBurns
Occasional Contributor
Hi

The API always bases the slider and scales available based on the first tiled map service added to the code.

We got around this by setting the best scales that matched all the mapping we had.

You can change this by hard coding levels of detail - http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples/map_customtilelevels.html

I have seen something in another API that actually changes the silder when you switch basemaps but i dont think this functionality is available currently (i might be wrong though but when i looked for it is wasnt about!)

Hope this helps
0 Kudos
AaronConnolly
Occasional Contributor
Hey, thanks this works really well! Awesome.
0 Kudos