Security News
The Dark Side of Open Source
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
@goparrot/react-native-geometry-utils
Advanced tools
Readme
Google maps geometry utils for react native
This library is a clone of react-native-geo-fencing with several improvements.
npm install @goparrot/react-native-geometry-utils
import {
polygonContainsLocation,
circleContainsLocation,
computeDistanceBetween
} from "@goparrot/react-native-geometry-utils";
// ...
const polygon = [
{ latitude: 0, longitude: 0 },
{ latitude: 0, longitude: 1 },
{ latitude: 1, longitude: 1 },
{ latitude: 1, longitude: 0 },
{ latitude: 0, longitude: 0 }, // last point has to be same as first point
];
const cicle = {
center: {
latitude: 0,
longitude: 0,
},
radius: 15742.949, // approximate radius of 0.1 degree in meters
};
const pointIn = {
latitude: 0.1,
longitude: 0.1,
};
const pointOut = {
latitude: 0.2,
longitude: -0.2,
};
await polygonContainsLocation(pointIn, polygon); // true
await polygonContainsLocation(pointOut, polygon); // false
await circleContainsLocation(pointIn, cicle); // true
await circleContainsLocation(pointOut, cicle); // false
await computeDistanceBetween(pointIn, pointOut); // 35162.86 meters
interface LatLng {
latitude: number;
longitude: number;
}
interface Circle {
center: LatLng;
radius: number;
}
polygonContainsLocation(point: LatLng, polygon: LatLng[]): Promise<boolean>;
circleContainsLocation(point: LatLng, circle: Circle): Promise<boolean>;
computeDistanceBetween(from: LatLng, to: LatLng): Promise<number>;
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
FAQs
Google maps geometry utils for react native
The npm package @goparrot/react-native-geometry-utils receives a total of 34 weekly downloads. As such, @goparrot/react-native-geometry-utils popularity was classified as not popular.
We found that @goparrot/react-native-geometry-utils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
Research
Security News
The Socket Research team found this npm package includes code for collecting sensitive developer information, including your operating system username, Git username, and Git email.
Security News
OpenJS is warning of social engineering takeovers targeting open source projects after receiving a credible attempt on the foundation.