show-drawn-polygon maps
Create your file config.js
with
var config = {
TOKEN: 'MAPBOX_TOKEN'
}
Use mapbox-gl-draw to draw a polygon and Turf.js to calculate its area in square meters.
See the example: https://docs.mapbox.com//mapbox-gl-js/example/mapbox-gl-draw/