mirror of
https://github.com/visgl/react-map-gl.git
synced 2026-01-25 16:02:50 +00:00
Docs: fix error in code (#2012)
Co-authored-by: Xiaoji Chen <Pessimistress@users.noreply.github.com>
This commit is contained in:
parent
49618fd317
commit
c6196b1794
@ -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} [..]/>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user