ThinkGeo.com    |     Documentation    |     Premium Support

Switch between layers

Hi all,


Is it possible to switch between  WorldMapKit and ShapeFileFeatureLayer depending on zoom level?

For example, I want to use ShapeFileFeatureLayer from zoom level 01 till zoom level 07 and from zoom level 08 switch to WorldMapKit or OpenStreetMap.


Thanks in advance, 

Vicky



Vicky,


It is possible to have them switch by adjusting styes on the zoom levels of the shapefile and by adjusting the upper and lower threshold on the WorldMapKitLayer.  Just to be sure are you going to use the WorldMapKitLayer or the Overlay in the desktop edition?  Here is the rough code.




ShapeFileFeatureLayer shapeFileFeatureLayer = new ShapeFileFeatureLayer();
            WorldMapKitLayer worldMapKitLayer = new WorldMapKitLayer();

            worldMapKitLayer.UpperThreshold = shapeFileFeatureLayer.ZoomLevelSet.ZoomLevel08.Scale;
            worldMapKitLayer.LowerThreshold = shapeFileFeatureLayer.ZoomLevelSet.ZoomLevel20.Scale;

            shapeFileFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle.CenterPen.Color = GeoColor.StandardColors.Red;
            shapeFileFeatureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level07;
 


David



Hi David.


Thanks for the answer.  It did the trick.


Vicky



Vicky, 
  
 I’m glad David’s answer did the trick, let us know if you have any other questions. 
  
 Thanks!