Este es el sitio https://www.space-intelligence.com/scotland-landcover/# Cuando hace clic en las estadísticas regionales, se abre un menú desplegable y luego, cuando hace clic en Seleccionar región, se abre una ventana emergente y aquí selecciona la ciudad. y después de eso, haga clic en el botón de búsqueda. Pero no está haciendo nada. Cuando hace clic en buscar, debe hacer zoom en el área seleccionada. El área se resalta en el mapa y se amplía cuando hace clic en buscar.
Esta es la función:
function areasearch(modalid) { var fid = $("#areasearch" + modalid).val(); $("#exampleModal" + modalid).modal('toggle'); map.data.forEach(function(feature) { if (fid != 0) { if (feature.i.ID != fid) { map.data.overrideStyle(feature, { visible: false }); feature.setProperty('visible', 'false'); } else { var bounds = new google.maps.LatLngBounds(); feature.getGeometry().forEachLatLng(function(latlng) { bounds.extend(latlng); }); map.fitBounds(bounds); map.data.overrideStyle(feature, { visible: true }); google.maps.event.trigger(map.data, 'click', feature.getId()); feature.setProperty('visible', 'true'); } } else { map.data.overrideStyle(feature, { visible: true }); feature.setProperty('visible', 'true'); } $('#exampleModal').modal('hide'); }); } Si experimenta algún problema con map.fitBounds() , intente usar el método setZoom() con el nivel de zoom deseado (se necesita int). También necesita centrar el mapa donde desea tener un enfoque con el método setCenter() (se necesita el objeto latLng).
Intente insertar las siguientes líneas con el valor deseado:
map.setCenter({lat:YOUR_LATITUDE, lng:YOUR_LONGITUDE}); map.setZoom(6);también puede leer esta sección de la documentación