Skip to content

Commit 357ff95

Browse files
committed
Website updates
1 parent 3589203 commit 357ff95

File tree

11 files changed

+426
-95
lines changed

11 files changed

+426
-95
lines changed

dist/en/main/apidoc/module-ol_interaction_Modify-Modify.html

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ <h4 class="name">
177177

178178
<div class="tag-source">
179179
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Modify.js">interaction/Modify.js</a>,
180-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Modify.js#L240">line 240</a>
180+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Modify.js#L249">line 249</a>
181181
</div>
182182

183183
</div>
@@ -454,6 +454,32 @@ <h4 class="name">
454454

455455

456456

457+
<tr class="">
458+
459+
<td class="name"><code>filter</code></td>
460+
461+
462+
463+
<td class="type">
464+
465+
466+
<span class="param-type"><a href="module-ol_interaction_Modify.html#~FilterFunction">FilterFunction</a></span>
467+
468+
| undefined
469+
470+
471+
</td>
472+
473+
474+
475+
<td class="description last">
476+
477+
<p>A function that takes a <a href="module-ol_Feature-Feature.html"><code>Feature</code></a>
478+
and returns <code>true</code> if the feature may be modified or <code>false</code> otherwise.</p></td>
479+
</tr>
480+
481+
482+
457483
<tr class="">
458484

459485
<td class="name"><code>trace</code></td>
@@ -767,7 +793,7 @@ <h4 class="name">
767793

768794
<div class="tag-source">
769795
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Modify.js">interaction/Modify.js</a>,
770-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Modify.js#L2032">line 2032</a>
796+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Modify.js#L2138">line 2138</a>
771797
</div>
772798

773799
</div>
@@ -858,7 +884,7 @@ <h4 class="name">
858884

859885
<div class="tag-source">
860886
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Modify.js">interaction/Modify.js</a>,
861-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Modify.js#L1840">line 1840</a>
887+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Modify.js#L1946">line 1946</a>
862888
</div>
863889

864890
</div>
@@ -1588,7 +1614,7 @@ <h4 class="name">
15881614

15891615
<div class="tag-source">
15901616
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Modify.js">interaction/Modify.js</a>,
1591-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Modify.js#L640">line 640</a>
1617+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Modify.js#L699">line 699</a>
15921618
</div>
15931619

15941620
</div>
@@ -1956,7 +1982,7 @@ <h4 class="name">
19561982

19571983
<div class="tag-source">
19581984
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Modify.js">interaction/Modify.js</a>,
1959-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Modify.js#L2065">line 2065</a>
1985+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Modify.js#L2171">line 2171</a>
19601986
</div>
19611987

19621988
</div>
@@ -2426,7 +2452,7 @@ <h4 class="name">
24262452

24272453
<div class="tag-source">
24282454
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Modify.js">interaction/Modify.js</a>,
2429-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Modify.js#L1871">line 1871</a>
2455+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Modify.js#L1977">line 1977</a>
24302456
</div>
24312457

24322458
</div>
@@ -2740,7 +2766,7 @@ <h4 class="name">
27402766

27412767
<div class="tag-source">
27422768
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Modify.js">interaction/Modify.js</a>,
2743-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Modify.js#L615">line 615</a>
2769+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Modify.js#L674">line 674</a>
27442770
</div>
27452771

27462772
</div>

dist/en/main/apidoc/module-ol_interaction_Modify.ModifyEvent.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ <h4 class="name">
768768

769769
<div class="tag-source">
770770
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Modify.js">interaction/Modify.js</a>,
771-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Modify.js#L79">line 79</a>
771+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Modify.js#L80">line 80</a>
772772
</div>
773773

774774
</div>
@@ -848,7 +848,7 @@ <h4 class="name">
848848

849849
<div class="tag-source">
850850
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Modify.js">interaction/Modify.js</a>,
851-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Modify.js#L73">line 73</a>
851+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Modify.js#L74">line 74</a>
852852
</div>
853853

854854
</div>

dist/en/main/apidoc/module-ol_interaction_Modify.html

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
<span class="subtitle">Typedefs</span>
7373
<ul>
7474
<li data-name="dragsegment"><a href="module-ol_interaction_Modify.html#~DragSegment">DragSegment</a>
75+
<li data-name="filterfunction"><a href="module-ol_interaction_Modify.html#~FilterFunction">FilterFunction</a>
7576
<li data-name="options"><a href="module-ol_interaction_Modify.html#~Options">Options</a>
7677
<li data-name="segmentdata"><a href="module-ol_interaction_Modify.html#~SegmentData">SegmentData</a>
7778
</ul>
@@ -221,6 +222,87 @@ <h4 class="name">
221222

