Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/facebook/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在mapbox ios sdk中将线宽属性添加到MGLFillStyleLayer?_Ios_Swift_Mapbox - Fatal编程技术网

如何在mapbox ios sdk中将线宽属性添加到MGLFillStyleLayer?

如何在mapbox ios sdk中将线宽属性添加到MGLFillStyleLayer?,ios,swift,mapbox,Ios,Swift,Mapbox,我必须在带有“MGLPolygonFeature”的“MGLFillStyleLayer”中添加多边形特征,但问题是我无法更改轮廓宽度。当前无法更改MGLFillStyleLayer的线宽。建议的解决方法是使用相同的源创建填充层,然后在填充层上方插入线层 我可以使用以下代码向中添加线条层: let lineLayer = MGLLineStyleLayer(identifier: "line-layer", source: source) lineLayer.lineWidth

我必须在带有“MGLPolygonFeature”的“MGLFillStyleLayer”中添加多边形特征,但问题是我无法更改轮廓宽度。

当前无法更改
MGLFillStyleLayer
的线宽。建议的解决方法是使用相同的源创建填充层,然后在填充层上方插入线层

我可以使用以下代码向中添加线条层:

    let lineLayer = MGLLineStyleLayer(identifier: "line-layer", source: source)
    lineLayer.lineWidth = MGLStyleValue(rawValue: 5)
    lineLayer.sourceLayerIdentifier = "drone-restrictions-3f6lsg"

    if let cityLabels = style.layer(withIdentifier: "place-city-sm") {
        style.insertLayer(layer, below: cityLabels)
        style.insertLayer(lineLayer, above: layer)
    }

别忘了显示您尝试过的内容/您设置的当前代码。