@seed-ship/mcp-ui-solid 3.0.5 → 4.0.0
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/CHANGELOG.md +115 -0
- package/README.md +253 -280
- package/dist/components/ChartJSRenderer.cjs +37 -15
- package/dist/components/ChartJSRenderer.cjs.map +1 -1
- package/dist/components/ChartJSRenderer.d.ts.map +1 -1
- package/dist/components/ChartJSRenderer.js +37 -15
- package/dist/components/ChartJSRenderer.js.map +1 -1
- package/dist/components/DataPreviewSection.cjs +172 -0
- package/dist/components/DataPreviewSection.cjs.map +1 -0
- package/dist/components/DataPreviewSection.d.ts +19 -0
- package/dist/components/DataPreviewSection.d.ts.map +1 -0
- package/dist/components/DataPreviewSection.js +172 -0
- package/dist/components/DataPreviewSection.js.map +1 -0
- package/dist/components/MapRenderer.cjs +168 -26
- package/dist/components/MapRenderer.cjs.map +1 -1
- package/dist/components/MapRenderer.d.ts +2 -2
- package/dist/components/MapRenderer.d.ts.map +1 -1
- package/dist/components/MapRenderer.js +169 -27
- package/dist/components/MapRenderer.js.map +1 -1
- package/dist/components/ScratchpadPanel.cjs +74 -0
- package/dist/components/ScratchpadPanel.cjs.map +1 -1
- package/dist/components/ScratchpadPanel.d.ts.map +1 -1
- package/dist/components/ScratchpadPanel.js +75 -1
- package/dist/components/ScratchpadPanel.js.map +1 -1
- package/dist/components/VerifiedText.cjs +166 -0
- package/dist/components/VerifiedText.cjs.map +1 -0
- package/dist/components/VerifiedText.d.ts +22 -0
- package/dist/components/VerifiedText.d.ts.map +1 -0
- package/dist/components/VerifiedText.js +166 -0
- package/dist/components/VerifiedText.js.map +1 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components.cjs +4 -0
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.cts +4 -0
- package/dist/components.d.ts +4 -0
- package/dist/components.js +4 -0
- package/dist/components.js.map +1 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/useDataValidator.cjs +31 -0
- package/dist/hooks/useDataValidator.cjs.map +1 -0
- package/dist/hooks/useDataValidator.d.ts +42 -0
- package/dist/hooks/useDataValidator.d.ts.map +1 -0
- package/dist/hooks/useDataValidator.js +31 -0
- package/dist/hooks/useDataValidator.js.map +1 -0
- package/dist/hooks.cjs +2 -0
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.d.cts +2 -0
- package/dist/hooks.d.ts +2 -0
- package/dist/hooks.js +2 -0
- package/dist/hooks.js.map +1 -1
- package/dist/index.cjs +8 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -5
- package/dist/index.d.ts +9 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/node_modules/.pnpm/@mapbox_point-geometry@1.1.0/node_modules/@mapbox/point-geometry/index.cjs +290 -0
- package/dist/node_modules/.pnpm/@mapbox_point-geometry@1.1.0/node_modules/@mapbox/point-geometry/index.cjs.map +1 -0
- package/dist/node_modules/.pnpm/@mapbox_point-geometry@1.1.0/node_modules/@mapbox/point-geometry/index.js +291 -0
- package/dist/node_modules/.pnpm/@mapbox_point-geometry@1.1.0/node_modules/@mapbox/point-geometry/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@mapbox_vector-tile@2.0.4/node_modules/@mapbox/vector-tile/index.cjs +243 -0
- package/dist/node_modules/.pnpm/@mapbox_vector-tile@2.0.4/node_modules/@mapbox/vector-tile/index.cjs.map +1 -0
- package/dist/node_modules/.pnpm/@mapbox_vector-tile@2.0.4/node_modules/@mapbox/vector-tile/index.js +243 -0
- package/dist/node_modules/.pnpm/@mapbox_vector-tile@2.0.4/node_modules/@mapbox/vector-tile/index.js.map +1 -0
- package/dist/node_modules/.pnpm/color2k@2.0.3/node_modules/color2k/dist/index.exports.import.es.cjs +137 -0
- package/dist/node_modules/.pnpm/color2k@2.0.3/node_modules/color2k/dist/index.exports.import.es.cjs.map +1 -0
- package/dist/node_modules/.pnpm/color2k@2.0.3/node_modules/color2k/dist/index.exports.import.es.js +137 -0
- package/dist/node_modules/.pnpm/color2k@2.0.3/node_modules/color2k/dist/index.exports.import.es.js.map +1 -0
- package/dist/node_modules/.pnpm/pbf@4.0.1/node_modules/pbf/index.cjs +686 -0
- package/dist/node_modules/.pnpm/pbf@4.0.1/node_modules/pbf/index.cjs.map +1 -0
- package/dist/node_modules/.pnpm/pbf@4.0.1/node_modules/pbf/index.js +687 -0
- package/dist/node_modules/.pnpm/pbf@4.0.1/node_modules/pbf/index.js.map +1 -0
- package/dist/node_modules/.pnpm/pmtiles@3.2.1/node_modules/pmtiles/dist/index.cjs +1366 -0
- package/dist/node_modules/.pnpm/pmtiles@3.2.1/node_modules/pmtiles/dist/index.cjs.map +1 -0
- package/dist/node_modules/.pnpm/pmtiles@3.2.1/node_modules/pmtiles/dist/index.js +1366 -0
- package/dist/node_modules/.pnpm/pmtiles@3.2.1/node_modules/pmtiles/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/potpack@1.0.2/node_modules/potpack/index.cjs +54 -0
- package/dist/node_modules/.pnpm/potpack@1.0.2/node_modules/potpack/index.cjs.map +1 -0
- package/dist/node_modules/.pnpm/potpack@1.0.2/node_modules/potpack/index.js +55 -0
- package/dist/node_modules/.pnpm/potpack@1.0.2/node_modules/potpack/index.js.map +1 -0
- package/dist/node_modules/.pnpm/protomaps-leaflet@4.1.1/node_modules/protomaps-leaflet/dist/esm/index.cjs +1256 -0
- package/dist/node_modules/.pnpm/protomaps-leaflet@4.1.1/node_modules/protomaps-leaflet/dist/esm/index.cjs.map +1 -0
- package/dist/node_modules/.pnpm/protomaps-leaflet@4.1.1/node_modules/protomaps-leaflet/dist/esm/index.js +1256 -0
- package/dist/node_modules/.pnpm/protomaps-leaflet@4.1.1/node_modules/protomaps-leaflet/dist/esm/index.js.map +1 -0
- package/dist/node_modules/.pnpm/quickselect@2.0.0/node_modules/quickselect/index.cjs +47 -0
- package/dist/node_modules/.pnpm/quickselect@2.0.0/node_modules/quickselect/index.cjs.map +1 -0
- package/dist/node_modules/.pnpm/quickselect@2.0.0/node_modules/quickselect/index.js +48 -0
- package/dist/node_modules/.pnpm/quickselect@2.0.0/node_modules/quickselect/index.js.map +1 -0
- package/dist/node_modules/.pnpm/rbush@3.0.1/node_modules/rbush/index.cjs +378 -0
- package/dist/node_modules/.pnpm/rbush@3.0.1/node_modules/rbush/index.cjs.map +1 -0
- package/dist/node_modules/.pnpm/rbush@3.0.1/node_modules/rbush/index.js +379 -0
- package/dist/node_modules/.pnpm/rbush@3.0.1/node_modules/rbush/index.js.map +1 -0
- package/dist/services/data-validator.cjs +85 -0
- package/dist/services/data-validator.cjs.map +1 -0
- package/dist/services/data-validator.d.ts +28 -0
- package/dist/services/data-validator.d.ts.map +1 -0
- package/dist/services/data-validator.js +85 -0
- package/dist/services/data-validator.js.map +1 -0
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.d.ts.map +1 -1
- package/dist/types/chat-bus.d.ts +88 -1
- package/dist/types/chat-bus.d.ts.map +1 -1
- package/dist/types/index.d.ts +135 -6
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types.d.cts +135 -6
- package/dist/types.d.ts +135 -6
- package/package.json +5 -1
- package/src/components/ChartJSRenderer.tsx +35 -13
- package/src/components/DataPreviewSection.tsx +206 -0
- package/src/components/MapRenderer.test.tsx +94 -5
- package/src/components/MapRenderer.tsx +246 -45
- package/src/components/ScratchpadPanel.tsx +10 -2
- package/src/components/VerifiedText.tsx +187 -0
- package/src/components/index.ts +7 -0
- package/src/hooks/index.ts +7 -0
- package/src/hooks/useDataValidator.ts +68 -0
- package/src/index.ts +26 -1
- package/src/services/data-validator.test.ts +151 -0
- package/src/services/data-validator.ts +149 -0
- package/src/services/index.ts +2 -0
- package/src/types/chat-bus.ts +98 -1
- package/src/types/index.ts +145 -6
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1,1256 @@
|
|
|
1
|
+
import Point from "../../../../../@mapbox_point-geometry@1.1.0/node_modules/@mapbox/point-geometry/index.js";
|
|
2
|
+
import { mix } from "../../../../../color2k@2.0.3/node_modules/color2k/dist/index.exports.import.es.js";
|
|
3
|
+
import { VectorTile } from "../../../../../@mapbox_vector-tile@2.0.4/node_modules/@mapbox/vector-tile/index.js";
|
|
4
|
+
import Pbf from "../../../../../pbf@4.0.1/node_modules/pbf/index.js";
|
|
5
|
+
import { PMTiles } from "../../../../../pmtiles@3.2.1/node_modules/pmtiles/dist/index.js";
|
|
6
|
+
import RBush from "../../../../../rbush@3.0.1/node_modules/rbush/index.js";
|
|
7
|
+
import potpack from "../../../../../potpack@1.0.2/node_modules/potpack/index.js";
|
|
8
|
+
var pt = Object.defineProperty;
|
|
9
|
+
var C = Math.pow;
|
|
10
|
+
var c = (a, e) => pt(a, "name", { value: e, configurable: true });
|
|
11
|
+
var D = (a, e, t) => new Promise((r, n) => {
|
|
12
|
+
var i = (o) => {
|
|
13
|
+
try {
|
|
14
|
+
l(t.next(o));
|
|
15
|
+
} catch (f) {
|
|
16
|
+
n(f);
|
|
17
|
+
}
|
|
18
|
+
}, s = (o) => {
|
|
19
|
+
try {
|
|
20
|
+
l(t.throw(o));
|
|
21
|
+
} catch (f) {
|
|
22
|
+
n(f);
|
|
23
|
+
}
|
|
24
|
+
}, l = (o) => o.done ? r(o.value) : Promise.resolve(o.value).then(i, s);
|
|
25
|
+
l((t = t.apply(a, e)).next());
|
|
26
|
+
});
|
|
27
|
+
var be = class be2 {
|
|
28
|
+
constructor(e, t) {
|
|
29
|
+
this.str = e != null ? e : t, this.perFeature = typeof this.str == "function" && this.str.length === 2;
|
|
30
|
+
}
|
|
31
|
+
get(e, t) {
|
|
32
|
+
return typeof this.str == "function" ? this.str(e, t) : this.str;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
c(be, "StringAttr");
|
|
36
|
+
var O = be, he = class he2 {
|
|
37
|
+
constructor(e, t = 1) {
|
|
38
|
+
this.value = e != null ? e : t, this.perFeature = typeof this.value == "function" && this.value.length === 2;
|
|
39
|
+
}
|
|
40
|
+
get(e, t) {
|
|
41
|
+
return typeof this.value == "function" ? this.value(e, t) : this.value;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
c(he, "NumberAttr");
|
|
45
|
+
var T = he, pe = class pe2 {
|
|
46
|
+
constructor(e) {
|
|
47
|
+
var t;
|
|
48
|
+
this.labelProps = (t = e == null ? void 0 : e.labelProps) != null ? t : ["name"], this.textTransform = e == null ? void 0 : e.textTransform;
|
|
49
|
+
}
|
|
50
|
+
get(e, t) {
|
|
51
|
+
let r, n;
|
|
52
|
+
typeof this.labelProps == "function" ? n = this.labelProps(e, t) : n = this.labelProps;
|
|
53
|
+
for (let s of n) if (Object.prototype.hasOwnProperty.call(t.props, s) && typeof t.props[s] == "string") {
|
|
54
|
+
r = t.props[s];
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
let i;
|
|
58
|
+
return typeof this.textTransform == "function" ? i = this.textTransform(e, t) : i = this.textTransform, r && i === "uppercase" ? r = r.toUpperCase() : r && i === "lowercase" ? r = r.toLowerCase() : r && i === "capitalize" && (r = r.toLowerCase().split(" ").map((o) => o[0].toUpperCase() + o.slice(1)).join(" ")), r;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
c(pe, "TextAttr");
|
|
62
|
+
var E = pe, ge = class ge2 {
|
|
63
|
+
constructor(e) {
|
|
64
|
+
var t, r;
|
|
65
|
+
e != null && e.font ? this.font = e.font : (this.family = (t = e == null ? void 0 : e.fontFamily) != null ? t : "sans-serif", this.size = (r = e == null ? void 0 : e.fontSize) != null ? r : 12, this.weight = e == null ? void 0 : e.fontWeight, this.style = e == null ? void 0 : e.fontStyle);
|
|
66
|
+
}
|
|
67
|
+
get(e, t) {
|
|
68
|
+
if (this.font) return typeof this.font == "function" ? this.font(e, t) : this.font;
|
|
69
|
+
let r = "";
|
|
70
|
+
this.style && (typeof this.style == "function" ? r = `${this.style(e, t)} ` : r = `${this.style} `);
|
|
71
|
+
let n = "";
|
|
72
|
+
this.weight && (typeof this.weight == "function" ? n = `${this.weight(e, t)} ` : n = `${this.weight} `);
|
|
73
|
+
let i;
|
|
74
|
+
typeof this.size == "function" ? i = this.size(e, t) : i = this.size;
|
|
75
|
+
let s;
|
|
76
|
+
return typeof this.family == "function" ? s = this.family(e, t) : s = this.family, `${r}${n}${i}px ${s}`;
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
c(ge, "FontAttr");
|
|
80
|
+
var N = ge, ye = class ye2 {
|
|
81
|
+
constructor(e, t = []) {
|
|
82
|
+
this.value = e != null ? e : t, this.perFeature = typeof this.value == "function" && this.value.length === 2;
|
|
83
|
+
}
|
|
84
|
+
get(e, t) {
|
|
85
|
+
return typeof this.value == "function" ? this.value(e, t) : this.value;
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
c(ye, "ArrayAttr");
|
|
89
|
+
var q = ye;
|
|
90
|
+
var gt = c((a, e, t) => {
|
|
91
|
+
let r = [], n, i, s, l = 0, o = 0, f = 0, u = 0, m = 0, d = 0, h = 0, g = 0, y = 0, _ = 0, k = 0, p = 0;
|
|
92
|
+
if (a.length < 2) return [];
|
|
93
|
+
if (a.length === 2) return f = Math.sqrt(C(a[1].x - a[0].x, 2) + C(a[1].y - a[0].y, 2)), [{ length: f, beginIndex: 0, beginDistance: 0, endIndex: 2, endDistance: f }];
|
|
94
|
+
for (u = Math.sqrt(C(a[1].x - a[0].x, 2) + C(a[1].y - a[0].y, 2)), l = 1, o = a.length - 1; l < o; l++) n = a[l - 1], i = a[l], s = a[l + 1], d = i.x - n.x, h = i.y - n.y, g = s.x - i.x, y = s.y - i.y, m = Math.sqrt(g * g + y * y), f += u, _ = Math.acos((d * g + h * y) / (u * m)), (_ > e || f - p > t) && (r.push({ length: f - p, beginDistance: p, beginIndex: k, endIndex: l + 1, endDistance: f }), k = l, p = f), u = m;
|
|
95
|
+
return l - k > 0 && r.push({ length: f - p + m, beginIndex: k, beginDistance: p, endIndex: l + 1, endDistance: f + m }), r;
|
|
96
|
+
}, "linelabel");
|
|
97
|
+
function Ue(a, e, t, r) {
|
|
98
|
+
let n = [];
|
|
99
|
+
for (let i of a) {
|
|
100
|
+
let s = gt(i, Math.PI / 45, e);
|
|
101
|
+
for (let l of s) if (l.length >= e + r) {
|
|
102
|
+
let o = new Point(i[l.beginIndex].x, i[l.beginIndex].y), f = i[l.endIndex - 1], u = new Point((f.x - o.x) / l.length, (f.y - o.y) / l.length);
|
|
103
|
+
for (let m = r; m < l.length - e; m += t) n.push({ start: o.add(u.mult(m)), end: o.add(u.mult(m + e)) });
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return n;
|
|
107
|
+
}
|
|
108
|
+
c(Ue, "simpleLabel");
|
|
109
|
+
function Ge(a, e, t, r) {
|
|
110
|
+
let n = e.x - a.x, i = e.y - a.y, s = Math.sqrt(C(e.x - a.x, 2) + C(e.y - a.y, 2)), l = [];
|
|
111
|
+
for (let o = 0; o < t + r; o += 2 * r) {
|
|
112
|
+
let f = o * 1 / s;
|
|
113
|
+
l.push({ x: a.x + f * n, y: a.y + f * i });
|
|
114
|
+
}
|
|
115
|
+
return l;
|
|
116
|
+
}
|
|
117
|
+
c(Ge, "lineCells");
|
|
118
|
+
function xe(a, e) {
|
|
119
|
+
if (a.length <= e) return [a];
|
|
120
|
+
let t = e - 1, r = a.lastIndexOf(" ", t), n = a.indexOf(" ", t);
|
|
121
|
+
if (r === -1 && n === -1) return [a];
|
|
122
|
+
let i, s;
|
|
123
|
+
return n === -1 || r >= 0 && t - r < n - t ? (i = a.substring(0, r), s = a.substring(r + 1, a.length)) : (i = a.substring(0, n), s = a.substring(n + 1, a.length)), [i, ...xe(s, e)];
|
|
124
|
+
}
|
|
125
|
+
c(xe, "linebreak");
|
|
126
|
+
var rt = ((r) => (r[r.Point = 1] = "Point", r[r.Line = 2] = "Line", r[r.Polygon = 3] = "Polygon", r))(rt || {});
|
|
127
|
+
function Y(a) {
|
|
128
|
+
return `${a.x}:${a.y}:${a.z}`;
|
|
129
|
+
}
|
|
130
|
+
c(Y, "toIndex");
|
|
131
|
+
var kt = c((a, e, t) => {
|
|
132
|
+
a.pos = e;
|
|
133
|
+
let r = a.readVarint() + a.pos, n = 1, i = 0, s = 0, l = 0, o = 1 / 0, f = -1 / 0, u = 1 / 0, m = -1 / 0, d = [], h = [];
|
|
134
|
+
for (; a.pos < r; ) {
|
|
135
|
+
if (i <= 0) {
|
|
136
|
+
let g = a.readVarint();
|
|
137
|
+
n = g & 7, i = g >> 3;
|
|
138
|
+
}
|
|
139
|
+
if (i--, n === 1 || n === 2) s += a.readSVarint() * t, l += a.readSVarint() * t, s < o && (o = s), s > f && (f = s), l < u && (u = l), l > m && (m = l), n === 1 && (h.length > 0 && d.push(h), h = []), h.push(new Point(s, l));
|
|
140
|
+
else if (n === 7) h && h.push(h[0].clone());
|
|
141
|
+
else throw new Error(`unknown command ${n}`);
|
|
142
|
+
}
|
|
143
|
+
return h && d.push(h), { geom: d, bbox: { minX: o, minY: u, maxX: f, maxY: m } };
|
|
144
|
+
}, "loadGeomAndBbox");
|
|
145
|
+
function nt(a, e) {
|
|
146
|
+
let t = new VectorTile(new Pbf(a)), r = /* @__PURE__ */ new Map();
|
|
147
|
+
for (let [n, i] of Object.entries(t.layers)) {
|
|
148
|
+
let s = [], l = i;
|
|
149
|
+
for (let o = 0; o < l.length; o++) {
|
|
150
|
+
let f = kt(l.feature(o)._pbf, l.feature(o)._geometry, e / l.extent), u = 0;
|
|
151
|
+
for (let m of f.geom) u += m.length;
|
|
152
|
+
s.push({ id: l.feature(o).id, geomType: l.feature(o).type, geom: f.geom, numVertices: u, bbox: f.bbox, props: l.feature(o).properties });
|
|
153
|
+
}
|
|
154
|
+
r.set(n, s);
|
|
155
|
+
}
|
|
156
|
+
return r;
|
|
157
|
+
}
|
|
158
|
+
c(nt, "parseTile");
|
|
159
|
+
var we = class we2 {
|
|
160
|
+
constructor(e, t) {
|
|
161
|
+
typeof e == "string" ? this.p = new PMTiles(e) : this.p = e, this.zoomaborts = [], this.shouldCancelZooms = t;
|
|
162
|
+
}
|
|
163
|
+
get(e, t) {
|
|
164
|
+
return D(this, null, function* () {
|
|
165
|
+
this.shouldCancelZooms && (this.zoomaborts = this.zoomaborts.filter((s) => s.z !== e.z ? (s.controller.abort(), false) : true));
|
|
166
|
+
let r = new AbortController();
|
|
167
|
+
this.zoomaborts.push({ z: e.z, controller: r });
|
|
168
|
+
let n = r.signal, i = yield this.p.getZxy(e.z, e.x, e.y, n);
|
|
169
|
+
return i ? nt(i.data, t) : /* @__PURE__ */ new Map();
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
c(we, "PmtilesSource");
|
|
174
|
+
var H = we, ke = class ke2 {
|
|
175
|
+
constructor(e, t) {
|
|
176
|
+
this.url = e, this.zoomaborts = [], this.shouldCancelZooms = t;
|
|
177
|
+
}
|
|
178
|
+
get(e, t) {
|
|
179
|
+
return D(this, null, function* () {
|
|
180
|
+
this.shouldCancelZooms && (this.zoomaborts = this.zoomaborts.filter((s) => s.z !== e.z ? (s.controller.abort(), false) : true));
|
|
181
|
+
let r = this.url.replace("{z}", e.z.toString()).replace("{x}", e.x.toString()).replace("{y}", e.y.toString()), n = new AbortController();
|
|
182
|
+
this.zoomaborts.push({ z: e.z, controller: n });
|
|
183
|
+
let i = n.signal;
|
|
184
|
+
return new Promise((s, l) => {
|
|
185
|
+
fetch(r, { signal: i }).then((o) => o.arrayBuffer()).then((o) => {
|
|
186
|
+
let f = nt(o, t);
|
|
187
|
+
s(f);
|
|
188
|
+
}).catch((o) => {
|
|
189
|
+
l(o);
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
c(ke, "ZxySource");
|
|
196
|
+
var Q = ke, _e = 6378137, Qe = 85.0511287798, U = _e * Math.PI, zt = c((a) => {
|
|
197
|
+
let e = Math.PI / 180, t = Math.max(Math.min(Qe, a[0]), -Qe), r = Math.sin(t * e);
|
|
198
|
+
return new Point(_e * a[1] * e, _e * Math.log((1 + r) / (1 - r)) / 2);
|
|
199
|
+
}, "project");
|
|
200
|
+
function et(a) {
|
|
201
|
+
return a * a;
|
|
202
|
+
}
|
|
203
|
+
c(et, "sqr");
|
|
204
|
+
function G(a, e) {
|
|
205
|
+
return et(a.x - e.x) + et(a.y - e.y);
|
|
206
|
+
}
|
|
207
|
+
c(G, "dist2");
|
|
208
|
+
function Tt(a, e, t) {
|
|
209
|
+
let r = G(e, t);
|
|
210
|
+
if (r === 0) return G(a, e);
|
|
211
|
+
let n = ((a.x - e.x) * (t.x - e.x) + (a.y - e.y) * (t.y - e.y)) / r;
|
|
212
|
+
return n = Math.max(0, Math.min(1, n)), G(a, new Point(e.x + n * (t.x - e.x), e.y + n * (t.y - e.y)));
|
|
213
|
+
}
|
|
214
|
+
c(Tt, "distToSegmentSquared");
|
|
215
|
+
function tt(a, e) {
|
|
216
|
+
let t = false;
|
|
217
|
+
for (let r = 0, n = e.length - 1; r < e.length; n = r++) {
|
|
218
|
+
let i = e[r].x, s = e[r].y, l = e[n].x, o = e[n].y;
|
|
219
|
+
s > a.y != o > a.y && a.x < (l - i) * (a.y - s) / (o - s) + i && (t = !t);
|
|
220
|
+
}
|
|
221
|
+
return t;
|
|
222
|
+
}
|
|
223
|
+
c(tt, "isInRing");
|
|
224
|
+
function Pt(a) {
|
|
225
|
+
let e = 0;
|
|
226
|
+
for (let t = 0; t < a.length; t++) {
|
|
227
|
+
let r = (t + 1) % a.length;
|
|
228
|
+
e += a[t].x * a[r].y, e -= a[r].x * a[t].y;
|
|
229
|
+
}
|
|
230
|
+
return e < 0;
|
|
231
|
+
}
|
|
232
|
+
c(Pt, "isCcw");
|
|
233
|
+
function Lt(a, e) {
|
|
234
|
+
let t = false;
|
|
235
|
+
for (let r of e) if (Pt(r)) tt(a, r) && (t = false);
|
|
236
|
+
else {
|
|
237
|
+
if (t) return true;
|
|
238
|
+
tt(a, r) && (t = true);
|
|
239
|
+
}
|
|
240
|
+
return t;
|
|
241
|
+
}
|
|
242
|
+
c(Lt, "pointInPolygon");
|
|
243
|
+
function vt(a, e) {
|
|
244
|
+
let t = 1 / 0;
|
|
245
|
+
for (let r of e) {
|
|
246
|
+
let n = Math.sqrt(G(a, r[0]));
|
|
247
|
+
n < t && (t = n);
|
|
248
|
+
}
|
|
249
|
+
return t;
|
|
250
|
+
}
|
|
251
|
+
c(vt, "pointMinDistToPoints");
|
|
252
|
+
function Ct(a, e) {
|
|
253
|
+
let t = 1 / 0;
|
|
254
|
+
for (let r of e) for (let n = 0; n < r.length - 1; n++) {
|
|
255
|
+
let i = Math.sqrt(Tt(a, r[n], r[n + 1]));
|
|
256
|
+
i < t && (t = i);
|
|
257
|
+
}
|
|
258
|
+
return t;
|
|
259
|
+
}
|
|
260
|
+
c(Ct, "pointMinDistToLines");
|
|
261
|
+
var ze = class ze2 {
|
|
262
|
+
constructor(e, t) {
|
|
263
|
+
this.source = e, this.cache = /* @__PURE__ */ new Map(), this.inflight = /* @__PURE__ */ new Map(), this.tileSize = t;
|
|
264
|
+
}
|
|
265
|
+
get(e) {
|
|
266
|
+
return D(this, null, function* () {
|
|
267
|
+
let t = Y(e);
|
|
268
|
+
return new Promise((r, n) => {
|
|
269
|
+
let i = this.cache.get(t);
|
|
270
|
+
if (i) i.used = performance.now(), r(i.data);
|
|
271
|
+
else {
|
|
272
|
+
let s = this.inflight.get(t);
|
|
273
|
+
s ? s.push({ resolve: r, reject: n }) : (this.inflight.set(t, []), this.source.get(e, this.tileSize).then((l) => {
|
|
274
|
+
this.cache.set(t, { used: performance.now(), data: l });
|
|
275
|
+
let o = this.inflight.get(t);
|
|
276
|
+
if (o) for (let f of o) f.resolve(l);
|
|
277
|
+
if (this.inflight.delete(t), r(l), this.cache.size >= 64) {
|
|
278
|
+
let f = 1 / 0, u;
|
|
279
|
+
this.cache.forEach((m, d) => {
|
|
280
|
+
m.used < f && (f = m.used, u = d);
|
|
281
|
+
}), u && this.cache.delete(u);
|
|
282
|
+
}
|
|
283
|
+
}).catch((l) => {
|
|
284
|
+
let o = this.inflight.get(t);
|
|
285
|
+
if (o) for (let f of o) f.reject(l);
|
|
286
|
+
this.inflight.delete(t), n(l);
|
|
287
|
+
}));
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
queryFeatures(e, t, r, n) {
|
|
293
|
+
let i = zt([t, e]), s = new Point((i.x + U) / (U * 2), 1 - (i.y + U) / (U * 2));
|
|
294
|
+
s.x > 1 && (s.x = s.x - Math.floor(s.x));
|
|
295
|
+
let l = s.mult(1 << r), o = Math.floor(l.x), f = Math.floor(l.y), u = Y({ z: r, x: o, y: f }), m = [], d = this.cache.get(u);
|
|
296
|
+
if (d) {
|
|
297
|
+
let h = new Point((l.x - o) * this.tileSize, (l.y - f) * this.tileSize);
|
|
298
|
+
for (let [g, y] of d.data.entries()) for (let _ of y) _.geomType === 1 ? vt(h, _.geom) < n && m.push({ feature: _, layerName: g }) : _.geomType === 2 ? Ct(h, _.geom) < n && m.push({ feature: _, layerName: g }) : Lt(h, _.geom) && m.push({ feature: _, layerName: g });
|
|
299
|
+
}
|
|
300
|
+
return m;
|
|
301
|
+
}
|
|
302
|
+
};
|
|
303
|
+
c(ze, "TileCache");
|
|
304
|
+
var ee = ze;
|
|
305
|
+
var St = ((r) => (r[r.Left = 1] = "Left", r[r.Center = 2] = "Center", r[r.Right = 3] = "Right", r))(St || {}), At = ((o) => (o[o.N = 1] = "N", o[o.Ne = 2] = "Ne", o[o.E = 3] = "E", o[o.Se = 4] = "Se", o[o.S = 5] = "S", o[o.Sw = 6] = "Sw", o[o.W = 7] = "W", o[o.Nw = 8] = "Nw", o))(At || {}), zr = c((a, e, t) => {
|
|
306
|
+
let r = document.createElement("canvas"), n = r.getContext("2d");
|
|
307
|
+
return r.width = a, r.height = e, n !== null && t(r, n), r;
|
|
308
|
+
}, "createPattern"), ve = class ve2 {
|
|
309
|
+
constructor(e) {
|
|
310
|
+
var t;
|
|
311
|
+
this.pattern = e.pattern, this.fill = new O(e.fill, "black"), this.opacity = new T(e.opacity, 1), this.stroke = new O(e.stroke, "black"), this.width = new T(e.width, 0), this.perFeature = (t = this.fill.perFeature || this.opacity.perFeature || this.stroke.perFeature || this.width.perFeature || e.perFeature) != null ? t : false, this.doStroke = false;
|
|
312
|
+
}
|
|
313
|
+
before(e, t) {
|
|
314
|
+
if (!this.perFeature) {
|
|
315
|
+
e.globalAlpha = this.opacity.get(t), e.fillStyle = this.fill.get(t), e.strokeStyle = this.stroke.get(t);
|
|
316
|
+
let r = this.width.get(t);
|
|
317
|
+
r > 0 && (this.doStroke = true), e.lineWidth = r;
|
|
318
|
+
}
|
|
319
|
+
if (this.pattern) {
|
|
320
|
+
let r = e.createPattern(this.pattern, "repeat");
|
|
321
|
+
r && (e.fillStyle = r);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
draw(e, t, r, n) {
|
|
325
|
+
let i = false;
|
|
326
|
+
if (this.perFeature) {
|
|
327
|
+
e.globalAlpha = this.opacity.get(r, n), e.fillStyle = this.fill.get(r, n);
|
|
328
|
+
let l = this.width.get(r, n);
|
|
329
|
+
l && (i = true, e.strokeStyle = this.stroke.get(r, n), e.lineWidth = l);
|
|
330
|
+
}
|
|
331
|
+
let s = c(() => {
|
|
332
|
+
e.fill(), (i || this.doStroke) && e.stroke();
|
|
333
|
+
}, "drawPath");
|
|
334
|
+
e.beginPath();
|
|
335
|
+
for (let l of t) for (let o = 0; o < l.length; o++) {
|
|
336
|
+
let f = l[o];
|
|
337
|
+
o === 0 ? e.moveTo(f.x, f.y) : e.lineTo(f.x, f.y);
|
|
338
|
+
}
|
|
339
|
+
s();
|
|
340
|
+
}
|
|
341
|
+
};
|
|
342
|
+
c(ve, "PolygonSymbolizer");
|
|
343
|
+
var P = ve;
|
|
344
|
+
function Tr(a, e) {
|
|
345
|
+
return (t) => {
|
|
346
|
+
let r = t - a;
|
|
347
|
+
return r >= 0 && r < e.length ? e[r] : 0;
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
c(Tr, "arr");
|
|
351
|
+
function Dt(a, e) {
|
|
352
|
+
let t = 0;
|
|
353
|
+
for (; e[t + 1][0] < a; ) t++;
|
|
354
|
+
return t;
|
|
355
|
+
}
|
|
356
|
+
c(Dt, "getStopIndex");
|
|
357
|
+
function Ot(a, e, t) {
|
|
358
|
+
return a * (t - e) + e;
|
|
359
|
+
}
|
|
360
|
+
c(Ot, "interpolate");
|
|
361
|
+
function Mt(a, e, t, r) {
|
|
362
|
+
let n = r[e + 1][0] - r[e][0], i = a - r[e][0];
|
|
363
|
+
return n === 0 ? 0 : t === 1 ? i / n : (C(t, i) - 1) / (C(t, n) - 1);
|
|
364
|
+
}
|
|
365
|
+
c(Mt, "computeInterpolationFactor");
|
|
366
|
+
function F(a, e) {
|
|
367
|
+
return (t) => {
|
|
368
|
+
if (e.length < 1) return 0;
|
|
369
|
+
if (t <= e[0][0]) return e[0][1];
|
|
370
|
+
if (t >= e[e.length - 1][0]) return e[e.length - 1][1];
|
|
371
|
+
let r = Dt(t, e), n = Mt(t, r, a, e);
|
|
372
|
+
return Ot(n, e[r][1], e[r + 1][1]);
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
c(F, "exp");
|
|
376
|
+
function Pr(a, e) {
|
|
377
|
+
return (t) => {
|
|
378
|
+
if (e.length < 1) return 0;
|
|
379
|
+
let r = a;
|
|
380
|
+
for (let n = 0; n < e.length; n++) t >= e[n][0] && (r = e[n][1]);
|
|
381
|
+
return r;
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
c(Pr, "step");
|
|
385
|
+
function Le(a) {
|
|
386
|
+
return F(1, a);
|
|
387
|
+
}
|
|
388
|
+
c(Le, "linear");
|
|
389
|
+
var Ce = class Ce2 {
|
|
390
|
+
constructor(e) {
|
|
391
|
+
var t;
|
|
392
|
+
this.color = new O(e.color, "black"), this.width = new T(e.width), this.opacity = new T(e.opacity), this.dash = e.dash ? new q(e.dash) : null, this.dashColor = new O(e.dashColor, "black"), this.dashWidth = new T(e.dashWidth, 1), this.lineCap = new O(e.lineCap, "butt"), this.lineJoin = new O(e.lineJoin, "miter"), this.skip = false, this.perFeature = !!((t = this.dash) != null && t.perFeature || this.color.perFeature || this.opacity.perFeature || this.width.perFeature || this.lineCap.perFeature || this.lineJoin.perFeature || e.perFeature);
|
|
393
|
+
}
|
|
394
|
+
before(e, t) {
|
|
395
|
+
this.perFeature || (e.strokeStyle = this.color.get(t), e.lineWidth = this.width.get(t), e.globalAlpha = this.opacity.get(t), e.lineCap = this.lineCap.get(t), e.lineJoin = this.lineJoin.get(t));
|
|
396
|
+
}
|
|
397
|
+
draw(e, t, r, n) {
|
|
398
|
+
if (this.skip) return;
|
|
399
|
+
let i = c(() => {
|
|
400
|
+
this.perFeature && (e.globalAlpha = this.opacity.get(r, n), e.lineCap = this.lineCap.get(r, n), e.lineJoin = this.lineJoin.get(r, n)), this.dash ? (e.save(), this.perFeature ? (e.lineWidth = this.dashWidth.get(r, n), e.strokeStyle = this.dashColor.get(r, n), e.setLineDash(this.dash.get(r, n))) : e.setLineDash(this.dash.get(r)), e.stroke(), e.restore()) : (e.save(), this.perFeature && (e.lineWidth = this.width.get(r, n), e.strokeStyle = this.color.get(r, n)), e.stroke(), e.restore());
|
|
401
|
+
}, "strokePath");
|
|
402
|
+
e.beginPath();
|
|
403
|
+
for (let s of t) for (let l = 0; l < s.length; l++) {
|
|
404
|
+
let o = s[l];
|
|
405
|
+
l === 0 ? e.moveTo(o.x, o.y) : e.lineTo(o.x, o.y);
|
|
406
|
+
}
|
|
407
|
+
i();
|
|
408
|
+
}
|
|
409
|
+
};
|
|
410
|
+
c(Ce, "LineSymbolizer");
|
|
411
|
+
var M = Ce, Se = class Se2 {
|
|
412
|
+
constructor(e) {
|
|
413
|
+
this.name = e.name, this.sheet = e.sheet, this.dpr = window.devicePixelRatio;
|
|
414
|
+
}
|
|
415
|
+
place(e, t, r) {
|
|
416
|
+
t[0];
|
|
417
|
+
let i = new Point(t[0][0].x, t[0][0].y), s = this.sheet.get(this.name), l = s.w / this.dpr, o = s.h / this.dpr, f = { minX: i.x - l / 2, minY: i.y - o / 2, maxX: i.x + l / 2, maxY: i.y + o / 2 };
|
|
418
|
+
return [{ anchor: i, bboxes: [f], draw: c((m) => {
|
|
419
|
+
m.globalAlpha = 1, m.drawImage(this.sheet.canvas, s.x, s.y, s.w, s.h, -s.w / 2 / this.dpr, -s.h / 2 / this.dpr, s.w / 2, s.h / 2);
|
|
420
|
+
}, "draw") }];
|
|
421
|
+
}
|
|
422
|
+
};
|
|
423
|
+
c(Se, "IconSymbolizer");
|
|
424
|
+
var it = Se, Ae = class Ae2 {
|
|
425
|
+
constructor(e) {
|
|
426
|
+
this.radius = new T(e.radius, 3), this.fill = new O(e.fill, "black"), this.stroke = new O(e.stroke, "white"), this.width = new T(e.width, 0), this.opacity = new T(e.opacity);
|
|
427
|
+
}
|
|
428
|
+
draw(e, t, r, n) {
|
|
429
|
+
e.globalAlpha = this.opacity.get(r, n);
|
|
430
|
+
let i = this.radius.get(r, n), s = this.width.get(r, n);
|
|
431
|
+
s > 0 && (e.strokeStyle = this.stroke.get(r, n), e.lineWidth = s, e.beginPath(), e.arc(t[0][0].x, t[0][0].y, i + s / 2, 0, 2 * Math.PI), e.stroke()), e.fillStyle = this.fill.get(r, n), e.beginPath(), e.arc(t[0][0].x, t[0][0].y, i, 0, 2 * Math.PI), e.fill();
|
|
432
|
+
}
|
|
433
|
+
place(e, t, r) {
|
|
434
|
+
t[0];
|
|
435
|
+
let i = new Point(t[0][0].x, t[0][0].y), s = this.radius.get(e.zoom, r), l = { minX: i.x - s, minY: i.y - s, maxX: i.x + s, maxY: i.y + s };
|
|
436
|
+
return [{ anchor: i, bboxes: [l], draw: c((f) => {
|
|
437
|
+
this.draw(f, [[new Point(0, 0)]], e.zoom, r);
|
|
438
|
+
}, "draw") }];
|
|
439
|
+
}
|
|
440
|
+
};
|
|
441
|
+
c(Ae, "CircleSymbolizer");
|
|
442
|
+
var te = Ae, De = class De2 {
|
|
443
|
+
constructor(e) {
|
|
444
|
+
this.font = new N(e), this.text = new E(e), this.fill = new O(e.fill, "black"), this.background = new O(e.background, "white"), this.padding = new T(e.padding, 0);
|
|
445
|
+
}
|
|
446
|
+
place(e, t, r) {
|
|
447
|
+
let n = this.text.get(e.zoom, r);
|
|
448
|
+
if (!n) return;
|
|
449
|
+
let i = this.font.get(e.zoom, r);
|
|
450
|
+
e.scratch.font = i;
|
|
451
|
+
let s = e.scratch.measureText(n), l = s.width, o = s.actualBoundingBoxAscent, f = s.actualBoundingBoxDescent;
|
|
452
|
+
t[0];
|
|
453
|
+
let m = new Point(t[0][0].x, t[0][0].y), d = this.padding.get(e.zoom, r), h = { minX: m.x - l / 2 - d, minY: m.y - o - d, maxX: m.x + l / 2 + d, maxY: m.y + f + d };
|
|
454
|
+
return [{ anchor: m, bboxes: [h], draw: c((y) => {
|
|
455
|
+
y.globalAlpha = 1, y.fillStyle = this.background.get(e.zoom, r), y.fillRect(-l / 2 - d, -o - d, l + 2 * d, o + f + 2 * d), y.fillStyle = this.fill.get(e.zoom, r), y.font = i, y.fillText(n, -l / 2, 0);
|
|
456
|
+
}, "draw") }];
|
|
457
|
+
}
|
|
458
|
+
};
|
|
459
|
+
c(De, "ShieldSymbolizer");
|
|
460
|
+
var at = De, Oe = class Oe2 {
|
|
461
|
+
constructor(e) {
|
|
462
|
+
this.list = e;
|
|
463
|
+
}
|
|
464
|
+
place(e, t, r) {
|
|
465
|
+
let n = this.list[0].place(e, t, r);
|
|
466
|
+
if (!n) return;
|
|
467
|
+
let i = n[0], s = i.anchor, l = i.bboxes[0], o = l.maxY - l.minY, f = [{ draw: i.draw, translate: { x: 0, y: 0 } }], u = [[new Point(t[0][0].x, t[0][0].y + o)]];
|
|
468
|
+
for (let d = 1; d < this.list.length; d++) n = this.list[d].place(e, u, r), n && (i = n[0], l = lt(l, i.bboxes[0]), f.push({ draw: i.draw, translate: { x: 0, y: o } }));
|
|
469
|
+
return [{ anchor: s, bboxes: [l], draw: c((d) => {
|
|
470
|
+
for (let h of f) d.save(), d.translate(h.translate.x, h.translate.y), h.draw(d), d.restore();
|
|
471
|
+
}, "draw") }];
|
|
472
|
+
}
|
|
473
|
+
};
|
|
474
|
+
c(Oe, "FlexSymbolizer");
|
|
475
|
+
var st = Oe, lt = c((a, e) => ({ minX: Math.min(a.minX, e.minX), minY: Math.min(a.minY, e.minY), maxX: Math.max(a.maxX, e.maxX), maxY: Math.max(a.maxY, e.maxY) }), "mergeBbox"), Me = class Me2 {
|
|
476
|
+
constructor(e) {
|
|
477
|
+
this.list = e;
|
|
478
|
+
}
|
|
479
|
+
place(e, t, r) {
|
|
480
|
+
let n = this.list[0];
|
|
481
|
+
if (!n) return;
|
|
482
|
+
let i = n.place(e, t, r);
|
|
483
|
+
if (!i) return;
|
|
484
|
+
let s = i[0], l = s.anchor, o = s.bboxes[0], f = [s.draw];
|
|
485
|
+
for (let m = 1; m < this.list.length; m++) {
|
|
486
|
+
if (i = this.list[m].place(e, t, r), !i) return;
|
|
487
|
+
s = i[0], o = lt(o, s.bboxes[0]), f.push(s.draw);
|
|
488
|
+
}
|
|
489
|
+
return [{ anchor: l, bboxes: [o], draw: c((m) => {
|
|
490
|
+
for (let d of f) d(m);
|
|
491
|
+
}, "draw") }];
|
|
492
|
+
}
|
|
493
|
+
};
|
|
494
|
+
c(Me, "GroupSymbolizer");
|
|
495
|
+
var re = Me, Re = class Re2 {
|
|
496
|
+
constructor(e) {
|
|
497
|
+
this.symbolizer = e;
|
|
498
|
+
}
|
|
499
|
+
place(e, t, r) {
|
|
500
|
+
let n = t[0][0], i = this.symbolizer.place(e, [[new Point(0, 0)]], r);
|
|
501
|
+
if (!i || i.length === 0) return;
|
|
502
|
+
let s = i[0], l = s.bboxes[0], o = l.maxX - l.minX, f = l.maxY - l.minY, u = { minX: n.x - o / 2, maxX: n.x + o / 2, minY: n.y - f / 2, maxY: n.y + f / 2 };
|
|
503
|
+
return [{ anchor: n, bboxes: [u], draw: c((d) => {
|
|
504
|
+
d.translate(-o / 2, f / 2 - l.maxY), s.draw(d, { justify: 2 });
|
|
505
|
+
}, "draw") }];
|
|
506
|
+
}
|
|
507
|
+
};
|
|
508
|
+
c(Re, "CenteredSymbolizer");
|
|
509
|
+
var Te = Re, Fe = class Fe2 {
|
|
510
|
+
constructor(e, t) {
|
|
511
|
+
this.padding = new T(e, 0), this.symbolizer = t;
|
|
512
|
+
}
|
|
513
|
+
place(e, t, r) {
|
|
514
|
+
let n = this.symbolizer.place(e, t, r);
|
|
515
|
+
if (!n || n.length === 0) return;
|
|
516
|
+
let i = this.padding.get(e.zoom, r);
|
|
517
|
+
for (let s of n) for (let l of s.bboxes) l.minX -= i, l.minY -= i, l.maxX += i, l.maxY += i;
|
|
518
|
+
return n;
|
|
519
|
+
}
|
|
520
|
+
};
|
|
521
|
+
c(Fe, "Padding");
|
|
522
|
+
var ot = Fe, je = class je2 {
|
|
523
|
+
constructor(e) {
|
|
524
|
+
this.font = new N(e), this.text = new E(e), this.fill = new O(e.fill, "black"), this.stroke = new O(e.stroke, "black"), this.width = new T(e.width, 0), this.lineHeight = new T(e.lineHeight, 1), this.letterSpacing = new T(e.letterSpacing, 0), this.maxLineCodeUnits = new T(e.maxLineChars, 15), this.justify = e.justify;
|
|
525
|
+
}
|
|
526
|
+
place(e, t, r) {
|
|
527
|
+
let n = this.text.get(e.zoom, r);
|
|
528
|
+
if (!n) return;
|
|
529
|
+
let i = this.font.get(e.zoom, r);
|
|
530
|
+
e.scratch.font = i;
|
|
531
|
+
let s = this.letterSpacing.get(e.zoom, r), l = xe(n, this.maxLineCodeUnits.get(e.zoom, r)), o = "", f = 0;
|
|
532
|
+
for (let p of l) p.length > f && (f = p.length, o = p);
|
|
533
|
+
let u = e.scratch.measureText(o), m = u.width + s * (f - 1), d = u.actualBoundingBoxAscent, h = u.actualBoundingBoxDescent, g = (d + h) * this.lineHeight.get(e.zoom, r), y = new Point(t[0][0].x, t[0][0].y), _ = { minX: y.x, minY: y.y - d, maxX: y.x + m, maxY: y.y + h + (l.length - 1) * g };
|
|
534
|
+
return [{ anchor: y, bboxes: [_], draw: c((p, x) => {
|
|
535
|
+
p.globalAlpha = 1, p.font = i, p.fillStyle = this.fill.get(e.zoom, r);
|
|
536
|
+
let A = this.width.get(e.zoom, r), b = 0;
|
|
537
|
+
for (let v of l) {
|
|
538
|
+
let z = 0;
|
|
539
|
+
if (this.justify === 2 || x && x.justify === 2 ? z = (m - p.measureText(v).width) / 2 : (this.justify === 3 || x && x.justify === 3) && (z = m - p.measureText(v).width), A) if (p.lineWidth = A * 2, p.strokeStyle = this.stroke.get(e.zoom, r), s > 0) {
|
|
540
|
+
let w = z;
|
|
541
|
+
for (let S of v) p.strokeText(S, w, b), w += p.measureText(S).width + s;
|
|
542
|
+
} else p.strokeText(v, z, b);
|
|
543
|
+
if (s > 0) {
|
|
544
|
+
let w = z;
|
|
545
|
+
for (let S of v) p.fillText(S, w, b), w += p.measureText(S).width + s;
|
|
546
|
+
} else p.fillText(v, z, b);
|
|
547
|
+
b += g;
|
|
548
|
+
}
|
|
549
|
+
}, "draw") }];
|
|
550
|
+
}
|
|
551
|
+
};
|
|
552
|
+
c(je, "TextSymbolizer");
|
|
553
|
+
var ne = je, Xe = class Xe2 {
|
|
554
|
+
constructor(e) {
|
|
555
|
+
this.centered = new Te(new ne(e));
|
|
556
|
+
}
|
|
557
|
+
place(e, t, r) {
|
|
558
|
+
return this.centered.place(e, t, r);
|
|
559
|
+
}
|
|
560
|
+
};
|
|
561
|
+
c(Xe, "CenteredTextSymbolizer");
|
|
562
|
+
var I = Xe, Ye = class Ye2 {
|
|
563
|
+
constructor(e, t) {
|
|
564
|
+
var r, n, i;
|
|
565
|
+
this.symbolizer = e, this.offsetX = new T(t.offsetX, 0), this.offsetY = new T(t.offsetY, 0), this.justify = (r = t.justify) != null ? r : void 0, this.placements = (n = t.placements) != null ? n : [2, 6, 8, 4, 1, 3, 5, 7], this.ddValues = (i = t.ddValues) != null ? i : () => ({});
|
|
566
|
+
}
|
|
567
|
+
place(e, t, r) {
|
|
568
|
+
if (r.geomType !== 1) return;
|
|
569
|
+
let n = t[0][0], i = this.symbolizer.place(e, [[new Point(0, 0)]], r);
|
|
570
|
+
if (!i || i.length === 0) return;
|
|
571
|
+
let s = i[0], l = s.bboxes[0], o = this.offsetX, f = this.offsetY, u = this.justify, m = this.placements, { offsetX: d, offsetY: h, justify: g, placements: y } = this.ddValues(e.zoom, r) || {};
|
|
572
|
+
d && (o = new T(d, 0)), h && (f = new T(h, 0)), g && (u = g), y && (m = y);
|
|
573
|
+
let _ = o.get(e.zoom, r), k = f.get(e.zoom, r), p = c((z, w) => ({ minX: z.x + w.x + l.minX, minY: z.y + w.y + l.minY, maxX: z.x + w.x + l.maxX, maxY: z.y + w.y + l.maxY }), "getBbox"), x = new Point(_, k), A, b = c((z) => {
|
|
574
|
+
z.translate(x.x, x.y), s.draw(z, { justify: A });
|
|
575
|
+
}, "draw"), v = c((z, w) => {
|
|
576
|
+
let S = p(z, w);
|
|
577
|
+
if (!e.index.bboxCollides(S, e.order)) return [{ anchor: n, bboxes: [S], draw: b }];
|
|
578
|
+
}, "placeLabelInPoint");
|
|
579
|
+
for (let z of m) {
|
|
580
|
+
let w = this.computeXaxisOffset(_, l, z), S = this.computeYaxisOffset(k, l, z);
|
|
581
|
+
return A = this.computeJustify(u, z), x = new Point(w, S), v(n, x);
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
computeXaxisOffset(e, t, r) {
|
|
585
|
+
let n = t.maxX, i = n / 2;
|
|
586
|
+
return [1, 5].includes(r) ? e - i : [8, 7, 6].includes(r) ? e - n : e;
|
|
587
|
+
}
|
|
588
|
+
computeYaxisOffset(e, t, r) {
|
|
589
|
+
let n = Math.abs(t.minY), i = t.maxY, s = (t.minY + t.maxY) / 2;
|
|
590
|
+
return [3, 7].includes(r) ? e - s : [8, 2, 1].includes(r) ? e - i : [6, 4, 5].includes(r) ? e + n : e;
|
|
591
|
+
}
|
|
592
|
+
computeJustify(e, t) {
|
|
593
|
+
return e || ([1, 5].includes(t) ? 2 : [2, 3, 4].includes(t) ? 1 : 3);
|
|
594
|
+
}
|
|
595
|
+
};
|
|
596
|
+
c(Ye, "OffsetSymbolizer");
|
|
597
|
+
var Pe = Ye, Ie = class Ie2 {
|
|
598
|
+
constructor(e) {
|
|
599
|
+
this.symbolizer = new Pe(new ne(e), e);
|
|
600
|
+
}
|
|
601
|
+
place(e, t, r) {
|
|
602
|
+
return this.symbolizer.place(e, t, r);
|
|
603
|
+
}
|
|
604
|
+
};
|
|
605
|
+
c(Ie, "OffsetTextSymbolizer");
|
|
606
|
+
var ie = Ie, Rt = ((r) => (r[r.Above = 1] = "Above", r[r.Center = 2] = "Center", r[r.Below = 3] = "Below", r))(Rt || {}), Be = class Be2 {
|
|
607
|
+
constructor(e) {
|
|
608
|
+
var t;
|
|
609
|
+
this.font = new N(e), this.text = new E(e), this.fill = new O(e.fill, "black"), this.stroke = new O(e.stroke, "black"), this.width = new T(e.width, 0), this.offset = new T(e.offset, 0), this.position = (t = e.position) != null ? t : 1, this.maxLabelCodeUnits = new T(e.maxLabelChars, 40), this.repeatDistance = new T(e.repeatDistance, 250);
|
|
610
|
+
}
|
|
611
|
+
place(e, t, r) {
|
|
612
|
+
let n = this.text.get(e.zoom, r);
|
|
613
|
+
if (!n || n.length > this.maxLabelCodeUnits.get(e.zoom, r)) return;
|
|
614
|
+
let i = 20, s = r.bbox;
|
|
615
|
+
if (s.maxY - s.minY < i && s.maxX - s.minX < i) return;
|
|
616
|
+
let l = this.font.get(e.zoom, r);
|
|
617
|
+
e.scratch.font = l;
|
|
618
|
+
let o = e.scratch.measureText(n), f = o.width, u = o.actualBoundingBoxAscent + o.actualBoundingBoxDescent, m = this.repeatDistance.get(e.zoom, r);
|
|
619
|
+
e.overzoom > 4 && (m *= 1 << e.overzoom - 4);
|
|
620
|
+
let d = u * 2, h = Ue(t, f, m, d);
|
|
621
|
+
if (h.length === 0) return;
|
|
622
|
+
let g = [];
|
|
623
|
+
for (let y of h) {
|
|
624
|
+
let _ = y.end.x - y.start.x, k = y.end.y - y.start.y, x = Ge(y.start, y.end, f, d / 2).map((b) => ({ minX: b.x - d / 2, minY: b.y - d / 2, maxX: b.x + d / 2, maxY: b.y + d / 2 })), A = c((b) => {
|
|
625
|
+
b.globalAlpha = 1, b.rotate(Math.atan2(k, _)), _ < 0 && (b.scale(-1, -1), b.translate(-f, 0));
|
|
626
|
+
let v = 0;
|
|
627
|
+
this.position === 3 ? v += u : this.position === 2 && (v += u / 2), b.translate(0, v - this.offset.get(e.zoom, r)), b.font = l;
|
|
628
|
+
let z = this.width.get(e.zoom, r);
|
|
629
|
+
z && (b.lineWidth = z, b.strokeStyle = this.stroke.get(e.zoom, r), b.strokeText(n, 0, 0)), b.fillStyle = this.fill.get(e.zoom, r), b.fillText(n, 0, 0);
|
|
630
|
+
}, "draw");
|
|
631
|
+
g.push({ anchor: y.start, bboxes: x, draw: A, deduplicationKey: n, deduplicationDistance: m });
|
|
632
|
+
}
|
|
633
|
+
return g;
|
|
634
|
+
}
|
|
635
|
+
};
|
|
636
|
+
c(Be, "LineLabelSymbolizer");
|
|
637
|
+
var $ = Be;
|
|
638
|
+
var R = c((a, e) => {
|
|
639
|
+
let t = a[e];
|
|
640
|
+
return typeof t == "string" ? t : "";
|
|
641
|
+
}, "getString"), ct = c((a, e) => {
|
|
642
|
+
let t = a[e];
|
|
643
|
+
return typeof t == "number" ? t : 0;
|
|
644
|
+
}, "getNumber"), ae = c((a) => [{ dataLayer: "earth", symbolizer: new P({ fill: a.earth }) }, { dataLayer: "landuse", symbolizer: new P({ fill: c((e, t) => mix(a.park_a, a.park_b, Math.min(Math.max(e / 12, 12), 0)), "fill") }), filter: c((e, t) => {
|
|
645
|
+
let r = R(t.props, "pmap:kind");
|
|
646
|
+
return ["allotments", "village_green", "playground"].includes(r);
|
|
647
|
+
}, "filter") }, { dataLayer: "landuse", symbolizer: new P({ fill: a.park_b, opacity: 0.7 }), filter: c((e, t) => {
|
|
648
|
+
let r = R(t.props, "pmap:kind");
|
|
649
|
+
return ["national_park", "park", "cemetery", "protected_area", "nature_reserve", "forest", "golf_course"].includes(r);
|
|
650
|
+
}, "filter") }, { dataLayer: "landuse", symbolizer: new P({ fill: a.hospital }), filter: c((e, t) => t.props["pmap:kind"] === "hospital", "filter") }, { dataLayer: "landuse", symbolizer: new P({ fill: a.industrial }), filter: c((e, t) => t.props["pmap:kind"] === "industrial", "filter") }, { dataLayer: "landuse", symbolizer: new P({ fill: a.school }), filter: c((e, t) => {
|
|
651
|
+
let r = R(t.props, "pmap:kind");
|
|
652
|
+
return ["school", "university", "college"].includes(r);
|
|
653
|
+
}, "filter") }, { dataLayer: "landuse", symbolizer: new P({ fill: a.beach }), filter: c((e, t) => t.props["pmap:kind"] === "beach", "filter") }, { dataLayer: "landuse", symbolizer: new P({ fill: a.zoo }), filter: c((e, t) => t.props["pmap:kind"] === "zoo", "filter") }, { dataLayer: "landuse", symbolizer: new P({ fill: a.zoo }), filter: c((e, t) => {
|
|
654
|
+
let r = R(t.props, "pmap:kind");
|
|
655
|
+
return ["military", "naval_base", "airfield"].includes(r);
|
|
656
|
+
}, "filter") }, { dataLayer: "natural", symbolizer: new P({ fill: c((e, t) => mix(a.wood_a, a.wood_b, Math.min(Math.max(e / 12, 12), 0)), "fill") }), filter: c((e, t) => {
|
|
657
|
+
let r = R(t.props, "pmap:kind");
|
|
658
|
+
return ["wood", "nature_reserve", "forest"].includes(r);
|
|
659
|
+
}, "filter") }, { dataLayer: "natural", symbolizer: new P({ fill: c((e, t) => mix(a.scrub_a, a.scrub_b, Math.min(Math.max(e / 12, 12), 0)), "fill") }), filter: c((e, t) => {
|
|
660
|
+
let r = R(t.props, "pmap:kind");
|
|
661
|
+
return ["scrub", "grassland", "grass"].includes(r);
|
|
662
|
+
}, "filter") }, { dataLayer: "natural", symbolizer: new P({ fill: a.scrub_b }), filter: c((e, t) => {
|
|
663
|
+
let r = R(t.props, "pmap:kind");
|
|
664
|
+
return ["scrub", "grassland", "grass"].includes(r);
|
|
665
|
+
}, "filter") }, { dataLayer: "natural", symbolizer: new P({ fill: a.glacier }), filter: c((e, t) => t.props["pmap:kind"] === "glacier", "filter") }, { dataLayer: "natural", symbolizer: new P({ fill: a.sand }), filter: c((e, t) => t.props["pmap:kind"] === "sand", "filter") }, { dataLayer: "landuse", symbolizer: new P({ fill: a.aerodrome }), filter: c((e, t) => t.props["pmap:kind"] === "aerodrome", "filter") }, { dataLayer: "water", symbolizer: new P({ fill: a.water }) }, { dataLayer: "transit", symbolizer: new M({ color: a.runway, width: c((e, t) => F(1.6, [[11, 0], [13, 4], [19, 30]])(e), "width") }), filter: c((e, t) => t.props["pmap:kind_detail"] === "runway", "filter") }, { dataLayer: "transit", symbolizer: new M({ color: a.runway, width: c((e, t) => F(1.6, [[14, 0], [14.5, 1], [16, 6]])(e), "width") }), filter: c((e, t) => t.props["pmap:kind_detail"] === "taxiway", "filter") }, { dataLayer: "transit", symbolizer: new M({ color: a.pier, width: c((e, t) => F(1.6, [[13, 0], [13.5, 0, 5], [21, 16]])(e), "width") }), filter: c((e, t) => t.props["pmap:kind"] === "pier", "filter") }, { dataLayer: "physical_line", minzoom: 14, symbolizer: new M({ color: a.water, width: c((e, t) => F(1.6, [[9, 0], [9.5, 1], [18, 12]])(e), "width") }), filter: c((e, t) => t.props["pmap:kind"] === "river", "filter") }, { dataLayer: "physical_line", minzoom: 14, symbolizer: new M({ color: a.water, width: 0.5 }), filter: c((e, t) => t.props["pmap:kind"] === "stream", "filter") }, { dataLayer: "landuse", symbolizer: new P({ fill: a.pedestrian }), filter: c((e, t) => t.props["pmap:kind"] === "pedestrian", "filter") }, { dataLayer: "landuse", symbolizer: new P({ fill: a.pier }), filter: c((e, t) => t.props["pmap:kind"] === "pier", "filter") }, { dataLayer: "buildings", symbolizer: new P({ fill: a.buildings, opacity: 0.5 }) }, { dataLayer: "roads", symbolizer: new M({ color: a.major, width: c((e, t) => F(1.6, [[14, 0], [20, 7]])(e), "width") }), filter: c((e, t) => {
|
|
666
|
+
let r = R(t.props, "pmap:kind");
|
|
667
|
+
return ["other", "path"].includes(r);
|
|
668
|
+
}, "filter") }, { dataLayer: "roads", symbolizer: new M({ color: a.major, width: c((e, t) => F(1.6, [[13, 0], [18, 8]])(e), "width") }), filter: c((e, t) => t.props["pmap:kind"] === "minor_road", "filter") }, { dataLayer: "roads", symbolizer: new M({ color: a.major, width: c((e, t) => F(1.6, [[7, 0], [12, 1.2], [15, 3], [18, 13]])(e), "width") }), filter: c((e, t) => t.props["pmap:kind"] === "medium_road", "filter") }, { dataLayer: "roads", symbolizer: new M({ color: a.major, width: c((e, t) => F(1.6, [[6, 0], [12, 1.6], [15, 3], [18, 13]])(e), "width") }), filter: c((e, t) => t.props["pmap:kind"] === "major_road", "filter") }, { dataLayer: "roads", symbolizer: new M({ color: a.major, width: c((e, t) => F(1.6, [[3, 0], [6, 1.1], [12, 1.6], [15, 5], [18, 15]])(e), "width") }), filter: c((e, t) => t.props["pmap:kind"] === "highway", "filter") }, { dataLayer: "boundaries", symbolizer: new M({ dash: [3, 2], color: a.boundaries, width: 1 }), filter: c((e, t) => {
|
|
669
|
+
let r = t.props["pmap:min_admin_level"];
|
|
670
|
+
return typeof r == "number" && r <= 2;
|
|
671
|
+
}, "filter") }, { dataLayer: "transit", symbolizer: new M({ dash: [0.3, 0.75], color: a.railway, dashWidth: c((e, t) => F(1.6, [[4, 0], [7, 0.15], [19, 9]])(e), "dashWidth"), opacity: 0.5 }), filter: c((e, t) => t.props["pmap:kind"] === "rail", "filter") }, { dataLayer: "boundaries", symbolizer: new M({ dash: [3, 2], color: a.boundaries, width: 0.5 }), filter: c((e, t) => {
|
|
672
|
+
let r = t.props["pmap:min_admin_level"];
|
|
673
|
+
return typeof r == "number" && r > 2;
|
|
674
|
+
}, "filter") }], "paintRules"), se = c((a) => {
|
|
675
|
+
let e = ["name"];
|
|
676
|
+
return [{ dataLayer: "roads", symbolizer: new $({ labelProps: e, fill: a.roads_label_minor, font: "400 12px sans-serif", width: 2, stroke: a.roads_label_minor_halo }), minzoom: 16, filter: c((t, r) => {
|
|
677
|
+
let n = R(r.props, "pmap:kind");
|
|
678
|
+
return ["minor_road", "other", "path"].includes(n);
|
|
679
|
+
}, "filter") }, { dataLayer: "roads", symbolizer: new $({ labelProps: e, fill: a.roads_label_major, font: "400 12px sans-serif", width: 2, stroke: a.roads_label_major_halo }), minzoom: 12, filter: c((t, r) => {
|
|
680
|
+
let n = R(r.props, "pmap:kind");
|
|
681
|
+
return ["highway", "major_road", "medium_road"].includes(n);
|
|
682
|
+
}, "filter") }, { dataLayer: "roads", symbolizer: new $({ labelProps: e, fill: a.roads_label_major, font: "400 12px sans-serif", width: 2, stroke: a.roads_label_major_halo }), minzoom: 12, filter: c((t, r) => {
|
|
683
|
+
let n = R(r.props, "pmap:kind");
|
|
684
|
+
return ["highway", "major_road", "medium_road"].includes(n);
|
|
685
|
+
}, "filter") }, { dataLayer: "physical_point", symbolizer: new I({ labelProps: e, fill: a.ocean_label, lineHeight: 1.5, letterSpacing: 1, font: c((t, r) => `400 ${Le([[3, 10], [10, 12]])(t)}px sans-serif`, "font"), textTransform: "uppercase" }), filter: c((t, r) => {
|
|
686
|
+
let n = R(r.props, "pmap:kind");
|
|
687
|
+
return ["ocean", "bay", "strait", "fjord"].includes(n);
|
|
688
|
+
}, "filter") }, { dataLayer: "physical_point", symbolizer: new I({ labelProps: e, fill: a.ocean_label, lineHeight: 1.5, letterSpacing: 1, font: c((t, r) => `400 ${Le([[3, 0], [6, 12], [10, 12]])(t)}px sans-serif`, "font") }), filter: c((t, r) => {
|
|
689
|
+
let n = R(r.props, "pmap:kind");
|
|
690
|
+
return ["sea", "lake", "water"].includes(n);
|
|
691
|
+
}, "filter") }, { dataLayer: "places", symbolizer: new I({ labelProps: c((t, r) => t < 6 ? ["name:short"] : e, "labelProps"), fill: a.state_label, stroke: a.state_label_halo, width: 1, lineHeight: 1.5, font: c((t, r) => t < 6 ? "400 16px sans-serif" : "400 12px sans-serif", "font"), textTransform: "uppercase" }), filter: c((t, r) => r.props["pmap:kind"] === "region", "filter") }, { dataLayer: "places", symbolizer: new I({ labelProps: e, fill: a.country_label, lineHeight: 1.5, font: c((t, r) => "600 12px sans-serif", "font"), textTransform: "uppercase" }), filter: c((t, r) => r.props["pmap:kind"] === "country", "filter") }, { dataLayer: "places", minzoom: 9, symbolizer: new I({ labelProps: e, fill: a.city_label, lineHeight: 1.5, font: c((t, r) => {
|
|
692
|
+
if (!r) return "400 12px sans-serif";
|
|
693
|
+
let n = r.props["pmap:min_zoom"], i = 400;
|
|
694
|
+
n && n <= 5 && (i = 600);
|
|
695
|
+
let s = 12, l = r.props["pmap:population_rank"];
|
|
696
|
+
return l && l > 9 && (s = 16), `${i} ${s}px sans-serif`;
|
|
697
|
+
}, "font") }), sort: c((t, r) => {
|
|
698
|
+
let n = ct(t, "pmap:population_rank"), i = ct(r, "pmap:population_rank");
|
|
699
|
+
return n - i;
|
|
700
|
+
}, "sort"), filter: c((t, r) => r.props["pmap:kind"] === "locality", "filter") }, { dataLayer: "places", maxzoom: 8, symbolizer: new re([new te({ radius: 2, fill: a.city_circle, stroke: a.city_circle_stroke, width: 1.5 }), new ie({ labelProps: e, fill: a.city_label, stroke: a.city_label_halo, width: 1, offsetX: 6, offsetY: 4.5, font: c((t, r) => "400 12px sans-serif", "font") })]), filter: c((t, r) => r.props["pmap:kind"] === "locality", "filter") }];
|
|
701
|
+
}, "labelRules");
|
|
702
|
+
var Ft = { background: "#cccccc", earth: "#e0e0e0", park_a: "#cfddd5", park_b: "#9cd3b4", hospital: "#e4dad9", industrial: "#d1dde1", school: "#e4ded7", wood_a: "#d0ded0", wood_b: "#a0d9a0", pedestrian: "#e3e0d4", scrub_a: "#cedcd7", scrub_b: "#99d2bb", glacier: "#e7e7e7", sand: "#e2e0d7", beach: "#e8e4d0", aerodrome: "#dadbdf", runway: "#e9e9ed", water: "#80deea", pier: "#e0e0e0", zoo: "#c6dcdc", military: "#dcdcdc", tunnel_other_casing: "#e0e0e0", tunnel_minor_casing: "#e0e0e0", tunnel_link_casing: "#e0e0e0", tunnel_medium_casing: "#e0e0e0", tunnel_major_casing: "#e0e0e0", tunnel_highway_casing: "#e0e0e0", tunnel_other: "#d5d5d5", tunnel_minor: "#d5d5d5", tunnel_link: "#d5d5d5", tunnel_medium: "#d5d5d5", tunnel_major: "#d5d5d5", tunnel_highway: "#d5d5d5", transit_pier: "#e0e0e0", buildings: "#cccccc", minor_service_casing: "#e0e0e0", minor_casing: "#e0e0e0", link_casing: "#e0e0e0", medium_casing: "#e0e0e0", major_casing_late: "#e0e0e0", highway_casing_late: "#e0e0e0", other: "#ebebeb", minor_service: "#ebebeb", minor_a: "#ebebeb", minor_b: "#ffffff", link: "#ffffff", medium: "#f5f5f5", major_casing_early: "#e0e0e0", major: "#ffffff", highway_casing_early: "#e0e0e0", highway: "#ffffff", railway: "#a7b1b3", boundaries: "#adadad", waterway_label: "#ffffff", bridges_other_casing: "#e0e0e0", bridges_minor_casing: "#e0e0e0", bridges_link_casing: "#e0e0e0", bridges_medium_casing: "#e0e0e0", bridges_major_casing: "#e0e0e0", bridges_highway_casing: "#e0e0e0", bridges_other: "#ebebeb", bridges_minor: "#ffffff", bridges_link: "#ffffff", bridges_medium: "#f0eded", bridges_major: "#f5f5f5", bridges_highway: "#ffffff", roads_label_minor: "#91888b", roads_label_minor_halo: "#ffffff", roads_label_major: "#938a8d", roads_label_major_halo: "#ffffff", ocean_label: "#ffffff", peak_label: "#7e9aa0", subplace_label: "#8f8f8f", subplace_label_halo: "#e0e0e0", city_circle: "#ffffff", city_circle_stroke: "#a3a3a3", city_label: "#5c5c5c", city_label_halo: "#e0e0e0", state_label: "#b3b3b3", state_label_halo: "#e0e0e0", country_label: "#a3a3a3" }, jt = { background: "#34373d", earth: "#1f1f1f", park_a: "#232325", park_b: "#232325", hospital: "#252424", industrial: "#222222", school: "#262323", wood_a: "#202121", wood_b: "#202121", pedestrian: "#1e1e1e", scrub_a: "#222323", scrub_b: "#222323", glacier: "#1c1c1c", sand: "#212123", beach: "#28282a", aerodrome: "#1e1e1e", runway: "#333333", water: "#34373d", pier: "#222222", zoo: "#222323", military: "#242323", tunnel_other_casing: "#141414", tunnel_minor_casing: "#141414", tunnel_link_casing: "#141414", tunnel_medium_casing: "#141414", tunnel_major_casing: "#141414", tunnel_highway_casing: "#141414", tunnel_other: "#292929", tunnel_minor: "#292929", tunnel_link: "#292929", tunnel_medium: "#292929", tunnel_major: "#292929", tunnel_highway: "#292929", transit_pier: "#333333", buildings: "#111111", minor_service_casing: "#1f1f1f", minor_casing: "#1f1f1f", link_casing: "#1f1f1f", medium_casing: "#1f1f1f", major_casing_late: "#1f1f1f", highway_casing_late: "#1f1f1f", other: "#333333", minor_service: "#333333", minor_a: "#3d3d3d", minor_b: "#333333", link: "#3d3d3d", medium: "#3d3d3d", major_casing_early: "#1f1f1f", major: "#3d3d3d", highway_casing_early: "#1f1f1f", highway: "#474747", railway: "#000000", boundaries: "#5b6374", waterway_label: "#717784", bridges_other_casing: "#2b2b2b", bridges_minor_casing: "#1f1f1f", bridges_link_casing: "#1f1f1f", bridges_medium_casing: "#1f1f1f", bridges_major_casing: "#1f1f1f", bridges_highway_casing: "#1f1f1f", bridges_other: "#333333", bridges_minor: "#333333", bridges_link: "#3d3d3d", bridges_medium: "#3d3d3d", bridges_major: "#3d3d3d", bridges_highway: "#474747", roads_label_minor: "#525252", roads_label_minor_halo: "#1f1f1f", roads_label_major: "#666666", roads_label_major_halo: "#1f1f1f", ocean_label: "#717784", peak_label: "#898080", subplace_label: "#525252", subplace_label_halo: "#1f1f1f", city_circle: "#000000", city_circle_stroke: "#7a7a7a", city_label: "#7a7a7a", city_label_halo: "#212121", state_label: "#3d3d3d", state_label_halo: "#1f1f1f", country_label: "#5c5c5c" }, Xt = { background: "#ffffff", earth: "#ffffff", park_a: "#fcfcfc", park_b: "#fcfcfc", hospital: "#f8f8f8", industrial: "#fcfcfc", school: "#f8f8f8", wood_a: "#fafafa", wood_b: "#fafafa", pedestrian: "#fdfdfd", scrub_a: "#fafafa", scrub_b: "#fafafa", glacier: "#fcfcfc", sand: "#fafafa", beach: "#f6f6f6", aerodrome: "#fdfdfd", runway: "#efefef", water: "#dcdcdc", pier: "#f5f5f5", zoo: "#f7f7f7", military: "#fcfcfc", tunnel_other_casing: "#d6d6d6", tunnel_minor_casing: "#fcfcfc", tunnel_link_casing: "#fcfcfc", tunnel_medium_casing: "#fcfcfc", tunnel_major_casing: "#fcfcfc", tunnel_highway_casing: "#fcfcfc", tunnel_other: "#d6d6d6", tunnel_minor: "#d6d6d6", tunnel_link: "#d6d6d6", tunnel_medium: "#d6d6d6", tunnel_major: "#d6d6d6", tunnel_highway: "#d6d6d6", transit_pier: "#efefef", buildings: "#efefef", minor_service_casing: "#ffffff", minor_casing: "#ffffff", link_casing: "#ffffff", medium_casing: "#ffffff", major_casing_late: "#ffffff", highway_casing_late: "#ffffff", other: "#f5f5f5", minor_service: "#f5f5f5", minor_a: "#ebebeb", minor_b: "#f5f5f5", link: "#ebebeb", medium: "#ebebeb", major_casing_early: "#ffffff", major: "#ebebeb", highway_casing_early: "#ffffff", highway: "#ebebeb", railway: "#d6d6d6", boundaries: "#adadad", waterway_label: "#adadad", bridges_other_casing: "#ffffff", bridges_minor_casing: "#ffffff", bridges_link_casing: "#ffffff", bridges_medium_casing: "#ffffff", bridges_major_casing: "#ffffff", bridges_highway_casing: "#ffffff", bridges_other: "#f5f5f5", bridges_minor: "#f5f5f5", bridges_link: "#ebebeb", bridges_medium: "#ebebeb", bridges_major: "#ebebeb", bridges_highway: "#ebebeb", roads_label_minor: "#adadad", roads_label_minor_halo: "#ffffff", roads_label_major: "#999999", roads_label_major_halo: "#ffffff", ocean_label: "#adadad", peak_label: "#adadad", subplace_label: "#8f8f8f", subplace_label_halo: "#ffffff", city_circle: "#ffffff", city_circle_stroke: "#adadad", city_label: "#5c5c5c", city_label_halo: "#ffffff", state_label: "#b3b3b3", state_label_halo: "#ffffff", country_label: "#b8b8b8" }, Yt = { background: "#a3a3a3", earth: "#cccccc", park_a: "#c2c2c2", park_b: "#c2c2c2", hospital: "#d0d0d0", industrial: "#c6c6c6", school: "#d0d0d0", wood_a: "#c2c2c2", wood_b: "#c2c2c2", pedestrian: "#c4c4c4", scrub_a: "#c2c2c2", scrub_b: "#c2c2c2", glacier: "#d2d2d2", sand: "#d2d2d2", beach: "#d2d2d2", aerodrome: "#c9c9c9", runway: "#f5f5f5", water: "#a3a3a3", pier: "#b8b8b8", zoo: "#c7c7c7", military: "#bfbfbf", tunnel_other_casing: "#b8b8b8", tunnel_minor_casing: "#b8b8b8", tunnel_link_casing: "#b8b8b8", tunnel_medium_casing: "#b8b8b8", tunnel_major_casing: "#b8b8b8", tunnel_highway_casing: "#b8b8b8", tunnel_other: "#d6d6d6", tunnel_minor: "#d6d6d6", tunnel_link: "#d6d6d6", tunnel_medium: "#d6d6d6", tunnel_major: "#d6d6d6", tunnel_highway: "#d6d6d6", transit_pier: "#b8b8b8", buildings: "#e0e0e0", minor_service_casing: "#cccccc", minor_casing: "#cccccc", link_casing: "#cccccc", medium_casing: "#cccccc", major_casing_late: "#cccccc", highway_casing_late: "#cccccc", other: "#e0e0e0", minor_service: "#e0e0e0", minor_a: "#ebebeb", minor_b: "#e0e0e0", link: "#ebebeb", medium: "#ebebeb", major_casing_early: "#cccccc", major: "#ebebeb", highway_casing_early: "#cccccc", highway: "#ebebeb", railway: "#f5f5f5", boundaries: "#5c5c5c", waterway_label: "#7a7a7a", bridges_other_casing: "#cccccc", bridges_minor_casing: "#cccccc", bridges_link_casing: "#cccccc", bridges_medium_casing: "#cccccc", bridges_major_casing: "#cccccc", bridges_highway_casing: "#cccccc", bridges_other: "#e0e0e0", bridges_minor: "#e0e0e0", bridges_link: "#ebebeb", bridges_medium: "#ebebeb", bridges_major: "#ebebeb", bridges_highway: "#ebebeb", roads_label_minor: "#999999", roads_label_minor_halo: "#e0e0e0", roads_label_major: "#8f8f8f", roads_label_major_halo: "#ebebeb", ocean_label: "#7a7a7a", peak_label: "#5c5c5c", subplace_label: "#7a7a7a", subplace_label_halo: "#cccccc", city_circle: "#c2c2c2", city_circle_stroke: "#7a7a7a", city_label: "#474747", city_label_halo: "#cccccc", state_label: "#999999", state_label_halo: "#cccccc", country_label: "#858585" }, It = { background: "#2b2b2b", earth: "#141414", park_a: "#181818", park_b: "#181818", hospital: "#1d1d1d", industrial: "#101010", school: "#111111", wood_a: "#1a1a1a", wood_b: "#1a1a1a", pedestrian: "#191919", scrub_a: "#1c1c1c", scrub_b: "#1c1c1c", glacier: "#191919", sand: "#161616", beach: "#1f1f1f", aerodrome: "#191919", runway: "#323232", water: "#333333", pier: "#0a0a0a", zoo: "#191919", military: "#121212", tunnel_other_casing: "#101010", tunnel_minor_casing: "#101010", tunnel_link_casing: "#101010", tunnel_medium_casing: "#101010", tunnel_major_casing: "#101010", tunnel_highway_casing: "#101010", tunnel_other: "#292929", tunnel_minor: "#292929", tunnel_link: "#292929", tunnel_medium: "#292929", tunnel_major: "#292929", tunnel_highway: "#292929", transit_pier: "#0a0a0a", buildings: "#0a0a0a", minor_service_casing: "#141414", minor_casing: "#141414", link_casing: "#141414", medium_casing: "#141414", major_casing_late: "#141414", highway_casing_late: "#141414", other: "#1f1f1f", minor_service: "#1f1f1f", minor_a: "#292929", minor_b: "#1f1f1f", link: "#1f1f1f", medium: "#292929", major_casing_early: "#141414", major: "#292929", highway_casing_early: "#141414", highway: "#292929", railway: "#292929", boundaries: "#707070", waterway_label: "#707070", bridges_other_casing: "#141414", bridges_minor_casing: "#141414", bridges_link_casing: "#141414", bridges_medium_casing: "#141414", bridges_major_casing: "#141414", bridges_highway_casing: "#141414", bridges_other: "#1f1f1f", bridges_minor: "#1f1f1f", bridges_link: "#292929", bridges_medium: "#292929", bridges_major: "#292929", bridges_highway: "#292929", roads_label_minor: "#525252", roads_label_minor_halo: "#141414", roads_label_major: "#5c5c5c", roads_label_major_halo: "#141414", ocean_label: "#707070", peak_label: "#707070", subplace_label: "#5c5c5c", subplace_label_halo: "#141414", city_circle: "#000000", city_circle_stroke: "#666666", city_label: "#999999", city_label_halo: "#141414", state_label: "#3d3d3d", state_label_halo: "#141414", country_label: "#707070" }, oe = { light: Ft, dark: jt, white: Xt, grayscale: Yt, black: It };
|
|
703
|
+
var ce = c((a, e, t) => {
|
|
704
|
+
let r = [];
|
|
705
|
+
for (let n of a) {
|
|
706
|
+
let i = [];
|
|
707
|
+
for (let s of n) i.push(s.clone().mult(e).add(t));
|
|
708
|
+
r.push(i);
|
|
709
|
+
}
|
|
710
|
+
return r;
|
|
711
|
+
}, "transformGeom"), le = c((a, e) => {
|
|
712
|
+
let t = 1 << e;
|
|
713
|
+
return a < 0 ? t + a : a >= t ? a % t : a;
|
|
714
|
+
}, "wrap"), $e = class $e2 {
|
|
715
|
+
constructor(e, t, r) {
|
|
716
|
+
this.tileCache = e, this.maxDataLevel = t, this.levelDiff = r;
|
|
717
|
+
}
|
|
718
|
+
dataTilesForBounds(e, t) {
|
|
719
|
+
let r = C(2, e) / C(2, Math.ceil(e)), n = [], i = 1, s = this.tileCache.tileSize;
|
|
720
|
+
if (e < this.levelDiff) i = 1 / (1 << this.levelDiff - e) * r, n.push({ dataTile: { z: 0, x: 0, y: 0 }, origin: new Point(0, 0), scale: i, dim: s * i });
|
|
721
|
+
else if (e <= this.levelDiff + this.maxDataLevel) {
|
|
722
|
+
let l = 1 << this.levelDiff, o = 256 * r, f = Math.ceil(e) - this.levelDiff, u = Math.floor(t.minX / l / o), m = Math.floor(t.minY / l / o), d = Math.floor(t.maxX / l / o), h = Math.floor(t.maxY / l / o);
|
|
723
|
+
for (let g = u; g <= d; g++) for (let y = m; y <= h; y++) {
|
|
724
|
+
let _ = new Point(g * l * o, y * l * o);
|
|
725
|
+
n.push({ dataTile: { z: f, x: le(g, f), y: le(y, f) }, origin: _, scale: r, dim: s * r });
|
|
726
|
+
}
|
|
727
|
+
} else {
|
|
728
|
+
let l = 1 << this.levelDiff;
|
|
729
|
+
i = (1 << Math.ceil(e) - this.maxDataLevel - this.levelDiff) * r;
|
|
730
|
+
let o = Math.floor(t.minX / l / 256 / i), f = Math.floor(t.minY / l / 256 / i), u = Math.floor(t.maxX / l / 256 / i), m = Math.floor(t.maxY / l / 256 / i);
|
|
731
|
+
for (let d = o; d <= u; d++) for (let h = f; h <= m; h++) {
|
|
732
|
+
let g = new Point(d * l * 256 * i, h * l * 256 * i);
|
|
733
|
+
n.push({ dataTile: { z: this.maxDataLevel, x: le(d, this.maxDataLevel), y: le(h, this.maxDataLevel) }, origin: g, scale: i, dim: s * i });
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
return n;
|
|
737
|
+
}
|
|
738
|
+
dataTileForDisplayTile(e) {
|
|
739
|
+
let t, r = 1, n = this.tileCache.tileSize, i;
|
|
740
|
+
if (e.z < this.levelDiff) t = { z: 0, x: 0, y: 0 }, r = 1 / (1 << this.levelDiff - e.z), i = new Point(0, 0), n = n * r;
|
|
741
|
+
else if (e.z <= this.levelDiff + this.maxDataLevel) {
|
|
742
|
+
let s = 1 << this.levelDiff;
|
|
743
|
+
t = { z: e.z - this.levelDiff, x: Math.floor(e.x / s), y: Math.floor(e.y / s) }, i = new Point(t.x * s * 256, t.y * s * 256);
|
|
744
|
+
} else {
|
|
745
|
+
r = 1 << e.z - this.maxDataLevel - this.levelDiff;
|
|
746
|
+
let s = 1 << this.levelDiff;
|
|
747
|
+
t = { z: this.maxDataLevel, x: Math.floor(e.x / s / r), y: Math.floor(e.y / s / r) }, i = new Point(t.x * s * r * 256, t.y * s * r * 256), n = n * r;
|
|
748
|
+
}
|
|
749
|
+
return { dataTile: t, scale: r, origin: i, dim: n };
|
|
750
|
+
}
|
|
751
|
+
getBbox(e, t) {
|
|
752
|
+
return D(this, null, function* () {
|
|
753
|
+
let r = this.dataTilesForBounds(e, t);
|
|
754
|
+
return (yield Promise.all(r.map((i) => this.tileCache.get(i.dataTile)))).map((i, s) => {
|
|
755
|
+
let l = r[s];
|
|
756
|
+
return { data: i, z: e, dataTile: l.dataTile, scale: l.scale, dim: l.dim, origin: l.origin };
|
|
757
|
+
});
|
|
758
|
+
});
|
|
759
|
+
}
|
|
760
|
+
getDisplayTile(e) {
|
|
761
|
+
return D(this, null, function* () {
|
|
762
|
+
let t = this.dataTileForDisplayTile(e);
|
|
763
|
+
return { data: yield this.tileCache.get(t.dataTile), z: e.z, dataTile: t.dataTile, scale: t.scale, origin: t.origin, dim: t.dim };
|
|
764
|
+
});
|
|
765
|
+
}
|
|
766
|
+
queryFeatures(e, t, r, n) {
|
|
767
|
+
let i = Math.round(r), s = Math.min(i - this.levelDiff, this.maxDataLevel), l = n / (1 << i - s);
|
|
768
|
+
return this.tileCache.queryFeatures(e, t, s, l);
|
|
769
|
+
}
|
|
770
|
+
};
|
|
771
|
+
c($e, "View");
|
|
772
|
+
var Ne = $e, fe = c((a) => {
|
|
773
|
+
let e = c((r) => {
|
|
774
|
+
let n = r.levelDiff === void 0 ? 1 : r.levelDiff, i = r.maxDataZoom || 15, s;
|
|
775
|
+
if (typeof r.url == "string") new URL(r.url, "http://example.com").pathname.endsWith(".pmtiles") ? s = new H(r.url, true) : s = new Q(r.url, true);
|
|
776
|
+
else if (r.url) s = new H(r.url, true);
|
|
777
|
+
else throw new Error(`Invalid source ${r.url}`);
|
|
778
|
+
let l = new ee(s, 256 * 1 << n);
|
|
779
|
+
return new Ne(l, i, n);
|
|
780
|
+
}, "sourceToViews"), t = /* @__PURE__ */ new Map();
|
|
781
|
+
if (a.sources) for (let r in a.sources) t.set(r, e(a.sources[r]));
|
|
782
|
+
else t.set("", e(a));
|
|
783
|
+
return t;
|
|
784
|
+
}, "sourcesToViews");
|
|
785
|
+
var Nt = c((a, e, t) => {
|
|
786
|
+
let n = e / 256, i = Math.floor(t.minX / 256), s = Math.floor(t.minY / 256), l = Math.floor(t.maxX / 256), o = Math.floor(t.maxY / 256), f = Math.log2(n), u = [];
|
|
787
|
+
for (let m = i; m <= l; m++) {
|
|
788
|
+
let d = m % (1 << a);
|
|
789
|
+
for (let h = s; h <= o; h++) u.push({ display: Y({ z: a, x: d, y: h }), key: Y({ z: a - f, x: Math.floor(d / n), y: Math.floor(h / n) }) });
|
|
790
|
+
}
|
|
791
|
+
return u;
|
|
792
|
+
}, "covering"), We = class We2 {
|
|
793
|
+
constructor(e, t) {
|
|
794
|
+
this.tree = new RBush(), this.current = /* @__PURE__ */ new Map(), this.dim = e, this.maxLabeledTiles = t;
|
|
795
|
+
}
|
|
796
|
+
hasPrefix(e) {
|
|
797
|
+
for (let t of this.current.keys()) if (t.startsWith(e)) return true;
|
|
798
|
+
return false;
|
|
799
|
+
}
|
|
800
|
+
has(e) {
|
|
801
|
+
return this.current.has(e);
|
|
802
|
+
}
|
|
803
|
+
size() {
|
|
804
|
+
return this.current.size;
|
|
805
|
+
}
|
|
806
|
+
keys() {
|
|
807
|
+
return this.current.keys();
|
|
808
|
+
}
|
|
809
|
+
searchBbox(e, t) {
|
|
810
|
+
let r = /* @__PURE__ */ new Set();
|
|
811
|
+
for (let n of this.tree.search(e)) n.indexedLabel.order <= t && r.add(n.indexedLabel);
|
|
812
|
+
return r;
|
|
813
|
+
}
|
|
814
|
+
searchLabel(e, t) {
|
|
815
|
+
let r = /* @__PURE__ */ new Set();
|
|
816
|
+
for (let n of e.bboxes) for (let i of this.tree.search(n)) i.indexedLabel.order <= t && r.add(i.indexedLabel);
|
|
817
|
+
return r;
|
|
818
|
+
}
|
|
819
|
+
bboxCollides(e, t) {
|
|
820
|
+
for (let r of this.tree.search(e)) if (r.indexedLabel.order <= t) return true;
|
|
821
|
+
return false;
|
|
822
|
+
}
|
|
823
|
+
labelCollides(e, t) {
|
|
824
|
+
for (let r of e.bboxes) for (let n of this.tree.search(r)) if (n.indexedLabel.order <= t) return true;
|
|
825
|
+
return false;
|
|
826
|
+
}
|
|
827
|
+
deduplicationCollides(e) {
|
|
828
|
+
if (!e.deduplicationKey || !e.deduplicationDistance) return false;
|
|
829
|
+
let t = e.deduplicationDistance, r = { minX: e.anchor.x - t, minY: e.anchor.y - t, maxX: e.anchor.x + t, maxY: e.anchor.y + t };
|
|
830
|
+
for (let n of this.tree.search(r)) if (n.indexedLabel.deduplicationKey === e.deduplicationKey && n.indexedLabel.anchor.dist(e.anchor) < t) return true;
|
|
831
|
+
return false;
|
|
832
|
+
}
|
|
833
|
+
makeEntry(e) {
|
|
834
|
+
this.current.get(e) && console.log("consistency error 1");
|
|
835
|
+
let t = /* @__PURE__ */ new Set();
|
|
836
|
+
this.current.set(e, t);
|
|
837
|
+
}
|
|
838
|
+
insert(e, t, r) {
|
|
839
|
+
let n = { anchor: e.anchor, bboxes: e.bboxes, draw: e.draw, order: t, tileKey: r, deduplicationKey: e.deduplicationKey, deduplicationDistance: e.deduplicationDistance }, i = this.current.get(r);
|
|
840
|
+
if (!i) {
|
|
841
|
+
let o = /* @__PURE__ */ new Set();
|
|
842
|
+
this.current.set(r, o), i = o;
|
|
843
|
+
}
|
|
844
|
+
i.add(n);
|
|
845
|
+
let s = false, l = false;
|
|
846
|
+
for (let o of e.bboxes) this.tree.insert({ minX: o.minX, minY: o.minY, maxX: o.maxX, maxY: o.maxY, indexedLabel: n }), o.minX < 0 && (s = true), o.maxX > this.dim && (l = true);
|
|
847
|
+
if (s || l) {
|
|
848
|
+
let o = s ? this.dim : -this.dim, f = [];
|
|
849
|
+
for (let d of e.bboxes) f.push({ minX: d.minX + o, minY: d.minY, maxX: d.maxX + o, maxY: d.maxY });
|
|
850
|
+
let u = { anchor: new Point(e.anchor.x + o, e.anchor.y), bboxes: f, draw: e.draw, order: t, tileKey: r }, m = this.current.get(r);
|
|
851
|
+
m && m.add(u);
|
|
852
|
+
for (let d of f) this.tree.insert({ minX: d.minX, minY: d.minY, maxX: d.maxX, maxY: d.maxY, indexedLabel: u });
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
pruneOrNoop(e) {
|
|
856
|
+
let t = e.split(":"), r, n = 0, i = 0;
|
|
857
|
+
for (let s of this.current.keys()) {
|
|
858
|
+
let l = s.split(":");
|
|
859
|
+
if (l[3] === t[3]) {
|
|
860
|
+
i++;
|
|
861
|
+
let o = Math.sqrt(C(+l[0] - +t[0], 2) + C(+l[1] - +t[1], 2));
|
|
862
|
+
o > n && (n = o, r = s);
|
|
863
|
+
}
|
|
864
|
+
r && i > this.maxLabeledTiles && this.pruneKey(r);
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
pruneKey(e) {
|
|
868
|
+
let t = this.current.get(e);
|
|
869
|
+
if (!t) return;
|
|
870
|
+
let r = [];
|
|
871
|
+
for (let n of this.tree.all()) t.has(n.indexedLabel) && r.push(n);
|
|
872
|
+
for (let n of r) this.tree.remove(n);
|
|
873
|
+
this.current.delete(e);
|
|
874
|
+
}
|
|
875
|
+
removeLabel(e) {
|
|
876
|
+
let t = [];
|
|
877
|
+
for (let n of this.tree.all()) e === n.indexedLabel && t.push(n);
|
|
878
|
+
for (let n of t) this.tree.remove(n);
|
|
879
|
+
let r = this.current.get(e.tileKey);
|
|
880
|
+
r && r.delete(e);
|
|
881
|
+
}
|
|
882
|
+
};
|
|
883
|
+
c(We, "Index");
|
|
884
|
+
var Je = We, He = class He2 {
|
|
885
|
+
constructor(e, t, r, n, i) {
|
|
886
|
+
this.index = new Je(256 * 1 << e, n), this.z = e, this.scratch = t, this.labelRules = r, this.callback = i;
|
|
887
|
+
}
|
|
888
|
+
layout(e) {
|
|
889
|
+
let t = performance.now(), r = /* @__PURE__ */ new Set();
|
|
890
|
+
for (let [i, s] of e) for (let l of s) {
|
|
891
|
+
let o = `${Y(l.dataTile)}:${i}`;
|
|
892
|
+
this.index.has(o) || (this.index.makeEntry(o), r.add(o));
|
|
893
|
+
}
|
|
894
|
+
let n = /* @__PURE__ */ new Set();
|
|
895
|
+
for (let [i, s] of this.labelRules.entries()) {
|
|
896
|
+
if (s.visible === false || s.minzoom && this.z < s.minzoom || s.maxzoom && this.z > s.maxzoom) continue;
|
|
897
|
+
let l = s.dataSource || "", o = e.get(l);
|
|
898
|
+
if (o) for (let f of o) {
|
|
899
|
+
let u = `${Y(f.dataTile)}:${l}`;
|
|
900
|
+
if (!r.has(u)) continue;
|
|
901
|
+
let m = f.data.get(s.dataLayer);
|
|
902
|
+
if (m === void 0) continue;
|
|
903
|
+
let d = m;
|
|
904
|
+
s.sort && d.sort((g, y) => s.sort ? s.sort(g.props, y.props) : 0);
|
|
905
|
+
let h = { index: this.index, zoom: this.z, scratch: this.scratch, order: i, overzoom: this.z - f.dataTile.z };
|
|
906
|
+
for (let g of d) {
|
|
907
|
+
if (s.filter && !s.filter(this.z, g)) continue;
|
|
908
|
+
let y = ce(g.geom, f.scale, f.origin), _ = s.symbolizer.place(h, y, g);
|
|
909
|
+
if (_) for (let k of _) {
|
|
910
|
+
let p = false;
|
|
911
|
+
if (!(k.deduplicationKey && this.index.deduplicationCollides(k))) {
|
|
912
|
+
if (this.index.labelCollides(k, 1 / 0)) {
|
|
913
|
+
if (!this.index.labelCollides(k, i)) {
|
|
914
|
+
let x = this.index.searchLabel(k, 1 / 0);
|
|
915
|
+
for (let A of x) {
|
|
916
|
+
this.index.removeLabel(A);
|
|
917
|
+
for (let b of A.bboxes) this.findInvalidatedTiles(n, f.dim, b, u);
|
|
918
|
+
}
|
|
919
|
+
this.index.insert(k, i, u), p = true;
|
|
920
|
+
}
|
|
921
|
+
} else this.index.insert(k, i, u), p = true;
|
|
922
|
+
if (p) for (let x of k.bboxes) (x.maxX > f.origin.x + f.dim || x.minX < f.origin.x || x.minY < f.origin.y || x.maxY > f.origin.y + f.dim) && this.findInvalidatedTiles(n, f.dim, x, u);
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
for (let i of r) this.index.pruneOrNoop(i);
|
|
929
|
+
return n.size > 0 && this.callback && this.callback(n), performance.now() - t;
|
|
930
|
+
}
|
|
931
|
+
findInvalidatedTiles(e, t, r, n) {
|
|
932
|
+
let i = Nt(this.z, t, r);
|
|
933
|
+
for (let s of i) s.key !== n && this.index.hasPrefix(s.key) && e.add(s.display);
|
|
934
|
+
}
|
|
935
|
+
add(e) {
|
|
936
|
+
let t = true;
|
|
937
|
+
for (let [n, i] of e) for (let s of i) this.index.has(`${Y(s.dataTile)}:${n}`) || (t = false);
|
|
938
|
+
return t ? 0 : this.layout(e);
|
|
939
|
+
}
|
|
940
|
+
};
|
|
941
|
+
c(He, "Labeler");
|
|
942
|
+
var V = He, Ve = class Ve2 {
|
|
943
|
+
constructor(e, t, r, n) {
|
|
944
|
+
this.labelers = /* @__PURE__ */ new Map(), this.scratch = e, this.labelRules = t, this.maxLabeledTiles = r, this.callback = n;
|
|
945
|
+
}
|
|
946
|
+
add(e, t) {
|
|
947
|
+
let r = this.labelers.get(e);
|
|
948
|
+
return r || (r = new V(e, this.scratch, this.labelRules, this.maxLabeledTiles, this.callback), this.labelers.set(e, r)), r.add(t);
|
|
949
|
+
}
|
|
950
|
+
getIndex(e) {
|
|
951
|
+
let t = this.labelers.get(e);
|
|
952
|
+
if (t) return t.index;
|
|
953
|
+
}
|
|
954
|
+
};
|
|
955
|
+
c(Ve, "Labelers");
|
|
956
|
+
var Z = Ve;
|
|
957
|
+
function ue(a, e, t, r, n, i, s, l, o) {
|
|
958
|
+
let f = performance.now();
|
|
959
|
+
a.save(), a.miterLimit = 2;
|
|
960
|
+
for (let u of n) {
|
|
961
|
+
if (u.minzoom && e < u.minzoom || u.maxzoom && e > u.maxzoom) continue;
|
|
962
|
+
let m = t.get(u.dataSource || "");
|
|
963
|
+
if (m) for (let d of m) {
|
|
964
|
+
let h = d.data.get(u.dataLayer);
|
|
965
|
+
if (h === void 0) continue;
|
|
966
|
+
u.symbolizer.before && u.symbolizer.before(a, d.z);
|
|
967
|
+
let g = d.origin, y = d.dim, _ = d.scale;
|
|
968
|
+
if (a.save(), l) {
|
|
969
|
+
a.beginPath();
|
|
970
|
+
let k = Math.max(g.x - s.x, i.minX - s.x), p = Math.max(g.y - s.y, i.minY - s.y), x = Math.min(g.x - s.x + y, i.maxX - s.x), A = Math.min(g.y - s.y + y, i.maxY - s.y);
|
|
971
|
+
a.rect(k, p, x - k, A - p), a.clip();
|
|
972
|
+
}
|
|
973
|
+
a.translate(g.x - s.x, g.y - s.y);
|
|
974
|
+
for (let k of h) {
|
|
975
|
+
let p = k.geom, x = k.bbox;
|
|
976
|
+
x.maxX * _ + g.x < i.minX || x.minX * _ + g.x > i.maxX || x.minY * _ + g.y > i.maxY || x.maxY * _ + g.y < i.minY || u.filter && !u.filter(d.z, k) || (_ !== 1 && (p = ce(p, _, new Point(0, 0))), u.symbolizer.draw(a, p, d.z, k));
|
|
977
|
+
}
|
|
978
|
+
a.restore();
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
if (l && (a.beginPath(), a.rect(i.minX - s.x, i.minY - s.y, i.maxX - i.minX, i.maxY - i.minY), a.clip()), r) {
|
|
982
|
+
let u = r.searchBbox(i, 1 / 0);
|
|
983
|
+
for (let m of u) if (a.save(), a.translate(m.anchor.x - s.x, m.anchor.y - s.y), m.draw(a), a.restore(), o) {
|
|
984
|
+
a.lineWidth = 0.5, a.strokeStyle = o, a.fillStyle = o, a.globalAlpha = 1, a.fillRect(m.anchor.x - s.x - 2, m.anchor.y - s.y - 2, 4, 4);
|
|
985
|
+
for (let d of m.bboxes) a.strokeRect(d.minX - s.x, d.minY - s.y, d.maxX - d.minX, d.maxY - d.minY);
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
return a.restore(), performance.now() - f;
|
|
989
|
+
}
|
|
990
|
+
c(ue, "paint");
|
|
991
|
+
var K = 6378137, ft = 85.0511287798, j = K * Math.PI, mt = c((a) => {
|
|
992
|
+
let e = Math.PI / 180, t = Math.max(Math.min(ft, a.y), -ft), r = Math.sin(t * e);
|
|
993
|
+
return new Point(K * a.x * e, K * Math.log((1 + r) / (1 - r)) / 2);
|
|
994
|
+
}, "project"), Jt = c((a) => {
|
|
995
|
+
let e = 180 / Math.PI;
|
|
996
|
+
return { lat: (2 * Math.atan(Math.exp(a.y / K)) - Math.PI / 2) * e, lng: a.x * e / K };
|
|
997
|
+
}, "unproject"), Wt = c((a, e) => (t) => {
|
|
998
|
+
let r = mt(t);
|
|
999
|
+
return new Point((r.x + j) / (j * 2), 1 - (r.y + j) / (j * 2)).mult(C(2, e) * 256).sub(a);
|
|
1000
|
+
}, "instancedProject"), Ht = c((a, e) => (t) => {
|
|
1001
|
+
let r = new Point(t.x, t.y).add(a).div(C(2, e) * 256), n = new Point(r.x * (j * 2) - j, (1 - r.y) * (j * 2) - j);
|
|
1002
|
+
return Jt(n);
|
|
1003
|
+
}, "instancedUnproject"), ut = c((a, e) => {
|
|
1004
|
+
let t = e * (360 / a);
|
|
1005
|
+
return Math.log2(t / 256);
|
|
1006
|
+
}, "getZoom"), Ze = class Ze2 {
|
|
1007
|
+
constructor(e) {
|
|
1008
|
+
if (e.theme) {
|
|
1009
|
+
let t = oe[e.theme];
|
|
1010
|
+
this.paintRules = ae(t), this.labelRules = se(t), this.backgroundColor = t.background;
|
|
1011
|
+
} else this.paintRules = e.paintRules || [], this.labelRules = e.labelRules || [], this.backgroundColor = e.backgroundColor;
|
|
1012
|
+
this.views = fe(e), this.debug = e.debug || "";
|
|
1013
|
+
}
|
|
1014
|
+
drawContext(e, t, r, n, i) {
|
|
1015
|
+
return D(this, null, function* () {
|
|
1016
|
+
let s = mt(n), o = new Point((s.x + j) / (j * 2), 1 - (s.y + j) / (j * 2)).clone().mult(C(2, i) * 256).sub(new Point(t / 2, r / 2)), f = { minX: o.x, minY: o.y, maxX: o.x + t, maxY: o.y + r }, u = [];
|
|
1017
|
+
for (let [p, x] of this.views) {
|
|
1018
|
+
let A = x.getBbox(i, f);
|
|
1019
|
+
u.push({ key: p, promise: A });
|
|
1020
|
+
}
|
|
1021
|
+
let m = yield Promise.all(u.map((p) => p.promise.then((x) => ({ status: "fulfilled", value: x, key: p.key }), (x) => ({ status: "rejected", value: [], reason: x, key: p.key })))), d = /* @__PURE__ */ new Map();
|
|
1022
|
+
for (let p of m) p.status === "fulfilled" && d.set(p.key, p.value);
|
|
1023
|
+
let h = performance.now(), g = new V(i, e, this.labelRules, 16, void 0);
|
|
1024
|
+
g.add(d);
|
|
1025
|
+
this.backgroundColor && (e.save(), e.fillStyle = this.backgroundColor, e.fillRect(0, 0, t, r), e.restore());
|
|
1026
|
+
let _ = this.paintRules;
|
|
1027
|
+
ue(e, i, d, g.index, _, f, o, true, this.debug);
|
|
1028
|
+
if (this.debug) {
|
|
1029
|
+
e.save(), e.translate(-o.x, -o.y), e.strokeStyle = this.debug, e.fillStyle = this.debug, e.font = "12px sans-serif";
|
|
1030
|
+
let p = 0;
|
|
1031
|
+
for (let [x, A] of d) {
|
|
1032
|
+
for (let b of A) {
|
|
1033
|
+
e.strokeRect(b.origin.x, b.origin.y, b.dim, b.dim);
|
|
1034
|
+
let v = b.dataTile;
|
|
1035
|
+
e.fillText(`${x + (x ? " " : "") + v.z} ${v.x} ${v.y}`, b.origin.x + 4, b.origin.y + 14 * (1 + p));
|
|
1036
|
+
}
|
|
1037
|
+
p++;
|
|
1038
|
+
}
|
|
1039
|
+
e.restore();
|
|
1040
|
+
}
|
|
1041
|
+
return { elapsed: performance.now() - h, project: Wt(o, i), unproject: Ht(o, i) };
|
|
1042
|
+
});
|
|
1043
|
+
}
|
|
1044
|
+
drawCanvas(i, s, l) {
|
|
1045
|
+
return D(this, arguments, function* (e, t, r, n = {}) {
|
|
1046
|
+
let o = window.devicePixelRatio, f = e.clientWidth, u = e.clientHeight;
|
|
1047
|
+
e.width === f * o && e.height === u * o || (e.width = f * o, e.height = u * o), n.lang && (e.lang = n.lang);
|
|
1048
|
+
let m = e.getContext("2d");
|
|
1049
|
+
if (!m) {
|
|
1050
|
+
console.error("Failed to initialize canvas2d context.");
|
|
1051
|
+
return;
|
|
1052
|
+
}
|
|
1053
|
+
return m.setTransform(o, 0, 0, o, 0, 0), this.drawContext(m, f, u, t, r);
|
|
1054
|
+
});
|
|
1055
|
+
}
|
|
1056
|
+
drawContextBounds(e, t, r, n, i) {
|
|
1057
|
+
return D(this, null, function* () {
|
|
1058
|
+
let s = r.x - t.x, l = new Point((t.x + r.x) / 2, (t.y + r.y) / 2);
|
|
1059
|
+
return this.drawContext(e, n, i, l, ut(s, n));
|
|
1060
|
+
});
|
|
1061
|
+
}
|
|
1062
|
+
drawCanvasBounds(s, l, o, f) {
|
|
1063
|
+
return D(this, arguments, function* (e, t, r, n, i = {}) {
|
|
1064
|
+
let u = r.x - t.x, m = new Point((t.x + r.x) / 2, (t.y + r.y) / 2);
|
|
1065
|
+
return this.drawCanvas(e, m, ut(u, n), i);
|
|
1066
|
+
});
|
|
1067
|
+
}
|
|
1068
|
+
};
|
|
1069
|
+
c(Ze, "Static");
|
|
1070
|
+
var dt = Ze;
|
|
1071
|
+
var Zt = c((a) => new Promise((e) => {
|
|
1072
|
+
setTimeout(() => {
|
|
1073
|
+
e();
|
|
1074
|
+
}, a);
|
|
1075
|
+
}), "timer"), Kt = c((a) => a.then((e) => ({ status: "fulfilled", value: e }), (e) => ({ status: "rejected", reason: e })), "reflect"), Pn = c((a = {}) => {
|
|
1076
|
+
let t = class t extends L.GridLayer {
|
|
1077
|
+
constructor(n = {}) {
|
|
1078
|
+
if (n.noWrap && !n.bounds && (n.bounds = [[-90, -180], [90, 180]]), n.attribution == null && (n.attribution = '<a href="https://protomaps.com">Protomaps</a> © <a href="https://openstreetmap.org/copyright">OpenStreetMap</a>'), super(n), n.theme) {
|
|
1079
|
+
let s = oe[n.theme];
|
|
1080
|
+
this.paintRules = ae(s), this.labelRules = se(s), this.backgroundColor = s.background;
|
|
1081
|
+
} else this.paintRules = n.paintRules || [], this.labelRules = n.labelRules || [], this.backgroundColor = n.backgroundColor;
|
|
1082
|
+
this.lastRequestedZ = void 0, this.tasks = n.tasks || [], this.views = fe(n), this.debug = n.debug;
|
|
1083
|
+
let i = document.createElement("canvas").getContext("2d");
|
|
1084
|
+
this.scratch = i, this.onTilesInvalidated = (s) => {
|
|
1085
|
+
for (let l of s) this.rerenderTile(l);
|
|
1086
|
+
}, this.labelers = new Z(this.scratch, this.labelRules, 16, this.onTilesInvalidated), this.tileSize = 256 * window.devicePixelRatio, this.tileDelay = n.tileDelay || 3, this.lang = n.lang;
|
|
1087
|
+
}
|
|
1088
|
+
renderTile(n, i, s, l = () => {
|
|
1089
|
+
}) {
|
|
1090
|
+
return D(this, null, function* () {
|
|
1091
|
+
this.lastRequestedZ = n.z;
|
|
1092
|
+
let o = [];
|
|
1093
|
+
for (let [w, S] of this.views) {
|
|
1094
|
+
let de = S.getDisplayTile(n);
|
|
1095
|
+
o.push({ key: w, promise: de });
|
|
1096
|
+
}
|
|
1097
|
+
let f = yield Promise.all(o.map((w) => w.promise.then((S) => ({ status: "fulfilled", value: S, key: w.key }), (S) => ({ status: "rejected", reason: S, key: w.key })))), u = /* @__PURE__ */ new Map();
|
|
1098
|
+
for (let w of f) w.status === "fulfilled" ? u.set(w.key, [w.value]) : w.reason.name === "AbortError" || console.error(w.reason);
|
|
1099
|
+
if (i.key !== s || this.lastRequestedZ !== n.z || (yield Promise.all(this.tasks.map(Kt)), i.key !== s) || this.lastRequestedZ !== n.z) return;
|
|
1100
|
+
let m = this.labelers.add(n.z, u);
|
|
1101
|
+
if (i.key !== s || this.lastRequestedZ !== n.z) return;
|
|
1102
|
+
let d = this.labelers.getIndex(n.z);
|
|
1103
|
+
if (!this._map) return;
|
|
1104
|
+
let h = this._map.getCenter().wrap(), g = this._getTiledPixelBounds(h), _ = this._pxBoundsToTileRange(g).getCenter(), k = n.distanceTo(_) * this.tileDelay;
|
|
1105
|
+
if (yield Zt(k), i.key !== s || this.lastRequestedZ !== n.z) return;
|
|
1106
|
+
let p = 16, x = { minX: 256 * n.x - p, minY: 256 * n.y - p, maxX: 256 * (n.x + 1) + p, maxY: 256 * (n.y + 1) + p }, A = new Point(256 * n.x, 256 * n.y);
|
|
1107
|
+
i.width = this.tileSize, i.height = this.tileSize;
|
|
1108
|
+
let b = i.getContext("2d");
|
|
1109
|
+
if (!b) {
|
|
1110
|
+
console.error("Failed to get Canvas context");
|
|
1111
|
+
return;
|
|
1112
|
+
}
|
|
1113
|
+
b.setTransform(this.tileSize / 256, 0, 0, this.tileSize / 256, 0, 0), b.clearRect(0, 0, 256, 256), this.backgroundColor && (b.save(), b.fillStyle = this.backgroundColor, b.fillRect(0, 0, 256, 256), b.restore());
|
|
1114
|
+
let v = 0, z = this.paintRules;
|
|
1115
|
+
if (v = ue(b, n.z, u, this.xray ? null : d, z, x, A, false, this.debug), this.debug) {
|
|
1116
|
+
b.save(), b.fillStyle = this.debug, b.font = "600 12px sans-serif", b.fillText(`${n.z} ${n.x} ${n.y}`, 4, 14), b.font = "12px sans-serif";
|
|
1117
|
+
let w = 28;
|
|
1118
|
+
for (let [S, de] of u) {
|
|
1119
|
+
let me = de[0].dataTile;
|
|
1120
|
+
b.fillText(`${S + (S ? " " : "") + me.z} ${me.x} ${me.y}`, 4, w), w += 14;
|
|
1121
|
+
}
|
|
1122
|
+
b.font = "600 10px sans-serif", v > 8 && (b.fillText(`${v.toFixed()} ms paint`, 4, w), w += 14), m > 8 && b.fillText(`${m.toFixed()} ms layout`, 4, w), b.strokeStyle = this.debug, b.lineWidth = 0.5, b.beginPath(), b.moveTo(0, 0), b.lineTo(0, 256), b.stroke(), b.lineWidth = 0.5, b.beginPath(), b.moveTo(0, 0), b.lineTo(256, 0), b.stroke(), b.restore();
|
|
1123
|
+
}
|
|
1124
|
+
l();
|
|
1125
|
+
});
|
|
1126
|
+
}
|
|
1127
|
+
rerenderTile(n) {
|
|
1128
|
+
for (let i in this._tiles) {
|
|
1129
|
+
let s = this._wrapCoords(this._keyToTileCoords(i));
|
|
1130
|
+
n === this._tileCoordsToKey(s) && this.renderTile(s, this._tiles[i].el, n);
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
queryTileFeaturesDebug(n, i, s = 16) {
|
|
1134
|
+
let l = /* @__PURE__ */ new Map();
|
|
1135
|
+
for (let [o, f] of this.views) l.set(o, f.queryFeatures(n, i, this._map.getZoom(), s));
|
|
1136
|
+
return l;
|
|
1137
|
+
}
|
|
1138
|
+
clearLayout() {
|
|
1139
|
+
this.labelers = new Z(this.scratch, this.labelRules, 16, this.onTilesInvalidated);
|
|
1140
|
+
}
|
|
1141
|
+
rerenderTiles() {
|
|
1142
|
+
for (let n in this._tiles) {
|
|
1143
|
+
let i = this._wrapCoords(this._keyToTileCoords(n)), s = this._tileCoordsToKey(i);
|
|
1144
|
+
this.renderTile(i, this._tiles[n].el, s);
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
createTile(n, i) {
|
|
1148
|
+
let s = L.DomUtil.create("canvas", "leaflet-tile");
|
|
1149
|
+
s.lang = this.lang;
|
|
1150
|
+
let l = this._tileCoordsToKey(n);
|
|
1151
|
+
return s.key = l, this.renderTile(n, s, l, () => {
|
|
1152
|
+
i(void 0, s);
|
|
1153
|
+
}), s;
|
|
1154
|
+
}
|
|
1155
|
+
_removeTile(n) {
|
|
1156
|
+
let i = this._tiles[n];
|
|
1157
|
+
i && (i.el.removed = true, i.el.key = void 0, L.DomUtil.removeClass(i.el, "leaflet-tile-loaded"), i.el.width = i.el.height = 0, L.DomUtil.remove(i.el), delete this._tiles[n], this.fire("tileunload", { tile: i.el, coords: this._keyToTileCoords(n) }));
|
|
1158
|
+
}
|
|
1159
|
+
};
|
|
1160
|
+
c(t, "LeafletLayer");
|
|
1161
|
+
let e = t;
|
|
1162
|
+
return new e(a);
|
|
1163
|
+
}, "leafletLayer");
|
|
1164
|
+
var Sn = c((a, e, t) => {
|
|
1165
|
+
let r = new FontFace(a, `url(${e})`, { weight: t });
|
|
1166
|
+
return document.fonts.add(r), r.load();
|
|
1167
|
+
}, "Font"), bt = c((a) => D(void 0, null, function* () {
|
|
1168
|
+
return new Promise((e, t) => {
|
|
1169
|
+
let r = new Image();
|
|
1170
|
+
r.onload = () => e(r), r.onerror = () => t("Invalid SVG"), r.src = a;
|
|
1171
|
+
});
|
|
1172
|
+
}), "mkimg"), Ut = `
|
|
1173
|
+
<svg width="20px" height="20px" viewBox="0 0 50 50" version="1.1" xmlns="http://www.w3.org/2000/svg">
|
|
1174
|
+
<rect width="50" height="50" fill="#cccccc"/>
|
|
1175
|
+
<g transform="translate(5,5)">
|
|
1176
|
+
<path fill="none" stroke="#666666" stroke-width="7" d="m11,12a8.5,8 0 1,1 17,0q0,4-4,6t-4.5,4.5-.4,4v.2m0,3v7"/>
|
|
1177
|
+
</g>
|
|
1178
|
+
</svg>
|
|
1179
|
+
`, Ke = class Ke2 {
|
|
1180
|
+
constructor(e) {
|
|
1181
|
+
this.src = e, this.canvas = document.createElement("canvas"), this.mapping = /* @__PURE__ */ new Map(), this.missingBox = { x: 0, y: 0, w: 0, h: 0 };
|
|
1182
|
+
}
|
|
1183
|
+
load() {
|
|
1184
|
+
return D(this, null, function* () {
|
|
1185
|
+
let e = this.src, t = window.devicePixelRatio;
|
|
1186
|
+
e.endsWith(".html") && (e = yield (yield fetch(e)).text());
|
|
1187
|
+
let r = new window.DOMParser().parseFromString(e, "text/html"), n = Array.from(r.body.children), i = yield bt(`data:image/svg+xml;base64,${btoa(Ut)}`), s = [{ w: i.width * t, h: i.height * t, img: i, id: "" }], l = new XMLSerializer();
|
|
1188
|
+
for (let u of n) {
|
|
1189
|
+
let d = `data:image/svg+xml;base64,${btoa(l.serializeToString(u))}`, h = yield bt(d);
|
|
1190
|
+
s.push({ w: h.width * t, h: h.height * t, img: h, id: u.id });
|
|
1191
|
+
}
|
|
1192
|
+
let o = potpack(s);
|
|
1193
|
+
this.canvas.width = o.w, this.canvas.height = o.h;
|
|
1194
|
+
let f = this.canvas.getContext("2d");
|
|
1195
|
+
if (f) for (let u of s) u.x !== void 0 && u.y !== void 0 && (f.drawImage(u.img, u.x, u.y, u.w, u.h), u.id ? this.mapping.set(u.id, { x: u.x, y: u.y, w: u.w, h: u.h }) : this.missingBox = { x: u.x, y: u.y, w: u.w, h: u.h });
|
|
1196
|
+
return this;
|
|
1197
|
+
});
|
|
1198
|
+
}
|
|
1199
|
+
get(e) {
|
|
1200
|
+
let t = this.mapping.get(e);
|
|
1201
|
+
return t || (t = this.missingBox), t;
|
|
1202
|
+
}
|
|
1203
|
+
};
|
|
1204
|
+
c(Ke, "Sheet");
|
|
1205
|
+
var ht = Ke;
|
|
1206
|
+
export {
|
|
1207
|
+
Te as CenteredSymbolizer,
|
|
1208
|
+
I as CenteredTextSymbolizer,
|
|
1209
|
+
te as CircleSymbolizer,
|
|
1210
|
+
st as FlexSymbolizer,
|
|
1211
|
+
Sn as Font,
|
|
1212
|
+
rt as GeomType,
|
|
1213
|
+
re as GroupSymbolizer,
|
|
1214
|
+
it as IconSymbolizer,
|
|
1215
|
+
Je as Index,
|
|
1216
|
+
St as Justify,
|
|
1217
|
+
V as Labeler,
|
|
1218
|
+
Z as Labelers,
|
|
1219
|
+
Rt as LineLabelPlacement,
|
|
1220
|
+
$ as LineLabelSymbolizer,
|
|
1221
|
+
M as LineSymbolizer,
|
|
1222
|
+
Pe as OffsetSymbolizer,
|
|
1223
|
+
ie as OffsetTextSymbolizer,
|
|
1224
|
+
ot as Padding,
|
|
1225
|
+
H as PmtilesSource,
|
|
1226
|
+
P as PolygonSymbolizer,
|
|
1227
|
+
ht as Sheet,
|
|
1228
|
+
at as ShieldSymbolizer,
|
|
1229
|
+
dt as Static,
|
|
1230
|
+
At as TextPlacements,
|
|
1231
|
+
ne as TextSymbolizer,
|
|
1232
|
+
ee as TileCache,
|
|
1233
|
+
Ne as View,
|
|
1234
|
+
Q as ZxySource,
|
|
1235
|
+
Tr as arr,
|
|
1236
|
+
Nt as covering,
|
|
1237
|
+
zr as createPattern,
|
|
1238
|
+
F as exp,
|
|
1239
|
+
ut as getZoom,
|
|
1240
|
+
Pt as isCcw,
|
|
1241
|
+
tt as isInRing,
|
|
1242
|
+
se as labelRules,
|
|
1243
|
+
Pn as leafletLayer,
|
|
1244
|
+
Le as linear,
|
|
1245
|
+
ue as paint,
|
|
1246
|
+
ae as paintRules,
|
|
1247
|
+
Lt as pointInPolygon,
|
|
1248
|
+
Ct as pointMinDistToLines,
|
|
1249
|
+
vt as pointMinDistToPoints,
|
|
1250
|
+
fe as sourcesToViews,
|
|
1251
|
+
Pr as step,
|
|
1252
|
+
Y as toIndex,
|
|
1253
|
+
ce as transformGeom,
|
|
1254
|
+
le as wrap
|
|
1255
|
+
};
|
|
1256
|
+
//# sourceMappingURL=index.js.map
|