Skip to content

Commit

Permalink
Enable and disable other types of zoom (double click, touch, box)
Browse files Browse the repository at this point in the history
  • Loading branch information
lopezvoliver committed Aug 21, 2024
1 parent 61cf2ed commit 6e0c2a0
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions python/jupyter_leaflet/src/Map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,30 @@ export class LeafletMapView extends LeafletDOMWidgetView {
this.obj.scrollWheelZoom.disable();
}
});
this.listenTo(this.model, 'change:double_click_zoom', () => {
const doubleClickZoom = this.model.get('double_click_zoom');
if (doubleClickZoom) {
this.obj.doubleClickZoom.enable();
} else {
this.obj.doubleClickZoom.disable();
}
});
this.listenTo(this.model, 'change:touch_zoom', () => {
const touchZoom = this.model.get('touch_zoom');
if (touchZoom) {
this.obj.touchZoom.enable();
} else {
this.obj.touchZoom.disable();
}
});
this.listenTo(this.model, 'change:box_zoom', () => {
const boxZoom = this.model.get('box_zoom');
if (boxZoom) {
this.obj.boxZoom.enable();
} else {
this.obj.boxZoom.disable();
}
});
}

processPhosphorMessage(msg: Message) {
Expand Down

0 comments on commit 6e0c2a0

Please sign in to comment.