Skip to content
This repository was archived by the owner on Jun 23, 2025. It is now read-only.

Commit 836078a

Browse files
josxsebholstein
authored andcommitted
feat(SebmGoogleMap): support draggable map option
Closes #556
1 parent 75f37a6 commit 836078a

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/core/directives/google-map.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ import {MarkerManager} from '../services/managers/marker-manager';
3838
selector: 'sebm-google-map',
3939
providers: [GoogleMapsAPIWrapper, MarkerManager, InfoWindowManager, CircleManager],
4040
inputs: [
41-
'longitude', 'latitude', 'zoom', 'disableDoubleClickZoom', 'disableDefaultUI', 'scrollwheel',
42-
'backgroundColor', 'draggableCursor', 'draggingCursor', 'keyboardShortcuts', 'zoomControl',
43-
'styles', 'usePanning', 'streetViewControl', 'fitBounds', 'scaleControl'
41+
'longitude', 'latitude', 'zoom', 'draggable: mapDraggable', 'disableDoubleClickZoom',
42+
'disableDefaultUI', 'scrollwheel', 'backgroundColor', 'draggableCursor', 'draggingCursor',
43+
'keyboardShortcuts', 'zoomControl', 'styles', 'usePanning', 'streetViewControl', 'fitBounds',
44+
'scaleControl'
4445
],
4546
outputs: [
4647
'mapClick', 'mapRightClick', 'mapDblClick', 'centerChange', 'idle', 'boundsChange', 'zoomChange'
@@ -78,6 +79,11 @@ export class SebmGoogleMap implements OnChanges, OnInit {
7879
*/
7980
zoom: number = 8;
8081

82+
/**
83+
* Enables/disables if map is draggable.
84+
*/
85+
draggable: boolean = true;
86+
8187
/**
8288
* Enables/disables zoom and center on double click. Enabled by default.
8389
*/
@@ -161,7 +167,7 @@ export class SebmGoogleMap implements OnChanges, OnInit {
161167
* Map option attributes that can change over time
162168
*/
163169
private static _mapOptionsAttributes: string[] = [
164-
'disableDoubleClickZoom', 'scrollwheel', 'draggableCursor', 'draggingCursor',
170+
'disableDoubleClickZoom', 'scrollwheel', 'draggable', 'draggableCursor', 'draggingCursor',
165171
'keyboardShortcuts', 'zoomControl', 'styles', 'streetViewControl', 'zoom'
166172
];
167173

@@ -220,6 +226,7 @@ export class SebmGoogleMap implements OnChanges, OnInit {
220226
zoom: this.zoom,
221227
disableDefaultUI: this.disableDefaultUI,
222228
backgroundColor: this.backgroundColor,
229+
draggable: this.draggable,
223230
draggableCursor: this.draggableCursor,
224231
draggingCursor: this.draggingCursor,
225232
keyboardShortcuts: this.keyboardShortcuts,

src/core/services/google-maps-types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ export interface MapOptions {
123123
disableDoubleClickZoom?: boolean;
124124
disableDefaultUI?: boolean;
125125
backgroundColor?: string;
126+
draggable?: boolean;
126127
draggableCursor?: string;
127128
draggingCursor?: string;
128129
keyboardShortcuts?: boolean;

0 commit comments

Comments
 (0)