Skip to content

Commit

Permalink
feat(SebmGoogleMap): support draggable map option
Browse files Browse the repository at this point in the history
Closes #556
  • Loading branch information
josx authored and sebholstein committed Aug 12, 2016
1 parent 75f37a6 commit 836078a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/core/directives/google-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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'
];

Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions src/core/services/google-maps-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export interface MapOptions {
disableDoubleClickZoom?: boolean;
disableDefaultUI?: boolean;
backgroundColor?: string;
draggable?: boolean;
draggableCursor?: string;
draggingCursor?: string;
keyboardShortcuts?: boolean;
Expand Down

0 comments on commit 836078a

Please sign in to comment.