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.5 "astatine-armor" (2024-09-20)
cdk
| Commit | Type | Description |
| -- | -- | -- |
| 4cd2152d9 | fix | drag-drop: account for scale when setting free drag position (#29739) |
| fd4085895 | fix | listbox: scroll active option into view when using aria-activedescendant (#29722) |
| 560878a23 | fix | overlay: load structural styles in a cascade layer (#29725) |
| 873eb01e0 | fix | portal: remove ComponentFactoryResolver usages (#27427) |
| be004b89f | fix | tree: resolve maximum call stack error (#29754) |
material
| Commit | Type | Description |
| -- | -- | -- |
| 777d1d295 | fix | chips: increase chip remove touch target size (#29452) |
| 602bef1cd | fix | datepicker: replace labels not pointing to anything (#29755) |
| 60776637e | fix | select: remove incompatible aria-autocomplete attribute (#29645) |
| 0ed5d7d4f | fix | slider: log proper error when slider isn't configured correctly (#29745) |
google-maps
| Commit | Type | Description |
| -- | -- | -- |
| 1bd976c6a | feat | Add support for some mouse events #29741 (#29747) |
material-date-fns-adapter
| Commit | Type | Description |
| -- | -- | -- |
| 234e5e0e8 | feat | add support for date-fns 4 (#29744) |
<!-- CHANGELOG SPLIT MARKER -->
<a name="18.2.4"></a>