Check if point exists within a polygon in react-native-maps?
react-native-maps
doesn't expose that function, but there are two packages that I'm aware of that can help you:
react-native-geo-fencing that does the same as the google maps utility you've mentioned.
react-native-geo-fence handles location checks for you and exposes events you can hook into.
For anyone still looking for an easier alternative (or for Circle
support just like I needed it), look into using geolib
: https://github.com/manuelbieh/Geolib.
Installation is simple and straightforward:
$yarn add geolib
Afterward in your React Native project, import it using:
import geolib from 'geolib'
And then just use the API as explained in the README.md.