From 0ac3230e38c00e08d9350a10beea010ea6fcb070 Mon Sep 17 00:00:00 2001 From: Francesco Mangiacrapa Date: Fri, 22 Jan 2016 16:23:21 +0000 Subject: [PATCH] 2054: Geo-Utility: an utility class to work with geo-spatial data Task-Url: https://support.d4science.org/issues/2054 Gis Viewer Application has been integrated with geo-utility library git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/gis-viewer-app@122467 82a268e6-3cf1-43bd-a215-b396298e98cf --- .classpath | 4 +- .settings/org.eclipse.wst.common.component | 5 +- pom.xml | 8 +- .../client/ApplicationController.java | 88 ++++++------ .../client/WmsRequestConverter.java | 128 +++++++----------- .../client/rpc/GisViewerAppService.java | 16 ++- .../client/rpc/GisViewerAppServiceAsync.java | 44 ++++-- .../server/GisViewerAppServiceImpl.java | 37 ++++- .../user/gisviewerapp/shared/GeoStyles.java | 106 +++++++++++++++ .../gisviewerapp/shared/WmsParameters.java | 69 ---------- 10 files changed, 286 insertions(+), 219 deletions(-) create mode 100644 src/main/java/org/gcube/portlets/user/gisviewerapp/shared/GeoStyles.java delete mode 100644 src/main/java/org/gcube/portlets/user/gisviewerapp/shared/WmsParameters.java diff --git a/.classpath b/.classpath index 93e51d5..a742b9e 100644 --- a/.classpath +++ b/.classpath @@ -1,6 +1,6 @@ - + @@ -30,5 +30,5 @@ - + diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index 5133431..631d426 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -3,7 +3,10 @@ - + + uses + + uses diff --git a/pom.xml b/pom.xml index cd00a8f..1d4f4d5 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ org.gcube.portlets.user gis-viewer-app war - 1.2.0-SNAPSHOT + 1.3.0-SNAPSHOT Gis Viewer App The Gis Viewer App @@ -70,6 +70,12 @@ compile + + org.gcube.spatial.data + geo-utility + [1.0.0-SNAPSHOT,2.0.0-SNAPSHOT) + + diff --git a/src/main/java/org/gcube/portlets/user/gisviewerapp/client/ApplicationController.java b/src/main/java/org/gcube/portlets/user/gisviewerapp/client/ApplicationController.java index c7902b4..76afbce 100644 --- a/src/main/java/org/gcube/portlets/user/gisviewerapp/client/ApplicationController.java +++ b/src/main/java/org/gcube/portlets/user/gisviewerapp/client/ApplicationController.java @@ -1,5 +1,5 @@ /** - * + * */ package org.gcube.portlets.user.gisviewerapp.client; @@ -33,7 +33,7 @@ import com.google.gwt.user.client.ui.RootPanel; public class ApplicationController { /** - * + * */ private GisViewerPanel gisViewerPanel; // for normal mode // private GCubeGisViewerPanel gisViewerPanel; // for gcube mode @@ -48,7 +48,7 @@ public class ApplicationController { @SuppressWarnings("unused") private RootPanel gwtRootPanel; /** - * + * */ public ApplicationController() { mainPanel = new LayoutContainer(); @@ -61,54 +61,49 @@ public class ApplicationController { wmsRequestConverter = new WmsRequestConverter(gisViewerPanel); mainPanel.add(gisViewerContentPanel); } - + private void initGisViewerParameters(){ - + gisViewerParameters = new GisViewerParameters(); gisViewerParameters.setProjection(""); gisViewerParameters.setOpenDataPanelAtStart(false); - + gisViewerParameters.setDataPanelOpenListener(new DataPanelOpenListener() { @Override public void dataPanelOpen(boolean isOpen, int panelHeight) { -// OLD CODE -// int gisViewerHeight = gisViewerContentPanel.getHeight()+ (isOpen ? panelHeight-24 : -panelHeight+24); -// ConstantGisViewerApp.logger.log(Level.INFO, "Set heigth: "+gisViewerHeight); -// gisViewerContentPanel.setHeight(gisViewerHeight); - int dataPanelHeight = isOpen ? panelHeight+24 : 24; int gisViewerHeight; - - if(gisViewerContentPanel.getHeight()>Constants.minGisViewerHeight) - gisViewerHeight = gisViewerContentPanel.getHeight(); - else - gisViewerHeight = Constants.minGisViewerHeight+dataPanelHeight; + if(gisViewerContentPanel.getHeight()>Constants.minGisViewerHeight) { + gisViewerHeight = gisViewerContentPanel.getHeight(); + } + else { + gisViewerHeight = Constants.minGisViewerHeight+dataPanelHeight; + } gisViewerContentPanel.setHeight(gisViewerHeight); - - } }); - + } - + private void initGisViewerContentPanel(){ - + gisViewerContentPanel = new ContentPanel() { @Override protected void onExpand() { super.onExpand(); - if (gisViewerPanel!=null) + if (gisViewerPanel!=null) { gisViewerPanel.updateOpenLayersSize(); + } } - + @Override protected void onCollapse() { super.onCollapse(); } }; - + gisViewerContentPanel.setLayout(new FitLayout()); gisViewerContentPanel.setHeading(ConstantGisViewerApp.GIS_VIEWER_APP); gisViewerContentPanel.setHeaderVisible(false); @@ -123,39 +118,38 @@ public class ApplicationController { public void go(final RootPanel rootPanel) { this.gwtRootPanel = rootPanel; rootPanel.add(mainPanel); - + String wmsRequest = Window.Location.getParameter(ConstantGisViewerApp.GET_WMS_PARAMETER); ConstantGisViewerApp.logger.log(Level.INFO, ConstantGisViewerApp.GET_WMS_PARAMETER+ " is "+wmsRequest); // String replacement = Window.Location.getParameter(ConstantGisViewerApp.WMS_PARAM_SEPARATOR_REPLACEMENT_KEY); // ConstantGisViewerApp.logger.log(Level.INFO, ConstantGisViewerApp.WMS_PARAM_SEPARATOR_REPLACEMENT_KEY+ " is "+replacement); - + if(wmsRequest!=null && !wmsRequest.isEmpty()){ - + // if(replacement!=null && !replacement.isEmpty()){ // ConstantGisViewerApp.logger.log(Level.INFO, "Replacing all "+replacement); // wmsRequest = wmsRequest.replaceAll(replacement, wmsRequest); // } try { - wmsRequestConverter.parseRequest(wmsRequest,null); - wmsRequestConverter.addRequestToGisViewer(); + wmsRequestConverter.addRequestToGisViewer(wmsRequest,null); } catch (Exception e) { ConstantGisViewerApp.logger.log(Level.INFO, "An error occurred on adding wmsrequest :"+wmsRequest); e.printStackTrace(); } } - + rootPanel.add(lcWMS); lcWMS.setId("WMS"); - + Command cmd = new Command() { - + @Override public void execute() { final DialogBox box = new DialogBox(true); box.setText("Add External WMS Layer"); box.getElement().getStyle().setZIndex(10000); - + WmsForm form = new WmsForm() { @Override @@ -165,9 +159,9 @@ public class ApplicationController { @Override public void subtmitHandler(String title, String name, String wmsRequest) { - - //TODO UPDATE - gisViewerPanel.addLayerByWms(title, name, wmsRequest, false, false, false); + + //TODO UPDATE + gisViewerPanel.addLayerByWms(title, name, wmsRequest, false, false, null); box.hide(); } }; @@ -176,16 +170,16 @@ public class ApplicationController { box.center(); } }; - + balloonWMS = new BaloonPanel("+WMS", false, cmd); SetZIndex setZIndex = new SetZIndex(); safeFunctionCallOn(lcWMS,setZIndex); } - - + + /** - * + * * @param wmsRequest * @return */ @@ -203,9 +197,9 @@ public class ApplicationController { public GisViewerPanel getGisViewerPanel() { return gisViewerPanel; } - + /** - * + * */ public void moveWMSBalloonPosition(){ balloonWMS.hide(); @@ -248,7 +242,7 @@ public class ApplicationController { c.addListener(Events.Render, lsnr); } } - + public interface Function { public void execute(); } @@ -257,7 +251,7 @@ public class ApplicationController { /* * (non-Javadoc) - * + * * @see * org.gcube.portlets.user.gisviewerapp.client.ApplicationController * .Function#execute() @@ -266,17 +260,17 @@ public class ApplicationController { public void execute() { final Timer tm = new Timer() { - + @Override public void run() { - + int zi = lcWMS.el().getZIndex(); GWT.log("zindex: "+zi); int zIndex = zi<300?300:zi; balloonWMS.getElement().getStyle().setZIndex(zIndex); } }; - + tm.schedule(1000); } } diff --git a/src/main/java/org/gcube/portlets/user/gisviewerapp/client/WmsRequestConverter.java b/src/main/java/org/gcube/portlets/user/gisviewerapp/client/WmsRequestConverter.java index 02c68fb..98a793d 100644 --- a/src/main/java/org/gcube/portlets/user/gisviewerapp/client/WmsRequestConverter.java +++ b/src/main/java/org/gcube/portlets/user/gisviewerapp/client/WmsRequestConverter.java @@ -1,18 +1,19 @@ /** - * + * */ package org.gcube.portlets.user.gisviewerapp.client; import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; import org.gcube.portlets.user.gisviewer.client.GisViewerPanel; import org.gcube.portlets.user.gisviewer.client.GisViewerPanel.LayerType; -import org.gcube.portlets.user.gisviewer.client.commons.utils.WmsUrlValidator; +import org.gcube.portlets.user.gisviewerapp.client.rpc.GisViewerAppServiceAsync; +import org.gcube.portlets.user.gisviewerapp.shared.GeoStyles; +import org.gcube.spatial.data.geoutility.bean.WmsParameters; +import org.gcube.spatial.data.geoutility.wms.WmsUrlValidator; -import com.google.gwt.core.shared.GWT; import com.google.gwt.user.client.Window; +import com.google.gwt.user.client.rpc.AsyncCallback; /** @@ -22,22 +23,21 @@ import com.google.gwt.user.client.Window; * Dec 10, 2015 */ public class WmsRequestConverter { - + private GisViewerPanel gisViewer; - + private LayerType layerType = LayerType.FEATURETYPE; private String title; private String displayLayerName; - private String url; + private String url; private boolean isExternal = false; private boolean isBase = false; private boolean displayInLayerSwitcher = false; private boolean onTop = true; - private ArrayList listStyles; private String wmsRequest; - private HashMap noWMSParams; - private boolean isNcWMS = false; - + + private WmsUrlValidator urlValidator; + /** * Instantiates a new wms request converter. * @@ -46,7 +46,7 @@ public class WmsRequestConverter { public WmsRequestConverter(GisViewerPanel gisViewerPanel) { this.gisViewer = gisViewerPanel; } - + /** * Parses the request. * @@ -54,52 +54,69 @@ public class WmsRequestConverter { * @param displayName the display name * @throws Exception the exception */ - public void parseRequest(String wmsRequest, String displayName) throws Exception{ + public void addRequestToGisViewer(String wmsRequest, String displayName) throws Exception{ this.wmsRequest = wmsRequest; - + //FIND BASE URL int indexStart = wmsRequest.indexOf("?"); if(indexStart>=0){ - url = wmsRequest.substring(0, indexStart); //get only parameters + url = wmsRequest.substring(0, indexStart); //get only base uri url = url.trim(); //string trim }else{ Window.alert("Bad wms request '?' not found!"); // throw new Exception("Bad server request '?' not found!"); } - - WmsUrlValidator urlValidator = new WmsUrlValidator(wmsRequest); + + urlValidator = new WmsUrlValidator(wmsRequest); urlValidator.parseWmsRequest(true,false); - String layerName = urlValidator.getValueOfParsedWMSParameter(org.gcube.portlets.user.gisviewer.client.commons.utils.WmsParameters.LAYERS); - + String layerName = urlValidator.getValueOfParsedWMSParameter(WmsParameters.LAYERS); + if(layerName==null || layerName.isEmpty()){ Window.alert("Bad wms request LAYER parameter not found!"); throw new Exception("Layer name not found!"); }else{ displayLayerName = layerName; title = layerName; - if(displayName!=null && !displayName.isEmpty()) + if(displayName!=null && !displayName.isEmpty()) { displayLayerName = displayName; + } } - - this.listStyles = new ArrayList(); + + GisViewerAppServiceAsync.Util.getInstance().getStylesForWmsRequest(wmsRequest, new AsyncCallback() { + + @Override + public void onSuccess(GeoStyles result) { + addRequestToGisViewer((ArrayList) result.getStyles(), result.isNcWMS()); + } + + @Override + public void onFailure(Throwable caught) { + addRequestToGisViewer(new ArrayList(1), false); + } + }); + + /*this.listStyles = new ArrayList(); String style = urlValidator.getValueOfParsedWMSParameter(org.gcube.portlets.user.gisviewer.client.commons.utils.WmsParameters.STYLES); GWT.log("Wms request, style "+style); - if(style!=null) + if(style!=null) { this.listStyles.add(style); - + } + Map noWms = urlValidator.getMapWmsNotStandardParams(); this.noWMSParams = new HashMap(); if(noWms!=null && noWms.size()>0){ this.noWMSParams.putAll(noWms); this.isNcWMS = true; - } + }*/ } - + /** * Adds the request to gis viewer. + * @param listStyles */ - public void addRequestToGisViewer(){ - gisViewer.addLayerByWms(GisViewerPanel.LayerType.FEATURETYPE, displayLayerName, title, url, isExternal, isBase, displayInLayerSwitcher, listStyles, wmsRequest, onTop, noWMSParams, isNcWMS); + public void addRequestToGisViewer(ArrayList styles, boolean ncWMS){ + gisViewer.addLayerByWms(GisViewerPanel.LayerType.FEATURETYPE, displayLayerName, title, url, isExternal, isBase, displayInLayerSwitcher, styles, wmsRequest, onTop, urlValidator.getParametersMap(), ncWMS, null); +// gisViewer.addLayerByWms(title, displayLayerName, wmsRequest, isBase, displayInLayerSwitcher, null); } /** @@ -174,15 +191,6 @@ public class WmsRequestConverter { return onTop; } - /** - * Gets the list styles. - * - * @return the list styles - */ - public ArrayList getListStyles() { - return listStyles; - } - /** * Sets the layer type. * @@ -254,48 +262,4 @@ public class WmsRequestConverter { public void setOnTop(boolean onTop) { this.onTop = onTop; } - - /** - * Sets the list styles. - * - * @param listStyles the new list styles - */ - public void setListStyles(ArrayList listStyles) { - this.listStyles = listStyles; - } - - /* (non-Javadoc) - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - StringBuilder builder = new StringBuilder(); - builder.append("WmsRequestConverter [gisViewer="); - builder.append(gisViewer); - builder.append(", layerType="); - builder.append(layerType); - builder.append(", title="); - builder.append(title); - builder.append(", displayLayerName="); - builder.append(displayLayerName); - builder.append(", url="); - builder.append(url); - builder.append(", isExternal="); - builder.append(isExternal); - builder.append(", isBase="); - builder.append(isBase); - builder.append(", displayInLayerSwitcher="); - builder.append(displayInLayerSwitcher); - builder.append(", onTop="); - builder.append(onTop); - builder.append(", listStyles="); - builder.append(listStyles); - builder.append(", wmsRequest="); - builder.append(wmsRequest); - builder.append(", noWMSParams="); - builder.append(noWMSParams); - builder.append("]"); - return builder.toString(); - } - } diff --git a/src/main/java/org/gcube/portlets/user/gisviewerapp/client/rpc/GisViewerAppService.java b/src/main/java/org/gcube/portlets/user/gisviewerapp/client/rpc/GisViewerAppService.java index bd2451f..6d93fdc 100644 --- a/src/main/java/org/gcube/portlets/user/gisviewerapp/client/rpc/GisViewerAppService.java +++ b/src/main/java/org/gcube/portlets/user/gisviewerapp/client/rpc/GisViewerAppService.java @@ -1,12 +1,26 @@ + package org.gcube.portlets.user.gisviewerapp.client.rpc; +import org.gcube.portlets.user.gisviewerapp.shared.GeoStyles; + import com.google.gwt.user.client.rpc.RemoteService; import com.google.gwt.user.client.rpc.RemoteServiceRelativePath; /** * The client side stub for the RPC service. + * + * @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it + * Jan 22, 2016 */ @RemoteServiceRelativePath("gisapp") public interface GisViewerAppService extends RemoteService { - String greetServer(String name) throws IllegalArgumentException; + + + /** + * Gets the styles for wms request. + * + * @param wmsRequest the wms request + * @return the styles for wms request + */ + GeoStyles getStylesForWmsRequest(String wmsRequest); } diff --git a/src/main/java/org/gcube/portlets/user/gisviewerapp/client/rpc/GisViewerAppServiceAsync.java b/src/main/java/org/gcube/portlets/user/gisviewerapp/client/rpc/GisViewerAppServiceAsync.java index f38f4df..72e344b 100644 --- a/src/main/java/org/gcube/portlets/user/gisviewerapp/client/rpc/GisViewerAppServiceAsync.java +++ b/src/main/java/org/gcube/portlets/user/gisviewerapp/client/rpc/GisViewerAppServiceAsync.java @@ -1,25 +1,34 @@ package org.gcube.portlets.user.gisviewerapp.client.rpc; +import org.gcube.portlets.user.gisviewerapp.shared.GeoStyles; + import com.google.gwt.core.client.GWT; import com.google.gwt.user.client.rpc.AsyncCallback; +/** + * The Interface GisViewerAppServiceAsync. + * + * @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it + * Jan 22, 2016 + */ public interface GisViewerAppServiceAsync { /** - * GWT-RPC service asynchronous (client-side) interface - * @see org.gcube.portlets.user.gisviewerapp.client.rpc.GisViewerAppService + * Utility class to get the RPC Async interface from client-side code. + * + * @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it + * Jan 22, 2016 */ - void greetServer( java.lang.String name, AsyncCallback callback ); - - - /** - * Utility class to get the RPC Async interface from client-side code - */ - public static final class Util - { + public static final class Util + { private static GisViewerAppServiceAsync instance; + /** + * Gets the single instance of Util. + * + * @return single instance of Util + */ public static final GisViewerAppServiceAsync getInstance() { if ( instance == null ) @@ -29,9 +38,24 @@ public interface GisViewerAppServiceAsync return instance; } + /** + * Instantiates a new util. + */ private Util() { // Utility class should not be instanciated } } + + + + /** + * Gets the styles for wms request. + * + * @param wmsRequest the wms request + * @param callback the callback + * @return the styles for wms request + */ + void getStylesForWmsRequest( + String wmsRequest, AsyncCallback callback); } diff --git a/src/main/java/org/gcube/portlets/user/gisviewerapp/server/GisViewerAppServiceImpl.java b/src/main/java/org/gcube/portlets/user/gisviewerapp/server/GisViewerAppServiceImpl.java index ff99944..a743d29 100644 --- a/src/main/java/org/gcube/portlets/user/gisviewerapp/server/GisViewerAppServiceImpl.java +++ b/src/main/java/org/gcube/portlets/user/gisviewerapp/server/GisViewerAppServiceImpl.java @@ -1,18 +1,43 @@ + package org.gcube.portlets.user.gisviewerapp.server; +import org.apache.log4j.Logger; import org.gcube.portlets.user.gisviewerapp.client.rpc.GisViewerAppService; +import org.gcube.portlets.user.gisviewerapp.shared.GeoStyles; +import org.gcube.spatial.data.geoutility.GeoGetStyles; import com.google.gwt.user.server.rpc.RemoteServiceServlet; /** * The server side implementation of the RPC service. + * + * @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it + * Jan 22, 2016 */ @SuppressWarnings("serial") -public class GisViewerAppServiceImpl extends RemoteServiceServlet implements - GisViewerAppService { +public class GisViewerAppServiceImpl extends RemoteServiceServlet implements GisViewerAppService { - public String greetServer(String input) throws IllegalArgumentException { - return ""; - - } + private static Logger logger =Logger.getLogger(GisViewerAppServiceImpl.class); + + /* (non-Javadoc) + * @see org.gcube.portlets.user.gisviewerapp.client.rpc.GisViewerAppService#getStylesForWmsRequest(java.lang.String) + */ + @Override + public GeoStyles getStylesForWmsRequest(String wmsRequest) { + + try { + logger.info("Tentative get styles for wmsRequest: "+wmsRequest); + GeoGetStyles geoGetStyles = new GeoGetStyles(wmsRequest); + + GeoStyles geo = new GeoStyles(); + geo.setStyles(geoGetStyles.getGeoStyles()); + geo.setNcWMS(geoGetStyles.isNcWms()); + + return geo; + } + catch (Exception e) { + logger.error("An error occurred during get styles, returning an empty GeoStyles: ",e); + return new GeoStyles(); + } + } } diff --git a/src/main/java/org/gcube/portlets/user/gisviewerapp/shared/GeoStyles.java b/src/main/java/org/gcube/portlets/user/gisviewerapp/shared/GeoStyles.java new file mode 100644 index 0000000..95e0aca --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/gisviewerapp/shared/GeoStyles.java @@ -0,0 +1,106 @@ +/** + * + */ + +package org.gcube.portlets.user.gisviewerapp.shared; + +import java.io.Serializable; +import java.util.List; + + +/** + * The Class GeoStyles. + * + * @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it + * Jan 22, 2016 + */ +public class GeoStyles implements Serializable { + + /** + * + */ + private static final long serialVersionUID = 7307380872802285337L; + List styles; + boolean isNcWMS = false; + + /** + * Instantiates a new geo styles. + */ + public GeoStyles() { + + } + + /** + * Instantiates a new geo styles. + * + * @param styles the styles + * @param isNcWMS the is nc wms + */ + public GeoStyles(List styles, boolean isNcWMS) { + + super(); + this.styles = styles; + this.isNcWMS = isNcWMS; + } + + + /** + * Gets the styles. + * + * @return the styles + */ + public List getStyles() { + + return styles; + } + + + /** + * Checks if is nc wms. + * + * @return the isNcWMS + */ + public boolean isNcWMS() { + + return isNcWMS; + } + + + /** + * Sets the styles. + * + * @param styles the styles to set + */ + public void setStyles(List styles) { + + this.styles = styles; + } + + + /** + * Sets the nc wms. + * + * @param isNcWMS the isNcWMS to set + */ + public void setNcWMS(boolean isNcWMS) { + + this.isNcWMS = isNcWMS; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + + StringBuilder builder = new StringBuilder(); + builder.append("GeoStyles [styles="); + builder.append(styles); + builder.append(", isNcWMS="); + builder.append(isNcWMS); + builder.append("]"); + return builder.toString(); + } + + +} diff --git a/src/main/java/org/gcube/portlets/user/gisviewerapp/shared/WmsParameters.java b/src/main/java/org/gcube/portlets/user/gisviewerapp/shared/WmsParameters.java deleted file mode 100644 index 31caa4c..0000000 --- a/src/main/java/org/gcube/portlets/user/gisviewerapp/shared/WmsParameters.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.gcube.portlets.user.gisviewerapp.shared; - - -/** - * - * Param Mandatory - * service Yes Service name. Value is WMS. - * version Yes Service version. Value is one of 1.0.0, 1.1.0, 1.1.1, 1.3. - * request Yes Operation name. Value is GetMap. - * layers Yes Layers to display on map. Value is a comma-separated list of layer names. - * styles Yes Styles in which layers are to be rendered. Value is a comma-separated list of style names, or empty if default styling is required. Style names may be empty in the list, to use default layer styling. - * srs or crs Yes Spatial Reference System for map output. Value is in form EPSG:nnn. crs is the parameter key used in WMS 1.3.0. - * bbox Yes Bounding box for map extent. Value is minx,miny,maxx,maxy in units of the SRS. - * width Yes Width of map output, in pixels. - * height Yes Height of map output, in pixels. - * format Yes Format for the map output. See WMS output formats for supported values. - * transparent No Whether the map background should be transparent. Values are true or false. Default is false - * bgcolor No Background color for the map image. Value is in the form RRGGBB. Default is FFFFFF (white). - * exceptions No Format in which to report exceptions. Default value is application/vnd.ogc.se_xml. - * time No Time value or range for map data. See Time Support in Geoserver WMS for more information. - * sld No A URL referencing a StyledLayerDescriptor XML file which controls or enhances map layers and styling - * sld_body No A URL-encoded StyledLayerDescriptor XML document which controls or enhances map layers and styling - * - */ -/** - * @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it - * @Apr 26, 2013 - * - */ -public enum WmsParameters { - - SERVICE("SERVICE", "WMS"), - VERSION("VERSION", "1.1.0"), - REQUEST("REQUEST", "GetMap"), - LAYERS("LAYERS", ""), - STYLES("STYLES",""), - BBOX("BBOX","-180,-90,180,90"), - WIDTH("WIDTH","676"), - HEIGHT("HEIGHT","230"), - SRS("SRS","EPSG:4326"), - CRS("CRS","EPSG:4326"), //WMS 1.3.0 COMPLIANT - FORMAT("FORMAT","image/png"), - TRANSPARENT("TRANSPARENT","true"); - - private String parameter; - private String value; - - WmsParameters(String parameter, String value){ - this.parameter = parameter; - this.value = value; - } - - public String getParameter() { - return parameter; - } - - public void setParameter(String parameter) { - this.parameter = parameter; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - -}