From 8767e9874568fe989079a0de063fc0cb42cabced Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Luis=20Di=20Biase?= Date: Tue, 9 Aug 2016 22:40:39 -0300 Subject: [PATCH] feat(SebmGoogleMap): support draggable map option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Luis Di Biase --- src/core/directives/google-map.ts | 14 ++++++++++---- src/core/services/google-maps-types.ts | 1 + 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/core/directives/google-map.ts b/src/core/directives/google-map.ts index 36fedcda2..538e81b2f 100644 --- a/src/core/directives/google-map.ts +++ b/src/core/directives/google-map.ts @@ -38,9 +38,9 @@ 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', 'disableDoubleClickZoom', 'disableDefaultUI', + 'scrollwheel', 'backgroundColor', 'draggableCursor', 'draggingCursor', 'keyboardShortcuts', + 'zoomControl', 'styles', 'usePanning', 'streetViewControl', 'fitBounds', 'scaleControl' ], outputs: [ 'mapClick', 'mapRightClick', 'mapDblClick', 'centerChange', 'idle', 'boundsChange', 'zoomChange' @@ -78,6 +78,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 +166,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 +225,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 aa8473774..a5c065a5d 100644 --- a/src/core/services/google-maps-types.ts +++ b/src/core/services/google-maps-types.ts @@ -121,6 +121,7 @@ export interface MapOptions { disableDoubleClickZoom?: boolean; disableDefaultUI?: boolean; backgroundColor?: string; + draggable?: boolean; draggableCursor?: string; draggingCursor?: string; keyboardShortcuts?: boolean;