tombatossals/angular-openlayers-directive

Option doubleClickZoom :false doesn't exist

Closed this issue · 4 comments

I am trying to remove the zoom when double clicking. Like this post. But when I did: 'interactions:{doubleClickZoom:'false'}'. It didn't work, so I looked around in the directive and couldn't find this option. Could you add it please?

Hey, it actually should already work by passing in a proper configuration object on the ol-defaults property.

<openlayers ol-defaults="vm.mapConfig">
   ...
</openlayers>

And in your controller you have to have something like this:

function MapDirectiveController() {
    var vm = this;
    vm.mapConfig = {
      ...
      interactions: {
         doubleClickZoom: false
      }
    } 
}

That works for me. Feel free to re-open the issue if it still doesn't work for you 😄

angular.extend(self, {
            center: ...,
            markers: ...,
            layers: [..., mapBox],
            defaults: {
                events: {
                    layers: [ 'mousemove', 'click' , 'dblclick'],
                },
                interactions: {
                  mouseWheelZoom: 'true',
                  doubleClickZoom : 'false'
                },
                view: {
                    maxZoom: 20,
                    minZoom: 4
                }
            }
        });
<openlayers ...  ol-defaults="correicoesCtrl.defaults" ...>
	...
</openlayers>

Can you try to pass false as a boolean rather than a string?

Yeap, that did the trick, Thank you :)