Freehand Map Polygon
This project is a free drawing feature map polygon project. For the map mapbox.js, for freehand drawing leaflet.freedraw.js I used it. If you want leaflet.js You can also use.
Live Preview Page
Free Drawing Feature
When you draw freely, Javascript function polygon takes the array of coordinates and encodes it. This encoded array GET sends with his request.
GET When a request arrives, another function that controls it receives and decodes it. According to the resulting coordinate sequence, a polygon draws areas and places markers on the map.
For all this point on polygon I researched the problem and Ray Casting I found a solution using the algorithm.