- Get the index of the layer you want to modify. To do that, run this snippet in the console:
view.map.allLayers.forEach(function(layer, index) {
console.log(layer.title, "->", index);
});
- Set the halo color, transparency and size by running the changeHalo function in the console.
function setHalo(index, color, size) {
const layer = view.map.allLayers.getItemAt(index);
const label3D = layer.labelingInfo[0].clone();
const textSymbol3D = label3D.symbol.symbolLayers.getItemAt(0);
textSymbol3D.halo = {
color: color,
size: size
}
layer.labelingInfo = [label3D];
}
// call the function with your own values
setHalo(1, [255, 255, 255, 0.8], 1);
index
- the layer index as identified in the previous stepcolor
- an array containing the opacity value; current value in SV is [255, 255, 255, 0.3]. Set it to [255, 255, 255, 1] to have completely opaque halos.size
- the size of the halo in pts. current value in SV is 0.5.
For more info on halo props see: https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol3DLayer.html#halo