Skip to content

Commit

Permalink
Fixed type
Browse files Browse the repository at this point in the history
  • Loading branch information
nerik committed Sep 21, 2023
1 parent 12b1a9c commit b18c3f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/scripts/components/common/map/hooks/use-fit-bbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function useFitBbox(
| [number, number, number, number]
| undefined;

if (bounds?.length && checkFitBoundsFromLayer(bounds, mapInstance as any)) {
if (bounds?.length && checkFitBoundsFromLayer(bounds, mapInstance)) {
mapInstance.fitBounds(bounds, { padding: FIT_BOUNDS_PADDING });
}
}, [mapInstance, isUserPositionSet, initialBbox, stacBbox]);
Expand Down
3 changes: 2 additions & 1 deletion app/scripts/components/common/map/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import axios, { Method } from 'axios';
import { Map as MapboxMap } from 'mapbox-gl';
import { MapRef } from 'react-map-gl';
import { endOfDay, startOfDay } from "date-fns";
import { StacFeature } from "./types";
import { userTzDate2utcString } from "$utils/date";
Expand Down Expand Up @@ -35,7 +36,7 @@ export function getMergedBBox(features: StacFeature[]) {

export function checkFitBoundsFromLayer(
layerBounds?: [number, number, number, number],
mapInstance?: MapboxMap
mapInstance?: MapboxMap | MapRef
) {
if (!layerBounds || !mapInstance) return false;

Expand Down

0 comments on commit b18c3f6

Please sign in to comment.