public class TileLayer extends RasterLayer
This class contains parameters needed to connect to a tile service.
Modifier and Type | Field and Description |
---|---|
protected org.springframework.context.ApplicationContext |
applicationContext |
Constructor and Description |
---|
TileLayer(java.lang.String id) |
TileLayer(java.lang.String id,
java.lang.String urlPattern) |
Modifier and Type | Method and Description |
---|---|
protected void |
fireLayerChangedEvent(LayerChangedEvent event) |
java.lang.String |
getAttributionString()
Returns attribution string.
|
java.lang.String |
getId() |
int |
getMaxZoom()
Returns maximum layer zoom level.
|
int |
getMinZoom()
Returns minimum layer zoom level.
|
java.lang.String[] |
getSubDomains()
Returns explicitly defined subdomain values for the url pattern.
|
java.lang.String |
getUrl()
Returns URL of a service.
|
boolean |
isEditable()
Whether the layer is to be editable on a map.
|
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 |
setAttributionString(java.lang.String attributionString)
Sets attribution string.
|
void |
setEditable(boolean editable)
Sets whether the layer is to be editable on a map.
|
void |
setMaxZoom(int maxZoom)
Sets maximum zoom level up to which the layer is visible (inclusive).
|
void |
setMinZoom(int minZoom)
Sets minimum zoom level down to which the layer is visible (inclusive).
|
void |
setSubDomains(java.lang.String[] subDomains)
Sets possible values for the {s} placeholder in the url pattern of xyz tiles.
|
void |
setUrl(java.lang.String url)
Sets URL of a service.
|
void |
setVisible(boolean visible)
Sets whether the layer should be visible on a map.
|
java.lang.String |
toString() |
getOpacity, setOpacity
protected org.springframework.context.ApplicationContext applicationContext
public TileLayer(java.lang.String id)
public TileLayer(java.lang.String id, java.lang.String urlPattern)
public java.lang.String getUrl()
@StudioProperty(name="urlPattern") public void setUrl(java.lang.String url)
url
- String URL of a servicepublic java.lang.String getAttributionString()
@StudioProperty(name="attribution") public void setAttributionString(java.lang.String attributionString)
attributionString
- String parameterpublic java.lang.String[] getSubDomains()
@StudioProperty(type=STRING) public void setSubDomains(java.lang.String[] subDomains)
Can be omitted in most cases. By default: a, b, c.
public void setMaxZoom(int maxZoom)
Default value: 18.
setMaxZoom
in interface Layer
maxZoom
- maximum layer zoom levelpublic 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