@capacitor/geolocation 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/android/build.gradle +1 -1
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/web.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.3.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/geolocation@1.3.0...@capacitor/geolocation@1.3.1) (2022-01-19)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* inline source code in esm map files ([#760](https://github.com/ionic-team/capacitor-plugins/issues/760)) ([a960489](https://github.com/ionic-team/capacitor-plugins/commit/a960489a19db0182b90d187a50deff9dfbe51038))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [1.3.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/geolocation@1.2.0...@capacitor/geolocation@1.3.0) (2021-12-08)
|
|
7
18
|
|
|
8
19
|
|
package/android/build.gradle
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PermissionState } from '@capacitor/core';\n\nexport type CallbackID = string;\n\nexport interface PermissionStatus {\n /**\n * Permission state for location alias.\n *\n * On Android it requests/checks both ACCESS_COARSE_LOCATION and\n * ACCESS_FINE_LOCATION permissions.\n *\n * On iOS and web it requests/checks location permission.\n *\n * @since 1.0.0\n */\n location: PermissionState;\n\n /**\n * Permission state for coarseLocation alias.\n *\n * On Android it requests/checks ACCESS_COARSE_LOCATION.\n *\n * On Android 12+, users can choose between Approximate location (ACCESS_COARSE_LOCATION) or\n * Precise location (ACCESS_FINE_LOCATION), so this alias can be used if the app doesn't\n * need high accuracy.\n *\n * On iOS and web it will have the same value as location alias.\n *\n * @since 1.2.0\n */\n coarseLocation: PermissionState;\n}\n\nexport type GeolocationPermissionType = 'location' | 'coarseLocation';\n\nexport interface GeolocationPluginPermissions {\n permissions: GeolocationPermissionType[];\n}\n\nexport interface GeolocationPlugin {\n /**\n * Get the current GPS location of the device\n *\n * @since 1.0.0\n */\n getCurrentPosition(options?: PositionOptions): Promise<Position>;\n\n /**\n * Set up a watch for location changes. Note that watching for location changes\n * can consume a large amount of energy. Be smart about listening only when you need to.\n *\n * @since 1.0.0\n */\n watchPosition(\n options: PositionOptions,\n callback: WatchPositionCallback,\n ): Promise<CallbackID>;\n\n /**\n * Clear a given watch\n *\n * @since 1.0.0\n */\n clearWatch(options: ClearWatchOptions): Promise<void>;\n\n /**\n * Check location permissions\n *\n * @since 1.0.0\n */\n checkPermissions(): Promise<PermissionStatus>;\n\n /**\n * Request location permissions\n *\n * @since 1.0.0\n */\n requestPermissions(\n permissions?: GeolocationPluginPermissions,\n ): Promise<PermissionStatus>;\n}\n\nexport interface ClearWatchOptions {\n id: CallbackID;\n}\n\nexport interface Position {\n /**\n * Creation timestamp for coords\n *\n * @since 1.0.0\n */\n timestamp: number;\n\n /**\n * The GPS coordinates along with the accuracy of the data\n *\n * @since 1.0.0\n */\n coords: {\n /**\n * Latitude in decimal degrees\n *\n * @since 1.0.0\n */\n latitude: number;\n\n /**\n * longitude in decimal degrees\n *\n * @since 1.0.0\n */\n longitude: number;\n\n /**\n * Accuracy level of the latitude and longitude coordinates in meters\n *\n * @since 1.0.0\n */\n accuracy: number;\n\n /**\n * Accuracy level of the altitude coordinate in meters, if available.\n *\n * Available on all iOS versions and on Android 8.0+.\n *\n * @since 1.0.0\n */\n altitudeAccuracy: number | null | undefined;\n\n /**\n * The altitude the user is at (if available)\n *\n * @since 1.0.0\n */\n altitude: number | null;\n\n /**\n * The speed the user is traveling (if available)\n *\n * @since 1.0.0\n */\n speed: number | null;\n\n /**\n * The heading the user is facing (if available)\n *\n * @since 1.0.0\n */\n heading: number | null;\n };\n}\n\nexport interface PositionOptions {\n /**\n * High accuracy mode (such as GPS, if available)\n *\n * On Android 12+ devices it will be ignored if users didn't grant\n * ACCESS_FINE_LOCATION permissions (can be checked with location alias).\n *\n * @default false\n * @since 1.0.0\n */\n enableHighAccuracy?: boolean;\n\n /**\n * The maximum wait time in milliseconds for location updates\n *\n * @default 10000\n * @since 1.0.0\n */\n timeout?: number;\n\n /**\n * The maximum age in milliseconds of a possible cached position that is acceptable to return\n *\n * @default 0\n * @since 1.0.0\n */\n maximumAge?: number;\n}\n\nexport type WatchPositionCallback = (\n position: Position | null,\n err?: any,\n) => void;\n\n/**\n * @deprecated Use `PositionOptions`.\n * @since 1.0.0\n */\nexport type GeolocationOptions = PositionOptions;\n\n/**\n * @deprecated Use `WatchPositionCallback`.\n * @since 1.0.0\n */\nexport type GeolocationWatchCallback = WatchPositionCallback;\n\n/**\n * @deprecated Use `Position`.\n * @since 1.0.0\n */\nexport type GeolocationPosition = Position;\n"]}
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,WAAW,GAAG,cAAc,CAAoB,aAAa,EAAE;IACnE,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,CAAC;CAC7D,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,WAAW,GAAG,cAAc,CAAoB,aAAa,EAAE;IACnE,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,CAAC;CAC7D,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { GeolocationPlugin } from './definitions';\n\nconst Geolocation = registerPlugin<GeolocationPlugin>('Geolocation', {\n web: () => import('./web').then(m => new m.GeolocationWeb()),\n});\n\nexport * from './definitions';\nexport { Geolocation };\n"]}
|
package/dist/esm/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAW5C,MAAM,OAAO,cAAe,SAAQ,SAAS;IAC3C,KAAK,CAAC,kBAAkB,CAAC,OAAyB;QAChD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,SAAS,CAAC,WAAW,CAAC,kBAAkB,CACtC,GAAG,CAAC,EAAE;gBACJ,OAAO,CAAC,GAAG,CAAC,CAAC;YACf,CAAC,EACD,GAAG,CAAC,EAAE;gBACJ,MAAM,CAAC,GAAG,CAAC,CAAC;YACd,CAAC,kBAEC,kBAAkB,EAAE,KAAK,EACzB,OAAO,EAAE,KAAK,EACd,UAAU,EAAE,CAAC,IACV,OAAO,EAEb,CAAC;QACJ,CAAC,CAAC,CAAC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AAC;SACzE;QAED,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC;YAC1D,IAAI,EAAE,aAAa;SACpB,CAAC,CAAC;QACH,OAAO,EAAE,QAAQ,EAAE,UAAU,CAAC,KAAK,EAAE,cAAc,EAAE,UAAU,CAAC,KAAK,EAAE,CAAC;IAC1E,CAAC;IAED,KAAK,CAAC,kBAAkB;QACtB,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;CACF;AAED,MAAM,WAAW,GAAG,IAAI,cAAc,EAAE,CAAC;AAEzC,OAAO,EAAE,WAAW,EAAE,CAAC","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type {\n CallbackID,\n GeolocationPlugin,\n PermissionStatus,\n Position,\n PositionOptions,\n WatchPositionCallback,\n} from './definitions';\n\nexport class GeolocationWeb extends WebPlugin implements GeolocationPlugin {\n async getCurrentPosition(options?: PositionOptions): Promise<Position> {\n return new Promise((resolve, reject) => {\n navigator.geolocation.getCurrentPosition(\n pos => {\n resolve(pos);\n },\n err => {\n reject(err);\n },\n {\n enableHighAccuracy: false,\n timeout: 10000,\n maximumAge: 0,\n ...options,\n },\n );\n });\n }\n\n async watchPosition(\n options: PositionOptions,\n callback: WatchPositionCallback,\n ): Promise<CallbackID> {\n const id = navigator.geolocation.watchPosition(\n pos => {\n callback(pos);\n },\n err => {\n callback(null, err);\n },\n {\n enableHighAccuracy: false,\n timeout: 10000,\n maximumAge: 0,\n ...options,\n },\n );\n\n return `${id}`;\n }\n\n async clearWatch(options: { id: string }): Promise<void> {\n window.navigator.geolocation.clearWatch(parseInt(options.id, 10));\n }\n\n async checkPermissions(): Promise<PermissionStatus> {\n if (typeof navigator === 'undefined' || !navigator.permissions) {\n throw this.unavailable('Permissions API not available in this browser');\n }\n\n const permission = await window.navigator.permissions.query({\n name: 'geolocation',\n });\n return { location: permission.state, coarseLocation: permission.state };\n }\n\n async requestPermissions(): Promise<PermissionStatus> {\n throw this.unimplemented('Not implemented on web.');\n }\n}\n\nconst Geolocation = new GeolocationWeb();\n\nexport { Geolocation };\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capacitor/geolocation",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "The Geolocation API provides simple methods for getting and tracking the current position of the device using GPS, along with altitude, heading, and speed information if available.",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"publishConfig": {
|
|
80
80
|
"access": "public"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "f18ee6482e1ec8e5fb0290d51f598397133af990"
|
|
83
83
|
}
|