@dereekb/dbx-web 9.6.0 → 9.6.3
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 +2 -1
- package/esm2020/mapbox/lib/mapbox.layout.component.mjs +54 -25
- package/esm2020/mapbox/lib/mapbox.marker.component.mjs +97 -0
- package/esm2020/mapbox/lib/mapbox.module.mjs +16 -4
- package/esm2020/mapbox/lib/mapbox.service.mjs +2 -2
- package/esm2020/mapbox/lib/mapbox.store.mjs +46 -22
- package/fesm2015/dereekb-dbx-web-mapbox.mjs +204 -51
- package/fesm2015/dereekb-dbx-web-mapbox.mjs.map +1 -1
- package/fesm2020/dereekb-dbx-web-mapbox.mjs +205 -51
- package/fesm2020/dereekb-dbx-web-mapbox.mjs.map +1 -1
- package/mapbox/esm2020/lib/index.mjs +2 -1
- package/mapbox/esm2020/lib/mapbox.layout.component.mjs +54 -25
- package/mapbox/esm2020/lib/mapbox.marker.component.mjs +97 -0
- package/mapbox/esm2020/lib/mapbox.module.mjs +16 -4
- package/mapbox/esm2020/lib/mapbox.service.mjs +2 -2
- package/mapbox/esm2020/lib/mapbox.store.mjs +46 -22
- package/mapbox/fesm2015/dereekb-dbx-web-mapbox.mjs +204 -51
- package/mapbox/fesm2015/dereekb-dbx-web-mapbox.mjs.map +1 -1
- package/mapbox/fesm2020/dereekb-dbx-web-mapbox.mjs +205 -51
- package/mapbox/fesm2020/dereekb-dbx-web-mapbox.mjs.map +1 -1
- package/mapbox/lib/index.d.ts +1 -0
- package/mapbox/lib/mapbox.layout.component.d.ts +5 -1
- package/mapbox/lib/mapbox.marker.component.d.ts +51 -0
- package/mapbox/lib/mapbox.module.d.ts +11 -8
- package/mapbox/lib/mapbox.store.d.ts +13 -0
- package/mapbox/package.json +3 -3
- package/package.json +3 -3
|
@@ -2,13 +2,15 @@ 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
3
|
import * as i2$1 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
|
-
import { latLngPointFunction, latLngBoundFunction, isSameLatLngPoint, isSameLatLngBound, isWithinLatLngBoundFunction, overlapsLatLngBoundFunction, diffLatLngBoundPoints, latLngBoundCenterPoint, addLatLngPoints, latLngPoint, DestroyFunctionObject } from '@dereekb/util';
|
|
5
|
+
import { latLngPointFunction, latLngBoundFunction, isSameLatLngPoint, isDefaultLatLngPoint, swMostLatLngPoint, neMostLatLngPoint, isSameLatLngBound, latLngBoundWrapsMap, isWithinLatLngBoundFunction, overlapsLatLngBoundFunction, diffLatLngBoundPoints, latLngBoundCenterPoint, addLatLngPoints, latLngPoint, DestroyFunctionObject, getValueFromGetter } from '@dereekb/util';
|
|
6
6
|
import * as i1 from 'ngx-mapbox-gl';
|
|
7
|
+
import { NgxMapboxGLModule } from 'ngx-mapbox-gl';
|
|
7
8
|
import { cleanup, filterMaybe, onTrueToFalse, SubscriptionObject } from '@dereekb/rxjs';
|
|
8
9
|
import { ComponentStore } from '@ngrx/component-store';
|
|
9
|
-
import { switchMap, NEVER, defaultIfEmpty, map, tap, distinctUntilChanged, shareReplay, of, combineLatest, filter, first, startWith, interval, Subject, BehaviorSubject, throttleTime
|
|
10
|
+
import { switchMap, NEVER, defaultIfEmpty, map, tap, distinctUntilChanged, shareReplay, of, combineLatest, filter, first, startWith, interval, Subject, BehaviorSubject, throttleTime } from 'rxjs';
|
|
10
11
|
import * as MapboxGl from 'mapbox-gl';
|
|
11
|
-
import
|
|
12
|
+
import * as i3$1 from '@dereekb/dbx-web';
|
|
13
|
+
import { dbxColorBackground, disableRightClickInCdkBackdrop, DbxRouterAnchorModule } from '@dereekb/dbx-web';
|
|
12
14
|
import * as i3 from '@angular/material/sidenav';
|
|
13
15
|
import { MatDrawerContainer, MatSidenavModule } from '@angular/material/sidenav';
|
|
14
16
|
import * as i4 from '@angular/material/button';
|
|
@@ -25,7 +27,7 @@ class DbxMapboxConfig {
|
|
|
25
27
|
}
|
|
26
28
|
const DEFAULT_MAPBOX_STYLE = 'mapbox://styles/mapbox/streets-v11';
|
|
27
29
|
const DEFAULT_MAPBOX_CENTER = [30.2690138665, -97.7408297965];
|
|
28
|
-
const DEFAULT_MAPBOX_ZOOM =
|
|
30
|
+
const DEFAULT_MAPBOX_ZOOM = 8;
|
|
29
31
|
const DEFAULT_MAPBOX_MAP_STORE_TIMER_REFRESH_PERIOD = 200;
|
|
30
32
|
class DbxMapboxService {
|
|
31
33
|
constructor(config) {
|
|
@@ -75,7 +77,7 @@ class DbxMapboxMapStore extends ComponentStore {
|
|
|
75
77
|
});
|
|
76
78
|
this.dbxMapboxService = dbxMapboxService;
|
|
77
79
|
this.latLngPoint = latLngPointFunction();
|
|
78
|
-
this.latLngBound = latLngBoundFunction();
|
|
80
|
+
this.latLngBound = latLngBoundFunction({ pointFunction: latLngPointFunction({ wrap: false, validate: false }) });
|
|
79
81
|
// MARK: Effects
|
|
80
82
|
this.setMapService = this.effect((input) => {
|
|
81
83
|
return input.pipe(switchMap((service) => {
|
|
@@ -319,17 +321,41 @@ class DbxMapboxMapStore extends ComponentStore {
|
|
|
319
321
|
this.isRotating$ = this.whenInitialized$.pipe(switchMap(() => this.rotateState$.pipe(map((x) => x === 'rotating'), distinctUntilChanged(), shareReplay())));
|
|
320
322
|
this._movingTimer = this.movingTimer();
|
|
321
323
|
this._renderingTimer = this.lifecycleRenderTimer();
|
|
322
|
-
this.centerNow$ = this.whenInitialized$.pipe(switchMap(() => this.mapInstance$.pipe(switchMap((x) => this._movingTimer.pipe(map(() => this.latLngPoint(x.getCenter())))), shareReplay(1))));
|
|
324
|
+
this.centerNow$ = this.whenInitialized$.pipe(switchMap(() => this.mapInstance$.pipe(switchMap((x) => this._movingTimer.pipe(map(() => this.latLngPoint(x.getCenter())))), shareReplay(1))), shareReplay(1));
|
|
323
325
|
this.center$ = this.whenInitialized$.pipe(switchMap(() => {
|
|
324
326
|
return this.isMoving$.pipe(onTrueToFalse(), startWith(undefined), switchMap(() => this.centerNow$.pipe(first())), distinctUntilChanged(isSameLatLngPoint), shareReplay(1));
|
|
327
|
+
}), shareReplay(1));
|
|
328
|
+
this.margin$ = this.state$.pipe(map((x) => x.margin), distinctUntilChanged((a, b) => a != null && b != null && a.fullWidth === b.fullWidth && a.leftMargin === b.leftMargin && a.rightMargin === b.rightMargin), shareReplay(1));
|
|
329
|
+
this.reverseMargin$ = this.margin$.pipe(map((x) => {
|
|
330
|
+
if (x) {
|
|
331
|
+
return { leftMargin: -x.leftMargin, rightMargin: -x.rightMargin, fullWidth: x.fullWidth };
|
|
332
|
+
}
|
|
333
|
+
else {
|
|
334
|
+
return x;
|
|
335
|
+
}
|
|
325
336
|
}));
|
|
337
|
+
this.centerGivenMargin$ = this.whenInitialized$.pipe(switchMap(() => {
|
|
338
|
+
return this.reverseMargin$.pipe(switchMap((x) => {
|
|
339
|
+
if (x) {
|
|
340
|
+
return this.center$.pipe(switchMap((_) => this.calculateNextCenterOffsetWithScreenMarginChange(x)));
|
|
341
|
+
}
|
|
342
|
+
else {
|
|
343
|
+
return this.isMoving$.pipe(filter((x) => !x), switchMap(() => this.center$));
|
|
344
|
+
}
|
|
345
|
+
}));
|
|
346
|
+
}), shareReplay(1));
|
|
326
347
|
this.boundNow$ = this.whenInitialized$.pipe(switchMap(() => this.mapInstance$.pipe(switchMap((x) => this._renderingTimer.pipe(map(() => {
|
|
327
348
|
const bound = x.getBounds();
|
|
328
|
-
|
|
349
|
+
const boundSw = bound.getSouthWest();
|
|
350
|
+
const boundNe = bound.getNorthEast();
|
|
351
|
+
const sw = isDefaultLatLngPoint(boundSw) ? swMostLatLngPoint() : boundSw;
|
|
352
|
+
const ne = isDefaultLatLngPoint(boundNe) ? neMostLatLngPoint() : boundNe;
|
|
353
|
+
return this.latLngBound(sw, ne);
|
|
329
354
|
}))), shareReplay(1))));
|
|
330
355
|
this.bound$ = this.whenInitialized$.pipe(switchMap(() => {
|
|
331
356
|
return this.isRendering$.pipe(onTrueToFalse(), startWith(undefined), switchMap((x) => this.boundNow$.pipe(first())), distinctUntilChanged(isSameLatLngBound), shareReplay(1));
|
|
332
357
|
}));
|
|
358
|
+
this.boundWrapsAroundWorld$ = this.bound$.pipe(map((x) => latLngBoundWrapsMap(x)), distinctUntilChanged(), shareReplay(1));
|
|
333
359
|
this.isWithinBoundFunction$ = this.bound$.pipe(map((x) => isWithinLatLngBoundFunction(x)), shareReplay(1));
|
|
334
360
|
this.overlapsBoundFunction$ = this.bound$.pipe(map((x) => overlapsLatLngBoundFunction(x)), shareReplay(1));
|
|
335
361
|
this.zoomNow$ = this.whenInitialized$.pipe(switchMap(() => this.mapInstance$.pipe(switchMap((x) => this._renderingTimer.pipe(map(() => x.getZoom()))), shareReplay(1))));
|
|
@@ -350,6 +376,7 @@ class DbxMapboxMapStore extends ComponentStore {
|
|
|
350
376
|
this.doubleClickEvent$ = this.state$.pipe(map((x) => x.doubleClickEvent), distinctUntilChanged(), shareReplay(1));
|
|
351
377
|
this.rightClickEvent$ = this.state$.pipe(map((x) => x.rightClickEvent), distinctUntilChanged(), shareReplay(1));
|
|
352
378
|
// MARK: State Changes
|
|
379
|
+
this.setMargin = this.updater((state, margin) => (Object.assign(Object.assign({}, state), { margin: margin && (margin.rightMargin !== 0 || margin.leftMargin !== 0) ? margin : undefined })));
|
|
353
380
|
this._setMapService = this.updater((state, mapService) => ({ mapService, moveState: 'init', lifecycleState: 'init', zoomState: 'init', rotateState: 'init', retainContent: state.retainContent, content: state.retainContent ? state.content : undefined }));
|
|
354
381
|
this._setLifecycleState = this.updater((state, lifecycleState) => (Object.assign(Object.assign({}, state), { lifecycleState })));
|
|
355
382
|
this._setMoveState = this.updater((state, moveState) => (Object.assign(Object.assign({}, state), { moveState })));
|
|
@@ -400,23 +427,22 @@ class DbxMapboxMapStore extends ComponentStore {
|
|
|
400
427
|
}))));
|
|
401
428
|
}
|
|
402
429
|
calculateNextCenterOffsetWithScreenMarginChange(sizing) {
|
|
403
|
-
return this.atNextIdle().pipe(switchMap(() => this.bound$.pipe(
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
})))));
|
|
430
|
+
return this.atNextIdle().pipe(switchMap(() => this.bound$.pipe(first(), map((bounds) => {
|
|
431
|
+
const diff = diffLatLngBoundPoints(bounds);
|
|
432
|
+
const center = latLngBoundCenterPoint(bounds);
|
|
433
|
+
const offsetWidth = sizing.leftMargin + sizing.rightMargin; // 300 + 0
|
|
434
|
+
const newWidth = sizing.fullWidth - offsetWidth; // 1000 - 300 - 0
|
|
435
|
+
const newWidthRatio = newWidth / sizing.fullWidth; // 700 / 1000
|
|
436
|
+
const newCenterLongitudeWidth = diff.lng * newWidthRatio; // 70% offset
|
|
437
|
+
const effectiveOffset = {
|
|
438
|
+
lat: 0,
|
|
439
|
+
lng: newCenterLongitudeWidth / 2
|
|
440
|
+
};
|
|
441
|
+
const newCenter = addLatLngPoints(bounds.sw, effectiveOffset);
|
|
442
|
+
newCenter.lat = center.lat; // retain center position
|
|
443
|
+
// console.log({ sizing, bounds, effectiveOffset, newWidth, offsetWidth, diff, center, newCenter });
|
|
444
|
+
return newCenter;
|
|
445
|
+
}))));
|
|
420
446
|
}
|
|
421
447
|
}
|
|
422
448
|
DbxMapboxMapStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxMapStore, deps: [{ token: DbxMapboxService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -501,11 +527,13 @@ class DbxMapboxLayoutComponent extends SubscriptionObject {
|
|
|
501
527
|
this._resized = new Subject();
|
|
502
528
|
this._updateMargins = new Subject();
|
|
503
529
|
this._forceHasContent = new BehaviorSubject(false);
|
|
530
|
+
this._mode = new BehaviorSubject('side');
|
|
504
531
|
this._side = new BehaviorSubject('right');
|
|
505
532
|
this._openToggle = new BehaviorSubject(true);
|
|
506
533
|
this._color = new BehaviorSubject(undefined);
|
|
507
534
|
this._toggleSub = new SubscriptionObject();
|
|
508
535
|
this.side$ = this._side.pipe(distinctUntilChanged(), shareReplay(1));
|
|
536
|
+
this.mode$ = this._mode.pipe(distinctUntilChanged(), shareReplay(1));
|
|
509
537
|
this.hasContent$ = combineLatest([this._forceHasContent, this.dbxMapboxMapStore.hasContent$]).pipe(map(([hasContent, forceHasContent]) => hasContent || forceHasContent), distinctUntilChanged(), shareReplay(1));
|
|
510
538
|
this.opened$ = combineLatest([this.hasContent$, this._openToggle]).pipe(map(([hasContent, open]) => hasContent && open), distinctUntilChanged(), shareReplay(1));
|
|
511
539
|
this.position$ = this.side$.pipe(map((x) => (x === 'right' ? 'end' : 'start')), distinctUntilChanged(), shareReplay(1));
|
|
@@ -535,27 +563,47 @@ class DbxMapboxLayoutComponent extends SubscriptionObject {
|
|
|
535
563
|
}
|
|
536
564
|
});
|
|
537
565
|
});
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
right = this.container._contentMargins
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
566
|
+
let init = false;
|
|
567
|
+
this._toggleSub.subscription = this.mode$
|
|
568
|
+
.pipe(switchMap((mode) => {
|
|
569
|
+
let obs;
|
|
570
|
+
if (mode === 'push') {
|
|
571
|
+
obs = combineLatest([this.opened$.pipe(distinctUntilChanged()), this._updateMargins]).pipe(tap(([opened]) => {
|
|
572
|
+
let { right } = this.container._contentMargins;
|
|
573
|
+
this.container.updateContentMargins();
|
|
574
|
+
setTimeout(() => {
|
|
575
|
+
const flip = opened ? 1 : -1;
|
|
576
|
+
if (opened) {
|
|
577
|
+
right = this.container._contentMargins.right;
|
|
578
|
+
}
|
|
579
|
+
right = (right || 0) * flip;
|
|
580
|
+
const element = this.content.nativeElement;
|
|
581
|
+
const width = element.clientWidth;
|
|
582
|
+
const margin = {
|
|
583
|
+
leftMargin: 0,
|
|
584
|
+
rightMargin: right,
|
|
585
|
+
fullWidth: width
|
|
586
|
+
};
|
|
587
|
+
const easeTo = this.dbxMapboxMapStore.calculateNextCenterOffsetWithScreenMarginChange(margin).pipe(first(), map((center) => ({ to: { center, duration: 3200, essential: false } })));
|
|
588
|
+
this.dbxMapboxMapStore.setMargin(opened ? margin : undefined);
|
|
589
|
+
if (!init) {
|
|
590
|
+
this.dbxMapboxMapStore.easeTo(easeTo);
|
|
591
|
+
}
|
|
592
|
+
else {
|
|
593
|
+
init = true;
|
|
594
|
+
}
|
|
595
|
+
});
|
|
596
|
+
}));
|
|
597
|
+
}
|
|
598
|
+
else {
|
|
599
|
+
obs = combineLatest([this.opened$.pipe(distinctUntilChanged()), this._updateMargins]).pipe(switchMap((_) => this.dbxMapboxMapStore.mapInstance$), tap((x) => {
|
|
600
|
+
this.container.updateContentMargins();
|
|
601
|
+
x.triggerRepaint();
|
|
602
|
+
}));
|
|
603
|
+
}
|
|
604
|
+
return obs;
|
|
605
|
+
}))
|
|
606
|
+
.subscribe();
|
|
559
607
|
}
|
|
560
608
|
ngOnDestroy() {
|
|
561
609
|
this._resized.complete();
|
|
@@ -577,6 +625,11 @@ class DbxMapboxLayoutComponent extends SubscriptionObject {
|
|
|
577
625
|
this._side.next(side);
|
|
578
626
|
}
|
|
579
627
|
}
|
|
628
|
+
set mode(mode) {
|
|
629
|
+
if (mode != null) {
|
|
630
|
+
this._mode.next(mode);
|
|
631
|
+
}
|
|
632
|
+
}
|
|
580
633
|
set opened(opened) {
|
|
581
634
|
if (opened != null) {
|
|
582
635
|
this._openToggle.next(opened);
|
|
@@ -595,10 +648,10 @@ class DbxMapboxLayoutComponent extends SubscriptionObject {
|
|
|
595
648
|
}
|
|
596
649
|
}
|
|
597
650
|
DbxMapboxLayoutComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxLayoutComponent, deps: [{ token: DbxMapboxMapStore }], target: i0.ɵɵFactoryTarget.Component });
|
|
598
|
-
DbxMapboxLayoutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.2", type: DbxMapboxLayoutComponent, selector: "dbx-mapbox-layout", inputs: { side: "side", 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=\"
|
|
651
|
+
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: i2$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: i2$1.AsyncPipe, name: "async" }] });
|
|
599
652
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxLayoutComponent, decorators: [{
|
|
600
653
|
type: Component,
|
|
601
|
-
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=\"
|
|
654
|
+
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"] }]
|
|
602
655
|
}], ctorParameters: function () { return [{ type: DbxMapboxMapStore }]; }, propDecorators: { container: [{
|
|
603
656
|
type: ViewChild,
|
|
604
657
|
args: [MatDrawerContainer]
|
|
@@ -607,6 +660,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImpor
|
|
|
607
660
|
args: ['content', { read: ElementRef, static: true }]
|
|
608
661
|
}], side: [{
|
|
609
662
|
type: Input
|
|
663
|
+
}], mode: [{
|
|
664
|
+
type: Input
|
|
610
665
|
}], opened: [{
|
|
611
666
|
type: Input
|
|
612
667
|
}], hasContent: [{
|
|
@@ -755,12 +810,102 @@ function provideMapboxStoreIfParentIsUnavailable() {
|
|
|
755
810
|
};
|
|
756
811
|
}
|
|
757
812
|
|
|
813
|
+
class DbxMapboxMarkerComponent {
|
|
814
|
+
constructor() { }
|
|
815
|
+
get marker() {
|
|
816
|
+
return this._marker;
|
|
817
|
+
}
|
|
818
|
+
set marker(marker) {
|
|
819
|
+
this._marker = marker;
|
|
820
|
+
}
|
|
821
|
+
get latLng() {
|
|
822
|
+
var _a;
|
|
823
|
+
return (_a = this._marker) === null || _a === void 0 ? void 0 : _a.latLng;
|
|
824
|
+
}
|
|
825
|
+
get anchor() {
|
|
826
|
+
var _a;
|
|
827
|
+
return (_a = this._marker) === null || _a === void 0 ? void 0 : _a.anchor;
|
|
828
|
+
}
|
|
829
|
+
get label() {
|
|
830
|
+
var _a;
|
|
831
|
+
return (_a = this._marker) === null || _a === void 0 ? void 0 : _a.label;
|
|
832
|
+
}
|
|
833
|
+
get icon() {
|
|
834
|
+
var _a;
|
|
835
|
+
return (_a = this._marker) === null || _a === void 0 ? void 0 : _a.icon;
|
|
836
|
+
}
|
|
837
|
+
get style() {
|
|
838
|
+
var _a, _b, _c;
|
|
839
|
+
let width = 0;
|
|
840
|
+
let height = 0;
|
|
841
|
+
const size = ((_a = this._marker) === null || _a === void 0 ? void 0 : _a.size) || 'medium';
|
|
842
|
+
if (typeof size === 'number') {
|
|
843
|
+
width = size;
|
|
844
|
+
}
|
|
845
|
+
else {
|
|
846
|
+
switch (size) {
|
|
847
|
+
case 'small':
|
|
848
|
+
width = 18;
|
|
849
|
+
break;
|
|
850
|
+
case 'medium':
|
|
851
|
+
width = 24;
|
|
852
|
+
break;
|
|
853
|
+
case 'large':
|
|
854
|
+
width = 32;
|
|
855
|
+
break;
|
|
856
|
+
case 'tall':
|
|
857
|
+
width = 24;
|
|
858
|
+
height = 32;
|
|
859
|
+
break;
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
if (!height) {
|
|
863
|
+
height = width;
|
|
864
|
+
}
|
|
865
|
+
const imageInput = (_b = this._marker) === null || _b === void 0 ? void 0 : _b.image;
|
|
866
|
+
const image = imageInput ? (typeof imageInput === 'string' ? imageInput : getValueFromGetter(imageInput, width)) : undefined;
|
|
867
|
+
let style = Object.assign(Object.assign({}, (_c = this._marker) === null || _c === void 0 ? void 0 : _c.style), { width: width + 'px', height: height + 'px', 'font-size': width + 'px', 'background-image': image });
|
|
868
|
+
return style;
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
DbxMapboxMarkerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxMarkerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
872
|
+
DbxMapboxMarkerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.2", type: DbxMapboxMarkerComponent, selector: "dbx-mapbox-marker", inputs: { marker: "marker" }, ngImport: i0, template: `
|
|
873
|
+
<mgl-marker *ngIf="marker" [lngLat]="latLng">
|
|
874
|
+
<dbx-anchor [anchor]="anchor">
|
|
875
|
+
<div class="dbx-mapbox-marker">
|
|
876
|
+
<div class="dbx-mapbox-marker-content" [ngStyle]="style">
|
|
877
|
+
<mat-icon *ngIf="icon">{{ icon }}</mat-icon>
|
|
878
|
+
</div>
|
|
879
|
+
<div class="dbx-mapbox-marker-label" *ngIf="label">{{ label }}</div>
|
|
880
|
+
</div>
|
|
881
|
+
</dbx-anchor>
|
|
882
|
+
</mgl-marker>
|
|
883
|
+
`, isInline: true, styles: [".dbx-mapbox-marker{display:flex;align-items:center;flex-direction:column;font-weight:700}.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}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$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 });
|
|
884
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxMarkerComponent, decorators: [{
|
|
885
|
+
type: Component,
|
|
886
|
+
args: [{ selector: 'dbx-mapbox-marker', template: `
|
|
887
|
+
<mgl-marker *ngIf="marker" [lngLat]="latLng">
|
|
888
|
+
<dbx-anchor [anchor]="anchor">
|
|
889
|
+
<div class="dbx-mapbox-marker">
|
|
890
|
+
<div class="dbx-mapbox-marker-content" [ngStyle]="style">
|
|
891
|
+
<mat-icon *ngIf="icon">{{ icon }}</mat-icon>
|
|
892
|
+
</div>
|
|
893
|
+
<div class="dbx-mapbox-marker-label" *ngIf="label">{{ label }}</div>
|
|
894
|
+
</div>
|
|
895
|
+
</dbx-anchor>
|
|
896
|
+
</mgl-marker>
|
|
897
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".dbx-mapbox-marker{display:flex;align-items:center;flex-direction:column;font-weight:700}.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}\n"] }]
|
|
898
|
+
}], ctorParameters: function () { return []; }, propDecorators: { marker: [{
|
|
899
|
+
type: Input
|
|
900
|
+
}] } });
|
|
901
|
+
|
|
758
902
|
const declarations = [
|
|
759
903
|
//
|
|
760
904
|
DbxMapboxMapDirective,
|
|
761
905
|
DbxMapboxLayoutComponent,
|
|
762
906
|
DbxMapboxLayoutDrawerComponent,
|
|
763
907
|
DbxMapboxMenuComponent,
|
|
908
|
+
DbxMapboxMarkerComponent,
|
|
764
909
|
DbxMapboxMapStoreInjectionBlockDirective
|
|
765
910
|
];
|
|
766
911
|
class DbxMapboxModule {
|
|
@@ -783,6 +928,7 @@ DbxMapboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version
|
|
|
783
928
|
DbxMapboxLayoutComponent,
|
|
784
929
|
DbxMapboxLayoutDrawerComponent,
|
|
785
930
|
DbxMapboxMenuComponent,
|
|
931
|
+
DbxMapboxMarkerComponent,
|
|
786
932
|
DbxMapboxMapStoreInjectionBlockDirective
|
|
787
933
|
], imports: [
|
|
788
934
|
//
|
|
@@ -791,13 +937,16 @@ DbxMapboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version
|
|
|
791
937
|
DbxInjectionComponentModule,
|
|
792
938
|
MatButtonModule,
|
|
793
939
|
MatIconModule,
|
|
794
|
-
AngularResizeEventModule
|
|
940
|
+
AngularResizeEventModule,
|
|
941
|
+
DbxRouterAnchorModule,
|
|
942
|
+
NgxMapboxGLModule
|
|
795
943
|
], exports: [
|
|
796
944
|
//
|
|
797
945
|
DbxMapboxMapDirective,
|
|
798
946
|
DbxMapboxLayoutComponent,
|
|
799
947
|
DbxMapboxLayoutDrawerComponent,
|
|
800
948
|
DbxMapboxMenuComponent,
|
|
949
|
+
DbxMapboxMarkerComponent,
|
|
801
950
|
DbxMapboxMapStoreInjectionBlockDirective
|
|
802
951
|
] });
|
|
803
952
|
DbxMapboxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxModule, imports: [
|
|
@@ -807,7 +956,9 @@ DbxMapboxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version
|
|
|
807
956
|
DbxInjectionComponentModule,
|
|
808
957
|
MatButtonModule,
|
|
809
958
|
MatIconModule,
|
|
810
|
-
AngularResizeEventModule
|
|
959
|
+
AngularResizeEventModule,
|
|
960
|
+
DbxRouterAnchorModule,
|
|
961
|
+
NgxMapboxGLModule
|
|
811
962
|
] });
|
|
812
963
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxModule, decorators: [{
|
|
813
964
|
type: NgModule,
|
|
@@ -819,7 +970,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImpor
|
|
|
819
970
|
DbxInjectionComponentModule,
|
|
820
971
|
MatButtonModule,
|
|
821
972
|
MatIconModule,
|
|
822
|
-
AngularResizeEventModule
|
|
973
|
+
AngularResizeEventModule,
|
|
974
|
+
DbxRouterAnchorModule,
|
|
975
|
+
NgxMapboxGLModule
|
|
823
976
|
],
|
|
824
977
|
declarations,
|
|
825
978
|
exports: declarations
|
|
@@ -847,5 +1000,5 @@ function mapboxZoomLevel(input) {
|
|
|
847
1000
|
* Generated bundle index. Do not edit.
|
|
848
1001
|
*/
|
|
849
1002
|
|
|
850
|
-
export { DEFAULT_MAPBOX_CENTER, DEFAULT_MAPBOX_MAP_STORE_TIMER_REFRESH_PERIOD, DEFAULT_MAPBOX_STYLE, DEFAULT_MAPBOX_ZOOM, DbxMapboxConfig, DbxMapboxLayoutComponent, DbxMapboxLayoutDrawerComponent, DbxMapboxMapDirective, DbxMapboxMapStore, DbxMapboxMapStoreInjectionBlockDirective, DbxMapboxMapStoreProviderBlock, DbxMapboxMenuComponent, DbxMapboxModule, DbxMapboxService, KNOWN_MAPBOX_STYLES, MAPBOX_MAX_ZOOM_LEVEL, MAPBOX_MIN_ZOOM_LEVEL, mapboxZoomLevel, provideMapboxStoreIfParentIsUnavailable };
|
|
1003
|
+
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 };
|
|
851
1004
|
//# sourceMappingURL=dereekb-dbx-web-mapbox.mjs.map
|