Draw geozome on map

5 posts, 0 answers
  1. sharp
    sharp avatar
    27 posts
    Member since:
    Feb 2011

    Posted 21 Jul 2011 Link to this post

    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.
  2. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 26 Jul 2011 Link to this post

    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!

  3. DevCraft banner
  4. Mrn
    Mrn avatar
    29 posts
    Member since:
    Apr 2011

    Posted 16 Aug 2011 Link to this post

    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!
  5. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 19 Aug 2011 Link to this post

    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 >>

  6. Mrn
    Mrn avatar
    29 posts
    Member since:
    Apr 2011

    Posted 23 Aug 2011 Link to this post

    Thanks!
Back to Top
DevCraft banner