【发布时间】:2021-10-22 14:27:53
【问题描述】:
如何根据音高插入标记的文本偏移量?
插值非常适合:
'text-size': ['interpolate', ['linear'], ['zoom'], 10, 10, 18, 20],
但是对于文本偏移它不起作用。
'text-offset': ['interpolate', ['linear'], ['pitch'], 10, [0.2, 0], 18, [2, 0]],
我做错了什么?
'layout': {
'text-field': ['get', 'name'],
'text-font': [
'Open Sans Semibold',
'Arial Unicode MS Bold'
],
'text-size': ['interpolate', ['linear'], ['zoom'], 10, 10, 18, 20],
'text-rotate': -90,
//'text-offset': [2, 0],
'text-offset': ['interpolate', ['linear'], ['pitch'], 10, [0.2, 0], 18, [2, 0]],
'text-anchor': 'left',
'text-allow-overlap': true
},
paint: {
"text-color": "rgba(0, 100, 50, 0.9)",
}
【问题讨论】:
标签: mapbox interpolation offset marker pitch