Skip to content

Commit

Permalink
feat(AgmMap): add tilt option
Browse files Browse the repository at this point in the history
add a tilt option allowing to tilt the camera 45° on close zooms
  • Loading branch information
Domvel authored and doom777 committed Jun 2, 2019
1 parent 565b6a7 commit 49890c5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
19 changes: 18 additions & 1 deletion packages/core/directives/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,22 @@ export class AgmMap implements OnChanges, OnInit, OnDestroy {
*/
@Input() gestureHandling: 'cooperative'|'greedy'|'none'|'auto' = 'auto';

/**
* Controls the automatic switching behavior for the angle of incidence of
* the map. The only allowed values are 0 and 45. The value 0 causes the map
* to always use a 0° overhead view regardless of the zoom level and
* viewport. The value 45 causes the tilt angle to automatically switch to
* 45 whenever 45° imagery is available for the current zoom level and
* viewport, and switch back to 0 whenever 45° imagery is not available
* (this is the default behavior). 45° imagery is only available for
* satellite and hybrid map types, within some locations, and at some zoom
* levels. Note: getTilt returns the current tilt angle, not the value
* specified by this option. Because getTilt and this option refer to
* different things, do not bind() the tilt property; doing so may yield
* unpredictable effects. (Default of AGM is 0 (disabled). Enable it with value 45.)
*/
@Input() tilt: number = 0;

/**
* Options for restricting the bounds of the map.
* User cannot pan or zoom away from restricted area.
Expand All @@ -274,7 +290,7 @@ export class AgmMap implements OnChanges, OnInit, OnDestroy {
'streetViewControlOptions', 'zoom', 'mapTypeControl', 'mapTypeControlOptions', 'minZoom',
'maxZoom', 'panControl', 'panControlOptions', 'rotateControl', 'rotateControlOptions',
'fullscreenControl', 'fullscreenControlOptions', 'scaleControl', 'scaleControlOptions',
'mapTypeId', 'clickableIcons', 'gestureHandling', 'restriction'
'mapTypeId', 'clickableIcons', 'gestureHandling', 'tilt', 'restriction'
];

private _observableSubscriptions: Subscription[] = [];
Expand Down Expand Up @@ -370,6 +386,7 @@ export class AgmMap implements OnChanges, OnInit, OnDestroy {
mapTypeId: this.mapTypeId,
clickableIcons: this.clickableIcons,
gestureHandling: this.gestureHandling,
tilt: this.tilt,
restriction: this.restriction,
})
.then(() => this._mapsWrapper.getNativeMap())
Expand Down
1 change: 1 addition & 0 deletions packages/core/services/google-maps-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ export interface MapOptions {
mapTypeId?: string|MapTypeId;
clickableIcons?: boolean;
gestureHandling?: 'cooperative'|'greedy'|'none'|'auto';
tilt?: number;
restriction?: MapRestriction;
}

Expand Down

0 comments on commit 49890c5

Please sign in to comment.