Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update Viewport type #3178

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions modules/tiles/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import {Vector3} from '@math.gl/core';

export type BoundingRectangle = {
width: number;
height: number;
Expand All @@ -9,17 +7,17 @@ export type BoundingRectangle = {
* We can't import it from Deck.gl to avoid circular reference */
export type Viewport = {
id: string;
cameraPosition: number[] | Vector3;
cameraPosition: [number,number,number] ;
height: number;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't be compatible with Vector3 (which inherits Array<number>) and will break code. We should probably use the Vector3Like type from math.gl or equivalently [number,number,number] | Vector3.

Also make sure to run yarn lint fix so that prettier autoformats the code, or insert spaces after commas.

width: number;
zoom: number;
distanceScales: {
unitsPerMeter: number[];
metersPerUnit: number[];
};
center: number[] | Vector3;
unprojectPosition: (position: number[] | Vector3) => [number, number, number];
project: (coorinates: number[] | Vector3) => number[];
center: [number,number,number] ;
unprojectPosition: (position: [number,number,number]) => [number, number, number];
project: (coordinates: [number,number,number] ) => [number,number,number];
};

/**
Expand Down
Loading