222223

223224

225+
</dd>
226+
227+
228+
229+
<dt class="">
230+
231+
<div class="nameContainer">
232+
<div class="anchor" id="~FilterFunction">
233+
</div>
234+
<h4 class="name">
235+
FilterFunction<span class="signature">()</span>
236+
237+
238+
239+
</h4>
240+
241+
<div class="tag-source">
242+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Modify.js">interaction/Modify.js</a>,
243+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/Modify.js#L98">line 98</a>
244+
</div>
245+
246+
</div>
247+
248+
249+
</dt>
250+
<dd class="">
251+
252+
253+
254+
255+
<div class="description">
256+
<p>A function that takes a <a href="module-ol_Feature-Feature.html"><code>Feature</code></a> and returns <code>true</code> if
257+
the feature may be modified or <code>false</code> otherwise.</p>
258+
</div>
259+
260+
261+
262+
263+
264+
265+
266+
267+
268+
269+
270+
<dl class="details">
271+
272+
273+
274+
275+
276+
277+
278+
279+
280+
281+
282+
283+
284+
285+
286+
287+
288+
289+
290+
291+
292+
</dl>
293+
294+
295+
296+
297+
298+
299+
300+
301+
302+
303+
304+
305+
224306
</dd>
225307

226308

@@ -488,6 +570,30 @@ <h5 class="subsection-title">Properties:</h5>
488570

489571

490572

573+
<tr>
574+
575+
<td class="name"><code>filter</code></td>
576+
577+
578+
<td class="type">
579+
580+
581+
<span class="param-type"><a href="module-ol_interaction_Modify.html#~FilterFunction">FilterFunction</a></span>
582+
583+
| undefined
584+
585+
586+
</td>
587+
588+
<td class="description last">
589+
<p>A function that takes a <a href="module-ol_Feature-Feature.html"><code>Feature</code></a>
590+
and returns <code>true</code> if the feature may be modified or <code>false</code> otherwise.</p>
591+
592+
</td>
593+
</tr>
594+
595+
596+
491597
<tr>
492598

493599
<td class="name"><code>trace</code></td>

dist/en/main/apidoc/navigation.tmpl.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2881,6 +2881,7 @@
28812881
<span class="subtitle">Typedefs</span>
28822882
<ul>
28832883
<li data-name="dragsegment"><a href="module-ol_interaction_Modify.html#~DragSegment">DragSegment</a>
2884+
<li data-name="filterfunction"><a href="module-ol_interaction_Modify.html#~FilterFunction">FilterFunction</a>
28842885
<li data-name="options"><a href="module-ol_interaction_Modify.html#~Options">Options</a>
28852886
<li data-name="segmentdata"><a href="module-ol_interaction_Modify.html#~SegmentData">SegmentData</a>
28862887
</ul>

dist/en/main/examples/common.js

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/examples/common.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/ol/dist/ol.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/ol/dist/ol.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/ol/interaction/Modify.d.ts

