I have created a simple polyline line graphic layer, i.e. below:
const polyline = {
type: "polyline",
paths: [
[lineY, lineX],
[coordinatesBx, coordinatesBy]
]
};
const polylineGraphic = new Graphic({
geometry: polyline,
symbol: simpleLineSymbol,
id: "drawLine"
});
graphicsLayer.add(polylineGraphic);
The problem is, it's going behind some elements... when it shouldn't be. It needs to be the second to top layer. For instance, I only want my modals to have a higher index then my new line here.
But if second to top is too low level; I could probably figure it out if I could simply know how make it the highest index (or on top of everything). I am having trouble toggling it's index position at all with the below two methods.
Most recently I have tried the below moveItem method. And did not see any effect... I have also tried the reorderLayer method, but anytime I use that I get 'reorderLayer' is not a function (perhaps because it is 3.x technique and I am on 4.x?).
//Gets the item in the 0 index
let drawLinegraphic = polylineGraphic.graphics.getItemAt(0);
//moves it to the 5 index
polylineGraphic.graphics.moveItem(drawLinegraphic, 5);