Select to view content in your preferred language

Opening a cache and map extent changed event

613
1
11-23-2010 07:32 AM
RobertMEIER
Regular Contributor
Can someone confirm what I am seeing; that the map extent changed event fires whenever you call the open event on a map cache? This is a pain in the butt! I am trying to add raster caches to my map when the scale is at a certain point using the extent changed event.

I create the map cache object, set the storage path, add it to the map datasources collecton and then call the open event on it, this seems to trigger the extent changed event, which then tries to add the same map cache again.

I am codeing around this by checking if the cache is already in the datasources collection, but i am annoyed by this extra work.

Any ideas to aid in this would be helpful.

Thanks!

-bert
0 Kudos
1 Reply
AkhilParujanwala
Regular Contributor
I think I may have 3 possible solutions:

1) Using ArcMap create your service with all your layers and your raster layers and set the zooms/extents at which they appear.

2) Use the Visible object, if extent = certain number then make raster layers visible. This means that when you open ur application and click load layers, it will load all layers. Then just program in what layers you want to be visible and invisible.

3) If extent = certain number, set your storage path to where you raster cache layers are, and then map1.MapLayers.AddRange(rasterCache).

Something to that effect.

I hope this helps in some way.


Thanks,

Akhil P.
0 Kudos