text: /**
   * angular2-google-maps - Angular2 components for Google Maps
   * @version v0.8.1
   * @link https://github.com/SebastianM/angular2-google-maps#readme
   * @license MIT
   */
  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, NgZone } from 'angular2/core';
  import { Observable } from 'rxjs/Observable';
  import { GoogleMapsAPIWrapper } from './google-maps-api-wrapper';
  export let MarkerManager = class MarkerManager {
      constructor(_mapsWrapper, _zone) {
          this._mapsWrapper = _mapsWrapper;
          this._zone = _zone;
          this._markers = new Map();
      }
      deleteMarker(marker) {
          const m = this._markers.get(marker);
          if (m == null) {
              // marker already deleted
              return Promise.resolve();
          }
          return m.then((m) => {
              return this._zone.run(() => {
                  m.setMap(null);
                  this._markers.delete(marker);
              });
          });
      }
      updateMarkerPosition(marker) {
          return this._markers.get(marker).then((m) => m.setPosition({ lat: marker.latitude, lng: marker.longitude }));
      }
      updateTitle(marker) {
          return this._markers.get(marker).then((m) => m.setTitle(marker.title));
      }
      updateLabel(marker) {
          return this._markers.get(marker).then((m) => { m.setLabel(marker.label); });
      }
      updateDraggable(marker) {
          return this._markers.get(marker).then((m) => m.setDraggable(marker.draggable));
      }
      addMarker(marker) {
          const markerPromise = this._mapsWrapper.createMarker({
              position: { lat: marker.latitude, lng: marker.longitude },
              label: marker.label,
              draggable: marker.draggable
          });
          this._markers.set(marker, markerPromise);
      }
      createEventObservable(eventName, marker) {
          return Observable.create((observer) => {
              this._markers.get(marker).then((m) => {
                  m.addListener(eventName, (e) => this._zone.run(() => observer.next(e)));
              });
          });
      }
  };
  MarkerManager = __decorate([
      Injectable(), 
      __metadata('design:paramtypes', [GoogleMapsAPIWrapper, NgZone])
  ], MarkerManager);
  
  //# sourceMappingURL=marker-manager.js.map
  