Hello Brad,
Please have a look this code, if you are using marker in InMemoryFeatureLayer, you can use this code directly, if not you still can refer this code to get some idea, the key part is using buffer to get the mouse click area.
private void winformsMap1_MapClick(object sender, MapClickWinformsMapEventArgs e)
{
LayerOverlay markerOverlay = (LayerOverlay)winformsMap1.Overlays["MarkerOverlay"];
InMemoryFeatureLayer inmemoryFeatureLayer = markerOverlay.Layers[0] as InMemoryFeatureLayer;
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("SelectedPOILayer ").FeatureSource.GetFeaturesNearestTo(new PointShape(e.WorldLocation.X, e.WorldLocation.Y), GeographyUnit.DecimalDegree, 10, ReturningColumnsType.AllColumns);
Feature selectedFeature;
foreach (Feature feature in features)
{
if (feature.GetWellKnownType() == WellKnownType.Line || feature.GetWellKnownType() == WellKnownType.Multiline)
{
selectedFeature = feature;
break;
}
}
//selectedFeature is what you want, do anything you want to do, like hight it, change the color, show some tooltip.
}
}
Regards,
Gary