From 6c72e07f6f3e683fc1e9c4d09515118f865693c9 Mon Sep 17 00:00:00 2001 From: Ramos Date: Sat, 19 Oct 2024 21:18:44 -0700 Subject: [PATCH 1/3] docs(google-maps/map-advanced-marker): README.md added --- src/google-maps/map-advanced-marker/README.md | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/google-maps/map-advanced-marker/README.md diff --git a/src/google-maps/map-advanced-marker/README.md b/src/google-maps/map-advanced-marker/README.md new file mode 100644 index 000000000000..f7497f553951 --- /dev/null +++ b/src/google-maps/map-advanced-marker/README.md @@ -0,0 +1,44 @@ +# MapAdvancedMarker + +The `MapAdvancedMarker` component wraps the [`google.maps.marker.AdvancedMarkerElement` class](https://developers.google.com/maps/documentation/javascript/reference/advanced-markers) from the Google Maps JavaScript API. The `MapAdvancedMarker` component displays a marker on the map when it is a content child of a `GoogleMap` component. Like `GoogleMap`, this component offers an `options` input as well as convenience inputs for `title`, `position`, `content`, `gmpDraggable` and `zIndex`, and supports all `google.maps.marker.AdvancedMarkerElement` events as outputs. + +**Note:** Use of `map-advanced-marker` requires a `google-map` whth a valid `mapId`. + +## Example + +```typescript +// google-map-demo.component.ts +import {Component} from '@angular/core'; +import {GoogleMap, MapAdvancedMarker} from '@angular/google-maps'; + +@Component({ + selector: 'google-map-demo', + templateUrl: 'google-map-demo.html', + imports: [GoogleMap, MapAdvancedMarker], +}) +export class GoogleMapDemo { + center: google.maps.LatLngLiteral = {lat: 24, lng: 12}; + zoom = 4; + advancedMarkerOptions: google.maps.marker.AdvancedMarkerElementOptions = {gmpDraggable: false}; + advancedMarkerPositions: google.maps.LatLngLiteral[] = []; + + addAdvancedMarker(event: google.maps.MapMouseEvent) { + this.advancedMarkerPositions.push(event.latLng.toJSON()); + } +} +``` + +```html + + + @for (position of advancedMarkerPositions; track position) { + + } + +``` From 46eb0f8f6d17ddca679a234394fafe14a9f1ca69 Mon Sep 17 00:00:00 2001 From: K0n4ta13 <148166466+K0n4ta13@users.noreply.github.com> Date: Sat, 19 Oct 2024 22:03:51 -0700 Subject: [PATCH 2/3] Update README.md Removed list of inputs and corrected spelling. --- src/google-maps/map-advanced-marker/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/google-maps/map-advanced-marker/README.md b/src/google-maps/map-advanced-marker/README.md index f7497f553951..870c64d34ce5 100644 --- a/src/google-maps/map-advanced-marker/README.md +++ b/src/google-maps/map-advanced-marker/README.md @@ -1,8 +1,8 @@ # MapAdvancedMarker -The `MapAdvancedMarker` component wraps the [`google.maps.marker.AdvancedMarkerElement` class](https://developers.google.com/maps/documentation/javascript/reference/advanced-markers) from the Google Maps JavaScript API. The `MapAdvancedMarker` component displays a marker on the map when it is a content child of a `GoogleMap` component. Like `GoogleMap`, this component offers an `options` input as well as convenience inputs for `title`, `position`, `content`, `gmpDraggable` and `zIndex`, and supports all `google.maps.marker.AdvancedMarkerElement` events as outputs. +The `MapAdvancedMarker` component wraps the [`google.maps.marker.AdvancedMarkerElement` class](https://developers.google.com/maps/documentation/javascript/reference/advanced-markers) from the Google Maps JavaScript API. The `MapAdvancedMarker` component displays a marker on the map when it is a content child of a `GoogleMap` component. Like `GoogleMap`, this component offers an `options` input and supports all `google.maps.marker.AdvancedMarkerElement` events as outputs. -**Note:** Use of `map-advanced-marker` requires a `google-map` whth a valid `mapId`. +**Note:** Use of `map-advanced-marker` requires a `google-map` with a valid `mapId`. ## Example From cd1c5811e8b05b9e4ccf05530890c0a3e2096177 Mon Sep 17 00:00:00 2001 From: K0n4ta13 <148166466+K0n4ta13@users.noreply.github.com> Date: Sat, 19 Oct 2024 22:09:18 -0700 Subject: [PATCH 3/3] Update README.md --- src/google-maps/map-advanced-marker/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/google-maps/map-advanced-marker/README.md b/src/google-maps/map-advanced-marker/README.md index 870c64d34ce5..4f2177219546 100644 --- a/src/google-maps/map-advanced-marker/README.md +++ b/src/google-maps/map-advanced-marker/README.md @@ -1,6 +1,6 @@ # MapAdvancedMarker -The `MapAdvancedMarker` component wraps the [`google.maps.marker.AdvancedMarkerElement` class](https://developers.google.com/maps/documentation/javascript/reference/advanced-markers) from the Google Maps JavaScript API. The `MapAdvancedMarker` component displays a marker on the map when it is a content child of a `GoogleMap` component. Like `GoogleMap`, this component offers an `options` input and supports all `google.maps.marker.AdvancedMarkerElement` events as outputs. +The `MapAdvancedMarker` component wraps the [`google.maps.marker.AdvancedMarkerElement` class](https://developers.google.com/maps/documentation/javascript/reference/advanced-markers) from the Google Maps JavaScript API. The `MapAdvancedMarker` component displays a marker on the map when it is a content child of a `GoogleMap` component. **Note:** Use of `map-advanced-marker` requires a `google-map` with a valid `mapId`.