Nice answer but your code is only good for getting streets and city names like the other guy needed. I want to return markers I create and draw myself. If I wanted to get these kind of map elements there is plenty of examples not only on your samples but also on your foruns.
Let me try to explain again: fist step I create a lot of markers, each with its own position on the map, on a marker overlay. This is a snipet from my code where platLocs is a [n,2] array of positions using DecimalDegree unit:
for (int c = 0; c < platLocs.GetLength(0); c++) {
double fact = 0.05;
lotsOfFeatures[c] = new Feature(platLocs[c,0], platLocs[c,1]);
markerOverlay.Features.Add("lots" + c, lotsOfFeatures[c]);
}
markerOverlay.Click += new EventHandler<markeroverlayclickeventargs>(markerOverlay_Click); </markeroverlayclickeventargs>
<markeroverlayclickeventargs>Map1.CustomOverlays.Add(markerOverlay);
</markeroverlayclickeventargs>
<markeroverlayclickeventargs>As you can see after I added all markers to the overlay I create a event handling for this overlay then I add this overlay to the Map1 object. So far so good, every marker show up on the map and all. The problem is, when I click one of this markers I wanted to get the position it's on, but inside "markerOverlay_Click" function I have no way of getting it.
Now I just tried to use your little function up there. The idea I had was to create a event handler for the Map1 object, then from inside "Map1_Click" function I would be able to retrieve the markerOverlay object and the clicked position and maybe use the "GetFeaturesNearestTo" function from markerOverlay to retrieve the right marker, except InMemoryMarkerOverlay have no "GetFeaturesNearestTo" function right?
Using the HighlightOverlay member of Map1 seems like a option but can I get the exact position of the PointShape Feature from inside a click event?
Do you understand what I'm trying to do here? Is it possible with your suite to do something like that at all?
If I'm not giving you enough info about what I'm trying to do just ask me.
Thanks in advance.</markeroverlayclickeventargs>