FeatureSourceColumn fsc = new FeatureSourceColumn("name");
wpfMap1.EditOverlay.EditShapesLayer.Open();
wpfMap1.EditOverlay.EditShapesLayer.Columns.Add(fsc);
wpfMap1.EditOverlay.EditShapesLayer.Close();
for(int i=0;i<c3.featrues.count;i++)<>
{
Feature feature = c3.Featrues;
feature.ColumnValues.Add("name", i.ToString());
wpfMap1.EditOverlay.EditShapesLayer.InternalFeatures.Add(feature);
}
wpfMap1.EditOverlay.CanDrag = true;
wpfMap1.EditOverlay.CanReshape = false;
wpfMap1.EditOverlay.CanResize = false;
wpfMap1.EditOverlay.CanRotate = false;
ValueStyle valueStyle = new ValueStyle();
valueStyle.ColumnName = "name";
valueStyle.ValueItems.Add(new ValueItem("0", AreaStyles.Country1));
valueStyle.ValueItems.Add(new ValueItem("1", AreaStyles.Country2));
wpfMap1.EditOverlay.EditShapesLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(valueStyle);
wpfMap1.EditOverlay.EditShapesLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
I want change wpfMap1.EditOverlay.EditShapesLayer. CustomStyles!
Exception :You are trying to use both a default style and the custom styles collection. You may only use one or the other.
</c3.featrues.count;i++)<>
You are trying to use both a default style and the custom styles collection. You may only use one or the other
Hi Zhang,
Try the below codes:
Map1.EditOverlay.EditShapesLayer.InternalFeatures.Add(allfeatures[0]);
Map1.EditOverlay.EditShapesLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle.IsActive = false;
Map1.EditOverlay.EditShapesLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle.IsActive = false;
Map1.EditOverlay.EditShapesLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle.IsActive = false;
Map1.EditOverlay.EditShapesLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.IsActive = false;
Map1.EditOverlay.EditShapesLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(valueStyle);
Map1.EditOverlay.EditShapesLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
Hope it helps.
Thanks,
Johnny
Or you can try this:
ZoomLevelSet zoomset=new ZoomLevelSet();
zoomset.ZoomLevel01.CustomStyles.Add(valueStyle);
zoomset.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
wpfMap1.EditOverlay.EditShapesLayer.ZoomLevelSet= zoomset;
Hi Johnny
it works
Thanks
Hi Zhang,
Good to hear it works.
Regards,
Johnny