Example : -------------- here alternative dash with red and yellow color.
Asked
Active
Viewed 197 times
2 Answers
0
You can color lines according to specific conditions.
routeSymbols = {
"Route 1": new SimpleLineSymbol().setColor(new Color([0,0,255,0.5])).setWidth(5),
"Route 2": new SimpleLineSymbol().setColor(new Color([0,255,0,0.5])).setWidth(5),
"Route 3": new SimpleLineSymbol().setColor(new Color([255,0,255,0.5])).setWidth(5)
};
//Three different drawings can be made.
map.graphics.add(routeResult.route.setSymbol(routeSymbols[routeResult.routeName]))

ikbal
- 1,110
- 12
- 21
-
Thanks for the answer but I want a single graphic with an alternative dashed line. Your answer will work if I am having multiple graphics with type line. – gaurav sardana Aug 22 '19 at 10:28
0
if anyone is looking, one solid line with dashed line on top:
new CIMSymbol({
data: {
type: "CIMSymbolReference",
symbol: {
type: "CIMLineSymbol",
symbolLayers: [
{
type: "CIMSolidStroke",
effects: [
{
type: "CIMGeometricEffectDashes",
dashTemplate: [3.75, 3.75],
lineDashEnding: "HalfPattern",
offsetAlongLine: 0,
},
],
enable: !0,
capStyle: "Butt",
joinStyle: "Round",
miterLimit: 10,
width: 1.6,
color: [253, 251, 83, 255],
},
{ type: "CIMSolidStroke", enable: !0, capStyle: "Butt", joinStyle: "Round", miterLimit: 10, width: 1.6, color: [255, 165, 83, 255] },
],
},
},
});

pauljosephatay
- 121
- 4