new Swipe( [Control])
Parameters:
Name | Type | Argument | Description |
---|---|---|---|
Control |
Object |
<optional> |
options. |
options.layers |
ol.layer | Array.<ol.layer> | layers to swipe |
|
options.rightLayers |
ol.layer | Array.<ol.layer> | layers to swipe on right side |
|
options.className |
string | control class name |
|
options.position |
number | position property of the swipe [0,1], default 0.5 |
|
options.orientation |
string | orientation property (vertical|horizontal), default vertical |
Fires:
- event:moving
Extends
Methods
-
addLayer(layer, add)
-
Add a layer to clip
Parameters:
Name Type Description layer
ol.layer | Array.<ol.layer> to clip
add
bool layer in the right part of the map, default left.
-
getRectangle()
-
Get visible rectangle
Returns:
- Type
- ol.extent
-
removeLayer(layer)
-
Remove a layer to clip
Parameters:
Name Type Description layer
ol.layer | Array.<ol.layer> to clip
-
removeLayers()
-
Remove all layers
-
setMap(map)
-
Set the map instance the control associated with.
Parameters:
Name Type Description map
_ol_Map_ The map instance.