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

Commit bda7ca8

Browse files
committed
feat(SebmGoogleMap): support backgroundColor opt
Closes #233
1 parent 82227da commit bda7ca8

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/directives/google-map.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ import {MouseEvent} from '../events';
3333
selector: 'sebm-google-map',
3434
providers: [GoogleMapsAPIWrapper, MarkerManager],
3535
inputs: [
36-
'longitude', 'latitude', 'zoom', 'disableDoubleClickZoom', 'disableDefaultUI', 'scrollwheel'
36+
'longitude', 'latitude', 'zoom', 'disableDoubleClickZoom', 'disableDefaultUI', 'scrollwheel',
37+
'backgroundColor'
3738
],
3839
outputs: ['mapClick', 'mapRightClick', 'mapDblClick', 'centerChange'],
3940
host: {'[class.sebm-google-map-container]': 'true'},
@@ -69,6 +70,12 @@ export class SebmGoogleMap implements OnChanges,
6970
*/
7071
scrollwheel: boolean = true;
7172

73+
/**
74+
* Color used for the background of the Map div. This color will be visible when tiles have not
75+
* yet loaded as the user pans. This option can only be set when the map is initialized.
76+
*/
77+
backgroundColor: string;
78+
7279
/**
7380
* Map option attributes that can change over time
7481
*/
@@ -109,7 +116,8 @@ export class SebmGoogleMap implements OnChanges,
109116
this._mapsWrapper.createMap(el, {
110117
center: {lat: this._latitude, lng: this._longitude},
111118
zoom: this._zoom,
112-
disableDefaultUI: this.disableDefaultUI
119+
disableDefaultUI: this.disableDefaultUI,
120+
backgroundColor: this.backgroundColor
113121
});
114122
this._handleMapCenterChange();
115123
this._handleMapZoomChange();

src/services/google-maps-types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,5 @@ export interface MapOptions {
5858
zoom?: number;
5959
disableDoubleClickZoom?: boolean;
6060
disableDefaultUI?: boolean;
61+
backgroundColor?: string;
6162
}

0 commit comments

Comments
 (0)