ui-leaflet
ui-leaflet copied to clipboard
Can't update defaults on the map
I set defaults for map like:
defaults: {
tileLayer: "http://{s}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png",
scrollWheelZoom: false
}
And later I want to update defaults with some other event like click. So I tried something like this:
angular.extend($scope, { defaults: { map: { scrollWheelZoom: true} } });
But nothing happens after I change this. Can somebody help me how to update defaults value?
I am sorry if I am boring but can somebody tell am I doing something wrong here or this could be some bug in directive?
You are initially setting $scope.defaults.scrollWheelZoom but then you are trying to modify $scope.defaults.map.scrollWheelZoom. Choose one definition or the other (I'm not sure off the top of my head which is the correct one) and use it consistently. This may be the source of your issue.