GeoJSON Map

5 posts, 1 answers
  1. Negin
    Negin avatar
    15 posts
    Member since:
    Mar 2015

    Posted 27 Apr 2015 Link to this post

    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

  2. T. Tsonev
    Admin
    T. Tsonev avatar
    2770 posts

    Posted 29 Apr 2015 Link to this post

    Hello,

    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
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Negin
    Negin avatar
    15 posts
    Member since:
    Mar 2015

    Posted 17 Jul 2015 in reply to T. Tsonev Link to this post

    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

  5. Answer
    Daniel
    Admin
    Daniel avatar
    2117 posts

    Posted 22 Jul 2015 Link to this post

    Hello,

    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
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  6. Negin
    Negin avatar
    15 posts
    Member since:
    Mar 2015

    Posted 22 Jul 2015 in reply to Daniel Link to this post

    Thanks a lot Daniel!

    It was really helpful.

Back to Top
Kendo UI is VS 2017 Ready