OSM Buildings broken with multiple viewers
- Dominant language
- JavaScript
- Stars
- 15.7k
- Forks
- 3.9k
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 34
Description
[Originally reported on the forum.](https://community.cesium.com/t/bug-report-osm-buildings-broken-when-multiple-viewers-involved/25795/2)
> If i create two viewers on the same page and add Osm Buildings to both of them, lots of the building’s polygons get stretched and misplaced, creating a “blob” that covers the entire map.
[Sandcastle example](https://sandcastle.cesium.com/index.html#c=xVNNT8IwGP4rzYzJSLAbGxPFSVQ8mnjQeOqldC/wxq4lbQei8b/bOZlI/Dho4nZpnz5fe9MJrawjS4RVeklOiYIVGYPFqqR3HgMTsqA5ZEHnhCnR0pPv6MkbnalGTK0ABXRhsESHS7CUF0XIVxzdRi8McAfXtryoUBaoZvbcrpUIO7VP4/lbl60+gpdgOJ3K9a0On5gir08B1qHiDrUabhzH3Di/4iqlU6PLS5gZABv2evRoEPcHqX+PkkF82O+Sfkb78XEWHydpkmVplnVJL47jTpep5+385F/yg26QW7eWMNrEnWG50MaRysiQ0shBuZB+ejaaVOIeHBXW1rUb8p547TPWynFUYEjb2vdG65XrIZlKeDh5x1dYuPmwLrG/hc4BZ3O3Az+3OW938TN7VNJHH0ykFvc/xHz0S/7KL4+2R5gXuCRYnLJgZzgsIEJya/3JtJLyBh+BBe3c32WbX2uURx77gpDsEj6sW6rUvL7w10sw/uNqybw3umpASmke+e3nSqe1nHCzk/IC)
> Notes:
> - If you comment out either one of the viewXX.scene.primitives.add(await Cesium.createOsmBuildingsAsync()); lines, the other viewer works perfectly fine.
> - Sometimes, the bug occours on only one of the two viewers, but it never happened to me that both viewers work fine at the same time.
> - I got a similar bug on an old version of cesium when loading OSM Buildings twice in the same viewer, but i can’t manage reproduce consistently.

Contributor guide
Research direction
Start with the linked Sandcastle example and reproduce the issue by creating two viewers, adding createOsmBuildingsAsync() to both, and observing the misplaced building polygons. Trace the OSM Buildings loading and rendering path to determine why the viewers interfere with each other. Done means both viewers render OSM Buildings correctly at the same time, including repeated loading in one viewer if the related case is addressed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- computer-graphics, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100