majorimi / blazor-components

Components collection and extensions for Blazor applications.
MIT License
327 stars 59 forks source link

How to Update Mapbound when adding more markers #126

Open nssidhu opened 1 year ago

nssidhu commented 1 year ago

Currently i start with some location and center the map for that location. But then, i add some more markers which are far away, i want the map to resize(zoom) so that this newly added markers are visible in the map.

How can i do that ?

usually in javascript it would be something like

 bounds = new google.maps.LatLngBounds();
                    bounds.extend(marker.getPosition());
                     mapNew.fitBounds(bounds); //auto-zoom
                    mapNew.panToBounds(bounds); //auto-center