Skip to content

Commit

Permalink
feat(SebmGoogleMap): support streetViewControl opt
Browse files Browse the repository at this point in the history
Closes #418
Closes #438
  • Loading branch information
sebholstein committed Jun 16, 2016
1 parent c358f3d commit e7426c5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/core/directives/google-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {MarkerManager} from '../services/marker-manager';
*
* ### Example
* ```typescript
* import {Component} from 'angular2/core';
* import {Component} from '@angular/core';
* import {SebmGoogleMap} from 'angular2-google-maps/core';
*
* @Component({
Expand All @@ -39,7 +39,7 @@ import {MarkerManager} from '../services/marker-manager';
inputs: [
'longitude', 'latitude', 'zoom', 'disableDoubleClickZoom', 'disableDefaultUI', 'scrollwheel',
'backgroundColor', 'draggableCursor', 'draggingCursor', 'keyboardShortcuts', 'zoomControl',
'styles', 'usePanning'
'styles', 'usePanning', 'streetViewControl'
],
outputs: ['mapClick', 'mapRightClick', 'mapDblClick', 'centerChange', 'idle'],
host: {'[class.sebm-google-map-container]': 'true'},
Expand Down Expand Up @@ -138,12 +138,19 @@ export class SebmGoogleMap implements OnChanges,
*/
usePanning: boolean = false;

/**
* The initial enabled/disabled state of the Street View Pegman control.
* This control is part of the default UI, and should be set to false when displaying a map type
* on which the Street View road overlay should not appear (e.g. a non-Earth map type).
*/
streetViewControl: boolean = true;

/**
* Map option attributes that can change over time
*/
private static _mapOptionsAttributes: string[] = [
'disableDoubleClickZoom', 'scrollwheel', 'draggableCursor', 'draggingCursor',
'keyboardShortcuts', 'zoomControl', 'styles'
'keyboardShortcuts', 'zoomControl', 'styles', 'streetViewControl'
];

private _observableSubscriptions: Subscription[] = [];
Expand Down Expand Up @@ -180,6 +187,7 @@ export class SebmGoogleMap implements OnChanges,

/** @internal */
ngOnInit() {
// todo: this should be solved with a new component and a viewChild decorator
const container = this._elem.nativeElement.querySelector('.sebm-google-map-container-inner');
this._initMapInstance(container);
}
Expand All @@ -194,7 +202,8 @@ export class SebmGoogleMap implements OnChanges,
draggingCursor: this.draggingCursor,
keyboardShortcuts: this.keyboardShortcuts,
zoomControl: this.zoomControl,
styles: this.styles
styles: this.styles,
streetViewControl: this.streetViewControl
});
this._handleMapCenterChange();
this._handleMapZoomChange();
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 @@ -64,6 +64,7 @@ export interface MapOptions {
keyboardShortcuts?: boolean;
zoomControl?: boolean;
styles?: MapTypeStyle[];
streetViewControl?: boolean;
}

export interface MapTypeStyle {
Expand Down

0 comments on commit e7426c5

Please sign in to comment.