What is @angular/google-maps?
@angular/google-maps is an Angular package that provides a set of Angular components and services for integrating Google Maps into Angular applications. It allows developers to easily add maps, markers, and other map-related functionalities to their Angular projects.
What are @angular/google-maps's main functionalities?
Displaying a Google Map
This feature allows you to display a basic Google Map in your Angular application. The map's height and width can be customized using the height and width attributes.
{
"template": "<google-map height='400px' width='750px'></google-map>",
"component": "import { Component } from '@angular/core';\n\n@Component({\n selector: 'app-map',\n templateUrl: './map.component.html',\n styleUrls: ['./map.component.css']\n})\nexport class MapComponent {}"
}
Adding Markers to the Map
This feature allows you to add markers to the Google Map. The position of the marker is specified using latitude and longitude coordinates.
{
"template": "<google-map height='400px' width='750px'>\n <map-marker [position]="{lat: 37.421995, lng: -122.084092}"></map-marker>\n</google-map>",
"component": "import { Component } from '@angular/core';\n\n@Component({\n selector: 'app-map',\n templateUrl: './map.component.html',\n styleUrls: ['./map.component.css']\n})\nexport class MapComponent {}"
}
Handling Map Events
This feature allows you to handle events on the Google Map, such as clicks. The example shows how to log the event details when the map is clicked.
{
"template": "<google-map height='400px' width='750px' (mapClick)='onMapClick($event)'></google-map>",
"component": "import { Component } from '@angular/core';\n\n@Component({\n selector: 'app-map',\n templateUrl: './map.component.html',\n styleUrls: ['./map.component.css']\n})\nexport class MapComponent {\n onMapClick(event: google.maps.MapMouseEvent) {\n console.log('Map clicked', event);\n }\n}"
}
Other packages similar to @angular/google-maps
ngx-google-maps
ngx-google-maps is an Angular package that provides components and services for integrating Google Maps into Angular applications. It offers similar functionalities to @angular/google-maps, such as displaying maps and adding markers, but with a different API and additional customization options.
19.0.0-next.2 "bronze-book" (2024-08-28)
Breaking Changes
cdk
-
- The overlay stays are now loaded slightly later than before which can change their specificity. You may have to update any overlay style overrides.
material
-
- The ripples styles are now loaded slightly later than before which can change their specificity. You may have to update any ripple style overrides.
multiple
-
MatButton.ripple
is no longer available.MatCheckbox.ripple
is no longer available.MatChip.ripple
is no longer available.
material
| Commit | Type | Description |
| -- | -- | -- |
| 64ed7ca715 | feat | core: add experimental theme demo (#29636) |
| fcb76d3ed1 | fix | core: add missing system variables (#29624) |
| 855ed49482 | fix | core: avoid having to manually load ripple styles |
| d0e178b75e | fix | core: stop manually instantiating MatRipple directive (#29630) |
| 3bf0e31f77 | fix | schematics: Add the missing neutral tones for the M3 color palettes (#29644) |
| 64cf19ccdb | perf | tooltip: Avoid unneeded calls to clearTimeout (#29643) |
cdk
| Commit | Type | Description |
| -- | -- | -- |
| 2f1fe03ae9 | fix | drag-drop: error if ngDevMode is undefined (#29634) |
| df21d2b091 | fix | overlay: avoid having to manually load structural styles |
| ad18e6d74e | fix | text-field: avoid having to manually load text field styles |
| a6835ef6a7 | fix | tree: avoid breaking change in constructor (#29648) |
| 8b34fb7e8d | fix | tree: capturing focus on load (#29641) |
multiple
| Commit | Type | Description |
| -- | -- | -- |
| a9da72ed15 | fix | consolidate strong focus indicators (#29623) |
| 485bd9923b | fix | stop exposing internal ripple implementation (#29622) |
<!-- CHANGELOG SPLIT MARKER -->
<a name="18.2.2"></a>