/* ********************************************************************** * $Source: /net/bitburg/u4/distapps/rcs/openmap/com/bbn/openmap/plugin/wms/WMSPlugIn.java,v $ * $Revision: 1.1.2.1 $ * $Date: 2001/07/11 22:53:00 $ * $Author: dietrick $ * * Code provided by Raj Singh from Syncline, rs@syncline.com * ********************************************************************* */ package com.bbn.openmap.plugin.wms; import java.awt.Component; import java.util.Properties; import java.util.StringTokenizer; import java.util.NoSuchElementException; import javax.swing.ImageIcon; import com.bbn.openmap.PropertyConsumer; import com.bbn.openmap.event.MapMouseListener; import com.bbn.openmap.image.ImageServerConstants; import com.bbn.openmap.image.WMTConstants; import com.bbn.openmap.omGraphics.*; import com.bbn.openmap.plugin.*; import com.bbn.openmap.proj.Projection; import com.bbn.openmap.util.Debug; /** * This class asks for an image from an OpenGIS compliant Web Map * Server (WMS). Make sure that OpenMap is using the LLXY projection, * because this plugin is only asking for images that are in the * Spatial Reference System EPS 4326 projection, and anything else * won't match up. This class will be growing to be more interactive * with the WMS. * * It has some properties that you can set in the openmap.properties file: *
 * #For the plugin layer
 * pluginlayer.class=com.bbn.openmap.plugin.PlugInLayer
 * pluginlayer.prettyName=Whatever
 * pluginlayer.plugin=com.bbn.openmap.plugin.wms.WMSPlugIn
 * pluginlayer.plugin.wmsserver=A URL for the WMS server (eg. http://host.domain.name/servlet/com.esri.wms.Esrimap)
 * pluginlayer.plugin.wmsversion=OpenGIS WMS version number (eg. 1.0.7)
 * pluginlayer.plugin.format=image format (eg. JPEG, GIF, PNG from WMTConstants.java)
 * pluginlayer.plugin.transparent=true or false, depends on imageformat
 * pluginlayer.plugin.backgroundcolor=RGB hex string (RRGGBB)
 * pluginlayer.plugin.layers=comma separated list of map layer names (eg. SDE.SASAUS_BND_COASTL,SDE.SASAUS_BND_POLBNDL)
 * pluginlayer.plugin.styles=comma separated list of layer rendering styles corresponding to the layers listed
 * pluginlayer.plugin.vendorspecificnames=comma separated list of vendor specific parameter names in order (eg. SERVICENAME)
 * pluginlayer.plugin.vendorspecificvalues=comma separated list of vendor specific parameter values in order (eg. default)
 * pluginlayer.plugin.wmsname=???
 * 
*/ public class WMSPlugIn extends AbstractPlugIn implements ImageServerConstants { /** URL to the server script that responds to WMS map requests */ protected String wmsName = null; /** URL to the server script that responds to WMS map requests */ protected String wmsServer = null; /** GIF, PNG, JPEG, etc. (anything the server supports) */ protected String imageFormat = null; /** Specify the color for non-data areas of the image in r,g,b */ protected String backgroundColor = null; /** true=make the backgroundColor transparent */ protected String transparent = null; /** version of the Web map server spec the server supports */ protected String wmsVersion = null; /** Comma-separated list of layer names */ protected String layers = null; /** Comma-separated list of style names */ protected String styles = null; /** Comma-separated list of vendor specific parameter names */ protected String vendorSpecificNames = null; /** Comma-separated list of vendor specific parameter values */ protected String vendorSpecificValues = null; /** Same as wmsServer */ protected String queryHeader = null; protected String MAPREQUESTNAME = GETMAP; public final static String WMSNameProperty = "wmsname"; public final static String WMSServerProperty = "wmsserver"; public final static String ImageFormatProperty = "format"; public final static String BackgroundColorProperty = "backgroundcolor"; public final static String TransparentProperty = "transparent"; public static final String WMSVersionProperty = "wmsversion"; public static final String LayersProperty = "layers"; public static final String StylesProperty = "styles"; public static final String VendorSpecificNamesProperty = "vendorspecificnames"; public static final String VendorSpecificValuesProperty = "vendorspecificvalues"; /** * Add new layers to the server request, using the default style. */ public void addLayers(String[] ls) { for (int j=0; j