PDA

View Full Version : MilStd2525IconRetrieverPath for offline use


bdschubert
03-19-2012, 06:19 PM
I'm trying to setup my app to use a file-based icon retriever instead of an http-based one. I'm under the impression that I need only specify in the MilStd2525IconRetrieverPath property the path to a zip file containing the icon folders (e.g., milstd2525-symbols.zip). Yet, no matter how I've configured the path, the AbstractIconRetriever.readImage() method always fails.

Ultimately, WWIO.getFileOrResourceAsStream() is called and it fails to open the file. It uses a File object to test for the existence of a zip file entry, which fails.

What's the correct way to configure WW to use a file-based zip file for icons?

Example property:

<Property name="gov.nasa.worldwind.avkey.MilStd2525IconR etrieverPath" value="c:/temp/milstd2525-symbols.zip" />

bdschubert
03-19-2012, 09:21 PM
FYI: getFileOrResourceAsStream() first tries to open a file, and if not found, it attempts to get a resource. So, I added my symbol icons (.PNGs) to my worldwind.jar file so that the subsequent call to getResourceAsStream(path) would succeed. Then I set the path in the MilStd2525IconRetrieverPath property to the root folder in the jar file. Its a viable workaround, for now, but certainly not as flexible as using an external file.

pabercrombie
03-20-2012, 06:32 PM
To load icons from a zip file, set the retrieval path to a jar URL like this:

<Property name="gov.nasa.worldwind.avkey.MilStd2525IconR etrieverPath" value="jar:file:milstd2525-symbols.zip!"/>

For more info, see the the Offline Use (http://goworldwind.org/developers-guide/symbology/tactical-symbols/#offline-use) section of the Symbology Usage guide.

bdschubert
03-20-2012, 10:12 PM
Ah, the jar:file:/...! syntax. Thanks! The local file works good, and fast too.

FYI, There are some new ems icons on the server dated 12-Mar-2012 that aren't in the zip file yet.

pabercrombie
03-27-2012, 09:32 PM
I uploaded a new zipfile that includes the EMS icons. Thanks for pointing that out.