Lines changed: 62 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ export type SegmentData = {
5252
*/
5353
featureSegments?: SegmentData[] | undefined;
5454
};
55+
/**
56+
* A function that takes a {@link module :ol/Feature~Feature} and returns `true` if
57+
* the feature may be modified or `false` otherwise.
58+
*/
59+
export type FilterFunction = (arg0: Feature) => boolean;
5560
export type DragSegment = [SegmentData, number];
5661
export type Options = {
5762
/**
@@ -120,6 +125,10 @@ export type Options = {
120125
* provided, a vector source must be provided with the `source` option.
121126
*/
122127
features?: Collection<Feature<import("../geom/Geometry.js").default>> | undefined;
128+
/**
129+
* A function that takes a {@link module :ol/Feature~Feature}and returns `true` if the feature may be modified or `false` otherwise.
130+
*/
131+
filter?: FilterFunction | undefined;
123132
/**
124133
* Trace a portion of another geometry.
125134
* Tracing starts when two neighboring vertices are dragged onto a trace target, without any other modification in between..
@@ -189,6 +198,33 @@ declare class Modify extends PointerInteraction {
189198
* @param {Options} options Options.
190199
*/
191200
constructor(options: Options);
201+
/**
202+
* @param {import("../source/Vector.js").VectorSourceEvent} event Event.
203+
* @private
204+
*/
205+
private handleSourceAdd_;
206+
/**
207+
* @param {import("../source/Vector.js").VectorSourceEvent} event Event.
208+
* @private
209+
*/
210+
private handleSourceRemove_;
211+
/**
212+
* @param {import("../Collection.js").CollectionEvent} event Event.
213+
* @private
214+
*/
215+
private handleExternalCollectionAdd_;
216+
/**
217+
* @param {import("../Collection.js").CollectionEvent} event Event.
218+
* @private
219+
*/
220+
private handleExternalCollectionRemove_;
221+
/**
222+
* Listener for features in external source or features collection. Ensures the feature filter
223+
* is re-run and segment data is updated.
224+
* @param {import("../events/Event.js").default | import("../Object").ObjectEvent} evt Event.
225+
* @private
226+
*/
227+
private handleFeatureChange_;
192228
/***
193229
* @type {ModifyOnSignature<import("../events").EventsKey>}
194230
*/
@@ -201,8 +237,6 @@ declare class Modify extends PointerInteraction {
201237
* @type {ModifyOnSignature<void>}
202238
*/
203239
un: ModifyOnSignature<void>;
204-
/** @private */
205-
private boundHandleFeatureChange_;
206240
/**
207241
* @private
208242
* @type {import("../events/condition.js").Condition}
@@ -324,7 +358,21 @@ declare class Modify extends PointerInteraction {
324358
*/
325359
private hitDetection_;
326360
/**
327-
* @type {Collection<Feature>}
361+
* Useful for performance optimization
362+
* @private
363+
* @type boolean
364+
*/
365+
private filterFunctionWasSupplied_;
366+
/**
367+
* @private
368+
* @type {FilterFunction}
369+
*/
370+
private filter_;
371+
featuresCollection_: Collection<Feature<import("../geom/Geometry.js").default>> | undefined;
372+
/**
373+
* Internal features array. When adding or removing features, be sure to use
374+
* addFeature_()/removeFeature_() so that the the segment index is adjusted.
375+
* @type {Array<Feature>}
328376
* @private
329377
*/
330378
private features_;
@@ -351,6 +399,7 @@ declare class Modify extends PointerInteraction {
351399
*/
352400
setTrace(trace: boolean | import("../events/condition.js").Condition): void;
353401
/**
402+
* Called when a feature is added to the internal features collection
354403
* @param {Feature} feature Feature.
355404
* @private
356405
*/
@@ -362,6 +411,8 @@ declare class Modify extends PointerInteraction {
362411
*/
363412
private willModifyFeatures_;
364413
/**
414+
* Removes a feature from the internal features collection and updates internal state
415+
* accordingly.
365416
* @param {Feature} feature Feature.
366417
* @private
367418
*/
@@ -386,30 +437,17 @@ declare class Modify extends PointerInteraction {
386437
*/
387438
getOverlay(): VectorLayer;
388439
/**
389-
* @param {import("../source/Vector.js").VectorSourceEvent} event Event.
390-
* @private
391-
*/
392-
private handleSourceAdd_;
393-
/**
394-
* @param {import("../source/Vector.js").VectorSourceEvent} event Event.
395-
* @private
396-
*/
397-
private handleSourceRemove_;
398-
/**
399-
* @param {import("../Collection.js").CollectionEvent<Feature>} evt Event.
400-
* @private
401-
*/
402-
private handleFeatureAdd_;
403-
/**
404-
* @param {import("../events/Event.js").default} evt Event.
405-
* @private
440+
* Common handler for event signaling addition of feature to the supplied features source
441+
* or collection.
442+
* @param {Feature} feature Feature.
406443
*/
407-
private handleFeatureChange_;
444+
externalAddFeatureHandler_(feature: Feature): void;
408445
/**
409-
* @param {import("../Collection.js").CollectionEvent<Feature>} evt Event.
410-
* @private
446+
* Common handler for event signaling removal of feature from the supplied features source
447+
* or collection.
448+
* @param {Feature} feature Feature.
411449
*/
412-
private handleFeatureRemove_;
450+
externalRemoveFeatureHandler_(feature: Feature): void;
413451
/**
414452
* @param {Feature} feature Feature
415453
* @param {Point} geometry Geometry.

dist/en/main/ol/interaction/Modify.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)