I am having an issue with Mapbox GL JS v2. I have a geojson dataset that mostly renders correctly in the map, but certain features won't render correctly with the "fill" layer style. The fill doesn't "show" up until you zoom way in and even then it kind of flickers around. I know the geojson is valid (at least according to geojsonlint.com. I have linked to a js fiddle showing the issue with one of the features. I thought at first it might be just related to my implementation, but it still happens when I modified a Mapbox example. Any help would be appreciated!
Thanks!
mapboxgl.accessToken = 'pk.eyJ1IjoiampnYXJyZXR0MCIsImEiOiJjanhnM3Fud2QwZnY1M3VvN3pqZHYzZzdvIn0.jaDeTWgRsKsOeojogZzk1g';
var map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/mapbox/streets-v11',
center: [-114.000, 46.31881],
zoom: 6
});
map.on('load', function () {
map.addSource('fill', {
'type': 'geojson',
'data': {"type": "Feature", "id": 124, "properties": {"name": "West Central Montana", "center": "Missoula Avalanche Center", "center_link": "https://missoulaavalanche.org/", "timezone": "America/Denver", "center_id": "WCMAC", "state": "MT", "travel_advice": "Very dangerous avalanche conditions. Travel in avalanche terrain not recommended.", "danger": "high", "danger_level": 4, "color": "#e32321", "stroke": "#484848", "font_color": "#ffffff", "link": "http://www.missoulaavalanche.org/current-advisory/", "start_date": "12/20 07:19 AM", "end_date": "12/21 07:19 AM MST", "fillOpacity": 0.5, "fillIncrement": 0.1, "warning": {"product": "warning"}}, "geometry": {"type": "Polygon", "coordinates": [[[-113.7133, 47.31881], [-113.73596, 47.30251], [-113.74488, 47.29413], [-113.74626, 47.28389], [-113.73047, 47.28179], [-113.72978, 47.2769], [-113.73528, 47.26665], [-113.72772, 47.2557], [-113.72841, 47.24475], [-113.72395, 47.24078], [-113.73459, 47.23612], [-113.74043, 47.23146], [-113.73905, 47.22423], [-113.72154, 47.21397], [-113.6982, 47.20768], [-113.69476, 47.20464], [-113.69785, 47.19881], [-113.69923, 47.18785], [-113.68412, 47.16871], [-113.63502, 47.15844], [-113.59623, 47.16474], [-113.55915, 47.17897], [-113.35796, 47.18014], [-113.29479, 47.18084], [-113.29616, 47.23775], [-113.30886, 47.24171], [-113.31401, 47.23705], [-113.32466, 47.23332], [-113.34011, 47.23705], [-113.3583, 47.24684], [-113.36963, 47.25033], [-113.37581, 47.24917], [-113.38131, 47.25127], [-113.38233, 47.26059], [-113.39109, 47.26595], [-113.3971, 47.2713], [-113.4019, 47.27759], [-113.41083, 47.28714], [-113.41667, 47.28714], [-113.42422, 47.29506], [-113.43452, 47.29972], [-113.42491, 47.32067], [-113.43246, 47.34719], [-113.47572, 47.34626], [-113.48877, 47.35464], [-113.50387, 47.36905], [-113.51211, 47.39742], [-113.52069, 47.40276], [-113.51898, 47.40717], [-113.52584, 47.41322], [-113.53614, 47.42344], [-113.55262, 47.41415], [-113.57116, 47.40996], [-113.57048, 47.39649], [-113.59794, 47.39649], [-113.61442, 47.40485], [-113.62541, 47.40671], [-113.62541, 47.38858], [-113.64532, 47.38626], [-113.65974, 47.39044], [-113.67828, 47.38672], [-113.67759, 47.34254], [-113.66729, 47.32765], [-113.67759, 47.3216], [-113.7133, 47.31881]], [[-113.63691, 46.96468], [-113.6594, 46.96421], [-113.65974, 46.94616], [-113.6594, 46.92928], [-113.73116, 46.92108], [-113.76343, 46.91885], [-113.76617, 46.90478], [-113.80531, 46.90525], [-113.80531, 46.89586], [-113.81424, 46.89399], [-113.82111, 46.88976], [-113.9344, 46.8907], [-113.93166, 46.91181], [-113.94333, 46.91346], [-113.94916, 46.91627], [-113.95449, 46.92072], [-113.9514, 46.92154], [-113.95088, 46.9253], [-113.95003, 46.92694], [-113.94968, 46.93432], [-113.95088, 46.93667], [-113.95689, 46.93127], [-113.95792, 46.9226], [-113.95912, 46.92084], [-113.95912, 46.91557], [-113.97045, 46.91674], [-113.97045, 46.92096], [-113.96461, 46.92225], [-113.96376, 46.92389], [-113.96461, 46.92647], [-113.96873, 46.92905], [-113.97578, 46.93198], [-113.98505, 46.93151], [-113.98659, 46.92858], [-113.99706, 46.92776], [-113.9962, 46.9498], [-113.99328, 46.95038], [-113.99071, 46.95448], [-113.99174, 46.95683], [-113.99637, 46.95776], [-113.99637, 46.96046], [-113.99225, 46.96151], [-113.99431, 46.96374], [-114.01234, 46.96456], [-114.03964, 46.96432], [-114.03964, 46.97908], [-114.05989, 46.97955], [-114.06023, 46.99337], [-114.08186, 46.99348], [-114.08289, 47.00847], [-114.06589, 47.00765], [-114.06452, 47.00461], [-114.06126, 47.00379], [-114.05525, 47.00437], [-114.04409, 47.00742], [-114.0362, 47.01104], [-114.03311, 47.01854], [-114.02865, 47.02334], [-114.02195, 47.02953], [-114.00959, 47.03433], [-114.00358, 47.03819], [-113.9974, 47.03936], [-113.99363, 47.03842], [-113.98711, 47.04018], [-113.9847, 47.04568], [-113.98006, 47.04954], [-113.97887, 47.05375], [-113.97594, 47.05714], [-113.96873, 47.05656], [-113.96393, 47.05784], [-113.96221, 47.05878], [-113.95603, 47.0596], [-113.94968, 47.06369], [-113.9483, 47.07457], [-113.95037, 47.08041], [-113.94779, 47.08217], [-113.938, 47.08053], [-113.9356, 47.08567], [-113.93321, 47.08766], [-113.92393, 47.08941], [-113.92342, 47.09619], [-113.91792, 47.10016], [-113.91363, 47.106], [-113.90385, 47.10682], [-113.8932, 47.09677], [-113.88376, 47.09631], [-113.87775, 47.09291], [-113.87295, 47.08906], [-113.85544, 47.08567], [-113.8563, 47.08871], [-113.84892, 47.09175], [-113.84428, 47.09291], [-113.83981, 47.08824], [-113.83295, 47.08882], [-113.82437, 47.09163], [-113.8151, 47.09397], [-113.80531, 47.09747], [-113.80273, 47.09806], [-113.79707, 47.09631], [-113.79433, 47.09712], [-113.78694, 47.09514], [-113.78437, 47.09152], [-113.77819, 47.09163], [-113.77286, 47.08719], [-113.76755, 47.0866], [-113.75862, 47.08882], [-113.75691, 47.08415], [-113.75313, 47.07819], [-113.75055, 47.07819], [-113.74815, 47.07959], [-113.74472, 47.0762], [-113.72292, 47.07223], [-113.71296, 47.07281], [-113.70438, 47.07515], [-113.68961, 47.07], [-113.69202, 47.06193], [-113.68549, 47.05422], [-113.64738, 47.03024], [-113.63743, 47.00859], [-113.63691, 46.96468]], [[-114.58569, 46.63294], [-114.57024, 46.64236], [-114.56509, 46.64119], [-114.55479, 46.64402], [-114.54689, 46.64402], [-114.5414, 46.6492], [-114.52938, 46.64236], [-114.52114, 46.63954], [-114.51324, 46.63954], [-114.50054, 46.64119], [-114.49024, 46.63482], [-114.47342, 46.63223], [-114.46037, 46.63576], [-114.45248, 46.6492], [-114.42398, 46.66027], [-114.41059, 46.65604], [-114.40922, 46.66122], [-114.40235, 46.6598], [-114.39239, 46.66499], [-114.38416, 46.66311], [-114.3766, 46.66711], [-114.36355, 46.66828], [-114.35909, 46.67017], [-114.35223, 46.66334], [-114.34502, 46.66193], [-114.33575, 46.66169], [-114.3227, 46.6525], [-114.32064, 46.64637], [-114.3227, 46.64166], [-114.31995, 46.63812], [-114.32442, 46.62138], [-114.32716, 46.61926], [-114.32304, 46.61171], [-114.32957, 46.60464], [-114.33678, 46.59284], [-114.34261, 46.58954], [-114.33437, 46.58317], [-114.33094, 46.57845], [-114.32751, 46.58695], [-114.32133, 46.59166], [-114.29009, 46.59898], [-114.2815, 46.60063], [-114.28082, 46.607], [-114.28253, 46.6136], [-114.27807, 46.62209], [-114.26983, 46.62987], [-114.27189, 46.6386], [-114.26605, 46.64142], [-114.26022, 46.64873], [-114.25575, 46.65062], [-114.25335, 46.65438], [-114.24717, 46.65533], [-114.2482, 46.66758], [-114.24408, 46.67748], [-114.23447, 46.68713], [-114.21902, 46.68901], [-114.19704, 46.69255], [-114.18194, 46.6876], [-114.16992, 46.6869], [-114.15894, 46.69679], [-114.15447, 46.70668], [-114.13696, 46.70927], [-114.12357, 46.71703], [-114.10949, 46.73609], [-114.10847, 46.71397], [-114.11842, 46.69679], [-114.11224, 46.69161], [-114.10949, 46.6843], [-114.17404, 46.47569], [-114.23309, 46.40188], [-114.23446, 46.33839], [-114.21798, 46.27293], [-114.22897, 46.25109], [-114.20837, 46.17032], [-114.2276, 46.13607], [-114.21661, 46.11418], [-114.1864, 45.99314], [-114.00238, 45.83645], [-113.97766, 45.80199], [-113.96942, 45.77327], [-113.93096, 45.7311], [-113.94882, 45.70138], [-113.95843, 45.68795], [-113.97354, 45.68747], [-114.40956, 45.85224], [-114.40544, 45.87113], [-114.39892, 45.87161], [-114.38896, 45.8826], [-114.38724, 45.8912], [-114.39342, 45.89097], [-114.39548, 45.90076], [-114.40201, 45.90171], [-114.41437, 45.91223], [-114.4154, 45.9225], [-114.42707, 45.93253], [-114.43119, 45.9373], [-114.42364, 45.94327], [-114.41505, 45.94852], [-114.40407, 45.9564], [-114.40098, 45.96261], [-114.4099, 45.97215], [-114.41162, 45.97788], [-114.42261, 45.98193], [-114.4305, 45.98647], [-114.44801, 45.98742], [-114.45763, 45.99696], [-114.46209, 45.99744], [-114.47514, 45.991], [-114.48509, 45.99672], [-114.48749, 46.00483], [-114.47308, 46.01389], [-114.48097, 46.02987], [-114.49333, 46.02748], [-114.50706, 46.03106], [-114.50603, 46.03892], [-114.49711, 46.04297], [-114.49436, 46.05107], [-114.47342, 46.0587], [-114.46827, 46.06299], [-114.47205, 46.07013], [-114.4717, 46.07752], [-114.46175, 46.07871], [-114.4614, 46.09157], [-114.46037, 46.09609], [-114.46312, 46.0999], [-114.46861, 46.10418], [-114.47548, 46.11347], [-114.48784, 46.11299], [-114.49848, 46.11871], [-114.50638, 46.11871], [-114.52148, 46.12561], [-114.51633, 46.13441], [-114.52011, 46.13536], [-114.52835, 46.14559], [-114.51427, 46.15415], [-114.51565, 46.16771], [-114.50569, 46.16437], [-114.49573, 46.16747], [-114.48646, 46.16557], [-114.47548, 46.16057], [-114.46518, 46.16533], [-114.4566, 46.17056], [-114.44389, 46.16842], [-114.44492, 46.17294], [-114.44389, 46.19124], [-114.44492, 46.20383], [-114.45145, 46.21548], [-114.44527, 46.2207], [-114.45007, 46.23875], [-114.46861, 46.24588], [-114.46655, 46.253], [-114.46999, 46.26629], [-114.4638, 46.27103], [-114.44458, 46.27199], [-114.42535, 46.28338], [-114.42673, 46.29239], [-114.43359, 46.3071], [-114.42123, 46.32702], [-114.41299, 46.33318], [-114.41093, 46.36541], [-114.42261, 46.38483], [-114.41574, 46.39194], [-114.40063, 46.40283], [-114.38484, 46.4104], [-114.3821, 46.43312], [-114.36905, 46.43596], [-114.3718, 46.44212], [-114.3869, 46.44779], [-114.38072, 46.45915], [-114.3869, 46.46766], [-114.3972, 46.47428], [-114.40063, 46.50265], [-114.38553, 46.50406], [-114.37729, 46.50123], [-114.35463, 46.50596], [-114.34021, 46.51824], [-114.34708, 46.52863], [-114.34776, 46.5513], [-114.34295, 46.56452], [-114.39514, 46.55602], [-114.45556, 46.55602], [-114.5819, 46.53997], [-114.6643, 46.55508], [-114.61761, 46.57963], [-114.59426, 46.61077], [-114.59289, 46.6334], [-114.61074, 46.63812], [-114.61624, 46.64425], [-114.61486, 46.65037], [-114.62036, 46.65603], [-114.63409, 46.65933], [-114.64233, 46.67299], [-114.64027, 46.68006], [-114.62379, 46.68901], [-114.62242, 46.70785], [-114.63546, 46.71821], [-114.64508, 46.72433], [-114.65126, 46.73233], [-114.66362, 46.7375], [-114.68421, 46.73468], [-114.69726, 46.73891], [-114.7158, 46.71397], [-114.73846, 46.71209], [-114.75082, 46.69749], [-114.76181, 46.69608], [-114.76867, 46.69796], [-114.77554, 46.70644], [-114.78584, 46.71114], [-114.7879, 46.71491], [-114.78035, 46.72103], [-114.78172, 46.72621], [-114.77623, 46.73139], [-114.76764, 46.73821], [-114.76661, 46.74597], [-114.76593, 46.75821], [-114.77142, 46.76103], [-114.77451, 46.76526], [-114.78344, 46.76832], [-114.78756, 46.78007], [-114.7982, 46.77514], [-114.80678, 46.78196], [-114.81571, 46.78101], [-114.82944, 46.78313], [-114.84867, 46.79418], [-114.86652, 46.81392], [-114.8957, 46.80241], [-114.89879, 46.80852], [-114.89604, 46.8165], [-114.90016, 46.82261], [-114.91355, 46.82543], [-114.92042, 46.82907], [-114.92437, 46.83342], [-114.92643, 46.83307], [-114.92849, 46.83577], [-114.92677, 46.83929], [-114.92832, 46.84375], [-114.92574, 46.84528], [-114.92385, 46.84821], [-114.92815, 46.85467], [-114.9381, 46.85667], [-114.94239, 46.85643], [-114.94754, 46.85936], [-114.94737, 46.86136], [-114.94463, 46.86688], [-114.94068, 46.86817], [-114.93158, 46.87685], [-114.93115, 46.88243], [-114.93252, 46.88765], [-114.93467, 46.89023], [-114.93578, 46.89304], [-114.9351, 46.89486], [-114.9363, 46.89756], [-114.93347, 46.90319], [-114.93115, 46.9036], [-114.92866, 46.90993], [-114.92214, 46.91286], [-114.92317, 46.91462], [-114.92591, 46.91849], [-114.92883, 46.91943], [-114.93553, 46.9199], [-114.94033, 46.92342], [-114.94531, 46.92318], [-114.95029, 46.926], [-114.95956, 46.92881], [-114.96093, 46.93373], [-114.96419, 46.93666], [-114.97621, 46.94065], [-114.97999, 46.94616], [-114.98634, 46.94955], [-114.98771, 46.95483], [-114.99286, 46.95834], [-114.99406, 46.96162], [-114.99887, 46.96561], [-115.00316, 46.97088], [-115.00762, 46.97275], [-115.02565, 46.97556], [-115.0229, 46.98282], [-115.01089, 46.98833], [-114.99046, 47.00671], [-114.9872, 47.01607], [-114.97947, 47.0252], [-114.97123, 47.03035], [-114.96196, 47.02895], [-114.96059, 47.03503], [-114.96265, 47.03667], [-114.95098, 47.04486], [-114.94651, 47.05211], [-114.93621, 47.05749], [-114.93209, 47.06404], [-114.92729, 47.06918], [-114.92214, 47.07924], [-114.91012, 47.08929], [-114.89296, 47.10753], [-114.85931, 47.12154], [-114.84283, 47.14303], [-114.82773, 47.14396], [-114.814, 47.14023], [-114.80164, 47.12808], [-114.7879, 47.10145], [-114.7831, 47.06872], [-114.7831, 47.05515], [-114.75494, 47.0355], [-114.74258, 47.00742], [-114.73434, 47.00039], [-114.71581, 46.99758], [-114.69658, 47.01069], [-114.67186, 46.99149], [-114.65401, 46.98025], [-114.65744, 46.9662], [-114.67117, 46.96245], [-114.67323, 46.95307], [-114.69795, 46.92823], [-114.68765, 46.90525], [-114.68559, 46.85503], [-114.64989, 46.81933], [-114.61144, 46.8057], [-114.5874, 46.78455], [-114.53796, 46.76056], [-114.51118, 46.75727], [-114.51461, 46.74927], [-114.53315, 46.71538], [-114.54277, 46.6989], [-114.57366, 46.67347], [-114.57778, 46.65509], [-114.58569, 46.63294]]]}}
});
map.addLayer({
'id': 'poly-fill',
'type': 'fill',
'source': 'fill',
'layout': {},
'paint': {
'fill-color': '#088',
'fill-opacity': 0.8
}
});
map.addLayer({
'id': 'poly-line',
'type': 'line',
'source': 'fill',
'layout': {},
'paint': {
'line-color': '#088',
'line-opacity': 1,
'line-width': 2
}
});
});
body { margin: 0; padding: 0; }
#map { position: absolute; top: 0; bottom: 0; width: 100%; }
<link href="https://api.mapbox.com/mapbox-gl-js/v2.0.0/mapbox-gl.css" rel="stylesheet"/>
<script src="https://api.mapbox.com/mapbox-gl-js/v2.0.0/mapbox-gl.js"></script>
<div id="map"></div>