Suppose I Draw a polygan using leaflet like in the follow demo: http://leaflet.github.io/Leaflet.draw/
My question is how I can determine if a given point reside inside the polygon or not.
Suppose I Draw a polygan using leaflet like in the follow demo: http://leaflet.github.io/Leaflet.draw/
My question is how I can determine if a given point reside inside the polygon or not.
Here is the modified(with @Sumit hints) version of @gusper answer that worked for me:(i had donuts)
Use the Ray Casting algorithm for checking if a point (marker) lies inside of a polygon:
See jsfiddle for example.
Original source for the code: https://github.com/substack/point-in-polygon/blob/master/index.js
See also 2014's similar answer, https://stackoverflow.com/a/41138512/287948