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.7.0 #13292

Open
wants to merge 39 commits into
base: main
Choose a base branch
from
Open

v3.7.0 #13292

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
cdd42b8
Do not use 3D stencil mode for 2D fill layers (internal-1836)
endanke Sep 13, 2024
a5eec6a
Minor type improvements (internal-1835)
stepankuzmin Sep 13, 2024
f689e7a
Bump @types/jest from 29.5.12 to 29.5.13 (internal-1844)
dependabot[bot] Sep 16, 2024
6fcb3ee
Bump testem from 3.15.1 to 3.15.2 (internal-1843)
dependabot[bot] Sep 16, 2024
8cc39cc
Bump eslint-plugin-jsdoc from 50.2.2 to 50.2.3 (internal-1848)
dependabot[bot] Sep 16, 2024
e7be9e2
Bump playwright from 1.47.0 to 1.47.1 (internal-1847)
dependabot[bot] Sep 16, 2024
1922c96
Bump the vitest-dependencies group with 3 updates (internal-1837)
dependabot[bot] Sep 17, 2024
9313403
Bump the eslint-dependencies group with 3 updates (internal-1838)
dependabot[bot] Sep 17, 2024
dd5e408
Bump tape from 5.8.1 to 5.9.0 (internal-1841)
dependabot[bot] Sep 17, 2024
e417a95
Bump serve-static from 1.15.0 to 1.16.2 (internal-1842)
dependabot[bot] Sep 17, 2024
b2f2eeb
Bump @types/node from 22.5.4 to 22.5.5 (internal-1840)
dependabot[bot] Sep 17, 2024
f903985
Bump postcss from 8.4.45 to 8.4.47 (internal-1845)
dependabot[bot] Sep 17, 2024
ad0256a
Bump tsx from 4.19.0 to 4.19.1 (internal-1846)
dependabot[bot] Sep 17, 2024
861a39d
Bump eslint from 8.57.0 to 8.57.1 (internal-1849)
dependabot[bot] Sep 17, 2024
19f33bc
Bump chokidar from 3.6.0 to 4.0.0 (internal-1839)
dependabot[bot] Sep 17, 2024
8d7fbd9
Small updates for test release pages (internal-1853)
underoot Sep 17, 2024
27c00a3
[MAPS3D-1416] Refactor Texture.update to use texStorage2D for all tex…
speps Sep 18, 2024
dd618d4
Image with two parameters expression tests (internal-1856)
woodroof Sep 18, 2024
2c309f9
Make fill-extrusion emissive-strength and flood-light-color data-driv…
endanke Sep 18, 2024
ab43f01
Revert "Make fill-extrusion-flood-light-color data-driven" (internal-…
endanke Sep 19, 2024
6e8f83b
Added render test where image is added after a layer with coalesce ex…
woodroof Sep 19, 2024
5282f1b
Set pitch to zero in render-tests/color-theme/red-chicago (internal-1…
endanke Sep 23, 2024
19e548d
Add elevated road rendering support for line shaders (internal-1861)
mpulkki-mapbox Sep 23, 2024
c4d68ad
Add background-pitch-alignment property (internal-1862)
endanke Sep 23, 2024
f067bff
[GLJS-1003] Add GL JS Storage Usage Policy (internal-1852)
underoot Sep 23, 2024
59d44bb
Bump eslint-plugin-html from 8.1.1 to 8.1.2 (internal-1867)
dependabot[bot] Sep 23, 2024
bf21034
Bump eslint-plugin-jsdoc from 50.2.3 to 50.2.4 (internal-1870)
dependabot[bot] Sep 23, 2024
9cd1869
Bump chokidar from 4.0.0 to 4.0.1 (internal-1871)
dependabot[bot] Sep 23, 2024
450d925
Bump the rollup-dependencies group with 3 updates (internal-1864)
dependabot[bot] Sep 24, 2024
0ba7b70
Bump the eslint-dependencies group with 3 updates (internal-1865)
dependabot[bot] Sep 24, 2024
fffe2ac
Bump esbuild from 0.23.1 to 0.24.0 (internal-1868)
dependabot[bot] Sep 24, 2024
dffe0f1
Bump @types/node from 22.5.5 to 22.6.1 (internal-1869)
dependabot[bot] Sep 24, 2024
ee0df04
Bump playwright from 1.47.1 to 1.47.2 (internal-1866)
dependabot[bot] Sep 24, 2024
17cb96d
Fix disappearing fill extrusions in zoom happening with conflation (i…
jtorresfabra Sep 24, 2024
d444092
[GLJS-952] Add `retainPadding` for camera movements options (internal…
underoot Sep 25, 2024
ba5217d
Remove iOS and Android from basic func list (internal-1790)
pjleonard37 Sep 25, 2024
8abc9f4
Adding a new render test for a broken case in GL Native (internal-1874)
woodroof Sep 25, 2024
67672bc
[MAPS3D-1467] Fix precision related flickering on far plane (internal…
astojilj Sep 26, 2024
f8f2563
v3.7.0
mourner Sep 26, 2024
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
2 changes: 0 additions & 2 deletions 3d-style/data/bucket/model_bucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,8 @@ class ModelBucket implements Bucket {
id: featureId,
sourceLayerIndex,
index,
// @ts-expect-error - TS2345 - Argument of type 'VectorTileFeature' is not assignable to parameter of type 'FeatureWithGeometry'.
geometry: needGeometry ? evaluationFeature.geometry : loadGeometry(feature, canonical, tileTransform),
properties: feature.properties,
// @ts-expect-error - TS2322 - Type '0 | 2 | 1 | 3' is not assignable to type '2 | 1 | 3'.
type: feature.type,
patterns: {}
};
Expand Down
2 changes: 1 addition & 1 deletion 3d-style/data/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ export default class Model {
}

export function uploadTexture(texture: ModelTexture, context: Context, useSingleChannelTexture: boolean = false) {
const textureFormat = useSingleChannelTexture ? context.gl.R8 : context.gl.RGBA;
const textureFormat = useSingleChannelTexture ? context.gl.R8 : context.gl.RGBA8;
if (!texture.uploaded) {
const useMipmap = texture.sampler.minFilter >= context.gl.NEAREST_MIPMAP_NEAREST;
texture.gfxTexture = new Texture(context, texture.image, textureFormat, {useMipmap});
Expand Down
5 changes: 1 addition & 4 deletions 3d-style/render/draw_model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function setupMeshDraw(definesValues: Array<string>, dynamicBuffers: Array<Verte
setupTexture(emissionTexture, 'HAS_TEXTURE_u_emissionTexture', TextureSlots.Emission);
if (lut) {
if (!lut.texture) {
lut.texture = new Texture3D(painter.context, lut.image, [lut.image.height, lut.image.height, lut.image.height], context.gl.RGBA);
lut.texture = new Texture3D(painter.context, lut.image, [lut.image.height, lut.image.height, lut.image.height], context.gl.RGBA8);
}
context.activeTexture.set(context.gl.TEXTURE0 + TextureSlots.LUT);
if (lut.texture) {
Expand Down Expand Up @@ -990,12 +990,10 @@ function drawBatchedModels(painter: Painter, source: SourceCache, layer: ModelSt
const dynamicBuffers = [];
setupMeshDraw((programOptions.defines as Array<string>), dynamicBuffers, mesh, painter, layer.lut);
if (!hasMapboxFeatures) {
// @ts-expect-error
programOptions.defines.push('DIFFUSE_SHADED');
}

if (singleCascade) {
// @ts-expect-error
programOptions.defines.push('SHADOWS_SINGLE_CASCADE');
}

Expand Down Expand Up @@ -1030,7 +1028,6 @@ function drawBatchedModels(painter: Painter, source: SourceCache, layer: ModelSt
// Handle Texture transform
if (material.occlusionTexture && material.occlusionTexture.offsetScale) {
occlusionTextureTransform = material.occlusionTexture.offsetScale;
// @ts-expect-error
programOptions.defines.push('OCCLUSION_TEXTURE_TRANSFORM');
}

Expand Down
2 changes: 2 additions & 0 deletions 3d-style/render/program/model_program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ export type ModelUniformsType = {
['u_occlusionTextureTransform']: Uniform4f;
};

export type ModelDefinesType = 'DIFFUSE_SHADED' | 'SHADOWS_SINGLE_CASCADE' | 'OCCLUSION_TEXTURE_TRANSFORM';

const modelUniforms = (context: Context): ModelUniformsType => ({
'u_matrix': new UniformMatrix4f(context),
'u_lighting_matrix': new UniformMatrix4f(context),
Expand Down
5 changes: 2 additions & 3 deletions 3d-style/render/shadow_renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,11 @@ export class ShadowRenderer {

const gl = context.gl;
const fbo = context.createFramebuffer(width, height, useColor, 'texture');
const depthTexture = new Texture(context, {width, height, data: null}, gl.DEPTH_COMPONENT);
const depthTexture = new Texture(context, {width, height, data: null}, gl.DEPTH_COMPONENT16);
fbo.depthAttachment.set(depthTexture.texture);

if (useColor) {
const colorTexture = new Texture(context, {width, height, data: null}, gl.RGBA);
const colorTexture = new Texture(context, {width, height, data: null}, gl.RGBA8);
fbo.colorAttachment.set(colorTexture.texture);
}

Expand Down Expand Up @@ -357,7 +357,6 @@ export class ShadowRenderer {
const coords = sourceCache ? sourceCoords[sourceCache.id] : undefined;
if (layer.type !== 'model' && !(coords && coords.length)) continue;

// @ts-expect-error - TS2345 - Argument of type 'void | SourceCache' is not assignable to parameter of type 'SourceCache'.
painter.renderLayer(painter, sourceCache, layer, coords);
}
}
Expand Down
3 changes: 1 addition & 2 deletions 3d-style/style/lights.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ class Lights<P extends LightProps> extends Evented {
}

get(): LightsSpecification {
// @ts-expect-error
this._options.properties = this._transitionable.serialize();
this._options.properties = this._transitionable.serialize() as LightsSpecification['properties'];
return this._options;
}

Expand Down
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
## v3.7.0-beta.1
## v3.7.0

### Features and improvements ✨

- Add `background-pitch-alignment` property of the `background` layer, which is set to `map` by default but can now be set to `viewport`. Useful for highlighting individual features by dimming the rest of the map with a semitransparent background.
- Add new control positions (`top`, `right`, `bottom`, and `left`) (h/t [@Ethan-Guttman](https://github.com/Ethan-Guttman)).
- Add `retainPadding` option for camera movement methods, which can be set to `false` for pre-v3.4 padding behavior.
- Add `config` expression support in layer filter.
- Add symbol elevation properties: `symbol-z-offset` and `symbol-elevation-reference`.
- Add the `fill-z-offset` property for fill layers.
Expand All @@ -13,6 +16,7 @@
- Improve type checking for the `Map#setPaintProperty` and `Map#setLayoutProperty` methods.
- Allow the `string` event type in Map event handlers.
- Expose `RequestTransformFunction`, `ResourceType`, and `RequestParameters` types.
- Improve texture memory footprint on some platforms.

### Bug fixes 🐞
- Fix feature filtering when using 3D lights.
Expand All @@ -22,6 +26,9 @@
- Fix the issue where `minzoom` and `maxzoom` properties were ignored by `clip` layers.
- Fix handling previously hidden models in `clip` layers.
- Fix directional light `cast-shadows` property type.
- Fix an edge case that could produce `setStencilMode`-related error in the console with the dev build.
- Fix an issue where some fill extrusions could temporarily disappear when zooming quickly in certain areas.
- Fix an edge case that could cause flickering on a far plane on high zooms.

## 3.6.0

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ native SDKs. For code and issues specific to the native SDKs, see the
- [Style documentation](https://docs.mapbox.com/mapbox-gl-js/style-spec/)
- [Open source styles](https://github.com/mapbox/mapbox-gl-styles)
- [Contributor documentation](./CONTRIBUTING.md)
- [Browser Data Storage](./STORAGE.md)

[<img width="600" alt="Mapbox GL JS gallery of map images" src="https://static-assets.mapbox.com/www/mapbox-gl-js-gallery.png">](https://www.mapbox.com/mapbox-gljs)

Expand All @@ -34,4 +35,4 @@ Mapbox Web SDK

Copyright © 2021 - 2023 Mapbox, Inc. All rights reserved.

The software and files in this repository (collectively, “Software”) are licensed under the Mapbox TOS for use only with the relevant Mapbox product(s) listed at www.mapbox.com/pricing. This license allows developers with a current active Mapbox account to use and modify the authorized portions of the Software as needed for use only with the relevant Mapbox product(s) through their Mapbox account in accordance with the Mapbox TOS. This license terminates automatically if a developer no longer has a Mapbox account in good standing or breaches the Mapbox TOS. For the license terms, please see the Mapbox TOS at https://www.mapbox.com/legal/tos/ which incorporates the Mapbox Product Terms at www.mapbox.com/legal/service-terms. If this Software is a SDK, modifications that change or interfere with marked portions of the code related to billing, accounting, or data collection are not authorized and the SDK sends limited de-identified location and usage data which is used in accordance with the Mapbox TOS. [Updated 2023-01]
The software and files in this repository (collectively, “Software”) are licensed under the Mapbox TOS for use only with the relevant Mapbox product(s) listed at www.mapbox.com/pricing. This license allows developers with a current active Mapbox account to use and modify the authorized portions of the Software as needed for use only with the relevant Mapbox product(s) through their Mapbox account in accordance with the Mapbox TOS. This license terminates automatically if a developer no longer has a Mapbox account in good standing or breaches the Mapbox TOS. For the license terms, please see the Mapbox TOS at https://www.mapbox.com/legal/tos/ which incorporates the Mapbox Product Terms at www.mapbox.com/legal/service-terms. If this Software is a SDK, modifications that change or interfere with marked portions of the code related to billing, accounting, or data collection are not authorized and the SDK sends limited de-identified location and usage data which is used in accordance with the Mapbox TOS. [Updated 2023-01]
2 changes: 2 additions & 0 deletions STORAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Browser Data Storage
Mapbox GL JS SDK uses the browser [local storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage) system and keys prefixed with `mapbox.eventData` to store telemetry-related data. This data includes a randomly-generated ID that is included in telemetry events that are sent to Mapbox in order to calculate aggregate usage statistics; as well as metadata about telemetry events that is only used locally. This data is not sold to third parties, nor does Mapbox use the data (either alone or in combination with any personal identifiers) for advertising, tracking end users, or creating profiles of individual end users.
1 change: 1 addition & 0 deletions debug/animate-point-along-route.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
body { margin: 0; padding: 0; }
#map { position: absolute; top: 0; bottom: 0; width: 100%; }
</style>
<link rel='stylesheet' href='../dist/mapbox-gl.css'/>
</head>
<body>
<style>
Expand Down
2 changes: 1 addition & 1 deletion debug/globe-with-video.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"sources": {
"video": {
"type": "video",
"urls": [ "ozone.mp4", "https://static-assets.mapbox.com/mapbox-gl-js/ozone2.mp4"],
"urls": [ "https://static-assets.mapbox.com/mapbox-gl-js/ozone2.mp4"],
"coordinates": [
[-180.0, 85.0511287798066],
[180.0, 85.0511287798066],
Expand Down
1 change: 1 addition & 0 deletions debug/image-on-globe.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
font-family: Arial, Helvetica, sans-serif;
}
</style>
<link rel='stylesheet' href='../dist/mapbox-gl.css' />
</head>

<body>
Expand Down
1 change: 1 addition & 0 deletions debug/projections.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
<fieldset>
<label>Select style</label>
<select id="style" name="style">
<option value="standard">Standard</option>
<option value="streets-v11">Streets</option>
<option value="satellite-v9">Satellite</option>
</select>
Expand Down
10 changes: 10 additions & 0 deletions debug/walls.html
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,16 @@
}
});

map.addLayer({
"type": "background",
"id": "dimming-background",
"paint": {
"background-pitch-alignment": "viewport",
"background-color": "black",
"background-opacity": 0.5
}
});

map.addLayer({
"type": "fill",
"id": "floors",
Expand Down
Loading
Loading