Auto zoom function?

2 posts, 0 answers
  1. Nikola
    Nikola avatar
    1 posts
    Member since:
    Oct 2014

    Posted 10 Oct 2014 Link to this post


    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 
  2. T. Tsonev
    T. Tsonev avatar
    2760 posts

    Posted 14 Oct 2014 Link to this post


    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
      [-10.683333, 113.155],   // North West location
      [-39.138889, 153.638889] // South East location


    I hope this helps.

    T. Tsonev
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top