Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.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
如何在IOS的MapBox中更改线宽_Ios_Mapbox - Fatal编程技术网

如何在IOS的MapBox中更改线宽

如何在IOS的MapBox中更改线宽,ios,mapbox,Ios,Mapbox,如何更改MGLLineStyleLayer中的线宽 //This is to change the color of the line let layer = MGLLineStyleLayer(identifier: "trails-path", source: trails) layer.lineColor = NSExpression(forConstantValue: UIColor.brown) mapView.style?.addLayer(layer) MGLStyleValu

如何更改MGLLineStyleLayer中的线宽

//This is to change the color of the line
let layer = MGLLineStyleLayer(identifier: "trails-path", source: trails)
layer.lineColor = NSExpression(forConstantValue: UIColor.brown)
mapView.style?.addLayer(layer)


MGLStyleValue似乎不再工作了

看起来您正在使用用于iOS的Mapbox Maps SDK的v4.0.0或更高版本。Maps SDK在v4.0.0中采用了
NSExpression

看起来您想要使用:

lineStyle.lineWidth = NSExpression(forConstantValue: 5)

有关迁移到表达式的详细信息,请参阅指南

请说明您进行了哪些研究,您已经尝试了哪些,哪些不起作用。我尝试使用lineStyle.lineWidth=MLGStyleValue(rawValue:4.0),但“MLGStyleValue”不再起作用。请用这些信息更新您的问题。结果是什么?这似乎是