Hi, I would like to select features by drawing rectangle or ellipse with the mouse. I saw “Draw and Edit Shapes” example in
websamples.thinkgeo.com/ examples, but I need that the rectangle would disappear after you select and client would send rectangle dimensions to server where features in the rectangle would be marked, how could I achieve that? Maybe there is something different for such task?
Select features
I think I found the solution, to add the map1.OnClientDrawEnd() event and get the EditOverlay, get the feature bounds and clear that layer, and send bound to server.
One more question would be is it possible to enable map1.OnClientClick() while the draw mode is “map1.SetDrawMode(‘Rectangle’);”? I need to be able to draw rectangle and select one feature on click if rectangle is not drown.
Or can I set “map1.SetDrawMode(‘Rectangle’);” on right mouse key?
Hi Hotter,
We are sorry to say the map click event can’t be handler if the map is under the draw mode. The reason is there is a events chain in the map and if the edit overlay occurs the click event, then the map can’t handler this event any more.
Also, for the right click, sorry again, it’s hard to configure this case.
Regards,
Johnny