We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9c047cc commit 897af65Copy full SHA for 897af65
samples/ui-kit-place-search-text/index.ts
@@ -84,6 +84,12 @@ async function addMarkers(){
84
85
const bounds = new LatLngBounds();
86
87
+ // First remove all existing markers.
88
+ for(marker in markers){
89
+ markers[marker].map = null;
90
+ }
91
+ markers = {};
92
+
93
if(placeList.places.length > 0){
94
placeList.places.forEach((place) => {
95
let marker = new AdvancedMarkerElement({
@@ -125,4 +131,4 @@ async function addMarkers(){
125
131
/* [END maps_ui_kit_place_search_text_add_markers] */
126
132
127
133
initMap();
128
-/* [END maps_ui_kit_place_search_text] */
134
+/* [END maps_ui_kit_place_search_text] */
0 commit comments