0

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:

  1. Am I correct in the method I'm using to render the Layer/My understanding of how Layers are rendered?
  2. 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?
mkrieger1
  • 19,194
  • 5
  • 54
  • 65
  • I think you need to provide more context. You cannot just take any old JSON data and expect WorldWind to know what to do with it. Is the data in a format that WorldWind can use? How are you creating a layer from JSON? Are you using something like the GeoJSONParser? I've never rendered from JSON before, so I probably won't be able to answer, but someone who can answer would benefit from additional context. – Loduwijk Oct 12 '18 at 15:18
  • Also (and this might be your problem), did you actually add the layer you created to the list of layers that are getting rendered? Please provide some code snippets. – Loduwijk Oct 12 '18 at 15:20

0 Answers0