Hello Lishan,
Thanks for your post, I think there is a solution.
You can use the Inmemoryfeaturelayer simulate the marker, that will improve the speed, and if you need any event on click the vehicles, you can use InmemoryFeatureLayer + Click event to make this.
First create the InMemoryFeatureLayer and set it's default pointshape style as same as your marker image.
private void DisplayMap_Load(object sender, EventArgs e)
{
winformsMap1.MapUnit = GeographyUnit.DecimalDegree;
winformsMap1.CurrentExtent = new RectangleShape(-155.733, 95.60, 104.42, -81.9);
WorldMapKitWmsDesktopOverlay worldMapKitOverlay = new WorldMapKitWmsDesktopOverlay();
winformsMap1.Overlays.Add(worldMapKitOverlay);
InMemoryFeatureLayer inmemoryFeatureLayer = new InMemoryFeatureLayer();
inmemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = new PointStyle(new GeoImage(Properties.Resources.AQUA));
inmemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
LayerOverlay markerOverlay = new LayerOverlay();
markerOverlay.Layers.Add(inmemoryFeatureLayer);
winformsMap1.Overlays.Add("MarkerOverlay", markerOverlay);
winformsMap1.Refresh();
}
Then, the Click event to help you find the marker and do something.
private void winformsMap1_MapClick(object sender, MapClickWinformsMapEventArgs e)
{
LayerOverlay markerOverlay = (LayerOverlay)winformsMap1.Overlays["MarkerOverlay"];
InMemoryFeatureLayer inmemoryFeatureLayer = markerOverlay.Layers[0] as InMemoryFeatureLayer;
inmemoryFeatureLayer.InternalFeatures.Clear();
MultipolygonShape buffer = e.WorldLocation.Buffer(350, GeographyUnit.DecimalDegree, DistanceUnit.Kilometer);
Collection<Feature> clickedMarker = inmemoryFeatureLayer.QueryTools.GetFeaturesWithin(buffer, ReturningColumnsType.NoColumns);
if (clickedMarker.Count > 0)
{
Collection<Feature> features = winformsMap1.FindFeatureLayer("WorldLayer").FeatureSource.GetFeaturesNearestTo(new PointShape(e.WorldLocation.X, e.WorldLocation.Y), GeographyUnit.DecimalDegree, 10, ReturningColumnsType.AllColumns);
//do anything you want to do, like hight it, change the color, show some tooltip.
}
winformsMap1.Refresh();
}
I hope that can be help, please feel free to let us know if you meet problems.
Regards,
Gary