diff --git a/src/core/directives/google-map.ts b/src/core/directives/google-map.ts index 36fedcda2..c12841478 100644 --- a/src/core/directives/google-map.ts +++ b/src/core/directives/google-map.ts @@ -38,9 +38,10 @@ import {MarkerManager} from '../services/managers/marker-manager'; selector: 'sebm-google-map', providers: [GoogleMapsAPIWrapper, MarkerManager, InfoWindowManager, CircleManager], inputs: [ - 'longitude', 'latitude', 'zoom', 'disableDoubleClickZoom', 'disableDefaultUI', 'scrollwheel', - 'backgroundColor', 'draggableCursor', 'draggingCursor', 'keyboardShortcuts', 'zoomControl', - 'styles', 'usePanning', 'streetViewControl', 'fitBounds', 'scaleControl' + 'longitude', 'latitude', 'zoom', 'draggable: mapDraggable', 'disableDoubleClickZoom', + 'disableDefaultUI', 'scrollwheel', 'backgroundColor', 'draggableCursor', 'draggingCursor', + 'keyboardShortcuts', 'zoomControl', 'styles', 'usePanning', 'streetViewControl', 'fitBounds', + 'scaleControl' ], outputs: [ 'mapClick', 'mapRightClick', 'mapDblClick', 'centerChange', 'idle', 'boundsChange', 'zoomChange' @@ -78,6 +79,11 @@ export class SebmGoogleMap implements OnChanges, OnInit { */ zoom: number = 8; + /** + * Enables/disables if map is draggable. + */ + draggable: boolean = true; + /** * Enables/disables zoom and center on double click. Enabled by default. */ @@ -161,7 +167,7 @@ export class SebmGoogleMap implements OnChanges, OnInit { * Map option attributes that can change over time */ private static _mapOptionsAttributes: string[] = [ - 'disableDoubleClickZoom', 'scrollwheel', 'draggableCursor', 'draggingCursor', + 'disableDoubleClickZoom', 'scrollwheel', 'draggable', 'draggableCursor', 'draggingCursor', 'keyboardShortcuts', 'zoomControl', 'styles', 'streetViewControl', 'zoom' ]; @@ -220,6 +226,7 @@ export class SebmGoogleMap implements OnChanges, OnInit { zoom: this.zoom, disableDefaultUI: this.disableDefaultUI, backgroundColor: this.backgroundColor, + draggable: this.draggable, draggableCursor: this.draggableCursor, draggingCursor: this.draggingCursor, keyboardShortcuts: this.keyboardShortcuts, diff --git a/src/core/services/google-maps-types.ts b/src/core/services/google-maps-types.ts index 918839350..fd671e6b2 100644 --- a/src/core/services/google-maps-types.ts +++ b/src/core/services/google-maps-types.ts @@ -123,6 +123,7 @@ export interface MapOptions { disableDoubleClickZoom?: boolean; disableDefaultUI?: boolean; backgroundColor?: string; + draggable?: boolean; draggableCursor?: string; draggingCursor?: string; keyboardShortcuts?: boolean;