@eyeon/map 2.0.43 → 2.0.44
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/assets/index.css +1 -1
- package/dist/chunks/MapViewer.js +2457 -2443
- package/dist/chunks/MapViewer.js.map +1 -1
- package/dist/chunks/responsive.js +667 -660
- package/dist/chunks/responsive.js.map +1 -1
- package/dist/chunks/wheelZoom.js +159 -159
- package/dist/chunks/wheelZoom.js.map +1 -1
- package/dist/core/import/index.d.ts +7 -0
- package/dist/core/import/index.d.ts.map +1 -1
- package/dist/core/index.js +161 -160
- package/dist/core/outdoorDecoration.d.ts +3 -2
- package/dist/core/outdoorDecoration.d.ts.map +1 -1
- package/dist/editor/MapEditor.d.ts +8 -1
- package/dist/editor/MapEditor.d.ts.map +1 -1
- package/dist/editor/canvas/EditorCanvas.d.ts.map +1 -1
- package/dist/editor/canvas/OutdoorSvgUnderlay.d.ts +3 -1
- package/dist/editor/canvas/OutdoorSvgUnderlay.d.ts.map +1 -1
- package/dist/editor/index.css +15 -0
- package/dist/editor/index.js +4418 -4312
- package/dist/editor/index.js.map +1 -1
- package/dist/editor/panels/ClassicMapFooter.d.ts +8 -4
- package/dist/editor/panels/ClassicMapFooter.d.ts.map +1 -1
- package/dist/editor/panels/LeftRail.d.ts +2 -1
- package/dist/editor/panels/LeftRail.d.ts.map +1 -1
- package/dist/editor/panels/PreviewOverlay.d.ts +3 -1
- package/dist/editor/panels/PreviewOverlay.d.ts.map +1 -1
- package/dist/viewer/MapViewer.d.ts +5 -0
- package/dist/viewer/MapViewer.d.ts.map +1 -1
- package/dist/viewer/components/MapScene.d.ts +6 -1
- package/dist/viewer/components/MapScene.d.ts.map +1 -1
- package/dist/viewer/components/SvgVectorLayer.d.ts +6 -1
- package/dist/viewer/components/SvgVectorLayer.d.ts.map +1 -1
- package/dist/viewer/index.js +4 -4
- package/package.json +1 -1
package/dist/chunks/wheelZoom.js
CHANGED
|
@@ -1,170 +1,170 @@
|
|
|
1
|
-
import {
|
|
2
|
-
function
|
|
3
|
-
var
|
|
4
|
-
const
|
|
5
|
-
for (const
|
|
6
|
-
if (!
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
id:
|
|
10
|
-
d:
|
|
11
|
-
fill:
|
|
12
|
-
stroke:
|
|
13
|
-
strokeWidth:
|
|
14
|
-
opacity: (
|
|
1
|
+
import { bL as S, bc as w, ba as M, b5 as _, be as L, b_ as O, aV as $, G as F, co as N, d as y, bw as b, av as k, bQ as x, bO as T, k as W } from "./responsive.js";
|
|
2
|
+
function U(e, f, c, s = !1) {
|
|
3
|
+
var t, u, l, o;
|
|
4
|
+
const n = S(e), i = [];
|
|
5
|
+
for (const r of n.elements) {
|
|
6
|
+
if (!r.d || r.interactive || r.inBackground && !s || f != null && f.has(r.id) || /^parking[-_]?lines?(?:[-_]|$)/i.test(r.id) || r.id.toLowerCase().startsWith("route-path") || w(r.id) || M(r.id) || _(r.id) || L(r.id)) continue;
|
|
7
|
+
const a = O(r.id, c), h = (a == null ? void 0 : a.fill) ?? ($(r.id) ? F(c) : (t = r.style) == null ? void 0 : t.fill), m = (a == null ? void 0 : a.stroke) ?? ((u = r.style) == null ? void 0 : u.stroke), d = (a == null ? void 0 : a.strokeWidth) ?? ((l = r.style) == null ? void 0 : l.strokeWidth);
|
|
8
|
+
i.push({
|
|
9
|
+
id: r.id,
|
|
10
|
+
d: r.d,
|
|
11
|
+
fill: h && h !== "none" ? h : void 0,
|
|
12
|
+
stroke: m && m !== "none" ? m : void 0,
|
|
13
|
+
strokeWidth: d,
|
|
14
|
+
opacity: (o = r.style) == null ? void 0 : o.opacity
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
|
-
return
|
|
17
|
+
return N(i, (r) => r.id);
|
|
18
18
|
}
|
|
19
|
-
function P(e,
|
|
20
|
-
const
|
|
21
|
-
if (
|
|
22
|
-
const i =
|
|
23
|
-
for (const
|
|
24
|
-
|
|
25
|
-
if (
|
|
26
|
-
const u = new Set(
|
|
27
|
-
for (const
|
|
28
|
-
let
|
|
29
|
-
if (u.has(
|
|
30
|
-
|
|
19
|
+
function P(e, f, c, s = y) {
|
|
20
|
+
const n = e.filter((o) => c.includes(o.id));
|
|
21
|
+
if (n.length < 2) return null;
|
|
22
|
+
const i = n.reduce((o, r) => r.id < o.id ? r : o), t = [];
|
|
23
|
+
for (const o of n)
|
|
24
|
+
o.id !== i.id && k(o, i) <= s && t.push(o.id);
|
|
25
|
+
if (t.length === 0) return null;
|
|
26
|
+
const u = new Set(t), l = [];
|
|
27
|
+
for (const o of f) {
|
|
28
|
+
let r = !1;
|
|
29
|
+
if (u.has(o.fromAnchorId) && (o.fromAnchorId = i.id, r = !0), u.has(o.toAnchorId) && (o.toAnchorId = i.id, r = !0), o.fromAnchorId === o.toAnchorId) {
|
|
30
|
+
l.push(o.id);
|
|
31
31
|
continue;
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
r && l.push(o.id);
|
|
34
34
|
}
|
|
35
35
|
return {
|
|
36
36
|
survivingAnchorId: i.id,
|
|
37
|
-
removedAnchorIds:
|
|
38
|
-
rewiredEdgeIds:
|
|
37
|
+
removedAnchorIds: t,
|
|
38
|
+
rewiredEdgeIds: l
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
-
function D(e,
|
|
42
|
-
const
|
|
43
|
-
for (let
|
|
44
|
-
if (
|
|
45
|
-
const i = [e[
|
|
46
|
-
for (let
|
|
47
|
-
|
|
48
|
-
i.length > 1 && (
|
|
41
|
+
function D(e, f = y) {
|
|
42
|
+
const c = [], s = /* @__PURE__ */ new Set();
|
|
43
|
+
for (let n = 0; n < e.length; n++) {
|
|
44
|
+
if (s.has(e[n].id)) continue;
|
|
45
|
+
const i = [e[n].id];
|
|
46
|
+
for (let t = n + 1; t < e.length; t++)
|
|
47
|
+
s.has(e[t].id) || e[n].levelId === e[t].levelId && k(e[n], e[t]) <= f && (i.push(e[t].id), s.add(e[t].id));
|
|
48
|
+
i.length > 1 && (s.add(e[n].id), c.push(i));
|
|
49
49
|
}
|
|
50
|
-
return
|
|
50
|
+
return c;
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
const
|
|
54
|
-
for (const
|
|
55
|
-
const
|
|
56
|
-
if (
|
|
57
|
-
for (const
|
|
52
|
+
function R(e, f, c = y) {
|
|
53
|
+
const s = e.slice(), n = f.map((o) => ({ ...o })), i = /* @__PURE__ */ new Set();
|
|
54
|
+
for (const o of D(s, c)) {
|
|
55
|
+
const r = P(s, n, o, c);
|
|
56
|
+
if (r)
|
|
57
|
+
for (const a of r.removedAnchorIds) i.add(a);
|
|
58
58
|
}
|
|
59
|
-
const
|
|
60
|
-
for (const
|
|
61
|
-
if (i.has(
|
|
62
|
-
const
|
|
63
|
-
u.has(
|
|
59
|
+
const t = s.filter((o) => !i.has(o.id)), u = /* @__PURE__ */ new Set(), l = [];
|
|
60
|
+
for (const o of n) {
|
|
61
|
+
if (i.has(o.fromAnchorId) || i.has(o.toAnchorId) || o.fromAnchorId === o.toAnchorId) continue;
|
|
62
|
+
const r = Math.min(o.fromAnchorId, o.toAnchorId), a = Math.max(o.fromAnchorId, o.toAnchorId), h = `${r}|${a}`;
|
|
63
|
+
u.has(h) || (u.add(h), l.push(o));
|
|
64
64
|
}
|
|
65
|
-
return { anchors:
|
|
65
|
+
return { anchors: t, edges: l };
|
|
66
66
|
}
|
|
67
|
-
function
|
|
68
|
-
let
|
|
69
|
-
for (const
|
|
70
|
-
const u = b(e,
|
|
71
|
-
u && (!
|
|
67
|
+
function Y(e, f, c, s = y) {
|
|
68
|
+
let n = null;
|
|
69
|
+
for (const t of f) {
|
|
70
|
+
const u = b(e, t);
|
|
71
|
+
u && (!n || u.distance < n.distance) && (n = { point: u.point, distance: u.distance });
|
|
72
72
|
}
|
|
73
|
-
if (!
|
|
74
|
-
const i =
|
|
75
|
-
(
|
|
73
|
+
if (!n) return null;
|
|
74
|
+
const i = c.find(
|
|
75
|
+
(t) => t.levelId === e.levelId && k(t, n.point) <= s
|
|
76
76
|
);
|
|
77
77
|
return {
|
|
78
78
|
unitAnchorId: e.id,
|
|
79
|
-
junctionAnchor: i ? { x: i.x, y: i.y, existingId: i.id } : { x:
|
|
79
|
+
junctionAnchor: i ? { x: i.x, y: i.y, existingId: i.id } : { x: n.point.x, y: n.point.y },
|
|
80
80
|
edge: {
|
|
81
81
|
fromAnchorId: e.id,
|
|
82
82
|
toAnchorId: i == null ? void 0 : i.id
|
|
83
83
|
}
|
|
84
84
|
};
|
|
85
85
|
}
|
|
86
|
-
function X(e,
|
|
87
|
-
if (
|
|
88
|
-
const
|
|
89
|
-
if (
|
|
90
|
-
let i = 0,
|
|
91
|
-
for (const
|
|
92
|
-
i +=
|
|
93
|
-
const u = { x: i /
|
|
86
|
+
function X(e, f, c, s) {
|
|
87
|
+
if (c.length === 0) return null;
|
|
88
|
+
const n = c.flat();
|
|
89
|
+
if (n.length === 0) return null;
|
|
90
|
+
let i = 0, t = 0;
|
|
91
|
+
for (const o of n)
|
|
92
|
+
i += o.x, t += o.y;
|
|
93
|
+
const u = { x: i / n.length, y: t / n.length }, l = x(u, c) ? u : n[0];
|
|
94
94
|
return {
|
|
95
|
-
id:
|
|
96
|
-
levelId:
|
|
95
|
+
id: s,
|
|
96
|
+
levelId: f,
|
|
97
97
|
shapeId: e,
|
|
98
98
|
kind: "unit",
|
|
99
|
-
x:
|
|
100
|
-
y:
|
|
99
|
+
x: l.x,
|
|
100
|
+
y: l.y,
|
|
101
101
|
connectorId: null
|
|
102
102
|
};
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function q(e, f, c = 20) {
|
|
105
105
|
if (e.length === 0)
|
|
106
106
|
return { anchors: [], edges: [] };
|
|
107
|
-
let
|
|
108
|
-
for (const
|
|
109
|
-
for (const
|
|
110
|
-
|
|
111
|
-
const u = Math.max(1, Math.ceil((i -
|
|
112
|
-
for (let
|
|
113
|
-
for (let
|
|
114
|
-
const p =
|
|
115
|
-
x(A, e) && (
|
|
107
|
+
let s = 1 / 0, n = 1 / 0, i = -1 / 0, t = -1 / 0;
|
|
108
|
+
for (const d of e)
|
|
109
|
+
for (const I of d)
|
|
110
|
+
s = Math.min(s, I.x), n = Math.min(n, I.y), i = Math.max(i, I.x), t = Math.max(t, I.y);
|
|
111
|
+
const u = Math.max(1, Math.ceil((i - s) / c)), l = Math.max(1, Math.ceil((t - n) / c)), o = [];
|
|
112
|
+
for (let d = 0; d < l; d++)
|
|
113
|
+
for (let I = 0; I < u; I++) {
|
|
114
|
+
const p = s + (I + 0.5) * c, g = n + (d + 0.5) * c, A = { x: p, y: g };
|
|
115
|
+
x(A, e) && (f.length > 0 && x(A, f) || o.push({ key: `${I},${d}`, x: p, y: g, col: I, row: d }));
|
|
116
116
|
}
|
|
117
|
-
const
|
|
118
|
-
tempId:
|
|
119
|
-
x:
|
|
120
|
-
y:
|
|
117
|
+
const r = new Map(o.map((d) => [d.key, d])), a = o.map((d) => ({
|
|
118
|
+
tempId: d.key,
|
|
119
|
+
x: d.x,
|
|
120
|
+
y: d.y,
|
|
121
121
|
kind: "junction"
|
|
122
|
-
})),
|
|
123
|
-
for (const
|
|
124
|
-
const
|
|
125
|
-
[
|
|
126
|
-
[
|
|
122
|
+
})), h = [], m = /* @__PURE__ */ new Set();
|
|
123
|
+
for (const d of o) {
|
|
124
|
+
const I = [
|
|
125
|
+
[d.col + 1, d.row],
|
|
126
|
+
[d.col, d.row + 1]
|
|
127
127
|
];
|
|
128
|
-
for (const [p, g] of
|
|
128
|
+
for (const [p, g] of I) {
|
|
129
129
|
const A = `${p},${g}`;
|
|
130
|
-
if (!
|
|
131
|
-
const v =
|
|
132
|
-
m.has(v) || (m.add(v),
|
|
130
|
+
if (!r.has(A)) continue;
|
|
131
|
+
const v = d.key < A ? `${d.key}|${A}` : `${A}|${d.key}`;
|
|
132
|
+
m.has(v) || (m.add(v), h.push({ fromTempId: d.key, toTempId: A }));
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
|
-
return { anchors:
|
|
135
|
+
return { anchors: a, edges: h };
|
|
136
136
|
}
|
|
137
|
-
function
|
|
138
|
-
const i = [],
|
|
139
|
-
let u =
|
|
140
|
-
const
|
|
141
|
-
const
|
|
142
|
-
(
|
|
137
|
+
function Q(e, f, c, s, n = y) {
|
|
138
|
+
const i = [], t = [];
|
|
139
|
+
let u = s;
|
|
140
|
+
const l = (r, a) => {
|
|
141
|
+
const h = i.find(
|
|
142
|
+
(d) => k(d, { x: r, y: a }) <= n
|
|
143
143
|
);
|
|
144
|
-
if (
|
|
144
|
+
if (h) return h.id;
|
|
145
145
|
const m = u++;
|
|
146
146
|
return i.push({
|
|
147
147
|
id: m,
|
|
148
|
-
levelId:
|
|
148
|
+
levelId: f,
|
|
149
149
|
shapeId: null,
|
|
150
150
|
kind: "junction",
|
|
151
|
-
x:
|
|
152
|
-
y:
|
|
151
|
+
x: r,
|
|
152
|
+
y: a,
|
|
153
153
|
connectorId: null
|
|
154
154
|
}), m;
|
|
155
155
|
};
|
|
156
|
-
for (const
|
|
157
|
-
const
|
|
158
|
-
for (const
|
|
159
|
-
for (let m = 0; m <
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
(g) => g.fromAnchorId ===
|
|
163
|
-
) ||
|
|
156
|
+
for (const r of e) {
|
|
157
|
+
const a = T(r);
|
|
158
|
+
for (const h of a)
|
|
159
|
+
for (let m = 0; m < h.length - 1; m++) {
|
|
160
|
+
const d = l(h[m].x, h[m].y), I = l(h[m + 1].x, h[m + 1].y);
|
|
161
|
+
d === I || t.some(
|
|
162
|
+
(g) => g.fromAnchorId === d && g.toAnchorId === I || g.fromAnchorId === I && g.toAnchorId === d
|
|
163
|
+
) || t.push({
|
|
164
164
|
id: u++,
|
|
165
|
-
mapId:
|
|
166
|
-
fromAnchorId:
|
|
167
|
-
toAnchorId:
|
|
165
|
+
mapId: c,
|
|
166
|
+
fromAnchorId: d,
|
|
167
|
+
toAnchorId: I,
|
|
168
168
|
weight: null,
|
|
169
169
|
directed: !1,
|
|
170
170
|
accessible: !0,
|
|
@@ -172,48 +172,48 @@ function q(e, d, r, c, t = y) {
|
|
|
172
172
|
});
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
-
const
|
|
176
|
-
return { anchors:
|
|
175
|
+
const o = R(i, t, n);
|
|
176
|
+
return { anchors: o.anchors, edges: o.edges, nextId: u };
|
|
177
177
|
}
|
|
178
|
-
function
|
|
178
|
+
function C(e) {
|
|
179
179
|
return e === "entrance" ? "entrance" : e === "connector" ? "connector" : "unit";
|
|
180
180
|
}
|
|
181
|
-
function
|
|
181
|
+
function K(e) {
|
|
182
182
|
return e === "entrance" ? "entrance_link" : "unit_link";
|
|
183
183
|
}
|
|
184
|
-
function G(e,
|
|
185
|
-
if (x(e,
|
|
186
|
-
for (const
|
|
187
|
-
if (
|
|
188
|
-
const
|
|
189
|
-
if (i && i.distance <=
|
|
184
|
+
function G(e, f, c) {
|
|
185
|
+
if (x(e, f)) return "inside";
|
|
186
|
+
for (const s of f) {
|
|
187
|
+
if (s.length < 2) continue;
|
|
188
|
+
const n = [...s, s[0]], i = b(e, n);
|
|
189
|
+
if (i && i.distance <= c) return "near";
|
|
190
190
|
}
|
|
191
191
|
return null;
|
|
192
192
|
}
|
|
193
|
-
function H(e,
|
|
194
|
-
let
|
|
195
|
-
for (const
|
|
196
|
-
if (!W.includes(
|
|
197
|
-
const i =
|
|
193
|
+
function H(e, f, c) {
|
|
194
|
+
let s = null;
|
|
195
|
+
for (const n of f) {
|
|
196
|
+
if (!W.includes(n.kind)) continue;
|
|
197
|
+
const i = n.geometry.polygons ?? [];
|
|
198
198
|
if (i.length === 0) continue;
|
|
199
|
-
const
|
|
200
|
-
if (
|
|
201
|
-
|
|
199
|
+
const t = G(e, i, c);
|
|
200
|
+
if (t === "inside") return n;
|
|
201
|
+
t === "near" && s == null && (s = n);
|
|
202
202
|
}
|
|
203
|
-
return
|
|
203
|
+
return s;
|
|
204
204
|
}
|
|
205
|
-
function
|
|
206
|
-
const
|
|
207
|
-
for (const
|
|
208
|
-
|
|
205
|
+
function Z(e, f, c, s = y * 3) {
|
|
206
|
+
const n = /* @__PURE__ */ new Map();
|
|
207
|
+
for (const t of f)
|
|
208
|
+
n.set(t.fromAnchorId, (n.get(t.fromAnchorId) ?? 0) + 1), n.set(t.toAnchorId, (n.get(t.toAnchorId) ?? 0) + 1);
|
|
209
209
|
let i = 0;
|
|
210
|
-
for (const
|
|
211
|
-
if (
|
|
212
|
-
const u = H(
|
|
213
|
-
if (!u || (
|
|
214
|
-
const
|
|
215
|
-
for (const
|
|
216
|
-
(
|
|
210
|
+
for (const t of e) {
|
|
211
|
+
if (t.shapeId != null) continue;
|
|
212
|
+
const u = H(t, c, s);
|
|
213
|
+
if (!u || (t.shapeId = u.id, t.kind = C(u.kind), i += 1, (n.get(t.id) ?? 0) > 1)) continue;
|
|
214
|
+
const l = K(t.kind);
|
|
215
|
+
for (const o of f)
|
|
216
|
+
(o.fromAnchorId === t.id || o.toAnchorId === t.id) && (o.kind = l);
|
|
217
217
|
}
|
|
218
218
|
return i;
|
|
219
219
|
}
|
|
@@ -221,24 +221,24 @@ const V = 0.95, E = 1;
|
|
|
221
221
|
function j(e = E) {
|
|
222
222
|
return Math.pow(V, e);
|
|
223
223
|
}
|
|
224
|
-
function
|
|
225
|
-
if (
|
|
226
|
-
const
|
|
227
|
-
return Math.min(
|
|
224
|
+
function J(e, f, c) {
|
|
225
|
+
if (f === 0) return e;
|
|
226
|
+
const s = j((c == null ? void 0 : c.zoomSpeed) ?? E), n = f < 0 ? e / s : e * s, i = (c == null ? void 0 : c.min) ?? Number.NEGATIVE_INFINITY, t = (c == null ? void 0 : c.max) ?? Number.POSITIVE_INFINITY;
|
|
227
|
+
return Math.min(t, Math.max(i, n));
|
|
228
228
|
}
|
|
229
229
|
export {
|
|
230
230
|
V as W,
|
|
231
231
|
E as a,
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
232
|
+
Z as b,
|
|
233
|
+
Y as c,
|
|
234
|
+
q as d,
|
|
235
|
+
R as e,
|
|
236
236
|
D as f,
|
|
237
237
|
j as g,
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
238
|
+
Q as i,
|
|
239
|
+
J as n,
|
|
240
|
+
U as o,
|
|
241
|
+
C as r,
|
|
242
242
|
X as u,
|
|
243
243
|
P as w
|
|
244
244
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wheelZoom.js","sources":["../../src/core/outdoorDecoration.ts","../../src/core/routing/graph-tools.ts","../../src/core/wheelZoom.ts"],"sourcesContent":["import {\n parseSvgString,\n isInteractiveGroupLabel,\n isRouteFolderLabel,\n isRoutePathLabel,\n isStoreFolderLabel,\n} from './import';\nimport { amenityHouseFill, isAmenityLayerId } from './shapeFill';\nimport {\n resolveLayerStyle,\n sortByOutdoorSvgPaintOrder,\n type StaticLayerTheme,\n} from './layerStyles';\n\nexport interface OutdoorDecorationPath {\n id: string;\n d: string;\n fill?: string;\n stroke?: string;\n strokeWidth?: number;\n opacity?: number;\n}\n\n/**\n * Paths the assign viewer draws from the live outdoor SVG: house-style\n * decoration (green area, parking lanes, icons) and any other\n * non-interactive art. Interactive / store folders stay out — those are\n * `cm_shapes` rows.\n */\nexport function outdoorDecorationFromSvg(\n svgText: string,\n suppressIds?: ReadonlySet<string>,\n theme?: StaticLayerTheme | null,\n): OutdoorDecorationPath[] {\n const parsed = parseSvgString(svgText);\n const out: OutdoorDecorationPath[] = [];\n for (const el of parsed.elements) {\n if (!el.d) continue;\n if (el.interactive) continue;\n if (suppressIds?.has(el.id)) continue;\n if (/^parking[-_]?lines?(?:[-_]|$)/i.test(el.id)) continue;\n if (el.id.toLowerCase().startsWith('route-path')) continue;\n if (isRoutePathLabel(el.id) || isRouteFolderLabel(el.id)) continue;\n if (isInteractiveGroupLabel(el.id) || isStoreFolderLabel(el.id)) continue;\n\n const layer = resolveLayerStyle(el.id, theme);\n const fill =\n layer?.fill ??\n (isAmenityLayerId(el.id) ? amenityHouseFill(theme) : el.style?.fill);\n const stroke = layer?.stroke ?? el.style?.stroke;\n const strokeWidth = layer?.strokeWidth ?? el.style?.strokeWidth;\n out.push({\n id: el.id,\n d: el.d,\n fill: fill && fill !== 'none' ? fill : undefined,\n stroke: stroke && stroke !== 'none' ? stroke : undefined,\n strokeWidth,\n opacity: el.style?.opacity,\n });\n }\n // Parking lanes move under green areas. Later special shapes stay on top.\n return sortByOutdoorSvgPaintOrder(out, (item) => item.id);\n}\n","import type {\n AnchorKind,\n AutoConnectResult,\n CmAnchor,\n CmRouteEdge,\n ShapeGeometry,\n ShapeKind,\n SkeletonSuggestion,\n Vec2,\n WeldResult,\n} from '../types';\nimport { DEFAULT_WELD_TOLERANCE, INTERACTIVE_SHAPE_KINDS } from '../types';\nimport {\n distance,\n nearestPointOnPolyline,\n pathToPolygons,\n pointInPolygons,\n} from '../geometry';\n\nexport interface AnchorLike {\n id: number;\n x: number;\n y: number;\n levelId: number;\n shapeId?: number | null;\n kind?: string;\n}\n\nexport interface EdgeLike {\n id: number;\n fromAnchorId: number;\n toAnchorId: number;\n}\n\n/**\n * Weld anchors within tolerance into the surviving (lowest id) anchor.\n * Rewires edges that referenced removed anchors.\n */\nexport function weldAnchors(\n anchors: AnchorLike[],\n edges: EdgeLike[],\n candidateIds: number[],\n tolerance = DEFAULT_WELD_TOLERANCE,\n): WeldResult | null {\n const candidates = anchors.filter((a) => candidateIds.includes(a.id));\n if (candidates.length < 2) return null;\n\n // Cluster by proximity from the first candidate's position centroid of group\n const surviving = candidates.reduce((min, a) => (a.id < min.id ? a : min));\n const removed: number[] = [];\n\n for (const a of candidates) {\n if (a.id === surviving.id) continue;\n if (distance(a, surviving) <= tolerance) {\n removed.push(a.id);\n }\n }\n\n if (removed.length === 0) return null;\n\n const removedSet = new Set(removed);\n const rewired: number[] = [];\n\n for (const edge of edges) {\n let changed = false;\n if (removedSet.has(edge.fromAnchorId)) {\n edge.fromAnchorId = surviving.id;\n changed = true;\n }\n if (removedSet.has(edge.toAnchorId)) {\n edge.toAnchorId = surviving.id;\n changed = true;\n }\n // Drop self-loops\n if (edge.fromAnchorId === edge.toAnchorId) {\n rewired.push(edge.id);\n continue;\n }\n if (changed) rewired.push(edge.id);\n }\n\n return {\n survivingAnchorId: surviving.id,\n removedAnchorIds: removed,\n rewiredEdgeIds: rewired,\n };\n}\n\n/**\n * Find all pairs of anchors within tolerance that should be welded.\n */\nexport function findWeldCandidates(\n anchors: AnchorLike[],\n tolerance = DEFAULT_WELD_TOLERANCE,\n): number[][] {\n const groups: number[][] = [];\n const used = new Set<number>();\n\n for (let i = 0; i < anchors.length; i++) {\n if (used.has(anchors[i].id)) continue;\n const group = [anchors[i].id];\n for (let j = i + 1; j < anchors.length; j++) {\n if (used.has(anchors[j].id)) continue;\n if (\n anchors[i].levelId === anchors[j].levelId &&\n distance(anchors[i], anchors[j]) <= tolerance\n ) {\n group.push(anchors[j].id);\n used.add(anchors[j].id);\n }\n }\n if (group.length > 1) {\n used.add(anchors[i].id);\n groups.push(group);\n }\n }\n return groups;\n}\n\n/**\n * Merge coincident anchors and drop overlapping undirected edges.\n * Two SVG imports of the same ROUTES layer stack a second copy on top of\n * the first — dragging one junction then leaves the twin behind.\n */\nexport function collapseDuplicateRouteGraph<\n A extends AnchorLike,\n E extends EdgeLike,\n>(\n anchors: A[],\n edges: E[],\n tolerance = DEFAULT_WELD_TOLERANCE,\n): { anchors: A[]; edges: E[] } {\n const nextAnchors = anchors.slice();\n const nextEdges = edges.map((edge) => ({ ...edge }));\n const removed = new Set<number>();\n for (const group of findWeldCandidates(nextAnchors, tolerance)) {\n const result = weldAnchors(nextAnchors, nextEdges, group, tolerance);\n if (!result) continue;\n for (const id of result.removedAnchorIds) removed.add(id);\n }\n const alive = nextAnchors.filter((anchor) => !removed.has(anchor.id));\n const seen = new Set<string>();\n const uniqueEdges: E[] = [];\n for (const edge of nextEdges) {\n if (removed.has(edge.fromAnchorId) || removed.has(edge.toAnchorId)) continue;\n if (edge.fromAnchorId === edge.toAnchorId) continue;\n const lo = Math.min(edge.fromAnchorId, edge.toAnchorId);\n const hi = Math.max(edge.fromAnchorId, edge.toAnchorId);\n const key = `${lo}|${hi}`;\n if (seen.has(key)) continue;\n seen.add(key);\n uniqueEdges.push(edge);\n }\n return { anchors: alive, edges: uniqueEdges };\n}\n\n/**\n * Auto-connect a unit anchor to the nearest walkable segment via perpendicular projection.\n */\nexport function autoConnectUnitAnchor(\n unitAnchor: AnchorLike,\n walkablePolylines: Vec2[][],\n existingJunctions: AnchorLike[],\n weldTolerance = DEFAULT_WELD_TOLERANCE,\n): AutoConnectResult | null {\n let best: { point: Vec2; distance: number } | null = null;\n\n for (const line of walkablePolylines) {\n const hit = nearestPointOnPolyline(unitAnchor, line);\n if (hit && (!best || hit.distance < best.distance)) {\n best = { point: hit.point, distance: hit.distance };\n }\n }\n\n if (!best) return null;\n\n // Reuse existing junction if within weld tolerance\n const existing = existingJunctions.find(\n (j) =>\n j.levelId === unitAnchor.levelId &&\n distance(j, best!.point) <= weldTolerance,\n );\n\n return {\n unitAnchorId: unitAnchor.id,\n junctionAnchor: existing\n ? { x: existing.x, y: existing.y, existingId: existing.id }\n : { x: best.point.x, y: best.point.y },\n edge: {\n fromAnchorId: unitAnchor.id,\n toAnchorId: existing?.id,\n },\n };\n}\n\n/**\n * Place a unit anchor at the centroid of a shape's polygons, if the point lies inside.\n */\nexport function unitAnchorFromShape(\n shapeId: number,\n levelId: number,\n polygons: Vec2[][],\n tempId: number,\n): CmAnchor | null {\n if (polygons.length === 0) return null;\n const flat = polygons.flat();\n if (flat.length === 0) return null;\n\n let sx = 0;\n let sy = 0;\n for (const p of flat) {\n sx += p.x;\n sy += p.y;\n }\n const c = { x: sx / flat.length, y: sy / flat.length };\n\n // Prefer centroid if inside; otherwise use first polygon's average of extremes\n const point = pointInPolygons(c, polygons) ? c : flat[0];\n\n return {\n id: tempId,\n levelId,\n shapeId,\n kind: 'unit',\n x: point.x,\n y: point.y,\n connectorId: null,\n };\n}\n\n/**\n * Build a simple medial-axis-ish skeleton from walkable polygons minus voids.\n * This is a pragmatic approximation: sample a grid inside walkable, reject void cells,\n * connect adjacent free cells into a sparse graph, then prune to a polyline network.\n */\nexport function buildAutoSkeleton(\n walkablePolygons: Vec2[][],\n voidPolygons: Vec2[][],\n cellSize = 20,\n): SkeletonSuggestion {\n if (walkablePolygons.length === 0) {\n return { anchors: [], edges: [] };\n }\n\n let minX = Infinity;\n let minY = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n for (const poly of walkablePolygons) {\n for (const p of poly) {\n minX = Math.min(minX, p.x);\n minY = Math.min(minY, p.y);\n maxX = Math.max(maxX, p.x);\n maxY = Math.max(maxY, p.y);\n }\n }\n\n const cols = Math.max(1, Math.ceil((maxX - minX) / cellSize));\n const rows = Math.max(1, Math.ceil((maxY - minY) / cellSize));\n const free: Array<{ key: string; x: number; y: number; col: number; row: number }> = [];\n\n for (let row = 0; row < rows; row++) {\n for (let col = 0; col < cols; col++) {\n const x = minX + (col + 0.5) * cellSize;\n const y = minY + (row + 0.5) * cellSize;\n const pt = { x, y };\n if (!pointInPolygons(pt, walkablePolygons)) continue;\n if (voidPolygons.length > 0 && pointInPolygons(pt, voidPolygons)) continue;\n free.push({ key: `${col},${row}`, x, y, col, row });\n }\n }\n\n const byKey = new Map(free.map((c) => [c.key, c]));\n const anchors = free.map((c) => ({\n tempId: c.key,\n x: c.x,\n y: c.y,\n kind: 'junction' as const,\n }));\n\n const edges: Array<{ fromTempId: string; toTempId: string }> = [];\n const seen = new Set<string>();\n\n for (const cell of free) {\n const neighbors = [\n [cell.col + 1, cell.row],\n [cell.col, cell.row + 1],\n ];\n for (const [nc, nr] of neighbors) {\n const nk = `${nc},${nr}`;\n if (!byKey.has(nk)) continue;\n const edgeKey = cell.key < nk ? `${cell.key}|${nk}` : `${nk}|${cell.key}`;\n if (seen.has(edgeKey)) continue;\n seen.add(edgeKey);\n edges.push({ fromTempId: cell.key, toTempId: nk });\n }\n }\n\n return { anchors, edges };\n}\n\n/**\n * Convert ROUTES-group SVG line endpoints into welded anchors + edges.\n * This is the key converter step that repairs coincident-but-disconnected joins.\n *\n * Anchors land in raw SVG user space (Y down), the same space as shape\n * geometry. There is intentionally no viewbox-height flip here — mirroring\n * routes without mirroring shapes would silently desynchronise the two.\n */\nexport function importRoutePaths(\n pathDs: string[],\n levelId: number,\n mapId: number,\n startId: number,\n weldTolerance = DEFAULT_WELD_TOLERANCE,\n): { anchors: CmAnchor[]; edges: CmRouteEdge[]; nextId: number } {\n const anchors: CmAnchor[] = [];\n const edges: CmRouteEdge[] = [];\n let nextId = startId;\n\n const findOrCreate = (x: number, y: number): number => {\n const existing = anchors.find(\n (a) => distance(a, { x, y }) <= weldTolerance,\n );\n if (existing) return existing.id;\n const id = nextId++;\n anchors.push({\n id,\n levelId,\n shapeId: null,\n kind: 'junction',\n x,\n y,\n connectorId: null,\n });\n return id;\n };\n\n for (const d of pathDs) {\n const polys = pathToPolygons(d);\n for (const poly of polys) {\n for (let i = 0; i < poly.length - 1; i++) {\n const a = findOrCreate(poly[i].x, poly[i].y);\n const b = findOrCreate(poly[i + 1].x, poly[i + 1].y);\n if (a === b) continue;\n // Avoid duplicate edges\n const dup = edges.some(\n (e) =>\n (e.fromAnchorId === a && e.toAnchorId === b) ||\n (e.fromAnchorId === b && e.toAnchorId === a),\n );\n if (dup) continue;\n edges.push({\n id: nextId++,\n mapId,\n fromAnchorId: a,\n toAnchorId: b,\n weight: null,\n directed: false,\n accessible: true,\n kind: 'walk',\n });\n }\n }\n }\n\n const collapsed = collapseDuplicateRouteGraph(anchors, edges, weldTolerance);\n return { anchors: collapsed.anchors, edges: collapsed.edges, nextId };\n}\n\nexport function routeAnchorKindForShape(kind: ShapeKind): AnchorKind {\n if (kind === 'entrance') return 'entrance';\n if (kind === 'connector') return 'connector';\n return 'unit';\n}\n\nfunction routeLinkKind(kind: AnchorKind): CmRouteEdge['kind'] {\n return kind === 'entrance' ? 'entrance_link' : 'unit_link';\n}\n\n/** `inside` matches v1's store-mesh hit; `near` is a door-step fallback. */\nfunction pointOnPolygons(\n point: Vec2,\n polygons: Vec2[][],\n tolerance: number,\n): 'inside' | 'near' | null {\n if (pointInPolygons(point, polygons)) return 'inside';\n for (const poly of polygons) {\n if (poly.length < 2) continue;\n const closed = [...poly, poly[0]];\n const hit = nearestPointOnPolyline(point, closed);\n if (hit && hit.distance <= tolerance) return 'near';\n }\n return null;\n}\n\nexport interface AttachableImportShape {\n id: number;\n kind: ShapeKind;\n geometry: Pick<ShapeGeometry, 'polygons'>;\n}\n\nfunction shapeUnderImportedAnchor(\n point: Vec2,\n shapes: AttachableImportShape[],\n insideTolerance: number,\n): AttachableImportShape | null {\n let near: AttachableImportShape | null = null;\n for (const shape of shapes) {\n if (!INTERACTIVE_SHAPE_KINDS.includes(shape.kind)) continue;\n const polys = shape.geometry.polygons ?? [];\n if (polys.length === 0) continue;\n const hit = pointOnPolygons(point, polys, insideTolerance);\n if (hit === 'inside') return shape;\n if (hit === 'near' && near == null) near = shape;\n }\n return near;\n}\n\n/**\n * Check every imported route vertex. If it falls inside (or on) a store /\n * amenity / kiosk / connector, it becomes that shape's orange destination.\n * A shape may own any number of those points so pathfinding can leave from\n * the nearest door. Corridor through-points keep `walk` edges; leaf stubs\n * become `unit_link`.\n */\nexport function attachImportedRouteAnchors(\n anchors: CmAnchor[],\n edges: CmRouteEdge[],\n shapes: AttachableImportShape[],\n insideTolerance = DEFAULT_WELD_TOLERANCE * 3,\n): number {\n const degree = new Map<number, number>();\n for (const edge of edges) {\n degree.set(edge.fromAnchorId, (degree.get(edge.fromAnchorId) ?? 0) + 1);\n degree.set(edge.toAnchorId, (degree.get(edge.toAnchorId) ?? 0) + 1);\n }\n\n let attached = 0;\n for (const anchor of anchors) {\n if (anchor.shapeId != null) continue;\n const shape = shapeUnderImportedAnchor(anchor, shapes, insideTolerance);\n if (!shape) continue;\n anchor.shapeId = shape.id;\n anchor.kind = routeAnchorKindForShape(shape.kind);\n attached += 1;\n if ((degree.get(anchor.id) ?? 0) > 1) continue;\n const linkKind = routeLinkKind(anchor.kind);\n for (const edge of edges) {\n if (edge.fromAnchorId === anchor.id || edge.toAnchorId === anchor.id) {\n edge.kind = linkKind;\n }\n }\n }\n\n return attached;\n}\n","/**\n * Wheel / trackpad zoom curve for every map surface.\n *\n * PORTAL default MapViewer uses drei → three-stdlib OrbitControls, whose\n * `getZoomScale()` is `Math.pow(0.95, zoomSpeed)` **per wheel event** (not\n * scaled by `deltaY`). Edit Map / Wayfinding must use the same step or they\n * feel slower than the assign map.\n *\n * Scroll up zooms in; the caller keeps the pointer over the same map point\n * (`panAfterZoom` on the SVG canvas, `zoomToCursor` on OrbitControls).\n */\n\n/** three-stdlib OrbitControls `Math.pow(0.95, zoomSpeed)` base. */\nexport const WHEEL_ZOOM_BASE = 0.95;\n/** drei / three-stdlib default `zoomSpeed`. */\nexport const WHEEL_ZOOM_SPEED = 1;\n\n/**\n * OrbitControls dolly scale for one wheel event: `0.95 ** zoomSpeed`.\n * Sign of `deltaY` is ignored here; `nextZoomFromWheel` applies in vs out.\n */\nexport function wheelDollyScale(zoomSpeed = WHEEL_ZOOM_SPEED): number {\n return Math.pow(WHEEL_ZOOM_BASE, zoomSpeed);\n}\n\n/**\n * Next SVG / orthographic zoom from a wheel event.\n * `deltaY < 0` zooms in. Pan separately so the cursor stays on the same point.\n */\nexport function nextZoomFromWheel(\n currentZoom: number,\n deltaY: number,\n options?: {\n zoomSpeed?: number;\n min?: number;\n max?: number;\n },\n): number {\n if (deltaY === 0) return currentZoom;\n const scale = wheelDollyScale(options?.zoomSpeed ?? WHEEL_ZOOM_SPEED);\n const next = deltaY < 0 ? currentZoom / scale : currentZoom * scale;\n const min = options?.min ?? Number.NEGATIVE_INFINITY;\n const max = options?.max ?? Number.POSITIVE_INFINITY;\n return Math.min(max, Math.max(min, next));\n}\n"],"names":["outdoorDecorationFromSvg","svgText","suppressIds","theme","parsed","parseSvgString","out","el","isRoutePathLabel","isRouteFolderLabel","isInteractiveGroupLabel","isStoreFolderLabel","layer","resolveLayerStyle","fill","isAmenityLayerId","amenityHouseFill","_a","stroke","_b","strokeWidth","_c","_d","sortByOutdoorSvgPaintOrder","item","weldAnchors","anchors","edges","candidateIds","tolerance","DEFAULT_WELD_TOLERANCE","candidates","a","surviving","min","removed","distance","removedSet","rewired","edge","changed","findWeldCandidates","groups","used","i","group","j","collapseDuplicateRouteGraph","nextAnchors","nextEdges","result","id","alive","anchor","seen","uniqueEdges","lo","hi","key","autoConnectUnitAnchor","unitAnchor","walkablePolylines","existingJunctions","weldTolerance","best","line","hit","nearestPointOnPolyline","existing","unitAnchorFromShape","shapeId","levelId","polygons","tempId","flat","sx","sy","p","c","point","pointInPolygons","buildAutoSkeleton","walkablePolygons","voidPolygons","cellSize","minX","minY","maxX","maxY","poly","cols","rows","free","row","col","x","y","pt","byKey","cell","neighbors","nc","nr","nk","edgeKey","importRoutePaths","pathDs","mapId","startId","nextId","findOrCreate","d","polys","pathToPolygons","b","e","collapsed","routeAnchorKindForShape","kind","routeLinkKind","pointOnPolygons","closed","shapeUnderImportedAnchor","shapes","insideTolerance","near","shape","INTERACTIVE_SHAPE_KINDS","attachImportedRouteAnchors","degree","attached","linkKind","WHEEL_ZOOM_BASE","WHEEL_ZOOM_SPEED","wheelDollyScale","zoomSpeed","nextZoomFromWheel","currentZoom","deltaY","options","scale","next","max"],"mappings":";AA6BO,SAASA,EACdC,GACAC,GACAC,GACyB;;AACzB,QAAMC,IAASC,EAAeJ,CAAO,GAC/BK,IAA+B,CAAA;AACrC,aAAWC,KAAMH,EAAO,UAAU;AAOhC,QANI,CAACG,EAAG,KACJA,EAAG,eACHL,KAAA,QAAAA,EAAa,IAAIK,EAAG,OACpB,iCAAiC,KAAKA,EAAG,EAAE,KAC3CA,EAAG,GAAG,YAAA,EAAc,WAAW,YAAY,KAC3CC,EAAiBD,EAAG,EAAE,KAAKE,EAAmBF,EAA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BAAAA,EAAS,QAAO,OAAO;AACnC,SAAO,KAAK,IAAIG,GAAK,KAAK,IAAI5G,GAAK2G,CAAI,CAAC;AAC1C;"}
|
|
1
|
+
{"version":3,"file":"wheelZoom.js","sources":["../../src/core/outdoorDecoration.ts","../../src/core/routing/graph-tools.ts","../../src/core/wheelZoom.ts"],"sourcesContent":["import {\n parseSvgString,\n isInteractiveGroupLabel,\n isRouteFolderLabel,\n isRoutePathLabel,\n isStoreFolderLabel,\n} from './import';\nimport { amenityHouseFill, isAmenityLayerId } from './shapeFill';\nimport {\n resolveLayerStyle,\n sortByOutdoorSvgPaintOrder,\n type StaticLayerTheme,\n} from './layerStyles';\n\nexport interface OutdoorDecorationPath {\n id: string;\n d: string;\n fill?: string;\n stroke?: string;\n strokeWidth?: number;\n opacity?: number;\n}\n\n/**\n * Paths the assign viewer draws from the live outdoor SVG: house-style\n * decoration (green area, parking lanes, icons) and any other\n * non-interactive art. Interactive / store folders stay out — those are\n * `cm_shapes` rows. The BACKGROUND group is Google Map artwork: omit it\n * unless `includeBackground` is set.\n */\nexport function outdoorDecorationFromSvg(\n svgText: string,\n suppressIds?: ReadonlySet<string>,\n theme?: StaticLayerTheme | null,\n includeBackground = false,\n): OutdoorDecorationPath[] {\n const parsed = parseSvgString(svgText);\n const out: OutdoorDecorationPath[] = [];\n for (const el of parsed.elements) {\n if (!el.d) continue;\n if (el.interactive) continue;\n if (el.inBackground && !includeBackground) continue;\n if (suppressIds?.has(el.id)) continue;\n if (/^parking[-_]?lines?(?:[-_]|$)/i.test(el.id)) continue;\n if (el.id.toLowerCase().startsWith('route-path')) continue;\n if (isRoutePathLabel(el.id) || isRouteFolderLabel(el.id)) continue;\n if (isInteractiveGroupLabel(el.id) || isStoreFolderLabel(el.id)) continue;\n\n const layer = resolveLayerStyle(el.id, theme);\n const fill =\n layer?.fill ??\n (isAmenityLayerId(el.id) ? amenityHouseFill(theme) : el.style?.fill);\n const stroke = layer?.stroke ?? el.style?.stroke;\n const strokeWidth = layer?.strokeWidth ?? el.style?.strokeWidth;\n out.push({\n id: el.id,\n d: el.d,\n fill: fill && fill !== 'none' ? fill : undefined,\n stroke: stroke && stroke !== 'none' ? stroke : undefined,\n strokeWidth,\n opacity: el.style?.opacity,\n });\n }\n // Parking lanes move under green areas. Later special shapes stay on top.\n return sortByOutdoorSvgPaintOrder(out, (item) => item.id);\n}\n","import type {\n AnchorKind,\n AutoConnectResult,\n CmAnchor,\n CmRouteEdge,\n ShapeGeometry,\n ShapeKind,\n SkeletonSuggestion,\n Vec2,\n WeldResult,\n} from '../types';\nimport { DEFAULT_WELD_TOLERANCE, INTERACTIVE_SHAPE_KINDS } from '../types';\nimport {\n distance,\n nearestPointOnPolyline,\n pathToPolygons,\n pointInPolygons,\n} from '../geometry';\n\nexport interface AnchorLike {\n id: number;\n x: number;\n y: number;\n levelId: number;\n shapeId?: number | null;\n kind?: string;\n}\n\nexport interface EdgeLike {\n id: number;\n fromAnchorId: number;\n toAnchorId: number;\n}\n\n/**\n * Weld anchors within tolerance into the surviving (lowest id) anchor.\n * Rewires edges that referenced removed anchors.\n */\nexport function weldAnchors(\n anchors: AnchorLike[],\n edges: EdgeLike[],\n candidateIds: number[],\n tolerance = DEFAULT_WELD_TOLERANCE,\n): WeldResult | null {\n const candidates = anchors.filter((a) => candidateIds.includes(a.id));\n if (candidates.length < 2) return null;\n\n // Cluster by proximity from the first candidate's position centroid of group\n const surviving = candidates.reduce((min, a) => (a.id < min.id ? a : min));\n const removed: number[] = [];\n\n for (const a of candidates) {\n if (a.id === surviving.id) continue;\n if (distance(a, surviving) <= tolerance) {\n removed.push(a.id);\n }\n }\n\n if (removed.length === 0) return null;\n\n const removedSet = new Set(removed);\n const rewired: number[] = [];\n\n for (const edge of edges) {\n let changed = false;\n if (removedSet.has(edge.fromAnchorId)) {\n edge.fromAnchorId = surviving.id;\n changed = true;\n }\n if (removedSet.has(edge.toAnchorId)) {\n edge.toAnchorId = surviving.id;\n changed = true;\n }\n // Drop self-loops\n if (edge.fromAnchorId === edge.toAnchorId) {\n rewired.push(edge.id);\n continue;\n }\n if (changed) rewired.push(edge.id);\n }\n\n return {\n survivingAnchorId: surviving.id,\n removedAnchorIds: removed,\n rewiredEdgeIds: rewired,\n };\n}\n\n/**\n * Find all pairs of anchors within tolerance that should be welded.\n */\nexport function findWeldCandidates(\n anchors: AnchorLike[],\n tolerance = DEFAULT_WELD_TOLERANCE,\n): number[][] {\n const groups: number[][] = [];\n const used = new Set<number>();\n\n for (let i = 0; i < anchors.length; i++) {\n if (used.has(anchors[i].id)) continue;\n const group = [anchors[i].id];\n for (let j = i + 1; j < anchors.length; j++) {\n if (used.has(anchors[j].id)) continue;\n if (\n anchors[i].levelId === anchors[j].levelId &&\n distance(anchors[i], anchors[j]) <= tolerance\n ) {\n group.push(anchors[j].id);\n used.add(anchors[j].id);\n }\n }\n if (group.length > 1) {\n used.add(anchors[i].id);\n groups.push(group);\n }\n }\n return groups;\n}\n\n/**\n * Merge coincident anchors and drop overlapping undirected edges.\n * Two SVG imports of the same ROUTES layer stack a second copy on top of\n * the first — dragging one junction then leaves the twin behind.\n */\nexport function collapseDuplicateRouteGraph<\n A extends AnchorLike,\n E extends EdgeLike,\n>(\n anchors: A[],\n edges: E[],\n tolerance = DEFAULT_WELD_TOLERANCE,\n): { anchors: A[]; edges: E[] } {\n const nextAnchors = anchors.slice();\n const nextEdges = edges.map((edge) => ({ ...edge }));\n const removed = new Set<number>();\n for (const group of findWeldCandidates(nextAnchors, tolerance)) {\n const result = weldAnchors(nextAnchors, nextEdges, group, tolerance);\n if (!result) continue;\n for (const id of result.removedAnchorIds) removed.add(id);\n }\n const alive = nextAnchors.filter((anchor) => !removed.has(anchor.id));\n const seen = new Set<string>();\n const uniqueEdges: E[] = [];\n for (const edge of nextEdges) {\n if (removed.has(edge.fromAnchorId) || removed.has(edge.toAnchorId)) continue;\n if (edge.fromAnchorId === edge.toAnchorId) continue;\n const lo = Math.min(edge.fromAnchorId, edge.toAnchorId);\n const hi = Math.max(edge.fromAnchorId, edge.toAnchorId);\n const key = `${lo}|${hi}`;\n if (seen.has(key)) continue;\n seen.add(key);\n uniqueEdges.push(edge);\n }\n return { anchors: alive, edges: uniqueEdges };\n}\n\n/**\n * Auto-connect a unit anchor to the nearest walkable segment via perpendicular projection.\n */\nexport function autoConnectUnitAnchor(\n unitAnchor: AnchorLike,\n walkablePolylines: Vec2[][],\n existingJunctions: AnchorLike[],\n weldTolerance = DEFAULT_WELD_TOLERANCE,\n): AutoConnectResult | null {\n let best: { point: Vec2; distance: number } | null = null;\n\n for (const line of walkablePolylines) {\n const hit = nearestPointOnPolyline(unitAnchor, line);\n if (hit && (!best || hit.distance < best.distance)) {\n best = { point: hit.point, distance: hit.distance };\n }\n }\n\n if (!best) return null;\n\n // Reuse existing junction if within weld tolerance\n const existing = existingJunctions.find(\n (j) =>\n j.levelId === unitAnchor.levelId &&\n distance(j, best!.point) <= weldTolerance,\n );\n\n return {\n unitAnchorId: unitAnchor.id,\n junctionAnchor: existing\n ? { x: existing.x, y: existing.y, existingId: existing.id }\n : { x: best.point.x, y: best.point.y },\n edge: {\n fromAnchorId: unitAnchor.id,\n toAnchorId: existing?.id,\n },\n };\n}\n\n/**\n * Place a unit anchor at the centroid of a shape's polygons, if the point lies inside.\n */\nexport function unitAnchorFromShape(\n shapeId: number,\n levelId: number,\n polygons: Vec2[][],\n tempId: number,\n): CmAnchor | null {\n if (polygons.length === 0) return null;\n const flat = polygons.flat();\n if (flat.length === 0) return null;\n\n let sx = 0;\n let sy = 0;\n for (const p of flat) {\n sx += p.x;\n sy += p.y;\n }\n const c = { x: sx / flat.length, y: sy / flat.length };\n\n // Prefer centroid if inside; otherwise use first polygon's average of extremes\n const point = pointInPolygons(c, polygons) ? c : flat[0];\n\n return {\n id: tempId,\n levelId,\n shapeId,\n kind: 'unit',\n x: point.x,\n y: point.y,\n connectorId: null,\n };\n}\n\n/**\n * Build a simple medial-axis-ish skeleton from walkable polygons minus voids.\n * This is a pragmatic approximation: sample a grid inside walkable, reject void cells,\n * connect adjacent free cells into a sparse graph, then prune to a polyline network.\n */\nexport function buildAutoSkeleton(\n walkablePolygons: Vec2[][],\n voidPolygons: Vec2[][],\n cellSize = 20,\n): SkeletonSuggestion {\n if (walkablePolygons.length === 0) {\n return { anchors: [], edges: [] };\n }\n\n let minX = Infinity;\n let minY = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n for (const poly of walkablePolygons) {\n for (const p of poly) {\n minX = Math.min(minX, p.x);\n minY = Math.min(minY, p.y);\n maxX = Math.max(maxX, p.x);\n maxY = Math.max(maxY, p.y);\n }\n }\n\n const cols = Math.max(1, Math.ceil((maxX - minX) / cellSize));\n const rows = Math.max(1, Math.ceil((maxY - minY) / cellSize));\n const free: Array<{ key: string; x: number; y: number; col: number; row: number }> = [];\n\n for (let row = 0; row < rows; row++) {\n for (let col = 0; col < cols; col++) {\n const x = minX + (col + 0.5) * cellSize;\n const y = minY + (row + 0.5) * cellSize;\n const pt = { x, y };\n if (!pointInPolygons(pt, walkablePolygons)) continue;\n if (voidPolygons.length > 0 && pointInPolygons(pt, voidPolygons)) continue;\n free.push({ key: `${col},${row}`, x, y, col, row });\n }\n }\n\n const byKey = new Map(free.map((c) => [c.key, c]));\n const anchors = free.map((c) => ({\n tempId: c.key,\n x: c.x,\n y: c.y,\n kind: 'junction' as const,\n }));\n\n const edges: Array<{ fromTempId: string; toTempId: string }> = [];\n const seen = new Set<string>();\n\n for (const cell of free) {\n const neighbors = [\n [cell.col + 1, cell.row],\n [cell.col, cell.row + 1],\n ];\n for (const [nc, nr] of neighbors) {\n const nk = `${nc},${nr}`;\n if (!byKey.has(nk)) continue;\n const edgeKey = cell.key < nk ? `${cell.key}|${nk}` : `${nk}|${cell.key}`;\n if (seen.has(edgeKey)) continue;\n seen.add(edgeKey);\n edges.push({ fromTempId: cell.key, toTempId: nk });\n }\n }\n\n return { anchors, edges };\n}\n\n/**\n * Convert ROUTES-group SVG line endpoints into welded anchors + edges.\n * This is the key converter step that repairs coincident-but-disconnected joins.\n *\n * Anchors land in raw SVG user space (Y down), the same space as shape\n * geometry. There is intentionally no viewbox-height flip here — mirroring\n * routes without mirroring shapes would silently desynchronise the two.\n */\nexport function importRoutePaths(\n pathDs: string[],\n levelId: number,\n mapId: number,\n startId: number,\n weldTolerance = DEFAULT_WELD_TOLERANCE,\n): { anchors: CmAnchor[]; edges: CmRouteEdge[]; nextId: number } {\n const anchors: CmAnchor[] = [];\n const edges: CmRouteEdge[] = [];\n let nextId = startId;\n\n const findOrCreate = (x: number, y: number): number => {\n const existing = anchors.find(\n (a) => distance(a, { x, y }) <= weldTolerance,\n );\n if (existing) return existing.id;\n const id = nextId++;\n anchors.push({\n id,\n levelId,\n shapeId: null,\n kind: 'junction',\n x,\n y,\n connectorId: null,\n });\n return id;\n };\n\n for (const d of pathDs) {\n const polys = pathToPolygons(d);\n for (const poly of polys) {\n for (let i = 0; i < poly.length - 1; i++) {\n const a = findOrCreate(poly[i].x, poly[i].y);\n const b = findOrCreate(poly[i + 1].x, poly[i + 1].y);\n if (a === b) continue;\n // Avoid duplicate edges\n const dup = edges.some(\n (e) =>\n (e.fromAnchorId === a && e.toAnchorId === b) ||\n (e.fromAnchorId === b && e.toAnchorId === a),\n );\n if (dup) continue;\n edges.push({\n id: nextId++,\n mapId,\n fromAnchorId: a,\n toAnchorId: b,\n weight: null,\n directed: false,\n accessible: true,\n kind: 'walk',\n });\n }\n }\n }\n\n const collapsed = collapseDuplicateRouteGraph(anchors, edges, weldTolerance);\n return { anchors: collapsed.anchors, edges: collapsed.edges, nextId };\n}\n\nexport function routeAnchorKindForShape(kind: ShapeKind): AnchorKind {\n if (kind === 'entrance') return 'entrance';\n if (kind === 'connector') return 'connector';\n return 'unit';\n}\n\nfunction routeLinkKind(kind: AnchorKind): CmRouteEdge['kind'] {\n return kind === 'entrance' ? 'entrance_link' : 'unit_link';\n}\n\n/** `inside` matches v1's store-mesh hit; `near` is a door-step fallback. */\nfunction pointOnPolygons(\n point: Vec2,\n polygons: Vec2[][],\n tolerance: number,\n): 'inside' | 'near' | null {\n if (pointInPolygons(point, polygons)) return 'inside';\n for (const poly of polygons) {\n if (poly.length < 2) continue;\n const closed = [...poly, poly[0]];\n const hit = nearestPointOnPolyline(point, closed);\n if (hit && hit.distance <= tolerance) return 'near';\n }\n return null;\n}\n\nexport interface AttachableImportShape {\n id: number;\n kind: ShapeKind;\n geometry: Pick<ShapeGeometry, 'polygons'>;\n}\n\nfunction shapeUnderImportedAnchor(\n point: Vec2,\n shapes: AttachableImportShape[],\n insideTolerance: number,\n): AttachableImportShape | null {\n let near: AttachableImportShape | null = null;\n for (const shape of shapes) {\n if (!INTERACTIVE_SHAPE_KINDS.includes(shape.kind)) continue;\n const polys = shape.geometry.polygons ?? [];\n if (polys.length === 0) continue;\n const hit = pointOnPolygons(point, polys, insideTolerance);\n if (hit === 'inside') return shape;\n if (hit === 'near' && near == null) near = shape;\n }\n return near;\n}\n\n/**\n * Check every imported route vertex. If it falls inside (or on) a store /\n * amenity / kiosk / connector, it becomes that shape's orange destination.\n * A shape may own any number of those points so pathfinding can leave from\n * the nearest door. Corridor through-points keep `walk` edges; leaf stubs\n * become `unit_link`.\n */\nexport function attachImportedRouteAnchors(\n anchors: CmAnchor[],\n edges: CmRouteEdge[],\n shapes: AttachableImportShape[],\n insideTolerance = DEFAULT_WELD_TOLERANCE * 3,\n): number {\n const degree = new Map<number, number>();\n for (const edge of edges) {\n degree.set(edge.fromAnchorId, (degree.get(edge.fromAnchorId) ?? 0) + 1);\n degree.set(edge.toAnchorId, (degree.get(edge.toAnchorId) ?? 0) + 1);\n }\n\n let attached = 0;\n for (const anchor of anchors) {\n if (anchor.shapeId != null) continue;\n const shape = shapeUnderImportedAnchor(anchor, shapes, insideTolerance);\n if (!shape) continue;\n anchor.shapeId = shape.id;\n anchor.kind = routeAnchorKindForShape(shape.kind);\n attached += 1;\n if ((degree.get(anchor.id) ?? 0) > 1) continue;\n const linkKind = routeLinkKind(anchor.kind);\n for (const edge of edges) {\n if (edge.fromAnchorId === anchor.id || edge.toAnchorId === anchor.id) {\n edge.kind = linkKind;\n }\n }\n }\n\n return attached;\n}\n","/**\n * Wheel / trackpad zoom curve for every map surface.\n *\n * PORTAL default MapViewer uses drei → three-stdlib OrbitControls, whose\n * `getZoomScale()` is `Math.pow(0.95, zoomSpeed)` **per wheel event** (not\n * scaled by `deltaY`). Edit Map / Wayfinding must use the same step or they\n * feel slower than the assign map.\n *\n * Scroll up zooms in; the caller keeps the pointer over the same map point\n * (`panAfterZoom` on the SVG canvas, `zoomToCursor` on OrbitControls).\n */\n\n/** three-stdlib OrbitControls `Math.pow(0.95, zoomSpeed)` base. */\nexport const WHEEL_ZOOM_BASE = 0.95;\n/** drei / three-stdlib default `zoomSpeed`. */\nexport const WHEEL_ZOOM_SPEED = 1;\n\n/**\n * OrbitControls dolly scale for one wheel event: `0.95 ** zoomSpeed`.\n * Sign of `deltaY` is ignored here; `nextZoomFromWheel` applies in vs out.\n */\nexport function wheelDollyScale(zoomSpeed = WHEEL_ZOOM_SPEED): number {\n return Math.pow(WHEEL_ZOOM_BASE, zoomSpeed);\n}\n\n/**\n * Next SVG / orthographic zoom from a wheel event.\n * `deltaY < 0` zooms in. Pan separately so the cursor stays on the same point.\n */\nexport function nextZoomFromWheel(\n currentZoom: number,\n deltaY: number,\n options?: {\n zoomSpeed?: number;\n min?: number;\n max?: number;\n },\n): number {\n if (deltaY === 0) return currentZoom;\n const scale = wheelDollyScale(options?.zoomSpeed ?? WHEEL_ZOOM_SPEED);\n const next = deltaY < 0 ? currentZoom / scale : currentZoom * scale;\n const min = options?.min ?? Number.NEGATIVE_INFINITY;\n const max = options?.max ?? Number.POSITIVE_INFINITY;\n return Math.min(max, Math.max(min, next));\n}\n"],"names":["outdoorDecorationFromSvg","svgText","suppressIds","theme","includeBackground","parsed","parseSvgString","out","el","isRoutePathLabel","isRouteFolderLabel","isInteractiveGroupLabel","isStoreFolderLabel","layer","resolveLayerStyle","fill","isAmenityLayerId","amenityHouseFill","_a","stroke","_b","strokeWidth","_c","_d","sortByOutdoorSvgPaintOrder","item","weldAnchors","anchors","edges","candidateIds","tolerance","DEFAULT_WELD_TOLERANCE","candidates","a","surviving","min","removed","distance","removedSet","rewired","edge","changed","findWeldCandidates","groups","used","i","group","j","collapseDuplicateRouteGraph","nextAnchors","nextEdges","result","id","alive","anchor","seen","uniqueEdges","lo","hi","key","autoConnectUnitAnchor","unitAnchor","walkablePolylines","existingJunctions","weldTolerance","best","line","hit","nearestPointOnPolyline","existing","unitAnchorFromShape","shapeId","levelId","polygons","tempId","flat","sx","sy","p","c","point","pointInPolygons","buildAutoSkeleton","walkablePolygons","voidPolygons","cellSize","minX","minY","maxX","maxY","poly","cols","rows","free","row","col","x","y","pt","byKey","cell","neighbors","nc","nr","nk","edgeKey","importRoutePaths","pathDs","mapId","startId","nextId","findOrCreate","d","polys","pathToPolygons","b","e","collapsed","routeAnchorKindForShape","kind","routeLinkKind","pointOnPolygons","closed","shapeUnderImportedAnchor","shapes","insideTolerance","near","shape","INTERACTIVE_SHAPE_KINDS","attachImportedRouteAnchors","degree","attached","linkKind","WHEEL_ZOOM_BASE","WHEEL_ZOOM_SPEED","wheelDollyScale","zoomSpeed","nextZoomFromWheel","currentZoom","deltaY","options","scale","next","max"],"mappings":";AA8BO,SAASA,EACdC,GACAC,GACAC,GACAC,IAAoB,IACK;;AACzB,QAAMC,IAASC,EAAeL,CAAO,GAC/BM,IAA+B,CAAA;AACrC,aAAWC,KAAMH,EAAO,UAAU;AAQhC,QAPI,CAACG,EAAG,KACJA,EAAG,eACHA,EAAG,gBAAgB,CAACJ,KACpBF,KAAA,QAAAA,EAAa,IAAIM,EAAG,OACpB,iCAAiC,KAAKA,EAAG,EAAE,KAC3CA,EAAG,GAAG,YAAA,EAAc,WAAW,YAAY,KAC3CC,EAAiBD,EAAG,EAAE,KAAKE,EAAmBF,EAAG,EAAE,KACnDG,EAAwBH,EAAG,EAAE,KAAKI,E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AIG,GAAK,KAAK,IAAI5G,GAAK2G,CAAI,CAAC;AAC1C;"}
|
|
@@ -7,6 +7,11 @@ export declare function isRoutePathLabel(label: string): boolean;
|
|
|
7
7
|
* Child layer names are ignored — same idea as the INTERACTIVE group.
|
|
8
8
|
*/
|
|
9
9
|
export declare function isRouteFolderLabel(label: string): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Outdoor artwork drawn only when Settings background is Google Map.
|
|
12
|
+
* `BACKGROUND`, `BACKGROUND-2`, data-name="BACKGROUND".
|
|
13
|
+
*/
|
|
14
|
+
export declare function isBackgroundGroupLabel(label: string): boolean;
|
|
10
15
|
/**
|
|
11
16
|
* Geometry that becomes a walking-path edge. `<line>` / `<polyline>` always
|
|
12
17
|
* count; an open `<path>` of straight M/L/H/V commands counts as line
|
|
@@ -33,6 +38,8 @@ export interface RawSvgElement {
|
|
|
33
38
|
interactive?: boolean;
|
|
34
39
|
/** Resolved fill/stroke after group inheritance + CSS class inlining. */
|
|
35
40
|
style?: SvgPresentationStyle;
|
|
41
|
+
/** Inside an outdoor `BACKGROUND` group. Shown only with a Google Map background. */
|
|
42
|
+
inBackground?: boolean;
|
|
36
43
|
}
|
|
37
44
|
export interface ParsedSvg {
|
|
38
45
|
viewbox: ViewBox | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/import/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EAEJ,UAAU,EAEV,YAAY,EACZ,aAAa,EACb,SAAS,EACT,UAAU,EACV,OAAO,EACR,MAAM,UAAU,CAAC;AASlB,OAAO,EAIL,KAAK,oBAAoB,EAC1B,MAAM,YAAY,CAAC;AA6DpB,yEAAyE;AACzE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAGvD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED;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