Fit Map Bounds to Makers/Elements Automatically?
See original GitHub issueCan we add a Boolean input binding to the SebmGoogleMap
component that automatically fits the map to the aggregate bounds of the markers/shapes/other map elements it contains?
If I’m not mistaken, it’s pretty easy to do in the native Google Maps JS API…you just create a new bounds
, then loop through all the elements on the map and extend the bounds, the finally tell the map object for fit the bounds.
Currently, its a pain to manually update the map bounds every time a marker changes. Thanks.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:14
- Comments:38 (5 by maintainers)
Top Results From Across the Web
Fit Map Bounds to Makers/Elements Automatically? · Issue #781
I need to make the map auto zoom / center based on the map points to be shown. based on the google api...
Read more >leaflet - How to fit bounds after adding multiple markers
I am using this piece of code to display map markers pulled from a MySQL database using leaflet js on an open street...
Read more >Fit map to bounds exactly - leaflet - Stack Overflow
fitBounds (bounds, {padding: [50, 50]}); });. I'm trying to fit a map as precisely as possible to a set of bounds that closely...
Read more >Fit a map to a bounding box | Mapbox GL JS
This example zooms and pans the map so the new visible area of the map fits within the specified geographical bounds.
Read more >Map.fitBounds(), zoom and center after resizing the map
In V2, this was my method for auto-center+zoom a map given a LatLngBounds: autoZoom: function() {. this.map. ... //fit map using map api...
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 FreeTop 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
Top GitHub Comments
+1 😃
I need to bound the map around my marker on load. Here is how I solved that for now :
Any update?