Hi,
I'm trying to set the default zoom level. For a reason I don't know, when opening my map, the default zoom level is always at the maximum (20), and I can't set it.
I'm using the GoogleOverlay.
Here is my code:
Map1.MapBackground.BackgroundBrush = new GeoSolidBrush(GeoColor.FromHtml("#E5E3DF"));
Map1.CurrentExtent = new RectangleShape(-125, 72, 50, -46);
Map1.MapUnit = GeographyUnit.Meter;
//Google Map
Map1.MapTools.OverlaySwitcher.Enabled = true;
Map1.MapTools.AnimationPanMapTool.Enabled = true;
//Map1.MapTools.TouchMapTool.Enabled = true;
Map1.MapTools.MouseCoordinate.Enabled = true;
GoogleOverlay googleOverlay = new GoogleOverlay("Google Map");
googleOverlay.GoogleMapType = GoogleMapType.Normal;
//World Layer
ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer(COUNTRY_FILE_PATH);
AreaStyle areaStyle = AreaStyles.CreateSimpleAreaStyle(GeoColor.SimpleColors.Transparent, GeoColor.FromArgb(100, GeoColor.SimpleColors.Green));
worldLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(areaStyle);
//use the projection to keep the shape file working with google map
Proj4Projection proj4 = new Proj4Projection();
proj4.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326);
proj4.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString();
worldLayer.FeatureSource.Projection = proj4;
IEnumerable<PartnerValues> partners = GetPartnersValues();
ValueStyle valueStyle = ColorPartners(partners);
worldLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(valueStyle);
LayerOverlay staticOverlay = new LayerOverlay(STAT_OVERLAY, true, TileType.SingleTile);
staticOverlay.Layers.Add(WORLD_LAYER, worldLayer);
staticOverlay.IsBaseOverlay = false;
Map1.CustomOverlays.Add(googleOverlay);
Map1.CustomOverlays.Add(staticOverlay);