From c8d0401bb7cccce7cbe65ba4c1e76e3725cbc18d Mon Sep 17 00:00:00 2001 From: Marcel Tams <17073000+amtee@users.noreply.github.com> Date: Mon, 28 Nov 2022 18:50:56 +0100 Subject: [PATCH] Docs: fix error in code (#2012) Co-authored-by: Xiaoji Chen --- docs/get-started/tips-and-tricks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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