How is auto map zoom determined?

Home Forums MapPress Support How is auto map zoom determined?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #15876
    asiantraveltips
    Participant

    Hi Chris, I am using Mappress Pro in a sidebar map widget and I can’t figure out why some maps are zoomed right in while others are not. What determines the zoom level of a map when it’s set to auto?

    For example: http://www.travelnasia.com/thailand/thai-girls-in-pattaya the zoom seems to be around the 10 level while http://www.travelnasia.com/blog/public-toilets-in-bangkok/ seems to be around 8, but both are just using a city level address like “Phuket” and “Bangkok”. Shouldn’t they both zoom to the same level?

    Thanks, Tony

    #15877
    Chris
    Keymaster

    Hi Tony,

    The zoom is calculated automatically by Google using their ‘fitBounds()’ function. That function tries to set the maximum zoom that will still show the region in question. The zoom is based on the rectangular bounds of the region to be shown and the size of the map container.

    Given the same map size, a very small bounds (like a single street) will zoom in close, while a large one (like a country) will zoom further out. I think in your case Pattaya is probably a little smaller than Bangkok.

    There’s one other case as well: for a map of locations without defined bounds, such as a single street address, the default POI Zoom is used from the MapPress settings – but that’s not the case in your examples.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.