js/plugins/highchart/parts-map/GeoJSON.js
/** 
 * Test for point in polygon. Polygon defined as array of [x,y] points.
 */
Test for point in polygon. Polygon defined as array of [x,y] points.
Test for point in polygon . Polygon defined as array of [ x y ] points .
function pointInPolygon(point, polygon) {
	var i,
		j,
		rel1,
		rel2,
		c = false,
		x = point.x,
		y = point.y;
	for (i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {
		rel1 = polygon[i][1] > y;
		rel2 = polygon[j][1] > y;
		if (rel1 !== rel2 && (x < (polygon[j][0] - polygon[i][0]) * (y - polygon[i][1]) / (polygon[j][1] - polygon[i][1]) + polygon[i][0])) {
			c = !c;
		}
	}
	return c;
}
function pointInPolygon ( point , polygon ) { var i , j , rel1 , rel2 , c = false , x = point . x , y = point . y ; for ( i = 0 , j = polygon . length - 1 ; i < polygon . length ; j = i ++ ) { rel1 = polygon [ i ] [ 1 ] > y ; rel2 = polygon [ j ] [ 1 ] > y ; if ( rel1 !== rel2 && ( x < ( polygon [ j ] [ 0 ] - polygon [ i ] [ 0 ] ) * ( y - polygon [ i ] [ 1 ] ) / ( polygon [ j ] [ 1 ] - polygon [ i ] [ 1 ] ) + polygon [ i ] [ 0 ] ) ) { c = ! c ; } } return c ; }
Test for point in polygon.
Test for point in polygon .