UNPKG

60.7 kBJavaScriptView Raw
1"use strict";
2var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5 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;
6 return c > 3 && r && Object.defineProperty(target, key, r), r;
7};
8var plugin_1 = require('./plugin');
9var Observable_1 = require('rxjs/Observable');
10require('rxjs/add/observable/fromEvent');
11/**
12 * @private
13 * You can listen to these events where appropriate
14 */
15exports.GoogleMapsEvent = {
16 MAP_CLICK: 'click',
17 MAP_LONG_CLICK: 'long_click',
18 MY_LOCATION_CHANGE: 'my_location_change',
19 MY_LOCATION_BUTTON_CLICK: 'my_location_button_click',
20 INDOOR_BUILDING_FOCUSED: 'indoor_building_focused',
21 INDOOR_LEVEL_ACTIVATED: 'indoor_level_activated',
22 CAMERA_CHANGE: 'camera_change',
23 CAMERA_IDLE: 'camera_idle',
24 MAP_READY: 'map_ready',
25 MAP_LOADED: 'map_loaded',
26 MAP_WILL_MOVE: 'will_move',
27 MAP_CLOSE: 'map_close',
28 MARKER_CLICK: 'click',
29 OVERLAY_CLICK: 'overlay_click',
30 INFO_CLICK: 'info_click',
31 MARKER_DRAG: 'drag',
32 MARKER_DRAG_START: 'drag_start',
33 MARKER_DRAG_END: 'drag_end'
34};
35/**
36 * @private
37 */
38exports.GoogleMapsAnimation = {
39 BOUNCE: 'BOUNCE',
40 DROP: 'DROP'
41};
42/**
43 * @private
44 */
45exports.GoogleMapsMapTypeId = {
46 HYBRID: 'MAP_TYPE_HYBRID',
47 NONE: 'MAP_TYPE_NONE',
48 NORMAL: 'MAP_TYPE_NORMAL',
49 ROADMAP: 'MAP_TYPE_ROADMAP',
50 SATELLITE: 'MAP_TYPE_SATELLITE',
51 TERAIN: 'MAP_TYPE_TERRAIN'
52};
53/**
54 * @name Google Maps
55 * @description This plugin uses the native Google Maps SDK
56 * @usage
57 * ```
58 * import {
59 * GoogleMap,
60 * GoogleMapsEvent,
61 * GoogleMapsLatLng,
62 * CameraPosition,
63 * GoogleMapsMarkerOptions,
64 * GoogleMapsMarker,
65 * GoogleMapsMapTypeId
66 * } from 'ionic-native';
67 *
68 * export class MapPage {
69 * constructor() {}
70 *
71 * // Load map only after view is initialize
72 * ngAfterViewInit() {
73 * this.loadMap();
74 * }
75 *
76 * loadMap() {
77 * // make sure to create following structure in your view.html file
78 * // and add a height (for example 100%) to it, else the map won't be visible
79 * // <ion-content>
80 * // <div #map id="map" style="height:100%;"></div>
81 * // </ion-content>
82 *
83 * // create a new map by passing HTMLElement
84 * let element: HTMLElement = document.getElementById('map');
85 *
86 * let map = new GoogleMap(element);
87 *
88 * // create LatLng object
89 * let ionic: GoogleMapsLatLng = new GoogleMapsLatLng(43.0741904,-89.3809802);
90 *
91 * // create CameraPosition
92 * let position: CameraPosition = {
93 * target: ionic,
94 * zoom: 18,
95 * tilt: 30
96 * };
97 *
98 * // listen to MAP_READY event
99 * map.one(GoogleMapsEvent.MAP_READY).then(() => {
100 * // move the map's camera to position
101 * map.moveCamera(position); // works on iOS and Android
102 * });
103 *
104 *
105 * // create new marker
106 * let markerOptions: GoogleMapsMarkerOptions = {
107 * position: ionic,
108 * title: 'Ionic'
109 * };
110 *
111 * map.addMarker(markerOptions)
112 * .then((marker: GoogleMapsMarker) => {
113 * marker.showInfoWindow();
114 * });
115 * }
116 * });
117 * }
118 * ```
119 */
120var GoogleMap = (function () {
121 function GoogleMap(element, options) {
122 if (!!plugin_1.getPlugin('plugin.google.maps.Map')) {
123 if (typeof element === 'string') {
124 element = document.getElementById(element);
125 }
126 this._objectInstance = plugin.google.maps.Map.getMap(element, options);
127 }
128 else {
129 plugin_1.pluginWarn({
130 pluginName: 'GoogleMap',
131 plugin: 'plugin.google.maps.Map'
132 });
133 }
134 }
135 /**
136 * Checks if a map object has been created and is available.
137 *
138 * @returns {Promise<boolean>}
139 */
140 GoogleMap.isAvailable = function () { return; };
141 /**
142 * Adds an event listener.
143 *
144 * @returns {Observable<any>}
145 */
146 GoogleMap.prototype.addEventListener = function (eventName) {
147 return Observable_1.Observable.fromEvent(this._objectInstance, eventName);
148 };
149 /**
150 * Adds an event listener that works once.
151 *
152 * @returns {Promise<any>}
153 */
154 GoogleMap.prototype.addListenerOnce = function (eventName) {
155 var _this = this;
156 if (!this._objectInstance) {
157 return Promise.reject({ error: 'plugin_not_installed' });
158 }
159 return new Promise(function (resolve) { return _this._objectInstance.addListenerOnce(eventName, resolve); });
160 };
161 /**
162 * Gets a value
163 * @param key
164 */
165 GoogleMap.prototype.get = function (key) { return; };
166 /**
167 * Sets a value
168 * @param key
169 * @param value
170 */
171 GoogleMap.prototype.set = function (key, value) { };
172 /**
173 * Listen to a map event.
174 *
175 * @returns {Observable<any>}
176 */
177 GoogleMap.prototype.on = function (eventName) {
178 var _this = this;
179 if (!this._objectInstance) {
180 return new Observable_1.Observable(function (observer) {
181 observer.error({ error: 'plugin_not_installed' });
182 });
183 }
184 return new Observable_1.Observable(function (observer) {
185 _this._objectInstance.on(eventName, observer.next.bind(observer));
186 return function () { return _this._objectInstance.off(event); };
187 });
188 };
189 /**
190 * Listen to a map event only once.
191 *
192 * @returns {Promise<any>}
193 */
194 GoogleMap.prototype.one = function (eventName) {
195 var _this = this;
196 if (!this._objectInstance) {
197 return Promise.reject({ error: 'plugin_not_installed' });
198 }
199 return new Promise(function (resolve) { return _this._objectInstance.one(eventName, resolve); });
200 };
201 /**
202 * Clears all stored values
203 */
204 GoogleMap.prototype.empty = function () { };
205 GoogleMap.prototype.setDebuggable = function (isDebuggable) { };
206 GoogleMap.prototype.setClickable = function (isClickable) { };
207 /**
208 * Get the position of the camera.
209 *
210 * @returns {Promise<CameraPosition>}
211 */
212 GoogleMap.prototype.getCameraPosition = function () { return; };
213 /**
214 * Get the location of the user.
215 *
216 * @returns {Promise<MyLocation>}
217 */
218 GoogleMap.prototype.getMyLocation = function (options) { return; };
219 /**
220 * Get the visible region.
221 *
222 * @returns {Promise<VisibleRegion>}
223 */
224 GoogleMap.prototype.getVisibleRegion = function () { return; };
225 GoogleMap.prototype.showDialog = function () { };
226 GoogleMap.prototype.closeDialog = function () { };
227 GoogleMap.prototype.getLicenseInfo = function () { return; };
228 GoogleMap.prototype.setCenter = function (latLng) { };
229 GoogleMap.prototype.setZoom = function (zoomLevel) { };
230 GoogleMap.prototype.setMapTypeId = function (mapTypeId) { };
231 GoogleMap.prototype.setTilt = function (tiltLevel) { };
232 /**
233 * @returns {Promise<any>}
234 */
235 GoogleMap.prototype.animateCamera = function (animateCameraOptions) { return; };
236 /**
237 * @returns {Promise<any>}
238 */
239 GoogleMap.prototype.moveCamera = function (cameraPosition) { return; };
240 GoogleMap.prototype.setMyLocationEnabled = function (enabled) { };
241 GoogleMap.prototype.setIndoorEnabled = function (enabled) { };
242 GoogleMap.prototype.setTrafficEnabled = function (enabled) { };
243 GoogleMap.prototype.setCompassEnabled = function (enabled) { };
244 GoogleMap.prototype.setAllGesturesEnabled = function (enabled) { };
245 /**
246 * @returns {Promise<GoogleMapsMarker | any>}
247 */
248 GoogleMap.prototype.addMarker = function (options) {
249 var _this = this;
250 if (!this._objectInstance) {
251 return Promise.reject({ error: 'plugin_not_installed' });
252 }
253 return new Promise(function (resolve, reject) {
254 _this._objectInstance.addMarker(options, function (marker) {
255 if (marker) {
256 resolve(new GoogleMapsMarker(marker));
257 }
258 else {
259 reject();
260 }
261 });
262 });
263 };
264 /**
265 * @returns {Promise<GoogleMapsCircle | any>}
266 */
267 GoogleMap.prototype.addCircle = function (options) {
268 var _this = this;
269 if (!this._objectInstance) {
270 return Promise.reject({ error: 'plugin_not_installed' });
271 }
272 return new Promise(function (resolve, reject) {
273 _this._objectInstance.addCircle(options, function (circle) {
274 if (circle) {
275 resolve(new GoogleMapsCircle(circle));
276 }
277 else {
278 reject();
279 }
280 });
281 });
282 };
283 /**
284 * @returns {Promise<GoogleMapsPolygon | any>}
285 */
286 GoogleMap.prototype.addPolygon = function (options) {
287 var _this = this;
288 if (!this._objectInstance) {
289 return Promise.reject({ error: 'plugin_not_installed' });
290 }
291 return new Promise(function (resolve, reject) {
292 _this._objectInstance.addPolygon(options, function (polygon) {
293 if (polygon) {
294 resolve(new GoogleMapsPolygon(polygon));
295 }
296 else {
297 reject();
298 }
299 });
300 });
301 };
302 /**
303 * @returns {Promise<GoogleMapsPolyline | any>}
304 */
305 GoogleMap.prototype.addPolyline = function (options) {
306 var _this = this;
307 if (!this._objectInstance) {
308 return Promise.reject({ error: 'plugin_not_installed' });
309 }
310 return new Promise(function (resolve, reject) {
311 _this._objectInstance.addPolyline(options, function (polyline) {
312 if (polyline) {
313 resolve(new GoogleMapsPolyline(polyline));
314 }
315 else {
316 reject();
317 }
318 });
319 });
320 };
321 /**
322 * @returns {Promise<GoogleMapsTileOverlay | any>}
323 */
324 GoogleMap.prototype.addTileOverlay = function (options) {
325 var _this = this;
326 if (!this._objectInstance) {
327 return Promise.reject({ error: 'plugin_not_installed' });
328 }
329 return new Promise(function (resolve, reject) {
330 _this._objectInstance.addTileOverlay(options, function (tileOverlay) {
331 if (tileOverlay) {
332 resolve(new GoogleMapsTileOverlay(tileOverlay));
333 }
334 else {
335 reject();
336 }
337 });
338 });
339 };
340 /**
341 * @returns {Promise<GoogleMapsGroundOverlay | any>}
342 */
343 GoogleMap.prototype.addGroundOverlay = function (options) {
344 var _this = this;
345 if (!this._objectInstance) {
346 return Promise.reject({ error: 'plugin_not_installed' });
347 }
348 return new Promise(function (resolve, reject) {
349 _this._objectInstance.addGroundOverlay(options, function (groundOverlay) {
350 if (groundOverlay) {
351 resolve(new GoogleMapsGroundOverlay(groundOverlay));
352 }
353 else {
354 reject();
355 }
356 });
357 });
358 };
359 /**
360 * @returns {Promise<GoogleMapsKmlOverlay | any>}
361 */
362 GoogleMap.prototype.addKmlOverlay = function (options) {
363 var _this = this;
364 if (!this._objectInstance) {
365 return Promise.reject({ error: 'plugin_not_installed' });
366 }
367 return new Promise(function (resolve, reject) {
368 _this._objectInstance.addKmlOverlay(options, function (kmlOverlay) {
369 if (kmlOverlay) {
370 resolve(new GoogleMapsKmlOverlay(kmlOverlay));
371 }
372 else {
373 reject();
374 }
375 });
376 });
377 };
378 GoogleMap.prototype.setDiv = function (domNode) { };
379 GoogleMap.prototype.setVisible = function (visible) { };
380 GoogleMap.prototype.setOptions = function (options) { };
381 GoogleMap.prototype.setBackgroundColor = function (backgroundColor) { };
382 GoogleMap.prototype.setPadding = function (top, right, bottom, left) { };
383 GoogleMap.prototype.clear = function () { };
384 GoogleMap.prototype.refreshLayout = function () { };
385 /**
386 * @returns {Promise<any>}
387 */
388 GoogleMap.prototype.fromLatLngToPoint = function (latLng, point) { return; };
389 /**
390 * @returns {Promise<GoogleMapsLatLng>}
391 */
392 GoogleMap.prototype.fromPointToLatLng = function (point, latLng) { return; };
393 /**
394 * @returns {Promise<any>}
395 */
396 GoogleMap.prototype.toDataURL = function () { return; };
397 GoogleMap.prototype.remove = function () { };
398 GoogleMap.prototype.panBy = function () { };
399 __decorate([
400 plugin_1.CordovaInstance({ sync: true })
401 ], GoogleMap.prototype, "get", null);
402 __decorate([
403 plugin_1.CordovaInstance({ sync: true })
404 ], GoogleMap.prototype, "set", null);
405 __decorate([
406 plugin_1.CordovaInstance({ sync: true })
407 ], GoogleMap.prototype, "empty", null);
408 __decorate([
409 plugin_1.CordovaInstance({ sync: true })
410 ], GoogleMap.prototype, "setDebuggable", null);
411 __decorate([
412 plugin_1.CordovaInstance({ sync: true })
413 ], GoogleMap.prototype, "setClickable", null);
414 __decorate([
415 plugin_1.CordovaInstance()
416 ], GoogleMap.prototype, "getCameraPosition", null);
417 __decorate([
418 plugin_1.CordovaInstance()
419 ], GoogleMap.prototype, "getMyLocation", null);
420 __decorate([
421 plugin_1.CordovaInstance()
422 ], GoogleMap.prototype, "getVisibleRegion", null);
423 __decorate([
424 plugin_1.CordovaInstance({ sync: true })
425 ], GoogleMap.prototype, "showDialog", null);
426 __decorate([
427 plugin_1.CordovaInstance({ sync: true })
428 ], GoogleMap.prototype, "closeDialog", null);
429 __decorate([
430 plugin_1.CordovaInstance()
431 ], GoogleMap.prototype, "getLicenseInfo", null);
432 __decorate([
433 plugin_1.CordovaInstance({ sync: true })
434 ], GoogleMap.prototype, "setCenter", null);
435 __decorate([
436 plugin_1.CordovaInstance({ sync: true })
437 ], GoogleMap.prototype, "setZoom", null);
438 __decorate([
439 plugin_1.CordovaInstance({ sync: true })
440 ], GoogleMap.prototype, "setMapTypeId", null);
441 __decorate([
442 plugin_1.CordovaInstance({ sync: true })
443 ], GoogleMap.prototype, "setTilt", null);
444 __decorate([
445 plugin_1.CordovaInstance()
446 ], GoogleMap.prototype, "animateCamera", null);
447 __decorate([
448 plugin_1.CordovaInstance()
449 ], GoogleMap.prototype, "moveCamera", null);
450 __decorate([
451 plugin_1.CordovaInstance({ sync: true })
452 ], GoogleMap.prototype, "setMyLocationEnabled", null);
453 __decorate([
454 plugin_1.CordovaInstance({ sync: true })
455 ], GoogleMap.prototype, "setIndoorEnabled", null);
456 __decorate([
457 plugin_1.CordovaInstance({ sync: true })
458 ], GoogleMap.prototype, "setTrafficEnabled", null);
459 __decorate([
460 plugin_1.CordovaInstance({ sync: true })
461 ], GoogleMap.prototype, "setCompassEnabled", null);
462 __decorate([
463 plugin_1.CordovaInstance({ sync: true })
464 ], GoogleMap.prototype, "setAllGesturesEnabled", null);
465 __decorate([
466 plugin_1.CordovaInstance({ sync: true })
467 ], GoogleMap.prototype, "setDiv", null);
468 __decorate([
469 plugin_1.CordovaInstance({ sync: true })
470 ], GoogleMap.prototype, "setVisible", null);
471 __decorate([
472 plugin_1.CordovaInstance({ sync: true })
473 ], GoogleMap.prototype, "setOptions", null);
474 __decorate([
475 plugin_1.CordovaInstance({ sync: true })
476 ], GoogleMap.prototype, "setBackgroundColor", null);
477 __decorate([
478 plugin_1.CordovaInstance({ sync: true })
479 ], GoogleMap.prototype, "setPadding", null);
480 __decorate([
481 plugin_1.CordovaInstance({ sync: true })
482 ], GoogleMap.prototype, "clear", null);
483 __decorate([
484 plugin_1.CordovaInstance({ sync: true })
485 ], GoogleMap.prototype, "refreshLayout", null);
486 __decorate([
487 plugin_1.CordovaInstance()
488 ], GoogleMap.prototype, "fromLatLngToPoint", null);
489 __decorate([
490 plugin_1.CordovaInstance()
491 ], GoogleMap.prototype, "fromPointToLatLng", null);
492 __decorate([
493 plugin_1.CordovaInstance()
494 ], GoogleMap.prototype, "toDataURL", null);
495 __decorate([
496 plugin_1.CordovaInstance({ sync: true })
497 ], GoogleMap.prototype, "remove", null);
498 __decorate([
499 plugin_1.CordovaInstance({ sync: true })
500 ], GoogleMap.prototype, "panBy", null);
501 __decorate([
502 plugin_1.Cordova()
503 ], GoogleMap, "isAvailable", null);
504 GoogleMap = __decorate([
505 plugin_1.Plugin({
506 pluginName: 'GoogleMap',
507 pluginRef: 'plugin.google.maps.Map',
508 plugin: 'cordova-plugin-googlemaps',
509 repo: 'https://github.com/mapsplugin/cordova-plugin-googlemaps',
510 install: 'ionic plugin add cordova-plugin-googlemaps --variable API_KEY_FOR_ANDROID="YOUR_ANDROID_API_KEY_IS_HERE" --variable API_KEY_FOR_IOS="YOUR_IOS_API_KEY_IS_HERE"'
511 })
512 ], GoogleMap);
513 return GoogleMap;
514}());
515exports.GoogleMap = GoogleMap;
516/**
517 * @private
518 */
519var GoogleMapsMarker = (function () {
520 function GoogleMapsMarker(_objectInstance) {
521 this._objectInstance = _objectInstance;
522 }
523 /**
524 * Adds an event listener.
525 *
526 * @returns {Observable<any>}
527 */
528 GoogleMapsMarker.prototype.addEventListener = function (eventName) {
529 return Observable_1.Observable.fromEvent(this._objectInstance, eventName);
530 };
531 /**
532 * Adds an event listener that works once.
533 *
534 * @returns {Promise<any>}
535 */
536 GoogleMapsMarker.prototype.addListenerOnce = function (eventName) {
537 var _this = this;
538 if (!this._objectInstance) {
539 return Promise.reject({ error: 'plugin_not_installed' });
540 }
541 return new Promise(function (resolve) { return _this._objectInstance.addListenerOnce(eventName, resolve); });
542 };
543 /**
544 * Gets a value
545 * @param key
546 */
547 GoogleMapsMarker.prototype.get = function (key) { return; };
548 /**
549 * Sets a value
550 * @param key
551 * @param value
552 */
553 GoogleMapsMarker.prototype.set = function (key, value) { };
554 /**
555 * Listen to a map event.
556 *
557 * @returns {Observable<any>}
558 */
559 GoogleMapsMarker.prototype.on = function (eventName) {
560 var _this = this;
561 if (!this._objectInstance) {
562 return new Observable_1.Observable(function (observer) {
563 observer.error({ error: 'plugin_not_installed' });
564 });
565 }
566 return new Observable_1.Observable(function (observer) {
567 _this._objectInstance.on(eventName, observer.next.bind(observer));
568 return function () { return _this._objectInstance.off(event); };
569 });
570 };
571 /**
572 * Listen to a map event only once.
573 *
574 * @returns {Promise<any>}
575 */
576 GoogleMapsMarker.prototype.one = function (eventName) {
577 var _this = this;
578 if (!this._objectInstance) {
579 return Promise.reject({ error: 'plugin_not_installed' });
580 }
581 return new Promise(function (resolve) { return _this._objectInstance.one(eventName, resolve); });
582 };
583 /**
584 * Clears all stored values
585 */
586 GoogleMapsMarker.prototype.empty = function () { };
587 /**
588 * Return true if the marker is visible
589 */
590 GoogleMapsMarker.prototype.isVisible = function () { return; };
591 /**
592 * Set false if you want to hide the marker.
593 * @param visible
594 */
595 GoogleMapsMarker.prototype.setVisible = function (visible) { };
596 /**
597 * Return the marker hash code.
598 * @return {string} Marker hash code
599 */
600 GoogleMapsMarker.prototype.getHashCode = function () { return; };
601 /**
602 * Remove the marker completely.
603 */
604 GoogleMapsMarker.prototype.remove = function () { };
605 /**
606 * Change the marker opacity.
607 * @param alpha {number} Opacity
608 */
609 GoogleMapsMarker.prototype.setOpacity = function (alpha) { };
610 /**
611 * Return the marker opacity.
612 * @return {number} Opacity
613 */
614 GoogleMapsMarker.prototype.getOpacity = function () { return; };
615 /**
616 * iOS only, Plugin Version >= 1.3.3 Higher zIndex value overlays will be drawn on top of lower zIndex value tile layers and overlays. (You're able to run this on Android, but it will have no effect)
617 * @return {number}
618 */
619 GoogleMapsMarker.prototype.setZIndex = function () { return; };
620 /**
621 * Change the info window anchor. This defaults to 50% from the left of the image and at the bottom of the image.
622 * @param x {number}
623 * @param y {number}
624 */
625 GoogleMapsMarker.prototype.setIconAnchor = function (x, y) { };
626 /**
627 * Change the info window anchor. This defaults to 50% from the left of the image and at the top of the image.
628 * @param x {number}
629 * @param y {number}
630 */
631 GoogleMapsMarker.prototype.setInfoWindowAnchor = function (x, y) { };
632 /**
633 * Set true if you allows all users to drag the marker.
634 * @param draggable {boolean}
635 */
636 GoogleMapsMarker.prototype.setDraggable = function (draggable) { };
637 /**
638 * Return true if the marker drag is enabled.
639 * @return {boolean}
640 */
641 GoogleMapsMarker.prototype.isDraggable = function () { return; };
642 /**
643 * Set true if you want to be flat marker.
644 * @param flat {boolean}
645 */
646 GoogleMapsMarker.prototype.setFlat = function (flat) { return; };
647 /**
648 * Change icon url and/or size
649 * @param icon
650 */
651 GoogleMapsMarker.prototype.setIcon = function (icon) { return; };
652 /**
653 * Change title of the infoWindow.
654 * @param title {string}
655 */
656 GoogleMapsMarker.prototype.setTitle = function (title) { };
657 /**
658 * Return the title strings.
659 * @return {string}
660 */
661 GoogleMapsMarker.prototype.getTitle = function () { return; };
662 /**
663 * Change snippet of the infoWindow.
664 * @param snippet {string}
665 */
666 GoogleMapsMarker.prototype.setSnippet = function (snippet) { };
667 /**
668 * Return the snippet strings.
669 * @return {string}
670 */
671 GoogleMapsMarker.prototype.getSnippet = function () { return; };
672 /**
673 * Set the marker rotation angle.
674 * @param rotation {number}
675 */
676 GoogleMapsMarker.prototype.setRotation = function (rotation) { };
677 /**
678 * Return the marker rotation angle.
679 * @return {number}
680 */
681 GoogleMapsMarker.prototype.getRotation = function () { return; };
682 /**
683 * Show the infoWindow of the marker.
684 * @return {number}
685 */
686 GoogleMapsMarker.prototype.showInfoWindow = function () { return; };
687 /**
688 * Hide the infoWindow of the marker.
689 * @return {number}
690 */
691 GoogleMapsMarker.prototype.hideInfoWindow = function () { return; };
692 /**
693 * Set the marker position.
694 * @param latLng {GoogleMapLatLng}
695 */
696 GoogleMapsMarker.prototype.setPosition = function (latLng) { return; };
697 /**
698 * Return the marker position.
699 * @return {Promise<GoogleMapLatLng>}
700 */
701 GoogleMapsMarker.prototype.getPosition = function () { return; };
702 /**
703 * Return the map instance.
704 * @return {GoogleMap}
705 */
706 GoogleMapsMarker.prototype.getMap = function () { return; };
707 /**
708 * Specify the animation either `DROP` or `BOUNCE`
709 * @param animation {string}
710 */
711 GoogleMapsMarker.prototype.setAnimation = function (animation) { };
712 __decorate([
713 plugin_1.CordovaInstance({ sync: true })
714 ], GoogleMapsMarker.prototype, "get", null);
715 __decorate([
716 plugin_1.CordovaInstance({ sync: true })
717 ], GoogleMapsMarker.prototype, "set", null);
718 __decorate([
719 plugin_1.CordovaInstance({ sync: true })
720 ], GoogleMapsMarker.prototype, "empty", null);
721 __decorate([
722 plugin_1.CordovaInstance({ sync: true })
723 ], GoogleMapsMarker.prototype, "isVisible", null);
724 __decorate([
725 plugin_1.CordovaInstance()
726 ], GoogleMapsMarker.prototype, "setVisible", null);
727 __decorate([
728 plugin_1.CordovaInstance({ sync: true })
729 ], GoogleMapsMarker.prototype, "getHashCode", null);
730 __decorate([
731 plugin_1.CordovaInstance({ sync: true })
732 ], GoogleMapsMarker.prototype, "remove", null);
733 __decorate([
734 plugin_1.CordovaInstance({ sync: true })
735 ], GoogleMapsMarker.prototype, "setOpacity", null);
736 __decorate([
737 plugin_1.CordovaInstance({ sync: true })
738 ], GoogleMapsMarker.prototype, "getOpacity", null);
739 __decorate([
740 plugin_1.CordovaInstance({ sync: true })
741 ], GoogleMapsMarker.prototype, "setZIndex", null);
742 __decorate([
743 plugin_1.CordovaInstance({ sync: true })
744 ], GoogleMapsMarker.prototype, "setIconAnchor", null);
745 __decorate([
746 plugin_1.CordovaInstance({ sync: true })
747 ], GoogleMapsMarker.prototype, "setInfoWindowAnchor", null);
748 __decorate([
749 plugin_1.CordovaInstance({ sync: true })
750 ], GoogleMapsMarker.prototype, "setDraggable", null);
751 __decorate([
752 plugin_1.CordovaInstance({ sync: true })
753 ], GoogleMapsMarker.prototype, "isDraggable", null);
754 __decorate([
755 plugin_1.CordovaInstance({ sync: true })
756 ], GoogleMapsMarker.prototype, "setFlat", null);
757 __decorate([
758 plugin_1.CordovaInstance({ sync: true })
759 ], GoogleMapsMarker.prototype, "setIcon", null);
760 __decorate([
761 plugin_1.CordovaInstance({ sync: true })
762 ], GoogleMapsMarker.prototype, "setTitle", null);
763 __decorate([
764 plugin_1.CordovaInstance({ sync: true })
765 ], GoogleMapsMarker.prototype, "getTitle", null);
766 __decorate([
767 plugin_1.CordovaInstance({ sync: true })
768 ], GoogleMapsMarker.prototype, "setSnippet", null);
769 __decorate([
770 plugin_1.CordovaInstance({ sync: true })
771 ], GoogleMapsMarker.prototype, "getSnippet", null);
772 __decorate([
773 plugin_1.CordovaInstance({ sync: true })
774 ], GoogleMapsMarker.prototype, "setRotation", null);
775 __decorate([
776 plugin_1.CordovaInstance({ sync: true })
777 ], GoogleMapsMarker.prototype, "getRotation", null);
778 __decorate([
779 plugin_1.CordovaInstance({ sync: true })
780 ], GoogleMapsMarker.prototype, "showInfoWindow", null);
781 __decorate([
782 plugin_1.CordovaInstance({ sync: true })
783 ], GoogleMapsMarker.prototype, "hideInfoWindow", null);
784 __decorate([
785 plugin_1.CordovaInstance({ sync: true })
786 ], GoogleMapsMarker.prototype, "setPosition", null);
787 __decorate([
788 plugin_1.CordovaInstance()
789 ], GoogleMapsMarker.prototype, "getPosition", null);
790 __decorate([
791 plugin_1.CordovaInstance({ sync: true })
792 ], GoogleMapsMarker.prototype, "getMap", null);
793 __decorate([
794 plugin_1.CordovaInstance({ sync: true })
795 ], GoogleMapsMarker.prototype, "setAnimation", null);
796 return GoogleMapsMarker;
797}());
798exports.GoogleMapsMarker = GoogleMapsMarker;
799/**
800 * @private
801 */
802var GoogleMapsCircle = (function () {
803 function GoogleMapsCircle(_objectInstance) {
804 this._objectInstance = _objectInstance;
805 }
806 /**
807 * Adds an event listener.
808 *
809 * @returns {Observable<any>}
810 */
811 GoogleMapsCircle.prototype.addEventListener = function (eventName) {
812 return Observable_1.Observable.fromEvent(this._objectInstance, eventName);
813 };
814 /**
815 * Adds an event listener that works once.
816 *
817 * @returns {Promise<any>}
818 */
819 GoogleMapsCircle.prototype.addListenerOnce = function (eventName) {
820 var _this = this;
821 if (!this._objectInstance) {
822 return Promise.reject({ error: 'plugin_not_installed' });
823 }
824 return new Promise(function (resolve) { return _this._objectInstance.addListenerOnce(eventName, resolve); });
825 };
826 /**
827 * Gets a value
828 * @param key
829 */
830 GoogleMapsCircle.prototype.get = function (key) { return; };
831 /**
832 * Sets a value
833 * @param key
834 * @param value
835 */
836 GoogleMapsCircle.prototype.set = function (key, value) { };
837 /**
838 * Listen to a map event.
839 *
840 * @returns {Observable<any>}
841 */
842 GoogleMapsCircle.prototype.on = function (eventName) {
843 var _this = this;
844 if (!this._objectInstance) {
845 return new Observable_1.Observable(function (observer) {
846 observer.error({ error: 'plugin_not_installed' });
847 });
848 }
849 return new Observable_1.Observable(function (observer) {
850 _this._objectInstance.on(eventName, observer.next.bind(observer));
851 return function () { return _this._objectInstance.off(event); };
852 });
853 };
854 /**
855 * Listen to a map event only once.
856 *
857 * @returns {Promise<any>}
858 */
859 GoogleMapsCircle.prototype.one = function (eventName) {
860 var _this = this;
861 if (!this._objectInstance) {
862 return Promise.reject({ error: 'plugin_not_installed' });
863 }
864 return new Promise(function (resolve) { return _this._objectInstance.one(eventName, resolve); });
865 };
866 /**
867 * Clears all stored values
868 */
869 GoogleMapsCircle.prototype.empty = function () { };
870 GoogleMapsCircle.prototype.getCenter = function () { return; };
871 GoogleMapsCircle.prototype.getRadius = function () { return; };
872 GoogleMapsCircle.prototype.getStrokeColor = function () { return; };
873 GoogleMapsCircle.prototype.getVisible = function () { return; };
874 GoogleMapsCircle.prototype.getZIndex = function () { return; };
875 GoogleMapsCircle.prototype.remove = function () { };
876 GoogleMapsCircle.prototype.setCenter = function (latLng) { };
877 GoogleMapsCircle.prototype.setFillColor = function (fillColor) { };
878 GoogleMapsCircle.prototype.setStrokeColor = function (strokeColor) { };
879 GoogleMapsCircle.prototype.setStrokeWidth = function (strokeWidth) { };
880 GoogleMapsCircle.prototype.setVisible = function (visible) { };
881 GoogleMapsCircle.prototype.setZIndex = function (zIndex) { };
882 GoogleMapsCircle.prototype.setRadius = function (radius) { };
883 GoogleMapsCircle.prototype.getMap = function () { return; };
884 __decorate([
885 plugin_1.CordovaInstance({ sync: true })
886 ], GoogleMapsCircle.prototype, "get", null);
887 __decorate([
888 plugin_1.CordovaInstance({ sync: true })
889 ], GoogleMapsCircle.prototype, "set", null);
890 __decorate([
891 plugin_1.CordovaInstance({ sync: true })
892 ], GoogleMapsCircle.prototype, "empty", null);
893 __decorate([
894 plugin_1.CordovaInstance({ sync: true })
895 ], GoogleMapsCircle.prototype, "getCenter", null);
896 __decorate([
897 plugin_1.CordovaInstance({ sync: true })
898 ], GoogleMapsCircle.prototype, "getRadius", null);
899 __decorate([
900 plugin_1.CordovaInstance({ sync: true })
901 ], GoogleMapsCircle.prototype, "getStrokeColor", null);
902 __decorate([
903 plugin_1.CordovaInstance({ sync: true })
904 ], GoogleMapsCircle.prototype, "getVisible", null);
905 __decorate([
906 plugin_1.CordovaInstance({ sync: true })
907 ], GoogleMapsCircle.prototype, "getZIndex", null);
908 __decorate([
909 plugin_1.CordovaInstance({ sync: true })
910 ], GoogleMapsCircle.prototype, "remove", null);
911 __decorate([
912 plugin_1.CordovaInstance({ sync: true })
913 ], GoogleMapsCircle.prototype, "setCenter", null);
914 __decorate([
915 plugin_1.CordovaInstance({ sync: true })
916 ], GoogleMapsCircle.prototype, "setFillColor", null);
917 __decorate([
918 plugin_1.CordovaInstance({ sync: true })
919 ], GoogleMapsCircle.prototype, "setStrokeColor", null);
920 __decorate([
921 plugin_1.CordovaInstance({ sync: true })
922 ], GoogleMapsCircle.prototype, "setStrokeWidth", null);
923 __decorate([
924 plugin_1.CordovaInstance({ sync: true })
925 ], GoogleMapsCircle.prototype, "setVisible", null);
926 __decorate([
927 plugin_1.CordovaInstance({ sync: true })
928 ], GoogleMapsCircle.prototype, "setZIndex", null);
929 __decorate([
930 plugin_1.CordovaInstance({ sync: true })
931 ], GoogleMapsCircle.prototype, "setRadius", null);
932 __decorate([
933 plugin_1.CordovaInstance({ sync: true })
934 ], GoogleMapsCircle.prototype, "getMap", null);
935 return GoogleMapsCircle;
936}());
937exports.GoogleMapsCircle = GoogleMapsCircle;
938/**
939 * @private
940 */
941var GoogleMapsPolyline = (function () {
942 function GoogleMapsPolyline(_objectInstance) {
943 this._objectInstance = _objectInstance;
944 }
945 /**
946 * Adds an event listener.
947 *
948 * @returns {Observable<any>}
949 */
950 GoogleMapsPolyline.prototype.addEventListener = function (eventName) {
951 return Observable_1.Observable.fromEvent(this._objectInstance, eventName);
952 };
953 /**
954 * Adds an event listener that works once.
955 *
956 * @returns {Promise<any>}
957 */
958 GoogleMapsPolyline.prototype.addListenerOnce = function (eventName) {
959 var _this = this;
960 if (!this._objectInstance) {
961 return Promise.reject({ error: 'plugin_not_installed' });
962 }
963 return new Promise(function (resolve) { return _this._objectInstance.addListenerOnce(eventName, resolve); });
964 };
965 /**
966 * Gets a value
967 * @param key
968 */
969 GoogleMapsPolyline.prototype.get = function (key) { return; };
970 /**
971 * Sets a value
972 * @param key
973 * @param value
974 */
975 GoogleMapsPolyline.prototype.set = function (key, value) { };
976 /**
977 * Listen to a map event.
978 *
979 * @returns {Observable<any>}
980 */
981 GoogleMapsPolyline.prototype.on = function (eventName) {
982 var _this = this;
983 if (!this._objectInstance) {
984 return new Observable_1.Observable(function (observer) {
985 observer.error({ error: 'plugin_not_installed' });
986 });
987 }
988 return new Observable_1.Observable(function (observer) {
989 _this._objectInstance.on(eventName, observer.next.bind(observer));
990 return function () { return _this._objectInstance.off(event); };
991 });
992 };
993 /**
994 * Listen to a map event only once.
995 *
996 * @returns {Promise<any>}
997 */
998 GoogleMapsPolyline.prototype.one = function (eventName) {
999 var _this = this;
1000 if (!this._objectInstance) {
1001 return Promise.reject({ error: 'plugin_not_installed' });
1002 }
1003 return new Promise(function (resolve) { return _this._objectInstance.one(eventName, resolve); });
1004 };
1005 /**
1006 * Clears all stored values
1007 */
1008 GoogleMapsPolyline.prototype.empty = function () { };
1009 GoogleMapsPolyline.prototype.getPoints = function () { return; };
1010 GoogleMapsPolyline.prototype.getCOlor = function () { return; };
1011 GoogleMapsPolyline.prototype.getWidth = function () { return; };
1012 GoogleMapsPolyline.prototype.getGeodesic = function () { return; };
1013 GoogleMapsPolyline.prototype.getZIndex = function () { return; };
1014 GoogleMapsPolyline.prototype.remove = function () { };
1015 GoogleMapsPolyline.prototype.setPoints = function (points) { };
1016 GoogleMapsPolyline.prototype.setColor = function (color) { };
1017 GoogleMapsPolyline.prototype.setWidth = function (width) { };
1018 GoogleMapsPolyline.prototype.setVisible = function (visible) { };
1019 GoogleMapsPolyline.prototype.setZIndex = function (zIndex) { };
1020 GoogleMapsPolyline.prototype.setGeoDesic = function (geoDesic) { };
1021 GoogleMapsPolyline.prototype.getMap = function () { return; };
1022 __decorate([
1023 plugin_1.CordovaInstance({ sync: true })
1024 ], GoogleMapsPolyline.prototype, "get", null);
1025 __decorate([
1026 plugin_1.CordovaInstance({ sync: true })
1027 ], GoogleMapsPolyline.prototype, "set", null);
1028 __decorate([
1029 plugin_1.CordovaInstance({ sync: true })
1030 ], GoogleMapsPolyline.prototype, "empty", null);
1031 __decorate([
1032 plugin_1.CordovaInstance({ sync: true })
1033 ], GoogleMapsPolyline.prototype, "getPoints", null);
1034 __decorate([
1035 plugin_1.CordovaInstance({ sync: true })
1036 ], GoogleMapsPolyline.prototype, "getCOlor", null);
1037 __decorate([
1038 plugin_1.CordovaInstance({ sync: true })
1039 ], GoogleMapsPolyline.prototype, "getWidth", null);
1040 __decorate([
1041 plugin_1.CordovaInstance({ sync: true })
1042 ], GoogleMapsPolyline.prototype, "getGeodesic", null);
1043 __decorate([
1044 plugin_1.CordovaInstance({ sync: true })
1045 ], GoogleMapsPolyline.prototype, "getZIndex", null);
1046 __decorate([
1047 plugin_1.CordovaInstance({ sync: true })
1048 ], GoogleMapsPolyline.prototype, "remove", null);
1049 __decorate([
1050 plugin_1.CordovaInstance({ sync: true })
1051 ], GoogleMapsPolyline.prototype, "setPoints", null);
1052 __decorate([
1053 plugin_1.CordovaInstance({ sync: true })
1054 ], GoogleMapsPolyline.prototype, "setColor", null);
1055 __decorate([
1056 plugin_1.CordovaInstance({ sync: true })
1057 ], GoogleMapsPolyline.prototype, "setWidth", null);
1058 __decorate([
1059 plugin_1.CordovaInstance({ sync: true })
1060 ], GoogleMapsPolyline.prototype, "setVisible", null);
1061 __decorate([
1062 plugin_1.CordovaInstance({ sync: true })
1063 ], GoogleMapsPolyline.prototype, "setZIndex", null);
1064 __decorate([
1065 plugin_1.CordovaInstance({ sync: true })
1066 ], GoogleMapsPolyline.prototype, "setGeoDesic", null);
1067 __decorate([
1068 plugin_1.CordovaInstance({ sync: true })
1069 ], GoogleMapsPolyline.prototype, "getMap", null);
1070 return GoogleMapsPolyline;
1071}());
1072exports.GoogleMapsPolyline = GoogleMapsPolyline;
1073/**
1074 * @private
1075 */
1076var GoogleMapsPolygon = (function () {
1077 function GoogleMapsPolygon(_objectInstance) {
1078 this._objectInstance = _objectInstance;
1079 }
1080 /**
1081 * Adds an event listener.
1082 *
1083 * @returns {Observable<any>}
1084 */
1085 GoogleMapsPolygon.prototype.addEventListener = function (eventName) {
1086 return Observable_1.Observable.fromEvent(this._objectInstance, eventName);
1087 };
1088 /**
1089 * Adds an event listener that works once.
1090 *
1091 * @returns {Promise<any>}
1092 */
1093 GoogleMapsPolygon.prototype.addListenerOnce = function (eventName) {
1094 var _this = this;
1095 if (!this._objectInstance) {
1096 return Promise.reject({ error: 'plugin_not_installed' });
1097 }
1098 return new Promise(function (resolve) { return _this._objectInstance.addListenerOnce(eventName, resolve); });
1099 };
1100 /**
1101 * Gets a value
1102 * @param key
1103 */
1104 GoogleMapsPolygon.prototype.get = function (key) { return; };
1105 /**
1106 * Sets a value
1107 * @param key
1108 * @param value
1109 */
1110 GoogleMapsPolygon.prototype.set = function (key, value) { };
1111 /**
1112 * Listen to a map event.
1113 *
1114 * @returns {Observable<any>}
1115 */
1116 GoogleMapsPolygon.prototype.on = function (eventName) {
1117 var _this = this;
1118 if (!this._objectInstance) {
1119 return new Observable_1.Observable(function (observer) {
1120 observer.error({ error: 'plugin_not_installed' });
1121 });
1122 }
1123 return new Observable_1.Observable(function (observer) {
1124 _this._objectInstance.on(eventName, observer.next.bind(observer));
1125 return function () { return _this._objectInstance.off(event); };
1126 });
1127 };
1128 /**
1129 * Listen to a map event only once.
1130 *
1131 * @returns {Promise<any>}
1132 */
1133 GoogleMapsPolygon.prototype.one = function (eventName) {
1134 var _this = this;
1135 if (!this._objectInstance) {
1136 return Promise.reject({ error: 'plugin_not_installed' });
1137 }
1138 return new Promise(function (resolve) { return _this._objectInstance.one(eventName, resolve); });
1139 };
1140 /**
1141 * Clears all stored values
1142 */
1143 GoogleMapsPolygon.prototype.empty = function () { };
1144 GoogleMapsPolygon.prototype.getPoints = function () { return; };
1145 GoogleMapsPolygon.prototype.getStrokeColor = function () { return; };
1146 GoogleMapsPolygon.prototype.getFillColor = function () { return; };
1147 GoogleMapsPolygon.prototype.getStrokeWidth = function () { return; };
1148 GoogleMapsPolygon.prototype.getGeodesic = function () { return; };
1149 GoogleMapsPolygon.prototype.getVisible = function () { return; };
1150 GoogleMapsPolygon.prototype.getZIndex = function () { return; };
1151 GoogleMapsPolygon.prototype.remove = function () { };
1152 GoogleMapsPolygon.prototype.setPoints = function (points) { };
1153 GoogleMapsPolygon.prototype.setStrokeColor = function (strokeColor) { };
1154 GoogleMapsPolygon.prototype.setFillColor = function (fillColor) { };
1155 GoogleMapsPolygon.prototype.setStrokeWidth = function (strokeWidth) { };
1156 GoogleMapsPolygon.prototype.setVisible = function (visible) { };
1157 GoogleMapsPolygon.prototype.setZIndex = function (zIndex) { };
1158 GoogleMapsPolygon.prototype.setGeodesic = function (geodesic) { };
1159 __decorate([
1160 plugin_1.CordovaInstance({ sync: true })
1161 ], GoogleMapsPolygon.prototype, "get", null);
1162 __decorate([
1163 plugin_1.CordovaInstance({ sync: true })
1164 ], GoogleMapsPolygon.prototype, "set", null);
1165 __decorate([
1166 plugin_1.CordovaInstance({ sync: true })
1167 ], GoogleMapsPolygon.prototype, "empty", null);
1168 __decorate([
1169 plugin_1.CordovaInstance({ sync: true })
1170 ], GoogleMapsPolygon.prototype, "getPoints", null);
1171 __decorate([
1172 plugin_1.CordovaInstance({ sync: true })
1173 ], GoogleMapsPolygon.prototype, "getStrokeColor", null);
1174 __decorate([
1175 plugin_1.CordovaInstance({ sync: true })
1176 ], GoogleMapsPolygon.prototype, "getFillColor", null);
1177 __decorate([
1178 plugin_1.CordovaInstance({ sync: true })
1179 ], GoogleMapsPolygon.prototype, "getStrokeWidth", null);
1180 __decorate([
1181 plugin_1.CordovaInstance({ sync: true })
1182 ], GoogleMapsPolygon.prototype, "getGeodesic", null);
1183 __decorate([
1184 plugin_1.CordovaInstance({ sync: true })
1185 ], GoogleMapsPolygon.prototype, "getVisible", null);
1186 __decorate([
1187 plugin_1.CordovaInstance({ sync: true })
1188 ], GoogleMapsPolygon.prototype, "getZIndex", null);
1189 __decorate([
1190 plugin_1.CordovaInstance({ sync: true })
1191 ], GoogleMapsPolygon.prototype, "remove", null);
1192 __decorate([
1193 plugin_1.CordovaInstance({ sync: true })
1194 ], GoogleMapsPolygon.prototype, "setPoints", null);
1195 __decorate([
1196 plugin_1.CordovaInstance({ sync: true })
1197 ], GoogleMapsPolygon.prototype, "setStrokeColor", null);
1198 __decorate([
1199 plugin_1.CordovaInstance({ sync: true })
1200 ], GoogleMapsPolygon.prototype, "setFillColor", null);
1201 __decorate([
1202 plugin_1.CordovaInstance({ sync: true })
1203 ], GoogleMapsPolygon.prototype, "setStrokeWidth", null);
1204 __decorate([
1205 plugin_1.CordovaInstance({ sync: true })
1206 ], GoogleMapsPolygon.prototype, "setVisible", null);
1207 __decorate([
1208 plugin_1.CordovaInstance({ sync: true })
1209 ], GoogleMapsPolygon.prototype, "setZIndex", null);
1210 __decorate([
1211 plugin_1.CordovaInstance({ sync: true })
1212 ], GoogleMapsPolygon.prototype, "setGeodesic", null);
1213 return GoogleMapsPolygon;
1214}());
1215exports.GoogleMapsPolygon = GoogleMapsPolygon;
1216/**
1217 * @private
1218 */
1219var GoogleMapsTileOverlay = (function () {
1220 function GoogleMapsTileOverlay(_objectInstance) {
1221 this._objectInstance = _objectInstance;
1222 }
1223 /**
1224 * Adds an event listener.
1225 *
1226 * @returns {Observable<any>}
1227 */
1228 GoogleMapsTileOverlay.prototype.addEventListener = function (eventName) {
1229 return Observable_1.Observable.fromEvent(this._objectInstance, eventName);
1230 };
1231 /**
1232 * Adds an event listener that works once.
1233 *
1234 * @returns {Promise<any>}
1235 */
1236 GoogleMapsTileOverlay.prototype.addListenerOnce = function (eventName) {
1237 var _this = this;
1238 if (!this._objectInstance) {
1239 return Promise.reject({ error: 'plugin_not_installed' });
1240 }
1241 return new Promise(function (resolve) { return _this._objectInstance.addListenerOnce(eventName, resolve); });
1242 };
1243 /**
1244 * Gets a value
1245 * @param key
1246 */
1247 GoogleMapsTileOverlay.prototype.get = function (key) { return; };
1248 /**
1249 * Sets a value
1250 * @param key
1251 * @param value
1252 */
1253 GoogleMapsTileOverlay.prototype.set = function (key, value) { };
1254 /**
1255 * Listen to a map event.
1256 *
1257 * @returns {Observable<any>}
1258 */
1259 GoogleMapsTileOverlay.prototype.on = function (eventName) {
1260 var _this = this;
1261 if (!this._objectInstance) {
1262 return new Observable_1.Observable(function (observer) {
1263 observer.error({ error: 'plugin_not_installed' });
1264 });
1265 }
1266 return new Observable_1.Observable(function (observer) {
1267 _this._objectInstance.on(eventName, observer.next.bind(observer));
1268 return function () { return _this._objectInstance.off(event); };
1269 });
1270 };
1271 /**
1272 * Listen to a map event only once.
1273 *
1274 * @returns {Promise<any>}
1275 */
1276 GoogleMapsTileOverlay.prototype.one = function (eventName) {
1277 var _this = this;
1278 if (!this._objectInstance) {
1279 return Promise.reject({ error: 'plugin_not_installed' });
1280 }
1281 return new Promise(function (resolve) { return _this._objectInstance.one(eventName, resolve); });
1282 };
1283 /**
1284 * Clears all stored values
1285 */
1286 GoogleMapsTileOverlay.prototype.empty = function () { };
1287 GoogleMapsTileOverlay.prototype.getVisible = function () { return; };
1288 GoogleMapsTileOverlay.prototype.setVisible = function (visible) { };
1289 GoogleMapsTileOverlay.prototype.getFadeIn = function () { return; };
1290 GoogleMapsTileOverlay.prototype.setFadeIn = function (fadeIn) { };
1291 GoogleMapsTileOverlay.prototype.getZIndex = function () { return; };
1292 GoogleMapsTileOverlay.prototype.setZIndex = function (zIndex) { };
1293 GoogleMapsTileOverlay.prototype.getOpacity = function () { return; };
1294 GoogleMapsTileOverlay.prototype.setOpacity = function (opacity) { };
1295 GoogleMapsTileOverlay.prototype.clearTileCache = function () { };
1296 GoogleMapsTileOverlay.prototype.remove = function () { };
1297 __decorate([
1298 plugin_1.CordovaInstance({ sync: true })
1299 ], GoogleMapsTileOverlay.prototype, "get", null);
1300 __decorate([
1301 plugin_1.CordovaInstance({ sync: true })
1302 ], GoogleMapsTileOverlay.prototype, "set", null);
1303 __decorate([
1304 plugin_1.CordovaInstance({ sync: true })
1305 ], GoogleMapsTileOverlay.prototype, "empty", null);
1306 __decorate([
1307 plugin_1.CordovaInstance({ sync: true })
1308 ], GoogleMapsTileOverlay.prototype, "getVisible", null);
1309 __decorate([
1310 plugin_1.CordovaInstance({ sync: true })
1311 ], GoogleMapsTileOverlay.prototype, "setVisible", null);
1312 __decorate([
1313 plugin_1.CordovaInstance({ sync: true })
1314 ], GoogleMapsTileOverlay.prototype, "getFadeIn", null);
1315 __decorate([
1316 plugin_1.CordovaInstance({ sync: true })
1317 ], GoogleMapsTileOverlay.prototype, "setFadeIn", null);
1318 __decorate([
1319 plugin_1.CordovaInstance({ sync: true })
1320 ], GoogleMapsTileOverlay.prototype, "getZIndex", null);
1321 __decorate([
1322 plugin_1.CordovaInstance({ sync: true })
1323 ], GoogleMapsTileOverlay.prototype, "setZIndex", null);
1324 __decorate([
1325 plugin_1.CordovaInstance({ sync: true })
1326 ], GoogleMapsTileOverlay.prototype, "getOpacity", null);
1327 __decorate([
1328 plugin_1.CordovaInstance({ sync: true })
1329 ], GoogleMapsTileOverlay.prototype, "setOpacity", null);
1330 __decorate([
1331 plugin_1.CordovaInstance({ sync: true })
1332 ], GoogleMapsTileOverlay.prototype, "clearTileCache", null);
1333 __decorate([
1334 plugin_1.CordovaInstance({ sync: true })
1335 ], GoogleMapsTileOverlay.prototype, "remove", null);
1336 return GoogleMapsTileOverlay;
1337}());
1338exports.GoogleMapsTileOverlay = GoogleMapsTileOverlay;
1339/**
1340 * @private
1341 */
1342var GoogleMapsGroundOverlay = (function () {
1343 function GoogleMapsGroundOverlay(_objectInstance) {
1344 this._objectInstance = _objectInstance;
1345 }
1346 /**
1347 * Adds an event listener.
1348 *
1349 * @returns {Observable<any>}
1350 */
1351 GoogleMapsGroundOverlay.prototype.addEventListener = function (eventName) {
1352 return Observable_1.Observable.fromEvent(this._objectInstance, eventName);
1353 };
1354 /**
1355 * Adds an event listener that works once.
1356 *
1357 * @returns {Promise<any>}
1358 */
1359 GoogleMapsGroundOverlay.prototype.addListenerOnce = function (eventName) {
1360 var _this = this;
1361 if (!this._objectInstance) {
1362 return Promise.reject({ error: 'plugin_not_installed' });
1363 }
1364 return new Promise(function (resolve) { return _this._objectInstance.addListenerOnce(eventName, resolve); });
1365 };
1366 /**
1367 * Gets a value
1368 * @param key
1369 */
1370 GoogleMapsGroundOverlay.prototype.get = function (key) { return; };
1371 /**
1372 * Sets a value
1373 * @param key
1374 * @param value
1375 */
1376 GoogleMapsGroundOverlay.prototype.set = function (key, value) { };
1377 /**
1378 * Listen to a map event.
1379 *
1380 * @returns {Observable<any>}
1381 */
1382 GoogleMapsGroundOverlay.prototype.on = function (eventName) {
1383 var _this = this;
1384 if (!this._objectInstance) {
1385 return new Observable_1.Observable(function (observer) {
1386 observer.error({ error: 'plugin_not_installed' });
1387 });
1388 }
1389 return new Observable_1.Observable(function (observer) {
1390 _this._objectInstance.on(eventName, observer.next.bind(observer));
1391 return function () { return _this._objectInstance.off(event); };
1392 });
1393 };
1394 /**
1395 * Listen to a map event only once.
1396 *
1397 * @returns {Promise<any>}
1398 */
1399 GoogleMapsGroundOverlay.prototype.one = function (eventName) {
1400 var _this = this;
1401 if (!this._objectInstance) {
1402 return Promise.reject({ error: 'plugin_not_installed' });
1403 }
1404 return new Promise(function (resolve) { return _this._objectInstance.one(eventName, resolve); });
1405 };
1406 /**
1407 * Clears all stored values
1408 */
1409 GoogleMapsGroundOverlay.prototype.empty = function () { };
1410 GoogleMapsGroundOverlay.prototype.setBearing = function (bearing) { };
1411 GoogleMapsGroundOverlay.prototype.getBearing = function () { return; };
1412 GoogleMapsGroundOverlay.prototype.setOpacity = function (opacity) { };
1413 GoogleMapsGroundOverlay.prototype.getOpacity = function () { return; };
1414 GoogleMapsGroundOverlay.prototype.setVisible = function (visible) { };
1415 GoogleMapsGroundOverlay.prototype.getVisible = function () { return; };
1416 GoogleMapsGroundOverlay.prototype.setImage = function (image) { };
1417 ;
1418 GoogleMapsGroundOverlay.prototype.remove = function () { };
1419 __decorate([
1420 plugin_1.CordovaInstance({ sync: true })
1421 ], GoogleMapsGroundOverlay.prototype, "get", null);
1422 __decorate([
1423 plugin_1.CordovaInstance({ sync: true })
1424 ], GoogleMapsGroundOverlay.prototype, "set", null);
1425 __decorate([
1426 plugin_1.CordovaInstance({ sync: true })
1427 ], GoogleMapsGroundOverlay.prototype, "empty", null);
1428 __decorate([
1429 plugin_1.CordovaInstance({ sync: true })
1430 ], GoogleMapsGroundOverlay.prototype, "setBearing", null);
1431 __decorate([
1432 plugin_1.CordovaInstance({ sync: true })
1433 ], GoogleMapsGroundOverlay.prototype, "getBearing", null);
1434 __decorate([
1435 plugin_1.CordovaInstance({ sync: true })
1436 ], GoogleMapsGroundOverlay.prototype, "setOpacity", null);
1437 __decorate([
1438 plugin_1.CordovaInstance({ sync: true })
1439 ], GoogleMapsGroundOverlay.prototype, "getOpacity", null);
1440 __decorate([
1441 plugin_1.CordovaInstance({ sync: true })
1442 ], GoogleMapsGroundOverlay.prototype, "setVisible", null);
1443 __decorate([
1444 plugin_1.CordovaInstance({ sync: true })
1445 ], GoogleMapsGroundOverlay.prototype, "getVisible", null);
1446 __decorate([
1447 plugin_1.CordovaInstance({ sync: true })
1448 ], GoogleMapsGroundOverlay.prototype, "setImage", null);
1449 __decorate([
1450 plugin_1.CordovaInstance({ sync: true })
1451 ], GoogleMapsGroundOverlay.prototype, "remove", null);
1452 return GoogleMapsGroundOverlay;
1453}());
1454exports.GoogleMapsGroundOverlay = GoogleMapsGroundOverlay;
1455/**
1456 * @private
1457 */
1458var GoogleMapsKmlOverlay = (function () {
1459 function GoogleMapsKmlOverlay(_objectInstance) {
1460 this._objectInstance = _objectInstance;
1461 }
1462 /**
1463 * Adds an event listener.
1464 *
1465 * @returns {Observable<any>}
1466 */
1467 GoogleMapsKmlOverlay.prototype.addEventListener = function (eventName) {
1468 return Observable_1.Observable.fromEvent(this._objectInstance, eventName);
1469 };
1470 /**
1471 * Adds an event listener that works once.
1472 *
1473 * @returns {Promise<any>}
1474 */
1475 GoogleMapsKmlOverlay.prototype.addListenerOnce = function (eventName) {
1476 var _this = this;
1477 if (!this._objectInstance) {
1478 return Promise.reject({ error: 'plugin_not_installed' });
1479 }
1480 return new Promise(function (resolve) { return _this._objectInstance.addListenerOnce(eventName, resolve); });
1481 };
1482 /**
1483 * Gets a value
1484 * @param key
1485 */
1486 GoogleMapsKmlOverlay.prototype.get = function (key) { return; };
1487 /**
1488 * Sets a value
1489 * @param key
1490 * @param value
1491 */
1492 GoogleMapsKmlOverlay.prototype.set = function (key, value) { };
1493 /**
1494 * Listen to a map event.
1495 *
1496 * @returns {Observable<any>}
1497 */
1498 GoogleMapsKmlOverlay.prototype.on = function (eventName) {
1499 var _this = this;
1500 if (!this._objectInstance) {
1501 return new Observable_1.Observable(function (observer) {
1502 observer.error({ error: 'plugin_not_installed' });
1503 });
1504 }
1505 return new Observable_1.Observable(function (observer) {
1506 _this._objectInstance.on(eventName, observer.next.bind(observer));
1507 return function () { return _this._objectInstance.off(event); };
1508 });
1509 };
1510 /**
1511 * Listen to a map event only once.
1512 *
1513 * @returns {Promise<any>}
1514 */
1515 GoogleMapsKmlOverlay.prototype.one = function (eventName) {
1516 var _this = this;
1517 if (!this._objectInstance) {
1518 return Promise.reject({ error: 'plugin_not_installed' });
1519 }
1520 return new Promise(function (resolve) { return _this._objectInstance.one(eventName, resolve); });
1521 };
1522 /**
1523 * Clears all stored values
1524 */
1525 GoogleMapsKmlOverlay.prototype.empty = function () { };
1526 GoogleMapsKmlOverlay.prototype.remove = function () { };
1527 GoogleMapsKmlOverlay.prototype.getOverlays = function () { return; };
1528 __decorate([
1529 plugin_1.CordovaInstance({ sync: true })
1530 ], GoogleMapsKmlOverlay.prototype, "get", null);
1531 __decorate([
1532 plugin_1.CordovaInstance({ sync: true })
1533 ], GoogleMapsKmlOverlay.prototype, "set", null);
1534 __decorate([
1535 plugin_1.CordovaInstance({ sync: true })
1536 ], GoogleMapsKmlOverlay.prototype, "empty", null);
1537 __decorate([
1538 plugin_1.CordovaInstance({ sync: true })
1539 ], GoogleMapsKmlOverlay.prototype, "remove", null);
1540 __decorate([
1541 plugin_1.CordovaInstance({ sync: true })
1542 ], GoogleMapsKmlOverlay.prototype, "getOverlays", null);
1543 return GoogleMapsKmlOverlay;
1544}());
1545exports.GoogleMapsKmlOverlay = GoogleMapsKmlOverlay;
1546/**
1547 * @private
1548 */
1549var GoogleMapsLatLngBounds = (function () {
1550 function GoogleMapsLatLngBounds(southwestOrArrayOfLatLng, northeast) {
1551 var args = !!northeast ? [southwestOrArrayOfLatLng, northeast] : southwestOrArrayOfLatLng;
1552 this._objectInstance = new plugin.google.maps.LatLngBounds(args);
1553 }
1554 GoogleMapsLatLngBounds.prototype.toString = function () { return; };
1555 GoogleMapsLatLngBounds.prototype.toUrlValue = function (precision) { return; };
1556 GoogleMapsLatLngBounds.prototype.extend = function (LatLng) { };
1557 GoogleMapsLatLngBounds.prototype.contains = function (LatLng) { return; };
1558 GoogleMapsLatLngBounds.prototype.getCenter = function () { return; };
1559 __decorate([
1560 plugin_1.InstanceProperty
1561 ], GoogleMapsLatLngBounds.prototype, "northeast", void 0);
1562 __decorate([
1563 plugin_1.InstanceProperty
1564 ], GoogleMapsLatLngBounds.prototype, "southwest", void 0);
1565 __decorate([
1566 plugin_1.InstanceProperty
1567 ], GoogleMapsLatLngBounds.prototype, "type", void 0);
1568 __decorate([
1569 plugin_1.CordovaInstance({ sync: true })
1570 ], GoogleMapsLatLngBounds.prototype, "toString", null);
1571 __decorate([
1572 plugin_1.CordovaInstance({ sync: true })
1573 ], GoogleMapsLatLngBounds.prototype, "toUrlValue", null);
1574 __decorate([
1575 plugin_1.CordovaInstance({ sync: true })
1576 ], GoogleMapsLatLngBounds.prototype, "extend", null);
1577 __decorate([
1578 plugin_1.CordovaInstance({ sync: true })
1579 ], GoogleMapsLatLngBounds.prototype, "contains", null);
1580 __decorate([
1581 plugin_1.CordovaInstance({ sync: true })
1582 ], GoogleMapsLatLngBounds.prototype, "getCenter", null);
1583 return GoogleMapsLatLngBounds;
1584}());
1585exports.GoogleMapsLatLngBounds = GoogleMapsLatLngBounds;
1586/**
1587 * @private
1588 */
1589var GoogleMapsLatLng = (function () {
1590 function GoogleMapsLatLng(lat, lng) {
1591 this.lat = lat;
1592 this.lng = lng;
1593 }
1594 GoogleMapsLatLng.prototype.equals = function (other) {
1595 return this.lat === other.lat && this.lng === other.lng;
1596 };
1597 GoogleMapsLatLng.prototype.toString = function () {
1598 return this.lat + ',' + this.lng;
1599 };
1600 GoogleMapsLatLng.prototype.toUrlValue = function (precision) {
1601 precision = precision || 6;
1602 return this.lat.toFixed(precision) + ',' + this.lng.toFixed(precision);
1603 };
1604 return GoogleMapsLatLng;
1605}());
1606exports.GoogleMapsLatLng = GoogleMapsLatLng;
1607/**
1608 * @private
1609 */
1610var Geocoder = (function () {
1611 function Geocoder() {
1612 }
1613 /**
1614 * Converts position to address and vice versa
1615 * @param {GeocoderRequest} request Request object with either an address or a position
1616 * @returns {Promise<GeocoderResult[]>}
1617 */
1618 Geocoder.geocode = function (request) {
1619 return new Promise(function (resolve, reject) {
1620 if (!plugin || !plugin.google || !plugin.google.maps || !plugin.google.maps.Geocoder) {
1621 plugin_1.pluginWarn({
1622 pluginName: 'GoogleMap',
1623 plugin: 'plugin.google.maps.Map'
1624 });
1625 reject({ error: 'plugin_not_installed' });
1626 }
1627 else {
1628 plugin.google.maps.Geocoder.geocode(request, resolve);
1629 }
1630 });
1631 };
1632 return Geocoder;
1633}());
1634exports.Geocoder = Geocoder;
1635//# sourceMappingURL=googlemap.js.map
\No newline at end of file