I've been trying to set up a way to pull a JSON file from a JMenu File Selector, and while I'm able to create a layer from said file, I'm not sure what to do in order to render it.
From what I understand, layers in World Wind render themselves. However the layer.render
method requires a DrawContext object as input. I'm not able to find the relevant DrawContext object in the appFrame
I've been passed as an argument. I can find a GlContext object via appFrame.getWwd().getContext()
. I thought there might be a way to find the object that created that GLContext, which should be a DrawContext object. I suppose another GLContext could have created that specific GLContext, but eventually the first GLContext has to have been made by a DrawContext object of some sort. At least that's my understanding of how that interaction works.
So my question has two parts I suppose:
- Am I correct in the method I'm using to render the Layer/My understanding of how Layers are rendered?
- Where do I find the appropriate instances of the DrawContext object I need to render the layer if the way I'm going about it is correct?