angular-ui / ui-leaflet

AngularJS directive to embed an interact with maps managed by Leaflet library
http://angular-ui.github.io/ui-leaflet
Other
314 stars 134 forks source link

Center: Allow user provided setView options #104

Open nmccready opened 9 years ago

nmccready commented 9 years ago

From @joeljeske on August 31, 2015 14:21

In the bounds directive, $scope.bounds.options is used as the options for map.fitBounds. This is nice as the user can specify animation options and the like. Center should use a similar way to specify options to map.setView (leaflet docs).

Copied from original issue: tombatossals/angular-leaflet-directive#907

nmccready commented 9 years ago

Why not just use

leafletData.getMap().then(function(map){
  map.setView(whatever);
});

instead?