text: var __extends = (this && this.__extends) || (function () {
      var extendStatics = Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
          function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
      return function (d, b) {
          extendStatics(d, b);
          function __() { this.constructor = d; }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
  })();
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
      else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
      return c > 3 && r && Object.defineProperty(target, key, r), r;
  };
  var __metadata = (this && this.__metadata) || function (k, v) {
      if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
  };
  import { Injectable } from '@angular/core';
  import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
  import { Observable } from 'rxjs/Observable';
  /**
   * @name Geolocation
   * @description
   * This plugin provides information about the device's location, such as latitude and longitude. Common sources of location information include Global Positioning System (GPS) and location inferred from network signals such as IP address, RFID, WiFi and Bluetooth MAC addresses, and GSM/CDMA cell IDs.
   *
   *  This API is based on the W3C Geolocation API Specification, and only executes on devices that don't already provide an implementation.
   *
   * For iOS you have to add this configuration to your configuration.xml file
   * ```xml
   * <edit-config file="*-Info.plist" mode="merge" target="NSLocationWhenInUseUsageDescription">
   *    <string>We want your location! Best regards NSA</string>
   * </edit-config>
   * ```
   *
   *
   * @usage
   *
   * ```typescript
   * import { Geolocation } from '@ionic-native/geolocation';
   *
   * ...
   *
   * constructor(private geolocation: Geolocation) {}
   *
   * ...
   *
   * this.geolocation.getCurrentPosition().then((resp) => {
   *  // resp.coords.latitude
   *  // resp.coords.longitude
   * }).catch((error) => {
   *   console.log('Error getting location', error);
   * });
   *
   * let watch = this.geolocation.watchPosition();
   * watch.subscribe((data) => {
   *  // data can be a set of coordinates, or an error (if an error occurred).
   *  // data.coords.latitude
   *  // data.coords.longitude
   * });
   * ```
   * @interfaces
   * Coordinates
   * Geoposition
   * PositionError
   * GeolocationOptions
   */
  var Geolocation = (function (_super) {
      __extends(Geolocation, _super);
      function Geolocation() {
          return _super !== null && _super.apply(this, arguments) || this;
      }
      /**
       * Get the device's current position.
       *
       * @param {GeolocationOptions} options  The [geolocation options](https://developer.mozilla.org/en-US/docs/Web/API/PositionOptions).
       * @returns {Promise<Geoposition>} Returns a Promise that resolves with the [position](https://developer.mozilla.org/en-US/docs/Web/API/Position) of the device, or rejects with an error.
       */
      Geolocation.prototype.getCurrentPosition = function (options) { return; };
      /**
       * Watch the current device's position.  Clear the watch by unsubscribing from
       * Observable changes.
       *
       * ```typescript
       * const subscription = this.geolocation.watchPosition()
       *                               .filter((p) => p.coords !== undefined) //Filter Out Errors
       *                               .subscribe(position => {
       *   console.log(position.coords.longitude + ' ' + position.coords.latitude);
       * });
       *
       * // To stop notifications
       * subscription.unsubscribe();
       * ```
       *
       * @param {GeolocationOptions} options  The [geolocation options](https://developer.mozilla.org/en-US/docs/Web/API/PositionOptions).
       * @returns {Observable<Geoposition>} Returns an Observable that notifies with the [position](https://developer.mozilla.org/en-US/docs/Web/API/Position) of the device, or errors.
       */
      Geolocation.prototype.watchPosition = function (options) {
          return new Observable(function (observer) {
              var watchId = navigator.geolocation.watchPosition(observer.next.bind(observer), observer.next.bind(observer), options);
              return function () { return navigator.geolocation.clearWatch(watchId); };
          });
      };
      Geolocation.decorators = [
          { type: Injectable },
      ];
      /** @nocollapse */
      Geolocation.ctorParameters = function () { return []; };
      __decorate([
          Cordova({
              callbackOrder: 'reverse'
          }),
          __metadata("design:type", Function),
          __metadata("design:paramtypes", [Object]),
          __metadata("design:returntype", Promise)
      ], Geolocation.prototype, "getCurrentPosition", null);
      Geolocation = __decorate([
          Plugin({
              pluginName: 'Geolocation',
              plugin: 'cordova-plugin-geolocation',
              pluginRef: 'navigator.geolocation',
              repo: 'https://github.com/apache/cordova-plugin-geolocation',
              install: 'ionic cordova plugin add cordova-plugin-geolocation --variable GEOLOCATION_USAGE_DESCRIPTION="To locate you"',
              installVariables: ['GEOLOCATION_USAGE_DESCRIPTION'],
              platforms: ['Amazon Fire OS', 'Android', 'Browser', 'iOS', 'Windows']
          })
      ], Geolocation);
      return Geolocation;
  }(IonicNativePlugin));
  export { Geolocation };
  //# sourceMappingURL=index.js.map