Skip to content

Commit

Permalink
Fix setStyle breaking with globe view (#11913)
Browse files Browse the repository at this point in the history
* set draping for terrain

* use map option for terrain draping check

* move to one line

* wip: add render test

* fixed error with render test

* demonstrate issue with mercator

* fix background id to update in second setStyle call

* bring zoom out to show sphere

* Updating expected.png

* better readability

* fix conditional

* fix lint

Co-authored-by: Aidan H <[email protected]>
  • Loading branch information
2 people authored and karimnaaji committed May 31, 2022
1 parent 1b95367 commit 1046bc7
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ui/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -1208,6 +1208,8 @@ class Map extends Camera {
}
this.style.applyProjectionUpdate();
this._update(true);
} else if (this.transform.projection.requiresDraping && !this.getTerrain() && !this.style.stylesheet.terrain) {
this.style.setTerrainForDraping();
}

return this;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"version": 8,
"metadata": {
"test": {
"height": 256,
"width": 256,
"operations": [
["setStyle", {
"version": 8,
"projection": {"name": "globe"},
"sources": {
"mapbox": {
"type": "vector",
"maxzoom": 14,
"tiles": [
"local://tiles/{z}-{x}-{y}.mvt"
]
}
},
"layers": [
{
"id": "background1",
"type": "background",
"paint": {
"background-color": "rgb(255,89,252)"
}
}
]
}],
["wait"],
["setStyle", {
"version": 8,
"projection": {"name": "globe"},
"sources": {
"mapbox": {
"type": "vector",
"maxzoom": 14,
"tiles": [
"local://tiles/{z}-{x}-{y}.mvt"
]
}
},
"layers": [
{
"id": "background2",
"type": "background",
"paint": {
"background-color": "rgb(17,207,20)"
}
}
]
}],
["wait"]
]
}
},
"zoom": 1,
"sources": {},
"layers": []
}

0 comments on commit 1046bc7

Please sign in to comment.