@@ -4,8 +4,9 @@ import {Subscription} from 'rxjs';
44import { MouseEvent } from '../map-types' ;
55import { GoogleMapsAPIWrapper } from '../services/google-maps-api-wrapper' ;
66import {
7- FullscreenControlOptions , LatLng , LatLngLiteral , MapTypeControlOptions , MapTypeId , PanControlOptions ,
8- RotateControlOptions , ScaleControlOptions , StreetViewControlOptions , ZoomControlOptions } from '../services/google-maps-types' ;
7+ FullscreenControlOptions , LatLng , LatLngLiteral , MapTypeControlOptions , MapTypeId , PanControlOptions , MapRestriction ,
8+ RotateControlOptions , ScaleControlOptions , StreetViewControlOptions , ZoomControlOptions
9+ } from '../services/google-maps-types' ;
910import { LatLngBounds , LatLngBoundsLiteral , MapTypeStyle } from '../services/google-maps-types' ;
1011import { CircleManager } from '../services/managers/circle-manager' ;
1112import { RectangleManager } from '../services/managers/rectangle-manager' ;
@@ -259,6 +260,11 @@ export class AgmMap implements OnChanges, OnInit, OnDestroy {
259260 */
260261 @Input ( ) gestureHandling : 'cooperative' | 'greedy' | 'none' | 'auto' = 'auto' ;
261262
263+ /**
264+ * Options for restricting the bounds of the map.
265+ * User cannot pan or zoom away from restricted area.
266+ */
267+ @Input ( ) restriction : MapRestriction ;
262268 /**
263269 * Map option attributes that can change over time
264270 */
@@ -268,7 +274,7 @@ export class AgmMap implements OnChanges, OnInit, OnDestroy {
268274 'streetViewControlOptions' , 'zoom' , 'mapTypeControl' , 'mapTypeControlOptions' , 'minZoom' ,
269275 'maxZoom' , 'panControl' , 'panControlOptions' , 'rotateControl' , 'rotateControlOptions' ,
270276 'fullscreenControl' , 'fullscreenControlOptions' , 'scaleControl' , 'scaleControlOptions' ,
271- 'mapTypeId' , 'clickableIcons' , 'gestureHandling'
277+ 'mapTypeId' , 'clickableIcons' , 'gestureHandling' , 'restriction'
272278 ] ;
273279
274280 private _observableSubscriptions : Subscription [ ] = [ ] ;
@@ -363,7 +369,8 @@ export class AgmMap implements OnChanges, OnInit, OnDestroy {
363369 fullscreenControlOptions : this . fullscreenControlOptions ,
364370 mapTypeId : this . mapTypeId ,
365371 clickableIcons : this . clickableIcons ,
366- gestureHandling : this . gestureHandling
372+ gestureHandling : this . gestureHandling ,
373+ restriction : this . restriction ,
367374 } )
368375 . then ( ( ) => this . _mapsWrapper . getNativeMap ( ) )
369376 . then ( map => this . mapReady . emit ( map ) ) ;
0 commit comments