Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected center surface is filled #10299

Closed
liulianfan opened this issue Jan 19, 2021 · 1 comment
Closed

Unexpected center surface is filled #10299

liulianfan opened this issue Jan 19, 2021 · 1 comment

Comments

@liulianfan
Copy link

mapbox-gl-js version:
v2.0.1
browser:
chrome 87.0.4280.141(正式版本) (x86_64)

Steps to Trigger Behavior

<title>Polygon</title> <script src='https://api.tiles.mapbox.com/mapbox-gl-js/v2.0.1/mapbox-gl.js'></script> <style> body { margin: 0; padding: 0; }
    #map {
        position: absolute;
        top: 0;
        bottom: 0;
        width: 100%;
    }
</style>
<div id='map'></div>
<script>
    mapboxgl.accessToken = '*';
    const map = new mapboxgl.Map({
        container: 'map',
        style: 'mapbox://styles/mapbox/light-v9',
        center: [121.52607779955963,31.233080259741023],
        zoom: 19
    });

    map.on('load', function () {
        map.addLayer({
            "id": "test",
            'type': 'fill',
            "source": {
                "type": "geojson",
                "data": {"type":"FeatureCollection","features":[{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[121.52607779955963,31.233080259741023],[121.52607780000392,31.233080259947695],[121.52607780793228,31.233080262058834],[121.52607781583234,31.233080264245807],[121.52607781633466,31.233080264296188],[121.52607781681756,31.23308026442477],[121.52607782507529,31.233080265172788],[121.5260778333225,31.233080265999885],[121.52607783382669,31.233080265965494],[121.52607783432964,31.233080266011065],[121.52607784259928,31.233080265367196],[121.5260778508768,31.23308026480265],[121.52607785136345,31.233080264684812],[121.52607785186714,31.233080264645604],[121.52607785983102,31.23308026263459],[121.52607786782065,31.233080260700074],[121.52607786827106,31.23308026050334],[121.52607786875613,31.23308026038085],[121.52607787610798,31.23308025708007],[121.52607788350291,31.23308025384986],[121.52607788389977,31.23308025358175],[121.52607788434756,31.233080253380702],[121.52607789080477,31.233080248917137],[121.52607789732086,31.233080244515236],[121.52607789764896,31.233080244186063],[121.52607789804226,31.233080243914202],[121.52607790335698,31.233080238459245],[121.52607790874356,31.233080233054924],[121.52607790899025,31.233080232677352],[121.52607790931394,31.2330802323451],[121.52607791328188,31.233080226108516],[121.52607791733199,31.233080219909358],[121.5260779174878,31.23308021949787],[121.52607791772948,31.233080219118012],[121.52612345510852,31.232988140627068],[121.52612346031889,31.232988126355803],[121.52612346219743,31.23298811149184],[121.52612346067296,31.232988096598266],[121.52612345580327,31.232988082239324],[121.52612344777282,31.232988068958967],[121.52612343688581,31.232988057260314],[121.52612342355474,31.232988047586566],[121.52612340828459,31.232988040304193],[121.52608440217833,31.232973492906744],[121.52602315137419,31.232950650148254],[121.52602313433097,31.232950645456693],[121.52602311653814,31.23295064374848],[121.52602309870254,31.232950645091464],[121.52602308153267,31.232950649432297],[121.52602306571065,31.232950656598543],[121.52602305186504,31.232950666305495],[121.52602304054582,31.232950678167565],[121.52602303220267,31.23295069171351],[121.52602297060217,31.232950821729585],[121.52596169097215,31.232927967883768],[121.52596169139622,31.23292778001587],[121.52596168975177,31.232927765236916],[121.52596168481314,31.232927751004492],[121.5259616767648,31.23292773785024],[121.5259616659074,31.232927726265515],[121.52596165264652,31.232927716683076],[121.52596163747751,31.232927709460874],[121.52592293946326,31.232913277631454],[121.52592292241332,31.23291327293871],[121.52592290461348,31.23291327123164],[121.5259228867714,31.2329132725781],[121.52592286959637,31.23291327692457],[121.52592285377125,31.232913284098235],[121.52592283992516,31.232913293813887],[121.52592282860856,31.232913305685308],[121.52592282027138,31.2329133192405],[121.525878973418,31.23300602720824],[121.52587896850488,31.233006041399314],[121.52587896686583,31.233006056132623],[121.52587896856171,31.233006070861265],[121.52587897352956,31.233006085038397],[121.52587898158495,31.233006098137714],[121.52587899242882,31.233006109672925],[121.5258790056586,31.233006119215798],[121.52587902078315,31.233006126412057],[121.52594500683315,31.233030736069995],[121.52601246712123,31.23305589474742],[121.52607779907845,31.23308025960782],[121.52607779955963,31.233080259741023]],[[121.52607778763564,31.23308008774062],[121.52601253894744,31.233055753934494],[121.52594507866041,31.2330305952574],[121.52587917275845,31.233006015490837],[121.5259229522301,31.23291344999229],[121.52596151161973,31.232927830123767],[121.52596151119566,31.23292801799118],[121.52596151284008,31.232928032770022],[121.52596151777864,31.232928047002343],[121.52596152582686,31.23292806015653],[121.52596153668411,31.232928071741206],[121.52596154994484,31.232928081323646],[121.52596156511366,31.232928088545897],[121.5260229833161,31.232950994071388],[121.52602300035936,31.232950998763023],[121.52602301815222,31.232951000471314],[121.5260230359879,31.23295099912838],[121.52602305315783,31.232950994787572],[121.52602306897992,31.232950987621336],[121.52602308282562,31.23295097791436],[121.52602309414489,31.232950966052268],[121.52602310248805,31.232950952506297],[121.52602316408876,31.232950822489816],[121.52608433035135,31.23297363371953],[121.52612325503551,31.23298815075043],[121.52607778763564,31.23308008774062]]]}}]}
            },
            'paint': {
                'fill-color': '#29B2C0'
            },
        });
    });
    map.on('click', ()=>{
        console.info(map.getZoom());
    })
</script>
  1. When the level is greater than 18

image

  1. When the level is greater than 17 and less than 18
    image

  2. When the level is less than 17

image

Link to Demonstration

Expected Behavior

The center plane should not be filled

Actual Behavior

The center surface is filled between 17 and 18 levels

@mourner
Copy link
Member

mourner commented Jan 25, 2021

This is very likely #7023. The rings are very closely positioned, so it's easy to introduce a degeneracy like touching / intersecting rings when simplifying the data for a zoom level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants