@@ -91,7 +91,13 @@ export class GoogleMapDemo {
91
91
center = { lat : 24 , lng : 12 } ;
92
92
mapAdvancedMarkerPosition = { lat : 24 , lng : 16 } ;
93
93
markerOptions = { draggable : false } ;
94
- markerPositions : google . maps . LatLngLiteral [ ] = [ ] ;
94
+ markerPositions : google . maps . LatLngLiteral [ ] = [ this . center ] ;
95
+ markerPositionsOld : google . maps . LatLngLiteral [ ] = [ ] ;
96
+ advancedMarkerPositions : google . maps . LatLngLiteral [ ] = [ this . mapAdvancedMarkerPosition ] ;
97
+ advancedMarkerPositionsOld : google . maps . LatLngLiteral [ ] = [ ] ;
98
+
99
+ hidden : boolean = false ;
100
+
95
101
zoom = 4 ;
96
102
display ?: google . maps . LatLngLiteral ;
97
103
isPolylineDisplayed = false ;
@@ -101,6 +107,11 @@ export class GoogleMapDemo {
101
107
strokeOpacity : 0.8 ,
102
108
} ;
103
109
110
+ createOptions : google . maps . MapOptions = {
111
+ gestureHandling : 'greedy' ,
112
+ mapId : '* YOUR MAP ID *' ,
113
+ } ;
114
+
104
115
heatmapData = this . _getHeatmapData ( 5 , 1 ) ;
105
116
heatmapOptions = { radius : 50 } ;
106
117
isHeatmapDisplayed = false ;
@@ -319,4 +330,18 @@ export class GoogleMapDemo {
319
330
document . body . appendChild ( script ) ;
320
331
} ) ;
321
332
}
333
+
334
+ toggleHideMarkers ( ) {
335
+ if ( this . hidden ) {
336
+ this . advancedMarkerPositions = this . advancedMarkerPositionsOld ;
337
+ this . markerPositions = this . markerPositionsOld ;
338
+ this . hidden = false ;
339
+ } else {
340
+ this . advancedMarkerPositionsOld = this . advancedMarkerPositions ;
341
+ this . advancedMarkerPositions = [ ] ;
342
+ this . markerPositionsOld = this . markerPositions ;
343
+ this . markerPositions = [ ] ;
344
+ this . hidden = true ;
345
+ }
346
+ }
322
347
}
0 commit comments