Constructor
new CadControl(options)
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | Tool options.
Properties
|
- Source:
Extends
Members
(private) className :string
Html class name of the control button
Type:
- string
- Inherited From:
- Source:
(private) editor :ole.Editor
ole.Editor instance.
Type:
- ole.Editor
- Inherited From:
- Source:
(private) linesLayer :ol.layer.Vector
Layer for colored lines indicating
intesection point between snapping lines.
Type:
- ol.layer.Vector
- Source:
(private) pointerInteraction :ol.interactionPointer
Interaction for handling move events.
Type:
- ol.interactionPointer
- Source:
(private) showSnapLines :Boolean
Whether to show snap lines.
Type:
- Boolean
- Source:
(private) showSnapPoints :Boolean
Whether to show the snap points.
Type:
- Boolean
- 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) snapPointDist :Number
Initial distance of snap points.
Type:
- Number
- Source:
(private) snapTolerance :Number
Snap tolerance in pixel.
Type:
- Number
- Source:
(private) source :ol.source.Vector
Source with edit features.
Type:
- ol.source.Vector
- Inherited From:
- Source:
(private) standalone :Boolean
Type:
- Boolean
- Overrides:
- Source:
(private) title :string
Control title.
Type:
- string
- Inherited From:
- Source:
useMapUnits
If true, map units are used for point snapping.
The default measurement are pixels.
- Source:
Methods
activate()
Activate the control
- Overrides:
- Source:
(private) closeDialog()
Closes the control dialog.
- Inherited From:
- Source:
deactivate()
Dectivate the control
- Overrides:
- Source:
(private) drawSnapLines(features, coordinate)
Draws snap lines by building the extent for
a pair of features.
Parameters:
Name | Type | Description |
---|---|---|
features |
Array.<ol.Feature> | List of features. |
coordinate |
ol.Coordinate | Mouse pointer coordinate. |
- Source:
(private) drawSnapPoints(coordinateMouse, feature)
Adds snap points to the snapping layer.
Parameters:
Name | Type | Description |
---|---|---|
coordinateMouse |
ol.Coordinate | cursor coordinate. |
feature |
ol.eaturee | Feature to draw the snap points for. |
- Source:
getActive() → {Boolean}
Returns the active state of the control.
- Inherited From:
- Source:
Returns:
Active state.
- Type
- Boolean
(private) getClosestFeatures(coordinate, numFeatures) → {Array.<ol.Feature>}
Returns a list of the {num} closest features
to a given coordinate.
Parameters:
Name | Type | Description |
---|---|---|
coordinate |
ol.Coordinate | Coordinate. |
numFeatures |
Number | Number of features to search. |
- Source:
Returns:
List of closest features.
- Type
- Array.<ol.Feature>
getElement() → {Element}
Returns the control's element.
- Inherited From:
- Source:
Returns:
the control element.
- Type
- Element
(private) onClick()
Click handler for the control element.
- Inherited From:
- Source:
(private) onMove(evt)
Handle move event.
Parameters:
Name | Type | Description |
---|---|---|
evt |
ol.MapBrowserEvent | Move event. |
- Source:
(protected) setEditor(editor)
Introduce the control to it's editor.
Parameters:
Name | Type | Description |
---|---|---|
editor |
ole.Editor | OLE Editor. |
- Inherited From:
- Source:
(protected) setMap(map)
Sets the map of the control.
Parameters:
Name | Type | Description |
---|---|---|
map |
ol.Map | The map object. |
- Overrides:
- Source: