ThinkGeo.com    |     Documentation    |     Premium Support

Selection Rectangle Suggestions / Examples

Hi,


I need to implement a rectangle selection feature and I'm looking for some examples.


I've seen and implemented something using the EditInteractiveOverlay in the past, where we explicitly added a rectangular feature, and then the user clicked on either the corners for resize or a rotation helper.  Then, the user needed to do some other explicit action to hide this feature.


What we're more interested in is similar to the zoom box that's seen when the user holds down the shift key.  We want to have a button that puts the user into a selection mode and, when the user clicks on the map and drags with the mouse down, a rectangle appears.  Then when the user lets go of the mouse, some callback is called so that we can go and apply our selection logic.  As you can see, this is very similar to the zoom box feature.


Are there any examples of anything like this?


Thanks,


Greg


 



 


Greg,
 
Thanks for your post.
 
I am not very sure what your requirement is but I found some samples that maybe help you.
 
You are interested in the zoom box which is a rectangle shape, you can track the same shape by using TrackInteractiveOverlay, and you can look at our HowDoI sample “Track and Edit Shapes”.
 
This post is for editing rectangular polygons, you can find sample code in it:
gis.thinkgeo.com/Support/Dis...fault.aspx
 
There is a sample in our Code Community shows how to track zoom in without shift. If you can not compile, please get rid of the reference of WorldMapKitWms.DLL.
code.thinkgeo.com/projects/show/trackzoomwithout
 
Please provide more information for your requirement and we can create more precise sample code for you.
 
Thanks
 
James

Hi James,


That "Track and edit Shapes" example looks exactly like what I need.


Thank you very much!


-Greg



We are glad you found what you were looking for. Any other questions, do not hesitate to let us know. Thank you.