Skip to content Skip to sidebar Skip to footer

Turfjs Point In Polygon Always Returns False

I'm using Google maps API that geolocates the user and, if they are in the city of Los Angeles, will tell them what LAPD reporting district they are in. I have a geojson overlay of

Solution 1:

I'd suggest checking two things:

  • The turf.point coordinate must be Lon,Lat instead of Lat,Lon. This might be the issue because -118 is not a valid latitude. Lon,Lat is a very common convention.

  • Also check the value passed in to booleanPointInPolygon The documentation shows the coordinate arrays being wrapped in two arrays, not just one.

Post a Comment for "Turfjs Point In Polygon Always Returns False"