@dereekb/dbx-web 9.2.0 → 9.3.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.
- package/esm2020/lib/layout/column/two/two.column.head.component.mjs +3 -3
- package/esm2020/mapbox/dereekb-dbx-web-mapbox.mjs +5 -0
- package/esm2020/mapbox/index.mjs +2 -0
- package/esm2020/mapbox/lib/index.mjs +7 -0
- package/esm2020/mapbox/lib/mapbox.mjs +12 -0
- package/esm2020/mapbox/lib/mapbox.module.mjs +30 -0
- package/esm2020/mapbox/lib/mapbox.service.mjs +36 -0
- package/esm2020/mapbox/lib/mapbox.store.map.directive.mjs +50 -0
- package/esm2020/mapbox/lib/mapbox.store.mjs +283 -0
- package/esm2020/mapbox/lib/options.mjs +2 -0
- package/fesm2015/dereekb-dbx-web-mapbox.mjs +415 -0
- package/fesm2015/dereekb-dbx-web-mapbox.mjs.map +1 -0
- package/fesm2015/dereekb-dbx-web.mjs +2 -2
- package/fesm2015/dereekb-dbx-web.mjs.map +1 -1
- package/fesm2020/dereekb-dbx-web-mapbox.mjs +402 -0
- package/fesm2020/dereekb-dbx-web-mapbox.mjs.map +1 -0
- package/fesm2020/dereekb-dbx-web.mjs +2 -2
- package/fesm2020/dereekb-dbx-web.mjs.map +1 -1
- package/lib/layout/style/_style.scss +13 -4
- package/mapbox/README.md +6 -0
- package/mapbox/esm2020/dereekb-dbx-web-mapbox.mjs +5 -0
- package/mapbox/esm2020/index.mjs +2 -0
- package/mapbox/esm2020/lib/index.mjs +7 -0
- package/mapbox/esm2020/lib/mapbox.mjs +12 -0
- package/mapbox/esm2020/lib/mapbox.module.mjs +30 -0
- package/mapbox/esm2020/lib/mapbox.service.mjs +36 -0
- package/mapbox/esm2020/lib/mapbox.store.map.directive.mjs +50 -0
- package/mapbox/esm2020/lib/mapbox.store.mjs +283 -0
- package/mapbox/esm2020/lib/options.mjs +2 -0
- package/mapbox/fesm2015/dereekb-dbx-web-mapbox.mjs +415 -0
- package/mapbox/fesm2015/dereekb-dbx-web-mapbox.mjs.map +1 -0
- package/mapbox/fesm2020/dereekb-dbx-web-mapbox.mjs +402 -0
- package/mapbox/fesm2020/dereekb-dbx-web-mapbox.mjs.map +1 -0
- package/mapbox/index.d.ts +1 -0
- package/mapbox/lib/index.d.ts +6 -0
- package/mapbox/lib/mapbox.d.ts +59 -0
- package/mapbox/lib/mapbox.module.d.ts +11 -0
- package/mapbox/lib/mapbox.service.d.ts +24 -0
- package/mapbox/lib/mapbox.store.d.ts +114 -0
- package/mapbox/lib/mapbox.store.map.directive.d.ts +18 -0
- package/mapbox/lib/options.d.ts +7 -0
- package/mapbox/package.json +36 -0
- package/package.json +11 -3
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, Optional, Inject, Directive, Host, NgModule } from '@angular/core';
|
|
3
|
+
import { CommonModule } from '@angular/common';
|
|
4
|
+
import { cleanup, filterMaybe, onTrueToFalse } from '@dereekb/rxjs';
|
|
5
|
+
import { latLngPointFunction, latLngBoundFunction, isSameLatLngPoint, isSameLatLngBound, isWithinLatLngBoundFunction, overlapsLatLngBoundFunction, latLngTuple } from '@dereekb/util';
|
|
6
|
+
import { ComponentStore } from '@ngrx/component-store';
|
|
7
|
+
import { switchMap, NEVER, defaultIfEmpty, map, tap, distinctUntilChanged, shareReplay, of, combineLatest, filter, first, startWith, interval } from 'rxjs';
|
|
8
|
+
import * as MapboxGl from 'mapbox-gl';
|
|
9
|
+
import * as i1 from 'ngx-mapbox-gl';
|
|
10
|
+
|
|
11
|
+
class DbxMapboxConfig {
|
|
12
|
+
}
|
|
13
|
+
const DEFAULT_MAPBOX_STYLE = 'mapbox://styles/mapbox/streets-v11';
|
|
14
|
+
const DEFAULT_MAPBOX_CENTER = [30.2690138665, -97.7408297965];
|
|
15
|
+
const DEFAULT_MAPBOX_ZOOM = 12;
|
|
16
|
+
const DEFAULT_MAPBOX_MAP_STORE_TIMER_REFRESH_PERIOD = 200;
|
|
17
|
+
class DbxMapboxService {
|
|
18
|
+
constructor(config) {
|
|
19
|
+
this._config = config ?? {};
|
|
20
|
+
}
|
|
21
|
+
get defaultStyle() {
|
|
22
|
+
return this._config.defaultStyle ?? DEFAULT_MAPBOX_STYLE;
|
|
23
|
+
}
|
|
24
|
+
get defaultZoom() {
|
|
25
|
+
return this._config.defaultZoom ?? DEFAULT_MAPBOX_ZOOM;
|
|
26
|
+
}
|
|
27
|
+
get defaultCenter() {
|
|
28
|
+
return this._config.defaultCenter ?? DEFAULT_MAPBOX_CENTER;
|
|
29
|
+
}
|
|
30
|
+
get mapboxMapStoreTimerRefreshPeriod() {
|
|
31
|
+
return this._config.defaultStoreRefreshPeriod ?? DEFAULT_MAPBOX_MAP_STORE_TIMER_REFRESH_PERIOD;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
DbxMapboxService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxService, deps: [{ token: DbxMapboxConfig, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
35
|
+
DbxMapboxService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxService, providedIn: 'root' });
|
|
36
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxService, decorators: [{
|
|
37
|
+
type: Injectable,
|
|
38
|
+
args: [{
|
|
39
|
+
providedIn: 'root'
|
|
40
|
+
}]
|
|
41
|
+
}], ctorParameters: function () { return [{ type: DbxMapboxConfig, decorators: [{
|
|
42
|
+
type: Optional
|
|
43
|
+
}] }]; } });
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Store used for retrieving information.
|
|
47
|
+
*/
|
|
48
|
+
class DbxMapboxMapStore extends ComponentStore {
|
|
49
|
+
constructor(dbxMapboxService) {
|
|
50
|
+
super({
|
|
51
|
+
lifecycleState: 'init',
|
|
52
|
+
moveState: 'init',
|
|
53
|
+
zoomState: 'init',
|
|
54
|
+
rotateState: 'init'
|
|
55
|
+
});
|
|
56
|
+
this.dbxMapboxService = dbxMapboxService;
|
|
57
|
+
this.latLngPoint = latLngPointFunction();
|
|
58
|
+
this.latLngBound = latLngBoundFunction();
|
|
59
|
+
// MARK: Effects
|
|
60
|
+
this.setMapService = this.effect((input) => {
|
|
61
|
+
return input.pipe(switchMap((service) => {
|
|
62
|
+
this._setMapService(service);
|
|
63
|
+
if (!service) {
|
|
64
|
+
return NEVER;
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
return service.mapLoaded$.pipe(defaultIfEmpty(undefined), map(() => {
|
|
68
|
+
this._setLifecycleState('idle');
|
|
69
|
+
this._setMoveState('idle');
|
|
70
|
+
this._setZoomState('idle');
|
|
71
|
+
this._setRotateState('idle');
|
|
72
|
+
const map = service.mapInstance;
|
|
73
|
+
const listenerPairs = [];
|
|
74
|
+
function addListener(type, listener) {
|
|
75
|
+
map.on(type, listener);
|
|
76
|
+
listenerPairs.push({ type, listener });
|
|
77
|
+
}
|
|
78
|
+
addListener('idle', () => this._setLifecycleState('idle'));
|
|
79
|
+
addListener('render', () => this._setLifecycleState('render'));
|
|
80
|
+
addListener('error', (x) => {
|
|
81
|
+
this._setError(x.error);
|
|
82
|
+
});
|
|
83
|
+
addListener('movestart', () => this._setMoveState('moving'));
|
|
84
|
+
addListener('moveend', () => this._setMoveState('idle'));
|
|
85
|
+
addListener('zoomstart', () => this._setZoomState('zooming'));
|
|
86
|
+
addListener('zoomend', () => this._setZoomState('idle'));
|
|
87
|
+
addListener('rotatestart', () => this._setRotateState('rotating'));
|
|
88
|
+
addListener('rotateend', () => this._setRotateState('idle'));
|
|
89
|
+
addListener('click', (x) => this._setClickEvent(x));
|
|
90
|
+
addListener('dblclick', (x) => this._setDoubleClickEvent(x));
|
|
91
|
+
const subs = [];
|
|
92
|
+
return {
|
|
93
|
+
service,
|
|
94
|
+
listenerPairs,
|
|
95
|
+
subs
|
|
96
|
+
};
|
|
97
|
+
}));
|
|
98
|
+
}
|
|
99
|
+
}), cleanup(({ service, listenerPairs, subs }) => {
|
|
100
|
+
const map = service.mapInstance;
|
|
101
|
+
if (map) {
|
|
102
|
+
listenerPairs.forEach((x) => {
|
|
103
|
+
map.off(x.type, x.listener);
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
subs.forEach((sub) => sub.unsubscribe());
|
|
107
|
+
}));
|
|
108
|
+
});
|
|
109
|
+
this.setStyle = this.effect((input) => {
|
|
110
|
+
return input.pipe(switchMap((style) => {
|
|
111
|
+
return this.mapInstance$.pipe(tap((map) => {
|
|
112
|
+
if (typeof style === 'string') {
|
|
113
|
+
map.setStyle(style);
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
map.setStyle(style.style, style.options);
|
|
117
|
+
}
|
|
118
|
+
}));
|
|
119
|
+
}));
|
|
120
|
+
});
|
|
121
|
+
this.setCenter = this.effect((input) => {
|
|
122
|
+
return input.pipe(switchMap((center) => {
|
|
123
|
+
const centerPoint = this.latLngPoint(center);
|
|
124
|
+
return this.mapInstance$.pipe(tap((map) => map.setCenter(centerPoint)));
|
|
125
|
+
}));
|
|
126
|
+
});
|
|
127
|
+
this.setZoom = this.effect((input) => {
|
|
128
|
+
return input.pipe(switchMap((zoom) => {
|
|
129
|
+
return this.mapInstance$.pipe(tap((map) => map.setZoom(zoom)));
|
|
130
|
+
}));
|
|
131
|
+
});
|
|
132
|
+
this.setMinZoom = this.effect((input) => {
|
|
133
|
+
return input.pipe(switchMap((zoom) => {
|
|
134
|
+
return this.mapInstance$.pipe(tap((map) => map.setMinZoom(zoom)));
|
|
135
|
+
}));
|
|
136
|
+
});
|
|
137
|
+
this.setMaxZoom = this.effect((input) => {
|
|
138
|
+
return input.pipe(switchMap((zoom) => {
|
|
139
|
+
return this.mapInstance$.pipe(tap((map) => map.setMaxZoom(zoom)));
|
|
140
|
+
}));
|
|
141
|
+
});
|
|
142
|
+
this.setPitch = this.effect((input) => {
|
|
143
|
+
return input.pipe(switchMap((pitch) => {
|
|
144
|
+
return this.mapInstance$.pipe(tap((map) => map.setPitch(pitch)));
|
|
145
|
+
}));
|
|
146
|
+
});
|
|
147
|
+
this.setMinPitch = this.effect((input) => {
|
|
148
|
+
return input.pipe(switchMap((pitch) => {
|
|
149
|
+
return this.mapInstance$.pipe(tap((map) => map.setMinPitch(pitch)));
|
|
150
|
+
}));
|
|
151
|
+
});
|
|
152
|
+
this.setMaxPitch = this.effect((input) => {
|
|
153
|
+
return input.pipe(switchMap((pitch) => {
|
|
154
|
+
return this.mapInstance$.pipe(tap((map) => map.setMaxPitch(pitch)));
|
|
155
|
+
}));
|
|
156
|
+
});
|
|
157
|
+
this.setBearing = this.effect((input) => {
|
|
158
|
+
return input.pipe(switchMap((bearing) => {
|
|
159
|
+
return this.mapInstance$.pipe(tap((map) => map.setBearing(bearing)));
|
|
160
|
+
}));
|
|
161
|
+
});
|
|
162
|
+
this.rotateTo = this.effect((input) => {
|
|
163
|
+
return input.pipe(switchMap((rotateInput) => {
|
|
164
|
+
const rotate = typeof rotateInput === 'number' ? { bearing: rotateInput } : rotateInput;
|
|
165
|
+
return this.mapInstance$.pipe(tap((map) => map.rotateTo(rotate.bearing, rotate.options, rotate?.eventData)));
|
|
166
|
+
}));
|
|
167
|
+
});
|
|
168
|
+
this.resetNorth = this.effect((input) => {
|
|
169
|
+
return input.pipe(switchMap((reset) => {
|
|
170
|
+
return this.mapInstance$.pipe(tap((map) => map.resetNorth(reset?.options, reset?.eventData)));
|
|
171
|
+
}));
|
|
172
|
+
});
|
|
173
|
+
this.resetNorthPitch = this.effect((input) => {
|
|
174
|
+
return input.pipe(switchMap((reset) => {
|
|
175
|
+
return this.mapInstance$.pipe(tap((map) => map.resetNorthPitch(reset?.options, reset?.eventData)));
|
|
176
|
+
}));
|
|
177
|
+
});
|
|
178
|
+
this.snapToNorth = this.effect((input) => {
|
|
179
|
+
return input.pipe(switchMap((snap) => {
|
|
180
|
+
return this.mapInstance$.pipe(tap((map) => map.snapToNorth(snap?.options, snap?.eventData)));
|
|
181
|
+
}));
|
|
182
|
+
});
|
|
183
|
+
this.fitBounds = this.effect((input) => {
|
|
184
|
+
return input.pipe(switchMap((x) => {
|
|
185
|
+
const bound = this.latLngBound(x.bounds);
|
|
186
|
+
return this.mapInstance$.pipe(tap((map) => map.fitBounds(new MapboxGl.LngLatBounds(bound.sw, bound.ne), x.options, x.eventData)));
|
|
187
|
+
}));
|
|
188
|
+
});
|
|
189
|
+
this.jumpTo = this.effect((input) => {
|
|
190
|
+
return input.pipe(switchMap((x) => {
|
|
191
|
+
const inputCenter = x.center ?? x.to?.center;
|
|
192
|
+
const center = inputCenter ? this.latLngPoint(inputCenter) : undefined;
|
|
193
|
+
return this.mapInstance$.pipe(tap((map) => map.jumpTo({ ...x.to, center }, x.eventData)));
|
|
194
|
+
}));
|
|
195
|
+
});
|
|
196
|
+
this.easeTo = this.effect((input) => {
|
|
197
|
+
return input.pipe(switchMap((x) => {
|
|
198
|
+
const inputCenter = x.center ?? x.to?.center;
|
|
199
|
+
const center = inputCenter ? this.latLngPoint(inputCenter) : undefined;
|
|
200
|
+
return this.mapInstance$.pipe(tap((map) => map.easeTo({ ...x.to, center }, x.eventData)));
|
|
201
|
+
}));
|
|
202
|
+
});
|
|
203
|
+
this.flyTo = this.effect((input) => {
|
|
204
|
+
return input.pipe(switchMap((x) => {
|
|
205
|
+
const inputCenter = x.center ?? x.to?.center;
|
|
206
|
+
const center = inputCenter ? this.latLngPoint(inputCenter) : undefined;
|
|
207
|
+
return this.mapInstance$.pipe(tap((map) => map.flyTo({ ...x.to, center }, x.eventData)));
|
|
208
|
+
}));
|
|
209
|
+
});
|
|
210
|
+
this.resetPitchAndBearing = this.effect((input) => {
|
|
211
|
+
return input.pipe(switchMap(() => {
|
|
212
|
+
return this.mapInstance$.pipe(tap((map) => {
|
|
213
|
+
map.setPitch(0);
|
|
214
|
+
map.setBearing(0);
|
|
215
|
+
}));
|
|
216
|
+
}));
|
|
217
|
+
});
|
|
218
|
+
this.currentMapService$ = this.state$.pipe(map((x) => x.mapService), distinctUntilChanged(), shareReplay(1));
|
|
219
|
+
this.mapService$ = this.currentMapService$.pipe(filterMaybe());
|
|
220
|
+
this.currentMapInstance$ = this.currentMapService$.pipe(switchMap((currentMapService) => {
|
|
221
|
+
if (currentMapService) {
|
|
222
|
+
return currentMapService.mapLoaded$.pipe(defaultIfEmpty(undefined), map(() => currentMapService.mapInstance));
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
return of(undefined);
|
|
226
|
+
}
|
|
227
|
+
}), distinctUntilChanged(), shareReplay(1));
|
|
228
|
+
this.mapInstance$ = this.currentMapInstance$.pipe(filterMaybe());
|
|
229
|
+
this.moveState$ = this.state$.pipe(map((x) => x.moveState), distinctUntilChanged(), shareReplay(1));
|
|
230
|
+
this.lifecycleState$ = this.state$.pipe(map((x) => x.lifecycleState), distinctUntilChanged(), shareReplay(1));
|
|
231
|
+
this.zoomState$ = this.state$.pipe(map((x) => x.zoomState), distinctUntilChanged(), shareReplay(1));
|
|
232
|
+
this.rotateState$ = this.state$.pipe(map((x) => x.rotateState), distinctUntilChanged(), shareReplay(1));
|
|
233
|
+
this.isInitialized$ = this.currentMapInstance$.pipe(switchMap((x) => {
|
|
234
|
+
if (!x) {
|
|
235
|
+
return of(false);
|
|
236
|
+
}
|
|
237
|
+
else {
|
|
238
|
+
return combineLatest([this.moveState$.pipe(map((x) => x === 'idle')), this.lifecycleState$.pipe(map((x) => x === 'idle'))]).pipe(filter(([m, l]) => m && l), first(), map(() => true));
|
|
239
|
+
}
|
|
240
|
+
}), shareReplay(1));
|
|
241
|
+
this.whenInitialized$ = this.isInitialized$.pipe(filter((x) => true), shareReplay(1));
|
|
242
|
+
this.isRendering$ = this.whenInitialized$.pipe(switchMap(() => this.lifecycleState$.pipe(map((x) => x === 'render'), distinctUntilChanged(), shareReplay())));
|
|
243
|
+
this.isMoving$ = this.whenInitialized$.pipe(switchMap(() => this.moveState$.pipe(map((x) => x === 'moving'), distinctUntilChanged(), shareReplay())));
|
|
244
|
+
this.isZooming$ = this.whenInitialized$.pipe(switchMap(() => this.zoomState$.pipe(map((x) => x === 'zooming'), distinctUntilChanged(), shareReplay())));
|
|
245
|
+
this.isRotating$ = this.whenInitialized$.pipe(switchMap(() => this.rotateState$.pipe(map((x) => x === 'rotating'), distinctUntilChanged(), shareReplay())));
|
|
246
|
+
this._movingTimer = this.movingTimer();
|
|
247
|
+
this._renderingTimer = this.lifecycleRenderTimer();
|
|
248
|
+
this.centerNow$ = this.whenInitialized$.pipe(switchMap(() => this.mapInstance$.pipe(switchMap((x) => this._movingTimer.pipe(map(() => this.latLngPoint(x.getCenter())))), shareReplay(1))));
|
|
249
|
+
this.center$ = this.whenInitialized$.pipe(switchMap(() => {
|
|
250
|
+
return this.isMoving$.pipe(onTrueToFalse(), startWith(undefined), switchMap(() => this.centerNow$.pipe(first())), distinctUntilChanged(isSameLatLngPoint), shareReplay(1));
|
|
251
|
+
}));
|
|
252
|
+
this.boundNow$ = this.whenInitialized$.pipe(switchMap(() => this.mapInstance$.pipe(switchMap((x) => this._renderingTimer.pipe(map(() => {
|
|
253
|
+
const bound = x.getBounds();
|
|
254
|
+
return this.latLngBound([bound.getSouthWest(), bound.getNorthEast()]);
|
|
255
|
+
}))), shareReplay(1))));
|
|
256
|
+
this.bound$ = this.whenInitialized$.pipe(switchMap(() => {
|
|
257
|
+
return this.isRendering$.pipe(onTrueToFalse(), startWith(undefined), switchMap((x) => this.boundNow$.pipe(first())), distinctUntilChanged(isSameLatLngBound), shareReplay(1));
|
|
258
|
+
}));
|
|
259
|
+
this.isWithinBoundFunction$ = this.bound$.pipe(map((x) => isWithinLatLngBoundFunction(x)), shareReplay(1));
|
|
260
|
+
this.overlapsBoundFunction$ = this.bound$.pipe(map((x) => overlapsLatLngBoundFunction(x)), shareReplay(1));
|
|
261
|
+
this.zoomNow$ = this.whenInitialized$.pipe(switchMap(() => this.mapInstance$.pipe(switchMap((x) => this._renderingTimer.pipe(map(() => x.getZoom()))), shareReplay(1))));
|
|
262
|
+
this.zoom$ = this.whenInitialized$.pipe(switchMap(() => {
|
|
263
|
+
return this.isZooming$.pipe(onTrueToFalse(), startWith(undefined), switchMap((x) => this.zoomNow$.pipe(first())), distinctUntilChanged(), shareReplay(1));
|
|
264
|
+
}));
|
|
265
|
+
this.pitchNow$ = this.whenInitialized$.pipe(switchMap(() => this.mapInstance$.pipe(switchMap((x) => this._movingTimer.pipe(map(() => x.getPitch()))), shareReplay(1))));
|
|
266
|
+
this.pitch$ = this.whenInitialized$.pipe(switchMap(() => {
|
|
267
|
+
return this.isRotating$.pipe(onTrueToFalse(), startWith(undefined), switchMap((x) => this.pitchNow$.pipe(first())), distinctUntilChanged(), shareReplay(1));
|
|
268
|
+
}));
|
|
269
|
+
this.bearingNow$ = this.whenInitialized$.pipe(switchMap(() => this.mapInstance$.pipe(switchMap((x) => this._movingTimer.pipe(map(() => x.getBearing()))), shareReplay(1))));
|
|
270
|
+
this.bearing$ = this.whenInitialized$.pipe(switchMap(() => {
|
|
271
|
+
return this.isRotating$.pipe(onTrueToFalse(), startWith(undefined), switchMap((x) => this.bearingNow$.pipe(first())), distinctUntilChanged(), shareReplay(1));
|
|
272
|
+
}));
|
|
273
|
+
this.clickEvent$ = this.state$.pipe(map((x) => x.clickEvent));
|
|
274
|
+
this.doubleClickEvent$ = this.state$.pipe(map((x) => x.doubleClickEvent));
|
|
275
|
+
// MARK: State Changes
|
|
276
|
+
this._setMapService = this.updater((state, mapService) => ({ mapService, moveState: 'init', lifecycleState: 'init', zoomState: 'init', rotateState: 'init' }));
|
|
277
|
+
this._setLifecycleState = this.updater((state, lifecycleState) => ({ ...state, lifecycleState }));
|
|
278
|
+
this._setMoveState = this.updater((state, moveState) => ({ ...state, moveState }));
|
|
279
|
+
this._setZoomState = this.updater((state, zoomState) => ({ ...state, zoomState }));
|
|
280
|
+
this._setRotateState = this.updater((state, rotateState) => ({ ...state, rotateState }));
|
|
281
|
+
this._setClickEvent = this.updater((state, clickEvent) => ({ ...state, clickEvent }));
|
|
282
|
+
this._setDoubleClickEvent = this.updater((state, doubleClickEvent) => ({ ...state, doubleClickEvent }));
|
|
283
|
+
this._setError = this.updater((state, error) => ({ ...state, error }));
|
|
284
|
+
}
|
|
285
|
+
// MARK: Accessors
|
|
286
|
+
get timerRefreshPeriod() {
|
|
287
|
+
return this.dbxMapboxService.mapboxMapStoreTimerRefreshPeriod;
|
|
288
|
+
}
|
|
289
|
+
movingTimer(period = this.timerRefreshPeriod) {
|
|
290
|
+
return this.moveState$.pipe(switchMap((x) => {
|
|
291
|
+
if (x === 'moving') {
|
|
292
|
+
return interval(period);
|
|
293
|
+
}
|
|
294
|
+
else {
|
|
295
|
+
return of(0);
|
|
296
|
+
}
|
|
297
|
+
}), shareReplay());
|
|
298
|
+
}
|
|
299
|
+
lifecycleRenderTimer(period = this.timerRefreshPeriod) {
|
|
300
|
+
return this.lifecycleState$.pipe(switchMap((x) => {
|
|
301
|
+
if (x === 'render') {
|
|
302
|
+
return interval(period);
|
|
303
|
+
}
|
|
304
|
+
else {
|
|
305
|
+
return of(0);
|
|
306
|
+
}
|
|
307
|
+
}), shareReplay());
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
DbxMapboxMapStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxMapStore, deps: [{ token: DbxMapboxService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
311
|
+
DbxMapboxMapStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxMapStore });
|
|
312
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxMapStore, decorators: [{
|
|
313
|
+
type: Injectable
|
|
314
|
+
}], ctorParameters: function () { return [{ type: DbxMapboxService, decorators: [{
|
|
315
|
+
type: Inject,
|
|
316
|
+
args: [DbxMapboxService]
|
|
317
|
+
}] }]; } });
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Directive that configures a MapComponent with content from DbxMapboxService. Connects a host MapService to a parent DbxMapboxMapStore if available.
|
|
321
|
+
*/
|
|
322
|
+
class DbxMapboxMapDirective {
|
|
323
|
+
constructor(
|
|
324
|
+
//
|
|
325
|
+
mapService, mapboxMap, dbxMapboxService, dbxMapboxMapStore) {
|
|
326
|
+
this.mapService = mapService;
|
|
327
|
+
this.mapboxMap = mapboxMap;
|
|
328
|
+
this.dbxMapboxService = dbxMapboxService;
|
|
329
|
+
this.dbxMapboxMapStore = dbxMapboxMapStore;
|
|
330
|
+
}
|
|
331
|
+
ngOnInit() {
|
|
332
|
+
// style must be provided first before the map will load.
|
|
333
|
+
this.mapboxMap.style = this.dbxMapboxService.defaultStyle;
|
|
334
|
+
if (this.dbxMapboxMapStore) {
|
|
335
|
+
this.dbxMapboxMapStore.setMapService(this.mapService);
|
|
336
|
+
this.dbxMapboxMapStore.setCenter(this.dbxMapboxService.defaultCenter);
|
|
337
|
+
this.dbxMapboxMapStore.setZoom(this.dbxMapboxService.defaultZoom);
|
|
338
|
+
}
|
|
339
|
+
else {
|
|
340
|
+
this.mapboxMap.zoom = [this.dbxMapboxService.defaultZoom];
|
|
341
|
+
this.mapboxMap.center = latLngTuple(this.dbxMapboxService.defaultCenter);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
DbxMapboxMapDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxMapDirective, deps: [{ token: i1.MapService, host: true }, { token: i1.MapComponent, host: true }, { token: DbxMapboxService }, { token: DbxMapboxMapStore, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
346
|
+
DbxMapboxMapDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.1.2", type: DbxMapboxMapDirective, selector: "[dbxMapboxMap]", ngImport: i0 });
|
|
347
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxMapDirective, decorators: [{
|
|
348
|
+
type: Directive,
|
|
349
|
+
args: [{
|
|
350
|
+
selector: '[dbxMapboxMap]'
|
|
351
|
+
}]
|
|
352
|
+
}], ctorParameters: function () { return [{ type: i1.MapService, decorators: [{
|
|
353
|
+
type: Host
|
|
354
|
+
}] }, { type: i1.MapComponent, decorators: [{
|
|
355
|
+
type: Host
|
|
356
|
+
}] }, { type: DbxMapboxService }, { type: DbxMapboxMapStore, decorators: [{
|
|
357
|
+
type: Optional
|
|
358
|
+
}] }]; } });
|
|
359
|
+
|
|
360
|
+
class DbxMapboxModule {
|
|
361
|
+
static forRoot(config) {
|
|
362
|
+
return {
|
|
363
|
+
ngModule: DbxMapboxModule,
|
|
364
|
+
providers: [
|
|
365
|
+
{
|
|
366
|
+
provide: DbxMapboxConfig,
|
|
367
|
+
useValue: config
|
|
368
|
+
}
|
|
369
|
+
]
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
DbxMapboxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
374
|
+
DbxMapboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxModule, declarations: [DbxMapboxMapDirective], imports: [CommonModule], exports: [DbxMapboxMapDirective] });
|
|
375
|
+
DbxMapboxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxModule, imports: [CommonModule] });
|
|
376
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: DbxMapboxModule, decorators: [{
|
|
377
|
+
type: NgModule,
|
|
378
|
+
args: [{
|
|
379
|
+
imports: [CommonModule],
|
|
380
|
+
declarations: [DbxMapboxMapDirective],
|
|
381
|
+
exports: [DbxMapboxMapDirective]
|
|
382
|
+
}]
|
|
383
|
+
}] });
|
|
384
|
+
|
|
385
|
+
const KNOWN_MAPBOX_STYLES = [
|
|
386
|
+
//
|
|
387
|
+
'mapbox://styles/mapbox/streets-v11',
|
|
388
|
+
'mapbox://styles/mapbox/outdoors-v11',
|
|
389
|
+
'mapbox://styles/mapbox/light-v10',
|
|
390
|
+
'mapbox://styles/mapbox/dark-v10',
|
|
391
|
+
'mapbox://styles/mapbox/satellite-v9',
|
|
392
|
+
'mapbox://styles/mapbox/satellite-streets-v11',
|
|
393
|
+
'mapbox://styles/mapbox/navigation-day-v1',
|
|
394
|
+
'mapbox://styles/mapbox/navigation-night-v1'
|
|
395
|
+
];
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* Generated bundle index. Do not edit.
|
|
399
|
+
*/
|
|
400
|
+
|
|
401
|
+
export { DEFAULT_MAPBOX_CENTER, DEFAULT_MAPBOX_MAP_STORE_TIMER_REFRESH_PERIOD, DEFAULT_MAPBOX_STYLE, DEFAULT_MAPBOX_ZOOM, DbxMapboxConfig, DbxMapboxMapDirective, DbxMapboxMapStore, DbxMapboxModule, DbxMapboxService, KNOWN_MAPBOX_STYLES };
|
|
402
|
+
//# sourceMappingURL=dereekb-dbx-web-mapbox.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dereekb-dbx-web-mapbox.mjs","sources":["../../../../../packages/dbx-web/mapbox/src/lib/mapbox.service.ts","../../../../../packages/dbx-web/mapbox/src/lib/mapbox.store.ts","../../../../../packages/dbx-web/mapbox/src/lib/mapbox.store.map.directive.ts","../../../../../packages/dbx-web/mapbox/src/lib/mapbox.module.ts","../../../../../packages/dbx-web/mapbox/src/lib/mapbox.ts","../../../../../packages/dbx-web/mapbox/src/dereekb-dbx-web-mapbox.ts"],"sourcesContent":["import { Injectable, Optional } from '@angular/core';\nimport { LatLngPointInput, Milliseconds } from '@dereekb/util';\nimport { MapboxOptions } from 'mapbox-gl';\nimport { KnownMapboxStyle, MapboxZoomLevel } from './mapbox';\n\nexport class DbxMapboxConfig {\n readonly defaultStyle?: MapboxOptions['style'];\n readonly defaultZoom?: MapboxZoomLevel;\n readonly defaultCenter?: LatLngPointInput;\n readonly defaultStoreRefreshPeriod?: number;\n}\n\nexport const DEFAULT_MAPBOX_STYLE: KnownMapboxStyle = 'mapbox://styles/mapbox/streets-v11';\nexport const DEFAULT_MAPBOX_CENTER: LatLngPointInput = [30.2690138665, -97.7408297965];\nexport const DEFAULT_MAPBOX_ZOOM: MapboxZoomLevel = 12;\nexport const DEFAULT_MAPBOX_MAP_STORE_TIMER_REFRESH_PERIOD: Milliseconds = 200;\n\n@Injectable({\n providedIn: 'root'\n})\nexport class DbxMapboxService {\n private readonly _config: DbxMapboxConfig;\n\n constructor(@Optional() config: DbxMapboxConfig) {\n this._config = config ?? {};\n }\n\n get defaultStyle() {\n return this._config.defaultStyle ?? DEFAULT_MAPBOX_STYLE;\n }\n\n get defaultZoom(): MapboxZoomLevel {\n return this._config.defaultZoom ?? DEFAULT_MAPBOX_ZOOM;\n }\n\n get defaultCenter(): LatLngPointInput {\n return this._config.defaultCenter ?? DEFAULT_MAPBOX_CENTER;\n }\n\n get mapboxMapStoreTimerRefreshPeriod(): number {\n return this._config.defaultStoreRefreshPeriod ?? DEFAULT_MAPBOX_MAP_STORE_TIMER_REFRESH_PERIOD;\n }\n}\n","import { cleanup, filterMaybe, onTrueToFalse } from '@dereekb/rxjs';\nimport { Inject, Injectable, OnDestroy } from '@angular/core';\nimport { isSameLatLngBound, isSameLatLngPoint, IsWithinLatLngBoundFunction, isWithinLatLngBoundFunction, LatLngBound, latLngBoundFunction, LatLngPointInput, LatLngPoint, latLngPointFunction, Maybe, OverlapsLatLngBoundFunction, overlapsLatLngBoundFunction } from '@dereekb/util';\nimport { ComponentStore } from '@ngrx/component-store';\nimport { MapService } from 'ngx-mapbox-gl';\nimport { defaultIfEmpty, distinctUntilChanged, filter, map, shareReplay, switchMap, tap, NEVER, Observable, of, Subscription, startWith, interval, first, combineLatest } from 'rxjs';\nimport * as MapboxGl from 'mapbox-gl';\nimport { DbxMapboxClickEvent, KnownMapboxStyle, MapboxBearing, MapboxEaseTo, MapboxFitBounds, MapboxFlyTo, MapboxJumpTo, MapboxResetNorth, MapboxResetNorthPitch, MapboxRotateTo, MapboxSnapToNorth, MapboxStyleConfig, MapboxZoomLevel } from './mapbox';\nimport { DbxMapboxService } from './mapbox.service';\n\nexport type MapboxMapLifecycleState = 'init' | 'load' | 'render' | 'idle';\nexport type MapboxMapMoveState = 'init' | 'idle' | 'moving';\nexport type MapboxMapZoomState = 'init' | 'idle' | 'zooming';\nexport type MapboxMapRotateState = 'init' | 'idle' | 'rotating';\n\nexport interface StringMapboxListenerPair {\n type: string;\n listener: (ev: MapboxGl.EventData) => void;\n}\n\nexport interface TypedMapboxListenerPair<T extends keyof MapboxGl.MapEventType> {\n type: T;\n listener: (ev: MapboxGl.MapEventType[T] & MapboxGl.EventData) => void;\n}\n\nexport interface DbxMapboxStoreState {\n /**\n * Current MapService being utilized.\n */\n mapService?: Maybe<MapService>;\n lifecycleState: MapboxMapLifecycleState;\n moveState: MapboxMapMoveState;\n zoomState: MapboxMapZoomState;\n rotateState: MapboxMapRotateState;\n /**\n * Latest click event\n */\n clickEvent?: Maybe<DbxMapboxClickEvent>;\n /**\n * Latest double-click event\n */\n doubleClickEvent?: Maybe<DbxMapboxClickEvent>;\n /**\n * Latest error\n */\n error?: Maybe<Error>;\n}\n\n/**\n * Store used for retrieving information.\n */\n@Injectable()\nexport class DbxMapboxMapStore extends ComponentStore<DbxMapboxStoreState> implements OnDestroy {\n private latLngPoint = latLngPointFunction();\n private latLngBound = latLngBoundFunction();\n\n constructor(@Inject(DbxMapboxService) private readonly dbxMapboxService: DbxMapboxService) {\n super({\n lifecycleState: 'init',\n moveState: 'init',\n zoomState: 'init',\n rotateState: 'init'\n });\n }\n\n // MARK: Effects\n readonly setMapService = this.effect((input: Observable<Maybe<MapService>>) => {\n return input.pipe(\n switchMap((service: Maybe<MapService>) => {\n this._setMapService(service);\n\n if (!service) {\n return NEVER;\n } else {\n return service.mapLoaded$.pipe(\n defaultIfEmpty(undefined),\n map(() => {\n this._setLifecycleState('idle');\n this._setMoveState('idle');\n this._setZoomState('idle');\n this._setRotateState('idle');\n\n const map = service.mapInstance;\n\n const listenerPairs: StringMapboxListenerPair[] = [];\n\n function addListener<T extends keyof MapboxGl.MapEventType>(type: T, listener: (ev: MapboxGl.MapEventType[T] & MapboxGl.EventData) => void) {\n map.on(type, listener);\n listenerPairs.push({ type, listener } as StringMapboxListenerPair);\n }\n\n addListener('idle', () => this._setLifecycleState('idle'));\n addListener('render', () => this._setLifecycleState('render'));\n addListener('error', (x) => {\n this._setError(x.error);\n });\n\n addListener('movestart', () => this._setMoveState('moving'));\n addListener('moveend', () => this._setMoveState('idle'));\n\n addListener('zoomstart', () => this._setZoomState('zooming'));\n addListener('zoomend', () => this._setZoomState('idle'));\n\n addListener('rotatestart', () => this._setRotateState('rotating'));\n addListener('rotateend', () => this._setRotateState('idle'));\n\n addListener('click', (x) => this._setClickEvent(x));\n addListener('dblclick', (x) => this._setDoubleClickEvent(x));\n\n const subs: Subscription[] = [];\n\n return {\n service,\n listenerPairs,\n subs\n };\n })\n );\n }\n }),\n cleanup(({ service, listenerPairs, subs }) => {\n const map = service.mapInstance;\n\n if (map) {\n listenerPairs.forEach((x) => {\n map.off(x.type, x.listener);\n });\n }\n\n subs.forEach((sub) => sub.unsubscribe());\n })\n );\n });\n\n readonly setStyle = this.effect((input: Observable<MapboxStyleConfig | KnownMapboxStyle | string>) => {\n return input.pipe(\n switchMap((style) => {\n return this.mapInstance$.pipe(\n tap((map) => {\n if (typeof style === 'string') {\n map.setStyle(style);\n } else {\n map.setStyle(style.style, style.options);\n }\n })\n );\n })\n );\n });\n\n readonly setCenter = this.effect((input: Observable<LatLngPointInput>) => {\n return input.pipe(\n switchMap((center: LatLngPointInput) => {\n const centerPoint = this.latLngPoint(center);\n return this.mapInstance$.pipe(tap((map) => map.setCenter(centerPoint)));\n })\n );\n });\n\n readonly setZoom = this.effect((input: Observable<MapboxZoomLevel>) => {\n return input.pipe(\n switchMap((zoom: MapboxZoomLevel) => {\n return this.mapInstance$.pipe(tap((map) => map.setZoom(zoom)));\n })\n );\n });\n\n readonly setMinZoom = this.effect((input: Observable<MapboxZoomLevel>) => {\n return input.pipe(\n switchMap((zoom: MapboxZoomLevel) => {\n return this.mapInstance$.pipe(tap((map) => map.setMinZoom(zoom)));\n })\n );\n });\n\n readonly setMaxZoom = this.effect((input: Observable<MapboxZoomLevel>) => {\n return input.pipe(\n switchMap((zoom: MapboxZoomLevel) => {\n return this.mapInstance$.pipe(tap((map) => map.setMaxZoom(zoom)));\n })\n );\n });\n\n readonly setPitch = this.effect((input: Observable<number>) => {\n return input.pipe(\n switchMap((pitch) => {\n return this.mapInstance$.pipe(tap((map) => map.setPitch(pitch)));\n })\n );\n });\n\n readonly setMinPitch = this.effect((input: Observable<number>) => {\n return input.pipe(\n switchMap((pitch: number) => {\n return this.mapInstance$.pipe(tap((map) => map.setMinPitch(pitch)));\n })\n );\n });\n\n readonly setMaxPitch = this.effect((input: Observable<number>) => {\n return input.pipe(\n switchMap((pitch: number) => {\n return this.mapInstance$.pipe(tap((map) => map.setMaxPitch(pitch)));\n })\n );\n });\n\n readonly setBearing = this.effect((input: Observable<number>) => {\n return input.pipe(\n switchMap((bearing) => {\n return this.mapInstance$.pipe(tap((map) => map.setBearing(bearing)));\n })\n );\n });\n\n readonly rotateTo = this.effect((input: Observable<MapboxBearing | MapboxRotateTo>) => {\n return input.pipe(\n switchMap((rotateInput: MapboxBearing | MapboxRotateTo) => {\n const rotate: MapboxRotateTo = typeof rotateInput === 'number' ? { bearing: rotateInput } : rotateInput;\n return this.mapInstance$.pipe(tap((map) => map.rotateTo(rotate.bearing, rotate.options, rotate?.eventData)));\n })\n );\n });\n\n readonly resetNorth = this.effect((input: Observable<Maybe<MapboxResetNorth> | void>) => {\n return input.pipe(\n switchMap((reset: Maybe<MapboxResetNorth> | void) => {\n return this.mapInstance$.pipe(tap((map) => map.resetNorth(reset?.options, reset?.eventData)));\n })\n );\n });\n\n readonly resetNorthPitch = this.effect((input: Observable<Maybe<MapboxResetNorthPitch> | void>) => {\n return input.pipe(\n switchMap((reset: Maybe<MapboxResetNorthPitch> | void) => {\n return this.mapInstance$.pipe(tap((map) => map.resetNorthPitch(reset?.options, reset?.eventData)));\n })\n );\n });\n\n readonly snapToNorth = this.effect((input: Observable<Maybe<MapboxSnapToNorth> | void>) => {\n return input.pipe(\n switchMap((snap: Maybe<MapboxSnapToNorth> | void) => {\n return this.mapInstance$.pipe(tap((map) => map.snapToNorth(snap?.options, snap?.eventData)));\n })\n );\n });\n\n readonly fitBounds = this.effect((input: Observable<MapboxFitBounds>) => {\n return input.pipe(\n switchMap((x) => {\n const bound = this.latLngBound(x.bounds);\n return this.mapInstance$.pipe(tap((map) => map.fitBounds(new MapboxGl.LngLatBounds(bound.sw, bound.ne), x.options, x.eventData)));\n })\n );\n });\n\n readonly jumpTo = this.effect((input: Observable<MapboxJumpTo>) => {\n return input.pipe(\n switchMap((x) => {\n const inputCenter = x.center ?? x.to?.center;\n const center = inputCenter ? this.latLngPoint(inputCenter) : undefined;\n return this.mapInstance$.pipe(tap((map) => map.jumpTo({ ...x.to, center }, x.eventData)));\n })\n );\n });\n\n readonly easeTo = this.effect((input: Observable<MapboxEaseTo>) => {\n return input.pipe(\n switchMap((x) => {\n const inputCenter = x.center ?? x.to?.center;\n const center = inputCenter ? this.latLngPoint(inputCenter) : undefined;\n return this.mapInstance$.pipe(tap((map) => map.easeTo({ ...x.to, center }, x.eventData)));\n })\n );\n });\n\n readonly flyTo = this.effect((input: Observable<MapboxFlyTo>) => {\n return input.pipe(\n switchMap((x) => {\n const inputCenter = x.center ?? x.to?.center;\n const center = inputCenter ? this.latLngPoint(inputCenter) : undefined;\n return this.mapInstance$.pipe(tap((map) => map.flyTo({ ...x.to, center }, x.eventData)));\n })\n );\n });\n\n readonly resetPitchAndBearing = this.effect((input: Observable<void>) => {\n return input.pipe(\n switchMap(() => {\n return this.mapInstance$.pipe(\n tap((map) => {\n map.setPitch(0);\n map.setBearing(0);\n })\n );\n })\n );\n });\n\n // MARK: Accessors\n get timerRefreshPeriod() {\n return this.dbxMapboxService.mapboxMapStoreTimerRefreshPeriod;\n }\n\n movingTimer(period = this.timerRefreshPeriod) {\n return this.moveState$.pipe(\n switchMap((x) => {\n if (x === 'moving') {\n return interval(period);\n } else {\n return of(0);\n }\n }),\n shareReplay()\n );\n }\n\n lifecycleRenderTimer(period = this.timerRefreshPeriod) {\n return this.lifecycleState$.pipe(\n switchMap((x) => {\n if (x === 'render') {\n return interval(period);\n } else {\n return of(0);\n }\n }),\n shareReplay()\n );\n }\n\n readonly currentMapService$ = this.state$.pipe(\n map((x) => x.mapService),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly mapService$ = this.currentMapService$.pipe(filterMaybe());\n\n readonly currentMapInstance$: Observable<Maybe<MapboxGl.Map>> = this.currentMapService$.pipe(\n switchMap((currentMapService: Maybe<MapService>) => {\n if (currentMapService) {\n return currentMapService.mapLoaded$.pipe(\n defaultIfEmpty(undefined),\n map(() => currentMapService.mapInstance)\n );\n } else {\n return of(undefined);\n }\n }),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly mapInstance$ = this.currentMapInstance$.pipe(filterMaybe());\n\n readonly moveState$ = this.state$.pipe(\n map((x) => x.moveState),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly lifecycleState$ = this.state$.pipe(\n map((x) => x.lifecycleState),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly zoomState$ = this.state$.pipe(\n map((x) => x.zoomState),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly rotateState$ = this.state$.pipe(\n map((x) => x.rotateState),\n distinctUntilChanged(),\n shareReplay(1)\n );\n\n readonly isInitialized$ = this.currentMapInstance$.pipe(\n switchMap((x) => {\n if (!x) {\n return of(false);\n } else {\n return combineLatest([this.moveState$.pipe(map((x) => x === 'idle')), this.lifecycleState$.pipe(map((x) => x === 'idle'))]).pipe(\n filter(([m, l]) => m && l),\n first(),\n map(() => true)\n );\n }\n }),\n shareReplay(1)\n );\n\n readonly whenInitialized$ = this.isInitialized$.pipe(\n filter((x) => true),\n shareReplay(1)\n );\n\n readonly isRendering$ = this.whenInitialized$.pipe(\n switchMap(() =>\n this.lifecycleState$.pipe(\n map((x) => x === 'render'),\n distinctUntilChanged(),\n shareReplay()\n )\n )\n );\n\n readonly isMoving$ = this.whenInitialized$.pipe(\n switchMap(() =>\n this.moveState$.pipe(\n map((x) => x === 'moving'),\n distinctUntilChanged(),\n shareReplay()\n )\n )\n );\n\n readonly isZooming$ = this.whenInitialized$.pipe(\n switchMap(() =>\n this.zoomState$.pipe(\n map((x) => x === 'zooming'),\n distinctUntilChanged(),\n shareReplay()\n )\n )\n );\n\n readonly isRotating$ = this.whenInitialized$.pipe(\n switchMap(() =>\n this.rotateState$.pipe(\n map((x) => x === 'rotating'),\n distinctUntilChanged(),\n shareReplay()\n )\n )\n );\n\n private readonly _movingTimer = this.movingTimer();\n private readonly _renderingTimer = this.lifecycleRenderTimer();\n\n readonly centerNow$: Observable<LatLngPoint> = this.whenInitialized$.pipe(\n switchMap(() =>\n this.mapInstance$.pipe(\n switchMap((x) => this._movingTimer.pipe(map(() => this.latLngPoint(x.getCenter())))),\n shareReplay(1)\n )\n )\n );\n\n readonly center$: Observable<LatLngPoint> = this.whenInitialized$.pipe(\n switchMap(() => {\n return this.isMoving$.pipe(\n onTrueToFalse(),\n startWith(undefined),\n switchMap(() => this.centerNow$.pipe(first())),\n distinctUntilChanged(isSameLatLngPoint),\n shareReplay(1)\n );\n })\n );\n\n readonly boundNow$: Observable<LatLngBound> = this.whenInitialized$.pipe(\n switchMap(() =>\n this.mapInstance$.pipe(\n switchMap((x) =>\n this._renderingTimer.pipe(\n map(() => {\n const bound = x.getBounds();\n return this.latLngBound([bound.getSouthWest(), bound.getNorthEast()]);\n })\n )\n ),\n shareReplay(1)\n )\n )\n );\n\n readonly bound$: Observable<LatLngBound> = this.whenInitialized$.pipe(\n switchMap(() => {\n return this.isRendering$.pipe(\n onTrueToFalse(),\n startWith(undefined),\n switchMap((x) => this.boundNow$.pipe(first())),\n distinctUntilChanged(isSameLatLngBound),\n shareReplay(1)\n );\n })\n );\n\n readonly isWithinBoundFunction$: Observable<IsWithinLatLngBoundFunction> = this.bound$.pipe(\n map((x) => isWithinLatLngBoundFunction(x)),\n shareReplay(1)\n );\n\n readonly overlapsBoundFunction$: Observable<OverlapsLatLngBoundFunction> = this.bound$.pipe(\n map((x) => overlapsLatLngBoundFunction(x)),\n shareReplay(1)\n );\n\n readonly zoomNow$: Observable<MapboxZoomLevel> = this.whenInitialized$.pipe(\n switchMap(() =>\n this.mapInstance$.pipe(\n switchMap((x) => this._renderingTimer.pipe(map(() => x.getZoom() as MapboxZoomLevel))),\n shareReplay(1)\n )\n )\n );\n\n readonly zoom$: Observable<MapboxZoomLevel> = this.whenInitialized$.pipe(\n switchMap(() => {\n return this.isZooming$.pipe(\n onTrueToFalse(),\n startWith(undefined),\n switchMap((x) => this.zoomNow$.pipe(first())),\n distinctUntilChanged(),\n shareReplay(1)\n );\n })\n );\n\n readonly pitchNow$ = this.whenInitialized$.pipe(\n switchMap(() =>\n this.mapInstance$.pipe(\n switchMap((x) => this._movingTimer.pipe(map(() => x.getPitch()))),\n shareReplay(1)\n )\n )\n );\n\n readonly pitch$ = this.whenInitialized$.pipe(\n switchMap(() => {\n return this.isRotating$.pipe(\n onTrueToFalse(),\n startWith(undefined),\n switchMap((x) => this.pitchNow$.pipe(first())),\n distinctUntilChanged(),\n shareReplay(1)\n );\n })\n );\n\n readonly bearingNow$ = this.whenInitialized$.pipe(\n switchMap(() =>\n this.mapInstance$.pipe(\n switchMap((x) => this._movingTimer.pipe(map(() => x.getBearing()))),\n shareReplay(1)\n )\n )\n );\n\n readonly bearing$ = this.whenInitialized$.pipe(\n switchMap(() => {\n return this.isRotating$.pipe(\n onTrueToFalse(),\n startWith(undefined),\n switchMap((x) => this.bearingNow$.pipe(first())),\n distinctUntilChanged(),\n shareReplay(1)\n );\n })\n );\n\n readonly clickEvent$ = this.state$.pipe(map((x) => x.clickEvent));\n readonly doubleClickEvent$ = this.state$.pipe(map((x) => x.doubleClickEvent));\n\n // MARK: State Changes\n private readonly _setMapService = this.updater((state, mapService: Maybe<MapService>) => ({ mapService, moveState: 'init', lifecycleState: 'init', zoomState: 'init', rotateState: 'init' }));\n private readonly _setLifecycleState = this.updater((state, lifecycleState: MapboxMapLifecycleState) => ({ ...state, lifecycleState }));\n private readonly _setMoveState = this.updater((state, moveState: MapboxMapMoveState) => ({ ...state, moveState }));\n private readonly _setZoomState = this.updater((state, zoomState: MapboxMapZoomState) => ({ ...state, zoomState }));\n private readonly _setRotateState = this.updater((state, rotateState: MapboxMapRotateState) => ({ ...state, rotateState }));\n\n private readonly _setClickEvent = this.updater((state, clickEvent: DbxMapboxClickEvent) => ({ ...state, clickEvent }));\n private readonly _setDoubleClickEvent = this.updater((state, doubleClickEvent: DbxMapboxClickEvent) => ({ ...state, doubleClickEvent }));\n\n private readonly _setError = this.updater((state, error: Error) => ({ ...state, error }));\n}\n","import { DbxMapboxService } from './mapbox.service';\nimport { DbxMapboxMapStore } from './mapbox.store';\nimport { Directive, Host, OnInit, Optional } from '@angular/core';\nimport { MapComponent, MapService } from 'ngx-mapbox-gl';\nimport { latLngTuple } from '@dereekb/util';\n\n/**\n * Directive that configures a MapComponent with content from DbxMapboxService. Connects a host MapService to a parent DbxMapboxMapStore if available.\n */\n@Directive({\n selector: '[dbxMapboxMap]'\n})\nexport class DbxMapboxMapDirective implements OnInit {\n constructor(\n //\n @Host() readonly mapService: MapService,\n @Host() readonly mapboxMap: MapComponent,\n readonly dbxMapboxService: DbxMapboxService,\n @Optional() readonly dbxMapboxMapStore: DbxMapboxMapStore\n ) {}\n\n ngOnInit(): void {\n // style must be provided first before the map will load.\n this.mapboxMap.style = this.dbxMapboxService.defaultStyle;\n\n if (this.dbxMapboxMapStore) {\n this.dbxMapboxMapStore.setMapService(this.mapService);\n this.dbxMapboxMapStore.setCenter(this.dbxMapboxService.defaultCenter);\n this.dbxMapboxMapStore.setZoom(this.dbxMapboxService.defaultZoom);\n } else {\n this.mapboxMap.zoom = [this.dbxMapboxService.defaultZoom];\n this.mapboxMap.center = latLngTuple(this.dbxMapboxService.defaultCenter);\n }\n }\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { DbxMapboxMapDirective } from './mapbox.store.map.directive';\nimport { DbxMapboxConfig } from './mapbox.service';\n\n@NgModule({\n imports: [CommonModule],\n declarations: [DbxMapboxMapDirective],\n exports: [DbxMapboxMapDirective]\n})\nexport class DbxMapboxModule {\n static forRoot(config: DbxMapboxConfig): ModuleWithProviders<DbxMapboxModule> {\n return {\n ngModule: DbxMapboxModule,\n providers: [\n {\n provide: DbxMapboxConfig,\n useValue: config\n }\n ]\n };\n }\n}\n","import { LatLngPoint, LatLngPointInput, LatLngBound, LatLngBoundInput } from '@dereekb/util';\nimport * as MapboxGl from 'mapbox-gl';\n\nexport type KnownMapboxStyle = 'mapbox://styles/mapbox/streets-v11' | 'mapbox://styles/mapbox/outdoors-v11' | 'mapbox://styles/mapbox/light-v10' | 'mapbox://styles/mapbox/dark-v10' | 'mapbox://styles/mapbox/satellite-v9' | 'mapbox://styles/mapbox/satellite-streets-v11' | 'mapbox://styles/mapbox/navigation-day-v1' | 'mapbox://styles/mapbox/navigation-night-v1';\n\nexport const KNOWN_MAPBOX_STYLES: KnownMapboxStyle[] = [\n //\n 'mapbox://styles/mapbox/streets-v11',\n 'mapbox://styles/mapbox/outdoors-v11',\n 'mapbox://styles/mapbox/light-v10',\n 'mapbox://styles/mapbox/dark-v10',\n 'mapbox://styles/mapbox/satellite-v9',\n 'mapbox://styles/mapbox/satellite-streets-v11',\n 'mapbox://styles/mapbox/navigation-day-v1',\n 'mapbox://styles/mapbox/navigation-night-v1'\n];\n\nexport type MapboxZoomLevel = number;\nexport type MapboxPitch = number;\nexport type MapboxBearing = number;\n\nexport type DbxMapboxClickEvent = MapboxGl.MapMouseEvent & MapboxGl.EventData;\n\nexport interface MapboxStyleConfig {\n style: MapboxGl.Style | string;\n options?: {\n diff?: boolean | undefined;\n localIdeographFontFamily?: string | undefined;\n };\n}\n\nexport interface MapboxFitBounds {\n bounds: LatLngBoundInput;\n options?: mapboxgl.FitBoundsOptions;\n eventData?: mapboxgl.EventData;\n}\n\nexport interface MapboxJumpToPositionOptions extends Omit<MapboxGl.CameraOptions, 'center'> {\n center: LatLngPointInput;\n}\n\nexport interface MapboxJumpTo {\n center?: LatLngPointInput;\n to?: MapboxJumpToPositionOptions;\n eventData?: mapboxgl.EventData;\n}\n\nexport interface MapboxEaseToPositionOptions extends Omit<MapboxGl.EaseToOptions, 'center'>, MapboxJumpToPositionOptions {}\n\nexport interface MapboxEaseTo {\n center?: LatLngPointInput;\n to?: MapboxEaseToPositionOptions;\n eventData?: mapboxgl.EventData;\n}\n\nexport interface MapboxFlyToPositionOptions extends Omit<MapboxGl.FlyToOptions, 'center'>, MapboxJumpToPositionOptions {}\n\nexport interface MapboxFlyTo {\n center?: LatLngPointInput;\n to?: MapboxFlyToPositionOptions;\n eventData?: mapboxgl.EventData;\n}\n\nexport interface MapboxRotateTo {\n bearing: MapboxBearing;\n options?: mapboxgl.AnimationOptions;\n eventData?: mapboxgl.EventData;\n}\n\nexport interface MapboxResetNorth {\n options?: mapboxgl.AnimationOptions;\n eventData?: mapboxgl.EventData;\n}\n\nexport interface MapboxResetNorthPitch {\n options?: mapboxgl.AnimationOptions;\n eventData?: mapboxgl.EventData;\n}\n\nexport interface MapboxSnapToNorth {\n options?: mapboxgl.AnimationOptions;\n eventData?: mapboxgl.EventData;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i2.DbxMapboxService","i3.DbxMapboxMapStore"],"mappings":";;;;;;;;;;MAKa,eAAe,CAAA;AAK3B,CAAA;AAEM,MAAM,oBAAoB,GAAqB,qCAAqC;AAC9E,MAAA,qBAAqB,GAAqB,CAAC,aAAa,EAAE,CAAC,aAAa,EAAE;AAChF,MAAM,mBAAmB,GAAoB,GAAG;AAChD,MAAM,6CAA6C,GAAiB,IAAI;MAKlE,gBAAgB,CAAA;AAG3B,IAAA,WAAA,CAAwB,MAAuB,EAAA;AAC7C,QAAA,IAAI,CAAC,OAAO,GAAG,MAAM,IAAI,EAAE,CAAC;KAC7B;AAED,IAAA,IAAI,YAAY,GAAA;AACd,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,IAAI,oBAAoB,CAAC;KAC1D;AAED,IAAA,IAAI,WAAW,GAAA;AACb,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,IAAI,mBAAmB,CAAC;KACxD;AAED,IAAA,IAAI,aAAa,GAAA;AACf,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,aAAa,IAAI,qBAAqB,CAAC;KAC5D;AAED,IAAA,IAAI,gCAAgC,GAAA;AAClC,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,yBAAyB,IAAI,6CAA6C,CAAC;KAChG;;AArBU,gBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,kBAGK,eAAe,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA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BACvB,YAAY,EAAE,CAAC,qBAAqB,CAAC;oBACrC,OAAO,EAAE,CAAC,qBAAqB,CAAC;AACjC,iBAAA,CAAA;;;ACJY,MAAA,mBAAmB,GAAuB;;IAErD,oCAAoC;IACpC,qCAAqC;IACrC,kCAAkC;IAClC,iCAAiC;IACjC,qCAAqC;IACrC,8CAA8C;IAC9C,0CAA0C;IAC1C,4CAA4C;;;ACd9C;;AAEG;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './lib';
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { LatLngPointInput, LatLngBoundInput } from '@dereekb/util';
|
|
2
|
+
import * as MapboxGl from 'mapbox-gl';
|
|
3
|
+
export declare type KnownMapboxStyle = 'mapbox://styles/mapbox/streets-v11' | 'mapbox://styles/mapbox/outdoors-v11' | 'mapbox://styles/mapbox/light-v10' | 'mapbox://styles/mapbox/dark-v10' | 'mapbox://styles/mapbox/satellite-v9' | 'mapbox://styles/mapbox/satellite-streets-v11' | 'mapbox://styles/mapbox/navigation-day-v1' | 'mapbox://styles/mapbox/navigation-night-v1';
|
|
4
|
+
export declare const KNOWN_MAPBOX_STYLES: KnownMapboxStyle[];
|
|
5
|
+
export declare type MapboxZoomLevel = number;
|
|
6
|
+
export declare type MapboxPitch = number;
|
|
7
|
+
export declare type MapboxBearing = number;
|
|
8
|
+
export declare type DbxMapboxClickEvent = MapboxGl.MapMouseEvent & MapboxGl.EventData;
|
|
9
|
+
export interface MapboxStyleConfig {
|
|
10
|
+
style: MapboxGl.Style | string;
|
|
11
|
+
options?: {
|
|
12
|
+
diff?: boolean | undefined;
|
|
13
|
+
localIdeographFontFamily?: string | undefined;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export interface MapboxFitBounds {
|
|
17
|
+
bounds: LatLngBoundInput;
|
|
18
|
+
options?: mapboxgl.FitBoundsOptions;
|
|
19
|
+
eventData?: mapboxgl.EventData;
|
|
20
|
+
}
|
|
21
|
+
export interface MapboxJumpToPositionOptions extends Omit<MapboxGl.CameraOptions, 'center'> {
|
|
22
|
+
center: LatLngPointInput;
|
|
23
|
+
}
|
|
24
|
+
export interface MapboxJumpTo {
|
|
25
|
+
center?: LatLngPointInput;
|
|
26
|
+
to?: MapboxJumpToPositionOptions;
|
|
27
|
+
eventData?: mapboxgl.EventData;
|
|
28
|
+
}
|
|
29
|
+
export interface MapboxEaseToPositionOptions extends Omit<MapboxGl.EaseToOptions, 'center'>, MapboxJumpToPositionOptions {
|
|
30
|
+
}
|
|
31
|
+
export interface MapboxEaseTo {
|
|
32
|
+
center?: LatLngPointInput;
|
|
33
|
+
to?: MapboxEaseToPositionOptions;
|
|
34
|
+
eventData?: mapboxgl.EventData;
|
|
35
|
+
}
|
|
36
|
+
export interface MapboxFlyToPositionOptions extends Omit<MapboxGl.FlyToOptions, 'center'>, MapboxJumpToPositionOptions {
|
|
37
|
+
}
|
|
38
|
+
export interface MapboxFlyTo {
|
|
39
|
+
center?: LatLngPointInput;
|
|
40
|
+
to?: MapboxFlyToPositionOptions;
|
|
41
|
+
eventData?: mapboxgl.EventData;
|
|
42
|
+
}
|
|
43
|
+
export interface MapboxRotateTo {
|
|
44
|
+
bearing: MapboxBearing;
|
|
45
|
+
options?: mapboxgl.AnimationOptions;
|
|
46
|
+
eventData?: mapboxgl.EventData;
|
|
47
|
+
}
|
|
48
|
+
export interface MapboxResetNorth {
|
|
49
|
+
options?: mapboxgl.AnimationOptions;
|
|
50
|
+
eventData?: mapboxgl.EventData;
|
|
51
|
+
}
|
|
52
|
+
export interface MapboxResetNorthPitch {
|
|
53
|
+
options?: mapboxgl.AnimationOptions;
|
|
54
|
+
eventData?: mapboxgl.EventData;
|
|
55
|
+
}
|
|
56
|
+
export interface MapboxSnapToNorth {
|
|
57
|
+
options?: mapboxgl.AnimationOptions;
|
|
58
|
+
eventData?: mapboxgl.EventData;
|
|
59
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ModuleWithProviders } from '@angular/core';
|
|
2
|
+
import { DbxMapboxConfig } from './mapbox.service';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "./mapbox.store.map.directive";
|
|
5
|
+
import * as i2 from "@angular/common";
|
|
6
|
+
export declare class DbxMapboxModule {
|
|
7
|
+
static forRoot(config: DbxMapboxConfig): ModuleWithProviders<DbxMapboxModule>;
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbxMapboxModule, never>;
|
|
9
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DbxMapboxModule, [typeof i1.DbxMapboxMapDirective], [typeof i2.CommonModule], [typeof i1.DbxMapboxMapDirective]>;
|
|
10
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DbxMapboxModule>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { LatLngPointInput, Milliseconds } from '@dereekb/util';
|
|
2
|
+
import { MapboxOptions } from 'mapbox-gl';
|
|
3
|
+
import { KnownMapboxStyle, MapboxZoomLevel } from './mapbox';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class DbxMapboxConfig {
|
|
6
|
+
readonly defaultStyle?: MapboxOptions['style'];
|
|
7
|
+
readonly defaultZoom?: MapboxZoomLevel;
|
|
8
|
+
readonly defaultCenter?: LatLngPointInput;
|
|
9
|
+
readonly defaultStoreRefreshPeriod?: number;
|
|
10
|
+
}
|
|
11
|
+
export declare const DEFAULT_MAPBOX_STYLE: KnownMapboxStyle;
|
|
12
|
+
export declare const DEFAULT_MAPBOX_CENTER: LatLngPointInput;
|
|
13
|
+
export declare const DEFAULT_MAPBOX_ZOOM: MapboxZoomLevel;
|
|
14
|
+
export declare const DEFAULT_MAPBOX_MAP_STORE_TIMER_REFRESH_PERIOD: Milliseconds;
|
|
15
|
+
export declare class DbxMapboxService {
|
|
16
|
+
private readonly _config;
|
|
17
|
+
constructor(config: DbxMapboxConfig);
|
|
18
|
+
get defaultStyle(): string | import("mapbox-gl").Style;
|
|
19
|
+
get defaultZoom(): MapboxZoomLevel;
|
|
20
|
+
get defaultCenter(): LatLngPointInput;
|
|
21
|
+
get mapboxMapStoreTimerRefreshPeriod(): number;
|
|
22
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DbxMapboxService, [{ optional: true; }]>;
|
|
23
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DbxMapboxService>;
|
|
24
|
+
}
|