2

How do you remove the default WMS Layer from a basic WorldWind Java application? If I remove it like so, my application is still trying to reach the public WorldWind WMS servers:

import gov.nasa.worldwind.Model;

Model testModel = new BasicModel();
testModel.getLayers().clear(); // Makes default geo invisible, but still queries server in background.

// Add my own layers, here
Agricola
  • 572
  • 1
  • 8
  • 20
  • Now, I was using .getLayers().clear(). I'm not sure from the Javadoc (which is silent on this) but I think clearList() clears the properties in the AVList and the layer list is something completely different. – Agricola Jul 31 '17 at 11:51

1 Answers1

1

Oh wow - thanks for reminding me about an old love !

However, regarding your question: If you want to work completely offline, use property gov.nasa.worldwind.avkey.OfflineMode (answer found here)

If you want to remove individual layers, take a look at the config folder. config/worlwind.layers.xml contains the layer config, just comment out layer you do not want to use. The folder resides in worldwind.jar when using the standard build, but you can specify a different location - take a look at the Configuration class on how to do that.

There is also another interesting file there, DataFileStore.xml, which lets you define the cache location. If you fill the cache with your area of interest while being online, this data will also be used when in offline mode. Once there were also Cachepacks available but it seem these are not available anymore.

I think there was also a tool to select an area and download the data into the cache for offline mode.

Have fun !

jausen brett
  • 1,111
  • 7
  • 10