private void WpfMap_Loaded(object sender, RoutedEventArgs e) { InMemoryFeatureLayer inmLayer1 = new InMemoryFeatureLayer(); InMemoryFeatureLayer inmLayer2 = new InMemoryFeatureLayer(); InMemoryFeatureLayer inmLayer3 = new InMemoryFeatureLayer(); InMemoryFeatureLayer inmLayer3Fortextstyle = new InMemoryFeatureLayer(); inmLayer1.Open(); inmLayer2.Open(); inmLayer3.Open(); inmLayer3Fortextstyle.Open(); Feature fatherPolygon = new Feature(new PolygonShape("POLYGON((-0.300699248889195 0.696735382459029,0.488993824757537 0.894846536823366,0.6568379972051 0.245482197518039,-0.300699248889195 0.245482197518039,-0.300699248889195 0.696735382459029))")); fatherPolygon.ColumnValues.Add("father", "FATHER"); Feature child1Polygon = new Feature(new PolygonShape("POLYGON((-0.300699248889195 0.245482197518039,0.6568379972051 0.245482197518039,0.612091980668121 0.418597933628322,0.450472211408916 0.407823282344371,0.387186703764753 0.669219944352871,0.539315010192485 0.700161294812749,0.488993824757537 0.894846536823366,-0.300699248889195 0.696735382459029,-0.300699248889195 0.245482197518039))")); child1Polygon.ColumnValues.Add("child1", "CHILD1"); Feature child2Polygon = new Feature(new PolygonShape("POLYGON((0.539315010192485 0.700161294812749,0.612091980668122 0.41859793362832,0.450472211408916 0.407823282344371,0.387186703764753 0.669219944352871,0.539315010192485 0.700161294812749))")); child2Polygon.ColumnValues.Add("child2", "CHILD2"); inmLayer1.InternalFeatures.Add(child1Polygon); inmLayer1.Columns.Add(new FeatureSourceColumn("child1")); inmLayer1.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(AreaStyles.CreateSimpleAreaStyle(GeoColor.SimpleColors.Transparent, GeoColor.SimpleColors.Red, 2)); TextStyle childTestStyle = new TextStyle("child1", new GeoFont("arial", 10, DrawingFontStyles.Regular), new GeoSolidBrush(GeoColor.SimpleColors.Black)); inmLayer1.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(childTestStyle); inmLayer1.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; inmLayer2.InternalFeatures.Add(child2Polygon); inmLayer2.Columns.Add(new FeatureSourceColumn("child2")); inmLayer2.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(AreaStyles.CreateSimpleAreaStyle(GeoColor.SimpleColors.Transparent, GeoColor.SimpleColors.Blue, 2)); inmLayer2.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(TextStyles.CreateSimpleTextStyle("child2", "Arial", 10, DrawingFontStyles.Regular, GeoColor.SimpleColors.Blue)); inmLayer2.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; inmLayer3.InternalFeatures.Add(fatherPolygon); inmLayer3.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(AreaStyles.CreateSimpleAreaStyle(GeoColor.SimpleColors.Transparent, GeoColor.SimpleColors.Black, 2)); inmLayer3.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; inmLayer3Fortextstyle.InternalFeatures.Add(fatherPolygon); inmLayer3Fortextstyle.Columns.Add(new FeatureSourceColumn("father")); TextStyle fatherTextStyle = new TextStyle("father", new GeoFont("arial", 10, DrawingFontStyles.Regular), new GeoSolidBrush(GeoColor.SimpleColors.Black)); fatherTextStyle.OverlappingRule = LabelOverlappingRule.AllowOverlapping; inmLayer3Fortextstyle.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(fatherTextStyle); inmLayer3Fortextstyle.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; LayerOverlay layerOverlay = new LayerOverlay(); layerOverlay.TileType = TileType.SingleTile; layerOverlay.Layers.Add(inmLayer3Fortextstyle); layerOverlay.Layers.Add(inmLayer1); layerOverlay.Layers.Add(inmLayer2); layerOverlay.Layers.Add(inmLayer3); Map1.MapUnit = GeographyUnit.DecimalDegree; Map1.Overlays.Add(layerOverlay); Map1.CurrentExtent = inmLayer3.GetBoundingBox(); Map1.Refresh(); }