Hi,

It looks that GetMap is not removed from the GetFeatureInfo request which makes 
at least Geoserver to fail

<ExceptionText>Single value expected for request parameter request but instead 
found: [GetMap, GetFeatureInfo]</ExceptionText>

-Jukka-


-----Alkuperäinen viesti-----
Lähettäjä: jump-pilot-...@lists.sourceforge.net 
[mailto:jump-pilot-...@lists.sourceforge.net] 
Lähetetty: 24. joulukuuta 2015 14:03
Vastaanottaja: jump-pilot-devel@lists.sourceforge.net
Aihe: [JPP-Devel] SVN: [4665] core/trunk

Revision: 4665
          http://sourceforge.net/p/jump-pilot/code/4665
Author:   bertazza
Date:     2015-12-24 12:03:26 +0000 (Thu, 24 Dec 2015)
Log Message:
-----------
Info feature tool for WMS: info shown only for visible layers, added 
&FEATURE_COUNT=10 parameter, and changed method to retrieve url as suggested by 
Jukka (should now support basic authentication).

Modified Paths:
--------------
    core/trunk/ChangeLog
    
core/trunk/src/com/vividsolutions/jump/workbench/ui/cursortool/FeatureInfoTool.java

Modified: core/trunk/ChangeLog
===================================================================
--- core/trunk/ChangeLog        2015-12-23 23:13:38 UTC (rev 4664)
+++ core/trunk/ChangeLog        2015-12-24 12:03:26 UTC (rev 4665)
@@ -4,6 +4,11 @@
 #<-------------------------------- 80 chars 
---------------------------------->#
 
 2015-12-24 bertazza
+  * Info feature tool for WMS: info shown only for visible layers, added
+    &FEATURE_COUNT=10 parameter, and changed method to retrieve url as
+    suggested by Jukka (should now support basic authentication).
+
+2015-12-24 bertazza
   * Fixed broken 4663 commit
 
 2015-12-23 bertazza

Modified: 
core/trunk/src/com/vividsolutions/jump/workbench/ui/cursortool/FeatureInfoTool.java
===================================================================
--- 
core/trunk/src/com/vividsolutions/jump/workbench/ui/cursortool/FeatureInfoTool.java
 2015-12-23 23:13:38 UTC (rev 4664)
+++ 
core/trunk/src/com/vividsolutions/jump/workbench/ui/cursortool/FeatureInfoTool.java
 2015-12-24 12:03:26 UTC (rev 4665)
@@ -113,11 +113,20 @@
         
         // WMS
         List<Layerable> wmsLay_l = 
getWorkbench().getContext().getLayerManager().getLayerables(WMSLayer.class);
+        //Iterator iter = 
getWorkbench().getContext().getLayerNamePanel().selectedNodes(WMSLayer.class).iterator();
+        
         String response = "";
-        for(Layerable lay : wmsLay_l) {
+        for(Layerable lay : wmsLay_l) {           
+            
+            // We only want visible layers
             WMSLayer wmsLayer = (WMSLayer) lay;
+            if(!wmsLayer.isVisible()) {
+                continue;
+            }
             
-            String featInfoUrl = 
wmsLayer.getService().getCapabilities().getFeatureInfoURL();     
+            //String featInfoUrl = 
wmsLayer.getService().getCapabilities().getFeatureInfoURL();
+            String featInfoUrl = 
wmsLayer.createRequest(getWorkbench().getContext().getLayerViewPanel()).getURL().toString();
+            
             String names = getWmsLayeNames(wmsLayer);
             
             Point2D point = getPanel().getViewport().toViewPoint(coord);
@@ -128,6 +137,7 @@
             } else {
                 featInfoUrl += "?";
             }
+            
             String version = wmsLayer.getWmsVersion();
             if (WMService.WMS_1_0_0.equals(version)) {
                 featInfoUrl += "REQUEST=feature_info&WMTVER=1.0.0";
@@ -162,6 +172,8 @@
                 }
             }
             
+            featInfoUrl = featInfoUrl.concat("&FEATURE_COUNT=10 ");
+            
             URL url = stripXhtmlTags(featInfoUrl);
             
             String newLine = System.getProperty("line.separator");


------------------------------------------------------------------------------
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

------------------------------------------------------------------------------
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to