fieldStudyMap = {
let container = html`<div style='height:800px;' />`;
yield container;
let map = new mapboxgl.Map({
container,
center: [17.937, 59.256],
zoom: 13.5,
style: "mapbox://styles/mapbox/outdoors-v12"
});
const geojson = {
'type': 'FeatureCollection',
'features': [
{
'type': 'Feature',
'properties': {},
'geometry': {
'type': 'LineString',
'coordinates': coordinates
}
}
]
};
map.on('load', () => {
map.addSource('line', {
type: 'geojson',
lineMetrics: true,
data: geojson
});
map.addLayer({
type: 'line',
source: 'line',
id: 'line',
paint: {
'line-color': 'red',
'line-width': 5,
'line-gradient': [
'interpolate',
['linear'],
['line-progress']
].concat(elevations)
},
layout: {
'line-cap': 'round',
'line-join': 'round'
}
});
});
}