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.0.0 #12988

Merged
merged 29 commits into from
Nov 29, 2023
Merged

v3.0.0 #12988

merged 29 commits into from
Nov 29, 2023

Conversation

stepankuzmin
Copy link
Contributor

@stepankuzmin stepankuzmin commented Nov 29, 2023

Mapbox GL JS v3 enables the Mapbox Standard Style, a new realistic 3D lighting system, building shadows and many other visual enhancements, and an ergonomic API for using a new kind of rich, evolving, configurable map styles and seamless integration with custom data. You can get more information about the new features in the Mapbox GL JS v3 migration guide.

v3.0.0

Breaking changes ⚠️

  • Discontinue WebGL 1 support. WebGL 2 is now mandatory for GL JS v3 usage, aligned with universal browser support.
  • Remove the optimizeForTerrain map option (layer rendering on globe and terrain is always optimized now).

Features and improvements ✨

3D Lights

  • Introduced a new 3D Lights API that supports directional and ambient light sources to give you control of lighting and shadows in your map when using 3D objects.
  • Add new *-emissive-strength properties for styling layers with the new lighting API.
  • Introduced flood lighting for the extruded buildings' walls and the ground beneath them.
  • Introduced ambient occlusion to affect the ground beneath the extruded buildings.
  • Introduced measureLight expression lights configuration property: Create dynamic styles based on lighting conditions.
  • Added support for shadows cast from fill extrusions.
  • Introduced hsl and hsla color expressions: These expressions allow you to define colors using hue, saturation, and lightness format.
  • Add support for fading out 3D layers in the distance with fill-extrusion-cutoff-fade-range and model-cutoff-fade-range style properties.

Style Composition with Imports

  • Introducing support for nested and configurable styles. You can now import other styles into your main style, with updates to imported styles automatically reflected in your main style. Configuration properties can be set for imported styles, making them customizable.
  • Introduced concept of slots, pre-specified locations in the style, where your layer can be added (e.g., on top of existing land layers but below all labels).
  • Introduced config expression: Retrieves the configuration value for the given option.
  • When no style option is provided to the Map constructor, the Mapbox Standard Style is now enabled as a default.
  • Add a style.import.load event to track the loading of imported style fragments.

Terrain Improvements

  • Improve terrain sampling accuracy.
  • Improve zooming and panning over dynamic terrain so that it feels smooth.
  • Improve performance for styles that use both hillshade layers and terrain.

New Raster Features

  • Introduced raster colorization via raster-color paint properties.
  • Introduced raster-value expression: Returns the raster value of a pixel computed via raster-color-mix.

…and more!

  • Add support for controlling the vertical fog range with vertical-range style property.
  • Introduced rounding fill extrusion edges for a smoother appearance.
  • Introduced the icon-image-cross-fade property, which controls the transitioning between the two variants of an icon image.
  • Introduced random expression: Generate random values using this expression. Use this expression to generate random values, which can be particularly helpful for introducing randomness into your map data.
  • Introduced distance expression: Returns the shortest distance in meters between the evaluated feature and the input geometry.
  • Add support for elevating symbols over buildings & other 3D layers with symbol-z-elevate style property.
  • Improve rendering of stars on globe view.
  • Add the renderstart event, which, combined with the render event, can be used to measure rendering frame duration.
  • Enable zoom-based expressions for model rotation, scale, and translation.
  • Optimize shader compilation to reduce stuttering on complex 3D styles.
  • Reduce flickering of symbols along lines due to rounding errors.

Bug fixes 🐞

  • Fix the accuracy of the atmosphere gradient when rendering the globe.
  • Fix a bug with horizon placement when map padding is used.
  • Fix a bug with horizon rendering on Windows/NVidia.
  • Accessibility fixes: remove tabindex when the map is not interactive; remove role="list" from the attribution control; add role="img" to markers (h/t @kumiko-haraguchi and @aviroopjana).
  • Fix the order of layers in queryRenderedFeatures results on maps with globe and terrain.
  • Fix an error when zooming out on certain globe views using the GL JS development bundle.
  • Fix an error on map hasImage and updateImage after the map was removed.
  • Fix rendering of line layers with data-driven line-border.
  • Fix an issue with symbols sometimes not rendering correctly over the terrain on a top-down view.
  • Remove duplicate frag precision qualifiers

Changes since v3.0.0-rc.2

Bug fixes 🐞

  • Fix stale source caches in imports on projection change.
  • Fix style not updating properly when adding new imports.
  • Fix the breakage of ground effect that occurs when edges cross tile boundaries.
  • Fix circle layer depth occlusion not working properly with the orthographic camera.
  • Fix diffing of the styles with imports on setStyle.
  • Fix GL JS bundle in environments that transpile minified code with async/awaits.
  • Fix queryRenderedFeatures when the model layer is present in the style.
  • Fix stale 3D lights when removing individually.
  • Fix source name collision between imports in symbol layers.
  • Remove duplicate frag precision qualifiers.

stepankuzmin and others added 29 commits November 28, 2023 17:30
* consistent docs

* remove require for model related emissiveness props
…nal-944)

* Reload sources on projection change

* Fix source cache tile cleanup on changing map projection

* Add allowed value to imports/set-projection
…internal-946)

* Don't reset shared style changes when creating fragments

* Add unit test
…oss tile boundaries (internal-943)

* [MAPS3D-1044] Fix breakage of ground effect that occurs when edges cross tile boundaries

* render test
* Fix adding first import

* simplify import management code in style.js (internal-948)

---------

Co-authored-by: Volodymyr Agafonkin <agafonkin@gmail.com>
* Ignore layer slot in style diffs

* Add unit test
…ternal-953)

* [GLJS-584] fix missing condition for circle layer depth occlusion

* add render test
* Diff configs on setStyle

* Add render test
* Fix Style.mergeAll when removing all imports

* Ignore legacy light since it's always set

* Add scope check for terrain in mergeAll

* Add layers check to the unit test

* Cleanup Style._remove()

* Check for terrain or globe on Style.mergeAll()
* Diff slots on setStyle

* Update error message

* Move repeating Style checks to _checkLayer and _checkSource
* Rewrite 3D Style async/await functions to Promises

* Fix decodeGLTF

* Cleanup

* Restrict async/await in ESLint
Bumps [testem](https://github.com/testem/testem) from 3.10.1 to 3.11.0.
- [Release notes](https://github.com/testem/testem/releases)
- [Commits](testem/testem@v3.10.1...v3.11.0)

---
updated-dependencies:
- dependency-name: testem
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Add version information to lights root element
* Mark Models section as private and fix setConfigProperty example

* Mark renderstart event as private

* Move setConfigProperty to the Style properties section

* Move setLights/getLights to the Style properties section

* Update events.js
… (internal-972)

* fix issue with source collision between imports in symbol layers

* Add render test

* Use layer.scope instead of getScopeFromFQID

---------

Co-authored-by: Stepan Kuzmin <stepan.kuzmin@mapbox.com>
@stepankuzmin stepankuzmin requested a review from a team as a code owner November 29, 2023 15:04
3d-style/render/model_manager.js Dismissed Show dismissed Hide dismissed
@stepankuzmin stepankuzmin merged commit 118e87d into main Nov 29, 2023
28 checks passed
@stepankuzmin stepankuzmin deleted the v3-staging-rc branch November 29, 2023 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants