But, when using this code, the entire “World” layer is overridden by line rendering. Same when using “UI” layer etc. Also, when I tried to create a new layer and render the lines into it, the lines were not rendered. Has anyone had this issue?
Oh, okay, the API docs mystifyed me, because I was using app.renderLine(start, end, startColor, endColor); and that was causing an error with layers (so I thought the layer is mandatory), because now the 4th parametr is not endColor, but target layer.
Anyhow, that still does not solve the problem with overwriting whole predefined layers / not drawing to new layers.
renderLine needs to use the Immediate layer to draw lines. If you want to render lines on a different layer then create a custom layer and set the same options as the built-in immediate layer. Don’t use the World layer or other built-in layers because that’s not how it’s meant to work.