Skip to content

Commit

Permalink
[Vega] [Map] disable map rotation using right right click / touch rot…
Browse files Browse the repository at this point in the history
…ation gesture (elastic#91996)

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
alexwizp and kibanamachine authored Feb 22, 2021
1 parent bdfa969 commit 5fa9370
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ jest.mock('mapbox-gl', () => ({
getZoom: () => 3,
addControl: jest.fn(),
addLayer: jest.fn(),
dragRotate: {
disable: jest.fn(),
},
touchZoomRotate: {
disableRotation: jest.fn(),
},
})),
MapboxOptions: jest.fn(),
NavigationControl: jest.fn(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@ export class VegaMapView extends VegaBaseView {
if (this.shouldShowZoomControl) {
mapBoxInstance.addControl(new NavigationControl({ showCompass: false }), 'top-left');
}

// disable map rotation using right click + drag
mapBoxInstance.dragRotate.disable();

// disable map rotation using touch rotation gesture
mapBoxInstance.touchZoomRotate.disableRotation();
}

private initLayers(mapBoxInstance: Map, vegaView: View) {
Expand Down

0 comments on commit 5fa9370

Please sign in to comment.