简体   繁体   English

Mapbox 在样式为线的多边形上显示图块边框

[英]Mapbox display tile borders on polygon styled as line

I am trying to display the borders of polygon with some line attributes based on zoom.我正在尝试基于缩放显示具有某些线属性的多边形边界。 The only problem is that on certain zoom levels the borders of tiles are shown.唯一的问题是在某些缩放级别上会显示图块的边框。

Polygono a zoom alejado

Polygono con zoom cercano

The style that I am using to display this is :我用来显示的样式是:

{ type: 'line',
'source-layer': 'pluto15v1',
"layout": {
  "line-round-limit": 1,
  "line-cap": "round",
  "line-miter-limit": 0,
  "line-join": "round"
},
"paint": {
    "line-color": [
        "step",
        ["zoom"],
        "hsla(0, 86%, 56%, 0)",
        7,
        "hsla(0, 86%, 56%, 0.58)",
        13,
        "hsl(0, 86%, 56%)",
        22,
        "hsla(0, 86%, 56%, 0.29)"
    ],
    "line-width": [
        "interpolate",
        ["linear"],
        ["zoom"],
        9,
        13,
        16,
        22,
        22,
        22
    ],
    "line-opacity": 0.76
}

Your problem is that your feature geometries are Polygon .你的问题是你的特征几何是Polygon When they are cut at tile boundaries, you end up with polygons that have an edge along the tile boundary.在切片边界处切割它们时,您最终会得到沿切片边界具有边缘的多边形。

If you use feature geometries that are LineString instead, then this doesn't happen.如果您使用LineString特征几何图形,则不会发生这种情况。 At tile boundaries, they are clipped and there is no part along the tile boundary.在图块边界处,它们被剪裁并且沿图块边界没有任何部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM