Add a GeoJSON polygon
Style a polygon with the fill layer type. See the example: https://docs.mapbox.com//mapbox-gl-js/example/geojson-polygon/
by jscastro76
HTML
<link rel="stylesheet" href="https://api.mapbox.com/mapbox-gl-js/v2.0.0/mapbox-gl.css">
<script src="https://api.mapbox.com/mapbox-gl-js/v1.11.1/mapbox-gl.js"></script>
<div id="map"></div>
CSS
body { margin: 0; padding: 0; }
#map { position: absolute; top: 0; bottom: 0; width: 100%; }
JavaScript
mapboxgl.accessToken = 'PASTE HERE YOUR TOKEN';
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':...