Hello,
I would like to know how to implement the "CustomColumnFetch" event when using an "InMemoryMarkerOverlay".
thanks a lot!
Hello,
I would like to know how to implement the "CustomColumnFetch" event when using an "InMemoryMarkerOverlay".
thanks a lot!
Hello Jean-marie,
I think it’s as same as other layer,
InMemoryMarkerOverlay i = new InMemoryMarkerOverlay();
i.FeatureSource.CustomColumnFetch +=new EventHandler<CustomColumnFetchEventArgs>(FeatureSource_CustomColumnFetch);
Please see the sample on HowDoIsamples—>Feature Layers—> Add my own custom data to a feature layer to get more details.
Regards,
Gary
Hi,
how do you use ".RequiredColumnNames.Add("xxx");" when using InMemoryMarkerOverlay?
jm.
Hello Jean-marie,
I think this is a bug of InMemoryMarkerOverlay, because the markerstyle is not inherit from style, it didn't include the RequiredColumnNames property.
We will fix that.
For now, there is a workaround:
1) Create a Class Inherit from InMemoryMarkerOverlay. override the GetMarkersCore method, and add a RequiredColumns property to the new Class.
2) With the FeatureSource property in the InMemoryMarkerOverlay, we can create a new InMemoryFeatureLayer, then with his help, we can set the real RequiredColumnNames property.
3) Bind the event as normal, and directly set the column to the new property like InMemoryMarkerOverlay.RequiredColumnNames
Here is some code I have wrote to help you override the GetMarkersCore method, sorry I didn't have enought time to test it, hope it can show your some way.
protected override Collection<Marker> GetMarkersCore(RectangleShape worldExtent, int currentZoomLevelId)
{
Collection<Marker> returnMarkers = new Collection<Marker>();
InMemoryFeatureLayer i = new InMemoryFeatureLayer(FeatureSource.GetColumns(), FeatureSource.GetAllFeatures(ReturningColumnsType.AllColumns));
i.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle.RequiredColumnNames.Add(requiredColumnNames);
MarkerZoomLevel zoomLevel = ZoomLevelSet.GetZoomLevelForDrawing(currentZoomLevelId);
if (zoomLevel != null)
{
i.Open();
returnMarkers = zoomLevel.GetMarkers(i.FeatureSource.GetFeaturesInsideBoundingBox(worldExtent, ReturningColumnsType.AllColumns));
i.Close();
returnMarkers = FilterMarkerWithClusterMarkerStyle(worldExtent, returnMarkers, zoomLevel);
}
return returnMarkers;
}
Sorry for get you in trouble, when we fix this, we will let you know as soon as possible.
Regards,
Gary