Skip to content

Commit

Permalink
Fixed zoom error on pages which include a “zoom to”
Browse files Browse the repository at this point in the history
  • Loading branch information
dhochbaum-dcp committed Dec 24, 2024
1 parent 7ab60a0 commit 21dca2e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/components/atlas.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import {
} from "./layers";
import type { MapView, MapViewState } from "@deck.gl/core";

const MAX_ZOOM = 20;
const MIN_ZOOM = 10;
export const MAX_ZOOM = 20;
export const MIN_ZOOM = 10;

const INITIAL_VIEW_STATE = {
longitude: -74.0008,
Expand Down
3 changes: 3 additions & 0 deletions app/extensions/FlyToGeoJsonExtension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
} from "@deck.gl/core";
import { bbox } from "@turf/bbox";
import { Geometry } from "geojson";
import { MIN_ZOOM, MAX_ZOOM } from "../components/atlas.client";

export class FlyToGeoJsonExtension extends LayerExtension {
updateState(
Expand Down Expand Up @@ -42,6 +43,8 @@ export class FlyToGeoJsonExtension extends LayerExtension {
zoom: zoom,
transitionDuration: 750,
transitionInterpolator: new FlyToInterpolator(),
maxZoom: MAX_ZOOM,
minZoom: MIN_ZOOM,
};
deckInstance.props.onViewStateChange({
viewState: newViewState,
Expand Down

0 comments on commit 21dca2e

Please sign in to comment.