Select to view content in your preferred language

combining cached and dynamic versions of mapservice

943
6
05-08-2010 08:11 AM
JohnCartwright
Occasional Contributor
Hello All,

Probably not strictly a JS API topic, but I'm seeking advice on the best way to handle a particular situation.  We often have a mapservice that is cached down to a particular level and below that level want to use a dynamic version of the mapservice. 

Currently I accommodate this by creating two mapservices using the same mxd and loading them both into the Map - one as a ArcGISDynamicMapServiceLayer and one as a ArcGISTiledMapServiceLayer.  Then, using the JS API, toggle the visibility depending on the zoom level so that only one is ever visible.

This works but seems rather clumsy and requires that I have two mapservices instantiated for each mxd.  I'd hoped that I could simply use the cached mapservice in a ArcGISDynamicMapServiceLayer, but that still doesn't display once I've zoomed in beyond the limits of the cache. I don't want to enable dynamic tile creation to populate the higher zoom levels - both out of performance concerns and control of disk space.

Can anyone suggest an alternative to the approach I'm currently using?  Ideally, I'd like the ArcGISTiledMapServiceLayer to have the option of switching to dynamically generate images once the limits of the cache have been passed.

Thanks!

--john
0 Kudos
6 Replies
MichalGasparovic
New Contributor III
john, have you ever resolved this problem ?
we are in a similar situation, though not exactly the same. I'd love to 'force' the service that is cached to produce dynamic images, so I want it to bypass the cached. can it be done?
thank you.
cheers.m.
0 Kudos
HemingZhu
Occasional Contributor III
Hello All,

Probably not strictly a JS API topic, but I'm seeking advice on the best way to handle a particular situation.  We often have a mapservice that is cached down to a particular level and below that level want to use a dynamic version of the mapservice. 

Currently I accommodate this by creating two mapservices using the same mxd and loading them both into the Map - one as a ArcGISDynamicMapServiceLayer and one as a ArcGISTiledMapServiceLayer.  Then, using the JS API, toggle the visibility depending on the zoom level so that only one is ever visible.

This works but seems rather clumsy and requires that I have two mapservices instantiated for each mxd.  I'd hoped that I could simply use the cached mapservice in a ArcGISDynamicMapServiceLayer, but that still doesn't display once I've zoomed in beyond the limits of the cache. I don't want to enable dynamic tile creation to populate the higher zoom levels - both out of performance concerns and control of disk space.

Can anyone suggest an alternative to the approach I'm currently using?  Ideally, I'd like the ArcGISTiledMapServiceLayer to have the option of switching to dynamically generate images once the limits of the cache have been passed.

Thanks!

--john


You could achieve your goal by setting up different visible scale range for your tiled .mxd and your dynamic .mxd. For example, set your dynamic .mxd display only at the scales beyond your tiled .mxd. So once your cache limit is reached, your dynamic .mxd will automatically display. The only minor issue you have to deal with is how to set up scale slider so that it allows zooming beyond your cache .mxd.
0 Kudos
JeffPace
MVP Alum
We went down this path for a different reason.  We have a very complicated (read "slow") mapservice that is cached, but changes frequently. 

We were trying to just accessed the cached service as dynamic, which kinda worked, but after talking with ESRI technical support, is "highly discouraged"

You best bet is likely two services, one cached and one dynamic, with a custom extent change handler that swaps your layer out based on the LOD.
0 Kudos
MichalGasparovic
New Contributor III
...
We were trying to just accessed the cached service as dynamic, which kinda worked, but after talking with ESRI technical support, is "highly discouraged"
...


jeff, how did you achieve to load the tiled service as dynamic ? was it via js api ? and why didn't esri recommend such an approach?
thx!
0 Kudos
JeffPace
MVP Alum
jeff, how did you achieve to load the tiled service as dynamic ? was it via js api ? and why didn't esri recommend such an approach?
thx!


We just did new ArcGISDynamicMapServiceLayer but gave it the path of a cached url.  If i remember right, it worked in firefox only.
0 Kudos
AxelSchaefer
New Contributor II
1.) You can access a tiled mapservice with the esri.layers.ArcGISDynamicMapServiceLayer but I can't say if it's "highly discouraged". Anyway you can zoom beyond the last cache level and get the (pixelized) image from the cache.

2.) I think it's worth to review your basemap. Although this is a very basic concept, that you already might know: The basemap/operational layers paradigm is the first step to user-acceptance. Check if your basemap is really a basemap and if your operational services contain only the operational ones. I don't know exactly why you need to switch from a cached service to the dynamic version. The only reason I know is that it takes too long or you don't have the disc-space.

But if you really cache your basemap down to the level and the region you're working at and put only the operational layers on top with dynamic services, you're requirement should fit. If you need a very high scale (1:500) you can pre-cache only the region you need (to decrease the needed disc-space). This is the first step and a concept of how to disassemble your layers into different services for different projects.

I know that it depends on the projects and doesn't fit in reality every time. But I hope that helps a bit.
Axel
0 Kudos