Skip to content

Commit

Permalink
feat(SebmGoogleMap): support disableDefaultUI MapOption
Browse files Browse the repository at this point in the history
closes #103
  • Loading branch information
sebholstein committed Feb 7, 2016
1 parent dd02353 commit a6c14e5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/directives/google-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import {LatLng, LatLngLiteral} from '../services/google-maps-types';
}
`
],
inputs: ['longitude', 'latitude', 'zoom', 'disableDoubleClickZoom'],
inputs: ['longitude', 'latitude', 'zoom', 'disableDoubleClickZoom', 'disableDefaultUI'],
outputs: ['mapClick', 'mapRightClick', 'mapDblClick'],
template: `
<div class="sebm-google-map-container-inner"></div>
Expand All @@ -64,6 +64,15 @@ export class SebmGoogleMap implements OnChanges,
*/
disableDoubleClickZoom: boolean = false;

/**
* Enables/disables all default UI of the Google map. Please note: When the map is created, this
* value cannot get updated.
*/
disableDefaultUI: boolean = false;

/**
* Map option attributes that can change over time
*/
private static _mapOptionsAttributes: string[] = ['disableDoubleClickZoom'];

/**
Expand Down Expand Up @@ -96,8 +105,11 @@ export class SebmGoogleMap implements OnChanges,
}

private _initMapInstance(el: HTMLElement) {
this._mapsWrapper.createMap(
el, {center: {lat: this._latitude, lng: this._longitude}, zoom: this._zoom});
this._mapsWrapper.createMap(el, {
center: {lat: this._latitude, lng: this._longitude},
zoom: this._zoom,
disableDefaultUI: this.disableDefaultUI
});
this._handleMapCenterChange();
this._handleMapZoomChange();
this._handleMapMouseEvents();
Expand Down
1 change: 1 addition & 0 deletions src/services/google-maps-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,5 @@ export interface MapOptions {
center?: LatLng | LatLngLiteral;
zoom?: number;
disableDoubleClickZoom?: boolean;
disableDefaultUI?: boolean;
}

0 comments on commit a6c14e5

Please sign in to comment.