Add a GeoJSON polygon
Style a polygon with the fill layer type.
<!DOCTYPE html><html><head><meta charset="utf-8" /><title>Add a GeoJSON polygon</title><meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" /><script src="https://unpkg.com/trackasia-gl@1.0.5/dist/trackasia-gl.js"></script><link href="https://unpkg.com/trackasia-gl@1.0.5/dist/trackasia-gl.css" rel="stylesheet" /><style> body { margin: 0; padding: 0; } #map { position: absolute; top: 0; bottom: 0; width: 100%; }</style></head><body><div id="map"></div><script>var map = new trackasiagl.Map({container: 'map',style: 'https://maps.track-asia.com/styles/v1/streets.json?key=public_key',center: [105.101562,9.065754],zoom: 8}); map.on('load', function () {map.addSource('maine', {'type': 'geojson','data': {'type': 'Feature','geometry': {'type': 'Polygon','coordinates': [[[104.711292,8.615239],[104.859705,8.560923],[105.107058,8.62067],[105.260967,8.761852],[105.418234,9.008928],[105.249698,9.087452],[105.278247,9.16423],[105.274811,9.184227],[105.261087,9.179143],[105.235451,9.224522],[105.297289,9.280095],[105.249193,9.323462],[105.298664,9.384439],[105.010166,9.552407],[104.944205,9.533447],[104.919469,9.551052],[104.882366,9.492814],[104.839767,9.521257],[104.787999,8.778139],[104.903057,8.804061],[104.791748,8.713124],[104.797245,8.653391],[104.72029,8.647961],[104.711292,8.615239]]]}}});map.addLayer({'id': 'maine','type': 'fill','source': 'maine','layout': {},'paint': {'fill-color': '#088','fill-opacity': 0.8}});});</script> </body></html>