ui-leaflet icon indicating copy to clipboard operation
ui-leaflet copied to clipboard

Can't update defaults on the map

Open ghost opened this issue 8 years ago • 2 comments

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?

ghost avatar Mar 15 '16 14:03 ghost

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?

ghost avatar Mar 16 '16 20:03 ghost

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.

MattSidor avatar Mar 16 '16 20:03 MattSidor