msbsmith

Hide cached service and zoom to any scale problem

Discussion created by msbsmith on Dec 14, 2010
Latest reply on Dec 20, 2010 by msbsmith
Hello,

I have a need to zoom to any scale on a dynamic service.  I have 2 services in my JavaScript API, a cached service for background maps and a dynamic service for layers.  By default the zoom scales are defined from the cached service, but I need the user to be able to switch off the cached maps and then zoom to a precise extent unrestricted by the cached service scales.

Essentially I want to be able to hide/remove the cached service and the restrictions imposed by the cached scales, and allow the user to zoom to any given scale on just the dynamic service.

I can remove the cached service using map.removeLayer(myMapServiceLayer); and hide the zoom slider, but the API continues to remember the cached scales and will not allow the user to zoom to an accurate extent, even though they are now only viewing the dynamic service.

Can anyone please offer a method that will hide/remove the cached service and so disable the scale-snapping effect and allow the user to zoom to exactly whatever scale they wish?  I also need to add the cached service back in again, but one thing at a time.

Thank you, Mark.

Outcomes