Hi
I am testing the WMSLayerManager example which in turn uses the WMSLayersPanel class to work. I am trying to connect to a wms server which its capabilities document contains the following GetMap part:
Code:
<GetMap>
<Format>application/bil16</Format>
<Format>image/png</Format>
<Format>image/jpeg</Format>
<DCPType>
<HTTP>
<Get>
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="http://basir.org/jjn/service/wms?SERVICE=WMS&"/>
</Get>
</HTTP>
</DCPType>
</GetMap>
Now when I select a layer from layers window to add it to the application the layer doesn't get added to the layer list. I debugged the app and found that there is a method which causes this behaviour, i.e., the WMSLayersPanel.getFactoryKeyForCapabilit ies method:
Code:
protected static String getFactoryKeyForCapabilities(WMSCapabilities caps)
{
boolean hasApplicationBilFormat = false;
Set<String> formats = caps.getImageFormats();
for (String s : formats)
{
if (s.contains("application/bil"))
{
hasApplicationBilFormat = true;
break;
}
}
return hasApplicationBilFormat ? AVKey.ELEVATION_MODEL_FACTORY : AVKey.LAYER_FACTORY;
}
As you could notice this method always returns gov.nasa.worldwind.avkey.ElevationModelF actory even if I choose an image layer because "formats" contains "application/bil". So the caller method thinks the layer is of type elevation layer. Why is this happening? Is anything wrong with my capabilities document or may be the method is problematic? I really appreciate your help.
Regards,
Ferez