const addTwoLineEvt = () => {
!map.value.getSource('g28LineSource') &&
map.value.addSource('g28LineSource', {
type: 'geojson',
data: G28,
lineMetrics: true,
});
!map.value.getLayer('g28Line') &&
map.value.addLayer({
type: 'line',
source: 'g28LineSource',
id: 'g28LineOut',
layout: {
'line-cap': 'round',
'line-join': 'round',
},
paint: {
'line-color': '#FFE990',
'line-width': [
'interpolate',
['exponential', 0.5],
['zoom'],
6,
10,
10,
14,
12,
18,
],
'line-blur': [
'interpolate',
['exponential', 0.5],
['zoom'],
6,
10,
10,
14,
12,
18,
],
},
});
map.value.addLayer({
type: 'line',
source: 'g28LineSource',
id: 'g28Line',
layout: {
'line-cap': 'round',
'line-join': 'round',
},
paint: {
'line-color': '#FFE990',
'line-width': [
'interpolate',
['exponential', 0.5],
['zoom'],
6,
1,
10,
2,
12,
4,
],
},
});
};
mapbox加载高亮线效果
于 2024-08-07 16:33:19 首次发布