How To Get Mobile Recharge API?

How do you get the best zoom level from a Bounds object (api v3)?

  • v2 of the api let you get the best zoom for a Bounds instance. Now there is no api method for it. Instead there is Map.fitBounds which in my case always zooms from the previous bounds. My specific use case is essentially map.fitBounds(map.getBounds()) across two different page hits. The map dimensions remain the same. From my research, I think Map.fitBounds is taking into account a maps controls which cover the map

  • Answer:

    Pretty sure you don't want to call map.fitBounds(map.getBounds()).  Instead you want to pass the bounds object to map.fitBounds() like so.... var bounds = new google.maps.LatLngBounds(); bounds.extend(new google.maps.LatLng(43.09206500, -89.35494200)); bounds.extend(new google.maps.LatLng(43.09300500, -89.35794100)); var map = new google.maps.Map($('#Map').get(0), { zoom: 14, center: bounds.getCenter(), mapTypeId: google.maps.MapTypeId.ROADMAP }); map.fitBounds(bounds);

Brent Theisen at Quora Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.