surialabs / react-native-geo-fencing

Native modules to determine if a location is within defined geographical boundaries using Google Geometry library
139 stars 33 forks source link

Not working in IOS. Android works fine #9

Open ydv0121 opened 6 years ago

ydv0121 commented 6 years ago

geofencing works properly in android also with realtime coordinates but in IOS not working..always describing point in not within polygon

static data

const polygon = [ {"lat": 37.42380853737998,"lng": -122.08662271499634}, {"lat": 37.42352949259187,"lng": -122.08644200116395}, {"lat": 37.42384474922283,"lng": -122.08275865763426}, {"lat": 37.42008900856639,"lng": -122.08249680697918}, {"lat": 37.42134369453038,"lng": -122.08579190075396}, // last point has to be same as first point ];

let point = {
  "lat": 37.421998333333335,
  "lng": -122.08400000000002
};

GeoFencing.containsLocation(point, polygon)
  .then(() => console.log('point is within polygon'))
  .catch(() => console.log('point is NOT within polygon'))

point is within polygon surely

please help

jameslporter commented 5 years ago

Your beginning and ending coordinates do not match, they must match to complete the polygon.

eramudeep commented 3 years ago

yes its not working man my poly =[ {lat: 54.1784838 , lng: -123.9541477}, {lat: 53.8348151, lng: -135.5103986}, {lat: 54.1798816, lng: -104.4465713}, {lat: 46.2679312, lng: -68.6551949}, {lat: 53.1668149, lng: -69.1783083}, {lat: 68.4817407, lng: -136.7732486}, {lat: 45.2906308 , lng: -65.2759181}, {lat: 63.5954344, lng: -124.1555502}, {lat: 48.9347914, lng: -93.7155729}, {lat: 46.5031512, lng: -63.7525627}, {lat: 53.4650568, lng: -77.3895206}, {lat: 54.1797758 , lng: -114.6389862}, {lat: 64.5610006 , lng: -141.332713}, {lat: 54.1784838 , lng: -123.9541477} ]

not even working for me

i have used a point one from the above coordinates. but its saying in the fence area

eduardoNBD commented 3 years ago

enter in this url and do that

https://npm.io/package/react-native-geo-fencing