World Wind Forums

Go Back   World Wind Forums > WorldWind JAVA forums > Development Help

Development Help Help for building applications or diagnosing problems with WWJ

Reply
 
Thread Tools Display Modes
Old 06-12-2012, 05:26 PM   #1
ferez
Junior Member
 
Join Date: Dec 2009
Posts: 15
ferez is on a distinguished road
Default Bug in WMSLayerManager example?

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&amp;"/>
          </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
ferez is offline   Reply With Quote
Old 06-13-2012, 06:13 PM   #2
tag
WWJ Technical Manager
 
Join Date: May 2007
Location: Seattle
Posts: 1,033
tag is on a distinguished road
Default

That's just a hack in the example to detect elevation data. In your case the test isn't valid. WMSLayersPanel is just an example; you can modify it to suit your needs.
tag is offline   Reply With Quote
Reply

Tags
wmslayermanager


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
bug in glClearColor in AbstractSceneController lud42 Development Help 1 05-27-2011 12:09 AM
Sector clipping bug? nigel_ht Development Help 5 05-06-2009 05:04 AM
Possible Bug in WorldWind 0.5.0 IconRenderer Griff241 Development Help 5 06-16-2008 11:24 PM
Thread bug? Hang and error message rogene Development Help 6 10-09-2007 08:14 AM
Addtion Bug Dave0 Add-on & Script Development 3 01-23-2006 10:57 PM


All times are GMT +1. The time now is 05:40 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.