new CopyPaste(options)
Parameters:
| Name | Type | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | Options Properties
|
Fires:
- event:focus
- event:copy
- event:paste
Extends
- ol.interaction.Interaction
Methods
-
copy(options)
-
Set current feature to copy
Parameters:
Name Type Description optionsObject Properties
Name Type Description featuresArray.<ol.Feature> | ol.Collection.<ol.Feature> feature to copy, default get in the provided collection
cutboolean try to cut feature from the sources, default false
silentboolean true to send an event, default true
-
getDestination()
-
Get source to paste features
Parameters:
Type Description ol.source.Vector -
getFeatures()
-
Get current feature to copy
Returns:
- Type
- Array.<ol.Feature>
-
getSources()
-
Get sources to cut feature from
Returns:
- Type
- Array.<ol.source.Vector>
-
paste(options, features)
-
Paste features
Parameters:
Name Type Description optionsObject featuresArray.<ol.Feature> | ol.Collection.<ol.Feature> feature to copy, default get current features
options.destinationol.source.Vector Source to paste to, default the current source
options.silentboolean true to send an event, default true
-
setDestination(source)
-
Source to paste features
Parameters:
Name Type Description sourceol.source.Vector -
setMap(map)
-
Remove the interaction from its current map and attach it to the new map.
Parameters:
Name Type Description mapol.Map The map instance.
-
setSources(sources)
-
Sources to cut feature from
Parameters:
Name Type Description sourcesol.source.Vector | Array.<ol.source.Vector>