public class WMSTileLayer extends TileLayer
For more information about parameters format see WMS reference.
To find out information about capabilities of a WMS service (for example, available layers) request GetCapabilities operation.
It is convenient to use software like QGIS for the purpose.
Modifier and Type | Field and Description |
---|---|
protected org.springframework.context.ApplicationContext |
applicationContext |
static java.lang.String |
SERVICE_NAME |
Constructor and Description |
---|
WMSTileLayer(java.lang.String id) |
WMSTileLayer(java.lang.String id,
java.lang.String url) |
Modifier and Type | Method and Description |
---|---|
protected void |
fireLayerChangedEvent(LayerChangedEvent event) |
CRS |
getCrs()
Returns
CRS used in the WMS. |
java.lang.String |
getFormat()
Returns format for the map output.
|
java.lang.String |
getId() |
java.lang.String |
getLayers()
Returns layers to display on a map.
|
int |
getMaxZoom()
Returns maximum layer zoom level.
|
int |
getMinZoom()
Returns minimum layer zoom level.
|
java.lang.String |
getStyles()
Returns comma-separated list of WMS styles.
|
java.lang.String |
getVersion()
Returns service version.
|
boolean |
isEditable()
Whether the layer is to be editable on a map.
|
boolean |
isTransparent()
Whether the map background is transparent.
|
boolean |
isVisible()
Whether the layer is to be visible on a map.
|
void |
refresh()
Notify clients that the layer has changed and need to be redrawn.
|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setCrs(CRS crs)
Sets
CRS to be used in the WMS. |
void |
setEditable(boolean editable)
Sets whether the layer is to be editable on a map.
|
void |
setFormat(java.lang.String format)
Formats for the map output.
|
void |
setLayers(java.lang.String layers)
Specifies layers to display on a map.
|
void |
setMinZoom(int minZoom)
Sets minimum zoom level down to which the layer is visible (inclusive).
|
void |
setStyles(java.lang.String styles)
Sets styles in which layers are to be rendered.
|
void |
setTransparent(boolean transparent)
Sets whether the map background is to be transparent.
|
void |
setVersion(java.lang.String version)
Sets service version.
|
void |
setVisible(boolean visible)
Sets whether the layer should be visible on a map.
|
java.lang.String |
toString() |
getAttributionString, getSubDomains, getUrl, setAttributionString, setMaxZoom, setSubDomains, setUrl
getOpacity, setOpacity
public static final java.lang.String SERVICE_NAME
protected org.springframework.context.ApplicationContext applicationContext
public WMSTileLayer(java.lang.String id)
public WMSTileLayer(java.lang.String id, java.lang.String url)
public void setCrs(CRS crs)
CRS
to be used in the WMS.crs
- CRS to be used in the WMSpublic java.lang.String getLayers()
@StudioProperty public void setLayers(java.lang.String layers)
To find out information about available layers of the WMS service, you can request GetCapabilities operation.
It's easier to use software like QGIS for the purpose.
layers
- String
which is a comma-separated list of layer namespublic java.lang.String getStyles()
String
which is a comma-separated list of WMS styles@StudioProperty public void setStyles(java.lang.String styles)
styles
- a comma-separated list of WMS stylespublic java.lang.String getFormat()
@StudioProperty public void setFormat(java.lang.String format)
format
- String parameterpublic boolean isTransparent()
true
if the map background is transparent;
false
otherwise@StudioProperty public void setTransparent(boolean transparent)
false
.transparent
- true/falsepublic java.lang.String getVersion()
@StudioProperty(type=ENUMERATION, options={"1.0.0","1.1.0","1.1.1","1.3.0"}, defaultValue="1.1.1") public void setVersion(java.lang.String version)
Value is one of: 1.0.0, 1.1.0, 1.1.1, 1.3.0. Default value is 1.1.1.
version
- String parameterpublic void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
public int getMaxZoom()
Layer
getMaxZoom
in interface Layer
public void setMinZoom(int minZoom)
Layer
Default value: 0.
setMinZoom
in interface Layer
minZoom
- minimum layer zoom levelpublic int getMinZoom()
Layer
getMinZoom
in interface Layer
public void setVisible(boolean visible)
Layer
Default value: true
.
setVisible
in interface Layer
visible
- true/falsepublic boolean isVisible()
Layer
public void setEditable(boolean editable)
Layer
Default value: false
.
setEditable
in interface Layer
editable
- true/falsepublic boolean isEditable()
Layer
isEditable
in interface Layer
true
if the layer is set to be editable;
otherwise false
protected void fireLayerChangedEvent(LayerChangedEvent event)
public void refresh()
Layer
public java.lang.String toString()
toString
in class java.lang.Object