Hi,
the WMS plugin currently shows the layer titles when you choose which
layers you want to fetch from the WMS but uses the first layer's name
when adding the WMS request to OpenJUMP's layers.
The name of a WMS layer is usually something like a layer ID, and
supposed to be used by machines, while the title is more like the name
to be presented to end users.
I changed the behavior of the plugin to use the WMS title of the first
requested layer instead.
Does anyone want to review the patch or can I just submit it?
(I attached it anyway...)
Best regards, Andreas
--
l a t / l o n GmbH
Aennchenstrasse 19 53177 Bonn, Germany
phone ++49 +228 18496-11 fax ++49 +228 1849629
http://www.lat-lon.de http://www.deegree.org
Index: src/com/vividsolutions/jump/workbench/model/WMSLayer.java
===================================================================
--- src/com/vividsolutions/jump/workbench/model/WMSLayer.java (Revision 907)
+++ src/com/vividsolutions/jump/workbench/model/WMSLayer.java (Arbeitskopie)
@@ -100,9 +100,14 @@
this(layerManager, initializedService, srs, layerNames, format,
initializedService.getVersion());
}
- public WMSLayer(LayerManager layerManager, WMService initializedService,
+ public WMSLayer(String title, LayerManager layerManager, WMService
initializedService,
+ String srs, List layerNames, String format) throws
IOException {
+ this(title, layerManager, initializedService, srs, layerNames, format,
initializedService.getVersion());
+ }
+
+ public WMSLayer(String title, LayerManager layerManager, WMService
initializedService,
String srs, List layerNames, String format, String
version){
- super((String) layerNames.get(0), layerManager);
+ super(title, layerManager);
setService(initializedService);
setSRS(srs);
this.layerNames = new ArrayList(layerNames);
@@ -111,6 +116,11 @@
this.wmsVersion = version;
}
+ public WMSLayer(LayerManager layerManager, WMService initializedService,
+ String srs, List layerNames, String format, String
version){
+ this((String) layerNames.get(0), layerManager, initializedService,
srs, layerNames, format, version);
+ }
+
protected void init() {
getBlackboard().put(
RenderingManager.USE_MULTI_RENDERING_THREAD_QUEUE_KEY, true);
Index:
src/com/vividsolutions/jump/workbench/ui/plugin/wms/AddWMSQueryPlugIn.java
===================================================================
--- src/com/vividsolutions/jump/workbench/ui/plugin/wms/AddWMSQueryPlugIn.java
(Revision 907)
+++ src/com/vividsolutions/jump/workbench/ui/plugin/wms/AddWMSQueryPlugIn.java
(Arbeitskopie)
@@ -31,6 +31,11 @@
*/
package com.vividsolutions.jump.workbench.ui.plugin.wms;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
import com.vividsolutions.jump.I18N;
import com.vividsolutions.jump.workbench.model.StandardCategoryNames;
import com.vividsolutions.jump.workbench.model.UndoableCommand;
@@ -40,21 +45,14 @@
import com.vividsolutions.jump.workbench.ui.GUIUtil;
import com.vividsolutions.jump.workbench.ui.wizard.WizardDialog;
import com.vividsolutions.jump.workbench.ui.wizard.WizardPanel;
-
import com.vividsolutions.wms.MapLayer;
import com.vividsolutions.wms.WMService;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
public class AddWMSQueryPlugIn extends AbstractPlugIn {
+
private String cachedURL = "http://demo.deegree.org/deegree-wms/services";
private String lastWMSVersion = WMService.WMS_1_1_1;
- public AddWMSQueryPlugIn() {
- }
private List toLayerNames(List mapLayers) {
ArrayList names = new ArrayList();
@@ -86,7 +84,10 @@
return false;
}
- final WMSLayer layer = new WMSLayer(context.getLayerManager(),
+ // title of the layer will be the title of the first WMS layer
+ String title =
((MapLayer)((List)d.getData(MapLayerWizardPanel.LAYERS_KEY)).get(0)).getTitle();
+
+ final WMSLayer layer = new WMSLayer(title,context.getLayerManager(),
(WMService) d.getData(URLWizardPanel.SERVICE_KEY),
(String) d.getData(SRSWizardPanel.SRS_KEY),
toLayerNames((List) d.getData(MapLayerWizardPanel.LAYERS_KEY)),
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel