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 options
Object Properties
Name Type Description features
Array.<ol.Feature> | ol.Collection.<ol.Feature> feature to copy, default get in the provided collection
cut
boolean try to cut feature from the sources, default false
silent
boolean 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 options
Object features
Array.<ol.Feature> | ol.Collection.<ol.Feature> feature to copy, default get current features
options.destination
ol.source.Vector Source to paste to, default the current source
options.silent
boolean true to send an event, default true
-
setDestination(source)
-
Source to paste features
Parameters:
Name Type Description source
ol.source.Vector -
setMap(map)
-
Remove the interaction from its current map and attach it to the new map.
Parameters:
Name Type Description map
ol.Map The map instance.
-
setSources(sources)
-
Sources to cut feature from
Parameters:
Name Type Description sources
ol.source.Vector | Array.<ol.source.Vector>