private void MapView_Loaded(object sender, RoutedEventArgs e) { mapView.MapUnit = GeographyUnit.Meter; mapView.ZoomLevelSet = new ThinkGeoCloudMapsZoomLevelSet(); mapView.CurrentExtent = new RectangleShape(-19747615, 17926782, -5857338, 1637456); mapView.BackgroundOverlay.BackgroundBrush = new GeoSolidBrush(GeoColors.ShallowOcean); AdministrationShapeFileLayer worldLayer = new AdministrationShapeFileLayer(SampleHelper.Get("Countries02_3857.shp"), SecurityLevel.AverageUsageLevel1); worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyle.CreateSimpleAreaStyle(GeoColor.FromArgb(255, 233, 232, 214), GeoColor.FromArgb(255, 118, 138, 69)); AdministrationShapeFileLayer statesLayer = new AdministrationShapeFileLayer(SampleHelper.Get("USStates_3857.shp"), SecurityLevel.AverageUsageLevel2); statesLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyle.CreateSimpleAreaStyle(GeoColor.FromArgb(255, 233, 232, 214), GeoColor.FromArgb(255, 156, 155, 154), 2); statesLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle.OutlinePen.LineJoin = DrawingLineJoin.Round; statesLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; LayerOverlay worldOverlay = new LayerOverlay(); worldOverlay.Layers.Add("WorldLayer", worldLayer); worldOverlay.Layers.Add("StatesLayer", statesLayer); mapView.Overlays.Add("WorldOverlay", worldOverlay); mapView.Refresh(); }
private void WpfMap_Loaded(object sender, RoutedEventArgs e) { wpfMap1.MapUnit = GeographyUnit.DecimalDegree; wpfMap1.CurrentExtent = new RectangleShape(-177.39584350585937, 83.113876342773437, -52.617362976074219, 14.550546646118164); wpfMap1.BackgroundOverlay.BackgroundBrush = new GeoSolidBrush(GeoColor.GeographicColors.ShallowOcean); AdministrationShapeFileLayer worldLayer = new AdministrationShapeFileLayer(@"..\..\SampleData\Data\Countries02.shp", SecurityLevel.AverageUsageLevel1); worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Country1; AdministrationShapeFileLayer statesLayer = new AdministrationShapeFileLayer(@"..\..\SampleData\Data\USStates.shp", SecurityLevel.AverageUsageLevel2); statesLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.State1; statesLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle.OutlinePen.LineJoin = DrawingLineJoin.Round; statesLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; LayerOverlay worldOverlay = new LayerOverlay(); worldOverlay.TransitionEffect = TransitionEffect.None; worldOverlay.Layers.Add("WorldLayer", worldLayer); worldOverlay.Layers.Add("StatesLayer", statesLayer); wpfMap1.Overlays.Add("WorldOverlay", worldOverlay); wpfMap1.Refresh(); }