npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@jwot/capacitor-location

v0.0.2

Published

justwei location plugin

Readme

@justwei/capacitor-location

justwei location plugin

Install

npm install @justwei/capacitor-location
npx cap sync

API

定义插件接口,描述插件的方法和返回类型

getCurrentPosition(...)

getCurrentPosition(options?: PositionOptions | undefined) => Promise<Position>

获取当前设备的GPS位置

| Param | Type | Description | | ------------- | ----------------------------------------------------------- | ----------- | | options | PositionOptions | 定位选项 |

Returns: Promise<Position>


checkPermissions()

checkPermissions() => Promise<PermissionStatus>

检查位置权限。如果系统位置服务被禁用,将会抛出异常。

Returns: Promise<PermissionStatus>


requestPermissions(...)

requestPermissions(permissions?: GeolocationPluginPermissions | undefined) => Promise<PermissionStatus>

请求位置权限。如果系统位置服务被禁用,将会抛出异常。

| Param | Type | | ----------------- | ------------------------------------------------------------------------------------- | | permissions | GeolocationPluginPermissions |

Returns: Promise<PermissionStatus>


Interfaces

Position

| Prop | Type | Description | Since | | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------- | ----- | | timestamp | number | 坐标的创建时间戳 | 1.0.0 | | coords | { latitude: number; longitude: number; accuracy: number; altitudeAccuracy: number | null; altitude: number | null; speed: number | null; heading: number | null; source?: 'gps' | 'network' | 'passive' | 'unknown'; fromCache?: boolean; timedOut?: boolean; } | The GPS coordinates along with the accuracy of the data | |

PositionOptions

| Prop | Type | Description | Default | Since | | --------------------------- | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | ----- | | enableHighAccuracy | boolean | High accuracy mode (such as GPS, if available) On Android 12+ devices it will be ignored if users didn't grant ACCESS_FINE_LOCATION permissions (can be checked with location alias). | false | 1.0.0 | | timeout | number | The maximum wait time in milliseconds for location updates. In Android, since version 4.0.0 of the plugin, timeout gets ignored for getCurrentPosition. | 10000 | 1.0.0 | | maximumAge | number | The maximum age in milliseconds of a possible cached position that is acceptable to return | 0 | 1.0.0 | | minimumUpdateInterval | number | The minumum update interval for location updates. If location updates are available faster than this interval then an update will only occur if the minimum update interval has expired since the last location update. This parameter is only available for Android. It has no effect on iOS or Web platforms. | 5000 | 6.1.0 |

PermissionStatus

| Prop | Type | Description | Since | | -------------------- | ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----- | | location | PermissionState | Permission state for location alias. On Android it requests/checks both ACCESS_COARSE_LOCATION and ACCESS_FINE_LOCATION permissions. On iOS and web it requests/checks location permission. | 1.0.0 | | coarseLocation | PermissionState | Permission state for coarseLocation alias. On Android it requests/checks ACCESS_COARSE_LOCATION. On Android 12+, users can choose between Approximate location (ACCESS_COARSE_LOCATION) or Precise location (ACCESS_FINE_LOCATION), so this alias can be used if the app doesn't need high accuracy. On iOS and web it will have the same value as location alias. | 1.2.0 |

GeolocationPluginPermissions

| Prop | Type | | ----------------- | ---------------------------------------- | | permissions | GeolocationPermissionType[] |

Type Aliases

PermissionState

'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'

GeolocationPermissionType

'location' | 'coarseLocation'