packages/core/src/lib/directives/map.ts
AgmMap renders a Google Map.
Important note: To be able see a map in the browser, you have to define a height for the
element agm-map
.
```typescript
agm-map {
height: 300px;
}
],
OnChanges
AfterContentInit
OnDestroy
providers |
CircleManager
DataLayerManager
DataLayerManager
FitBoundsService
GoogleMapsAPIWrapper
InfoWindowManager
KmlLayerManager
LayerManager
MarkerManager
PolygonManager
PolylineManager
RectangleManager
|
selector | agm-map |
styles |
.agm-map-container-inner {
width: inherit;
height: inherit;
}
.agm-map-content {
display:none;
}
|
template |
Properties |
|
Methods |
|
Inputs |
|
Outputs |
constructor(_elem: ElementRef, _mapsWrapper: GoogleMapsAPIWrapper, _platformId: Object, _fitBoundsService: FitBoundsService, _zone: NgZone)
|
||||||||||||||||||
Defined in packages/core/src/lib/directives/map.ts:413
|
||||||||||||||||||
Parameters :
|
backgroundColor | |
Type : string
|
|
Defined in packages/core/src/lib/directives/map.ts:247
|
|
Color used for the background of the Map div. This color will be visible when tiles have not yet loaded as the user pans. This option can only be set when the map is initialized. |
clickableIcons | |
Default value : true
|
|
Defined in packages/core/src/lib/directives/map.ts:304
|
|
When false, map icons are not clickable. A map icon represents a point of interest, also known as a POI. By default map icons are clickable. |
controlSize | |
Type : number
|
|
Defined in packages/core/src/lib/directives/map.ts:219
|
|
The control size for the default map controls. Only governs the controls made by the Maps API itself |
disableDefaultUI | |
Default value : false
|
|
Defined in packages/core/src/lib/directives/map.ts:236
|
|
Enables/disables all default UI of the Google map. Please note: When the map is created, this value cannot get updated. |
disableDoubleClickZoom | |
Default value : false
|
|
Defined in packages/core/src/lib/directives/map.ts:230
|
|
Enables/disables zoom and center on double click. Enabled by default. |
draggableCursor | |
Type : string
|
|
Defined in packages/core/src/lib/directives/map.ts:255
|
|
The name or url of the cursor to display when mousing over a draggable map. This property uses the css * cursor attribute to change the icon. As with the css property, you must specify at least one fallback cursor that is not a URL. For example: [draggableCursor]="'url(http://www.example.com/icon.png), auto;'" |
draggingCursor | |
Type : string
|
|
Defined in packages/core/src/lib/directives/map.ts:263
|
|
The name or url of the cursor to display when the map is being dragged. This property uses the css cursor attribute to change the icon. As with the css property, you must specify at least one fallback cursor that is not a URL. For example: [draggingCursor]="'url(http://www.example.com/icon.png), auto;'" |
fitBounds | |
Type : google.maps.LatLngBoundsLiteral | google.maps.LatLngBounds | boolean
|
|
Default value : false
|
|
Defined in packages/core/src/lib/directives/map.ts:288
|
|
Sets the viewport to contain the given bounds.
If this option to |
fitBoundsPadding | |
Type : number | google.maps.Padding
|
|
Defined in packages/core/src/lib/directives/map.ts:293
|
|
Padding amount for the bounds. |
gestureHandling | |
Type : google.maps.GestureHandlingOptions
|
|
Default value : 'auto'
|
|
Defined in packages/core/src/lib/directives/map.ts:322
|
|
This setting controls how gestures on the map are handled. Allowed values:
|
keyboardShortcuts | |
Default value : true
|
|
Defined in packages/core/src/lib/directives/map.ts:269
|
|
If false, prevents the map from being controlled by the keyboard. Keyboard shortcuts are enabled by default. |
latitude | |
Default value : 0
|
|
Defined in packages/core/src/lib/directives/map.ts:197
|
|
The latitude that defines the center of the map. |
longitude | |
Default value : 0
|
|
Defined in packages/core/src/lib/directives/map.ts:192
|
|
The longitude that defines the center of the map. |
mapDraggable | |
Default value : true
|
|
Defined in packages/core/src/lib/directives/map.ts:225
|
|
Enables/disables if map is draggable. |
mapTypeId | |
Default value : 'ROADMAP'
|
|
Defined in packages/core/src/lib/directives/map.ts:298
|
|
The map mapTypeId. Defaults to 'roadmap'. |
maxZoom | |
Type : number
|
|
Defined in packages/core/src/lib/directives/map.ts:214
|
|
The maximal zoom level of the map allowed. When not provided, no restrictions to the zoom level are enforced. |
minZoom | |
Type : number
|
|
Defined in packages/core/src/lib/directives/map.ts:208
|
|
The minimal zoom level of the map allowed. When not provided, no restrictions to the zoom level are enforced. |
restriction | |
Type : google.maps.MapRestriction
|
|
Defined in packages/core/src/lib/directives/map.ts:344
|
|
Options for restricting the bounds of the map. User cannot pan or zoom away from restricted area. |
scrollwheel | |
Default value : true
|
|
Defined in packages/core/src/lib/directives/map.ts:241
|
|
If false, disables scrollwheel zooming on the map. The scrollwheel is enabled by default. |
showDefaultInfoWindow | |
Default value : true
|
|
Defined in packages/core/src/lib/directives/map.ts:312
|
|
A map icon represents a point of interest, also known as a POI. When map icons are clickable by default, an info window is displayed. When this property is set to false, the info window will not be shown but the click event will still fire |
styles | |
Type : google.maps.MapTypeStyle[]
|
|
Default value : []
|
|
Defined in packages/core/src/lib/directives/map.ts:275
|
|
Styles to apply to each of the default map types. Note that for Satellite/Hybrid and Terrain modes, these styles will only apply to labels and geometry. |
tilt | |
Default value : 0
|
|
Defined in packages/core/src/lib/directives/map.ts:338
|
|
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.) |
usePanning | |
Default value : false
|
|
Defined in packages/core/src/lib/directives/map.ts:282
|
|
When true and the latitude and/or longitude values changes, the Google Maps panTo method is used to center the map. See: https://developers.google.com/maps/documentation/javascript/reference#Map |
zoom | |
Default value : 8
|
|
Defined in packages/core/src/lib/directives/map.ts:202
|
|
The zoom level of the map. The default zoom level is 8. |
boundsChange | |
Type : EventEmitter<google.maps.LatLngBounds>
|
|
Defined in packages/core/src/lib/directives/map.ts:385
|
|
This event is fired when the viewport bounds have changed. |
centerChange | |
Type : EventEmitter<google.maps.LatLngLiteral>
|
|
Defined in packages/core/src/lib/directives/map.ts:380
|
|
This event emitter is fired when the map center changes. |
idle | |
Type : EventEmitter<void>
|
|
Defined in packages/core/src/lib/directives/map.ts:395
|
|
This event is fired when the map becomes idle after panning or zooming. |
mapClick | |
Type : EventEmitter<google.maps.MouseEvent | google.maps.IconMouseEvent>
|
|
Defined in packages/core/src/lib/directives/map.ts:363
|
|
This event emitter gets emitted when the user clicks on the map (but not when they click on a marker or infoWindow). |
mapDblClick | |
Type : EventEmitter<google.maps.MouseEvent>
|
|
Defined in packages/core/src/lib/directives/map.ts:375
|
|
This event emitter gets emitted when the user double-clicks on the map (but not when they click on a marker or infoWindow). |
mapReady | |
Type : EventEmitter<any>
|
|
Defined in packages/core/src/lib/directives/map.ts:406
|
|
This event is fired when the google map is fully initialized. You get the google.maps.Map instance as a result of this EventEmitter. |
mapRightClick | |
Type : EventEmitter<google.maps.MouseEvent>
|
|
Defined in packages/core/src/lib/directives/map.ts:369
|
|
This event emitter gets emitted when the user right-clicks on the map (but not when they click on a marker or infoWindow). |
mapTypeIdChange | |
Type : EventEmitter<google.maps.MapTypeId>
|
|
Defined in packages/core/src/lib/directives/map.ts:390
|
|
This event is fired when the mapTypeId property changes. |
tilesLoaded | |
Type : EventEmitter<void>
|
|
Defined in packages/core/src/lib/directives/map.ts:411
|
|
This event is fired when the visible tiles have finished loading. |
zoomChange | |
Type : EventEmitter<number>
|
|
Defined in packages/core/src/lib/directives/map.ts:400
|
|
This event is fired when the zoom level has changed. |
Private _fitBounds |
_fitBounds()
|
Defined in packages/core/src/lib/directives/map.ts:551
|
Returns :
void
|
Private _handleBoundsChange |
_handleBoundsChange()
|
Defined in packages/core/src/lib/directives/map.ts:608
|
Returns :
void
|
_handleControlChange |
_handleControlChange()
|
Defined in packages/core/src/lib/directives/map.ts:669
|
Returns :
void
|
Private _handleIdleEvent |
_handleIdleEvent()
|
Defined in packages/core/src/lib/directives/map.ts:634
|
Returns :
void
|
Private _handleMapCenterChange |
_handleMapCenterChange()
|
Defined in packages/core/src/lib/directives/map.ts:597
|
Returns :
void
|
Private _handleMapMouseEvents |
_handleMapMouseEvents()
|
Defined in packages/core/src/lib/directives/map.ts:647
|
Returns :
void
|
Private _handleMapTypeIdChange |
_handleMapTypeIdChange()
|
Defined in packages/core/src/lib/directives/map.ts:616
|
Returns :
void
|
Private _handleMapZoomChange |
_handleMapZoomChange()
|
Defined in packages/core/src/lib/directives/map.ts:624
|
Returns :
void
|
Private _handleTilesLoadedEvent |
_handleTilesLoadedEvent()
|
Defined in packages/core/src/lib/directives/map.ts:640
|
Returns :
void
|
Private _initMapInstance | ||||||
_initMapInstance(el: HTMLElement)
|
||||||
Defined in packages/core/src/lib/directives/map.ts:435
|
||||||
Parameters :
Returns :
void
|
Private _isLatLngBoundsLiteral | ||||||
_isLatLngBoundsLiteral(bounds: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral)
|
||||||
Defined in packages/core/src/lib/directives/map.ts:593
|
||||||
Parameters :
Returns :
boolean
|
Private _setCenter |
_setCenter()
|
Defined in packages/core/src/lib/directives/map.ts:539
|
Returns :
void
|
_setControls |
_setControls()
|
Defined in packages/core/src/lib/directives/map.ts:674
|
Returns :
void
|
Private _subscribeToFitBoundsUpdates |
_subscribeToFitBoundsUpdates()
|
Defined in packages/core/src/lib/directives/map.ts:569
|
Returns :
void
|
Protected _updateBounds | |||||||||
_updateBounds(bounds: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral, padding?: number | google.maps.Padding)
|
|||||||||
Defined in packages/core/src/lib/directives/map.ts:577
|
|||||||||
Parameters :
Returns :
void
|
Private _updateMapOptionsChanges | ||||||
_updateMapOptionsChanges(changes: SimpleChanges)
|
||||||
Defined in packages/core/src/lib/directives/map.ts:489
|
||||||
Parameters :
Returns :
void
|
Private _updatePosition | ||||||
_updatePosition(changes: SimpleChanges)
|
||||||
Defined in packages/core/src/lib/directives/map.ts:518
|
||||||
Parameters :
Returns :
void
|
ngAfterContentInit |
ngAfterContentInit()
|
Defined in packages/core/src/lib/directives/map.ts:425
|
Returns :
void
|
ngOnChanges | ||||||
ngOnChanges(changes: SimpleChanges)
|
||||||
Defined in packages/core/src/lib/directives/map.ts:484
|
||||||
Parameters :
Returns :
void
|
ngOnDestroy |
ngOnDestroy()
|
Defined in packages/core/src/lib/directives/map.ts:472
|
Returns :
void
|
triggerResize | ||||||||
triggerResize(recenter: boolean)
|
||||||||
Defined in packages/core/src/lib/directives/map.ts:502
|
||||||||
Triggers a resize event on the google map instance. When recenter is true, the of the google map gets called with the current lat/lng values or fitBounds value to recenter the map. Returns a promise that gets resolved after the event was triggered.
Parameters :
Returns :
Promise<void>
|
Private _fitBoundsSubscription |
Type : Subscription
|
Defined in packages/core/src/lib/directives/map.ts:356
|
Private Static _mapOptionsAttributes |
Type : string[]
|
Default value : [
'disableDoubleClickZoom', 'scrollwheel', 'draggable', 'draggableCursor', 'draggingCursor',
'keyboardShortcuts', 'styles', 'zoom', 'minZoom', 'maxZoom', 'mapTypeId', 'clickableIcons',
'gestureHandling', 'tilt', 'restriction',
]
|
Defined in packages/core/src/lib/directives/map.ts:349
|
Map option attributes that can change over time |
Private _observableSubscriptions |
Type : Subscription[]
|
Default value : []
|
Defined in packages/core/src/lib/directives/map.ts:355
|
mapControls |
Type : QueryList<AgmMapControl>
|
Decorators :
@ContentChildren(AgmMapControl)
|
Defined in packages/core/src/lib/directives/map.ts:413
|