Add support for map.fitbounds
See original GitHub issueWhen it is difficult to calculate the correct zoom level to show an specific area of the map, google maps allow the use of Map.fitBounds. It basically needs only the NE and SW coordinates: https://developers.google.com/maps/documentation/javascript/reference/3/map#Map.fitBounds
I have added the support for it in my fork, and I would like to do it in the main branch if approved. My only questions is. Should this be added as a separate function? something like def fit_bounds(self, nelat, nelng, swlat, swlng): or as a different way to initialize the map. That means providing NE and SW instead of center_lat, center_lng, zoom.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Google maps API V3 method fitBounds() - Stack Overflow
While I would like to render a higher level zoom. Like this. enter image description here. I use the method fitBounds() var bounds...
Read more >Add support for map.fitbounds · Issue #77 · gmplot ... - GitHub
I have added the support for it in my fork, and I would like to do it in the main branch if approved....
Read more >Fit a map to a bounding box | Mapbox GL JS
Fit the map to a specific area, regardless of the pixel size of the map. ... fitBounds() pans and zooms the map viewport...
Read more >Maps JavaScript API | Google Developers
Sets the viewport to contain the given bounds. Note: When the map is set to display: none , the fitBounds function reads the...
Read more >Support auto fit bounds for custom components
Angular Google Maps (AGM) has an auto fit bounds feature, that adds all containing components to the bounds of the map: <agm-map [fitBounds]="true"> ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I’ve just merged this into master in #153, you can set it by passing in a bounds literal when creating a
GoogleMapPlotterobject:Right as you said that I found this PR and got it working:
https://github.com/vgm64/gmplot/pull/12/commits/2b5b2d634534dd2b31fc8eae566bffdc22a579d5
However that code in that PR is slightly bugged in that SW is supposed to go first, NE.
Thanks either way though! Appreciate it 😃