react-geofencing

1.0.2 • Public • Published

Geo fencing for react apps(Circular).

import { useGeoFencing } from 'react-geofencing'

const MyComponent = () => {
	 const { isWithinGeoFence } = useGeoFencing({radius: 50})

  if(isWithinGeoFence(
     { lat: 28.420006.latitude, long: 77.038188 }, //geo-fence center point
     { lat: location.lat, long: location.lng } //user location, can be fetched from browsers geo location api
   )) {
     alert("Is within geo fence area.")
   }
   else {
     alert("Is not within geo fence area.")
   }
}

Readme

Keywords

Package Sidebar

Install

npm i react-geofencing

Weekly Downloads

16

Version

1.0.2

License

ISC

Unpacked Size

3.23 kB

Total Files

4

Last publish

Collaborators

  • chetvishal