Check if point is inside of geoman drawn layers #1397
Replies: 3 comments 2 replies
-
You can use booleanContains from turfjs.org to check if the mouse-position is inside of a layer.
|
Beta Was this translation helpful? Give feedback.
-
I made a strange observation. When i draw a circle with the center on the marker (meaning the lat/lng i check against (snap mode)) then turf.booleanContains works.
|
Beta Was this translation helpful? Give feedback.
-
To complete if someone finds this thread: The following function checks if a point is within a circle or a polygon drawn with geoman-leaflet:
|
Beta Was this translation helpful? Give feedback.
-
Hi there
I search for a function to check if a lat/lng is inside layers drawn by geoman. Something like the mouseover that changes to pointer hand whenever over a geoman drawn layer.
So something like
L.PM.Utils.PointInGeomanLayers(latlng, map);
That returns true or false.
If somebody has a hint or if i can re-use the mouseover function somehow?
Beta Was this translation helpful? Give feedback.
All reactions