Hello there,
I am wanting to set the default line colour for the sketch widget in a similar fashion to this: https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-change-the-default-color-o... but in the 4.X javascript world.
I am able to assign a color to a graphic by setting the symbol on the graphic that I can then add to a view by using:
const graphic = new Graphic({
geometry: geometry,
symbol: {
type: this.options.line.type,
color: this.options.line.color,
width: this.options.line.width
}
});
But I am not sure what I would need to default and on what object so that when I draw lines the custom color is used.
Thanks
Solved! Go to Solution.
This might do what you're looking for:
sketch.viewModel.polylineSymbol = {
type: "simple-line", //autocasts as new SimpleLineSymbol()
color: "red",
width: "4px",
style: "solid"
};
This might do what you're looking for:
sketch.viewModel.polylineSymbol = {
type: "simple-line", //autocasts as new SimpleLineSymbol()
color: "red",
width: "4px",
style: "solid"
};
That's it - thanks a lot.