Hi,
In my project I need to dynamically zoom in or out on a region or country.
e.g. I select a country or some countries of a region, and it gets a close-up of that country or region.
And when I deselect the countries, it zooms out. (Preferably animated).
I was wondering if you could let me know if Kendo GeoJSON Map has this functionality.
Thanks
4 Answers, 1 is accepted
This is possible by using the extent method albeit without the animated transition.
Also, check out the Authoring Maps help article for some general info on working with GeoJSON maps.
I hope this helps.
Regards,
T. Tsonev
Telerik

Thanks for your reply T.
Unfortunately, in my case, in order to use "Extent" or "Map Center Point", I need to get the location of the shapes dynamically.
I need to get the location of the shapes while they are being created. So I can keep them in the json, and by selecting my countries somewhere else on the page (like some checkboxes), it can zoom in to the countries' shapes.
I tried this in Shape Create Event Handler, and assigned that to the center of the map, but it didn't work. It zoomed in to somewhere else.
var bbox = e.shape.bbox();
var center = bbox.center();
The only thing that worked for me to get the location, was Map, itself, Click Event:
click: function(e) { var location = e.location }
But it's not what I need.
Was wondering if you could help me.
Thanks
The location can be found from the bbox center by using the viewToLocation method. You will also need to take account the current surface offset. I created an example that demonstrates centering the map based on a dropdownlist selection.
Regards,
Daniel
Telerik

Thanks a lot Daniel!
It was really helpful.