Perf/Fix: Resolve Google Maps OverQuotaMapError through marker recycling and instance reuse
This commit is contained in:
@ -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,
|
||||
|
||||
Reference in New Issue
Block a user