diff --git a/app.js b/app.js index 852124a..bb7d4c4 100644 --- a/app.js +++ b/app.js @@ -56,6 +56,7 @@ const PROVINCE_BY_PLATE_PREFIX = { let map = null; let markerList = []; +let infoWindowList = []; let is3DPitch = true; let currentMode = 'vehicle'; let currentTheme = 'theme-white'; @@ -239,6 +240,7 @@ function stationNodes() { function renderAMapMarkers() { if (!map || !dashboard) return; markerList.forEach(marker => marker.remove()); markerList = []; + infoWindowList.forEach(infoWindow => infoWindow.close()); infoWindowList = []; const nodes = currentMode === 'vehicle' ? vehicleNodes() : stationNodes(); const dict = i18n[currentLang]; for (const node of nodes) { @@ -253,6 +255,7 @@ function renderAMapMarkers() { content: `