Skip to content

Commit

Permalink
Merge pull request #803 from opentripplanner/PRJ77-490
Browse files Browse the repository at this point in the history
Add 'boundsFitting' prop to manage camera manipulation via zoomToGeoJSON method
  • Loading branch information
miles-grant-ibigroup authored Dec 26, 2024
2 parents c80a29d + cfed5a7 commit d1f88e8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/transitive-overlay/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ const accessLegFilter = [
type Props = {
activeLeg?: Leg;
accessLegColorOverride?: string;
boundsFitting?: boolean;
showRouteArrows?: boolean;
transitiveData?: TransitiveData;
};
Expand Down Expand Up @@ -116,6 +117,7 @@ const loadImages = (map: MapRef, images: MapImage[]) => {
const TransitiveCanvasOverlay = ({
activeLeg,
accessLegColorOverride,
boundsFitting = true,
showRouteArrows,
transitiveData
}: Props): JSX.Element => {
Expand Down Expand Up @@ -227,6 +229,7 @@ const TransitiveCanvasOverlay = ({
};

const zoomToGeoJSON = geoJson => {
if (!boundsFitting) return;
const b = bbox(geoJson);
const bounds: [number, number, number, number] = [b[0], b[1], b[2], b[3]];

Expand Down

0 comments on commit d1f88e8

Please sign in to comment.