Draw a polyline with a border

453
1
Jump to solution
08-09-2023 04:43 AM
padmalcom
Occasional Contributor

Hi, we use SimpleLineSymbol to draw lines on the map. To make them more distinguishable from the map, I'd like to add a border in a different color. How can I do that? I found that there is a SimpleFillSymbol class that has an outline property but I don't understand how that works together with the SimpleLineSymbol.

0 Kudos
1 Solution

Accepted Solutions
padmalcom
Occasional Contributor

Nevermind, I got it.

// set a default symbol for features in the new collection table
val innerPolygonLayer: SymbolLayer = SolidStrokeSymbolLayer(
width = 6.0,
color = Color(routeType.color)
)
val outerPolygonLayer: SymbolLayer = SolidStrokeSymbolLayer(
width = 12.0,
color = Color.white
)

val multilayerPolygonSymbol = MultilayerPolylineSymbol(
symbolLayers = listOf(outerPolygonLayer, innerPolygonLayer)
)

val renderer = SimpleRenderer(multilayerPolygonSymbol)

View solution in original post

0 Kudos
1 Reply
padmalcom
Occasional Contributor

Nevermind, I got it.

// set a default symbol for features in the new collection table
val innerPolygonLayer: SymbolLayer = SolidStrokeSymbolLayer(
width = 6.0,
color = Color(routeType.color)
)
val outerPolygonLayer: SymbolLayer = SolidStrokeSymbolLayer(
width = 12.0,
color = Color.white
)

val multilayerPolygonSymbol = MultilayerPolylineSymbol(
symbolLayers = listOf(outerPolygonLayer, innerPolygonLayer)
)

val renderer = SimpleRenderer(multilayerPolygonSymbol)
0 Kudos