@dereekb/dbx-web 13.11.14 → 13.11.16

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.
@@ -71,7 +71,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
71
71
  * Creates a function that calculates the geographic bounds of a Mapbox viewport given a center point and zoom level.
72
72
  *
73
73
  * @param config - Configuration specifying the map canvas size and optional tile size.
74
- * @returns A function that accepts a center point and zoom level and returns the corresponding {@link LatLngBound}.
74
+ * @returns Accepts a center point and zoom level and returns the corresponding {@link LatLngBound}.
75
75
  */
76
76
  function mapboxViewportBoundFunction(config) {
77
77
  const { mapCanvasSize, tileSize = 512 } = config;
@@ -111,12 +111,12 @@ function filterByMapboxViewportBound(config) {
111
111
  const cacheKey = `${zoomStep}_${centerLatLng.lat}_${centerLatLng.lng}`;
112
112
  const cachedValue = cache.get(cacheKey);
113
113
  let bound;
114
- if (!cachedValue) {
115
- bound = viewportBoundFunction({ center: centerLatLng, zoom: zoomStep });
116
- cache.set(cacheKey, bound);
114
+ if (cachedValue) {
115
+ bound = cachedValue;
117
116
  }
118
117
  else {
119
- bound = cachedValue;
118
+ bound = viewportBoundFunction({ center: centerLatLng, zoom: zoomStep });
119
+ cache.set(cacheKey, bound);
120
120
  }
121
121
  return {
122
122
  value,
@@ -857,10 +857,14 @@ class DbxMapboxLayoutComponent {
857
857
  this.isDrawerOpenSignal.set(this.openDrawer());
858
858
  }, ...(ngDevMode ? [{ debugName: "_openDrawerEffect" }] : /* istanbul ignore next */ []));
859
859
  storeHasDrawerContent = toSignal(this.dbxMapboxMapStore.hasDrawerContent$);
860
- drawerHasContentSignal = computed(() => this.forceHasDrawerContent() ?? this.storeHasDrawerContent(), ...(ngDevMode ? [{ debugName: "drawerHasContentSignal" }] : /* istanbul ignore next */ []));
860
+ drawerHasContentSignal = computed(() => {
861
+ const storeHasDrawerContent = this.storeHasDrawerContent();
862
+ return this.forceHasDrawerContent() ?? storeHasDrawerContent;
863
+ }, ...(ngDevMode ? [{ debugName: "drawerHasContentSignal" }] : /* istanbul ignore next */ []));
861
864
  refreshContentMargins$ = this._refreshContentMargins;
862
865
  isOpenAndHasContentSignal = computed(() => {
863
- return this.drawerHasContentSignal() && this.isDrawerOpenSignal();
866
+ const isDrawerOpen = this.isDrawerOpenSignal();
867
+ return this.drawerHasContentSignal() && isDrawerOpen;
864
868
  }, ...(ngDevMode ? [{ debugName: "isOpenAndHasContentSignal" }] : /* istanbul ignore next */ []));
865
869
  viewResized$ = this._viewResized.asObservable();
866
870
  side$ = toObservable(this.side);
@@ -921,11 +925,11 @@ class DbxMapboxLayoutComponent {
921
925
  };
922
926
  const easeTo = this.dbxMapboxMapStore.calculateNextCenterOffsetWithScreenMarginChange(margin).pipe(first(), map((center) => ({ to: { center, duration: 3200, essential: false } })));
923
927
  this.dbxMapboxMapStore.setMargin(opened ? margin : undefined);
924
- if (!init) {
925
- this.dbxMapboxMapStore.easeTo(easeTo);
928
+ if (init) {
929
+ init = true;
926
930
  }
927
931
  else {
928
- init = true;
932
+ this.dbxMapboxMapStore.easeTo(easeTo);
929
933
  }
930
934
  });
931
935
  }));
@@ -1343,8 +1347,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
1343
1347
  /**
1344
1348
  * Creates EnvironmentProviders for providing DbxMapboxConfig and configuring the NgxMapboxGLModule.
1345
1349
  *
1346
- * @param config Configuration
1347
- * @returns EnvironmentProviders
1350
+ * @param config - Configuration.
1351
+ * @returns EnvironmentProviders.
1348
1352
  */
1349
1353
  function provideDbxMapbox(config) {
1350
1354
  const { dbxMapboxConfig, ngxMapboxGLModuleConfig } = config;