如何在IOS的MapBox中更改线宽
如何更改MGLLineStyleLayer中的线宽如何在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
//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”不再起作用。请用这些信息更新您的问题。结果是什么?这似乎是