diff --git a/docs/get-started/tips-and-tricks.md b/docs/get-started/tips-and-tricks.md index 9b3155c4..4c095582 100644 --- a/docs/get-started/tips-and-tricks.md +++ b/docs/get-started/tips-and-tricks.md @@ -184,7 +184,7 @@ const mapRef = useRef(); 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