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

Is it possible to Measure the map location with rectangular zoom

6 Answers 151 Views
Map
This is a migrated thread and some comments may be shown as answers.
Vivek
Top achievements
Rank 1
Vivek asked on 14 Jul 2011, 05:20 PM
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.

6 Answers, 1 is accepted

Sort by
0
Vivek
Top achievements
Rank 1
answered on 18 Jul 2011, 04:57 PM
Hi Team,

Please respond on this.

thanks,
Vivek
0
Vivek
Top achievements
Rank 1
answered on 18 Jul 2011, 05:01 PM
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
0
Accepted
Andrey
Telerik team
answered on 20 Jul 2011, 11:04 AM
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!

0
Vivek
Top achievements
Rank 1
answered on 20 Jul 2011, 02:27 PM
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
0
Vivek
Top achievements
Rank 1
answered on 20 Jul 2011, 04:09 PM
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.
0
Andrey
Telerik team
answered on 25 Jul 2011, 02:39 PM
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!

Tags
Map
Asked by
Vivek
Top achievements
Rank 1
Answers by
Vivek
Top achievements
Rank 1
Andrey
Telerik team
Share this question
or