@JsType(isNative=true) public class LayerGroup extends java.lang.Object implements ILayer
Modifier and Type | Method and Description |
---|---|
L |
addLayer(ILayer layer)
Adds a given layer to the group.
|
L |
addTo(Map map)
Adds the group of layers to the map.
|
L |
clearLayers()
Removes all the layers from the group.
|
L |
eachLayer(Function fn,
com.google.gwt.core.client.JavaScriptObject context)
Iterates over the layers of the group, optionally specifying context of the iterator function.
|
java.lang.Boolean |
getLayer(java.lang.String id)
Returns the layer with the given id.
|
com.google.gwt.core.client.JsArray<com.google.gwt.core.client.JavaScriptObject> |
getLayers()
Returns an array of all the layers added to the group.
|
java.lang.Boolean |
hasLayer(ILayer layer)
Returns true if the given layer is currently added to the group.
|
void |
onAdd(Map map)
Should contain code that creates DOM elements for the overlay, adds them to map panes where they should belong and puts listeners on relevant map events.
|
void |
onRemove(Map map)
Should contain all clean up code that removes the overlay's elements from the DOM and removes listeners previously added in onAdd.
|
L |
removeLayer(ILayer layer)
Removes a given layer from the group.
|
L |
removeLayer(java.lang.String id)
Removes a given layer from the group.
|
com.google.gwt.core.client.JavaScriptObject |
toGeoJSON()
Returns a GeoJSON representation of the layer group (GeoJSON FeatureCollection).
|
@JsMethod public L addTo(Map map)
map
- the map@JsMethod public L addLayer(ILayer layer)
layer
- the layer@JsMethod public L removeLayer(ILayer layer)
layer
- the layer@JsMethod public L removeLayer(java.lang.String id)
id
- the id@JsMethod public java.lang.Boolean hasLayer(ILayer layer)
layer
- the layer@JsMethod public java.lang.Boolean getLayer(java.lang.String id)
id
- the id@JsMethod public com.google.gwt.core.client.JsArray<com.google.gwt.core.client.JavaScriptObject> getLayers()
@JsMethod public L clearLayers()
@JsMethod public L eachLayer(Function fn, com.google.gwt.core.client.JavaScriptObject context)
fn
- the action functioncontext
- the context@JsMethod public com.google.gwt.core.client.JavaScriptObject toGeoJSON()
@JsMethod public void onAdd(Map map)
ILayer