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
  • Loading branch information
alexwizp committed Feb 19, 2021
1 parent bf7fdfc commit 477cf97
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 477cf97

Please sign in to comment.