ThinkGeo.com    |     Documentation    |     Premium Support

Google layer drawing world more the one time

Hi


I'm using latest beta 2 build, when the map control is zoom out, the mapcontrol

draw the google layer more times (see attachment)


I was looking at the restriction layer, but i don't want to restrict inside a boundary, but

outside it.


Any body knows how to solve this ?


 


Code for creating the google layer.


  private LayerOverlay SetupGoogleAndWorldLayer(Projection googleProjection)

  {

   string shapeFile = m_shapePath + @"Countries02.shp";

   string googleShapeFile = m_shapePath + @"GoogleCountries02.shp";

   ShapeFileFeatureSource.SaveToProjection(shapeFile, googleShapeFile, googleProjection, OverwriteMode.Overwrite);




   ShapeFileFeatureLayer shapeFileLayer = new ShapeFileFeatureLayer(googleShapeFile);


   shapeFileLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.County2;

   //shapeFileLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = new AreaStyle(new GeoPen(GeoColor.SimpleColors.DarkBlue, 1));

   shapeFileLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

   //string googleCacheDir = Environment.SpecialFolder.ApplicationData

   m_googleLayer = new GoogleMapsLayer(@"xxxxxxx", m_shapePath + "GoogleCache");

   m_googleLayer.MapType = m_googleMapType;

   m_googleLayer.IsVisible = true;

   m_googleLayer.DrawingExceptionMode = DrawingExceptionMode.DrawException;

   LayerOverlay backgroundOverlay = new LayerOverlay();

   backgroundOverlay.Layers.Add(GetLayerName(LayerNameEnum.Google), m_googleLayer);

   backgroundOverlay.Layers.Add(GetLayerName(LayerNameEnum.World), shapeFileLayer);


   return backgroundOverlay;

  }



Lars, 
  
   I think the RestrictionLayer can help you.  On the layer there is a RestrictionMode that allows you to control if the polygons you add are to hide or show.  If you select the ShowZones mode then only the areas within the polygons you set are shown and the rest if blocked out. 
  
             RestrictionLayer restrictionLayer = new RestrictionLayer(); 
             restrictionLayer.RestrictionMode = RestrictionMode.ShowZones; 
  
 David

problem solved, thanks.

Lars, 
  
   No problem, glad I could help. 
  
 David