Mapbox GL JS v2.2.0: GeoJSON performance improvements and level roofs on 3D terrain

No items found.

Apr 8, 2021

Mapbox GL JS v2.2.0: GeoJSON performance improvements and level roofs on 3D terrain

Guest

No items found.

Guest

Apr 8, 2021

We’ve released Mapbox GL JS v2.2.0 with improved GeoJSON update performance in Safari, level roofs on 3D terrain for all fill extrusions, and a new Continuous Integration (CI) test mode so developers can include Mapbox in their automated testing suite and ensure a high quality experience for their customers.

Improved data update performance

Updating GeoJSON sources with setData(geojson) is now much faster in Safari, resulting in smoother data rendering for layers with frequently-updated data like vehicle or asset positions. Instacart leverages Mapbox GL to help users track their order in real-time and this update means their users will experience smooth animations as their order approaches their front door, regardless of browser.

Before / After

Level roofs on 3D terrain

Roofs on 3D buildings are now level relative to the earth rather than the terrain. Level roofs are now drawn for all fill-extrusion layers drawn on top of terrain. Previously, the top face of extruded features on layers using custom data followed the elevation of terrain. Extrusions are now drawn correctly with a level top for all custom data layers.

Before / After

Continuous Integration (CI) Test Mode

Test mode lets developers include GL JS in automated tests without an access token. Developers can ensure complete test coverage and rapidly iterate on code with confidence they are delivering high quality applications to their customers. Maps created in test mode don’t load resources from Mapbox and do not trigger billing. The GL JS API still works as expected and your tests can load test styles and tiles locally. In test mode you can still:

  • Listen for interaction events such as click and mouseover on Layers.
  • Interact with Markers and Popups
  • Query features data with map.queryRenderedFeatures()
  • Update the camera center, zoom or bearing and use map.easeTo() and map.flyTo()

Upgrading to v2.2.0

Mapbox GL JS v2.2.0 is available on CDN. Include the JavaScript and CSS files in the <head> block of your HTML file to upgrade:


<script src='https://api.mapbox.com/mapbox-gl-js/v2.2.0/mapbox-gl.js'></script>
<link href='https://api.mapbox.com/mapbox-gl-js/v2.2.0/mapbox-gl.css' rel='stylesheet'/>

See the v2.2.0 release notes for a full list of changes.

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Block quote

Ordered list

  1. Item 1
  2. Item 2
  3. Item 3

Unordered list

  • Item A
  • Item B
  • Item C

Text link

Bold text

Emphasis

Superscript

Subscript

No items found.
No items found.

Related articles