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

Auto zoom function?

5 Answers 56 Views
Map
This is a migrated thread and some comments may be shown as answers.
Nikola
Top achievements
Rank 1
Nikola asked on 10 Oct 2014, 02:48 PM
Hello,

I was just wondering if there is a way to make the map always show the same extent, regardless
of the size of the <div> element containing it?

Something like an auto zoom function so the map always shows the same area?

Best regards 

5 Answers, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 14 Oct 2014, 11:55 AM
Hi,

The Map extent method can be used as a setter in order to ensure that the given region is visible.
It must be called after the map is initialized, as the initial configuration covers only center and zoom.

For example, check out this snippet:
var aus = new kendo.dataviz.map.Extent(
  [-10.683333, 113.155],   // North West location
  [-39.138889, 153.638889] // South East location
);

$("#map").getKendoMap().extent(aus);



I hope this helps.

Regards,
T. Tsonev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Michael
Top achievements
Rank 1
answered on 04 Nov 2019, 04:08 PM

With the extent method it appears that when it zooms to the extent it is rounding the zoom level. It is really nice that the initial zoom of the map can be in decimal form, can the extent do the same? For example when it zooms from an extent call if it needs to zoom to 4.67 it would instead of rounding to 4.5

version: 2019.3.917

 

0
Viktor Tachev
Telerik team
answered on 06 Nov 2019, 01:30 PM

Hi Michael,

 

Map zoom level can be controlled via the zoom method. However, only whole numbers can be used. If a decimal is entered it will be rounded to the nearest integer. 

 

Regards,
Viktor Tachev
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Michael
Top achievements
Rank 1
answered on 06 Nov 2019, 01:39 PM

Viktor thank you. The issue / recommendation is not the zoom method. What is happening is when I use map.extent to zoom to a bounding box that method is setting the zoom level to a whole number or in some cases 1/2 increments such as 6, 6.5, 7 or 7.5 so you do not get the depth that would be desired. This does not seem to happen when working with markers, but only when doing bounding box with shapes. It would be nice to also allow a padding property to the extent method (This is what Mapbox FitBounds does).

Is there a better way I can achieve my goal?

0
Viktor Tachev
Telerik team
answered on 08 Nov 2019, 12:34 PM

Hello Michael,

 

I am afraid that currently padding is not available for the extent method. Nevertheless, you can submit a feature request in our feedback portal for this. We monitor the feedback portal and based on the votes from customers the requests are considered for implementation.

 

 

Regards,
Viktor Tachev
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Map
Asked by
Nikola
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Michael
Top achievements
Rank 1
Viktor Tachev
Telerik team
Share this question
or