|
8 | 8 | (mapClick)="handleClick($event)"
|
9 | 9 | (mapMousemove)="handleMove($event)"
|
10 | 10 | (mapRightclick)="handleRightclick()"
|
11 |
| - [mapTypeId]="mapTypeId"> |
| 11 | + [mapTypeId]="mapTypeId" |
| 12 | + [mapId]="mapId"> |
12 | 13 | <map-marker-clusterer [imagePath]="markerClustererImagePath">
|
13 | 14 | <map-marker #firstMarker="mapMarker"
|
14 | 15 | [position]="center"
|
15 |
| - (mapClick)="clickMarker(firstMarker)"></map-marker> |
| 16 | + (mapClick)="infoWindow.open(firstMarker)"></map-marker> |
16 | 17 | @for (markerPosition of markerPositions; track markerPosition) {
|
17 | 18 | <map-marker #marker="mapMarker"
|
18 | 19 | [position]="markerPosition"
|
19 | 20 | [options]="markerOptions"
|
20 |
| - (mapClick)="clickMarker(marker)"></map-marker> |
| 21 | + (mapClick)="infoWindow.open(marker)"></map-marker> |
21 | 22 | }
|
22 | 23 | </map-marker-clusterer>
|
23 | 24 | @if (hasAdvancedMarker) {
|
24 | 25 | <map-advanced-marker
|
25 | 26 | #secondMarker="mapAdvancedMarker"
|
26 |
| - (mapClick)="clickAdvancedMarker(secondMarker)" |
| 27 | + (mapClick)="infoWindow.open(secondMarker)" |
27 | 28 | title="Advanced Marker"
|
28 | 29 | [gmpDraggable]="false"
|
29 |
| - [content]="advancedMarkerContent" |
| 30 | + [content]="hasAdvancedMarkerCustomContent ? advancedMarkerContent : null" |
30 | 31 | [position]="mapAdvancedMarkerPosition">
|
31 | 32 |
|
32 | 33 | <svg #advancedMarkerContent fill="oklch(69.02% .277 332.77)" viewBox="0 0 960 960" width="50px" height="50px" xml:space="preserve">
|
33 | 34 | <g>
|
34 |
| - <polygon points="562.6,109.8 804.1,629.5 829.2,233.1 "/> |
35 |
| - <polygon points="624.9,655.9 334.3,655.9 297.2,745.8 479.6,849.8 662,745.8 "/> |
36 |
| - <polygon points="384.1,539.3 575.2,539.3 479.6,307 "/> |
37 |
| - <polygon points="396.6,109.8 130,233.1 155.1,629.5 "/> |
| 35 | + <polygon points="562.6,109.8 804.1,629.5 829.2,233.1"/> |
| 36 | + <polygon points="624.9,655.9 334.3,655.9 297.2,745.8 479.6,849.8 662,745.8"/> |
| 37 | + <polygon points="384.1,539.3 575.2,539.3 479.6,307"/> |
| 38 | + <polygon points="396.6,109.8 130,233.1 155.1,629.5"/> |
38 | 39 | </g>
|
39 | 40 | </svg>
|
40 | 41 | </map-advanced-marker>
|
41 | 42 | }
|
42 |
| - <map-info-window>Testing 1 2 3</map-info-window> |
| 43 | + <map-info-window #infoWindow="mapInfoWindow">Testing 1 2 3</map-info-window> |
43 | 44 | @if (isPolylineDisplayed) {
|
44 | 45 | <map-polyline [options]="polylineOptions"></map-polyline>
|
45 | 46 | }
|
|
213 | 214 | </label>
|
214 | 215 | </div>
|
215 | 216 |
|
| 217 | + <div> |
| 218 | + <label> |
| 219 | + Toggle custom content for Advanced Marker |
| 220 | + <input type="checkbox" (click)="toggleAdvancedMarkerCustomContent()"> |
| 221 | + </label> |
| 222 | + </div> |
| 223 | + |
216 | 224 | <div>
|
217 | 225 | <button mat-button (click)="calculateDirections()">
|
218 | 226 | Calculate directions between first two markers
|
|
0 commit comments