{
const width = 140;
const height = 220;
const container = html`<div id='123' style="height:${height}px; width: ${width}px" />`;
yield container;
const map = new mapboxgl.Map({
container,
center: polygon.center,
zoom: 17,
style: 'mapbox://styles/mapbox/satellite-v9',
preserveDrawingBuffer: true
});
map.on('load', function () {
map.addSource('maine', {
'type': 'geojson',
'data': {
'type': 'Feature',
'geometry': {
'type': 'Polygon',
'coordinates':[polygon.field_polygon]
}
}
});
map.addLayer({
'id': 'maine',
'type': 'fill',
'source': 'maine',
'layout': {},
'paint': {
'fill-color': '#088',
'fill-opacity': 0.6
}
});
map.fitBounds([
maxRightTop(polygon.field_polygon),
minLeftBottom(polygon.field_polygon)
],{padding: 10})
});
}