Hi Khalil
Thank you very much for your reply.
It has worked. But if I have multiple Shapefile Feature Layers loaded, the event does not fire. In the code below, the event does not fire.
protected override MapConfiguration GetMapConfigurationCore(string style, string crs)// Get the paths to the sample data
string path = Directory.GetParent(Directory.GetParent(AppDomain.CurrentDomain.BaseDirectory).FullName).FullName;string worldLayerFilePath = path + "\\SampleData\\Countries02.shp";string stateFilePath = path + "\\SampleData\\STATES.SHP";string citiesFilePath = path + "\\SampleData\\cities_a.shp";// Setup the various shape file layers
worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle =
worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel =
ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer(worldLayerFilePath);AreaStyles.Country1;ApplyUntilZoomLevel.Level20;ShapeFileFeatureLayer statesLayer = new ShapeFileFeatureLayer(stateFilePath);//statesLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = TextStyles.Capital1("Test");
statesLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle =
statesLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle =
statesLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel =
statesLayer.FeatureSource.CustomColumnFetch +=
citiesLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle =
citiesLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle =
citiesLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.HaloPen =
citiesLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel =
citiesLayer.DrawingMarginPercentage = 50;
TextStyles.Country1("STATE_NAME");AreaStyles.CreateSimpleAreaStyle(GeoColor.FromArgb(255, 243, 239, 228), GeoColor.FromArgb(255, 218, 193, 163), 1);ApplyUntilZoomLevel.Level20;new EventHandler<CustomColumnFetchEventArgs>(FeatureSource_CustomColumnFetch);ShapeFileFeatureLayer citiesLayer = new ShapeFileFeatureLayer(citiesFilePath);PointStyles.City3;new TextStyle("AREANAME", new GeoFont("Verdana", 9), new GeoSolidBrush(GeoColor.StandardColors.Black));new GeoPen(GeoColor.StandardColors.White, 2);ApplyUntilZoomLevel.Level20;// Create a MapConfiguration and add the layer to it
mapConfiguration.Layers.Add(
mapConfiguration.Layers.Add(
mapConfiguration.Layers.Add(
}
{
{
e.ColumnValue =
}
}
MapConfiguration mapConfiguration = new MapConfiguration();"WorldLayer", worldLayer);"StatesLayer", statesLayer);"CitiesLayer", citiesLayer);return mapConfiguration;void FeatureSource_CustomColumnFetch(object sender, CustomColumnFetchEventArgs e)if (e.ColumnName == "CNTRY_NAME")string id = e.Id;string columnName = e.ColumnName;"My Country";
Best Regards,
Vincent
{