Skip to content
main
Switch branches/tags
Code

Latest commit

* Add globe view projection

- Extend symbol data structures to support reprojection
- Use more explicit "tileAnchor" naming for anchor fields in data
structures.
- Extend symbol data structures to support 3D anchor points in preparation of data reprojection model required for the globe view
- Update shaders to support variable directions for elevation
- Add helper functions to the Aabb class
- Add z-component support to symbol shaders
- Globe view refactoring
- abstraction work
- working on symbol reprojection abstraction
- symbol projection abstraction
- Separation of globe atmosphere effect
- Fix atmosphere render on retina display
- Force reload of symbol layers on projection mode changes
- Fix pitched symbols on globe
- Prevent expensive call to buffer updates and use shared tile vertex buffers (#10944)
- Updating buffers flagged with GL_DYNAMIC_DRAW was an expensive part of the frame
with roughly half of the frame time spent updating buffer data. To prevent that
initialize the shared data once and store the tile buffer data per tile instead
- Separate pixelsPerMeter to standalone uniform (#10967)
- Separate pixelsPerMeter to standalone uniform
- Add separate getter for normal up vectors in tile transform
- Code review fixes
- Change tileSpaceUpVector to tileSpaceUpVectorScale
- Add up vector scaling to collision and symbol drawing (#10987)
- Fix occlusion of map aligned line labels
- Globe view to mercator transition for sphere geometry (#10984)
- Interpolate between mercator and globe view
- Interpolate on the GPU
- Interpolate the zoom transition in the shader
- Simplify readability of shader code
- Switch projection after transition
- Reenable static buffer optimization and use triangle face culling
- Apply correct transforms to globe raster depth shader
- Update projection during render loop
- Reintroduce tile globe matrix
- Revert globe tile vertex size
- Cleanup vertex layouts
- Cleanup shader code and share functions in prelude
- Update transition switch range
- Fix pole rendering
- Add globe to mercator transition for symbols
- Add shader variant PROJECTION_GLOBE_VIEW
- Address FIXME, prevent projecting points using stale layout attribute data
Since projections may create a dependency with the symbol layout buffers
as we store projected points in it, we need to prevent rendering of such buffers
when switching projections
- Revert vertex grid size change
- Fix missing attribute in symbol_text_and_icon.vertex.glsl and apply
transition changes to all symbol and icon shaders
- Apply transition fade for viewport aligned labels
- Prevent line label interpolation during the transition
- Add support for terrain during the transition and fix up vector transform
- Fix up vector transform along longitudes as up vectors are shared between
all tiles along longitude, they need to be rotated correctly based on their
tile y id
- Keep zoom constant to compensate camera altitude properly and account
for projection scaler in globeMercator matrix and z extrusion
- Account for projection scaling in symbol inversion matrix
- Apply review changes from #11015
- Simplify zScale calculation in globe mercator matrix
- Dead code removal and remove unused
- Remove usage of pointCoordinateOnGlobe, make it part of the projection interface
- Initialize worker projection to fix render tests under Mercator projection
- Fix far plane for render tests
- Fix pole rendering
- Disable wrap jump in globe view
- Fix world wrap under globe in cross_tile_symbol_index
- Fix variable anchor, custom layer and symbol along lines (#11168)
- Remove unused anchorIsInside function calls
- Fix collision circle placement
Fix ~30 mercator render tests
- Fix variable anchor elevation
Fix ~32 mercator render tests
- Fix mercator matrix
Fix custom layer render test
- Reset globeGridBuffer and globePoleBuffer to prevent corrupt access
- Fix symbol anchors with terrain
- Remove unused u_label_space_scale uniform
- Remove unused parameter
- Remove unused variables
- Green CI and miscellaneous fixes (#11193)
- Fix inverted frustum matrix on non-globe projection
Fixes camera-fit and free-camera render tests
Skip last failing test render-tests/fill-extrusion-pattern/opacity-terrain
- Fix linter
- Fix build
- Fix flow
- Consolidate atmosphere buffers in shared globe buffer struct
- Fix data/symbol_bucket.test tests
- Fix util/primitives.test
- Fix ui/camera.test
- Add FIXME for transform unit tests
- Fix symbol/cross_tile_symbol_index
- Fix linter
- Address review comments
- Add unit test FIXME ui/camera.test
- Fix some matrix precision change to fix flow and keep precision
- Replace tile backface culling by far plane adjustment for frustum culling (#11214)
- Add ray closest point on sphere
- Add common projection interface farthestPixelDistance
- Add PROJECTION_GLOBE_VIEW define when globe rendering is enabled
This allows enabling the elevationVector function and fixes rendering
of terrain with globe view
- Add wireframe mode + reduce vertex resolution (#11237)
- Use GLOBE_VERTEX_GRID_SIZE = 64 and consolidate vertex buffer functions in GlobeSharedBuffers struct
This uses the same vertex grid size as gl-native, refer:
mapbox/mapbox-gl-native-internal#2348
- Add support for globe wireframe mode
- Remove GlobeTile class, inline function call
- Remove unused
- Remove globe specific code path
- Address FIXME unit test ui/camera.test
Reduce and consolidate redundant code
Remove globe specific code path from gesture interaction
- Consolidate globe specific code

Co-authored-by: Daniel Eke <daniel.eke@mapbox.com>
Co-authored-by: Karim Naaji <karim.naaji@gmail.com>

* Reachitecture and allow globe view + non-mercator projections to coexist (#11290)

* Fix build

* Fix a few lint issues

* Fix rebase: use same projection variable in transform

* Fix tile transform to retrieve tileAABB from common function

* Fix mercator runtime

* Add flat_tile_transform and globe_tile_transform

* Fix alternate projections rendering, testing Albers

* Add far_z common code, fix equal_earth projection

* Add far_z common code, fix equal_earth projection

* Fix equirectangular, lambert, natural_earth, winkel_tripel projections

* Fix tile_transform mismatching function name

* Extend check against != mercator for globe, add globeOrMercator function

* Add globe to spec allowed options

* Enable terrain draping pipeline when setting globe projection

* Replace transform.maxValidLatitude by MAX_MERCATOR_LATITUDE

* Exhaust check against != mercator for globe in load_geometry

* Add missing globe.unproject

* Fix terrain not enabled when using globe rendering

* Add labelPlaneMatrix and glCoordMatrix for globe

* Fix some tile cover fall through when using globe

* Fix symbol rendering with globe

* Remove unused

* Add TODO for faster projection switch in style.updateProjection

* Fixup comparison check

* Add `supportsFog` and `supportsTerrain` as part of the projection interface

* Add `isReprojectedInTileSpace` in projection interface

* Add `supportsFreeCamera` and `supportsCustomLayers` as part of the projection interface

* Fix inverted check

* Remove leftover FIXME

* Fixup comparison check

* Fix gestures under non-mercator projections

* Fix lint and address FIXME

* Fix flow

* Add TODO

* Fix `render-tests/image/wrap-projected` render test, merge `wrap` and `supportsWorldCopies` concepts

* Fix all non-mercator render tests

* Fix all unit tests

* Globe View: Allow terrain render pipeline to be used without preexisting DEM sources (#11323)

* Mock DEM data source to allow globe view to leverage terrain draping pipeline

* Allow 'globe' to be set as a projection as part of the map constructor

* Make sure terrain is disabled when previously used for the deferred pipeline

* Fixup

* Review comments

* Review comments

* Add unit tests

* Skip setting terrain when it was set for draping only

* Add test cases to globe-view branch (#11311)

* Port test cases for closestPointOnSphere, apply minor fixes

* Port tests for furthestPixelDistance test cases, minor changes to align with gl-native

* Rename furthestPixelDistanceOnSphere to farthestPixelDistanceOnSphere

* Add transition to farthestPixelDistance in globe.js

* Address some simplifications

* Disable terrain depth rendering for globe and use far plane for symbol/circle occlusion

* Fix incorrect wrapping logic introduced in rebase

* Revert some unnecessary change

* Simplify examples

* Fix coveringTilesUnitTests

* Fixed a bug where switching from a non-mercator projection and mercator/globe would leave ghost data artifacts

* Optimize and reduce cos/sin from inner loops when creating globe meshes

Optimization from https://github.com/mapbox/mapbox-gl-native/2651

* Separate globe atmosphere rendering from sky (#11344)

* Separate globe atmosphere rendering from sky

* Render sky layer during the transition between mercator and globe

* Disable unsupported layers on globe (#11343)

* Disable unsupported layers on globe

* Add list of unsupported layers to projection types

* Address review comments
- Remove extraneous up vector matrix
- Cleanup rotated mesh logic that isn't used anymore

* Only apply zoom transition vertex operations when it occurs

Early return when calculating the globe label mercator matrix when no transition is happening

squash

* Simply globe tile transform upVector() as per review comment

* Simplify elevation vector calculations, remove extraneous elevationTileId param

* Address review comment, use cached matrix

* Simplify and rewrite globe.pointCoordinate
- Extra matrix column instead of using a transform
- Reuse ray.closestPointOnSphere

* Reuse getElevation function, make it part of the elevation interface

* Add circle and heatmap render tests (skipped - pending implementation)

* Add globe-padding render test (skipped - pending implementation)

* Add globe symbols render tests

* Add globe terrain render test

* Add globe transform render tests

* Add globe transition render tests

* Address review comments

* Globe view fix #11352 (#11372)

* Fix #11352

* Add unit test

* Globe view fix #11367 (#11381)

* Fix issue #11367
Make sure to update projection after a call to map.setStyle(...)

* Optimize ray picking for globe view (#11389)

* eliminate all allocations in ray picking

* cleanup

Co-authored-by: Mikko Pulkki <mikko.pulkki@mapbox.com>
Co-authored-by: Daniel Eke <daniel.eke@mapbox.com>
Co-authored-by: Vladimir Agafonkin <agafonkin@gmail.com>
c9cd5d9

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time

Mapbox logo

Mapbox GL JS is a JavaScript library for interactive, customizable vector maps on the web. It takes map styles that conform to the Mapbox Style Specification, applies them to vector tiles that conform to the Mapbox Vector Tile Specification, and renders them using WebGL.

Mapbox GL JS is part of the cross-platform Mapbox GL ecosystem, which also includes compatible native SDKs for applications on Android, iOS, macOS, Qt, and React Native. Mapbox provides building blocks to add location features like maps, search, and navigation into any experience you create. To get started with GL JS or any of our other building blocks, sign up for a Mapbox account.

In addition to GL JS, this repository contains code, issues, and test fixtures that are common to both GL JS and the native SDKs. For code and issues specific to the native SDKs, see the mapbox/mapbox-gl-native repository.

Mapbox GL JS gallery of map images

Caption: (Mapbox GL JS maps, left-to-right, top-to-bottom): Custom styled point clusters, custom style with points, hexbin visualization on a Dark style map with Popups, data-driven circles over a raster layer with satellite imagery, 3D terrain with custom Markers, Mapbox Movement data visualization.

License

Copyright © 2021 Mapbox

All rights reserved.

Mapbox GL JS version 2.0 or higher (“Mapbox Web SDK”) must be used according to the Mapbox Terms of Service. This license allows developers with a current active Mapbox account to use and modify the Mapbox Web SDK. Developers may modify the Mapbox Web SDK code so long as the modifications do not change or interfere with marked portions of the code related to billing, accounting, and anonymized data collection. The Mapbox Web SDK sends only anonymized usage data, which Mapbox uses for fixing bugs and errors, accounting, and generating aggregated anonymized statistics. This license terminates automatically if a user no longer has an active Mapbox account.

For the full license terms, please see the Mapbox Terms of Service.