Skip to content

Commit 6bbc7a4

Browse files
committed
Website updates
1 parent 963cbe1 commit 6bbc7a4

10 files changed

Lines changed: 35 additions & 24 deletions

dist/en/main/apidoc/module-ol_Feature-Feature.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ <h4 class="name">
894894

895895
<div class="tag-source">
896896
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/Feature.js">Feature.js</a>,
897-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/Feature.js#L182">line 182</a>
897+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/Feature.js#L190">line 190</a>
898898
</div>
899899

900900
</div>
@@ -986,7 +986,7 @@ <h4 class="name">
986986

987987
<div class="tag-source">
988988
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/Feature.js">Feature.js</a>,
989-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/Feature.js#L204">line 204</a>
989+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/Feature.js#L212">line 212</a>
990990
</div>
991991

992992
</div>
@@ -1078,7 +1078,7 @@ <h4 class="name">
10781078

10791079
<div class="tag-source">
10801080
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/Feature.js">Feature.js</a>,
1081-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/Feature.js#L193">line 193</a>
1081+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/Feature.js#L201">line 201</a>
10821082
</div>
10831083

10841084
</div>
@@ -1447,7 +1447,7 @@ <h4 class="name">
14471447

14481448
<div class="tag-source">
14491449
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/Feature.js">Feature.js</a>,
1450-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/Feature.js#L214">line 214</a>
1450+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/Feature.js#L222">line 222</a>
14511451
</div>
14521452

14531453
</div>
@@ -1538,7 +1538,7 @@ <h4 class="name">
15381538

15391539
<div class="tag-source">
15401540
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/Feature.js">Feature.js</a>,
1541-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/Feature.js#L224">line 224</a>
1541+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/Feature.js#L232">line 232</a>
15421542
</div>
15431543

15441544
</div>
@@ -2141,7 +2141,7 @@ <h4 class="name">
21412141

21422142
<div class="tag-source">
21432143
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/Feature.js">Feature.js</a>,
2144-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/Feature.js#L262">line 262</a>
2144+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/Feature.js#L270">line 270</a>
21452145
</div>
21462146

21472147
</div>
@@ -2271,7 +2271,7 @@ <h4 class="name">
22712271

22722272
<div class="tag-source">
22732273
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/Feature.js">Feature.js</a>,
2274-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/Feature.js#L302">line 302</a>
2274+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/Feature.js#L310">line 310</a>
22752275
</div>
22762276

22772277
</div>
@@ -2399,7 +2399,7 @@ <h4 class="name">
23992399

24002400
<div class="tag-source">
24012401
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/Feature.js">Feature.js</a>,
2402-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/Feature.js#L290">line 290</a>
2402+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/Feature.js#L298">line 298</a>
24032403
</div>
24042404

24052405
</div>
@@ -2703,7 +2703,7 @@ <h4 class="name">
27032703

27042704
<div class="tag-source">
27052705
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/Feature.js">Feature.js</a>,
2706-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/Feature.js#L275">line 275</a>
2706+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/Feature.js#L283">line 283</a>
27072707
</div>
27082708

27092709
</div>

dist/en/main/examples/common.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/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/examples/offscreen-canvas.worker.worker.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/examples/offscreen-canvas.worker.worker.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/Feature.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.

dist/en/main/ol/Feature.js

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -156,14 +156,22 @@ class Feature extends BaseObject {
156156
* @api
157157
*/
158158
clone() {
159-
const clone = /** @type {Feature<Geometry>} */ (
160-
new Feature(this.hasProperties() ? this.getProperties() : null)
161-
);
162-
clone.setGeometryName(this.getGeometryName());
163-
const geometry = this.getGeometry();
164-
if (geometry) {
165-
clone.setGeometry(/** @type {Geometry} */ (geometry.clone()));
159+
const clone = /** @type {Feature<Geometry>} */ (new Feature());
160+
const geometryName = this.geometryName_;
161+
clone.setGeometryName(geometryName);
162+
163+
const properties = this.getPropertiesInternal();
164+
if (properties) {
165+
const geometry = this.getGeometry();
166+
for (const key in properties) {
167+
if (key === geometryName && geometry) {
168+
clone.set(key, geometry.clone());
169+
} else {
170+
clone.set(key, properties[key], true);
171+
}
172+
}
166173
}
174+
167175
const style = this.getStyle();
168176
if (style) {
169177
clone.setStyle(style);
@@ -300,6 +308,9 @@ class Feature extends BaseObject {
300308
* @api
301309
*/
302310
setGeometryName(name) {
311+
if (name === this.geometryName_) {
312+
return;
313+
}
303314
this.removeChangeListener(this.geometryName_, this.handleGeometryChanged_);
304315
this.geometryName_ = name;
305316
this.addChangeListener(this.geometryName_, this.handleGeometryChanged_);

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/main.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.

0 commit comments

Comments
 (0)