Mapbox GL JS v2.2.0: GeoJSON performance improvements and level roofs on 3D terrain
Guest
No items found.
Ryan Hamley
Guest
Ryan Hamley
No items found.
Mapbox
April 8, 2021
Releases
Mapbox GL JS v2.2.0: GeoJSON performance improvements and level roofs on 3D terrain
Guest
No items found.
Ryan Hamley
Guest
Ryan Hamley
No items found.
Mapbox
April 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 mouseoveron 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:
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.
Heading 2
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.
Heading 3
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.
Heading 4
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.
Heading 5
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.
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.
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque euismod maximus porta. Pellentesque vitae augue elit. Nam semper eros leo, nec hendrerit nunc aliquet quis. Morbi ac sapien tortor. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Curabitur porta imperdiet lorem, ut aliquet orci pellentesque quis. Donec magna augue, molestie aliquam enim eu, auctor feugiat metus."