Hello,

after upgrading from GeoTools 2.6.6 to 2.7.2, the following code
fails, which was previously working:

mapPane = new JMapPane(new StreamingRenderer(), new DefaultMapContext());

The stack is:

java.lang.NullPointerException
        at org.geotools.map.MapContent.listenToMapLayers(MapContent.java:275)
        at 
org.geotools.map.MapContent.addMapLayerListListener(MapContent.java:225)
        at 
org.geotools.map.MapContext.addMapLayerListListener(MapContext.java:514)
        at org.geotools.swing.JMapPane.doSetMapContext(JMapPane.java:480)
        at org.geotools.swing.JMapPane.<init>(JMapPane.java:228)
        at 
org.argeo.gis.ui.rcp.swing.SwingMapViewer.<init>(SwingMapViewer.java:45)
...

Apparently the problem is in MapContent:

        if (listen) {
            for (Layer layer : layerList) {
                layer.addMapLayerListener(layerListener);
            }
        } else {

(layerList is null)

Is there now another way to initialize an empty JMapPane ?

Thanks in advance for your help,

Mathieu

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a 
definitive record of customers, application performance, security 
threats, fraudulent activity and more. Splunk takes this data and makes 
sense of it. Business sense. IT sense. Common sense.. 
http://p.sf.net/sfu/splunk-d2d-c1
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to