@octostar/map-component 0.7.1 → 0.8.1
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/README.md +49 -0
- package/dist/index.mjs +1379 -922
- package/dist/index.mjs.map +1 -1
- package/dist/types/components/action-panel.d.ts.map +1 -1
- package/dist/types/components/cluster-pie-chart.d.ts +1 -1
- package/dist/types/components/cluster-pie-chart.d.ts.map +1 -1
- package/dist/types/components/drawing-toolbar.d.ts.map +1 -1
- package/dist/types/components/icon-picker.d.ts.map +1 -1
- package/dist/types/components/ingest-progress-overlay.d.ts.map +1 -1
- package/dist/types/components/layers-panel.d.ts +3 -0
- package/dist/types/components/layers-panel.d.ts.map +1 -1
- package/dist/types/components/map-drop-zone.d.ts.map +1 -1
- package/dist/types/components/map-editor-canvas.d.ts.map +1 -1
- package/dist/types/components/properties-panel.d.ts +1 -1
- package/dist/types/components/properties-panel.d.ts.map +1 -1
- package/dist/types/components/status-indicator.d.ts.map +1 -1
- package/dist/types/components/timebar.d.ts +3 -7
- package/dist/types/components/timebar.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/lib/custom-layer-stack.d.ts +10 -2
- package/dist/types/lib/custom-layer-stack.d.ts.map +1 -1
- package/dist/types/lib/feature-cap.d.ts +25 -1
- package/dist/types/lib/feature-cap.d.ts.map +1 -1
- package/dist/types/lib/feature-stack.d.ts +0 -2
- package/dist/types/lib/feature-stack.d.ts.map +1 -1
- package/dist/types/lib/icon-catalog.d.ts +654 -0
- package/dist/types/lib/icon-catalog.d.ts.map +1 -1
- package/dist/types/lib/ingest-client.d.ts +9 -0
- package/dist/types/lib/ingest-client.d.ts.map +1 -1
- package/dist/types/lib/ingest-progress.d.ts +4 -3
- package/dist/types/lib/ingest-progress.d.ts.map +1 -1
- package/dist/types/lib/label-pinning.d.ts +1 -1
- package/dist/types/lib/label-pinning.d.ts.map +1 -1
- package/dist/types/lib/map-editor-api.d.ts +12 -1
- package/dist/types/lib/map-editor-api.d.ts.map +1 -1
- package/dist/types/lib/map-endpoints.d.ts +2 -1
- package/dist/types/lib/map-endpoints.d.ts.map +1 -1
- package/dist/types/lib/map-labels.d.ts +890 -0
- package/dist/types/lib/map-labels.d.ts.map +1 -0
- package/dist/types/lib/selection-overlay.d.ts +1 -1
- package/dist/types/lib/selection-overlay.d.ts.map +1 -1
- package/dist/types/lib/shard-pipeline.d.ts.map +1 -1
- package/dist/types/lib/shard-registry.d.ts +2 -0
- package/dist/types/lib/shard-registry.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useRef, useLayoutEffect, useState, useEffect, useSyncExternalStore, useCallback, useMemo,
|
|
2
|
+
import { useContext, createContext, useRef, useLayoutEffect, useState, useEffect, useSyncExternalStore, useCallback, useMemo, forwardRef, useImperativeHandle } from "react";
|
|
3
3
|
import * as maplibregl from "maplibre-gl";
|
|
4
4
|
import { getWorkerUrl, getVersion, setWorkerUrl } from "maplibre-gl";
|
|
5
5
|
import MapboxDraw from "@mapbox/mapbox-gl-draw";
|
|
@@ -144,7 +144,7 @@ async function featureCollectionBlobPartsAsync(collection, options) {
|
|
|
144
144
|
(_c = options == null ? void 0 : options.onProgress) == null ? void 0 : _c.call(options, total, total);
|
|
145
145
|
return coalescer.finish();
|
|
146
146
|
}
|
|
147
|
-
const ingestWorkerSource = '"use strict";(()=>{function b(e,t){let n=e.length,r=Math.max(0,t.max-(t.existing??0));return n<=r?{features:e,dropped:0,sourceCount:n}:{features:e.slice(0,r),dropped:n-r,sourceCount:n}}function S(e){let t=e.crs?.properties?.name,n=null;if(t){let r=t.match(/EPSG::?(\\d+)/i);r&&(n=`EPSG:${r[1]}`)}if(!n&&e.features.length>0){let r=
|
|
147
|
+
const ingestWorkerSource = '"use strict";(()=>{function b(e,t){let n=e.length,r=Math.max(0,t.max-(t.existing??0));return n<=r?{features:e,dropped:0,sourceCount:n}:{features:e.slice(0,r),dropped:n-r,sourceCount:n}}function S(e){let t=e.crs?.properties?.name,n=null;if(t){let r=t.match(/EPSG::?(\\d+)/i);r&&(n=`EPSG:${r[1]}`)}if(!n&&e.features.length>0){let r=E(e.features[0].geometry);if(r){let[s,a]=r;if(Math.abs(s)<=180&&Math.abs(a)<=90)return{sourceCRS:"EPSG:4326",needsReprojection:!1}}return{sourceCRS:null,needsReprojection:!1}}return{sourceCRS:n,needsReprojection:n!==null&&n!=="EPSG:4326"}}function E(e){if(!e)return null;switch(e.type){case"Point":return e.coordinates;case"MultiPoint":case"LineString":return e.coordinates[0];case"MultiLineString":case"Polygon":return e.coordinates[0]?.[0];case"MultiPolygon":return e.coordinates[0]?.[0]?.[0];default:return null}}function I(e){return e.geometry?.type==="LineString"?e.geometry.coordinates.some(n=>n.length>=3&&n[2]!==0):e.geometry?.type==="MultiLineString"?e.geometry.coordinates.some(n=>n.some(r=>r.length>=3&&r[2]!==0)):!1}function d(e){if(!e)return null;if(e instanceof Date)return e;if(typeof e=="string"||typeof e=="number"){let t=new Date(e);return isNaN(t.getTime())?null:t}return null}function h(e){return!!(e.startDate||e.startdate||e.start_date||e.start_time||e.date||e.timestamp||e.flightDate||e.time||e.datetime||e.endDate||e.enddate||e.end_date||e.end_time)}function F(e){let t=d(e.startDate)||d(e.startdate)||d(e.start_date)||d(e.start_time)||d(e.date)||d(e.timestamp)||d(e.flightDate)||d(e.time)||d(e.datetime),n=d(e.endDate)||d(e.enddate)||d(e.end_date)||d(e.end_time);return t&&n&&n<t&&([t,n]=[n,t]),{startDate:t,endDate:n}}function x(e){return"kind"in e&&e.kind==="ack"}function w(){let e=globalThis.crypto?.randomUUID?.bind(globalThis.crypto);return e?e():`f-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function _(e,t,n){switch(n.idStrategy){case"preserve":return e.id;case"layer-index":return e.id!==void 0&&e.id!==null?String(e.id):`${n.layerId}-f${t}`;case"uuid-fallback":return e.id?String(e.id):w()}}function C(e,t){if(Array.isArray(e)){if(typeof e[0]=="number"){let n=e[0],r=e[1];t[0]=Math.min(t[0],n),t[1]=Math.min(t[1],r),t[2]=Math.max(t[2],n),t[3]=Math.max(t[3],r);return}for(let n of e)C(n,t)}}function R(e,t){if(e){if(e.type==="GeometryCollection"){for(let n of e.geometries)R(n,t);return}C(e.coordinates,t)}}function G(e){let t=[1/0,1/0,-1/0,-1/0];for(let n of e)R(n.geometry,t);return t.every(n=>isFinite(n))?t:null}function A(e,t){let n;if(e.type==="text")try{n=JSON.parse(e.text)}catch(c){return{kind:"error",code:"parse-error",message:c instanceof Error?c.message:"Invalid file"}}else n=e.data;if(n&&n.type==="Feature"&&(n={type:"FeatureCollection",features:[n]}),!n||n.type!=="FeatureCollection"||!Array.isArray(n.features))return{kind:"error",code:"invalid-format",message:"Invalid GeoJSON format"};if(t.emptyIsError&&n.features.length===0)return{kind:"error",code:"empty",message:"The file contains no features"};if(n["octostar:map"])return{kind:"enriched",data:n};let{sourceCRS:r,needsReprojection:s}=S(n),a=b(n.features,{max:t.maxFeatures??1/0}),o=!1,u=!1,i=[];a.features.forEach((c,D)=>{let p=_(c,D,t);!u&&I(c)&&(u=!0);let g=c.properties||{};if(!h(g)){i.push(t.idStrategy==="preserve"?c:{...c,id:p});return}let{startDate:y,endDate:k}=F(g);(y||k)&&(o=!0),i.push({...c,...p!==void 0&&{id:p},properties:{...g,startDate:y?.toISOString()||null,endDate:k?.toISOString()||null}})});let m=n.properties?.layerMetadata;return{kind:"features",features:i,featureCount:i.length,bbox:G(i),hasTemporal:o,hasAltitude:u,reprojected:!1,sourceCRS:r,...s&&{needsReprojection:s},...m&&{layerMetadata:m},...a.dropped>0&&{truncated:{droppedCount:a.dropped,sourceFeatureCount:a.sourceCount,maxFeatures:t.maxFeatures}}}}var N=5e3;function P(e,t){let n=Number.isNaN(t)?N:Math.max(1,Math.floor(t)),r=[];for(let s=0;s<e.length;s+=n)r.push(e.slice(s,s+n));return r}function f(e){if(e===void 0)return!1;if(typeof e=="number")return Number.isFinite(e)&&!Object.is(e,-0);if(e===null||typeof e!="object")return!0;if(Array.isArray(e)){for(let t=0;t<e.length;t++)if(!f(e[t]))return!1;return!0}for(let t in e)if(!f(e[t]))return!1;return!0}function J(e){for(let t=0;t<e.length;t++)if(!f(e[t]))return e;try{return JSON.stringify(e)}catch{return e}}function M(e){let{kind:t,features:n,...r}=e;return r}async function T(e,t,n,r){let s;try{s=A(t,n)}catch(a){r.post({kind:"result",id:e,ok:!1,error:a instanceof Error?a.message:String(a)});return}if(s.kind!=="features"){r.post({kind:"result",id:e,ok:!0,result:s});return}try{let a=r.encode??J,o=P(s.features,r.chunkSize??N);r.post({kind:"head",id:e,summary:M(s)});let u=o.length>0?a(o[0]):null;for(let i=0;i<o.length;i++){let m=r.waitAck(i);r.post({kind:"chunk",id:e,seq:i,payload:u}),u=i+1<o.length?a(o[i+1]):null,await m}r.post({kind:"done",id:e,chunkCount:o.length})}catch(a){r.post({kind:"error",id:e,message:a instanceof Error?a.message:String(a)})}}var O=e=>self.postMessage(e),l=new Map;self.onmessage=async e=>{let t=e.data;if(x(t)){let o=`${t.id}:${t.seq}`,u=l.get(o);l.delete(o),u?.();return}let{id:n,source:r,options:s,tuning:a}=t;try{let o=r.type==="blob"?{type:"text",text:await r.blob.text()}:r;await T(n,o,s,{post:O,waitAck:u=>new Promise(i=>{l.set(`${n}:${u}`,i)}),...a?.chunkSize!==void 0&&{chunkSize:a.chunkSize},...a?.featureArrayChunks&&{encode:u=>u}})}catch(o){O({kind:"result",id:n,ok:!1,error:o instanceof Error?o.message:String(o)})}finally{l.forEach((o,u)=>{u.startsWith(`${n}:`)&&l.delete(u)})}};})();\n';
|
|
148
148
|
proj4.defs("EPSG:27700", "+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +towgs84=446.448,-125.157,542.06,0.15,0.247,0.842,-20.489 +units=m +no_defs");
|
|
149
149
|
proj4.defs("EPSG:3857", "+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs");
|
|
150
150
|
proj4.defs("EPSG:32630", "+proj=utm +zone=30 +datum=WGS84 +units=m +no_defs");
|
|
@@ -220,35 +220,47 @@ function truncationToCapInfo(truncation, rest) {
|
|
|
220
220
|
function formatCount(value) {
|
|
221
221
|
return value.toLocaleString("en-US");
|
|
222
222
|
}
|
|
223
|
-
|
|
223
|
+
const DEFAULT_FEATURE_CAP_LABELS = {
|
|
224
|
+
title: "Feature limit reached",
|
|
225
|
+
layersOverLimit: ({ layerCount, max, dropped }) => `${formatCount(layerCount)} layers were larger than the ${formatCount(max)}-feature limit; ${formatCount(dropped)} features in total were not loaded.`,
|
|
226
|
+
layerAlreadyHeld: ({ layerName, existing, max, kept, dropped }) => `"${layerName}" already held ${formatCount(existing)} of its ${formatCount(max)}-feature limit, so only ${formatCount(kept)} more were added; ${formatCount(dropped)} were skipped.`,
|
|
227
|
+
firstFeaturesAdded: ({ kept, sourceCount, layerName, dropped }) => `Only the first ${formatCount(kept)} of ${formatCount(sourceCount)} features were added to "${layerName}"; ${formatCount(dropped)} were skipped (per-layer limit).`,
|
|
228
|
+
restoreNote: "Re-saving this map will persist only the loaded features."
|
|
229
|
+
};
|
|
230
|
+
function formatFeatureCapToast(info, labels = DEFAULT_FEATURE_CAP_LABELS) {
|
|
224
231
|
const isRestore = info.source === "restore";
|
|
225
232
|
const variant = isRestore ? "destructive" : "default";
|
|
226
|
-
const withNote = (text) => isRestore ? `${text}
|
|
233
|
+
const withNote = (text) => isRestore ? `${text} ${labels.restoreNote}` : text;
|
|
227
234
|
const layerCount = info.layerCount ?? 1;
|
|
228
235
|
if (layerCount > 1) {
|
|
229
236
|
return {
|
|
230
|
-
title:
|
|
231
|
-
description: withNote(
|
|
232
|
-
`${formatCount(layerCount)} layers were larger than the ${formatCount(info.max)}-feature limit; ${formatCount(info.dropped)} features in total were not loaded.`
|
|
233
|
-
),
|
|
237
|
+
title: labels.title,
|
|
238
|
+
description: withNote(labels.layersOverLimit({ layerCount, max: info.max, dropped: info.dropped })),
|
|
234
239
|
variant
|
|
235
240
|
};
|
|
236
241
|
}
|
|
237
242
|
const existing = info.existing ?? 0;
|
|
238
243
|
if (existing > 0) {
|
|
239
244
|
return {
|
|
240
|
-
title:
|
|
241
|
-
description: withNote(
|
|
242
|
-
|
|
243
|
-
|
|
245
|
+
title: labels.title,
|
|
246
|
+
description: withNote(labels.layerAlreadyHeld({
|
|
247
|
+
layerName: info.layerName,
|
|
248
|
+
existing,
|
|
249
|
+
max: info.max,
|
|
250
|
+
kept: info.kept,
|
|
251
|
+
dropped: info.dropped
|
|
252
|
+
})),
|
|
244
253
|
variant
|
|
245
254
|
};
|
|
246
255
|
}
|
|
247
256
|
return {
|
|
248
|
-
title:
|
|
249
|
-
description: withNote(
|
|
250
|
-
|
|
251
|
-
|
|
257
|
+
title: labels.title,
|
|
258
|
+
description: withNote(labels.firstFeaturesAdded({
|
|
259
|
+
kept: info.kept,
|
|
260
|
+
sourceCount: info.sourceCount,
|
|
261
|
+
layerName: info.layerName,
|
|
262
|
+
dropped: info.dropped
|
|
263
|
+
})),
|
|
252
264
|
variant
|
|
253
265
|
};
|
|
254
266
|
}
|
|
@@ -433,6 +445,18 @@ function mapPerfLog(area, message2, data) {
|
|
|
433
445
|
console.info(`[map-perf:${area}] ${message2}`, data);
|
|
434
446
|
}
|
|
435
447
|
}
|
|
448
|
+
class IngestWorkerError extends Error {
|
|
449
|
+
constructor(failure, message2) {
|
|
450
|
+
super(message2);
|
|
451
|
+
this.failure = failure;
|
|
452
|
+
this.name = "IngestWorkerError";
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
function describeIngestFailure(error, labels) {
|
|
456
|
+
if (error instanceof IngestWorkerError && error.failure === "unresponsive") return labels.ingest.workerUnresponsive;
|
|
457
|
+
if (error instanceof IngestWorkerError && error.failure === "crashed") return labels.ingest.workerCrashed;
|
|
458
|
+
return error instanceof Error ? error.message : labels.toasts.invalidFile;
|
|
459
|
+
}
|
|
436
460
|
function finalizeReprojection(result) {
|
|
437
461
|
if (result.kind !== "features" || !result.needsReprojection || !result.sourceCRS) return result;
|
|
438
462
|
const reprojected = reprojectFeatures(result.features, result.sourceCRS);
|
|
@@ -500,15 +524,15 @@ function createIngestClient(portFactory = createWorkerPort) {
|
|
|
500
524
|
let portUnavailable = false;
|
|
501
525
|
let nextId = 0;
|
|
502
526
|
const pending = /* @__PURE__ */ new Map();
|
|
503
|
-
const rejectAllPending = (reason) => {
|
|
527
|
+
const rejectAllPending = (failure, reason) => {
|
|
504
528
|
pending.forEach((request) => {
|
|
505
529
|
clearTimeout(request.timeout);
|
|
506
|
-
request.reject(new
|
|
530
|
+
request.reject(new IngestWorkerError(failure, reason));
|
|
507
531
|
});
|
|
508
532
|
pending.clear();
|
|
509
533
|
};
|
|
510
|
-
const abandonPort = (reason) => {
|
|
511
|
-
rejectAllPending(reason);
|
|
534
|
+
const abandonPort = (reason, failure = "protocol") => {
|
|
535
|
+
rejectAllPending(failure, reason);
|
|
512
536
|
port == null ? void 0 : port.terminate();
|
|
513
537
|
port = null;
|
|
514
538
|
};
|
|
@@ -518,7 +542,7 @@ function createIngestClient(portFactory = createWorkerPort) {
|
|
|
518
542
|
console.warn(
|
|
519
543
|
`[map-component] Ingest worker unresponsive for "${request.label}" after ${INGEST_STALL_TIMEOUT_MS}ms; it will be respawned on next use.`
|
|
520
544
|
);
|
|
521
|
-
abandonPort("Ingest worker unresponsive — the file could not be parsed");
|
|
545
|
+
abandonPort("Ingest worker unresponsive — the file could not be parsed", "unresponsive");
|
|
522
546
|
}, INGEST_STALL_TIMEOUT_MS);
|
|
523
547
|
};
|
|
524
548
|
const callHook = (request, invoke) => {
|
|
@@ -659,7 +683,7 @@ function createIngestClient(portFactory = createWorkerPort) {
|
|
|
659
683
|
activePort.onMessage((msg) => handleMessage(activePort, msg));
|
|
660
684
|
activePort.onError((err) => {
|
|
661
685
|
console.warn("[map-component] Ingest worker crashed; it will be respawned on next use.", err);
|
|
662
|
-
abandonPort("Ingest worker crashed");
|
|
686
|
+
abandonPort("Ingest worker crashed", "crashed");
|
|
663
687
|
});
|
|
664
688
|
return port;
|
|
665
689
|
};
|
|
@@ -707,7 +731,7 @@ function createIngestClient(portFactory = createWorkerPort) {
|
|
|
707
731
|
});
|
|
708
732
|
},
|
|
709
733
|
dispose() {
|
|
710
|
-
abandonPort("Ingest client disposed");
|
|
734
|
+
abandonPort("Ingest client disposed", "disposed");
|
|
711
735
|
portUnavailable = false;
|
|
712
736
|
}
|
|
713
737
|
};
|
|
@@ -730,7 +754,7 @@ function createIngestProgressStore() {
|
|
|
730
754
|
return {
|
|
731
755
|
begin(label, options) {
|
|
732
756
|
const id = nextId++;
|
|
733
|
-
entries.set(id, { label, received: 0, total: null, ...(options == null ? void 0 : options.
|
|
757
|
+
entries.set(id, { label, received: 0, total: null, ...(options == null ? void 0 : options.activity) && { activity: options.activity } });
|
|
734
758
|
notify();
|
|
735
759
|
return {
|
|
736
760
|
setTotal(total) {
|
|
@@ -797,6 +821,560 @@ function hostIconSizeMultiplier(size, fieldPosition) {
|
|
|
797
821
|
if ((size == null ? void 0 : size.mode) === "field" && fieldPosition !== null) return 0.6 + fieldPosition * 0.9;
|
|
798
822
|
return 1;
|
|
799
823
|
}
|
|
824
|
+
const ICON_LIST = [
|
|
825
|
+
// Location & Places
|
|
826
|
+
{ id: "map-pin", emoji: "📍", name: "Map Pin", category: "places" },
|
|
827
|
+
{ id: "home", emoji: "🏠", name: "Home", category: "places" },
|
|
828
|
+
{ id: "building", emoji: "🏢", name: "Building", category: "places" },
|
|
829
|
+
{ id: "store", emoji: "🏪", name: "Store", category: "places" },
|
|
830
|
+
{ id: "factory", emoji: "🏭", name: "Factory", category: "places" },
|
|
831
|
+
{ id: "construction", emoji: "🏗️", name: "Construction", category: "places" },
|
|
832
|
+
{ id: "church", emoji: "⛪", name: "Church", category: "places" },
|
|
833
|
+
{ id: "hospital", emoji: "🏥", name: "Hospital", category: "places" },
|
|
834
|
+
{ id: "school", emoji: "🏫", name: "School", category: "places" },
|
|
835
|
+
{ id: "graduation", emoji: "🎓", name: "University", category: "places" },
|
|
836
|
+
{ id: "library", emoji: "📚", name: "Library", category: "places" },
|
|
837
|
+
{ id: "landmark", emoji: "🏛️", name: "Landmark", category: "places" },
|
|
838
|
+
{ id: "castle", emoji: "🏰", name: "Castle", category: "places" },
|
|
839
|
+
{ id: "mosque", emoji: "🕌", name: "Mosque", category: "places" },
|
|
840
|
+
{ id: "stadium", emoji: "🏟️", name: "Stadium", category: "places" },
|
|
841
|
+
{ id: "tent", emoji: "⛺", name: "Camping", category: "places" },
|
|
842
|
+
// Transport
|
|
843
|
+
{ id: "car", emoji: "🚗", name: "Car", category: "transport" },
|
|
844
|
+
{ id: "bus", emoji: "🚌", name: "Bus", category: "transport" },
|
|
845
|
+
{ id: "train", emoji: "🚂", name: "Train", category: "transport" },
|
|
846
|
+
{ id: "plane", emoji: "✈️", name: "Plane", category: "transport" },
|
|
847
|
+
{ id: "ship", emoji: "🚢", name: "Ship", category: "transport" },
|
|
848
|
+
{ id: "bike", emoji: "🚲", name: "Bike", category: "transport" },
|
|
849
|
+
{ id: "fuel", emoji: "⛽", name: "Gas Station", category: "transport" },
|
|
850
|
+
{ id: "helicopter", emoji: "🚁", name: "Helicopter", category: "transport" },
|
|
851
|
+
{ id: "rocket", emoji: "🚀", name: "Rocket", category: "transport" },
|
|
852
|
+
{ id: "motorcycle", emoji: "🏍️", name: "Motorcycle", category: "transport" },
|
|
853
|
+
{ id: "taxi", emoji: "🚕", name: "Taxi", category: "transport" },
|
|
854
|
+
{ id: "truck", emoji: "🚛", name: "Truck", category: "transport" },
|
|
855
|
+
// Food & Drink
|
|
856
|
+
{ id: "utensils", emoji: "🍴", name: "Restaurant", category: "food" },
|
|
857
|
+
{ id: "coffee", emoji: "☕", name: "Coffee", category: "food" },
|
|
858
|
+
{ id: "beer", emoji: "🍺", name: "Bar", category: "food" },
|
|
859
|
+
{ id: "wine", emoji: "🍷", name: "Wine", category: "food" },
|
|
860
|
+
{ id: "pizza", emoji: "🍕", name: "Pizza", category: "food" },
|
|
861
|
+
{ id: "ice-cream", emoji: "🍦", name: "Ice Cream", category: "food" },
|
|
862
|
+
{ id: "apple", emoji: "🍎", name: "Apple", category: "food" },
|
|
863
|
+
{ id: "cake", emoji: "🎂", name: "Cake", category: "food" },
|
|
864
|
+
{ id: "hamburger", emoji: "🍔", name: "Burger", category: "food" },
|
|
865
|
+
// Nature
|
|
866
|
+
{ id: "trees", emoji: "🌲", name: "Forest", category: "nature" },
|
|
867
|
+
{ id: "mountain", emoji: "⛰️", name: "Mountain", category: "nature" },
|
|
868
|
+
{ id: "waves", emoji: "🌊", name: "Water", category: "nature" },
|
|
869
|
+
{ id: "sun", emoji: "☀️", name: "Sun", category: "nature" },
|
|
870
|
+
{ id: "cloud", emoji: "☁️", name: "Cloud", category: "nature" },
|
|
871
|
+
{ id: "umbrella", emoji: "🌂", name: "Umbrella", category: "nature" },
|
|
872
|
+
{ id: "flower", emoji: "🌸", name: "Flower", category: "nature" },
|
|
873
|
+
{ id: "leaf", emoji: "🍃", name: "Leaf", category: "nature" },
|
|
874
|
+
{ id: "rainbow", emoji: "🌈", name: "Rainbow", category: "nature" },
|
|
875
|
+
{ id: "snowflake", emoji: "❄️", name: "Snow", category: "nature" },
|
|
876
|
+
{ id: "fire", emoji: "🔥", name: "Fire", category: "nature" },
|
|
877
|
+
{ id: "volcano", emoji: "🌋", name: "Volcano", category: "nature" },
|
|
878
|
+
// Symbols & Markers
|
|
879
|
+
{ id: "heart", emoji: "❤️", name: "Heart", category: "symbols" },
|
|
880
|
+
{ id: "star", emoji: "⭐", name: "Star", category: "symbols" },
|
|
881
|
+
{ id: "flag", emoji: "🚩", name: "Flag", category: "symbols" },
|
|
882
|
+
{ id: "alert", emoji: "⚠️", name: "Warning", category: "symbols" },
|
|
883
|
+
{ id: "info", emoji: "ℹ️", name: "Info", category: "symbols" },
|
|
884
|
+
{ id: "check", emoji: "✅", name: "Check", category: "symbols" },
|
|
885
|
+
{ id: "x-mark", emoji: "❌", name: "X", category: "symbols" },
|
|
886
|
+
{ id: "zap", emoji: "⚡", name: "Zap", category: "symbols" },
|
|
887
|
+
{ id: "bell", emoji: "🔔", name: "Bell", category: "symbols" },
|
|
888
|
+
{ id: "peace", emoji: "☮️", name: "Peace", category: "symbols" },
|
|
889
|
+
{ id: "recycle", emoji: "♻️", name: "Recycle", category: "symbols" },
|
|
890
|
+
{ id: "radioactive", emoji: "☢️", name: "Radioactive", category: "symbols" },
|
|
891
|
+
{ id: "biohazard", emoji: "☣️", name: "Biohazard", category: "symbols" },
|
|
892
|
+
// Activities
|
|
893
|
+
{ id: "camera", emoji: "📷", name: "Camera", category: "activities" },
|
|
894
|
+
{ id: "music", emoji: "🎵", name: "Music", category: "activities" },
|
|
895
|
+
{ id: "film", emoji: "🎬", name: "Cinema", category: "activities" },
|
|
896
|
+
{ id: "gamepad", emoji: "🎮", name: "Gaming", category: "activities" },
|
|
897
|
+
{ id: "trophy", emoji: "🏆", name: "Trophy", category: "activities" },
|
|
898
|
+
{ id: "medal", emoji: "🎖️", name: "Medal", category: "activities" },
|
|
899
|
+
{ id: "sports", emoji: "⚽", name: "Sports", category: "activities" },
|
|
900
|
+
{ id: "basketball", emoji: "🏀", name: "Basketball", category: "activities" },
|
|
901
|
+
{ id: "fishing", emoji: "🎣", name: "Fishing", category: "activities" },
|
|
902
|
+
{ id: "art", emoji: "🎨", name: "Art", category: "activities" },
|
|
903
|
+
// Work & Tools
|
|
904
|
+
{ id: "briefcase", emoji: "💼", name: "Office", category: "work" },
|
|
905
|
+
{ id: "wrench", emoji: "🔧", name: "Repair", category: "work" },
|
|
906
|
+
{ id: "hammer", emoji: "🔨", name: "Construction", category: "work" },
|
|
907
|
+
{ id: "gear", emoji: "⚙️", name: "Settings", category: "work" },
|
|
908
|
+
{ id: "microscope", emoji: "🔬", name: "Science", category: "work" },
|
|
909
|
+
{ id: "test-tube", emoji: "🧪", name: "Lab", category: "work" },
|
|
910
|
+
{ id: "computer", emoji: "💻", name: "Computer", category: "work" },
|
|
911
|
+
// Shopping
|
|
912
|
+
{ id: "cart", emoji: "🛒", name: "Shopping", category: "shopping" },
|
|
913
|
+
{ id: "gift", emoji: "🎁", name: "Gift", category: "shopping" },
|
|
914
|
+
{ id: "package", emoji: "📦", name: "Package", category: "shopping" },
|
|
915
|
+
{ id: "money", emoji: "💰", name: "Money", category: "shopping" },
|
|
916
|
+
{ id: "credit-card", emoji: "💳", name: "Payment", category: "shopping" },
|
|
917
|
+
// Communication
|
|
918
|
+
{ id: "phone", emoji: "📱", name: "Phone", category: "communication" },
|
|
919
|
+
{ id: "mail", emoji: "📧", name: "Mail", category: "communication" },
|
|
920
|
+
{ id: "globe", emoji: "🌐", name: "Web", category: "communication" },
|
|
921
|
+
{ id: "satellite", emoji: "📡", name: "Satellite", category: "communication" },
|
|
922
|
+
{ id: "radio", emoji: "📻", name: "Radio", category: "communication" },
|
|
923
|
+
{ id: "tv", emoji: "📺", name: "TV", category: "communication" },
|
|
924
|
+
// People & Animals
|
|
925
|
+
{ id: "user", emoji: "👤", name: "Person", category: "people" },
|
|
926
|
+
{ id: "users", emoji: "👥", name: "Group", category: "people" },
|
|
927
|
+
{ id: "baby", emoji: "👶", name: "Baby", category: "people" },
|
|
928
|
+
{ id: "dog", emoji: "🐕", name: "Dog", category: "people" },
|
|
929
|
+
{ id: "cat", emoji: "🐈", name: "Cat", category: "people" },
|
|
930
|
+
{ id: "bird", emoji: "🐦", name: "Bird", category: "people" },
|
|
931
|
+
{ id: "horse", emoji: "🐴", name: "Horse", category: "people" },
|
|
932
|
+
{ id: "fish", emoji: "🐟", name: "Fish", category: "people" },
|
|
933
|
+
// Maritime & Navigation
|
|
934
|
+
{ id: "anchor", emoji: "⚓", name: "Anchor", category: "maritime" },
|
|
935
|
+
{ id: "compass", emoji: "🧭", name: "Compass", category: "maritime" },
|
|
936
|
+
{ id: "lighthouse", emoji: "🗼", name: "Lighthouse", category: "maritime" },
|
|
937
|
+
{ id: "sailboat", emoji: "⛵", name: "Sailboat", category: "maritime" },
|
|
938
|
+
// Security
|
|
939
|
+
{ id: "lock", emoji: "🔒", name: "Lock", category: "security" },
|
|
940
|
+
{ id: "key", emoji: "🔑", name: "Key", category: "security" },
|
|
941
|
+
{ id: "shield", emoji: "🛡️", name: "Shield", category: "security" },
|
|
942
|
+
{ id: "eye", emoji: "👁️", name: "Eye", category: "security" },
|
|
943
|
+
{ id: "search", emoji: "🔍", name: "Search", category: "security" },
|
|
944
|
+
{ id: "police", emoji: "🚔", name: "Police", category: "security" },
|
|
945
|
+
{ id: "siren", emoji: "🚨", name: "Siren", category: "security" },
|
|
946
|
+
// Time & Organization
|
|
947
|
+
{ id: "clock", emoji: "🕐", name: "Clock", category: "time" },
|
|
948
|
+
{ id: "calendar", emoji: "📅", name: "Calendar", category: "time" },
|
|
949
|
+
{ id: "bookmark", emoji: "🔖", name: "Bookmark", category: "time" },
|
|
950
|
+
{ id: "tag", emoji: "🏷️", name: "Tag", category: "time" },
|
|
951
|
+
{ id: "pushpin", emoji: "📌", name: "Pin", category: "time" },
|
|
952
|
+
// Shapes & Geometric
|
|
953
|
+
{ id: "red-circle", emoji: "🔴", name: "Red Circle", category: "shapes" },
|
|
954
|
+
{ id: "blue-circle", emoji: "🔵", name: "Blue Circle", category: "shapes" },
|
|
955
|
+
{ id: "green-circle", emoji: "🟢", name: "Green Circle", category: "shapes" },
|
|
956
|
+
{ id: "yellow-circle", emoji: "🟡", name: "Yellow Circle", category: "shapes" },
|
|
957
|
+
{ id: "orange-circle", emoji: "🟠", name: "Orange Circle", category: "shapes" },
|
|
958
|
+
{ id: "purple-circle", emoji: "🟣", name: "Purple Circle", category: "shapes" },
|
|
959
|
+
{ id: "white-circle", emoji: "⚪", name: "White Circle", category: "shapes" },
|
|
960
|
+
{ id: "black-circle", emoji: "⚫", name: "Black Circle", category: "shapes" },
|
|
961
|
+
{ id: "red-square", emoji: "🟥", name: "Red Square", category: "shapes" },
|
|
962
|
+
{ id: "blue-square", emoji: "🟦", name: "Blue Square", category: "shapes" },
|
|
963
|
+
{ id: "diamond", emoji: "💎", name: "Diamond", category: "shapes" },
|
|
964
|
+
// Arrows
|
|
965
|
+
{ id: "arrow-up", emoji: "⬆️", name: "Arrow Up", category: "arrows" },
|
|
966
|
+
{ id: "arrow-down", emoji: "⬇️", name: "Arrow Down", category: "arrows" },
|
|
967
|
+
{ id: "arrow-left", emoji: "⬅️", name: "Arrow Left", category: "arrows" },
|
|
968
|
+
{ id: "arrow-right", emoji: "➡️", name: "Arrow Right", category: "arrows" },
|
|
969
|
+
{ id: "target", emoji: "🎯", name: "Target", category: "arrows" }
|
|
970
|
+
];
|
|
971
|
+
const ICONS = [...ICON_LIST];
|
|
972
|
+
const EMOJI_BY_ID = new Map(ICONS.map((i) => [i.id, i.emoji]));
|
|
973
|
+
const plural = (count, word) => `${word}${count !== 1 ? "s" : ""}`;
|
|
974
|
+
const DEFAULT_LAYER_ID = "default";
|
|
975
|
+
const DEFAULT_LAYER_NAME = "Default Layer";
|
|
976
|
+
const iconNames = Object.fromEntries(ICONS.map((icon) => [icon.id, icon.name]));
|
|
977
|
+
const iconCategories = {
|
|
978
|
+
places: "Places",
|
|
979
|
+
transport: "Transport",
|
|
980
|
+
food: "Food",
|
|
981
|
+
nature: "Nature",
|
|
982
|
+
symbols: "Symbols",
|
|
983
|
+
activities: "Activities",
|
|
984
|
+
work: "Work",
|
|
985
|
+
shopping: "Shopping",
|
|
986
|
+
communication: "Communication",
|
|
987
|
+
people: "People",
|
|
988
|
+
maritime: "Maritime",
|
|
989
|
+
security: "Security",
|
|
990
|
+
time: "Time",
|
|
991
|
+
shapes: "Shapes",
|
|
992
|
+
arrows: "Arrows"
|
|
993
|
+
};
|
|
994
|
+
const DEFAULT_MAP_LABELS = {
|
|
995
|
+
canvas: {
|
|
996
|
+
defaultLayerName: DEFAULT_LAYER_NAME,
|
|
997
|
+
newTextLabel: "New Label",
|
|
998
|
+
clusterOther: "Other",
|
|
999
|
+
mapInitFailedTitle: "Map Initialization Failed",
|
|
1000
|
+
mapInitFailedSubtitle: "Unable to load the interactive map",
|
|
1001
|
+
mapInitFailedFallback: "Failed to initialize map",
|
|
1002
|
+
refreshPage: "Refresh Page",
|
|
1003
|
+
measureDistance: "Distance:",
|
|
1004
|
+
measureArea: "Area:",
|
|
1005
|
+
measureDistanceHint: "Click points to measure",
|
|
1006
|
+
measureAreaHint: "Click 3+ points",
|
|
1007
|
+
measureClearHint: "(double-click to clear)",
|
|
1008
|
+
timelineToggle: "Timeline",
|
|
1009
|
+
layersToggle: "Layers",
|
|
1010
|
+
layersToggleAriaLabel: "Toggle layers panel",
|
|
1011
|
+
unsavedCount: (count) => `${count} unsaved`,
|
|
1012
|
+
createPointFeature: "Create new point feature",
|
|
1013
|
+
noEditableLayer: "No editable layer",
|
|
1014
|
+
tooltipId: "ID:",
|
|
1015
|
+
morePointsHint: "More points overlap here: zoom in to reach them",
|
|
1016
|
+
traceDuration: "Duration:",
|
|
1017
|
+
traceDistance: "Distance:",
|
|
1018
|
+
traceAvgSpeed: "Avg Speed:",
|
|
1019
|
+
traceGroup: (group) => `Group: ${group}`,
|
|
1020
|
+
statusFeatureCount: (count) => `${count} ${plural(count, "feature")}`,
|
|
1021
|
+
statusSelectedCount: (count) => `${count} selected`
|
|
1022
|
+
},
|
|
1023
|
+
toasts: {
|
|
1024
|
+
screenshotFailed: "Screenshot failed",
|
|
1025
|
+
screenshotMapNotReady: "Map is not ready yet.",
|
|
1026
|
+
screenshotNotRendered: "The map did not render in time. Please try again.",
|
|
1027
|
+
noVisibleLayers: "No visible layers",
|
|
1028
|
+
noVisibleLayersDescription: "Show at least one layer to draw features",
|
|
1029
|
+
noLayerSelected: "No layer selected",
|
|
1030
|
+
noLayerSelectedDescription: "Select an editable layer to clear features",
|
|
1031
|
+
cannotClearHpLayer: "Cannot clear high-performance layer",
|
|
1032
|
+
cannotClearHpLayerDescription: "Clear is not supported for HP layers. Delete individual features instead.",
|
|
1033
|
+
layerEmpty: "Layer is empty",
|
|
1034
|
+
layerEmptyDescription: "No features to clear",
|
|
1035
|
+
layerCleared: "Layer cleared",
|
|
1036
|
+
layerClearedDescription: (layerName) => `Removed all features from "${layerName}"`,
|
|
1037
|
+
terrainUnavailable: "3D Terrain Unavailable",
|
|
1038
|
+
terrainUnavailableDescription: "Terrain features are disabled for this configuration.",
|
|
1039
|
+
terrainEnabled: "3D Terrain Enabled",
|
|
1040
|
+
terrainEnabledDescription: "Tilt the map (right-click + drag or Ctrl + drag) to see the 3D effect.",
|
|
1041
|
+
exportFailed: "Export failed",
|
|
1042
|
+
exportFailedDescription: "Could not prepare the download",
|
|
1043
|
+
featuresAdded: "Features added",
|
|
1044
|
+
featuresAddedDescription: ({ count, layerName }) => `Added ${count} features to "${layerName}"`,
|
|
1045
|
+
layerCreated: "Layer created",
|
|
1046
|
+
searchFailed: "Search failed",
|
|
1047
|
+
searchFailedDescription: "Failed to search data source",
|
|
1048
|
+
mapRestored: "Map restored",
|
|
1049
|
+
mapRestoredDescription: ({ layerCount, featureCount }) => `Restored ${layerCount} layers with ${featureCount} features`,
|
|
1050
|
+
featuresLoaded: "Features loaded",
|
|
1051
|
+
featuresLoadedDescription: (count) => `Created layer with ${count} features`,
|
|
1052
|
+
loadFailed: "Load failed",
|
|
1053
|
+
loadFailedDescription: "Failed to load from workspace",
|
|
1054
|
+
saved: "Saved",
|
|
1055
|
+
savedDescription: "Saved entire map to workspace",
|
|
1056
|
+
saveFailed: "Save failed",
|
|
1057
|
+
saveFailedDescription: "Failed to save to workspace",
|
|
1058
|
+
noFeatures: "No features",
|
|
1059
|
+
noFeaturesDescription: "There are no features to fit to",
|
|
1060
|
+
geojsonLoadFailed: "Failed to load GeoJSON",
|
|
1061
|
+
invalidFile: "Invalid file",
|
|
1062
|
+
emptyGeojson: "Empty GeoJSON",
|
|
1063
|
+
/** `reprojectedFrom` is the source CRS when the file was reprojected, otherwise null. */
|
|
1064
|
+
hpLayerCreatedDescription: ({ layerName, count, reprojectedFrom }) => `Created "${layerName}" with ${count} features${reprojectedFrom !== null ? ` (reprojected from ${reprojectedFrom})` : ""} (high-performance mode)`,
|
|
1065
|
+
dataViewingLayer: "Can't load into a data-viewing layer",
|
|
1066
|
+
dataViewingLayerDescription: "Its features are fetched from data and aren't saved with the map. Load the file into another layer.",
|
|
1067
|
+
hostOwnedLayer: "Can't load into this layer",
|
|
1068
|
+
hostOwnedLayerDescription: "Another view owns its features. Load the file into another layer.",
|
|
1069
|
+
noLayerToLoadInto: "No layer to load into",
|
|
1070
|
+
noLayerToLoadIntoDescription: "Create a layer first, then load the file again.",
|
|
1071
|
+
geojsonLoaded: "GeoJSON loaded",
|
|
1072
|
+
geojsonLoadedDescription: ({ count, reprojectedFrom, layerHidden }) => `Added ${count} features${reprojectedFrom !== null ? ` (reprojected from ${reprojectedFrom})` : ""}${layerHidden ? " (layer hidden)" : ""}`,
|
|
1073
|
+
layerAdded: "Layer added",
|
|
1074
|
+
layerAddedDescription: ({ layerName, count, reprojectedFrom }) => `Created "${layerName}" with ${count} features${reprojectedFrom !== null ? ` (reprojected from ${reprojectedFrom})` : ""} (high-performance)`
|
|
1075
|
+
},
|
|
1076
|
+
featureCap: DEFAULT_FEATURE_CAP_LABELS,
|
|
1077
|
+
ingest: {
|
|
1078
|
+
importing: (name) => `Importing ${name}…`,
|
|
1079
|
+
rendering: (name) => `Rendering ${name}…`,
|
|
1080
|
+
preparingDownload: (name) => `Preparing download ${name}…`,
|
|
1081
|
+
progress: ({ received, total }) => `${received.toLocaleString()} / ${total.toLocaleString()} features`,
|
|
1082
|
+
invalidFormat: "Invalid GeoJSON format",
|
|
1083
|
+
noFeatures: "The file contains no features",
|
|
1084
|
+
workerUnresponsive: "Ingest worker unresponsive — the file could not be parsed",
|
|
1085
|
+
workerCrashed: "Ingest worker crashed"
|
|
1086
|
+
},
|
|
1087
|
+
dropZone: {
|
|
1088
|
+
title: "Drop GeoJSON here",
|
|
1089
|
+
subtitle: "Add as new layer"
|
|
1090
|
+
},
|
|
1091
|
+
mapOptions: {
|
|
1092
|
+
title: "Map Options",
|
|
1093
|
+
load: "Load",
|
|
1094
|
+
uploadMap: "Upload Map",
|
|
1095
|
+
loadFromWorkspace: "Load Map from workspace",
|
|
1096
|
+
save: "Save",
|
|
1097
|
+
downloadMap: "Download Map",
|
|
1098
|
+
saveToWorkspace: "Save Map to workspace",
|
|
1099
|
+
autoShowLabels: "Auto-show labels",
|
|
1100
|
+
autoLabelThreshold: "When features on screen",
|
|
1101
|
+
visibleFeatures: "Visible:",
|
|
1102
|
+
labelsShown: "(shown)",
|
|
1103
|
+
labelsHidden: "(hidden)",
|
|
1104
|
+
fitToAllFeatures: "Fit Map to All Features",
|
|
1105
|
+
terrain3d: "3D",
|
|
1106
|
+
basemapStreets: "Streets",
|
|
1107
|
+
basemapSatellite: "Satellite",
|
|
1108
|
+
basemapDark: "Dark"
|
|
1109
|
+
},
|
|
1110
|
+
layersPanel: {
|
|
1111
|
+
title: "Layers",
|
|
1112
|
+
createLayer: "Create new layer",
|
|
1113
|
+
loadAsNewLayer: "Load GeoJSON from desktop as new layer",
|
|
1114
|
+
searchAndAdd: "Search and add...",
|
|
1115
|
+
groupLayerCount: (count) => `${count} layers`,
|
|
1116
|
+
unsavedCount: (count) => `${count} unsaved`,
|
|
1117
|
+
hpLayerTitle: "High-Performance Layer",
|
|
1118
|
+
hpLayerDescription: "Optimized for large datasets. Geometry cannot be moved or reshaped.",
|
|
1119
|
+
editingThisLayer: "This is the layer being edited",
|
|
1120
|
+
clickToEditLayer: "Click to edit this layer",
|
|
1121
|
+
loadGeojson: "Load GeoJSON from desktop",
|
|
1122
|
+
saveGeojson: "Save GeoJSON to desktop",
|
|
1123
|
+
neverHideLabels: "Never hide labels",
|
|
1124
|
+
labelsOffForLayer: "Labels are turned off for this layer",
|
|
1125
|
+
neverHideLabelsHint: "Show every label even when the map is crowded",
|
|
1126
|
+
fitMapToLayer: "Fit Map to Layer",
|
|
1127
|
+
deleteLayer: "Delete Layer",
|
|
1128
|
+
deleteLayerConfirmTitle: (layerName) => `Delete layer "${layerName}"?`,
|
|
1129
|
+
deleteLayerConfirmContent: "This will delete the layer and all its features.",
|
|
1130
|
+
deleteLayerConfirmOk: "Delete",
|
|
1131
|
+
deleteLayerConfirmCancel: "Cancel",
|
|
1132
|
+
moveSelectedHere: (count) => `Move ${count} selected here`
|
|
1133
|
+
},
|
|
1134
|
+
layerSettings: {
|
|
1135
|
+
pointFeatures: "Point Features",
|
|
1136
|
+
traceLines: "Trace Lines",
|
|
1137
|
+
connectAllPoints: "Connect all points",
|
|
1138
|
+
groupBy: (field) => `Group by ${field}`,
|
|
1139
|
+
heatmap: "Heatmap",
|
|
1140
|
+
intensity: "Intensity",
|
|
1141
|
+
radius: "Radius",
|
|
1142
|
+
clustering: "Clustering",
|
|
1143
|
+
simpleCount: "Simple count",
|
|
1144
|
+
pieBy: (field) => `Pie by ${field}`,
|
|
1145
|
+
showPointDots: "Show point dots",
|
|
1146
|
+
countByField: "Count by field",
|
|
1147
|
+
selectNumericField: "Select numeric field...",
|
|
1148
|
+
colorBubblesByValue: "Color bubbles by value",
|
|
1149
|
+
altitudeDisplay: "Altitude Display",
|
|
1150
|
+
altitude3d: "3D (show altitude)",
|
|
1151
|
+
altitudeFlat: "Flat (ignore altitude)",
|
|
1152
|
+
altitudeBoth: "Both (3D + flat shadow)",
|
|
1153
|
+
visualSettings: "Visual Settings",
|
|
1154
|
+
labels: "Labels",
|
|
1155
|
+
labelFromName: "Use name property",
|
|
1156
|
+
labelFromField: "Use field...",
|
|
1157
|
+
labelFixedText: "Fixed text...",
|
|
1158
|
+
selectField: "Select field...",
|
|
1159
|
+
enterLabelText: "Enter label text...",
|
|
1160
|
+
size: "Size",
|
|
1161
|
+
defaultSize: "Default size",
|
|
1162
|
+
sizeByField: "Size by field...",
|
|
1163
|
+
overrideSize: "Override size...",
|
|
1164
|
+
color: "Color",
|
|
1165
|
+
useFeatureColor: "Use feature color",
|
|
1166
|
+
colorByField: "Color by field...",
|
|
1167
|
+
fixedColor: "Fixed color...",
|
|
1168
|
+
categories: "Categories",
|
|
1169
|
+
gradient: "Gradient",
|
|
1170
|
+
pointIcon: "Point Icon",
|
|
1171
|
+
legend: "Legend",
|
|
1172
|
+
legendTop: (count) => `Legend (top ${count})`,
|
|
1173
|
+
legendSampled: "Legend (sampled)",
|
|
1174
|
+
filterValues: "Filter values…",
|
|
1175
|
+
noMatches: "No matches",
|
|
1176
|
+
showLess: "Show less",
|
|
1177
|
+
showAll: (count) => `Show all (${count})`
|
|
1178
|
+
},
|
|
1179
|
+
drawingToolbar: {
|
|
1180
|
+
drawingTools: "Drawing tools",
|
|
1181
|
+
clickSelect: "Click Select",
|
|
1182
|
+
rectangleSelect: "Rectangle Select",
|
|
1183
|
+
polygonSelect: "Polygon Select",
|
|
1184
|
+
circleSelect: "Circle Select",
|
|
1185
|
+
selectTool: "Select Tool",
|
|
1186
|
+
switchSelectionMode: "Switch selection mode",
|
|
1187
|
+
filterArea: "Filter Area",
|
|
1188
|
+
clearFilter: "Clear Filter",
|
|
1189
|
+
measureDistance: "Measure Distance",
|
|
1190
|
+
measureArea: "Measure Area",
|
|
1191
|
+
switchMeasureMode: "Switch measure mode",
|
|
1192
|
+
searchAndNavigate: "Search & Navigate",
|
|
1193
|
+
fitToData: "Fit to Data",
|
|
1194
|
+
noEditableLayer: "No editable layer",
|
|
1195
|
+
noEditableLayerHint: "Select an editable layer with the pencil icon to enable editing",
|
|
1196
|
+
editMode: "Edit Mode",
|
|
1197
|
+
searchAndAdd: "Search and Add",
|
|
1198
|
+
dropPoint: "Drop Point",
|
|
1199
|
+
drawLine: "Draw Line",
|
|
1200
|
+
drawPolygon: "Draw Polygon",
|
|
1201
|
+
drawRectangle: "Draw Rectangle",
|
|
1202
|
+
drawPolygonOrRectangle: "Draw Polygon/Rectangle",
|
|
1203
|
+
drawPolygonOrRectangleAriaLabel: "Draw Polygon or Rectangle",
|
|
1204
|
+
addText: "Add Text",
|
|
1205
|
+
drawArrow: "Draw Arrow",
|
|
1206
|
+
drawCircle: "Draw Circle",
|
|
1207
|
+
undo: "Undo",
|
|
1208
|
+
redo: "Redo",
|
|
1209
|
+
deleteSelected: (count) => `Delete selected (${count})`,
|
|
1210
|
+
deleteSelectedAriaLabel: "Delete selected features",
|
|
1211
|
+
clearAll: (count) => `Clear all (${count})`,
|
|
1212
|
+
moreTools: "More tools",
|
|
1213
|
+
clearAllConfirmTitle: "Clear all features?",
|
|
1214
|
+
clearAllConfirmContent: (count) => `This will remove all ${count} ${plural(count, "feature")} from the map. This action cannot be undone.`,
|
|
1215
|
+
clearAllConfirmOk: "Clear all",
|
|
1216
|
+
clearAllConfirmCancel: "Cancel"
|
|
1217
|
+
},
|
|
1218
|
+
navigate: {
|
|
1219
|
+
title: "Navigate To",
|
|
1220
|
+
addressPlaceholder: "Search address...",
|
|
1221
|
+
searchAddress: "Go",
|
|
1222
|
+
orCoordinates: "or coordinates",
|
|
1223
|
+
latitude: "Lat",
|
|
1224
|
+
longitude: "Lng",
|
|
1225
|
+
latitudePlaceholder: "-90 to 90",
|
|
1226
|
+
longitudePlaceholder: "-180 to 180",
|
|
1227
|
+
dropPoint: "Drop",
|
|
1228
|
+
goToCoordinates: "Go",
|
|
1229
|
+
locationNotFound: "Location not found",
|
|
1230
|
+
locationNotFoundDescription: "Try a different search term",
|
|
1231
|
+
searchError: "Search error",
|
|
1232
|
+
searchErrorDescription: "Could not search for location. Check your connection."
|
|
1233
|
+
},
|
|
1234
|
+
coordinates: {
|
|
1235
|
+
invalidCoordinates: "Invalid coordinates",
|
|
1236
|
+
invalidCoordinatesDescription: "Please enter valid latitude and longitude values",
|
|
1237
|
+
invalidLatitude: "Invalid latitude",
|
|
1238
|
+
invalidLongitude: "Invalid longitude",
|
|
1239
|
+
latitudeOutOfRange: "Latitude must be between -90 and 90",
|
|
1240
|
+
longitudeOutOfRange: "Longitude must be between -180 and 180",
|
|
1241
|
+
notANumber: "Please enter a valid number"
|
|
1242
|
+
},
|
|
1243
|
+
featureSearch: {
|
|
1244
|
+
title: "Search Features",
|
|
1245
|
+
placeholder: "Search features...",
|
|
1246
|
+
titlesMode: "Titles",
|
|
1247
|
+
fullJsonMode: "Full JSON",
|
|
1248
|
+
/** `more` is true when the result list stopped at its cap. */
|
|
1249
|
+
resultCount: ({ count, more }) => `${count}${more ? "+" : ""} found`,
|
|
1250
|
+
totalCount: (count) => `${count} total`,
|
|
1251
|
+
noResults: "No features found",
|
|
1252
|
+
typeToSearch: (count) => `Type to search across ${count} features`,
|
|
1253
|
+
untitledFeature: "Feature",
|
|
1254
|
+
unknownGeometry: "Unknown"
|
|
1255
|
+
},
|
|
1256
|
+
propertiesPanel: {
|
|
1257
|
+
showingFirstSelected: ({ shown, total }) => `Showing the first ${shown} of ${total.toLocaleString()} selected features`,
|
|
1258
|
+
previousOverlappingPoint: "Previous overlapping point",
|
|
1259
|
+
nextOverlappingPoint: "Next overlapping point",
|
|
1260
|
+
selectedFeatures: (count) => `${count} selected ${count === 1 ? "feature" : "features"}`,
|
|
1261
|
+
untitledFeature: "Feature",
|
|
1262
|
+
hpLayerHint: "High Performance Layer — does not allow moving / geometrical editing of features",
|
|
1263
|
+
hpBadge: "HP",
|
|
1264
|
+
viewBadge: "View",
|
|
1265
|
+
openInNewTab: "Open in new tab",
|
|
1266
|
+
actions: "Actions",
|
|
1267
|
+
copyToLayer: "Copy to layer",
|
|
1268
|
+
moveToLayer: "Move to layer",
|
|
1269
|
+
untitledLayer: "Untitled",
|
|
1270
|
+
newLayer: "New layer…",
|
|
1271
|
+
newLayerPrompt: "New layer name",
|
|
1272
|
+
changeIcon: "Change icon",
|
|
1273
|
+
setIcon: "Set icon",
|
|
1274
|
+
deleteFeatures: (count) => `Delete ${count} feature${count > 1 ? "s" : ""}`,
|
|
1275
|
+
deleteFeature: "Delete feature",
|
|
1276
|
+
entityCards: "Entity Cards",
|
|
1277
|
+
entityCardsCount: (count) => `Entity Cards (${count})`,
|
|
1278
|
+
properties: "Properties",
|
|
1279
|
+
noEntityCardProvider: "No entity card provider registered",
|
|
1280
|
+
selectSingleToSeeProperties: "Select a single feature to see/set properties",
|
|
1281
|
+
selectSingleToEdit: "Select a single feature to edit properties.",
|
|
1282
|
+
pointDetail: "Point Detail",
|
|
1283
|
+
layer: "Layer:",
|
|
1284
|
+
octostarRecord: "Octostar record",
|
|
1285
|
+
localMapFeature: "Local map feature",
|
|
1286
|
+
unsaved: "Unsaved",
|
|
1287
|
+
createEntity: "Create entity",
|
|
1288
|
+
untitledRecord: "Untitled",
|
|
1289
|
+
refreshFromRecord: "Refresh from record",
|
|
1290
|
+
recordFields: "Record Fields",
|
|
1291
|
+
id: "ID:",
|
|
1292
|
+
featureSaved: "Feature saved",
|
|
1293
|
+
savedTo: (workspace) => `Saved to ${workspace}`,
|
|
1294
|
+
saveFailed: "Save failed",
|
|
1295
|
+
saveFeatureFailed: "Failed to save feature",
|
|
1296
|
+
refreshed: "Refreshed",
|
|
1297
|
+
refreshedDescription: "Properties updated from record",
|
|
1298
|
+
refreshFailed: "Refresh failed"
|
|
1299
|
+
},
|
|
1300
|
+
featureFields: {
|
|
1301
|
+
label: "Label",
|
|
1302
|
+
name: "Name",
|
|
1303
|
+
enterLabel: "Enter label...",
|
|
1304
|
+
featureName: "Feature name",
|
|
1305
|
+
noName: "No name",
|
|
1306
|
+
icon: "Icon",
|
|
1307
|
+
type: "Type",
|
|
1308
|
+
noType: "No type",
|
|
1309
|
+
latLng: "Lat / Lng",
|
|
1310
|
+
centroidHint: "Lat and Lng refer to the centroid of this feature",
|
|
1311
|
+
latitude: "Latitude",
|
|
1312
|
+
longitude: "Longitude",
|
|
1313
|
+
temporal: "Temporal",
|
|
1314
|
+
dateCount: (count) => `${count} ${plural(count, "date")}`,
|
|
1315
|
+
start: "Start",
|
|
1316
|
+
end: "End",
|
|
1317
|
+
style: "Style",
|
|
1318
|
+
fontSize: "Font Size",
|
|
1319
|
+
fontColor: "Font Color",
|
|
1320
|
+
fontWeight: "Font Weight",
|
|
1321
|
+
fontWeightNormal: "Normal",
|
|
1322
|
+
fontWeightBold: "Bold",
|
|
1323
|
+
arrowSize: "Arrow Size",
|
|
1324
|
+
stroke: "Stroke",
|
|
1325
|
+
strokeColor: "Stroke Color",
|
|
1326
|
+
strokeWidth: "Stroke Width",
|
|
1327
|
+
strokeOpacity: "Stroke Opacity",
|
|
1328
|
+
fill: "Fill",
|
|
1329
|
+
fillColor: "Fill Color",
|
|
1330
|
+
fillOpacity: "Fill Opacity",
|
|
1331
|
+
resetFillToStroke: "Reset fill to the stroke colour",
|
|
1332
|
+
iconSize: "Size",
|
|
1333
|
+
propertyKey: "Key",
|
|
1334
|
+
propertyValue: "Value",
|
|
1335
|
+
newProperty: "New property…"
|
|
1336
|
+
},
|
|
1337
|
+
iconPicker: {
|
|
1338
|
+
title: "Select Icon",
|
|
1339
|
+
searchPlaceholder: "Search icons...",
|
|
1340
|
+
allCategories: (count) => `All (${count})`,
|
|
1341
|
+
categoryWithCount: ({ category, count }) => `${category} (${count})`,
|
|
1342
|
+
noIconsFound: (query) => `No icons found for "${query}"`,
|
|
1343
|
+
noIconSelected: "No icon selected",
|
|
1344
|
+
clearIcon: "Clear",
|
|
1345
|
+
cancel: "Cancel",
|
|
1346
|
+
emptyTrigger: "icon"
|
|
1347
|
+
},
|
|
1348
|
+
iconCategories,
|
|
1349
|
+
iconNames,
|
|
1350
|
+
timebar: {
|
|
1351
|
+
play: "Play",
|
|
1352
|
+
pause: "Pause",
|
|
1353
|
+
reset: "Reset timeline",
|
|
1354
|
+
cumulative: "Cumulative: keep what has appeared",
|
|
1355
|
+
toggle: "Toggle timeline",
|
|
1356
|
+
featureCount: (count) => `${count} ${plural(count, "feature")}`,
|
|
1357
|
+
selectedCount: ({ selected, total }) => `${selected} of ${total} selected`,
|
|
1358
|
+
binEvents: (count) => `${count} ${plural(count, "event")}`,
|
|
1359
|
+
binEventsWithSelection: ({ count, selected }) => `${count} ${plural(count, "event")} (${selected} selected)`
|
|
1360
|
+
},
|
|
1361
|
+
actionPanel: {
|
|
1362
|
+
groupLabel: "File actions",
|
|
1363
|
+
saveTooltip: "Download features as GeoJSON",
|
|
1364
|
+
saveAriaLabel: "Save as GeoJSON",
|
|
1365
|
+
save: "Save GeoJSON",
|
|
1366
|
+
loadTooltip: "Import features from GeoJSON file",
|
|
1367
|
+
loadAriaLabel: "Load GeoJSON file",
|
|
1368
|
+
load: "Load GeoJSON"
|
|
1369
|
+
}
|
|
1370
|
+
};
|
|
1371
|
+
const MapLabelsContext = createContext(DEFAULT_MAP_LABELS);
|
|
1372
|
+
function shownLayerName(layer, labels) {
|
|
1373
|
+
return layer.name === DEFAULT_LAYER_NAME ? labels.defaultLayerName : layer.name;
|
|
1374
|
+
}
|
|
1375
|
+
function useMapLabels() {
|
|
1376
|
+
return useContext(MapLabelsContext);
|
|
1377
|
+
}
|
|
800
1378
|
const SELECTED_STATE_KEY = "selected";
|
|
801
1379
|
const SELECTED = ["boolean", ["feature-state", SELECTED_STATE_KEY], false];
|
|
802
1380
|
const SELECTED_STATE = Object.freeze({ [SELECTED_STATE_KEY]: true });
|
|
@@ -823,7 +1401,7 @@ const hostIconLabelOffsetAt = (z) => [
|
|
|
823
1401
|
function computeLabelNeverHide(label) {
|
|
824
1402
|
return (label == null ? void 0 : label.neverHide) && !label.hidden ? 1 : 0;
|
|
825
1403
|
}
|
|
826
|
-
function buildCustomLabelLayout() {
|
|
1404
|
+
function buildCustomLabelLayout(newTextLabel = DEFAULT_MAP_LABELS.canvas.newTextLabel) {
|
|
827
1405
|
return {
|
|
828
1406
|
// Hide labels for trace points (a group's endpoint label is the trace
|
|
829
1407
|
// source's, trace-timeline.ts), arrows handled by the custom-arrow-labels layer.Features blanked by
|
|
@@ -841,7 +1419,7 @@ function buildCustomLabelLayout() {
|
|
|
841
1419
|
["==", ["get", "isTracePoint"], true],
|
|
842
1420
|
"",
|
|
843
1421
|
["==", ["get", "kind"], "text"],
|
|
844
|
-
["coalesce", ["get", "label"], ["get", "text"],
|
|
1422
|
+
["coalesce", ["get", "label"], ["get", "text"], newTextLabel],
|
|
845
1423
|
["coalesce", ["get", "name"], ""]
|
|
846
1424
|
],
|
|
847
1425
|
// Text features use their fontSize property; others 12px
|
|
@@ -1109,13 +1687,14 @@ function geometryClassesOf(features) {
|
|
|
1109
1687
|
const ROLES_BY_CLASS = {
|
|
1110
1688
|
polygon: ["polygon-fill", "polygon-stroke"],
|
|
1111
1689
|
line: ["line"],
|
|
1112
|
-
point: ["point-shadow", "point"
|
|
1690
|
+
point: ["point-shadow", "point"]
|
|
1113
1691
|
};
|
|
1114
|
-
function rolesForGeometry(classes) {
|
|
1692
|
+
function rolesForGeometry(classes, { icons = true } = {}) {
|
|
1115
1693
|
const needed = /* @__PURE__ */ new Set(["labels", "labels-pinned"]);
|
|
1116
1694
|
Object.keys(ROLES_BY_CLASS).forEach((cls) => {
|
|
1117
1695
|
if (classes.has(cls)) ROLES_BY_CLASS[cls].forEach((role) => needed.add(role));
|
|
1118
1696
|
});
|
|
1697
|
+
if (icons && classes.has("point")) needed.add("point-icon");
|
|
1119
1698
|
return CUSTOM_LAYER_ROLES.filter((role) => needed.has(role));
|
|
1120
1699
|
}
|
|
1121
1700
|
function shardInsertAnchor(role) {
|
|
@@ -1320,7 +1899,7 @@ function buildLayer(role, sourceId, opts) {
|
|
|
1320
1899
|
source: sourceId,
|
|
1321
1900
|
filter: shared ? ["all", UNPINNED_LABEL_FILTER, NOT_HOST_FILTER] : UNPINNED_LABEL_FILTER,
|
|
1322
1901
|
layout: {
|
|
1323
|
-
...buildCustomLabelLayout(),
|
|
1902
|
+
...buildCustomLabelLayout(opts.newTextLabel),
|
|
1324
1903
|
"visibility": opts.labelsVisible ? "visible" : "none",
|
|
1325
1904
|
// Native collision-based de-overlap.
|
|
1326
1905
|
//
|
|
@@ -1372,7 +1951,7 @@ function buildLayer(role, sourceId, opts) {
|
|
|
1372
1951
|
source: sourceId,
|
|
1373
1952
|
filter: shared ? ["all", PINNED_LABEL_FILTER, NOT_HOST_FILTER] : PINNED_LABEL_FILTER,
|
|
1374
1953
|
layout: {
|
|
1375
|
-
...buildCustomLabelLayout(),
|
|
1954
|
+
...buildCustomLabelLayout(opts.newTextLabel),
|
|
1376
1955
|
"visibility": "visible",
|
|
1377
1956
|
"text-allow-overlap": true,
|
|
1378
1957
|
"text-ignore-placement": true,
|
|
@@ -1471,7 +2050,7 @@ function shardFingerprintsEqual(a, b) {
|
|
|
1471
2050
|
if (!a || !b) return false;
|
|
1472
2051
|
return Object.is(a.features, b.features) && Object.is(a.visualConfig, b.visualConfig) && Object.is(a.heatmapConfig, b.heatmapConfig) && Object.is(a.clusterConfig, b.clusterConfig) && Object.is(a.altitudeDisplayMode, b.altitudeDisplayMode) && Object.is(a.hasAltitudeData, b.hasAltitudeData) && Object.is(a.shardSize, b.shardSize);
|
|
1473
2052
|
}
|
|
1474
|
-
const INTERACTIVE_ROLES = ["point", "line", "polygon-fill"];
|
|
2053
|
+
const INTERACTIVE_ROLES = ["point", "point-icon", "line", "polygon-fill"];
|
|
1475
2054
|
const HOST_INTERACTIVE_ROLES = [...INTERACTIVE_ROLES, "host-icon"];
|
|
1476
2055
|
function createShardRegistry(host, hooks) {
|
|
1477
2056
|
const states = /* @__PURE__ */ new Map();
|
|
@@ -1503,9 +2082,13 @@ function createShardRegistry(host, hooks) {
|
|
|
1503
2082
|
}
|
|
1504
2083
|
};
|
|
1505
2084
|
const createStack = (state, index, roles, data) => {
|
|
2085
|
+
var _a;
|
|
1506
2086
|
const sourceId = shardSourceId(state.layerId, index);
|
|
1507
2087
|
host.addSource(sourceId, customSourceSpec());
|
|
1508
|
-
const specs = buildCustomLayerStack(sourceId, roles, {
|
|
2088
|
+
const specs = buildCustomLayerStack(sourceId, roles, {
|
|
2089
|
+
labelsVisible: hooks.labelsVisible(),
|
|
2090
|
+
newTextLabel: (_a = hooks.newTextLabel) == null ? void 0 : _a.call(hooks)
|
|
2091
|
+
});
|
|
1509
2092
|
const ordered = CUSTOM_LAYER_ROLES.filter((role) => roles.includes(role));
|
|
1510
2093
|
const layerIds = [];
|
|
1511
2094
|
specs.forEach((spec, i) => {
|
|
@@ -1817,154 +2400,6 @@ function resolveMissingImage(id, provider) {
|
|
|
1817
2400
|
if (image == null ? void 0 : image.data) return { kind: "host", image };
|
|
1818
2401
|
return id.startsWith(HOST_IMAGE_PREFIX) ? { kind: "none" } : { kind: "emoji" };
|
|
1819
2402
|
}
|
|
1820
|
-
const ICONS = [
|
|
1821
|
-
// Location & Places
|
|
1822
|
-
{ id: "map-pin", emoji: "📍", name: "Map Pin", category: "places" },
|
|
1823
|
-
{ id: "home", emoji: "🏠", name: "Home", category: "places" },
|
|
1824
|
-
{ id: "building", emoji: "🏢", name: "Building", category: "places" },
|
|
1825
|
-
{ id: "store", emoji: "🏪", name: "Store", category: "places" },
|
|
1826
|
-
{ id: "factory", emoji: "🏭", name: "Factory", category: "places" },
|
|
1827
|
-
{ id: "construction", emoji: "🏗️", name: "Construction", category: "places" },
|
|
1828
|
-
{ id: "church", emoji: "⛪", name: "Church", category: "places" },
|
|
1829
|
-
{ id: "hospital", emoji: "🏥", name: "Hospital", category: "places" },
|
|
1830
|
-
{ id: "school", emoji: "🏫", name: "School", category: "places" },
|
|
1831
|
-
{ id: "graduation", emoji: "🎓", name: "University", category: "places" },
|
|
1832
|
-
{ id: "library", emoji: "📚", name: "Library", category: "places" },
|
|
1833
|
-
{ id: "landmark", emoji: "🏛️", name: "Landmark", category: "places" },
|
|
1834
|
-
{ id: "castle", emoji: "🏰", name: "Castle", category: "places" },
|
|
1835
|
-
{ id: "mosque", emoji: "🕌", name: "Mosque", category: "places" },
|
|
1836
|
-
{ id: "stadium", emoji: "🏟️", name: "Stadium", category: "places" },
|
|
1837
|
-
{ id: "tent", emoji: "⛺", name: "Camping", category: "places" },
|
|
1838
|
-
// Transport
|
|
1839
|
-
{ id: "car", emoji: "🚗", name: "Car", category: "transport" },
|
|
1840
|
-
{ id: "bus", emoji: "🚌", name: "Bus", category: "transport" },
|
|
1841
|
-
{ id: "train", emoji: "🚂", name: "Train", category: "transport" },
|
|
1842
|
-
{ id: "plane", emoji: "✈️", name: "Plane", category: "transport" },
|
|
1843
|
-
{ id: "ship", emoji: "🚢", name: "Ship", category: "transport" },
|
|
1844
|
-
{ id: "bike", emoji: "🚲", name: "Bike", category: "transport" },
|
|
1845
|
-
{ id: "fuel", emoji: "⛽", name: "Gas Station", category: "transport" },
|
|
1846
|
-
{ id: "helicopter", emoji: "🚁", name: "Helicopter", category: "transport" },
|
|
1847
|
-
{ id: "rocket", emoji: "🚀", name: "Rocket", category: "transport" },
|
|
1848
|
-
{ id: "motorcycle", emoji: "🏍️", name: "Motorcycle", category: "transport" },
|
|
1849
|
-
{ id: "taxi", emoji: "🚕", name: "Taxi", category: "transport" },
|
|
1850
|
-
{ id: "truck", emoji: "🚛", name: "Truck", category: "transport" },
|
|
1851
|
-
// Food & Drink
|
|
1852
|
-
{ id: "utensils", emoji: "🍴", name: "Restaurant", category: "food" },
|
|
1853
|
-
{ id: "coffee", emoji: "☕", name: "Coffee", category: "food" },
|
|
1854
|
-
{ id: "beer", emoji: "🍺", name: "Bar", category: "food" },
|
|
1855
|
-
{ id: "wine", emoji: "🍷", name: "Wine", category: "food" },
|
|
1856
|
-
{ id: "pizza", emoji: "🍕", name: "Pizza", category: "food" },
|
|
1857
|
-
{ id: "ice-cream", emoji: "🍦", name: "Ice Cream", category: "food" },
|
|
1858
|
-
{ id: "apple", emoji: "🍎", name: "Apple", category: "food" },
|
|
1859
|
-
{ id: "cake", emoji: "🎂", name: "Cake", category: "food" },
|
|
1860
|
-
{ id: "hamburger", emoji: "🍔", name: "Burger", category: "food" },
|
|
1861
|
-
// Nature
|
|
1862
|
-
{ id: "trees", emoji: "🌲", name: "Forest", category: "nature" },
|
|
1863
|
-
{ id: "mountain", emoji: "⛰️", name: "Mountain", category: "nature" },
|
|
1864
|
-
{ id: "waves", emoji: "🌊", name: "Water", category: "nature" },
|
|
1865
|
-
{ id: "sun", emoji: "☀️", name: "Sun", category: "nature" },
|
|
1866
|
-
{ id: "cloud", emoji: "☁️", name: "Cloud", category: "nature" },
|
|
1867
|
-
{ id: "umbrella", emoji: "🌂", name: "Umbrella", category: "nature" },
|
|
1868
|
-
{ id: "flower", emoji: "🌸", name: "Flower", category: "nature" },
|
|
1869
|
-
{ id: "leaf", emoji: "🍃", name: "Leaf", category: "nature" },
|
|
1870
|
-
{ id: "rainbow", emoji: "🌈", name: "Rainbow", category: "nature" },
|
|
1871
|
-
{ id: "snowflake", emoji: "❄️", name: "Snow", category: "nature" },
|
|
1872
|
-
{ id: "fire", emoji: "🔥", name: "Fire", category: "nature" },
|
|
1873
|
-
{ id: "volcano", emoji: "🌋", name: "Volcano", category: "nature" },
|
|
1874
|
-
// Symbols & Markers
|
|
1875
|
-
{ id: "heart", emoji: "❤️", name: "Heart", category: "symbols" },
|
|
1876
|
-
{ id: "star", emoji: "⭐", name: "Star", category: "symbols" },
|
|
1877
|
-
{ id: "flag", emoji: "🚩", name: "Flag", category: "symbols" },
|
|
1878
|
-
{ id: "alert", emoji: "⚠️", name: "Warning", category: "symbols" },
|
|
1879
|
-
{ id: "info", emoji: "ℹ️", name: "Info", category: "symbols" },
|
|
1880
|
-
{ id: "check", emoji: "✅", name: "Check", category: "symbols" },
|
|
1881
|
-
{ id: "x-mark", emoji: "❌", name: "X", category: "symbols" },
|
|
1882
|
-
{ id: "zap", emoji: "⚡", name: "Zap", category: "symbols" },
|
|
1883
|
-
{ id: "bell", emoji: "🔔", name: "Bell", category: "symbols" },
|
|
1884
|
-
{ id: "peace", emoji: "☮️", name: "Peace", category: "symbols" },
|
|
1885
|
-
{ id: "recycle", emoji: "♻️", name: "Recycle", category: "symbols" },
|
|
1886
|
-
{ id: "radioactive", emoji: "☢️", name: "Radioactive", category: "symbols" },
|
|
1887
|
-
{ id: "biohazard", emoji: "☣️", name: "Biohazard", category: "symbols" },
|
|
1888
|
-
// Activities
|
|
1889
|
-
{ id: "camera", emoji: "📷", name: "Camera", category: "activities" },
|
|
1890
|
-
{ id: "music", emoji: "🎵", name: "Music", category: "activities" },
|
|
1891
|
-
{ id: "film", emoji: "🎬", name: "Cinema", category: "activities" },
|
|
1892
|
-
{ id: "gamepad", emoji: "🎮", name: "Gaming", category: "activities" },
|
|
1893
|
-
{ id: "trophy", emoji: "🏆", name: "Trophy", category: "activities" },
|
|
1894
|
-
{ id: "medal", emoji: "🎖️", name: "Medal", category: "activities" },
|
|
1895
|
-
{ id: "sports", emoji: "⚽", name: "Sports", category: "activities" },
|
|
1896
|
-
{ id: "basketball", emoji: "🏀", name: "Basketball", category: "activities" },
|
|
1897
|
-
{ id: "fishing", emoji: "🎣", name: "Fishing", category: "activities" },
|
|
1898
|
-
{ id: "art", emoji: "🎨", name: "Art", category: "activities" },
|
|
1899
|
-
// Work & Tools
|
|
1900
|
-
{ id: "briefcase", emoji: "💼", name: "Office", category: "work" },
|
|
1901
|
-
{ id: "wrench", emoji: "🔧", name: "Repair", category: "work" },
|
|
1902
|
-
{ id: "hammer", emoji: "🔨", name: "Construction", category: "work" },
|
|
1903
|
-
{ id: "gear", emoji: "⚙️", name: "Settings", category: "work" },
|
|
1904
|
-
{ id: "microscope", emoji: "🔬", name: "Science", category: "work" },
|
|
1905
|
-
{ id: "test-tube", emoji: "🧪", name: "Lab", category: "work" },
|
|
1906
|
-
{ id: "computer", emoji: "💻", name: "Computer", category: "work" },
|
|
1907
|
-
// Shopping
|
|
1908
|
-
{ id: "cart", emoji: "🛒", name: "Shopping", category: "shopping" },
|
|
1909
|
-
{ id: "gift", emoji: "🎁", name: "Gift", category: "shopping" },
|
|
1910
|
-
{ id: "package", emoji: "📦", name: "Package", category: "shopping" },
|
|
1911
|
-
{ id: "money", emoji: "💰", name: "Money", category: "shopping" },
|
|
1912
|
-
{ id: "credit-card", emoji: "💳", name: "Payment", category: "shopping" },
|
|
1913
|
-
// Communication
|
|
1914
|
-
{ id: "phone", emoji: "📱", name: "Phone", category: "communication" },
|
|
1915
|
-
{ id: "mail", emoji: "📧", name: "Mail", category: "communication" },
|
|
1916
|
-
{ id: "globe", emoji: "🌐", name: "Web", category: "communication" },
|
|
1917
|
-
{ id: "satellite", emoji: "📡", name: "Satellite", category: "communication" },
|
|
1918
|
-
{ id: "radio", emoji: "📻", name: "Radio", category: "communication" },
|
|
1919
|
-
{ id: "tv", emoji: "📺", name: "TV", category: "communication" },
|
|
1920
|
-
// People & Animals
|
|
1921
|
-
{ id: "user", emoji: "👤", name: "Person", category: "people" },
|
|
1922
|
-
{ id: "users", emoji: "👥", name: "Group", category: "people" },
|
|
1923
|
-
{ id: "baby", emoji: "👶", name: "Baby", category: "people" },
|
|
1924
|
-
{ id: "dog", emoji: "🐕", name: "Dog", category: "people" },
|
|
1925
|
-
{ id: "cat", emoji: "🐈", name: "Cat", category: "people" },
|
|
1926
|
-
{ id: "bird", emoji: "🐦", name: "Bird", category: "people" },
|
|
1927
|
-
{ id: "horse", emoji: "🐴", name: "Horse", category: "people" },
|
|
1928
|
-
{ id: "fish", emoji: "🐟", name: "Fish", category: "people" },
|
|
1929
|
-
// Maritime & Navigation
|
|
1930
|
-
{ id: "anchor", emoji: "⚓", name: "Anchor", category: "maritime" },
|
|
1931
|
-
{ id: "compass", emoji: "🧭", name: "Compass", category: "maritime" },
|
|
1932
|
-
{ id: "lighthouse", emoji: "🗼", name: "Lighthouse", category: "maritime" },
|
|
1933
|
-
{ id: "sailboat", emoji: "⛵", name: "Sailboat", category: "maritime" },
|
|
1934
|
-
// Security
|
|
1935
|
-
{ id: "lock", emoji: "🔒", name: "Lock", category: "security" },
|
|
1936
|
-
{ id: "key", emoji: "🔑", name: "Key", category: "security" },
|
|
1937
|
-
{ id: "shield", emoji: "🛡️", name: "Shield", category: "security" },
|
|
1938
|
-
{ id: "eye", emoji: "👁️", name: "Eye", category: "security" },
|
|
1939
|
-
{ id: "search", emoji: "🔍", name: "Search", category: "security" },
|
|
1940
|
-
{ id: "police", emoji: "🚔", name: "Police", category: "security" },
|
|
1941
|
-
{ id: "siren", emoji: "🚨", name: "Siren", category: "security" },
|
|
1942
|
-
// Time & Organization
|
|
1943
|
-
{ id: "clock", emoji: "🕐", name: "Clock", category: "time" },
|
|
1944
|
-
{ id: "calendar", emoji: "📅", name: "Calendar", category: "time" },
|
|
1945
|
-
{ id: "bookmark", emoji: "🔖", name: "Bookmark", category: "time" },
|
|
1946
|
-
{ id: "tag", emoji: "🏷️", name: "Tag", category: "time" },
|
|
1947
|
-
{ id: "pushpin", emoji: "📌", name: "Pin", category: "time" },
|
|
1948
|
-
// Shapes & Geometric
|
|
1949
|
-
{ id: "red-circle", emoji: "🔴", name: "Red Circle", category: "shapes" },
|
|
1950
|
-
{ id: "blue-circle", emoji: "🔵", name: "Blue Circle", category: "shapes" },
|
|
1951
|
-
{ id: "green-circle", emoji: "🟢", name: "Green Circle", category: "shapes" },
|
|
1952
|
-
{ id: "yellow-circle", emoji: "🟡", name: "Yellow Circle", category: "shapes" },
|
|
1953
|
-
{ id: "orange-circle", emoji: "🟠", name: "Orange Circle", category: "shapes" },
|
|
1954
|
-
{ id: "purple-circle", emoji: "🟣", name: "Purple Circle", category: "shapes" },
|
|
1955
|
-
{ id: "white-circle", emoji: "⚪", name: "White Circle", category: "shapes" },
|
|
1956
|
-
{ id: "black-circle", emoji: "⚫", name: "Black Circle", category: "shapes" },
|
|
1957
|
-
{ id: "red-square", emoji: "🟥", name: "Red Square", category: "shapes" },
|
|
1958
|
-
{ id: "blue-square", emoji: "🟦", name: "Blue Square", category: "shapes" },
|
|
1959
|
-
{ id: "diamond", emoji: "💎", name: "Diamond", category: "shapes" },
|
|
1960
|
-
// Arrows
|
|
1961
|
-
{ id: "arrow-up", emoji: "⬆️", name: "Arrow Up", category: "arrows" },
|
|
1962
|
-
{ id: "arrow-down", emoji: "⬇️", name: "Arrow Down", category: "arrows" },
|
|
1963
|
-
{ id: "arrow-left", emoji: "⬅️", name: "Arrow Left", category: "arrows" },
|
|
1964
|
-
{ id: "arrow-right", emoji: "➡️", name: "Arrow Right", category: "arrows" },
|
|
1965
|
-
{ id: "target", emoji: "🎯", name: "Target", category: "arrows" }
|
|
1966
|
-
];
|
|
1967
|
-
const EMOJI_BY_ID = new Map(ICONS.map((i) => [i.id, i.emoji]));
|
|
1968
2403
|
function windowFromRange(start, end) {
|
|
1969
2404
|
if (!start || !end) return null;
|
|
1970
2405
|
const t0 = start.getTime();
|
|
@@ -2662,17 +3097,19 @@ async function runShardPass(input) {
|
|
|
2662
3097
|
for (let index = 0; index < ranges.length; index++) {
|
|
2663
3098
|
const { start, end } = ranges[index];
|
|
2664
3099
|
const slice = features.slice(start, end);
|
|
2665
|
-
const roles = rolesForGeometry(geometryClassesOf(slice));
|
|
2666
3100
|
const ctx = input.contextForShard();
|
|
2667
3101
|
const shardArrows = [];
|
|
3102
|
+
let icons = false;
|
|
2668
3103
|
const painted = slice.map((f) => {
|
|
2669
|
-
var _a2;
|
|
3104
|
+
var _a2, _b2;
|
|
2670
3105
|
const styled = styleFeatureForPaint(f, layer, ctx, true);
|
|
2671
3106
|
if (((_a2 = styled.feature.properties) == null ? void 0 : _a2.kind) === "arrow" && styled.feature.geometry.type === "LineString") {
|
|
2672
3107
|
shardArrows.push(styled.feature);
|
|
2673
3108
|
}
|
|
3109
|
+
if (!icons && ((_b2 = styled.feature.properties) == null ? void 0 : _b2.icon)) icons = true;
|
|
2674
3110
|
return styled.feature;
|
|
2675
3111
|
});
|
|
3112
|
+
const roles = rolesForGeometry(geometryClassesOf(slice), { icons });
|
|
2676
3113
|
host.paintShard(index, roles, { type: "FeatureCollection", features: painted });
|
|
2677
3114
|
if (shardArrows.length > 0) pushAll$1(arrowLines, shardArrows);
|
|
2678
3115
|
(_a = input.onShardPainted) == null ? void 0 : _a.call(input, index, start, end);
|
|
@@ -3043,10 +3480,21 @@ function CursorCoordinatesOverlay({ map }) {
|
|
|
3043
3480
|
}
|
|
3044
3481
|
const NO_IMPORTS = Object.freeze([]);
|
|
3045
3482
|
const getServerSnapshot = () => NO_IMPORTS;
|
|
3483
|
+
function describeActivity(entry, labels) {
|
|
3484
|
+
switch (entry.activity) {
|
|
3485
|
+
case "rendering":
|
|
3486
|
+
return labels.rendering(entry.label);
|
|
3487
|
+
case "preparing-download":
|
|
3488
|
+
return labels.preparingDownload(entry.label);
|
|
3489
|
+
default:
|
|
3490
|
+
return labels.importing(entry.label);
|
|
3491
|
+
}
|
|
3492
|
+
}
|
|
3046
3493
|
function IngestProgressOverlay({
|
|
3047
3494
|
store,
|
|
3048
3495
|
bottomPx
|
|
3049
3496
|
}) {
|
|
3497
|
+
const { ingest: labels } = useMapLabels();
|
|
3050
3498
|
const entries = useSyncExternalStore(store.subscribe, store.getSnapshot, getServerSnapshot);
|
|
3051
3499
|
if (entries.length === 0) return null;
|
|
3052
3500
|
return /* @__PURE__ */ jsx(
|
|
@@ -3061,11 +3509,8 @@ function IngestProgressOverlay({
|
|
|
3061
3509
|
className: "rounded-md border bg-background/90 px-3 py-1.5 text-xs text-muted-foreground shadow-md",
|
|
3062
3510
|
children: [
|
|
3063
3511
|
/* @__PURE__ */ jsxs("span", { children: [
|
|
3064
|
-
entry
|
|
3065
|
-
|
|
3066
|
-
entry.label,
|
|
3067
|
-
"…",
|
|
3068
|
-
entry.total !== null ? ` ${entry.received.toLocaleString()} / ${entry.total.toLocaleString()} features` : ""
|
|
3512
|
+
describeActivity(entry, labels),
|
|
3513
|
+
entry.total !== null ? ` ${labels.progress({ received: entry.received, total: entry.total })}` : ""
|
|
3069
3514
|
] }),
|
|
3070
3515
|
entry.total !== null && entry.total > 0 && /* @__PURE__ */ jsx("div", { className: "mt-1 h-1 w-48 overflow-hidden rounded bg-muted", children: /* @__PURE__ */ jsx(
|
|
3071
3516
|
"div",
|
|
@@ -3082,23 +3527,25 @@ function IngestProgressOverlay({
|
|
|
3082
3527
|
);
|
|
3083
3528
|
}
|
|
3084
3529
|
const CATEGORIES = [
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3530
|
+
"places",
|
|
3531
|
+
"transport",
|
|
3532
|
+
"food",
|
|
3533
|
+
"nature",
|
|
3534
|
+
"symbols",
|
|
3535
|
+
"activities",
|
|
3536
|
+
"work",
|
|
3537
|
+
"shopping",
|
|
3538
|
+
"communication",
|
|
3539
|
+
"people",
|
|
3540
|
+
"maritime",
|
|
3541
|
+
"security",
|
|
3542
|
+
"time",
|
|
3543
|
+
"shapes",
|
|
3544
|
+
"arrows"
|
|
3100
3545
|
];
|
|
3101
3546
|
function IconPicker({ value, onChange, disabled = false, renderTrigger, open: controlledOpen, onOpenChange }) {
|
|
3547
|
+
const { iconPicker: labels, iconNames: iconNames2, iconCategories: iconCategories2 } = useMapLabels();
|
|
3548
|
+
const iconName = useCallback((icon) => iconNames2[icon.id] ?? icon.name, [iconNames2]);
|
|
3102
3549
|
const [internalOpen, setInternalOpen] = useState(false);
|
|
3103
3550
|
const open = controlledOpen ?? internalOpen;
|
|
3104
3551
|
const setOpen = useCallback((v) => {
|
|
@@ -3115,11 +3562,11 @@ function IconPicker({ value, onChange, disabled = false, renderTrigger, open: co
|
|
|
3115
3562
|
if (search.trim()) {
|
|
3116
3563
|
const searchLower = search.toLowerCase().trim();
|
|
3117
3564
|
result = result.filter(
|
|
3118
|
-
(i) => i.name.toLowerCase().includes(searchLower) || i.id.toLowerCase().includes(searchLower) || i.category.toLowerCase().includes(searchLower)
|
|
3565
|
+
(i) => iconName(i).toLowerCase().includes(searchLower) || i.name.toLowerCase().includes(searchLower) || i.id.toLowerCase().includes(searchLower) || i.category.toLowerCase().includes(searchLower) || (iconCategories2[i.category] ?? "").toLowerCase().includes(searchLower)
|
|
3119
3566
|
);
|
|
3120
3567
|
}
|
|
3121
3568
|
return result;
|
|
3122
|
-
}, [activeCategory, search]);
|
|
3569
|
+
}, [activeCategory, search, iconName, iconCategories2]);
|
|
3123
3570
|
const handleSelect = useCallback((emoji) => {
|
|
3124
3571
|
onChange(emoji);
|
|
3125
3572
|
setOpen(false);
|
|
@@ -3139,7 +3586,7 @@ function IconPicker({ value, onChange, disabled = false, renderTrigger, open: co
|
|
|
3139
3586
|
onClick: () => setOpen(true),
|
|
3140
3587
|
className: "!w-10 !h-8 !p-0 overflow-hidden",
|
|
3141
3588
|
"data-testid": "button-icon-picker",
|
|
3142
|
-
children: value ? /* @__PURE__ */ jsx("span", { className: "text-lg leading-none", children: value }) : /* @__PURE__ */ jsx("span", { className: "text-xs text-gray-400 leading-none", children:
|
|
3589
|
+
children: value ? /* @__PURE__ */ jsx("span", { className: "text-lg leading-none", children: value }) : /* @__PURE__ */ jsx("span", { className: "text-xs text-gray-400 leading-none", children: labels.emptyTrigger })
|
|
3143
3590
|
}
|
|
3144
3591
|
),
|
|
3145
3592
|
/* @__PURE__ */ jsxs(
|
|
@@ -3147,7 +3594,7 @@ function IconPicker({ value, onChange, disabled = false, renderTrigger, open: co
|
|
|
3147
3594
|
{
|
|
3148
3595
|
open,
|
|
3149
3596
|
onCancel: () => setOpen(false),
|
|
3150
|
-
title:
|
|
3597
|
+
title: labels.title,
|
|
3151
3598
|
footer: null,
|
|
3152
3599
|
width: 600,
|
|
3153
3600
|
className: "icon-picker-modal",
|
|
@@ -3158,7 +3605,7 @@ function IconPicker({ value, onChange, disabled = false, renderTrigger, open: co
|
|
|
3158
3605
|
/* @__PURE__ */ jsx(
|
|
3159
3606
|
Input,
|
|
3160
3607
|
{
|
|
3161
|
-
placeholder:
|
|
3608
|
+
placeholder: labels.searchPlaceholder,
|
|
3162
3609
|
value: search,
|
|
3163
3610
|
onChange: (e) => {
|
|
3164
3611
|
setSearch(e.target.value);
|
|
@@ -3170,7 +3617,7 @@ function IconPicker({ value, onChange, disabled = false, renderTrigger, open: co
|
|
|
3170
3617
|
}
|
|
3171
3618
|
),
|
|
3172
3619
|
/* @__PURE__ */ jsx("div", { className: "overflow-x-auto whitespace-nowrap", children: /* @__PURE__ */ jsxs("div", { className: "flex gap-1 pb-2", children: [
|
|
3173
|
-
/* @__PURE__ */
|
|
3620
|
+
/* @__PURE__ */ jsx(
|
|
3174
3621
|
Button,
|
|
3175
3622
|
{
|
|
3176
3623
|
type: activeCategory === null && !search ? "primary" : "text",
|
|
@@ -3181,34 +3628,25 @@ function IconPicker({ value, onChange, disabled = false, renderTrigger, open: co
|
|
|
3181
3628
|
setSearch("");
|
|
3182
3629
|
},
|
|
3183
3630
|
"data-testid": "button-category-all",
|
|
3184
|
-
children:
|
|
3185
|
-
"All (",
|
|
3186
|
-
ICONS.length,
|
|
3187
|
-
")"
|
|
3188
|
-
]
|
|
3631
|
+
children: labels.allCategories(ICONS.length)
|
|
3189
3632
|
}
|
|
3190
3633
|
),
|
|
3191
3634
|
CATEGORIES.map((cat) => {
|
|
3192
|
-
const count = ICONS.filter((i) => i.category === cat
|
|
3193
|
-
return /* @__PURE__ */
|
|
3635
|
+
const count = ICONS.filter((i) => i.category === cat).length;
|
|
3636
|
+
return /* @__PURE__ */ jsx(
|
|
3194
3637
|
Button,
|
|
3195
3638
|
{
|
|
3196
|
-
type: activeCategory === cat
|
|
3639
|
+
type: activeCategory === cat ? "primary" : "text",
|
|
3197
3640
|
size: "small",
|
|
3198
3641
|
className: "!h-7 text-xs !px-3 shrink-0",
|
|
3199
3642
|
onClick: () => {
|
|
3200
|
-
setActiveCategory(cat
|
|
3643
|
+
setActiveCategory(cat);
|
|
3201
3644
|
setSearch("");
|
|
3202
3645
|
},
|
|
3203
|
-
"data-testid": `button-category-${cat
|
|
3204
|
-
children: [
|
|
3205
|
-
cat.label,
|
|
3206
|
-
" (",
|
|
3207
|
-
count,
|
|
3208
|
-
")"
|
|
3209
|
-
]
|
|
3646
|
+
"data-testid": `button-category-${cat}`,
|
|
3647
|
+
children: labels.categoryWithCount({ category: iconCategories2[cat], count })
|
|
3210
3648
|
},
|
|
3211
|
-
cat
|
|
3649
|
+
cat
|
|
3212
3650
|
);
|
|
3213
3651
|
})
|
|
3214
3652
|
] }) })
|
|
@@ -3226,25 +3664,21 @@ function IconPicker({ value, onChange, disabled = false, renderTrigger, open: co
|
|
|
3226
3664
|
size: "small",
|
|
3227
3665
|
className: "!w-10 !h-10 !p-1",
|
|
3228
3666
|
onClick: () => handleSelect(iconDef.emoji),
|
|
3229
|
-
title: iconDef
|
|
3667
|
+
title: iconName(iconDef),
|
|
3230
3668
|
"data-testid": `button-icon-${iconDef.id}`,
|
|
3231
3669
|
children: /* @__PURE__ */ jsx("span", { className: "text-xl leading-none", children: iconDef.emoji })
|
|
3232
3670
|
},
|
|
3233
3671
|
iconDef.id
|
|
3234
3672
|
)) }),
|
|
3235
|
-
filteredIcons.length === 0 && /* @__PURE__ */
|
|
3236
|
-
'No icons found for "',
|
|
3237
|
-
search,
|
|
3238
|
-
'"'
|
|
3239
|
-
] })
|
|
3673
|
+
filteredIcons.length === 0 && /* @__PURE__ */ jsx("div", { className: "text-center text-muted-foreground text-sm py-12", children: labels.noIconsFound(search) })
|
|
3240
3674
|
]
|
|
3241
3675
|
}
|
|
3242
3676
|
),
|
|
3243
3677
|
/* @__PURE__ */ jsxs("div", { className: "px-4 py-3 border-t shrink-0 flex items-center justify-between gap-2", children: [
|
|
3244
3678
|
selectedIcon ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground min-w-0", children: [
|
|
3245
3679
|
/* @__PURE__ */ jsx("span", { className: "text-xl leading-none shrink-0", children: selectedIcon.emoji }),
|
|
3246
|
-
/* @__PURE__ */ jsx("span", { className: "truncate", children: selectedIcon
|
|
3247
|
-
] }) : /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children:
|
|
3680
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: iconName(selectedIcon) })
|
|
3681
|
+
] }) : /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: labels.noIconSelected }),
|
|
3248
3682
|
/* @__PURE__ */ jsxs("div", { className: "flex gap-2 shrink-0", children: [
|
|
3249
3683
|
value && /* @__PURE__ */ jsx(
|
|
3250
3684
|
Button,
|
|
@@ -3256,7 +3690,7 @@ function IconPicker({ value, onChange, disabled = false, renderTrigger, open: co
|
|
|
3256
3690
|
setOpen(false);
|
|
3257
3691
|
},
|
|
3258
3692
|
"data-testid": "button-clear-icon",
|
|
3259
|
-
children:
|
|
3693
|
+
children: labels.clearIcon
|
|
3260
3694
|
}
|
|
3261
3695
|
),
|
|
3262
3696
|
/* @__PURE__ */ jsx(
|
|
@@ -3266,7 +3700,7 @@ function IconPicker({ value, onChange, disabled = false, renderTrigger, open: co
|
|
|
3266
3700
|
size: "small",
|
|
3267
3701
|
onClick: () => setOpen(false),
|
|
3268
3702
|
"data-testid": "button-close-icon-picker",
|
|
3269
|
-
children:
|
|
3703
|
+
children: labels.cancel
|
|
3270
3704
|
}
|
|
3271
3705
|
)
|
|
3272
3706
|
] })
|
|
@@ -3385,11 +3819,6 @@ const DEFAULT_ENDPOINTS = {
|
|
|
3385
3819
|
terrainTiles: ["https://s3.amazonaws.com/elevation-tiles-prod/terrarium/{z}/{x}/{y}.png"],
|
|
3386
3820
|
glyphsUrl: "/fonts/{fontstack}/{range}.pbf"
|
|
3387
3821
|
};
|
|
3388
|
-
const BUILT_IN_NAMES = {
|
|
3389
|
-
streets: "Streets",
|
|
3390
|
-
satellite: "Satellite",
|
|
3391
|
-
dark: "Dark"
|
|
3392
|
-
};
|
|
3393
3822
|
const isOff = (value) => value === false || value === null;
|
|
3394
3823
|
const nonEmpty = (value) => typeof value === "string" && value.trim() !== "" ? value : void 0;
|
|
3395
3824
|
const nonEmptyTiles = (tiles) => Array.isArray(tiles) ? tiles.filter((tile) => nonEmpty(tile) !== void 0) : [];
|
|
@@ -3443,9 +3872,9 @@ function resolveEndpoints(endpoints) {
|
|
|
3443
3872
|
const adoptStyleGlyphs = glyphs === "from-style";
|
|
3444
3873
|
const glyphsUrl = typeof glyphs === "object" && glyphs !== null && nonEmpty(glyphs.url) || DEFAULT_ENDPOINTS.glyphsUrl;
|
|
3445
3874
|
const builtInBasemaps = [];
|
|
3446
|
-
if (streets) builtInBasemaps.push({ id: "streets", name: streets.name
|
|
3447
|
-
if (satellite) builtInBasemaps.push({ id: "satellite", name: satelliteName
|
|
3448
|
-
if (dark) builtInBasemaps.push({ id: "dark", name: dark.name
|
|
3875
|
+
if (streets) builtInBasemaps.push({ id: "streets", name: streets.name });
|
|
3876
|
+
if (satellite) builtInBasemaps.push({ id: "satellite", name: satelliteName });
|
|
3877
|
+
if (dark) builtInBasemaps.push({ id: "dark", name: dark.name });
|
|
3449
3878
|
return {
|
|
3450
3879
|
vectorStyles: {
|
|
3451
3880
|
...streets ? { streets: streets.style } : {},
|
|
@@ -3554,10 +3983,10 @@ function ToolButton({ mode, activeMode, onModeChange, icon, label, shortcut, dis
|
|
|
3554
3983
|
);
|
|
3555
3984
|
}
|
|
3556
3985
|
const SELECTION_MODES = [
|
|
3557
|
-
{ id: "click",
|
|
3558
|
-
{ id: "rectangle",
|
|
3559
|
-
{ id: "polygon",
|
|
3560
|
-
{ id: "circle",
|
|
3986
|
+
{ id: "click", labelKey: "clickSelect", icon: MousePointer2, shortcut: "V" },
|
|
3987
|
+
{ id: "rectangle", labelKey: "rectangleSelect", icon: Square, shortcut: "R" },
|
|
3988
|
+
{ id: "polygon", labelKey: "polygonSelect", icon: Hexagon, shortcut: "S" },
|
|
3989
|
+
{ id: "circle", labelKey: "circleSelect", icon: Circle, shortcut: "O" }
|
|
3561
3990
|
];
|
|
3562
3991
|
function DrawingToolbar({
|
|
3563
3992
|
activeMode,
|
|
@@ -3602,6 +4031,13 @@ function DrawingToolbar({
|
|
|
3602
4031
|
canDeleteSelected = true,
|
|
3603
4032
|
showUndoRedo = false
|
|
3604
4033
|
}) {
|
|
4034
|
+
var _a;
|
|
4035
|
+
const {
|
|
4036
|
+
drawingToolbar: labels,
|
|
4037
|
+
navigate: navigateLabels,
|
|
4038
|
+
coordinates: coordinateLabels,
|
|
4039
|
+
featureSearch: searchLabels
|
|
4040
|
+
} = useMapLabels();
|
|
3605
4041
|
const { toast } = useToast();
|
|
3606
4042
|
const confirm = useConfirm();
|
|
3607
4043
|
const antdPopupSelector = useAntdPopupSelector();
|
|
@@ -3623,8 +4059,8 @@ function DrawingToolbar({
|
|
|
3623
4059
|
useEffect(() => {
|
|
3624
4060
|
if (featureSearchOpen) {
|
|
3625
4061
|
setTimeout(() => {
|
|
3626
|
-
var
|
|
3627
|
-
return (
|
|
4062
|
+
var _a2;
|
|
4063
|
+
return (_a2 = searchInputRef.current) == null ? void 0 : _a2.focus();
|
|
3628
4064
|
}, 100);
|
|
3629
4065
|
}
|
|
3630
4066
|
}, [featureSearchOpen]);
|
|
@@ -3641,9 +4077,9 @@ function DrawingToolbar({
|
|
|
3641
4077
|
return () => document.removeEventListener("pointerdown", handlePointerDown);
|
|
3642
4078
|
}, [featureSearchOpen, antdPopupSelector]);
|
|
3643
4079
|
const getFeatureLabel = (f) => {
|
|
3644
|
-
var
|
|
4080
|
+
var _a2;
|
|
3645
4081
|
const p = f.properties || {};
|
|
3646
|
-
return p.name || p.label || p.title || p.text || p.description || `${p.entityType || ((
|
|
4082
|
+
return p.name || p.label || p.title || p.text || p.description || `${p.entityType || ((_a2 = f.geometry) == null ? void 0 : _a2.type) || searchLabels.untitledFeature}`;
|
|
3647
4083
|
};
|
|
3648
4084
|
const cachedFeatures = featureSearchOpen && getAllFeatures ? getAllFeatures() : [];
|
|
3649
4085
|
const featureSearchResults = (() => {
|
|
@@ -3721,15 +4157,15 @@ function DrawingToolbar({
|
|
|
3721
4157
|
const lat = parseFloat(goToLat.trim());
|
|
3722
4158
|
const lng = parseFloat(goToLng.trim());
|
|
3723
4159
|
if (isNaN(lat) || isNaN(lng)) {
|
|
3724
|
-
toast({ title:
|
|
4160
|
+
toast({ title: coordinateLabels.invalidCoordinates, description: coordinateLabels.invalidCoordinatesDescription, variant: "destructive" });
|
|
3725
4161
|
return;
|
|
3726
4162
|
}
|
|
3727
4163
|
if (lat < -90 || lat > 90) {
|
|
3728
|
-
toast({ title:
|
|
4164
|
+
toast({ title: coordinateLabels.invalidLatitude, description: coordinateLabels.latitudeOutOfRange, variant: "destructive" });
|
|
3729
4165
|
return;
|
|
3730
4166
|
}
|
|
3731
4167
|
if (lng < -180 || lng > 180) {
|
|
3732
|
-
toast({ title:
|
|
4168
|
+
toast({ title: coordinateLabels.invalidLongitude, description: coordinateLabels.longitudeOutOfRange, variant: "destructive" });
|
|
3733
4169
|
return;
|
|
3734
4170
|
}
|
|
3735
4171
|
if (onDropPoint) {
|
|
@@ -3748,8 +4184,8 @@ function DrawingToolbar({
|
|
|
3748
4184
|
const result = await geocodeAddress(resolvedGeocoder, goToAddress.trim());
|
|
3749
4185
|
if (!result) {
|
|
3750
4186
|
toast({
|
|
3751
|
-
title:
|
|
3752
|
-
description:
|
|
4187
|
+
title: navigateLabels.locationNotFound,
|
|
4188
|
+
description: navigateLabels.locationNotFoundDescription,
|
|
3753
4189
|
variant: "destructive"
|
|
3754
4190
|
});
|
|
3755
4191
|
return;
|
|
@@ -3765,8 +4201,8 @@ function DrawingToolbar({
|
|
|
3765
4201
|
setGoToAddress("");
|
|
3766
4202
|
} catch (error) {
|
|
3767
4203
|
toast({
|
|
3768
|
-
title:
|
|
3769
|
-
description:
|
|
4204
|
+
title: navigateLabels.searchError,
|
|
4205
|
+
description: navigateLabels.searchErrorDescription,
|
|
3770
4206
|
variant: "destructive"
|
|
3771
4207
|
});
|
|
3772
4208
|
} finally {
|
|
@@ -3775,11 +4211,11 @@ function DrawingToolbar({
|
|
|
3775
4211
|
};
|
|
3776
4212
|
const handleClearAll = () => {
|
|
3777
4213
|
confirm({
|
|
3778
|
-
title:
|
|
3779
|
-
content:
|
|
3780
|
-
okText:
|
|
4214
|
+
title: labels.clearAllConfirmTitle,
|
|
4215
|
+
content: labels.clearAllConfirmContent(featureCount),
|
|
4216
|
+
okText: labels.clearAllConfirmOk,
|
|
3781
4217
|
okButtonProps: { danger: true },
|
|
3782
|
-
cancelText:
|
|
4218
|
+
cancelText: labels.clearAllConfirmCancel,
|
|
3783
4219
|
onOk: onClear
|
|
3784
4220
|
});
|
|
3785
4221
|
};
|
|
@@ -3791,7 +4227,7 @@ function DrawingToolbar({
|
|
|
3791
4227
|
key: mode.id,
|
|
3792
4228
|
label: /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
3793
4229
|
/* @__PURE__ */ jsx(Icon, { className: "w-4 h-4" }),
|
|
3794
|
-
mode.
|
|
4230
|
+
labels[mode.labelKey]
|
|
3795
4231
|
] }),
|
|
3796
4232
|
className: isThisModeActive ? "bg-primary/10" : "",
|
|
3797
4233
|
onClick: () => {
|
|
@@ -3818,7 +4254,7 @@ function DrawingToolbar({
|
|
|
3818
4254
|
label: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between w-full", children: [
|
|
3819
4255
|
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
3820
4256
|
/* @__PURE__ */ jsx(Ruler, { className: "w-4 h-4" }),
|
|
3821
|
-
|
|
4257
|
+
labels.measureDistance
|
|
3822
4258
|
] }),
|
|
3823
4259
|
showShortcutHints && /* @__PURE__ */ jsx("kbd", { className: "px-1.5 py-0.5 text-xs font-mono bg-black/10 dark:bg-white/10 rounded", children: "M" })
|
|
3824
4260
|
] }),
|
|
@@ -3830,7 +4266,7 @@ function DrawingToolbar({
|
|
|
3830
4266
|
label: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between w-full", children: [
|
|
3831
4267
|
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
3832
4268
|
/* @__PURE__ */ jsx(Move, { className: "w-4 h-4" }),
|
|
3833
|
-
|
|
4269
|
+
labels.measureArea
|
|
3834
4270
|
] }),
|
|
3835
4271
|
showShortcutHints && /* @__PURE__ */ jsx("kbd", { className: "px-1.5 py-0.5 text-xs font-mono bg-black/10 dark:bg-white/10 rounded", children: "A" })
|
|
3836
4272
|
] }),
|
|
@@ -3847,7 +4283,7 @@ function DrawingToolbar({
|
|
|
3847
4283
|
label: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between w-full", children: [
|
|
3848
4284
|
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
3849
4285
|
/* @__PURE__ */ jsx(Type, { className: "w-4 h-4" }),
|
|
3850
|
-
|
|
4286
|
+
labels.addText
|
|
3851
4287
|
] }),
|
|
3852
4288
|
showShortcutHints && /* @__PURE__ */ jsx("kbd", { className: "px-1.5 py-0.5 text-xs font-mono bg-black/10 dark:bg-white/10 rounded", children: "T" })
|
|
3853
4289
|
] }),
|
|
@@ -3862,7 +4298,7 @@ function DrawingToolbar({
|
|
|
3862
4298
|
label: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between w-full", children: [
|
|
3863
4299
|
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
3864
4300
|
/* @__PURE__ */ jsx(MoveRight, { className: "w-4 h-4" }),
|
|
3865
|
-
|
|
4301
|
+
labels.drawArrow
|
|
3866
4302
|
] }),
|
|
3867
4303
|
showShortcutHints && /* @__PURE__ */ jsx("kbd", { className: "px-1.5 py-0.5 text-xs font-mono bg-black/10 dark:bg-white/10 rounded", children: "W" })
|
|
3868
4304
|
] }),
|
|
@@ -3877,7 +4313,7 @@ function DrawingToolbar({
|
|
|
3877
4313
|
label: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between w-full", children: [
|
|
3878
4314
|
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
3879
4315
|
/* @__PURE__ */ jsx(Circle, { className: "w-4 h-4" }),
|
|
3880
|
-
|
|
4316
|
+
labels.drawCircle
|
|
3881
4317
|
] }),
|
|
3882
4318
|
showShortcutHints && /* @__PURE__ */ jsx("kbd", { className: "px-1.5 py-0.5 text-xs font-mono bg-black/10 dark:bg-white/10 rounded", children: "C" })
|
|
3883
4319
|
] }),
|
|
@@ -3893,7 +4329,7 @@ function DrawingToolbar({
|
|
|
3893
4329
|
label: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between w-full", children: [
|
|
3894
4330
|
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
3895
4331
|
/* @__PURE__ */ jsx(Undo2, { className: "w-4 h-4" }),
|
|
3896
|
-
|
|
4332
|
+
labels.undo
|
|
3897
4333
|
] }),
|
|
3898
4334
|
showShortcutHints && /* @__PURE__ */ jsx("kbd", { className: "px-1.5 py-0.5 text-xs font-mono bg-black/10 dark:bg-white/10 rounded", children: "Ctrl+Z" })
|
|
3899
4335
|
] }),
|
|
@@ -3905,7 +4341,7 @@ function DrawingToolbar({
|
|
|
3905
4341
|
label: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between w-full", children: [
|
|
3906
4342
|
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
3907
4343
|
/* @__PURE__ */ jsx(Redo2, { className: "w-4 h-4" }),
|
|
3908
|
-
|
|
4344
|
+
labels.redo
|
|
3909
4345
|
] }),
|
|
3910
4346
|
showShortcutHints && /* @__PURE__ */ jsx("kbd", { className: "px-1.5 py-0.5 text-xs font-mono bg-black/10 dark:bg-white/10 rounded", children: "Ctrl+Y" })
|
|
3911
4347
|
] }),
|
|
@@ -3919,9 +4355,7 @@ function DrawingToolbar({
|
|
|
3919
4355
|
label: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between w-full text-red-500", children: [
|
|
3920
4356
|
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
3921
4357
|
/* @__PURE__ */ jsx(X, { className: "w-4 h-4" }),
|
|
3922
|
-
|
|
3923
|
-
selectedCount,
|
|
3924
|
-
")"
|
|
4358
|
+
labels.deleteSelected(selectedCount)
|
|
3925
4359
|
] }),
|
|
3926
4360
|
showShortcutHints && /* @__PURE__ */ jsx("kbd", { className: "px-1.5 py-0.5 text-xs font-mono bg-black/10 dark:bg-white/10 rounded", children: "Del" })
|
|
3927
4361
|
] }),
|
|
@@ -3932,16 +4366,14 @@ function DrawingToolbar({
|
|
|
3932
4366
|
key: "clear",
|
|
3933
4367
|
label: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-red-500", children: [
|
|
3934
4368
|
/* @__PURE__ */ jsx(Trash2, { className: "w-4 h-4" }),
|
|
3935
|
-
|
|
3936
|
-
featureCount,
|
|
3937
|
-
")"
|
|
4369
|
+
labels.clearAll(featureCount)
|
|
3938
4370
|
] }),
|
|
3939
4371
|
disabled: disabled || featureCount === 0,
|
|
3940
4372
|
onClick: handleClearAll
|
|
3941
4373
|
});
|
|
3942
4374
|
return items;
|
|
3943
4375
|
};
|
|
3944
|
-
const compactOverflowItems = isEditMode && isCompact && !selectionOnly ? /* @__PURE__ */ jsx(Tooltip, { title:
|
|
4376
|
+
const compactOverflowItems = isEditMode && isCompact && !selectionOnly ? /* @__PURE__ */ jsx(Tooltip, { title: labels.moreTools, placement: "right", children: /* @__PURE__ */ jsx(
|
|
3945
4377
|
Dropdown,
|
|
3946
4378
|
{
|
|
3947
4379
|
menu: { items: getMoreMenuItems() },
|
|
@@ -3952,7 +4384,7 @@ function DrawingToolbar({
|
|
|
3952
4384
|
{
|
|
3953
4385
|
type: "text",
|
|
3954
4386
|
className: "relative flex items-center justify-center !w-9 !h-9 !min-w-0 !p-0",
|
|
3955
|
-
"aria-label":
|
|
4387
|
+
"aria-label": labels.moreTools,
|
|
3956
4388
|
"data-testid": "button-more-tools",
|
|
3957
4389
|
icon: /* @__PURE__ */ jsx(MoreVertical, { className: "w-5 h-5" })
|
|
3958
4390
|
}
|
|
@@ -3965,14 +4397,14 @@ function DrawingToolbar({
|
|
|
3965
4397
|
ref: toolbarRef,
|
|
3966
4398
|
className: "absolute top-4 left-4 z-10 flex flex-col gap-0.5 p-1 bg-background/80 floating-panel rounded-lg shadow-[0_2px_8px_rgba(0,0,0,0.12)] border border-border",
|
|
3967
4399
|
role: "toolbar",
|
|
3968
|
-
"aria-label":
|
|
4400
|
+
"aria-label": labels.drawingTools,
|
|
3969
4401
|
"data-testid": "toolbar-drawing",
|
|
3970
4402
|
children: [
|
|
3971
4403
|
enableSelection && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3972
4404
|
expandSelectionTools ? /* @__PURE__ */ jsx(Fragment, { children: visibleSelectionModes.map((mode) => {
|
|
3973
4405
|
const Icon = mode.icon;
|
|
3974
4406
|
const isThisModeActive = isSelectionToolActive && selectionMode === mode.id;
|
|
3975
|
-
return /* @__PURE__ */ jsx(Tooltip, { title: mode.
|
|
4407
|
+
return /* @__PURE__ */ jsx(Tooltip, { title: labels[mode.labelKey], placement: "right", children: /* @__PURE__ */ jsx(
|
|
3976
4408
|
Button,
|
|
3977
4409
|
{
|
|
3978
4410
|
type: "text",
|
|
@@ -3991,13 +4423,13 @@ function DrawingToolbar({
|
|
|
3991
4423
|
"relative transition-all duration-150 flex items-center justify-center !w-9 !h-9 !min-w-0 !p-0",
|
|
3992
4424
|
isThisModeActive && "tool-active bg-primary/10"
|
|
3993
4425
|
),
|
|
3994
|
-
"aria-label": mode.
|
|
4426
|
+
"aria-label": labels[mode.labelKey],
|
|
3995
4427
|
"data-testid": `button-select-${mode.id}`,
|
|
3996
4428
|
icon: /* @__PURE__ */ jsx(Icon, { className: "w-5 h-5" })
|
|
3997
4429
|
}
|
|
3998
4430
|
) }, mode.id);
|
|
3999
4431
|
}) }) : /* @__PURE__ */ jsxs("div", { className: "relative flex items-center", children: [
|
|
4000
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
4432
|
+
/* @__PURE__ */ jsx(Tooltip, { title: labels[((_a = SELECTION_MODES.find((mode) => mode.id === selectionMode)) == null ? void 0 : _a.labelKey) ?? "clickSelect"], placement: "right", children: /* @__PURE__ */ jsxs(
|
|
4001
4433
|
Button,
|
|
4002
4434
|
{
|
|
4003
4435
|
type: "text",
|
|
@@ -4016,7 +4448,7 @@ function DrawingToolbar({
|
|
|
4016
4448
|
"relative transition-all duration-150 flex items-center justify-center !w-9 !h-9 !min-w-0 !p-0",
|
|
4017
4449
|
isSelectionToolActive && selectionMode !== "click" && !filterActive && "tool-active bg-primary/10"
|
|
4018
4450
|
),
|
|
4019
|
-
"aria-label":
|
|
4451
|
+
"aria-label": labels.selectTool,
|
|
4020
4452
|
"data-testid": "button-select-tool",
|
|
4021
4453
|
children: [
|
|
4022
4454
|
selectionMode === "click" && /* @__PURE__ */ jsx(MousePointer2, { className: "w-5 h-5" }),
|
|
@@ -4037,7 +4469,7 @@ function DrawingToolbar({
|
|
|
4037
4469
|
{
|
|
4038
4470
|
disabled,
|
|
4039
4471
|
className: "absolute -bottom-1 -right-1 w-4 h-4 flex items-center justify-center rounded-sm bg-background/80 hover:bg-accent cursor-pointer border-0 p-0",
|
|
4040
|
-
"aria-label":
|
|
4472
|
+
"aria-label": labels.switchSelectionMode,
|
|
4041
4473
|
"data-testid": "button-select-mode-switch",
|
|
4042
4474
|
onClick: (e) => e.stopPropagation(),
|
|
4043
4475
|
children: /* @__PURE__ */ jsx(ChevronDown, { className: "w-3 h-3 opacity-70" })
|
|
@@ -4046,7 +4478,7 @@ function DrawingToolbar({
|
|
|
4046
4478
|
}
|
|
4047
4479
|
)
|
|
4048
4480
|
] }),
|
|
4049
|
-
showFilterTool && /* @__PURE__ */ jsx(Tooltip, { title:
|
|
4481
|
+
showFilterTool && /* @__PURE__ */ jsx(Tooltip, { title: labels.filterArea, placement: "right", children: /* @__PURE__ */ jsx(
|
|
4050
4482
|
Button,
|
|
4051
4483
|
{
|
|
4052
4484
|
type: "text",
|
|
@@ -4067,19 +4499,19 @@ function DrawingToolbar({
|
|
|
4067
4499
|
"relative transition-all duration-150 flex items-center justify-center !w-9 !h-9 !min-w-0 !p-0",
|
|
4068
4500
|
isSelectionToolActive && filterActive && "tool-active bg-primary/10"
|
|
4069
4501
|
),
|
|
4070
|
-
"aria-label":
|
|
4502
|
+
"aria-label": labels.filterArea,
|
|
4071
4503
|
"data-testid": "button-filter-tool",
|
|
4072
4504
|
icon: /* @__PURE__ */ jsx(Filter, { className: "w-5 h-5" })
|
|
4073
4505
|
}
|
|
4074
4506
|
) }),
|
|
4075
|
-
showClearFilter && /* @__PURE__ */ jsx(Tooltip, { title:
|
|
4507
|
+
showClearFilter && /* @__PURE__ */ jsx(Tooltip, { title: labels.clearFilter, placement: "right", children: /* @__PURE__ */ jsx(
|
|
4076
4508
|
Button,
|
|
4077
4509
|
{
|
|
4078
4510
|
type: "text",
|
|
4079
4511
|
onClick: onClearFilter,
|
|
4080
4512
|
disabled,
|
|
4081
4513
|
className: "relative transition-all duration-150 text-red-500 hover:text-red-500 flex items-center justify-center !w-9 !h-9 !min-w-0 !p-0",
|
|
4082
|
-
"aria-label":
|
|
4514
|
+
"aria-label": labels.clearFilter,
|
|
4083
4515
|
"data-testid": "button-clear-filter-toolbar",
|
|
4084
4516
|
icon: /* @__PURE__ */ jsx(X, { className: "w-5 h-5" })
|
|
4085
4517
|
}
|
|
@@ -4091,7 +4523,7 @@ function DrawingToolbar({
|
|
|
4091
4523
|
/* @__PURE__ */ jsx(
|
|
4092
4524
|
Tooltip,
|
|
4093
4525
|
{
|
|
4094
|
-
title: measureMode === "area" ?
|
|
4526
|
+
title: measureMode === "area" ? labels.measureArea : labels.measureDistance,
|
|
4095
4527
|
placement: "right",
|
|
4096
4528
|
children: /* @__PURE__ */ jsx(
|
|
4097
4529
|
Button,
|
|
@@ -4106,7 +4538,7 @@ function DrawingToolbar({
|
|
|
4106
4538
|
"relative transition-all duration-150 flex items-center justify-center !w-9 !h-9 !min-w-0 !p-0",
|
|
4107
4539
|
measureMode !== "none" && "tool-active bg-primary/10"
|
|
4108
4540
|
),
|
|
4109
|
-
"aria-label": measureMode === "area" ?
|
|
4541
|
+
"aria-label": measureMode === "area" ? labels.measureArea : labels.measureDistance,
|
|
4110
4542
|
"aria-pressed": measureMode !== "none",
|
|
4111
4543
|
"data-testid": "button-measure",
|
|
4112
4544
|
children: measureMode === "area" ? /* @__PURE__ */ jsx(Move, { className: "w-5 h-5" }) : /* @__PURE__ */ jsx(Ruler, { className: "w-5 h-5" })
|
|
@@ -4125,7 +4557,7 @@ function DrawingToolbar({
|
|
|
4125
4557
|
{
|
|
4126
4558
|
disabled,
|
|
4127
4559
|
className: "absolute -bottom-1 -right-1 w-4 h-4 flex items-center justify-center rounded-sm bg-background/80 hover:bg-accent cursor-pointer border-0 p-0",
|
|
4128
|
-
"aria-label":
|
|
4560
|
+
"aria-label": labels.switchMeasureMode,
|
|
4129
4561
|
"data-testid": "button-measure-mode-switch",
|
|
4130
4562
|
onClick: (e) => e.stopPropagation(),
|
|
4131
4563
|
children: /* @__PURE__ */ jsx(ChevronDown, { className: "w-3 h-3 opacity-70" })
|
|
@@ -4136,7 +4568,7 @@ function DrawingToolbar({
|
|
|
4136
4568
|
] }),
|
|
4137
4569
|
/* @__PURE__ */ jsx(Divider, { className: "!my-0 !min-w-0" })
|
|
4138
4570
|
] }),
|
|
4139
|
-
(onFlyToFeature && getAllFeatures || onGoTo) && /* @__PURE__ */ jsx(Tooltip, { title:
|
|
4571
|
+
(onFlyToFeature && getAllFeatures || onGoTo) && /* @__PURE__ */ jsx(Tooltip, { title: labels.searchAndNavigate, placement: "right", children: /* @__PURE__ */ jsx(
|
|
4140
4572
|
Button,
|
|
4141
4573
|
{
|
|
4142
4574
|
type: "text",
|
|
@@ -4146,7 +4578,7 @@ function DrawingToolbar({
|
|
|
4146
4578
|
"relative transition-all duration-150 flex items-center justify-center !w-9 !h-9 !min-w-0 !p-0",
|
|
4147
4579
|
featureSearchOpen && "tool-active bg-primary/10"
|
|
4148
4580
|
),
|
|
4149
|
-
"aria-label":
|
|
4581
|
+
"aria-label": labels.searchAndNavigate,
|
|
4150
4582
|
"data-testid": "button-search-features",
|
|
4151
4583
|
icon: /* @__PURE__ */ jsx(Search, { className: "w-5 h-5" })
|
|
4152
4584
|
}
|
|
@@ -4154,7 +4586,7 @@ function DrawingToolbar({
|
|
|
4154
4586
|
onFitToFeatures && /* @__PURE__ */ jsx(
|
|
4155
4587
|
Tooltip,
|
|
4156
4588
|
{
|
|
4157
|
-
title:
|
|
4589
|
+
title: labels.fitToData,
|
|
4158
4590
|
placement: "right",
|
|
4159
4591
|
children: /* @__PURE__ */ jsx(
|
|
4160
4592
|
Button,
|
|
@@ -4163,7 +4595,7 @@ function DrawingToolbar({
|
|
|
4163
4595
|
onClick: onFitToFeatures,
|
|
4164
4596
|
disabled,
|
|
4165
4597
|
className: "relative transition-all duration-150 flex items-center justify-center !w-9 !h-9 !min-w-0 !p-0",
|
|
4166
|
-
"aria-label":
|
|
4598
|
+
"aria-label": labels.fitToData,
|
|
4167
4599
|
"data-testid": "button-fit-to-data",
|
|
4168
4600
|
icon: /* @__PURE__ */ jsx(Scan, { className: "w-5 h-5" })
|
|
4169
4601
|
}
|
|
@@ -4175,12 +4607,12 @@ function DrawingToolbar({
|
|
|
4175
4607
|
Tooltip,
|
|
4176
4608
|
{
|
|
4177
4609
|
title: !hasEditableLayer && !isEditMode ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1 max-w-48", children: [
|
|
4178
|
-
/* @__PURE__ */ jsx("span", { className: "text-amber-500 font-medium", children:
|
|
4179
|
-
/* @__PURE__ */ jsx("span", { className: "text-xs", children:
|
|
4610
|
+
/* @__PURE__ */ jsx("span", { className: "text-amber-500 font-medium", children: labels.noEditableLayer }),
|
|
4611
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs", children: labels.noEditableLayerHint })
|
|
4180
4612
|
] }) : showShortcutHints ? /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
4181
|
-
|
|
4613
|
+
labels.editMode,
|
|
4182
4614
|
/* @__PURE__ */ jsx("kbd", { className: "px-1.5 py-0.5 text-xs font-mono bg-black/20 rounded", children: "E" })
|
|
4183
|
-
] }) :
|
|
4615
|
+
] }) : labels.editMode,
|
|
4184
4616
|
placement: "right",
|
|
4185
4617
|
children: /* @__PURE__ */ jsx(
|
|
4186
4618
|
Button,
|
|
@@ -4192,7 +4624,7 @@ function DrawingToolbar({
|
|
|
4192
4624
|
"relative transition-all duration-150 flex items-center justify-center !w-9 !h-9 !min-w-0 !p-0",
|
|
4193
4625
|
isEditMode && "tool-active bg-primary/10"
|
|
4194
4626
|
),
|
|
4195
|
-
"aria-label":
|
|
4627
|
+
"aria-label": labels.editMode,
|
|
4196
4628
|
"aria-pressed": isEditMode,
|
|
4197
4629
|
"data-testid": "button-edit-mode",
|
|
4198
4630
|
icon: /* @__PURE__ */ jsx(Pencil, { className: "w-5 h-5" })
|
|
@@ -4202,14 +4634,14 @@ function DrawingToolbar({
|
|
|
4202
4634
|
),
|
|
4203
4635
|
isEditMode && !selectionOnly && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4204
4636
|
/* @__PURE__ */ jsx(Divider, { className: "!my-0 !min-w-0" }),
|
|
4205
|
-
onSearchEngineRequest && /* @__PURE__ */ jsx(Tooltip, { title:
|
|
4637
|
+
onSearchEngineRequest && /* @__PURE__ */ jsx(Tooltip, { title: labels.searchAndAdd, placement: "right", children: /* @__PURE__ */ jsx(
|
|
4206
4638
|
Button,
|
|
4207
4639
|
{
|
|
4208
4640
|
type: "text",
|
|
4209
4641
|
onClick: onSearchEngineRequest,
|
|
4210
4642
|
disabled: drawingDisabled,
|
|
4211
4643
|
className: "relative transition-all duration-150 flex items-center justify-center !w-9 !h-9 !min-w-0 !p-0",
|
|
4212
|
-
"aria-label":
|
|
4644
|
+
"aria-label": labels.searchAndAdd,
|
|
4213
4645
|
"data-testid": "button-search-database",
|
|
4214
4646
|
icon: /* @__PURE__ */ jsxs("div", { className: "relative w-5 h-5", children: [
|
|
4215
4647
|
/* @__PURE__ */ jsx(Database, { className: "w-5 h-5" }),
|
|
@@ -4224,7 +4656,7 @@ function DrawingToolbar({
|
|
|
4224
4656
|
activeMode,
|
|
4225
4657
|
onModeChange,
|
|
4226
4658
|
icon: /* @__PURE__ */ jsx(MapPin, { className: "w-5 h-5" }),
|
|
4227
|
-
label:
|
|
4659
|
+
label: labels.dropPoint,
|
|
4228
4660
|
shortcut: "P",
|
|
4229
4661
|
disabled: drawingDisabled,
|
|
4230
4662
|
showShortcutHint: showShortcutHints
|
|
@@ -4237,7 +4669,7 @@ function DrawingToolbar({
|
|
|
4237
4669
|
activeMode,
|
|
4238
4670
|
onModeChange,
|
|
4239
4671
|
icon: /* @__PURE__ */ jsx(Minus, { className: "w-5 h-5" }),
|
|
4240
|
-
label:
|
|
4672
|
+
label: labels.drawLine,
|
|
4241
4673
|
shortcut: "L",
|
|
4242
4674
|
disabled: drawingDisabled,
|
|
4243
4675
|
showShortcutHint: showShortcutHints
|
|
@@ -4250,7 +4682,7 @@ function DrawingToolbar({
|
|
|
4250
4682
|
activeMode,
|
|
4251
4683
|
onModeChange,
|
|
4252
4684
|
icon: /* @__PURE__ */ jsx(Pentagon, { className: "w-5 h-5" }),
|
|
4253
|
-
label:
|
|
4685
|
+
label: labels.drawPolygon,
|
|
4254
4686
|
shortcut: "G",
|
|
4255
4687
|
disabled: drawingDisabled,
|
|
4256
4688
|
showShortcutHint: showShortcutHints
|
|
@@ -4265,7 +4697,7 @@ function DrawingToolbar({
|
|
|
4265
4697
|
key: "polygon",
|
|
4266
4698
|
label: /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
4267
4699
|
/* @__PURE__ */ jsx(Pentagon, { className: "w-4 h-4" }),
|
|
4268
|
-
|
|
4700
|
+
labels.drawPolygon,
|
|
4269
4701
|
showShortcutHints && /* @__PURE__ */ jsx("kbd", { className: "ml-auto px-1.5 py-0.5 text-xs font-mono bg-black/10 dark:bg-white/10 rounded", children: "G" })
|
|
4270
4702
|
] }),
|
|
4271
4703
|
onClick: () => onModeChange("draw_polygon")
|
|
@@ -4274,7 +4706,7 @@ function DrawingToolbar({
|
|
|
4274
4706
|
key: "rectangle",
|
|
4275
4707
|
label: /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
4276
4708
|
/* @__PURE__ */ jsx(Square, { className: "w-4 h-4" }),
|
|
4277
|
-
|
|
4709
|
+
labels.drawRectangle,
|
|
4278
4710
|
showShortcutHints && /* @__PURE__ */ jsx("kbd", { className: "ml-auto px-1.5 py-0.5 text-xs font-mono bg-black/10 dark:bg-white/10 rounded", children: "B" })
|
|
4279
4711
|
] }),
|
|
4280
4712
|
onClick: () => onModeChange("draw_rectangle")
|
|
@@ -4288,9 +4720,9 @@ function DrawingToolbar({
|
|
|
4288
4720
|
Tooltip,
|
|
4289
4721
|
{
|
|
4290
4722
|
title: showShortcutHints ? /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
4291
|
-
|
|
4723
|
+
labels.drawPolygonOrRectangle,
|
|
4292
4724
|
/* @__PURE__ */ jsx("kbd", { className: "px-1.5 py-0.5 text-xs font-mono bg-black/20 rounded", children: "G" })
|
|
4293
|
-
] }) :
|
|
4725
|
+
] }) : labels.drawPolygonOrRectangle,
|
|
4294
4726
|
placement: "right",
|
|
4295
4727
|
children: /* @__PURE__ */ jsx(
|
|
4296
4728
|
Button,
|
|
@@ -4301,7 +4733,7 @@ function DrawingToolbar({
|
|
|
4301
4733
|
"relative transition-all duration-150 flex items-center justify-center !w-9 !h-9 !min-w-0 !p-0",
|
|
4302
4734
|
(activeMode === "draw_polygon" || activeMode === "draw_rectangle") && "tool-active bg-primary/10"
|
|
4303
4735
|
),
|
|
4304
|
-
"aria-label":
|
|
4736
|
+
"aria-label": labels.drawPolygonOrRectangleAriaLabel,
|
|
4305
4737
|
"data-testid": "button-tool-polygon-menu",
|
|
4306
4738
|
icon: /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
4307
4739
|
activeMode === "draw_rectangle" ? /* @__PURE__ */ jsx(Square, { className: "w-5 h-5" }) : /* @__PURE__ */ jsx(Pentagon, { className: "w-5 h-5" }),
|
|
@@ -4322,7 +4754,7 @@ function DrawingToolbar({
|
|
|
4322
4754
|
activeMode,
|
|
4323
4755
|
onModeChange,
|
|
4324
4756
|
icon: /* @__PURE__ */ jsx(Type, { className: "w-5 h-5" }),
|
|
4325
|
-
label:
|
|
4757
|
+
label: labels.addText,
|
|
4326
4758
|
shortcut: "T",
|
|
4327
4759
|
disabled: drawingDisabled,
|
|
4328
4760
|
showShortcutHint: showShortcutHints
|
|
@@ -4335,7 +4767,7 @@ function DrawingToolbar({
|
|
|
4335
4767
|
activeMode,
|
|
4336
4768
|
onModeChange,
|
|
4337
4769
|
icon: /* @__PURE__ */ jsx(MoveRight, { className: "w-5 h-5" }),
|
|
4338
|
-
label:
|
|
4770
|
+
label: labels.drawArrow,
|
|
4339
4771
|
shortcut: "W",
|
|
4340
4772
|
disabled: drawingDisabled,
|
|
4341
4773
|
showShortcutHint: showShortcutHints
|
|
@@ -4348,7 +4780,7 @@ function DrawingToolbar({
|
|
|
4348
4780
|
activeMode,
|
|
4349
4781
|
onModeChange,
|
|
4350
4782
|
icon: /* @__PURE__ */ jsx(Circle, { className: "w-5 h-5" }),
|
|
4351
|
-
label:
|
|
4783
|
+
label: labels.drawCircle,
|
|
4352
4784
|
shortcut: "C",
|
|
4353
4785
|
disabled: drawingDisabled,
|
|
4354
4786
|
showShortcutHint: showShortcutHints
|
|
@@ -4360,9 +4792,9 @@ function DrawingToolbar({
|
|
|
4360
4792
|
Tooltip,
|
|
4361
4793
|
{
|
|
4362
4794
|
title: showShortcutHints ? /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
4363
|
-
|
|
4795
|
+
labels.undo,
|
|
4364
4796
|
/* @__PURE__ */ jsx("kbd", { className: "px-1.5 py-0.5 text-xs font-mono bg-black/20 rounded", children: "Ctrl+Z" })
|
|
4365
|
-
] }) :
|
|
4797
|
+
] }) : labels.undo,
|
|
4366
4798
|
placement: "right",
|
|
4367
4799
|
children: /* @__PURE__ */ jsx(
|
|
4368
4800
|
Button,
|
|
@@ -4370,7 +4802,7 @@ function DrawingToolbar({
|
|
|
4370
4802
|
type: "text",
|
|
4371
4803
|
onClick: onUndo,
|
|
4372
4804
|
disabled: disabled || !canUndo,
|
|
4373
|
-
"aria-label":
|
|
4805
|
+
"aria-label": labels.undo,
|
|
4374
4806
|
"data-testid": "button-undo",
|
|
4375
4807
|
className: "flex items-center justify-center !w-9 !h-9 !min-w-0 !p-0",
|
|
4376
4808
|
icon: /* @__PURE__ */ jsx(Undo2, { className: "w-5 h-5" })
|
|
@@ -4382,9 +4814,9 @@ function DrawingToolbar({
|
|
|
4382
4814
|
Tooltip,
|
|
4383
4815
|
{
|
|
4384
4816
|
title: showShortcutHints ? /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
4385
|
-
|
|
4817
|
+
labels.redo,
|
|
4386
4818
|
/* @__PURE__ */ jsx("kbd", { className: "px-1.5 py-0.5 text-xs font-mono bg-black/20 rounded", children: "Ctrl+Y" })
|
|
4387
|
-
] }) :
|
|
4819
|
+
] }) : labels.redo,
|
|
4388
4820
|
placement: "right",
|
|
4389
4821
|
children: /* @__PURE__ */ jsx(
|
|
4390
4822
|
Button,
|
|
@@ -4392,7 +4824,7 @@ function DrawingToolbar({
|
|
|
4392
4824
|
type: "text",
|
|
4393
4825
|
onClick: onRedo,
|
|
4394
4826
|
disabled: disabled || !canRedo,
|
|
4395
|
-
"aria-label":
|
|
4827
|
+
"aria-label": labels.redo,
|
|
4396
4828
|
"data-testid": "button-redo",
|
|
4397
4829
|
className: "flex items-center justify-center !w-9 !h-9 !min-w-0 !p-0",
|
|
4398
4830
|
icon: /* @__PURE__ */ jsx(Redo2, { className: "w-5 h-5" })
|
|
@@ -4408,11 +4840,9 @@ function DrawingToolbar({
|
|
|
4408
4840
|
Tooltip,
|
|
4409
4841
|
{
|
|
4410
4842
|
title: showShortcutHints ? /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
4411
|
-
|
|
4412
|
-
selectedCount,
|
|
4413
|
-
")",
|
|
4843
|
+
labels.deleteSelected(selectedCount),
|
|
4414
4844
|
/* @__PURE__ */ jsx("kbd", { className: "px-1.5 py-0.5 text-xs font-mono bg-black/20 rounded", children: "Del" })
|
|
4415
|
-
] }) :
|
|
4845
|
+
] }) : labels.deleteSelected(selectedCount),
|
|
4416
4846
|
placement: "right",
|
|
4417
4847
|
children: /* @__PURE__ */ jsx(
|
|
4418
4848
|
Button,
|
|
@@ -4421,7 +4851,7 @@ function DrawingToolbar({
|
|
|
4421
4851
|
onClick: onDeleteSelected,
|
|
4422
4852
|
disabled,
|
|
4423
4853
|
className: "text-red-500 hover:text-red-500 flex items-center justify-center !w-9 !h-9 !min-w-0 !p-0",
|
|
4424
|
-
"aria-label":
|
|
4854
|
+
"aria-label": labels.deleteSelectedAriaLabel,
|
|
4425
4855
|
"data-testid": "button-delete-selected",
|
|
4426
4856
|
icon: /* @__PURE__ */ jsx(Trash2, { className: "w-5 h-5" })
|
|
4427
4857
|
}
|
|
@@ -4438,13 +4868,13 @@ function DrawingToolbar({
|
|
|
4438
4868
|
/* @__PURE__ */ jsxs("div", { className: "p-2 border-b border-border space-y-1.5", children: [
|
|
4439
4869
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 pb-0.5", children: [
|
|
4440
4870
|
/* @__PURE__ */ jsx(Search, { className: "w-3 h-3 text-muted-foreground" }),
|
|
4441
|
-
/* @__PURE__ */ jsx("span", { className: "text-[10px] font-semibold uppercase tracking-wider text-muted-foreground", children:
|
|
4871
|
+
/* @__PURE__ */ jsx("span", { className: "text-[10px] font-semibold uppercase tracking-wider text-muted-foreground", children: searchLabels.title })
|
|
4442
4872
|
] }),
|
|
4443
4873
|
/* @__PURE__ */ jsx(
|
|
4444
4874
|
Input,
|
|
4445
4875
|
{
|
|
4446
4876
|
ref: searchInputRef,
|
|
4447
|
-
placeholder:
|
|
4877
|
+
placeholder: searchLabels.placeholder,
|
|
4448
4878
|
value: featureSearchQuery,
|
|
4449
4879
|
onChange: (e) => setFeatureSearchQuery(e.target.value),
|
|
4450
4880
|
allowClear: true,
|
|
@@ -4462,7 +4892,7 @@ function DrawingToolbar({
|
|
|
4462
4892
|
"px-2 py-0.5 text-xs rounded border-0 cursor-pointer transition-colors",
|
|
4463
4893
|
featureSearchMode === "title" ? "bg-primary text-primary-foreground" : "bg-muted hover:bg-accent text-foreground"
|
|
4464
4894
|
),
|
|
4465
|
-
children:
|
|
4895
|
+
children: searchLabels.titlesMode
|
|
4466
4896
|
}
|
|
4467
4897
|
),
|
|
4468
4898
|
/* @__PURE__ */ jsx(
|
|
@@ -4473,23 +4903,19 @@ function DrawingToolbar({
|
|
|
4473
4903
|
"px-2 py-0.5 text-xs rounded border-0 cursor-pointer transition-colors",
|
|
4474
4904
|
featureSearchMode === "json" ? "bg-primary text-primary-foreground" : "bg-muted hover:bg-accent text-foreground"
|
|
4475
4905
|
),
|
|
4476
|
-
children:
|
|
4906
|
+
children: searchLabels.fullJsonMode
|
|
4477
4907
|
}
|
|
4478
4908
|
),
|
|
4479
|
-
/* @__PURE__ */ jsx("span", { className: "ml-auto text-xs text-muted-foreground self-center", children: featureSearchQuery.trim() ?
|
|
4909
|
+
/* @__PURE__ */ jsx("span", { className: "ml-auto text-xs text-muted-foreground self-center", children: featureSearchQuery.trim() ? searchLabels.resultCount({ count: featureSearchResults.length, more: featureSearchResults.length >= 50 }) : searchLabels.totalCount(cachedFeatures.length) })
|
|
4480
4910
|
] })
|
|
4481
4911
|
] }),
|
|
4482
4912
|
/* @__PURE__ */ jsxs("div", { className: "overflow-y-auto flex-1 min-h-0", children: [
|
|
4483
|
-
featureSearchQuery.trim() && featureSearchResults.length === 0 && /* @__PURE__ */ jsx("div", { className: "p-3 text-center text-xs text-muted-foreground", children:
|
|
4484
|
-
!featureSearchQuery.trim() && /* @__PURE__ */
|
|
4485
|
-
"Type to search across ",
|
|
4486
|
-
cachedFeatures.length,
|
|
4487
|
-
" features"
|
|
4488
|
-
] }),
|
|
4913
|
+
featureSearchQuery.trim() && featureSearchResults.length === 0 && /* @__PURE__ */ jsx("div", { className: "p-3 text-center text-xs text-muted-foreground", children: searchLabels.noResults }),
|
|
4914
|
+
!featureSearchQuery.trim() && /* @__PURE__ */ jsx("div", { className: "p-3 text-center text-xs text-muted-foreground", children: searchLabels.typeToSearch(cachedFeatures.length) }),
|
|
4489
4915
|
featureSearchResults.map((feature, idx) => {
|
|
4490
|
-
var
|
|
4916
|
+
var _a2;
|
|
4491
4917
|
const label = getFeatureLabel(feature);
|
|
4492
|
-
const geomType = ((
|
|
4918
|
+
const geomType = ((_a2 = feature.geometry) == null ? void 0 : _a2.type) || searchLabels.unknownGeometry;
|
|
4493
4919
|
const props = feature.properties || {};
|
|
4494
4920
|
const subtitle = props.entityType || props.kind || geomType;
|
|
4495
4921
|
return /* @__PURE__ */ jsxs(
|
|
@@ -4514,14 +4940,14 @@ function DrawingToolbar({
|
|
|
4514
4940
|
onGoTo && /* @__PURE__ */ jsxs("div", { className: cn("p-2.5 space-y-2", onFlyToFeature && getAllFeatures && "border-t border-border"), children: [
|
|
4515
4941
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
4516
4942
|
/* @__PURE__ */ jsx(Navigation, { className: "w-3 h-3 text-muted-foreground" }),
|
|
4517
|
-
/* @__PURE__ */ jsx("span", { className: "text-[10px] font-semibold uppercase tracking-wider text-muted-foreground", children:
|
|
4943
|
+
/* @__PURE__ */ jsx("span", { className: "text-[10px] font-semibold uppercase tracking-wider text-muted-foreground", children: navigateLabels.title })
|
|
4518
4944
|
] }),
|
|
4519
4945
|
resolvedGeocoder && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4520
4946
|
/* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
|
|
4521
4947
|
/* @__PURE__ */ jsx(
|
|
4522
4948
|
Input,
|
|
4523
4949
|
{
|
|
4524
|
-
placeholder:
|
|
4950
|
+
placeholder: navigateLabels.addressPlaceholder,
|
|
4525
4951
|
value: goToAddress,
|
|
4526
4952
|
onChange: (e) => setGoToAddress(e.target.value),
|
|
4527
4953
|
onKeyDown: (e) => {
|
|
@@ -4544,25 +4970,25 @@ function DrawingToolbar({
|
|
|
4544
4970
|
className: "shrink-0",
|
|
4545
4971
|
"data-testid": "button-search-address",
|
|
4546
4972
|
icon: isSearching ? /* @__PURE__ */ jsx(Loader2, { className: "w-4 h-4 animate-spin" }) : void 0,
|
|
4547
|
-
children: isSearching ? "" :
|
|
4973
|
+
children: isSearching ? "" : navigateLabels.searchAddress
|
|
4548
4974
|
}
|
|
4549
4975
|
)
|
|
4550
4976
|
] }),
|
|
4551
4977
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
4552
4978
|
/* @__PURE__ */ jsx("div", { className: "flex-1 h-px bg-border" }),
|
|
4553
|
-
/* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground shrink-0", children:
|
|
4979
|
+
/* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground shrink-0", children: navigateLabels.orCoordinates }),
|
|
4554
4980
|
/* @__PURE__ */ jsx("div", { className: "flex-1 h-px bg-border" })
|
|
4555
4981
|
] })
|
|
4556
4982
|
] }),
|
|
4557
4983
|
/* @__PURE__ */ jsxs("div", { className: "flex gap-2 items-end", children: [
|
|
4558
4984
|
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
4559
|
-
/* @__PURE__ */ jsx("label", { className: "text-[10px] text-muted-foreground mb-0.5 block", children:
|
|
4985
|
+
/* @__PURE__ */ jsx("label", { className: "text-[10px] text-muted-foreground mb-0.5 block", children: navigateLabels.latitude }),
|
|
4560
4986
|
/* @__PURE__ */ jsx(
|
|
4561
4987
|
Input,
|
|
4562
4988
|
{
|
|
4563
4989
|
type: "number",
|
|
4564
4990
|
step: "any",
|
|
4565
|
-
placeholder:
|
|
4991
|
+
placeholder: navigateLabels.latitudePlaceholder,
|
|
4566
4992
|
value: goToLat,
|
|
4567
4993
|
onChange: (e) => setGoToLat(e.target.value),
|
|
4568
4994
|
onKeyDown: (e) => {
|
|
@@ -4574,13 +5000,13 @@ function DrawingToolbar({
|
|
|
4574
5000
|
)
|
|
4575
5001
|
] }),
|
|
4576
5002
|
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
4577
|
-
/* @__PURE__ */ jsx("label", { className: "text-[10px] text-muted-foreground mb-0.5 block", children:
|
|
5003
|
+
/* @__PURE__ */ jsx("label", { className: "text-[10px] text-muted-foreground mb-0.5 block", children: navigateLabels.longitude }),
|
|
4578
5004
|
/* @__PURE__ */ jsx(
|
|
4579
5005
|
Input,
|
|
4580
5006
|
{
|
|
4581
5007
|
type: "number",
|
|
4582
5008
|
step: "any",
|
|
4583
|
-
placeholder:
|
|
5009
|
+
placeholder: navigateLabels.longitudePlaceholder,
|
|
4584
5010
|
value: goToLng,
|
|
4585
5011
|
onChange: (e) => setGoToLng(e.target.value),
|
|
4586
5012
|
onKeyDown: (e) => {
|
|
@@ -4600,7 +5026,7 @@ function DrawingToolbar({
|
|
|
4600
5026
|
disabled: !goToLat.trim() || !goToLng.trim(),
|
|
4601
5027
|
className: "shrink-0",
|
|
4602
5028
|
"data-testid": "button-goto-navigate",
|
|
4603
|
-
children: onDropPoint ?
|
|
5029
|
+
children: onDropPoint ? navigateLabels.dropPoint : navigateLabels.goToCoordinates
|
|
4604
5030
|
}
|
|
4605
5031
|
)
|
|
4606
5032
|
] })
|
|
@@ -4717,6 +5143,18 @@ const MAP_STYLES = [
|
|
|
4717
5143
|
{ id: "satellite", name: "Satellite", icon: Satellite },
|
|
4718
5144
|
{ id: "dark", name: "Dark", icon: Map$1 }
|
|
4719
5145
|
];
|
|
5146
|
+
function builtInBasemapName(id, labels) {
|
|
5147
|
+
switch (id) {
|
|
5148
|
+
case "streets":
|
|
5149
|
+
return labels.basemapStreets;
|
|
5150
|
+
case "satellite":
|
|
5151
|
+
return labels.basemapSatellite;
|
|
5152
|
+
case "dark":
|
|
5153
|
+
return labels.basemapDark;
|
|
5154
|
+
default:
|
|
5155
|
+
return void 0;
|
|
5156
|
+
}
|
|
5157
|
+
}
|
|
4720
5158
|
const LEGEND_MAX_VALUES = 50;
|
|
4721
5159
|
const LEGEND_INITIAL_VISIBLE = 8;
|
|
4722
5160
|
function ColorByFieldLegend({
|
|
@@ -4724,6 +5162,7 @@ function ColorByFieldLegend({
|
|
|
4724
5162
|
fieldName,
|
|
4725
5163
|
getFieldValueDistribution
|
|
4726
5164
|
}) {
|
|
5165
|
+
const { layerSettings: labels } = useMapLabels();
|
|
4727
5166
|
const [expanded, setExpanded] = useState(false);
|
|
4728
5167
|
const [filter, setFilter] = useState("");
|
|
4729
5168
|
useEffect(() => {
|
|
@@ -4748,16 +5187,13 @@ function ColorByFieldLegend({
|
|
|
4748
5187
|
className: "mt-1 rounded border border-border/50 bg-background/40 p-1.5",
|
|
4749
5188
|
"data-testid": `legend-color-by-${layerId}`,
|
|
4750
5189
|
children: [
|
|
4751
|
-
/* @__PURE__ */
|
|
4752
|
-
"Legend",
|
|
4753
|
-
distribution.length >= LEGEND_MAX_VALUES ? ` (top ${LEGEND_MAX_VALUES})` : ""
|
|
4754
|
-
] }),
|
|
5190
|
+
/* @__PURE__ */ jsx("div", { className: "text-[10px] uppercase tracking-wide text-muted-foreground mb-1", children: distribution.length >= LEGEND_MAX_VALUES ? labels.legendTop(LEGEND_MAX_VALUES) : labels.legend }),
|
|
4755
5191
|
(distribution.length > LEGEND_INITIAL_VISIBLE || expanded) && /* @__PURE__ */ jsx(
|
|
4756
5192
|
Input,
|
|
4757
5193
|
{
|
|
4758
5194
|
size: "small",
|
|
4759
5195
|
allowClear: true,
|
|
4760
|
-
placeholder:
|
|
5196
|
+
placeholder: labels.filterValues,
|
|
4761
5197
|
value: filter,
|
|
4762
5198
|
onChange: (e) => setFilter(e.target.value),
|
|
4763
5199
|
className: "mb-1 !text-[11px]",
|
|
@@ -4784,7 +5220,7 @@ function ColorByFieldLegend({
|
|
|
4784
5220
|
},
|
|
4785
5221
|
value
|
|
4786
5222
|
)),
|
|
4787
|
-
visible.length === 0 && /* @__PURE__ */ jsx("div", { className: "text-[11px] text-muted-foreground italic", children:
|
|
5223
|
+
visible.length === 0 && /* @__PURE__ */ jsx("div", { className: "text-[11px] text-muted-foreground italic", children: labels.noMatches })
|
|
4788
5224
|
] }),
|
|
4789
5225
|
(hiddenCount > 0 || expanded && filtered.length > LEGEND_INITIAL_VISIBLE) && /* @__PURE__ */ jsx(
|
|
4790
5226
|
"button",
|
|
@@ -4793,7 +5229,7 @@ function ColorByFieldLegend({
|
|
|
4793
5229
|
className: "mt-1 text-[11px] text-primary hover:underline",
|
|
4794
5230
|
onClick: () => setExpanded((e) => !e),
|
|
4795
5231
|
"data-testid": `legend-toggle-${layerId}`,
|
|
4796
|
-
children: expanded ?
|
|
5232
|
+
children: expanded ? labels.showLess : labels.showAll(filtered.length)
|
|
4797
5233
|
}
|
|
4798
5234
|
)
|
|
4799
5235
|
]
|
|
@@ -4806,6 +5242,7 @@ function ColorGradientLegend({
|
|
|
4806
5242
|
max,
|
|
4807
5243
|
sampled
|
|
4808
5244
|
}) {
|
|
5245
|
+
const { layerSettings: labels } = useMapLabels();
|
|
4809
5246
|
const degenerate = min === max;
|
|
4810
5247
|
return /* @__PURE__ */ jsxs(
|
|
4811
5248
|
"div",
|
|
@@ -4813,10 +5250,7 @@ function ColorGradientLegend({
|
|
|
4813
5250
|
className: "mt-1 rounded border border-border/50 bg-background/40 p-1.5",
|
|
4814
5251
|
"data-testid": `legend-gradient-${layerId}`,
|
|
4815
5252
|
children: [
|
|
4816
|
-
/* @__PURE__ */
|
|
4817
|
-
"Legend",
|
|
4818
|
-
sampled ? " (sampled)" : ""
|
|
4819
|
-
] }),
|
|
5253
|
+
/* @__PURE__ */ jsx("div", { className: "text-[10px] uppercase tracking-wide text-muted-foreground mb-1", children: sampled ? labels.legendSampled : labels.legend }),
|
|
4820
5254
|
/* @__PURE__ */ jsx(
|
|
4821
5255
|
"div",
|
|
4822
5256
|
{
|
|
@@ -4883,6 +5317,13 @@ function LayersPanel({
|
|
|
4883
5317
|
layerBadgeProvider,
|
|
4884
5318
|
featureCountProvider
|
|
4885
5319
|
}) {
|
|
5320
|
+
const {
|
|
5321
|
+
canvas: canvasLabels,
|
|
5322
|
+
layersPanel: labels,
|
|
5323
|
+
layerSettings: settingsLabels,
|
|
5324
|
+
mapOptions: optionsLabels
|
|
5325
|
+
} = useMapLabels();
|
|
5326
|
+
const shownName = useCallback((layer) => shownLayerName(layer, canvasLabels), [canvasLabels]);
|
|
4886
5327
|
const confirm = useConfirm();
|
|
4887
5328
|
const [editingLayerId, setEditingLayerId] = useState(null);
|
|
4888
5329
|
const [editingName, setEditingName] = useState("");
|
|
@@ -4933,15 +5374,17 @@ function LayersPanel({
|
|
|
4933
5374
|
}, [layers]);
|
|
4934
5375
|
const handleStartEdit = useCallback((layer) => {
|
|
4935
5376
|
setEditingLayerId(layer.id);
|
|
4936
|
-
setEditingName(layer
|
|
4937
|
-
}, []);
|
|
5377
|
+
setEditingName(shownName(layer));
|
|
5378
|
+
}, [shownName]);
|
|
4938
5379
|
const handleSaveEdit = useCallback(() => {
|
|
4939
|
-
|
|
5380
|
+
const edited = layers.find((l) => l.id === editingLayerId);
|
|
5381
|
+
const unchangedDefault = edited !== void 0 && edited.name !== shownName(edited) && editingName.trim() === shownName(edited);
|
|
5382
|
+
if (editingLayerId && editingName.trim() && !unchangedDefault) {
|
|
4940
5383
|
onRenameLayer(editingLayerId, editingName.trim());
|
|
4941
5384
|
}
|
|
4942
5385
|
setEditingLayerId(null);
|
|
4943
5386
|
setEditingName("");
|
|
4944
|
-
}, [editingLayerId, editingName, onRenameLayer]);
|
|
5387
|
+
}, [layers, editingLayerId, editingName, onRenameLayer, shownName]);
|
|
4945
5388
|
const handleCancelEdit = useCallback(() => {
|
|
4946
5389
|
setEditingLayerId(null);
|
|
4947
5390
|
setEditingName("");
|
|
@@ -4964,14 +5407,14 @@ function LayersPanel({
|
|
|
4964
5407
|
}, [selectedFeatureIds, onMoveFeatureToLayer]);
|
|
4965
5408
|
const handleDeleteLayer = useCallback((layer) => {
|
|
4966
5409
|
confirm({
|
|
4967
|
-
title:
|
|
4968
|
-
content:
|
|
4969
|
-
okText:
|
|
5410
|
+
title: labels.deleteLayerConfirmTitle(shownName(layer)),
|
|
5411
|
+
content: labels.deleteLayerConfirmContent,
|
|
5412
|
+
okText: labels.deleteLayerConfirmOk,
|
|
4970
5413
|
okButtonProps: { danger: true },
|
|
4971
|
-
cancelText:
|
|
5414
|
+
cancelText: labels.deleteLayerConfirmCancel,
|
|
4972
5415
|
onOk: () => onRemoveLayer(layer.id)
|
|
4973
5416
|
});
|
|
4974
|
-
}, [confirm, onRemoveLayer]);
|
|
5417
|
+
}, [confirm, onRemoveLayer, labels, shownName]);
|
|
4975
5418
|
const renderLayerItem = (layer) => {
|
|
4976
5419
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa;
|
|
4977
5420
|
const customCount = featureCountProvider == null ? void 0 : featureCountProvider(layer.id);
|
|
@@ -5007,12 +5450,12 @@ function LayersPanel({
|
|
|
5007
5450
|
}
|
|
5008
5451
|
),
|
|
5009
5452
|
layer.readOnly ? /* @__PURE__ */ jsx(Tooltip, { title: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5010
|
-
/* @__PURE__ */ jsx("p", { className: "font-medium", children:
|
|
5011
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children:
|
|
5453
|
+
/* @__PURE__ */ jsx("p", { className: "font-medium", children: labels.hpLayerTitle }),
|
|
5454
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: labels.hpLayerDescription })
|
|
5012
5455
|
] }), children: /* @__PURE__ */ jsxs("div", { className: "h-7 w-6 flex items-center justify-center relative", children: [
|
|
5013
5456
|
/* @__PURE__ */ jsx(Lock, { className: "w-4 h-4 text-muted-foreground" }),
|
|
5014
5457
|
/* @__PURE__ */ jsx("span", { className: "absolute -top-0.5 -right-0.5 w-2.5 h-2.5 bg-green-500 rounded-full" })
|
|
5015
|
-
] }) }) : /* @__PURE__ */ jsx(Tooltip, { title: isActiveEditing ?
|
|
5458
|
+
] }) }) : /* @__PURE__ */ jsx(Tooltip, { title: isActiveEditing ? labels.editingThisLayer : labels.clickToEditLayer, children: /* @__PURE__ */ jsx(
|
|
5016
5459
|
Button,
|
|
5017
5460
|
{
|
|
5018
5461
|
type: "text",
|
|
@@ -5055,22 +5498,19 @@ function LayersPanel({
|
|
|
5055
5498
|
"data-testid": `layer-color-${layer.id}`
|
|
5056
5499
|
}
|
|
5057
5500
|
),
|
|
5058
|
-
/* @__PURE__ */ jsx(Tooltip, { title: layer
|
|
5501
|
+
/* @__PURE__ */ jsx(Tooltip, { title: shownName(layer), children: /* @__PURE__ */ jsx(
|
|
5059
5502
|
"button",
|
|
5060
5503
|
{
|
|
5061
5504
|
onClick: () => handleStartEdit(layer),
|
|
5062
5505
|
className: "text-left truncate px-1 min-w-0 text-base",
|
|
5063
5506
|
"data-testid": `button-layer-name-${layer.id}`,
|
|
5064
|
-
children: layer
|
|
5507
|
+
children: shownName(layer)
|
|
5065
5508
|
}
|
|
5066
5509
|
) }),
|
|
5067
5510
|
layerBadgeProvider == null ? void 0 : layerBadgeProvider(layer),
|
|
5068
5511
|
!externalPersistence && getLayerUnsavedCount && (() => {
|
|
5069
5512
|
const totalUnsaved = getLayerUnsavedCount(layer.id);
|
|
5070
|
-
return totalUnsaved > 0 ? /* @__PURE__ */
|
|
5071
|
-
totalUnsaved,
|
|
5072
|
-
" unsaved"
|
|
5073
|
-
] }) : null;
|
|
5513
|
+
return totalUnsaved > 0 ? /* @__PURE__ */ jsx(Tag, { color: "orange", className: "!text-[10px] !px-1 !py-0 !leading-4 !border-0 shrink-0", children: labels.unsavedCount(totalUnsaved) }) : null;
|
|
5074
5514
|
})()
|
|
5075
5515
|
] }),
|
|
5076
5516
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 shrink-0", children: [
|
|
@@ -5085,13 +5525,13 @@ function LayersPanel({
|
|
|
5085
5525
|
{
|
|
5086
5526
|
key: "load-desktop",
|
|
5087
5527
|
icon: /* @__PURE__ */ jsx(Upload, { className: "w-[18px] h-[18px]" }),
|
|
5088
|
-
label:
|
|
5528
|
+
label: labels.loadGeojson,
|
|
5089
5529
|
onClick: () => onLoadLayerGeoJSON(layer.id)
|
|
5090
5530
|
},
|
|
5091
5531
|
{
|
|
5092
5532
|
key: "save-desktop",
|
|
5093
5533
|
icon: /* @__PURE__ */ jsx(Download, { className: "w-[18px] h-[18px]" }),
|
|
5094
|
-
label:
|
|
5534
|
+
label: labels.saveGeojson,
|
|
5095
5535
|
onClick: () => {
|
|
5096
5536
|
void onSaveLayerGeoJSON(layer.id);
|
|
5097
5537
|
}
|
|
@@ -5104,7 +5544,7 @@ function LayersPanel({
|
|
|
5104
5544
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
5105
5545
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
5106
5546
|
/* @__PURE__ */ jsx(Type, { className: "w-[18px] h-[18px]" }),
|
|
5107
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm", children:
|
|
5547
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm", children: labels.neverHideLabels })
|
|
5108
5548
|
] }),
|
|
5109
5549
|
/* @__PURE__ */ jsx(
|
|
5110
5550
|
Switch,
|
|
@@ -5127,7 +5567,7 @@ function LayersPanel({
|
|
|
5127
5567
|
}
|
|
5128
5568
|
)
|
|
5129
5569
|
] }),
|
|
5130
|
-
/* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground mt-1", children: ((_h = (_g = layer.visualConfig) == null ? void 0 : _g.label) == null ? void 0 : _h.hidden) ?
|
|
5570
|
+
/* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground mt-1", children: ((_h = (_g = layer.visualConfig) == null ? void 0 : _g.label) == null ? void 0 : _h.hidden) ? labels.labelsOffForLayer : labels.neverHideLabelsHint })
|
|
5131
5571
|
] })
|
|
5132
5572
|
}
|
|
5133
5573
|
] : [],
|
|
@@ -5136,7 +5576,7 @@ function LayersPanel({
|
|
|
5136
5576
|
{
|
|
5137
5577
|
key: "fit",
|
|
5138
5578
|
icon: /* @__PURE__ */ jsx(Focus, { className: "w-[18px] h-[18px]" }),
|
|
5139
|
-
label:
|
|
5579
|
+
label: labels.fitMapToLayer,
|
|
5140
5580
|
onClick: () => onFitToLayerFeatures(layer.id)
|
|
5141
5581
|
}
|
|
5142
5582
|
] : [],
|
|
@@ -5146,7 +5586,7 @@ function LayersPanel({
|
|
|
5146
5586
|
{
|
|
5147
5587
|
key: "delete",
|
|
5148
5588
|
icon: /* @__PURE__ */ jsx(Trash2, { className: "w-[18px] h-[18px]" }),
|
|
5149
|
-
label:
|
|
5589
|
+
label: labels.deleteLayer,
|
|
5150
5590
|
danger: true,
|
|
5151
5591
|
onClick: () => handleDeleteLayer(layer)
|
|
5152
5592
|
}
|
|
@@ -5169,7 +5609,7 @@ function LayersPanel({
|
|
|
5169
5609
|
}
|
|
5170
5610
|
),
|
|
5171
5611
|
isExpanded && /* @__PURE__ */ jsxs("div", { className: "pl-2 border-l border-border space-y-1.5 py-1.5 ml-[8px] mr-[8px]", children: [
|
|
5172
|
-
selectedFeatureIds.length > 0 && !layer.readOnly && /* @__PURE__ */
|
|
5612
|
+
selectedFeatureIds.length > 0 && !layer.readOnly && /* @__PURE__ */ jsx(
|
|
5173
5613
|
Button,
|
|
5174
5614
|
{
|
|
5175
5615
|
type: "default",
|
|
@@ -5177,15 +5617,11 @@ function LayersPanel({
|
|
|
5177
5617
|
onClick: () => handleMoveSelectedToLayer(layer.id),
|
|
5178
5618
|
className: "w-full text-xs",
|
|
5179
5619
|
"data-testid": `button-move-to-layer-${layer.id}`,
|
|
5180
|
-
children:
|
|
5181
|
-
"Move ",
|
|
5182
|
-
selectedFeatureIds.length,
|
|
5183
|
-
" selected here"
|
|
5184
|
-
]
|
|
5620
|
+
children: labels.moveSelectedHere(selectedFeatureIds.length)
|
|
5185
5621
|
}
|
|
5186
5622
|
),
|
|
5187
5623
|
(hasPointFeatures == null ? void 0 : hasPointFeatures(layer.id)) && !((_i = layer.metadata) == null ? void 0 : _i.hidePointFeatures) && /* @__PURE__ */ jsxs("div", { className: "space-y-1 p-1.5 bg-muted/30 rounded-md", children: [
|
|
5188
|
-
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-1.5 text-xs font-medium", children: /* @__PURE__ */ jsx("span", { children:
|
|
5624
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-1.5 text-xs font-medium", children: /* @__PURE__ */ jsx("span", { children: settingsLabels.pointFeatures }) }),
|
|
5189
5625
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
5190
5626
|
/* @__PURE__ */ jsx(
|
|
5191
5627
|
Switch,
|
|
@@ -5201,7 +5637,7 @@ function LayersPanel({
|
|
|
5201
5637
|
"data-testid": `switch-trace-${layer.id}`
|
|
5202
5638
|
}
|
|
5203
5639
|
),
|
|
5204
|
-
/* @__PURE__ */ jsx("span", { className: "text-xs", children:
|
|
5640
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs", children: settingsLabels.traceLines })
|
|
5205
5641
|
] }),
|
|
5206
5642
|
((_k = layer.traceConfig) == null ? void 0 : _k.enabled) && /* @__PURE__ */ jsx(
|
|
5207
5643
|
Select,
|
|
@@ -5216,8 +5652,8 @@ function LayersPanel({
|
|
|
5216
5652
|
showSearch: true,
|
|
5217
5653
|
optionFilterProp: "label",
|
|
5218
5654
|
options: [
|
|
5219
|
-
{ value: "all", label:
|
|
5220
|
-
...getAvailableTraceFields(layer.id).map((f) => ({ value: f, label:
|
|
5655
|
+
{ value: "all", label: settingsLabels.connectAllPoints },
|
|
5656
|
+
...getAvailableTraceFields(layer.id).map((f) => ({ value: f, label: settingsLabels.groupBy(f) }))
|
|
5221
5657
|
],
|
|
5222
5658
|
"data-testid": `select-trace-field-${layer.id}`
|
|
5223
5659
|
}
|
|
@@ -5241,11 +5677,11 @@ function LayersPanel({
|
|
|
5241
5677
|
"data-testid": `switch-heatmap-${layer.id}`
|
|
5242
5678
|
}
|
|
5243
5679
|
),
|
|
5244
|
-
/* @__PURE__ */ jsx("span", { className: "text-xs", children:
|
|
5680
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs", children: settingsLabels.heatmap })
|
|
5245
5681
|
] }),
|
|
5246
5682
|
((_m = layer.heatmapConfig) == null ? void 0 : _m.enabled) && /* @__PURE__ */ jsxs("div", { className: "space-y-1 pl-4", children: [
|
|
5247
5683
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
5248
|
-
/* @__PURE__ */ jsx("span", { className: "text-[10px] w-12", children:
|
|
5684
|
+
/* @__PURE__ */ jsx("span", { className: "text-[10px] w-12", children: settingsLabels.intensity }),
|
|
5249
5685
|
/* @__PURE__ */ jsx(
|
|
5250
5686
|
Slider,
|
|
5251
5687
|
{
|
|
@@ -5262,7 +5698,7 @@ function LayersPanel({
|
|
|
5262
5698
|
)
|
|
5263
5699
|
] }),
|
|
5264
5700
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
5265
|
-
/* @__PURE__ */ jsx("span", { className: "text-[10px] w-12", children:
|
|
5701
|
+
/* @__PURE__ */ jsx("span", { className: "text-[10px] w-12", children: settingsLabels.radius }),
|
|
5266
5702
|
/* @__PURE__ */ jsx(
|
|
5267
5703
|
Slider,
|
|
5268
5704
|
{
|
|
@@ -5300,7 +5736,7 @@ function LayersPanel({
|
|
|
5300
5736
|
"data-testid": `switch-cluster-${layer.id}`
|
|
5301
5737
|
}
|
|
5302
5738
|
),
|
|
5303
|
-
/* @__PURE__ */ jsx("span", { className: "text-xs", children:
|
|
5739
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs", children: settingsLabels.clustering })
|
|
5304
5740
|
] }),
|
|
5305
5741
|
((_o = layer.clusterConfig) == null ? void 0 : _o.enabled) && getLayerFields && /* @__PURE__ */ jsxs("div", { className: "space-y-1 pl-4", children: [
|
|
5306
5742
|
/* @__PURE__ */ jsx(
|
|
@@ -5316,8 +5752,8 @@ function LayersPanel({
|
|
|
5316
5752
|
showSearch: true,
|
|
5317
5753
|
optionFilterProp: "label",
|
|
5318
5754
|
options: [
|
|
5319
|
-
{ value: "count", label:
|
|
5320
|
-
...getLayerFields(layer.id).filter((f) => !f.isNumeric).map((f) => ({ value: f.name, label:
|
|
5755
|
+
{ value: "count", label: settingsLabels.simpleCount },
|
|
5756
|
+
...getLayerFields(layer.id).filter((f) => !f.isNumeric).map((f) => ({ value: f.name, label: settingsLabels.pieBy(f.name) }))
|
|
5321
5757
|
],
|
|
5322
5758
|
"data-testid": `select-cluster-field-${layer.id}`
|
|
5323
5759
|
}
|
|
@@ -5334,7 +5770,7 @@ function LayersPanel({
|
|
|
5334
5770
|
})
|
|
5335
5771
|
}
|
|
5336
5772
|
),
|
|
5337
|
-
/* @__PURE__ */ jsx("span", { className: "text-[10px]", children:
|
|
5773
|
+
/* @__PURE__ */ jsx("span", { className: "text-[10px]", children: settingsLabels.showPointDots })
|
|
5338
5774
|
] }),
|
|
5339
5775
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
5340
5776
|
/* @__PURE__ */ jsx(
|
|
@@ -5349,7 +5785,7 @@ function LayersPanel({
|
|
|
5349
5785
|
"data-testid": `switch-cluster-count-by-${layer.id}`
|
|
5350
5786
|
}
|
|
5351
5787
|
),
|
|
5352
|
-
/* @__PURE__ */ jsx("span", { className: "text-[10px]", children:
|
|
5788
|
+
/* @__PURE__ */ jsx("span", { className: "text-[10px]", children: settingsLabels.countByField })
|
|
5353
5789
|
] }),
|
|
5354
5790
|
layer.clusterConfig.countByFieldEnabled && /* @__PURE__ */ jsx(
|
|
5355
5791
|
Select,
|
|
@@ -5361,7 +5797,7 @@ function LayersPanel({
|
|
|
5361
5797
|
countByField: val
|
|
5362
5798
|
}),
|
|
5363
5799
|
className: "w-full text-xs",
|
|
5364
|
-
placeholder:
|
|
5800
|
+
placeholder: settingsLabels.selectNumericField,
|
|
5365
5801
|
showSearch: true,
|
|
5366
5802
|
optionFilterProp: "label",
|
|
5367
5803
|
options: getLayerFields(layer.id).filter((f) => f.isNumeric).map((f) => ({ value: f.name, label: f.name })),
|
|
@@ -5381,7 +5817,7 @@ function LayersPanel({
|
|
|
5381
5817
|
"data-testid": `switch-cluster-gradient-${layer.id}`
|
|
5382
5818
|
}
|
|
5383
5819
|
),
|
|
5384
|
-
/* @__PURE__ */ jsx("span", { className: "text-[10px]", children:
|
|
5820
|
+
/* @__PURE__ */ jsx("span", { className: "text-[10px]", children: settingsLabels.colorBubblesByValue })
|
|
5385
5821
|
] })
|
|
5386
5822
|
] })
|
|
5387
5823
|
] })
|
|
@@ -5389,7 +5825,7 @@ function LayersPanel({
|
|
|
5389
5825
|
layer.hasAltitudeData && onUpdateAltitudeDisplayMode && /* @__PURE__ */ jsxs("div", { className: "space-y-1 p-1.5 bg-muted/30 rounded-md", children: [
|
|
5390
5826
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 text-xs font-medium", children: [
|
|
5391
5827
|
/* @__PURE__ */ jsx(Box, { className: "w-3.5 h-3.5" }),
|
|
5392
|
-
/* @__PURE__ */ jsx("span", { children:
|
|
5828
|
+
/* @__PURE__ */ jsx("span", { children: settingsLabels.altitudeDisplay })
|
|
5393
5829
|
] }),
|
|
5394
5830
|
/* @__PURE__ */ jsx(
|
|
5395
5831
|
Select,
|
|
@@ -5399,20 +5835,20 @@ function LayersPanel({
|
|
|
5399
5835
|
onChange: (val) => onUpdateAltitudeDisplayMode(layer.id, val),
|
|
5400
5836
|
className: "w-full text-xs",
|
|
5401
5837
|
options: [
|
|
5402
|
-
{ value: "3d", label:
|
|
5403
|
-
{ value: "flat", label:
|
|
5404
|
-
{ value: "both", label:
|
|
5838
|
+
{ value: "3d", label: settingsLabels.altitude3d },
|
|
5839
|
+
{ value: "flat", label: settingsLabels.altitudeFlat },
|
|
5840
|
+
{ value: "both", label: settingsLabels.altitudeBoth }
|
|
5405
5841
|
],
|
|
5406
5842
|
"data-testid": `select-altitude-mode-${layer.id}`
|
|
5407
5843
|
}
|
|
5408
5844
|
)
|
|
5409
5845
|
] }),
|
|
5410
5846
|
onUpdateVisualConfig && getLayerFields && /* @__PURE__ */ jsxs("div", { className: "space-y-1.5 p-1.5 bg-muted/30 rounded-md", children: [
|
|
5411
|
-
/* @__PURE__ */ jsx("div", { className: "text-sm font-medium", children:
|
|
5847
|
+
/* @__PURE__ */ jsx("div", { className: "text-sm font-medium", children: settingsLabels.visualSettings }),
|
|
5412
5848
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
5413
5849
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 text-sm text-muted-foreground", children: [
|
|
5414
5850
|
/* @__PURE__ */ jsx(Type, { className: "w-3.5 h-3.5" }),
|
|
5415
|
-
/* @__PURE__ */ jsx("span", { children:
|
|
5851
|
+
/* @__PURE__ */ jsx("span", { children: settingsLabels.labels })
|
|
5416
5852
|
] }),
|
|
5417
5853
|
/* @__PURE__ */ jsx(
|
|
5418
5854
|
Switch,
|
|
@@ -5445,9 +5881,9 @@ function LayersPanel({
|
|
|
5445
5881
|
},
|
|
5446
5882
|
className: "w-full text-sm",
|
|
5447
5883
|
options: [
|
|
5448
|
-
{ value: "standard", label:
|
|
5449
|
-
{ value: "field", label:
|
|
5450
|
-
{ value: "fixed", label:
|
|
5884
|
+
{ value: "standard", label: settingsLabels.labelFromName },
|
|
5885
|
+
{ value: "field", label: settingsLabels.labelFromField },
|
|
5886
|
+
{ value: "fixed", label: settingsLabels.labelFixedText }
|
|
5451
5887
|
],
|
|
5452
5888
|
"data-testid": `select-label-mode-${layer.id}`
|
|
5453
5889
|
}
|
|
@@ -5465,7 +5901,7 @@ function LayersPanel({
|
|
|
5465
5901
|
});
|
|
5466
5902
|
},
|
|
5467
5903
|
className: "w-full text-sm",
|
|
5468
|
-
placeholder:
|
|
5904
|
+
placeholder: settingsLabels.selectField,
|
|
5469
5905
|
showSearch: true,
|
|
5470
5906
|
optionFilterProp: "label",
|
|
5471
5907
|
options: getLayerFields(layer.id).map((f) => ({ value: f.name, label: f.name })),
|
|
@@ -5484,14 +5920,14 @@ function LayersPanel({
|
|
|
5484
5920
|
label: { ...(_a2 = layer.visualConfig) == null ? void 0 : _a2.label, mode: "fixed", fixedText: e.target.value }
|
|
5485
5921
|
});
|
|
5486
5922
|
},
|
|
5487
|
-
placeholder:
|
|
5923
|
+
placeholder: settingsLabels.enterLabelText,
|
|
5488
5924
|
className: "text-sm",
|
|
5489
5925
|
"data-testid": `input-label-text-${layer.id}`
|
|
5490
5926
|
}
|
|
5491
5927
|
),
|
|
5492
5928
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 text-sm text-muted-foreground pt-0.5", children: [
|
|
5493
5929
|
/* @__PURE__ */ jsx("span", { className: "w-3.5 h-3.5 text-center", children: "S" }),
|
|
5494
|
-
/* @__PURE__ */ jsx("span", { children:
|
|
5930
|
+
/* @__PURE__ */ jsx("span", { children: settingsLabels.size })
|
|
5495
5931
|
] }),
|
|
5496
5932
|
/* @__PURE__ */ jsx(
|
|
5497
5933
|
Select,
|
|
@@ -5504,9 +5940,9 @@ function LayersPanel({
|
|
|
5504
5940
|
}),
|
|
5505
5941
|
className: "w-full text-sm",
|
|
5506
5942
|
options: [
|
|
5507
|
-
{ value: "standard", label:
|
|
5508
|
-
{ value: "field", label:
|
|
5509
|
-
{ value: "override", label:
|
|
5943
|
+
{ value: "standard", label: settingsLabels.defaultSize },
|
|
5944
|
+
{ value: "field", label: settingsLabels.sizeByField },
|
|
5945
|
+
{ value: "override", label: settingsLabels.overrideSize }
|
|
5510
5946
|
],
|
|
5511
5947
|
"data-testid": `select-size-mode-${layer.id}`
|
|
5512
5948
|
}
|
|
@@ -5521,7 +5957,7 @@ function LayersPanel({
|
|
|
5521
5957
|
size: { mode: "field", fieldName: val }
|
|
5522
5958
|
}),
|
|
5523
5959
|
className: "w-full text-sm",
|
|
5524
|
-
placeholder:
|
|
5960
|
+
placeholder: settingsLabels.selectNumericField,
|
|
5525
5961
|
showSearch: true,
|
|
5526
5962
|
optionFilterProp: "label",
|
|
5527
5963
|
options: getLayerFields(layer.id).filter((f) => f.isNumeric).map((f) => ({ value: f.name, label: f.name })),
|
|
@@ -5547,7 +5983,7 @@ function LayersPanel({
|
|
|
5547
5983
|
] }),
|
|
5548
5984
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 text-sm text-muted-foreground pt-0.5", children: [
|
|
5549
5985
|
/* @__PURE__ */ jsx("span", { className: "w-3.5 h-3.5 rounded-full bg-current" }),
|
|
5550
|
-
/* @__PURE__ */ jsx("span", { children:
|
|
5986
|
+
/* @__PURE__ */ jsx("span", { children: settingsLabels.color })
|
|
5551
5987
|
] }),
|
|
5552
5988
|
/* @__PURE__ */ jsx(
|
|
5553
5989
|
Select,
|
|
@@ -5560,9 +5996,9 @@ function LayersPanel({
|
|
|
5560
5996
|
}),
|
|
5561
5997
|
className: "w-full text-sm",
|
|
5562
5998
|
options: [
|
|
5563
|
-
{ value: "standard", label:
|
|
5564
|
-
{ value: "field", label:
|
|
5565
|
-
{ value: "fixed", label:
|
|
5999
|
+
{ value: "standard", label: settingsLabels.useFeatureColor },
|
|
6000
|
+
{ value: "field", label: settingsLabels.colorByField },
|
|
6001
|
+
{ value: "fixed", label: settingsLabels.fixedColor }
|
|
5566
6002
|
],
|
|
5567
6003
|
"data-testid": `select-color-mode-${layer.id}`
|
|
5568
6004
|
}
|
|
@@ -5588,7 +6024,7 @@ function LayersPanel({
|
|
|
5588
6024
|
color: { mode: "field", fieldName: val, scale: defaultColorScaleForField(fields.find((f) => f.name === val)) }
|
|
5589
6025
|
}),
|
|
5590
6026
|
className: "w-full text-sm",
|
|
5591
|
-
placeholder:
|
|
6027
|
+
placeholder: settingsLabels.selectField,
|
|
5592
6028
|
showSearch: true,
|
|
5593
6029
|
optionFilterProp: "label",
|
|
5594
6030
|
options: fields.map((f) => ({ value: f.name, label: f.name })),
|
|
@@ -5609,8 +6045,8 @@ function LayersPanel({
|
|
|
5609
6045
|
});
|
|
5610
6046
|
},
|
|
5611
6047
|
options: [
|
|
5612
|
-
{ label:
|
|
5613
|
-
{ label:
|
|
6048
|
+
{ label: settingsLabels.categories, value: "categorical" },
|
|
6049
|
+
{ label: settingsLabels.gradient, value: "gradient", disabled: !fieldHasNumeric && scale !== "gradient" }
|
|
5614
6050
|
],
|
|
5615
6051
|
"data-testid": `segmented-color-scale-${layer.id}`
|
|
5616
6052
|
}
|
|
@@ -5653,7 +6089,7 @@ function LayersPanel({
|
|
|
5653
6089
|
(hasPointFeatures == null ? void 0 : hasPointFeatures(layer.id)) && !((_X = layer.metadata) == null ? void 0 : _X.hidePointFeatures) && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5654
6090
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 text-sm text-muted-foreground pt-0.5", children: [
|
|
5655
6091
|
/* @__PURE__ */ jsx(Smile, { className: "w-3.5 h-3.5" }),
|
|
5656
|
-
/* @__PURE__ */ jsx("span", { children:
|
|
6092
|
+
/* @__PURE__ */ jsx("span", { children: settingsLabels.pointIcon })
|
|
5657
6093
|
] }),
|
|
5658
6094
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
5659
6095
|
/* @__PURE__ */ jsx(
|
|
@@ -5731,7 +6167,7 @@ function LayersPanel({
|
|
|
5731
6167
|
/* @__PURE__ */ jsxs("div", { className: "px-2 pt-2.5 pb-2 border-b border-border shrink-0", children: [
|
|
5732
6168
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
5733
6169
|
/* @__PURE__ */ jsx(Map$1, { className: "w-5 h-5 text-muted-foreground" }),
|
|
5734
|
-
/* @__PURE__ */ jsx("h3", { className: "text-[16px] font-semibold flex-1 !m-0 leading-tight", children:
|
|
6170
|
+
/* @__PURE__ */ jsx("h3", { className: "text-[16px] font-semibold flex-1 !m-0 leading-tight", children: optionsLabels.title }),
|
|
5735
6171
|
/* @__PURE__ */ jsx(
|
|
5736
6172
|
Dropdown,
|
|
5737
6173
|
{
|
|
@@ -5742,18 +6178,18 @@ function LayersPanel({
|
|
|
5742
6178
|
{
|
|
5743
6179
|
key: "load-geojson",
|
|
5744
6180
|
icon: /* @__PURE__ */ jsx(Upload, { className: "w-4 h-4" }),
|
|
5745
|
-
label:
|
|
6181
|
+
label: optionsLabels.uploadMap,
|
|
5746
6182
|
onClick: onLoadNewLayerGeoJSON
|
|
5747
6183
|
},
|
|
5748
6184
|
...onWorkspaceLoad ? [{
|
|
5749
6185
|
key: "load-workspace",
|
|
5750
6186
|
icon: /* @__PURE__ */ jsx(FolderOpen, { className: "w-4 h-4" }),
|
|
5751
|
-
label:
|
|
6187
|
+
label: optionsLabels.loadFromWorkspace,
|
|
5752
6188
|
onClick: () => onWorkspaceLoad()
|
|
5753
6189
|
}] : []
|
|
5754
6190
|
]
|
|
5755
6191
|
},
|
|
5756
|
-
children: /* @__PURE__ */ jsx(Tooltip, { title:
|
|
6192
|
+
children: /* @__PURE__ */ jsx(Tooltip, { title: optionsLabels.load, children: /* @__PURE__ */ jsx(
|
|
5757
6193
|
Button,
|
|
5758
6194
|
{
|
|
5759
6195
|
type: "text",
|
|
@@ -5774,7 +6210,7 @@ function LayersPanel({
|
|
|
5774
6210
|
{
|
|
5775
6211
|
key: "save-geojson",
|
|
5776
6212
|
icon: /* @__PURE__ */ jsx(Download, { className: "w-4 h-4" }),
|
|
5777
|
-
label:
|
|
6213
|
+
label: optionsLabels.downloadMap,
|
|
5778
6214
|
onClick: () => {
|
|
5779
6215
|
void onSaveAllGeoJSON();
|
|
5780
6216
|
}
|
|
@@ -5782,12 +6218,12 @@ function LayersPanel({
|
|
|
5782
6218
|
...onWorkspaceSave ? [{
|
|
5783
6219
|
key: "save-workspace",
|
|
5784
6220
|
icon: /* @__PURE__ */ jsx(FolderOpen, { className: "w-4 h-4" }),
|
|
5785
|
-
label:
|
|
6221
|
+
label: optionsLabels.saveToWorkspace,
|
|
5786
6222
|
onClick: () => onWorkspaceSave()
|
|
5787
6223
|
}] : []
|
|
5788
6224
|
]
|
|
5789
6225
|
},
|
|
5790
|
-
children: /* @__PURE__ */ jsx(Tooltip, { title:
|
|
6226
|
+
children: /* @__PURE__ */ jsx(Tooltip, { title: optionsLabels.save, children: /* @__PURE__ */ jsx(
|
|
5791
6227
|
Button,
|
|
5792
6228
|
{
|
|
5793
6229
|
type: "text",
|
|
@@ -5812,7 +6248,7 @@ function LayersPanel({
|
|
|
5812
6248
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-1.5 mb-1.5", children: [
|
|
5813
6249
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
5814
6250
|
/* @__PURE__ */ jsx(Type, { className: "w-4 h-4 text-muted-foreground" }),
|
|
5815
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm", children:
|
|
6251
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm", children: optionsLabels.autoShowLabels })
|
|
5816
6252
|
] }),
|
|
5817
6253
|
/* @__PURE__ */ jsx(
|
|
5818
6254
|
Switch,
|
|
@@ -5829,7 +6265,7 @@ function LayersPanel({
|
|
|
5829
6265
|
] }),
|
|
5830
6266
|
(autoLabelConfig == null ? void 0 : autoLabelConfig.enabled) && /* @__PURE__ */ jsxs("div", { className: "ml-5 space-y-1", children: [
|
|
5831
6267
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
5832
|
-
/* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children:
|
|
6268
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: optionsLabels.autoLabelThreshold }),
|
|
5833
6269
|
/* @__PURE__ */ jsxs("span", { className: "text-xs font-medium", children: [
|
|
5834
6270
|
"< ",
|
|
5835
6271
|
autoLabelConfig.threshold
|
|
@@ -5851,9 +6287,10 @@ function LayersPanel({
|
|
|
5851
6287
|
}
|
|
5852
6288
|
),
|
|
5853
6289
|
visibleFeatureCount !== void 0 && /* @__PURE__ */ jsxs("div", { className: "text-xs text-muted-foreground", children: [
|
|
5854
|
-
|
|
6290
|
+
optionsLabels.visibleFeatures,
|
|
6291
|
+
" ",
|
|
5855
6292
|
/* @__PURE__ */ jsx("span", { className: "font-medium", children: visibleFeatureCount }),
|
|
5856
|
-
visibleFeatureCount < autoLabelConfig.threshold ? /* @__PURE__ */ jsx("span", { className: "text-green-600 dark:text-green-400 ml-1", children:
|
|
6293
|
+
visibleFeatureCount < autoLabelConfig.threshold ? /* @__PURE__ */ jsx("span", { className: "text-green-600 dark:text-green-400 ml-1", children: optionsLabels.labelsShown }) : /* @__PURE__ */ jsx("span", { className: "text-amber-600 dark:text-amber-400 ml-1", children: optionsLabels.labelsHidden })
|
|
5857
6294
|
] })
|
|
5858
6295
|
] })
|
|
5859
6296
|
] })
|
|
@@ -5863,7 +6300,7 @@ function LayersPanel({
|
|
|
5863
6300
|
{
|
|
5864
6301
|
key: "fit-all",
|
|
5865
6302
|
icon: /* @__PURE__ */ jsx(Focus, { className: "w-[18px] h-[18px]" }),
|
|
5866
|
-
label:
|
|
6303
|
+
label: optionsLabels.fitToAllFeatures,
|
|
5867
6304
|
onClick: onFitToFeatures
|
|
5868
6305
|
}
|
|
5869
6306
|
] : [],
|
|
@@ -5891,7 +6328,7 @@ function LayersPanel({
|
|
|
5891
6328
|
)
|
|
5892
6329
|
] }),
|
|
5893
6330
|
!hideBasemapSwitcher && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
5894
|
-
/* @__PURE__ */ jsx("div", { className: "flex gap-1 flex-1", children: (availableBasemaps ?? MAP_STYLES).filter((style) => {
|
|
6331
|
+
/* @__PURE__ */ jsx("div", { className: "flex gap-1 flex-1", children: (availableBasemaps ?? MAP_STYLES.map((style) => ({ ...style, name: builtInBasemapName(style.id, optionsLabels) ?? style.name }))).filter((style) => {
|
|
5895
6332
|
if (hideSatellite && style.id === "satellite") return false;
|
|
5896
6333
|
if (hideDark && style.id === "dark") return false;
|
|
5897
6334
|
return true;
|
|
@@ -5924,7 +6361,7 @@ function LayersPanel({
|
|
|
5924
6361
|
"data-testid": "button-3d-terrain",
|
|
5925
6362
|
children: [
|
|
5926
6363
|
/* @__PURE__ */ jsx(Box, { className: "w-4 h-4" }),
|
|
5927
|
-
/* @__PURE__ */ jsx("span", { className: "text-xs font-medium", children:
|
|
6364
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs font-medium", children: optionsLabels.terrain3d })
|
|
5928
6365
|
]
|
|
5929
6366
|
}
|
|
5930
6367
|
)
|
|
@@ -5933,9 +6370,9 @@ function LayersPanel({
|
|
|
5933
6370
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 px-2 py-1.5 border-b border-border shrink-0", children: [
|
|
5934
6371
|
/* @__PURE__ */ jsx(Layers, { className: "w-5 h-5 text-muted-foreground shrink-0" }),
|
|
5935
6372
|
/* @__PURE__ */ jsx("span", { className: "min-w-[18px] h-[18px] flex items-center justify-center rounded-full bg-primary text-primary-foreground text-[10px] font-bold leading-none px-1 shrink-0", children: layers.length }),
|
|
5936
|
-
/* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold flex-1", children:
|
|
6373
|
+
/* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold flex-1", children: labels.title }),
|
|
5937
6374
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
5938
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
6375
|
+
/* @__PURE__ */ jsx(Tooltip, { title: labels.createLayer, children: /* @__PURE__ */ jsx(
|
|
5939
6376
|
Button,
|
|
5940
6377
|
{
|
|
5941
6378
|
type: "text",
|
|
@@ -5945,7 +6382,7 @@ function LayersPanel({
|
|
|
5945
6382
|
"data-testid": "button-add-layer"
|
|
5946
6383
|
}
|
|
5947
6384
|
) }),
|
|
5948
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
6385
|
+
/* @__PURE__ */ jsx(Tooltip, { title: labels.loadAsNewLayer, children: /* @__PURE__ */ jsx(
|
|
5949
6386
|
Button,
|
|
5950
6387
|
{
|
|
5951
6388
|
type: "text",
|
|
@@ -5955,7 +6392,7 @@ function LayersPanel({
|
|
|
5955
6392
|
"data-testid": "button-open-layer"
|
|
5956
6393
|
}
|
|
5957
6394
|
) }),
|
|
5958
|
-
onSearchAndAddToNewLayer && /* @__PURE__ */ jsx(Tooltip, { title:
|
|
6395
|
+
onSearchAndAddToNewLayer && /* @__PURE__ */ jsx(Tooltip, { title: labels.searchAndAdd, children: /* @__PURE__ */ jsx(
|
|
5959
6396
|
Button,
|
|
5960
6397
|
{
|
|
5961
6398
|
type: "text",
|
|
@@ -6030,10 +6467,7 @@ function LayersPanel({
|
|
|
6030
6467
|
),
|
|
6031
6468
|
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold flex-1 truncate min-w-0", children: groupName }),
|
|
6032
6469
|
/* @__PURE__ */ jsx(Tag, { className: "text-xs !mr-0", children: groupFeatureTotal }),
|
|
6033
|
-
/* @__PURE__ */
|
|
6034
|
-
groupLayers.length,
|
|
6035
|
-
" layers"
|
|
6036
|
-
] })
|
|
6470
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground shrink-0 mr-0.5", children: labels.groupLayerCount(groupLayers.length) })
|
|
6037
6471
|
]
|
|
6038
6472
|
}
|
|
6039
6473
|
),
|
|
@@ -6097,182 +6531,69 @@ var localeData$1 = { exports: {} };
|
|
|
6097
6531
|
return s.bind(this)();
|
|
6098
6532
|
}, t.localeData = function() {
|
|
6099
6533
|
var n2 = i();
|
|
6100
|
-
return { firstDayOfWeek: function() {
|
|
6101
|
-
return n2.weekStart || 0;
|
|
6102
|
-
}, weekdays: function() {
|
|
6103
|
-
return t.weekdays();
|
|
6104
|
-
}, weekdaysShort: function() {
|
|
6105
|
-
return t.weekdaysShort();
|
|
6106
|
-
}, weekdaysMin: function() {
|
|
6107
|
-
return t.weekdaysMin();
|
|
6108
|
-
}, months: function() {
|
|
6109
|
-
return t.months();
|
|
6110
|
-
}, monthsShort: function() {
|
|
6111
|
-
return t.monthsShort();
|
|
6112
|
-
}, longDateFormat: function(e2) {
|
|
6113
|
-
return a(n2, e2);
|
|
6114
|
-
}, meridiem: n2.meridiem, ordinal: n2.ordinal };
|
|
6115
|
-
}, t.months = function() {
|
|
6116
|
-
return u(i(), "months");
|
|
6117
|
-
}, t.monthsShort = function() {
|
|
6118
|
-
return u(i(), "monthsShort", "months", 3);
|
|
6119
|
-
}, t.weekdays = function(n2) {
|
|
6120
|
-
return u(i(), "weekdays", null, null, n2);
|
|
6121
|
-
}, t.weekdaysShort = function(n2) {
|
|
6122
|
-
return u(i(), "weekdaysShort", "weekdays", 3, n2);
|
|
6123
|
-
}, t.weekdaysMin = function(n2) {
|
|
6124
|
-
return u(i(), "weekdaysMin", "weekdays", 2, n2);
|
|
6125
|
-
};
|
|
6126
|
-
};
|
|
6127
|
-
}));
|
|
6128
|
-
})(localeData$1);
|
|
6129
|
-
var localeDataExports = localeData$1.exports;
|
|
6130
|
-
const localeData = /* @__PURE__ */ getDefaultExportFromCjs(localeDataExports);
|
|
6131
|
-
var weekday$1 = { exports: {} };
|
|
6132
|
-
(function(module, exports$1) {
|
|
6133
|
-
!(function(e, t) {
|
|
6134
|
-
module.exports = t();
|
|
6135
|
-
})(commonjsGlobal, (function() {
|
|
6136
|
-
return function(e, t) {
|
|
6137
|
-
t.prototype.weekday = function(e2) {
|
|
6138
|
-
var t2 = this.$locale().weekStart || 0, i = this.$W, n = (i < t2 ? i + 7 : i) - t2;
|
|
6139
|
-
return this.$utils().u(e2) ? n : this.subtract(n, "day").add(e2, "day");
|
|
6140
|
-
};
|
|
6141
|
-
};
|
|
6142
|
-
}));
|
|
6143
|
-
})(weekday$1);
|
|
6144
|
-
var weekdayExports = weekday$1.exports;
|
|
6145
|
-
const weekday = /* @__PURE__ */ getDefaultExportFromCjs(weekdayExports);
|
|
6146
|
-
dayjs.extend(weekday);
|
|
6147
|
-
dayjs.extend(localeData);
|
|
6148
|
-
function FeatureDatePicker({ value, onChange, disabled, "data-testid": testId }) {
|
|
6149
|
-
const date = useMemo(() => value ? dayjs(value) : null, [value]);
|
|
6150
|
-
return /* @__PURE__ */ jsx(
|
|
6151
|
-
DatePicker,
|
|
6152
|
-
{
|
|
6153
|
-
showTime: true,
|
|
6154
|
-
format: "YYYY-MM-DD HH:mm",
|
|
6155
|
-
size: "small",
|
|
6156
|
-
value: date,
|
|
6157
|
-
onChange: (picked) => onChange(picked ? picked.startOf("minute").toISOString() : ""),
|
|
6158
|
-
disabled,
|
|
6159
|
-
className: "!h-6 flex-1",
|
|
6160
|
-
"data-testid": testId
|
|
6161
|
-
}
|
|
6162
|
-
);
|
|
6163
|
-
}
|
|
6164
|
-
function deepClone(value) {
|
|
6165
|
-
try {
|
|
6166
|
-
return structuredClone(value);
|
|
6167
|
-
} catch {
|
|
6168
|
-
return JSON.parse(JSON.stringify(value));
|
|
6169
|
-
}
|
|
6170
|
-
}
|
|
6171
|
-
function cloneFeatures(features) {
|
|
6172
|
-
try {
|
|
6173
|
-
return structuredClone(features);
|
|
6174
|
-
} catch {
|
|
6175
|
-
return features.map((f) => deepClone(f));
|
|
6176
|
-
}
|
|
6177
|
-
}
|
|
6178
|
-
function renderedFeatureId(f) {
|
|
6179
|
-
var _a;
|
|
6180
|
-
const fromProps = (_a = f.properties) == null ? void 0 : _a.id;
|
|
6181
|
-
if (fromProps !== void 0 && fromProps !== null && fromProps !== "") return String(fromProps);
|
|
6182
|
-
if (f.id !== void 0 && f.id !== null && f.id !== "") return String(f.id);
|
|
6183
|
-
return null;
|
|
6184
|
-
}
|
|
6185
|
-
function resolveTooltipFeature(rendered, lookup) {
|
|
6186
|
-
const id = renderedFeatureId(rendered);
|
|
6187
|
-
const stored = id === null ? null : lookup(id);
|
|
6188
|
-
if (stored) {
|
|
6189
|
-
return deepClone({
|
|
6190
|
-
type: "Feature",
|
|
6191
|
-
geometry: stored.geometry,
|
|
6192
|
-
properties: stored.properties ?? {},
|
|
6193
|
-
id: stored.id
|
|
6194
|
-
});
|
|
6195
|
-
}
|
|
6196
|
-
return {
|
|
6197
|
-
type: "Feature",
|
|
6198
|
-
geometry: rendered.geometry,
|
|
6199
|
-
properties: { ...rendered.properties ?? {} },
|
|
6200
|
-
id: rendered.id
|
|
6201
|
-
};
|
|
6202
|
-
}
|
|
6203
|
-
const DEFAULT_POINT_RADIUS = 5;
|
|
6204
|
-
const DEFAULT_ICON_SIZE = 24;
|
|
6205
|
-
const MAX_POINT_RADIUS = 18;
|
|
6206
|
-
const SAME_SPOT_PX = 1;
|
|
6207
|
-
const CROWD = 16;
|
|
6208
|
-
const SCAN_LIMIT = 256;
|
|
6209
|
-
const isDot = (m) => m.center !== null;
|
|
6210
|
-
const distance = (a, b) => Math.hypot(a.x - b.x, a.y - b.y);
|
|
6211
|
-
function paintedRadius(f) {
|
|
6212
|
-
var _a, _b;
|
|
6213
|
-
const p = f.properties ?? {};
|
|
6214
|
-
const hidden = ((_a = f.state) == null ? void 0 : _a[TIMELINE_HIDDEN_KEY]) === true || p.isHiddenByCluster === 1 || p.isHiddenByHeatmap === 1;
|
|
6215
|
-
if (hidden) return 0;
|
|
6216
|
-
if (typeof p.icon === "string" && p.icon !== "") {
|
|
6217
|
-
if (p[HOST_OWNED_PROP] !== 1) return 0;
|
|
6218
|
-
return typeof p.iconSize === "number" && Number.isFinite(p.iconSize) ? p.iconSize / 2 : DEFAULT_ICON_SIZE / 2;
|
|
6219
|
-
}
|
|
6220
|
-
const r = ((_b = f.state) == null ? void 0 : _b[TRACE_ENDPOINT_KEY]) === true ? p._endpointRadius : p.pointRadius;
|
|
6221
|
-
return typeof r === "number" && Number.isFinite(r) ? r : DEFAULT_POINT_RADIUS;
|
|
6222
|
-
}
|
|
6223
|
-
function labelPriority(f) {
|
|
6224
|
-
var _a;
|
|
6225
|
-
const v = (_a = f.properties) == null ? void 0 : _a._labelPriority;
|
|
6226
|
-
return typeof v === "number" && Number.isFinite(v) ? v : DEFAULT_LABEL_PRIORITY;
|
|
6227
|
-
}
|
|
6228
|
-
function members(features, project, maxDots = Infinity) {
|
|
6229
|
-
const seen = /* @__PURE__ */ new Set();
|
|
6230
|
-
const out = [];
|
|
6231
|
-
let dots = 0;
|
|
6232
|
-
for (const feature of features) {
|
|
6233
|
-
const id = renderedFeatureId(feature);
|
|
6234
|
-
if (id === null || seen.has(id)) continue;
|
|
6235
|
-
if (seen.size === SCAN_LIMIT || dots === maxDots) return { members: out, cut: true };
|
|
6236
|
-
seen.add(id);
|
|
6237
|
-
if (feature.geometry.type !== "Point") {
|
|
6238
|
-
out.push({ id, feature, center: null, radius: 0 });
|
|
6239
|
-
continue;
|
|
6534
|
+
return { firstDayOfWeek: function() {
|
|
6535
|
+
return n2.weekStart || 0;
|
|
6536
|
+
}, weekdays: function() {
|
|
6537
|
+
return t.weekdays();
|
|
6538
|
+
}, weekdaysShort: function() {
|
|
6539
|
+
return t.weekdaysShort();
|
|
6540
|
+
}, weekdaysMin: function() {
|
|
6541
|
+
return t.weekdaysMin();
|
|
6542
|
+
}, months: function() {
|
|
6543
|
+
return t.months();
|
|
6544
|
+
}, monthsShort: function() {
|
|
6545
|
+
return t.monthsShort();
|
|
6546
|
+
}, longDateFormat: function(e2) {
|
|
6547
|
+
return a(n2, e2);
|
|
6548
|
+
}, meridiem: n2.meridiem, ordinal: n2.ordinal };
|
|
6549
|
+
}, t.months = function() {
|
|
6550
|
+
return u(i(), "months");
|
|
6551
|
+
}, t.monthsShort = function() {
|
|
6552
|
+
return u(i(), "monthsShort", "months", 3);
|
|
6553
|
+
}, t.weekdays = function(n2) {
|
|
6554
|
+
return u(i(), "weekdays", null, null, n2);
|
|
6555
|
+
}, t.weekdaysShort = function(n2) {
|
|
6556
|
+
return u(i(), "weekdaysShort", "weekdays", 3, n2);
|
|
6557
|
+
}, t.weekdaysMin = function(n2) {
|
|
6558
|
+
return u(i(), "weekdaysMin", "weekdays", 2, n2);
|
|
6559
|
+
};
|
|
6560
|
+
};
|
|
6561
|
+
}));
|
|
6562
|
+
})(localeData$1);
|
|
6563
|
+
var localeDataExports = localeData$1.exports;
|
|
6564
|
+
const localeData = /* @__PURE__ */ getDefaultExportFromCjs(localeDataExports);
|
|
6565
|
+
var weekday$1 = { exports: {} };
|
|
6566
|
+
(function(module, exports$1) {
|
|
6567
|
+
!(function(e, t) {
|
|
6568
|
+
module.exports = t();
|
|
6569
|
+
})(commonjsGlobal, (function() {
|
|
6570
|
+
return function(e, t) {
|
|
6571
|
+
t.prototype.weekday = function(e2) {
|
|
6572
|
+
var t2 = this.$locale().weekStart || 0, i = this.$W, n = (i < t2 ? i + 7 : i) - t2;
|
|
6573
|
+
return this.$utils().u(e2) ? n : this.subtract(n, "day").add(e2, "day");
|
|
6574
|
+
};
|
|
6575
|
+
};
|
|
6576
|
+
}));
|
|
6577
|
+
})(weekday$1);
|
|
6578
|
+
var weekdayExports = weekday$1.exports;
|
|
6579
|
+
const weekday = /* @__PURE__ */ getDefaultExportFromCjs(weekdayExports);
|
|
6580
|
+
dayjs.extend(weekday);
|
|
6581
|
+
dayjs.extend(localeData);
|
|
6582
|
+
function FeatureDatePicker({ value, onChange, disabled, "data-testid": testId }) {
|
|
6583
|
+
const date = useMemo(() => value ? dayjs(value) : null, [value]);
|
|
6584
|
+
return /* @__PURE__ */ jsx(
|
|
6585
|
+
DatePicker,
|
|
6586
|
+
{
|
|
6587
|
+
showTime: true,
|
|
6588
|
+
format: "YYYY-MM-DD HH:mm",
|
|
6589
|
+
size: "small",
|
|
6590
|
+
value: date,
|
|
6591
|
+
onChange: (picked) => onChange(picked ? picked.startOf("minute").toISOString() : ""),
|
|
6592
|
+
disabled,
|
|
6593
|
+
className: "!h-6 flex-1",
|
|
6594
|
+
"data-testid": testId
|
|
6240
6595
|
}
|
|
6241
|
-
|
|
6242
|
-
if (radius <= 0) continue;
|
|
6243
|
-
out.push({ id, feature, center: project(feature.geometry.coordinates), radius });
|
|
6244
|
-
dots++;
|
|
6245
|
-
}
|
|
6246
|
-
return { members: out, cut: false };
|
|
6247
|
-
}
|
|
6248
|
-
function searchBox(dot) {
|
|
6249
|
-
const reach = dot.radius + MAX_POINT_RADIUS;
|
|
6250
|
-
return [[dot.center.x - reach, dot.center.y - reach], [dot.center.x + reach, dot.center.y + reach]];
|
|
6251
|
-
}
|
|
6252
|
-
const MORE_POINTS_HINT = "More points overlap here: zoom in to reach them";
|
|
6253
|
-
function featureStackAt(point2, hits, queryBox, project) {
|
|
6254
|
-
const hit = members(hits, project, CROWD + 1).members;
|
|
6255
|
-
const under = hit.filter(isDot);
|
|
6256
|
-
if (under.length === 0) return { features: hit.length > 0 ? [hit[0].feature] : [], more: false };
|
|
6257
|
-
const fromCursor = (d) => distance(d.center, point2);
|
|
6258
|
-
const byCursor = (a, b) => fromCursor(a) - fromCursor(b);
|
|
6259
|
-
let dots;
|
|
6260
|
-
let more;
|
|
6261
|
-
if (under.length > CROWD) {
|
|
6262
|
-
dots = under.sort(byCursor).slice(0, CROWD);
|
|
6263
|
-
more = true;
|
|
6264
|
-
} else {
|
|
6265
|
-
const nearest = under.reduce((a, b) => fromCursor(b) < fromCursor(a) ? b : a);
|
|
6266
|
-
const taken = new Set(under.map((d) => d.id));
|
|
6267
|
-
const box = members(queryBox(searchBox(nearest)), project);
|
|
6268
|
-
const neighbours = box.members.filter(isDot).filter((m) => !taken.has(m.id) && distance(m.center, nearest.center) <= m.radius + nearest.radius);
|
|
6269
|
-
dots = [...under, ...neighbours].sort(byCursor);
|
|
6270
|
-
more = box.cut;
|
|
6271
|
-
}
|
|
6272
|
-
const spot = dots[0].center;
|
|
6273
|
-
const onSpot = dots.filter((d) => distance(d.center, spot) < SAME_SPOT_PX).sort((a, b) => labelPriority(a.feature) - labelPriority(b.feature));
|
|
6274
|
-
const rest = dots.filter((d) => distance(d.center, spot) >= SAME_SPOT_PX);
|
|
6275
|
-
return { features: [...onSpot, ...rest].map((d) => d.feature), more };
|
|
6596
|
+
);
|
|
6276
6597
|
}
|
|
6277
6598
|
const { TextArea } = Input;
|
|
6278
6599
|
function formatDateForState(value) {
|
|
@@ -6293,6 +6614,7 @@ function EntityCardsList({
|
|
|
6293
6614
|
selectedFeatures,
|
|
6294
6615
|
entityCardProvider
|
|
6295
6616
|
}) {
|
|
6617
|
+
const { propertiesPanel: labels } = useMapLabels();
|
|
6296
6618
|
const shown = selectedFeatures.slice(0, ENTITY_CARDS_RENDER_CAP);
|
|
6297
6619
|
return /* @__PURE__ */ jsxs("div", { className: "p-2 space-y-2", children: [
|
|
6298
6620
|
shown.map((f) => {
|
|
@@ -6305,18 +6627,13 @@ function EntityCardsList({
|
|
|
6305
6627
|
const card = entityCardProvider(geoFeature);
|
|
6306
6628
|
return card ? /* @__PURE__ */ jsx("div", { className: "border border-border rounded-md p-2 bg-card", children: card }, f.id) : null;
|
|
6307
6629
|
}),
|
|
6308
|
-
selectedFeatures.length > shown.length && /* @__PURE__ */
|
|
6309
|
-
"Showing the first ",
|
|
6310
|
-
shown.length,
|
|
6311
|
-
" of ",
|
|
6312
|
-
selectedFeatures.length.toLocaleString(),
|
|
6313
|
-
" selected features"
|
|
6314
|
-
] })
|
|
6630
|
+
selectedFeatures.length > shown.length && /* @__PURE__ */ jsx("div", { className: "text-center py-2 text-muted-foreground text-sm", "data-testid": "entity-cards-cap-note", children: labels.showingFirstSelected({ shown: shown.length, total: selectedFeatures.length }) })
|
|
6315
6631
|
] });
|
|
6316
6632
|
}
|
|
6317
6633
|
function StackPager({ stack }) {
|
|
6634
|
+
const { propertiesPanel: labels, canvas: canvasLabels } = useMapLabels();
|
|
6318
6635
|
return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-3 py-1 border-b border-border shrink-0 text-xs text-muted-foreground", children: [
|
|
6319
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
6636
|
+
/* @__PURE__ */ jsx(Tooltip, { title: labels.previousOverlappingPoint, children: /* @__PURE__ */ jsx(
|
|
6320
6637
|
Button,
|
|
6321
6638
|
{
|
|
6322
6639
|
type: "text",
|
|
@@ -6324,17 +6641,17 @@ function StackPager({ stack }) {
|
|
|
6324
6641
|
disabled: stack.position === 0,
|
|
6325
6642
|
onClick: () => stack.onStep(-1),
|
|
6326
6643
|
className: "!w-6 !h-6 !min-w-0 !p-0",
|
|
6327
|
-
"aria-label":
|
|
6644
|
+
"aria-label": labels.previousOverlappingPoint,
|
|
6328
6645
|
"data-testid": "button-stack-prev"
|
|
6329
6646
|
}
|
|
6330
6647
|
) }),
|
|
6331
|
-
/* @__PURE__ */ jsx(Tooltip, { title: stack.more ?
|
|
6648
|
+
/* @__PURE__ */ jsx(Tooltip, { title: stack.more ? canvasLabels.morePointsHint : void 0, children: /* @__PURE__ */ jsxs("span", { "data-testid": "panel-stack-position", children: [
|
|
6332
6649
|
stack.position + 1,
|
|
6333
6650
|
" / ",
|
|
6334
6651
|
stack.count,
|
|
6335
6652
|
stack.more ? "+" : ""
|
|
6336
6653
|
] }) }),
|
|
6337
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
6654
|
+
/* @__PURE__ */ jsx(Tooltip, { title: labels.nextOverlappingPoint, children: /* @__PURE__ */ jsx(
|
|
6338
6655
|
Button,
|
|
6339
6656
|
{
|
|
6340
6657
|
type: "text",
|
|
@@ -6342,7 +6659,7 @@ function StackPager({ stack }) {
|
|
|
6342
6659
|
disabled: stack.position === stack.count - 1,
|
|
6343
6660
|
onClick: () => stack.onStep(1),
|
|
6344
6661
|
className: "!w-6 !h-6 !min-w-0 !p-0",
|
|
6345
|
-
"aria-label":
|
|
6662
|
+
"aria-label": labels.nextOverlappingPoint,
|
|
6346
6663
|
"data-testid": "button-stack-next"
|
|
6347
6664
|
}
|
|
6348
6665
|
) })
|
|
@@ -6379,6 +6696,7 @@ function colorPickerNoHexPanel(_panel, extra) {
|
|
|
6379
6696
|
}
|
|
6380
6697
|
function LatLngFields(props) {
|
|
6381
6698
|
const { latitude, longitude, isEditable, testIdPrefix } = props;
|
|
6699
|
+
const { featureFields: labels } = useMapLabels();
|
|
6382
6700
|
if (!isEditable) {
|
|
6383
6701
|
return /* @__PURE__ */ jsxs(
|
|
6384
6702
|
"div",
|
|
@@ -6401,7 +6719,7 @@ function LatLngFields(props) {
|
|
|
6401
6719
|
onChange: (e) => props.onLatChange(e.target.value),
|
|
6402
6720
|
onFocus: props.onLatFocus,
|
|
6403
6721
|
onBlur: props.onLatBlur,
|
|
6404
|
-
placeholder:
|
|
6722
|
+
placeholder: labels.latitude,
|
|
6405
6723
|
className: "!h-6 text-[13px] flex-1",
|
|
6406
6724
|
"data-testid": `${testIdPrefix}-latitude`
|
|
6407
6725
|
}
|
|
@@ -6413,7 +6731,7 @@ function LatLngFields(props) {
|
|
|
6413
6731
|
onChange: (e) => props.onLngChange(e.target.value),
|
|
6414
6732
|
onFocus: props.onLngFocus,
|
|
6415
6733
|
onBlur: props.onLngBlur,
|
|
6416
|
-
placeholder:
|
|
6734
|
+
placeholder: labels.longitude,
|
|
6417
6735
|
className: "!h-6 text-[13px] flex-1",
|
|
6418
6736
|
"data-testid": `${testIdPrefix}-longitude`
|
|
6419
6737
|
}
|
|
@@ -6540,6 +6858,7 @@ function parseRecordFields(feature) {
|
|
|
6540
6858
|
}
|
|
6541
6859
|
const FLUSH_COLLAPSE = { header: "!px-0 !py-1", body: "!px-0 !py-1" };
|
|
6542
6860
|
function RecordFieldsSection({ feature }) {
|
|
6861
|
+
const { propertiesPanel: labels } = useMapLabels();
|
|
6543
6862
|
const fields = parseRecordFields(feature);
|
|
6544
6863
|
if (fields.length === 0) return null;
|
|
6545
6864
|
return /* @__PURE__ */ jsx(
|
|
@@ -6553,7 +6872,7 @@ function RecordFieldsSection({ feature }) {
|
|
|
6553
6872
|
key: "record-fields",
|
|
6554
6873
|
label: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
6555
6874
|
/* @__PURE__ */ jsx(Info, { className: "w-3 h-3 text-foreground" }),
|
|
6556
|
-
/* @__PURE__ */ jsx("span", { className: "text-[11px] font-bold uppercase tracking-wide text-foreground", children:
|
|
6875
|
+
/* @__PURE__ */ jsx("span", { className: "text-[11px] font-bold uppercase tracking-wide text-foreground", children: labels.recordFields }),
|
|
6557
6876
|
/* @__PURE__ */ jsxs("span", { className: "text-[10px] text-muted-foreground ml-1", children: [
|
|
6558
6877
|
"(",
|
|
6559
6878
|
fields.length,
|
|
@@ -6569,9 +6888,17 @@ function RecordFieldsSection({ feature }) {
|
|
|
6569
6888
|
);
|
|
6570
6889
|
}
|
|
6571
6890
|
let persistedTabPreference = "properties";
|
|
6572
|
-
function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometry, onClose, isEditMode = true, isReadOnlyLayer = false, layerName, layerId, autoFocusLabel = false, entityCardProvider, entityCardPlacement = "tab", inlineEntityCardLabel
|
|
6891
|
+
function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometry, onClose, isEditMode = true, isReadOnlyLayer = false, layerName, layerId, autoFocusLabel = false, entityCardProvider, entityCardPlacement = "tab", inlineEntityCardLabel: inlineEntityCardLabelProp, typePickerProvider, featureSaveProvider, featureRefreshProvider, onFeatureSaved, onDeleteFeatures, onOpenInNewTab, onEntityContextMenu, layers, onMoveFeaturesToLayer, onCopyFeaturesToLayer, onCreateLayerAndMoveFeatures, onCreateLayerAndCopyFeatures, getFeatureColor, anchorEl, stack }) {
|
|
6573
6892
|
var _a, _b, _c, _d, _e;
|
|
6574
6893
|
const feature = selectedFeatures[0];
|
|
6894
|
+
const {
|
|
6895
|
+
propertiesPanel: labels,
|
|
6896
|
+
featureFields: fieldLabels,
|
|
6897
|
+
coordinates: coordinateLabels,
|
|
6898
|
+
canvas: canvasLabels
|
|
6899
|
+
} = useMapLabels();
|
|
6900
|
+
const inlineEntityCardLabel = inlineEntityCardLabelProp ?? labels.pointDetail;
|
|
6901
|
+
const shownName = layerName !== void 0 && layerId !== void 0 ? shownLayerName({ name: layerName }, canvasLabels) : layerName;
|
|
6575
6902
|
const { toast } = useToast();
|
|
6576
6903
|
const hasMultipleSelection = selectedFeatures.length > 1;
|
|
6577
6904
|
const [isSaving, setIsSaving] = useState(false);
|
|
@@ -6635,7 +6962,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
6635
6962
|
targetLayers.forEach((l) => {
|
|
6636
6963
|
items.push({
|
|
6637
6964
|
key: l.id,
|
|
6638
|
-
label: l
|
|
6965
|
+
label: shownLayerName(l, canvasLabels) || labels.untitledLayer,
|
|
6639
6966
|
onClick: () => {
|
|
6640
6967
|
if (action === "copy") {
|
|
6641
6968
|
onCopyFeaturesToLayer == null ? void 0 : onCopyFeaturesToLayer(featureIds, l.id);
|
|
@@ -6650,16 +6977,16 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
6650
6977
|
if (items.length > 0) items.push({ type: "divider" });
|
|
6651
6978
|
items.push({
|
|
6652
6979
|
key: "new-layer",
|
|
6653
|
-
label:
|
|
6980
|
+
label: labels.newLayer,
|
|
6654
6981
|
icon: /* @__PURE__ */ jsx(Plus, { className: "w-4 h-4" }),
|
|
6655
6982
|
onClick: () => {
|
|
6656
|
-
const name2 = window.prompt(
|
|
6983
|
+
const name2 = window.prompt(labels.newLayerPrompt);
|
|
6657
6984
|
if (name2 == null ? void 0 : name2.trim()) createHandler(featureIds, name2.trim());
|
|
6658
6985
|
}
|
|
6659
6986
|
});
|
|
6660
6987
|
}
|
|
6661
6988
|
return items;
|
|
6662
|
-
}, [targetLayers, featureIds, onCopyFeaturesToLayer, onMoveFeaturesToLayer, onCreateLayerAndCopyFeatures, onCreateLayerAndMoveFeatures]);
|
|
6989
|
+
}, [targetLayers, featureIds, onCopyFeaturesToLayer, onMoveFeaturesToLayer, onCreateLayerAndCopyFeatures, onCreateLayerAndMoveFeatures, labels, canvasLabels]);
|
|
6663
6990
|
const [name, setName] = useState("");
|
|
6664
6991
|
const [description, setDescription] = useState("");
|
|
6665
6992
|
const [startDate, setStartDate] = useState("");
|
|
@@ -6672,7 +6999,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
6672
6999
|
const [strokeOpacity, setStrokeOpacity] = useState(1);
|
|
6673
7000
|
const [fillColor, setFillColor] = useState("#3b82f6");
|
|
6674
7001
|
const [fillOpacity, setFillOpacity] = useState(0.2);
|
|
6675
|
-
const [labelText, setLabelText] = useState(
|
|
7002
|
+
const [labelText, setLabelText] = useState(canvasLabels.newTextLabel);
|
|
6676
7003
|
const [fontSize, setFontSize] = useState(14);
|
|
6677
7004
|
const [fontColor, setFontColor] = useState("#000000");
|
|
6678
7005
|
const [fontWeight, setFontWeight] = useState("normal");
|
|
@@ -6688,7 +7015,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
6688
7015
|
useEffect(() => {
|
|
6689
7016
|
if (feature) {
|
|
6690
7017
|
if (feature.properties.kind === "text") {
|
|
6691
|
-
const textLabel = feature.properties.label || feature.properties.text ||
|
|
7018
|
+
const textLabel = feature.properties.label || feature.properties.text || canvasLabels.newTextLabel;
|
|
6692
7019
|
setName(textLabel);
|
|
6693
7020
|
setLabelText(textLabel);
|
|
6694
7021
|
} else {
|
|
@@ -6899,20 +7226,20 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
6899
7226
|
entityLabel: result.entityLabel
|
|
6900
7227
|
});
|
|
6901
7228
|
toast({
|
|
6902
|
-
title:
|
|
6903
|
-
description:
|
|
7229
|
+
title: labels.featureSaved,
|
|
7230
|
+
description: labels.savedTo(result.workspace)
|
|
6904
7231
|
});
|
|
6905
7232
|
}
|
|
6906
7233
|
} catch (error) {
|
|
6907
7234
|
toast({
|
|
6908
|
-
title:
|
|
6909
|
-
description: error instanceof Error ? error.message :
|
|
7235
|
+
title: labels.saveFailed,
|
|
7236
|
+
description: error instanceof Error ? error.message : labels.saveFeatureFailed,
|
|
6910
7237
|
variant: "destructive"
|
|
6911
7238
|
});
|
|
6912
7239
|
} finally {
|
|
6913
7240
|
setIsSaving(false);
|
|
6914
7241
|
}
|
|
6915
|
-
}, [featureSaveProvider, feature, layerId, layerName, onFeatureSaved, toast]);
|
|
7242
|
+
}, [featureSaveProvider, feature, layerId, layerName, onFeatureSaved, toast, labels]);
|
|
6916
7243
|
if (selectedFeatures.length === 0) {
|
|
6917
7244
|
return null;
|
|
6918
7245
|
}
|
|
@@ -6932,17 +7259,17 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
6932
7259
|
if (updated) {
|
|
6933
7260
|
onUpdateProperties(feature.id, updated, { fromRefresh: true });
|
|
6934
7261
|
if (!silent) {
|
|
6935
|
-
toast({ title:
|
|
7262
|
+
toast({ title: labels.refreshed, description: labels.refreshedDescription });
|
|
6936
7263
|
}
|
|
6937
7264
|
}
|
|
6938
7265
|
} catch (err) {
|
|
6939
7266
|
if (!silent) {
|
|
6940
|
-
toast({ title:
|
|
7267
|
+
toast({ title: labels.refreshFailed, description: String(err), variant: "destructive" });
|
|
6941
7268
|
}
|
|
6942
7269
|
} finally {
|
|
6943
7270
|
setIsRefreshing(false);
|
|
6944
7271
|
}
|
|
6945
|
-
}, [feature, featureRefreshProvider, onUpdateProperties, toast]);
|
|
7272
|
+
}, [feature, featureRefreshProvider, onUpdateProperties, toast, labels]);
|
|
6946
7273
|
const autoRefreshedRef = useRef(null);
|
|
6947
7274
|
useEffect(() => {
|
|
6948
7275
|
if (!isRecord || !featureRefreshProvider || !feature) return;
|
|
@@ -6957,8 +7284,8 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
6957
7284
|
const recordProperties = feature ? Object.entries(feature.properties).filter(
|
|
6958
7285
|
([key, value]) => !isExcludedRecordKey(key) && value !== void 0 && value !== null && !key.startsWith("_") && !key.startsWith("os_") && !key.startsWith("isHidden")
|
|
6959
7286
|
).map(([key, value]) => ({ key, value: formatFieldValue(String(value)) })) : [];
|
|
6960
|
-
const entityCardsContent = entityCardProvider ? /* @__PURE__ */ jsx(EntityCardsList, { selectedFeatures, entityCardProvider }) : /* @__PURE__ */ jsx("div", { className: "p-2 space-y-2", children: /* @__PURE__ */ jsx("div", { className: "text-center py-4 text-muted-foreground text-sm", children:
|
|
6961
|
-
const propertiesDisabledOverlay = /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-background/80 flex items-center justify-center z-10 rounded-md", children: /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground text-center px-4", children:
|
|
7287
|
+
const entityCardsContent = entityCardProvider ? /* @__PURE__ */ jsx(EntityCardsList, { selectedFeatures, entityCardProvider }) : /* @__PURE__ */ jsx("div", { className: "p-2 space-y-2", children: /* @__PURE__ */ jsx("div", { className: "text-center py-4 text-muted-foreground text-sm", children: labels.noEntityCardProvider }) });
|
|
7288
|
+
const propertiesDisabledOverlay = /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-background/80 flex items-center justify-center z-10 rounded-md", children: /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground text-center px-4", children: labels.selectSingleToSeeProperties }) });
|
|
6962
7289
|
if (hasMultipleSelection && !entityCardProvider) {
|
|
6963
7290
|
return /* @__PURE__ */ jsxs(
|
|
6964
7291
|
"div",
|
|
@@ -6969,20 +7296,16 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
6969
7296
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2 px-2.5 py-2 border-b border-border", children: [
|
|
6970
7297
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
6971
7298
|
/* @__PURE__ */ jsx(Package, { className: "w-4 h-4 text-primary" }),
|
|
6972
|
-
/* @__PURE__ */
|
|
6973
|
-
selectedFeatures.length,
|
|
6974
|
-
" selected ",
|
|
6975
|
-
selectedFeatures.length === 1 ? "feature" : "features"
|
|
6976
|
-
] })
|
|
7299
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold", children: labels.selectedFeatures(selectedFeatures.length) })
|
|
6977
7300
|
] }),
|
|
6978
7301
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
6979
|
-
hasLayerActions && onCopyFeaturesToLayer && /* @__PURE__ */ jsx(Dropdown, { menu: { items: buildLayerMenuItems("copy") }, trigger: ["click"], placement: "bottomRight", children: /* @__PURE__ */ jsx(Tooltip, { title:
|
|
6980
|
-
hasLayerActions && onMoveFeaturesToLayer && /* @__PURE__ */ jsx(Dropdown, { menu: { items: buildLayerMenuItems("move") }, trigger: ["click"], placement: "bottomRight", children: /* @__PURE__ */ jsx(Tooltip, { title:
|
|
6981
|
-
onDeleteFeatures && /* @__PURE__ */ jsx(Tooltip, { title:
|
|
7302
|
+
hasLayerActions && onCopyFeaturesToLayer && /* @__PURE__ */ jsx(Dropdown, { menu: { items: buildLayerMenuItems("copy") }, trigger: ["click"], placement: "bottomRight", children: /* @__PURE__ */ jsx(Tooltip, { title: labels.copyToLayer, children: /* @__PURE__ */ jsx(Button, { type: "text", icon: /* @__PURE__ */ jsx(Copy, { className: "w-3.5 h-3.5" }), className: "!w-6 !h-6 !min-w-0 !p-0", "data-testid": "button-copy-to-layer" }) }) }),
|
|
7303
|
+
hasLayerActions && onMoveFeaturesToLayer && /* @__PURE__ */ jsx(Dropdown, { menu: { items: buildLayerMenuItems("move") }, trigger: ["click"], placement: "bottomRight", children: /* @__PURE__ */ jsx(Tooltip, { title: labels.moveToLayer, children: /* @__PURE__ */ jsx(Button, { type: "text", icon: /* @__PURE__ */ jsx(FolderInput, { className: "w-3.5 h-3.5" }), className: "!w-6 !h-6 !min-w-0 !p-0", "data-testid": "button-move-to-layer" }) }) }),
|
|
7304
|
+
onDeleteFeatures && /* @__PURE__ */ jsx(Tooltip, { title: labels.deleteFeatures(selectedFeatures.length), children: /* @__PURE__ */ jsx(Button, { type: "text", danger: true, icon: /* @__PURE__ */ jsx(Trash2, { className: "w-3.5 h-3.5" }), onClick: onDeleteFeatures, className: "!w-6 !h-6 !min-w-0 !p-0", "data-testid": "button-delete-features" }) }),
|
|
6982
7305
|
/* @__PURE__ */ jsx(Button, { type: "text", icon: /* @__PURE__ */ jsx(X, { className: "w-3.5 h-3.5" }), onClick: onClose, className: "!w-6 !h-6 !min-w-0 !p-0", "data-testid": "button-close-properties" })
|
|
6983
7306
|
] })
|
|
6984
7307
|
] }),
|
|
6985
|
-
/* @__PURE__ */ jsx("div", { className: "p-2.5", children: /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children:
|
|
7308
|
+
/* @__PURE__ */ jsx("div", { className: "p-2.5", children: /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: labels.selectSingleToEdit }) })
|
|
6986
7309
|
]
|
|
6987
7310
|
}
|
|
6988
7311
|
);
|
|
@@ -6991,17 +7314,17 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
6991
7314
|
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
6992
7315
|
layerName && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
6993
7316
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 min-w-0", children: [
|
|
6994
|
-
/* @__PURE__ */ jsx("span", { className: "text-[12px] text-muted-foreground", children:
|
|
6995
|
-
/* @__PURE__ */ jsx("span", { className: "text-[12px] text-foreground truncate", "data-testid": "text-feature-layer", children:
|
|
7317
|
+
/* @__PURE__ */ jsx("span", { className: "text-[12px] text-muted-foreground", children: labels.layer }),
|
|
7318
|
+
/* @__PURE__ */ jsx("span", { className: "text-[12px] text-foreground truncate", "data-testid": "text-feature-layer", children: shownName })
|
|
6996
7319
|
] }),
|
|
6997
7320
|
hasLayerActions && !hasMultipleSelection && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
6998
|
-
onCopyFeaturesToLayer && /* @__PURE__ */ jsx(Dropdown, { menu: { items: buildLayerMenuItems("copy") }, trigger: ["click"], placement: "bottomRight", children: /* @__PURE__ */ jsx(Tooltip, { title:
|
|
6999
|
-
onMoveFeaturesToLayer && /* @__PURE__ */ jsx(Dropdown, { menu: { items: buildLayerMenuItems("move") }, trigger: ["click"], placement: "bottomRight", children: /* @__PURE__ */ jsx(Tooltip, { title:
|
|
7321
|
+
onCopyFeaturesToLayer && /* @__PURE__ */ jsx(Dropdown, { menu: { items: buildLayerMenuItems("copy") }, trigger: ["click"], placement: "bottomRight", children: /* @__PURE__ */ jsx(Tooltip, { title: labels.copyToLayer, children: /* @__PURE__ */ jsx(Button, { type: "text", icon: /* @__PURE__ */ jsx(Copy, { className: "w-3.5 h-3.5" }), className: "!w-5 !h-5 !min-w-0 !p-0", "data-testid": "button-copy-to-layer-prop" }) }) }),
|
|
7322
|
+
onMoveFeaturesToLayer && /* @__PURE__ */ jsx(Dropdown, { menu: { items: buildLayerMenuItems("move") }, trigger: ["click"], placement: "bottomRight", children: /* @__PURE__ */ jsx(Tooltip, { title: labels.moveToLayer, children: /* @__PURE__ */ jsx(Button, { type: "text", icon: /* @__PURE__ */ jsx(FolderInput, { className: "w-3.5 h-3.5" }), className: "!w-5 !h-5 !min-w-0 !p-0", "data-testid": "button-move-to-layer-prop" }) }) })
|
|
7000
7323
|
] })
|
|
7001
7324
|
] }),
|
|
7002
7325
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [
|
|
7003
|
-
isRecord ? /* @__PURE__ */ jsx(Tag, { color: "cyan", className: "!text-[12px] !px-2.5 !py-0.5 !leading-5 !m-0 !font-semibold", children:
|
|
7004
|
-
isUnsaved && /* @__PURE__ */ jsx(Tag, { color: "orange", className: "!text-[12px] !px-2.5 !py-0.5 !leading-5 !border-0 !m-0 !font-semibold", children:
|
|
7326
|
+
isRecord ? /* @__PURE__ */ jsx(Tag, { color: "cyan", className: "!text-[12px] !px-2.5 !py-0.5 !leading-5 !m-0 !font-semibold", children: labels.octostarRecord }) : /* @__PURE__ */ jsx(Tag, { color: "blue", className: "!text-[12px] !px-2.5 !py-0.5 !leading-5 !m-0 !font-semibold", children: labels.localMapFeature }),
|
|
7327
|
+
isUnsaved && /* @__PURE__ */ jsx(Tag, { color: "orange", className: "!text-[12px] !px-2.5 !py-0.5 !leading-5 !border-0 !m-0 !font-semibold", children: labels.unsaved }),
|
|
7005
7328
|
!isRecord && featureSaveProvider && /* @__PURE__ */ jsx(
|
|
7006
7329
|
Button,
|
|
7007
7330
|
{
|
|
@@ -7012,14 +7335,14 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7012
7335
|
onClick: handleFeatureSave,
|
|
7013
7336
|
className: "!h-7 !px-3 !text-[12px] !font-medium",
|
|
7014
7337
|
"data-testid": "button-save-feature",
|
|
7015
|
-
children:
|
|
7338
|
+
children: labels.createEntity
|
|
7016
7339
|
}
|
|
7017
7340
|
)
|
|
7018
7341
|
] })
|
|
7019
7342
|
] }),
|
|
7020
7343
|
/* @__PURE__ */ jsx(Divider, { className: "!my-1.5" }),
|
|
7021
7344
|
/* @__PURE__ */ jsxs("div", { className: "space-y-0.5", children: [
|
|
7022
|
-
/* @__PURE__ */ jsx("label", { htmlFor: "feature-name", className: "text-xs text-muted-foreground", children: feature.properties.kind === "text" ?
|
|
7345
|
+
/* @__PURE__ */ jsx("label", { htmlFor: "feature-name", className: "text-xs text-muted-foreground", children: feature.properties.kind === "text" ? fieldLabels.label : fieldLabels.name }),
|
|
7023
7346
|
isEditMode ? /* @__PURE__ */ jsx(
|
|
7024
7347
|
Input,
|
|
7025
7348
|
{
|
|
@@ -7033,19 +7356,19 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7033
7356
|
}
|
|
7034
7357
|
},
|
|
7035
7358
|
onBlur: () => handleSave(),
|
|
7036
|
-
placeholder: feature.properties.kind === "text" ?
|
|
7359
|
+
placeholder: feature.properties.kind === "text" ? fieldLabels.enterLabel : fieldLabels.featureName,
|
|
7037
7360
|
className: "!h-6 text-[13px]",
|
|
7038
7361
|
"data-testid": "input-feature-name"
|
|
7039
7362
|
}
|
|
7040
7363
|
) : (
|
|
7041
7364
|
// Static in view mode — a readOnly Input keeps the editable look
|
|
7042
7365
|
// but swallows every keystroke (see LatLngFields).
|
|
7043
|
-
/* @__PURE__ */ jsx("div", { className: "text-[13px] px-1 py-0.5 break-words", "data-testid": "text-feature-name", children: name || /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children:
|
|
7366
|
+
/* @__PURE__ */ jsx("div", { className: "text-[13px] px-1 py-0.5 break-words", "data-testid": "text-feature-name", children: name || /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: fieldLabels.noName }) })
|
|
7044
7367
|
)
|
|
7045
7368
|
] }),
|
|
7046
7369
|
(typePickerProvider || feature.geometry.type === "Point" && feature.properties.kind !== "text" && pointIcon) && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
7047
7370
|
feature.geometry.type === "Point" && feature.properties.kind !== "text" && pointIcon && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
7048
|
-
/* @__PURE__ */ jsx("label", { className: "text-xs text-muted-foreground", children:
|
|
7371
|
+
/* @__PURE__ */ jsx("label", { className: "text-xs text-muted-foreground", children: fieldLabels.icon }),
|
|
7049
7372
|
/* @__PURE__ */ jsx("span", { className: "text-lg leading-none", children: pointIcon }),
|
|
7050
7373
|
isEditMode && /* @__PURE__ */ jsx(
|
|
7051
7374
|
Button,
|
|
@@ -7062,13 +7385,13 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7062
7385
|
)
|
|
7063
7386
|
] }),
|
|
7064
7387
|
typePickerProvider && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 flex-1", children: [
|
|
7065
|
-
/* @__PURE__ */ jsx("label", { className: "text-xs text-muted-foreground", children:
|
|
7388
|
+
/* @__PURE__ */ jsx("label", { className: "text-xs text-muted-foreground", children: fieldLabels.type }),
|
|
7066
7389
|
/* @__PURE__ */ jsx(
|
|
7067
7390
|
Input,
|
|
7068
7391
|
{
|
|
7069
7392
|
value: entityType || "",
|
|
7070
7393
|
readOnly: true,
|
|
7071
|
-
placeholder:
|
|
7394
|
+
placeholder: fieldLabels.noType,
|
|
7072
7395
|
className: "!h-6 text-[13px] flex-1",
|
|
7073
7396
|
"data-testid": "input-entity-type"
|
|
7074
7397
|
}
|
|
@@ -7096,8 +7419,8 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7096
7419
|
] }),
|
|
7097
7420
|
/* @__PURE__ */ jsxs("div", { className: "space-y-0.5", children: [
|
|
7098
7421
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
7099
|
-
/* @__PURE__ */ jsx("label", { className: "text-xs text-muted-foreground", children:
|
|
7100
|
-
feature.geometry.type !== "Point" && /* @__PURE__ */ jsx(Tooltip, { title:
|
|
7422
|
+
/* @__PURE__ */ jsx("label", { className: "text-xs text-muted-foreground", children: fieldLabels.latLng }),
|
|
7423
|
+
feature.geometry.type !== "Point" && /* @__PURE__ */ jsx(Tooltip, { title: fieldLabels.centroidHint, children: /* @__PURE__ */ jsx("span", { className: "text-[13px] text-muted-foreground cursor-help", children: "*" }) })
|
|
7101
7424
|
] }),
|
|
7102
7425
|
/* @__PURE__ */ jsx(
|
|
7103
7426
|
LatLngFields,
|
|
@@ -7121,10 +7444,10 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7121
7444
|
const lng = parseFloat(longitude);
|
|
7122
7445
|
const coords = feature.geometry.coordinates;
|
|
7123
7446
|
if (isNaN(lat)) {
|
|
7124
|
-
toast({ title:
|
|
7447
|
+
toast({ title: coordinateLabels.invalidLatitude, description: coordinateLabels.notANumber, variant: "destructive" });
|
|
7125
7448
|
setLatitude(coords[1].toFixed(6));
|
|
7126
7449
|
} else if (lat < -90 || lat > 90) {
|
|
7127
|
-
toast({ title:
|
|
7450
|
+
toast({ title: coordinateLabels.invalidLatitude, description: coordinateLabels.latitudeOutOfRange, variant: "destructive" });
|
|
7128
7451
|
setLatitude(coords[1].toFixed(6));
|
|
7129
7452
|
} else if (isNaN(lng) || lng < -180 || lng > 180) ;
|
|
7130
7453
|
else {
|
|
@@ -7139,10 +7462,10 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7139
7462
|
const lng = parseFloat(longitude);
|
|
7140
7463
|
const coords = feature.geometry.coordinates;
|
|
7141
7464
|
if (isNaN(lng)) {
|
|
7142
|
-
toast({ title:
|
|
7465
|
+
toast({ title: coordinateLabels.invalidLongitude, description: coordinateLabels.notANumber, variant: "destructive" });
|
|
7143
7466
|
setLongitude(coords[0].toFixed(6));
|
|
7144
7467
|
} else if (lng < -180 || lng > 180) {
|
|
7145
|
-
toast({ title:
|
|
7468
|
+
toast({ title: coordinateLabels.invalidLongitude, description: coordinateLabels.longitudeOutOfRange, variant: "destructive" });
|
|
7146
7469
|
setLongitude(coords[0].toFixed(6));
|
|
7147
7470
|
} else if (isNaN(lat) || lat < -90 || lat > 90) ;
|
|
7148
7471
|
else {
|
|
@@ -7165,16 +7488,16 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7165
7488
|
key: "temporal",
|
|
7166
7489
|
label: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
7167
7490
|
/* @__PURE__ */ jsx(Calendar, { className: "w-3 h-3 text-foreground" }),
|
|
7168
|
-
/* @__PURE__ */ jsx("span", { className: "text-[11px] font-bold uppercase tracking-wide text-foreground", children:
|
|
7491
|
+
/* @__PURE__ */ jsx("span", { className: "text-[11px] font-bold uppercase tracking-wide text-foreground", children: fieldLabels.temporal }),
|
|
7169
7492
|
(startDate || endDate) && /* @__PURE__ */ jsxs("span", { className: "text-[10px] text-muted-foreground ml-1", children: [
|
|
7170
7493
|
"(",
|
|
7171
|
-
startDate && endDate ?
|
|
7494
|
+
fieldLabels.dateCount(startDate && endDate ? 2 : 1),
|
|
7172
7495
|
")"
|
|
7173
7496
|
] })
|
|
7174
7497
|
] }),
|
|
7175
7498
|
children: /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
7176
7499
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
7177
|
-
/* @__PURE__ */ jsx("label", { className: "text-[13px] text-muted-foreground w-8 shrink-0", children:
|
|
7500
|
+
/* @__PURE__ */ jsx("label", { className: "text-[13px] text-muted-foreground w-8 shrink-0", children: fieldLabels.start }),
|
|
7178
7501
|
/* @__PURE__ */ jsx(
|
|
7179
7502
|
FeatureDatePicker,
|
|
7180
7503
|
{
|
|
@@ -7189,7 +7512,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7189
7512
|
)
|
|
7190
7513
|
] }),
|
|
7191
7514
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
7192
|
-
/* @__PURE__ */ jsx("label", { className: "text-[13px] text-muted-foreground w-8 shrink-0", children:
|
|
7515
|
+
/* @__PURE__ */ jsx("label", { className: "text-[13px] text-muted-foreground w-8 shrink-0", children: fieldLabels.end }),
|
|
7193
7516
|
/* @__PURE__ */ jsx(
|
|
7194
7517
|
FeatureDatePicker,
|
|
7195
7518
|
{
|
|
@@ -7211,11 +7534,11 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7211
7534
|
/* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
7212
7535
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
7213
7536
|
/* @__PURE__ */ jsx(Palette, { className: "w-3 h-3 text-foreground" }),
|
|
7214
|
-
/* @__PURE__ */ jsx("span", { className: "text-[11px] font-bold uppercase tracking-wide text-foreground", children:
|
|
7537
|
+
/* @__PURE__ */ jsx("span", { className: "text-[11px] font-bold uppercase tracking-wide text-foreground", children: fieldLabels.style })
|
|
7215
7538
|
] }),
|
|
7216
7539
|
feature.properties.kind === "text" && /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
7217
7540
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
7218
|
-
/* @__PURE__ */ jsx("label", { className: "text-[13px] text-muted-foreground", children:
|
|
7541
|
+
/* @__PURE__ */ jsx("label", { className: "text-[13px] text-muted-foreground", children: fieldLabels.fontSize }),
|
|
7219
7542
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
7220
7543
|
/* @__PURE__ */ jsx(
|
|
7221
7544
|
Slider,
|
|
@@ -7236,7 +7559,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7236
7559
|
] })
|
|
7237
7560
|
] }),
|
|
7238
7561
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
7239
|
-
/* @__PURE__ */ jsx("label", { className: "text-[13px] text-muted-foreground", children:
|
|
7562
|
+
/* @__PURE__ */ jsx("label", { className: "text-[13px] text-muted-foreground", children: fieldLabels.fontColor }),
|
|
7240
7563
|
/* @__PURE__ */ jsx("div", { className: "flex gap-1 flex-wrap", children: PRESET_COLORS.map((color) => /* @__PURE__ */ jsx(
|
|
7241
7564
|
"button",
|
|
7242
7565
|
{
|
|
@@ -7254,7 +7577,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7254
7577
|
)) })
|
|
7255
7578
|
] }),
|
|
7256
7579
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
7257
|
-
/* @__PURE__ */ jsx("label", { className: "text-[13px] text-muted-foreground", children:
|
|
7580
|
+
/* @__PURE__ */ jsx("label", { className: "text-[13px] text-muted-foreground", children: fieldLabels.fontWeight }),
|
|
7258
7581
|
/* @__PURE__ */ jsxs("div", { className: "flex gap-1", children: [
|
|
7259
7582
|
/* @__PURE__ */ jsx(
|
|
7260
7583
|
Button,
|
|
@@ -7268,7 +7591,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7268
7591
|
},
|
|
7269
7592
|
disabled: !isEditMode,
|
|
7270
7593
|
className: "flex-1",
|
|
7271
|
-
children:
|
|
7594
|
+
children: fieldLabels.fontWeightNormal
|
|
7272
7595
|
}
|
|
7273
7596
|
),
|
|
7274
7597
|
/* @__PURE__ */ jsx(
|
|
@@ -7283,14 +7606,14 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7283
7606
|
},
|
|
7284
7607
|
disabled: !isEditMode,
|
|
7285
7608
|
className: "flex-1",
|
|
7286
|
-
children:
|
|
7609
|
+
children: fieldLabels.fontWeightBold
|
|
7287
7610
|
}
|
|
7288
7611
|
)
|
|
7289
7612
|
] })
|
|
7290
7613
|
] })
|
|
7291
7614
|
] }),
|
|
7292
7615
|
feature.properties.kind === "arrow" && /* @__PURE__ */ jsx("div", { className: "space-y-1.5", children: /* @__PURE__ */ jsxs("div", { children: [
|
|
7293
|
-
/* @__PURE__ */ jsx("label", { className: "text-[13px] text-muted-foreground", children:
|
|
7616
|
+
/* @__PURE__ */ jsx("label", { className: "text-[13px] text-muted-foreground", children: fieldLabels.arrowSize }),
|
|
7294
7617
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
7295
7618
|
/* @__PURE__ */ jsx(
|
|
7296
7619
|
Slider,
|
|
@@ -7315,8 +7638,8 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7315
7638
|
] }) }),
|
|
7316
7639
|
feature.properties.kind !== "text" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7317
7640
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
7318
|
-
/* @__PURE__ */ jsx("label", { className: "text-[13px] text-muted-foreground shrink-0", children:
|
|
7319
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
7641
|
+
/* @__PURE__ */ jsx("label", { className: "text-[13px] text-muted-foreground shrink-0", children: fieldLabels.stroke }),
|
|
7642
|
+
/* @__PURE__ */ jsx(Tooltip, { title: fieldLabels.strokeColor, children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(
|
|
7320
7643
|
ColorPicker,
|
|
7321
7644
|
{
|
|
7322
7645
|
value: strokeColor,
|
|
@@ -7334,7 +7657,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7334
7657
|
"data-testid": "color-picker-stroke"
|
|
7335
7658
|
}
|
|
7336
7659
|
) }) }),
|
|
7337
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
7660
|
+
/* @__PURE__ */ jsx(Tooltip, { title: fieldLabels.strokeWidth, children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(
|
|
7338
7661
|
Select,
|
|
7339
7662
|
{
|
|
7340
7663
|
value: strokeWidth,
|
|
@@ -7360,7 +7683,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7360
7683
|
"data-testid": "select-stroke-width"
|
|
7361
7684
|
}
|
|
7362
7685
|
) }) }),
|
|
7363
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
7686
|
+
/* @__PURE__ */ jsx(Tooltip, { title: fieldLabels.strokeOpacity, children: /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1", children: [
|
|
7364
7687
|
/* @__PURE__ */ jsx(Blend, { className: "w-3 h-3 text-muted-foreground" }),
|
|
7365
7688
|
/* @__PURE__ */ jsx(
|
|
7366
7689
|
Select,
|
|
@@ -7392,8 +7715,8 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7392
7715
|
] }) })
|
|
7393
7716
|
] }),
|
|
7394
7717
|
(feature.geometry.type === "Polygon" || feature.properties.kind === "circle") && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
7395
|
-
/* @__PURE__ */ jsx("label", { className: "text-[13px] text-muted-foreground shrink-0", children:
|
|
7396
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
7718
|
+
/* @__PURE__ */ jsx("label", { className: "text-[13px] text-muted-foreground shrink-0", children: fieldLabels.fill }),
|
|
7719
|
+
/* @__PURE__ */ jsx(Tooltip, { title: fieldLabels.fillColor, children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(
|
|
7397
7720
|
ColorPicker,
|
|
7398
7721
|
{
|
|
7399
7722
|
value: fillColor,
|
|
@@ -7410,13 +7733,13 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7410
7733
|
"data-testid": "color-picker-fill"
|
|
7411
7734
|
}
|
|
7412
7735
|
) }) }),
|
|
7413
|
-
isEditMode && ownFill(feature.properties) && /* @__PURE__ */ jsx(Tooltip, { title:
|
|
7736
|
+
isEditMode && ownFill(feature.properties) && /* @__PURE__ */ jsx(Tooltip, { title: fieldLabels.resetFillToStroke, children: /* @__PURE__ */ jsx(
|
|
7414
7737
|
Button,
|
|
7415
7738
|
{
|
|
7416
7739
|
size: "small",
|
|
7417
7740
|
type: "text",
|
|
7418
7741
|
icon: /* @__PURE__ */ jsx(RotateCcw, { className: "w-3 h-3" }),
|
|
7419
|
-
"aria-label":
|
|
7742
|
+
"aria-label": fieldLabels.resetFillToStroke,
|
|
7420
7743
|
onClick: () => {
|
|
7421
7744
|
setFillColor(strokeColor);
|
|
7422
7745
|
handleSave({ fillColor: null });
|
|
@@ -7424,7 +7747,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7424
7747
|
"data-testid": "button-reset-fill"
|
|
7425
7748
|
}
|
|
7426
7749
|
) }),
|
|
7427
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
7750
|
+
/* @__PURE__ */ jsx(Tooltip, { title: fieldLabels.fillOpacity, children: /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1", children: [
|
|
7428
7751
|
/* @__PURE__ */ jsx(Blend, { className: "w-3 h-3 text-muted-foreground" }),
|
|
7429
7752
|
/* @__PURE__ */ jsx(
|
|
7430
7753
|
Select,
|
|
@@ -7456,7 +7779,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7456
7779
|
] }) })
|
|
7457
7780
|
] }),
|
|
7458
7781
|
feature.geometry.type === "Point" && feature.properties.kind !== "text" && pointIcon && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
7459
|
-
/* @__PURE__ */ jsx("label", { className: "text-[13px] text-muted-foreground shrink-0", children:
|
|
7782
|
+
/* @__PURE__ */ jsx("label", { className: "text-[13px] text-muted-foreground shrink-0", children: fieldLabels.iconSize }),
|
|
7460
7783
|
/* @__PURE__ */ jsx(
|
|
7461
7784
|
Slider,
|
|
7462
7785
|
{
|
|
@@ -7478,7 +7801,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7478
7801
|
] }),
|
|
7479
7802
|
/* @__PURE__ */ jsx(Divider, { className: "!my-1.5" }),
|
|
7480
7803
|
/* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
7481
|
-
/* @__PURE__ */ jsx("span", { className: "text-[11px] font-bold uppercase tracking-wide text-foreground", children:
|
|
7804
|
+
/* @__PURE__ */ jsx("span", { className: "text-[11px] font-bold uppercase tracking-wide text-foreground", children: labels.properties }),
|
|
7482
7805
|
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
7483
7806
|
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-1", children: [
|
|
7484
7807
|
/* @__PURE__ */ jsx("div", { className: "text-[13px] font-mono text-muted-foreground shrink-0 w-24 px-1 leading-6 select-none", children: "description" }),
|
|
@@ -7503,7 +7826,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7503
7826
|
value: prop.key,
|
|
7504
7827
|
onChange: (e) => handlePropertyKeyChange(index, e.target.value),
|
|
7505
7828
|
onBlur: () => handleSave(),
|
|
7506
|
-
placeholder:
|
|
7829
|
+
placeholder: fieldLabels.propertyKey,
|
|
7507
7830
|
style: { width: "6rem", flex: "0 0 6rem" },
|
|
7508
7831
|
className: "shrink-0 w-24 text-[13px] font-mono !h-6 !px-1",
|
|
7509
7832
|
"data-testid": `input-property-key-${index}`
|
|
@@ -7515,7 +7838,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7515
7838
|
value: prop.value,
|
|
7516
7839
|
onChange: (e) => handlePropertyValueChange(index, e.target.value),
|
|
7517
7840
|
onBlur: () => handleSave(),
|
|
7518
|
-
placeholder:
|
|
7841
|
+
placeholder: fieldLabels.propertyValue,
|
|
7519
7842
|
className: "flex-1 text-[13px] !h-6 !px-1.5",
|
|
7520
7843
|
"data-testid": `input-property-value-${index}`
|
|
7521
7844
|
}
|
|
@@ -7550,7 +7873,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7550
7873
|
handleAddProperty();
|
|
7551
7874
|
}
|
|
7552
7875
|
},
|
|
7553
|
-
placeholder:
|
|
7876
|
+
placeholder: fieldLabels.newProperty,
|
|
7554
7877
|
className: "flex-1 text-[13px] !h-6 !px-1.5",
|
|
7555
7878
|
"data-testid": "input-new-property-key"
|
|
7556
7879
|
}
|
|
@@ -7570,7 +7893,10 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7570
7893
|
] }),
|
|
7571
7894
|
/* @__PURE__ */ jsx(Divider, { className: "!my-1.5" }),
|
|
7572
7895
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
7573
|
-
/* @__PURE__ */
|
|
7896
|
+
/* @__PURE__ */ jsxs("span", { className: "text-[13px] text-muted-foreground", children: [
|
|
7897
|
+
labels.id,
|
|
7898
|
+
" "
|
|
7899
|
+
] }),
|
|
7574
7900
|
/* @__PURE__ */ jsxs("code", { className: "text-[13px] font-mono text-muted-foreground", children: [
|
|
7575
7901
|
feature.id.slice(0, 12),
|
|
7576
7902
|
"..."
|
|
@@ -7580,18 +7906,18 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7580
7906
|
const recordContent = /* @__PURE__ */ jsxs("div", { className: "p-2 space-y-2", children: [
|
|
7581
7907
|
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
7582
7908
|
layerName && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 min-w-0", children: [
|
|
7583
|
-
/* @__PURE__ */ jsx("span", { className: "text-[12px] text-muted-foreground", children:
|
|
7584
|
-
/* @__PURE__ */ jsx("span", { className: "text-[12px] text-foreground truncate", children:
|
|
7909
|
+
/* @__PURE__ */ jsx("span", { className: "text-[12px] text-muted-foreground", children: labels.layer }),
|
|
7910
|
+
/* @__PURE__ */ jsx("span", { className: "text-[12px] text-foreground truncate", children: shownName })
|
|
7585
7911
|
] }),
|
|
7586
|
-
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 flex-wrap", children: /* @__PURE__ */ jsx(Tag, { color: "cyan", className: "!text-[12px] !px-2.5 !py-0.5 !leading-5 !m-0 !font-semibold", children:
|
|
7912
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 flex-wrap", children: /* @__PURE__ */ jsx(Tag, { color: "cyan", className: "!text-[12px] !px-2.5 !py-0.5 !leading-5 !m-0 !font-semibold", children: labels.octostarRecord }) })
|
|
7587
7913
|
] }),
|
|
7588
7914
|
/* @__PURE__ */ jsx(Divider, { className: "!my-1.5" }),
|
|
7589
7915
|
/* @__PURE__ */ jsx("div", { className: "space-y-1", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
7590
7916
|
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
7591
|
-
/* @__PURE__ */ jsx("div", { className: "text-sm font-semibold truncate", title: String(feature.properties.entity_label || feature.properties.name || ""), children: String(feature.properties.entity_label || feature.properties.name ||
|
|
7917
|
+
/* @__PURE__ */ jsx("div", { className: "text-sm font-semibold truncate", title: String(feature.properties.entity_label || feature.properties.name || ""), children: String(feature.properties.entity_label || feature.properties.name || labels.untitledRecord) }),
|
|
7592
7918
|
feature.properties.entity_type ? /* @__PURE__ */ jsx("div", { className: "text-[11px] text-muted-foreground", children: formatEntityTypeName(String(feature.properties.entity_type)) }) : null
|
|
7593
7919
|
] }),
|
|
7594
|
-
featureRefreshProvider && /* @__PURE__ */ jsx(Tooltip, { title:
|
|
7920
|
+
featureRefreshProvider && /* @__PURE__ */ jsx(Tooltip, { title: labels.refreshFromRecord, children: /* @__PURE__ */ jsx(
|
|
7595
7921
|
Button,
|
|
7596
7922
|
{
|
|
7597
7923
|
type: "text",
|
|
@@ -7607,8 +7933,8 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7607
7933
|
/* @__PURE__ */ jsxs("div", { className: "space-y-0.5", children: [
|
|
7608
7934
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
7609
7935
|
/* @__PURE__ */ jsx(MapPin, { className: "w-3 h-3 text-muted-foreground" }),
|
|
7610
|
-
/* @__PURE__ */ jsx("label", { className: "text-xs text-muted-foreground", children:
|
|
7611
|
-
feature.geometry.type !== "Point" && /* @__PURE__ */ jsx(Tooltip, { title:
|
|
7936
|
+
/* @__PURE__ */ jsx("label", { className: "text-xs text-muted-foreground", children: fieldLabels.latLng }),
|
|
7937
|
+
feature.geometry.type !== "Point" && /* @__PURE__ */ jsx(Tooltip, { title: fieldLabels.centroidHint, children: /* @__PURE__ */ jsx("span", { className: "text-[13px] text-muted-foreground cursor-help", children: "*" }) })
|
|
7612
7938
|
] }),
|
|
7613
7939
|
/* @__PURE__ */ jsx(
|
|
7614
7940
|
LatLngFields,
|
|
@@ -7632,10 +7958,10 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7632
7958
|
const lng = parseFloat(longitude);
|
|
7633
7959
|
const coords = feature.geometry.coordinates;
|
|
7634
7960
|
if (isNaN(lat)) {
|
|
7635
|
-
toast({ title:
|
|
7961
|
+
toast({ title: coordinateLabels.invalidLatitude, description: coordinateLabels.notANumber, variant: "destructive" });
|
|
7636
7962
|
setLatitude(coords[1].toFixed(6));
|
|
7637
7963
|
} else if (lat < -90 || lat > 90) {
|
|
7638
|
-
toast({ title:
|
|
7964
|
+
toast({ title: coordinateLabels.invalidLatitude, description: coordinateLabels.latitudeOutOfRange, variant: "destructive" });
|
|
7639
7965
|
setLatitude(coords[1].toFixed(6));
|
|
7640
7966
|
} else if (isNaN(lng) || lng < -180 || lng > 180) ;
|
|
7641
7967
|
else {
|
|
@@ -7650,10 +7976,10 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7650
7976
|
const lng = parseFloat(longitude);
|
|
7651
7977
|
const coords = feature.geometry.coordinates;
|
|
7652
7978
|
if (isNaN(lng)) {
|
|
7653
|
-
toast({ title:
|
|
7979
|
+
toast({ title: coordinateLabels.invalidLongitude, description: coordinateLabels.notANumber, variant: "destructive" });
|
|
7654
7980
|
setLongitude(coords[0].toFixed(6));
|
|
7655
7981
|
} else if (lng < -180 || lng > 180) {
|
|
7656
|
-
toast({ title:
|
|
7982
|
+
toast({ title: coordinateLabels.invalidLongitude, description: coordinateLabels.longitudeOutOfRange, variant: "destructive" });
|
|
7657
7983
|
setLongitude(coords[0].toFixed(6));
|
|
7658
7984
|
} else if (isNaN(lat) || lat < -90 || lat > 90) ;
|
|
7659
7985
|
else {
|
|
@@ -7667,7 +7993,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7667
7993
|
recordProperties.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7668
7994
|
/* @__PURE__ */ jsx(Divider, { className: "!my-1.5" }),
|
|
7669
7995
|
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
7670
|
-
/* @__PURE__ */ jsx("span", { className: "text-[11px] font-bold uppercase tracking-wide text-foreground", children:
|
|
7996
|
+
/* @__PURE__ */ jsx("span", { className: "text-[11px] font-bold uppercase tracking-wide text-foreground", children: labels.properties }),
|
|
7671
7997
|
/* @__PURE__ */ jsx("div", { className: "space-y-0.5", children: recordProperties.map(({ key, value }) => /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 py-0.5", children: [
|
|
7672
7998
|
/* @__PURE__ */ jsx("span", { className: "text-[11px] text-muted-foreground shrink-0 pt-px min-w-[80px]", children: formatPropertyKey(key) }),
|
|
7673
7999
|
/* @__PURE__ */ jsx("span", { className: "text-[13px] text-foreground whitespace-pre-wrap break-words", children: value })
|
|
@@ -7707,7 +8033,10 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7707
8033
|
/* @__PURE__ */ jsx(RecordFieldsSection, { feature }),
|
|
7708
8034
|
/* @__PURE__ */ jsx(Divider, { className: "!my-1.5" }),
|
|
7709
8035
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
7710
|
-
/* @__PURE__ */
|
|
8036
|
+
/* @__PURE__ */ jsxs("span", { className: "text-[13px] text-muted-foreground", children: [
|
|
8037
|
+
labels.id,
|
|
8038
|
+
" "
|
|
8039
|
+
] }),
|
|
7711
8040
|
/* @__PURE__ */ jsxs("code", { className: "text-[13px] font-mono text-muted-foreground", children: [
|
|
7712
8041
|
feature.id.slice(0, 12),
|
|
7713
8042
|
"..."
|
|
@@ -7757,12 +8086,12 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7757
8086
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2 px-3 py-2.5 border-b border-border shrink-0 bg-background/95", children: [
|
|
7758
8087
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [
|
|
7759
8088
|
hasMultipleSelection ? /* @__PURE__ */ jsx("span", { className: "text-primary shrink-0", children: /* @__PURE__ */ jsx(Package, { className: "w-4 h-4" }) }) : null,
|
|
7760
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold truncate", children: hasMultipleSelection ?
|
|
7761
|
-
isReadOnlyLayer && /* @__PURE__ */ jsx(Tooltip, { title:
|
|
8089
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold truncate", children: hasMultipleSelection ? labels.selectedFeatures(selectedFeatures.length) : name || feature.properties.entity_label || labels.untitledFeature }),
|
|
8090
|
+
isReadOnlyLayer && /* @__PURE__ */ jsx(Tooltip, { title: labels.hpLayerHint, children: /* @__PURE__ */ jsx(Tag, { color: "green", className: "text-xs px-1.5 py-0", children: labels.hpBadge }) })
|
|
7762
8091
|
] }),
|
|
7763
8092
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 shrink-0", children: [
|
|
7764
8093
|
!hasMultipleSelection && !!((_d = feature == null ? void 0 : feature.properties) == null ? void 0 : _d.entity_id) && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7765
|
-
onOpenInNewTab && /* @__PURE__ */ jsx(Tooltip, { title:
|
|
8094
|
+
onOpenInNewTab && /* @__PURE__ */ jsx(Tooltip, { title: labels.openInNewTab, children: /* @__PURE__ */ jsx(
|
|
7766
8095
|
Button,
|
|
7767
8096
|
{
|
|
7768
8097
|
type: "text",
|
|
@@ -7780,7 +8109,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7780
8109
|
"data-testid": "button-open-in-new-tab"
|
|
7781
8110
|
}
|
|
7782
8111
|
) }),
|
|
7783
|
-
onEntityContextMenu && /* @__PURE__ */ jsx(Tooltip, { title:
|
|
8112
|
+
onEntityContextMenu && /* @__PURE__ */ jsx(Tooltip, { title: labels.actions, children: /* @__PURE__ */ jsx(
|
|
7784
8113
|
Button,
|
|
7785
8114
|
{
|
|
7786
8115
|
type: "text",
|
|
@@ -7800,10 +8129,10 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7800
8129
|
}
|
|
7801
8130
|
) })
|
|
7802
8131
|
] }),
|
|
7803
|
-
hasLayerActions && onCopyFeaturesToLayer && /* @__PURE__ */ jsx(Dropdown, { menu: { items: buildLayerMenuItems("copy") }, trigger: ["click"], placement: "bottomRight", children: /* @__PURE__ */ jsx(Tooltip, { title:
|
|
7804
|
-
hasLayerActions && onMoveFeaturesToLayer && /* @__PURE__ */ jsx(Dropdown, { menu: { items: buildLayerMenuItems("move") }, trigger: ["click"], placement: "bottomRight", children: /* @__PURE__ */ jsx(Tooltip, { title:
|
|
8132
|
+
hasLayerActions && onCopyFeaturesToLayer && /* @__PURE__ */ jsx(Dropdown, { menu: { items: buildLayerMenuItems("copy") }, trigger: ["click"], placement: "bottomRight", children: /* @__PURE__ */ jsx(Tooltip, { title: labels.copyToLayer, children: /* @__PURE__ */ jsx(Button, { type: "text", icon: /* @__PURE__ */ jsx(Copy, { className: "w-3.5 h-3.5" }), className: "!w-6 !h-6 !min-w-0 !p-0", "data-testid": "button-copy-to-layer" }) }) }),
|
|
8133
|
+
hasLayerActions && onMoveFeaturesToLayer && /* @__PURE__ */ jsx(Dropdown, { menu: { items: buildLayerMenuItems("move") }, trigger: ["click"], placement: "bottomRight", children: /* @__PURE__ */ jsx(Tooltip, { title: labels.moveToLayer, children: /* @__PURE__ */ jsx(Button, { type: "text", icon: /* @__PURE__ */ jsx(FolderInput, { className: "w-3.5 h-3.5" }), className: "!w-6 !h-6 !min-w-0 !p-0", "data-testid": "button-move-to-layer" }) }) }),
|
|
7805
8134
|
!hasMultipleSelection && feature.geometry.type === "Point" && feature.properties.kind !== "text" && isEditMode && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7806
|
-
/* @__PURE__ */ jsx(Tooltip, { title: pointIcon ?
|
|
8135
|
+
/* @__PURE__ */ jsx(Tooltip, { title: pointIcon ? labels.changeIcon : labels.setIcon, children: /* @__PURE__ */ jsx(
|
|
7807
8136
|
"button",
|
|
7808
8137
|
{
|
|
7809
8138
|
type: "button",
|
|
@@ -7838,7 +8167,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7838
8167
|
] }),
|
|
7839
8168
|
!hasMultipleSelection && feature.geometry.type === "Point" && feature.properties.kind !== "text" && !isEditMode && /* @__PURE__ */ jsx("span", { className: "shrink-0 w-9 h-9 flex items-center justify-center", children: pointIcon ? /* @__PURE__ */ jsx("span", { className: "text-xl leading-none", children: pointIcon }) : /* @__PURE__ */ jsx(PointColorDot, { color: headerDotColor, size: 24 }) }),
|
|
7840
8169
|
!hasMultipleSelection && (feature.geometry.type !== "Point" || feature.properties.kind === "text") && /* @__PURE__ */ jsx("span", { className: "text-primary shrink-0 w-9 h-9 flex items-center justify-center", children: getFeatureTypeIcon(feature.geometry.type, feature.properties.kind, "lg") }),
|
|
7841
|
-
onDeleteFeatures && /* @__PURE__ */ jsx(Tooltip, { title:
|
|
8170
|
+
onDeleteFeatures && /* @__PURE__ */ jsx(Tooltip, { title: labels.deleteFeatures(selectedFeatures.length), children: /* @__PURE__ */ jsx(Button, { type: "text", danger: true, icon: /* @__PURE__ */ jsx(Trash2, { className: "w-4 h-4" }), onClick: onDeleteFeatures, className: "!w-6 !h-6 !min-w-0 !p-0", "data-testid": "button-delete-features" }) }),
|
|
7842
8171
|
/* @__PURE__ */ jsx(Button, { type: "text", icon: /* @__PURE__ */ jsx(X, { className: "w-4 h-4" }), onClick: onClose, className: "!w-6 !h-6 !min-w-0 !p-0 shrink-0", "data-testid": "button-close-properties" })
|
|
7843
8172
|
] })
|
|
7844
8173
|
] }),
|
|
@@ -7855,12 +8184,12 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7855
8184
|
items: [
|
|
7856
8185
|
{
|
|
7857
8186
|
key: "cards",
|
|
7858
|
-
label: selectedFeatures.length >= 2 ?
|
|
8187
|
+
label: selectedFeatures.length >= 2 ? labels.entityCardsCount(selectedFeatures.length) : labels.entityCards,
|
|
7859
8188
|
children: /* @__PURE__ */ jsx("div", { className: "flex-1 min-h-0 overflow-y-auto overflow-x-hidden scrollbar-visible", children: entityCardsContent })
|
|
7860
8189
|
},
|
|
7861
8190
|
{
|
|
7862
8191
|
key: "properties",
|
|
7863
|
-
label:
|
|
8192
|
+
label: labels.properties,
|
|
7864
8193
|
disabled: hasMultipleSelection,
|
|
7865
8194
|
children: /* @__PURE__ */ jsx("div", { className: "flex-1 min-h-0 overflow-y-auto overflow-x-hidden scrollbar-visible relative", children: hasMultipleSelection ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7866
8195
|
propertiesDisabledOverlay,
|
|
@@ -7893,12 +8222,12 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7893
8222
|
children: [
|
|
7894
8223
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2 px-3 py-2.5 border-b border-border shrink-0 bg-background/95", children: [
|
|
7895
8224
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [
|
|
7896
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold truncate", children: name ||
|
|
7897
|
-
isReadOnlyLayer ? /* @__PURE__ */ jsx(Tooltip, { title:
|
|
8225
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold truncate", children: name || labels.untitledFeature }),
|
|
8226
|
+
isReadOnlyLayer ? /* @__PURE__ */ jsx(Tooltip, { title: labels.hpLayerHint, children: /* @__PURE__ */ jsx(Tag, { color: "green", className: "text-xs px-1.5 py-0", children: labels.hpBadge }) }) : !isEditMode ? /* @__PURE__ */ jsx(Tag, { className: "text-xs px-1.5 py-0", children: labels.viewBadge }) : null
|
|
7898
8227
|
] }),
|
|
7899
8228
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 shrink-0", children: [
|
|
7900
8229
|
!!((_e = feature == null ? void 0 : feature.properties) == null ? void 0 : _e.entity_id) && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7901
|
-
onOpenInNewTab && /* @__PURE__ */ jsx(Tooltip, { title:
|
|
8230
|
+
onOpenInNewTab && /* @__PURE__ */ jsx(Tooltip, { title: labels.openInNewTab, children: /* @__PURE__ */ jsx(
|
|
7902
8231
|
Button,
|
|
7903
8232
|
{
|
|
7904
8233
|
type: "text",
|
|
@@ -7916,7 +8245,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7916
8245
|
"data-testid": "button-open-in-new-tab"
|
|
7917
8246
|
}
|
|
7918
8247
|
) }),
|
|
7919
|
-
onEntityContextMenu && /* @__PURE__ */ jsx(Tooltip, { title:
|
|
8248
|
+
onEntityContextMenu && /* @__PURE__ */ jsx(Tooltip, { title: labels.actions, children: /* @__PURE__ */ jsx(
|
|
7920
8249
|
Button,
|
|
7921
8250
|
{
|
|
7922
8251
|
type: "text",
|
|
@@ -7937,7 +8266,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7937
8266
|
) })
|
|
7938
8267
|
] }),
|
|
7939
8268
|
feature.geometry.type === "Point" && feature.properties.kind !== "text" && isEditMode && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7940
|
-
/* @__PURE__ */ jsx(Tooltip, { title: pointIcon ?
|
|
8269
|
+
/* @__PURE__ */ jsx(Tooltip, { title: pointIcon ? labels.changeIcon : labels.setIcon, children: /* @__PURE__ */ jsx(
|
|
7941
8270
|
"button",
|
|
7942
8271
|
{
|
|
7943
8272
|
type: "button",
|
|
@@ -7972,7 +8301,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7972
8301
|
] }),
|
|
7973
8302
|
feature.geometry.type === "Point" && feature.properties.kind !== "text" && !isEditMode && /* @__PURE__ */ jsx("span", { className: "shrink-0 w-9 h-9 flex items-center justify-center", children: pointIcon ? /* @__PURE__ */ jsx("span", { className: "text-xl leading-none", children: pointIcon }) : /* @__PURE__ */ jsx(PointColorDot, { color: headerDotColor, size: 24 }) }),
|
|
7974
8303
|
(feature.geometry.type !== "Point" || feature.properties.kind === "text") && /* @__PURE__ */ jsx("span", { className: "text-primary shrink-0 w-9 h-9 flex items-center justify-center", children: getFeatureTypeIcon(feature.geometry.type, feature.properties.kind, "lg") }),
|
|
7975
|
-
onDeleteFeatures && /* @__PURE__ */ jsx(Tooltip, { title:
|
|
8304
|
+
onDeleteFeatures && /* @__PURE__ */ jsx(Tooltip, { title: labels.deleteFeature, children: /* @__PURE__ */ jsx(Button, { type: "text", danger: true, icon: /* @__PURE__ */ jsx(Trash2, { className: "w-4 h-4" }), onClick: onDeleteFeatures, className: "!w-6 !h-6 !min-w-0 !p-0", "data-testid": "button-delete-features" }) }),
|
|
7976
8305
|
/* @__PURE__ */ jsx(Button, { type: "text", icon: /* @__PURE__ */ jsx(X, { className: "w-4 h-4" }), onClick: onClose, className: "!w-6 !h-6 !min-w-0 !p-0 shrink-0", "data-testid": "button-close-properties" })
|
|
7977
8306
|
] })
|
|
7978
8307
|
] }),
|
|
@@ -7984,6 +8313,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7984
8313
|
return portalIfAnchored(panelJsx);
|
|
7985
8314
|
}
|
|
7986
8315
|
function StatusIndicator({ featureCount, selectedCount = 0 }) {
|
|
8316
|
+
const { canvas: labels } = useMapLabels();
|
|
7987
8317
|
const hasSelection = selectedCount > 0;
|
|
7988
8318
|
if (!hasSelection) {
|
|
7989
8319
|
return null;
|
|
@@ -7996,16 +8326,9 @@ function StatusIndicator({ featureCount, selectedCount = 0 }) {
|
|
|
7996
8326
|
"aria-live": "polite",
|
|
7997
8327
|
"data-testid": "status-indicator",
|
|
7998
8328
|
children: [
|
|
7999
|
-
/* @__PURE__ */
|
|
8000
|
-
featureCount,
|
|
8001
|
-
" feature",
|
|
8002
|
-
featureCount !== 1 ? "s" : ""
|
|
8003
|
-
] }),
|
|
8329
|
+
/* @__PURE__ */ jsx(Tag, { className: "font-mono text-xs !m-0", "data-testid": "badge-feature-count", children: labels.statusFeatureCount(featureCount) }),
|
|
8004
8330
|
/* @__PURE__ */ jsx("div", { className: "w-px h-4 bg-border" }),
|
|
8005
|
-
/* @__PURE__ */
|
|
8006
|
-
selectedCount,
|
|
8007
|
-
" selected"
|
|
8008
|
-
] })
|
|
8331
|
+
/* @__PURE__ */ jsx(Tag, { className: "font-mono text-xs !m-0", "data-testid": "badge-selected-count", children: labels.statusSelectedCount(selectedCount) })
|
|
8009
8332
|
]
|
|
8010
8333
|
}
|
|
8011
8334
|
);
|
|
@@ -8182,12 +8505,6 @@ function useTimelineStore(selector) {
|
|
|
8182
8505
|
const TIMEBAR_HEIGHT = 158;
|
|
8183
8506
|
const EMPTY_TIMEBAR_HEIGHT = 46;
|
|
8184
8507
|
const TIMEBAR_BOTTOM_OFFSET = 12;
|
|
8185
|
-
const DEFAULT_LABELS = {
|
|
8186
|
-
play: "Play",
|
|
8187
|
-
pause: "Pause",
|
|
8188
|
-
reset: "Reset timeline",
|
|
8189
|
-
cumulative: "Cumulative: keep what has appeared"
|
|
8190
|
-
};
|
|
8191
8508
|
const MINUTE_MS = 6e4;
|
|
8192
8509
|
const HOUR_MS = 36e5;
|
|
8193
8510
|
const DAY_MS = 864e5;
|
|
@@ -8331,7 +8648,7 @@ function formatDateTime(date) {
|
|
|
8331
8648
|
minute: "2-digit"
|
|
8332
8649
|
});
|
|
8333
8650
|
}
|
|
8334
|
-
function Histogram({ bins, maxCount, colorGroupedBins, selectedBins }) {
|
|
8651
|
+
function Histogram({ labels, bins, maxCount, colorGroupedBins, selectedBins }) {
|
|
8335
8652
|
const [hoveredBin, setHoveredBin] = useState(null);
|
|
8336
8653
|
const containerRef = useRef(null);
|
|
8337
8654
|
if (bins.length === 0 || maxCount === 0) return null;
|
|
@@ -8387,18 +8704,14 @@ function Histogram({ bins, maxCount, colorGroupedBins, selectedBins }) {
|
|
|
8387
8704
|
},
|
|
8388
8705
|
children: [
|
|
8389
8706
|
/* @__PURE__ */ jsx("div", { className: "font-medium", children: formatDateTime(bins[hoveredBin].start) }),
|
|
8390
|
-
/* @__PURE__ */
|
|
8391
|
-
bins[hoveredBin].count,
|
|
8392
|
-
" event",
|
|
8393
|
-
bins[hoveredBin].count !== 1 ? "s" : "",
|
|
8394
|
-
!!(selectedBins == null ? void 0 : selectedBins[hoveredBin]) && ` (${selectedBins[hoveredBin]} selected)`
|
|
8395
|
-
] })
|
|
8707
|
+
/* @__PURE__ */ jsx("div", { className: "text-muted-foreground", children: (selectedBins == null ? void 0 : selectedBins[hoveredBin]) ? labels.binEventsWithSelection({ count: bins[hoveredBin].count, selected: selectedBins[hoveredBin] }) : labels.binEvents(bins[hoveredBin].count) })
|
|
8396
8708
|
]
|
|
8397
8709
|
}
|
|
8398
8710
|
)
|
|
8399
8711
|
] });
|
|
8400
8712
|
}
|
|
8401
8713
|
function TimebarToggle({ onClick, hasData }) {
|
|
8714
|
+
const { timebar: labels } = useMapLabels();
|
|
8402
8715
|
if (!hasData) return null;
|
|
8403
8716
|
return /* @__PURE__ */ jsx(
|
|
8404
8717
|
Button,
|
|
@@ -8407,7 +8720,7 @@ function TimebarToggle({ onClick, hasData }) {
|
|
|
8407
8720
|
icon: /* @__PURE__ */ jsx(Clock, { className: "w-5 h-5" }),
|
|
8408
8721
|
onClick,
|
|
8409
8722
|
className: "relative !w-9 !h-9 !min-w-0 !p-0",
|
|
8410
|
-
"aria-label":
|
|
8723
|
+
"aria-label": labels.toggle,
|
|
8411
8724
|
"data-testid": "button-timeline-toggle"
|
|
8412
8725
|
}
|
|
8413
8726
|
);
|
|
@@ -8423,7 +8736,7 @@ function Timebar({
|
|
|
8423
8736
|
formatCount: formatCount2,
|
|
8424
8737
|
labels: labelOverrides
|
|
8425
8738
|
}) {
|
|
8426
|
-
const labels = { ...
|
|
8739
|
+
const labels = { ...useMapLabels().timebar, ...labelOverrides };
|
|
8427
8740
|
const {
|
|
8428
8741
|
isEnabled,
|
|
8429
8742
|
hasTemporalData,
|
|
@@ -8621,6 +8934,7 @@ function Timebar({
|
|
|
8621
8934
|
/* @__PURE__ */ jsx(
|
|
8622
8935
|
Histogram,
|
|
8623
8936
|
{
|
|
8937
|
+
labels,
|
|
8624
8938
|
bins: histogramBins,
|
|
8625
8939
|
maxCount: maxBinCount,
|
|
8626
8940
|
colorGroupedBins,
|
|
@@ -8695,7 +9009,7 @@ function Timebar({
|
|
|
8695
9009
|
children: formatCount2 ? formatCount2({
|
|
8696
9010
|
total: temporalFeatures.length,
|
|
8697
9011
|
selected: hasSelection ? selectedTemporalFeatures.length : null
|
|
8698
|
-
}) : hasSelection ?
|
|
9012
|
+
}) : hasSelection ? labels.selectedCount({ selected: selectedTemporalFeatures.length, total: temporalFeatures.length }) : labels.featureCount(temporalFeatures.length)
|
|
8699
9013
|
}
|
|
8700
9014
|
)
|
|
8701
9015
|
] }),
|
|
@@ -8711,6 +9025,7 @@ function Timebar({
|
|
|
8711
9025
|
);
|
|
8712
9026
|
}
|
|
8713
9027
|
function MapDropZone({ onDrop, onDropFile, children }) {
|
|
9028
|
+
const { dropZone: labels } = useMapLabels();
|
|
8714
9029
|
const [isDragOver, setIsDragOver] = useState(false);
|
|
8715
9030
|
const handleDragOver = useCallback((e) => {
|
|
8716
9031
|
e.preventDefault();
|
|
@@ -8786,8 +9101,8 @@ function MapDropZone({ onDrop, onDropFile, children }) {
|
|
|
8786
9101
|
"data-testid": "map-drop-overlay",
|
|
8787
9102
|
children: /* @__PURE__ */ jsxs("div", { className: "bg-background/95 rounded-lg p-6 shadow-lg flex flex-col items-center gap-3", children: [
|
|
8788
9103
|
/* @__PURE__ */ jsx(Upload, { className: "w-10 h-10 text-primary" }),
|
|
8789
|
-
/* @__PURE__ */ jsx("span", { className: "text-lg font-medium", children:
|
|
8790
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children:
|
|
9104
|
+
/* @__PURE__ */ jsx("span", { className: "text-lg font-medium", children: labels.title }),
|
|
9105
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: labels.subtitle })
|
|
8791
9106
|
] })
|
|
8792
9107
|
}
|
|
8793
9108
|
)
|
|
@@ -9477,6 +9792,20 @@ function suggestTraceGroupField(features, fields, timelineFields) {
|
|
|
9477
9792
|
};
|
|
9478
9793
|
return ((_a = candidates.find((c) => splitsIntoTracks(c.field))) == null ? void 0 : _a.field) ?? null;
|
|
9479
9794
|
}
|
|
9795
|
+
function deepClone(value) {
|
|
9796
|
+
try {
|
|
9797
|
+
return structuredClone(value);
|
|
9798
|
+
} catch {
|
|
9799
|
+
return JSON.parse(JSON.stringify(value));
|
|
9800
|
+
}
|
|
9801
|
+
}
|
|
9802
|
+
function cloneFeatures(features) {
|
|
9803
|
+
try {
|
|
9804
|
+
return structuredClone(features);
|
|
9805
|
+
} catch {
|
|
9806
|
+
return features.map((f) => deepClone(f));
|
|
9807
|
+
}
|
|
9808
|
+
}
|
|
9480
9809
|
function numberEquals(a, b) {
|
|
9481
9810
|
return a === b || !Number.isFinite(a) && !Number.isFinite(b);
|
|
9482
9811
|
}
|
|
@@ -9676,7 +10005,7 @@ const SELECTION_OVERLAY_LAYER_IDS = {
|
|
|
9676
10005
|
polygon: "selection-overlay-polygon",
|
|
9677
10006
|
label: "selection-overlay-label"
|
|
9678
10007
|
};
|
|
9679
|
-
function buildSelectionOverlayStack() {
|
|
10008
|
+
function buildSelectionOverlayStack(newTextLabel) {
|
|
9680
10009
|
const source = SELECTION_OVERLAY_SOURCE_ID;
|
|
9681
10010
|
return [
|
|
9682
10011
|
{
|
|
@@ -9735,7 +10064,7 @@ function buildSelectionOverlayStack() {
|
|
|
9735
10064
|
// A selected host feature keeps its label in the shared `host-labels` layer.
|
|
9736
10065
|
filter: NOT_HOST_FILTER,
|
|
9737
10066
|
layout: {
|
|
9738
|
-
...buildCustomLabelLayout(),
|
|
10067
|
+
...buildCustomLabelLayout(newTextLabel),
|
|
9739
10068
|
// Never hidden by the auto-label density cap, which only flips the
|
|
9740
10069
|
// unpinned base layer: with base labels off, the selected ones stay.
|
|
9741
10070
|
visibility: "visible",
|
|
@@ -9759,6 +10088,103 @@ function buildSelectionOverlayData(ids, styleFor) {
|
|
|
9759
10088
|
});
|
|
9760
10089
|
return { type: "FeatureCollection", features };
|
|
9761
10090
|
}
|
|
10091
|
+
function renderedFeatureId(f) {
|
|
10092
|
+
var _a;
|
|
10093
|
+
const fromProps = (_a = f.properties) == null ? void 0 : _a.id;
|
|
10094
|
+
if (fromProps !== void 0 && fromProps !== null && fromProps !== "") return String(fromProps);
|
|
10095
|
+
if (f.id !== void 0 && f.id !== null && f.id !== "") return String(f.id);
|
|
10096
|
+
return null;
|
|
10097
|
+
}
|
|
10098
|
+
function resolveTooltipFeature(rendered, lookup) {
|
|
10099
|
+
const id = renderedFeatureId(rendered);
|
|
10100
|
+
const stored = id === null ? null : lookup(id);
|
|
10101
|
+
if (stored) {
|
|
10102
|
+
return deepClone({
|
|
10103
|
+
type: "Feature",
|
|
10104
|
+
geometry: stored.geometry,
|
|
10105
|
+
properties: stored.properties ?? {},
|
|
10106
|
+
id: stored.id
|
|
10107
|
+
});
|
|
10108
|
+
}
|
|
10109
|
+
return {
|
|
10110
|
+
type: "Feature",
|
|
10111
|
+
geometry: rendered.geometry,
|
|
10112
|
+
properties: { ...rendered.properties ?? {} },
|
|
10113
|
+
id: rendered.id
|
|
10114
|
+
};
|
|
10115
|
+
}
|
|
10116
|
+
const DEFAULT_POINT_RADIUS = 5;
|
|
10117
|
+
const DEFAULT_ICON_SIZE = 24;
|
|
10118
|
+
const MAX_POINT_RADIUS = 24;
|
|
10119
|
+
const SAME_SPOT_PX = 1;
|
|
10120
|
+
const CROWD = 16;
|
|
10121
|
+
const SCAN_LIMIT = 256;
|
|
10122
|
+
const isDot = (m) => m.center !== null;
|
|
10123
|
+
const distance = (a, b) => Math.hypot(a.x - b.x, a.y - b.y);
|
|
10124
|
+
function paintedRadius(f) {
|
|
10125
|
+
var _a, _b;
|
|
10126
|
+
const p = f.properties ?? {};
|
|
10127
|
+
const hidden = ((_a = f.state) == null ? void 0 : _a[TIMELINE_HIDDEN_KEY]) === true || p.isHiddenByCluster === 1 || p.isHiddenByHeatmap === 1;
|
|
10128
|
+
if (hidden) return 0;
|
|
10129
|
+
if (typeof p.icon === "string" && p.icon !== "") {
|
|
10130
|
+
return typeof p.iconSize === "number" && Number.isFinite(p.iconSize) ? p.iconSize / 2 : DEFAULT_ICON_SIZE / 2;
|
|
10131
|
+
}
|
|
10132
|
+
const r = ((_b = f.state) == null ? void 0 : _b[TRACE_ENDPOINT_KEY]) === true ? p._endpointRadius : p.pointRadius;
|
|
10133
|
+
return typeof r === "number" && Number.isFinite(r) ? r : DEFAULT_POINT_RADIUS;
|
|
10134
|
+
}
|
|
10135
|
+
function labelPriority(f) {
|
|
10136
|
+
var _a;
|
|
10137
|
+
const v = (_a = f.properties) == null ? void 0 : _a._labelPriority;
|
|
10138
|
+
return typeof v === "number" && Number.isFinite(v) ? v : DEFAULT_LABEL_PRIORITY;
|
|
10139
|
+
}
|
|
10140
|
+
function members(features, project, maxDots = Infinity) {
|
|
10141
|
+
const seen = /* @__PURE__ */ new Set();
|
|
10142
|
+
const out = [];
|
|
10143
|
+
let dots = 0;
|
|
10144
|
+
for (const feature of features) {
|
|
10145
|
+
const id = renderedFeatureId(feature);
|
|
10146
|
+
if (id === null || seen.has(id)) continue;
|
|
10147
|
+
if (seen.size === SCAN_LIMIT || dots === maxDots) return { members: out, cut: true };
|
|
10148
|
+
seen.add(id);
|
|
10149
|
+
if (feature.geometry.type !== "Point") {
|
|
10150
|
+
out.push({ id, feature, center: null, radius: 0 });
|
|
10151
|
+
continue;
|
|
10152
|
+
}
|
|
10153
|
+
const radius = paintedRadius(feature);
|
|
10154
|
+
if (radius <= 0) continue;
|
|
10155
|
+
out.push({ id, feature, center: project(feature.geometry.coordinates), radius });
|
|
10156
|
+
dots++;
|
|
10157
|
+
}
|
|
10158
|
+
return { members: out, cut: false };
|
|
10159
|
+
}
|
|
10160
|
+
function searchBox(dot) {
|
|
10161
|
+
const reach = dot.radius + MAX_POINT_RADIUS;
|
|
10162
|
+
return [[dot.center.x - reach, dot.center.y - reach], [dot.center.x + reach, dot.center.y + reach]];
|
|
10163
|
+
}
|
|
10164
|
+
function featureStackAt(point2, hits, queryBox, project) {
|
|
10165
|
+
const hit = members(hits, project, CROWD + 1).members;
|
|
10166
|
+
const under = hit.filter(isDot);
|
|
10167
|
+
if (under.length === 0) return { features: hit.length > 0 ? [hit[0].feature] : [], more: false };
|
|
10168
|
+
const fromCursor = (d) => distance(d.center, point2);
|
|
10169
|
+
const byCursor = (a, b) => fromCursor(a) - fromCursor(b);
|
|
10170
|
+
let dots;
|
|
10171
|
+
let more;
|
|
10172
|
+
if (under.length > CROWD) {
|
|
10173
|
+
dots = under.sort(byCursor).slice(0, CROWD);
|
|
10174
|
+
more = true;
|
|
10175
|
+
} else {
|
|
10176
|
+
const nearest = under.reduce((a, b) => fromCursor(b) < fromCursor(a) ? b : a);
|
|
10177
|
+
const taken = new Set(under.map((d) => d.id));
|
|
10178
|
+
const box = members(queryBox(searchBox(nearest)), project);
|
|
10179
|
+
const neighbours = box.members.filter(isDot).filter((m) => !taken.has(m.id) && distance(m.center, nearest.center) <= m.radius + nearest.radius);
|
|
10180
|
+
dots = [...under, ...neighbours].sort(byCursor);
|
|
10181
|
+
more = box.cut;
|
|
10182
|
+
}
|
|
10183
|
+
const spot = dots[0].center;
|
|
10184
|
+
const onSpot = dots.filter((d) => distance(d.center, spot) < SAME_SPOT_PX).sort((a, b) => labelPriority(a.feature) - labelPriority(b.feature));
|
|
10185
|
+
const rest = dots.filter((d) => distance(d.center, spot) >= SAME_SPOT_PX);
|
|
10186
|
+
return { features: [...onSpot, ...rest].map((d) => d.feature), more };
|
|
10187
|
+
}
|
|
9762
10188
|
function computeBubbleDomain(values) {
|
|
9763
10189
|
let min = Infinity;
|
|
9764
10190
|
let max = -Infinity;
|
|
@@ -9854,12 +10280,11 @@ function createClusterGradientManager(map, sourceId, options) {
|
|
|
9854
10280
|
};
|
|
9855
10281
|
}
|
|
9856
10282
|
const OTHER_BUCKET_KEY = "__other__";
|
|
9857
|
-
const OTHER_BUCKET_LABEL = "Other";
|
|
9858
10283
|
const OTHER_BUCKET_COLOR = "#9ca3af";
|
|
9859
|
-
function toDisplayName(name) {
|
|
9860
|
-
return name === OTHER_BUCKET_KEY ?
|
|
10284
|
+
function toDisplayName(name, otherLabel) {
|
|
10285
|
+
return name === OTHER_BUCKET_KEY ? otherLabel : name;
|
|
9861
10286
|
}
|
|
9862
|
-
function createPieSVG(categories, total, size = 44, onSliceHover, badgeValue) {
|
|
10287
|
+
function createPieSVG(categories, total, otherLabel, size = 44, onSliceHover, badgeValue) {
|
|
9863
10288
|
const container = document.createElement("div");
|
|
9864
10289
|
container.style.width = `${size}px`;
|
|
9865
10290
|
container.style.height = `${size}px`;
|
|
@@ -9879,7 +10304,7 @@ function createPieSVG(categories, total, size = 44, onSliceHover, badgeValue) {
|
|
|
9879
10304
|
svg.appendChild(bgCircle);
|
|
9880
10305
|
const slicesSum = categories.reduce((s, c) => s + c.count, 0);
|
|
9881
10306
|
const remainder = Math.max(0, total - slicesSum);
|
|
9882
|
-
const renderList = remainder > 0 ? [...categories, { name: "__remainder__", displayName:
|
|
10307
|
+
const renderList = remainder > 0 ? [...categories, { name: "__remainder__", displayName: otherLabel, count: remainder, color: OTHER_BUCKET_COLOR }] : categories;
|
|
9883
10308
|
const nonZeroSlices = renderList.filter((c) => c.count > 0);
|
|
9884
10309
|
const isSingleFullSlice = nonZeroSlices.length === 1 && nonZeroSlices[0].count >= total;
|
|
9885
10310
|
if (isSingleFullSlice) {
|
|
@@ -10017,8 +10442,8 @@ function hideTooltip() {
|
|
|
10017
10442
|
function fingerprintCluster(pointCount, counts2, size, badgeValue) {
|
|
10018
10443
|
return `${size}|${pointCount}|${badgeValue ?? ""}|${counts2.join(",")}`;
|
|
10019
10444
|
}
|
|
10020
|
-
function buildPieElement(categories, pointCount, size, source, clusterId, map, coords, badgeValue) {
|
|
10021
|
-
const el = createPieSVG(categories, pointCount, size, (cat, event) => {
|
|
10445
|
+
function buildPieElement(categories, pointCount, otherLabel, size, source, clusterId, map, coords, badgeValue) {
|
|
10446
|
+
const el = createPieSVG(categories, pointCount, otherLabel, size, (cat, event) => {
|
|
10022
10447
|
if (cat) {
|
|
10023
10448
|
showTooltip(cat, event.clientX, event.clientY);
|
|
10024
10449
|
} else {
|
|
@@ -10035,7 +10460,7 @@ function buildPieElement(categories, pointCount, size, source, clusterId, map, c
|
|
|
10035
10460
|
});
|
|
10036
10461
|
return el;
|
|
10037
10462
|
}
|
|
10038
|
-
function renderClusterPies(map, sourceId, categoryValues, categoryColorMap, markers) {
|
|
10463
|
+
function renderClusterPies(map, sourceId, categoryValues, categoryColorMap, markers, otherLabel) {
|
|
10039
10464
|
const source = map.getSource(sourceId);
|
|
10040
10465
|
if (!source) return;
|
|
10041
10466
|
const clusters = map.querySourceFeatures(sourceId, {
|
|
@@ -10059,7 +10484,7 @@ function renderClusterPies(map, sourceId, categoryValues, categoryColorMap, mark
|
|
|
10059
10484
|
});
|
|
10060
10485
|
const categories = categoryValues.map((cat, i) => ({
|
|
10061
10486
|
name: cat,
|
|
10062
|
-
displayName: toDisplayName(cat),
|
|
10487
|
+
displayName: toDisplayName(cat, otherLabel),
|
|
10063
10488
|
count: allCounts[i],
|
|
10064
10489
|
color: categoryColorMap[cat] || "#3b82f6"
|
|
10065
10490
|
})).filter((c) => c.count > 0);
|
|
@@ -10070,7 +10495,7 @@ function renderClusterPies(map, sourceId, categoryValues, categoryColorMap, mark
|
|
|
10070
10495
|
existing.marker.setLngLat(coords);
|
|
10071
10496
|
return;
|
|
10072
10497
|
}
|
|
10073
|
-
const el = buildPieElement(categories, pointCount, size, source, clusterId, map, coords, badgeValue);
|
|
10498
|
+
const el = buildPieElement(categories, pointCount, otherLabel, size, source, clusterId, map, coords, badgeValue);
|
|
10074
10499
|
if (existing) {
|
|
10075
10500
|
existing.marker.remove();
|
|
10076
10501
|
}
|
|
@@ -10084,7 +10509,7 @@ function renderClusterPies(map, sourceId, categoryValues, categoryColorMap, mark
|
|
|
10084
10509
|
}
|
|
10085
10510
|
});
|
|
10086
10511
|
}
|
|
10087
|
-
function createClusterPieManager(map, sourceId, categoryValues, categoryColorMap) {
|
|
10512
|
+
function createClusterPieManager(map, sourceId, categoryValues, categoryColorMap, otherLabel = DEFAULT_MAP_LABELS.canvas.clusterOther) {
|
|
10088
10513
|
const markers = /* @__PURE__ */ new Map();
|
|
10089
10514
|
let updateScheduled = false;
|
|
10090
10515
|
function scheduleUpdate() {
|
|
@@ -10092,7 +10517,7 @@ function createClusterPieManager(map, sourceId, categoryValues, categoryColorMap
|
|
|
10092
10517
|
updateScheduled = true;
|
|
10093
10518
|
requestAnimationFrame(() => {
|
|
10094
10519
|
updateScheduled = false;
|
|
10095
|
-
renderClusterPies(map, sourceId, categoryValues, categoryColorMap, markers);
|
|
10520
|
+
renderClusterPies(map, sourceId, categoryValues, categoryColorMap, markers, otherLabel);
|
|
10096
10521
|
});
|
|
10097
10522
|
}
|
|
10098
10523
|
function onData(e) {
|
|
@@ -10116,6 +10541,7 @@ function createClusterPieManager(map, sourceId, categoryValues, categoryColorMap
|
|
|
10116
10541
|
}
|
|
10117
10542
|
function ClusterPieManager(props) {
|
|
10118
10543
|
const { map, sourceId, categoryValues, categoryColorMap, visible } = props;
|
|
10544
|
+
const otherLabel = useMapLabels().canvas.clusterOther;
|
|
10119
10545
|
const markersRef = useRef(/* @__PURE__ */ new Map());
|
|
10120
10546
|
const updateScheduled = useRef(false);
|
|
10121
10547
|
const updateMarkers = useCallback(() => {
|
|
@@ -10124,8 +10550,8 @@ function ClusterPieManager(props) {
|
|
|
10124
10550
|
markersRef.current.clear();
|
|
10125
10551
|
return;
|
|
10126
10552
|
}
|
|
10127
|
-
renderClusterPies(map, sourceId, categoryValues, categoryColorMap, markersRef.current);
|
|
10128
|
-
}, [map, sourceId, categoryValues, categoryColorMap, visible]);
|
|
10553
|
+
renderClusterPies(map, sourceId, categoryValues, categoryColorMap, markersRef.current, otherLabel);
|
|
10554
|
+
}, [map, sourceId, categoryValues, categoryColorMap, visible, otherLabel]);
|
|
10129
10555
|
useEffect(() => {
|
|
10130
10556
|
if (!map) return;
|
|
10131
10557
|
const scheduleUpdate = () => {
|
|
@@ -10377,6 +10803,16 @@ function extract3DFlightPaths(features, fields) {
|
|
|
10377
10803
|
});
|
|
10378
10804
|
return paths;
|
|
10379
10805
|
}
|
|
10806
|
+
function describeIngestError(result, labels) {
|
|
10807
|
+
switch (result.code) {
|
|
10808
|
+
case "invalid-format":
|
|
10809
|
+
return labels.invalidFormat;
|
|
10810
|
+
case "empty":
|
|
10811
|
+
return labels.noFeatures;
|
|
10812
|
+
default:
|
|
10813
|
+
return result.message;
|
|
10814
|
+
}
|
|
10815
|
+
}
|
|
10380
10816
|
const CAP_NOTICE_INTERVAL_MS = 5e3;
|
|
10381
10817
|
function basemapInsertAnchor(map) {
|
|
10382
10818
|
if (map.getLayer("satellite-layer")) return "satellite-layer";
|
|
@@ -10469,8 +10905,12 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
10469
10905
|
timelineFields,
|
|
10470
10906
|
keepTimebarExtra = false,
|
|
10471
10907
|
onOpenInNewTab,
|
|
10472
|
-
onEntityContextMenu
|
|
10908
|
+
onEntityContextMenu,
|
|
10909
|
+
labels: labelsProp
|
|
10473
10910
|
}, ref) {
|
|
10911
|
+
const labels = labelsProp ?? DEFAULT_MAP_LABELS;
|
|
10912
|
+
const labelsRef = useRef(labels);
|
|
10913
|
+
labelsRef.current = labels;
|
|
10474
10914
|
const mapContainer = useRef(null);
|
|
10475
10915
|
const [resolvedEndpoints] = useState(() => resolveEndpoints(endpoints));
|
|
10476
10916
|
const [baseMapStyle] = useState(() => {
|
|
@@ -10491,7 +10931,7 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
10491
10931
|
const tracePopupRef = useRef(null);
|
|
10492
10932
|
const tooltipElRef = useRef(null);
|
|
10493
10933
|
const layersRef = useRef([
|
|
10494
|
-
{ id:
|
|
10934
|
+
{ id: DEFAULT_LAYER_ID, name: DEFAULT_LAYER_NAME, visible: true, featureIds: [] }
|
|
10495
10935
|
]);
|
|
10496
10936
|
const activeEditingLayerIdRef = useRef("default");
|
|
10497
10937
|
const isApiAddingRef = useRef(false);
|
|
@@ -10507,12 +10947,16 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
10507
10947
|
var _a;
|
|
10508
10948
|
return ((_a = MAP_STYLES.find((style) => style.id === id)) == null ? void 0 : _a.icon) ?? Map$1;
|
|
10509
10949
|
};
|
|
10510
|
-
|
|
10950
|
+
const builtIns = resolvedEndpoints.builtInBasemaps.map((basemap) => ({
|
|
10951
|
+
id: basemap.id,
|
|
10952
|
+
name: basemap.name ?? builtInBasemapName(basemap.id, labels.mapOptions) ?? basemap.id
|
|
10953
|
+
}));
|
|
10954
|
+
return resolveBasemapChoices(basemapOrder, customBasemaps, builtIns).map((choice) => ({
|
|
10511
10955
|
id: choice.id,
|
|
10512
10956
|
name: choice.name,
|
|
10513
10957
|
icon: iconFor(choice.id)
|
|
10514
10958
|
}));
|
|
10515
|
-
}, [basemapOrder, customBasemaps, resolvedEndpoints]);
|
|
10959
|
+
}, [basemapOrder, customBasemaps, resolvedEndpoints, labels.mapOptions]);
|
|
10516
10960
|
const loadingBasemaps = useRef(/* @__PURE__ */ new Set());
|
|
10517
10961
|
const customBasemapRegistry = useRef(/* @__PURE__ */ new Map());
|
|
10518
10962
|
const clusterPieManagers = useRef(/* @__PURE__ */ new Map());
|
|
@@ -10545,7 +10989,7 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
10545
10989
|
const [autoFocusLabel, setAutoFocusLabel] = useState(false);
|
|
10546
10990
|
const [showLayers, setShowLayers] = useState(false);
|
|
10547
10991
|
const [layers, setLayers] = useState([
|
|
10548
|
-
{ id:
|
|
10992
|
+
{ id: DEFAULT_LAYER_ID, name: DEFAULT_LAYER_NAME, visible: true, featureIds: [] }
|
|
10549
10993
|
]);
|
|
10550
10994
|
const [activeEditingLayerId, setActiveEditingLayerId] = useState("default");
|
|
10551
10995
|
const history = useMapHistory();
|
|
@@ -10627,7 +11071,8 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
10627
11071
|
if (last != null && now - last < CAP_NOTICE_INTERVAL_MS) return;
|
|
10628
11072
|
capNoticeRef.current.set(key, now);
|
|
10629
11073
|
}
|
|
10630
|
-
|
|
11074
|
+
const layerName = shownLayerName({ id: info.layerId ?? "", name: info.layerName }, labelsRef.current.canvas);
|
|
11075
|
+
toast(formatFeatureCapToast({ ...info, layerName }, labelsRef.current.featureCap));
|
|
10631
11076
|
}, [onFeaturesTruncated, toast]);
|
|
10632
11077
|
const countExisting = useCallback(
|
|
10633
11078
|
(layer) => countLayerFeatures(layer, {
|
|
@@ -11434,7 +11879,7 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
11434
11879
|
const generation = ++state.generation;
|
|
11435
11880
|
state.inFlightFingerprint = fingerprint;
|
|
11436
11881
|
const passStart = performance.now();
|
|
11437
|
-
const progress = (_a = ingestProgressStoreRef.current) == null ? void 0 : _a.begin(layer.
|
|
11882
|
+
const progress = (_a = ingestProgressStoreRef.current) == null ? void 0 : _a.begin(shownLayerName(layer, labelsRef.current.canvas), { activity: "rendering" });
|
|
11438
11883
|
progress == null ? void 0 : progress.setTotal(features.length);
|
|
11439
11884
|
setLayerImporting(layer.id, true);
|
|
11440
11885
|
const ranges = layerFieldRanges(layer.visualConfig, (visit) => {
|
|
@@ -11985,7 +12430,10 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
11985
12430
|
map.current = mapInstance;
|
|
11986
12431
|
draw.current = drawInstance;
|
|
11987
12432
|
mapInstance.addSource(SHARED_SOURCE_ID, customSourceSpec());
|
|
11988
|
-
const sharedStack = buildCustomLayerStack(SHARED_SOURCE_ID, CUSTOM_LAYER_ROLES, {
|
|
12433
|
+
const sharedStack = buildCustomLayerStack(SHARED_SOURCE_ID, CUSTOM_LAYER_ROLES, {
|
|
12434
|
+
labelsVisible: false,
|
|
12435
|
+
newTextLabel: labelsRef.current.canvas.newTextLabel
|
|
12436
|
+
});
|
|
11989
12437
|
sharedStack.forEach((spec) => mapInstance.addLayer(spec));
|
|
11990
12438
|
const styleHost = {
|
|
11991
12439
|
getSource: (id) => mapInstance.getSource(id),
|
|
@@ -12014,6 +12462,7 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
12014
12462
|
return (_a2 = unbindHoverHandlersRef.current) == null ? void 0 : _a2.call(unbindHoverHandlersRef, id);
|
|
12015
12463
|
}),
|
|
12016
12464
|
labelsVisible: () => lastLabelVisibility.current,
|
|
12465
|
+
newTextLabel: () => labelsRef.current.canvas.newTextLabel,
|
|
12017
12466
|
hostIconInteractive: () => hostIconBoundRef.current
|
|
12018
12467
|
});
|
|
12019
12468
|
shardRegistryRef.current.registerShared(sharedStack.map((spec) => spec.id));
|
|
@@ -12091,7 +12540,7 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
12091
12540
|
data: { type: "FeatureCollection", features: [] },
|
|
12092
12541
|
maxzoom: 22
|
|
12093
12542
|
});
|
|
12094
|
-
buildSelectionOverlayStack().forEach((spec) => mapInstance.addLayer(spec));
|
|
12543
|
+
buildSelectionOverlayStack(labelsRef.current.canvas.newTextLabel).forEach((spec) => mapInstance.addLayer(spec));
|
|
12095
12544
|
if (tooltipElRef.current) {
|
|
12096
12545
|
const prevCleanup = tooltipElRef.current._cleanup;
|
|
12097
12546
|
try {
|
|
@@ -12216,7 +12665,7 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
12216
12665
|
const name = props.name;
|
|
12217
12666
|
let html = '<div class="text-sm space-y-0.5">';
|
|
12218
12667
|
if (name) html += `<div class="font-medium">${escapeHtml(name)}</div>`;
|
|
12219
|
-
if (featureId) html += `<div class="text-xs text-muted-foreground"><span class="opacity-70"
|
|
12668
|
+
if (featureId) html += `<div class="text-xs text-muted-foreground"><span class="opacity-70">${escapeHtml(labelsRef.current.canvas.tooltipId)}</span> ${escapeHtml(featureId.slice(0, 30))}</div>`;
|
|
12220
12669
|
const otherProps = displayProps.filter(([k]) => k !== "name" && k !== "id");
|
|
12221
12670
|
if (otherProps.length > 0) {
|
|
12222
12671
|
html += '<div class="text-xs text-muted-foreground space-y-0.5">';
|
|
@@ -12249,7 +12698,7 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
12249
12698
|
const prevDisabled = tooltipPageIndex === 0;
|
|
12250
12699
|
const nextDisabled = tooltipPageIndex === tooltipFeatures.length - 1;
|
|
12251
12700
|
const btnBase = "background:none;border-radius:4px;padding:1px 8px;font-size:12px;line-height:1.4;";
|
|
12252
|
-
const navHtml = `<div style="display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #eee;padding:4px 0 6px;margin-bottom:4px;font-size:12px;color:#666;user-select:none"><button data-tooltip-nav="prev" style="${btnBase}border:1px solid ${prevDisabled ? "#eee" : "#ddd"};cursor:${prevDisabled ? "default" : "pointer"};color:${prevDisabled ? "#ccc" : "#444"}"${prevDisabled ? " disabled" : ""}>‹</button><span${tooltipMore ? ` title="${
|
|
12701
|
+
const navHtml = `<div style="display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #eee;padding:4px 0 6px;margin-bottom:4px;font-size:12px;color:#666;user-select:none"><button data-tooltip-nav="prev" style="${btnBase}border:1px solid ${prevDisabled ? "#eee" : "#ddd"};cursor:${prevDisabled ? "default" : "pointer"};color:${prevDisabled ? "#ccc" : "#444"}"${prevDisabled ? " disabled" : ""}>‹</button><span${tooltipMore ? ` title="${escapeHtml(labelsRef.current.canvas.morePointsHint)}"` : ""}>${tooltipPageIndex + 1} / ${tooltipFeatures.length}${tooltipMore ? "+" : ""}</span><button data-tooltip-nav="next" style="${btnBase}border:1px solid ${nextDisabled ? "#eee" : "#ddd"};cursor:${nextDisabled ? "default" : "pointer"};color:${nextDisabled ? "#ccc" : "#444"}"${nextDisabled ? " disabled" : ""}>›</button></div>`;
|
|
12253
12702
|
html = navHtml + html;
|
|
12254
12703
|
}
|
|
12255
12704
|
return html;
|
|
@@ -12376,13 +12825,33 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
12376
12825
|
}
|
|
12377
12826
|
};
|
|
12378
12827
|
let pendingHover = null;
|
|
12828
|
+
const endHover = () => {
|
|
12829
|
+
mapInstance.getCanvas().style.cursor = "";
|
|
12830
|
+
const wasPolygon = lastHoveredGeomType === "Polygon" || lastHoveredGeomType === "MultiPolygon";
|
|
12831
|
+
lastHoveredFeatureKey = null;
|
|
12832
|
+
lastHoveredGeomType = null;
|
|
12833
|
+
if (tooltipShowTimeout) {
|
|
12834
|
+
clearTimeout(tooltipShowTimeout);
|
|
12835
|
+
tooltipShowTimeout = null;
|
|
12836
|
+
}
|
|
12837
|
+
if (wasPolygon) {
|
|
12838
|
+
hideTooltip2();
|
|
12839
|
+
} else {
|
|
12840
|
+
scheduleTooltipHide();
|
|
12841
|
+
}
|
|
12842
|
+
};
|
|
12379
12843
|
const flushHover = ({ e, hits, entered }) => {
|
|
12380
12844
|
if (hits.length === 0) return;
|
|
12381
12845
|
const order = mapInstance.getLayersOrder();
|
|
12382
12846
|
const z = (list) => order.indexOf(list[0].layer.id);
|
|
12383
12847
|
const all = hits.length === 1 ? hits[0] : [].concat(...[...hits].sort((a, b) => z(b) - z(a)));
|
|
12384
12848
|
const hover = stackFromHits(e.point, all);
|
|
12385
|
-
if (
|
|
12849
|
+
if (hover.features.length === 0) {
|
|
12850
|
+
if (lastHoveredFeatureKey !== null) endHover();
|
|
12851
|
+
return;
|
|
12852
|
+
}
|
|
12853
|
+
mapInstance.getCanvas().style.cursor = "pointer";
|
|
12854
|
+
if (entered && stackKey(hover) !== lastHoveredFeatureKey) showTooltipForFeatures(e, hover);
|
|
12386
12855
|
else moveTooltip(e, hover);
|
|
12387
12856
|
};
|
|
12388
12857
|
const collectHover = (e, entered) => {
|
|
@@ -12397,27 +12866,9 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
12397
12866
|
};
|
|
12398
12867
|
const bindHoverHandlers = (layerId) => {
|
|
12399
12868
|
if (hoverHandlersByLayer.has(layerId)) return;
|
|
12400
|
-
const onMouseEnter = (e) =>
|
|
12401
|
-
mapInstance.getCanvas().style.cursor = "pointer";
|
|
12402
|
-
collectHover(e, true);
|
|
12403
|
-
};
|
|
12869
|
+
const onMouseEnter = (e) => collectHover(e, true);
|
|
12404
12870
|
const onMouseMove = (e) => collectHover(e, false);
|
|
12405
|
-
const
|
|
12406
|
-
mapInstance.getCanvas().style.cursor = "";
|
|
12407
|
-
const wasPolygon = lastHoveredGeomType === "Polygon" || lastHoveredGeomType === "MultiPolygon";
|
|
12408
|
-
lastHoveredFeatureKey = null;
|
|
12409
|
-
lastHoveredGeomType = null;
|
|
12410
|
-
if (tooltipShowTimeout) {
|
|
12411
|
-
clearTimeout(tooltipShowTimeout);
|
|
12412
|
-
tooltipShowTimeout = null;
|
|
12413
|
-
}
|
|
12414
|
-
if (wasPolygon) {
|
|
12415
|
-
hideTooltip2();
|
|
12416
|
-
} else {
|
|
12417
|
-
scheduleTooltipHide();
|
|
12418
|
-
}
|
|
12419
|
-
};
|
|
12420
|
-
const handlers = { mouseenter: onMouseEnter, mousemove: onMouseMove, mouseleave: onMouseLeave };
|
|
12871
|
+
const handlers = { mouseenter: onMouseEnter, mousemove: onMouseMove, mouseleave: endHover };
|
|
12421
12872
|
hoverHandlersByLayer.set(layerId, handlers);
|
|
12422
12873
|
mapInstance.on("mouseenter", layerId, handlers.mouseenter);
|
|
12423
12874
|
mapInstance.on("mousemove", layerId, handlers.mousemove);
|
|
@@ -12444,17 +12895,18 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
12444
12895
|
const group = props.group !== "__all__" ? props.group : null;
|
|
12445
12896
|
const fromName = props.fromName || "";
|
|
12446
12897
|
const toName = props.toName || "";
|
|
12898
|
+
const traceLabels = labelsRef.current.canvas;
|
|
12447
12899
|
let html = '<div class="text-sm space-y-1">';
|
|
12448
12900
|
if (fromName || toName) {
|
|
12449
12901
|
html += `<div class="font-medium text-xs text-muted-foreground">${escapeHtml(fromName || "?")} → ${escapeHtml(toName || "?")}</div>`;
|
|
12450
12902
|
}
|
|
12451
12903
|
html += '<div class="space-y-0.5">';
|
|
12452
|
-
html += `<div><span class="text-muted-foreground"
|
|
12453
|
-
html += `<div><span class="text-muted-foreground"
|
|
12454
|
-
html += `<div><span class="text-muted-foreground"
|
|
12904
|
+
html += `<div><span class="text-muted-foreground">${escapeHtml(traceLabels.traceDuration)}</span> <span class="font-medium">${escapeHtml(duration)}</span></div>`;
|
|
12905
|
+
html += `<div><span class="text-muted-foreground">${escapeHtml(traceLabels.traceDistance)}</span> <span class="font-medium">${escapeHtml(distance2)}</span></div>`;
|
|
12906
|
+
html += `<div><span class="text-muted-foreground">${escapeHtml(traceLabels.traceAvgSpeed)}</span> <span class="font-medium">${escapeHtml(avgSpeed)}</span></div>`;
|
|
12455
12907
|
html += "</div>";
|
|
12456
12908
|
if (group) {
|
|
12457
|
-
html += `<div class="text-xs text-muted-foreground border-t border-border/50 mt-1 pt-1"
|
|
12909
|
+
html += `<div class="text-xs text-muted-foreground border-t border-border/50 mt-1 pt-1">${escapeHtml(traceLabels.traceGroup(group))}</div>`;
|
|
12458
12910
|
}
|
|
12459
12911
|
html += "</div>";
|
|
12460
12912
|
if (!tracePopupRef.current) {
|
|
@@ -12631,7 +13083,7 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
12631
13083
|
if (pendingKind === "text") {
|
|
12632
13084
|
newProps = {
|
|
12633
13085
|
...newProps,
|
|
12634
|
-
label:
|
|
13086
|
+
label: labelsRef.current.canvas.newTextLabel,
|
|
12635
13087
|
fontSize: 14,
|
|
12636
13088
|
fontColor: "#000000",
|
|
12637
13089
|
fontWeight: "normal"
|
|
@@ -12947,7 +13399,7 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
12947
13399
|
});
|
|
12948
13400
|
} catch (error) {
|
|
12949
13401
|
console.error("Failed to initialize map:", error);
|
|
12950
|
-
setMapError(error instanceof Error ? error.message :
|
|
13402
|
+
setMapError(error instanceof Error ? error.message : labelsRef.current.canvas.mapInitFailedFallback);
|
|
12951
13403
|
}
|
|
12952
13404
|
return () => {
|
|
12953
13405
|
var _a;
|
|
@@ -13085,8 +13537,8 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
13085
13537
|
const m = map.current;
|
|
13086
13538
|
if (!m || !isMapLoadedRef.current) {
|
|
13087
13539
|
toast({
|
|
13088
|
-
title:
|
|
13089
|
-
description:
|
|
13540
|
+
title: labelsRef.current.toasts.screenshotFailed,
|
|
13541
|
+
description: labelsRef.current.toasts.screenshotMapNotReady,
|
|
13090
13542
|
variant: "destructive"
|
|
13091
13543
|
});
|
|
13092
13544
|
throw new Error("Map is not ready");
|
|
@@ -13111,8 +13563,8 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
13111
13563
|
});
|
|
13112
13564
|
} catch (err) {
|
|
13113
13565
|
toast({
|
|
13114
|
-
title:
|
|
13115
|
-
description: err instanceof Error ? err.message :
|
|
13566
|
+
title: labelsRef.current.toasts.screenshotFailed,
|
|
13567
|
+
description: err instanceof Error ? err.message : labelsRef.current.toasts.screenshotNotRendered,
|
|
13116
13568
|
variant: "destructive"
|
|
13117
13569
|
});
|
|
13118
13570
|
throw err;
|
|
@@ -13878,8 +14330,8 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
13878
14330
|
if (!draw.current || !isMapLoaded) return;
|
|
13879
14331
|
if (!hasVisibleLayers && mode !== "simple_select" && mode !== "view_select") {
|
|
13880
14332
|
toast({
|
|
13881
|
-
title:
|
|
13882
|
-
description:
|
|
14333
|
+
title: labelsRef.current.toasts.noVisibleLayers,
|
|
14334
|
+
description: labelsRef.current.toasts.noVisibleLayersDescription,
|
|
13883
14335
|
variant: "destructive"
|
|
13884
14336
|
});
|
|
13885
14337
|
return;
|
|
@@ -13912,26 +14364,27 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
13912
14364
|
const handleClear = useCallback(() => {
|
|
13913
14365
|
if (!draw.current) return;
|
|
13914
14366
|
const activeLayer = layersRef.current.find((l) => l.id === activeEditingLayerId);
|
|
14367
|
+
const toastLabels = labelsRef.current.toasts;
|
|
13915
14368
|
if (!activeLayer) {
|
|
13916
14369
|
toast({
|
|
13917
|
-
title:
|
|
13918
|
-
description:
|
|
14370
|
+
title: toastLabels.noLayerSelected,
|
|
14371
|
+
description: toastLabels.noLayerSelectedDescription,
|
|
13919
14372
|
variant: "destructive"
|
|
13920
14373
|
});
|
|
13921
14374
|
return;
|
|
13922
14375
|
}
|
|
13923
14376
|
if (activeLayer.readOnly) {
|
|
13924
14377
|
toast({
|
|
13925
|
-
title:
|
|
13926
|
-
description:
|
|
14378
|
+
title: toastLabels.cannotClearHpLayer,
|
|
14379
|
+
description: toastLabels.cannotClearHpLayerDescription,
|
|
13927
14380
|
variant: "destructive"
|
|
13928
14381
|
});
|
|
13929
14382
|
return;
|
|
13930
14383
|
}
|
|
13931
14384
|
if (activeLayer.featureIds.length === 0) {
|
|
13932
14385
|
toast({
|
|
13933
|
-
title:
|
|
13934
|
-
description:
|
|
14386
|
+
title: toastLabels.layerEmpty,
|
|
14387
|
+
description: toastLabels.layerEmptyDescription
|
|
13935
14388
|
});
|
|
13936
14389
|
return;
|
|
13937
14390
|
}
|
|
@@ -13952,8 +14405,8 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
13952
14405
|
scheduleTimelineUpdate();
|
|
13953
14406
|
scheduleSync();
|
|
13954
14407
|
toast({
|
|
13955
|
-
title:
|
|
13956
|
-
description:
|
|
14408
|
+
title: toastLabels.layerCleared,
|
|
14409
|
+
description: toastLabels.layerClearedDescription(shownLayerName(activeLayer, labelsRef.current.canvas))
|
|
13957
14410
|
});
|
|
13958
14411
|
}, [activeEditingLayerId, saveStateForUndo, updateFeatureCount, scheduleTimelineUpdate, scheduleSync, toast]);
|
|
13959
14412
|
const handleDeleteSelected = useCallback(() => {
|
|
@@ -14254,7 +14707,7 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
14254
14707
|
const items = [
|
|
14255
14708
|
{
|
|
14256
14709
|
id: "create-point",
|
|
14257
|
-
label: canCreate ?
|
|
14710
|
+
label: canCreate ? labelsRef.current.canvas.createPointFeature : labelsRef.current.canvas.noEditableLayer,
|
|
14258
14711
|
disabled: !canCreate,
|
|
14259
14712
|
onSelect: () => {
|
|
14260
14713
|
createPointAtCoords(clickCoords[0], clickCoords[1]);
|
|
@@ -15297,8 +15750,8 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
15297
15750
|
if (!map.current) return;
|
|
15298
15751
|
if (!resolvedEndpoints.terrain) {
|
|
15299
15752
|
toast({
|
|
15300
|
-
title:
|
|
15301
|
-
description:
|
|
15753
|
+
title: labelsRef.current.toasts.terrainUnavailable,
|
|
15754
|
+
description: labelsRef.current.toasts.terrainUnavailableDescription,
|
|
15302
15755
|
variant: "destructive"
|
|
15303
15756
|
});
|
|
15304
15757
|
return;
|
|
@@ -15331,8 +15784,8 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
15331
15784
|
mapInstance.setLayoutProperty("terrain-hillshade", "visibility", "visible");
|
|
15332
15785
|
}
|
|
15333
15786
|
toast({
|
|
15334
|
-
title:
|
|
15335
|
-
description:
|
|
15787
|
+
title: labelsRef.current.toasts.terrainEnabled,
|
|
15788
|
+
description: labelsRef.current.toasts.terrainEnabledDescription
|
|
15336
15789
|
});
|
|
15337
15790
|
} else {
|
|
15338
15791
|
mapInstance.setTerrain(null);
|
|
@@ -16249,7 +16702,7 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
16249
16702
|
}
|
|
16250
16703
|
};
|
|
16251
16704
|
exportInFlightRef.current = true;
|
|
16252
|
-
const progress = ingestProgressStore.begin(layer.
|
|
16705
|
+
const progress = ingestProgressStore.begin(shownLayerName(layer, labelsRef.current.canvas), { activity: "preparing-download" });
|
|
16253
16706
|
progress.setTotal(features.length);
|
|
16254
16707
|
try {
|
|
16255
16708
|
const parts = await featureCollectionBlobPartsAsync(geojson, {
|
|
@@ -16263,8 +16716,8 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
16263
16716
|
} catch (error) {
|
|
16264
16717
|
console.error(`Failed to export layer "${layer.name}" as GeoJSON:`, error);
|
|
16265
16718
|
toast({
|
|
16266
|
-
title:
|
|
16267
|
-
description: error instanceof Error ? error.message :
|
|
16719
|
+
title: labelsRef.current.toasts.exportFailed,
|
|
16720
|
+
description: error instanceof Error ? error.message : labelsRef.current.toasts.exportFailedDescription,
|
|
16268
16721
|
variant: "destructive"
|
|
16269
16722
|
});
|
|
16270
16723
|
} finally {
|
|
@@ -16344,7 +16797,7 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
16344
16797
|
if (!draw.current || exportInFlightRef.current) return;
|
|
16345
16798
|
const { collection, mapFeature } = buildEnrichedExport();
|
|
16346
16799
|
exportInFlightRef.current = true;
|
|
16347
|
-
const progress = ingestProgressStore.begin("map_export.geojson", {
|
|
16800
|
+
const progress = ingestProgressStore.begin("map_export.geojson", { activity: "preparing-download" });
|
|
16348
16801
|
progress.setTotal(collection.features.length);
|
|
16349
16802
|
try {
|
|
16350
16803
|
const parts = await featureCollectionBlobPartsAsync(collection, {
|
|
@@ -16355,8 +16808,8 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
16355
16808
|
} catch (error) {
|
|
16356
16809
|
console.error("Failed to export the map as GeoJSON:", error);
|
|
16357
16810
|
toast({
|
|
16358
|
-
title:
|
|
16359
|
-
description: error instanceof Error ? error.message :
|
|
16811
|
+
title: labelsRef.current.toasts.exportFailed,
|
|
16812
|
+
description: error instanceof Error ? error.message : labelsRef.current.toasts.exportFailedDescription,
|
|
16360
16813
|
variant: "destructive"
|
|
16361
16814
|
});
|
|
16362
16815
|
} finally {
|
|
@@ -16431,8 +16884,11 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
16431
16884
|
targetLayerId = activeLayer.id;
|
|
16432
16885
|
targetLayerName = activeLayer.name;
|
|
16433
16886
|
toast({
|
|
16434
|
-
title:
|
|
16435
|
-
description:
|
|
16887
|
+
title: labelsRef.current.toasts.featuresAdded,
|
|
16888
|
+
description: labelsRef.current.toasts.featuresAddedDescription({
|
|
16889
|
+
count: addedIds.length,
|
|
16890
|
+
layerName: shownLayerName(activeLayer, labelsRef.current.canvas)
|
|
16891
|
+
})
|
|
16436
16892
|
});
|
|
16437
16893
|
} else {
|
|
16438
16894
|
const layerName = `${addedIds.length} workspace features`;
|
|
@@ -16449,8 +16905,8 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
16449
16905
|
targetLayerId = newLayerId;
|
|
16450
16906
|
targetLayerName = layerName;
|
|
16451
16907
|
toast({
|
|
16452
|
-
title:
|
|
16453
|
-
description:
|
|
16908
|
+
title: labelsRef.current.toasts.layerCreated,
|
|
16909
|
+
description: labelsRef.current.toasts.featuresAddedDescription({ count: addedIds.length, layerName })
|
|
16454
16910
|
});
|
|
16455
16911
|
}
|
|
16456
16912
|
if (capped.dropped > 0) {
|
|
@@ -16471,8 +16927,8 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
16471
16927
|
}
|
|
16472
16928
|
} catch (error) {
|
|
16473
16929
|
toast({
|
|
16474
|
-
title:
|
|
16475
|
-
description: error instanceof Error ? error.message :
|
|
16930
|
+
title: labelsRef.current.toasts.searchFailed,
|
|
16931
|
+
description: error instanceof Error ? error.message : labelsRef.current.toasts.searchFailedDescription,
|
|
16476
16932
|
variant: "destructive"
|
|
16477
16933
|
});
|
|
16478
16934
|
}
|
|
@@ -16579,8 +17035,8 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
16579
17035
|
}
|
|
16580
17036
|
const totalFeatures = newLayers.reduce((sum, l) => sum + l.featureIds.length, 0);
|
|
16581
17037
|
toast({
|
|
16582
|
-
title:
|
|
16583
|
-
description:
|
|
17038
|
+
title: labelsRef.current.toasts.mapRestored,
|
|
17039
|
+
description: labelsRef.current.toasts.mapRestoredDescription({ layerCount: newLayers.length, featureCount: totalFeatures })
|
|
16584
17040
|
});
|
|
16585
17041
|
if (restoreDropped > 0) {
|
|
16586
17042
|
notifyFeatureCap({
|
|
@@ -16633,13 +17089,13 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
16633
17089
|
scheduleTimelineUpdate();
|
|
16634
17090
|
scheduleSync();
|
|
16635
17091
|
toast({
|
|
16636
|
-
title:
|
|
16637
|
-
description:
|
|
17092
|
+
title: labelsRef.current.toasts.featuresLoaded,
|
|
17093
|
+
description: labelsRef.current.toasts.featuresLoadedDescription(prepared.features.length)
|
|
16638
17094
|
});
|
|
16639
17095
|
} catch (error) {
|
|
16640
17096
|
toast({
|
|
16641
|
-
title:
|
|
16642
|
-
description: error instanceof Error ? error.message :
|
|
17097
|
+
title: labelsRef.current.toasts.loadFailed,
|
|
17098
|
+
description: error instanceof Error ? error.message : labelsRef.current.toasts.loadFailedDescription,
|
|
16643
17099
|
variant: "destructive"
|
|
16644
17100
|
});
|
|
16645
17101
|
}
|
|
@@ -16669,15 +17125,15 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
16669
17125
|
});
|
|
16670
17126
|
setLayers((prev) => [...prev]);
|
|
16671
17127
|
toast({
|
|
16672
|
-
title:
|
|
16673
|
-
description:
|
|
17128
|
+
title: labelsRef.current.toasts.saved,
|
|
17129
|
+
description: labelsRef.current.toasts.savedDescription
|
|
16674
17130
|
});
|
|
16675
17131
|
} catch (error) {
|
|
16676
|
-
const
|
|
16677
|
-
if (!
|
|
17132
|
+
const cancelled = error instanceof Error && error.message.includes("cancelled");
|
|
17133
|
+
if (!cancelled) {
|
|
16678
17134
|
toast({
|
|
16679
|
-
title:
|
|
16680
|
-
description:
|
|
17135
|
+
title: labelsRef.current.toasts.saveFailed,
|
|
17136
|
+
description: error instanceof Error ? error.message : labelsRef.current.toasts.saveFailedDescription,
|
|
16681
17137
|
variant: "destructive"
|
|
16682
17138
|
});
|
|
16683
17139
|
}
|
|
@@ -16705,8 +17161,8 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
16705
17161
|
});
|
|
16706
17162
|
if (allFeatures.length === 0) {
|
|
16707
17163
|
toast({
|
|
16708
|
-
title:
|
|
16709
|
-
description:
|
|
17164
|
+
title: labelsRef.current.toasts.noFeatures,
|
|
17165
|
+
description: labelsRef.current.toasts.noFeaturesDescription
|
|
16710
17166
|
});
|
|
16711
17167
|
return;
|
|
16712
17168
|
}
|
|
@@ -16746,26 +17202,18 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
16746
17202
|
});
|
|
16747
17203
|
} catch (error) {
|
|
16748
17204
|
toast({
|
|
16749
|
-
title:
|
|
16750
|
-
description: error
|
|
17205
|
+
title: labelsRef.current.toasts.geojsonLoadFailed,
|
|
17206
|
+
description: describeIngestFailure(error, labelsRef.current),
|
|
16751
17207
|
variant: "destructive"
|
|
16752
17208
|
});
|
|
16753
17209
|
return;
|
|
16754
17210
|
}
|
|
16755
17211
|
if (result.kind === "error") {
|
|
16756
|
-
|
|
16757
|
-
|
|
16758
|
-
|
|
16759
|
-
|
|
16760
|
-
|
|
16761
|
-
});
|
|
16762
|
-
} else {
|
|
16763
|
-
toast({
|
|
16764
|
-
title: "Failed to load GeoJSON",
|
|
16765
|
-
description: result.message,
|
|
16766
|
-
variant: "destructive"
|
|
16767
|
-
});
|
|
16768
|
-
}
|
|
17212
|
+
toast({
|
|
17213
|
+
title: result.code === "empty" ? labelsRef.current.toasts.emptyGeojson : labelsRef.current.toasts.geojsonLoadFailed,
|
|
17214
|
+
description: describeIngestError(result, labelsRef.current.ingest),
|
|
17215
|
+
variant: "destructive"
|
|
17216
|
+
});
|
|
16769
17217
|
return;
|
|
16770
17218
|
}
|
|
16771
17219
|
if (result.kind === "enriched") {
|
|
@@ -16829,10 +17277,13 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
16829
17277
|
{ padding: 50, maxZoom: 16, duration: 1e3 }
|
|
16830
17278
|
);
|
|
16831
17279
|
}
|
|
16832
|
-
const reprojectMsg2 = reprojected ? ` (reprojected from ${sourceCRS})` : "";
|
|
16833
17280
|
toast({
|
|
16834
|
-
title:
|
|
16835
|
-
description:
|
|
17281
|
+
title: labelsRef.current.toasts.layerCreated,
|
|
17282
|
+
description: labelsRef.current.toasts.hpLayerCreatedDescription({
|
|
17283
|
+
layerName: newLayer.name,
|
|
17284
|
+
count: addedIds.length,
|
|
17285
|
+
reprojectedFrom: reprojected ? String(sourceCRS) : null
|
|
17286
|
+
})
|
|
16836
17287
|
});
|
|
16837
17288
|
return;
|
|
16838
17289
|
}
|
|
@@ -16840,16 +17291,16 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
16840
17291
|
let targetLayer = currentLayers.find((l) => l.id === requestedTargetLayerId);
|
|
16841
17292
|
if (((_a = targetLayer == null ? void 0 : targetLayer.metadata) == null ? void 0 : _a.dataViewing) === true) {
|
|
16842
17293
|
toast({
|
|
16843
|
-
title:
|
|
16844
|
-
description:
|
|
17294
|
+
title: labelsRef.current.toasts.dataViewingLayer,
|
|
17295
|
+
description: labelsRef.current.toasts.dataViewingLayerDescription,
|
|
16845
17296
|
variant: "destructive"
|
|
16846
17297
|
});
|
|
16847
17298
|
return;
|
|
16848
17299
|
}
|
|
16849
17300
|
if (isHostOwnedLayer(targetLayer)) {
|
|
16850
17301
|
toast({
|
|
16851
|
-
title:
|
|
16852
|
-
description:
|
|
17302
|
+
title: labelsRef.current.toasts.hostOwnedLayer,
|
|
17303
|
+
description: labelsRef.current.toasts.hostOwnedLayerDescription,
|
|
16853
17304
|
variant: "destructive"
|
|
16854
17305
|
});
|
|
16855
17306
|
return;
|
|
@@ -16862,8 +17313,8 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
16862
17313
|
}
|
|
16863
17314
|
if (!targetLayer) {
|
|
16864
17315
|
toast({
|
|
16865
|
-
title:
|
|
16866
|
-
description:
|
|
17316
|
+
title: labelsRef.current.toasts.noLayerToLoadInto,
|
|
17317
|
+
description: labelsRef.current.toasts.noLayerToLoadIntoDescription,
|
|
16867
17318
|
variant: "destructive"
|
|
16868
17319
|
});
|
|
16869
17320
|
return;
|
|
@@ -16924,10 +17375,13 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
16924
17375
|
updateFeatureCount();
|
|
16925
17376
|
scheduleTimelineUpdate();
|
|
16926
17377
|
scheduleSync();
|
|
16927
|
-
const reprojectMsg = reprojected ? ` (reprojected from ${sourceCRS})` : "";
|
|
16928
17378
|
toast({
|
|
16929
|
-
title:
|
|
16930
|
-
description:
|
|
17379
|
+
title: labelsRef.current.toasts.geojsonLoaded,
|
|
17380
|
+
description: labelsRef.current.toasts.geojsonLoadedDescription({
|
|
17381
|
+
count: appendFeatures.length,
|
|
17382
|
+
reprojectedFrom: reprojected ? String(sourceCRS) : null,
|
|
17383
|
+
layerHidden: !(targetLayer == null ? void 0 : targetLayer.visible)
|
|
17384
|
+
})
|
|
16931
17385
|
});
|
|
16932
17386
|
}, [saveStateForUndo, updateFeatureCount, scheduleTimelineUpdate, scheduleSync, restoreEnrichedGeoJSON, toast, interceptGeoJSONFileLoad, ingestWithProgress, notifyFeatureCap, withAutoColor]);
|
|
16933
17387
|
const handleFileChange = useCallback((e) => {
|
|
@@ -16949,8 +17403,8 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
16949
17403
|
result = await ingestWithProgress(name, input, { idStrategy: "layer-index", layerId });
|
|
16950
17404
|
} catch (error) {
|
|
16951
17405
|
toast({
|
|
16952
|
-
title:
|
|
16953
|
-
description: error
|
|
17406
|
+
title: labelsRef.current.toasts.geojsonLoadFailed,
|
|
17407
|
+
description: describeIngestFailure(error, labelsRef.current),
|
|
16954
17408
|
variant: "destructive"
|
|
16955
17409
|
});
|
|
16956
17410
|
return;
|
|
@@ -16958,8 +17412,8 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
16958
17412
|
if (!map.current) return;
|
|
16959
17413
|
if (result.kind === "error") {
|
|
16960
17414
|
toast({
|
|
16961
|
-
title:
|
|
16962
|
-
description: result.
|
|
17415
|
+
title: labelsRef.current.toasts.geojsonLoadFailed,
|
|
17416
|
+
description: describeIngestError(result, labelsRef.current.ingest),
|
|
16963
17417
|
variant: "destructive"
|
|
16964
17418
|
});
|
|
16965
17419
|
return;
|
|
@@ -17018,10 +17472,13 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
17018
17472
|
features: addedIds.length,
|
|
17019
17473
|
totalMs: Math.round(performance.now() - startedAt)
|
|
17020
17474
|
});
|
|
17021
|
-
const reprojectMsg = reprojected ? ` (reprojected from ${sourceCRS})` : "";
|
|
17022
17475
|
toast({
|
|
17023
|
-
title:
|
|
17024
|
-
description:
|
|
17476
|
+
title: labelsRef.current.toasts.layerAdded,
|
|
17477
|
+
description: labelsRef.current.toasts.layerAddedDescription({
|
|
17478
|
+
layerName: newLayer.name,
|
|
17479
|
+
count: addedIds.length,
|
|
17480
|
+
reprojectedFrom: reprojected ? String(sourceCRS) : null
|
|
17481
|
+
})
|
|
17025
17482
|
});
|
|
17026
17483
|
}, [saveStateForUndo, updateFeatureCount, scheduleTimelineUpdate, scheduleSync, restoreEnrichedGeoJSON, toast, interceptGeoJSONFileLoad, ingestWithProgress, notifyFeatureCap, withAutoColor]);
|
|
17027
17484
|
const handleDropGeoJSON = useCallback((name, data) => {
|
|
@@ -17306,7 +17763,8 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
17306
17763
|
mapInstance,
|
|
17307
17764
|
sourceId,
|
|
17308
17765
|
categoryValues,
|
|
17309
|
-
categoryColorMap
|
|
17766
|
+
categoryColorMap,
|
|
17767
|
+
labelsRef.current.canvas.clusterOther
|
|
17310
17768
|
);
|
|
17311
17769
|
clusterPieManagers.current.set(layer.id, pieManager);
|
|
17312
17770
|
} else {
|
|
@@ -17482,18 +17940,18 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
17482
17940
|
/* @__PURE__ */ jsx("div", { className: "p-4 border-b border-border", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
17483
17941
|
/* @__PURE__ */ jsx("div", { className: "p-2 rounded-full bg-destructive/10", children: /* @__PURE__ */ jsx(AlertTriangle, { className: "w-6 h-6 text-destructive" }) }),
|
|
17484
17942
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
17485
|
-
/* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold", children:
|
|
17486
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children:
|
|
17943
|
+
/* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold", children: labels.canvas.mapInitFailedTitle }),
|
|
17944
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: labels.canvas.mapInitFailedSubtitle })
|
|
17487
17945
|
] })
|
|
17488
17946
|
] }) }),
|
|
17489
17947
|
/* @__PURE__ */ jsxs("div", { className: "p-4 space-y-4", children: [
|
|
17490
17948
|
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: mapError }),
|
|
17491
|
-
/* @__PURE__ */ jsx(Button, { type: "primary", onClick: () => window.location.reload(), className: "w-full", "data-testid": "button-reload", children:
|
|
17949
|
+
/* @__PURE__ */ jsx(Button, { type: "primary", onClick: () => window.location.reload(), className: "w-full", "data-testid": "button-reload", children: labels.canvas.refreshPage })
|
|
17492
17950
|
] })
|
|
17493
17951
|
] }) });
|
|
17494
17952
|
}
|
|
17495
17953
|
const toastContextValue = toastProvider ?? null;
|
|
17496
|
-
return /* @__PURE__ */ jsx(TimelineStoreContext.Provider, { value: timelineStoreApi, children: /* @__PURE__ */ jsx(ToastContext.Provider, { value: toastContextValue, children: /* @__PURE__ */ jsx(MapDropZone, { onDrop: handleDropGeoJSON, onDropFile: handleDropGeoJSONFile, children: /* @__PURE__ */ jsxs("div", { className: `map-container w-full h-full min-w-0 relative overflow-hidden isolate ${className || ""}`, "data-testid": "map-editor-canvas", children: [
|
|
17954
|
+
return /* @__PURE__ */ jsx(MapLabelsContext.Provider, { value: labels, children: /* @__PURE__ */ jsx(TimelineStoreContext.Provider, { value: timelineStoreApi, children: /* @__PURE__ */ jsx(ToastContext.Provider, { value: toastContextValue, children: /* @__PURE__ */ jsx(MapDropZone, { onDrop: handleDropGeoJSON, onDropFile: handleDropGeoJSONFile, children: /* @__PURE__ */ jsxs("div", { className: `map-container w-full h-full min-w-0 relative overflow-hidden isolate ${className || ""}`, "data-testid": "map-editor-canvas", children: [
|
|
17497
17955
|
/* @__PURE__ */ jsx(
|
|
17498
17956
|
"div",
|
|
17499
17957
|
{
|
|
@@ -17780,9 +18238,9 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
17780
18238
|
className: "absolute top-4 left-16 z-10 bg-background/90 floating-panel rounded-lg shadow-lg border border-border px-4 py-2",
|
|
17781
18239
|
"data-testid": "measure-result-panel",
|
|
17782
18240
|
children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
17783
|
-
/* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: measureMode === "distance" ?
|
|
17784
|
-
/* @__PURE__ */ jsx("span", { className: "font-mono text-sm font-medium", "data-testid": "text-measure-result", children: measureResult || (measureMode === "distance" ?
|
|
17785
|
-
/* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children:
|
|
18241
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: measureMode === "distance" ? labels.canvas.measureDistance : labels.canvas.measureArea }),
|
|
18242
|
+
/* @__PURE__ */ jsx("span", { className: "font-mono text-sm font-medium", "data-testid": "text-measure-result", children: measureResult || (measureMode === "distance" ? labels.canvas.measureDistanceHint : labels.canvas.measureAreaHint) }),
|
|
18243
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: labels.canvas.measureClearHint })
|
|
17786
18244
|
] })
|
|
17787
18245
|
}
|
|
17788
18246
|
),
|
|
@@ -17791,7 +18249,7 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
17791
18249
|
{
|
|
17792
18250
|
className: "absolute left-4 z-[200] transition-all",
|
|
17793
18251
|
style: { bottom: timelineEnabled ? timebarHeight + TIMEBAR_BOTTOM_OFFSET + 8 : 48 },
|
|
17794
|
-
children: /* @__PURE__ */ jsx(Tooltip, { title:
|
|
18252
|
+
children: /* @__PURE__ */ jsx(Tooltip, { title: labels.canvas.timelineToggle, placement: "right", children: /* @__PURE__ */ jsx(
|
|
17795
18253
|
Button,
|
|
17796
18254
|
{
|
|
17797
18255
|
type: "default",
|
|
@@ -17799,7 +18257,7 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
17799
18257
|
onClick: () => timelineStoreApi.getState().setEnabled(!timelineEnabled),
|
|
17800
18258
|
disabled: !isMapLoaded,
|
|
17801
18259
|
className: `!w-10 !h-10 !min-w-0 !p-0 bg-background shadow-lg ${timelineEnabled ? "bg-primary/10" : ""}`,
|
|
17802
|
-
"aria-label":
|
|
18260
|
+
"aria-label": labels.timebar.toggle,
|
|
17803
18261
|
"aria-pressed": timelineEnabled,
|
|
17804
18262
|
"data-testid": "button-toggle-timeline"
|
|
17805
18263
|
}
|
|
@@ -17807,18 +18265,15 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
17807
18265
|
}
|
|
17808
18266
|
),
|
|
17809
18267
|
enableLayers && /* @__PURE__ */ jsxs("div", { className: "absolute top-4 right-4 z-[200] flex items-center gap-2", children: [
|
|
17810
|
-
getMapUnsavedCount() > 0 && /* @__PURE__ */
|
|
18268
|
+
getMapUnsavedCount() > 0 && /* @__PURE__ */ jsx(
|
|
17811
18269
|
"div",
|
|
17812
18270
|
{
|
|
17813
18271
|
className: "px-2 py-1 bg-orange-500 text-white text-xs font-medium rounded-md shadow-lg",
|
|
17814
18272
|
"data-testid": "badge-unsaved-count",
|
|
17815
|
-
children:
|
|
17816
|
-
getMapUnsavedCount(),
|
|
17817
|
-
" unsaved"
|
|
17818
|
-
]
|
|
18273
|
+
children: labels.canvas.unsavedCount(getMapUnsavedCount())
|
|
17819
18274
|
}
|
|
17820
18275
|
),
|
|
17821
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
18276
|
+
/* @__PURE__ */ jsx(Tooltip, { title: labels.canvas.layersToggle, placement: "left", children: /* @__PURE__ */ jsx(
|
|
17822
18277
|
Button,
|
|
17823
18278
|
{
|
|
17824
18279
|
type: "default",
|
|
@@ -17826,7 +18281,7 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
17826
18281
|
onClick: handleToggleLayers,
|
|
17827
18282
|
disabled: !isMapLoaded,
|
|
17828
18283
|
className: `!w-[46px] !h-[46px] !min-w-0 !p-0 !rounded-lg floating-panel !border !border-border shadow-[0_2px_8px_rgba(0,0,0,0.12)] ${showLayers ? "tool-active !bg-primary/10" : "!bg-background/80"}`,
|
|
17829
|
-
"aria-label":
|
|
18284
|
+
"aria-label": labels.canvas.layersToggleAriaLabel,
|
|
17830
18285
|
"aria-pressed": showLayers,
|
|
17831
18286
|
"data-testid": "button-toggle-layers"
|
|
17832
18287
|
}
|
|
@@ -17978,22 +18433,23 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
17978
18433
|
"data-testid": "input-file-geojson"
|
|
17979
18434
|
}
|
|
17980
18435
|
)
|
|
17981
|
-
] }) }) }) });
|
|
18436
|
+
] }) }) }) }) });
|
|
17982
18437
|
});
|
|
17983
18438
|
function ActionPanel({ onSave, onLoad, disabled }) {
|
|
18439
|
+
const { actionPanel: labels } = useMapLabels();
|
|
17984
18440
|
return /* @__PURE__ */ jsxs(
|
|
17985
18441
|
"div",
|
|
17986
18442
|
{
|
|
17987
18443
|
className: "absolute top-4 right-4 z-10 flex items-center gap-2 p-2 bg-background/80 floating-panel rounded-lg shadow-lg border border-border",
|
|
17988
18444
|
role: "group",
|
|
17989
|
-
"aria-label":
|
|
18445
|
+
"aria-label": labels.groupLabel,
|
|
17990
18446
|
"data-testid": "panel-actions",
|
|
17991
18447
|
children: [
|
|
17992
18448
|
/* @__PURE__ */ jsx(
|
|
17993
18449
|
Tooltip,
|
|
17994
18450
|
{
|
|
17995
18451
|
title: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
17996
|
-
/* @__PURE__ */ jsx("span", { children:
|
|
18452
|
+
/* @__PURE__ */ jsx("span", { children: labels.saveTooltip }),
|
|
17997
18453
|
/* @__PURE__ */ jsx("kbd", { className: "px-1.5 py-0.5 text-xs font-mono bg-white/20 rounded", children: "S" })
|
|
17998
18454
|
] }),
|
|
17999
18455
|
children: /* @__PURE__ */ jsxs(
|
|
@@ -18003,28 +18459,28 @@ function ActionPanel({ onSave, onLoad, disabled }) {
|
|
|
18003
18459
|
onClick: onSave,
|
|
18004
18460
|
disabled,
|
|
18005
18461
|
className: "gap-2 flex items-center",
|
|
18006
|
-
"aria-label":
|
|
18462
|
+
"aria-label": labels.saveAriaLabel,
|
|
18007
18463
|
"data-testid": "button-save-geojson",
|
|
18008
18464
|
children: [
|
|
18009
18465
|
/* @__PURE__ */ jsx(Download, { className: "w-4 h-4" }),
|
|
18010
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children:
|
|
18466
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: labels.save })
|
|
18011
18467
|
]
|
|
18012
18468
|
}
|
|
18013
18469
|
)
|
|
18014
18470
|
}
|
|
18015
18471
|
),
|
|
18016
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
18472
|
+
/* @__PURE__ */ jsx(Tooltip, { title: labels.loadTooltip, children: /* @__PURE__ */ jsxs(
|
|
18017
18473
|
Button,
|
|
18018
18474
|
{
|
|
18019
18475
|
type: "default",
|
|
18020
18476
|
onClick: onLoad,
|
|
18021
18477
|
disabled,
|
|
18022
18478
|
className: "gap-2 flex items-center",
|
|
18023
|
-
"aria-label":
|
|
18479
|
+
"aria-label": labels.loadAriaLabel,
|
|
18024
18480
|
"data-testid": "button-load-geojson",
|
|
18025
18481
|
children: [
|
|
18026
18482
|
/* @__PURE__ */ jsx(Upload, { className: "w-4 h-4" }),
|
|
18027
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children:
|
|
18483
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: labels.load })
|
|
18028
18484
|
]
|
|
18029
18485
|
}
|
|
18030
18486
|
) })
|
|
@@ -18987,6 +19443,7 @@ export {
|
|
|
18987
19443
|
ActionPanel,
|
|
18988
19444
|
ClusterPieManager,
|
|
18989
19445
|
ColorPickerPopover,
|
|
19446
|
+
DEFAULT_MAP_LABELS,
|
|
18990
19447
|
DEFAULT_MAX_FEATURES_PER_LAYER,
|
|
18991
19448
|
DebugSidebar,
|
|
18992
19449
|
DrawingToolbar,
|