Constructor
new CadControl(optionsopt)
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
Tool options.
Properties
|
- Source:
Extends
- Control
Members
(private) drawCustomSnapLines :function
Function to draw more snapping lines.
Type:
- function
- Source:
extentFilter
Filter the features spatially.
- Source:
(private) filter :function
Filter the features to snap with.
Type:
- function
- Source:
lineFilter
Filter the generated line list
- Source:
(private) linesLayer :ol.layer.Vector
Layer for colored lines indicating
intersection point between snapping lines.
Type:
- ol.layer.Vector
- Source:
(private) nbClosestFeatures :Number
Number of features to use for snapping (closest first). Default is 5.
Type:
- Number
- Source:
(private) pointerInteraction :ol.interaction.Pointer
Interaction for handling move events.
Type:
- ol.interaction.Pointer
- Source:
(private) snapInteraction :ol.interaction.Snap
Interaction for snapping
Type:
- ol.interaction.Snap
- Source:
(private) snapLayer :ol.layer.Vector
Layer for drawing snapping geometries.
Type:
- ol.layer.Vector
- Source:
(private) snapTolerance :Number
Snap tolerance in pixel.
Type:
- Number
- Source:
Methods
activate()
- Source:
deactivate()
- Source:
(private) drawSnapLines(coordinate, features)
Draws snap lines by building the extent for
a pair of features.
Parameters:
Name | Type | Description |
---|---|---|
coordinate |
ol.Coordinate | Mouse pointer coordinate. |
features |
Array.<ol.Feature> | List of features. |
- Source:
(private) drawSnapPoints(coordinate, feature)
Adds snap points to the snapping layer.
Parameters:
Name | Type | Description |
---|---|---|
coordinate |
ol.Coordinate | cursor coordinate. |
feature |
ol.eaturee | Feature to draw the snap points for. |
- Source:
(private) getClosestFeatures(coordinate, nbFeatures) → {Array.<ol.Feature>}
Returns a list of the {num} closest features
to a given coordinate.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
coordinate |
ol.Coordinate | Coordinate. | |
nbFeatures |
Number | 1 | Number of features to search. |
- Source:
Returns:
List of closest features.
- Type
- Array.<ol.Feature>
getDialogTemplate()
- Source:
getOrthoLines()
For each segment, we calculate lines that are perpendicular.
- Source:
(private) getRotatedExtent(geometry) → {Array.<number>}
Returns an extent array, considers the map rotation.
Parameters:
Name | Type | Description |
---|---|---|
geometry |
ol.Geometry | An OL geometry. |
- Source:
Returns:
extent array.
- Type
- Array.<number>
getSegmentLines()
For each segment, we calculate lines that extends it.
- Source:
(private) onMove(evt)
Handle move event.
Parameters:
Name | Type | Description |
---|---|---|
evt |
ol.MapBrowserEvent | Move event. |
- Source:
setMap()
- Source: