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

v3.8.0-beta.1 #13309

Merged
merged 49 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
067aa0c
Enable `noImplicitOverride` (internal-1885)
stepankuzmin Sep 30, 2024
9dd2267
Bump the eslint-dependencies group with 3 updates (internal-1887)
dependabot[bot] Oct 1, 2024
a740f86
Bump @types/node from 22.6.1 to 22.7.4 (internal-1888)
dependabot[bot] Oct 1, 2024
ca939f8
Bump eslint-plugin-jsdoc from 50.2.4 to 50.3.0 (internal-1889)
dependabot[bot] Oct 1, 2024
0be3897
Make fog and terrain lazy properties (internal-1891)
underoot Oct 1, 2024
123357e
Fix conflation intersection test causing fill-extrusions to disappear…
aleksigron Oct 1, 2024
63b8d31
Fix env substitution in access token generation (internal-1893)
stepankuzmin Oct 1, 2024
764d1ee
Fix self-overlap of line corners when large line-width is used (inte…
endanke Oct 2, 2024
1096baf
Reduce line AA if blur is used (internal-1890)
endanke Oct 2, 2024
fafe16d
Add uSVG protobuf decoder (internal-1715)
stepankuzmin Oct 3, 2024
19b5549
Improve internal types (internal-1895)
stepankuzmin Oct 3, 2024
cbbcba1
[MAPS3D-1231] Add fill-extrusion-height-alignment and fill-extrusion-…
speps Oct 4, 2024
f5dd237
[GLJS-1019] Fix inlined TileJSON recursive structure (internal-1899)
underoot Oct 5, 2024
85c05bf
Moved to not-deprecated lodash/template (internal-1900)
underoot Oct 5, 2024
b121367
Render tests to cover dynamic terrain and update of terrain after lin…
astojilj Oct 7, 2024
e3e319b
Bump browserify from 17.0.0 to 17.0.1 (internal-1904)
dependabot[bot] Oct 7, 2024
24e54a9
Bump @types/node from 22.7.4 to 22.7.5 (internal-1905)
dependabot[bot] Oct 7, 2024
0db690d
Bump eslint-plugin-jsdoc from 50.3.0 to 50.3.1 (internal-1907)
dependabot[bot] Oct 7, 2024
37643a9
Bump the vitest-dependencies group with 3 updates (internal-1902)
dependabot[bot] Oct 8, 2024
6343643
Bump the eslint-dependencies group with 3 updates (internal-1903)
dependabot[bot] Oct 8, 2024
8ffb56a
Bump eslint-plugin-import from 2.30.0 to 2.31.0 (internal-1906)
dependabot[bot] Oct 8, 2024
e57a7e5
Added expression tests for image options (internal-1908)
woodroof Oct 8, 2024
7c645ea
Bump typescript from 5.6.2 to 5.6.3 (internal-1917)
dependabot[bot] Oct 14, 2024
cf806c2
Bump stylelint from 16.9.0 to 16.10.0 (internal-1916)
dependabot[bot] Oct 15, 2024
d20673c
Bump playwright from 1.47.2 to 1.48.0 (internal-1915)
dependabot[bot] Oct 15, 2024
7aa5973
Bump eslint-plugin-jsdoc from 50.3.1 to 50.4.1 (internal-1918)
dependabot[bot] Oct 15, 2024
9a83609
Bump the eslint-dependencies group with 3 updates (internal-1914)
dependabot[bot] Oct 15, 2024
683ba6b
Bump the vitest-dependencies group with 3 updates (internal-1913)
dependabot[bot] Oct 15, 2024
2cc5b42
Rename NATIVE to TEXTURE_GATHER in shadow prelude (internal-1919)
speps Oct 16, 2024
93f80a8
[GLJS-877] Implement Featuresets specification + Interactions API imp…
mourner Oct 16, 2024
d377458
Add uSVG protobuf renderer (internal-1759)
stepankuzmin Oct 16, 2024
a6583e5
[GLJS-1048] Fix missing feature state in the interaction handlers (in…
stepankuzmin Oct 17, 2024
c6fd404
[GLJS-387] Drop `API_URL_REGEX` build-time configuration support (int…
stepankuzmin Oct 17, 2024
89c10ce
[MAPS3D-1488] Initial precipitation support (internal-1912)
alexey-romanov Oct 17, 2024
378187d
[GLJS-1049] Fix feature state getter during tile bucket update (inter…
stepankuzmin Oct 18, 2024
0a49b63
Skip edge straightening based on sharpCornerOffset (internal-1927)
endanke Oct 21, 2024
6cc1d57
Bump eslint-plugin-jsdoc from 50.4.1 to 50.4.3 (internal-1933)
dependabot[bot] Oct 22, 2024
9dead1d
Bump playwright from 1.48.0 to 1.48.1 (internal-1931)
dependabot[bot] Oct 22, 2024
2be0ea8
Bump the eslint-dependencies group with 3 updates (internal-1930)
dependabot[bot] Oct 22, 2024
0b4fa5f
Bump @types/node from 22.7.5 to 22.7.7 (internal-1932)
dependabot[bot] Oct 22, 2024
d863bfc
Bump @rollup/plugin-commonjs in the rollup-dependencies group (intern…
dependabot[bot] Oct 22, 2024
fc8671f
[MAPS3D-1423][MAPS3D-1458] Introduce line-cross-slope and line-elevat…
lasselammi Oct 23, 2024
d11030a
Upgrade MRT library (internal-1936)
rreusser Oct 23, 2024
eda65a6
[GLJS-1056] Remove experimental tag from clip layer (internal-1937)
underoot Oct 24, 2024
7d6cad5
[GLJS-844] Fixes RasterArray, set sampler2D to highp (internal-1938)
smartties Oct 24, 2024
253f2e1
[GLJS-1050] Align Featureset API with Native (internal-1928)
stepankuzmin Oct 25, 2024
f27c898
[GLJS-1013] Fix rendering of Osage script; don't fail on non-renderab…
mourner Oct 25, 2024
5ab0e67
[GLJS-980] Global scale factor (internal-1809)
underoot Oct 25, 2024
fa70264
v3.8.0-beta.1 (internal-1939)
underoot Oct 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
22 changes: 22 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ workflows:
filters:
tags:
only: /.*/
- test-usvg:
requires:
- setup-playwright
filters:
tags:
only: /.*/
- test-csp:
requires:
- setup-playwright
Expand Down Expand Up @@ -365,6 +371,22 @@ jobs:
- store_test_results:
path: test/unit/test-results.xml

test-usvg:
<<: *linux-defaults
steps:
- attach_workspace:
at: ~/
- run:
name: Run usvg tests
command: |
tar xvzf test/usvg/test-suite.tar.gz -C test/usvg/
npm run test-usvg
no_output_timeout: 5m
- store_artifacts:
path: test/usvg/vitest
- store_test_results:
path: test/usvg/test-results.xml

test-query:
<<: *linux-defaults
steps:
Expand Down
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"parserOptions": {
"projectService": {
"defaultProject": "./tsconfig.json",
"allowDefaultProject": ["*.js"]
"allowDefaultProject": ["*.js", "debug/*", "build/*"]
}
},
"plugins": [
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,9 @@ vitest.config.js.*

tsconfig.tsbuildinfo
bundle-analysis.html

# tmp usvg ignores
test/usvg/vitest/
test/usvg/test-suite/
test/usvg/test-results.xml
src/data/usvg/usvg_pb_renderer.js
15 changes: 6 additions & 9 deletions 3d-style/data/bucket/model_bucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@ import type {TileFootprint} from '../../../3d-style/util/conflation';

class ModelFeature {
feature: EvaluationFeature;
featureStates: FeatureState;
instancedDataOffset: number;
instancedDataCount: number;

rotation: Array<number>;
scale: Array<number>;
translation: Array<number>;
rotation: vec3;
scale: vec3;
translation: vec3;

constructor(feature: EvaluationFeature, offset: number) {
this.feature = feature;
Expand Down Expand Up @@ -83,9 +84,7 @@ class ModelBucket implements Bucket {
stateDependentLayerIds: Array<string>;
hasPattern: boolean;

instancesPerModel: {
string: PerModelAttributes;
};
instancesPerModel: Record<string, PerModelAttributes>;

uploaded: boolean;

Expand Down Expand Up @@ -128,7 +127,6 @@ class ModelBucket implements Bucket {

this.stateDependentLayerIds = this.layers.filter((l) => l.isStateDependent()).map((l) => l.id);
this.hasPattern = false;
// @ts-expect-error - TS2741 - Property 'string' is missing in type '{}' but required in type '{ string: PerModelAttributes; }'.
this.instancesPerModel = {};
this.validForExaggeration = 0;
this.maxVerticalOffset = 0;
Expand Down Expand Up @@ -419,8 +417,7 @@ class ModelBucket implements Bucket {
const color = layer.paint.get('model-color').evaluate(evaluationFeature, featureState, canonical);

color.a = layer.paint.get('model-color-mix-intensity').evaluate(evaluationFeature, featureState, canonical);
// @ts-expect-error - TS2322 - Type '[]' is not assignable to type 'mat4'.
const rotationScaleYZFlip: mat4 = [];
const rotationScaleYZFlip = [] as unknown as mat4;
if (this.maxVerticalOffset < translation[2]) this.maxVerticalOffset = translation[2];
this.maxScale = Math.max(Math.max(this.maxScale, scale[0]), Math.max(scale[1], scale[2]));

Expand Down
39 changes: 17 additions & 22 deletions 3d-style/data/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,13 @@ export function calculateModelMatrix(matrix: mat4, model: Readonly<Model>, state
if (state.elevation) {
elevation = state.elevation.getAtPointOrZero(new MercatorCoordinate(projectedPoint.x / worldSize, projectedPoint.y / worldSize), 0.0);
}
// @ts-expect-error - TS2345 - Argument of type 'number[] | Float32Array | Float64Array' is not assignable to parameter of type 'ReadonlyMat4'.
const mercProjPos = vec4.transformMat4([] as any, [projectedPoint.x, projectedPoint.y, elevation, 1.0], state.projMatrix);
const mercProjectionScale = mercProjPos[3] / state.cameraToCenterDistance;
const viewMetersPerPixel = getMetersPerPixelAtLatitude(state.center.lat, zoom);
scaleXY = mercProjectionScale;
scaleZ = mercProjectionScale * viewMetersPerPixel;
} else if (state.projection.name === 'globe') {
const globeMatrix = convertModelMatrixForGlobe(matrix, state);
// @ts-expect-error - TS2345 - Argument of type 'number[] | Float32Array | Float64Array' is not assignable to parameter of type 'ReadonlyMat4'.
const worldViewProjection = mat4.multiply([] as any, state.projMatrix, globeMatrix);
const globeProjPos = [0, 0, 0, 1];
vec4.transformMat4(globeProjPos as [number, number, number, number], globeProjPos as [number, number, number, number], worldViewProjection);
Expand All @@ -209,32 +207,30 @@ export function calculateModelMatrix(matrix: mat4, model: Readonly<Model>, state

// When applying physics (rotation) we need to insert rotation matrix
// between model rotation and transforms above. Keep the intermediate results.
const modelMatrixBeforeRotationScaleYZFlip = [...matrix];
const modelMatrixBeforeRotationScaleYZFlip = [...matrix] as mat4;

const orientation = model.orientation;

// @ts-expect-error - TS2322 - Type '[]' is not assignable to type 'mat4'.
const rotationScaleYZFlip: mat4 = [];
rotationScaleYZFlipMatrix(rotationScaleYZFlip,
[orientation[0] + rotation[0],
orientation[1] + rotation[1],
orientation[2] + rotation[2]],
scale);
// @ts-expect-error - TS2345 - Argument of type '[number]' is not assignable to parameter of type 'ReadonlyMat4'. | TS2352 - Conversion of type 'mat4' to type '[]' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
mat4.multiply(matrix, modelMatrixBeforeRotationScaleYZFlip as [number], rotationScaleYZFlip as []);
const rotationScaleYZFlip = [] as unknown as mat4;
rotationScaleYZFlipMatrix(
rotationScaleYZFlip,
[
orientation[0] + rotation[0],
orientation[1] + rotation[1],
orientation[2] + rotation[2]
],
scale
);
mat4.multiply(matrix, modelMatrixBeforeRotationScaleYZFlip, rotationScaleYZFlip);

if (applyElevation && state.elevation) {
let elevate = 0;
const rotateOnTerrain = [];
const rotateOnTerrain = [] as unknown as quat;
if (followTerrainSlope && state.elevation) {
// @ts-expect-error - TS2345 - Argument of type 'any[]' is not assignable to parameter of type 'quat'.
elevate = positionModelOnTerrain(rotateOnTerrain, state, model.aabb, matrix, position);
// @ts-expect-error - TS2345 - Argument of type '[]' is not assignable to parameter of type 'ReadonlyQuat'.
const rotationOnTerrain = mat4.fromQuat([] as any, rotateOnTerrain as []);
// @ts-expect-error - TS2345 - Argument of type '[]' is not assignable to parameter of type 'ReadonlyMat4'. | TS2352 - Conversion of type 'mat4' to type '[]' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
const appendRotation = mat4.multiply([] as any, rotationOnTerrain, rotationScaleYZFlip as []);
// @ts-expect-error - TS2345 - Argument of type '[number]' is not assignable to parameter of type 'ReadonlyMat4'.
mat4.multiply(matrix, modelMatrixBeforeRotationScaleYZFlip as [number], appendRotation);
const rotationOnTerrain = mat4.fromQuat([] as unknown as mat4, rotateOnTerrain);
const appendRotation = mat4.multiply([] as any, rotationOnTerrain, rotationScaleYZFlip);
mat4.multiply(matrix, modelMatrixBeforeRotationScaleYZFlip, appendRotation);
} else {
elevate = state.elevation.getAtPointOrZero(new MercatorCoordinate(projectedPoint.x / worldSize, projectedPoint.y / worldSize), 0.0);
}
Expand All @@ -261,8 +257,7 @@ export default class Model {
this.nodes = nodes;
this.uploaded = false;
this.aabb = new Aabb([Infinity, Infinity, Infinity], [-Infinity, -Infinity, -Infinity]);
// @ts-expect-error - TS2322 - Type '[]' is not assignable to type 'mat4'.
this.matrix = [];
this.matrix = [] as unknown as mat4;
}

_applyTransformations(node: Node, parentMatrix: mat4) {
Expand Down
Loading
Loading