Docs: fix error in code (#2012)

Co-authored-by: Xiaoji Chen <Pessimistress@users.noreply.github.com>
This commit is contained in:
Marcel Tams 2022-11-28 18:50:56 +01:00 committed by GitHub
parent 6213d5758a
commit c8d0401bb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -184,7 +184,7 @@ const mapRef = useRef<MapRef>();
const checkIfPositionInViewport = (lat, lng) => {
const bounds = mapRef.current.getMap().getBounds();
return (lat >= bounds._sw.lat && lat <= bounds._nw.lat && lng >= bounds._sw.lng && lng <= bounds._nw.lng);
return bounds.contains([lng, lat]);
}
return <Map ref={mapRef} [..]/>