ofs-object 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +5 -0
- package/dist/ofs-object.cjs +1 -1
- package/dist/ofs-object.js +26 -19
- package/package.json +1 -1
package/dist/ofs-object.js
CHANGED
|
@@ -36049,11 +36049,11 @@ class c3 extends zo {
|
|
|
36049
36049
|
return;
|
|
36050
36050
|
if (this.currentMode === "select") {
|
|
36051
36051
|
this.grips.getIsEditing() && this.grips.clear();
|
|
36052
|
-
const h = !!((o = e.originalEvent) != null && o.shiftKey);
|
|
36053
|
-
if (
|
|
36054
|
-
const
|
|
36055
|
-
if (
|
|
36056
|
-
h ? this.dataSource.toggleFeatureSelection(
|
|
36052
|
+
const h = !!((o = e.originalEvent) != null && o.shiftKey), f = this.pickable(e.features);
|
|
36053
|
+
if (f.length > 0) {
|
|
36054
|
+
const d = f[0];
|
|
36055
|
+
if (d.id !== void 0 && d.layerId) {
|
|
36056
|
+
h ? this.dataSource.toggleFeatureSelection(d.layerId, d.id) : this.dataSource.selectFeature(d.layerId, d.id, !1);
|
|
36057
36057
|
return;
|
|
36058
36058
|
}
|
|
36059
36059
|
} else {
|
|
@@ -36151,21 +36151,21 @@ class c3 extends zo {
|
|
|
36151
36151
|
* Handle double click on map (finishes LineString or Polygon)
|
|
36152
36152
|
*/
|
|
36153
36153
|
handleMapDblClick(e) {
|
|
36154
|
-
if (this.currentMode)
|
|
36155
|
-
|
|
36156
|
-
|
|
36157
|
-
|
|
36158
|
-
|
|
36159
|
-
|
|
36160
|
-
|
|
36154
|
+
if (!this.currentMode) return;
|
|
36155
|
+
const n = this.currentMode === "select" ? this.pickable(e.features) : [];
|
|
36156
|
+
if (n.length > 0) {
|
|
36157
|
+
const s = n[0];
|
|
36158
|
+
if (s.id !== void 0 && s.layerId) {
|
|
36159
|
+
this.startEdit(s.layerId, s.id);
|
|
36160
|
+
return;
|
|
36161
36161
|
}
|
|
36162
|
-
|
|
36163
|
-
|
|
36164
|
-
|
|
36165
|
-
|
|
36166
|
-
|
|
36167
|
-
this.finishDrawing();
|
|
36162
|
+
}
|
|
36163
|
+
if (this.isDrawing && (this.currentMode === "line" || this.currentMode === "polygon" || this.currentMode === "select-polygon")) {
|
|
36164
|
+
if (this.activeCoordinates.length > 1) {
|
|
36165
|
+
const s = this.activeCoordinates[this.activeCoordinates.length - 1], r = this.activeCoordinates[this.activeCoordinates.length - 2];
|
|
36166
|
+
s[0] === r[0] && s[1] === r[1] && this.activeCoordinates.pop();
|
|
36168
36167
|
}
|
|
36168
|
+
this.finishDrawing();
|
|
36169
36169
|
}
|
|
36170
36170
|
}
|
|
36171
36171
|
/**
|
|
@@ -36207,7 +36207,7 @@ class c3 extends zo {
|
|
|
36207
36207
|
return;
|
|
36208
36208
|
}
|
|
36209
36209
|
if (this.currentMode === "select" || this.currentMode === "modify") {
|
|
36210
|
-
const a =
|
|
36210
|
+
const a = this.pickable(e.features)[0] ?? null, l = xe(this.mapAdapter), h = l && typeof l.getCanvas == "function" ? l.getCanvas() : null;
|
|
36211
36211
|
if (a && a.id !== void 0 && a.layerId) {
|
|
36212
36212
|
const f = this.dataSource.getLayer(a.layerId), d = f == null ? void 0 : f.getFeature(a.id);
|
|
36213
36213
|
this.selectionOverlay.setHoverFeature(d || a), h && (h.style.cursor = "pointer");
|
|
@@ -37256,6 +37256,13 @@ class c3 extends zo {
|
|
|
37256
37256
|
features: [f]
|
|
37257
37257
|
});
|
|
37258
37258
|
}
|
|
37259
|
+
/**
|
|
37260
|
+
* Features under the pointer that select / modify may pick - only the target layer's when
|
|
37261
|
+
* `setMode('select', layerId)` named one (the same rule as box / polygon selection)
|
|
37262
|
+
*/
|
|
37263
|
+
pickable(e) {
|
|
37264
|
+
return e != null && e.length ? this.targetLayerId ? e.filter((n) => n.layerId === this.targetLayerId) : e : [];
|
|
37265
|
+
}
|
|
37259
37266
|
/**
|
|
37260
37267
|
* Query all features within or intersecting the given geometry across visible layers
|
|
37261
37268
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ofs-object",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Framework-agnostic TypeScript Library for GIS Map Tools (Data Adapter, Draw Tools, Legend & Thematic Symbology, Map Adapters, Web CLI & AI Bridge)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "On-Farm Solution Co.,Ltd.",
|