0

How can I call fitbounds on a map with angular leaflet? I saw a post somehwere to look for the map binding event but couldn't find any sample code.

MonkeyBonkey
  • 46,433
  • 78
  • 254
  • 460

1 Answers1

0

Try to use

angular.module('myModule').controller('MapController', ['$scope', 'leafletData',
    function($scope, leafletData) {
            leafletData.getMap().then(function(map) {
                map.fitBounds(bounds);
            });
    }
]);

and check out Dynamically changing Leaflet map bounds in Angular?

Community
  • 1
  • 1
Marina Zubkova
  • 95
  • 1
  • 2
  • 7