Mapbox 你能在地图盒静态地图上画一个圆吗?
我有一些geojson形状要传递给。某些形状是多段线,其他形状是圆,表示为具有半径特性的点,例如:Mapbox 你能在地图盒静态地图上画一个圆吗?,mapbox,Mapbox,我有一些geojson形状要传递给。某些形状是多段线,其他形状是圆,表示为具有半径特性的点,例如: { "type": "Feature", "properties": { "radius": 500 }, "geometry": { "type": "Point", "coordinates": [ 30.5,
{
"type": "Feature",
"properties": {
"radius": 500
},
"geometry": {
"type": "Point",
"coordinates": [
30.5,
50.5
]
}
}
这些将被渲染为带有标记的点。是否有任何方法可以将点渲染为以该点为中心的特定半径的圆?可以使用“层类型:圆”将点显示为圆。然后可以使用表达式从geojson属性中获取半径: 检查
您找到解决方案了吗?问题是关于静态映射API的
map.addLayer({
'id': 'demo',
'type': 'circle',
'source': 'points',
'paint': {
// use get expression to get the radius property. Divided by 10 to be able to display it
'circle-radius': ['/',['get', 'radius'],10],
'circle-color': "blue"
}
});