Hi,
I'm trying to union the two zips. But only one of them is being highlight. Not sure if I'm missing something.
Map1.MapBackground.BackgroundBrush = new GeoSolidBrush(GeoColor.FromHtml("#E5E3DF"));
Map1.CurrentExtent = new RectangleShape(-125, 72, 50, -46);
Map1.MapUnit = GeographyUnit.DecimalDegree;
WorldMapKitWmsWebOverlay worldMapKitOverlay = new WorldMapKitWmsWebOverlay();
Map1.CustomOverlays.Add(worldMapKitOverlay);
ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer(ConfigurationSettings.AppSettings["Default2"] + "\\tl_2010_26_zcta510.shp");
worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.CreateSimpleAreaStyle(GeoColor.SimpleColors.Transparent, GeoColor.FromArgb(100, GeoColor.SimpleColors.Green));
worldLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = new TextStyle("ZCTA5CE10", new GeoFont("Verdana", 7, DrawingFontStyles.Regular), new GeoSolidBrush(GeoColor.StandardColors.LightSlateGray));//TextStyles.County1("NAME");
worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
InMemoryFeatureLayer mapShapeLayer = new InMemoryFeatureLayer();
mapShapeLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = new AreaStyle(new GeoSolidBrush(new GeoColor(50, 100, 100, 200)));
mapShapeLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle.OutlinePen.Color = GeoColor.StandardColors.RoyalBlue;
mapShapeLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
worldLayer.Open();
//Collection<feature> features = worldLayer.QueryTools.GetFeaturesByIds(featureIds, new string[] { "CNTRY_NAME" }); </feature>
Feature features = worldLayer.QueryTools.GetFeaturesByColumnValue("ZCTA5CE10", "49508")[0];
Feature features2 = worldLayer.QueryTools.GetFeaturesByColumnValue("ZCTA5CE10", "49512")[0];
worldLayer.Close();
mapShapeLayer.InternalFeatures.Add("AreaShape1", features);
mapShapeLayer.InternalFeatures.Add("AreaShape2", features2);
LayerOverlay dynamicOverlay = new LayerOverlay();
dynamicOverlay.TileType = TileType.SingleTile;
dynamicOverlay.Layers.Add("InMemoryFeatureLayer", mapShapeLayer);
dynamicOverlay.Layers.Add("worldLayer", worldLayer);
dynamicOverlay.IsBaseOverlay = false;
Map1.CustomOverlays.Add(dynamicOverlay);
if (mapShapeLayer.InternalFeatures.Count > 1)
{
AreaBaseShape targetShape = (AreaBaseShape)mapShapeLayer.InternalFeatures["AreaShape1"].GetShape();
mapShapeLayer.Open();
mapShapeLayer.EditTools.BeginTransaction();
mapShapeLayer.EditTools.Union("AreaShape2", targetShape);
mapShapeLayer.EditTools.Delete("AreaShape1");
mapShapeLayer.EditTools.CommitTransaction();
mapShapeLayer.Close();
mapShapeLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle.FillSolidBrush.Color = GeoColor.FromArgb(100, GeoColor.StandardColors.Blue);
}
((LayerOverlay)Map1.CustomOverlays[1]).Redraw();
001_union.png (45.7 KB)