Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mapbox/mapbox-gl-js
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.0.1
Choose a base ref
...
head repository: mapbox/mapbox-gl-js
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.1.0
Choose a head ref

Commits on Dec 27, 2020

  1. cherry-pick changelog for v2.0.1 (#10239)

    * add changelog and bump package version
    
    * Update style-spec changelog and bump package version
    
    * bump to dev versions
    
    Co-authored-by: Arindam Bose <arindam.bose@mapbox.com>
    ansis and Arindam Bose authored Dec 27, 2020
    Copy the full SHA
    f21691c View commit details

Commits on Jan 5, 2021

  1. Disable terrain vertex morphing in render tests by default (#10255)

    * Add an option to disable terrain vertex morphing
    * Disable vertex morphing in render tests
    * Fix free camera render test
    mpulkki-mapbox authored Jan 5, 2021
    Copy the full SHA
    15f0983 View commit details

Commits on Jan 11, 2021

  1. Return a promise in "once" if no listener provided (#10203)

    * return a promise in "once" if no listener provided
    
    * fix ambiguity in map.once docs
    mourner authored Jan 11, 2021
    Copy the full SHA
    bdfe181 View commit details

Commits on Jan 12, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    2c9c1a6 View commit details

Commits on Jan 13, 2021

  1. Add support for min/max array in style-spec and use it for sky proper…

    …ties (#10272)
    
    * update style spec
    
    * multiple min/max
    
    * edit validation, add test cases
    
    * fix linting error
    
    * add min/max to array element spec
    
    * fix error messages
    
    * Remove render test
    
    * Replace render test line-dasharray/unusual-cases/negative-values by unit test
    
    * Use new test fixturest
    
    Co-authored-by: Karim Naaji <karim.naaji@gmail.com>
    thefifthisa and karimnaaji authored Jan 13, 2021
    Copy the full SHA
    4eda278 View commit details

Commits on Jan 15, 2021

  1. Fix blurry map-aligned labels on terrain (#10296)

    * fix blurry map-pitched labels on terrain
    
    * update render tests
    mourner authored Jan 15, 2021
    Copy the full SHA
    07179fe View commit details

Commits on Jan 20, 2021

  1. Run check-bundle-size script after deploying release to avoid a bug i…

    …n release process (#10285)
    Ryan Hamley authored Jan 20, 2021
    Copy the full SHA
    4740647 View commit details
  2. Fix forked PRs (#10231)

    Ryan Hamley authored Jan 20, 2021
    Copy the full SHA
    fe339a9 View commit details
  3. Hardcode fallback token in release test page (#10306)

    Ryan Hamley authored Jan 20, 2021
    Copy the full SHA
    f352188 View commit details

Commits on Jan 21, 2021

  1. Fix JSDoc lint warnings (#10127)

    * Fix JSDoc lint warnings
    
    * Fix new JSDoc warnings
    Andrew Calder authored Jan 21, 2021
    Copy the full SHA
    d30c030 View commit details
  2. Revert usage of restricted access token for release testing (#10308)

    * Revert "Hardcode fallback token in release test page (#10306)"
    
    This reverts commit f352188.
    
    * Revert 6a2531e
    karimnaaji authored Jan 21, 2021
    Copy the full SHA
    b744c76 View commit details
  3. Copy the full SHA
    b77da4f View commit details
  4. Add option allowing to preserver draw order when terrain is enabled (#…

    …10258)
    
    * Fix issue #10186: not preserving drawn order while using terrain render cache
    
    - Revise terrain render loop to be more explicit and easier to follow from the
      painter render passes:
      - Remove any painter modifications from render() function
      - Extract terrain draw depth to reduce branching and add explicit call from
        painter.render()
      - Make it explicit that all rendering of terrain happens in the translucent
        render pass
    
    - Update terrain.render() to work as follow:
      - In render cache mode:
        . Draw all layers of sequential draped and add to render cache
        . Switch to interleaved render mode (not cached) for other layers
    
    - Add debug/10186 sample code for simple reproduction case
    
    * Update 3d playground with more styles to test from
    
    * Add helper function to calculate render cache efficiency
    
    * Update render test baseline with correct terrain drawn order
    
    * Update 3d playground example
    - Add mapbox/satellite-streets-v11 style
    - Add back mistakenly removed fill-extrusion layer
    
    * Add render tests
    
    * layerEnd -> lastDrawnLayerIndex
    
    * Self review: Comment + renaming
    
    * Check render cache efficiency on style order changes
    
    * Add more information on render cache efficiency warning
    
    * Fix wrong variable naming and unit test to not warn
    
    * Add unit tests
    
    * Calculate list of sequential draped render batches
    
    * Consume draped layer batches
    
    * Create getter for style._order to allow split with drape first order
    
    * Move isLayerDraped to style
    
    * Minor tweak
    
    * Load list of draped first layers when terrain is enabled
    
    * Assign FBOs to renderable terrain batches
    
    * Don't render empty batches
    
    * Fix bug not clearing raster fade if any source is not RasterTileSource
    
    Minor syntax tweak
    
    * Use draped render batches in terrain.render()
    
    * Simplify render loop
    
    * Move terrain depth render earlier to reduce framebuffer switches
    
    * Update terrain-debug to add custom layer for debugging
    
    * Add map.options.optimizeForTerrain and update unit tests
    
    * Update render tests to account for map.options.optimizeForTerrain
    
    * Fix Flow + Lint + render tests
    
    * Remove extraneous flag
    
    * Add documentation and update comments
    
    * Add warning and guidance on low render cache efficiency
    
    * Revert using cached mode always
    This should be addressed in separate PR, needs to take into
    account video source type and feature state changes in order
    to invalidate the render cache.
    
    * Address review comments
    Thanks @arindam1993
    karimnaaji authored Jan 21, 2021
    Copy the full SHA
    a3a98a8 View commit details

Commits on Jan 22, 2021

  1. Copy the full SHA
    6e237cc View commit details
  2. Fix an issue with small-radius clusters and uncap clusterMaxZoom (#10300

    )
    
    * upgrade Supercluster to v7.1.2, uncap clusterMaxRadius
    
    * add a render test for clusterMaxZoom
    mourner authored Jan 22, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    1d0e3dc View commit details
  3. Avoid building from main in check-bundle-size (#10307)

    Ryan Hamley authored Jan 22, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    10f45ed View commit details
  4. Add a few more release testing pages and add 3d test page variants (#…

    …10313)
    
    * Add a few more release testing pages
    
    * add 3d playground
    
    * Testing symbolic link
    
    * Add new page for skybox gradient and use symbolic links
    
    * Lint
    
    * Bring performance indicator from internal
    
    * Add more 3d variant test pages and inject 3d code
    
    * Lint
    
    Co-authored-by: Karim Naaji <karim.naaji@gmail.com>
    Arindam Bose and karimnaaji authored Jan 22, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    47d8d51 View commit details

Commits on Jan 23, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    a0ffa40 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    b5eeddb View commit details

Commits on Jan 25, 2021

  1. Fix fullscreen fill-extrusion querying at low pitch (#10315)

    * Account for all possible query volumes that include the camera
    
    * use spice for inserting at index
    Arindam Bose authored Jan 25, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    81978c8 View commit details
  2. Port high resolution local SDFs (#10298)

    * Add 'localFontFamily' option to support rendering of all glyphs.
    
    * Switch local glyph rendering to 2x SDF resolution.
    Don't double-generate for glyphs with different fontstack but same local font.
    Align baselines for glyphs generated with different local fonts.
    Update tests.
    ChrisLoer authored Jan 25, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    51510e8 View commit details

Commits on Jan 26, 2021

  1. Copy the full SHA
    0406574 View commit details
  2. Wait for sprite to load before parsing tiles (#10294)

    Ryan Hamley authored Jan 26, 2021
    Copy the full SHA
    edc17c2 View commit details
  3. shift horizon towards center to reduce the number of tiles loaded (#1…

    …0304)
    
    * shift horizon towards center and clip everything beyond it
    
    * fix tests
    
    * fix query test
    
    hiding labels whose anchor is above the shifted horizon
    and caused cascading label changess
    
    * refix
    
    * nit
    
    * Skip flaky test
    
    * Update render test baseline for new changes
    
    Co-authored-by: Karim Naaji <karim.naaji@gmail.com>
    ansis and karimnaaji authored Jan 26, 2021
    Copy the full SHA
    d0fbc98 View commit details
  4. Bump tiny-sdf version for an RTL glyph width fix. (#10328)

    * Bump tiny-sdf version for an RTL glyph width fix.
    
    * Bump yarn.lock tiny-sdf version.
    ChrisLoer authored Jan 26, 2021
    Copy the full SHA
    82e5c24 View commit details

Commits on Jan 27, 2021

  1. v2.1.0 + style-spec v13.19.0 changelogs (#10336)

    * mapbox-gl-js v2.1.0 and style-spec v13.19.0 changelogs
    
    * Fixup
    
    * Remove extra line
    
    * Use beta tags
    
    * Update package versions
    
    * Update CHANGELOG.md
    
    Co-authored-by: Vladimir Agafonkin <agafonkin@gmail.com>
    
    Co-authored-by: Vladimir Agafonkin <agafonkin@gmail.com>
    karimnaaji and mourner authored Jan 27, 2021
    Copy the full SHA
    9d5bb34 View commit details

Commits on Feb 4, 2021

  1. Copy the full SHA
    b962951 View commit details
Showing with 3,144 additions and 566 deletions.
  1. +10 −0 .circleci/config.yml
  2. +37 −0 CHANGELOG.md
  3. +2 −1 bench/lib/access_token.js
  4. +60 −16 build/check-bundle-size.js
  5. +5 −2 build/generate-struct-arrays.js
  6. +131 −0 debug/10186.html
  7. +13 −34 debug/3d-playground.html
  8. +3 −1 debug/access_token.js
  9. +0 −1 debug/circles.html
  10. +8 −0 debug/extrusion-query.html
  11. +82 −1 debug/terrain-debug.html
  12. +2 −6 debug/video-export.html
  13. +7 −9 package.json
  14. +46 −14 src/data/array_types.js
  15. +8 −2 src/data/bucket/fill_extrusion_bucket.js
  16. +2 −2 src/data/bucket/pattern_attributes.js
  17. +6 −2 src/data/dem_data.js
  18. +23 −16 src/data/feature_index.js
  19. +7 −2 src/data/program_configuration.js
  20. +10 −9 src/geo/edge_insets.js
  21. +28 −16 src/geo/transform.js
  22. +12 −1 src/render/glyph_atlas.js
  23. +85 −15 src/render/glyph_manager.js
  24. +51 −12 src/render/painter.js
  25. +2 −2 src/render/program/symbol_program.js
  26. +11 −2 src/shaders/_prelude_terrain.vertex.glsl
  27. +1 −0 src/source/canvas_source.js
  28. +1 −3 src/source/geojson_source.js
  29. +2 −2 src/source/geojson_worker_source.js
  30. +27 −7 src/source/vector_tile_worker_source.js
  31. +17 −1 src/source/worker.js
  32. +19 −0 src/style-spec/CHANGELOG.md
  33. +1 −1 src/style-spec/package.json
  34. +6 −0 src/style-spec/reference/v8.json
  35. +3 −1 src/style-spec/validate/validate_array.js
  36. +18 −4 src/style-spec/validate/validate_number.js
  37. +82 −18 src/style/query_geometry.js
  38. +104 −13 src/style/style.js
  39. +2 −1 src/style/style_glyph.js
  40. +2 −1 src/style/style_layer.js
  41. +148 −6 src/style/style_layer/fill_extrusion_style_layer.js
  42. +11 −8 src/symbol/collision_index.js
  43. +3 −2 src/symbol/quads.js
  44. +6 −4 src/symbol/shaping.js
  45. +2 −0 src/terrain/draw_terrain_raster.js
  46. +36 −10 src/terrain/elevation.js
  47. +202 −98 src/terrain/terrain.js
  48. +23 −6 src/ui/map.js
  49. +2 −1 src/util/browser.js
  50. +10 −5 src/util/evented.js
  51. +17 −11 src/util/util.js
  52. +1 −1 test/browser/drag.test.js
  53. +1 −1 test/browser/zoom.test.js
  54. +6 −1 test/expected/text-shaping-default.json
  55. +16 −1 test/expected/text-shaping-images-horizontal.json
  56. +11 −1 test/expected/text-shaping-images-vertical.json
  57. +11 −1 test/expected/text-shaping-linebreak.json
  58. +11 −1 test/expected/text-shaping-newline.json
  59. +11 −1 test/expected/text-shaping-newlines-in-middle.json
  60. +3 −1 test/expected/text-shaping-null.json
  61. +6 −1 test/expected/text-shaping-spacing.json
  62. +15 −1 test/expected/text-shaping-zero-width-space.json
  63. +2 −1 test/ignores.json
  64. +0 −9 test/integration/lib/operation-handlers.js
  65. +7 −0 test/integration/lib/render.js
  66. +107 −0 test/integration/query-tests/fill-extrusion/top-down/expected.json
  67. +141 −0 test/integration/query-tests/fill-extrusion/top-down/style.json
  68. +1 −1 test/integration/query-tests/symbol-features-in/tilted-outside/style.json
  69. +105 −0 test/integration/query-tests/terrain/fill-extrusion-flat-roof/border-overlap/expected.json
  70. +53 −0 test/integration/query-tests/terrain/fill-extrusion-flat-roof/border-overlap/style.json
  71. +45 −0 test/integration/query-tests/terrain/fill-extrusion-flat-roof/default/expected.json
  72. +55 −0 test/integration/query-tests/terrain/fill-extrusion-flat-roof/default/style.json
  73. BIN ...ration/render-tests/combinations/symbol-translucent--line-translucent-terrain-draped/expected.png
  74. +1 −3 ...egration/render-tests/combinations/symbol-translucent--line-translucent-terrain-draped/style.json
  75. BIN test/integration/render-tests/debug/collision-high-pitched-fractional-zoom/expected.png
  76. BIN test/integration/render-tests/debug/collision-high-pitched/expected.png
  77. BIN test/integration/render-tests/debug/terrain/camera-under-terrain/expected.png
  78. BIN test/integration/render-tests/debug/terrain/collision-pitch-with-map-text-and-icon/expected.png
  79. BIN test/integration/render-tests/debug/terrain/collision-pitch-with-map/expected.png
  80. BIN test/integration/render-tests/fit-screen-coordinates/horizon/expected.png
  81. BIN test/integration/render-tests/free-camera/terrain/expected.png
  82. +1 −0 test/integration/render-tests/free-camera/terrain/style.json
  83. BIN test/integration/render-tests/geojson/clustered-max-zoom/expected.png
  84. +39 −0 test/integration/render-tests/geojson/clustered-max-zoom/style.json
  85. BIN test/integration/render-tests/line-dasharray/unusual-cases/negative-values/expected.png
  86. +0 −39 test/integration/render-tests/line-dasharray/unusual-cases/negative-values/style.json
  87. +0 −5 test/integration/render-tests/real-world/sanfrancisco-terrain-draped-movelayer/style.json
  88. +0 −5 test/integration/render-tests/real-world/sanfrancisco-terrain-draped/style.json
  89. BIN test/integration/render-tests/regressions/mapbox-gl-js#10033/expected.png
  90. +81 −0 test/integration/render-tests/regressions/mapbox-gl-js#10033/style.json
  91. BIN test/integration/render-tests/skybox/atmosphere-color/expected.png
  92. BIN test/integration/render-tests/skybox/atmosphere-horizon/expected.png
  93. BIN test/integration/render-tests/skybox/atmosphere-intensity/low/expected.png
  94. BIN test/integration/render-tests/skybox/atmosphere-intensity/medium/expected.png
  95. BIN test/integration/render-tests/skybox/atmosphere-mie/expected.png
  96. BIN test/integration/render-tests/skybox/atmosphere-padding/expected.png
  97. BIN test/integration/render-tests/skybox/atmosphere-update/expected.png
  98. BIN test/integration/render-tests/skybox/compositing/alpha-blend/expected.png
  99. BIN test/integration/render-tests/skybox/compositing/base/expected.png
  100. BIN test/integration/render-tests/skybox/fill-extrusion-light/horizon-north-east/expected.png
  101. BIN test/integration/render-tests/skybox/fill-extrusion-light/horizon-south-west/expected.png
  102. BIN test/integration/render-tests/skybox/fill-extrusion-light/sun-override/expected.png
  103. BIN test/integration/render-tests/skybox/gradient/east/expected.png
  104. BIN test/integration/render-tests/skybox/gradient/linear/expected.png
  105. BIN test/integration/render-tests/skybox/gradient/north/expected.png
  106. BIN test/integration/render-tests/skybox/gradient/padding/expected.png
  107. BIN test/integration/render-tests/skybox/gradient/south/expected.png
  108. BIN test/integration/render-tests/skybox/gradient/update/expected.png
  109. BIN test/integration/render-tests/skybox/gradient/west/expected.png
  110. BIN test/integration/render-tests/skybox/horizon-visibility/base/expected.png
  111. BIN test/integration/render-tests/skybox/horizon-visibility/padding/expected.png
  112. BIN test/integration/render-tests/symbol-distance-fade/expected.png
  113. +0 −1 test/integration/render-tests/terrain/fill-border/style.json
  114. BIN test/integration/render-tests/terrain/hillshade--raster-interpolate-exaggeration/expected.png
  115. +3 −2 test/integration/render-tests/terrain/hillshade--raster-runtime-styling/style.json
  116. BIN test/integration/render-tests/terrain/interleaved-cached/expected.png
  117. +124 −0 test/integration/render-tests/terrain/interleaved-cached/style.json
  118. BIN test/integration/render-tests/terrain/interleaved/expected.png
  119. +123 −0 test/integration/render-tests/terrain/interleaved/style.json
  120. BIN ...ntegration/render-tests/text-pitch-alignment/map-text-rotation-alignment-map-terrain/expected.png
  121. BIN ...ation/render-tests/text-pitch-alignment/map-text-rotation-alignment-viewport-terrain/expected.png
  122. BIN test/integration/render-tests/text-pitch-alignment/viewport-text-rotation-alignment-map/expected.png
  123. BIN test/integration/sprites/128px-grey-square.png
  124. BIN test/integration/sprites/32px-grey-square.png
  125. BIN test/integration/sprites/64px-grey-square.png
  126. +1 −0 test/release/3d-playground.html
  127. +2 −0 test/release/README.md
  128. +2 −1 test/release/index.css
  129. +3 −2 test/release/index.html
  130. +175 −43 test/release/index.js
  131. +1 −0 test/release/skybox-gradient.html
  132. +0 −7 test/suite_implementation.js
  133. +54 −29 test/unit/render/glyph_manager.test.js
  134. +5 −5 test/unit/source/geojson_worker_source.test.js
  135. +1 −5 test/unit/source/source_cache.test.js
  136. +9 −9 test/unit/source/vector_tile_worker_source.test.js
  137. +20 −0 test/unit/style-spec/fixture/bad-dasharray.input.json
  138. +10 −0 test/unit/style-spec/fixture/bad-dasharray.output-api-supported.json
  139. +10 −0 test/unit/style-spec/fixture/bad-dasharray.output.json
  140. +43 −0 test/unit/style-spec/fixture/bad-sky.input.json
  141. +18 −0 test/unit/style-spec/fixture/bad-sky.output-api-supported.json
  142. +18 −0 test/unit/style-spec/fixture/bad-sky.output.json
  143. +58 −0 test/unit/style/style.test.js
  144. +319 −8 test/unit/terrain/terrain.test.js
  145. +7 −1 test/unit/util/evented.test.js
  146. +4 −2 test/unit/util/struct_array.test.js
  147. +8 −8 yarn.lock
10 changes: 10 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -94,6 +94,7 @@ workflows:
only: /v[0-9]+.[0-9]+.[0-9]+(-.+)?/
branches:
ignore: /.*/


defaults: &defaults
docker:
@@ -270,6 +271,15 @@ jobs:
- attach_workspace:
at: .
- aws-cli/install
- run:
name: Check build file for correct SDK version
command: |
if grep -q "sdkVersion:\"$CIRCLE_TAG\"" mapbox-gl.js; then
echo SDK version in mapbox-gl.js matches $CIRCLE_TAG
else
echo SDK version in mapbox-gl.js does not match $CIRCLE_TAG
circleci-agent step halt
fi
- run:
name: Deploy release
command: |
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
## 2.1.0

### ✨ Features and improvements

- Added `localFontFamily` map option that enables local generation of all font glyphs. ([#10298](https://github.com/mapbox/mapbox-gl-js/pull/10298))
- Introduced high resolution local glyph generation for improved rendering quality of glyphs generated using `localIdeographFontFamily` or `localFontFamily` options. ([#10298](https://github.com/mapbox/mapbox-gl-js/pull/10298))
- Added `optimizeForTerrain` map option allowing to use terrain in _layer draw-order_ or _performance_ priority mode. This fixes terrain not always preserving layer draw-order during animations by making the behavior explicit. ([#10258](https://github.com/mapbox/mapbox-gl-js/pull/10258))
- Improved performance by slightly shifting the horizon down, reducing the number of tiles loaded for highly-pitched maps. ([#10304](https://github.com/mapbox/mapbox-gl-js/pull/10304))
- Improved `evented.once(eventName)` to return a promise if no listener function is provided, which allows using `async/await` with map events for a simpler and more readable code. ([#10203](https://github.com/mapbox/mapbox-gl-js/pull/10203))

### 🐞 Bug fixes

- Fixed querying of `fill-extrusion`s when terrain is enabled. ([#10293](https://github.com/mapbox/mapbox-gl-js/pull/10293))
- Fixed a bug where close points were sometimes not clustered on higher zoom levels given a small clustering radius. Fixed `clusterMaxZoom` so that it is not capped by the source `maxzoom`. ([#10300](https://github.com/mapbox/mapbox-gl-js/pull/10300))
- Fixed blurry map-aligned labels on highly pitched maps with terrain. ([#10296](https://github.com/mapbox/mapbox-gl-js/pull/10296))
- Fixed a race condition when evaluating image expressions by ensuring sprite has loaded before parsing tiles. ([#10294](https://github.com/mapbox/mapbox-gl-js/pull/10294))
- Fixed a bug with fullscreen `fill-extrusion` querying at low pitch. ([#10315](https://github.com/mapbox/mapbox-gl-js/pull/10315))
- Fixed a regression with the usage of patterns with data-driven styling. ([#10284](https://github.com/mapbox/mapbox-gl-js/pull/10284))
- Ensure `evented.listens` returns `false` when no listener is available. ([#10281](https://github.com/mapbox/mapbox-gl-js/pull/10281))


## 2.0.1

### ✨ Features and improvements

- Added support for using third-party worker-loader plugins in build systems such as Webpack and Rollup (`mapboxgl.workerClass`). ([#10219](https://github.com/mapbox/mapbox-gl-js/pull/10219))
- Added `mapboxgl.setNow` and `mapboxgl.restoreNow` methods which allow setting custom animation timing for 60 fps, jank-free video recording. ([#10172](https://github.com/mapbox/mapbox-gl-js/pull/10172))
- Removed outdated CSS hacks that no longer apply. ([#10202](https://github.com/mapbox/mapbox-gl-js/pull/10202))

### 🐞 Bug fixes

- Fixed a bug where `ImageSource` and dynamically loaded icons didn't work in some cases in Firefox and Safari. ([#10230](https://github.com/mapbox/mapbox-gl-js/pull/10230))
- Fixed a bug where `map.unproject` and `map.panBy` acted unpredictably in certain cases. ([#10224](https://github.com/mapbox/mapbox-gl-js/pull/10224))
- Fixed a bug where the sky layer didn't take map padding into account. ([#10201](https://github.com/mapbox/mapbox-gl-js/pull/10201))
- Fixed a bug where `map.setStyle` couldn't be used to enable terrain. ([#10177](https://github.com/mapbox/mapbox-gl-js/pull/10177))
- Fixed a bug where mouse events didn't properly fire during zoom scrolling. ([#10171](https://github.com/mapbox/mapbox-gl-js/pull/10171))

## 2.0.0

### ⚠️ Breaking changes
3 changes: 2 additions & 1 deletion bench/lib/access_token.js
Original file line number Diff line number Diff line change
@@ -2,7 +2,8 @@ const accessToken = (
process.env.MapboxAccessToken ||
process.env.MAPBOX_ACCESS_TOKEN ||
getURLParameter('access_token') ||
localStorage.getItem('accessToken')
localStorage.getItem('accessToken') ||
'pk.eyJ1IjoibWFwYm94LWdsLWpzIiwiYSI6ImNram9ybGI1ajExYjQyeGxlemppb2pwYjIifQ.LGy5UGNIsXUZdYMvfYRiAQ'
);

localStorage.setItem('accessToken', accessToken);
76 changes: 60 additions & 16 deletions build/check-bundle-size.js
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ const FILES = [
['JS', "dist/mapbox-gl.js"],
['CSS', "dist/mapbox-gl.css"]
];
const PK = Buffer.from(process.env['SIZE_CHECK_APP_PRIVATE_KEY'], 'base64').toString('binary');
const PK = process.env['SIZE_CHECK_APP_PRIVATE_KEY'];
if (!PK) {
console.log('Fork PR; not computing size.');
process.exit(0);
@@ -36,35 +36,79 @@ const repo = 'mapbox-gl-js';
authStrategy: createAppAuth,
auth: {
id: SIZE_CHECK_APP_ID,
privateKey: PK,
privateKey: Buffer.from(PK, 'base64').toString('binary'),
installationId: SIZE_CHECK_APP_INSTALLATION_ID
}
});

//get current sizes
const currentSizes = FILES.map(([label, filePath]) => [label, getSize(filePath)]);
console.log(currentSizes);
// Why we need to add GitHub's public key to known_hosts:
// https://circleci.com/docs/2.0/gh-bb-integration/#establishing-the-authenticity-of-an-ssh-host
execSync(`mkdir -p ~/.ssh`);
execSync(`echo 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==
bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==
' >> ~/.ssh/known_hosts`);
execSync(`git reset --hard && git checkout origin/main`);
execSync('yarn install');
execSync('yarn run build-prod-min');
execSync('yarn run build-css');
const priorSizes = FILES.map(([label, filePath]) => [label, getSize(filePath)]);
console.log(priorSizes);

async function getMergeBase() {
const head = process.env['CIRCLE_SHA1'];
const pr = process.env['CIRCLE_PULL_REQUEST'];
if (pr) {
const number = +pr.match(/\/(\d+)\/?$/)[1];
return github.pulls.get({
owner,
repo,
pull_number: number
}).then(({data}) => {
const base = data.base.ref;
return execSync(`git merge-base origin/${base} ${head}`).toString().trim();
});
} else {
// Walk backward through the history (maximum of 10 commits) until
// finding a commit on either master or release-*; assume that's the
// base branch.
for (const sha of execSync(`git rev-list --max-count=10 ${head}`).toString().trim().split('\n')) {
const base = execSync(`git branch -r --contains ${sha} origin/main origin/release-*`).toString().split('\n')[0].trim();
if (base) {
return Promise.resolve(execSync(`git merge-base ${base} ${head}`).toString().trim());
}
}
}

return Promise.resolve(null);
}

async function getPriorSize(mergeBase, name) {
if (!mergeBase) {
console.log('No merge base available.');
return Promise.resolve(null);
}

return github.checks.listForRef({
owner,
repo,
ref: mergeBase
}).then(({data}) => {
const run = data.check_runs.find(run => run.name === name);
if (run) {
const match = run.output.summary.match(/`[^`]+` is (\d+) bytes \([^\)]+\) uncompressed, (\d+) bytes \([^\)]+\) gzipped\./);
if (match) {
const prior = { size: +match[1], gzipSize: +match[2] };
console.log(`Prior size was ${prettyBytes(prior.size)}, gzipped ${prior.gzipSize}.`);
return prior;
}
}
console.log('No matching check found.');
return Promise.resolve(null);
});
}

const mergeBase = await getMergeBase();

// Generate a github check for each filetype
for(let check_idx=0; check_idx<FILES.length; check_idx++){
const [label, file] = FILES[check_idx];
const name = `Size - ${label}`;
const size = currentSizes[check_idx][1];
const priorSize = priorSizes[check_idx][1];
const priorSize = await getPriorSize(mergeBase, name);
console.log('priorSize: ', label, priorSize);

const title = `${formatSize(size.size, priorSize.size)}, gzipped ${formatSize(size.gzipSize, priorSize.gzipSize)}`;
const title = `${formatSize(size.size, priorSize ? priorSize.size : null)}, gzipped ${formatSize(size.gzipSize, priorSize ? priorSize.gzipSize : null)}`;

const megabit = Math.pow(2, 12);
const downloadTime3G = (size.gzipSize / (3 * megabit)).toFixed(0);
7 changes: 5 additions & 2 deletions build/generate-struct-arrays.js
Original file line number Diff line number Diff line change
@@ -185,7 +185,9 @@ createStructArrayType('feature_index', createLayout([
// the source layer the feature appears in
{ type: 'Uint16', name: 'sourceLayerIndex' },
// the bucket the feature appears in
{ type: 'Uint16', name: 'bucketIndex' }
{ type: 'Uint16', name: 'bucketIndex' },
// Offset into bucket.layoutVertexArray
{ type: 'Uint16', name: 'layoutVertexArrayOffset' },
]), true);

// triangle index array
@@ -230,12 +232,13 @@ createStructArrayLayoutType(createLayout([{
}], 4));

// Fill extrusion specific array
createStructArrayType(`fill_extrusion_centroid`, centroidAttributes);
createStructArrayType(`fill_extrusion_centroid`, centroidAttributes, true);

const layouts = Object.keys(layoutCache).map(k => layoutCache[k]);

fs.writeFileSync('src/data/array_types.js',
`// This file is generated. Edit build/generate-struct-arrays.js, then run \`yarn run codegen\`.
/* eslint-disable camelcase */
// @flow
import assert from 'assert';
131 changes: 131 additions & 0 deletions debug/10186.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
<!DOCTYPE html>
<html>
<head>
<title>Mapbox GL JS debug page</title>
<meta charset='utf-8'>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<style>
body { margin: 0; padding: 0 }
html, body, #map { height: 100%; }

#checkboxes {
position: absolute;
top:0;
left:0;
padding:10px;
}
</style>
</head>

<body>
<div id='map'></div>
<div id='checkboxes'>
<label><input id='show-tile-boundaries-checkbox' type='checkbox'> tile debug</label><br />
</div>
<script src='../dist/mapbox-gl-dev.js'></script>
<script src='../debug/access_token_generated.js'></script>
<script>

const map = window.map = new mapboxgl.Map({
container: 'map',
style: {
'version': 8,
'name': "Blank",
'sources': {
'composite': {
'url': 'mapbox://mapbox.country-boundaries-v1',
'type': 'vector'
},
'overlay': {
'type': 'image',
'url': 'https://docs.mapbox.com/mapbox-gl-js/assets/radar.gif',
'coordinates': [
[-80.425, 46.437],
[-71.516, 46.437],
[-71.516, 37.936],
[-80.425, 37.936]
]
},
'label': {
'type': 'geojson',
'data': {
'type': 'FeatureCollection',
'features': [{
'type': 'Feature',
'geometry': {
'type': 'Point',
'coordinates': [ -73, 43 ]
}
}]
}
}
},
'layers': [{
'id': 'background',
'type': 'background',
'paint': {
'background-color': 'beige'
}
},
{
'id': 'country-boundaries',
'type': 'line',
'paint': {
'line-color': 'hsl(216, 74%, 50%)'
},
'layout': {},
'source': 'composite',
'source-layer': 'country_boundaries'
},
{
'id': 'symbol',
'type': 'symbol',
'source': 'label',
'layout': {
'text-field': 'Test Test Test',
'text-size': 20,
'text-font': [
'Open Sans Semibold',
'Arial Unicode MS Bold'
]
},
'paint': {
'text-color': 'red'
}
},
{
'id': 'overlay',
'source': 'overlay',
'type': 'raster',
'paint': {
'raster-opacity': 0.85
}
}],
'glyphs': 'mapbox://fonts/mapbox/{fontstack}/{range}.pbf',
'id': 'blank'
},
hash: true,
center: [0, 0],
pitch: 0,
bearing: 0,
zoom: 0,
optimizeForTerrain: true
});

map.on('load', function () {
map.addSource('mapbox-dem', {
'type': 'raster-dem',
'url': 'mapbox://mapbox.mapbox-terrain-dem-v1',
'tileSize': 512,
'maxzoom': 14
});
map.setTerrain({'source': 'mapbox-dem', 'exaggeration': 1.5});
});

document.getElementById('show-tile-boundaries-checkbox').onclick = function() {
map.showTileBoundaries = !!this.checked;
};

</script>
</body>
</html>
47 changes: 13 additions & 34 deletions debug/3d-playground.html
Original file line number Diff line number Diff line change
@@ -50,9 +50,20 @@
window.onload = function() {
var gui = new dat.GUI(); // eslint-disable-line

var style = gui.add(demo3d, 'style', [ 'streets-v11', 'light-v10', 'dark-v10', 'outdoors-v11', 'satellite-v9' ]);
var style = gui.add(demo3d, 'style', [
'mapbox/streets-v11',
'mapbox/satellite-streets-v11',
'mapbox/light-v10',
'mapbox/dark-v10',
'mapbox/outdoors-v11',
'mapbox/satellite-v9',
'mapbox/cjerxnqt3cgvp2rmyuxbeqme7',
'mapbox-map-design/ckhqrdj3q0q1y19ko8t70qtqu',
'mapbox-map-design/ckhqrf2tz0dt119ny6azh975y',
'mapbox-map-design/ckhqrbxlc1awj19svtb92m0bd'
]);
style.onFinishChange((value) => {
map.setStyle('mapbox://styles/mapbox/' + value);
map.setStyle('mapbox://styles/' + value);
});

var terrain = gui.addFolder('Terrain');
@@ -132,38 +143,6 @@
});
map.setTerrain(demo3d.enableTerrain ? {"source": "mapbox-dem", "exaggeration": 1.5} : null);

const hillshadeID = map.style._order.find((id) => map.style.getLayer(id).type === 'hillshade') || 'hillshade';
let hillshade = map.getLayer(hillshadeID);
let addHillshadeBefore = 'hillshade_highlight_bright';
if (hillshade && hillshade.type === 'hillshade') {
addHillshadeBefore = map.style._order[map.style._order.indexOf(hillshadeID) + 1];
map.removeLayer(hillshadeID);
hillshade = null;
}
if (!hillshade) {
map.addLayer({
"id": hillshadeID,
"source": "mapbox-dem",
"type": "hillshade"
}, addHillshadeBefore);
}
["housenum-label", "hillshade_highlight_bright", "hillshade_highlight_med", "hillshade_shadow_faint",
"hillshade_shadow_med", "hillshade_shadow_dark", "hillshade_shadow_extreme"].forEach(layerid => { if (map.getLayer(layerid)) map.removeLayer(layerid); });

map.addSource("satellite", {
"type": "raster",
"url": "mapbox://mapbox.satellite",
"tileSize": 512
});
map.addLayer({
"id": "satellite",
"type": "raster",
"source": "satellite",
"layout": {
"visibility": "none"
}
});

map.addLayer({
'id': "extrusion",
'source': 'composite',
Loading