Perf/Fix: Resolve Google Maps OverQuotaMapError through marker recycling and instance reuse

This commit is contained in:
2026-03-03 15:40:13 -05:00
parent df0a4397f6
commit 7ff205b12a
2 changed files with 16 additions and 2 deletions

View File

@ -108,6 +108,14 @@ export function useGoogleMaps() {
clearAllOverlaysForMap(map.value)
}
// 🚀 OPTIMIZACIÓN DE CUOTA: Si el mapa ya existe, no crearlo de nuevo (ahorra cargos de Map Load)
if (map.value && container.contains(map.value.getDiv())) {
console.log('SIBU | Mapa ya inicializado, reutilizando instancia...');
map.value.setCenter(center);
map.value.setZoom(zoom);
return;
}
try {
map.value = new google.maps.Map(container, {
center,