I have a map with a circle drawn on it placed in the center of the map. Circle is always present on the map. Radius of the circle is adjustable by the user. On each radius change I am calling fitBounds like this:
leafletData.getMap().then(function(map){
var currentDiameter = L.circle(map.getCenter(), $scope.radius);
map.fitBounds(currentDiameter.getBounds());
});
Sometimes fitBounds moves the center of the map. I have tried recentering the map after each fitBounds call but it is not ideal.
Thanks in advance