@angular/google-maps 13.0.0-next.7 → 13.0.0-rc.2

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.
Files changed (81) hide show
  1. package/esm2020/google-map/google-map.mjs +445 -0
  2. package/esm2020/google-maps-module.mjs +86 -0
  3. package/esm2020/google-maps_public_index.mjs +5 -0
  4. package/esm2020/index.mjs +9 -0
  5. package/{esm2015/map-anchor-point.js → esm2020/map-anchor-point.mjs} +2 -2
  6. package/esm2020/map-base-layer.mjs +51 -0
  7. package/esm2020/map-bicycling-layer/map-bicycling-layer.mjs +48 -0
  8. package/esm2020/map-circle/map-circle.mjs +268 -0
  9. package/esm2020/map-directions-renderer/map-directions-renderer.mjs +138 -0
  10. package/esm2020/map-directions-renderer/map-directions-service.mjs +51 -0
  11. package/esm2020/map-event-manager.mjs +67 -0
  12. package/esm2020/map-geocoder/map-geocoder.mjs +47 -0
  13. package/esm2020/map-ground-overlay/map-ground-overlay.mjs +177 -0
  14. package/esm2020/map-heatmap-layer/map-heatmap-layer.mjs +135 -0
  15. package/esm2020/map-info-window/map-info-window.mjs +203 -0
  16. package/esm2020/map-kml-layer/map-kml-layer.mjs +170 -0
  17. package/esm2020/map-marker/map-marker.mjs +427 -0
  18. package/esm2020/map-marker-clusterer/map-marker-clusterer.mjs +407 -0
  19. package/esm2020/map-marker-clusterer/marker-clusterer-types.mjs +9 -0
  20. package/esm2020/map-polygon/map-polygon.mjs +216 -0
  21. package/esm2020/map-polyline/map-polyline.mjs +207 -0
  22. package/esm2020/map-rectangle/map-rectangle.mjs +229 -0
  23. package/esm2020/map-traffic-layer/map-traffic-layer.mjs +93 -0
  24. package/esm2020/map-transit-layer/map-transit-layer.mjs +48 -0
  25. package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
  26. package/fesm2015/{google-maps.js → google-maps.mjs} +590 -518
  27. package/fesm2015/google-maps.mjs.map +1 -0
  28. package/fesm2020/google-maps.mjs +3257 -0
  29. package/fesm2020/google-maps.mjs.map +1 -0
  30. package/google-map/google-map.d.ts +10 -7
  31. package/google-maps-module.d.ts +20 -7
  32. package/google-maps_public_index.d.ts +4 -0
  33. package/index.d.ts +5 -1
  34. package/map-anchor-point.d.ts +1 -1
  35. package/map-base-layer.d.ts +3 -0
  36. package/map-bicycling-layer/map-bicycling-layer.d.ts +4 -8
  37. package/map-circle/map-circle.d.ts +6 -3
  38. package/map-directions-renderer/map-directions-renderer.d.ts +6 -3
  39. package/map-directions-renderer/map-directions-service.d.ts +4 -1
  40. package/map-event-manager.d.ts +1 -1
  41. package/map-geocoder/map-geocoder.d.ts +4 -1
  42. package/map-ground-overlay/map-ground-overlay.d.ts +5 -2
  43. package/map-heatmap-layer/map-heatmap-layer.d.ts +4 -1
  44. package/map-info-window/map-info-window.d.ts +5 -2
  45. package/map-kml-layer/map-kml-layer.d.ts +6 -3
  46. package/map-marker/map-marker.d.ts +4 -1
  47. package/map-marker-clusterer/map-marker-clusterer.d.ts +5 -2
  48. package/map-marker-clusterer/marker-clusterer-types.d.ts +1 -1
  49. package/map-polygon/map-polygon.d.ts +4 -1
  50. package/map-polyline/map-polyline.d.ts +4 -1
  51. package/map-rectangle/map-rectangle.d.ts +5 -2
  52. package/map-traffic-layer/map-traffic-layer.d.ts +4 -1
  53. package/map-transit-layer/map-transit-layer.d.ts +4 -8
  54. package/package.json +23 -9
  55. package/bundles/google-maps.umd.js +0 -3757
  56. package/bundles/google-maps.umd.js.map +0 -1
  57. package/esm2015/google-map/google-map.js +0 -418
  58. package/esm2015/google-maps-module.js +0 -51
  59. package/esm2015/google-maps.externs.js +0 -6
  60. package/esm2015/index.js +0 -5
  61. package/esm2015/map-base-layer.js +0 -49
  62. package/esm2015/map-bicycling-layer/map-bicycling-layer.js +0 -43
  63. package/esm2015/map-circle/map-circle.js +0 -247
  64. package/esm2015/map-directions-renderer/map-directions-renderer.js +0 -131
  65. package/esm2015/map-directions-renderer/map-directions-service.js +0 -52
  66. package/esm2015/map-event-manager.js +0 -67
  67. package/esm2015/map-geocoder/map-geocoder.js +0 -47
  68. package/esm2015/map-ground-overlay/map-ground-overlay.js +0 -171
  69. package/esm2015/map-heatmap-layer/map-heatmap-layer.js +0 -130
  70. package/esm2015/map-info-window/map-info-window.js +0 -193
  71. package/esm2015/map-kml-layer/map-kml-layer.js +0 -160
  72. package/esm2015/map-marker/map-marker.js +0 -391
  73. package/esm2015/map-marker-clusterer/map-marker-clusterer.js +0 -360
  74. package/esm2015/map-marker-clusterer/marker-clusterer-types.js +0 -9
  75. package/esm2015/map-polygon/map-polygon.js +0 -198
  76. package/esm2015/map-polyline/map-polyline.js +0 -189
  77. package/esm2015/map-rectangle/map-rectangle.js +0 -210
  78. package/esm2015/map-traffic-layer/map-traffic-layer.js +0 -88
  79. package/esm2015/map-transit-layer/map-transit-layer.js +0 -43
  80. package/fesm2015/google-maps.js.map +0 -1
  81. package/index.metadata.json +0 -1
