ThinkGeo.com    |     Documentation    |     Premium Support

Using Left or Right Ctrl + Left Mouse Click and Dragging to select mulitple objects on the Map

Currently we have a custom EditInteractiveOverlay which allows us to display dragging of multiple features on the map after using Ctrl+ Click to select individual map features and that works fine. However we would like override the Ctrl + Left Mouse Click and Drag which zooms in on the Map to do the same and select multiple features at once. I understand this is tied to ExtentInteractiveOverlay and have looked through several forum posts but most lead to Not Found Errors for the sample source or for a post titled “How to select multiple features on a layer?”. I found some old source that supposedly was an example of how to do this but no longer works in version 12 with WPF nor does it appear to be robust enough

Thanks,
James R.

ThinkGeo has a GIS Editor that can identify all features within a rubber band region. It uses Ctrl-LeftButtonDown-Drag to draw a rectangle and shows (not selects) all features in the region when you let the left button go. I have integrated this feature into my own ThinkGeo editor to rubber band select multiple features using both the Control and Shift keys.

The source code to the GIS Editor can be found here: https://github.com/ThinkGeo/GIS-Editor. Start at GisEditorWpfMapExtension.ShowIdentifyFeaturesWindow() and work your way backwards to see how this editor draws the rubber band region to show all features in the region.

I have attached a sanitized version of my rubber band select using the auto-created MapView.ExtentOverlay and its mouse events.ThinkGeoRubberBandSelect.cs (9.6 KB)

Thanks, @Rick_Heinz1, it’s very kind of you. It’s not easy to see such a professional comment. really appreciated.

hi, @James_Ridley, I’ve uploaded a sample for you. In the sample, we have a MyExtentInteractiveOverlay, which inherits from ExtentInteractiveOverlay, we can override its MouseDownCore and MouseUpCore method to query the features inside the drawn bounding box. Then just replaced the original ExtentInteractiveOverlay with the new one.

MultiSelect.zip (736.4 KB)

Thanks,
Leo

Rick,

Thank you very much. That source was much appreciated and helped a great deal. It has some other source in it that may be of use later.

Thanks again,
James R.

Leo,

Thank you very much this helped tremendously.

James R.

hi, James,

It’s my pleasure. Let me know if you have other questions.

Thanks,
Leo