diff --git a/src/core/directives/map.ts b/src/core/directives/map.ts index da2508e1d..3894036f7 100644 --- a/src/core/directives/map.ts +++ b/src/core/directives/map.ts @@ -49,7 +49,7 @@ import {DataLayerManager} from './../services/managers/data-layer-manager'; 'draggingCursor', 'keyboardShortcuts', 'zoomControl', 'zoomControlOptions', 'styles', 'usePanning', 'streetViewControl', 'streetViewControlOptions', 'fitBounds', 'mapTypeControl', 'mapTypeControlOptions', 'panControlOptions', 'rotateControl', 'rotateControlOptions', 'fullscreenControl', 'fullscreenControlOptions', - 'scaleControl', 'scaleControlOptions', 'mapTypeId', 'clickableIcons' + 'scaleControl', 'scaleControlOptions', 'mapTypeId', 'clickableIcons', 'gestureHandling' ], outputs: [ 'mapClick', 'mapRightClick', 'mapDblClick', 'centerChange', 'idle', 'boundsChange', 'zoomChange' @@ -252,6 +252,16 @@ export class AgmMap implements OnChanges, OnInit, OnDestroy { */ clickableIcons: boolean = true; + /** + * This setting controls how gestures on the map are handled. + * Allowed values: + * - 'cooperative' (Two-finger touch gestures pan and zoom the map. One-finger touch gestures are not handled by the map.) + * - 'greedy' (All touch gestures pan or zoom the map.) + * - 'none' (The map cannot be panned or zoomed by user gestures.) + * - 'auto' [default] (Gesture handling is either cooperative or greedy, depending on whether the page is scrollable or not. + */ + gestureHandling: 'cooperative'|'greedy'|'none'|'auto' = 'auto'; + /** * Map option attributes that can change over time */ @@ -261,7 +271,7 @@ export class AgmMap implements OnChanges, OnInit, OnDestroy { 'streetViewControlOptions', 'zoom', 'mapTypeControl', 'mapTypeControlOptions', 'minZoom', 'maxZoom', 'panControl', 'panControlOptions', 'rotateControl', 'rotateControlOptions', 'fullscreenControl', 'fullscreenControlOptions', 'scaleControl', 'scaleControlOptions', - 'mapTypeId', 'clickableIcons' + 'mapTypeId', 'clickableIcons', 'gestureHandling' ]; private _observableSubscriptions: Subscription[] = []; @@ -343,7 +353,8 @@ export class AgmMap implements OnChanges, OnInit, OnDestroy { fullscreenControl: this.fullscreenControl, fullscreenControlOptions: this.fullscreenControlOptions, mapTypeId: this.mapTypeId, - clickableIcons: this.clickableIcons + clickableIcons: this.clickableIcons, + gestureHandling: this.gestureHandling }); // register event listeners diff --git a/src/core/services/google-maps-types.ts b/src/core/services/google-maps-types.ts index 57d01af36..20e3ce045 100644 --- a/src/core/services/google-maps-types.ts +++ b/src/core/services/google-maps-types.ts @@ -148,6 +148,7 @@ export interface MapOptions { fullscreenControlOptions?: FullscreenControlOptions; mapTypeId?: string|MapTypeId; clickableIcons?: boolean; + gestureHandling?: 'cooperative'|'greedy'|'none'|'auto'; } export interface MapTypeStyle {