@dereekb/dbx-web 9.6.3 → 9.7.0
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.
- package/esm2020/mapbox/lib/index.mjs +5 -1
- package/esm2020/mapbox/lib/mapbox.layout.component.mjs +1 -1
- package/esm2020/mapbox/lib/mapbox.marker.component.mjs +10 -8
- package/esm2020/mapbox/lib/mapbox.marker.mjs +16 -0
- package/esm2020/mapbox/lib/mapbox.markers.component.mjs +59 -0
- package/esm2020/mapbox/lib/mapbox.menu.component.mjs +1 -1
- package/esm2020/mapbox/lib/mapbox.mjs +1 -1
- package/esm2020/mapbox/lib/mapbox.module.mjs +5 -1
- package/esm2020/mapbox/lib/mapbox.rxjs.mjs +53 -0
- package/esm2020/mapbox/lib/mapbox.store.mjs +27 -14
- package/esm2020/mapbox/lib/mapbox.util.mjs +15 -0
- package/fesm2015/dereekb-dbx-web-mapbox.mjs +180 -29
- package/fesm2015/dereekb-dbx-web-mapbox.mjs.map +1 -1
- package/fesm2020/dereekb-dbx-web-mapbox.mjs +180 -29
- package/fesm2020/dereekb-dbx-web-mapbox.mjs.map +1 -1
- package/lib/layout/text/_text.scss +18 -0
- package/mapbox/esm2020/lib/index.mjs +5 -1
- package/mapbox/esm2020/lib/mapbox.layout.component.mjs +1 -1
- package/mapbox/esm2020/lib/mapbox.marker.component.mjs +10 -8
- package/mapbox/esm2020/lib/mapbox.marker.mjs +16 -0
- package/mapbox/esm2020/lib/mapbox.markers.component.mjs +59 -0
- package/mapbox/esm2020/lib/mapbox.menu.component.mjs +1 -1
- package/mapbox/esm2020/lib/mapbox.mjs +1 -1
- package/mapbox/esm2020/lib/mapbox.module.mjs +5 -1
- package/mapbox/esm2020/lib/mapbox.rxjs.mjs +53 -0
- package/mapbox/esm2020/lib/mapbox.store.mjs +27 -14
- package/mapbox/esm2020/lib/mapbox.util.mjs +15 -0
- package/mapbox/fesm2015/dereekb-dbx-web-mapbox.mjs +180 -29
- package/mapbox/fesm2015/dereekb-dbx-web-mapbox.mjs.map +1 -1
- package/mapbox/fesm2020/dereekb-dbx-web-mapbox.mjs +180 -29
- package/mapbox/fesm2020/dereekb-dbx-web-mapbox.mjs.map +1 -1
- package/mapbox/lib/index.d.ts +4 -0
- package/mapbox/lib/mapbox.d.ts +6 -0
- package/mapbox/lib/mapbox.marker.component.d.ts +4 -33
- package/mapbox/lib/mapbox.marker.d.ts +49 -0
- package/mapbox/lib/mapbox.markers.component.d.ts +21 -0
- package/mapbox/lib/mapbox.module.d.ts +11 -10
- package/mapbox/lib/mapbox.rxjs.d.ts +44 -0
- package/mapbox/lib/mapbox.store.d.ts +12 -1
- package/mapbox/lib/mapbox.util.d.ts +27 -0
- package/mapbox/package.json +5 -4
- package/package.json +3 -3
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Injectable, Optional, Inject, Directive, Host, Component, ElementRef, ViewChild, Input, ChangeDetectionStrategy, SkipSelf, Injector, NgModule } from '@angular/core';
|
|
3
|
-
import * as
|
|
3
|
+
import * as i1$1 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
|
-
import { cleanup, filterMaybe, onTrueToFalse, SubscriptionObject } from '@dereekb/rxjs';
|
|
6
|
-
import { latLngPointFunction, latLngBoundFunction, isSameLatLngPoint, isDefaultLatLngPoint, swMostLatLngPoint, neMostLatLngPoint, isSameLatLngBound, latLngBoundWrapsMap, isWithinLatLngBoundFunction, overlapsLatLngBoundFunction,
|
|
5
|
+
import { cleanup, filterMaybe, onTrueToFalse, SubscriptionObject, asObservable } from '@dereekb/rxjs';
|
|
6
|
+
import { latLngPointFunction, latLngBoundFunction, isSameLatLngPoint, isDefaultLatLngPoint, swMostLatLngPoint, neMostLatLngPoint, isSameLatLngBound, diffLatLngBoundPoints, latLngBoundWrapsMap, isWithinLatLngBoundFunction, overlapsLatLngBoundFunction, vectorsAreEqual, latLngBoundCenterPoint, addLatLngPoints, latLngPoint, DestroyFunctionObject, getValueFromGetter, LAT_LONG_10M_PRECISION, roundNumberToStepFunction } from '@dereekb/util';
|
|
7
7
|
import { ComponentStore } from '@ngrx/component-store';
|
|
8
|
-
import { switchMap, NEVER, defaultIfEmpty, map, tap, distinctUntilChanged, shareReplay, of, combineLatest, filter, first, startWith, interval, Subject, BehaviorSubject, throttleTime } from 'rxjs';
|
|
8
|
+
import { switchMap, NEVER, defaultIfEmpty, map, tap, distinctUntilChanged, shareReplay, of, combineLatest, filter, first, startWith, interval, Subject, BehaviorSubject, throttleTime, combineLatestWith } from 'rxjs';
|
|
9
9
|
import * as MapboxGl from 'mapbox-gl';
|
|
10
|
+
import { bounds } from '@mapbox/geo-viewport';
|
|
10
11
|
import * as i1 from 'ngx-mapbox-gl';
|
|
11
12
|
import { NgxMapboxGLModule } from 'ngx-mapbox-gl';
|
|
12
13
|
import * as i3$1 from '@dereekb/dbx-web';
|
|
@@ -20,8 +21,8 @@ import { MatIconModule } from '@angular/material/icon';
|
|
|
20
21
|
import * as i6 from 'angular-resize-event';
|
|
21
22
|
import { AngularResizeEventModule } from 'angular-resize-event';
|
|
22
23
|
import * as i2 from '@dereekb/dbx-core';
|
|
23
|
-
import { AbstractSubscriptionDirective, safeMarkForCheck, DbxInjectionComponentModule } from '@dereekb/dbx-core';
|
|
24
|
-
import * as i2$
|
|
24
|
+
import { AbstractSubscriptionDirective, safeMarkForCheck, tapDetectChanges, DbxInjectionComponentModule } from '@dereekb/dbx-core';
|
|
25
|
+
import * as i2$1 from '@angular/material/menu';
|
|
25
26
|
|
|
26
27
|
class DbxMapboxConfig {
|
|
27
28
|
}
|
|
@@ -57,6 +58,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImpor
|
|
|
57
58
|
type: Optional
|
|
58
59
|
}] }]; } });
|
|
59
60
|
|
|
61
|
+
function mapboxViewportBoundFunction(config) {
|
|
62
|
+
const { mapCanvasSize, tileSize = 512 } = config;
|
|
63
|
+
const dimensions = [mapCanvasSize.x, mapCanvasSize.y];
|
|
64
|
+
return ({ center, zoom }) => {
|
|
65
|
+
const boundingBox = bounds([center.lng, center.lat], zoom, dimensions, tileSize);
|
|
66
|
+
const [swLng, swLat, neLng, neLat] = boundingBox;
|
|
67
|
+
const result = {
|
|
68
|
+
sw: { lat: swLat, lng: swLng },
|
|
69
|
+
ne: { lat: neLat, lng: neLng }
|
|
70
|
+
};
|
|
71
|
+
return result;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
60
75
|
/**
|
|
61
76
|
* Store used for retrieving information.
|
|
62
77
|
*/
|
|
@@ -70,8 +85,9 @@ class DbxMapboxMapStore extends ComponentStore {
|
|
|
70
85
|
retainContent: true
|
|
71
86
|
});
|
|
72
87
|
this.dbxMapboxService = dbxMapboxService;
|
|
73
|
-
this.
|
|
74
|
-
this.
|
|
88
|
+
this.safeLatLngPoint = latLngPointFunction();
|
|
89
|
+
this.latLngPoint = latLngPointFunction({ wrap: false, validate: false });
|
|
90
|
+
this.latLngBound = latLngBoundFunction({ pointFunction: this.latLngPoint });
|
|
75
91
|
// MARK: Effects
|
|
76
92
|
this.setMapService = this.effect((input) => {
|
|
77
93
|
return input.pipe(switchMap((service) => {
|
|
@@ -105,6 +121,12 @@ class DbxMapboxMapStore extends ComponentStore {
|
|
|
105
121
|
addListener('click', (x) => this._setClickEvent(x));
|
|
106
122
|
addListener('dblclick', (x) => this._setDoubleClickEvent(x));
|
|
107
123
|
addListener('contextmenu', (x) => this._setRightClickEvent(x));
|
|
124
|
+
const refreshForResize = () => {
|
|
125
|
+
const { clientWidth: x, clientHeight: y } = map.getCanvas();
|
|
126
|
+
this._setMapCanvasSize({ x, y });
|
|
127
|
+
};
|
|
128
|
+
addListener('resize', refreshForResize);
|
|
129
|
+
refreshForResize();
|
|
108
130
|
const subs = [];
|
|
109
131
|
return {
|
|
110
132
|
service,
|
|
@@ -137,7 +159,7 @@ class DbxMapboxMapStore extends ComponentStore {
|
|
|
137
159
|
});
|
|
138
160
|
this.setCenter = this.effect((input) => {
|
|
139
161
|
return input.pipe(switchMap((center) => {
|
|
140
|
-
const centerPoint = this.
|
|
162
|
+
const centerPoint = this.safeLatLngPoint(center);
|
|
141
163
|
return this.mapInstance$.pipe(tap((map) => map.setCenter(centerPoint)));
|
|
142
164
|
}));
|
|
143
165
|
});
|
|
@@ -256,21 +278,21 @@ class DbxMapboxMapStore extends ComponentStore {
|
|
|
256
278
|
this.jumpTo = this.effect((input) => {
|
|
257
279
|
return input.pipe(switchMap((x) => {
|
|
258
280
|
const inputCenter = x.center ?? x.to?.center;
|
|
259
|
-
const center = inputCenter ? this.
|
|
281
|
+
const center = inputCenter ? this.safeLatLngPoint(inputCenter) : undefined;
|
|
260
282
|
return this.mapInstance$.pipe(tap((map) => map.jumpTo({ ...x.to, center }, x.eventData)));
|
|
261
283
|
}));
|
|
262
284
|
});
|
|
263
285
|
this.easeTo = this.effect((input) => {
|
|
264
286
|
return input.pipe(switchMap((x) => {
|
|
265
287
|
const inputCenter = x.center ?? x.to?.center;
|
|
266
|
-
const center = inputCenter ? this.
|
|
288
|
+
const center = inputCenter ? this.safeLatLngPoint(inputCenter) : undefined;
|
|
267
289
|
return this.mapInstance$.pipe(tap((map) => map.easeTo({ ...x.to, center }, x.eventData)));
|
|
268
290
|
}));
|
|
269
291
|
});
|
|
270
292
|
this.flyTo = this.effect((input) => {
|
|
271
293
|
return input.pipe(switchMap((x) => {
|
|
272
294
|
const inputCenter = x.center ?? x.to?.center;
|
|
273
|
-
const center = inputCenter ? this.
|
|
295
|
+
const center = inputCenter ? this.safeLatLngPoint(inputCenter) : undefined;
|
|
274
296
|
return this.mapInstance$.pipe(tap((map) => map.flyTo({ ...x.to, center }, x.eventData)));
|
|
275
297
|
}));
|
|
276
298
|
});
|
|
@@ -339,30 +361,34 @@ class DbxMapboxMapStore extends ComponentStore {
|
|
|
339
361
|
const bound = x.getBounds();
|
|
340
362
|
const boundSw = bound.getSouthWest();
|
|
341
363
|
const boundNe = bound.getNorthEast();
|
|
342
|
-
const sw = isDefaultLatLngPoint(boundSw) ? swMostLatLngPoint() : boundSw;
|
|
343
|
-
const ne = isDefaultLatLngPoint(boundNe) ? neMostLatLngPoint() : boundNe;
|
|
364
|
+
const sw = isDefaultLatLngPoint(boundSw) ? swMostLatLngPoint() : { lat: boundSw.lat, lng: boundSw.lng };
|
|
365
|
+
const ne = isDefaultLatLngPoint(boundNe) ? neMostLatLngPoint() : { lat: boundNe.lat, lng: boundNe.lng };
|
|
344
366
|
return this.latLngBound(sw, ne);
|
|
345
367
|
}))), shareReplay(1))));
|
|
346
368
|
this.bound$ = this.whenInitialized$.pipe(switchMap(() => {
|
|
347
369
|
return this.isRendering$.pipe(onTrueToFalse(), startWith(undefined), switchMap((x) => this.boundNow$.pipe(first())), distinctUntilChanged(isSameLatLngBound), shareReplay(1));
|
|
348
370
|
}));
|
|
371
|
+
this.boundSizing$ = this.bound$.pipe(map((x) => diffLatLngBoundPoints(x)), shareReplay(1));
|
|
349
372
|
this.boundWrapsAroundWorld$ = this.bound$.pipe(map((x) => latLngBoundWrapsMap(x)), distinctUntilChanged(), shareReplay(1));
|
|
350
373
|
this.isWithinBoundFunction$ = this.bound$.pipe(map((x) => isWithinLatLngBoundFunction(x)), shareReplay(1));
|
|
351
374
|
this.overlapsBoundFunction$ = this.bound$.pipe(map((x) => overlapsLatLngBoundFunction(x)), shareReplay(1));
|
|
352
375
|
this.zoomNow$ = this.whenInitialized$.pipe(switchMap(() => this.mapInstance$.pipe(switchMap((x) => this._renderingTimer.pipe(map(() => x.getZoom()))), shareReplay(1))));
|
|
353
376
|
this.zoom$ = this.whenInitialized$.pipe(switchMap(() => {
|
|
354
|
-
return this.isZooming$.pipe(onTrueToFalse(), startWith(undefined), switchMap((
|
|
377
|
+
return this.isZooming$.pipe(onTrueToFalse(), startWith(undefined), switchMap(() => this.zoomNow$.pipe(first())), distinctUntilChanged(), shareReplay(1));
|
|
355
378
|
}));
|
|
356
379
|
this.pitchNow$ = this.whenInitialized$.pipe(switchMap(() => this.mapInstance$.pipe(switchMap((x) => this._movingTimer.pipe(map(() => x.getPitch()))), shareReplay(1))));
|
|
357
380
|
this.pitch$ = this.whenInitialized$.pipe(switchMap(() => {
|
|
358
|
-
return this.isRotating$.pipe(onTrueToFalse(), startWith(undefined), switchMap((
|
|
381
|
+
return this.isRotating$.pipe(onTrueToFalse(), startWith(undefined), switchMap(() => this.pitchNow$.pipe(first())), distinctUntilChanged(), shareReplay(1));
|
|
359
382
|
}));
|
|
360
383
|
this.bearingNow$ = this.whenInitialized$.pipe(switchMap(() => this.mapInstance$.pipe(switchMap((x) => this._movingTimer.pipe(map(() => x.getBearing()))), shareReplay(1))));
|
|
361
384
|
this.bearing$ = this.whenInitialized$.pipe(switchMap(() => {
|
|
362
|
-
return this.isRotating$.pipe(onTrueToFalse(), startWith(undefined), switchMap((
|
|
385
|
+
return this.isRotating$.pipe(onTrueToFalse(), startWith(undefined), switchMap(() => this.bearingNow$.pipe(first())), distinctUntilChanged(), shareReplay(1));
|
|
363
386
|
}));
|
|
364
387
|
this.content$ = this.state$.pipe(map((x) => x.content), distinctUntilChanged(), shareReplay(1));
|
|
365
388
|
this.hasContent$ = this.content$.pipe(map(Boolean));
|
|
389
|
+
this.currentMapCanvasSize$ = this.state$.pipe(map((x) => x.mapCanvasSize), distinctUntilChanged((a, b) => a != null && b != null && vectorsAreEqual(a, b)), shareReplay(1));
|
|
390
|
+
this.mapCanvasSize$ = this.currentMapCanvasSize$.pipe(filterMaybe());
|
|
391
|
+
this.viewportBoundFunction$ = this.mapCanvasSize$.pipe(map((x) => mapboxViewportBoundFunction({ mapCanvasSize: x })), shareReplay(1));
|
|
366
392
|
this.clickEvent$ = this.state$.pipe(map((x) => x.clickEvent), distinctUntilChanged(), shareReplay(1));
|
|
367
393
|
this.doubleClickEvent$ = this.state$.pipe(map((x) => x.doubleClickEvent), distinctUntilChanged(), shareReplay(1));
|
|
368
394
|
this.rightClickEvent$ = this.state$.pipe(map((x) => x.rightClickEvent), distinctUntilChanged(), shareReplay(1));
|
|
@@ -373,6 +399,7 @@ class DbxMapboxMapStore extends ComponentStore {
|
|
|
373
399
|
this._setMoveState = this.updater((state, moveState) => ({ ...state, moveState }));
|
|
374
400
|
this._setZoomState = this.updater((state, zoomState) => ({ ...state, zoomState }));
|
|
375
401
|
this._setRotateState = this.updater((state, rotateState) => ({ ...state, rotateState }));
|
|
402
|
+
this._setMapCanvasSize = this.updater((state, mapCanvasSize) => ({ ...state, mapCanvasSize }));
|
|
376
403
|
this._setClickEvent = this.updater((state, clickEvent) => ({ ...state, clickEvent }));
|
|
377
404
|
this._setDoubleClickEvent = this.updater((state, doubleClickEvent) => ({ ...state, doubleClickEvent }));
|
|
378
405
|
this._setRightClickEvent = this.updater((state, rightClickEvent) => ({ ...state, rightClickEvent }));
|
|
@@ -419,7 +446,7 @@ class DbxMapboxMapStore extends ComponentStore {
|
|
|
419
446
|
}
|
|
420
447
|
calculateNextCenterOffsetWithScreenMarginChange(sizing) {
|
|
421
448
|
return this.atNextIdle().pipe(switchMap(() => this.bound$.pipe(first(), map((bounds) => {
|
|
422
|
-
const diff = diffLatLngBoundPoints(bounds);
|
|
449
|
+
const diff = diffLatLngBoundPoints(bounds, true);
|
|
423
450
|
const center = latLngBoundCenterPoint(bounds);
|
|
424
451
|
const offsetWidth = sizing.leftMargin + sizing.rightMargin; // 300 + 0
|
|
425
452
|
const newWidth = sizing.fullWidth - offsetWidth; // 1000 - 300 - 0
|
|
@@ -492,7 +519,7 @@ class DbxMapboxLayoutDrawerComponent {
|
|
|
492
519
|
}
|
|
493
520
|
}
|
|
494
521
|
DbxMapboxLayoutDrawerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxLayoutDrawerComponent, deps: [{ token: DbxMapboxMapStore }], target: i0.ɵɵFactoryTarget.Component });
|
|
495
|
-
DbxMapboxLayoutDrawerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.2", type: DbxMapboxLayoutDrawerComponent, selector: "dbx-mapbox-layout-drawer", host: { classAttribute: "dbx-mapbox-layout-drawer" }, ngImport: i0, template: "<div>\n <dbx-injection [config]=\"config$ | async\"></dbx-injection>\n</div>\n", dependencies: [{ kind: "component", type: i2.DbxInjectionComponent, selector: "dbx-injection, [dbxInjection], [dbx-injection]", inputs: ["config", "template"] }, { kind: "pipe", type:
|
|
522
|
+
DbxMapboxLayoutDrawerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.2", type: DbxMapboxLayoutDrawerComponent, selector: "dbx-mapbox-layout-drawer", host: { classAttribute: "dbx-mapbox-layout-drawer" }, ngImport: i0, template: "<div>\n <dbx-injection [config]=\"config$ | async\"></dbx-injection>\n</div>\n", dependencies: [{ kind: "component", type: i2.DbxInjectionComponent, selector: "dbx-injection, [dbxInjection], [dbx-injection]", inputs: ["config", "template"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }] });
|
|
496
523
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxLayoutDrawerComponent, decorators: [{
|
|
497
524
|
type: Component,
|
|
498
525
|
args: [{ selector: 'dbx-mapbox-layout-drawer', host: {
|
|
@@ -635,7 +662,7 @@ class DbxMapboxLayoutComponent extends SubscriptionObject {
|
|
|
635
662
|
}
|
|
636
663
|
}
|
|
637
664
|
DbxMapboxLayoutComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxLayoutComponent, deps: [{ token: DbxMapboxMapStore }], target: i0.ɵɵFactoryTarget.Component });
|
|
638
|
-
DbxMapboxLayoutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.2", type: DbxMapboxLayoutComponent, selector: "dbx-mapbox-layout", inputs: { side: "side", mode: "mode", opened: "opened", hasContent: "hasContent", drawerColor: "drawerColor" }, viewQueries: [{ propertyName: "container", first: true, predicate: MatDrawerContainer, descendants: true }, { propertyName: "content", first: true, predicate: ["content"], descendants: true, read: ElementRef, static: true }], usesInheritance: true, ngImport: i0, template: "<mat-drawer-container class=\"dbx-mapbox-layout-container\" [ngClass]=\"(drawerClasses$ | async) || ''\" [hasBackdrop]=\"false\">\n <mat-drawer class=\"dbx-mapbox-layout-drawer\" #drawer [opened]=\"opened$ | async\" [mode]=\"(mode$ | async) || 'side'\" [position]=\"(position$ | async) || 'end'\">\n <div class=\"dbx-mapbox-layout-drawer-content\" [ngClass]=\"(drawerButtonClasses$ | async) || ''\">\n <ng-content select=\"[drawer]\"></ng-content>\n <dbx-mapbox-layout-drawer></dbx-mapbox-layout-drawer>\n </div>\n </mat-drawer>\n <mat-drawer-content #content class=\"dbx-mapbox-layout-content\" (resized)=\"onResized($event)\">\n <button mat-icon-button (click)=\"toggleDrawer()\" class=\"dbx-mapbox-layout-drawer-button\" [ngClass]=\"(drawerButtonClasses$ | async) || ''\">\n <mat-icon>{{ buttonIcon$ | async }}</mat-icon>\n </button>\n <ng-content></ng-content>\n </mat-drawer-content>\n</mat-drawer-container>\n", styles: [".dbx-mapbox-layout-container{height:100%;max-width:100%}.dbx-mapbox-layout-container .mat-drawer-container{height:100%}.dbx-mapbox-layout-container .dbx-mapbox-layout-drawer{max-width:calc(100% - var(--dbx-mapbox-min-width-var, 60px))}.dbx-mapbox-layout-container .dbx-mapbox-layout-drawer-content{height:100%;width:100%;overflow:hidden}.dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{position:absolute;z-index:2;top:40%;border:none;display:flex;overflow:hidden}.left-drawer .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{left:0;border-radius:0 20px 20px 0}.right-drawer .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{right:0;border-radius:20px 0 0 20px}.has-drawer-content .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{width:35px}.has-drawer-content.open-drawer .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{width:35px}.no-drawer-content .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{width:0px}.dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button mat-icon{padding-left:8px}\n"], dependencies: [{ kind: "directive", type:
|
|
665
|
+
DbxMapboxLayoutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.2", type: DbxMapboxLayoutComponent, selector: "dbx-mapbox-layout", inputs: { side: "side", mode: "mode", opened: "opened", hasContent: "hasContent", drawerColor: "drawerColor" }, viewQueries: [{ propertyName: "container", first: true, predicate: MatDrawerContainer, descendants: true }, { propertyName: "content", first: true, predicate: ["content"], descendants: true, read: ElementRef, static: true }], usesInheritance: true, ngImport: i0, template: "<mat-drawer-container class=\"dbx-mapbox-layout-container\" [ngClass]=\"(drawerClasses$ | async) || ''\" [hasBackdrop]=\"false\">\n <mat-drawer class=\"dbx-mapbox-layout-drawer\" #drawer [opened]=\"opened$ | async\" [mode]=\"(mode$ | async) || 'side'\" [position]=\"(position$ | async) || 'end'\">\n <div class=\"dbx-mapbox-layout-drawer-content\" [ngClass]=\"(drawerButtonClasses$ | async) || ''\">\n <ng-content select=\"[drawer]\"></ng-content>\n <dbx-mapbox-layout-drawer></dbx-mapbox-layout-drawer>\n </div>\n </mat-drawer>\n <mat-drawer-content #content class=\"dbx-mapbox-layout-content\" (resized)=\"onResized($event)\">\n <button mat-icon-button (click)=\"toggleDrawer()\" class=\"dbx-mapbox-layout-drawer-button\" [ngClass]=\"(drawerButtonClasses$ | async) || ''\">\n <mat-icon>{{ buttonIcon$ | async }}</mat-icon>\n </button>\n <ng-content></ng-content>\n </mat-drawer-content>\n</mat-drawer-container>\n", styles: [".dbx-mapbox-layout-container{height:100%;max-width:100%}.dbx-mapbox-layout-container .mat-drawer-container{height:100%}.dbx-mapbox-layout-container .dbx-mapbox-layout-drawer{max-width:calc(100% - var(--dbx-mapbox-min-width-var, 60px))}.dbx-mapbox-layout-container .dbx-mapbox-layout-drawer-content{height:100%;width:100%;overflow:hidden}.dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{position:absolute;z-index:2;top:40%;border:none;display:flex;overflow:hidden}.left-drawer .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{left:0;border-radius:0 20px 20px 0}.right-drawer .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{right:0;border-radius:20px 0 0 20px}.has-drawer-content .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{width:35px}.has-drawer-content.open-drawer .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{width:35px}.no-drawer-content .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{width:0px}.dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button mat-icon{padding-left:8px}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: i3.MatDrawer, selector: "mat-drawer", inputs: ["position", "mode", "disableClose", "autoFocus", "opened"], outputs: ["openedChange", "opened", "openedStart", "closed", "closedStart", "positionChanged"], exportAs: ["matDrawer"] }, { kind: "component", type: i3.MatDrawerContainer, selector: "mat-drawer-container", inputs: ["autosize", "hasBackdrop"], outputs: ["backdropClick"], exportAs: ["matDrawerContainer"] }, { kind: "component", type: i3.MatDrawerContent, selector: "mat-drawer-content" }, { kind: "component", type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i6.ResizedDirective, selector: "[resized]", outputs: ["resized"] }, { kind: "component", type: DbxMapboxLayoutDrawerComponent, selector: "dbx-mapbox-layout-drawer" }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }] });
|
|
639
666
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxLayoutComponent, decorators: [{
|
|
640
667
|
type: Component,
|
|
641
668
|
args: [{ selector: 'dbx-mapbox-layout', template: "<mat-drawer-container class=\"dbx-mapbox-layout-container\" [ngClass]=\"(drawerClasses$ | async) || ''\" [hasBackdrop]=\"false\">\n <mat-drawer class=\"dbx-mapbox-layout-drawer\" #drawer [opened]=\"opened$ | async\" [mode]=\"(mode$ | async) || 'side'\" [position]=\"(position$ | async) || 'end'\">\n <div class=\"dbx-mapbox-layout-drawer-content\" [ngClass]=\"(drawerButtonClasses$ | async) || ''\">\n <ng-content select=\"[drawer]\"></ng-content>\n <dbx-mapbox-layout-drawer></dbx-mapbox-layout-drawer>\n </div>\n </mat-drawer>\n <mat-drawer-content #content class=\"dbx-mapbox-layout-content\" (resized)=\"onResized($event)\">\n <button mat-icon-button (click)=\"toggleDrawer()\" class=\"dbx-mapbox-layout-drawer-button\" [ngClass]=\"(drawerButtonClasses$ | async) || ''\">\n <mat-icon>{{ buttonIcon$ | async }}</mat-icon>\n </button>\n <ng-content></ng-content>\n </mat-drawer-content>\n</mat-drawer-container>\n", styles: [".dbx-mapbox-layout-container{height:100%;max-width:100%}.dbx-mapbox-layout-container .mat-drawer-container{height:100%}.dbx-mapbox-layout-container .dbx-mapbox-layout-drawer{max-width:calc(100% - var(--dbx-mapbox-min-width-var, 60px))}.dbx-mapbox-layout-container .dbx-mapbox-layout-drawer-content{height:100%;width:100%;overflow:hidden}.dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{position:absolute;z-index:2;top:40%;border:none;display:flex;overflow:hidden}.left-drawer .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{left:0;border-radius:0 20px 20px 0}.right-drawer .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{right:0;border-radius:20px 0 0 20px}.has-drawer-content .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{width:35px}.has-drawer-content.open-drawer .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{width:35px}.no-drawer-content .dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button{width:0px}.dbx-mapbox-layout-content>.dbx-mapbox-layout-drawer-button mat-icon{padding-left:8px}\n"] }]
|
|
@@ -724,7 +751,7 @@ class DbxMapboxMenuComponent extends AbstractSubscriptionDirective {
|
|
|
724
751
|
this._active.next(active ?? true);
|
|
725
752
|
}
|
|
726
753
|
}
|
|
727
|
-
DbxMapboxMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxMenuComponent, deps: [{ token: DbxMapboxMapStore }, { token: i2$
|
|
754
|
+
DbxMapboxMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxMenuComponent, deps: [{ token: DbxMapboxMapStore }, { token: i2$1.MatMenuTrigger, host: true }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
728
755
|
DbxMapboxMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.2", type: DbxMapboxMenuComponent, selector: "dbx-mapbox-menu", inputs: { active: ["dbxMapboxMenu", "active"] }, host: { properties: { "style.top": "pos.y", "style.left": "pos.x" }, styleAttribute: "visibility: hidden; position: fixed" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
729
756
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxMenuComponent, decorators: [{
|
|
730
757
|
type: Component,
|
|
@@ -738,7 +765,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImpor
|
|
|
738
765
|
},
|
|
739
766
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
740
767
|
}]
|
|
741
|
-
}], ctorParameters: function () { return [{ type: DbxMapboxMapStore }, { type: i2$
|
|
768
|
+
}], ctorParameters: function () { return [{ type: DbxMapboxMapStore }, { type: i2$1.MatMenuTrigger, decorators: [{
|
|
742
769
|
type: Host
|
|
743
770
|
}] }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { active: [{
|
|
744
771
|
type: Input,
|
|
@@ -802,7 +829,8 @@ class DbxMapboxMarkerComponent {
|
|
|
802
829
|
this._marker = marker;
|
|
803
830
|
}
|
|
804
831
|
get latLng() {
|
|
805
|
-
|
|
832
|
+
const input = this._marker?.latLng;
|
|
833
|
+
return input ? DbxMapboxMarkerComponent._latLngPoint(input) : undefined;
|
|
806
834
|
}
|
|
807
835
|
get anchor() {
|
|
808
836
|
return this._marker?.anchor;
|
|
@@ -842,7 +870,7 @@ class DbxMapboxMarkerComponent {
|
|
|
842
870
|
}
|
|
843
871
|
const imageInput = this._marker?.image;
|
|
844
872
|
const image = imageInput ? (typeof imageInput === 'string' ? imageInput : getValueFromGetter(imageInput, width)) : undefined;
|
|
845
|
-
|
|
873
|
+
const style = {
|
|
846
874
|
...this._marker?.style,
|
|
847
875
|
width: width + 'px',
|
|
848
876
|
height: height + 'px',
|
|
@@ -852,6 +880,7 @@ class DbxMapboxMarkerComponent {
|
|
|
852
880
|
return style;
|
|
853
881
|
}
|
|
854
882
|
}
|
|
883
|
+
DbxMapboxMarkerComponent._latLngPoint = latLngPointFunction({ wrap: true });
|
|
855
884
|
DbxMapboxMarkerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxMarkerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
856
885
|
DbxMapboxMarkerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.2", type: DbxMapboxMarkerComponent, selector: "dbx-mapbox-marker", inputs: { marker: "marker" }, ngImport: i0, template: `
|
|
857
886
|
<mgl-marker *ngIf="marker" [lngLat]="latLng">
|
|
@@ -860,11 +889,11 @@ DbxMapboxMarkerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0
|
|
|
860
889
|
<div class="dbx-mapbox-marker-content" [ngStyle]="style">
|
|
861
890
|
<mat-icon *ngIf="icon">{{ icon }}</mat-icon>
|
|
862
891
|
</div>
|
|
863
|
-
<div class="dbx-mapbox-marker-label" *ngIf="label">{{ label }}</div>
|
|
892
|
+
<div class="dbx-mapbox-marker-label dbx-outlined-text" *ngIf="label">{{ label }}</div>
|
|
864
893
|
</div>
|
|
865
894
|
</dbx-anchor>
|
|
866
895
|
</mgl-marker>
|
|
867
|
-
`, isInline: true, styles: [".dbx-mapbox-marker{display:flex;align-items:center;flex-direction:column
|
|
896
|
+
`, isInline: true, styles: [".dbx-mapbox-marker{display:flex;align-items:center;flex-direction:column}.dbx-mapbox-marker .dbx-mapbox-marker-content{display:flex;align-items:center;justify-content:center}.dbx-mapbox-marker .dbx-mapbox-marker-content mat-icon{width:100%;height:100%;font-size:inherit}.dbx-mapbox-marker .dbx-mapbox-marker-label{font-size:.9em}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3$1.DbxAnchorComponent, selector: "dbx-anchor, [dbx-anchor]", inputs: ["block"] }, { kind: "component", type: i1.MarkerComponent, selector: "mgl-marker", inputs: ["offset", "anchor", "clickTolerance", "feature", "lngLat", "draggable", "popupShown", "className", "pitchAlignment", "rotationAlignment"], outputs: ["markerDragStart", "markerDragEnd", "markerDrag", "dragStart", "dragEnd", "drag"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
868
897
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxMarkerComponent, decorators: [{
|
|
869
898
|
type: Component,
|
|
870
899
|
args: [{ selector: 'dbx-mapbox-marker', template: `
|
|
@@ -874,15 +903,68 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImpor
|
|
|
874
903
|
<div class="dbx-mapbox-marker-content" [ngStyle]="style">
|
|
875
904
|
<mat-icon *ngIf="icon">{{ icon }}</mat-icon>
|
|
876
905
|
</div>
|
|
877
|
-
<div class="dbx-mapbox-marker-label" *ngIf="label">{{ label }}</div>
|
|
906
|
+
<div class="dbx-mapbox-marker-label dbx-outlined-text" *ngIf="label">{{ label }}</div>
|
|
878
907
|
</div>
|
|
879
908
|
</dbx-anchor>
|
|
880
909
|
</mgl-marker>
|
|
881
|
-
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".dbx-mapbox-marker{display:flex;align-items:center;flex-direction:column
|
|
910
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".dbx-mapbox-marker{display:flex;align-items:center;flex-direction:column}.dbx-mapbox-marker .dbx-mapbox-marker-content{display:flex;align-items:center;justify-content:center}.dbx-mapbox-marker .dbx-mapbox-marker-content mat-icon{width:100%;height:100%;font-size:inherit}.dbx-mapbox-marker .dbx-mapbox-marker-label{font-size:.9em}\n"] }]
|
|
882
911
|
}], ctorParameters: function () { return []; }, propDecorators: { marker: [{
|
|
883
912
|
type: Input
|
|
884
913
|
}] } });
|
|
885
914
|
|
|
915
|
+
/**
|
|
916
|
+
* Component used to render a set of DbxMapboxMarker values from the input data and marker factory.
|
|
917
|
+
*/
|
|
918
|
+
class DbxMapboxMarkersComponent {
|
|
919
|
+
constructor(cdRef) {
|
|
920
|
+
this.cdRef = cdRef;
|
|
921
|
+
this._data = new BehaviorSubject(undefined);
|
|
922
|
+
this._markerFactory = new BehaviorSubject(undefined);
|
|
923
|
+
this.markers$ = combineLatest([this._data.pipe(distinctUntilChanged()), this._markerFactory.pipe(distinctUntilChanged())]).pipe(map(([data, markerFactory]) => {
|
|
924
|
+
if (data?.length && markerFactory) {
|
|
925
|
+
return data.map(markerFactory);
|
|
926
|
+
}
|
|
927
|
+
else {
|
|
928
|
+
return [];
|
|
929
|
+
}
|
|
930
|
+
}), tapDetectChanges(this.cdRef), shareReplay(1));
|
|
931
|
+
}
|
|
932
|
+
get data() {
|
|
933
|
+
return this._data.value;
|
|
934
|
+
}
|
|
935
|
+
set data(data) {
|
|
936
|
+
this._data.next(data);
|
|
937
|
+
}
|
|
938
|
+
get markerFactory() {
|
|
939
|
+
return this._markerFactory.value;
|
|
940
|
+
}
|
|
941
|
+
set markerFactory(markerFactory) {
|
|
942
|
+
this._markerFactory.next(markerFactory);
|
|
943
|
+
}
|
|
944
|
+
ngOnDestroy() {
|
|
945
|
+
this._data.complete();
|
|
946
|
+
this._markerFactory.complete();
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
DbxMapboxMarkersComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxMarkersComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
950
|
+
DbxMapboxMarkersComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.2", type: DbxMapboxMarkersComponent, selector: "dbx-mapbox-markers", inputs: { data: "data", markerFactory: "markerFactory" }, ngImport: i0, template: `
|
|
951
|
+
<dbx-mapbox-marker *ngFor="let marker of markers$ | async" [marker]="marker"></dbx-mapbox-marker>
|
|
952
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: DbxMapboxMarkerComponent, selector: "dbx-mapbox-marker", inputs: ["marker"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
953
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxMarkersComponent, decorators: [{
|
|
954
|
+
type: Component,
|
|
955
|
+
args: [{
|
|
956
|
+
selector: 'dbx-mapbox-markers',
|
|
957
|
+
template: `
|
|
958
|
+
<dbx-mapbox-marker *ngFor="let marker of markers$ | async" [marker]="marker"></dbx-mapbox-marker>
|
|
959
|
+
`,
|
|
960
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
961
|
+
}]
|
|
962
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { data: [{
|
|
963
|
+
type: Input
|
|
964
|
+
}], markerFactory: [{
|
|
965
|
+
type: Input
|
|
966
|
+
}] } });
|
|
967
|
+
|
|
886
968
|
const declarations = [
|
|
887
969
|
//
|
|
888
970
|
DbxMapboxMapDirective,
|
|
@@ -890,6 +972,7 @@ const declarations = [
|
|
|
890
972
|
DbxMapboxLayoutDrawerComponent,
|
|
891
973
|
DbxMapboxMenuComponent,
|
|
892
974
|
DbxMapboxMarkerComponent,
|
|
975
|
+
DbxMapboxMarkersComponent,
|
|
893
976
|
DbxMapboxMapStoreInjectionBlockDirective
|
|
894
977
|
];
|
|
895
978
|
class DbxMapboxModule {
|
|
@@ -913,6 +996,7 @@ DbxMapboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version
|
|
|
913
996
|
DbxMapboxLayoutDrawerComponent,
|
|
914
997
|
DbxMapboxMenuComponent,
|
|
915
998
|
DbxMapboxMarkerComponent,
|
|
999
|
+
DbxMapboxMarkersComponent,
|
|
916
1000
|
DbxMapboxMapStoreInjectionBlockDirective], imports: [
|
|
917
1001
|
//
|
|
918
1002
|
CommonModule,
|
|
@@ -929,6 +1013,7 @@ DbxMapboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version
|
|
|
929
1013
|
DbxMapboxLayoutDrawerComponent,
|
|
930
1014
|
DbxMapboxMenuComponent,
|
|
931
1015
|
DbxMapboxMarkerComponent,
|
|
1016
|
+
DbxMapboxMarkersComponent,
|
|
932
1017
|
DbxMapboxMapStoreInjectionBlockDirective] });
|
|
933
1018
|
DbxMapboxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxModule, imports: [
|
|
934
1019
|
//
|
|
@@ -959,6 +1044,72 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImpor
|
|
|
959
1044
|
}]
|
|
960
1045
|
}] });
|
|
961
1046
|
|
|
1047
|
+
/**
|
|
1048
|
+
* Creates the styling for rendering a dot.
|
|
1049
|
+
*
|
|
1050
|
+
* @param background
|
|
1051
|
+
* @param color
|
|
1052
|
+
* @returns
|
|
1053
|
+
*/
|
|
1054
|
+
function dbxMapboxColoredDotStyle(background, color) {
|
|
1055
|
+
return {
|
|
1056
|
+
background,
|
|
1057
|
+
padding: '2px',
|
|
1058
|
+
color: color || 'white',
|
|
1059
|
+
'border-radius': '50%'
|
|
1060
|
+
};
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
/**
|
|
1064
|
+
* Filters the input objects based on their center and zoom values.
|
|
1065
|
+
*
|
|
1066
|
+
* This function caches the bounds computations for each of the input values.
|
|
1067
|
+
*
|
|
1068
|
+
* @param config
|
|
1069
|
+
* @returns
|
|
1070
|
+
*/
|
|
1071
|
+
function filterByMapboxViewportBound(config) {
|
|
1072
|
+
const { boundDecisionObs: inputBoundDecisionObs, boundFunctionObs: inputBoundFunctionObs, defaultZoom: inputDefaultZoom = 17, readValue, zoomRounding, precision = LAT_LONG_10M_PRECISION } = config;
|
|
1073
|
+
const _latLngPoint = latLngPointFunction({ wrap: false, validate: false, precision });
|
|
1074
|
+
const _roundZoom = roundNumberToStepFunction(zoomRounding || { step: 0.5, round: 'floor' });
|
|
1075
|
+
const boundDecisionObs = asObservable(inputBoundDecisionObs);
|
|
1076
|
+
const boundFunctionObs = asObservable(inputBoundFunctionObs);
|
|
1077
|
+
return (input) => {
|
|
1078
|
+
return boundFunctionObs.pipe(distinctUntilChanged(), switchMap((viewportBoundFunction) => {
|
|
1079
|
+
const cache = new Map();
|
|
1080
|
+
return input.pipe(map((values) => {
|
|
1081
|
+
return values.map((value) => {
|
|
1082
|
+
const item = readValue(value);
|
|
1083
|
+
const centerLatLng = _latLngPoint(item.center);
|
|
1084
|
+
const zoomStep = _roundZoom(item.zoom || inputDefaultZoom);
|
|
1085
|
+
const cacheKey = `${zoomStep}_${centerLatLng.lat}_${centerLatLng.lng}`;
|
|
1086
|
+
const cachedValue = cache.get(cacheKey);
|
|
1087
|
+
let bound;
|
|
1088
|
+
if (!cachedValue) {
|
|
1089
|
+
bound = viewportBoundFunction({ center: centerLatLng, zoom: zoomStep });
|
|
1090
|
+
cache.set(cacheKey, bound);
|
|
1091
|
+
}
|
|
1092
|
+
else {
|
|
1093
|
+
bound = cachedValue;
|
|
1094
|
+
}
|
|
1095
|
+
return {
|
|
1096
|
+
value,
|
|
1097
|
+
bound
|
|
1098
|
+
};
|
|
1099
|
+
});
|
|
1100
|
+
}), combineLatestWith(boundDecisionObs), map(([items, boundFunction]) => {
|
|
1101
|
+
let valuesInBounds = [];
|
|
1102
|
+
items.forEach((item) => {
|
|
1103
|
+
if (boundFunction(item.bound)) {
|
|
1104
|
+
valuesInBounds.push(item.value);
|
|
1105
|
+
}
|
|
1106
|
+
});
|
|
1107
|
+
return valuesInBounds;
|
|
1108
|
+
}));
|
|
1109
|
+
}), shareReplay(1));
|
|
1110
|
+
};
|
|
1111
|
+
}
|
|
1112
|
+
|
|
962
1113
|
const KNOWN_MAPBOX_STYLES = [
|
|
963
1114
|
//
|
|
964
1115
|
'mapbox://styles/mapbox/streets-v11',
|
|
@@ -980,5 +1131,5 @@ function mapboxZoomLevel(input) {
|
|
|
980
1131
|
* Generated bundle index. Do not edit.
|
|
981
1132
|
*/
|
|
982
1133
|
|
|
983
|
-
export { DEFAULT_MAPBOX_CENTER, DEFAULT_MAPBOX_MAP_STORE_TIMER_REFRESH_PERIOD, DEFAULT_MAPBOX_STYLE, DEFAULT_MAPBOX_ZOOM, DbxMapboxConfig, DbxMapboxLayoutComponent, DbxMapboxLayoutDrawerComponent, DbxMapboxMapDirective, DbxMapboxMapStore, DbxMapboxMapStoreInjectionBlockDirective, DbxMapboxMapStoreProviderBlock, DbxMapboxMarkerComponent, DbxMapboxMenuComponent, DbxMapboxModule, DbxMapboxService, KNOWN_MAPBOX_STYLES, MAPBOX_MAX_ZOOM_LEVEL, MAPBOX_MIN_ZOOM_LEVEL, mapboxZoomLevel, provideMapboxStoreIfParentIsUnavailable };
|
|
1134
|
+
export { DEFAULT_MAPBOX_CENTER, DEFAULT_MAPBOX_MAP_STORE_TIMER_REFRESH_PERIOD, DEFAULT_MAPBOX_STYLE, DEFAULT_MAPBOX_ZOOM, DbxMapboxConfig, DbxMapboxLayoutComponent, DbxMapboxLayoutDrawerComponent, DbxMapboxMapDirective, DbxMapboxMapStore, DbxMapboxMapStoreInjectionBlockDirective, DbxMapboxMapStoreProviderBlock, DbxMapboxMarkerComponent, DbxMapboxMarkersComponent, DbxMapboxMenuComponent, DbxMapboxModule, DbxMapboxService, KNOWN_MAPBOX_STYLES, MAPBOX_MAX_ZOOM_LEVEL, MAPBOX_MIN_ZOOM_LEVEL, dbxMapboxColoredDotStyle, filterByMapboxViewportBound, mapboxViewportBoundFunction, mapboxZoomLevel, provideMapboxStoreIfParentIsUnavailable };
|
|
984
1135
|
//# sourceMappingURL=dereekb-dbx-web-mapbox.mjs.map
|