java.lang.Object | |
↳ | com.carto.layers.Layer |
![]() |
![]() |
An abstract base class for all layers.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
boolean |
containsMetaDataKey(String key)
Returns true if the specified key exists in the layer meta data map.
| ||||||||||
synchronized void | delete() | ||||||||||
boolean |
equals(Object obj)
Checks if this object is equal to the specified object.
| ||||||||||
StringVariantMap |
getMetaData()
Returns a copy of the layer meta data map.
| ||||||||||
Variant |
getMetaDataElement(String key)
Returns a layer meta data element corresponding to the key.
| ||||||||||
float |
getOpacity()
Returns the opacity of this layer.
| ||||||||||
int |
getUpdatePriority()
Returns the layer task priority of this layer.
| ||||||||||
MapRange |
getVisibleZoomRange()
Returns the visible zoom range of this layer.
| ||||||||||
int |
hashCode()
Returns the hash value of this object.
| ||||||||||
boolean |
isUpdateInProgress()
Tests whether this layer is being currently updated.
| ||||||||||
boolean |
isVisible()
Returns the visibility of this layer.
| ||||||||||
void |
refresh()
Refreshes the layer using old stored visibility information.
| ||||||||||
void |
setCullDelay(int delay)
Sets the layer culling delay.
| ||||||||||
void |
setMetaData(StringVariantMap metaData)
Sets a new meta data map for the layer.
| ||||||||||
void |
setMetaDataElement(String key, Variant element)
Adds a new key-value pair to the layer meta data map.
| ||||||||||
void |
setOpacity(float opacity)
Set the opacity of the layer.
| ||||||||||
void |
setUpdatePriority(int priority)
Sets the layer task priority.
| ||||||||||
void |
setVisible(boolean visible)
Sets the visibility of this layer.
| ||||||||||
void |
setVisibleZoomRange(MapRange range)
Sets the visible zoom range for this layer.
| ||||||||||
void |
simulateClick(ClickType clickType, ScreenPos screenPos, ViewState viewState)
Simulate click on this layer.
| ||||||||||
void |
update(CullState cullState)
Updates the layer using new visibility information.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Returns true if the specified key exists in the layer meta data map.
key | The key to check. |
---|
Checks if this object is equal to the specified object.
obj | The reference object. |
---|
Returns a copy of the layer meta data map. The changes you make to this map are NOT reflected in the actual meta data of the layer.
Returns a layer meta data element corresponding to the key. If no value is found null variant is returned.
key | The key to use. |
---|
Returns the opacity of this layer.
Returns the layer task priority of this layer.
Returns the visible zoom range of this layer.
Returns the hash value of this object.
Tests whether this layer is being currently updated.
Returns the visibility of this layer.
Refreshes the layer using old stored visibility information. This method might be called if some of the layer data
changes.
Sets the layer culling delay. The culling delay is used to delay layer content rendering in case of user interaction,
higher delay improves performance and battery life at the expense of interactivity. Default is 200ms-400ms, depending
on layer type.
delay | The new culling delay in milliseconds. |
---|
Sets a new meta data map for the layer. Old meta data values will be lost.
metaData | The new meta data map for this layer. |
---|
Adds a new key-value pair to the layer meta data map. If the key already exists in the map,
it's value will be replaced by the new value.
key | The new key. |
---|---|
element | The new value. |
Set the opacity of the layer.
opacity | The opacity of the layer in range (0..1). 1.0 is the default value. |
---|
Sets the layer task priority. Higher priority layers get to load data before
lower priority layers. Normal layers and tile layers have seperate task queues and thus
don't compete with each other for task queue access. The default is 0.
priority | The new task priority for this layer, higher values get better access. |
---|
Sets the visibility of this layer.
visible | The new visibility state of the layer. |
---|
Sets the visible zoom range for this layer. Current zoom level must be within this range for the layer to be visible.
This range is half-open, thus layer is visible if range.min <= ZOOMLEVEL < range.max.
range | new visible zoom range |
---|
Simulate click on this layer. This may trigger any event listeners attached to the layer.
clickType | The type of the click. |
---|---|
screenPos | The screen position for the simulated click. |
viewState | The view state to use. |
Updates the layer using new visibility information. This method is periodically called when the map view moves.
The visibilty info is saved, so the data can be refreshed later.
cullState | The new visibilty information. |
---|