@optimum-intelligence/opti-ui 0.7.4 → 0.7.6
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 +21 -0
- package/README.md +4 -1
- package/dist/components/map/Map.d.ts +29 -3
- package/dist/components/map/Map.js +542 -302
- package/dist/components/map/Map.js.map +1 -1
- package/dist/components.json +17 -3
- package/dist/llms-full.txt +7 -8
- package/dist/opti-ui.css +2 -0
- package/package.json +1 -1
|
@@ -86,24 +86,28 @@ function hasValidPositions(coords, min) {
|
|
|
86
86
|
};
|
|
87
87
|
return check(coords) && count >= min;
|
|
88
88
|
}
|
|
89
|
-
/**
|
|
90
|
-
function
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
89
|
+
/** `[w, s, e, n]` around every `[lng, lat]` pair nested in `coords`, or null when there is none. */
|
|
90
|
+
function boundsOf(coords) {
|
|
91
|
+
let w = Infinity, s = Infinity, e = -Infinity, n = -Infinity;
|
|
92
|
+
const visit = (value) => {
|
|
93
|
+
if (!Array.isArray(value)) return;
|
|
94
|
+
if (typeof value[0] !== "number") {
|
|
95
|
+
for (const child of value) visit(child);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const [x, y] = value;
|
|
99
|
+
if (x < w) w = x;
|
|
100
|
+
if (x > e) e = x;
|
|
101
|
+
if (y < s) s = y;
|
|
102
|
+
if (y > n) n = y;
|
|
103
|
+
};
|
|
104
|
+
visit(coords);
|
|
105
|
+
return w <= e ? [
|
|
106
|
+
w,
|
|
107
|
+
s,
|
|
108
|
+
e,
|
|
109
|
+
n
|
|
110
|
+
] : null;
|
|
107
111
|
}
|
|
108
112
|
var toneColors = {
|
|
109
113
|
neutral: {
|
|
@@ -159,7 +163,7 @@ var dimmed = (hasSelection, dim) => hasSelection ? [
|
|
|
159
163
|
* and keeps the `selected` feature state in sync (also after a style switch re-adds the source).
|
|
160
164
|
*/
|
|
161
165
|
function useDataPart(partName, sourceId, options) {
|
|
162
|
-
const $ = c(
|
|
166
|
+
const $ = c(62);
|
|
163
167
|
const ctx = useMapContext(partName);
|
|
164
168
|
const { items, selectedIds: t0, layerIds, coordinates, minPositions: t1, onItemClick, onItemHover } = options;
|
|
165
169
|
let t2;
|
|
@@ -171,7 +175,6 @@ function useDataPart(partName, sourceId, options) {
|
|
|
171
175
|
const selectedIds = t2;
|
|
172
176
|
const minPositions = t1 === void 0 ? 1 : t1;
|
|
173
177
|
const { register, setHandlers, map } = ctx;
|
|
174
|
-
const selected = new Set(selectedIds);
|
|
175
178
|
let t3;
|
|
176
179
|
if ($[2] !== selectedIds) {
|
|
177
180
|
t3 = selectedIds.join("\0");
|
|
@@ -180,83 +183,124 @@ function useDataPart(partName, sourceId, options) {
|
|
|
180
183
|
} else t3 = $[3];
|
|
181
184
|
const selectedKey = t3;
|
|
182
185
|
let t4;
|
|
183
|
-
if ($[4] !== coordinates || $[5] !== minPositions) {
|
|
184
|
-
t4 = (item) => hasValidPositions(coordinates(item), minPositions);
|
|
185
|
-
$[4] = coordinates;
|
|
186
|
-
$[5] = minPositions;
|
|
187
|
-
$[6] = t4;
|
|
188
|
-
} else t4 = $[6];
|
|
189
|
-
const valid = new Set(items.filter(t4));
|
|
190
|
-
const invalidIds = items.filter((item_0) => !valid.has(item_0)).map(_temp).join(", ");
|
|
191
186
|
let t5;
|
|
192
187
|
let t6;
|
|
193
|
-
if ($[
|
|
194
|
-
|
|
188
|
+
if ($[4] !== coordinates || $[5] !== items || $[6] !== minPositions) {
|
|
189
|
+
let t7;
|
|
190
|
+
if ($[10] !== coordinates || $[11] !== minPositions) {
|
|
191
|
+
t7 = (item) => hasValidPositions(coordinates(item), minPositions);
|
|
192
|
+
$[10] = coordinates;
|
|
193
|
+
$[11] = minPositions;
|
|
194
|
+
$[12] = t7;
|
|
195
|
+
} else t7 = $[12];
|
|
196
|
+
const drawable = items.filter(t7);
|
|
197
|
+
const set = new Set(drawable);
|
|
198
|
+
t4 = set;
|
|
199
|
+
t5 = items.filter((item_0) => !set.has(item_0)).map(_temp).join(", ");
|
|
200
|
+
t6 = boundsOf(drawable.map(coordinates));
|
|
201
|
+
$[4] = coordinates;
|
|
202
|
+
$[5] = items;
|
|
203
|
+
$[6] = minPositions;
|
|
204
|
+
$[7] = t4;
|
|
205
|
+
$[8] = t5;
|
|
206
|
+
$[9] = t6;
|
|
207
|
+
} else {
|
|
208
|
+
t4 = $[7];
|
|
209
|
+
t5 = $[8];
|
|
210
|
+
t6 = $[9];
|
|
211
|
+
}
|
|
212
|
+
let t7;
|
|
213
|
+
if ($[13] !== t4 || $[14] !== t5 || $[15] !== t6) {
|
|
214
|
+
t7 = {
|
|
215
|
+
valid: t4,
|
|
216
|
+
invalidIds: t5,
|
|
217
|
+
bounds: t6
|
|
218
|
+
};
|
|
219
|
+
$[13] = t4;
|
|
220
|
+
$[14] = t5;
|
|
221
|
+
$[15] = t6;
|
|
222
|
+
$[16] = t7;
|
|
223
|
+
} else t7 = $[16];
|
|
224
|
+
const { valid, invalidIds, bounds } = t7;
|
|
225
|
+
let t8;
|
|
226
|
+
if ($[17] !== selectedKey) {
|
|
227
|
+
t8 = new Set(selectedKey ? selectedKey.split("\0") : []);
|
|
228
|
+
$[17] = selectedKey;
|
|
229
|
+
$[18] = t8;
|
|
230
|
+
} else t8 = $[18];
|
|
231
|
+
const selected = t8;
|
|
232
|
+
let t9;
|
|
233
|
+
if ($[19] !== coordinates || $[20] !== selected || $[21] !== valid) {
|
|
234
|
+
t9 = boundsOf([...valid].filter((item_2) => selected.has(item_2.id)).map(coordinates));
|
|
235
|
+
$[19] = coordinates;
|
|
236
|
+
$[20] = selected;
|
|
237
|
+
$[21] = valid;
|
|
238
|
+
$[22] = t9;
|
|
239
|
+
} else t9 = $[22];
|
|
240
|
+
const selectedBounds = t9;
|
|
241
|
+
let t10;
|
|
242
|
+
let t11;
|
|
243
|
+
if ($[23] !== invalidIds || $[24] !== partName) {
|
|
244
|
+
t10 = () => {
|
|
195
245
|
if (invalidIds && process.env.NODE_ENV !== "production") console.warn(`${partName}: skipped items with invalid coordinates: ${invalidIds}`);
|
|
196
246
|
};
|
|
197
|
-
|
|
198
|
-
$[
|
|
199
|
-
$[
|
|
200
|
-
$[
|
|
201
|
-
$[
|
|
247
|
+
t11 = [partName, invalidIds];
|
|
248
|
+
$[23] = invalidIds;
|
|
249
|
+
$[24] = partName;
|
|
250
|
+
$[25] = t10;
|
|
251
|
+
$[26] = t11;
|
|
202
252
|
} else {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
}
|
|
206
|
-
React.useEffect(t5, t6);
|
|
207
|
-
let bounds = null;
|
|
208
|
-
let selectedBounds = null;
|
|
209
|
-
for (const item_2 of valid) {
|
|
210
|
-
bounds = extend(bounds, coordinates(item_2));
|
|
211
|
-
if (selected.has(item_2.id)) selectedBounds = extend(selectedBounds, coordinates(item_2));
|
|
253
|
+
t10 = $[25];
|
|
254
|
+
t11 = $[26];
|
|
212
255
|
}
|
|
256
|
+
React.useEffect(t10, t11);
|
|
213
257
|
const boundsKey = `${bounds}|${selectedBounds}|${layerIds}`;
|
|
214
|
-
let
|
|
215
|
-
if ($[
|
|
216
|
-
|
|
258
|
+
let t12;
|
|
259
|
+
if ($[27] !== bounds || $[28] !== layerIds || $[29] !== register || $[30] !== selectedBounds || $[31] !== sourceId) {
|
|
260
|
+
t12 = () => {
|
|
217
261
|
register(sourceId, {
|
|
218
262
|
layerIds,
|
|
219
263
|
bounds,
|
|
220
264
|
selectedBounds
|
|
221
265
|
});
|
|
222
266
|
};
|
|
223
|
-
$[
|
|
224
|
-
$[
|
|
225
|
-
$[
|
|
226
|
-
$[
|
|
227
|
-
$[
|
|
228
|
-
$[
|
|
229
|
-
} else
|
|
230
|
-
let
|
|
231
|
-
if ($[
|
|
232
|
-
|
|
267
|
+
$[27] = bounds;
|
|
268
|
+
$[28] = layerIds;
|
|
269
|
+
$[29] = register;
|
|
270
|
+
$[30] = selectedBounds;
|
|
271
|
+
$[31] = sourceId;
|
|
272
|
+
$[32] = t12;
|
|
273
|
+
} else t12 = $[32];
|
|
274
|
+
let t13;
|
|
275
|
+
if ($[33] !== boundsKey || $[34] !== register || $[35] !== sourceId) {
|
|
276
|
+
t13 = [
|
|
233
277
|
register,
|
|
234
278
|
sourceId,
|
|
235
279
|
boundsKey
|
|
236
280
|
];
|
|
237
|
-
$[
|
|
238
|
-
$[
|
|
239
|
-
$[
|
|
240
|
-
$[
|
|
241
|
-
} else
|
|
242
|
-
React.useEffect(
|
|
243
|
-
let
|
|
244
|
-
let
|
|
245
|
-
if ($[
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
$[
|
|
249
|
-
$[
|
|
250
|
-
$[
|
|
251
|
-
$[
|
|
281
|
+
$[33] = boundsKey;
|
|
282
|
+
$[34] = register;
|
|
283
|
+
$[35] = sourceId;
|
|
284
|
+
$[36] = t13;
|
|
285
|
+
} else t13 = $[36];
|
|
286
|
+
React.useEffect(t12, t13);
|
|
287
|
+
let t14;
|
|
288
|
+
let t15;
|
|
289
|
+
if ($[37] !== register || $[38] !== sourceId) {
|
|
290
|
+
t14 = () => () => register(sourceId, null);
|
|
291
|
+
t15 = [register, sourceId];
|
|
292
|
+
$[37] = register;
|
|
293
|
+
$[38] = sourceId;
|
|
294
|
+
$[39] = t14;
|
|
295
|
+
$[40] = t15;
|
|
252
296
|
} else {
|
|
253
|
-
|
|
254
|
-
|
|
297
|
+
t14 = $[39];
|
|
298
|
+
t15 = $[40];
|
|
255
299
|
}
|
|
256
|
-
React.useEffect(
|
|
257
|
-
let
|
|
258
|
-
if ($[
|
|
259
|
-
|
|
300
|
+
React.useEffect(t14, t15);
|
|
301
|
+
let t16;
|
|
302
|
+
if ($[41] !== items || $[42] !== onItemClick || $[43] !== onItemHover || $[44] !== setHandlers || $[45] !== sourceId) {
|
|
303
|
+
t16 = () => {
|
|
260
304
|
const byId = (id) => items.find((item_3) => item_3.id === id);
|
|
261
305
|
setHandlers(sourceId, {
|
|
262
306
|
onClick: (id_0, event) => {
|
|
@@ -266,73 +310,97 @@ function useDataPart(partName, sourceId, options) {
|
|
|
266
310
|
onHover: (id_1, event_0) => onItemHover?.(id_1 == null ? null : byId(id_1) ?? null, event_0)
|
|
267
311
|
});
|
|
268
312
|
};
|
|
269
|
-
$[
|
|
270
|
-
$[
|
|
271
|
-
$[
|
|
272
|
-
$[
|
|
273
|
-
$[
|
|
274
|
-
$[
|
|
275
|
-
} else
|
|
276
|
-
React.useEffect(
|
|
277
|
-
let
|
|
278
|
-
let
|
|
279
|
-
if ($[
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
$[
|
|
283
|
-
$[
|
|
284
|
-
$[
|
|
285
|
-
$[
|
|
313
|
+
$[41] = items;
|
|
314
|
+
$[42] = onItemClick;
|
|
315
|
+
$[43] = onItemHover;
|
|
316
|
+
$[44] = setHandlers;
|
|
317
|
+
$[45] = sourceId;
|
|
318
|
+
$[46] = t16;
|
|
319
|
+
} else t16 = $[46];
|
|
320
|
+
React.useEffect(t16);
|
|
321
|
+
let t17;
|
|
322
|
+
let t18;
|
|
323
|
+
if ($[47] !== setHandlers || $[48] !== sourceId) {
|
|
324
|
+
t17 = () => () => setHandlers(sourceId, null);
|
|
325
|
+
t18 = [setHandlers, sourceId];
|
|
326
|
+
$[47] = setHandlers;
|
|
327
|
+
$[48] = sourceId;
|
|
328
|
+
$[49] = t17;
|
|
329
|
+
$[50] = t18;
|
|
286
330
|
} else {
|
|
287
|
-
|
|
288
|
-
|
|
331
|
+
t17 = $[49];
|
|
332
|
+
t18 = $[50];
|
|
289
333
|
}
|
|
290
|
-
React.useEffect(
|
|
291
|
-
let
|
|
292
|
-
if ($[
|
|
293
|
-
|
|
294
|
-
$[
|
|
295
|
-
} else
|
|
296
|
-
const applied = React.useRef(
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
const
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
applied.current = /* @__PURE__ */ new Set();
|
|
334
|
+
React.useEffect(t17, t18);
|
|
335
|
+
let t19;
|
|
336
|
+
if ($[51] === Symbol.for("react.memo_cache_sentinel")) {
|
|
337
|
+
t19 = /* @__PURE__ */ new Set();
|
|
338
|
+
$[51] = t19;
|
|
339
|
+
} else t19 = $[51];
|
|
340
|
+
const applied = React.useRef(t19);
|
|
341
|
+
let t20;
|
|
342
|
+
let t21;
|
|
343
|
+
if ($[52] !== map || $[53] !== selectedKey || $[54] !== sourceId || $[55] !== valid) {
|
|
344
|
+
t20 = () => {
|
|
345
|
+
const instance = map?.getMap();
|
|
346
|
+
if (!instance) return;
|
|
347
|
+
const drawn = new Set([...valid].map(_temp2));
|
|
348
|
+
const target = new Set((selectedKey ? selectedKey.split("\0") : []).filter((id_2) => drawn.has(id_2)));
|
|
349
|
+
const sync = () => {
|
|
350
|
+
if (!instance.getSource(sourceId)) return;
|
|
351
|
+
const prev = applied.current;
|
|
352
|
+
for (const id_3 of prev) if (!target.has(id_3)) instance.setFeatureState({
|
|
353
|
+
source: sourceId,
|
|
354
|
+
id: id_3
|
|
355
|
+
}, { selected: false });
|
|
356
|
+
for (const id_4 of target) if (!prev.has(id_4)) instance.setFeatureState({
|
|
357
|
+
source: sourceId,
|
|
358
|
+
id: id_4
|
|
359
|
+
}, { selected: true });
|
|
360
|
+
applied.current = target;
|
|
361
|
+
};
|
|
319
362
|
sync();
|
|
363
|
+
const onData = (e) => {
|
|
364
|
+
if (e.sourceId !== sourceId || e.sourceDataType !== "metadata") return;
|
|
365
|
+
applied.current = /* @__PURE__ */ new Set();
|
|
366
|
+
sync();
|
|
367
|
+
};
|
|
368
|
+
instance.on("sourcedata", onData);
|
|
369
|
+
return () => {
|
|
370
|
+
instance.off("sourcedata", onData);
|
|
371
|
+
};
|
|
320
372
|
};
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
373
|
+
t21 = [
|
|
374
|
+
map,
|
|
375
|
+
sourceId,
|
|
376
|
+
valid,
|
|
377
|
+
selectedKey
|
|
378
|
+
];
|
|
379
|
+
$[52] = map;
|
|
380
|
+
$[53] = selectedKey;
|
|
381
|
+
$[54] = sourceId;
|
|
382
|
+
$[55] = valid;
|
|
383
|
+
$[56] = t20;
|
|
384
|
+
$[57] = t21;
|
|
385
|
+
} else {
|
|
386
|
+
t20 = $[56];
|
|
387
|
+
t21 = $[57];
|
|
388
|
+
}
|
|
389
|
+
React.useEffect(t20, t21);
|
|
390
|
+
const t22 = selectedIds.length > 0;
|
|
391
|
+
let t23;
|
|
392
|
+
if ($[58] !== ctx.colors || $[59] !== t22 || $[60] !== valid) {
|
|
393
|
+
t23 = {
|
|
394
|
+
colors: ctx.colors,
|
|
395
|
+
hasSelection: t22,
|
|
396
|
+
valid
|
|
324
397
|
};
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
return {
|
|
332
|
-
colors: ctx.colors,
|
|
333
|
-
hasSelection: selectedIds.length > 0,
|
|
334
|
-
valid
|
|
335
|
-
};
|
|
398
|
+
$[58] = ctx.colors;
|
|
399
|
+
$[59] = t22;
|
|
400
|
+
$[60] = valid;
|
|
401
|
+
$[61] = t23;
|
|
402
|
+
} else t23 = $[61];
|
|
403
|
+
return t23;
|
|
336
404
|
}
|
|
337
405
|
/** A source id that is safe in MapLibre layer ids. */
|
|
338
406
|
function _temp2(item_5) {
|
|
@@ -528,11 +596,11 @@ function MapRoot(t0) {
|
|
|
528
596
|
empty = entries.length > 0 && entries.every(_temp4);
|
|
529
597
|
const corners = _temp5;
|
|
530
598
|
const boundsKey = _temp7;
|
|
531
|
-
dataKey = fit === "none" ? "" : boundsKey(
|
|
599
|
+
dataKey = fit === "none" ? "" : boundsKey(boundsOf(entries.map((t14) => {
|
|
532
600
|
const [, part_3] = t14;
|
|
533
601
|
return corners(part_3.bounds);
|
|
534
602
|
})));
|
|
535
|
-
t12 = fit === "selected" ? boundsKey(
|
|
603
|
+
t12 = fit === "selected" ? boundsKey(boundsOf(entries.map((t15) => {
|
|
536
604
|
const [, part_4] = t15;
|
|
537
605
|
return corners(part_4.selectedBounds);
|
|
538
606
|
}))) : "";
|
|
@@ -636,18 +704,18 @@ function MapRoot(t0) {
|
|
|
636
704
|
handlers.current[next_0.source]?.onHover?.(String(next_0.id), event_0);
|
|
637
705
|
}
|
|
638
706
|
hovered.current = next_0;
|
|
639
|
-
setCursor(next_0 ? "pointer" : "");
|
|
640
707
|
};
|
|
641
708
|
$[46] = t18;
|
|
642
709
|
} else t18 = $[46];
|
|
643
710
|
const setHover = t18;
|
|
711
|
+
const zoomToCluster = _temp0;
|
|
644
712
|
let t19;
|
|
645
713
|
let t20;
|
|
646
714
|
if ($[47] !== expanded) {
|
|
647
715
|
t19 = () => {
|
|
648
716
|
if (!expanded) return;
|
|
649
|
-
const onKeyDown = (
|
|
650
|
-
if (
|
|
717
|
+
const onKeyDown = (event_2) => {
|
|
718
|
+
if (event_2.key === "Escape" && !event_2.defaultPrevented) setExpanded(false);
|
|
651
719
|
};
|
|
652
720
|
document.addEventListener("keydown", onKeyDown);
|
|
653
721
|
return () => document.removeEventListener("keydown", onKeyDown);
|
|
@@ -714,10 +782,10 @@ function MapRoot(t0) {
|
|
|
714
782
|
t26 = element && /* @__PURE__ */ jsx(Map, {
|
|
715
783
|
...props,
|
|
716
784
|
mapLib: loadMapLib(),
|
|
717
|
-
ref: (
|
|
718
|
-
setMap(
|
|
719
|
-
if (typeof ref === "function") ref(
|
|
720
|
-
else if (ref) ref.current =
|
|
785
|
+
ref: (instance_2) => {
|
|
786
|
+
setMap(instance_2);
|
|
787
|
+
if (typeof ref === "function") ref(instance_2);
|
|
788
|
+
else if (ref) ref.current = instance_2;
|
|
721
789
|
},
|
|
722
790
|
mapStyle,
|
|
723
791
|
initialViewState,
|
|
@@ -728,24 +796,28 @@ function MapRoot(t0) {
|
|
|
728
796
|
"NavigationControl.ZoomIn": text.zoomIn,
|
|
729
797
|
"NavigationControl.ZoomOut": text.zoomOut
|
|
730
798
|
},
|
|
731
|
-
onClick: (
|
|
732
|
-
const feature = event_2.features?.[0];
|
|
733
|
-
const owner = feature && ownerOf(feature.layer.id);
|
|
734
|
-
if (feature && owner && feature.id != null) handlers.current[owner]?.onClick?.(String(feature.id), event_2);
|
|
735
|
-
onClick?.(event_2);
|
|
736
|
-
},
|
|
737
|
-
onMouseMove: (event_3) => {
|
|
799
|
+
onClick: (event_3) => {
|
|
738
800
|
const feature_0 = event_3.features?.[0];
|
|
739
|
-
const
|
|
740
|
-
|
|
801
|
+
const owner = feature_0 && ownerOf(feature_0.layer.id);
|
|
802
|
+
if (feature_0 && owner && feature_0.properties.cluster) zoomToCluster(feature_0, event_3);
|
|
803
|
+
else if (feature_0 && owner && feature_0.id != null) handlers.current[owner]?.onClick?.(String(feature_0.id), event_3);
|
|
804
|
+
onClick?.(event_3);
|
|
805
|
+
},
|
|
806
|
+
onMouseMove: (event_4) => {
|
|
807
|
+
const feature_1 = event_4.features?.[0];
|
|
808
|
+
const owner_0 = feature_1 && ownerOf(feature_1.layer.id);
|
|
809
|
+
const cluster = !!feature_1?.properties.cluster;
|
|
810
|
+
setHover(feature_1 && owner_0 && !cluster && feature_1.id != null ? {
|
|
741
811
|
source: owner_0,
|
|
742
|
-
id:
|
|
743
|
-
} : null,
|
|
744
|
-
|
|
812
|
+
id: feature_1.id
|
|
813
|
+
} : null, event_4);
|
|
814
|
+
setCursor(feature_1 && owner_0 && (cluster || feature_1.id != null) ? "pointer" : "");
|
|
815
|
+
onMouseMove?.(event_4);
|
|
745
816
|
},
|
|
746
|
-
onMouseOut: (
|
|
747
|
-
setHover(null,
|
|
748
|
-
|
|
817
|
+
onMouseOut: (event_5) => {
|
|
818
|
+
setHover(null, event_5);
|
|
819
|
+
setCursor("");
|
|
820
|
+
onMouseOut?.(event_5);
|
|
749
821
|
},
|
|
750
822
|
children: /* @__PURE__ */ jsxs(MapContext, {
|
|
751
823
|
value: {
|
|
@@ -767,7 +839,7 @@ function MapRoot(t0) {
|
|
|
767
839
|
position: controlsPosition || "top-right",
|
|
768
840
|
expanded,
|
|
769
841
|
label: expanded ? text.collapse : text.expand,
|
|
770
|
-
onToggle: () => setExpanded(
|
|
842
|
+
onToggle: () => setExpanded(_temp1)
|
|
771
843
|
}),
|
|
772
844
|
/* @__PURE__ */ jsx(AttributionControl, {
|
|
773
845
|
compact: true,
|
|
@@ -824,9 +896,20 @@ function MapRoot(t0) {
|
|
|
824
896
|
return t27;
|
|
825
897
|
}
|
|
826
898
|
/** The expand button as a MapLibre control, so it stacks with the zoom buttons in the same corner. */
|
|
827
|
-
function
|
|
899
|
+
function _temp1(value_0) {
|
|
828
900
|
return !value_0;
|
|
829
901
|
}
|
|
902
|
+
function _temp0(feature, event_1) {
|
|
903
|
+
const instance_1 = event_1.target;
|
|
904
|
+
const source = instance_1.getSource(feature.source);
|
|
905
|
+
const center = feature.geometry.coordinates;
|
|
906
|
+
source?.getClusterExpansionZoom(feature.properties.cluster_id).then((zoom) => instance_1.easeTo({
|
|
907
|
+
center,
|
|
908
|
+
zoom,
|
|
909
|
+
duration: 400
|
|
910
|
+
}, { originalEvent: event_1.originalEvent }), _temp9);
|
|
911
|
+
}
|
|
912
|
+
function _temp9() {}
|
|
830
913
|
function _temp8(h) {
|
|
831
914
|
return h ? `${h.source}|${h.id}` : "";
|
|
832
915
|
}
|
|
@@ -850,7 +933,7 @@ function _temp3(t0) {
|
|
|
850
933
|
function ExpandControl(t0) {
|
|
851
934
|
const $ = c(12);
|
|
852
935
|
const { position, expanded, label, onToggle } = t0;
|
|
853
|
-
const [host] = React.useState(
|
|
936
|
+
const [host] = React.useState(_temp10);
|
|
854
937
|
let t1;
|
|
855
938
|
if ($[0] !== host) {
|
|
856
939
|
t1 = () => ({
|
|
@@ -900,7 +983,7 @@ function ExpandControl(t0) {
|
|
|
900
983
|
} else t5 = $[11];
|
|
901
984
|
return t5;
|
|
902
985
|
}
|
|
903
|
-
function
|
|
986
|
+
function _temp10() {
|
|
904
987
|
const element = document.createElement("div");
|
|
905
988
|
element.className = "maplibregl-ctrl maplibregl-ctrl-group";
|
|
906
989
|
return element;
|
|
@@ -950,7 +1033,7 @@ function MapRoutes(t0) {
|
|
|
950
1033
|
items,
|
|
951
1034
|
selectedIds,
|
|
952
1035
|
layerIds: t5,
|
|
953
|
-
coordinates:
|
|
1036
|
+
coordinates: _temp11,
|
|
954
1037
|
minPositions: 2,
|
|
955
1038
|
onItemClick,
|
|
956
1039
|
onItemHover
|
|
@@ -1184,7 +1267,7 @@ function MapRoutes(t0) {
|
|
|
1184
1267
|
const layers = t27;
|
|
1185
1268
|
let t28;
|
|
1186
1269
|
if ($[62] !== layers) {
|
|
1187
|
-
t28 = layers.map(
|
|
1270
|
+
t28 = layers.map(_temp12);
|
|
1188
1271
|
$[62] = layers;
|
|
1189
1272
|
$[63] = t28;
|
|
1190
1273
|
} else t28 = $[63];
|
|
@@ -1204,10 +1287,10 @@ function MapRoutes(t0) {
|
|
|
1204
1287
|
} else t29 = $[67];
|
|
1205
1288
|
return t29;
|
|
1206
1289
|
}
|
|
1207
|
-
function
|
|
1290
|
+
function _temp12(layer) {
|
|
1208
1291
|
return /* @__PURE__ */ jsx(Layer, { ...layer }, layer.id);
|
|
1209
1292
|
}
|
|
1210
|
-
function
|
|
1293
|
+
function _temp11(item) {
|
|
1211
1294
|
return item.coordinates;
|
|
1212
1295
|
}
|
|
1213
1296
|
/**
|
|
@@ -1246,7 +1329,7 @@ function MapAreas(t0) {
|
|
|
1246
1329
|
items,
|
|
1247
1330
|
selectedIds,
|
|
1248
1331
|
layerIds: t4,
|
|
1249
|
-
coordinates:
|
|
1332
|
+
coordinates: _temp13,
|
|
1250
1333
|
onItemClick,
|
|
1251
1334
|
onItemHover
|
|
1252
1335
|
};
|
|
@@ -1378,13 +1461,14 @@ function MapAreas(t0) {
|
|
|
1378
1461
|
} else t17 = $[37];
|
|
1379
1462
|
return t17;
|
|
1380
1463
|
}
|
|
1381
|
-
function
|
|
1464
|
+
function _temp13(item) {
|
|
1382
1465
|
return item.geometry.coordinates;
|
|
1383
1466
|
}
|
|
1384
1467
|
/**
|
|
1385
1468
|
* Many simple points (sensors, stops, events) as one circle layer. Items with a `label` get it drawn in
|
|
1386
|
-
* the circle by a symbol layer on the same source, so thousands of numbered stops
|
|
1387
|
-
* dozen styled pins with HTML
|
|
1469
|
+
* the circle by a symbol layer on the same source from `labelMinZoom` on, so thousands of numbered stops
|
|
1470
|
+
* stay fast. With `cluster`, dense areas become count bubbles. For a few dozen styled pins with HTML
|
|
1471
|
+
* content, use `Map.Marker` instead.
|
|
1388
1472
|
*
|
|
1389
1473
|
* @example
|
|
1390
1474
|
* <Map.Points items={sensors.map((s) => ({ id: s.id, coordinates: s.position, tone: s.ok ? 'success' : 'danger' }))} />
|
|
@@ -1395,46 +1479,72 @@ function _temp11(item) {
|
|
|
1395
1479
|
* items={trucks.flatMap((truck, t) =>
|
|
1396
1480
|
* truck.stops.map((stop, i) => ({ id: stop.id, coordinates: stop.position, colorIndex: t, label: i + 1 })),
|
|
1397
1481
|
* )}
|
|
1482
|
+
* labelMinZoom={11}
|
|
1398
1483
|
* />
|
|
1484
|
+
*
|
|
1485
|
+
* @example
|
|
1486
|
+
* // A fleet's stops over two months, merged into count bubbles at low zoom.
|
|
1487
|
+
* <Map.Points items={stops} cluster={{ radius: 40 }} onItemClick={(stop) => setPicked(stop)} />
|
|
1399
1488
|
*/
|
|
1400
1489
|
function MapPoints(t0) {
|
|
1401
|
-
const $ = c(
|
|
1402
|
-
const { items, selectedIds, onItemClick, onItemHover } = t0;
|
|
1490
|
+
const $ = c(78);
|
|
1491
|
+
const { items, selectedIds, labelMinZoom: t1, cluster: t2, onItemClick, onItemHover } = t0;
|
|
1492
|
+
const labelMinZoom = t1 === void 0 ? 12 : t1;
|
|
1493
|
+
const cluster = t2 === void 0 ? false : t2;
|
|
1403
1494
|
const sourceId = usePartId("points");
|
|
1404
1495
|
const circleId = `${sourceId}-circle`;
|
|
1405
1496
|
const labelId = `${sourceId}-label`;
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
$[
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1497
|
+
const clusterId = `${sourceId}-cluster`;
|
|
1498
|
+
const countId = `${sourceId}-count`;
|
|
1499
|
+
let t3;
|
|
1500
|
+
if ($[0] !== cluster) {
|
|
1501
|
+
t3 = cluster === true ? {} : cluster || {};
|
|
1502
|
+
$[0] = cluster;
|
|
1503
|
+
$[1] = t3;
|
|
1504
|
+
} else t3 = $[1];
|
|
1505
|
+
const { radius: t4, maxZoom: t5 } = t3;
|
|
1506
|
+
const clusterRadius = t4 === void 0 ? 50 : t4;
|
|
1507
|
+
const clusterMaxZoom = t5 === void 0 ? 14 : t5;
|
|
1508
|
+
let t6;
|
|
1509
|
+
if ($[2] !== circleId || $[3] !== cluster || $[4] !== clusterId || $[5] !== labelId) {
|
|
1510
|
+
t6 = cluster ? [
|
|
1511
|
+
circleId,
|
|
1512
|
+
labelId,
|
|
1513
|
+
clusterId
|
|
1514
|
+
] : [circleId, labelId];
|
|
1515
|
+
$[2] = circleId;
|
|
1516
|
+
$[3] = cluster;
|
|
1517
|
+
$[4] = clusterId;
|
|
1518
|
+
$[5] = labelId;
|
|
1519
|
+
$[6] = t6;
|
|
1520
|
+
} else t6 = $[6];
|
|
1521
|
+
let t7;
|
|
1522
|
+
if ($[7] !== items || $[8] !== onItemClick || $[9] !== onItemHover || $[10] !== selectedIds || $[11] !== t6) {
|
|
1523
|
+
t7 = {
|
|
1416
1524
|
items,
|
|
1417
1525
|
selectedIds,
|
|
1418
|
-
layerIds:
|
|
1419
|
-
coordinates:
|
|
1526
|
+
layerIds: t6,
|
|
1527
|
+
coordinates: _temp14,
|
|
1420
1528
|
onItemClick,
|
|
1421
1529
|
onItemHover
|
|
1422
1530
|
};
|
|
1423
|
-
$[
|
|
1424
|
-
$[
|
|
1425
|
-
$[
|
|
1426
|
-
$[
|
|
1427
|
-
$[
|
|
1428
|
-
$[
|
|
1429
|
-
} else
|
|
1430
|
-
const { colors, hasSelection, valid } = useDataPart("Map.Points", sourceId,
|
|
1531
|
+
$[7] = items;
|
|
1532
|
+
$[8] = onItemClick;
|
|
1533
|
+
$[9] = onItemHover;
|
|
1534
|
+
$[10] = selectedIds;
|
|
1535
|
+
$[11] = t6;
|
|
1536
|
+
$[12] = t7;
|
|
1537
|
+
} else t7 = $[12];
|
|
1538
|
+
const { colors, hasSelection, valid } = useDataPart("Map.Points", sourceId, t7);
|
|
1539
|
+
let casing;
|
|
1431
1540
|
let data;
|
|
1541
|
+
let dim;
|
|
1432
1542
|
let opacity;
|
|
1433
|
-
let
|
|
1434
|
-
if ($[
|
|
1435
|
-
let
|
|
1436
|
-
if ($[
|
|
1437
|
-
|
|
1543
|
+
let t8;
|
|
1544
|
+
if ($[13] !== colors || $[14] !== hasSelection || $[15] !== items || $[16] !== valid) {
|
|
1545
|
+
let t9;
|
|
1546
|
+
if ($[22] !== colors || $[23] !== valid) {
|
|
1547
|
+
t9 = (item_0, index) => valid.has(item_0) ? [{
|
|
1438
1548
|
type: "Feature",
|
|
1439
1549
|
properties: {
|
|
1440
1550
|
id: item_0.id,
|
|
@@ -1446,59 +1556,91 @@ function MapPoints(t0) {
|
|
|
1446
1556
|
coordinates: item_0.coordinates
|
|
1447
1557
|
}
|
|
1448
1558
|
}] : [];
|
|
1449
|
-
$[
|
|
1450
|
-
$[
|
|
1451
|
-
$[
|
|
1452
|
-
} else
|
|
1559
|
+
$[22] = colors;
|
|
1560
|
+
$[23] = valid;
|
|
1561
|
+
$[24] = t9;
|
|
1562
|
+
} else t9 = $[24];
|
|
1453
1563
|
data = {
|
|
1454
1564
|
type: "FeatureCollection",
|
|
1455
|
-
features: items.flatMap(
|
|
1565
|
+
features: items.flatMap(t9)
|
|
1456
1566
|
};
|
|
1457
|
-
let
|
|
1458
|
-
if ($[
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
$[
|
|
1462
|
-
$[
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
$[
|
|
1472
|
-
|
|
1567
|
+
let t10;
|
|
1568
|
+
if ($[25] !== colors || $[26] !== hasSelection) {
|
|
1569
|
+
dim = colors.number("--oui-map-dim-opacity", .35);
|
|
1570
|
+
t10 = dimmed(hasSelection, dim);
|
|
1571
|
+
$[25] = colors;
|
|
1572
|
+
$[26] = hasSelection;
|
|
1573
|
+
$[27] = dim;
|
|
1574
|
+
$[28] = t10;
|
|
1575
|
+
} else {
|
|
1576
|
+
dim = $[27];
|
|
1577
|
+
t10 = $[28];
|
|
1578
|
+
}
|
|
1579
|
+
opacity = t10;
|
|
1580
|
+
let t11;
|
|
1581
|
+
if ($[29] !== colors) {
|
|
1582
|
+
t11 = colors.color("var(--oui-map-casing-color)");
|
|
1583
|
+
$[29] = colors;
|
|
1584
|
+
$[30] = t11;
|
|
1585
|
+
} else t11 = $[30];
|
|
1586
|
+
casing = t11;
|
|
1587
|
+
t8 = data.features.some(_temp15);
|
|
1588
|
+
$[13] = colors;
|
|
1589
|
+
$[14] = hasSelection;
|
|
1590
|
+
$[15] = items;
|
|
1591
|
+
$[16] = valid;
|
|
1592
|
+
$[17] = casing;
|
|
1593
|
+
$[18] = data;
|
|
1594
|
+
$[19] = dim;
|
|
1595
|
+
$[20] = opacity;
|
|
1596
|
+
$[21] = t8;
|
|
1473
1597
|
} else {
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1598
|
+
casing = $[17];
|
|
1599
|
+
data = $[18];
|
|
1600
|
+
dim = $[19];
|
|
1601
|
+
opacity = $[20];
|
|
1602
|
+
t8 = $[21];
|
|
1477
1603
|
}
|
|
1478
|
-
const hasLabels =
|
|
1479
|
-
let
|
|
1480
|
-
if ($[
|
|
1481
|
-
|
|
1604
|
+
const hasLabels = t8;
|
|
1605
|
+
let t9;
|
|
1606
|
+
if ($[31] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1607
|
+
t9 = [
|
|
1482
1608
|
"case",
|
|
1483
1609
|
ACTIVE,
|
|
1484
1610
|
2,
|
|
1485
1611
|
0
|
|
1486
1612
|
];
|
|
1487
|
-
$[
|
|
1488
|
-
} else
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1613
|
+
$[31] = t9;
|
|
1614
|
+
} else t9 = $[31];
|
|
1615
|
+
const grow = t9;
|
|
1616
|
+
let t10;
|
|
1617
|
+
let t11;
|
|
1618
|
+
if ($[32] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1619
|
+
t10 = ["zoom"];
|
|
1620
|
+
t11 = [
|
|
1621
|
+
"+",
|
|
1622
|
+
grow,
|
|
1623
|
+
5
|
|
1624
|
+
];
|
|
1625
|
+
$[32] = t10;
|
|
1626
|
+
$[33] = t11;
|
|
1627
|
+
} else {
|
|
1628
|
+
t10 = $[32];
|
|
1629
|
+
t11 = $[33];
|
|
1630
|
+
}
|
|
1631
|
+
let t12;
|
|
1632
|
+
if ($[34] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1633
|
+
t12 = ["has", "label"];
|
|
1634
|
+
$[34] = t12;
|
|
1635
|
+
} else t12 = $[34];
|
|
1636
|
+
let t13;
|
|
1637
|
+
if ($[35] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1638
|
+
t13 = [
|
|
1497
1639
|
"+",
|
|
1498
|
-
|
|
1640
|
+
grow,
|
|
1499
1641
|
[
|
|
1500
1642
|
"case",
|
|
1501
|
-
|
|
1643
|
+
t12,
|
|
1502
1644
|
[
|
|
1503
1645
|
"step",
|
|
1504
1646
|
["length", ["get", "label"]],
|
|
@@ -1509,51 +1651,82 @@ function MapPoints(t0) {
|
|
|
1509
1651
|
5
|
|
1510
1652
|
]
|
|
1511
1653
|
];
|
|
1512
|
-
$[
|
|
1513
|
-
} else
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
$[
|
|
1524
|
-
$[
|
|
1525
|
-
} else
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1654
|
+
$[35] = t13;
|
|
1655
|
+
} else t13 = $[35];
|
|
1656
|
+
let t14;
|
|
1657
|
+
if ($[36] !== labelMinZoom) {
|
|
1658
|
+
t14 = [
|
|
1659
|
+
"step",
|
|
1660
|
+
t10,
|
|
1661
|
+
t11,
|
|
1662
|
+
labelMinZoom,
|
|
1663
|
+
t13
|
|
1664
|
+
];
|
|
1665
|
+
$[36] = labelMinZoom;
|
|
1666
|
+
$[37] = t14;
|
|
1667
|
+
} else t14 = $[37];
|
|
1668
|
+
const radius = t14;
|
|
1669
|
+
const clusterOpacity = hasSelection ? dim : 1;
|
|
1670
|
+
const sourceKey = cluster ? `cluster-${clusterRadius}-${clusterMaxZoom}` : "plain";
|
|
1671
|
+
let t15;
|
|
1672
|
+
if ($[38] !== cluster || $[39] !== clusterMaxZoom || $[40] !== clusterRadius) {
|
|
1673
|
+
t15 = cluster ? {
|
|
1674
|
+
cluster: true,
|
|
1675
|
+
clusterRadius,
|
|
1676
|
+
clusterMaxZoom
|
|
1677
|
+
} : {};
|
|
1678
|
+
$[38] = cluster;
|
|
1679
|
+
$[39] = clusterMaxZoom;
|
|
1680
|
+
$[40] = clusterRadius;
|
|
1681
|
+
$[41] = t15;
|
|
1682
|
+
} else t15 = $[41];
|
|
1683
|
+
const clusterProps = t15;
|
|
1684
|
+
let t16;
|
|
1685
|
+
if ($[42] !== cluster) {
|
|
1686
|
+
t16 = cluster && { filter: ["!", ["has", "point_count"]] };
|
|
1687
|
+
$[42] = cluster;
|
|
1688
|
+
$[43] = t16;
|
|
1689
|
+
} else t16 = $[43];
|
|
1690
|
+
let t17;
|
|
1691
|
+
if ($[44] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1692
|
+
t17 = ["get", "color"];
|
|
1693
|
+
$[44] = t17;
|
|
1694
|
+
} else t17 = $[44];
|
|
1695
|
+
let t18;
|
|
1696
|
+
if ($[45] !== casing || $[46] !== opacity || $[47] !== radius) {
|
|
1697
|
+
t18 = {
|
|
1698
|
+
"circle-color": t17,
|
|
1530
1699
|
"circle-radius": radius,
|
|
1531
|
-
"circle-stroke-color":
|
|
1700
|
+
"circle-stroke-color": casing,
|
|
1532
1701
|
"circle-stroke-width": 1.5,
|
|
1533
1702
|
"circle-opacity": opacity,
|
|
1534
1703
|
"circle-stroke-opacity": opacity
|
|
1535
1704
|
};
|
|
1536
|
-
$[
|
|
1537
|
-
$[
|
|
1538
|
-
$[
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1705
|
+
$[45] = casing;
|
|
1706
|
+
$[46] = opacity;
|
|
1707
|
+
$[47] = radius;
|
|
1708
|
+
$[48] = t18;
|
|
1709
|
+
} else t18 = $[48];
|
|
1710
|
+
let t19;
|
|
1711
|
+
if ($[49] !== circleId || $[50] !== t16 || $[51] !== t18) {
|
|
1712
|
+
t19 = /* @__PURE__ */ jsx(Layer, {
|
|
1543
1713
|
id: circleId,
|
|
1544
1714
|
type: "circle",
|
|
1545
|
-
|
|
1715
|
+
...t16,
|
|
1716
|
+
paint: t18
|
|
1546
1717
|
});
|
|
1547
|
-
$[
|
|
1548
|
-
$[
|
|
1549
|
-
$[
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1718
|
+
$[49] = circleId;
|
|
1719
|
+
$[50] = t16;
|
|
1720
|
+
$[51] = t18;
|
|
1721
|
+
$[52] = t19;
|
|
1722
|
+
} else t19 = $[52];
|
|
1723
|
+
let t20;
|
|
1724
|
+
if ($[53] !== hasLabels || $[54] !== labelId || $[55] !== labelMinZoom || $[56] !== opacity) {
|
|
1725
|
+
t20 = hasLabels && /* @__PURE__ */ jsx(Layer, {
|
|
1554
1726
|
id: labelId,
|
|
1555
1727
|
type: "symbol",
|
|
1556
1728
|
filter: ["has", "label"],
|
|
1729
|
+
minzoom: labelMinZoom,
|
|
1557
1730
|
layout: {
|
|
1558
1731
|
"text-field": ["get", "label"],
|
|
1559
1732
|
"text-font": LABEL_FONT,
|
|
@@ -1568,32 +1741,99 @@ function MapPoints(t0) {
|
|
|
1568
1741
|
"text-opacity": opacity
|
|
1569
1742
|
}
|
|
1570
1743
|
});
|
|
1571
|
-
$[
|
|
1572
|
-
$[
|
|
1573
|
-
$[
|
|
1574
|
-
$[
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1744
|
+
$[53] = hasLabels;
|
|
1745
|
+
$[54] = labelId;
|
|
1746
|
+
$[55] = labelMinZoom;
|
|
1747
|
+
$[56] = opacity;
|
|
1748
|
+
$[57] = t20;
|
|
1749
|
+
} else t20 = $[57];
|
|
1750
|
+
let t21;
|
|
1751
|
+
if ($[58] !== casing || $[59] !== cluster || $[60] !== clusterId || $[61] !== clusterOpacity || $[62] !== colors) {
|
|
1752
|
+
t21 = cluster && /* @__PURE__ */ jsx(Layer, {
|
|
1753
|
+
id: clusterId,
|
|
1754
|
+
type: "circle",
|
|
1755
|
+
filter: ["has", "point_count"],
|
|
1756
|
+
paint: {
|
|
1757
|
+
"circle-color": colors.color("var(--oui-map-cluster-color)"),
|
|
1758
|
+
"circle-radius": [
|
|
1759
|
+
"step",
|
|
1760
|
+
["get", "point_count"],
|
|
1761
|
+
12,
|
|
1762
|
+
10,
|
|
1763
|
+
15,
|
|
1764
|
+
100,
|
|
1765
|
+
19,
|
|
1766
|
+
1e3,
|
|
1767
|
+
24
|
|
1768
|
+
],
|
|
1769
|
+
"circle-stroke-color": casing,
|
|
1770
|
+
"circle-stroke-width": 2,
|
|
1771
|
+
"circle-opacity": clusterOpacity,
|
|
1772
|
+
"circle-stroke-opacity": clusterOpacity
|
|
1773
|
+
}
|
|
1774
|
+
});
|
|
1775
|
+
$[58] = casing;
|
|
1776
|
+
$[59] = cluster;
|
|
1777
|
+
$[60] = clusterId;
|
|
1778
|
+
$[61] = clusterOpacity;
|
|
1779
|
+
$[62] = colors;
|
|
1780
|
+
$[63] = t21;
|
|
1781
|
+
} else t21 = $[63];
|
|
1782
|
+
let t22;
|
|
1783
|
+
if ($[64] !== cluster || $[65] !== clusterOpacity || $[66] !== colors || $[67] !== countId) {
|
|
1784
|
+
t22 = cluster && /* @__PURE__ */ jsx(Layer, {
|
|
1785
|
+
id: countId,
|
|
1786
|
+
type: "symbol",
|
|
1787
|
+
filter: ["has", "point_count"],
|
|
1788
|
+
layout: {
|
|
1789
|
+
"text-field": ["get", "point_count_abbreviated"],
|
|
1790
|
+
"text-font": LABEL_FONT,
|
|
1791
|
+
"text-size": 11,
|
|
1792
|
+
"text-allow-overlap": true,
|
|
1793
|
+
"text-ignore-placement": true
|
|
1794
|
+
},
|
|
1795
|
+
paint: {
|
|
1796
|
+
"text-color": colors.color("var(--oui-map-cluster-text-color)"),
|
|
1797
|
+
"text-opacity": clusterOpacity
|
|
1798
|
+
}
|
|
1799
|
+
});
|
|
1800
|
+
$[64] = cluster;
|
|
1801
|
+
$[65] = clusterOpacity;
|
|
1802
|
+
$[66] = colors;
|
|
1803
|
+
$[67] = countId;
|
|
1804
|
+
$[68] = t22;
|
|
1805
|
+
} else t22 = $[68];
|
|
1806
|
+
let t23;
|
|
1807
|
+
if ($[69] !== clusterProps || $[70] !== data || $[71] !== sourceId || $[72] !== sourceKey || $[73] !== t19 || $[74] !== t20 || $[75] !== t21 || $[76] !== t22) {
|
|
1808
|
+
t23 = /* @__PURE__ */ jsxs(Source, {
|
|
1579
1809
|
id: sourceId,
|
|
1580
1810
|
type: "geojson",
|
|
1581
1811
|
data,
|
|
1582
1812
|
promoteId: "id",
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1813
|
+
...clusterProps,
|
|
1814
|
+
children: [
|
|
1815
|
+
t19,
|
|
1816
|
+
t20,
|
|
1817
|
+
t21,
|
|
1818
|
+
t22
|
|
1819
|
+
]
|
|
1820
|
+
}, sourceKey);
|
|
1821
|
+
$[69] = clusterProps;
|
|
1822
|
+
$[70] = data;
|
|
1823
|
+
$[71] = sourceId;
|
|
1824
|
+
$[72] = sourceKey;
|
|
1825
|
+
$[73] = t19;
|
|
1826
|
+
$[74] = t20;
|
|
1827
|
+
$[75] = t21;
|
|
1828
|
+
$[76] = t22;
|
|
1829
|
+
$[77] = t23;
|
|
1830
|
+
} else t23 = $[77];
|
|
1831
|
+
return t23;
|
|
1592
1832
|
}
|
|
1593
|
-
function
|
|
1833
|
+
function _temp15(feature) {
|
|
1594
1834
|
return "label" in feature.properties;
|
|
1595
1835
|
}
|
|
1596
|
-
function
|
|
1836
|
+
function _temp14(item) {
|
|
1597
1837
|
return item.coordinates;
|
|
1598
1838
|
}
|
|
1599
1839
|
/**
|
|
@@ -1936,7 +2176,7 @@ function MapLegend(t0) {
|
|
|
1936
2176
|
const labels = React.use(MapContext)?.labels ?? defaultLabels;
|
|
1937
2177
|
let t6;
|
|
1938
2178
|
if ($[13] !== items) {
|
|
1939
|
-
t6 = items.every(
|
|
2179
|
+
t6 = items.every(_temp16);
|
|
1940
2180
|
$[13] = items;
|
|
1941
2181
|
$[14] = t6;
|
|
1942
2182
|
} else t6 = $[14];
|
|
@@ -1965,7 +2205,7 @@ function MapLegend(t0) {
|
|
|
1965
2205
|
t9 = onVisibilityChange && showAllToggle && /* @__PURE__ */ jsx("button", {
|
|
1966
2206
|
type: "button",
|
|
1967
2207
|
className: "oui-map-legend__toggle-all",
|
|
1968
|
-
onClick: () => onVisibilityChange(items.map(
|
|
2208
|
+
onClick: () => onVisibilityChange(items.map(_temp17), !allVisible),
|
|
1969
2209
|
children: allVisible ? labels.hideAll : labels.showAll
|
|
1970
2210
|
});
|
|
1971
2211
|
$[21] = allVisible;
|
|
@@ -2064,10 +2304,10 @@ function MapLegend(t0) {
|
|
|
2064
2304
|
} else t12 = $[49];
|
|
2065
2305
|
return t12;
|
|
2066
2306
|
}
|
|
2067
|
-
function
|
|
2307
|
+
function _temp17(item_0) {
|
|
2068
2308
|
return item_0.id;
|
|
2069
2309
|
}
|
|
2070
|
-
function
|
|
2310
|
+
function _temp16(item) {
|
|
2071
2311
|
return item.visible !== false;
|
|
2072
2312
|
}
|
|
2073
2313
|
/**
|
|
@@ -2157,7 +2397,7 @@ function MapBaseLayerSwitch(t0) {
|
|
|
2157
2397
|
}
|
|
2158
2398
|
let t3;
|
|
2159
2399
|
if ($[23] !== baseLayers) {
|
|
2160
|
-
t3 = baseLayers.map(
|
|
2400
|
+
t3 = baseLayers.map(_temp18);
|
|
2161
2401
|
$[23] = baseLayers;
|
|
2162
2402
|
$[24] = t3;
|
|
2163
2403
|
} else t3 = $[24];
|
|
@@ -2201,7 +2441,7 @@ function MapBaseLayerSwitch(t0) {
|
|
|
2201
2441
|
* </Map.Overlay>
|
|
2202
2442
|
* </Map.Root>
|
|
2203
2443
|
*/
|
|
2204
|
-
function
|
|
2444
|
+
function _temp18(layer_0) {
|
|
2205
2445
|
return {
|
|
2206
2446
|
value: layer_0.id,
|
|
2207
2447
|
label: layer_0.label
|