@dereekb/dbx-web 9.6.4 → 9.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/esm2020/mapbox/lib/index.mjs +3 -1
  2. package/esm2020/mapbox/lib/mapbox.marker.component.mjs +2 -3
  3. package/esm2020/mapbox/lib/mapbox.markers.component.mjs +5 -4
  4. package/esm2020/mapbox/lib/mapbox.mjs +1 -1
  5. package/esm2020/mapbox/lib/mapbox.rxjs.mjs +53 -0
  6. package/esm2020/mapbox/lib/mapbox.store.mjs +27 -14
  7. package/esm2020/mapbox/lib/mapbox.util.mjs +15 -0
  8. package/fesm2015/dereekb-dbx-web-mapbox.mjs +97 -20
  9. package/fesm2015/dereekb-dbx-web-mapbox.mjs.map +1 -1
  10. package/fesm2020/dereekb-dbx-web-mapbox.mjs +97 -20
  11. package/fesm2020/dereekb-dbx-web-mapbox.mjs.map +1 -1
  12. package/mapbox/esm2020/lib/index.mjs +3 -1
  13. package/mapbox/esm2020/lib/mapbox.marker.component.mjs +2 -3
  14. package/mapbox/esm2020/lib/mapbox.markers.component.mjs +5 -4
  15. package/mapbox/esm2020/lib/mapbox.mjs +1 -1
  16. package/mapbox/esm2020/lib/mapbox.rxjs.mjs +53 -0
  17. package/mapbox/esm2020/lib/mapbox.store.mjs +27 -14
  18. package/mapbox/esm2020/lib/mapbox.util.mjs +15 -0
  19. package/mapbox/fesm2015/dereekb-dbx-web-mapbox.mjs +97 -20
  20. package/mapbox/fesm2015/dereekb-dbx-web-mapbox.mjs.map +1 -1
  21. package/mapbox/fesm2020/dereekb-dbx-web-mapbox.mjs +97 -20
  22. package/mapbox/fesm2020/dereekb-dbx-web-mapbox.mjs.map +1 -1
  23. package/mapbox/lib/index.d.ts +2 -0
  24. package/mapbox/lib/mapbox.d.ts +6 -0
  25. package/mapbox/lib/mapbox.marker.component.d.ts +0 -1
  26. package/mapbox/lib/mapbox.rxjs.d.ts +44 -0
  27. package/mapbox/lib/mapbox.store.d.ts +12 -1
  28. package/mapbox/lib/mapbox.util.d.ts +27 -0
  29. package/mapbox/package.json +5 -4
  30. package/package.json +3 -3
@@ -1,5 +1,5 @@
1
1
  import { OnDestroy } from '@angular/core';
2
- import { IsWithinLatLngBoundFunction, LatLngBound, LatLngPointInput, LatLngPoint, Maybe, OverlapsLatLngBoundFunction } from '@dereekb/util';
2
+ import { IsWithinLatLngBoundFunction, LatLngBound, LatLngPointInput, LatLngPoint, Maybe, OverlapsLatLngBoundFunction, Vector } from '@dereekb/util';
3
3
  import { ComponentStore } from '@ngrx/component-store';
4
4
  import { MapService } from 'ngx-mapbox-gl';
5
5
  import { Observable, Subscription } from 'rxjs';
@@ -7,6 +7,7 @@ import * as MapboxGl from 'mapbox-gl';
7
7
  import { DbxMapboxClickEvent, MapboxEaseTo, MapboxFitBounds, MapboxFlyTo, MapboxJumpTo, MapboxResetNorth, MapboxResetNorthPitch, MapboxRotateTo, MapboxSnapToNorth, MapboxStyleConfig, MapboxZoomLevel } from './mapbox';
8
8
  import { DbxMapboxService } from './mapbox.service';
9
9
  import { DbxInjectionComponentConfig } from '@dereekb/dbx-core';
10
+ import { MapboxViewportBoundFunction } from './mapbox.util';
10
11
  import * as i0 from "@angular/core";
11
12
  export declare type MapboxMapLifecycleState = 'init' | 'load' | 'render' | 'idle';
12
13
  export declare type MapboxMapMoveState = 'init' | 'idle' | 'moving';