@@ -1,3757 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('rxjs'), require('rxjs/operators')) :
3
- typeof define === 'function' && define.amd ? define('@angular/google-maps', ['exports', '@angular/core', '@angular/common', 'rxjs', 'rxjs/operators'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.ng = global.ng || {}, global.ng.googleMaps = {}), global.ng.core, global.ng.common, global.rxjs, global.rxjs.operators));
5
- }(this, (function (exports, i0, common, rxjs, operators) { 'use strict';
6
-
7
- function _interopNamespace(e) {
8
- if (e && e.__esModule) return e;
9
- var n = Object.create(null);
10
- if (e) {
11
- Object.keys(e).forEach(function (k) {
12
- if (k !== 'default') {
13
- var d = Object.getOwnPropertyDescriptor(e, k);
14
- Object.defineProperty(n, k, d.get ? d : {
15
- enumerable: true,
16
- get: function () {
17
- return e[k];
18
- }
19
- });
20
- }
21
- });
22
- }
23
- n['default'] = e;
24
- return Object.freeze(n);
25
- }
26
-
27
- var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
28
-
29
- /*! *****************************************************************************
30
- Copyright (c) Microsoft Corporation.
31
-
32
- Permission to use, copy, modify, and/or distribute this software for any
33
- purpose with or without fee is hereby granted.
34
-
35
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
36
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
37
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
38
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
39
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
40
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
41
- PERFORMANCE OF THIS SOFTWARE.
42
- ***************************************************************************** */
43
- /* global Reflect, Promise */
44
- var extendStatics = function (d, b) {
45
- extendStatics = Object.setPrototypeOf ||
46
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
47
- function (d, b) { for (var p in b)
48
- if (Object.prototype.hasOwnProperty.call(b, p))
49
- d[p] = b[p]; };
50
- return extendStatics(d, b);
51
- };
52
- function __extends(d, b) {
53
- if (typeof b !== "function" && b !== null)
54
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
55
- extendStatics(d, b);
56
- function __() { this.constructor = d; }
57
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
58
- }
59
- var __assign = function () {
60
- __assign = Object.assign || function __assign(t) {
61
- for (var s, i = 1, n = arguments.length; i < n; i++) {
62
- s = arguments[i];
63
- for (var p in s)
64
- if (Object.prototype.hasOwnProperty.call(s, p))
65
- t[p] = s[p];
66
- }
67
- return t;
68
- };
69
- return __assign.apply(this, arguments);
70
- };
71
- function __rest(s, e) {
72
- var t = {};
73
- for (var p in s)
74
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
75
- t[p] = s[p];
76
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
77
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
78
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
79
- t[p[i]] = s[p[i]];
80
- }
81
- return t;
82
- }
83
- function __decorate(decorators, target, key, desc) {
84
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
85
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
86
- r = Reflect.decorate(decorators, target, key, desc);
87
- else
88
- for (var i = decorators.length - 1; i >= 0; i--)
89
- if (d = decorators[i])
90
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
91
- return c > 3 && r && Object.defineProperty(target, key, r), r;
92
- }
93
- function __param(paramIndex, decorator) {
94
- return function (target, key) { decorator(target, key, paramIndex); };
95
- }
96
- function __metadata(metadataKey, metadataValue) {
97
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
98
- return Reflect.metadata(metadataKey, metadataValue);
99
- }
100
- function __awaiter(thisArg, _arguments, P, generator) {
101
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
102
- return new (P || (P = Promise))(function (resolve, reject) {
103
- function fulfilled(value) { try {
104
- step(generator.next(value));
105
- }
106
- catch (e) {
107
- reject(e);
108
- } }
109
- function rejected(value) { try {
110
- step(generator["throw"](value));
111
- }
112
- catch (e) {
113
- reject(e);
114
- } }
115
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
116
- step((generator = generator.apply(thisArg, _arguments || [])).next());
117
- });
118
- }
119
- function __generator(thisArg, body) {
120
- var _ = { label: 0, sent: function () { if (t[0] & 1)
121
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
122
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
123
- function verb(n) { return function (v) { return step([n, v]); }; }
124
- function step(op) {
125
- if (f)
126
- throw new TypeError("Generator is already executing.");
127
- while (_)
128
- try {
129
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
130
- return t;
131
- if (y = 0, t)
132
- op = [op[0] & 2, t.value];
133
- switch (op[0]) {
134
- case 0:
135
- case 1:
136
- t = op;
137
- break;
138
- case 4:
139
- _.label++;
140
- return { value: op[1], done: false };
141
- case 5:
142
- _.label++;
143
- y = op[1];
144
- op = [0];
145
- continue;
146
- case 7:
147
- op = _.ops.pop();
148
- _.trys.pop();
149
- continue;
150
- default:
151
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
152
- _ = 0;
153
- continue;
154
- }
155
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
156
- _.label = op[1];
157
- break;
158
- }
159
- if (op[0] === 6 && _.label < t[1]) {
160
- _.label = t[1];
161
- t = op;
162
- break;
163
- }
164
- if (t && _.label < t[2]) {
165
- _.label = t[2];
166
- _.ops.push(op);
167
- break;
168
- }
169
- if (t[2])
170
- _.ops.pop();
171
- _.trys.pop();
172
- continue;
173
- }
174
- op = body.call(thisArg, _);
175
- }
176
- catch (e) {
177
- op = [6, e];
178
- y = 0;
179
- }
180
- finally {
181
- f = t = 0;
182
- }
183
- if (op[0] & 5)
184
- throw op[1];
185
- return { value: op[0] ? op[1] : void 0, done: true };
186
- }
187
- }
188
- var __createBinding = Object.create ? (function (o, m, k, k2) {
189
- if (k2 === undefined)
190
- k2 = k;
191
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
192
- }) : (function (o, m, k, k2) {
193
- if (k2 === undefined)
194
- k2 = k;
195
- o[k2] = m[k];
196
- });
197
- function __exportStar(m, o) {
198
- for (var p in m)
199
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
200
- __createBinding(o, m, p);
201
- }
202
- function __values(o) {
203
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
204
- if (m)
205
- return m.call(o);
206
- if (o && typeof o.length === "number")
207
- return {
208
- next: function () {
209
- if (o && i >= o.length)
210
- o = void 0;
211
- return { value: o && o[i++], done: !o };
212
- }
213
- };
214
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
215
- }
216
- function __read(o, n) {
217
- var m = typeof Symbol === "function" && o[Symbol.iterator];
218
- if (!m)
219
- return o;
220
- var i = m.call(o), r, ar = [], e;
221
- try {
222
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
223
- ar.push(r.value);
224
- }
225
- catch (error) {
226
- e = { error: error };
227
- }
228
- finally {
229
- try {
230
- if (r && !r.done && (m = i["return"]))
231
- m.call(i);
232
- }
233
- finally {
234
- if (e)
235
- throw e.error;
236
- }
237
- }
238
- return ar;
239
- }
240
- /** @deprecated */
241
- function __spread() {
242
- for (var ar = [], i = 0; i < arguments.length; i++)
243
- ar = ar.concat(__read(arguments[i]));
244
- return ar;
245
- }
246
- /** @deprecated */
247
- function __spreadArrays() {
248
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
249
- s += arguments[i].length;
250
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
251
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
252
- r[k] = a[j];
253
- return r;
254
- }
255
- function __spreadArray(to, from, pack) {
256
- if (pack || arguments.length === 2)
257
- for (var i = 0, l = from.length, ar; i < l; i++) {
258
- if (ar || !(i in from)) {
259
- if (!ar)
260
- ar = Array.prototype.slice.call(from, 0, i);
261
- ar[i] = from[i];
262
- }
263
- }
264
- return to.concat(ar || Array.prototype.slice.call(from));
265
- }
266
- function __await(v) {
267
- return this instanceof __await ? (this.v = v, this) : new __await(v);
268
- }
269
- function __asyncGenerator(thisArg, _arguments, generator) {
270
- if (!Symbol.asyncIterator)
271
- throw new TypeError("Symbol.asyncIterator is not defined.");
272
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
273
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
274
- function verb(n) { if (g[n])
275
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
276
- function resume(n, v) { try {
277
- step(g[n](v));
278
- }
279
- catch (e) {
280
- settle(q[0][3], e);
281
- } }
282
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
283
- function fulfill(value) { resume("next", value); }
284
- function reject(value) { resume("throw", value); }
285
- function settle(f, v) { if (f(v), q.shift(), q.length)
286
- resume(q[0][0], q[0][1]); }
287
- }
288
- function __asyncDelegator(o) {
289
- var i, p;
290
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
291
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
292
- }
293
- function __asyncValues(o) {
294
- if (!Symbol.asyncIterator)
295
- throw new TypeError("Symbol.asyncIterator is not defined.");
296
- var m = o[Symbol.asyncIterator], i;
297
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
298
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
299
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
300
- }
301
- function __makeTemplateObject(cooked, raw) {
302
- if (Object.defineProperty) {
303
- Object.defineProperty(cooked, "raw", { value: raw });
304
- }
305
- else {
306
- cooked.raw = raw;
307
- }
308
- return cooked;
309
- }
310
- ;
311
- var __setModuleDefault = Object.create ? (function (o, v) {
312
- Object.defineProperty(o, "default", { enumerable: true, value: v });
313
- }) : function (o, v) {
314
- o["default"] = v;
315
- };
316
- function __importStar(mod) {
317
- if (mod && mod.__esModule)
318
- return mod;
319
- var result = {};
320
- if (mod != null)
321
- for (var k in mod)
322
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
323
- __createBinding(result, mod, k);
324
- __setModuleDefault(result, mod);
325
- return result;
326
- }
327
- function __importDefault(mod) {
328
- return (mod && mod.__esModule) ? mod : { default: mod };
329
- }
330
- function __classPrivateFieldGet(receiver, state, kind, f) {
331
- if (kind === "a" && !f)
332
- throw new TypeError("Private accessor was defined without a getter");
333
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
334
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
335
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
336
- }
337
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
338
- if (kind === "m")
339
- throw new TypeError("Private method is not writable");
340
- if (kind === "a" && !f)
341
- throw new TypeError("Private accessor was defined without a setter");
342
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
343
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
344
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
345
- }
346
-
347
- /** Manages event on a Google Maps object, ensuring that events are added only when necessary. */
348
- var MapEventManager = /** @class */ (function () {
349
- function MapEventManager(_ngZone) {
350
- this._ngZone = _ngZone;
351
- /** Pending listeners that were added before the target was set. */
352
- this._pending = [];
353
- this._listeners = [];
354
- this._targetStream = new rxjs.BehaviorSubject(undefined);
355
- }
356
- /** Clears all currently-registered event listeners. */
357
- MapEventManager.prototype._clearListeners = function () {
358
- var e_1, _a;
359
- try {
360
- for (var _b = __values(this._listeners), _c = _b.next(); !_c.done; _c = _b.next()) {
361
- var listener = _c.value;
362
- listener.remove();
363
- }
364
- }
365
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
366
- finally {
367
- try {
368
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
369
- }
370
- finally { if (e_1) throw e_1.error; }
371
- }
372
- this._listeners = [];
373
- };
374
- /** Gets an observable that adds an event listener to the map when a consumer subscribes to it. */
375
- MapEventManager.prototype.getLazyEmitter = function (name) {
376
- var _this = this;
377
- return this._targetStream.pipe(operators.switchMap(function (target) {
378
- var observable = new rxjs.Observable(function (observer) {
379
- // If the target hasn't been initialized yet, cache the observer so it can be added later.
380
- if (!target) {
381
- _this._pending.push({ observable: observable, observer: observer });
382
- return undefined;
383
- }
384
- var listener = target.addListener(name, function (event) {
385
- _this._ngZone.run(function () { return observer.next(event); });
386
- });
387
- _this._listeners.push(listener);
388
- return function () { return listener.remove(); };
389
- });
390
- return observable;
391
- }));
392
- };
393
- /** Sets the current target that the manager should bind events to. */
394
- MapEventManager.prototype.setTarget = function (target) {
395
- var currentTarget = this._targetStream.value;
396
- if (target === currentTarget) {
397
- return;
398
- }
399
- // Clear the listeners from the pre-existing target.
400
- if (currentTarget) {
401
- this._clearListeners();
402
- this._pending = [];
403
- }
404
- this._targetStream.next(target);
405
- // Add the listeners that were bound before the map was initialized.
406
- this._pending.forEach(function (subscriber) { return subscriber.observable.subscribe(subscriber.observer); });
407
- this._pending = [];
408
- };
409
- /** Destroys the manager and clears the event listeners. */
410
- MapEventManager.prototype.destroy = function () {
411
- this._clearListeners();
412
- this._pending = [];
413
- this._targetStream.complete();
414
- };
415
- return MapEventManager;
416
- }());
417
-
418
- /**
419
- * @license
420
- * Copyright Google LLC All Rights Reserved.
421
- *
422
- * Use of this source code is governed by an MIT-style license that can be
423
- * found in the LICENSE file at https://angular.io/license
424
- */
425
- /** default options set to the Googleplex */
426
- var DEFAULT_OPTIONS = {
427
- center: { lat: 37.421995, lng: -122.084092 },
428
- zoom: 17,
429
- // Note: the type conversion here isn't necessary for our CI, but it resolves a g3 failure.
430
- mapTypeId: 'roadmap'
431
- };
432
- /** Arbitrary default height for the map element */
433
- var DEFAULT_HEIGHT = '500px';
434
- /** Arbitrary default width for the map element */
435
- var DEFAULT_WIDTH = '500px';
436
- /**
437
- * Angular component that renders a Google Map via the Google Maps JavaScript
438
- * API.
439
- * @see https://developers.google.com/maps/documentation/javascript/reference/
440
- */
441
- var GoogleMap = /** @class */ (function () {
442
- function GoogleMap(_elementRef, _ngZone, platformId) {
443
- var _this = this;
444
- this._elementRef = _elementRef;
445
- this._ngZone = _ngZone;
446
- this._eventManager = new MapEventManager(this._ngZone);
447
- /** Height of the map. Set this to `null` if you'd like to control the height through CSS. */
448
- this.height = DEFAULT_HEIGHT;
449
- /** Width of the map. Set this to `null` if you'd like to control the width through CSS. */
450
- this.width = DEFAULT_WIDTH;
451
- this._options = DEFAULT_OPTIONS;
452
- /**
453
- * See
454
- * https://developers.google.com/maps/documentation/javascript/events#auth-errors
455
- */
456
- this.authFailure = new i0.EventEmitter();
457
- /**
458
- * See
459
- * https://developers.google.com/maps/documentation/javascript/reference/map#Map.bounds_changed
460
- */
461
- this.boundsChanged = this._eventManager.getLazyEmitter('bounds_changed');
462
- /**
463
- * See
464
- * https://developers.google.com/maps/documentation/javascript/reference/map#Map.center_changed
465
- */
466
- this.centerChanged = this._eventManager.getLazyEmitter('center_changed');
467
- /**
468
- * See
469
- * https://developers.google.com/maps/documentation/javascript/reference/map#Map.click
470
- */
471
- this.mapClick = this._eventManager
472
- .getLazyEmitter('click');
473
- /**
474
- * See
475
- * https://developers.google.com/maps/documentation/javascript/reference/map#Map.dblclick
476
- */
477
- this.mapDblclick = this._eventManager.getLazyEmitter('dblclick');
478
- /**
479
- * See
480
- * https://developers.google.com/maps/documentation/javascript/reference/map#Map.drag
481
- */
482
- this.mapDrag = this._eventManager.getLazyEmitter('drag');
483
- /**
484
- * See
485
- * https://developers.google.com/maps/documentation/javascript/reference/map#Map.dragend
486
- */
487
- this.mapDragend = this._eventManager.getLazyEmitter('dragend');
488
- /**
489
- * See
490
- * https://developers.google.com/maps/documentation/javascript/reference/map#Map.dragstart
491
- */
492
- this.mapDragstart = this._eventManager.getLazyEmitter('dragstart');
493
- /**
494
- * See
495
- * https://developers.google.com/maps/documentation/javascript/reference/map#Map.heading_changed
496
- */
497
- this.headingChanged = this._eventManager.getLazyEmitter('heading_changed');
498
- /**
499
- * See
500
- * https://developers.google.com/maps/documentation/javascript/reference/map#Map.idle
501
- */
502
- this.idle = this._eventManager.getLazyEmitter('idle');
503
- /**
504
- * See
505
- * https://developers.google.com/maps/documentation/javascript/reference/map#Map.maptypeid_changed
506
- */
507
- this.maptypeidChanged = this._eventManager.getLazyEmitter('maptypeid_changed');
508
- /**
509
- * See
510
- * https://developers.google.com/maps/documentation/javascript/reference/map#Map.mousemove
511
- */
512
- this.mapMousemove = this._eventManager.getLazyEmitter('mousemove');
513
- /**
514
- * See
515
- * https://developers.google.com/maps/documentation/javascript/reference/map#Map.mouseout
516
- */
517
- this.mapMouseout = this._eventManager.getLazyEmitter('mouseout');
518
- /**
519
- * See
520
- * https://developers.google.com/maps/documentation/javascript/reference/map#Map.mouseover
521
- */
522
- this.mapMouseover = this._eventManager.getLazyEmitter('mouseover');
523
- /**
524
- * See
525
- * developers.google.com/maps/documentation/javascript/reference/map#Map.projection_changed
526
- */
527
- this.projectionChanged = this._eventManager.getLazyEmitter('projection_changed');
528
- /**
529
- * See
530
- * https://developers.google.com/maps/documentation/javascript/reference/map#Map.rightclick
531
- */
532
- this.mapRightclick = this._eventManager.getLazyEmitter('rightclick');
533
- /**
534
- * See
535
- * https://developers.google.com/maps/documentation/javascript/reference/map#Map.tilesloaded
536
- */
537
- this.tilesloaded = this._eventManager.getLazyEmitter('tilesloaded');
538
- /**
539
- * See
540
- * https://developers.google.com/maps/documentation/javascript/reference/map#Map.tilt_changed
541
- */
542
- this.tiltChanged = this._eventManager.getLazyEmitter('tilt_changed');
543
- /**
544
- * See
545
- * https://developers.google.com/maps/documentation/javascript/reference/map#Map.zoom_changed
546
- */
547
- this.zoomChanged = this._eventManager.getLazyEmitter('zoom_changed');
548
- this._isBrowser = common.isPlatformBrowser(platformId);
549
- if (this._isBrowser) {
550
- var googleMapsWindow = window;
551
- if (!googleMapsWindow.google && (typeof ngDevMode === 'undefined' || ngDevMode)) {
552
- throw Error('Namespace google not found, cannot construct embedded google ' +
553
- 'map. Please install the Google Maps JavaScript API: ' +
554
- 'https://developers.google.com/maps/documentation/javascript/' +
555
- 'tutorial#Loading_the_Maps_API');
556
- }
557
- this._existingAuthFailureCallback = googleMapsWindow.gm_authFailure;
558
- googleMapsWindow.gm_authFailure = function () {
559
- if (_this._existingAuthFailureCallback) {
560
- _this._existingAuthFailureCallback();
561
- }
562
- _this.authFailure.emit();
563
- };
564
- }
565
- }
566
- Object.defineProperty(GoogleMap.prototype, "center", {
567
- set: function (center) {
568
- this._center = center;
569
- },
570
- enumerable: false,
571
- configurable: true
572
- });
573
- Object.defineProperty(GoogleMap.prototype, "zoom", {
574
- set: function (zoom) {
575
- this._zoom = zoom;
576
- },
577
- enumerable: false,
578
- configurable: true
579
- });
580
- Object.defineProperty(GoogleMap.prototype, "options", {
581
- set: function (options) {
582
- this._options = options || DEFAULT_OPTIONS;
583
- },
584
- enumerable: false,
585
- configurable: true
586
- });
587
- GoogleMap.prototype.ngOnChanges = function (changes) {
588
- if (changes['height'] || changes['width']) {
589
- this._setSize();
590
- }
591
- var googleMap = this.googleMap;
592
- if (googleMap) {
593
- if (changes['options']) {
594
- googleMap.setOptions(this._combineOptions());
595
- }
596
- if (changes['center'] && this._center) {
597
- googleMap.setCenter(this._center);
598
- }
599
- // Note that the zoom can be zero.
600
- if (changes['zoom'] && this._zoom != null) {
601
- googleMap.setZoom(this._zoom);
602
- }
603
- if (changes['mapTypeId'] && this.mapTypeId) {
604
- googleMap.setMapTypeId(this.mapTypeId);
605
- }
606
- }
607
- };
608
- GoogleMap.prototype.ngOnInit = function () {
609
- var _this = this;
610
- // It should be a noop during server-side rendering.
611
- if (this._isBrowser) {
612
- this._mapEl = this._elementRef.nativeElement.querySelector('.map-container');
613
- this._setSize();
614
- // Create the object outside the zone so its events don't trigger change detection.
615
- // We'll bring it back in inside the `MapEventManager` only for the events that the
616
- // user has subscribed to.
617
- this._ngZone.runOutsideAngular(function () {
618
- _this.googleMap = new google.maps.Map(_this._mapEl, _this._combineOptions());
619
- });
620
- this._eventManager.setTarget(this.googleMap);
621
- }
622
- };
623
- GoogleMap.prototype.ngOnDestroy = function () {
624
- this._eventManager.destroy();
625
- if (this._isBrowser) {
626
- var googleMapsWindow = window;
627
- googleMapsWindow.gm_authFailure = this._existingAuthFailureCallback;
628
- }
629
- };
630
- /**
631
- * See
632
- * https://developers.google.com/maps/documentation/javascript/reference/map#Map.fitBounds
633
- */
634
- GoogleMap.prototype.fitBounds = function (bounds, padding) {
635
- this._assertInitialized();
636
- this.googleMap.fitBounds(bounds, padding);
637
- };
638
- /**
639
- * See
640
- * https://developers.google.com/maps/documentation/javascript/reference/map#Map.panBy
641
- */
642
- GoogleMap.prototype.panBy = function (x, y) {
643
- this._assertInitialized();
644
- this.googleMap.panBy(x, y);
645
- };
646
- /**
647
- * See
648
- * https://developers.google.com/maps/documentation/javascript/reference/map#Map.panTo
649
- */
650
- GoogleMap.prototype.panTo = function (latLng) {
651
- this._assertInitialized();
652
- this.googleMap.panTo(latLng);
653
- };
654
- /**
655
- * See
656
- * https://developers.google.com/maps/documentation/javascript/reference/map#Map.panToBounds
657
- */
658
- GoogleMap.prototype.panToBounds = function (latLngBounds, padding) {
659
- this._assertInitialized();
660
- this.googleMap.panToBounds(latLngBounds, padding);
661
- };
662
- /**
663
- * See
664
- * https://developers.google.com/maps/documentation/javascript/reference/map#Map.getBounds
665
- */
666
- GoogleMap.prototype.getBounds = function () {
667
- this._assertInitialized();
668
- return this.googleMap.getBounds() || null;
669
- };
670
- /**
671
- * See
672
- * https://developers.google.com/maps/documentation/javascript/reference/map#Map.getCenter
673
- */
674
- GoogleMap.prototype.getCenter = function () {
675
- this._assertInitialized();
676
- return this.googleMap.getCenter();
677
- };
678
- /**
679
- * See
680
- * https://developers.google.com/maps/documentation/javascript/reference/map#Map.getClickableIcons
681
- */
682
- GoogleMap.prototype.getClickableIcons = function () {
683
- this._assertInitialized();
684
- return this.googleMap.getClickableIcons();
685
- };
686
- /**
687
- * See
688
- * https://developers.google.com/maps/documentation/javascript/reference/map#Map.getHeading
689
- */
690
- GoogleMap.prototype.getHeading = function () {
691
- this._assertInitialized();
692
- return this.googleMap.getHeading();
693
- };
694
- /**
695
- * See
696
- * https://developers.google.com/maps/documentation/javascript/reference/map#Map.getMapTypeId
697
- */
698
- GoogleMap.prototype.getMapTypeId = function () {
699
- this._assertInitialized();
700
- return this.googleMap.getMapTypeId();
701
- };
702
- /**
703
- * See
704
- * https://developers.google.com/maps/documentation/javascript/reference/map#Map.getProjection
705
- */
706
- GoogleMap.prototype.getProjection = function () {
707
- this._assertInitialized();
708
- return this.googleMap.getProjection();
709
- };
710
- /**
711
- * See
712
- * https://developers.google.com/maps/documentation/javascript/reference/map#Map.getStreetView
713
- */
714
- GoogleMap.prototype.getStreetView = function () {
715
- this._assertInitialized();
716
- return this.googleMap.getStreetView();
717
- };
718
- /**
719
- * See
720
- * https://developers.google.com/maps/documentation/javascript/reference/map#Map.getTilt
721
- */
722
- GoogleMap.prototype.getTilt = function () {
723
- this._assertInitialized();
724
- return this.googleMap.getTilt();
725
- };
726
- /**
727
- * See
728
- * https://developers.google.com/maps/documentation/javascript/reference/map#Map.getZoom
729
- */
730
- GoogleMap.prototype.getZoom = function () {
731
- this._assertInitialized();
732
- return this.googleMap.getZoom();
733
- };
734
- Object.defineProperty(GoogleMap.prototype, "controls", {
735
- /**
736
- * See
737
- * https://developers.google.com/maps/documentation/javascript/reference/map#Map.controls
738
- */
739
- get: function () {
740
- this._assertInitialized();
741
- return this.googleMap.controls;
742
- },
743
- enumerable: false,
744
- configurable: true
745
- });
746
- Object.defineProperty(GoogleMap.prototype, "data", {
747
- /**
748
- * See
749
- * https://developers.google.com/maps/documentation/javascript/reference/map#Map.data
750
- */
751
- get: function () {
752
- this._assertInitialized();
753
- return this.googleMap.data;
754
- },
755
- enumerable: false,
756
- configurable: true
757
- });
758
- Object.defineProperty(GoogleMap.prototype, "mapTypes", {
759
- /**
760
- * See
761
- * https://developers.google.com/maps/documentation/javascript/reference/map#Map.mapTypes
762
- */
763
- get: function () {
764
- this._assertInitialized();
765
- return this.googleMap.mapTypes;
766
- },
767
- enumerable: false,
768
- configurable: true
769
- });
770
- Object.defineProperty(GoogleMap.prototype, "overlayMapTypes", {
771
- /**
772
- * See
773
- * https://developers.google.com/maps/documentation/javascript/reference/map#Map.overlayMapTypes
774
- */
775
- get: function () {
776
- this._assertInitialized();
777
- return this.googleMap.overlayMapTypes;
778
- },
779
- enumerable: false,
780
- configurable: true
781
- });
782
- GoogleMap.prototype._setSize = function () {
783
- if (this._mapEl) {
784
- var styles = this._mapEl.style;
785
- styles.height =
786
- this.height === null ? '' : (coerceCssPixelValue(this.height) || DEFAULT_HEIGHT);
787
- styles.width = this.width === null ? '' : (coerceCssPixelValue(this.width) || DEFAULT_WIDTH);
788
- }
789
- };
790
- /** Combines the center and zoom and the other map options into a single object */
791
- GoogleMap.prototype._combineOptions = function () {
792
- var _a, _b;
793
- var options = this._options || {};
794
- return Object.assign(Object.assign({}, options), {
795
- // It's important that we set **some** kind of `center` and `zoom`, otherwise
796
- // Google Maps will render a blank rectangle which looks broken.
797
- center: this._center || options.center || DEFAULT_OPTIONS.center, zoom: (_b = (_a = this._zoom) !== null && _a !== void 0 ? _a : options.zoom) !== null && _b !== void 0 ? _b : DEFAULT_OPTIONS.zoom,
798
- // Passing in an undefined `mapTypeId` seems to break tile loading
799
- // so make sure that we have some kind of default (see #22082).
800
- mapTypeId: this.mapTypeId || options.mapTypeId || DEFAULT_OPTIONS.mapTypeId
801
- });
802
- };
803
- /** Asserts that the map has been initialized. */
804
- GoogleMap.prototype._assertInitialized = function () {
805
- if (!this.googleMap && (typeof ngDevMode === 'undefined' || ngDevMode)) {
806
- throw Error('Cannot access Google Map information before the API has been initialized. ' +
807
- 'Please wait for the API to load before trying to interact with it.');
808
- }
809
- };
810
- return GoogleMap;
811
- }());
812
- GoogleMap.decorators = [
813
- { type: i0.Component, args: [{
814
- selector: 'google-map',
815
- exportAs: 'googleMap',
816
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
817
- template: '<div class="map-container"></div><ng-content></ng-content>',
818
- encapsulation: i0.ViewEncapsulation.None
819
- },] }
820
- ];
821
- GoogleMap.ctorParameters = function () { return [
822
- { type: i0.ElementRef },
823
- { type: i0.NgZone },
824
- { type: Object, decorators: [{ type: i0.Inject, args: [i0.PLATFORM_ID,] }] }
825
- ]; };
826
- GoogleMap.propDecorators = {
827
- height: [{ type: i0.Input }],
828
- width: [{ type: i0.Input }],
829
- mapTypeId: [{ type: i0.Input }],
830
- center: [{ type: i0.Input }],
831
- zoom: [{ type: i0.Input }],
832
- options: [{ type: i0.Input }],
833
- authFailure: [{ type: i0.Output }],
834
- boundsChanged: [{ type: i0.Output }],
835
- centerChanged: [{ type: i0.Output }],
836
- mapClick: [{ type: i0.Output }],
837
- mapDblclick: [{ type: i0.Output }],
838
- mapDrag: [{ type: i0.Output }],
839
- mapDragend: [{ type: i0.Output }],
840
- mapDragstart: [{ type: i0.Output }],
841
- headingChanged: [{ type: i0.Output }],
842
- idle: [{ type: i0.Output }],
843
- maptypeidChanged: [{ type: i0.Output }],
844
- mapMousemove: [{ type: i0.Output }],
845
- mapMouseout: [{ type: i0.Output }],
846
- mapMouseover: [{ type: i0.Output }],
847
- projectionChanged: [{ type: i0.Output }],
848
- mapRightclick: [{ type: i0.Output }],
849
- tilesloaded: [{ type: i0.Output }],
850
- tiltChanged: [{ type: i0.Output }],
851
- zoomChanged: [{ type: i0.Output }]
852
- };
853
- var cssUnitsPattern = /([A-Za-z%]+)$/;
854
- /** Coerces a value to a CSS pixel value. */
855
- function coerceCssPixelValue(value) {
856
- if (value == null) {
857
- return '';
858
- }
859
- return cssUnitsPattern.test(value) ? value : value + "px";
860
- }
861
-
862
- /**
863
- * @license
864
- * Copyright Google LLC All Rights Reserved.
865
- *
866
- * Use of this source code is governed by an MIT-style license that can be
867
- * found in the LICENSE file at https://angular.io/license
868
- */
869
- var MapBaseLayer = /** @class */ (function () {
870
- function MapBaseLayer(_map, _ngZone) {
871
- this._map = _map;
872
- this._ngZone = _ngZone;
873
- }
874
- MapBaseLayer.prototype.ngOnInit = function () {
875
- var _this = this;
876
- if (this._map._isBrowser) {
877
- this._ngZone.runOutsideAngular(function () {
878
- _this._initializeObject();
879
- });
880
- this._assertInitialized();
881
- this._setMap();
882
- }
883
- };
884
- MapBaseLayer.prototype.ngOnDestroy = function () {
885
- this._unsetMap();
886
- };
887
- MapBaseLayer.prototype._assertInitialized = function () {
888
- if (!this._map.googleMap) {
889
- throw Error('Cannot access Google Map information before the API has been initialized. ' +
890
- 'Please wait for the API to load before trying to interact with it.');
891
- }
892
- };
893
- MapBaseLayer.prototype._initializeObject = function () { };
894
- MapBaseLayer.prototype._setMap = function () { };
895
- MapBaseLayer.prototype._unsetMap = function () { };
896
- return MapBaseLayer;
897
- }());
898
- MapBaseLayer.decorators = [
899
- { type: i0.Directive, args: [{
900
- selector: 'map-base-layer',
901
- exportAs: 'mapBaseLayer',
902
- },] }
903
- ];
904
- MapBaseLayer.ctorParameters = function () { return [
905
- { type: GoogleMap },
906
- { type: i0.NgZone }
907
- ]; };
908
-
909
- /**
910
- * Angular component that renders a Google Maps Bicycling Layer via the Google Maps JavaScript API.
911
- *
912
- * See developers.google.com/maps/documentation/javascript/reference/map#BicyclingLayer
913
- */
914
- var MapBicyclingLayer = /** @class */ (function (_super) {
915
- __extends(MapBicyclingLayer, _super);
916
- function MapBicyclingLayer() {
917
- return _super !== null && _super.apply(this, arguments) || this;
918
- }
919
- MapBicyclingLayer.prototype._initializeObject = function () {
920
- this.bicyclingLayer = new google.maps.BicyclingLayer();
921
- };
922
- MapBicyclingLayer.prototype._setMap = function () {
923
- this._assertLayerInitialized();
924
- this.bicyclingLayer.setMap(this._map.googleMap);
925
- };
926
- MapBicyclingLayer.prototype._unsetMap = function () {
927
- if (this.bicyclingLayer) {
928
- this.bicyclingLayer.setMap(null);
929
- }
930
- };
931
- MapBicyclingLayer.prototype._assertLayerInitialized = function () {
932
- if (!this.bicyclingLayer) {
933
- throw Error('Cannot interact with a Google Map Bicycling Layer before it has been initialized. ' +
934
- 'Please wait for the Transit Layer to load before trying to interact with it.');
935
- }
936
- };
937
- return MapBicyclingLayer;
938
- }(MapBaseLayer));
939
- MapBicyclingLayer.decorators = [
940
- { type: i0.Directive, args: [{
941
- selector: 'map-bicycling-layer',
942
- exportAs: 'mapBicyclingLayer',
943
- },] }
944
- ];
945
-
946
- /**
947
- * Angular component that renders a Google Maps Circle via the Google Maps JavaScript API.
948
- * @see developers.google.com/maps/documentation/javascript/reference/polygon#Circle
949
- */
950
- var MapCircle = /** @class */ (function () {
951
- function MapCircle(_map, _ngZone) {
952
- this._map = _map;
953
- this._ngZone = _ngZone;
954
- this._eventManager = new MapEventManager(this._ngZone);
955
- this._options = new rxjs.BehaviorSubject({});
956
- this._center = new rxjs.BehaviorSubject(undefined);
957
- this._radius = new rxjs.BehaviorSubject(undefined);
958
- this._destroyed = new rxjs.Subject();
959
- /**
960
- * @see
961
- * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.center_changed
962
- */
963
- this.centerChanged = this._eventManager.getLazyEmitter('center_changed');
964
- /**
965
- * @see
966
- * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.click
967
- */
968
- this.circleClick = this._eventManager.getLazyEmitter('click');
969
- /**
970
- * @see
971
- * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.dblclick
972
- */
973
- this.circleDblclick = this._eventManager.getLazyEmitter('dblclick');
974
- /**
975
- * @see
976
- * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.drag
977
- */
978
- this.circleDrag = this._eventManager.getLazyEmitter('drag');
979
- /**
980
- * @see
981
- * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.dragend
982
- */
983
- this.circleDragend = this._eventManager.getLazyEmitter('dragend');
984
- /**
985
- * @see
986
- * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.dragstart
987
- */
988
- this.circleDragstart = this._eventManager.getLazyEmitter('dragstart');
989
- /**
990
- * @see
991
- * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.mousedown
992
- */
993
- this.circleMousedown = this._eventManager.getLazyEmitter('mousedown');
994
- /**
995
- * @see
996
- * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.mousemove
997
- */
998
- this.circleMousemove = this._eventManager.getLazyEmitter('mousemove');
999
- /**
1000
- * @see
1001
- * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.mouseout
1002
- */
1003
- this.circleMouseout = this._eventManager.getLazyEmitter('mouseout');
1004
- /**
1005
- * @see
1006
- * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.mouseover
1007
- */
1008
- this.circleMouseover = this._eventManager.getLazyEmitter('mouseover');
1009
- /**
1010
- * @see
1011
- * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.mouseup
1012
- */
1013
- this.circleMouseup = this._eventManager.getLazyEmitter('mouseup');
1014
- /**
1015
- * @see
1016
- * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.radius_changed
1017
- */
1018
- this.radiusChanged = this._eventManager.getLazyEmitter('radius_changed');
1019
- /**
1020
- * @see
1021
- * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.rightclick
1022
- */
1023
- this.circleRightclick = this._eventManager.getLazyEmitter('rightclick');
1024
- }
1025
- Object.defineProperty(MapCircle.prototype, "options", {
1026
- set: function (options) {
1027
- this._options.next(options || {});
1028
- },
1029
- enumerable: false,
1030
- configurable: true
1031
- });
1032
- Object.defineProperty(MapCircle.prototype, "center", {
1033
- set: function (center) {
1034
- this._center.next(center);
1035
- },
1036
- enumerable: false,
1037
- configurable: true
1038
- });
1039
- Object.defineProperty(MapCircle.prototype, "radius", {
1040
- set: function (radius) {
1041
- this._radius.next(radius);
1042
- },
1043
- enumerable: false,
1044
- configurable: true
1045
- });
1046
- MapCircle.prototype.ngOnInit = function () {
1047
- var _this = this;
1048
- if (this._map._isBrowser) {
1049
- this._combineOptions().pipe(operators.take(1)).subscribe(function (options) {
1050
- // Create the object outside the zone so its events don't trigger change detection.
1051
- // We'll bring it back in inside the `MapEventManager` only for the events that the
1052
- // user has subscribed to.
1053
- _this._ngZone.runOutsideAngular(function () {
1054
- _this.circle = new google.maps.Circle(options);
1055
- });
1056
- _this._assertInitialized();
1057
- _this.circle.setMap(_this._map.googleMap);
1058
- _this._eventManager.setTarget(_this.circle);
1059
- });
1060
- this._watchForOptionsChanges();
1061
- this._watchForCenterChanges();
1062
- this._watchForRadiusChanges();
1063
- }
1064
- };
1065
- MapCircle.prototype.ngOnDestroy = function () {
1066
- this._eventManager.destroy();
1067
- this._destroyed.next();
1068
- this._destroyed.complete();
1069
- if (this.circle) {
1070
- this.circle.setMap(null);
1071
- }
1072
- };
1073
- /**
1074
- * @see
1075
- * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.getBounds
1076
- */
1077
- MapCircle.prototype.getBounds = function () {
1078
- this._assertInitialized();
1079
- return this.circle.getBounds();
1080
- };
1081
- /**
1082
- * @see
1083
- * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.getCenter
1084
- */
1085
- MapCircle.prototype.getCenter = function () {
1086
- this._assertInitialized();
1087
- return this.circle.getCenter();
1088
- };
1089
- /**
1090
- * @see
1091
- * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.getDraggable
1092
- */
1093
- MapCircle.prototype.getDraggable = function () {
1094
- this._assertInitialized();
1095
- return this.circle.getDraggable();
1096
- };
1097
- /**
1098
- * @see
1099
- * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.getEditable
1100
- */
1101
- MapCircle.prototype.getEditable = function () {
1102
- this._assertInitialized();
1103
- return this.circle.getEditable();
1104
- };
1105
- /**
1106
- * @see
1107
- * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.getRadius
1108
- */
1109
- MapCircle.prototype.getRadius = function () {
1110
- this._assertInitialized();
1111
- return this.circle.getRadius();
1112
- };
1113
- /**
1114
- * @see
1115
- * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.getVisible
1116
- */
1117
- MapCircle.prototype.getVisible = function () {
1118
- this._assertInitialized();
1119
- return this.circle.getVisible();
1120
- };
1121
- MapCircle.prototype._combineOptions = function () {
1122
- return rxjs.combineLatest([this._options, this._center, this._radius])
1123
- .pipe(operators.map(function (_a) {
1124
- var _b = __read(_a, 3), options = _b[0], center = _b[1], radius = _b[2];
1125
- var combinedOptions = Object.assign(Object.assign({}, options), { center: center || options.center, radius: radius !== undefined ? radius : options.radius });
1126
- return combinedOptions;
1127
- }));
1128
- };
1129
- MapCircle.prototype._watchForOptionsChanges = function () {
1130
- var _this = this;
1131
- this._options.pipe(operators.takeUntil(this._destroyed)).subscribe(function (options) {
1132
- _this._assertInitialized();
1133
- _this.circle.setOptions(options);
1134
- });
1135
- };
1136
- MapCircle.prototype._watchForCenterChanges = function () {
1137
- var _this = this;
1138
- this._center.pipe(operators.takeUntil(this._destroyed)).subscribe(function (center) {
1139
- if (center) {
1140
- _this._assertInitialized();
1141
- _this.circle.setCenter(center);
1142
- }
1143
- });
1144
- };
1145
- MapCircle.prototype._watchForRadiusChanges = function () {
1146
- var _this = this;
1147
- this._radius.pipe(operators.takeUntil(this._destroyed)).subscribe(function (radius) {
1148
- if (radius !== undefined) {
1149
- _this._assertInitialized();
1150
- _this.circle.setRadius(radius);
1151
- }
1152
- });
1153
- };
1154
- MapCircle.prototype._assertInitialized = function () {
1155
- if (typeof ngDevMode === 'undefined' || ngDevMode) {
1156
- if (!this._map.googleMap) {
1157
- throw Error('Cannot access Google Map information before the API has been initialized. ' +
1158
- 'Please wait for the API to load before trying to interact with it.');
1159
- }
1160
- if (!this.circle) {
1161
- throw Error('Cannot interact with a Google Map Circle before it has been ' +
1162
- 'initialized. Please wait for the Circle to load before trying to interact with it.');
1163
- }
1164
- }
1165
- };
1166
- return MapCircle;
1167
- }());
1168
- MapCircle.decorators = [
1169
- { type: i0.Directive, args: [{
1170
- selector: 'map-circle',
1171
- exportAs: 'mapCircle',
1172
- },] }
1173
- ];
1174
- MapCircle.ctorParameters = function () { return [
1175
- { type: GoogleMap },
1176
- { type: i0.NgZone }
1177
- ]; };
1178
- MapCircle.propDecorators = {
1179
- options: [{ type: i0.Input }],
1180
- center: [{ type: i0.Input }],
1181
- radius: [{ type: i0.Input }],
1182
- centerChanged: [{ type: i0.Output }],
1183
- circleClick: [{ type: i0.Output }],
1184
- circleDblclick: [{ type: i0.Output }],
1185
- circleDrag: [{ type: i0.Output }],
1186
- circleDragend: [{ type: i0.Output }],
1187
- circleDragstart: [{ type: i0.Output }],
1188
- circleMousedown: [{ type: i0.Output }],
1189
- circleMousemove: [{ type: i0.Output }],
1190
- circleMouseout: [{ type: i0.Output }],
1191
- circleMouseover: [{ type: i0.Output }],
1192
- circleMouseup: [{ type: i0.Output }],
1193
- radiusChanged: [{ type: i0.Output }],
1194
- circleRightclick: [{ type: i0.Output }]
1195
- };
1196
-
1197
- /**
1198
- * @license
1199
- * Copyright Google LLC All Rights Reserved.
1200
- *
1201
- * Use of this source code is governed by an MIT-style license that can be
1202
- * found in the LICENSE file at https://angular.io/license
1203
- */
1204
- /**
1205
- * Angular component that renders a Google Maps Directions Renderer via the Google Maps
1206
- * JavaScript API.
1207
- *
1208
- * See developers.google.com/maps/documentation/javascript/reference/directions#DirectionsRenderer
1209
- */
1210
- var MapDirectionsRenderer = /** @class */ (function () {
1211
- function MapDirectionsRenderer(_googleMap, _ngZone) {
1212
- this._googleMap = _googleMap;
1213
- this._ngZone = _ngZone;
1214
- this._eventManager = new MapEventManager(this._ngZone);
1215
- /**
1216
- * See developers.google.com/maps/documentation/javascript/reference/directions
1217
- * #DirectionsRenderer.directions_changed
1218
- */
1219
- this.directionsChanged = this._eventManager.getLazyEmitter('directions_changed');
1220
- }
1221
- Object.defineProperty(MapDirectionsRenderer.prototype, "directions", {
1222
- /**
1223
- * See developers.google.com/maps/documentation/javascript/reference/directions
1224
- * #DirectionsRendererOptions.directions
1225
- */
1226
- set: function (directions) {
1227
- this._directions = directions;
1228
- },
1229
- enumerable: false,
1230
- configurable: true
1231
- });
1232
- Object.defineProperty(MapDirectionsRenderer.prototype, "options", {
1233
- /**
1234
- * See developers.google.com/maps/documentation/javascript/reference/directions
1235
- * #DirectionsRendererOptions
1236
- */
1237
- set: function (options) {
1238
- this._options = options;
1239
- },
1240
- enumerable: false,
1241
- configurable: true
1242
- });
1243
- MapDirectionsRenderer.prototype.ngOnInit = function () {
1244
- var _this = this;
1245
- if (this._googleMap._isBrowser) {
1246
- // Create the object outside the zone so its events don't trigger change detection.
1247
- // We'll bring it back in inside the `MapEventManager` only for the events that the
1248
- // user has subscribed to.
1249
- this._ngZone.runOutsideAngular(function () {
1250
- _this.directionsRenderer = new google.maps.DirectionsRenderer(_this._combineOptions());
1251
- });
1252
- this._assertInitialized();
1253
- this.directionsRenderer.setMap(this._googleMap.googleMap);
1254
- this._eventManager.setTarget(this.directionsRenderer);
1255
- }
1256
- };
1257
- MapDirectionsRenderer.prototype.ngOnChanges = function (changes) {
1258
- if (this.directionsRenderer) {
1259
- if (changes['options']) {
1260
- this.directionsRenderer.setOptions(this._combineOptions());
1261
- }
1262
- if (changes['directions'] && this._directions !== undefined) {
1263
- this.directionsRenderer.setDirections(this._directions);
1264
- }
1265
- }
1266
- };
1267
- MapDirectionsRenderer.prototype.ngOnDestroy = function () {
1268
- this._eventManager.destroy();
1269
- if (this.directionsRenderer) {
1270
- this.directionsRenderer.setMap(null);
1271
- }
1272
- };
1273
- /**
1274
- * See developers.google.com/maps/documentation/javascript/reference/directions
1275
- * #DirectionsRenderer.getDirections
1276
- */
1277
- MapDirectionsRenderer.prototype.getDirections = function () {
1278
- this._assertInitialized();
1279
- return this.directionsRenderer.getDirections();
1280
- };
1281
- /**
1282
- * See developers.google.com/maps/documentation/javascript/reference/directions
1283
- * #DirectionsRenderer.getPanel
1284
- */
1285
- MapDirectionsRenderer.prototype.getPanel = function () {
1286
- this._assertInitialized();
1287
- return this.directionsRenderer.getPanel();
1288
- };
1289
- /**
1290
- * See developers.google.com/maps/documentation/javascript/reference/directions
1291
- * #DirectionsRenderer.getRouteIndex
1292
- */
1293
- MapDirectionsRenderer.prototype.getRouteIndex = function () {
1294
- this._assertInitialized();
1295
- return this.directionsRenderer.getRouteIndex();
1296
- };
1297
- MapDirectionsRenderer.prototype._combineOptions = function () {
1298
- var options = this._options || {};
1299
- return Object.assign(Object.assign({}, options), { directions: this._directions || options.directions, map: this._googleMap.googleMap });
1300
- };
1301
- MapDirectionsRenderer.prototype._assertInitialized = function () {
1302
- if (typeof ngDevMode === 'undefined' || ngDevMode) {
1303
- if (!this._googleMap.googleMap) {
1304
- throw Error('Cannot access Google Map information before the API has been initialized. ' +
1305
- 'Please wait for the API to load before trying to interact with it.');
1306
- }
1307
- if (!this.directionsRenderer) {
1308
- throw Error('Cannot interact with a Google Map Directions Renderer before it has been ' +
1309
- 'initialized. Please wait for the Directions Renderer to load before trying ' +
1310
- 'to interact with it.');
1311
- }
1312
- }
1313
- };
1314
- return MapDirectionsRenderer;
1315
- }());
1316
- MapDirectionsRenderer.decorators = [
1317
- { type: i0.Directive, args: [{
1318
- selector: 'map-directions-renderer',
1319
- exportAs: 'mapDirectionsRenderer',
1320
- },] }
1321
- ];
1322
- MapDirectionsRenderer.ctorParameters = function () { return [
1323
- { type: GoogleMap },
1324
- { type: i0.NgZone }
1325
- ]; };
1326
- MapDirectionsRenderer.propDecorators = {
1327
- directions: [{ type: i0.Input }],
1328
- options: [{ type: i0.Input }],
1329
- directionsChanged: [{ type: i0.Output }]
1330
- };
1331
-
1332
- /**
1333
- * @license
1334
- * Copyright Google LLC All Rights Reserved.
1335
- *
1336
- * Use of this source code is governed by an MIT-style license that can be
1337
- * found in the LICENSE file at https://angular.io/license
1338
- */
1339
- /**
1340
- * Angular component that renders a Google Maps Ground Overlay via the Google Maps JavaScript API.
1341
- *
1342
- * See developers.google.com/maps/documentation/javascript/reference/image-overlay#GroundOverlay
1343
- */
1344
- var MapGroundOverlay = /** @class */ (function () {
1345
- function MapGroundOverlay(_map, _ngZone) {
1346
- this._map = _map;
1347
- this._ngZone = _ngZone;
1348
- this._eventManager = new MapEventManager(this._ngZone);
1349
- this._opacity = new rxjs.BehaviorSubject(1);
1350
- this._url = new rxjs.BehaviorSubject('');
1351
- this._bounds = new rxjs.BehaviorSubject(undefined);
1352
- this._destroyed = new rxjs.Subject();
1353
- /** Whether the overlay is clickable */
1354
- this.clickable = false;
1355
- /**
1356
- * See
1357
- * developers.google.com/maps/documentation/javascript/reference/image-overlay#GroundOverlay.click
1358
- */
1359
- this.mapClick = this._eventManager.getLazyEmitter('click');
1360
- /**
1361
- * See
1362
- * developers.google.com/maps/documentation/javascript/reference/image-overlay
1363
- * #GroundOverlay.dblclick
1364
- */
1365
- this.mapDblclick = this._eventManager.getLazyEmitter('dblclick');
1366
- }
1367
- Object.defineProperty(MapGroundOverlay.prototype, "url", {
1368
- /** URL of the image that will be shown in the overlay. */
1369
- set: function (url) {
1370
- this._url.next(url);
1371
- },
1372
- enumerable: false,
1373
- configurable: true
1374
- });
1375
- Object.defineProperty(MapGroundOverlay.prototype, "bounds", {
1376
- /** Bounds for the overlay. */
1377
- get: function () {
1378
- return this._bounds.value;
1379
- },
1380
- set: function (bounds) {
1381
- this._bounds.next(bounds);
1382
- },
1383
- enumerable: false,
1384
- configurable: true
1385
- });
1386
- Object.defineProperty(MapGroundOverlay.prototype, "opacity", {
1387
- /** Opacity of the overlay. */
1388
- set: function (opacity) {
1389
- this._opacity.next(opacity);
1390
- },
1391
- enumerable: false,
1392
- configurable: true
1393
- });
1394
- MapGroundOverlay.prototype.ngOnInit = function () {
1395
- var _this = this;
1396
- if (this._map._isBrowser) {
1397
- // The ground overlay setup is slightly different from the other Google Maps objects in that
1398
- // we have to recreate the `GroundOverlay` object whenever the bounds change, because
1399
- // Google Maps doesn't provide an API to update the bounds of an existing overlay.
1400
- this._bounds.pipe(operators.takeUntil(this._destroyed)).subscribe(function (bounds) {
1401
- if (_this.groundOverlay) {
1402
- _this.groundOverlay.setMap(null);
1403
- _this.groundOverlay = undefined;
1404
- }
1405
- // Create the object outside the zone so its events don't trigger change detection.
1406
- // We'll bring it back in inside the `MapEventManager` only for the events that the
1407
- // user has subscribed to.
1408
- if (bounds) {
1409
- _this._ngZone.runOutsideAngular(function () {
1410
- _this.groundOverlay = new google.maps.GroundOverlay(_this._url.getValue(), bounds, {
1411
- clickable: _this.clickable,
1412
- opacity: _this._opacity.value,
1413
- });
1414
- });
1415
- _this._assertInitialized();
1416
- _this.groundOverlay.setMap(_this._map.googleMap);
1417
- _this._eventManager.setTarget(_this.groundOverlay);
1418
- }
1419
- });
1420
- this._watchForOpacityChanges();
1421
- this._watchForUrlChanges();
1422
- }
1423
- };
1424
- MapGroundOverlay.prototype.ngOnDestroy = function () {
1425
- this._eventManager.destroy();
1426
- this._destroyed.next();
1427
- this._destroyed.complete();
1428
- if (this.groundOverlay) {
1429
- this.groundOverlay.setMap(null);
1430
- }
1431
- };
1432
- /**
1433
- * See
1434
- * developers.google.com/maps/documentation/javascript/reference/image-overlay
1435
- * #GroundOverlay.getBounds
1436
- */
1437
- MapGroundOverlay.prototype.getBounds = function () {
1438
- this._assertInitialized();
1439
- return this.groundOverlay.getBounds();
1440
- };
1441
- /**
1442
- * See
1443
- * developers.google.com/maps/documentation/javascript/reference/image-overlay
1444
- * #GroundOverlay.getOpacity
1445
- */
1446
- MapGroundOverlay.prototype.getOpacity = function () {
1447
- this._assertInitialized();
1448
- return this.groundOverlay.getOpacity();
1449
- };
1450
- /**
1451
- * See
1452
- * developers.google.com/maps/documentation/javascript/reference/image-overlay
1453
- * #GroundOverlay.getUrl
1454
- */
1455
- MapGroundOverlay.prototype.getUrl = function () {
1456
- this._assertInitialized();
1457
- return this.groundOverlay.getUrl();
1458
- };
1459
- MapGroundOverlay.prototype._watchForOpacityChanges = function () {
1460
- var _this = this;
1461
- this._opacity.pipe(operators.takeUntil(this._destroyed)).subscribe(function (opacity) {
1462
- if (opacity != null) {
1463
- _this._assertInitialized();
1464
- _this.groundOverlay.setOpacity(opacity);
1465
- }
1466
- });
1467
- };
1468
- MapGroundOverlay.prototype._watchForUrlChanges = function () {
1469
- var _this = this;
1470
- this._url.pipe(operators.takeUntil(this._destroyed)).subscribe(function (url) {
1471
- _this._assertInitialized();
1472
- var overlay = _this.groundOverlay;
1473
- overlay.set('url', url);
1474
- // Google Maps only redraws the overlay if we re-set the map.
1475
- overlay.setMap(null);
1476
- overlay.setMap(_this._map.googleMap);
1477
- });
1478
- };
1479
- MapGroundOverlay.prototype._assertInitialized = function () {
1480
- if (typeof ngDevMode === 'undefined' || ngDevMode) {
1481
- if (!this._map.googleMap) {
1482
- throw Error('Cannot access Google Map information before the API has been initialized. ' +
1483
- 'Please wait for the API to load before trying to interact with it.');
1484
- }
1485
- if (!this.groundOverlay) {
1486
- throw Error('Cannot interact with a Google Map GroundOverlay before it has been initialized. ' +
1487
- 'Please wait for the GroundOverlay to load before trying to interact with it.');
1488
- }
1489
- }
1490
- };
1491
- return MapGroundOverlay;
1492
- }());
1493
- MapGroundOverlay.decorators = [
1494
- { type: i0.Directive, args: [{
1495
- selector: 'map-ground-overlay',
1496
- exportAs: 'mapGroundOverlay',
1497
- },] }
1498
- ];
1499
- MapGroundOverlay.ctorParameters = function () { return [
1500
- { type: GoogleMap },
1501
- { type: i0.NgZone }
1502
- ]; };
1503
- MapGroundOverlay.propDecorators = {
1504
- url: [{ type: i0.Input }],
1505
- bounds: [{ type: i0.Input }],
1506
- clickable: [{ type: i0.Input }],
1507
- opacity: [{ type: i0.Input }],
1508
- mapClick: [{ type: i0.Output }],
1509
- mapDblclick: [{ type: i0.Output }]
1510
- };
1511
-
1512
- /**
1513
- * Angular component that renders a Google Maps info window via the Google Maps JavaScript API.
1514
- *
1515
- * See developers.google.com/maps/documentation/javascript/reference/info-window
1516
- */
1517
- var MapInfoWindow = /** @class */ (function () {
1518
- function MapInfoWindow(_googleMap, _elementRef, _ngZone) {
1519
- this._googleMap = _googleMap;
1520
- this._elementRef = _elementRef;
1521
- this._ngZone = _ngZone;
1522
- this._eventManager = new MapEventManager(this._ngZone);
1523
- this._options = new rxjs.BehaviorSubject({});
1524
- this._position = new rxjs.BehaviorSubject(undefined);
1525
- this._destroy = new rxjs.Subject();
1526
- /**
1527
- * See
1528
- * developers.google.com/maps/documentation/javascript/reference/info-window#InfoWindow.closeclick
1529
- */
1530
- this.closeclick = this._eventManager.getLazyEmitter('closeclick');
1531
- /**
1532
- * See
1533
- * developers.google.com/maps/documentation/javascript/reference/info-window
1534
- * #InfoWindow.content_changed
1535
- */
1536
- this.contentChanged = this._eventManager.getLazyEmitter('content_changed');
1537
- /**
1538
- * See
1539
- * developers.google.com/maps/documentation/javascript/reference/info-window#InfoWindow.domready
1540
- */
1541
- this.domready = this._eventManager.getLazyEmitter('domready');
1542
- /**
1543
- * See
1544
- * developers.google.com/maps/documentation/javascript/reference/info-window
1545
- * #InfoWindow.position_changed
1546
- */
1547
- this.positionChanged = this._eventManager.getLazyEmitter('position_changed');
1548
- /**
1549
- * See
1550
- * developers.google.com/maps/documentation/javascript/reference/info-window
1551
- * #InfoWindow.zindex_changed
1552
- */
1553
- this.zindexChanged = this._eventManager.getLazyEmitter('zindex_changed');
1554
- }
1555
- Object.defineProperty(MapInfoWindow.prototype, "options", {
1556
- set: function (options) {
1557
- this._options.next(options || {});
1558
- },
1559
- enumerable: false,
1560
- configurable: true
1561
- });
1562
- Object.defineProperty(MapInfoWindow.prototype, "position", {
1563
- set: function (position) {
1564
- this._position.next(position);
1565
- },
1566
- enumerable: false,
1567
- configurable: true
1568
- });
1569
- MapInfoWindow.prototype.ngOnInit = function () {
1570
- var _this = this;
1571
- if (this._googleMap._isBrowser) {
1572
- var combinedOptionsChanges = this._combineOptions();
1573
- combinedOptionsChanges.pipe(operators.take(1)).subscribe(function (options) {
1574
- // Create the object outside the zone so its events don't trigger change detection.
1575
- // We'll bring it back in inside the `MapEventManager` only for the events that the
1576
- // user has subscribed to.
1577
- _this._ngZone.runOutsideAngular(function () {
1578
- _this.infoWindow = new google.maps.InfoWindow(options);
1579
- });
1580
- _this._eventManager.setTarget(_this.infoWindow);
1581
- });
1582
- this._watchForOptionsChanges();
1583
- this._watchForPositionChanges();
1584
- }
1585
- };
1586
- MapInfoWindow.prototype.ngOnDestroy = function () {
1587
- this._eventManager.destroy();
1588
- this._destroy.next();
1589
- this._destroy.complete();
1590
- // If no info window has been created on the server, we do not try closing it.
1591
- // On the server, an info window cannot be created and this would cause errors.
1592
- if (this.infoWindow) {
1593
- this.close();
1594
- }
1595
- };
1596
- /**
1597
- * See developers.google.com/maps/documentation/javascript/reference/info-window#InfoWindow.close
1598
- */
1599
- MapInfoWindow.prototype.close = function () {
1600
- this._assertInitialized();
1601
- this.infoWindow.close();
1602
- };
1603
- /**
1604
- * See
1605
- * developers.google.com/maps/documentation/javascript/reference/info-window#InfoWindow.getContent
1606
- */
1607
- MapInfoWindow.prototype.getContent = function () {
1608
- this._assertInitialized();
1609
- return this.infoWindow.getContent();
1610
- };
1611
- /**
1612
- * See
1613
- * developers.google.com/maps/documentation/javascript/reference/info-window
1614
- * #InfoWindow.getPosition
1615
- */
1616
- MapInfoWindow.prototype.getPosition = function () {
1617
- this._assertInitialized();
1618
- return this.infoWindow.getPosition();
1619
- };
1620
- /**
1621
- * See
1622
- * developers.google.com/maps/documentation/javascript/reference/info-window#InfoWindow.getZIndex
1623
- */
1624
- MapInfoWindow.prototype.getZIndex = function () {
1625
- this._assertInitialized();
1626
- return this.infoWindow.getZIndex();
1627
- };
1628
- /**
1629
- * Opens the MapInfoWindow using the provided anchor. If the anchor is not set,
1630
- * then the position property of the options input is used instead.
1631
- */
1632
- MapInfoWindow.prototype.open = function (anchor) {
1633
- this._assertInitialized();
1634
- var anchorObject = anchor ? anchor.getAnchor() : undefined;
1635
- // Prevent the info window from initializing when trying to reopen on the same anchor.
1636
- // Note that when the window is opened for the first time, the anchor will always be
1637
- // undefined. If that's the case, we have to allow it to open in order to handle the
1638
- // case where the window doesn't have an anchor, but is placed at a particular position.
1639
- if (this.infoWindow.get('anchor') !== anchorObject || !anchorObject) {
1640
- this._elementRef.nativeElement.style.display = '';
1641
- this.infoWindow.open(this._googleMap.googleMap, anchorObject);
1642
- }
1643
- };
1644
- MapInfoWindow.prototype._combineOptions = function () {
1645
- var _this = this;
1646
- return rxjs.combineLatest([this._options, this._position]).pipe(operators.map(function (_a) {
1647
- var _b = __read(_a, 2), options = _b[0], position = _b[1];
1648
- var combinedOptions = Object.assign(Object.assign({}, options), { position: position || options.position, content: _this._elementRef.nativeElement });
1649
- return combinedOptions;
1650
- }));
1651
- };
1652
- MapInfoWindow.prototype._watchForOptionsChanges = function () {
1653
- var _this = this;
1654
- this._options.pipe(operators.takeUntil(this._destroy)).subscribe(function (options) {
1655
- _this._assertInitialized();
1656
- _this.infoWindow.setOptions(options);
1657
- });
1658
- };
1659
- MapInfoWindow.prototype._watchForPositionChanges = function () {
1660
- var _this = this;
1661
- this._position.pipe(operators.takeUntil(this._destroy)).subscribe(function (position) {
1662
- if (position) {
1663
- _this._assertInitialized();
1664
- _this.infoWindow.setPosition(position);
1665
- }
1666
- });
1667
- };
1668
- MapInfoWindow.prototype._assertInitialized = function () {
1669
- if (typeof ngDevMode === 'undefined' || ngDevMode) {
1670
- if (!this._googleMap.googleMap) {
1671
- throw Error('Cannot access Google Map information before the API has been initialized. ' +
1672
- 'Please wait for the API to load before trying to interact with it.');
1673
- }
1674
- if (!this.infoWindow) {
1675
- throw Error('Cannot interact with a Google Map Info Window before it has been ' +
1676
- 'initialized. Please wait for the Info Window to load before trying to interact with ' +
1677
- 'it.');
1678
- }
1679
- }
1680
- };
1681
- return MapInfoWindow;
1682
- }());
1683
- MapInfoWindow.decorators = [
1684
- { type: i0.Directive, args: [{
1685
- selector: 'map-info-window',
1686
- exportAs: 'mapInfoWindow',
1687
- host: { 'style': 'display: none' },
1688
- },] }
1689
- ];
1690
- MapInfoWindow.ctorParameters = function () { return [
1691
- { type: GoogleMap },
1692
- { type: i0.ElementRef },
1693
- { type: i0.NgZone }
1694
- ]; };
1695
- MapInfoWindow.propDecorators = {
1696
- options: [{ type: i0.Input }],
1697
- position: [{ type: i0.Input }],
1698
- closeclick: [{ type: i0.Output }],
1699
- contentChanged: [{ type: i0.Output }],
1700
- domready: [{ type: i0.Output }],
1701
- positionChanged: [{ type: i0.Output }],
1702
- zindexChanged: [{ type: i0.Output }]
1703
- };
1704
-
1705
- /**
1706
- * Angular component that renders a Google Maps KML Layer via the Google Maps JavaScript API.
1707
- *
1708
- * See developers.google.com/maps/documentation/javascript/reference/kml#KmlLayer
1709
- */
1710
- var MapKmlLayer = /** @class */ (function () {
1711
- function MapKmlLayer(_map, _ngZone) {
1712
- this._map = _map;
1713
- this._ngZone = _ngZone;
1714
- this._eventManager = new MapEventManager(this._ngZone);
1715
- this._options = new rxjs.BehaviorSubject({});
1716
- this._url = new rxjs.BehaviorSubject('');
1717
- this._destroyed = new rxjs.Subject();
1718
- /**
1719
- * See developers.google.com/maps/documentation/javascript/reference/kml#KmlLayer.click
1720
- */
1721
- this.kmlClick = this._eventManager.getLazyEmitter('click');
1722
- /**
1723
- * See
1724
- * developers.google.com/maps/documentation/javascript/reference/kml
1725
- * #KmlLayer.defaultviewport_changed
1726
- */
1727
- this.defaultviewportChanged = this._eventManager.getLazyEmitter('defaultviewport_changed');
1728
- /**
1729
- * See developers.google.com/maps/documentation/javascript/reference/kml#KmlLayer.status_changed
1730
- */
1731
- this.statusChanged = this._eventManager.getLazyEmitter('status_changed');
1732
- }
1733
- Object.defineProperty(MapKmlLayer.prototype, "options", {
1734
- set: function (options) {
1735
- this._options.next(options || {});
1736
- },
1737
- enumerable: false,
1738
- configurable: true
1739
- });
1740
- Object.defineProperty(MapKmlLayer.prototype, "url", {
1741
- set: function (url) {
1742
- this._url.next(url);
1743
- },
1744
- enumerable: false,
1745
- configurable: true
1746
- });
1747
- MapKmlLayer.prototype.ngOnInit = function () {
1748
- var _this = this;
1749
- if (this._map._isBrowser) {
1750
- this._combineOptions().pipe(operators.take(1)).subscribe(function (options) {
1751
- // Create the object outside the zone so its events don't trigger change detection.
1752
- // We'll bring it back in inside the `MapEventManager` only for the events that the
1753
- // user has subscribed to.
1754
- _this._ngZone.runOutsideAngular(function () { return _this.kmlLayer = new google.maps.KmlLayer(options); });
1755
- _this._assertInitialized();
1756
- _this.kmlLayer.setMap(_this._map.googleMap);
1757
- _this._eventManager.setTarget(_this.kmlLayer);
1758
- });
1759
- this._watchForOptionsChanges();
1760
- this._watchForUrlChanges();
1761
- }
1762
- };
1763
- MapKmlLayer.prototype.ngOnDestroy = function () {
1764
- this._eventManager.destroy();
1765
- this._destroyed.next();
1766
- this._destroyed.complete();
1767
- if (this.kmlLayer) {
1768
- this.kmlLayer.setMap(null);
1769
- }
1770
- };
1771
- /**
1772
- * See
1773
- * developers.google.com/maps/documentation/javascript/reference/kml#KmlLayer.getDefaultViewport
1774
- */
1775
- MapKmlLayer.prototype.getDefaultViewport = function () {
1776
- this._assertInitialized();
1777
- return this.kmlLayer.getDefaultViewport();
1778
- };
1779
- /**
1780
- * See developers.google.com/maps/documentation/javascript/reference/kml#KmlLayer.getMetadata
1781
- */
1782
- MapKmlLayer.prototype.getMetadata = function () {
1783
- this._assertInitialized();
1784
- return this.kmlLayer.getMetadata();
1785
- };
1786
- /**
1787
- * See developers.google.com/maps/documentation/javascript/reference/kml#KmlLayer.getStatus
1788
- */
1789
- MapKmlLayer.prototype.getStatus = function () {
1790
- this._assertInitialized();
1791
- return this.kmlLayer.getStatus();
1792
- };
1793
- /**
1794
- * See developers.google.com/maps/documentation/javascript/reference/kml#KmlLayer.getUrl
1795
- */
1796
- MapKmlLayer.prototype.getUrl = function () {
1797
- this._assertInitialized();
1798
- return this.kmlLayer.getUrl();
1799
- };
1800
- /**
1801
- * See developers.google.com/maps/documentation/javascript/reference/kml#KmlLayer.getZIndex
1802
- */
1803
- MapKmlLayer.prototype.getZIndex = function () {
1804
- this._assertInitialized();
1805
- return this.kmlLayer.getZIndex();
1806
- };
1807
- MapKmlLayer.prototype._combineOptions = function () {
1808
- return rxjs.combineLatest([this._options, this._url]).pipe(operators.map(function (_a) {
1809
- var _b = __read(_a, 2), options = _b[0], url = _b[1];
1810
- var combinedOptions = Object.assign(Object.assign({}, options), { url: url || options.url });
1811
- return combinedOptions;
1812
- }));
1813
- };
1814
- MapKmlLayer.prototype._watchForOptionsChanges = function () {
1815
- var _this = this;
1816
- this._options.pipe(operators.takeUntil(this._destroyed)).subscribe(function (options) {
1817
- if (_this.kmlLayer) {
1818
- _this._assertInitialized();
1819
- _this.kmlLayer.setOptions(options);
1820
- }
1821
- });
1822
- };
1823
- MapKmlLayer.prototype._watchForUrlChanges = function () {
1824
- var _this = this;
1825
- this._url.pipe(operators.takeUntil(this._destroyed)).subscribe(function (url) {
1826
- if (url && _this.kmlLayer) {
1827
- _this._assertInitialized();
1828
- _this.kmlLayer.setUrl(url);
1829
- }
1830
- });
1831
- };
1832
- MapKmlLayer.prototype._assertInitialized = function () {
1833
- if (typeof ngDevMode === 'undefined' || ngDevMode) {
1834
- if (!this._map.googleMap) {
1835
- throw Error('Cannot access Google Map information before the API has been initialized. ' +
1836
- 'Please wait for the API to load before trying to interact with it.');
1837
- }
1838
- if (!this.kmlLayer) {
1839
- throw Error('Cannot interact with a Google Map KmlLayer before it has been ' +
1840
- 'initialized. Please wait for the KmlLayer to load before trying to interact with it.');
1841
- }
1842
- }
1843
- };
1844
- return MapKmlLayer;
1845
- }());
1846
- MapKmlLayer.decorators = [
1847
- { type: i0.Directive, args: [{
1848
- selector: 'map-kml-layer',
1849
- exportAs: 'mapKmlLayer',
1850
- },] }
1851
- ];
1852
- MapKmlLayer.ctorParameters = function () { return [
1853
- { type: GoogleMap },
1854
- { type: i0.NgZone }
1855
- ]; };
1856
- MapKmlLayer.propDecorators = {
1857
- options: [{ type: i0.Input }],
1858
- url: [{ type: i0.Input }],
1859
- kmlClick: [{ type: i0.Output }],
1860
- defaultviewportChanged: [{ type: i0.Output }],
1861
- statusChanged: [{ type: i0.Output }]
1862
- };
1863
-
1864
- /**
1865
- * @license
1866
- * Copyright Google LLC All Rights Reserved.
1867
- *
1868
- * Use of this source code is governed by an MIT-style license that can be
1869
- * found in the LICENSE file at https://angular.io/license
1870
- */
1871
- /**
1872
- * Default options for the Google Maps marker component. Displays a marker
1873
- * at the Googleplex.
1874
- */
1875
- var DEFAULT_MARKER_OPTIONS = {
1876
- position: { lat: 37.421995, lng: -122.084092 },
1877
- };
1878
- /**
1879
- * Angular component that renders a Google Maps marker via the Google Maps JavaScript API.
1880
- *
1881
- * See developers.google.com/maps/documentation/javascript/reference/marker
1882
- */
1883
- var MapMarker = /** @class */ (function () {
1884
- function MapMarker(_googleMap, _ngZone) {
1885
- this._googleMap = _googleMap;
1886
- this._ngZone = _ngZone;
1887
- this._eventManager = new MapEventManager(this._ngZone);
1888
- /**
1889
- * See
1890
- * developers.google.com/maps/documentation/javascript/reference/marker#Marker.animation_changed
1891
- */
1892
- this.animationChanged = this._eventManager.getLazyEmitter('animation_changed');
1893
- /**
1894
- * See
1895
- * developers.google.com/maps/documentation/javascript/reference/marker#Marker.click
1896
- */
1897
- this.mapClick = this._eventManager.getLazyEmitter('click');
1898
- /**
1899
- * See
1900
- * developers.google.com/maps/documentation/javascript/reference/marker#Marker.clickable_changed
1901
- */
1902
- this.clickableChanged = this._eventManager.getLazyEmitter('clickable_changed');
1903
- /**
1904
- * See
1905
- * developers.google.com/maps/documentation/javascript/reference/marker#Marker.cursor_changed
1906
- */
1907
- this.cursorChanged = this._eventManager.getLazyEmitter('cursor_changed');
1908
- /**
1909
- * See
1910
- * developers.google.com/maps/documentation/javascript/reference/marker#Marker.dblclick
1911
- */
1912
- this.mapDblclick = this._eventManager.getLazyEmitter('dblclick');
1913
- /**
1914
- * See
1915
- * developers.google.com/maps/documentation/javascript/reference/marker#Marker.drag
1916
- */
1917
- this.mapDrag = this._eventManager.getLazyEmitter('drag');
1918
- /**
1919
- * See
1920
- * developers.google.com/maps/documentation/javascript/reference/marker#Marker.dragend
1921
- */
1922
- this.mapDragend = this._eventManager.getLazyEmitter('dragend');
1923
- /**
1924
- * See
1925
- * developers.google.com/maps/documentation/javascript/reference/marker#Marker.draggable_changed
1926
- */
1927
- this.draggableChanged = this._eventManager.getLazyEmitter('draggable_changed');
1928
- /**
1929
- * See
1930
- * developers.google.com/maps/documentation/javascript/reference/marker#Marker.dragstart
1931
- */
1932
- this.mapDragstart = this._eventManager.getLazyEmitter('dragstart');
1933
- /**
1934
- * See
1935
- * developers.google.com/maps/documentation/javascript/reference/marker#Marker.flat_changed
1936
- */
1937
- this.flatChanged = this._eventManager.getLazyEmitter('flat_changed');
1938
- /**
1939
- * See
1940
- * developers.google.com/maps/documentation/javascript/reference/marker#Marker.icon_changed
1941
- */
1942
- this.iconChanged = this._eventManager.getLazyEmitter('icon_changed');
1943
- /**
1944
- * See
1945
- * developers.google.com/maps/documentation/javascript/reference/marker#Marker.mousedown
1946
- */
1947
- this.mapMousedown = this._eventManager.getLazyEmitter('mousedown');
1948
- /**
1949
- * See
1950
- * developers.google.com/maps/documentation/javascript/reference/marker#Marker.mouseout
1951
- */
1952
- this.mapMouseout = this._eventManager.getLazyEmitter('mouseout');
1953
- /**
1954
- * See
1955
- * developers.google.com/maps/documentation/javascript/reference/marker#Marker.mouseover
1956
- */
1957
- this.mapMouseover = this._eventManager.getLazyEmitter('mouseover');
1958
- /**
1959
- * See
1960
- * developers.google.com/maps/documentation/javascript/reference/marker#Marker.mouseup
1961
- */
1962
- this.mapMouseup = this._eventManager.getLazyEmitter('mouseup');
1963
- /**
1964
- * See
1965
- * developers.google.com/maps/documentation/javascript/reference/marker#Marker.position_changed
1966
- */
1967
- this.positionChanged = this._eventManager.getLazyEmitter('position_changed');
1968
- /**
1969
- * See
1970
- * developers.google.com/maps/documentation/javascript/reference/marker#Marker.rightclick
1971
- */
1972
- this.mapRightclick = this._eventManager.getLazyEmitter('rightclick');
1973
- /**
1974
- * See
1975
- * developers.google.com/maps/documentation/javascript/reference/marker#Marker.shape_changed
1976
- */
1977
- this.shapeChanged = this._eventManager.getLazyEmitter('shape_changed');
1978
- /**
1979
- * See
1980
- * developers.google.com/maps/documentation/javascript/reference/marker#Marker.title_changed
1981
- */
1982
- this.titleChanged = this._eventManager.getLazyEmitter('title_changed');
1983
- /**
1984
- * See
1985
- * developers.google.com/maps/documentation/javascript/reference/marker#Marker.visible_changed
1986
- */
1987
- this.visibleChanged = this._eventManager.getLazyEmitter('visible_changed');
1988
- /**
1989
- * See
1990
- * developers.google.com/maps/documentation/javascript/reference/marker#Marker.zindex_changed
1991
- */
1992
- this.zindexChanged = this._eventManager.getLazyEmitter('zindex_changed');
1993
- }
1994
- Object.defineProperty(MapMarker.prototype, "title", {
1995
- /**
1996
- * Title of the marker.
1997
- * See: developers.google.com/maps/documentation/javascript/reference/marker#MarkerOptions.title
1998
- */
1999
- set: function (title) {
2000
- this._title = title;
2001
- },
2002
- enumerable: false,
2003
- configurable: true
2004
- });
2005
- Object.defineProperty(MapMarker.prototype, "position", {
2006
- /**
2007
- * Position of the marker. See:
2008
- * developers.google.com/maps/documentation/javascript/reference/marker#MarkerOptions.position
2009
- */
2010
- set: function (position) {
2011
- this._position = position;
2012
- },
2013
- enumerable: false,
2014
- configurable: true
2015
- });
2016
- Object.defineProperty(MapMarker.prototype, "label", {
2017
- /**
2018
- * Label for the marker.
2019
- * See: developers.google.com/maps/documentation/javascript/reference/marker#MarkerOptions.label
2020
- */
2021
- set: function (label) {
2022
- this._label = label;
2023
- },
2024
- enumerable: false,
2025
- configurable: true
2026
- });
2027
- Object.defineProperty(MapMarker.prototype, "clickable", {
2028
- /**
2029
- * Whether the marker is clickable. See:
2030
- * developers.google.com/maps/documentation/javascript/reference/marker#MarkerOptions.clickable
2031
- */
2032
- set: function (clickable) {
2033
- this._clickable = clickable;
2034
- },
2035
- enumerable: false,
2036
- configurable: true
2037
- });
2038
- Object.defineProperty(MapMarker.prototype, "options", {
2039
- /**
2040
- * Options used to configure the marker.
2041
- * See: developers.google.com/maps/documentation/javascript/reference/marker#MarkerOptions
2042
- */
2043
- set: function (options) {
2044
- this._options = options;
2045
- },
2046
- enumerable: false,
2047
- configurable: true
2048
- });
2049
- Object.defineProperty(MapMarker.prototype, "icon", {
2050
- /**
2051
- * Icon to be used for the marker.
2052
- * See: https://developers.google.com/maps/documentation/javascript/reference/marker#Icon
2053
- */
2054
- set: function (icon) {
2055
- this._icon = icon;
2056
- },
2057
- enumerable: false,
2058
- configurable: true
2059
- });
2060
- Object.defineProperty(MapMarker.prototype, "visible", {
2061
- /**
2062
- * Whether the marker is visible.
2063
- * See: developers.google.com/maps/documentation/javascript/reference/marker#MarkerOptions.visible
2064
- */
2065
- set: function (value) {
2066
- this._visible = value;
2067
- },
2068
- enumerable: false,
2069
- configurable: true
2070
- });
2071
- MapMarker.prototype.ngOnInit = function () {
2072
- var _this = this;
2073
- if (this._googleMap._isBrowser) {
2074
- // Create the object outside the zone so its events don't trigger change detection.
2075
- // We'll bring it back in inside the `MapEventManager` only for the events that the
2076
- // user has subscribed to.
2077
- this._ngZone.runOutsideAngular(function () {
2078
- _this.marker = new google.maps.Marker(_this._combineOptions());
2079
- });
2080
- this._assertInitialized();
2081
- this.marker.setMap(this._googleMap.googleMap);
2082
- this._eventManager.setTarget(this.marker);
2083
- }
2084
- };
2085
- MapMarker.prototype.ngOnChanges = function (changes) {
2086
- var _c = this, marker = _c.marker, _title = _c._title, _position = _c._position, _label = _c._label, _clickable = _c._clickable, _icon = _c._icon, _visible = _c._visible;
2087
- if (marker) {
2088
- if (changes['options']) {
2089
- marker.setOptions(this._combineOptions());
2090
- }
2091
- if (changes['title'] && _title !== undefined) {
2092
- marker.setTitle(_title);
2093
- }
2094
- if (changes['position'] && _position) {
2095
- marker.setPosition(_position);
2096
- }
2097
- if (changes['label'] && _label !== undefined) {
2098
- marker.setLabel(_label);
2099
- }
2100
- if (changes['clickable'] && _clickable !== undefined) {
2101
- marker.setClickable(_clickable);
2102
- }
2103
- if (changes['icon'] && _icon) {
2104
- marker.setIcon(_icon);
2105
- }
2106
- if (changes['visible'] && _visible !== undefined) {
2107
- marker.setVisible(_visible);
2108
- }
2109
- }
2110
- };
2111
- MapMarker.prototype.ngOnDestroy = function () {
2112
- this._eventManager.destroy();
2113
- if (this.marker) {
2114
- this.marker.setMap(null);
2115
- }
2116
- };
2117
- /**
2118
- * See
2119
- * developers.google.com/maps/documentation/javascript/reference/marker#Marker.getAnimation
2120
- */
2121
- MapMarker.prototype.getAnimation = function () {
2122
- this._assertInitialized();
2123
- return this.marker.getAnimation() || null;
2124
- };
2125
- /**
2126
- * See
2127
- * developers.google.com/maps/documentation/javascript/reference/marker#Marker.getClickable
2128
- */
2129
- MapMarker.prototype.getClickable = function () {
2130
- this._assertInitialized();
2131
- return this.marker.getClickable();
2132
- };
2133
- /**
2134
- * See
2135
- * developers.google.com/maps/documentation/javascript/reference/marker#Marker.getCursor
2136
- */
2137
- MapMarker.prototype.getCursor = function () {
2138
- this._assertInitialized();
2139
- return this.marker.getCursor() || null;
2140
- };
2141
- /**
2142
- * See
2143
- * developers.google.com/maps/documentation/javascript/reference/marker#Marker.getDraggable
2144
- */
2145
- MapMarker.prototype.getDraggable = function () {
2146
- this._assertInitialized();
2147
- return !!this.marker.getDraggable();
2148
- };
2149
- /**
2150
- * See
2151
- * developers.google.com/maps/documentation/javascript/reference/marker#Marker.getIcon
2152
- */
2153
- MapMarker.prototype.getIcon = function () {
2154
- this._assertInitialized();
2155
- return this.marker.getIcon() || null;
2156
- };
2157
- /**
2158
- * See
2159
- * developers.google.com/maps/documentation/javascript/reference/marker#Marker.getLabel
2160
- */
2161
- MapMarker.prototype.getLabel = function () {
2162
- this._assertInitialized();
2163
- return this.marker.getLabel() || null;
2164
- };
2165
- /**
2166
- * See
2167
- * developers.google.com/maps/documentation/javascript/reference/marker#Marker.getOpacity
2168
- */
2169
- MapMarker.prototype.getOpacity = function () {
2170
- this._assertInitialized();
2171
- return this.marker.getOpacity() || null;
2172
- };
2173
- /**
2174
- * See
2175
- * developers.google.com/maps/documentation/javascript/reference/marker#Marker.getPosition
2176
- */
2177
- MapMarker.prototype.getPosition = function () {
2178
- this._assertInitialized();
2179
- return this.marker.getPosition() || null;
2180
- };
2181
- /**
2182
- * See
2183
- * developers.google.com/maps/documentation/javascript/reference/marker#Marker.getShape
2184
- */
2185
- MapMarker.prototype.getShape = function () {
2186
- this._assertInitialized();
2187
- return this.marker.getShape() || null;
2188
- };
2189
- /**
2190
- * See
2191
- * developers.google.com/maps/documentation/javascript/reference/marker#Marker.getTitle
2192
- */
2193
- MapMarker.prototype.getTitle = function () {
2194
- this._assertInitialized();
2195
- return this.marker.getTitle() || null;
2196
- };
2197
- /**
2198
- * See
2199
- * developers.google.com/maps/documentation/javascript/reference/marker#Marker.getVisible
2200
- */
2201
- MapMarker.prototype.getVisible = function () {
2202
- this._assertInitialized();
2203
- return this.marker.getVisible();
2204
- };
2205
- /**
2206
- * See
2207
- * developers.google.com/maps/documentation/javascript/reference/marker#Marker.getZIndex
2208
- */
2209
- MapMarker.prototype.getZIndex = function () {
2210
- this._assertInitialized();
2211
- return this.marker.getZIndex() || null;
2212
- };
2213
- /** Gets the anchor point that can be used to attach other Google Maps objects. */
2214
- MapMarker.prototype.getAnchor = function () {
2215
- this._assertInitialized();
2216
- return this.marker;
2217
- };
2218
- /** Creates a combined options object using the passed-in options and the individual inputs. */
2219
- MapMarker.prototype._combineOptions = function () {
2220
- var _a, _b;
2221
- var options = this._options || DEFAULT_MARKER_OPTIONS;
2222
- return Object.assign(Object.assign({}, options), { title: this._title || options.title, position: this._position || options.position, label: this._label || options.label, clickable: (_a = this._clickable) !== null && _a !== void 0 ? _a : options.clickable, map: this._googleMap.googleMap, icon: this._icon || options.icon, visible: (_b = this._visible) !== null && _b !== void 0 ? _b : options.visible });
2223
- };
2224
- MapMarker.prototype._assertInitialized = function () {
2225
- if (typeof ngDevMode === 'undefined' || ngDevMode) {
2226
- if (!this._googleMap.googleMap) {
2227
- throw Error('Cannot access Google Map information before the API has been initialized. ' +
2228
- 'Please wait for the API to load before trying to interact with it.');
2229
- }
2230
- if (!this.marker) {
2231
- throw Error('Cannot interact with a Google Map Marker before it has been ' +
2232
- 'initialized. Please wait for the Marker to load before trying to interact with it.');
2233
- }
2234
- }
2235
- };
2236
- return MapMarker;
2237
- }());
2238
- MapMarker.decorators = [
2239
- { type: i0.Directive, args: [{
2240
- selector: 'map-marker',
2241
- exportAs: 'mapMarker',
2242
- },] }
2243
- ];
2244
- MapMarker.ctorParameters = function () { return [
2245
- { type: GoogleMap },
2246
- { type: i0.NgZone }
2247
- ]; };
2248
- MapMarker.propDecorators = {
2249
- title: [{ type: i0.Input }],
2250
- position: [{ type: i0.Input }],
2251
- label: [{ type: i0.Input }],
2252
- clickable: [{ type: i0.Input }],
2253
- options: [{ type: i0.Input }],
2254
- icon: [{ type: i0.Input }],
2255
- visible: [{ type: i0.Input }],
2256
- animationChanged: [{ type: i0.Output }],
2257
- mapClick: [{ type: i0.Output }],
2258
- clickableChanged: [{ type: i0.Output }],
2259
- cursorChanged: [{ type: i0.Output }],
2260
- mapDblclick: [{ type: i0.Output }],
2261
- mapDrag: [{ type: i0.Output }],
2262
- mapDragend: [{ type: i0.Output }],
2263
- draggableChanged: [{ type: i0.Output }],
2264
- mapDragstart: [{ type: i0.Output }],
2265
- flatChanged: [{ type: i0.Output }],
2266
- iconChanged: [{ type: i0.Output }],
2267
- mapMousedown: [{ type: i0.Output }],
2268
- mapMouseout: [{ type: i0.Output }],
2269
- mapMouseover: [{ type: i0.Output }],
2270
- mapMouseup: [{ type: i0.Output }],
2271
- positionChanged: [{ type: i0.Output }],
2272
- mapRightclick: [{ type: i0.Output }],
2273
- shapeChanged: [{ type: i0.Output }],
2274
- titleChanged: [{ type: i0.Output }],
2275
- visibleChanged: [{ type: i0.Output }],
2276
- zindexChanged: [{ type: i0.Output }]
2277
- };
2278
-
2279
- /** Default options for a clusterer. */
2280
- var DEFAULT_CLUSTERER_OPTIONS = {};
2281
- /**
2282
- * Angular component for implementing a Google Maps Marker Clusterer.
2283
- *
2284
- * See https://developers.google.com/maps/documentation/javascript/marker-clustering
2285
- */
2286
- var MapMarkerClusterer = /** @class */ (function () {
2287
- function MapMarkerClusterer(_googleMap, _ngZone) {
2288
- this._googleMap = _googleMap;
2289
- this._ngZone = _ngZone;
2290
- this._currentMarkers = new Set();
2291
- this._eventManager = new MapEventManager(this._ngZone);
2292
- this._destroy = new rxjs.Subject();
2293
- this.ariaLabelFn = function () { return ''; };
2294
- /**
2295
- * See
2296
- * googlemaps.github.io/v3-utility-library/modules/
2297
- * _google_markerclustererplus.html#clusteringbegin
2298
- */
2299
- this.clusteringbegin = this._eventManager.getLazyEmitter('clusteringbegin');
2300
- /**
2301
- * See
2302
- * googlemaps.github.io/v3-utility-library/modules/_google_markerclustererplus.html#clusteringend
2303
- */
2304
- this.clusteringend = this._eventManager.getLazyEmitter('clusteringend');
2305
- /** Emits when a cluster has been clicked. */
2306
- this.clusterClick = this._eventManager.getLazyEmitter('click');
2307
- this._canInitialize = this._googleMap._isBrowser;
2308
- }
2309
- Object.defineProperty(MapMarkerClusterer.prototype, "averageCenter", {
2310
- set: function (averageCenter) {
2311
- this._averageCenter = averageCenter;
2312
- },
2313
- enumerable: false,
2314
- configurable: true
2315
- });
2316
- Object.defineProperty(MapMarkerClusterer.prototype, "batchSizeIE", {
2317
- set: function (batchSizeIE) {
2318
- this._batchSizeIE = batchSizeIE;
2319
- },
2320
- enumerable: false,
2321
- configurable: true
2322
- });
2323
- Object.defineProperty(MapMarkerClusterer.prototype, "calculator", {
2324
- set: function (calculator) {
2325
- this._calculator = calculator;
2326
- },
2327
- enumerable: false,
2328
- configurable: true
2329
- });
2330
- Object.defineProperty(MapMarkerClusterer.prototype, "clusterClass", {
2331
- set: function (clusterClass) {
2332
- this._clusterClass = clusterClass;
2333
- },
2334
- enumerable: false,
2335
- configurable: true
2336
- });
2337
- Object.defineProperty(MapMarkerClusterer.prototype, "enableRetinaIcons", {
2338
- set: function (enableRetinaIcons) {
2339
- this._enableRetinaIcons = enableRetinaIcons;
2340
- },
2341
- enumerable: false,
2342
- configurable: true
2343
- });
2344
- Object.defineProperty(MapMarkerClusterer.prototype, "gridSize", {
2345
- set: function (gridSize) {
2346
- this._gridSize = gridSize;
2347
- },
2348
- enumerable: false,
2349
- configurable: true
2350
- });
2351
- Object.defineProperty(MapMarkerClusterer.prototype, "ignoreHidden", {
2352
- set: function (ignoreHidden) {
2353
- this._ignoreHidden = ignoreHidden;
2354
- },
2355
- enumerable: false,
2356
- configurable: true
2357
- });
2358
- Object.defineProperty(MapMarkerClusterer.prototype, "imageExtension", {
2359
- set: function (imageExtension) {
2360
- this._imageExtension = imageExtension;
2361
- },
2362
- enumerable: false,
2363
- configurable: true
2364
- });
2365
- Object.defineProperty(MapMarkerClusterer.prototype, "imagePath", {
2366
- set: function (imagePath) {
2367
- this._imagePath = imagePath;
2368
- },
2369
- enumerable: false,
2370
- configurable: true
2371
- });
2372
- Object.defineProperty(MapMarkerClusterer.prototype, "imageSizes", {
2373
- set: function (imageSizes) {
2374
- this._imageSizes = imageSizes;
2375
- },
2376
- enumerable: false,
2377
- configurable: true
2378
- });
2379
- Object.defineProperty(MapMarkerClusterer.prototype, "maxZoom", {
2380
- set: function (maxZoom) {
2381
- this._maxZoom = maxZoom;
2382
- },
2383
- enumerable: false,
2384
- configurable: true
2385
- });
2386
- Object.defineProperty(MapMarkerClusterer.prototype, "minimumClusterSize", {
2387
- set: function (minimumClusterSize) {
2388
- this._minimumClusterSize = minimumClusterSize;
2389
- },
2390
- enumerable: false,
2391
- configurable: true
2392
- });
2393
- Object.defineProperty(MapMarkerClusterer.prototype, "styles", {
2394
- set: function (styles) {
2395
- this._styles = styles;
2396
- },
2397
- enumerable: false,
2398
- configurable: true
2399
- });
2400
- Object.defineProperty(MapMarkerClusterer.prototype, "title", {
2401
- set: function (title) {
2402
- this._title = title;
2403
- },
2404
- enumerable: false,
2405
- configurable: true
2406
- });
2407
- Object.defineProperty(MapMarkerClusterer.prototype, "zIndex", {
2408
- set: function (zIndex) {
2409
- this._zIndex = zIndex;
2410
- },
2411
- enumerable: false,
2412
- configurable: true
2413
- });
2414
- Object.defineProperty(MapMarkerClusterer.prototype, "zoomOnClick", {
2415
- set: function (zoomOnClick) {
2416
- this._zoomOnClick = zoomOnClick;
2417
- },
2418
- enumerable: false,
2419
- configurable: true
2420
- });
2421
- Object.defineProperty(MapMarkerClusterer.prototype, "options", {
2422
- set: function (options) {
2423
- this._options = options;
2424
- },
2425
- enumerable: false,
2426
- configurable: true
2427
- });
2428
- MapMarkerClusterer.prototype.ngOnInit = function () {
2429
- var _this = this;
2430
- if (this._canInitialize) {
2431
- var clustererWindow = window;
2432
- if (!clustererWindow.MarkerClusterer && (typeof ngDevMode === 'undefined' || ngDevMode)) {
2433
- throw Error('MarkerClusterer class not found, cannot construct a marker cluster. ' +
2434
- 'Please install the MarkerClustererPlus library: ' +
2435
- 'https://github.com/googlemaps/js-markerclustererplus');
2436
- }
2437
- // Create the object outside the zone so its events don't trigger change detection.
2438
- // We'll bring it back in inside the `MapEventManager` only for the events that the
2439
- // user has subscribed to.
2440
- this._ngZone.runOutsideAngular(function () {
2441
- _this.markerClusterer = new MarkerClusterer(_this._googleMap.googleMap, [], _this._combineOptions());
2442
- });
2443
- this._assertInitialized();
2444
- this._eventManager.setTarget(this.markerClusterer);
2445
- }
2446
- };
2447
- MapMarkerClusterer.prototype.ngAfterContentInit = function () {
2448
- if (this._canInitialize) {
2449
- this._watchForMarkerChanges();
2450
- }
2451
- };
2452
- MapMarkerClusterer.prototype.ngOnChanges = function (changes) {
2453
- var _u = this, clusterer = _u.markerClusterer, ariaLabelFn = _u.ariaLabelFn, _averageCenter = _u._averageCenter, _batchSizeIE = _u._batchSizeIE, _calculator = _u._calculator, _styles = _u._styles, _clusterClass = _u._clusterClass, _enableRetinaIcons = _u._enableRetinaIcons, _gridSize = _u._gridSize, _ignoreHidden = _u._ignoreHidden, _imageExtension = _u._imageExtension, _imagePath = _u._imagePath, _imageSizes = _u._imageSizes, _maxZoom = _u._maxZoom, _minimumClusterSize = _u._minimumClusterSize, _title = _u._title, _zIndex = _u._zIndex, _zoomOnClick = _u._zoomOnClick;
2454
- if (clusterer) {
2455
- if (changes['options']) {
2456
- clusterer.setOptions(this._combineOptions());
2457
- }
2458
- if (changes['ariaLabelFn']) {
2459
- clusterer.ariaLabelFn = ariaLabelFn;
2460
- }
2461
- if (changes['averageCenter'] && _averageCenter !== undefined) {
2462
- clusterer.setAverageCenter(_averageCenter);
2463
- }
2464
- if (changes['batchSizeIE'] && _batchSizeIE !== undefined) {
2465
- clusterer.setBatchSizeIE(_batchSizeIE);
2466
- }
2467
- if (changes['calculator'] && !!_calculator) {
2468
- clusterer.setCalculator(_calculator);
2469
- }
2470
- if (changes['clusterClass'] && _clusterClass !== undefined) {
2471
- clusterer.setClusterClass(_clusterClass);
2472
- }
2473
- if (changes['enableRetinaIcons'] && _enableRetinaIcons !== undefined) {
2474
- clusterer.setEnableRetinaIcons(_enableRetinaIcons);
2475
- }
2476
- if (changes['gridSize'] && _gridSize !== undefined) {
2477
- clusterer.setGridSize(_gridSize);
2478
- }
2479
- if (changes['ignoreHidden'] && _ignoreHidden !== undefined) {
2480
- clusterer.setIgnoreHidden(_ignoreHidden);
2481
- }
2482
- if (changes['imageExtension'] && _imageExtension !== undefined) {
2483
- clusterer.setImageExtension(_imageExtension);
2484
- }
2485
- if (changes['imagePath'] && _imagePath !== undefined) {
2486
- clusterer.setImagePath(_imagePath);
2487
- }
2488
- if (changes['imageSizes'] && _imageSizes) {
2489
- clusterer.setImageSizes(_imageSizes);
2490
- }
2491
- if (changes['maxZoom'] && _maxZoom !== undefined) {
2492
- clusterer.setMaxZoom(_maxZoom);
2493
- }
2494
- if (changes['minimumClusterSize'] && _minimumClusterSize !== undefined) {
2495
- clusterer.setMinimumClusterSize(_minimumClusterSize);
2496
- }
2497
- if (changes['styles'] && _styles) {
2498
- clusterer.setStyles(_styles);
2499
- }
2500
- if (changes['title'] && _title !== undefined) {
2501
- clusterer.setTitle(_title);
2502
- }
2503
- if (changes['zIndex'] && _zIndex !== undefined) {
2504
- clusterer.setZIndex(_zIndex);
2505
- }
2506
- if (changes['zoomOnClick'] && _zoomOnClick !== undefined) {
2507
- clusterer.setZoomOnClick(_zoomOnClick);
2508
- }
2509
- }
2510
- };
2511
- MapMarkerClusterer.prototype.ngOnDestroy = function () {
2512
- this._destroy.next();
2513
- this._destroy.complete();
2514
- this._eventManager.destroy();
2515
- if (this.markerClusterer) {
2516
- this.markerClusterer.setMap(null);
2517
- }
2518
- };
2519
- MapMarkerClusterer.prototype.fitMapToMarkers = function (padding) {
2520
- this._assertInitialized();
2521
- this.markerClusterer.fitMapToMarkers(padding);
2522
- };
2523
- MapMarkerClusterer.prototype.getAverageCenter = function () {
2524
- this._assertInitialized();
2525
- return this.markerClusterer.getAverageCenter();
2526
- };
2527
- MapMarkerClusterer.prototype.getBatchSizeIE = function () {
2528
- this._assertInitialized();
2529
- return this.markerClusterer.getBatchSizeIE();
2530
- };
2531
- MapMarkerClusterer.prototype.getCalculator = function () {
2532
- this._assertInitialized();
2533
- return this.markerClusterer.getCalculator();
2534
- };
2535
- MapMarkerClusterer.prototype.getClusterClass = function () {
2536
- this._assertInitialized();
2537
- return this.markerClusterer.getClusterClass();
2538
- };
2539
- MapMarkerClusterer.prototype.getClusters = function () {
2540
- this._assertInitialized();
2541
- return this.markerClusterer.getClusters();
2542
- };
2543
- MapMarkerClusterer.prototype.getEnableRetinaIcons = function () {
2544
- this._assertInitialized();
2545
- return this.markerClusterer.getEnableRetinaIcons();
2546
- };
2547
- MapMarkerClusterer.prototype.getGridSize = function () {
2548
- this._assertInitialized();
2549
- return this.markerClusterer.getGridSize();
2550
- };
2551
- MapMarkerClusterer.prototype.getIgnoreHidden = function () {
2552
- this._assertInitialized();
2553
- return this.markerClusterer.getIgnoreHidden();
2554
- };
2555
- MapMarkerClusterer.prototype.getImageExtension = function () {
2556
- this._assertInitialized();
2557
- return this.markerClusterer.getImageExtension();
2558
- };
2559
- MapMarkerClusterer.prototype.getImagePath = function () {
2560
- this._assertInitialized();
2561
- return this.markerClusterer.getImagePath();
2562
- };
2563
- MapMarkerClusterer.prototype.getImageSizes = function () {
2564
- this._assertInitialized();
2565
- return this.markerClusterer.getImageSizes();
2566
- };
2567
- MapMarkerClusterer.prototype.getMaxZoom = function () {
2568
- this._assertInitialized();
2569
- return this.markerClusterer.getMaxZoom();
2570
- };
2571
- MapMarkerClusterer.prototype.getMinimumClusterSize = function () {
2572
- this._assertInitialized();
2573
- return this.markerClusterer.getMinimumClusterSize();
2574
- };
2575
- MapMarkerClusterer.prototype.getStyles = function () {
2576
- this._assertInitialized();
2577
- return this.markerClusterer.getStyles();
2578
- };
2579
- MapMarkerClusterer.prototype.getTitle = function () {
2580
- this._assertInitialized();
2581
- return this.markerClusterer.getTitle();
2582
- };
2583
- MapMarkerClusterer.prototype.getTotalClusters = function () {
2584
- this._assertInitialized();
2585
- return this.markerClusterer.getTotalClusters();
2586
- };
2587
- MapMarkerClusterer.prototype.getTotalMarkers = function () {
2588
- this._assertInitialized();
2589
- return this.markerClusterer.getTotalMarkers();
2590
- };
2591
- MapMarkerClusterer.prototype.getZIndex = function () {
2592
- this._assertInitialized();
2593
- return this.markerClusterer.getZIndex();
2594
- };
2595
- MapMarkerClusterer.prototype.getZoomOnClick = function () {
2596
- this._assertInitialized();
2597
- return this.markerClusterer.getZoomOnClick();
2598
- };
2599
- MapMarkerClusterer.prototype._combineOptions = function () {
2600
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
2601
- var options = this._options || DEFAULT_CLUSTERER_OPTIONS;
2602
- return Object.assign(Object.assign({}, options), { ariaLabelFn: (_a = this.ariaLabelFn) !== null && _a !== void 0 ? _a : options.ariaLabelFn, averageCenter: (_b = this._averageCenter) !== null && _b !== void 0 ? _b : options.averageCenter, batchSize: (_c = this.batchSize) !== null && _c !== void 0 ? _c : options.batchSize, batchSizeIE: (_d = this._batchSizeIE) !== null && _d !== void 0 ? _d : options.batchSizeIE, calculator: (_e = this._calculator) !== null && _e !== void 0 ? _e : options.calculator, clusterClass: (_f = this._clusterClass) !== null && _f !== void 0 ? _f : options.clusterClass, enableRetinaIcons: (_g = this._enableRetinaIcons) !== null && _g !== void 0 ? _g : options.enableRetinaIcons, gridSize: (_h = this._gridSize) !== null && _h !== void 0 ? _h : options.gridSize, ignoreHidden: (_j = this._ignoreHidden) !== null && _j !== void 0 ? _j : options.ignoreHidden, imageExtension: (_k = this._imageExtension) !== null && _k !== void 0 ? _k : options.imageExtension, imagePath: (_l = this._imagePath) !== null && _l !== void 0 ? _l : options.imagePath, imageSizes: (_m = this._imageSizes) !== null && _m !== void 0 ? _m : options.imageSizes, maxZoom: (_o = this._maxZoom) !== null && _o !== void 0 ? _o : options.maxZoom, minimumClusterSize: (_p = this._minimumClusterSize) !== null && _p !== void 0 ? _p : options.minimumClusterSize, styles: (_q = this._styles) !== null && _q !== void 0 ? _q : options.styles, title: (_r = this._title) !== null && _r !== void 0 ? _r : options.title, zIndex: (_s = this._zIndex) !== null && _s !== void 0 ? _s : options.zIndex, zoomOnClick: (_t = this._zoomOnClick) !== null && _t !== void 0 ? _t : options.zoomOnClick });
2603
- };
2604
- MapMarkerClusterer.prototype._watchForMarkerChanges = function () {
2605
- var e_1, _u;
2606
- var _this = this;
2607
- this._assertInitialized();
2608
- var initialMarkers = [];
2609
- try {
2610
- for (var _v = __values(this._getInternalMarkers(this._markers.toArray())), _w = _v.next(); !_w.done; _w = _v.next()) {
2611
- var marker = _w.value;
2612
- this._currentMarkers.add(marker);
2613
- initialMarkers.push(marker);
2614
- }
2615
- }
2616
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
2617
- finally {
2618
- try {
2619
- if (_w && !_w.done && (_u = _v.return)) _u.call(_v);
2620
- }
2621
- finally { if (e_1) throw e_1.error; }
2622
- }
2623
- this.markerClusterer.addMarkers(initialMarkers);
2624
- this._markers.changes.pipe(operators.takeUntil(this._destroy)).subscribe(function (markerComponents) {
2625
- var e_2, _u, e_3, _v, e_4, _w;
2626
- _this._assertInitialized();
2627
- var newMarkers = new Set(_this._getInternalMarkers(markerComponents));
2628
- var markersToAdd = [];
2629
- var markersToRemove = [];
2630
- try {
2631
- for (var _x = __values(Array.from(newMarkers)), _y = _x.next(); !_y.done; _y = _x.next()) {
2632
- var marker = _y.value;
2633
- if (!_this._currentMarkers.has(marker)) {
2634
- _this._currentMarkers.add(marker);
2635
- markersToAdd.push(marker);
2636
- }
2637
- }
2638
- }
2639
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
2640
- finally {
2641
- try {
2642
- if (_y && !_y.done && (_u = _x.return)) _u.call(_x);
2643
- }
2644
- finally { if (e_2) throw e_2.error; }
2645
- }
2646
- try {
2647
- for (var _z = __values(Array.from(_this._currentMarkers)), _0 = _z.next(); !_0.done; _0 = _z.next()) {
2648
- var marker = _0.value;
2649
- if (!newMarkers.has(marker)) {
2650
- markersToRemove.push(marker);
2651
- }
2652
- }
2653
- }
2654
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
2655
- finally {
2656
- try {
2657
- if (_0 && !_0.done && (_v = _z.return)) _v.call(_z);
2658
- }
2659
- finally { if (e_3) throw e_3.error; }
2660
- }
2661
- _this.markerClusterer.addMarkers(markersToAdd, true);
2662
- _this.markerClusterer.removeMarkers(markersToRemove, true);
2663
- _this.markerClusterer.repaint();
2664
- try {
2665
- for (var markersToRemove_1 = __values(markersToRemove), markersToRemove_1_1 = markersToRemove_1.next(); !markersToRemove_1_1.done; markersToRemove_1_1 = markersToRemove_1.next()) {
2666
- var marker = markersToRemove_1_1.value;
2667
- _this._currentMarkers.delete(marker);
2668
- }
2669
- }
2670
- catch (e_4_1) { e_4 = { error: e_4_1 }; }
2671
- finally {
2672
- try {
2673
- if (markersToRemove_1_1 && !markersToRemove_1_1.done && (_w = markersToRemove_1.return)) _w.call(markersToRemove_1);
2674
- }
2675
- finally { if (e_4) throw e_4.error; }
2676
- }
2677
- });
2678
- };
2679
- MapMarkerClusterer.prototype._getInternalMarkers = function (markers) {
2680
- return markers.filter(function (markerComponent) { return !!markerComponent.marker; })
2681
- .map(function (markerComponent) { return markerComponent.marker; });
2682
- };
2683
- MapMarkerClusterer.prototype._assertInitialized = function () {
2684
- if (typeof ngDevMode === 'undefined' || ngDevMode) {
2685
- if (!this._googleMap.googleMap) {
2686
- throw Error('Cannot access Google Map information before the API has been initialized. ' +
2687
- 'Please wait for the API to load before trying to interact with it.');
2688
- }
2689
- if (!this.markerClusterer) {
2690
- throw Error('Cannot interact with a MarkerClusterer before it has been initialized. ' +
2691
- 'Please wait for the MarkerClusterer to load before trying to interact with it.');
2692
- }
2693
- }
2694
- };
2695
- return MapMarkerClusterer;
2696
- }());
2697
- MapMarkerClusterer.decorators = [
2698
- { type: i0.Component, args: [{
2699
- selector: 'map-marker-clusterer',
2700
- exportAs: 'mapMarkerClusterer',
2701
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
2702
- template: '<ng-content></ng-content>',
2703
- encapsulation: i0.ViewEncapsulation.None
2704
- },] }
2705
- ];
2706
- MapMarkerClusterer.ctorParameters = function () { return [
2707
- { type: GoogleMap },
2708
- { type: i0.NgZone }
2709
- ]; };
2710
- MapMarkerClusterer.propDecorators = {
2711
- ariaLabelFn: [{ type: i0.Input }],
2712
- averageCenter: [{ type: i0.Input }],
2713
- batchSize: [{ type: i0.Input }],
2714
- batchSizeIE: [{ type: i0.Input }],
2715
- calculator: [{ type: i0.Input }],
2716
- clusterClass: [{ type: i0.Input }],
2717
- enableRetinaIcons: [{ type: i0.Input }],
2718
- gridSize: [{ type: i0.Input }],
2719
- ignoreHidden: [{ type: i0.Input }],
2720
- imageExtension: [{ type: i0.Input }],
2721
- imagePath: [{ type: i0.Input }],
2722
- imageSizes: [{ type: i0.Input }],
2723
- maxZoom: [{ type: i0.Input }],
2724
- minimumClusterSize: [{ type: i0.Input }],
2725
- styles: [{ type: i0.Input }],
2726
- title: [{ type: i0.Input }],
2727
- zIndex: [{ type: i0.Input }],
2728
- zoomOnClick: [{ type: i0.Input }],
2729
- options: [{ type: i0.Input }],
2730
- clusteringbegin: [{ type: i0.Output }],
2731
- clusteringend: [{ type: i0.Output }],
2732
- clusterClick: [{ type: i0.Output }],
2733
- _markers: [{ type: i0.ContentChildren, args: [MapMarker, { descendants: true },] }]
2734
- };
2735
-
2736
- /**
2737
- * Angular component that renders a Google Maps Polygon via the Google Maps JavaScript API.
2738
- *
2739
- * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon
2740
- */
2741
- var MapPolygon = /** @class */ (function () {
2742
- function MapPolygon(_map, _ngZone) {
2743
- this._map = _map;
2744
- this._ngZone = _ngZone;
2745
- this._eventManager = new MapEventManager(this._ngZone);
2746
- this._options = new rxjs.BehaviorSubject({});
2747
- this._paths = new rxjs.BehaviorSubject(undefined);
2748
- this._destroyed = new rxjs.Subject();
2749
- /**
2750
- * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.click
2751
- */
2752
- this.polygonClick = this._eventManager.getLazyEmitter('click');
2753
- /**
2754
- * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.dblclick
2755
- */
2756
- this.polygonDblclick = this._eventManager.getLazyEmitter('dblclick');
2757
- /**
2758
- * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.drag
2759
- */
2760
- this.polygonDrag = this._eventManager.getLazyEmitter('drag');
2761
- /**
2762
- * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.dragend
2763
- */
2764
- this.polygonDragend = this._eventManager.getLazyEmitter('dragend');
2765
- /**
2766
- * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.dragstart
2767
- */
2768
- this.polygonDragstart = this._eventManager.getLazyEmitter('dragstart');
2769
- /**
2770
- * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.mousedown
2771
- */
2772
- this.polygonMousedown = this._eventManager.getLazyEmitter('mousedown');
2773
- /**
2774
- * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.mousemove
2775
- */
2776
- this.polygonMousemove = this._eventManager.getLazyEmitter('mousemove');
2777
- /**
2778
- * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.mouseout
2779
- */
2780
- this.polygonMouseout = this._eventManager.getLazyEmitter('mouseout');
2781
- /**
2782
- * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.mouseover
2783
- */
2784
- this.polygonMouseover = this._eventManager.getLazyEmitter('mouseover');
2785
- /**
2786
- * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.mouseup
2787
- */
2788
- this.polygonMouseup = this._eventManager.getLazyEmitter('mouseup');
2789
- /**
2790
- * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.rightclick
2791
- */
2792
- this.polygonRightclick = this._eventManager.getLazyEmitter('rightclick');
2793
- }
2794
- Object.defineProperty(MapPolygon.prototype, "options", {
2795
- set: function (options) {
2796
- this._options.next(options || {});
2797
- },
2798
- enumerable: false,
2799
- configurable: true
2800
- });
2801
- Object.defineProperty(MapPolygon.prototype, "paths", {
2802
- set: function (paths) {
2803
- this._paths.next(paths);
2804
- },
2805
- enumerable: false,
2806
- configurable: true
2807
- });
2808
- MapPolygon.prototype.ngOnInit = function () {
2809
- var _this = this;
2810
- if (this._map._isBrowser) {
2811
- this._combineOptions().pipe(operators.take(1)).subscribe(function (options) {
2812
- // Create the object outside the zone so its events don't trigger change detection.
2813
- // We'll bring it back in inside the `MapEventManager` only for the events that the
2814
- // user has subscribed to.
2815
- _this._ngZone.runOutsideAngular(function () {
2816
- _this.polygon = new google.maps.Polygon(options);
2817
- });
2818
- _this._assertInitialized();
2819
- _this.polygon.setMap(_this._map.googleMap);
2820
- _this._eventManager.setTarget(_this.polygon);
2821
- });
2822
- this._watchForOptionsChanges();
2823
- this._watchForPathChanges();
2824
- }
2825
- };
2826
- MapPolygon.prototype.ngOnDestroy = function () {
2827
- this._eventManager.destroy();
2828
- this._destroyed.next();
2829
- this._destroyed.complete();
2830
- if (this.polygon) {
2831
- this.polygon.setMap(null);
2832
- }
2833
- };
2834
- /**
2835
- * See
2836
- * developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.getDraggable
2837
- */
2838
- MapPolygon.prototype.getDraggable = function () {
2839
- this._assertInitialized();
2840
- return this.polygon.getDraggable();
2841
- };
2842
- /**
2843
- * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.getEditable
2844
- */
2845
- MapPolygon.prototype.getEditable = function () {
2846
- this._assertInitialized();
2847
- return this.polygon.getEditable();
2848
- };
2849
- /**
2850
- * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.getPath
2851
- */
2852
- MapPolygon.prototype.getPath = function () {
2853
- this._assertInitialized();
2854
- return this.polygon.getPath();
2855
- };
2856
- /**
2857
- * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.getPaths
2858
- */
2859
- MapPolygon.prototype.getPaths = function () {
2860
- this._assertInitialized();
2861
- return this.polygon.getPaths();
2862
- };
2863
- /**
2864
- * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.getVisible
2865
- */
2866
- MapPolygon.prototype.getVisible = function () {
2867
- this._assertInitialized();
2868
- return this.polygon.getVisible();
2869
- };
2870
- MapPolygon.prototype._combineOptions = function () {
2871
- return rxjs.combineLatest([this._options, this._paths]).pipe(operators.map(function (_a) {
2872
- var _b = __read(_a, 2), options = _b[0], paths = _b[1];
2873
- var combinedOptions = Object.assign(Object.assign({}, options), { paths: paths || options.paths });
2874
- return combinedOptions;
2875
- }));
2876
- };
2877
- MapPolygon.prototype._watchForOptionsChanges = function () {
2878
- var _this = this;
2879
- this._options.pipe(operators.takeUntil(this._destroyed)).subscribe(function (options) {
2880
- _this._assertInitialized();
2881
- _this.polygon.setOptions(options);
2882
- });
2883
- };
2884
- MapPolygon.prototype._watchForPathChanges = function () {
2885
- var _this = this;
2886
- this._paths.pipe(operators.takeUntil(this._destroyed)).subscribe(function (paths) {
2887
- if (paths) {
2888
- _this._assertInitialized();
2889
- _this.polygon.setPaths(paths);
2890
- }
2891
- });
2892
- };
2893
- MapPolygon.prototype._assertInitialized = function () {
2894
- if (typeof ngDevMode === 'undefined' || ngDevMode) {
2895
- if (!this._map.googleMap) {
2896
- throw Error('Cannot access Google Map information before the API has been initialized. ' +
2897
- 'Please wait for the API to load before trying to interact with it.');
2898
- }
2899
- if (!this.polygon) {
2900
- throw Error('Cannot interact with a Google Map Polygon before it has been ' +
2901
- 'initialized. Please wait for the Polygon to load before trying to interact with it.');
2902
- }
2903
- }
2904
- };
2905
- return MapPolygon;
2906
- }());
2907
- MapPolygon.decorators = [
2908
- { type: i0.Directive, args: [{
2909
- selector: 'map-polygon',
2910
- exportAs: 'mapPolygon',
2911
- },] }
2912
- ];
2913
- MapPolygon.ctorParameters = function () { return [
2914
- { type: GoogleMap },
2915
- { type: i0.NgZone }
2916
- ]; };
2917
- MapPolygon.propDecorators = {
2918
- options: [{ type: i0.Input }],
2919
- paths: [{ type: i0.Input }],
2920
- polygonClick: [{ type: i0.Output }],
2921
- polygonDblclick: [{ type: i0.Output }],
2922
- polygonDrag: [{ type: i0.Output }],
2923
- polygonDragend: [{ type: i0.Output }],
2924
- polygonDragstart: [{ type: i0.Output }],
2925
- polygonMousedown: [{ type: i0.Output }],
2926
- polygonMousemove: [{ type: i0.Output }],
2927
- polygonMouseout: [{ type: i0.Output }],
2928
- polygonMouseover: [{ type: i0.Output }],
2929
- polygonMouseup: [{ type: i0.Output }],
2930
- polygonRightclick: [{ type: i0.Output }]
2931
- };
2932
-
2933
- /**
2934
- * Angular component that renders a Google Maps Polyline via the Google Maps JavaScript API.
2935
- *
2936
- * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline
2937
- */
2938
- var MapPolyline = /** @class */ (function () {
2939
- function MapPolyline(_map, _ngZone) {
2940
- this._map = _map;
2941
- this._ngZone = _ngZone;
2942
- this._eventManager = new MapEventManager(this._ngZone);
2943
- this._options = new rxjs.BehaviorSubject({});
2944
- this._path = new rxjs.BehaviorSubject(undefined);
2945
- this._destroyed = new rxjs.Subject();
2946
- /**
2947
- * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.click
2948
- */
2949
- this.polylineClick = this._eventManager.getLazyEmitter('click');
2950
- /**
2951
- * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.dblclick
2952
- */
2953
- this.polylineDblclick = this._eventManager.getLazyEmitter('dblclick');
2954
- /**
2955
- * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.drag
2956
- */
2957
- this.polylineDrag = this._eventManager.getLazyEmitter('drag');
2958
- /**
2959
- * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.dragend
2960
- */
2961
- this.polylineDragend = this._eventManager.getLazyEmitter('dragend');
2962
- /**
2963
- * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.dragstart
2964
- */
2965
- this.polylineDragstart = this._eventManager.getLazyEmitter('dragstart');
2966
- /**
2967
- * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.mousedown
2968
- */
2969
- this.polylineMousedown = this._eventManager.getLazyEmitter('mousedown');
2970
- /**
2971
- * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.mousemove
2972
- */
2973
- this.polylineMousemove = this._eventManager.getLazyEmitter('mousemove');
2974
- /**
2975
- * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.mouseout
2976
- */
2977
- this.polylineMouseout = this._eventManager.getLazyEmitter('mouseout');
2978
- /**
2979
- * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.mouseover
2980
- */
2981
- this.polylineMouseover = this._eventManager.getLazyEmitter('mouseover');
2982
- /**
2983
- * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.mouseup
2984
- */
2985
- this.polylineMouseup = this._eventManager.getLazyEmitter('mouseup');
2986
- /**
2987
- * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.rightclick
2988
- */
2989
- this.polylineRightclick = this._eventManager.getLazyEmitter('rightclick');
2990
- }
2991
- Object.defineProperty(MapPolyline.prototype, "options", {
2992
- set: function (options) {
2993
- this._options.next(options || {});
2994
- },
2995
- enumerable: false,
2996
- configurable: true
2997
- });
2998
- Object.defineProperty(MapPolyline.prototype, "path", {
2999
- set: function (path) {
3000
- this._path.next(path);
3001
- },
3002
- enumerable: false,
3003
- configurable: true
3004
- });
3005
- MapPolyline.prototype.ngOnInit = function () {
3006
- var _this = this;
3007
- if (this._map._isBrowser) {
3008
- this._combineOptions().pipe(operators.take(1)).subscribe(function (options) {
3009
- // Create the object outside the zone so its events don't trigger change detection.
3010
- // We'll bring it back in inside the `MapEventManager` only for the events that the
3011
- // user has subscribed to.
3012
- _this._ngZone.runOutsideAngular(function () { return _this.polyline = new google.maps.Polyline(options); });
3013
- _this._assertInitialized();
3014
- _this.polyline.setMap(_this._map.googleMap);
3015
- _this._eventManager.setTarget(_this.polyline);
3016
- });
3017
- this._watchForOptionsChanges();
3018
- this._watchForPathChanges();
3019
- }
3020
- };
3021
- MapPolyline.prototype.ngOnDestroy = function () {
3022
- this._eventManager.destroy();
3023
- this._destroyed.next();
3024
- this._destroyed.complete();
3025
- if (this.polyline) {
3026
- this.polyline.setMap(null);
3027
- }
3028
- };
3029
- /**
3030
- * See
3031
- * developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.getDraggable
3032
- */
3033
- MapPolyline.prototype.getDraggable = function () {
3034
- this._assertInitialized();
3035
- return this.polyline.getDraggable();
3036
- };
3037
- /**
3038
- * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.getEditable
3039
- */
3040
- MapPolyline.prototype.getEditable = function () {
3041
- this._assertInitialized();
3042
- return this.polyline.getEditable();
3043
- };
3044
- /**
3045
- * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.getPath
3046
- */
3047
- MapPolyline.prototype.getPath = function () {
3048
- this._assertInitialized();
3049
- return this.polyline.getPath();
3050
- };
3051
- /**
3052
- * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.getVisible
3053
- */
3054
- MapPolyline.prototype.getVisible = function () {
3055
- this._assertInitialized();
3056
- return this.polyline.getVisible();
3057
- };
3058
- MapPolyline.prototype._combineOptions = function () {
3059
- return rxjs.combineLatest([this._options, this._path]).pipe(operators.map(function (_a) {
3060
- var _b = __read(_a, 2), options = _b[0], path = _b[1];
3061
- var combinedOptions = Object.assign(Object.assign({}, options), { path: path || options.path });
3062
- return combinedOptions;
3063
- }));
3064
- };
3065
- MapPolyline.prototype._watchForOptionsChanges = function () {
3066
- var _this = this;
3067
- this._options.pipe(operators.takeUntil(this._destroyed)).subscribe(function (options) {
3068
- _this._assertInitialized();
3069
- _this.polyline.setOptions(options);
3070
- });
3071
- };
3072
- MapPolyline.prototype._watchForPathChanges = function () {
3073
- var _this = this;
3074
- this._path.pipe(operators.takeUntil(this._destroyed)).subscribe(function (path) {
3075
- if (path) {
3076
- _this._assertInitialized();
3077
- _this.polyline.setPath(path);
3078
- }
3079
- });
3080
- };
3081
- MapPolyline.prototype._assertInitialized = function () {
3082
- if (typeof ngDevMode === 'undefined' || ngDevMode) {
3083
- if (!this._map.googleMap) {
3084
- throw Error('Cannot access Google Map information before the API has been initialized. ' +
3085
- 'Please wait for the API to load before trying to interact with it.');
3086
- }
3087
- if (!this.polyline) {
3088
- throw Error('Cannot interact with a Google Map Polyline before it has been ' +
3089
- 'initialized. Please wait for the Polyline to load before trying to interact with it.');
3090
- }
3091
- }
3092
- };
3093
- return MapPolyline;
3094
- }());
3095
- MapPolyline.decorators = [
3096
- { type: i0.Directive, args: [{
3097
- selector: 'map-polyline',
3098
- exportAs: 'mapPolyline',
3099
- },] }
3100
- ];
3101
- MapPolyline.ctorParameters = function () { return [
3102
- { type: GoogleMap },
3103
- { type: i0.NgZone }
3104
- ]; };
3105
- MapPolyline.propDecorators = {
3106
- options: [{ type: i0.Input }],
3107
- path: [{ type: i0.Input }],
3108
- polylineClick: [{ type: i0.Output }],
3109
- polylineDblclick: [{ type: i0.Output }],
3110
- polylineDrag: [{ type: i0.Output }],
3111
- polylineDragend: [{ type: i0.Output }],
3112
- polylineDragstart: [{ type: i0.Output }],
3113
- polylineMousedown: [{ type: i0.Output }],
3114
- polylineMousemove: [{ type: i0.Output }],
3115
- polylineMouseout: [{ type: i0.Output }],
3116
- polylineMouseover: [{ type: i0.Output }],
3117
- polylineMouseup: [{ type: i0.Output }],
3118
- polylineRightclick: [{ type: i0.Output }]
3119
- };
3120
-
3121
- /**
3122
- * Angular component that renders a Google Maps Rectangle via the Google Maps JavaScript API.
3123
- *
3124
- * See developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle
3125
- */
3126
- var MapRectangle = /** @class */ (function () {
3127
- function MapRectangle(_map, _ngZone) {
3128
- this._map = _map;
3129
- this._ngZone = _ngZone;
3130
- this._eventManager = new MapEventManager(this._ngZone);
3131
- this._options = new rxjs.BehaviorSubject({});
3132
- this._bounds = new rxjs.BehaviorSubject(undefined);
3133
- this._destroyed = new rxjs.Subject();
3134
- /**
3135
- * See
3136
- * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.boundsChanged
3137
- */ this.boundsChanged = this._eventManager.getLazyEmitter('bounds_changed');
3138
- /**
3139
- * See
3140
- * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.click
3141
- */
3142
- this.rectangleClick = this._eventManager.getLazyEmitter('click');
3143
- /**
3144
- * See
3145
- * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.dblclick
3146
- */
3147
- this.rectangleDblclick = this._eventManager.getLazyEmitter('dblclick');
3148
- /**
3149
- * See
3150
- * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.drag
3151
- */
3152
- this.rectangleDrag = this._eventManager.getLazyEmitter('drag');
3153
- /**
3154
- * See
3155
- * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.dragend
3156
- */
3157
- this.rectangleDragend = this._eventManager.getLazyEmitter('dragend');
3158
- /**
3159
- * See
3160
- * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.dragstart
3161
- */
3162
- this.rectangleDragstart = this._eventManager.getLazyEmitter('dragstart');
3163
- /**
3164
- * See
3165
- * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.mousedown
3166
- */
3167
- this.rectangleMousedown = this._eventManager.getLazyEmitter('mousedown');
3168
- /**
3169
- * See
3170
- * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.mousemove
3171
- */
3172
- this.rectangleMousemove = this._eventManager.getLazyEmitter('mousemove');
3173
- /**
3174
- * See
3175
- * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.mouseout
3176
- */
3177
- this.rectangleMouseout = this._eventManager.getLazyEmitter('mouseout');
3178
- /**
3179
- * See
3180
- * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.mouseover
3181
- */
3182
- this.rectangleMouseover = this._eventManager.getLazyEmitter('mouseover');
3183
- /**
3184
- * See
3185
- * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.mouseup
3186
- */
3187
- this.rectangleMouseup = this._eventManager.getLazyEmitter('mouseup');
3188
- /**
3189
- * See
3190
- * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.rightclick
3191
- */
3192
- this.rectangleRightclick = this._eventManager.getLazyEmitter('rightclick');
3193
- }
3194
- Object.defineProperty(MapRectangle.prototype, "options", {
3195
- set: function (options) {
3196
- this._options.next(options || {});
3197
- },
3198
- enumerable: false,
3199
- configurable: true
3200
- });
3201
- Object.defineProperty(MapRectangle.prototype, "bounds", {
3202
- set: function (bounds) {
3203
- this._bounds.next(bounds);
3204
- },
3205
- enumerable: false,
3206
- configurable: true
3207
- });
3208
- MapRectangle.prototype.ngOnInit = function () {
3209
- var _this = this;
3210
- if (this._map._isBrowser) {
3211
- this._combineOptions().pipe(operators.take(1)).subscribe(function (options) {
3212
- // Create the object outside the zone so its events don't trigger change detection.
3213
- // We'll bring it back in inside the `MapEventManager` only for the events that the
3214
- // user has subscribed to.
3215
- _this._ngZone.runOutsideAngular(function () {
3216
- _this.rectangle = new google.maps.Rectangle(options);
3217
- });
3218
- _this._assertInitialized();
3219
- _this.rectangle.setMap(_this._map.googleMap);
3220
- _this._eventManager.setTarget(_this.rectangle);
3221
- });
3222
- this._watchForOptionsChanges();
3223
- this._watchForBoundsChanges();
3224
- }
3225
- };
3226
- MapRectangle.prototype.ngOnDestroy = function () {
3227
- this._eventManager.destroy();
3228
- this._destroyed.next();
3229
- this._destroyed.complete();
3230
- if (this.rectangle) {
3231
- this.rectangle.setMap(null);
3232
- }
3233
- };
3234
- /**
3235
- * See
3236
- * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.getBounds
3237
- */
3238
- MapRectangle.prototype.getBounds = function () {
3239
- this._assertInitialized();
3240
- return this.rectangle.getBounds();
3241
- };
3242
- /**
3243
- * See
3244
- * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.getDraggable
3245
- */
3246
- MapRectangle.prototype.getDraggable = function () {
3247
- this._assertInitialized();
3248
- return this.rectangle.getDraggable();
3249
- };
3250
- /**
3251
- * See
3252
- * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.getEditable
3253
- */
3254
- MapRectangle.prototype.getEditable = function () {
3255
- this._assertInitialized();
3256
- return this.rectangle.getEditable();
3257
- };
3258
- /**
3259
- * See
3260
- * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.getVisible
3261
- */
3262
- MapRectangle.prototype.getVisible = function () {
3263
- this._assertInitialized();
3264
- return this.rectangle.getVisible();
3265
- };
3266
- MapRectangle.prototype._combineOptions = function () {
3267
- return rxjs.combineLatest([this._options, this._bounds]).pipe(operators.map(function (_a) {
3268
- var _b = __read(_a, 2), options = _b[0], bounds = _b[1];
3269
- var combinedOptions = Object.assign(Object.assign({}, options), { bounds: bounds || options.bounds });
3270
- return combinedOptions;
3271
- }));
3272
- };
3273
- MapRectangle.prototype._watchForOptionsChanges = function () {
3274
- var _this = this;
3275
- this._options.pipe(operators.takeUntil(this._destroyed)).subscribe(function (options) {
3276
- _this._assertInitialized();
3277
- _this.rectangle.setOptions(options);
3278
- });
3279
- };
3280
- MapRectangle.prototype._watchForBoundsChanges = function () {
3281
- var _this = this;
3282
- this._bounds.pipe(operators.takeUntil(this._destroyed)).subscribe(function (bounds) {
3283
- if (bounds) {
3284
- _this._assertInitialized();
3285
- _this.rectangle.setBounds(bounds);
3286
- }
3287
- });
3288
- };
3289
- MapRectangle.prototype._assertInitialized = function () {
3290
- if (typeof ngDevMode === 'undefined' || ngDevMode) {
3291
- if (!this._map.googleMap) {
3292
- throw Error('Cannot access Google Map information before the API has been initialized. ' +
3293
- 'Please wait for the API to load before trying to interact with it.');
3294
- }
3295
- if (!this.rectangle) {
3296
- throw Error('Cannot interact with a Google Map Rectangle before it has been initialized. ' +
3297
- 'Please wait for the Rectangle to load before trying to interact with it.');
3298
- }
3299
- }
3300
- };
3301
- return MapRectangle;
3302
- }());
3303
- MapRectangle.decorators = [
3304
- { type: i0.Directive, args: [{
3305
- selector: 'map-rectangle',
3306
- exportAs: 'mapRectangle',
3307
- },] }
3308
- ];
3309
- MapRectangle.ctorParameters = function () { return [
3310
- { type: GoogleMap },
3311
- { type: i0.NgZone }
3312
- ]; };
3313
- MapRectangle.propDecorators = {
3314
- options: [{ type: i0.Input }],
3315
- bounds: [{ type: i0.Input }],
3316
- boundsChanged: [{ type: i0.Output }],
3317
- rectangleClick: [{ type: i0.Output }],
3318
- rectangleDblclick: [{ type: i0.Output }],
3319
- rectangleDrag: [{ type: i0.Output }],
3320
- rectangleDragend: [{ type: i0.Output }],
3321
- rectangleDragstart: [{ type: i0.Output }],
3322
- rectangleMousedown: [{ type: i0.Output }],
3323
- rectangleMousemove: [{ type: i0.Output }],
3324
- rectangleMouseout: [{ type: i0.Output }],
3325
- rectangleMouseover: [{ type: i0.Output }],
3326
- rectangleMouseup: [{ type: i0.Output }],
3327
- rectangleRightclick: [{ type: i0.Output }]
3328
- };
3329
-
3330
- /**
3331
- * @license
3332
- * Copyright Google LLC All Rights Reserved.
3333
- *
3334
- * Use of this source code is governed by an MIT-style license that can be
3335
- * found in the LICENSE file at https://angular.io/license
3336
- */
3337
- /**
3338
- * Angular component that renders a Google Maps Traffic Layer via the Google Maps JavaScript API.
3339
- *
3340
- * See developers.google.com/maps/documentation/javascript/reference/map#TrafficLayer
3341
- */
3342
- var MapTrafficLayer = /** @class */ (function () {
3343
- function MapTrafficLayer(_map, _ngZone) {
3344
- this._map = _map;
3345
- this._ngZone = _ngZone;
3346
- this._autoRefresh = new rxjs.BehaviorSubject(true);
3347
- this._destroyed = new rxjs.Subject();
3348
- }
3349
- Object.defineProperty(MapTrafficLayer.prototype, "autoRefresh", {
3350
- /**
3351
- * Whether the traffic layer refreshes with updated information automatically.
3352
- */
3353
- set: function (autoRefresh) {
3354
- this._autoRefresh.next(autoRefresh);
3355
- },
3356
- enumerable: false,
3357
- configurable: true
3358
- });
3359
- MapTrafficLayer.prototype.ngOnInit = function () {
3360
- var _this = this;
3361
- if (this._map._isBrowser) {
3362
- this._combineOptions().pipe(operators.take(1)).subscribe(function (options) {
3363
- // Create the object outside the zone so its events don't trigger change detection.
3364
- _this._ngZone.runOutsideAngular(function () {
3365
- _this.trafficLayer = new google.maps.TrafficLayer(options);
3366
- });
3367
- _this._assertInitialized();
3368
- _this.trafficLayer.setMap(_this._map.googleMap);
3369
- });
3370
- this._watchForAutoRefreshChanges();
3371
- }
3372
- };
3373
- MapTrafficLayer.prototype.ngOnDestroy = function () {
3374
- this._destroyed.next();
3375
- this._destroyed.complete();
3376
- if (this.trafficLayer) {
3377
- this.trafficLayer.setMap(null);
3378
- }
3379
- };
3380
- MapTrafficLayer.prototype._combineOptions = function () {
3381
- return this._autoRefresh.pipe(operators.map(function (autoRefresh) {
3382
- var combinedOptions = { autoRefresh: autoRefresh };
3383
- return combinedOptions;
3384
- }));
3385
- };
3386
- MapTrafficLayer.prototype._watchForAutoRefreshChanges = function () {
3387
- var _this = this;
3388
- this._combineOptions().pipe(operators.takeUntil(this._destroyed)).subscribe(function (options) {
3389
- _this._assertInitialized();
3390
- _this.trafficLayer.setOptions(options);
3391
- });
3392
- };
3393
- MapTrafficLayer.prototype._assertInitialized = function () {
3394
- if (!this._map.googleMap) {
3395
- throw Error('Cannot access Google Map information before the API has been initialized. ' +
3396
- 'Please wait for the API to load before trying to interact with it.');
3397
- }
3398
- if (!this.trafficLayer) {
3399
- throw Error('Cannot interact with a Google Map Traffic Layer before it has been initialized. ' +
3400
- 'Please wait for the Traffic Layer to load before trying to interact with it.');
3401
- }
3402
- };
3403
- return MapTrafficLayer;
3404
- }());
3405
- MapTrafficLayer.decorators = [
3406
- { type: i0.Directive, args: [{
3407
- selector: 'map-traffic-layer',
3408
- exportAs: 'mapTrafficLayer',
3409
- },] }
3410
- ];
3411
- MapTrafficLayer.ctorParameters = function () { return [
3412
- { type: GoogleMap },
3413
- { type: i0.NgZone }
3414
- ]; };
3415
- MapTrafficLayer.propDecorators = {
3416
- autoRefresh: [{ type: i0.Input }]
3417
- };
3418
-
3419
- /**
3420
- * Angular component that renders a Google Maps Transit Layer via the Google Maps JavaScript API.
3421
- *
3422
- * See developers.google.com/maps/documentation/javascript/reference/map#TransitLayer
3423
- */
3424
- var MapTransitLayer = /** @class */ (function (_super) {
3425
- __extends(MapTransitLayer, _super);
3426
- function MapTransitLayer() {
3427
- return _super !== null && _super.apply(this, arguments) || this;
3428
- }
3429
- MapTransitLayer.prototype._initializeObject = function () {
3430
- this.transitLayer = new google.maps.TransitLayer();
3431
- };
3432
- MapTransitLayer.prototype._setMap = function () {
3433
- this._assertLayerInitialized();
3434
- this.transitLayer.setMap(this._map.googleMap);
3435
- };
3436
- MapTransitLayer.prototype._unsetMap = function () {
3437
- if (this.transitLayer) {
3438
- this.transitLayer.setMap(null);
3439
- }
3440
- };
3441
- MapTransitLayer.prototype._assertLayerInitialized = function () {
3442
- if (!this.transitLayer) {
3443
- throw Error('Cannot interact with a Google Map Transit Layer before it has been initialized. ' +
3444
- 'Please wait for the Transit Layer to load before trying to interact with it.');
3445
- }
3446
- };
3447
- return MapTransitLayer;
3448
- }(MapBaseLayer));
3449
- MapTransitLayer.decorators = [
3450
- { type: i0.Directive, args: [{
3451
- selector: 'map-transit-layer',
3452
- exportAs: 'mapTransitLayer',
3453
- },] }
3454
- ];
3455
-
3456
- /**
3457
- * @license
3458
- * Copyright Google LLC All Rights Reserved.
3459
- *
3460
- * Use of this source code is governed by an MIT-style license that can be
3461
- * found in the LICENSE file at https://angular.io/license
3462
- */
3463
- /**
3464
- * Angular directive that renders a Google Maps heatmap via the Google Maps JavaScript API.
3465
- *
3466
- * See: https://developers.google.com/maps/documentation/javascript/reference/visualization
3467
- */
3468
- var MapHeatmapLayer = /** @class */ (function () {
3469
- function MapHeatmapLayer(_googleMap, _ngZone) {
3470
- this._googleMap = _googleMap;
3471
- this._ngZone = _ngZone;
3472
- }
3473
- Object.defineProperty(MapHeatmapLayer.prototype, "data", {
3474
- /**
3475
- * Data shown on the heatmap.
3476
- * See: https://developers.google.com/maps/documentation/javascript/reference/visualization
3477
- */
3478
- set: function (data) {
3479
- this._data = data;
3480
- },
3481
- enumerable: false,
3482
- configurable: true
3483
- });
3484
- Object.defineProperty(MapHeatmapLayer.prototype, "options", {
3485
- /**
3486
- * Options used to configure the heatmap. See:
3487
- * developers.google.com/maps/documentation/javascript/reference/visualization#HeatmapLayerOptions
3488
- */
3489
- set: function (options) {
3490
- this._options = options;
3491
- },
3492
- enumerable: false,
3493
- configurable: true
3494
- });
3495
- MapHeatmapLayer.prototype.ngOnInit = function () {
3496
- var _this = this;
3497
- var _a, _b;
3498
- if (this._googleMap._isBrowser) {
3499
- if (!((_b = (_a = window.google) === null || _a === void 0 ? void 0 : _a.maps) === null || _b === void 0 ? void 0 : _b.visualization) && (typeof ngDevMode === 'undefined' || ngDevMode)) {
3500
- throw Error('Namespace `google.maps.visualization` not found, cannot construct heatmap. ' +
3501
- 'Please install the Google Maps JavaScript API with the "visualization" library: ' +
3502
- 'https://developers.google.com/maps/documentation/javascript/visualization');
3503
- }
3504
- // Create the object outside the zone so its events don't trigger change detection.
3505
- // We'll bring it back in inside the `MapEventManager` only for the events that the
3506
- // user has subscribed to.
3507
- this._ngZone.runOutsideAngular(function () {
3508
- _this.heatmap = new google.maps.visualization.HeatmapLayer(_this._combineOptions());
3509
- });
3510
- this._assertInitialized();
3511
- this.heatmap.setMap(this._googleMap.googleMap);
3512
- }
3513
- };
3514
- MapHeatmapLayer.prototype.ngOnChanges = function (changes) {
3515
- var _c = this, _data = _c._data, heatmap = _c.heatmap;
3516
- if (heatmap) {
3517
- if (changes['options']) {
3518
- heatmap.setOptions(this._combineOptions());
3519
- }
3520
- if (changes['data'] && _data !== undefined) {
3521
- heatmap.setData(this._normalizeData(_data));
3522
- }
3523
- }
3524
- };
3525
- MapHeatmapLayer.prototype.ngOnDestroy = function () {
3526
- if (this.heatmap) {
3527
- this.heatmap.setMap(null);
3528
- }
3529
- };
3530
- /**
3531
- * Gets the data that is currently shown on the heatmap.
3532
- * See: developers.google.com/maps/documentation/javascript/reference/visualization#HeatmapLayer
3533
- */
3534
- MapHeatmapLayer.prototype.getData = function () {
3535
- this._assertInitialized();
3536
- return this.heatmap.getData();
3537
- };
3538
- /** Creates a combined options object using the passed-in options and the individual inputs. */
3539
- MapHeatmapLayer.prototype._combineOptions = function () {
3540
- var options = this._options || {};
3541
- return Object.assign(Object.assign({}, options), { data: this._normalizeData(this._data || options.data || []), map: this._googleMap.googleMap });
3542
- };
3543
- /**
3544
- * Most Google Maps APIs support both `LatLng` objects and `LatLngLiteral`. The latter is more
3545
- * convenient to write out, because the Google Maps API doesn't have to have been loaded in order
3546
- * to construct them. The `HeatmapLayer` appears to be an exception that only allows a `LatLng`
3547
- * object, or it throws a runtime error. Since it's more convenient and we expect that Angular
3548
- * users will load the API asynchronously, we allow them to pass in a `LatLngLiteral` and we
3549
- * convert it to a `LatLng` object before passing it off to Google Maps.
3550
- */
3551
- MapHeatmapLayer.prototype._normalizeData = function (data) {
3552
- var result = [];
3553
- data.forEach(function (item) {
3554
- result.push(isLatLngLiteral(item) ? new google.maps.LatLng(item.lat, item.lng) : item);
3555
- });
3556
- return result;
3557
- };
3558
- /** Asserts that the heatmap object has been initialized. */
3559
- MapHeatmapLayer.prototype._assertInitialized = function () {
3560
- if (typeof ngDevMode === 'undefined' || ngDevMode) {
3561
- if (!this._googleMap.googleMap) {
3562
- throw Error('Cannot access Google Map information before the API has been initialized. ' +
3563
- 'Please wait for the API to load before trying to interact with it.');
3564
- }
3565
- if (!this.heatmap) {
3566
- throw Error('Cannot interact with a Google Map HeatmapLayer before it has been ' +
3567
- 'initialized. Please wait for the heatmap to load before trying to interact with it.');
3568
- }
3569
- }
3570
- };
3571
- return MapHeatmapLayer;
3572
- }());
3573
- MapHeatmapLayer.decorators = [
3574
- { type: i0.Directive, args: [{
3575
- selector: 'map-heatmap-layer',
3576
- exportAs: 'mapHeatmapLayer',
3577
- },] }
3578
- ];
3579
- MapHeatmapLayer.ctorParameters = function () { return [
3580
- { type: GoogleMap },
3581
- { type: i0.NgZone }
3582
- ]; };
3583
- MapHeatmapLayer.propDecorators = {
3584
- data: [{ type: i0.Input }],
3585
- options: [{ type: i0.Input }]
3586
- };
3587
- /** Asserts that an object is a `LatLngLiteral`. */
3588
- function isLatLngLiteral(value) {
3589
- return value && typeof value.lat === 'number' && typeof value.lng === 'number';
3590
- }
3591
-
3592
- /**
3593
- * @license
3594
- * Copyright Google LLC All Rights Reserved.
3595
- *
3596
- * Use of this source code is governed by an MIT-style license that can be
3597
- * found in the LICENSE file at https://angular.io/license
3598
- */
3599
- var COMPONENTS = [
3600
- GoogleMap,
3601
- MapBaseLayer,
3602
- MapBicyclingLayer,
3603
- MapCircle,
3604
- MapDirectionsRenderer,
3605
- MapGroundOverlay,
3606
- MapInfoWindow,
3607
- MapKmlLayer,
3608
- MapMarker,
3609
- MapMarkerClusterer,
3610
- MapPolygon,
3611
- MapPolyline,
3612
- MapRectangle,
3613
- MapTrafficLayer,
3614
- MapTransitLayer,
3615
- MapHeatmapLayer,
3616
- ];
3617
- var GoogleMapsModule = /** @class */ (function () {
3618
- function GoogleMapsModule() {
3619
- }
3620
- return GoogleMapsModule;
3621
- }());
3622
- GoogleMapsModule.decorators = [
3623
- { type: i0.NgModule, args: [{
3624
- declarations: COMPONENTS,
3625
- exports: COMPONENTS,
3626
- },] }
3627
- ];
3628
-
3629
- /**
3630
- * @license
3631
- * Copyright Google LLC All Rights Reserved.
3632
- *
3633
- * Use of this source code is governed by an MIT-style license that can be
3634
- * found in the LICENSE file at https://angular.io/license
3635
- */
3636
- /**
3637
- * Angular service that wraps the Google Maps DirectionsService from the Google Maps JavaScript
3638
- * API.
3639
- *
3640
- * See developers.google.com/maps/documentation/javascript/reference/directions#DirectionsService
3641
- */
3642
- var MapDirectionsService = /** @class */ (function () {
3643
- function MapDirectionsService(_ngZone) {
3644
- this._ngZone = _ngZone;
3645
- }
3646
- /**
3647
- * See
3648
- * developers.google.com/maps/documentation/javascript/reference/directions
3649
- * #DirectionsService.route
3650
- */
3651
- MapDirectionsService.prototype.route = function (request) {
3652
- var _this = this;
3653
- return new rxjs.Observable(function (observer) {
3654
- // Initialize the `DirectionsService` lazily since the Google Maps API may
3655
- // not have been loaded when the provider is instantiated.
3656
- if (!_this._directionsService) {
3657
- _this._directionsService = new google.maps.DirectionsService();
3658
- }
3659
- var callback = function (result, status) {
3660
- _this._ngZone.run(function () {
3661
- observer.next({ result: result, status: status });
3662
- observer.complete();
3663
- });
3664
- };
3665
- _this._directionsService.route(request, callback);
3666
- });
3667
- };
3668
- return MapDirectionsService;
3669
- }());
3670
- MapDirectionsService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function MapDirectionsService_Factory() { return new MapDirectionsService(i0__namespace.ɵɵinject(i0__namespace.NgZone)); }, token: MapDirectionsService, providedIn: "root" });
3671
- MapDirectionsService.decorators = [
3672
- { type: i0.Injectable, args: [{ providedIn: 'root' },] }
3673
- ];
3674
- MapDirectionsService.ctorParameters = function () { return [
3675
- { type: i0.NgZone }
3676
- ]; };
3677
-
3678
- /**
3679
- * @license
3680
- * Copyright Google LLC All Rights Reserved.
3681
- *
3682
- * Use of this source code is governed by an MIT-style license that can be
3683
- * found in the LICENSE file at https://angular.io/license
3684
- */
3685
- /**
3686
- * Angular service that wraps the Google Maps Geocoder from the Google Maps JavaScript API.
3687
- * See developers.google.com/maps/documentation/javascript/reference/geocoder#Geocoder
3688
- */
3689
- var MapGeocoder = /** @class */ (function () {
3690
- function MapGeocoder(_ngZone) {
3691
- this._ngZone = _ngZone;
3692
- }
3693
- /**
3694
- * See developers.google.com/maps/documentation/javascript/reference/geocoder#Geocoder.geocode
3695
- */
3696
- MapGeocoder.prototype.geocode = function (request) {
3697
- var _this = this;
3698
- return new rxjs.Observable(function (observer) {
3699
- // Initialize the `Geocoder` lazily since the Google Maps API may
3700
- // not have been loaded when the provider is instantiated.
3701
- if (!_this._geocoder) {
3702
- _this._geocoder = new google.maps.Geocoder();
3703
- }
3704
- _this._geocoder.geocode(request, function (results, status) {
3705
- _this._ngZone.run(function () {
3706
- observer.next({ results: results, status: status });
3707
- observer.complete();
3708
- });
3709
- });
3710
- });
3711
- };
3712
- return MapGeocoder;
3713
- }());
3714
- MapGeocoder.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function MapGeocoder_Factory() { return new MapGeocoder(i0__namespace.ɵɵinject(i0__namespace.NgZone)); }, token: MapGeocoder, providedIn: "root" });
3715
- MapGeocoder.decorators = [
3716
- { type: i0.Injectable, args: [{ providedIn: 'root' },] }
3717
- ];
3718
- MapGeocoder.ctorParameters = function () { return [
3719
- { type: i0.NgZone }
3720
- ]; };
3721
-
3722
- /**
3723
- * @license
3724
- * Copyright Google LLC All Rights Reserved.
3725
- *
3726
- * Use of this source code is governed by an MIT-style license that can be
3727
- * found in the LICENSE file at https://angular.io/license
3728
- */
3729
-
3730
- /**
3731
- * Generated bundle index. Do not edit.
3732
- */
3733
-
3734
- exports.GoogleMap = GoogleMap;
3735
- exports.GoogleMapsModule = GoogleMapsModule;
3736
- exports.MapBaseLayer = MapBaseLayer;
3737
- exports.MapBicyclingLayer = MapBicyclingLayer;
3738
- exports.MapCircle = MapCircle;
3739
- exports.MapDirectionsRenderer = MapDirectionsRenderer;
3740
- exports.MapDirectionsService = MapDirectionsService;
3741
- exports.MapGeocoder = MapGeocoder;
3742
- exports.MapGroundOverlay = MapGroundOverlay;
3743
- exports.MapHeatmapLayer = MapHeatmapLayer;
3744
- exports.MapInfoWindow = MapInfoWindow;
3745
- exports.MapKmlLayer = MapKmlLayer;
3746
- exports.MapMarker = MapMarker;
3747
- exports.MapMarkerClusterer = MapMarkerClusterer;
3748
- exports.MapPolygon = MapPolygon;
3749
- exports.MapPolyline = MapPolyline;
3750
- exports.MapRectangle = MapRectangle;
3751
- exports.MapTrafficLayer = MapTrafficLayer;
3752
- exports.MapTransitLayer = MapTransitLayer;
3753
-
3754
- Object.defineProperty(exports, '__esModule', { value: true });
3755
-
3756
- })));
3757
- //# sourceMappingURL=google-maps.umd.js.map