com.bbn.openmap.plugin.wms
Class WMSPlugIn

java.lang.Object
  |
  +--com.bbn.openmap.plugin.AbstractPlugIn
        |
        +--com.bbn.openmap.plugin.WebImagePlugIn
              |
              +--com.bbn.openmap.plugin.wms.WMSPlugIn
All Implemented Interfaces:
ImageServerConstants, MapMouseListener, PlugIn, PropertyConsumer, WMTConstants

public class WMSPlugIn
extends WebImagePlugIn
implements ImageServerConstants

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, add wms_plugin to openmap.layers list
  wms_plugin=com.bbn.openmap.plugin.wms.WMSPlugIn
  wms_plugin.wmsserver=A URL for the WMS server (eg. http://host.domain.name/servlet/com.esri.wms.Esrimap)
  wms_plugin.wmsversion=OpenGIS WMS version number (eg. 1.1.0)
  wms_plugin.format=image format (eg. JPEG, GIF, PNG from WMTConstants.java)
  wms_plugin.transparent=true or false, depends on imageformat
  wms_plugin.backgroundcolor=RGB hex string (RRGGBB)
  wms_plugin.layers=comma separated list of map layer names (eg. SDE.SASAUS_BND_COASTL,SDE.SASAUS_BND_POLBNDL)
  wms_plugin.styles=comma separated list of layer rendering styles corresponding to the layers listed
  wms_plugin.vendorspecificnames=comma separated list of vendor specific parameter names in order (eg. SERVICENAME)
  wms_plugin.vendorspecificvalues=comma separated list of vendor specific parameter values in order (eg. default)
  
 

One of the best demo WMS servers can be found at: http://demo.cubewerx.com/demo/cubeserv/cubeserv.cgi


Field Summary
protected  java.lang.String backgroundColor
          Specify the color for non-data areas of the image in r,g,b
static java.lang.String BackgroundColorProperty
           
protected  java.lang.String errorHandling
          Keyword for error handling.
protected  java.lang.String imageFormat
          GIF, PNG, JPEG, etc.
static java.lang.String ImageFormatProperty
           
protected  java.lang.String imageQuality
          If using a lossy image format, such as jpeg, set this to high, medium or low
protected  java.lang.String layers
          Comma-separated list of layer names
static java.lang.String LayersProperty
           
static int LOSSY_IMAGE_QUALITY_HIGH
          integer identifier for high image quality
static int LOSSY_IMAGE_QUALITY_LOW
          integer identifier for low image quality
static int LOSSY_IMAGE_QUALITY_MEDIUM
          integer identifier for medium image quality
protected  java.lang.String mapRequestName
          Keyword for map request.
protected  java.lang.String queryHeader
          Same as wmsServer
protected  java.lang.String styles
          Comma-separated list of style names
static java.lang.String StylesProperty
           
protected  java.lang.String transparent
          true=make the backgroundColor transparent
static java.lang.String TransparentProperty
           
protected  java.lang.String vendorSpecificNames
          Comma-separated list of vendor specific parameter names
static java.lang.String VendorSpecificNamesProperty
           
protected  java.lang.String vendorSpecificValues
          Comma-separated list of vendor specific parameter values
static java.lang.String VendorSpecificValuesProperty
           
static java.lang.String WMSNameProperty
           
protected  java.lang.String wmsServer
          URL to the server script that responds to WMS map requests
static java.lang.String WMSServerProperty
           
protected  java.lang.String wmsVersion
          version of the Web map server spec the server supports
static java.lang.String WMSVersionProperty
           
 
Fields inherited from class com.bbn.openmap.plugin.WebImagePlugIn
currentProjection, layer, messageWindow, redrawButton
 
Fields inherited from class com.bbn.openmap.plugin.AbstractPlugIn
addToBeanContext, component, i18n, mml, name, prefix, removable, RemovableProperty
 
Fields inherited from interface com.bbn.openmap.image.ImageServerConstants
AZIMUTH, LAT, LAYERMASK, LAYERS, LON, PAN, PROJTYPE, QUERY, RECENTER, SCALE, X, Y
 
Fields inherited from interface com.bbn.openmap.image.WMTConstants
BBOX, BGCOLOR, CAPABILITIES, EXCEPTIONS, FORMAT, GETMAP, HEIGHT, IMAGEFORMAT_GEOTIFF, IMAGEFORMAT_GIF, IMAGEFORMAT_JPEG, IMAGEFORMAT_PNG, IMAGEFORMAT_PPM, IMAGEFORMAT_SVG, IMAGEFORMAT_TIFF, IMAGEFORMAT_WBMP, MAP, REQUEST, SRS, STYLES, TRANSPARENT, VERSION, WIDTH, WMTVER
 
Fields inherited from interface com.bbn.openmap.PropertyConsumer
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty
 
Constructor Summary
WMSPlugIn()
           
 
Method Summary
 void addLayers(java.lang.String[] ls)
          Add new layers to the server request, using the default style.
 void addLayers(java.lang.String[] ls, java.lang.String[] st)
          Add new layers to the server request, using specified styles.
 java.lang.String createQueryString(Projection p)
          Create the query to be sent to the server, based on current settings.
 java.lang.String getImageFormat()
           
 java.util.Properties getProperties(java.util.Properties props)
          Method to fill in a Properties object, reflecting the current values of the PropertyConsumer.
 java.util.Properties getPropertyInfo(java.util.Properties props)
          Method to fill in a Properties object with values reflecting the properties able to be set on this PropertyConsumer.
 java.lang.String getServerName()
           
 void setImageFormat(java.lang.String newImageFormat)
           
 void setImageQuality(int newImageQuality)
           
 void setProperties(java.lang.String prefix, java.util.Properties setList)
          Method to set the properties in the PropertyConsumer.
 
Methods inherited from class com.bbn.openmap.plugin.WebImagePlugIn
getGUI, getRectangle, setComponent
 
Methods inherited from class com.bbn.openmap.plugin.AbstractPlugIn
doPrepare, getAddToBeanContext, getComponent, getMapMouseListener, getMouseModeServiceList, getName, getPropertyPrefix, isRemovable, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mouseMoved, mousePressed, mouseReleased, removed, repaint, setAddToBeanContext, setMapMouseListener, setName, setProperties, setPropertyPrefix, setRemovable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

wmsServer

protected java.lang.String wmsServer
URL to the server script that responds to WMS map requests


imageFormat

protected java.lang.String imageFormat
GIF, PNG, JPEG, etc. (anything the server supports)


imageQuality

protected java.lang.String imageQuality
If using a lossy image format, such as jpeg, set this to high, medium or low


backgroundColor

protected java.lang.String backgroundColor
Specify the color for non-data areas of the image in r,g,b


transparent

protected java.lang.String transparent
true=make the backgroundColor transparent


wmsVersion

protected java.lang.String wmsVersion
version of the Web map server spec the server supports


layers

protected java.lang.String layers
Comma-separated list of layer names


styles

protected java.lang.String styles
Comma-separated list of style names


vendorSpecificNames

protected java.lang.String vendorSpecificNames
Comma-separated list of vendor specific parameter names


vendorSpecificValues

protected java.lang.String vendorSpecificValues
Comma-separated list of vendor specific parameter values


queryHeader

protected java.lang.String queryHeader
Same as wmsServer


mapRequestName

protected java.lang.String mapRequestName
Keyword for map request. Changes to MAP for WMS version 1.0.0


errorHandling

protected java.lang.String errorHandling
Keyword for error handling. Changes to INIMAGE for WMS version under 1.1.0. Changes to application/vnd.ogc.se+inimage for versions greater than 1.1.1


WMSNameProperty

public static final java.lang.String WMSNameProperty
See Also:
Constant Field Values

WMSServerProperty

public static final java.lang.String WMSServerProperty
See Also:
Constant Field Values

ImageFormatProperty

public static final java.lang.String ImageFormatProperty
See Also:
Constant Field Values

BackgroundColorProperty

public static final java.lang.String BackgroundColorProperty
See Also:
Constant Field Values

TransparentProperty

public static final java.lang.String TransparentProperty
See Also:
Constant Field Values

WMSVersionProperty

public static final java.lang.String WMSVersionProperty
See Also:
Constant Field Values

LayersProperty

public static final java.lang.String LayersProperty
See Also:
Constant Field Values

StylesProperty

public static final java.lang.String StylesProperty
See Also:
Constant Field Values

VendorSpecificNamesProperty

public static final java.lang.String VendorSpecificNamesProperty
See Also:
Constant Field Values

VendorSpecificValuesProperty

public static final java.lang.String VendorSpecificValuesProperty
See Also:
Constant Field Values

LOSSY_IMAGE_QUALITY_HIGH

public static final int LOSSY_IMAGE_QUALITY_HIGH
integer identifier for high image quality

See Also:
Constant Field Values

LOSSY_IMAGE_QUALITY_MEDIUM

public static final int LOSSY_IMAGE_QUALITY_MEDIUM
integer identifier for medium image quality

See Also:
Constant Field Values

LOSSY_IMAGE_QUALITY_LOW

public static final int LOSSY_IMAGE_QUALITY_LOW
integer identifier for low image quality

See Also:
Constant Field Values
Constructor Detail

WMSPlugIn

public WMSPlugIn()
Method Detail

addLayers

public void addLayers(java.lang.String[] ls)
Add new layers to the server request, using the default style.


addLayers

public void addLayers(java.lang.String[] ls,
                      java.lang.String[] st)
Add new layers to the server request, using specified styles.


createQueryString

public java.lang.String createQueryString(Projection p)
Create the query to be sent to the server, based on current settings.

Specified by:
createQueryString in class WebImagePlugIn

setProperties

public void setProperties(java.lang.String prefix,
                          java.util.Properties setList)
Method to set the properties in the PropertyConsumer. The prefix is a string that should be prepended to each property key (in addition to a separating '.') in order for the PropertyConsumer to uniquely identify properies meant for it, in the midst of Properties meant for several objects.

Specified by:
setProperties in interface PropertyConsumer
Overrides:
setProperties in class AbstractPlugIn
Parameters:
prefix - a String used by the PropertyConsumer to prepend to each property value it wants to look up - setList.getProperty(prefix.propertyKey). If the prefix had already been set, then the prefix passed in should replace that previous value.
setList - a Properties object that the PropertyConsumer can use to retrieve expected properties it can use for configuration.

getProperties

public java.util.Properties getProperties(java.util.Properties props)
Description copied from class: AbstractPlugIn
Method to fill in a Properties object, reflecting the current values of the PropertyConsumer. If the PropertyConsumer has a prefix set, the property keys should have that prefix plus a separating '.' prepended to each propery key it uses for configuration.

Specified by:
getProperties in interface PropertyConsumer
Overrides:
getProperties in class AbstractPlugIn
Parameters:
props - a Properties object to load the PropertyConsumer properties into. If getList equals null, then a new Properties object should be created.
Returns:
Properties object containing PropertyConsumer property values. If getList was not null, this should equal getList. Otherwise, it should be the Properties object created by the PropertyConsumer.

getPropertyInfo

public java.util.Properties getPropertyInfo(java.util.Properties props)
Description copied from class: AbstractPlugIn
Method to fill in a Properties object with values reflecting the properties able to be set on this PropertyConsumer. The key for each property should be the raw property name (without a prefix) with a value that is a String that describes what the property key represents, along with any other information about the property that would be helpful (range, default value, etc.).

Specified by:
getPropertyInfo in interface PropertyConsumer
Overrides:
getPropertyInfo in class AbstractPlugIn
Parameters:
props - a Properties object to load the PropertyConsumer properties into. If getList equals null, then a new Properties object should be created.
Returns:
Properties object containing PropertyConsumer property values. If getList was not null, this should equal getList. Otherwise, it should be the Properties object created by the PropertyConsumer.

getImageFormat

public java.lang.String getImageFormat()

setImageFormat

public void setImageFormat(java.lang.String newImageFormat)

setImageQuality

public void setImageQuality(int newImageQuality)

getServerName

public java.lang.String getServerName()
Specified by:
getServerName in class WebImagePlugIn


Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details