Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(SebmGoogleMap): support streetViewControl opt #438

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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