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

Map zoom level

4 Answers 56 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Craig
Top achievements
Rank 1
Craig asked on 23 Oct 2017, 09:00 AM
 I have a report with a Map control on it. Most of the points are within a small distance of each other in one city, but there are also a few random points around the rest of the US. The map by default zooms to show all the points. Is it possible to set it to zoom to a certain level and centre on the highest value points as they are the most interesting to the user?

4 Answers, 1 is accepted

Sort by
0
Ivan Hristov
Telerik team
answered on 24 Oct 2017, 07:00 AM
Hi Craig,

The Map item calculates its zoom level based on its extent, and the extent depends on the points currently displayed. However, you can add some "virtual" points to control the zoom at a desired level. Please refer to this KB article that demonstrates how to implement a solution for such scenario: How to set the Map extent dynamically when showing a single data point.

Regards,
Ivan Hristov
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Craig
Top achievements
Rank 1
answered on 24 Oct 2017, 07:08 AM

Thanks, I did see this. The issue is that the map doesn't contain a single point, it contains many points. So how would I determine which out of the many points is the largest one (highest  For my data is something like this (these are postcodes)

 

48185, US = 126
48111, US = 18
48324, US = 14
48342, US = 3
48348, US = 11
48154, US = 20

0
Craig
Top achievements
Rank 1
answered on 24 Oct 2017, 07:10 AM
Also, I don't have Lon/Lat, I am geocoding dynamically.
0
Ivan Hristov
Telerik team
answered on 25 Oct 2017, 10:10 AM
Hi Craig,

In the KB's example report we used Lat and Long fields for clarity, but in your report you can use the expressions Location.Latitude and Location.Longitude, which will obtain their values from the actual coordinates, returned from the LocationProvider - see the Additional Information section here.

As explained, the Map item sets its extent to show all the points, because, as a data item, it  shows the available data by design. However, you can filter out the points that have a size smaller than a certain value, thus reducing the points in a series. Please note that in this case you shouldn't use ConditionalFormatting to change the point's visibility, because even the invisible points are included in the map extent. Since the point's size is probably bound to a data field, you need to add a filter rule based on that field, i.e. =Fields.US > 15, which in your case will show only the postcodes 48185, 48111 and 48154.

Hope it helps.

Regards,
Ivan Hristov
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Craig
Top achievements
Rank 1
Answers by
Ivan Hristov
Telerik team
Craig
Top achievements
Rank 1
Share this question
or