index.js
function insidePolygon(rings, p) {
    var inside = false;
    for (var i = 0, len = rings.length; i < len; i++) {
        var ring = rings[i];
        for (var j = 0, len2 = ring.length, k = len2 - 1; j < len2; k = j++) {
            if (rayIntersect(p, ring[j], ring[k])) inside = !inside;
        }
    }
    return inside;
}
function insidePolygon(rings, p) {
    var inside = false;
    for (var i = 0, len = rings.length; i < len; i++) {
        var ring = rings[i];
        for (var j = 0, len2 = ring.length, k = len2 - 1; j < len2; k = j++) {
            if (rayIntersect(p, ring[j], ring[k])) inside = !inside;
        }
    }
    return inside;
}
function insidePolygon ( rings , p ) { var inside = false ; for ( var i = 0 , len = rings . length ; i < len ; i ++ ) { var ring = rings [ i ] ; for ( var j = 0 , len2 = ring . length , k = len2 - 1 ; j < len2 ; k = j ++ ) { if ( rayIntersect ( p , ring [ j ] , ring [ k ] ) ) inside = ! inside ; } } return inside ; }
ray casting algorithm for detecting if point is in polygon
ray casting algorithm for detecting if point is in polygon