Thursday 15 January 2015

javascript - identify which is the polygon from latitude and longitude -


I have a map using leaflet.js. Can I identify polygon if I give latitude and latitude values ​​as input? Can I get a client side script for it?

Get answers as follows:

// This' points in polygon algorithm Based on '

  function getPoint () {float x = -89.82421875; // Floating x and y latitude and lag values ​​= 40.18307014852533; Var a = borders; Coordinate {PointInPolygon (x, y, a.features [i] .geometry.coordinates used to draw map for // coordinates (i = 0; i & lt; a.features.length; i ++) [0], i); }}; Function PointpointPolygon (PointX, Point, U, Voucher, Number) {var j = _vertices.length - 1; Var odd nodes = false; Var polyex, poly, polyoxyx, polyis; (Var i = 0; i & lt; _vertices.length; i ++) {polyY = parseflow (_vertices [i] .toString (). Partition (",") [1]); Polyx = parseflot (_vertices [i] .toString (.) Partition (",") [0]); Polyexes = parseflot (_vertices [j] .toString (.) Partition (",") [0]); PolyYJ = PersFlot (_vertices [j] .toString (). Partition (",") [1]); If (polyii and lieutenant; poinci and amp; poly jaëg> = point y] polyise and lieutenant; point et amp polly u; = point y) {if (polyoxy + (point-polyi) / (polyise-polyi) * (Polyexes - polyx) & lt; pointX) {oddNodes =! OddNodes; }} J = I; } If (strange nodes == true) {map._layers [number + 1]. Fire ('click'); // map click event event}}    

No comments:

Post a Comment