1. If you are using Openlayers see [here][1].
 2. If you are using leaflet see [here][2].
 3. For pure javascript see [here][3] or for NPM resource [here][4].

There are other solutions beyond these but this should be enough to be getting on with.


  [1]: http://gis.stackexchange.com/questions/131280/ol3-check-if-point-is-inside-a-polygon
  [2]: http://stackoverflow.com/questions/16890294/leaflet-how-to-check-point-lies-inside-outside-of-polygon-or-rectangle
  [3]: http://stackoverflow.com/questions/22521982/js-check-if-point-inside-a-polygon
  [4]: http://