仅为圆形地图框 gl js 的边缘着色

ben*_*enj 3 mapbox-gl-js

我想在交互式地图上显示圆圈的轮廓(无填充),但是 mapbox-gl-js 中的绘制选项似乎仅限于填充。 https://www.mapbox.com/mapbox-gl-style-spec/#layers-circle

var styles = [{
    "id": 'points',
    "interactive": true,
    "type": "circle",
    "source": "geojson",
    "paint": {
        "circle-radius": 5,
        "circle-color": "#000
    },
    "filter": ["in", "$type", "Point"]
}, {
    "type": "line",
    "source": "geojson",
    "layout": {
      "line-cap": "round",
      "line-join": "round"
    },
    "paint": {
      "line-color": "#000",
      "line-width": 2.5
    },
    "filter": ["in", "$type", "LineString"]
}];
Run Code Online (Sandbox Code Playgroud)

我错过了什么还是这不可能?

eri*_*oco 7

这现在是可能的,使用circle-opacity.

例如:

"paint": {
    "circle-opacity": 0,
    "circle-stroke-width": 1,
    "circle-stroke-color": #000
}
Run Code Online (Sandbox Code Playgroud)