@@ -34,6 +35,10 @@ export interface DbxMapboxStoreState {
34
35
  moveState: MapboxMapMoveState;
35
36
  zoomState: MapboxMapZoomState;
36
37
  rotateState: MapboxMapRotateState;
38
+ /**
39
+ * Visual container size of the map.
40
+ */
41
+ mapCanvasSize?: Maybe<Vector>;
37
42
  /**
38
43
  * Latest click event
39
44
  */
@@ -70,6 +75,7 @@ export interface DbxMapboxStoreState {
70
75
  */
71
76
  export declare class DbxMapboxMapStore extends ComponentStore<DbxMapboxStoreState> implements OnDestroy {
72
77
  private readonly dbxMapboxService;
78
+ private safeLatLngPoint;
73
79
  private latLngPoint;
74
80
  private latLngBound;
75
81
  constructor(dbxMapboxService: DbxMapboxService);
@@ -129,6 +135,7 @@ export declare class DbxMapboxMapStore extends ComponentStore<DbxMapboxStoreStat
129
135
  readonly centerGivenMargin$: Observable<LatLngPoint>;
130
136
  readonly boundNow$: Observable<LatLngBound>;
131
137
  readonly bound$: Observable<LatLngBound>;
138
+ readonly boundSizing$: Observable<LatLngPoint>;
132
139
  readonly boundWrapsAroundWorld$: Observable<boolean>;
133
140
  readonly isWithinBoundFunction$: Observable<IsWithinLatLngBoundFunction>;
134
141
  readonly overlapsBoundFunction$: Observable<OverlapsLatLngBoundFunction>;
@@ -140,6 +147,9 @@ export declare class DbxMapboxMapStore extends ComponentStore<DbxMapboxStoreStat
140
147
  readonly bearing$: Observable<number>;
141
148
  readonly content$: Observable<Maybe<DbxInjectionComponentConfig<unknown>>>;
142
149
  readonly hasContent$: Observable<boolean>;
150
+ readonly currentMapCanvasSize$: Observable<Maybe<Vector>>;
151
+ readonly mapCanvasSize$: Observable<Vector>;
152
+ readonly viewportBoundFunction$: Observable<MapboxViewportBoundFunction>;
143
153
  readonly clickEvent$: Observable<Maybe<DbxMapboxClickEvent>>;
144
154
  readonly doubleClickEvent$: Observable<Maybe<DbxMapboxClickEvent>>;
145
155
  readonly rightClickEvent$: Observable<Maybe<DbxMapboxClickEvent>>;
@@ -149,6 +159,7 @@ export declare class DbxMapboxMapStore extends ComponentStore<DbxMapboxStoreStat
149
159
  private readonly _setMoveState;
150
160
  private readonly _setZoomState;
151
161
  private readonly _setRotateState;
162
+ private readonly _setMapCanvasSize;
152
163
  private readonly _setClickEvent;
153
164
  private readonly _setDoubleClickEvent;
154
165
  private readonly _setRightClickEvent;
@@ -0,0 +1,27 @@
1
+ import { LatLngBound, LatLngPoint, Vector } from '@dereekb/util';
2
+ import { MapboxTileSize, MapboxZoomLevel } from './mapbox';
3
+ export interface MapboxViewportBoundFunctionConfig {
4
+ readonly mapCanvasSize: Vector;
5
+ /**
6
+ * Mapbox tilesize being used. Defaults to 512x512.
7
+ */
8
+ readonly tileSize?: MapboxTileSize;
9
+ }
10
+ /**
11
+ * Input for MapboxViewportBoundFunction.
12
+ */
13
+ export interface MapboxViewportBoundFunctionInput {
14
+ /**
15
+ * Center of the viewport
16
+ */
17
+ readonly center: LatLngPoint;
18
+ /**
19
+ * Zoom level
20
+ */
21
+ readonly zoom: MapboxZoomLevel;
22
+ }
23
+ /**
24
+ * Used to calculate the bounds of a view/object given the input MapboxViewportBoundFunctionInput.
25
+ */
26
+ export declare type MapboxViewportBoundFunction = (input: MapboxViewportBoundFunctionInput) => LatLngBound;
27
+ export declare function mapboxViewportBoundFunction(config: MapboxViewportBoundFunctionConfig): MapboxViewportBoundFunction;
@@ -1,14 +1,15 @@
1
1
  {
2
2
  "name": "@dereekb/dbx-web/mapbox",
3
- "version": "9.6.4",
3
+ "version": "9.7.1",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^14.1.0",
6
6
  "@angular/core": "^14.1.0",
7
7
  "rxjs": "^7.5.0",
8
- "@dereekb/util": "9.6.4",
9
- "@dereekb/dbx-web": "9.6.4",
8
+ "@dereekb/util": "9.7.1",
9
+ "@dereekb/dbx-web": "9.7.1",
10
10
  "ngx-mapbox-gl": "^9.1.0",
11
- "mapbox-gl": "^2.9.2"
11
+ "mapbox-gl": "^2.9.2",
12
+ "@mapbox/geo-viewport": "git+https://git@github.com/dereekb/geo-viewport#165513972f87dca23a20c177f4d173edc51b5e2f"
12
13
  },
13
14
  "dependencies": {
14
15
  "tslib": "^2.3.0"
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@dereekb/dbx-web",
3
- "version": "9.6.4",
3
+ "version": "9.7.1",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^14.0.0",
6
6
  "@angular/core": "^14.0.0",
7
7
  "linkify-string": "4.0.0-beta.5",
8
8
  "linkifyjs": "^4.0.0-beta.5",
9
9
  "@angular/material": "^14.0.0",
10
- "@dereekb/rxjs": "9.6.4",
11
- "@dereekb/dbx-core": "9.6.4",
10
+ "@dereekb/rxjs": "9.7.1",
11
+ "@dereekb/dbx-core": "9.7.1",
12
12
  "angular-calendar": "^0.30.1",
13
13
  "@angular/flex-layout": "^14.0.0-beta.40",
14
14
  "ng-overlay-container": "^14.0.0",