You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/control/cad.js
+13-4
Original file line number
Diff line number
Diff line change
@@ -33,9 +33,10 @@ import {
33
33
classCadControlextendsControl{
34
34
/**
35
35
* @param {Object} [options] Tool options.
36
-
* @param {Function} [options.drawCustomSnapLines] Allow to draw more snapping lines using selected corrdinaites.
36
+
* @param {Function} [options.drawCustomSnapLines] Allow to draw more snapping lines using selected coordinates.
37
37
* @param {Function} [options.filter] Returns an array containing the features
38
38
* to include for CAD (takes the source as a single argument).
39
+
* @param {Function} [options.extentFilter] An optional spatial filter for the features to snap with. Returns an ol.Extent which will be used by the source.getFeaturesinExtent method.
39
40
* @param {Function} [options.lineFilter] An optional filter for the generated snapping lines
40
41
* array (takes the lines and cursor coordinate as arguments and returns the new line array)
41
42
* @param {Number} [options.nbClosestFeatures] Number of features to use for snapping (closest first). Default is 5.
@@ -148,6 +149,13 @@ class CadControl extends Control {
148
149
*/
149
150
this.filter=options.filter||(()=>true);
150
151
152
+
/**
153
+
* Filter the features spatially.
154
+
*/
155
+
this.extentFilter=
156
+
options.extentFilter||
157
+
(()=>[-Infinity,-Infinity,Infinity,Infinity]);
158
+
151
159
/**
152
160
* Filter the generated line list
153
161
*/
@@ -282,9 +290,10 @@ class CadControl extends Control {
0 commit comments