Is it possible to Measure the map location with rectangular zoom

7 posts, 1 answers
  1. Vivek
    Vivek avatar
    50 posts
    Member since:
    Jul 2011

    Posted 14 Jul 2011 Link to this post

    Hi Team,

    We are evaluating the telerik map features, we don't find any examples for measure the map.
    Also we are looking for the rectangular zoom for the map.

    is this two  features are  possible in telerik map using openstreetmap. if possible Please provide us some code example so that we can run it and check it the all features.

    Also is it possible to have pinpoints onclick infomration in telerik map using openstreetmap.

    This is very important for us, so please respond ASAP.

    thanks,
    vivek.

  2. Vivek
    Vivek avatar
    50 posts
    Member since:
    Jul 2011

    Posted 18 Jul 2011 Link to this post

    Hi Team,

    Please respond on this.

    thanks,
    Vivek
  3. UI for WPF is Visual Studio 2017 Ready
  4. Vivek
    Vivek avatar
    50 posts
    Member since:
    Jul 2011

    Posted 18 Jul 2011 Link to this post

    Hi Team,

    1) Measure the openstreemap --> by mouse click you will create tow points, and then on mouse release it should show the distance.

    2) Rectangular zoom --> means you will choose some location, suppose you choose Finland and then you will create a Rectangular area by pressing mouse and on release of the mouse the Finland area should zoom in.

    We are looking for these two feature, Please respond it.

    Thanks,
    Vivek
  5. Answer
    Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 20 Jul 2011 Link to this post

    Hello Vivek,

    1) You can create the LocationRect instance from two locations and then calculate the distance using Width and Height properties. The LocationRect structure calculates these properties according to the DistanceUnit property of applied MapControl. The sample method is below.
    private double GetDistance(Location location1, Location location2)
    {
        LocationRect rect = new LocationRect(location1, location2);
        rect.MapControl = this.radMap;
        double distance = Math.Sqrt(rect.Width * rect.Width + rect.Height * rect.Height);
        return distance;
    }

    2) 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!

  6. Vivek
    Vivek avatar
    50 posts
    Member since:
    Jul 2011

    Posted 20 Jul 2011 Link to this post

    Hi Team,

    Please let me know if rectangular zoom is possible or not in telerik map.

    Rectangular zoom --> means you will choose some location, suppose you choose Finland and then you will create a Rectangular area by pressing mouse and on release of the mouse the Finland area should zoom in.

    Thanks,
    Vivek
  7. Vivek
    Vivek avatar
    50 posts
    Member since:
    Jul 2011

    Posted 20 Jul 2011 Link to this post

    Hi Team,

    Somehow your answer not visible. I don't why but I got to know by using view source of the page.

    Thanks rectangular zoom is working now.

    I got how we can calculate the distance between two points, but how we can put two points on the map and check the distance between these two points.

    Please guide in right direction. if you have some sample code please pass over.

    Thanks for the help.
    Vivek.
  8. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 25 Jul 2011 Link to this post

    Hello Vivek,

    I have attached a sample solution which draws a polyline using the MapMouseClick event. The solution calculates the length of the polyline and shows the distance in tooltip.

    All the best,
    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!

Back to Top
UI for WPF is Visual Studio 2017 Ready