ThinkGeo.com    |     Documentation    |     Premium Support

How To Select Markers in SimpleMarkerOverlay

I have markers positioned on a map in a SimpleMarkerOverlay. Are there any code examples out there that demonstrate how to select markers, either with a click or any of the editing tools (line, polygon, etc.). My overlay is created programmatically and is not part of the layer list system in the Editor UI.

Thanks.

Hi Michael,

If you click on marker, it will do something for example shows popup follow your code, but I think it don’t contains selected.

I am not sure what’s the scenario to select marker, please let us know that so we can provide some suggestion.

In fact we don’t have other sample for GisEditor because it’s a utility project. If you want to implement some function in it, you can build standalone project with our map, then solve the problem there, after that you can move the code back to GisEditor.

Regards,

Ethan

Let’s forget about the fact that it’s a scenario in the Editor for the purposes of this discussion. That being said, SimpleMarkerOverlay and Marker are classes that are in the ThinkGeo Mapsuite Wpf toolkit.

I would like some assistance, either with sample code or pointers or suggestions, for implementing the ability to select markers the same way that, for example, I would select features on the map interactively. Thanks.

Hi Michael,

Thanks for your update, your question in fact contains two steps.

  1. Find the marker in your clicked position

  2. Make the marker show the “Select” status

The first step please refer this sample:

It get the clicked position and find nearest feature.

The 2nd step need your further information, any screen shots or description so we can know whether it can be implemented.

Regards,

Ethan

Thanks, but this is not quite necessary. Markers are interactive, as such, they have mouse event handlers including a Click event handler. So clicking on a marker will be trapped by a handler in my subclass.

In short, what I am trying to do is locate the code that allows editing tools to be drawn in the map in a selection or highlight layer, still trying to figure this all out. If I can locate that code, I might be able to enhance it to handle my marker layer instead of just the regular feature layers that it seems to be limited to handling.

Do you have any idea where in the MapSuite toolkits I might find code that would allow line or polygon drawing to be done? That would surely speed me on my way.

Thanks anyway for your kind suggestions.

OK, starting to get somewhere. I found references to ExtentInteractiveOverlay and InteractiveOverlay. These are classes that are in the MapSuite packages. I have no source for these classes. I am thinking that the Editor line and polygon selection tools are manipulating information being passed from these classes about where on the screen the user is clicking to create the selections. The Editor classes then use this information to find the features according to the selection mode in force and collect them in other classes.

What I am trying to do is extend these editing tools or subclass them to work with my SimpleMarker overlay and its markers instead of a feature layer and features.

Wish me luck!

Found it. Class of interest is SelectionTrackInteractiveOverlay. Now the WORK begins!

Hi Michael,

That’s so cool, we hadn’t met same requirement before so we don’t tried to find that, thanks for your share!

If you met any problem when you try to implement that please let us know.

Regards,

Ethan