mvindahl/angular-pan-zoom

Option to disable pan/zoom functionality

Opened this issue · 1 comments

CW12 commented

Is there an easy way to disable the pan/zoom functionality? (i.e. I want an "edit mode" button that toggles editMode between true and false, and only want the pan/zoom functionality enabled when editMode is true.

(awesome directive btw!)

Hi CW12, apologies for delayed reply. I don't think it's possible at the moment as configuration is only taken into account during initialization. However, one might argue that it would be very much in the spirit of AngularJS if the configuration were a shared object which could be modified by client code at any time and watched by the directive to make changes reflect. It wouldn't make sense for all properties but it would definitely make sense for an enablement type property.

I don't think I will find the time to implement it but I'll happily approve a PR if you decide to give it a shot. Don't feel obliged to create a general solution; as long as it solves your specific problem and doesn't wreak havoc on existing functionality it'll be a definite improvement.

If you don't have the time either, don't feel any pressure. Either way, thanks for the nice words.