1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, '__esModule', { value: true });
|
4 |
|
5 | var tslib = require('tslib');
|
6 | var core$1 = require('@angular/core');
|
7 | var core = require('@ionic-native/core');
|
8 | var rxjs = require('rxjs');
|
9 |
|
10 | var Geolocation = (function (_super) {
|
11 | tslib.__extends(Geolocation, _super);
|
12 | function Geolocation() {
|
13 | return _super !== null && _super.apply(this, arguments) || this;
|
14 | }
|
15 | Geolocation.prototype.getCurrentPosition = function (options) { return core.cordova(this, "getCurrentPosition", { "callbackOrder": "reverse" }, arguments); };
|
16 | |
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 | Geolocation.prototype.watchPosition = function (options) {
|
35 | return new rxjs.Observable(function (observer) {
|
36 | var watchId = navigator.geolocation.watchPosition(observer.next.bind(observer), observer.next.bind(observer), options);
|
37 | return function () { return navigator.geolocation.clearWatch(watchId); };
|
38 | });
|
39 | };
|
40 | Geolocation.pluginName = "Geolocation";
|
41 | Geolocation.plugin = "cordova-plugin-geolocation";
|
42 | Geolocation.pluginRef = "navigator.geolocation";
|
43 | Geolocation.repo = "https://github.com/apache/cordova-plugin-geolocation";
|
44 | Geolocation.install = "ionic cordova plugin add cordova-plugin-geolocation --variable GEOLOCATION_USAGE_DESCRIPTION=\"To locate you\"";
|
45 | Geolocation.installVariables = ["GEOLOCATION_USAGE_DESCRIPTION"];
|
46 | Geolocation.platforms = ["Amazon Fire OS", "Android", "Browser", "iOS", "Windows"];
|
47 | Geolocation.decorators = [
|
48 | { type: core$1.Injectable }
|
49 | ];
|
50 | return Geolocation;
|
51 | }(core.IonicNativePlugin));
|
52 |
|
53 | exports.Geolocation = Geolocation;
|