Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
@awesome-cordova-library/geolocation
Advanced tools
This plugin provides information about the device's location, such as latitude and longitude.
id: plugin-geolocation title: Geolocation tags:
This plugin provides information about the device's location, such as latitude and longitude.
npm install @awesome-cordova-library/geolocation
cordova plugin add cordova-plugin-geolocation
npm install @awesome-cordova-library/geolocation
npm install cordova-plugin-geolocation
npm install @awesome-cordova-library/geolocation
npx cap sync
class Geolocation {
static getCurrentPosition(
successCallback: PositionCallback,
errorCallback?: PositionErrorCallback | null,
options?: PositionOptions
): void;
static watchPosition(
successCallback: PositionCallback,
errorCallback?: PositionErrorCallback | null,
options?: PositionOptions
): number;
static clearWatch(watchId: number): void;
}
import Geolocation from "@awesome-cordova-library/geolocation";
Geolocation.getCurrentPosition(
() => {},
() => {},
{}
);
const watchid = Geolocation.watchPosition(
() => {},
() => {},
{}
);
Geolocation.clearWatch(watchid);
const useGeolocation: () => {
getCurrentPosition: (
options?: PositionOptions
) => Promise<GeolocationPosition>;
watchPosition: (
successCallback: PositionCallback,
errorCallback?: PositionErrorCallback | null,
options?: PositionOptions
) => number;
clearWatch: (watchId: number) => void;
};
import { useState } from "react";
import useGeolocation from "@awesome-cordova-library/geolocation/lib/react";
function App() {
const [loading, setLoading] = useState<boolean>(false);
const [position, setPosition] = useState<GeolocationPosition | undefined>();
const { getCurrentPosition } = useGeolocation();
return (
<div>
{position && (
<div>
<p>
Latitude: {position.coords.latitude} <br /> Longitude:{" "}
{position.coords.longitude}
</p>
</div>
)}
<div>
<button
onClick={() => {
setLoading(true);
getCurrentPosition()
.then((p) => {
setPosition(p);
})
.finally(() => {
setLoading(false);
});
}}
>
Get current position
</button>
</div>
</div>
);
}
FAQs
This plugin provides information about the device's location, such as latitude and longitude.
The npm package @awesome-cordova-library/geolocation receives a total of 2 weekly downloads. As such, @awesome-cordova-library/geolocation popularity was classified as not popular.
We found that @awesome-cordova-library/geolocation demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.