This is a migrated thread and some comments may be shown as answers.

Draw geozome on map

4 Answers 86 Views
Map
This is a migrated thread and some comments may be shown as answers.
Artem
Top achievements
Rank 1
Artem asked on 21 Jul 2011, 06:08 AM
Hi.
Please tell me can I draw geozome on map use mouse?
For example I press buttom on menu and then I press and hold left mouse buttom on map and start create rectange.When I up mouse buttom I want see rectangle on map, nd when I zoom map I want that this rectangle automatically scale.
Can I do this and how?

Thanks.

4 Answers, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 26 Jul 2011, 12:51 PM
Hello Sharp,

The map control contains the "Box Zoom" feature (Rectangular zoom). By default it is enabled automatically when the user holds down the SHIFT key.
- press and hold down the SHIFT key
- press left mouse button
- drag the mouse cursor
You will see the area which will be used for rectangular zoom when you release a mouse button.

Also the RadMap contains the MouseDragMode property.
The property allows using the following values:
- "None"
- "Drag"
- "Select"

When its value is "Select" then the "Box Zoom" feature is enabled for mouse dragging. You can use it to toggle mouse mode between dragging the map and the "Box Zoom" mode.

Best wishes,
Andrey Murzov
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Mrn
Top achievements
Rank 1
answered on 16 Aug 2011, 02:38 PM
Hello,

I'd like to achieve something similar to the scenario described by sharp, and I've tried the "Box zoom" feature both in "select" and "drag" MouseDragMode values but I also want to keep the rectangle drawn in the map instead of changing the zoom level when the mouse button is released and getting the rectangle disappeared, is it possible?

Thanks!
0
Andrey
Telerik team
answered on 19 Aug 2011, 07:46 AM
Hello Mrn,

The standard behavior of this feature does not allow to keep the rectangle drawn on the map. You should draw the rectangle with a custom code using mouse events.
I have attached a sample solution which draws the rectangle.

I hope this gets you started properly.

Greetings,
Andrey Murzov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
Mrn
Top achievements
Rank 1
answered on 23 Aug 2011, 03:44 PM
Thanks!
Tags
Map
Asked by
Artem
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Mrn
Top achievements
Rank 1
Share this question
or