是否可以为 mapbox 中的一条折线设置更多 Line Dasharray
Is possible set more Line Dasharray for one polyline in mapbox
我在 Xamarin Forms 项目中使用 Naxam Mapbox。我需要为一条折线设置更多样式的 LineDasharray(折线的一部分是实线,其余部分是虚线)。
所有要素都有字符串 属性“isDottedLine”
我试过这个:
LineDasharray = Expression.SwitchCase
(
Expression.Eq(Expression.ToString(Expression.Get("isDottedLine")), Expression.ToString("true")), Expression.Literal(new[] { 0.1f, 1.5f }), // dotted line
Expression.Literal(new[] { 1f, 0f })// full line
),
但是不行。整条折线显示为实线。是我的代码有问题还是无法为一条折线设置更多 LineDasharray 样式?
我终于发现 Mapbox 不支持 line-dasharray 的数据驱动样式。
文档是 here.
我在 Xamarin Forms 项目中使用 Naxam Mapbox。我需要为一条折线设置更多样式的 LineDasharray(折线的一部分是实线,其余部分是虚线)。
所有要素都有字符串 属性“isDottedLine” 我试过这个:
LineDasharray = Expression.SwitchCase
(
Expression.Eq(Expression.ToString(Expression.Get("isDottedLine")), Expression.ToString("true")), Expression.Literal(new[] { 0.1f, 1.5f }), // dotted line
Expression.Literal(new[] { 1f, 0f })// full line
),
但是不行。整条折线显示为实线。是我的代码有问题还是无法为一条折线设置更多 LineDasharray 样式?
我终于发现 Mapbox 不支持 line-dasharray 的数据驱动样式。 文档是 here.