Open qaqnass opened 5 years ago
You can use the onZoomChanged
property to handle this, and get the zoom value with getZoom()
.
...
const [map, setMap] = useState(null);
const [zoomValue, setZoomValue] = useState(10);
<GoogleMap
defaultZoom={10}
defaultCenter={{ lat: xx.xxxxx, lng: -x.xxxxx }}
ref={googleMap => setMap(googleMap)}
onZoomChanged={() => setZoom(map.getZoom())}
>
...
</GoogleMap>
...
I want to hide and present something else while the map has zoom in or out. please, would you mind to let me know how can I add zoom_changed to the map?