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

Commit 00d26e5

Browse files
committed
feat(SebmGoogleMap): support draggableCursor opt
Closes #234
1 parent bda7ca8 commit 00d26e5

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

src/directives/google-map.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import {MouseEvent} from '../events';
3434
providers: [GoogleMapsAPIWrapper, MarkerManager],
3535
inputs: [
3636
'longitude', 'latitude', 'zoom', 'disableDoubleClickZoom', 'disableDefaultUI', 'scrollwheel',
37-
'backgroundColor'
37+
'backgroundColor', 'draggableCursor'
3838
],
3939
outputs: ['mapClick', 'mapRightClick', 'mapDblClick', 'centerChange'],
4040
host: {'[class.sebm-google-map-container]': 'true'},
@@ -76,10 +76,19 @@ export class SebmGoogleMap implements OnChanges,
7676
*/
7777
backgroundColor: string;
7878

79+
/**
80+
* The name or url of the cursor to display when mousing over a draggable map. This property uses
81+
* the css * cursor attribute to change the icon. As with the css property, you must specify at
82+
* least one fallback * cursor that is not a URL. For example:
83+
* draggableCursor="'url(http://www.example.com/icon.png), auto;'"
84+
*/
85+
draggableCursor: string;
86+
7987
/**
8088
* Map option attributes that can change over time
8189
*/
82-
private static _mapOptionsAttributes: string[] = ['disableDoubleClickZoom', 'scrollwheel'];
90+
private static _mapOptionsAttributes: string[] =
91+
['disableDoubleClickZoom', 'scrollwheel', 'draggableCursor'];
8392

8493
/**
8594
* This event emitter gets emitted when the user clicks on the map (but not when they click on a
@@ -117,7 +126,8 @@ export class SebmGoogleMap implements OnChanges,
117126
center: {lat: this._latitude, lng: this._longitude},
118127
zoom: this._zoom,
119128
disableDefaultUI: this.disableDefaultUI,
120-
backgroundColor: this.backgroundColor
129+
backgroundColor: this.backgroundColor,
130+
draggableCursor: this.draggableCursor
121131
});
122132
this._handleMapCenterChange();
123133
this._handleMapZoomChange();

src/services/google-maps-types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,5 @@ export interface MapOptions {
5959
disableDoubleClickZoom?: boolean;
6060
disableDefaultUI?: boolean;
6161
backgroundColor?: string;
62+
draggableCursor?: string;
6263
}

0 commit comments

Comments
 (0)