@octostar/map-component 0.7.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -0
- package/dist/index.mjs +1287 -834
- 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 +2 -0
- 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-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
|
|
@@ -1320,7 +1898,7 @@ function buildLayer(role, sourceId, opts) {
|
|
|
1320
1898
|
source: sourceId,
|
|
1321
1899
|
filter: shared ? ["all", UNPINNED_LABEL_FILTER, NOT_HOST_FILTER] : UNPINNED_LABEL_FILTER,
|
|
1322
1900
|
layout: {
|
|
1323
|
-
...buildCustomLabelLayout(),
|
|
1901
|
+
...buildCustomLabelLayout(opts.newTextLabel),
|
|
1324
1902
|
"visibility": opts.labelsVisible ? "visible" : "none",
|
|
1325
1903
|
// Native collision-based de-overlap.
|
|
1326
1904
|
//
|
|
@@ -1372,7 +1950,7 @@ function buildLayer(role, sourceId, opts) {
|
|
|
1372
1950
|
source: sourceId,
|
|
1373
1951
|
filter: shared ? ["all", PINNED_LABEL_FILTER, NOT_HOST_FILTER] : PINNED_LABEL_FILTER,
|
|
1374
1952
|
layout: {
|
|
1375
|
-
...buildCustomLabelLayout(),
|
|
1953
|
+
...buildCustomLabelLayout(opts.newTextLabel),
|
|
1376
1954
|
"visibility": "visible",
|
|
1377
1955
|
"text-allow-overlap": true,
|
|
1378
1956
|
"text-ignore-placement": true,
|
|
@@ -1503,9 +2081,13 @@ function createShardRegistry(host, hooks) {
|
|
|
1503
2081
|
}
|
|
1504
2082
|
};
|
|
1505
2083
|
const createStack = (state, index, roles, data) => {
|
|
2084
|
+
var _a;
|
|
1506
2085
|
const sourceId = shardSourceId(state.layerId, index);
|
|
1507
2086
|
host.addSource(sourceId, customSourceSpec());
|
|
1508
|
-
const specs = buildCustomLayerStack(sourceId, roles, {
|
|
2087
|
+
const specs = buildCustomLayerStack(sourceId, roles, {
|
|
2088
|
+
labelsVisible: hooks.labelsVisible(),
|
|
2089
|
+
newTextLabel: (_a = hooks.newTextLabel) == null ? void 0 : _a.call(hooks)
|
|
2090
|
+
});
|
|
1509
2091
|
const ordered = CUSTOM_LAYER_ROLES.filter((role) => roles.includes(role));
|
|
1510
2092
|
const layerIds = [];
|
|
1511
2093
|
specs.forEach((spec, i) => {
|
|
@@ -1817,154 +2399,6 @@ function resolveMissingImage(id, provider) {
|
|
|
1817
2399
|
if (image == null ? void 0 : image.data) return { kind: "host", image };
|
|
1818
2400
|
return id.startsWith(HOST_IMAGE_PREFIX) ? { kind: "none" } : { kind: "emoji" };
|
|
1819
2401
|
}
|
|
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
2402
|
function windowFromRange(start, end) {
|
|
1969
2403
|
if (!start || !end) return null;
|
|
1970
2404
|
const t0 = start.getTime();
|
|
@@ -3043,10 +3477,21 @@ function CursorCoordinatesOverlay({ map }) {
|
|
|
3043
3477
|
}
|
|
3044
3478
|
const NO_IMPORTS = Object.freeze([]);
|
|
3045
3479
|
const getServerSnapshot = () => NO_IMPORTS;
|
|
3480
|
+
function describeActivity(entry, labels) {
|
|
3481
|
+
switch (entry.activity) {
|
|
3482
|
+
case "rendering":
|
|
3483
|
+
return labels.rendering(entry.label);
|
|
3484
|
+
case "preparing-download":
|
|
3485
|
+
return labels.preparingDownload(entry.label);
|
|
3486
|
+
default:
|
|
3487
|
+
return labels.importing(entry.label);
|
|
3488
|
+
}
|
|
3489
|
+
}
|
|
3046
3490
|
function IngestProgressOverlay({
|
|
3047
3491
|
store,
|
|
3048
3492
|
bottomPx
|
|
3049
3493
|
}) {
|
|
3494
|
+
const { ingest: labels } = useMapLabels();
|
|
3050
3495
|
const entries = useSyncExternalStore(store.subscribe, store.getSnapshot, getServerSnapshot);
|
|
3051
3496
|
if (entries.length === 0) return null;
|
|
3052
3497
|
return /* @__PURE__ */ jsx(
|
|
@@ -3061,11 +3506,8 @@ function IngestProgressOverlay({
|
|
|
3061
3506
|
className: "rounded-md border bg-background/90 px-3 py-1.5 text-xs text-muted-foreground shadow-md",
|
|
3062
3507
|
children: [
|
|
3063
3508
|
/* @__PURE__ */ jsxs("span", { children: [
|
|
3064
|
-
entry
|
|
3065
|
-
|
|
3066
|
-
entry.label,
|
|
3067
|
-
"…",
|
|
3068
|
-
entry.total !== null ? ` ${entry.received.toLocaleString()} / ${entry.total.toLocaleString()} features` : ""
|
|
3509
|
+
describeActivity(entry, labels),
|
|
3510
|
+
entry.total !== null ? ` ${labels.progress({ received: entry.received, total: entry.total })}` : ""
|
|
3069
3511
|
] }),
|
|
3070
3512
|
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
3513
|
"div",
|
|
@@ -3082,23 +3524,25 @@ function IngestProgressOverlay({
|
|
|
3082
3524
|
);
|
|
3083
3525
|
}
|
|
3084
3526
|
const CATEGORIES = [
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3527
|
+
"places",
|
|
3528
|
+
"transport",
|
|
3529
|
+
"food",
|
|
3530
|
+
"nature",
|
|
3531
|
+
"symbols",
|
|
3532
|
+
"activities",
|
|
3533
|
+
"work",
|
|
3534
|
+
"shopping",
|
|
3535
|
+
"communication",
|
|
3536
|
+
"people",
|
|
3537
|
+
"maritime",
|
|
3538
|
+
"security",
|
|
3539
|
+
"time",
|
|
3540
|
+
"shapes",
|
|
3541
|
+
"arrows"
|
|
3100
3542
|
];
|
|
3101
3543
|
function IconPicker({ value, onChange, disabled = false, renderTrigger, open: controlledOpen, onOpenChange }) {
|
|
3544
|
+
const { iconPicker: labels, iconNames: iconNames2, iconCategories: iconCategories2 } = useMapLabels();
|
|
3545
|
+
const iconName = useCallback((icon) => iconNames2[icon.id] ?? icon.name, [iconNames2]);
|
|
3102
3546
|
const [internalOpen, setInternalOpen] = useState(false);
|
|
3103
3547
|
const open = controlledOpen ?? internalOpen;
|
|
3104
3548
|
const setOpen = useCallback((v) => {
|
|
@@ -3115,11 +3559,11 @@ function IconPicker({ value, onChange, disabled = false, renderTrigger, open: co
|
|
|
3115
3559
|
if (search.trim()) {
|
|
3116
3560
|
const searchLower = search.toLowerCase().trim();
|
|
3117
3561
|
result = result.filter(
|
|
3118
|
-
(i) => i.name.toLowerCase().includes(searchLower) || i.id.toLowerCase().includes(searchLower) || i.category.toLowerCase().includes(searchLower)
|
|
3562
|
+
(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
3563
|
);
|
|
3120
3564
|
}
|
|
3121
3565
|
return result;
|
|
3122
|
-
}, [activeCategory, search]);
|
|
3566
|
+
}, [activeCategory, search, iconName, iconCategories2]);
|
|
3123
3567
|
const handleSelect = useCallback((emoji) => {
|
|
3124
3568
|
onChange(emoji);
|
|
3125
3569
|
setOpen(false);
|
|
@@ -3139,7 +3583,7 @@ function IconPicker({ value, onChange, disabled = false, renderTrigger, open: co
|
|
|
3139
3583
|
onClick: () => setOpen(true),
|
|
3140
3584
|
className: "!w-10 !h-8 !p-0 overflow-hidden",
|
|
3141
3585
|
"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:
|
|
3586
|
+
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
3587
|
}
|
|
3144
3588
|
),
|
|
3145
3589
|
/* @__PURE__ */ jsxs(
|
|
@@ -3147,7 +3591,7 @@ function IconPicker({ value, onChange, disabled = false, renderTrigger, open: co
|
|
|
3147
3591
|
{
|
|
3148
3592
|
open,
|
|
3149
3593
|
onCancel: () => setOpen(false),
|
|
3150
|
-
title:
|
|
3594
|
+
title: labels.title,
|
|
3151
3595
|
footer: null,
|
|
3152
3596
|
width: 600,
|
|
3153
3597
|
className: "icon-picker-modal",
|
|
@@ -3158,7 +3602,7 @@ function IconPicker({ value, onChange, disabled = false, renderTrigger, open: co
|
|
|
3158
3602
|
/* @__PURE__ */ jsx(
|
|
3159
3603
|
Input,
|
|
3160
3604
|
{
|
|
3161
|
-
placeholder:
|
|
3605
|
+
placeholder: labels.searchPlaceholder,
|
|
3162
3606
|
value: search,
|
|
3163
3607
|
onChange: (e) => {
|
|
3164
3608
|
setSearch(e.target.value);
|
|
@@ -3170,7 +3614,7 @@ function IconPicker({ value, onChange, disabled = false, renderTrigger, open: co
|
|
|
3170
3614
|
}
|
|
3171
3615
|
),
|
|
3172
3616
|
/* @__PURE__ */ jsx("div", { className: "overflow-x-auto whitespace-nowrap", children: /* @__PURE__ */ jsxs("div", { className: "flex gap-1 pb-2", children: [
|
|
3173
|
-
/* @__PURE__ */
|
|
3617
|
+
/* @__PURE__ */ jsx(
|
|
3174
3618
|
Button,
|
|
3175
3619
|
{
|
|
3176
3620
|
type: activeCategory === null && !search ? "primary" : "text",
|
|
@@ -3181,34 +3625,25 @@ function IconPicker({ value, onChange, disabled = false, renderTrigger, open: co
|
|
|
3181
3625
|
setSearch("");
|
|
3182
3626
|
},
|
|
3183
3627
|
"data-testid": "button-category-all",
|
|
3184
|
-
children:
|
|
3185
|
-
"All (",
|
|
3186
|
-
ICONS.length,
|
|
3187
|
-
")"
|
|
3188
|
-
]
|
|
3628
|
+
children: labels.allCategories(ICONS.length)
|
|
3189
3629
|
}
|
|
3190
3630
|
),
|
|
3191
3631
|
CATEGORIES.map((cat) => {
|
|
3192
|
-
const count = ICONS.filter((i) => i.category === cat
|
|
3193
|
-
return /* @__PURE__ */
|
|
3632
|
+
const count = ICONS.filter((i) => i.category === cat).length;
|
|
3633
|
+
return /* @__PURE__ */ jsx(
|
|
3194
3634
|
Button,
|
|
3195
3635
|
{
|
|
3196
|
-
type: activeCategory === cat
|
|
3636
|
+
type: activeCategory === cat ? "primary" : "text",
|
|
3197
3637
|
size: "small",
|
|
3198
3638
|
className: "!h-7 text-xs !px-3 shrink-0",
|
|
3199
3639
|
onClick: () => {
|
|
3200
|
-
setActiveCategory(cat
|
|
3640
|
+
setActiveCategory(cat);
|
|
3201
3641
|
setSearch("");
|
|
3202
3642
|
},
|
|
3203
|
-
"data-testid": `button-category-${cat
|
|
3204
|
-
children: [
|
|
3205
|
-
cat.label,
|
|
3206
|
-
" (",
|
|
3207
|
-
count,
|
|
3208
|
-
")"
|
|
3209
|
-
]
|
|
3643
|
+
"data-testid": `button-category-${cat}`,
|
|
3644
|
+
children: labels.categoryWithCount({ category: iconCategories2[cat], count })
|
|
3210
3645
|
},
|
|
3211
|
-
cat
|
|
3646
|
+
cat
|
|
3212
3647
|
);
|
|
3213
3648
|
})
|
|
3214
3649
|
] }) })
|
|
@@ -3226,25 +3661,21 @@ function IconPicker({ value, onChange, disabled = false, renderTrigger, open: co
|
|
|
3226
3661
|
size: "small",
|
|
3227
3662
|
className: "!w-10 !h-10 !p-1",
|
|
3228
3663
|
onClick: () => handleSelect(iconDef.emoji),
|
|
3229
|
-
title: iconDef
|
|
3664
|
+
title: iconName(iconDef),
|
|
3230
3665
|
"data-testid": `button-icon-${iconDef.id}`,
|
|
3231
3666
|
children: /* @__PURE__ */ jsx("span", { className: "text-xl leading-none", children: iconDef.emoji })
|
|
3232
3667
|
},
|
|
3233
3668
|
iconDef.id
|
|
3234
3669
|
)) }),
|
|
3235
|
-
filteredIcons.length === 0 && /* @__PURE__ */
|
|
3236
|
-
'No icons found for "',
|
|
3237
|
-
search,
|
|
3238
|
-
'"'
|
|
3239
|
-
] })
|
|
3670
|
+
filteredIcons.length === 0 && /* @__PURE__ */ jsx("div", { className: "text-center text-muted-foreground text-sm py-12", children: labels.noIconsFound(search) })
|
|
3240
3671
|
]
|
|
3241
3672
|
}
|
|
3242
3673
|
),
|
|
3243
3674
|
/* @__PURE__ */ jsxs("div", { className: "px-4 py-3 border-t shrink-0 flex items-center justify-between gap-2", children: [
|
|
3244
3675
|
selectedIcon ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground min-w-0", children: [
|
|
3245
3676
|
/* @__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:
|
|
3677
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: iconName(selectedIcon) })
|
|
3678
|
+
] }) : /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: labels.noIconSelected }),
|
|
3248
3679
|
/* @__PURE__ */ jsxs("div", { className: "flex gap-2 shrink-0", children: [
|
|
3249
3680
|
value && /* @__PURE__ */ jsx(
|
|
3250
3681
|
Button,
|
|
@@ -3256,7 +3687,7 @@ function IconPicker({ value, onChange, disabled = false, renderTrigger, open: co
|
|
|
3256
3687
|
setOpen(false);
|
|
3257
3688
|
},
|
|
3258
3689
|
"data-testid": "button-clear-icon",
|
|
3259
|
-
children:
|
|
3690
|
+
children: labels.clearIcon
|
|
3260
3691
|
}
|
|
3261
3692
|
),
|
|
3262
3693
|
/* @__PURE__ */ jsx(
|
|
@@ -3266,7 +3697,7 @@ function IconPicker({ value, onChange, disabled = false, renderTrigger, open: co
|
|
|
3266
3697
|
size: "small",
|
|
3267
3698
|
onClick: () => setOpen(false),
|
|
3268
3699
|
"data-testid": "button-close-icon-picker",
|
|
3269
|
-
children:
|
|
3700
|
+
children: labels.cancel
|
|
3270
3701
|
}
|
|
3271
3702
|
)
|
|
3272
3703
|
] })
|
|
@@ -3385,11 +3816,6 @@ const DEFAULT_ENDPOINTS = {
|
|
|
3385
3816
|
terrainTiles: ["https://s3.amazonaws.com/elevation-tiles-prod/terrarium/{z}/{x}/{y}.png"],
|
|
3386
3817
|
glyphsUrl: "/fonts/{fontstack}/{range}.pbf"
|
|
3387
3818
|
};
|
|
3388
|
-
const BUILT_IN_NAMES = {
|
|
3389
|
-
streets: "Streets",
|
|
3390
|
-
satellite: "Satellite",
|
|
3391
|
-
dark: "Dark"
|
|
3392
|
-
};
|
|
3393
3819
|
const isOff = (value) => value === false || value === null;
|
|
3394
3820
|
const nonEmpty = (value) => typeof value === "string" && value.trim() !== "" ? value : void 0;
|
|
3395
3821
|
const nonEmptyTiles = (tiles) => Array.isArray(tiles) ? tiles.filter((tile) => nonEmpty(tile) !== void 0) : [];
|
|
@@ -3443,9 +3869,9 @@ function resolveEndpoints(endpoints) {
|
|
|
3443
3869
|
const adoptStyleGlyphs = glyphs === "from-style";
|
|
3444
3870
|
const glyphsUrl = typeof glyphs === "object" && glyphs !== null && nonEmpty(glyphs.url) || DEFAULT_ENDPOINTS.glyphsUrl;
|
|
3445
3871
|
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
|
|
3872
|
+
if (streets) builtInBasemaps.push({ id: "streets", name: streets.name });
|
|
3873
|
+
if (satellite) builtInBasemaps.push({ id: "satellite", name: satelliteName });
|
|
3874
|
+
if (dark) builtInBasemaps.push({ id: "dark", name: dark.name });
|
|
3449
3875
|
return {
|
|
3450
3876
|
vectorStyles: {
|
|
3451
3877
|
...streets ? { streets: streets.style } : {},
|
|
@@ -3554,10 +3980,10 @@ function ToolButton({ mode, activeMode, onModeChange, icon, label, shortcut, dis
|
|
|
3554
3980
|
);
|
|
3555
3981
|
}
|
|
3556
3982
|
const SELECTION_MODES = [
|
|
3557
|
-
{ id: "click",
|
|
3558
|
-
{ id: "rectangle",
|
|
3559
|
-
{ id: "polygon",
|
|
3560
|
-
{ id: "circle",
|
|
3983
|
+
{ id: "click", labelKey: "clickSelect", icon: MousePointer2, shortcut: "V" },
|
|
3984
|
+
{ id: "rectangle", labelKey: "rectangleSelect", icon: Square, shortcut: "R" },
|
|
3985
|
+
{ id: "polygon", labelKey: "polygonSelect", icon: Hexagon, shortcut: "S" },
|
|
3986
|
+
{ id: "circle", labelKey: "circleSelect", icon: Circle, shortcut: "O" }
|
|
3561
3987
|
];
|
|
3562
3988
|
function DrawingToolbar({
|
|
3563
3989
|
activeMode,
|
|
@@ -3602,6 +4028,13 @@ function DrawingToolbar({
|
|
|
3602
4028
|
canDeleteSelected = true,
|
|
3603
4029
|
showUndoRedo = false
|
|
3604
4030
|
}) {
|
|
4031
|
+
var _a;
|
|
4032
|
+
const {
|
|
4033
|
+
drawingToolbar: labels,
|
|
4034
|
+
navigate: navigateLabels,
|
|
4035
|
+
coordinates: coordinateLabels,
|
|
4036
|
+
featureSearch: searchLabels
|
|
4037
|
+
} = useMapLabels();
|
|
3605
4038
|
const { toast } = useToast();
|
|
3606
4039
|
const confirm = useConfirm();
|
|
3607
4040
|
const antdPopupSelector = useAntdPopupSelector();
|
|
@@ -3623,8 +4056,8 @@ function DrawingToolbar({
|
|
|
3623
4056
|
useEffect(() => {
|
|
3624
4057
|
if (featureSearchOpen) {
|
|
3625
4058
|
setTimeout(() => {
|
|
3626
|
-
var
|
|
3627
|
-
return (
|
|
4059
|
+
var _a2;
|
|
4060
|
+
return (_a2 = searchInputRef.current) == null ? void 0 : _a2.focus();
|
|
3628
4061
|
}, 100);
|
|
3629
4062
|
}
|
|
3630
4063
|
}, [featureSearchOpen]);
|
|
@@ -3641,9 +4074,9 @@ function DrawingToolbar({
|
|
|
3641
4074
|
return () => document.removeEventListener("pointerdown", handlePointerDown);
|
|
3642
4075
|
}, [featureSearchOpen, antdPopupSelector]);
|
|
3643
4076
|
const getFeatureLabel = (f) => {
|
|
3644
|
-
var
|
|
4077
|
+
var _a2;
|
|
3645
4078
|
const p = f.properties || {};
|
|
3646
|
-
return p.name || p.label || p.title || p.text || p.description || `${p.entityType || ((
|
|
4079
|
+
return p.name || p.label || p.title || p.text || p.description || `${p.entityType || ((_a2 = f.geometry) == null ? void 0 : _a2.type) || searchLabels.untitledFeature}`;
|
|
3647
4080
|
};
|
|
3648
4081
|
const cachedFeatures = featureSearchOpen && getAllFeatures ? getAllFeatures() : [];
|
|
3649
4082
|
const featureSearchResults = (() => {
|
|
@@ -3721,15 +4154,15 @@ function DrawingToolbar({
|
|
|
3721
4154
|
const lat = parseFloat(goToLat.trim());
|
|
3722
4155
|
const lng = parseFloat(goToLng.trim());
|
|
3723
4156
|
if (isNaN(lat) || isNaN(lng)) {
|
|
3724
|
-
toast({ title:
|
|
4157
|
+
toast({ title: coordinateLabels.invalidCoordinates, description: coordinateLabels.invalidCoordinatesDescription, variant: "destructive" });
|
|
3725
4158
|
return;
|
|
3726
4159
|
}
|
|
3727
4160
|
if (lat < -90 || lat > 90) {
|
|
3728
|
-
toast({ title:
|
|
4161
|
+
toast({ title: coordinateLabels.invalidLatitude, description: coordinateLabels.latitudeOutOfRange, variant: "destructive" });
|
|
3729
4162
|
return;
|
|
3730
4163
|
}
|
|
3731
4164
|
if (lng < -180 || lng > 180) {
|
|
3732
|
-
toast({ title:
|
|
4165
|
+
toast({ title: coordinateLabels.invalidLongitude, description: coordinateLabels.longitudeOutOfRange, variant: "destructive" });
|
|
3733
4166
|
return;
|
|
3734
4167
|
}
|
|
3735
4168
|
if (onDropPoint) {
|
|
@@ -3748,8 +4181,8 @@ function DrawingToolbar({
|
|
|
3748
4181
|
const result = await geocodeAddress(resolvedGeocoder, goToAddress.trim());
|
|
3749
4182
|
if (!result) {
|
|
3750
4183
|
toast({
|
|
3751
|
-
title:
|
|
3752
|
-
description:
|
|
4184
|
+
title: navigateLabels.locationNotFound,
|
|
4185
|
+
description: navigateLabels.locationNotFoundDescription,
|
|
3753
4186
|
variant: "destructive"
|
|
3754
4187
|
});
|
|
3755
4188
|
return;
|
|
@@ -3765,8 +4198,8 @@ function DrawingToolbar({
|
|
|
3765
4198
|
setGoToAddress("");
|
|
3766
4199
|
} catch (error) {
|
|
3767
4200
|
toast({
|
|
3768
|
-
title:
|
|
3769
|
-
description:
|
|
4201
|
+
title: navigateLabels.searchError,
|
|
4202
|
+
description: navigateLabels.searchErrorDescription,
|
|
3770
4203
|
variant: "destructive"
|
|
3771
4204
|
});
|
|
3772
4205
|
} finally {
|
|
@@ -3775,11 +4208,11 @@ function DrawingToolbar({
|
|
|
3775
4208
|
};
|
|
3776
4209
|
const handleClearAll = () => {
|
|
3777
4210
|
confirm({
|
|
3778
|
-
title:
|
|
3779
|
-
content:
|
|
3780
|
-
okText:
|
|
4211
|
+
title: labels.clearAllConfirmTitle,
|
|
4212
|
+
content: labels.clearAllConfirmContent(featureCount),
|
|
4213
|
+
okText: labels.clearAllConfirmOk,
|
|
3781
4214
|
okButtonProps: { danger: true },
|
|
3782
|
-
cancelText:
|
|
4215
|
+
cancelText: labels.clearAllConfirmCancel,
|
|
3783
4216
|
onOk: onClear
|
|
3784
4217
|
});
|
|
3785
4218
|
};
|
|
@@ -3791,7 +4224,7 @@ function DrawingToolbar({
|
|
|
3791
4224
|
key: mode.id,
|
|
3792
4225
|
label: /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
3793
4226
|
/* @__PURE__ */ jsx(Icon, { className: "w-4 h-4" }),
|
|
3794
|
-
mode.
|
|
4227
|
+
labels[mode.labelKey]
|
|
3795
4228
|
] }),
|
|
3796
4229
|
className: isThisModeActive ? "bg-primary/10" : "",
|
|
3797
4230
|
onClick: () => {
|
|
@@ -3818,7 +4251,7 @@ function DrawingToolbar({
|
|
|
3818
4251
|
label: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between w-full", children: [
|
|
3819
4252
|
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
3820
4253
|
/* @__PURE__ */ jsx(Ruler, { className: "w-4 h-4" }),
|
|
3821
|
-
|
|
4254
|
+
labels.measureDistance
|
|
3822
4255
|
] }),
|
|
3823
4256
|
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
4257
|
] }),
|
|
@@ -3830,7 +4263,7 @@ function DrawingToolbar({
|
|
|
3830
4263
|
label: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between w-full", children: [
|
|
3831
4264
|
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
3832
4265
|
/* @__PURE__ */ jsx(Move, { className: "w-4 h-4" }),
|
|
3833
|
-
|
|
4266
|
+
labels.measureArea
|
|
3834
4267
|
] }),
|
|
3835
4268
|
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
4269
|
] }),
|
|
@@ -3847,7 +4280,7 @@ function DrawingToolbar({
|
|
|
3847
4280
|
label: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between w-full", children: [
|
|
3848
4281
|
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
3849
4282
|
/* @__PURE__ */ jsx(Type, { className: "w-4 h-4" }),
|
|
3850
|
-
|
|
4283
|
+
labels.addText
|
|
3851
4284
|
] }),
|
|
3852
4285
|
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
4286
|
] }),
|
|
@@ -3862,7 +4295,7 @@ function DrawingToolbar({
|
|
|
3862
4295
|
label: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between w-full", children: [
|
|
3863
4296
|
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
3864
4297
|
/* @__PURE__ */ jsx(MoveRight, { className: "w-4 h-4" }),
|
|
3865
|
-
|
|
4298
|
+
labels.drawArrow
|
|
3866
4299
|
] }),
|
|
3867
4300
|
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
4301
|
] }),
|
|
@@ -3877,7 +4310,7 @@ function DrawingToolbar({
|
|
|
3877
4310
|
label: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between w-full", children: [
|
|
3878
4311
|
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
3879
4312
|
/* @__PURE__ */ jsx(Circle, { className: "w-4 h-4" }),
|
|
3880
|
-
|
|
4313
|
+
labels.drawCircle
|
|
3881
4314
|
] }),
|
|
3882
4315
|
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
4316
|
] }),
|
|
@@ -3893,7 +4326,7 @@ function DrawingToolbar({
|
|
|
3893
4326
|
label: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between w-full", children: [
|
|
3894
4327
|
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
3895
4328
|
/* @__PURE__ */ jsx(Undo2, { className: "w-4 h-4" }),
|
|
3896
|
-
|
|
4329
|
+
labels.undo
|
|
3897
4330
|
] }),
|
|
3898
4331
|
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
4332
|
] }),
|
|
@@ -3905,7 +4338,7 @@ function DrawingToolbar({
|
|
|
3905
4338
|
label: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between w-full", children: [
|
|
3906
4339
|
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
3907
4340
|
/* @__PURE__ */ jsx(Redo2, { className: "w-4 h-4" }),
|
|
3908
|
-
|
|
4341
|
+
labels.redo
|
|
3909
4342
|
] }),
|
|
3910
4343
|
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
4344
|
] }),
|
|
@@ -3919,9 +4352,7 @@ function DrawingToolbar({
|
|
|
3919
4352
|
label: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between w-full text-red-500", children: [
|
|
3920
4353
|
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
3921
4354
|
/* @__PURE__ */ jsx(X, { className: "w-4 h-4" }),
|
|
3922
|
-
|
|
3923
|
-
selectedCount,
|
|
3924
|
-
")"
|
|
4355
|
+
labels.deleteSelected(selectedCount)
|
|
3925
4356
|
] }),
|
|
3926
4357
|
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
4358
|
] }),
|
|
@@ -3932,16 +4363,14 @@ function DrawingToolbar({
|
|
|
3932
4363
|
key: "clear",
|
|
3933
4364
|
label: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-red-500", children: [
|
|
3934
4365
|
/* @__PURE__ */ jsx(Trash2, { className: "w-4 h-4" }),
|
|
3935
|
-
|
|
3936
|
-
featureCount,
|
|
3937
|
-
")"
|
|
4366
|
+
labels.clearAll(featureCount)
|
|
3938
4367
|
] }),
|
|
3939
4368
|
disabled: disabled || featureCount === 0,
|
|
3940
4369
|
onClick: handleClearAll
|
|
3941
4370
|
});
|
|
3942
4371
|
return items;
|
|
3943
4372
|
};
|
|
3944
|
-
const compactOverflowItems = isEditMode && isCompact && !selectionOnly ? /* @__PURE__ */ jsx(Tooltip, { title:
|
|
4373
|
+
const compactOverflowItems = isEditMode && isCompact && !selectionOnly ? /* @__PURE__ */ jsx(Tooltip, { title: labels.moreTools, placement: "right", children: /* @__PURE__ */ jsx(
|
|
3945
4374
|
Dropdown,
|
|
3946
4375
|
{
|
|
3947
4376
|
menu: { items: getMoreMenuItems() },
|
|
@@ -3952,7 +4381,7 @@ function DrawingToolbar({
|
|
|
3952
4381
|
{
|
|
3953
4382
|
type: "text",
|
|
3954
4383
|
className: "relative flex items-center justify-center !w-9 !h-9 !min-w-0 !p-0",
|
|
3955
|
-
"aria-label":
|
|
4384
|
+
"aria-label": labels.moreTools,
|
|
3956
4385
|
"data-testid": "button-more-tools",
|
|
3957
4386
|
icon: /* @__PURE__ */ jsx(MoreVertical, { className: "w-5 h-5" })
|
|
3958
4387
|
}
|
|
@@ -3965,14 +4394,14 @@ function DrawingToolbar({
|
|
|
3965
4394
|
ref: toolbarRef,
|
|
3966
4395
|
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
4396
|
role: "toolbar",
|
|
3968
|
-
"aria-label":
|
|
4397
|
+
"aria-label": labels.drawingTools,
|
|
3969
4398
|
"data-testid": "toolbar-drawing",
|
|
3970
4399
|
children: [
|
|
3971
4400
|
enableSelection && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3972
4401
|
expandSelectionTools ? /* @__PURE__ */ jsx(Fragment, { children: visibleSelectionModes.map((mode) => {
|
|
3973
4402
|
const Icon = mode.icon;
|
|
3974
4403
|
const isThisModeActive = isSelectionToolActive && selectionMode === mode.id;
|
|
3975
|
-
return /* @__PURE__ */ jsx(Tooltip, { title: mode.
|
|
4404
|
+
return /* @__PURE__ */ jsx(Tooltip, { title: labels[mode.labelKey], placement: "right", children: /* @__PURE__ */ jsx(
|
|
3976
4405
|
Button,
|
|
3977
4406
|
{
|
|
3978
4407
|
type: "text",
|
|
@@ -3991,13 +4420,13 @@ function DrawingToolbar({
|
|
|
3991
4420
|
"relative transition-all duration-150 flex items-center justify-center !w-9 !h-9 !min-w-0 !p-0",
|
|
3992
4421
|
isThisModeActive && "tool-active bg-primary/10"
|
|
3993
4422
|
),
|
|
3994
|
-
"aria-label": mode.
|
|
4423
|
+
"aria-label": labels[mode.labelKey],
|
|
3995
4424
|
"data-testid": `button-select-${mode.id}`,
|
|
3996
4425
|
icon: /* @__PURE__ */ jsx(Icon, { className: "w-5 h-5" })
|
|
3997
4426
|
}
|
|
3998
4427
|
) }, mode.id);
|
|
3999
4428
|
}) }) : /* @__PURE__ */ jsxs("div", { className: "relative flex items-center", children: [
|
|
4000
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
4429
|
+
/* @__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
4430
|
Button,
|
|
4002
4431
|
{
|
|
4003
4432
|
type: "text",
|
|
@@ -4016,7 +4445,7 @@ function DrawingToolbar({
|
|
|
4016
4445
|
"relative transition-all duration-150 flex items-center justify-center !w-9 !h-9 !min-w-0 !p-0",
|
|
4017
4446
|
isSelectionToolActive && selectionMode !== "click" && !filterActive && "tool-active bg-primary/10"
|
|
4018
4447
|
),
|
|
4019
|
-
"aria-label":
|
|
4448
|
+
"aria-label": labels.selectTool,
|
|
4020
4449
|
"data-testid": "button-select-tool",
|
|
4021
4450
|
children: [
|
|
4022
4451
|
selectionMode === "click" && /* @__PURE__ */ jsx(MousePointer2, { className: "w-5 h-5" }),
|
|
@@ -4037,7 +4466,7 @@ function DrawingToolbar({
|
|
|
4037
4466
|
{
|
|
4038
4467
|
disabled,
|
|
4039
4468
|
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":
|
|
4469
|
+
"aria-label": labels.switchSelectionMode,
|
|
4041
4470
|
"data-testid": "button-select-mode-switch",
|
|
4042
4471
|
onClick: (e) => e.stopPropagation(),
|
|
4043
4472
|
children: /* @__PURE__ */ jsx(ChevronDown, { className: "w-3 h-3 opacity-70" })
|
|
@@ -4046,7 +4475,7 @@ function DrawingToolbar({
|
|
|
4046
4475
|
}
|
|
4047
4476
|
)
|
|
4048
4477
|
] }),
|
|
4049
|
-
showFilterTool && /* @__PURE__ */ jsx(Tooltip, { title:
|
|
4478
|
+
showFilterTool && /* @__PURE__ */ jsx(Tooltip, { title: labels.filterArea, placement: "right", children: /* @__PURE__ */ jsx(
|
|
4050
4479
|
Button,
|
|
4051
4480
|
{
|
|
4052
4481
|
type: "text",
|
|
@@ -4067,19 +4496,19 @@ function DrawingToolbar({
|
|
|
4067
4496
|
"relative transition-all duration-150 flex items-center justify-center !w-9 !h-9 !min-w-0 !p-0",
|
|
4068
4497
|
isSelectionToolActive && filterActive && "tool-active bg-primary/10"
|
|
4069
4498
|
),
|
|
4070
|
-
"aria-label":
|
|
4499
|
+
"aria-label": labels.filterArea,
|
|
4071
4500
|
"data-testid": "button-filter-tool",
|
|
4072
4501
|
icon: /* @__PURE__ */ jsx(Filter, { className: "w-5 h-5" })
|
|
4073
4502
|
}
|
|
4074
4503
|
) }),
|
|
4075
|
-
showClearFilter && /* @__PURE__ */ jsx(Tooltip, { title:
|
|
4504
|
+
showClearFilter && /* @__PURE__ */ jsx(Tooltip, { title: labels.clearFilter, placement: "right", children: /* @__PURE__ */ jsx(
|
|
4076
4505
|
Button,
|
|
4077
4506
|
{
|
|
4078
4507
|
type: "text",
|
|
4079
4508
|
onClick: onClearFilter,
|
|
4080
4509
|
disabled,
|
|
4081
4510
|
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":
|
|
4511
|
+
"aria-label": labels.clearFilter,
|
|
4083
4512
|
"data-testid": "button-clear-filter-toolbar",
|
|
4084
4513
|
icon: /* @__PURE__ */ jsx(X, { className: "w-5 h-5" })
|
|
4085
4514
|
}
|
|
@@ -4091,7 +4520,7 @@ function DrawingToolbar({
|
|
|
4091
4520
|
/* @__PURE__ */ jsx(
|
|
4092
4521
|
Tooltip,
|
|
4093
4522
|
{
|
|
4094
|
-
title: measureMode === "area" ?
|
|
4523
|
+
title: measureMode === "area" ? labels.measureArea : labels.measureDistance,
|
|
4095
4524
|
placement: "right",
|
|
4096
4525
|
children: /* @__PURE__ */ jsx(
|
|
4097
4526
|
Button,
|
|
@@ -4106,7 +4535,7 @@ function DrawingToolbar({
|
|
|
4106
4535
|
"relative transition-all duration-150 flex items-center justify-center !w-9 !h-9 !min-w-0 !p-0",
|
|
4107
4536
|
measureMode !== "none" && "tool-active bg-primary/10"
|
|
4108
4537
|
),
|
|
4109
|
-
"aria-label": measureMode === "area" ?
|
|
4538
|
+
"aria-label": measureMode === "area" ? labels.measureArea : labels.measureDistance,
|
|
4110
4539
|
"aria-pressed": measureMode !== "none",
|
|
4111
4540
|
"data-testid": "button-measure",
|
|
4112
4541
|
children: measureMode === "area" ? /* @__PURE__ */ jsx(Move, { className: "w-5 h-5" }) : /* @__PURE__ */ jsx(Ruler, { className: "w-5 h-5" })
|
|
@@ -4125,7 +4554,7 @@ function DrawingToolbar({
|
|
|
4125
4554
|
{
|
|
4126
4555
|
disabled,
|
|
4127
4556
|
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":
|
|
4557
|
+
"aria-label": labels.switchMeasureMode,
|
|
4129
4558
|
"data-testid": "button-measure-mode-switch",
|
|
4130
4559
|
onClick: (e) => e.stopPropagation(),
|
|
4131
4560
|
children: /* @__PURE__ */ jsx(ChevronDown, { className: "w-3 h-3 opacity-70" })
|
|
@@ -4136,7 +4565,7 @@ function DrawingToolbar({
|
|
|
4136
4565
|
] }),
|
|
4137
4566
|
/* @__PURE__ */ jsx(Divider, { className: "!my-0 !min-w-0" })
|
|
4138
4567
|
] }),
|
|
4139
|
-
(onFlyToFeature && getAllFeatures || onGoTo) && /* @__PURE__ */ jsx(Tooltip, { title:
|
|
4568
|
+
(onFlyToFeature && getAllFeatures || onGoTo) && /* @__PURE__ */ jsx(Tooltip, { title: labels.searchAndNavigate, placement: "right", children: /* @__PURE__ */ jsx(
|
|
4140
4569
|
Button,
|
|
4141
4570
|
{
|
|
4142
4571
|
type: "text",
|
|
@@ -4146,7 +4575,7 @@ function DrawingToolbar({
|
|
|
4146
4575
|
"relative transition-all duration-150 flex items-center justify-center !w-9 !h-9 !min-w-0 !p-0",
|
|
4147
4576
|
featureSearchOpen && "tool-active bg-primary/10"
|
|
4148
4577
|
),
|
|
4149
|
-
"aria-label":
|
|
4578
|
+
"aria-label": labels.searchAndNavigate,
|
|
4150
4579
|
"data-testid": "button-search-features",
|
|
4151
4580
|
icon: /* @__PURE__ */ jsx(Search, { className: "w-5 h-5" })
|
|
4152
4581
|
}
|
|
@@ -4154,7 +4583,7 @@ function DrawingToolbar({
|
|
|
4154
4583
|
onFitToFeatures && /* @__PURE__ */ jsx(
|
|
4155
4584
|
Tooltip,
|
|
4156
4585
|
{
|
|
4157
|
-
title:
|
|
4586
|
+
title: labels.fitToData,
|
|
4158
4587
|
placement: "right",
|
|
4159
4588
|
children: /* @__PURE__ */ jsx(
|
|
4160
4589
|
Button,
|
|
@@ -4163,7 +4592,7 @@ function DrawingToolbar({
|
|
|
4163
4592
|
onClick: onFitToFeatures,
|
|
4164
4593
|
disabled,
|
|
4165
4594
|
className: "relative transition-all duration-150 flex items-center justify-center !w-9 !h-9 !min-w-0 !p-0",
|
|
4166
|
-
"aria-label":
|
|
4595
|
+
"aria-label": labels.fitToData,
|
|
4167
4596
|
"data-testid": "button-fit-to-data",
|
|
4168
4597
|
icon: /* @__PURE__ */ jsx(Scan, { className: "w-5 h-5" })
|
|
4169
4598
|
}
|
|
@@ -4175,12 +4604,12 @@ function DrawingToolbar({
|
|
|
4175
4604
|
Tooltip,
|
|
4176
4605
|
{
|
|
4177
4606
|
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:
|
|
4607
|
+
/* @__PURE__ */ jsx("span", { className: "text-amber-500 font-medium", children: labels.noEditableLayer }),
|
|
4608
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs", children: labels.noEditableLayerHint })
|
|
4180
4609
|
] }) : showShortcutHints ? /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
4181
|
-
|
|
4610
|
+
labels.editMode,
|
|
4182
4611
|
/* @__PURE__ */ jsx("kbd", { className: "px-1.5 py-0.5 text-xs font-mono bg-black/20 rounded", children: "E" })
|
|
4183
|
-
] }) :
|
|
4612
|
+
] }) : labels.editMode,
|
|
4184
4613
|
placement: "right",
|
|
4185
4614
|
children: /* @__PURE__ */ jsx(
|
|
4186
4615
|
Button,
|
|
@@ -4192,7 +4621,7 @@ function DrawingToolbar({
|
|
|
4192
4621
|
"relative transition-all duration-150 flex items-center justify-center !w-9 !h-9 !min-w-0 !p-0",
|
|
4193
4622
|
isEditMode && "tool-active bg-primary/10"
|
|
4194
4623
|
),
|
|
4195
|
-
"aria-label":
|
|
4624
|
+
"aria-label": labels.editMode,
|
|
4196
4625
|
"aria-pressed": isEditMode,
|
|
4197
4626
|
"data-testid": "button-edit-mode",
|
|
4198
4627
|
icon: /* @__PURE__ */ jsx(Pencil, { className: "w-5 h-5" })
|
|
@@ -4202,14 +4631,14 @@ function DrawingToolbar({
|
|
|
4202
4631
|
),
|
|
4203
4632
|
isEditMode && !selectionOnly && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4204
4633
|
/* @__PURE__ */ jsx(Divider, { className: "!my-0 !min-w-0" }),
|
|
4205
|
-
onSearchEngineRequest && /* @__PURE__ */ jsx(Tooltip, { title:
|
|
4634
|
+
onSearchEngineRequest && /* @__PURE__ */ jsx(Tooltip, { title: labels.searchAndAdd, placement: "right", children: /* @__PURE__ */ jsx(
|
|
4206
4635
|
Button,
|
|
4207
4636
|
{
|
|
4208
4637
|
type: "text",
|
|
4209
4638
|
onClick: onSearchEngineRequest,
|
|
4210
4639
|
disabled: drawingDisabled,
|
|
4211
4640
|
className: "relative transition-all duration-150 flex items-center justify-center !w-9 !h-9 !min-w-0 !p-0",
|
|
4212
|
-
"aria-label":
|
|
4641
|
+
"aria-label": labels.searchAndAdd,
|
|
4213
4642
|
"data-testid": "button-search-database",
|
|
4214
4643
|
icon: /* @__PURE__ */ jsxs("div", { className: "relative w-5 h-5", children: [
|
|
4215
4644
|
/* @__PURE__ */ jsx(Database, { className: "w-5 h-5" }),
|
|
@@ -4224,7 +4653,7 @@ function DrawingToolbar({
|
|
|
4224
4653
|
activeMode,
|
|
4225
4654
|
onModeChange,
|
|
4226
4655
|
icon: /* @__PURE__ */ jsx(MapPin, { className: "w-5 h-5" }),
|
|
4227
|
-
label:
|
|
4656
|
+
label: labels.dropPoint,
|
|
4228
4657
|
shortcut: "P",
|
|
4229
4658
|
disabled: drawingDisabled,
|
|
4230
4659
|
showShortcutHint: showShortcutHints
|
|
@@ -4237,7 +4666,7 @@ function DrawingToolbar({
|
|
|
4237
4666
|
activeMode,
|
|
4238
4667
|
onModeChange,
|
|
4239
4668
|
icon: /* @__PURE__ */ jsx(Minus, { className: "w-5 h-5" }),
|
|
4240
|
-
label:
|
|
4669
|
+
label: labels.drawLine,
|
|
4241
4670
|
shortcut: "L",
|
|
4242
4671
|
disabled: drawingDisabled,
|
|
4243
4672
|
showShortcutHint: showShortcutHints
|
|
@@ -4250,7 +4679,7 @@ function DrawingToolbar({
|
|
|
4250
4679
|
activeMode,
|
|
4251
4680
|
onModeChange,
|
|
4252
4681
|
icon: /* @__PURE__ */ jsx(Pentagon, { className: "w-5 h-5" }),
|
|
4253
|
-
label:
|
|
4682
|
+
label: labels.drawPolygon,
|
|
4254
4683
|
shortcut: "G",
|
|
4255
4684
|
disabled: drawingDisabled,
|
|
4256
4685
|
showShortcutHint: showShortcutHints
|
|
@@ -4265,7 +4694,7 @@ function DrawingToolbar({
|
|
|
4265
4694
|
key: "polygon",
|
|
4266
4695
|
label: /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
4267
4696
|
/* @__PURE__ */ jsx(Pentagon, { className: "w-4 h-4" }),
|
|
4268
|
-
|
|
4697
|
+
labels.drawPolygon,
|
|
4269
4698
|
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
4699
|
] }),
|
|
4271
4700
|
onClick: () => onModeChange("draw_polygon")
|
|
@@ -4274,7 +4703,7 @@ function DrawingToolbar({
|
|
|
4274
4703
|
key: "rectangle",
|
|
4275
4704
|
label: /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
4276
4705
|
/* @__PURE__ */ jsx(Square, { className: "w-4 h-4" }),
|
|
4277
|
-
|
|
4706
|
+
labels.drawRectangle,
|
|
4278
4707
|
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
4708
|
] }),
|
|
4280
4709
|
onClick: () => onModeChange("draw_rectangle")
|
|
@@ -4288,9 +4717,9 @@ function DrawingToolbar({
|
|
|
4288
4717
|
Tooltip,
|
|
4289
4718
|
{
|
|
4290
4719
|
title: showShortcutHints ? /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
4291
|
-
|
|
4720
|
+
labels.drawPolygonOrRectangle,
|
|
4292
4721
|
/* @__PURE__ */ jsx("kbd", { className: "px-1.5 py-0.5 text-xs font-mono bg-black/20 rounded", children: "G" })
|
|
4293
|
-
] }) :
|
|
4722
|
+
] }) : labels.drawPolygonOrRectangle,
|
|
4294
4723
|
placement: "right",
|
|
4295
4724
|
children: /* @__PURE__ */ jsx(
|
|
4296
4725
|
Button,
|
|
@@ -4301,7 +4730,7 @@ function DrawingToolbar({
|
|
|
4301
4730
|
"relative transition-all duration-150 flex items-center justify-center !w-9 !h-9 !min-w-0 !p-0",
|
|
4302
4731
|
(activeMode === "draw_polygon" || activeMode === "draw_rectangle") && "tool-active bg-primary/10"
|
|
4303
4732
|
),
|
|
4304
|
-
"aria-label":
|
|
4733
|
+
"aria-label": labels.drawPolygonOrRectangleAriaLabel,
|
|
4305
4734
|
"data-testid": "button-tool-polygon-menu",
|
|
4306
4735
|
icon: /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
4307
4736
|
activeMode === "draw_rectangle" ? /* @__PURE__ */ jsx(Square, { className: "w-5 h-5" }) : /* @__PURE__ */ jsx(Pentagon, { className: "w-5 h-5" }),
|
|
@@ -4322,7 +4751,7 @@ function DrawingToolbar({
|
|
|
4322
4751
|
activeMode,
|
|
4323
4752
|
onModeChange,
|
|
4324
4753
|
icon: /* @__PURE__ */ jsx(Type, { className: "w-5 h-5" }),
|
|
4325
|
-
label:
|
|
4754
|
+
label: labels.addText,
|
|
4326
4755
|
shortcut: "T",
|
|
4327
4756
|
disabled: drawingDisabled,
|
|
4328
4757
|
showShortcutHint: showShortcutHints
|
|
@@ -4335,7 +4764,7 @@ function DrawingToolbar({
|
|
|
4335
4764
|
activeMode,
|
|
4336
4765
|
onModeChange,
|
|
4337
4766
|
icon: /* @__PURE__ */ jsx(MoveRight, { className: "w-5 h-5" }),
|
|
4338
|
-
label:
|
|
4767
|
+
label: labels.drawArrow,
|
|
4339
4768
|
shortcut: "W",
|
|
4340
4769
|
disabled: drawingDisabled,
|
|
4341
4770
|
showShortcutHint: showShortcutHints
|
|
@@ -4348,7 +4777,7 @@ function DrawingToolbar({
|
|
|
4348
4777
|
activeMode,
|
|
4349
4778
|
onModeChange,
|
|
4350
4779
|
icon: /* @__PURE__ */ jsx(Circle, { className: "w-5 h-5" }),
|
|
4351
|
-
label:
|
|
4780
|
+
label: labels.drawCircle,
|
|
4352
4781
|
shortcut: "C",
|
|
4353
4782
|
disabled: drawingDisabled,
|
|
4354
4783
|
showShortcutHint: showShortcutHints
|
|
@@ -4360,9 +4789,9 @@ function DrawingToolbar({
|
|
|
4360
4789
|
Tooltip,
|
|
4361
4790
|
{
|
|
4362
4791
|
title: showShortcutHints ? /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
4363
|
-
|
|
4792
|
+
labels.undo,
|
|
4364
4793
|
/* @__PURE__ */ jsx("kbd", { className: "px-1.5 py-0.5 text-xs font-mono bg-black/20 rounded", children: "Ctrl+Z" })
|
|
4365
|
-
] }) :
|
|
4794
|
+
] }) : labels.undo,
|
|
4366
4795
|
placement: "right",
|
|
4367
4796
|
children: /* @__PURE__ */ jsx(
|
|
4368
4797
|
Button,
|
|
@@ -4370,7 +4799,7 @@ function DrawingToolbar({
|
|
|
4370
4799
|
type: "text",
|
|
4371
4800
|
onClick: onUndo,
|
|
4372
4801
|
disabled: disabled || !canUndo,
|
|
4373
|
-
"aria-label":
|
|
4802
|
+
"aria-label": labels.undo,
|
|
4374
4803
|
"data-testid": "button-undo",
|
|
4375
4804
|
className: "flex items-center justify-center !w-9 !h-9 !min-w-0 !p-0",
|
|
4376
4805
|
icon: /* @__PURE__ */ jsx(Undo2, { className: "w-5 h-5" })
|
|
@@ -4382,9 +4811,9 @@ function DrawingToolbar({
|
|
|
4382
4811
|
Tooltip,
|
|
4383
4812
|
{
|
|
4384
4813
|
title: showShortcutHints ? /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
4385
|
-
|
|
4814
|
+
labels.redo,
|
|
4386
4815
|
/* @__PURE__ */ jsx("kbd", { className: "px-1.5 py-0.5 text-xs font-mono bg-black/20 rounded", children: "Ctrl+Y" })
|
|
4387
|
-
] }) :
|
|
4816
|
+
] }) : labels.redo,
|
|
4388
4817
|
placement: "right",
|
|
4389
4818
|
children: /* @__PURE__ */ jsx(
|
|
4390
4819
|
Button,
|
|
@@ -4392,7 +4821,7 @@ function DrawingToolbar({
|
|
|
4392
4821
|
type: "text",
|
|
4393
4822
|
onClick: onRedo,
|
|
4394
4823
|
disabled: disabled || !canRedo,
|
|
4395
|
-
"aria-label":
|
|
4824
|
+
"aria-label": labels.redo,
|
|
4396
4825
|
"data-testid": "button-redo",
|
|
4397
4826
|
className: "flex items-center justify-center !w-9 !h-9 !min-w-0 !p-0",
|
|
4398
4827
|
icon: /* @__PURE__ */ jsx(Redo2, { className: "w-5 h-5" })
|
|
@@ -4408,11 +4837,9 @@ function DrawingToolbar({
|
|
|
4408
4837
|
Tooltip,
|
|
4409
4838
|
{
|
|
4410
4839
|
title: showShortcutHints ? /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
4411
|
-
|
|
4412
|
-
selectedCount,
|
|
4413
|
-
")",
|
|
4840
|
+
labels.deleteSelected(selectedCount),
|
|
4414
4841
|
/* @__PURE__ */ jsx("kbd", { className: "px-1.5 py-0.5 text-xs font-mono bg-black/20 rounded", children: "Del" })
|
|
4415
|
-
] }) :
|
|
4842
|
+
] }) : labels.deleteSelected(selectedCount),
|
|
4416
4843
|
placement: "right",
|
|
4417
4844
|
children: /* @__PURE__ */ jsx(
|
|
4418
4845
|
Button,
|
|
@@ -4421,7 +4848,7 @@ function DrawingToolbar({
|
|
|
4421
4848
|
onClick: onDeleteSelected,
|
|
4422
4849
|
disabled,
|
|
4423
4850
|
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":
|
|
4851
|
+
"aria-label": labels.deleteSelectedAriaLabel,
|
|
4425
4852
|
"data-testid": "button-delete-selected",
|
|
4426
4853
|
icon: /* @__PURE__ */ jsx(Trash2, { className: "w-5 h-5" })
|
|
4427
4854
|
}
|
|
@@ -4438,13 +4865,13 @@ function DrawingToolbar({
|
|
|
4438
4865
|
/* @__PURE__ */ jsxs("div", { className: "p-2 border-b border-border space-y-1.5", children: [
|
|
4439
4866
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 pb-0.5", children: [
|
|
4440
4867
|
/* @__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:
|
|
4868
|
+
/* @__PURE__ */ jsx("span", { className: "text-[10px] font-semibold uppercase tracking-wider text-muted-foreground", children: searchLabels.title })
|
|
4442
4869
|
] }),
|
|
4443
4870
|
/* @__PURE__ */ jsx(
|
|
4444
4871
|
Input,
|
|
4445
4872
|
{
|
|
4446
4873
|
ref: searchInputRef,
|
|
4447
|
-
placeholder:
|
|
4874
|
+
placeholder: searchLabels.placeholder,
|
|
4448
4875
|
value: featureSearchQuery,
|
|
4449
4876
|
onChange: (e) => setFeatureSearchQuery(e.target.value),
|
|
4450
4877
|
allowClear: true,
|
|
@@ -4462,7 +4889,7 @@ function DrawingToolbar({
|
|
|
4462
4889
|
"px-2 py-0.5 text-xs rounded border-0 cursor-pointer transition-colors",
|
|
4463
4890
|
featureSearchMode === "title" ? "bg-primary text-primary-foreground" : "bg-muted hover:bg-accent text-foreground"
|
|
4464
4891
|
),
|
|
4465
|
-
children:
|
|
4892
|
+
children: searchLabels.titlesMode
|
|
4466
4893
|
}
|
|
4467
4894
|
),
|
|
4468
4895
|
/* @__PURE__ */ jsx(
|
|
@@ -4473,23 +4900,19 @@ function DrawingToolbar({
|
|
|
4473
4900
|
"px-2 py-0.5 text-xs rounded border-0 cursor-pointer transition-colors",
|
|
4474
4901
|
featureSearchMode === "json" ? "bg-primary text-primary-foreground" : "bg-muted hover:bg-accent text-foreground"
|
|
4475
4902
|
),
|
|
4476
|
-
children:
|
|
4903
|
+
children: searchLabels.fullJsonMode
|
|
4477
4904
|
}
|
|
4478
4905
|
),
|
|
4479
|
-
/* @__PURE__ */ jsx("span", { className: "ml-auto text-xs text-muted-foreground self-center", children: featureSearchQuery.trim() ?
|
|
4906
|
+
/* @__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
4907
|
] })
|
|
4481
4908
|
] }),
|
|
4482
4909
|
/* @__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
|
-
] }),
|
|
4910
|
+
featureSearchQuery.trim() && featureSearchResults.length === 0 && /* @__PURE__ */ jsx("div", { className: "p-3 text-center text-xs text-muted-foreground", children: searchLabels.noResults }),
|
|
4911
|
+
!featureSearchQuery.trim() && /* @__PURE__ */ jsx("div", { className: "p-3 text-center text-xs text-muted-foreground", children: searchLabels.typeToSearch(cachedFeatures.length) }),
|
|
4489
4912
|
featureSearchResults.map((feature, idx) => {
|
|
4490
|
-
var
|
|
4913
|
+
var _a2;
|
|
4491
4914
|
const label = getFeatureLabel(feature);
|
|
4492
|
-
const geomType = ((
|
|
4915
|
+
const geomType = ((_a2 = feature.geometry) == null ? void 0 : _a2.type) || searchLabels.unknownGeometry;
|
|
4493
4916
|
const props = feature.properties || {};
|
|
4494
4917
|
const subtitle = props.entityType || props.kind || geomType;
|
|
4495
4918
|
return /* @__PURE__ */ jsxs(
|
|
@@ -4514,14 +4937,14 @@ function DrawingToolbar({
|
|
|
4514
4937
|
onGoTo && /* @__PURE__ */ jsxs("div", { className: cn("p-2.5 space-y-2", onFlyToFeature && getAllFeatures && "border-t border-border"), children: [
|
|
4515
4938
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
4516
4939
|
/* @__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:
|
|
4940
|
+
/* @__PURE__ */ jsx("span", { className: "text-[10px] font-semibold uppercase tracking-wider text-muted-foreground", children: navigateLabels.title })
|
|
4518
4941
|
] }),
|
|
4519
4942
|
resolvedGeocoder && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4520
4943
|
/* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
|
|
4521
4944
|
/* @__PURE__ */ jsx(
|
|
4522
4945
|
Input,
|
|
4523
4946
|
{
|
|
4524
|
-
placeholder:
|
|
4947
|
+
placeholder: navigateLabels.addressPlaceholder,
|
|
4525
4948
|
value: goToAddress,
|
|
4526
4949
|
onChange: (e) => setGoToAddress(e.target.value),
|
|
4527
4950
|
onKeyDown: (e) => {
|
|
@@ -4544,25 +4967,25 @@ function DrawingToolbar({
|
|
|
4544
4967
|
className: "shrink-0",
|
|
4545
4968
|
"data-testid": "button-search-address",
|
|
4546
4969
|
icon: isSearching ? /* @__PURE__ */ jsx(Loader2, { className: "w-4 h-4 animate-spin" }) : void 0,
|
|
4547
|
-
children: isSearching ? "" :
|
|
4970
|
+
children: isSearching ? "" : navigateLabels.searchAddress
|
|
4548
4971
|
}
|
|
4549
4972
|
)
|
|
4550
4973
|
] }),
|
|
4551
4974
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
4552
4975
|
/* @__PURE__ */ jsx("div", { className: "flex-1 h-px bg-border" }),
|
|
4553
|
-
/* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground shrink-0", children:
|
|
4976
|
+
/* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground shrink-0", children: navigateLabels.orCoordinates }),
|
|
4554
4977
|
/* @__PURE__ */ jsx("div", { className: "flex-1 h-px bg-border" })
|
|
4555
4978
|
] })
|
|
4556
4979
|
] }),
|
|
4557
4980
|
/* @__PURE__ */ jsxs("div", { className: "flex gap-2 items-end", children: [
|
|
4558
4981
|
/* @__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:
|
|
4982
|
+
/* @__PURE__ */ jsx("label", { className: "text-[10px] text-muted-foreground mb-0.5 block", children: navigateLabels.latitude }),
|
|
4560
4983
|
/* @__PURE__ */ jsx(
|
|
4561
4984
|
Input,
|
|
4562
4985
|
{
|
|
4563
4986
|
type: "number",
|
|
4564
4987
|
step: "any",
|
|
4565
|
-
placeholder:
|
|
4988
|
+
placeholder: navigateLabels.latitudePlaceholder,
|
|
4566
4989
|
value: goToLat,
|
|
4567
4990
|
onChange: (e) => setGoToLat(e.target.value),
|
|
4568
4991
|
onKeyDown: (e) => {
|
|
@@ -4574,13 +4997,13 @@ function DrawingToolbar({
|
|
|
4574
4997
|
)
|
|
4575
4998
|
] }),
|
|
4576
4999
|
/* @__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:
|
|
5000
|
+
/* @__PURE__ */ jsx("label", { className: "text-[10px] text-muted-foreground mb-0.5 block", children: navigateLabels.longitude }),
|
|
4578
5001
|
/* @__PURE__ */ jsx(
|
|
4579
5002
|
Input,
|
|
4580
5003
|
{
|
|
4581
5004
|
type: "number",
|
|
4582
5005
|
step: "any",
|
|
4583
|
-
placeholder:
|
|
5006
|
+
placeholder: navigateLabels.longitudePlaceholder,
|
|
4584
5007
|
value: goToLng,
|
|
4585
5008
|
onChange: (e) => setGoToLng(e.target.value),
|
|
4586
5009
|
onKeyDown: (e) => {
|
|
@@ -4600,7 +5023,7 @@ function DrawingToolbar({
|
|
|
4600
5023
|
disabled: !goToLat.trim() || !goToLng.trim(),
|
|
4601
5024
|
className: "shrink-0",
|
|
4602
5025
|
"data-testid": "button-goto-navigate",
|
|
4603
|
-
children: onDropPoint ?
|
|
5026
|
+
children: onDropPoint ? navigateLabels.dropPoint : navigateLabels.goToCoordinates
|
|
4604
5027
|
}
|
|
4605
5028
|
)
|
|
4606
5029
|
] })
|
|
@@ -4717,6 +5140,18 @@ const MAP_STYLES = [
|
|
|
4717
5140
|
{ id: "satellite", name: "Satellite", icon: Satellite },
|
|
4718
5141
|
{ id: "dark", name: "Dark", icon: Map$1 }
|
|
4719
5142
|
];
|
|
5143
|
+
function builtInBasemapName(id, labels) {
|
|
5144
|
+
switch (id) {
|
|
5145
|
+
case "streets":
|
|
5146
|
+
return labels.basemapStreets;
|
|
5147
|
+
case "satellite":
|
|
5148
|
+
return labels.basemapSatellite;
|
|
5149
|
+
case "dark":
|
|
5150
|
+
return labels.basemapDark;
|
|
5151
|
+
default:
|
|
5152
|
+
return void 0;
|
|
5153
|
+
}
|
|
5154
|
+
}
|
|
4720
5155
|
const LEGEND_MAX_VALUES = 50;
|
|
4721
5156
|
const LEGEND_INITIAL_VISIBLE = 8;
|
|
4722
5157
|
function ColorByFieldLegend({
|
|
@@ -4724,6 +5159,7 @@ function ColorByFieldLegend({
|
|
|
4724
5159
|
fieldName,
|
|
4725
5160
|
getFieldValueDistribution
|
|
4726
5161
|
}) {
|
|
5162
|
+
const { layerSettings: labels } = useMapLabels();
|
|
4727
5163
|
const [expanded, setExpanded] = useState(false);
|
|
4728
5164
|
const [filter, setFilter] = useState("");
|
|
4729
5165
|
useEffect(() => {
|
|
@@ -4748,16 +5184,13 @@ function ColorByFieldLegend({
|
|
|
4748
5184
|
className: "mt-1 rounded border border-border/50 bg-background/40 p-1.5",
|
|
4749
5185
|
"data-testid": `legend-color-by-${layerId}`,
|
|
4750
5186
|
children: [
|
|
4751
|
-
/* @__PURE__ */
|
|
4752
|
-
"Legend",
|
|
4753
|
-
distribution.length >= LEGEND_MAX_VALUES ? ` (top ${LEGEND_MAX_VALUES})` : ""
|
|
4754
|
-
] }),
|
|
5187
|
+
/* @__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
5188
|
(distribution.length > LEGEND_INITIAL_VISIBLE || expanded) && /* @__PURE__ */ jsx(
|
|
4756
5189
|
Input,
|
|
4757
5190
|
{
|
|
4758
5191
|
size: "small",
|
|
4759
5192
|
allowClear: true,
|
|
4760
|
-
placeholder:
|
|
5193
|
+
placeholder: labels.filterValues,
|
|
4761
5194
|
value: filter,
|
|
4762
5195
|
onChange: (e) => setFilter(e.target.value),
|
|
4763
5196
|
className: "mb-1 !text-[11px]",
|
|
@@ -4784,7 +5217,7 @@ function ColorByFieldLegend({
|
|
|
4784
5217
|
},
|
|
4785
5218
|
value
|
|
4786
5219
|
)),
|
|
4787
|
-
visible.length === 0 && /* @__PURE__ */ jsx("div", { className: "text-[11px] text-muted-foreground italic", children:
|
|
5220
|
+
visible.length === 0 && /* @__PURE__ */ jsx("div", { className: "text-[11px] text-muted-foreground italic", children: labels.noMatches })
|
|
4788
5221
|
] }),
|
|
4789
5222
|
(hiddenCount > 0 || expanded && filtered.length > LEGEND_INITIAL_VISIBLE) && /* @__PURE__ */ jsx(
|
|
4790
5223
|
"button",
|
|
@@ -4793,7 +5226,7 @@ function ColorByFieldLegend({
|
|
|
4793
5226
|
className: "mt-1 text-[11px] text-primary hover:underline",
|
|
4794
5227
|
onClick: () => setExpanded((e) => !e),
|
|
4795
5228
|
"data-testid": `legend-toggle-${layerId}`,
|
|
4796
|
-
children: expanded ?
|
|
5229
|
+
children: expanded ? labels.showLess : labels.showAll(filtered.length)
|
|
4797
5230
|
}
|
|
4798
5231
|
)
|
|
4799
5232
|
]
|
|
@@ -4806,6 +5239,7 @@ function ColorGradientLegend({
|
|
|
4806
5239
|
max,
|
|
4807
5240
|
sampled
|
|
4808
5241
|
}) {
|
|
5242
|
+
const { layerSettings: labels } = useMapLabels();
|
|
4809
5243
|
const degenerate = min === max;
|
|
4810
5244
|
return /* @__PURE__ */ jsxs(
|
|
4811
5245
|
"div",
|
|
@@ -4813,10 +5247,7 @@ function ColorGradientLegend({
|
|
|
4813
5247
|
className: "mt-1 rounded border border-border/50 bg-background/40 p-1.5",
|
|
4814
5248
|
"data-testid": `legend-gradient-${layerId}`,
|
|
4815
5249
|
children: [
|
|
4816
|
-
/* @__PURE__ */
|
|
4817
|
-
"Legend",
|
|
4818
|
-
sampled ? " (sampled)" : ""
|
|
4819
|
-
] }),
|
|
5250
|
+
/* @__PURE__ */ jsx("div", { className: "text-[10px] uppercase tracking-wide text-muted-foreground mb-1", children: sampled ? labels.legendSampled : labels.legend }),
|
|
4820
5251
|
/* @__PURE__ */ jsx(
|
|
4821
5252
|
"div",
|
|
4822
5253
|
{
|
|
@@ -4883,6 +5314,13 @@ function LayersPanel({
|
|
|
4883
5314
|
layerBadgeProvider,
|
|
4884
5315
|
featureCountProvider
|
|
4885
5316
|
}) {
|
|
5317
|
+
const {
|
|
5318
|
+
canvas: canvasLabels,
|
|
5319
|
+
layersPanel: labels,
|
|
5320
|
+
layerSettings: settingsLabels,
|
|
5321
|
+
mapOptions: optionsLabels
|
|
5322
|
+
} = useMapLabels();
|
|
5323
|
+
const shownName = useCallback((layer) => shownLayerName(layer, canvasLabels), [canvasLabels]);
|
|
4886
5324
|
const confirm = useConfirm();
|
|
4887
5325
|
const [editingLayerId, setEditingLayerId] = useState(null);
|
|
4888
5326
|
const [editingName, setEditingName] = useState("");
|
|
@@ -4933,15 +5371,17 @@ function LayersPanel({
|
|
|
4933
5371
|
}, [layers]);
|
|
4934
5372
|
const handleStartEdit = useCallback((layer) => {
|
|
4935
5373
|
setEditingLayerId(layer.id);
|
|
4936
|
-
setEditingName(layer
|
|
4937
|
-
}, []);
|
|
5374
|
+
setEditingName(shownName(layer));
|
|
5375
|
+
}, [shownName]);
|
|
4938
5376
|
const handleSaveEdit = useCallback(() => {
|
|
4939
|
-
|
|
5377
|
+
const edited = layers.find((l) => l.id === editingLayerId);
|
|
5378
|
+
const unchangedDefault = edited !== void 0 && edited.name !== shownName(edited) && editingName.trim() === shownName(edited);
|
|
5379
|
+
if (editingLayerId && editingName.trim() && !unchangedDefault) {
|
|
4940
5380
|
onRenameLayer(editingLayerId, editingName.trim());
|
|
4941
5381
|
}
|
|
4942
5382
|
setEditingLayerId(null);
|
|
4943
5383
|
setEditingName("");
|
|
4944
|
-
}, [editingLayerId, editingName, onRenameLayer]);
|
|
5384
|
+
}, [layers, editingLayerId, editingName, onRenameLayer, shownName]);
|
|
4945
5385
|
const handleCancelEdit = useCallback(() => {
|
|
4946
5386
|
setEditingLayerId(null);
|
|
4947
5387
|
setEditingName("");
|
|
@@ -4964,14 +5404,14 @@ function LayersPanel({
|
|
|
4964
5404
|
}, [selectedFeatureIds, onMoveFeatureToLayer]);
|
|
4965
5405
|
const handleDeleteLayer = useCallback((layer) => {
|
|
4966
5406
|
confirm({
|
|
4967
|
-
title:
|
|
4968
|
-
content:
|
|
4969
|
-
okText:
|
|
5407
|
+
title: labels.deleteLayerConfirmTitle(shownName(layer)),
|
|
5408
|
+
content: labels.deleteLayerConfirmContent,
|
|
5409
|
+
okText: labels.deleteLayerConfirmOk,
|
|
4970
5410
|
okButtonProps: { danger: true },
|
|
4971
|
-
cancelText:
|
|
5411
|
+
cancelText: labels.deleteLayerConfirmCancel,
|
|
4972
5412
|
onOk: () => onRemoveLayer(layer.id)
|
|
4973
5413
|
});
|
|
4974
|
-
}, [confirm, onRemoveLayer]);
|
|
5414
|
+
}, [confirm, onRemoveLayer, labels, shownName]);
|
|
4975
5415
|
const renderLayerItem = (layer) => {
|
|
4976
5416
|
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
5417
|
const customCount = featureCountProvider == null ? void 0 : featureCountProvider(layer.id);
|
|
@@ -5007,12 +5447,12 @@ function LayersPanel({
|
|
|
5007
5447
|
}
|
|
5008
5448
|
),
|
|
5009
5449
|
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:
|
|
5450
|
+
/* @__PURE__ */ jsx("p", { className: "font-medium", children: labels.hpLayerTitle }),
|
|
5451
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: labels.hpLayerDescription })
|
|
5012
5452
|
] }), children: /* @__PURE__ */ jsxs("div", { className: "h-7 w-6 flex items-center justify-center relative", children: [
|
|
5013
5453
|
/* @__PURE__ */ jsx(Lock, { className: "w-4 h-4 text-muted-foreground" }),
|
|
5014
5454
|
/* @__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 ?
|
|
5455
|
+
] }) }) : /* @__PURE__ */ jsx(Tooltip, { title: isActiveEditing ? labels.editingThisLayer : labels.clickToEditLayer, children: /* @__PURE__ */ jsx(
|
|
5016
5456
|
Button,
|
|
5017
5457
|
{
|
|
5018
5458
|
type: "text",
|
|
@@ -5055,22 +5495,19 @@ function LayersPanel({
|
|
|
5055
5495
|
"data-testid": `layer-color-${layer.id}`
|
|
5056
5496
|
}
|
|
5057
5497
|
),
|
|
5058
|
-
/* @__PURE__ */ jsx(Tooltip, { title: layer
|
|
5498
|
+
/* @__PURE__ */ jsx(Tooltip, { title: shownName(layer), children: /* @__PURE__ */ jsx(
|
|
5059
5499
|
"button",
|
|
5060
5500
|
{
|
|
5061
5501
|
onClick: () => handleStartEdit(layer),
|
|
5062
5502
|
className: "text-left truncate px-1 min-w-0 text-base",
|
|
5063
5503
|
"data-testid": `button-layer-name-${layer.id}`,
|
|
5064
|
-
children: layer
|
|
5504
|
+
children: shownName(layer)
|
|
5065
5505
|
}
|
|
5066
5506
|
) }),
|
|
5067
5507
|
layerBadgeProvider == null ? void 0 : layerBadgeProvider(layer),
|
|
5068
5508
|
!externalPersistence && getLayerUnsavedCount && (() => {
|
|
5069
5509
|
const totalUnsaved = getLayerUnsavedCount(layer.id);
|
|
5070
|
-
return totalUnsaved > 0 ? /* @__PURE__ */
|
|
5071
|
-
totalUnsaved,
|
|
5072
|
-
" unsaved"
|
|
5073
|
-
] }) : null;
|
|
5510
|
+
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
5511
|
})()
|
|
5075
5512
|
] }),
|
|
5076
5513
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 shrink-0", children: [
|
|
@@ -5085,13 +5522,13 @@ function LayersPanel({
|
|
|
5085
5522
|
{
|
|
5086
5523
|
key: "load-desktop",
|
|
5087
5524
|
icon: /* @__PURE__ */ jsx(Upload, { className: "w-[18px] h-[18px]" }),
|
|
5088
|
-
label:
|
|
5525
|
+
label: labels.loadGeojson,
|
|
5089
5526
|
onClick: () => onLoadLayerGeoJSON(layer.id)
|
|
5090
5527
|
},
|
|
5091
5528
|
{
|
|
5092
5529
|
key: "save-desktop",
|
|
5093
5530
|
icon: /* @__PURE__ */ jsx(Download, { className: "w-[18px] h-[18px]" }),
|
|
5094
|
-
label:
|
|
5531
|
+
label: labels.saveGeojson,
|
|
5095
5532
|
onClick: () => {
|
|
5096
5533
|
void onSaveLayerGeoJSON(layer.id);
|
|
5097
5534
|
}
|
|
@@ -5104,7 +5541,7 @@ function LayersPanel({
|
|
|
5104
5541
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
5105
5542
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
5106
5543
|
/* @__PURE__ */ jsx(Type, { className: "w-[18px] h-[18px]" }),
|
|
5107
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm", children:
|
|
5544
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm", children: labels.neverHideLabels })
|
|
5108
5545
|
] }),
|
|
5109
5546
|
/* @__PURE__ */ jsx(
|
|
5110
5547
|
Switch,
|
|
@@ -5127,7 +5564,7 @@ function LayersPanel({
|
|
|
5127
5564
|
}
|
|
5128
5565
|
)
|
|
5129
5566
|
] }),
|
|
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) ?
|
|
5567
|
+
/* @__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
5568
|
] })
|
|
5132
5569
|
}
|
|
5133
5570
|
] : [],
|
|
@@ -5136,7 +5573,7 @@ function LayersPanel({
|
|
|
5136
5573
|
{
|
|
5137
5574
|
key: "fit",
|
|
5138
5575
|
icon: /* @__PURE__ */ jsx(Focus, { className: "w-[18px] h-[18px]" }),
|
|
5139
|
-
label:
|
|
5576
|
+
label: labels.fitMapToLayer,
|
|
5140
5577
|
onClick: () => onFitToLayerFeatures(layer.id)
|
|
5141
5578
|
}
|
|
5142
5579
|
] : [],
|
|
@@ -5146,7 +5583,7 @@ function LayersPanel({
|
|
|
5146
5583
|
{
|
|
5147
5584
|
key: "delete",
|
|
5148
5585
|
icon: /* @__PURE__ */ jsx(Trash2, { className: "w-[18px] h-[18px]" }),
|
|
5149
|
-
label:
|
|
5586
|
+
label: labels.deleteLayer,
|
|
5150
5587
|
danger: true,
|
|
5151
5588
|
onClick: () => handleDeleteLayer(layer)
|
|
5152
5589
|
}
|
|
@@ -5169,7 +5606,7 @@ function LayersPanel({
|
|
|
5169
5606
|
}
|
|
5170
5607
|
),
|
|
5171
5608
|
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__ */
|
|
5609
|
+
selectedFeatureIds.length > 0 && !layer.readOnly && /* @__PURE__ */ jsx(
|
|
5173
5610
|
Button,
|
|
5174
5611
|
{
|
|
5175
5612
|
type: "default",
|
|
@@ -5177,15 +5614,11 @@ function LayersPanel({
|
|
|
5177
5614
|
onClick: () => handleMoveSelectedToLayer(layer.id),
|
|
5178
5615
|
className: "w-full text-xs",
|
|
5179
5616
|
"data-testid": `button-move-to-layer-${layer.id}`,
|
|
5180
|
-
children:
|
|
5181
|
-
"Move ",
|
|
5182
|
-
selectedFeatureIds.length,
|
|
5183
|
-
" selected here"
|
|
5184
|
-
]
|
|
5617
|
+
children: labels.moveSelectedHere(selectedFeatureIds.length)
|
|
5185
5618
|
}
|
|
5186
5619
|
),
|
|
5187
5620
|
(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:
|
|
5621
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-1.5 text-xs font-medium", children: /* @__PURE__ */ jsx("span", { children: settingsLabels.pointFeatures }) }),
|
|
5189
5622
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
5190
5623
|
/* @__PURE__ */ jsx(
|
|
5191
5624
|
Switch,
|
|
@@ -5201,7 +5634,7 @@ function LayersPanel({
|
|
|
5201
5634
|
"data-testid": `switch-trace-${layer.id}`
|
|
5202
5635
|
}
|
|
5203
5636
|
),
|
|
5204
|
-
/* @__PURE__ */ jsx("span", { className: "text-xs", children:
|
|
5637
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs", children: settingsLabels.traceLines })
|
|
5205
5638
|
] }),
|
|
5206
5639
|
((_k = layer.traceConfig) == null ? void 0 : _k.enabled) && /* @__PURE__ */ jsx(
|
|
5207
5640
|
Select,
|
|
@@ -5216,8 +5649,8 @@ function LayersPanel({
|
|
|
5216
5649
|
showSearch: true,
|
|
5217
5650
|
optionFilterProp: "label",
|
|
5218
5651
|
options: [
|
|
5219
|
-
{ value: "all", label:
|
|
5220
|
-
...getAvailableTraceFields(layer.id).map((f) => ({ value: f, label:
|
|
5652
|
+
{ value: "all", label: settingsLabels.connectAllPoints },
|
|
5653
|
+
...getAvailableTraceFields(layer.id).map((f) => ({ value: f, label: settingsLabels.groupBy(f) }))
|
|
5221
5654
|
],
|
|
5222
5655
|
"data-testid": `select-trace-field-${layer.id}`
|
|
5223
5656
|
}
|
|
@@ -5241,11 +5674,11 @@ function LayersPanel({
|
|
|
5241
5674
|
"data-testid": `switch-heatmap-${layer.id}`
|
|
5242
5675
|
}
|
|
5243
5676
|
),
|
|
5244
|
-
/* @__PURE__ */ jsx("span", { className: "text-xs", children:
|
|
5677
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs", children: settingsLabels.heatmap })
|
|
5245
5678
|
] }),
|
|
5246
5679
|
((_m = layer.heatmapConfig) == null ? void 0 : _m.enabled) && /* @__PURE__ */ jsxs("div", { className: "space-y-1 pl-4", children: [
|
|
5247
5680
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
5248
|
-
/* @__PURE__ */ jsx("span", { className: "text-[10px] w-12", children:
|
|
5681
|
+
/* @__PURE__ */ jsx("span", { className: "text-[10px] w-12", children: settingsLabels.intensity }),
|
|
5249
5682
|
/* @__PURE__ */ jsx(
|
|
5250
5683
|
Slider,
|
|
5251
5684
|
{
|
|
@@ -5262,7 +5695,7 @@ function LayersPanel({
|
|
|
5262
5695
|
)
|
|
5263
5696
|
] }),
|
|
5264
5697
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
5265
|
-
/* @__PURE__ */ jsx("span", { className: "text-[10px] w-12", children:
|
|
5698
|
+
/* @__PURE__ */ jsx("span", { className: "text-[10px] w-12", children: settingsLabels.radius }),
|
|
5266
5699
|
/* @__PURE__ */ jsx(
|
|
5267
5700
|
Slider,
|
|
5268
5701
|
{
|
|
@@ -5300,7 +5733,7 @@ function LayersPanel({
|
|
|
5300
5733
|
"data-testid": `switch-cluster-${layer.id}`
|
|
5301
5734
|
}
|
|
5302
5735
|
),
|
|
5303
|
-
/* @__PURE__ */ jsx("span", { className: "text-xs", children:
|
|
5736
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs", children: settingsLabels.clustering })
|
|
5304
5737
|
] }),
|
|
5305
5738
|
((_o = layer.clusterConfig) == null ? void 0 : _o.enabled) && getLayerFields && /* @__PURE__ */ jsxs("div", { className: "space-y-1 pl-4", children: [
|
|
5306
5739
|
/* @__PURE__ */ jsx(
|
|
@@ -5316,8 +5749,8 @@ function LayersPanel({
|
|
|
5316
5749
|
showSearch: true,
|
|
5317
5750
|
optionFilterProp: "label",
|
|
5318
5751
|
options: [
|
|
5319
|
-
{ value: "count", label:
|
|
5320
|
-
...getLayerFields(layer.id).filter((f) => !f.isNumeric).map((f) => ({ value: f.name, label:
|
|
5752
|
+
{ value: "count", label: settingsLabels.simpleCount },
|
|
5753
|
+
...getLayerFields(layer.id).filter((f) => !f.isNumeric).map((f) => ({ value: f.name, label: settingsLabels.pieBy(f.name) }))
|
|
5321
5754
|
],
|
|
5322
5755
|
"data-testid": `select-cluster-field-${layer.id}`
|
|
5323
5756
|
}
|
|
@@ -5334,7 +5767,7 @@ function LayersPanel({
|
|
|
5334
5767
|
})
|
|
5335
5768
|
}
|
|
5336
5769
|
),
|
|
5337
|
-
/* @__PURE__ */ jsx("span", { className: "text-[10px]", children:
|
|
5770
|
+
/* @__PURE__ */ jsx("span", { className: "text-[10px]", children: settingsLabels.showPointDots })
|
|
5338
5771
|
] }),
|
|
5339
5772
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
5340
5773
|
/* @__PURE__ */ jsx(
|
|
@@ -5349,7 +5782,7 @@ function LayersPanel({
|
|
|
5349
5782
|
"data-testid": `switch-cluster-count-by-${layer.id}`
|
|
5350
5783
|
}
|
|
5351
5784
|
),
|
|
5352
|
-
/* @__PURE__ */ jsx("span", { className: "text-[10px]", children:
|
|
5785
|
+
/* @__PURE__ */ jsx("span", { className: "text-[10px]", children: settingsLabels.countByField })
|
|
5353
5786
|
] }),
|
|
5354
5787
|
layer.clusterConfig.countByFieldEnabled && /* @__PURE__ */ jsx(
|
|
5355
5788
|
Select,
|
|
@@ -5361,7 +5794,7 @@ function LayersPanel({
|
|
|
5361
5794
|
countByField: val
|
|
5362
5795
|
}),
|
|
5363
5796
|
className: "w-full text-xs",
|
|
5364
|
-
placeholder:
|
|
5797
|
+
placeholder: settingsLabels.selectNumericField,
|
|
5365
5798
|
showSearch: true,
|
|
5366
5799
|
optionFilterProp: "label",
|
|
5367
5800
|
options: getLayerFields(layer.id).filter((f) => f.isNumeric).map((f) => ({ value: f.name, label: f.name })),
|
|
@@ -5381,7 +5814,7 @@ function LayersPanel({
|
|
|
5381
5814
|
"data-testid": `switch-cluster-gradient-${layer.id}`
|
|
5382
5815
|
}
|
|
5383
5816
|
),
|
|
5384
|
-
/* @__PURE__ */ jsx("span", { className: "text-[10px]", children:
|
|
5817
|
+
/* @__PURE__ */ jsx("span", { className: "text-[10px]", children: settingsLabels.colorBubblesByValue })
|
|
5385
5818
|
] })
|
|
5386
5819
|
] })
|
|
5387
5820
|
] })
|
|
@@ -5389,7 +5822,7 @@ function LayersPanel({
|
|
|
5389
5822
|
layer.hasAltitudeData && onUpdateAltitudeDisplayMode && /* @__PURE__ */ jsxs("div", { className: "space-y-1 p-1.5 bg-muted/30 rounded-md", children: [
|
|
5390
5823
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 text-xs font-medium", children: [
|
|
5391
5824
|
/* @__PURE__ */ jsx(Box, { className: "w-3.5 h-3.5" }),
|
|
5392
|
-
/* @__PURE__ */ jsx("span", { children:
|
|
5825
|
+
/* @__PURE__ */ jsx("span", { children: settingsLabels.altitudeDisplay })
|
|
5393
5826
|
] }),
|
|
5394
5827
|
/* @__PURE__ */ jsx(
|
|
5395
5828
|
Select,
|
|
@@ -5399,20 +5832,20 @@ function LayersPanel({
|
|
|
5399
5832
|
onChange: (val) => onUpdateAltitudeDisplayMode(layer.id, val),
|
|
5400
5833
|
className: "w-full text-xs",
|
|
5401
5834
|
options: [
|
|
5402
|
-
{ value: "3d", label:
|
|
5403
|
-
{ value: "flat", label:
|
|
5404
|
-
{ value: "both", label:
|
|
5835
|
+
{ value: "3d", label: settingsLabels.altitude3d },
|
|
5836
|
+
{ value: "flat", label: settingsLabels.altitudeFlat },
|
|
5837
|
+
{ value: "both", label: settingsLabels.altitudeBoth }
|
|
5405
5838
|
],
|
|
5406
5839
|
"data-testid": `select-altitude-mode-${layer.id}`
|
|
5407
5840
|
}
|
|
5408
5841
|
)
|
|
5409
5842
|
] }),
|
|
5410
5843
|
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:
|
|
5844
|
+
/* @__PURE__ */ jsx("div", { className: "text-sm font-medium", children: settingsLabels.visualSettings }),
|
|
5412
5845
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
5413
5846
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 text-sm text-muted-foreground", children: [
|
|
5414
5847
|
/* @__PURE__ */ jsx(Type, { className: "w-3.5 h-3.5" }),
|
|
5415
|
-
/* @__PURE__ */ jsx("span", { children:
|
|
5848
|
+
/* @__PURE__ */ jsx("span", { children: settingsLabels.labels })
|
|
5416
5849
|
] }),
|
|
5417
5850
|
/* @__PURE__ */ jsx(
|
|
5418
5851
|
Switch,
|
|
@@ -5445,9 +5878,9 @@ function LayersPanel({
|
|
|
5445
5878
|
},
|
|
5446
5879
|
className: "w-full text-sm",
|
|
5447
5880
|
options: [
|
|
5448
|
-
{ value: "standard", label:
|
|
5449
|
-
{ value: "field", label:
|
|
5450
|
-
{ value: "fixed", label:
|
|
5881
|
+
{ value: "standard", label: settingsLabels.labelFromName },
|
|
5882
|
+
{ value: "field", label: settingsLabels.labelFromField },
|
|
5883
|
+
{ value: "fixed", label: settingsLabels.labelFixedText }
|
|
5451
5884
|
],
|
|
5452
5885
|
"data-testid": `select-label-mode-${layer.id}`
|
|
5453
5886
|
}
|
|
@@ -5465,7 +5898,7 @@ function LayersPanel({
|
|
|
5465
5898
|
});
|
|
5466
5899
|
},
|
|
5467
5900
|
className: "w-full text-sm",
|
|
5468
|
-
placeholder:
|
|
5901
|
+
placeholder: settingsLabels.selectField,
|
|
5469
5902
|
showSearch: true,
|
|
5470
5903
|
optionFilterProp: "label",
|
|
5471
5904
|
options: getLayerFields(layer.id).map((f) => ({ value: f.name, label: f.name })),
|
|
@@ -5484,14 +5917,14 @@ function LayersPanel({
|
|
|
5484
5917
|
label: { ...(_a2 = layer.visualConfig) == null ? void 0 : _a2.label, mode: "fixed", fixedText: e.target.value }
|
|
5485
5918
|
});
|
|
5486
5919
|
},
|
|
5487
|
-
placeholder:
|
|
5920
|
+
placeholder: settingsLabels.enterLabelText,
|
|
5488
5921
|
className: "text-sm",
|
|
5489
5922
|
"data-testid": `input-label-text-${layer.id}`
|
|
5490
5923
|
}
|
|
5491
5924
|
),
|
|
5492
5925
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 text-sm text-muted-foreground pt-0.5", children: [
|
|
5493
5926
|
/* @__PURE__ */ jsx("span", { className: "w-3.5 h-3.5 text-center", children: "S" }),
|
|
5494
|
-
/* @__PURE__ */ jsx("span", { children:
|
|
5927
|
+
/* @__PURE__ */ jsx("span", { children: settingsLabels.size })
|
|
5495
5928
|
] }),
|
|
5496
5929
|
/* @__PURE__ */ jsx(
|
|
5497
5930
|
Select,
|
|
@@ -5504,9 +5937,9 @@ function LayersPanel({
|
|
|
5504
5937
|
}),
|
|
5505
5938
|
className: "w-full text-sm",
|
|
5506
5939
|
options: [
|
|
5507
|
-
{ value: "standard", label:
|
|
5508
|
-
{ value: "field", label:
|
|
5509
|
-
{ value: "override", label:
|
|
5940
|
+
{ value: "standard", label: settingsLabels.defaultSize },
|
|
5941
|
+
{ value: "field", label: settingsLabels.sizeByField },
|
|
5942
|
+
{ value: "override", label: settingsLabels.overrideSize }
|
|
5510
5943
|
],
|
|
5511
5944
|
"data-testid": `select-size-mode-${layer.id}`
|
|
5512
5945
|
}
|
|
@@ -5521,7 +5954,7 @@ function LayersPanel({
|
|
|
5521
5954
|
size: { mode: "field", fieldName: val }
|
|
5522
5955
|
}),
|
|
5523
5956
|
className: "w-full text-sm",
|
|
5524
|
-
placeholder:
|
|
5957
|
+
placeholder: settingsLabels.selectNumericField,
|
|
5525
5958
|
showSearch: true,
|
|
5526
5959
|
optionFilterProp: "label",
|
|
5527
5960
|
options: getLayerFields(layer.id).filter((f) => f.isNumeric).map((f) => ({ value: f.name, label: f.name })),
|
|
@@ -5547,7 +5980,7 @@ function LayersPanel({
|
|
|
5547
5980
|
] }),
|
|
5548
5981
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 text-sm text-muted-foreground pt-0.5", children: [
|
|
5549
5982
|
/* @__PURE__ */ jsx("span", { className: "w-3.5 h-3.5 rounded-full bg-current" }),
|
|
5550
|
-
/* @__PURE__ */ jsx("span", { children:
|
|
5983
|
+
/* @__PURE__ */ jsx("span", { children: settingsLabels.color })
|
|
5551
5984
|
] }),
|
|
5552
5985
|
/* @__PURE__ */ jsx(
|
|
5553
5986
|
Select,
|
|
@@ -5560,9 +5993,9 @@ function LayersPanel({
|
|
|
5560
5993
|
}),
|
|
5561
5994
|
className: "w-full text-sm",
|
|
5562
5995
|
options: [
|
|
5563
|
-
{ value: "standard", label:
|
|
5564
|
-
{ value: "field", label:
|
|
5565
|
-
{ value: "fixed", label:
|
|
5996
|
+
{ value: "standard", label: settingsLabels.useFeatureColor },
|
|
5997
|
+
{ value: "field", label: settingsLabels.colorByField },
|
|
5998
|
+
{ value: "fixed", label: settingsLabels.fixedColor }
|
|
5566
5999
|
],
|
|
5567
6000
|
"data-testid": `select-color-mode-${layer.id}`
|
|
5568
6001
|
}
|
|
@@ -5588,7 +6021,7 @@ function LayersPanel({
|
|
|
5588
6021
|
color: { mode: "field", fieldName: val, scale: defaultColorScaleForField(fields.find((f) => f.name === val)) }
|
|
5589
6022
|
}),
|
|
5590
6023
|
className: "w-full text-sm",
|
|
5591
|
-
placeholder:
|
|
6024
|
+
placeholder: settingsLabels.selectField,
|
|
5592
6025
|
showSearch: true,
|
|
5593
6026
|
optionFilterProp: "label",
|
|
5594
6027
|
options: fields.map((f) => ({ value: f.name, label: f.name })),
|
|
@@ -5609,8 +6042,8 @@ function LayersPanel({
|
|
|
5609
6042
|
});
|
|
5610
6043
|
},
|
|
5611
6044
|
options: [
|
|
5612
|
-
{ label:
|
|
5613
|
-
{ label:
|
|
6045
|
+
{ label: settingsLabels.categories, value: "categorical" },
|
|
6046
|
+
{ label: settingsLabels.gradient, value: "gradient", disabled: !fieldHasNumeric && scale !== "gradient" }
|
|
5614
6047
|
],
|
|
5615
6048
|
"data-testid": `segmented-color-scale-${layer.id}`
|
|
5616
6049
|
}
|
|
@@ -5653,7 +6086,7 @@ function LayersPanel({
|
|
|
5653
6086
|
(hasPointFeatures == null ? void 0 : hasPointFeatures(layer.id)) && !((_X = layer.metadata) == null ? void 0 : _X.hidePointFeatures) && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5654
6087
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 text-sm text-muted-foreground pt-0.5", children: [
|
|
5655
6088
|
/* @__PURE__ */ jsx(Smile, { className: "w-3.5 h-3.5" }),
|
|
5656
|
-
/* @__PURE__ */ jsx("span", { children:
|
|
6089
|
+
/* @__PURE__ */ jsx("span", { children: settingsLabels.pointIcon })
|
|
5657
6090
|
] }),
|
|
5658
6091
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
5659
6092
|
/* @__PURE__ */ jsx(
|
|
@@ -5731,7 +6164,7 @@ function LayersPanel({
|
|
|
5731
6164
|
/* @__PURE__ */ jsxs("div", { className: "px-2 pt-2.5 pb-2 border-b border-border shrink-0", children: [
|
|
5732
6165
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
5733
6166
|
/* @__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:
|
|
6167
|
+
/* @__PURE__ */ jsx("h3", { className: "text-[16px] font-semibold flex-1 !m-0 leading-tight", children: optionsLabels.title }),
|
|
5735
6168
|
/* @__PURE__ */ jsx(
|
|
5736
6169
|
Dropdown,
|
|
5737
6170
|
{
|
|
@@ -5742,18 +6175,18 @@ function LayersPanel({
|
|
|
5742
6175
|
{
|
|
5743
6176
|
key: "load-geojson",
|
|
5744
6177
|
icon: /* @__PURE__ */ jsx(Upload, { className: "w-4 h-4" }),
|
|
5745
|
-
label:
|
|
6178
|
+
label: optionsLabels.uploadMap,
|
|
5746
6179
|
onClick: onLoadNewLayerGeoJSON
|
|
5747
6180
|
},
|
|
5748
6181
|
...onWorkspaceLoad ? [{
|
|
5749
6182
|
key: "load-workspace",
|
|
5750
6183
|
icon: /* @__PURE__ */ jsx(FolderOpen, { className: "w-4 h-4" }),
|
|
5751
|
-
label:
|
|
6184
|
+
label: optionsLabels.loadFromWorkspace,
|
|
5752
6185
|
onClick: () => onWorkspaceLoad()
|
|
5753
6186
|
}] : []
|
|
5754
6187
|
]
|
|
5755
6188
|
},
|
|
5756
|
-
children: /* @__PURE__ */ jsx(Tooltip, { title:
|
|
6189
|
+
children: /* @__PURE__ */ jsx(Tooltip, { title: optionsLabels.load, children: /* @__PURE__ */ jsx(
|
|
5757
6190
|
Button,
|
|
5758
6191
|
{
|
|
5759
6192
|
type: "text",
|
|
@@ -5774,7 +6207,7 @@ function LayersPanel({
|
|
|
5774
6207
|
{
|
|
5775
6208
|
key: "save-geojson",
|
|
5776
6209
|
icon: /* @__PURE__ */ jsx(Download, { className: "w-4 h-4" }),
|
|
5777
|
-
label:
|
|
6210
|
+
label: optionsLabels.downloadMap,
|
|
5778
6211
|
onClick: () => {
|
|
5779
6212
|
void onSaveAllGeoJSON();
|
|
5780
6213
|
}
|
|
@@ -5782,12 +6215,12 @@ function LayersPanel({
|
|
|
5782
6215
|
...onWorkspaceSave ? [{
|
|
5783
6216
|
key: "save-workspace",
|
|
5784
6217
|
icon: /* @__PURE__ */ jsx(FolderOpen, { className: "w-4 h-4" }),
|
|
5785
|
-
label:
|
|
6218
|
+
label: optionsLabels.saveToWorkspace,
|
|
5786
6219
|
onClick: () => onWorkspaceSave()
|
|
5787
6220
|
}] : []
|
|
5788
6221
|
]
|
|
5789
6222
|
},
|
|
5790
|
-
children: /* @__PURE__ */ jsx(Tooltip, { title:
|
|
6223
|
+
children: /* @__PURE__ */ jsx(Tooltip, { title: optionsLabels.save, children: /* @__PURE__ */ jsx(
|
|
5791
6224
|
Button,
|
|
5792
6225
|
{
|
|
5793
6226
|
type: "text",
|
|
@@ -5812,7 +6245,7 @@ function LayersPanel({
|
|
|
5812
6245
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-1.5 mb-1.5", children: [
|
|
5813
6246
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
5814
6247
|
/* @__PURE__ */ jsx(Type, { className: "w-4 h-4 text-muted-foreground" }),
|
|
5815
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm", children:
|
|
6248
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm", children: optionsLabels.autoShowLabels })
|
|
5816
6249
|
] }),
|
|
5817
6250
|
/* @__PURE__ */ jsx(
|
|
5818
6251
|
Switch,
|
|
@@ -5829,7 +6262,7 @@ function LayersPanel({
|
|
|
5829
6262
|
] }),
|
|
5830
6263
|
(autoLabelConfig == null ? void 0 : autoLabelConfig.enabled) && /* @__PURE__ */ jsxs("div", { className: "ml-5 space-y-1", children: [
|
|
5831
6264
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
5832
|
-
/* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children:
|
|
6265
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: optionsLabels.autoLabelThreshold }),
|
|
5833
6266
|
/* @__PURE__ */ jsxs("span", { className: "text-xs font-medium", children: [
|
|
5834
6267
|
"< ",
|
|
5835
6268
|
autoLabelConfig.threshold
|
|
@@ -5851,9 +6284,10 @@ function LayersPanel({
|
|
|
5851
6284
|
}
|
|
5852
6285
|
),
|
|
5853
6286
|
visibleFeatureCount !== void 0 && /* @__PURE__ */ jsxs("div", { className: "text-xs text-muted-foreground", children: [
|
|
5854
|
-
|
|
6287
|
+
optionsLabels.visibleFeatures,
|
|
6288
|
+
" ",
|
|
5855
6289
|
/* @__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:
|
|
6290
|
+
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
6291
|
] })
|
|
5858
6292
|
] })
|
|
5859
6293
|
] })
|
|
@@ -5863,7 +6297,7 @@ function LayersPanel({
|
|
|
5863
6297
|
{
|
|
5864
6298
|
key: "fit-all",
|
|
5865
6299
|
icon: /* @__PURE__ */ jsx(Focus, { className: "w-[18px] h-[18px]" }),
|
|
5866
|
-
label:
|
|
6300
|
+
label: optionsLabels.fitToAllFeatures,
|
|
5867
6301
|
onClick: onFitToFeatures
|
|
5868
6302
|
}
|
|
5869
6303
|
] : [],
|
|
@@ -5891,7 +6325,7 @@ function LayersPanel({
|
|
|
5891
6325
|
)
|
|
5892
6326
|
] }),
|
|
5893
6327
|
!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) => {
|
|
6328
|
+
/* @__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
6329
|
if (hideSatellite && style.id === "satellite") return false;
|
|
5896
6330
|
if (hideDark && style.id === "dark") return false;
|
|
5897
6331
|
return true;
|
|
@@ -5924,7 +6358,7 @@ function LayersPanel({
|
|
|
5924
6358
|
"data-testid": "button-3d-terrain",
|
|
5925
6359
|
children: [
|
|
5926
6360
|
/* @__PURE__ */ jsx(Box, { className: "w-4 h-4" }),
|
|
5927
|
-
/* @__PURE__ */ jsx("span", { className: "text-xs font-medium", children:
|
|
6361
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs font-medium", children: optionsLabels.terrain3d })
|
|
5928
6362
|
]
|
|
5929
6363
|
}
|
|
5930
6364
|
)
|
|
@@ -5933,9 +6367,9 @@ function LayersPanel({
|
|
|
5933
6367
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 px-2 py-1.5 border-b border-border shrink-0", children: [
|
|
5934
6368
|
/* @__PURE__ */ jsx(Layers, { className: "w-5 h-5 text-muted-foreground shrink-0" }),
|
|
5935
6369
|
/* @__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:
|
|
6370
|
+
/* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold flex-1", children: labels.title }),
|
|
5937
6371
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
5938
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
6372
|
+
/* @__PURE__ */ jsx(Tooltip, { title: labels.createLayer, children: /* @__PURE__ */ jsx(
|
|
5939
6373
|
Button,
|
|
5940
6374
|
{
|
|
5941
6375
|
type: "text",
|
|
@@ -5945,7 +6379,7 @@ function LayersPanel({
|
|
|
5945
6379
|
"data-testid": "button-add-layer"
|
|
5946
6380
|
}
|
|
5947
6381
|
) }),
|
|
5948
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
6382
|
+
/* @__PURE__ */ jsx(Tooltip, { title: labels.loadAsNewLayer, children: /* @__PURE__ */ jsx(
|
|
5949
6383
|
Button,
|
|
5950
6384
|
{
|
|
5951
6385
|
type: "text",
|
|
@@ -5955,7 +6389,7 @@ function LayersPanel({
|
|
|
5955
6389
|
"data-testid": "button-open-layer"
|
|
5956
6390
|
}
|
|
5957
6391
|
) }),
|
|
5958
|
-
onSearchAndAddToNewLayer && /* @__PURE__ */ jsx(Tooltip, { title:
|
|
6392
|
+
onSearchAndAddToNewLayer && /* @__PURE__ */ jsx(Tooltip, { title: labels.searchAndAdd, children: /* @__PURE__ */ jsx(
|
|
5959
6393
|
Button,
|
|
5960
6394
|
{
|
|
5961
6395
|
type: "text",
|
|
@@ -6030,10 +6464,7 @@ function LayersPanel({
|
|
|
6030
6464
|
),
|
|
6031
6465
|
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold flex-1 truncate min-w-0", children: groupName }),
|
|
6032
6466
|
/* @__PURE__ */ jsx(Tag, { className: "text-xs !mr-0", children: groupFeatureTotal }),
|
|
6033
|
-
/* @__PURE__ */
|
|
6034
|
-
groupLayers.length,
|
|
6035
|
-
" layers"
|
|
6036
|
-
] })
|
|
6467
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground shrink-0 mr-0.5", children: labels.groupLayerCount(groupLayers.length) })
|
|
6037
6468
|
]
|
|
6038
6469
|
}
|
|
6039
6470
|
),
|
|
@@ -6161,119 +6592,6 @@ function FeatureDatePicker({ value, onChange, disabled, "data-testid": testId })
|
|
|
6161
6592
|
}
|
|
6162
6593
|
);
|
|
6163
6594
|
}
|
|
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;
|
|
6240
|
-
}
|
|
6241
|
-
const radius = paintedRadius(feature);
|
|
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 };
|
|
6276
|
-
}
|
|
6277
6595
|
const { TextArea } = Input;
|
|
6278
6596
|
function formatDateForState(value) {
|
|
6279
6597
|
if (!value) return "";
|
|
@@ -6293,6 +6611,7 @@ function EntityCardsList({
|
|
|
6293
6611
|
selectedFeatures,
|
|
6294
6612
|
entityCardProvider
|
|
6295
6613
|
}) {
|
|
6614
|
+
const { propertiesPanel: labels } = useMapLabels();
|
|
6296
6615
|
const shown = selectedFeatures.slice(0, ENTITY_CARDS_RENDER_CAP);
|
|
6297
6616
|
return /* @__PURE__ */ jsxs("div", { className: "p-2 space-y-2", children: [
|
|
6298
6617
|
shown.map((f) => {
|
|
@@ -6305,18 +6624,13 @@ function EntityCardsList({
|
|
|
6305
6624
|
const card = entityCardProvider(geoFeature);
|
|
6306
6625
|
return card ? /* @__PURE__ */ jsx("div", { className: "border border-border rounded-md p-2 bg-card", children: card }, f.id) : null;
|
|
6307
6626
|
}),
|
|
6308
|
-
selectedFeatures.length > shown.length && /* @__PURE__ */
|
|
6309
|
-
"Showing the first ",
|
|
6310
|
-
shown.length,
|
|
6311
|
-
" of ",
|
|
6312
|
-
selectedFeatures.length.toLocaleString(),
|
|
6313
|
-
" selected features"
|
|
6314
|
-
] })
|
|
6627
|
+
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
6628
|
] });
|
|
6316
6629
|
}
|
|
6317
6630
|
function StackPager({ stack }) {
|
|
6631
|
+
const { propertiesPanel: labels, canvas: canvasLabels } = useMapLabels();
|
|
6318
6632
|
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:
|
|
6633
|
+
/* @__PURE__ */ jsx(Tooltip, { title: labels.previousOverlappingPoint, children: /* @__PURE__ */ jsx(
|
|
6320
6634
|
Button,
|
|
6321
6635
|
{
|
|
6322
6636
|
type: "text",
|
|
@@ -6324,17 +6638,17 @@ function StackPager({ stack }) {
|
|
|
6324
6638
|
disabled: stack.position === 0,
|
|
6325
6639
|
onClick: () => stack.onStep(-1),
|
|
6326
6640
|
className: "!w-6 !h-6 !min-w-0 !p-0",
|
|
6327
|
-
"aria-label":
|
|
6641
|
+
"aria-label": labels.previousOverlappingPoint,
|
|
6328
6642
|
"data-testid": "button-stack-prev"
|
|
6329
6643
|
}
|
|
6330
6644
|
) }),
|
|
6331
|
-
/* @__PURE__ */ jsx(Tooltip, { title: stack.more ?
|
|
6645
|
+
/* @__PURE__ */ jsx(Tooltip, { title: stack.more ? canvasLabels.morePointsHint : void 0, children: /* @__PURE__ */ jsxs("span", { "data-testid": "panel-stack-position", children: [
|
|
6332
6646
|
stack.position + 1,
|
|
6333
6647
|
" / ",
|
|
6334
6648
|
stack.count,
|
|
6335
6649
|
stack.more ? "+" : ""
|
|
6336
6650
|
] }) }),
|
|
6337
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
6651
|
+
/* @__PURE__ */ jsx(Tooltip, { title: labels.nextOverlappingPoint, children: /* @__PURE__ */ jsx(
|
|
6338
6652
|
Button,
|
|
6339
6653
|
{
|
|
6340
6654
|
type: "text",
|
|
@@ -6342,7 +6656,7 @@ function StackPager({ stack }) {
|
|
|
6342
6656
|
disabled: stack.position === stack.count - 1,
|
|
6343
6657
|
onClick: () => stack.onStep(1),
|
|
6344
6658
|
className: "!w-6 !h-6 !min-w-0 !p-0",
|
|
6345
|
-
"aria-label":
|
|
6659
|
+
"aria-label": labels.nextOverlappingPoint,
|
|
6346
6660
|
"data-testid": "button-stack-next"
|
|
6347
6661
|
}
|
|
6348
6662
|
) })
|
|
@@ -6379,6 +6693,7 @@ function colorPickerNoHexPanel(_panel, extra) {
|
|
|
6379
6693
|
}
|
|
6380
6694
|
function LatLngFields(props) {
|
|
6381
6695
|
const { latitude, longitude, isEditable, testIdPrefix } = props;
|
|
6696
|
+
const { featureFields: labels } = useMapLabels();
|
|
6382
6697
|
if (!isEditable) {
|
|
6383
6698
|
return /* @__PURE__ */ jsxs(
|
|
6384
6699
|
"div",
|
|
@@ -6401,7 +6716,7 @@ function LatLngFields(props) {
|
|
|
6401
6716
|
onChange: (e) => props.onLatChange(e.target.value),
|
|
6402
6717
|
onFocus: props.onLatFocus,
|
|
6403
6718
|
onBlur: props.onLatBlur,
|
|
6404
|
-
placeholder:
|
|
6719
|
+
placeholder: labels.latitude,
|
|
6405
6720
|
className: "!h-6 text-[13px] flex-1",
|
|
6406
6721
|
"data-testid": `${testIdPrefix}-latitude`
|
|
6407
6722
|
}
|
|
@@ -6413,7 +6728,7 @@ function LatLngFields(props) {
|
|
|
6413
6728
|
onChange: (e) => props.onLngChange(e.target.value),
|
|
6414
6729
|
onFocus: props.onLngFocus,
|
|
6415
6730
|
onBlur: props.onLngBlur,
|
|
6416
|
-
placeholder:
|
|
6731
|
+
placeholder: labels.longitude,
|
|
6417
6732
|
className: "!h-6 text-[13px] flex-1",
|
|
6418
6733
|
"data-testid": `${testIdPrefix}-longitude`
|
|
6419
6734
|
}
|
|
@@ -6540,6 +6855,7 @@ function parseRecordFields(feature) {
|
|
|
6540
6855
|
}
|
|
6541
6856
|
const FLUSH_COLLAPSE = { header: "!px-0 !py-1", body: "!px-0 !py-1" };
|
|
6542
6857
|
function RecordFieldsSection({ feature }) {
|
|
6858
|
+
const { propertiesPanel: labels } = useMapLabels();
|
|
6543
6859
|
const fields = parseRecordFields(feature);
|
|
6544
6860
|
if (fields.length === 0) return null;
|
|
6545
6861
|
return /* @__PURE__ */ jsx(
|
|
@@ -6553,7 +6869,7 @@ function RecordFieldsSection({ feature }) {
|
|
|
6553
6869
|
key: "record-fields",
|
|
6554
6870
|
label: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
6555
6871
|
/* @__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:
|
|
6872
|
+
/* @__PURE__ */ jsx("span", { className: "text-[11px] font-bold uppercase tracking-wide text-foreground", children: labels.recordFields }),
|
|
6557
6873
|
/* @__PURE__ */ jsxs("span", { className: "text-[10px] text-muted-foreground ml-1", children: [
|
|
6558
6874
|
"(",
|
|
6559
6875
|
fields.length,
|
|
@@ -6569,9 +6885,17 @@ function RecordFieldsSection({ feature }) {
|
|
|
6569
6885
|
);
|
|
6570
6886
|
}
|
|
6571
6887
|
let persistedTabPreference = "properties";
|
|
6572
|
-
function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometry, onClose, isEditMode = true, isReadOnlyLayer = false, layerName, layerId, autoFocusLabel = false, entityCardProvider, entityCardPlacement = "tab", inlineEntityCardLabel
|
|
6888
|
+
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
6889
|
var _a, _b, _c, _d, _e;
|
|
6574
6890
|
const feature = selectedFeatures[0];
|
|
6891
|
+
const {
|
|
6892
|
+
propertiesPanel: labels,
|
|
6893
|
+
featureFields: fieldLabels,
|
|
6894
|
+
coordinates: coordinateLabels,
|
|
6895
|
+
canvas: canvasLabels
|
|
6896
|
+
} = useMapLabels();
|
|
6897
|
+
const inlineEntityCardLabel = inlineEntityCardLabelProp ?? labels.pointDetail;
|
|
6898
|
+
const shownName = layerName !== void 0 && layerId !== void 0 ? shownLayerName({ name: layerName }, canvasLabels) : layerName;
|
|
6575
6899
|
const { toast } = useToast();
|
|
6576
6900
|
const hasMultipleSelection = selectedFeatures.length > 1;
|
|
6577
6901
|
const [isSaving, setIsSaving] = useState(false);
|
|
@@ -6635,7 +6959,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
6635
6959
|
targetLayers.forEach((l) => {
|
|
6636
6960
|
items.push({
|
|
6637
6961
|
key: l.id,
|
|
6638
|
-
label: l
|
|
6962
|
+
label: shownLayerName(l, canvasLabels) || labels.untitledLayer,
|
|
6639
6963
|
onClick: () => {
|
|
6640
6964
|
if (action === "copy") {
|
|
6641
6965
|
onCopyFeaturesToLayer == null ? void 0 : onCopyFeaturesToLayer(featureIds, l.id);
|
|
@@ -6650,16 +6974,16 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
6650
6974
|
if (items.length > 0) items.push({ type: "divider" });
|
|
6651
6975
|
items.push({
|
|
6652
6976
|
key: "new-layer",
|
|
6653
|
-
label:
|
|
6977
|
+
label: labels.newLayer,
|
|
6654
6978
|
icon: /* @__PURE__ */ jsx(Plus, { className: "w-4 h-4" }),
|
|
6655
6979
|
onClick: () => {
|
|
6656
|
-
const name2 = window.prompt(
|
|
6980
|
+
const name2 = window.prompt(labels.newLayerPrompt);
|
|
6657
6981
|
if (name2 == null ? void 0 : name2.trim()) createHandler(featureIds, name2.trim());
|
|
6658
6982
|
}
|
|
6659
6983
|
});
|
|
6660
6984
|
}
|
|
6661
6985
|
return items;
|
|
6662
|
-
}, [targetLayers, featureIds, onCopyFeaturesToLayer, onMoveFeaturesToLayer, onCreateLayerAndCopyFeatures, onCreateLayerAndMoveFeatures]);
|
|
6986
|
+
}, [targetLayers, featureIds, onCopyFeaturesToLayer, onMoveFeaturesToLayer, onCreateLayerAndCopyFeatures, onCreateLayerAndMoveFeatures, labels, canvasLabels]);
|
|
6663
6987
|
const [name, setName] = useState("");
|
|
6664
6988
|
const [description, setDescription] = useState("");
|
|
6665
6989
|
const [startDate, setStartDate] = useState("");
|
|
@@ -6672,7 +6996,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
6672
6996
|
const [strokeOpacity, setStrokeOpacity] = useState(1);
|
|
6673
6997
|
const [fillColor, setFillColor] = useState("#3b82f6");
|
|
6674
6998
|
const [fillOpacity, setFillOpacity] = useState(0.2);
|
|
6675
|
-
const [labelText, setLabelText] = useState(
|
|
6999
|
+
const [labelText, setLabelText] = useState(canvasLabels.newTextLabel);
|
|
6676
7000
|
const [fontSize, setFontSize] = useState(14);
|
|
6677
7001
|
const [fontColor, setFontColor] = useState("#000000");
|
|
6678
7002
|
const [fontWeight, setFontWeight] = useState("normal");
|
|
@@ -6688,7 +7012,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
6688
7012
|
useEffect(() => {
|
|
6689
7013
|
if (feature) {
|
|
6690
7014
|
if (feature.properties.kind === "text") {
|
|
6691
|
-
const textLabel = feature.properties.label || feature.properties.text ||
|
|
7015
|
+
const textLabel = feature.properties.label || feature.properties.text || canvasLabels.newTextLabel;
|
|
6692
7016
|
setName(textLabel);
|
|
6693
7017
|
setLabelText(textLabel);
|
|
6694
7018
|
} else {
|
|
@@ -6899,20 +7223,20 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
6899
7223
|
entityLabel: result.entityLabel
|
|
6900
7224
|
});
|
|
6901
7225
|
toast({
|
|
6902
|
-
title:
|
|
6903
|
-
description:
|
|
7226
|
+
title: labels.featureSaved,
|
|
7227
|
+
description: labels.savedTo(result.workspace)
|
|
6904
7228
|
});
|
|
6905
7229
|
}
|
|
6906
7230
|
} catch (error) {
|
|
6907
7231
|
toast({
|
|
6908
|
-
title:
|
|
6909
|
-
description: error instanceof Error ? error.message :
|
|
7232
|
+
title: labels.saveFailed,
|
|
7233
|
+
description: error instanceof Error ? error.message : labels.saveFeatureFailed,
|
|
6910
7234
|
variant: "destructive"
|
|
6911
7235
|
});
|
|
6912
7236
|
} finally {
|
|
6913
7237
|
setIsSaving(false);
|
|
6914
7238
|
}
|
|
6915
|
-
}, [featureSaveProvider, feature, layerId, layerName, onFeatureSaved, toast]);
|
|
7239
|
+
}, [featureSaveProvider, feature, layerId, layerName, onFeatureSaved, toast, labels]);
|
|
6916
7240
|
if (selectedFeatures.length === 0) {
|
|
6917
7241
|
return null;
|
|
6918
7242
|
}
|
|
@@ -6932,17 +7256,17 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
6932
7256
|
if (updated) {
|
|
6933
7257
|
onUpdateProperties(feature.id, updated, { fromRefresh: true });
|
|
6934
7258
|
if (!silent) {
|
|
6935
|
-
toast({ title:
|
|
7259
|
+
toast({ title: labels.refreshed, description: labels.refreshedDescription });
|
|
6936
7260
|
}
|
|
6937
7261
|
}
|
|
6938
7262
|
} catch (err) {
|
|
6939
7263
|
if (!silent) {
|
|
6940
|
-
toast({ title:
|
|
7264
|
+
toast({ title: labels.refreshFailed, description: String(err), variant: "destructive" });
|
|
6941
7265
|
}
|
|
6942
7266
|
} finally {
|
|
6943
7267
|
setIsRefreshing(false);
|
|
6944
7268
|
}
|
|
6945
|
-
}, [feature, featureRefreshProvider, onUpdateProperties, toast]);
|
|
7269
|
+
}, [feature, featureRefreshProvider, onUpdateProperties, toast, labels]);
|
|
6946
7270
|
const autoRefreshedRef = useRef(null);
|
|
6947
7271
|
useEffect(() => {
|
|
6948
7272
|
if (!isRecord || !featureRefreshProvider || !feature) return;
|
|
@@ -6957,8 +7281,8 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
6957
7281
|
const recordProperties = feature ? Object.entries(feature.properties).filter(
|
|
6958
7282
|
([key, value]) => !isExcludedRecordKey(key) && value !== void 0 && value !== null && !key.startsWith("_") && !key.startsWith("os_") && !key.startsWith("isHidden")
|
|
6959
7283
|
).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:
|
|
7284
|
+
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 }) });
|
|
7285
|
+
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
7286
|
if (hasMultipleSelection && !entityCardProvider) {
|
|
6963
7287
|
return /* @__PURE__ */ jsxs(
|
|
6964
7288
|
"div",
|
|
@@ -6969,20 +7293,16 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
6969
7293
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2 px-2.5 py-2 border-b border-border", children: [
|
|
6970
7294
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
6971
7295
|
/* @__PURE__ */ jsx(Package, { className: "w-4 h-4 text-primary" }),
|
|
6972
|
-
/* @__PURE__ */
|
|
6973
|
-
selectedFeatures.length,
|
|
6974
|
-
" selected ",
|
|
6975
|
-
selectedFeatures.length === 1 ? "feature" : "features"
|
|
6976
|
-
] })
|
|
7296
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold", children: labels.selectedFeatures(selectedFeatures.length) })
|
|
6977
7297
|
] }),
|
|
6978
7298
|
/* @__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:
|
|
7299
|
+
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" }) }) }),
|
|
7300
|
+
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" }) }) }),
|
|
7301
|
+
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
7302
|
/* @__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
7303
|
] })
|
|
6984
7304
|
] }),
|
|
6985
|
-
/* @__PURE__ */ jsx("div", { className: "p-2.5", children: /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children:
|
|
7305
|
+
/* @__PURE__ */ jsx("div", { className: "p-2.5", children: /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: labels.selectSingleToEdit }) })
|
|
6986
7306
|
]
|
|
6987
7307
|
}
|
|
6988
7308
|
);
|
|
@@ -6991,17 +7311,17 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
6991
7311
|
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
6992
7312
|
layerName && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
6993
7313
|
/* @__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:
|
|
7314
|
+
/* @__PURE__ */ jsx("span", { className: "text-[12px] text-muted-foreground", children: labels.layer }),
|
|
7315
|
+
/* @__PURE__ */ jsx("span", { className: "text-[12px] text-foreground truncate", "data-testid": "text-feature-layer", children: shownName })
|
|
6996
7316
|
] }),
|
|
6997
7317
|
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:
|
|
7318
|
+
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" }) }) }),
|
|
7319
|
+
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
7320
|
] })
|
|
7001
7321
|
] }),
|
|
7002
7322
|
/* @__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:
|
|
7323
|
+
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 }),
|
|
7324
|
+
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
7325
|
!isRecord && featureSaveProvider && /* @__PURE__ */ jsx(
|
|
7006
7326
|
Button,
|
|
7007
7327
|
{
|
|
@@ -7012,14 +7332,14 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7012
7332
|
onClick: handleFeatureSave,
|
|
7013
7333
|
className: "!h-7 !px-3 !text-[12px] !font-medium",
|
|
7014
7334
|
"data-testid": "button-save-feature",
|
|
7015
|
-
children:
|
|
7335
|
+
children: labels.createEntity
|
|
7016
7336
|
}
|
|
7017
7337
|
)
|
|
7018
7338
|
] })
|
|
7019
7339
|
] }),
|
|
7020
7340
|
/* @__PURE__ */ jsx(Divider, { className: "!my-1.5" }),
|
|
7021
7341
|
/* @__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" ?
|
|
7342
|
+
/* @__PURE__ */ jsx("label", { htmlFor: "feature-name", className: "text-xs text-muted-foreground", children: feature.properties.kind === "text" ? fieldLabels.label : fieldLabels.name }),
|
|
7023
7343
|
isEditMode ? /* @__PURE__ */ jsx(
|
|
7024
7344
|
Input,
|
|
7025
7345
|
{
|
|
@@ -7033,19 +7353,19 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7033
7353
|
}
|
|
7034
7354
|
},
|
|
7035
7355
|
onBlur: () => handleSave(),
|
|
7036
|
-
placeholder: feature.properties.kind === "text" ?
|
|
7356
|
+
placeholder: feature.properties.kind === "text" ? fieldLabels.enterLabel : fieldLabels.featureName,
|
|
7037
7357
|
className: "!h-6 text-[13px]",
|
|
7038
7358
|
"data-testid": "input-feature-name"
|
|
7039
7359
|
}
|
|
7040
7360
|
) : (
|
|
7041
7361
|
// Static in view mode — a readOnly Input keeps the editable look
|
|
7042
7362
|
// 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:
|
|
7363
|
+
/* @__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
7364
|
)
|
|
7045
7365
|
] }),
|
|
7046
7366
|
(typePickerProvider || feature.geometry.type === "Point" && feature.properties.kind !== "text" && pointIcon) && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
7047
7367
|
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:
|
|
7368
|
+
/* @__PURE__ */ jsx("label", { className: "text-xs text-muted-foreground", children: fieldLabels.icon }),
|
|
7049
7369
|
/* @__PURE__ */ jsx("span", { className: "text-lg leading-none", children: pointIcon }),
|
|
7050
7370
|
isEditMode && /* @__PURE__ */ jsx(
|
|
7051
7371
|
Button,
|
|
@@ -7062,13 +7382,13 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7062
7382
|
)
|
|
7063
7383
|
] }),
|
|
7064
7384
|
typePickerProvider && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 flex-1", children: [
|
|
7065
|
-
/* @__PURE__ */ jsx("label", { className: "text-xs text-muted-foreground", children:
|
|
7385
|
+
/* @__PURE__ */ jsx("label", { className: "text-xs text-muted-foreground", children: fieldLabels.type }),
|
|
7066
7386
|
/* @__PURE__ */ jsx(
|
|
7067
7387
|
Input,
|
|
7068
7388
|
{
|
|
7069
7389
|
value: entityType || "",
|
|
7070
7390
|
readOnly: true,
|
|
7071
|
-
placeholder:
|
|
7391
|
+
placeholder: fieldLabels.noType,
|
|
7072
7392
|
className: "!h-6 text-[13px] flex-1",
|
|
7073
7393
|
"data-testid": "input-entity-type"
|
|
7074
7394
|
}
|
|
@@ -7096,8 +7416,8 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7096
7416
|
] }),
|
|
7097
7417
|
/* @__PURE__ */ jsxs("div", { className: "space-y-0.5", children: [
|
|
7098
7418
|
/* @__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:
|
|
7419
|
+
/* @__PURE__ */ jsx("label", { className: "text-xs text-muted-foreground", children: fieldLabels.latLng }),
|
|
7420
|
+
feature.geometry.type !== "Point" && /* @__PURE__ */ jsx(Tooltip, { title: fieldLabels.centroidHint, children: /* @__PURE__ */ jsx("span", { className: "text-[13px] text-muted-foreground cursor-help", children: "*" }) })
|
|
7101
7421
|
] }),
|
|
7102
7422
|
/* @__PURE__ */ jsx(
|
|
7103
7423
|
LatLngFields,
|
|
@@ -7121,10 +7441,10 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7121
7441
|
const lng = parseFloat(longitude);
|
|
7122
7442
|
const coords = feature.geometry.coordinates;
|
|
7123
7443
|
if (isNaN(lat)) {
|
|
7124
|
-
toast({ title:
|
|
7444
|
+
toast({ title: coordinateLabels.invalidLatitude, description: coordinateLabels.notANumber, variant: "destructive" });
|
|
7125
7445
|
setLatitude(coords[1].toFixed(6));
|
|
7126
7446
|
} else if (lat < -90 || lat > 90) {
|
|
7127
|
-
toast({ title:
|
|
7447
|
+
toast({ title: coordinateLabels.invalidLatitude, description: coordinateLabels.latitudeOutOfRange, variant: "destructive" });
|
|
7128
7448
|
setLatitude(coords[1].toFixed(6));
|
|
7129
7449
|
} else if (isNaN(lng) || lng < -180 || lng > 180) ;
|
|
7130
7450
|
else {
|
|
@@ -7139,10 +7459,10 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7139
7459
|
const lng = parseFloat(longitude);
|
|
7140
7460
|
const coords = feature.geometry.coordinates;
|
|
7141
7461
|
if (isNaN(lng)) {
|
|
7142
|
-
toast({ title:
|
|
7462
|
+
toast({ title: coordinateLabels.invalidLongitude, description: coordinateLabels.notANumber, variant: "destructive" });
|
|
7143
7463
|
setLongitude(coords[0].toFixed(6));
|
|
7144
7464
|
} else if (lng < -180 || lng > 180) {
|
|
7145
|
-
toast({ title:
|
|
7465
|
+
toast({ title: coordinateLabels.invalidLongitude, description: coordinateLabels.longitudeOutOfRange, variant: "destructive" });
|
|
7146
7466
|
setLongitude(coords[0].toFixed(6));
|
|
7147
7467
|
} else if (isNaN(lat) || lat < -90 || lat > 90) ;
|
|
7148
7468
|
else {
|
|
@@ -7165,16 +7485,16 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7165
7485
|
key: "temporal",
|
|
7166
7486
|
label: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
7167
7487
|
/* @__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:
|
|
7488
|
+
/* @__PURE__ */ jsx("span", { className: "text-[11px] font-bold uppercase tracking-wide text-foreground", children: fieldLabels.temporal }),
|
|
7169
7489
|
(startDate || endDate) && /* @__PURE__ */ jsxs("span", { className: "text-[10px] text-muted-foreground ml-1", children: [
|
|
7170
7490
|
"(",
|
|
7171
|
-
startDate && endDate ?
|
|
7491
|
+
fieldLabels.dateCount(startDate && endDate ? 2 : 1),
|
|
7172
7492
|
")"
|
|
7173
7493
|
] })
|
|
7174
7494
|
] }),
|
|
7175
7495
|
children: /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
7176
7496
|
/* @__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:
|
|
7497
|
+
/* @__PURE__ */ jsx("label", { className: "text-[13px] text-muted-foreground w-8 shrink-0", children: fieldLabels.start }),
|
|
7178
7498
|
/* @__PURE__ */ jsx(
|
|
7179
7499
|
FeatureDatePicker,
|
|
7180
7500
|
{
|
|
@@ -7189,7 +7509,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7189
7509
|
)
|
|
7190
7510
|
] }),
|
|
7191
7511
|
/* @__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:
|
|
7512
|
+
/* @__PURE__ */ jsx("label", { className: "text-[13px] text-muted-foreground w-8 shrink-0", children: fieldLabels.end }),
|
|
7193
7513
|
/* @__PURE__ */ jsx(
|
|
7194
7514
|
FeatureDatePicker,
|
|
7195
7515
|
{
|
|
@@ -7211,11 +7531,11 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7211
7531
|
/* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
7212
7532
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
7213
7533
|
/* @__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:
|
|
7534
|
+
/* @__PURE__ */ jsx("span", { className: "text-[11px] font-bold uppercase tracking-wide text-foreground", children: fieldLabels.style })
|
|
7215
7535
|
] }),
|
|
7216
7536
|
feature.properties.kind === "text" && /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
7217
7537
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
7218
|
-
/* @__PURE__ */ jsx("label", { className: "text-[13px] text-muted-foreground", children:
|
|
7538
|
+
/* @__PURE__ */ jsx("label", { className: "text-[13px] text-muted-foreground", children: fieldLabels.fontSize }),
|
|
7219
7539
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
7220
7540
|
/* @__PURE__ */ jsx(
|
|
7221
7541
|
Slider,
|
|
@@ -7236,7 +7556,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7236
7556
|
] })
|
|
7237
7557
|
] }),
|
|
7238
7558
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
7239
|
-
/* @__PURE__ */ jsx("label", { className: "text-[13px] text-muted-foreground", children:
|
|
7559
|
+
/* @__PURE__ */ jsx("label", { className: "text-[13px] text-muted-foreground", children: fieldLabels.fontColor }),
|
|
7240
7560
|
/* @__PURE__ */ jsx("div", { className: "flex gap-1 flex-wrap", children: PRESET_COLORS.map((color) => /* @__PURE__ */ jsx(
|
|
7241
7561
|
"button",
|
|
7242
7562
|
{
|
|
@@ -7254,7 +7574,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7254
7574
|
)) })
|
|
7255
7575
|
] }),
|
|
7256
7576
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
7257
|
-
/* @__PURE__ */ jsx("label", { className: "text-[13px] text-muted-foreground", children:
|
|
7577
|
+
/* @__PURE__ */ jsx("label", { className: "text-[13px] text-muted-foreground", children: fieldLabels.fontWeight }),
|
|
7258
7578
|
/* @__PURE__ */ jsxs("div", { className: "flex gap-1", children: [
|
|
7259
7579
|
/* @__PURE__ */ jsx(
|
|
7260
7580
|
Button,
|
|
@@ -7268,7 +7588,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7268
7588
|
},
|
|
7269
7589
|
disabled: !isEditMode,
|
|
7270
7590
|
className: "flex-1",
|
|
7271
|
-
children:
|
|
7591
|
+
children: fieldLabels.fontWeightNormal
|
|
7272
7592
|
}
|
|
7273
7593
|
),
|
|
7274
7594
|
/* @__PURE__ */ jsx(
|
|
@@ -7283,14 +7603,14 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7283
7603
|
},
|
|
7284
7604
|
disabled: !isEditMode,
|
|
7285
7605
|
className: "flex-1",
|
|
7286
|
-
children:
|
|
7606
|
+
children: fieldLabels.fontWeightBold
|
|
7287
7607
|
}
|
|
7288
7608
|
)
|
|
7289
7609
|
] })
|
|
7290
7610
|
] })
|
|
7291
7611
|
] }),
|
|
7292
7612
|
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:
|
|
7613
|
+
/* @__PURE__ */ jsx("label", { className: "text-[13px] text-muted-foreground", children: fieldLabels.arrowSize }),
|
|
7294
7614
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
7295
7615
|
/* @__PURE__ */ jsx(
|
|
7296
7616
|
Slider,
|
|
@@ -7315,8 +7635,8 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7315
7635
|
] }) }),
|
|
7316
7636
|
feature.properties.kind !== "text" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7317
7637
|
/* @__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:
|
|
7638
|
+
/* @__PURE__ */ jsx("label", { className: "text-[13px] text-muted-foreground shrink-0", children: fieldLabels.stroke }),
|
|
7639
|
+
/* @__PURE__ */ jsx(Tooltip, { title: fieldLabels.strokeColor, children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(
|
|
7320
7640
|
ColorPicker,
|
|
7321
7641
|
{
|
|
7322
7642
|
value: strokeColor,
|
|
@@ -7334,7 +7654,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7334
7654
|
"data-testid": "color-picker-stroke"
|
|
7335
7655
|
}
|
|
7336
7656
|
) }) }),
|
|
7337
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
7657
|
+
/* @__PURE__ */ jsx(Tooltip, { title: fieldLabels.strokeWidth, children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(
|
|
7338
7658
|
Select,
|
|
7339
7659
|
{
|
|
7340
7660
|
value: strokeWidth,
|
|
@@ -7360,7 +7680,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7360
7680
|
"data-testid": "select-stroke-width"
|
|
7361
7681
|
}
|
|
7362
7682
|
) }) }),
|
|
7363
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
7683
|
+
/* @__PURE__ */ jsx(Tooltip, { title: fieldLabels.strokeOpacity, children: /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1", children: [
|
|
7364
7684
|
/* @__PURE__ */ jsx(Blend, { className: "w-3 h-3 text-muted-foreground" }),
|
|
7365
7685
|
/* @__PURE__ */ jsx(
|
|
7366
7686
|
Select,
|
|
@@ -7392,8 +7712,8 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7392
7712
|
] }) })
|
|
7393
7713
|
] }),
|
|
7394
7714
|
(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:
|
|
7715
|
+
/* @__PURE__ */ jsx("label", { className: "text-[13px] text-muted-foreground shrink-0", children: fieldLabels.fill }),
|
|
7716
|
+
/* @__PURE__ */ jsx(Tooltip, { title: fieldLabels.fillColor, children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(
|
|
7397
7717
|
ColorPicker,
|
|
7398
7718
|
{
|
|
7399
7719
|
value: fillColor,
|
|
@@ -7410,13 +7730,13 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7410
7730
|
"data-testid": "color-picker-fill"
|
|
7411
7731
|
}
|
|
7412
7732
|
) }) }),
|
|
7413
|
-
isEditMode && ownFill(feature.properties) && /* @__PURE__ */ jsx(Tooltip, { title:
|
|
7733
|
+
isEditMode && ownFill(feature.properties) && /* @__PURE__ */ jsx(Tooltip, { title: fieldLabels.resetFillToStroke, children: /* @__PURE__ */ jsx(
|
|
7414
7734
|
Button,
|
|
7415
7735
|
{
|
|
7416
7736
|
size: "small",
|
|
7417
7737
|
type: "text",
|
|
7418
7738
|
icon: /* @__PURE__ */ jsx(RotateCcw, { className: "w-3 h-3" }),
|
|
7419
|
-
"aria-label":
|
|
7739
|
+
"aria-label": fieldLabels.resetFillToStroke,
|
|
7420
7740
|
onClick: () => {
|
|
7421
7741
|
setFillColor(strokeColor);
|
|
7422
7742
|
handleSave({ fillColor: null });
|
|
@@ -7424,7 +7744,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7424
7744
|
"data-testid": "button-reset-fill"
|
|
7425
7745
|
}
|
|
7426
7746
|
) }),
|
|
7427
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
7747
|
+
/* @__PURE__ */ jsx(Tooltip, { title: fieldLabels.fillOpacity, children: /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1", children: [
|
|
7428
7748
|
/* @__PURE__ */ jsx(Blend, { className: "w-3 h-3 text-muted-foreground" }),
|
|
7429
7749
|
/* @__PURE__ */ jsx(
|
|
7430
7750
|
Select,
|
|
@@ -7456,7 +7776,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7456
7776
|
] }) })
|
|
7457
7777
|
] }),
|
|
7458
7778
|
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:
|
|
7779
|
+
/* @__PURE__ */ jsx("label", { className: "text-[13px] text-muted-foreground shrink-0", children: fieldLabels.iconSize }),
|
|
7460
7780
|
/* @__PURE__ */ jsx(
|
|
7461
7781
|
Slider,
|
|
7462
7782
|
{
|
|
@@ -7478,7 +7798,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7478
7798
|
] }),
|
|
7479
7799
|
/* @__PURE__ */ jsx(Divider, { className: "!my-1.5" }),
|
|
7480
7800
|
/* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
|
|
7481
|
-
/* @__PURE__ */ jsx("span", { className: "text-[11px] font-bold uppercase tracking-wide text-foreground", children:
|
|
7801
|
+
/* @__PURE__ */ jsx("span", { className: "text-[11px] font-bold uppercase tracking-wide text-foreground", children: labels.properties }),
|
|
7482
7802
|
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
7483
7803
|
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-1", children: [
|
|
7484
7804
|
/* @__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 +7823,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7503
7823
|
value: prop.key,
|
|
7504
7824
|
onChange: (e) => handlePropertyKeyChange(index, e.target.value),
|
|
7505
7825
|
onBlur: () => handleSave(),
|
|
7506
|
-
placeholder:
|
|
7826
|
+
placeholder: fieldLabels.propertyKey,
|
|
7507
7827
|
style: { width: "6rem", flex: "0 0 6rem" },
|
|
7508
7828
|
className: "shrink-0 w-24 text-[13px] font-mono !h-6 !px-1",
|
|
7509
7829
|
"data-testid": `input-property-key-${index}`
|
|
@@ -7515,7 +7835,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7515
7835
|
value: prop.value,
|
|
7516
7836
|
onChange: (e) => handlePropertyValueChange(index, e.target.value),
|
|
7517
7837
|
onBlur: () => handleSave(),
|
|
7518
|
-
placeholder:
|
|
7838
|
+
placeholder: fieldLabels.propertyValue,
|
|
7519
7839
|
className: "flex-1 text-[13px] !h-6 !px-1.5",
|
|
7520
7840
|
"data-testid": `input-property-value-${index}`
|
|
7521
7841
|
}
|
|
@@ -7550,7 +7870,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7550
7870
|
handleAddProperty();
|
|
7551
7871
|
}
|
|
7552
7872
|
},
|
|
7553
|
-
placeholder:
|
|
7873
|
+
placeholder: fieldLabels.newProperty,
|
|
7554
7874
|
className: "flex-1 text-[13px] !h-6 !px-1.5",
|
|
7555
7875
|
"data-testid": "input-new-property-key"
|
|
7556
7876
|
}
|
|
@@ -7570,7 +7890,10 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7570
7890
|
] }),
|
|
7571
7891
|
/* @__PURE__ */ jsx(Divider, { className: "!my-1.5" }),
|
|
7572
7892
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
7573
|
-
/* @__PURE__ */
|
|
7893
|
+
/* @__PURE__ */ jsxs("span", { className: "text-[13px] text-muted-foreground", children: [
|
|
7894
|
+
labels.id,
|
|
7895
|
+
" "
|
|
7896
|
+
] }),
|
|
7574
7897
|
/* @__PURE__ */ jsxs("code", { className: "text-[13px] font-mono text-muted-foreground", children: [
|
|
7575
7898
|
feature.id.slice(0, 12),
|
|
7576
7899
|
"..."
|
|
@@ -7580,18 +7903,18 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7580
7903
|
const recordContent = /* @__PURE__ */ jsxs("div", { className: "p-2 space-y-2", children: [
|
|
7581
7904
|
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
7582
7905
|
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:
|
|
7906
|
+
/* @__PURE__ */ jsx("span", { className: "text-[12px] text-muted-foreground", children: labels.layer }),
|
|
7907
|
+
/* @__PURE__ */ jsx("span", { className: "text-[12px] text-foreground truncate", children: shownName })
|
|
7585
7908
|
] }),
|
|
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:
|
|
7909
|
+
/* @__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
7910
|
] }),
|
|
7588
7911
|
/* @__PURE__ */ jsx(Divider, { className: "!my-1.5" }),
|
|
7589
7912
|
/* @__PURE__ */ jsx("div", { className: "space-y-1", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
7590
7913
|
/* @__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 ||
|
|
7914
|
+
/* @__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
7915
|
feature.properties.entity_type ? /* @__PURE__ */ jsx("div", { className: "text-[11px] text-muted-foreground", children: formatEntityTypeName(String(feature.properties.entity_type)) }) : null
|
|
7593
7916
|
] }),
|
|
7594
|
-
featureRefreshProvider && /* @__PURE__ */ jsx(Tooltip, { title:
|
|
7917
|
+
featureRefreshProvider && /* @__PURE__ */ jsx(Tooltip, { title: labels.refreshFromRecord, children: /* @__PURE__ */ jsx(
|
|
7595
7918
|
Button,
|
|
7596
7919
|
{
|
|
7597
7920
|
type: "text",
|
|
@@ -7607,8 +7930,8 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7607
7930
|
/* @__PURE__ */ jsxs("div", { className: "space-y-0.5", children: [
|
|
7608
7931
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
7609
7932
|
/* @__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:
|
|
7933
|
+
/* @__PURE__ */ jsx("label", { className: "text-xs text-muted-foreground", children: fieldLabels.latLng }),
|
|
7934
|
+
feature.geometry.type !== "Point" && /* @__PURE__ */ jsx(Tooltip, { title: fieldLabels.centroidHint, children: /* @__PURE__ */ jsx("span", { className: "text-[13px] text-muted-foreground cursor-help", children: "*" }) })
|
|
7612
7935
|
] }),
|
|
7613
7936
|
/* @__PURE__ */ jsx(
|
|
7614
7937
|
LatLngFields,
|
|
@@ -7632,10 +7955,10 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7632
7955
|
const lng = parseFloat(longitude);
|
|
7633
7956
|
const coords = feature.geometry.coordinates;
|
|
7634
7957
|
if (isNaN(lat)) {
|
|
7635
|
-
toast({ title:
|
|
7958
|
+
toast({ title: coordinateLabels.invalidLatitude, description: coordinateLabels.notANumber, variant: "destructive" });
|
|
7636
7959
|
setLatitude(coords[1].toFixed(6));
|
|
7637
7960
|
} else if (lat < -90 || lat > 90) {
|
|
7638
|
-
toast({ title:
|
|
7961
|
+
toast({ title: coordinateLabels.invalidLatitude, description: coordinateLabels.latitudeOutOfRange, variant: "destructive" });
|
|
7639
7962
|
setLatitude(coords[1].toFixed(6));
|
|
7640
7963
|
} else if (isNaN(lng) || lng < -180 || lng > 180) ;
|
|
7641
7964
|
else {
|
|
@@ -7650,10 +7973,10 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7650
7973
|
const lng = parseFloat(longitude);
|
|
7651
7974
|
const coords = feature.geometry.coordinates;
|
|
7652
7975
|
if (isNaN(lng)) {
|
|
7653
|
-
toast({ title:
|
|
7976
|
+
toast({ title: coordinateLabels.invalidLongitude, description: coordinateLabels.notANumber, variant: "destructive" });
|
|
7654
7977
|
setLongitude(coords[0].toFixed(6));
|
|
7655
7978
|
} else if (lng < -180 || lng > 180) {
|
|
7656
|
-
toast({ title:
|
|
7979
|
+
toast({ title: coordinateLabels.invalidLongitude, description: coordinateLabels.longitudeOutOfRange, variant: "destructive" });
|
|
7657
7980
|
setLongitude(coords[0].toFixed(6));
|
|
7658
7981
|
} else if (isNaN(lat) || lat < -90 || lat > 90) ;
|
|
7659
7982
|
else {
|
|
@@ -7667,7 +7990,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7667
7990
|
recordProperties.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7668
7991
|
/* @__PURE__ */ jsx(Divider, { className: "!my-1.5" }),
|
|
7669
7992
|
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
7670
|
-
/* @__PURE__ */ jsx("span", { className: "text-[11px] font-bold uppercase tracking-wide text-foreground", children:
|
|
7993
|
+
/* @__PURE__ */ jsx("span", { className: "text-[11px] font-bold uppercase tracking-wide text-foreground", children: labels.properties }),
|
|
7671
7994
|
/* @__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
7995
|
/* @__PURE__ */ jsx("span", { className: "text-[11px] text-muted-foreground shrink-0 pt-px min-w-[80px]", children: formatPropertyKey(key) }),
|
|
7673
7996
|
/* @__PURE__ */ jsx("span", { className: "text-[13px] text-foreground whitespace-pre-wrap break-words", children: value })
|
|
@@ -7707,7 +8030,10 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7707
8030
|
/* @__PURE__ */ jsx(RecordFieldsSection, { feature }),
|
|
7708
8031
|
/* @__PURE__ */ jsx(Divider, { className: "!my-1.5" }),
|
|
7709
8032
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
7710
|
-
/* @__PURE__ */
|
|
8033
|
+
/* @__PURE__ */ jsxs("span", { className: "text-[13px] text-muted-foreground", children: [
|
|
8034
|
+
labels.id,
|
|
8035
|
+
" "
|
|
8036
|
+
] }),
|
|
7711
8037
|
/* @__PURE__ */ jsxs("code", { className: "text-[13px] font-mono text-muted-foreground", children: [
|
|
7712
8038
|
feature.id.slice(0, 12),
|
|
7713
8039
|
"..."
|
|
@@ -7757,12 +8083,12 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7757
8083
|
/* @__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
8084
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [
|
|
7759
8085
|
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:
|
|
8086
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold truncate", children: hasMultipleSelection ? labels.selectedFeatures(selectedFeatures.length) : name || feature.properties.entity_label || labels.untitledFeature }),
|
|
8087
|
+
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
8088
|
] }),
|
|
7763
8089
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 shrink-0", children: [
|
|
7764
8090
|
!hasMultipleSelection && !!((_d = feature == null ? void 0 : feature.properties) == null ? void 0 : _d.entity_id) && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7765
|
-
onOpenInNewTab && /* @__PURE__ */ jsx(Tooltip, { title:
|
|
8091
|
+
onOpenInNewTab && /* @__PURE__ */ jsx(Tooltip, { title: labels.openInNewTab, children: /* @__PURE__ */ jsx(
|
|
7766
8092
|
Button,
|
|
7767
8093
|
{
|
|
7768
8094
|
type: "text",
|
|
@@ -7780,7 +8106,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7780
8106
|
"data-testid": "button-open-in-new-tab"
|
|
7781
8107
|
}
|
|
7782
8108
|
) }),
|
|
7783
|
-
onEntityContextMenu && /* @__PURE__ */ jsx(Tooltip, { title:
|
|
8109
|
+
onEntityContextMenu && /* @__PURE__ */ jsx(Tooltip, { title: labels.actions, children: /* @__PURE__ */ jsx(
|
|
7784
8110
|
Button,
|
|
7785
8111
|
{
|
|
7786
8112
|
type: "text",
|
|
@@ -7800,10 +8126,10 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7800
8126
|
}
|
|
7801
8127
|
) })
|
|
7802
8128
|
] }),
|
|
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:
|
|
8129
|
+
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" }) }) }),
|
|
8130
|
+
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
8131
|
!hasMultipleSelection && feature.geometry.type === "Point" && feature.properties.kind !== "text" && isEditMode && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7806
|
-
/* @__PURE__ */ jsx(Tooltip, { title: pointIcon ?
|
|
8132
|
+
/* @__PURE__ */ jsx(Tooltip, { title: pointIcon ? labels.changeIcon : labels.setIcon, children: /* @__PURE__ */ jsx(
|
|
7807
8133
|
"button",
|
|
7808
8134
|
{
|
|
7809
8135
|
type: "button",
|
|
@@ -7838,7 +8164,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7838
8164
|
] }),
|
|
7839
8165
|
!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
8166
|
!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:
|
|
8167
|
+
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
8168
|
/* @__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
8169
|
] })
|
|
7844
8170
|
] }),
|
|
@@ -7855,12 +8181,12 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7855
8181
|
items: [
|
|
7856
8182
|
{
|
|
7857
8183
|
key: "cards",
|
|
7858
|
-
label: selectedFeatures.length >= 2 ?
|
|
8184
|
+
label: selectedFeatures.length >= 2 ? labels.entityCardsCount(selectedFeatures.length) : labels.entityCards,
|
|
7859
8185
|
children: /* @__PURE__ */ jsx("div", { className: "flex-1 min-h-0 overflow-y-auto overflow-x-hidden scrollbar-visible", children: entityCardsContent })
|
|
7860
8186
|
},
|
|
7861
8187
|
{
|
|
7862
8188
|
key: "properties",
|
|
7863
|
-
label:
|
|
8189
|
+
label: labels.properties,
|
|
7864
8190
|
disabled: hasMultipleSelection,
|
|
7865
8191
|
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
8192
|
propertiesDisabledOverlay,
|
|
@@ -7893,12 +8219,12 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7893
8219
|
children: [
|
|
7894
8220
|
/* @__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
8221
|
/* @__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:
|
|
8222
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold truncate", children: name || labels.untitledFeature }),
|
|
8223
|
+
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
8224
|
] }),
|
|
7899
8225
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 shrink-0", children: [
|
|
7900
8226
|
!!((_e = feature == null ? void 0 : feature.properties) == null ? void 0 : _e.entity_id) && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7901
|
-
onOpenInNewTab && /* @__PURE__ */ jsx(Tooltip, { title:
|
|
8227
|
+
onOpenInNewTab && /* @__PURE__ */ jsx(Tooltip, { title: labels.openInNewTab, children: /* @__PURE__ */ jsx(
|
|
7902
8228
|
Button,
|
|
7903
8229
|
{
|
|
7904
8230
|
type: "text",
|
|
@@ -7916,7 +8242,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7916
8242
|
"data-testid": "button-open-in-new-tab"
|
|
7917
8243
|
}
|
|
7918
8244
|
) }),
|
|
7919
|
-
onEntityContextMenu && /* @__PURE__ */ jsx(Tooltip, { title:
|
|
8245
|
+
onEntityContextMenu && /* @__PURE__ */ jsx(Tooltip, { title: labels.actions, children: /* @__PURE__ */ jsx(
|
|
7920
8246
|
Button,
|
|
7921
8247
|
{
|
|
7922
8248
|
type: "text",
|
|
@@ -7937,7 +8263,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7937
8263
|
) })
|
|
7938
8264
|
] }),
|
|
7939
8265
|
feature.geometry.type === "Point" && feature.properties.kind !== "text" && isEditMode && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7940
|
-
/* @__PURE__ */ jsx(Tooltip, { title: pointIcon ?
|
|
8266
|
+
/* @__PURE__ */ jsx(Tooltip, { title: pointIcon ? labels.changeIcon : labels.setIcon, children: /* @__PURE__ */ jsx(
|
|
7941
8267
|
"button",
|
|
7942
8268
|
{
|
|
7943
8269
|
type: "button",
|
|
@@ -7972,7 +8298,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7972
8298
|
] }),
|
|
7973
8299
|
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
8300
|
(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:
|
|
8301
|
+
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
8302
|
/* @__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
8303
|
] })
|
|
7978
8304
|
] }),
|
|
@@ -7984,6 +8310,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
7984
8310
|
return portalIfAnchored(panelJsx);
|
|
7985
8311
|
}
|
|
7986
8312
|
function StatusIndicator({ featureCount, selectedCount = 0 }) {
|
|
8313
|
+
const { canvas: labels } = useMapLabels();
|
|
7987
8314
|
const hasSelection = selectedCount > 0;
|
|
7988
8315
|
if (!hasSelection) {
|
|
7989
8316
|
return null;
|
|
@@ -7996,16 +8323,9 @@ function StatusIndicator({ featureCount, selectedCount = 0 }) {
|
|
|
7996
8323
|
"aria-live": "polite",
|
|
7997
8324
|
"data-testid": "status-indicator",
|
|
7998
8325
|
children: [
|
|
7999
|
-
/* @__PURE__ */
|
|
8000
|
-
featureCount,
|
|
8001
|
-
" feature",
|
|
8002
|
-
featureCount !== 1 ? "s" : ""
|
|
8003
|
-
] }),
|
|
8326
|
+
/* @__PURE__ */ jsx(Tag, { className: "font-mono text-xs !m-0", "data-testid": "badge-feature-count", children: labels.statusFeatureCount(featureCount) }),
|
|
8004
8327
|
/* @__PURE__ */ jsx("div", { className: "w-px h-4 bg-border" }),
|
|
8005
|
-
/* @__PURE__ */
|
|
8006
|
-
selectedCount,
|
|
8007
|
-
" selected"
|
|
8008
|
-
] })
|
|
8328
|
+
/* @__PURE__ */ jsx(Tag, { className: "font-mono text-xs !m-0", "data-testid": "badge-selected-count", children: labels.statusSelectedCount(selectedCount) })
|
|
8009
8329
|
]
|
|
8010
8330
|
}
|
|
8011
8331
|
);
|
|
@@ -8182,12 +8502,6 @@ function useTimelineStore(selector) {
|
|
|
8182
8502
|
const TIMEBAR_HEIGHT = 158;
|
|
8183
8503
|
const EMPTY_TIMEBAR_HEIGHT = 46;
|
|
8184
8504
|
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
8505
|
const MINUTE_MS = 6e4;
|
|
8192
8506
|
const HOUR_MS = 36e5;
|
|
8193
8507
|
const DAY_MS = 864e5;
|
|
@@ -8331,7 +8645,7 @@ function formatDateTime(date) {
|
|
|
8331
8645
|
minute: "2-digit"
|
|
8332
8646
|
});
|
|
8333
8647
|
}
|
|
8334
|
-
function Histogram({ bins, maxCount, colorGroupedBins, selectedBins }) {
|
|
8648
|
+
function Histogram({ labels, bins, maxCount, colorGroupedBins, selectedBins }) {
|
|
8335
8649
|
const [hoveredBin, setHoveredBin] = useState(null);
|
|
8336
8650
|
const containerRef = useRef(null);
|
|
8337
8651
|
if (bins.length === 0 || maxCount === 0) return null;
|
|
@@ -8387,18 +8701,14 @@ function Histogram({ bins, maxCount, colorGroupedBins, selectedBins }) {
|
|
|
8387
8701
|
},
|
|
8388
8702
|
children: [
|
|
8389
8703
|
/* @__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
|
-
] })
|
|
8704
|
+
/* @__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
8705
|
]
|
|
8397
8706
|
}
|
|
8398
8707
|
)
|
|
8399
8708
|
] });
|
|
8400
8709
|
}
|
|
8401
8710
|
function TimebarToggle({ onClick, hasData }) {
|
|
8711
|
+
const { timebar: labels } = useMapLabels();
|
|
8402
8712
|
if (!hasData) return null;
|
|
8403
8713
|
return /* @__PURE__ */ jsx(
|
|
8404
8714
|
Button,
|
|
@@ -8407,7 +8717,7 @@ function TimebarToggle({ onClick, hasData }) {
|
|
|
8407
8717
|
icon: /* @__PURE__ */ jsx(Clock, { className: "w-5 h-5" }),
|
|
8408
8718
|
onClick,
|
|
8409
8719
|
className: "relative !w-9 !h-9 !min-w-0 !p-0",
|
|
8410
|
-
"aria-label":
|
|
8720
|
+
"aria-label": labels.toggle,
|
|
8411
8721
|
"data-testid": "button-timeline-toggle"
|
|
8412
8722
|
}
|
|
8413
8723
|
);
|
|
@@ -8423,7 +8733,7 @@ function Timebar({
|
|
|
8423
8733
|
formatCount: formatCount2,
|
|
8424
8734
|
labels: labelOverrides
|
|
8425
8735
|
}) {
|
|
8426
|
-
const labels = { ...
|
|
8736
|
+
const labels = { ...useMapLabels().timebar, ...labelOverrides };
|
|
8427
8737
|
const {
|
|
8428
8738
|
isEnabled,
|
|
8429
8739
|
hasTemporalData,
|
|
@@ -8621,6 +8931,7 @@ function Timebar({
|
|
|
8621
8931
|
/* @__PURE__ */ jsx(
|
|
8622
8932
|
Histogram,
|
|
8623
8933
|
{
|
|
8934
|
+
labels,
|
|
8624
8935
|
bins: histogramBins,
|
|
8625
8936
|
maxCount: maxBinCount,
|
|
8626
8937
|
colorGroupedBins,
|
|
@@ -8695,7 +9006,7 @@ function Timebar({
|
|
|
8695
9006
|
children: formatCount2 ? formatCount2({
|
|
8696
9007
|
total: temporalFeatures.length,
|
|
8697
9008
|
selected: hasSelection ? selectedTemporalFeatures.length : null
|
|
8698
|
-
}) : hasSelection ?
|
|
9009
|
+
}) : hasSelection ? labels.selectedCount({ selected: selectedTemporalFeatures.length, total: temporalFeatures.length }) : labels.featureCount(temporalFeatures.length)
|
|
8699
9010
|
}
|
|
8700
9011
|
)
|
|
8701
9012
|
] }),
|
|
@@ -8711,6 +9022,7 @@ function Timebar({
|
|
|
8711
9022
|
);
|
|
8712
9023
|
}
|
|
8713
9024
|
function MapDropZone({ onDrop, onDropFile, children }) {
|
|
9025
|
+
const { dropZone: labels } = useMapLabels();
|
|
8714
9026
|
const [isDragOver, setIsDragOver] = useState(false);
|
|
8715
9027
|
const handleDragOver = useCallback((e) => {
|
|
8716
9028
|
e.preventDefault();
|
|
@@ -8786,8 +9098,8 @@ function MapDropZone({ onDrop, onDropFile, children }) {
|
|
|
8786
9098
|
"data-testid": "map-drop-overlay",
|
|
8787
9099
|
children: /* @__PURE__ */ jsxs("div", { className: "bg-background/95 rounded-lg p-6 shadow-lg flex flex-col items-center gap-3", children: [
|
|
8788
9100
|
/* @__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:
|
|
9101
|
+
/* @__PURE__ */ jsx("span", { className: "text-lg font-medium", children: labels.title }),
|
|
9102
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: labels.subtitle })
|
|
8791
9103
|
] })
|
|
8792
9104
|
}
|
|
8793
9105
|
)
|
|
@@ -9477,6 +9789,20 @@ function suggestTraceGroupField(features, fields, timelineFields) {
|
|
|
9477
9789
|
};
|
|
9478
9790
|
return ((_a = candidates.find((c) => splitsIntoTracks(c.field))) == null ? void 0 : _a.field) ?? null;
|
|
9479
9791
|
}
|
|
9792
|
+
function deepClone(value) {
|
|
9793
|
+
try {
|
|
9794
|
+
return structuredClone(value);
|
|
9795
|
+
} catch {
|
|
9796
|
+
return JSON.parse(JSON.stringify(value));
|
|
9797
|
+
}
|
|
9798
|
+
}
|
|
9799
|
+
function cloneFeatures(features) {
|
|
9800
|
+
try {
|
|
9801
|
+
return structuredClone(features);
|
|
9802
|
+
} catch {
|
|
9803
|
+
return features.map((f) => deepClone(f));
|
|
9804
|
+
}
|
|
9805
|
+
}
|
|
9480
9806
|
function numberEquals(a, b) {
|
|
9481
9807
|
return a === b || !Number.isFinite(a) && !Number.isFinite(b);
|
|
9482
9808
|
}
|
|
@@ -9676,7 +10002,7 @@ const SELECTION_OVERLAY_LAYER_IDS = {
|
|
|
9676
10002
|
polygon: "selection-overlay-polygon",
|
|
9677
10003
|
label: "selection-overlay-label"
|
|
9678
10004
|
};
|
|
9679
|
-
function buildSelectionOverlayStack() {
|
|
10005
|
+
function buildSelectionOverlayStack(newTextLabel) {
|
|
9680
10006
|
const source = SELECTION_OVERLAY_SOURCE_ID;
|
|
9681
10007
|
return [
|
|
9682
10008
|
{
|
|
@@ -9735,7 +10061,7 @@ function buildSelectionOverlayStack() {
|
|
|
9735
10061
|
// A selected host feature keeps its label in the shared `host-labels` layer.
|
|
9736
10062
|
filter: NOT_HOST_FILTER,
|
|
9737
10063
|
layout: {
|
|
9738
|
-
...buildCustomLabelLayout(),
|
|
10064
|
+
...buildCustomLabelLayout(newTextLabel),
|
|
9739
10065
|
// Never hidden by the auto-label density cap, which only flips the
|
|
9740
10066
|
// unpinned base layer: with base labels off, the selected ones stay.
|
|
9741
10067
|
visibility: "visible",
|
|
@@ -9759,6 +10085,104 @@ function buildSelectionOverlayData(ids, styleFor) {
|
|
|
9759
10085
|
});
|
|
9760
10086
|
return { type: "FeatureCollection", features };
|
|
9761
10087
|
}
|
|
10088
|
+
function renderedFeatureId(f) {
|
|
10089
|
+
var _a;
|
|
10090
|
+
const fromProps = (_a = f.properties) == null ? void 0 : _a.id;
|
|
10091
|
+
if (fromProps !== void 0 && fromProps !== null && fromProps !== "") return String(fromProps);
|
|
10092
|
+
if (f.id !== void 0 && f.id !== null && f.id !== "") return String(f.id);
|
|
10093
|
+
return null;
|
|
10094
|
+
}
|
|
10095
|
+
function resolveTooltipFeature(rendered, lookup) {
|
|
10096
|
+
const id = renderedFeatureId(rendered);
|
|
10097
|
+
const stored = id === null ? null : lookup(id);
|
|
10098
|
+
if (stored) {
|
|
10099
|
+
return deepClone({
|
|
10100
|
+
type: "Feature",
|
|
10101
|
+
geometry: stored.geometry,
|
|
10102
|
+
properties: stored.properties ?? {},
|
|
10103
|
+
id: stored.id
|
|
10104
|
+
});
|
|
10105
|
+
}
|
|
10106
|
+
return {
|
|
10107
|
+
type: "Feature",
|
|
10108
|
+
geometry: rendered.geometry,
|
|
10109
|
+
properties: { ...rendered.properties ?? {} },
|
|
10110
|
+
id: rendered.id
|
|
10111
|
+
};
|
|
10112
|
+
}
|
|
10113
|
+
const DEFAULT_POINT_RADIUS = 5;
|
|
10114
|
+
const DEFAULT_ICON_SIZE = 24;
|
|
10115
|
+
const MAX_POINT_RADIUS = 18;
|
|
10116
|
+
const SAME_SPOT_PX = 1;
|
|
10117
|
+
const CROWD = 16;
|
|
10118
|
+
const SCAN_LIMIT = 256;
|
|
10119
|
+
const isDot = (m) => m.center !== null;
|
|
10120
|
+
const distance = (a, b) => Math.hypot(a.x - b.x, a.y - b.y);
|
|
10121
|
+
function paintedRadius(f) {
|
|
10122
|
+
var _a, _b;
|
|
10123
|
+
const p = f.properties ?? {};
|
|
10124
|
+
const hidden = ((_a = f.state) == null ? void 0 : _a[TIMELINE_HIDDEN_KEY]) === true || p.isHiddenByCluster === 1 || p.isHiddenByHeatmap === 1;
|
|
10125
|
+
if (hidden) return 0;
|
|
10126
|
+
if (typeof p.icon === "string" && p.icon !== "") {
|
|
10127
|
+
if (p[HOST_OWNED_PROP] !== 1) return 0;
|
|
10128
|
+
return typeof p.iconSize === "number" && Number.isFinite(p.iconSize) ? p.iconSize / 2 : DEFAULT_ICON_SIZE / 2;
|
|
10129
|
+
}
|
|
10130
|
+
const r = ((_b = f.state) == null ? void 0 : _b[TRACE_ENDPOINT_KEY]) === true ? p._endpointRadius : p.pointRadius;
|
|
10131
|
+
return typeof r === "number" && Number.isFinite(r) ? r : DEFAULT_POINT_RADIUS;
|
|
10132
|
+
}
|
|
10133
|
+
function labelPriority(f) {
|
|
10134
|
+
var _a;
|
|
10135
|
+
const v = (_a = f.properties) == null ? void 0 : _a._labelPriority;
|
|
10136
|
+
return typeof v === "number" && Number.isFinite(v) ? v : DEFAULT_LABEL_PRIORITY;
|
|
10137
|
+
}
|
|
10138
|
+
function members(features, project, maxDots = Infinity) {
|
|
10139
|
+
const seen = /* @__PURE__ */ new Set();
|
|
10140
|
+
const out = [];
|
|
10141
|
+
let dots = 0;
|
|
10142
|
+
for (const feature of features) {
|
|
10143
|
+
const id = renderedFeatureId(feature);
|
|
10144
|
+
if (id === null || seen.has(id)) continue;
|
|
10145
|
+
if (seen.size === SCAN_LIMIT || dots === maxDots) return { members: out, cut: true };
|
|
10146
|
+
seen.add(id);
|
|
10147
|
+
if (feature.geometry.type !== "Point") {
|
|
10148
|
+
out.push({ id, feature, center: null, radius: 0 });
|
|
10149
|
+
continue;
|
|
10150
|
+
}
|
|
10151
|
+
const radius = paintedRadius(feature);
|
|
10152
|
+
if (radius <= 0) continue;
|
|
10153
|
+
out.push({ id, feature, center: project(feature.geometry.coordinates), radius });
|
|
10154
|
+
dots++;
|
|
10155
|
+
}
|
|
10156
|
+
return { members: out, cut: false };
|
|
10157
|
+
}
|
|
10158
|
+
function searchBox(dot) {
|
|
10159
|
+
const reach = dot.radius + MAX_POINT_RADIUS;
|
|
10160
|
+
return [[dot.center.x - reach, dot.center.y - reach], [dot.center.x + reach, dot.center.y + reach]];
|
|
10161
|
+
}
|
|
10162
|
+
function featureStackAt(point2, hits, queryBox, project) {
|
|
10163
|
+
const hit = members(hits, project, CROWD + 1).members;
|
|
10164
|
+
const under = hit.filter(isDot);
|
|
10165
|
+
if (under.length === 0) return { features: hit.length > 0 ? [hit[0].feature] : [], more: false };
|
|
10166
|
+
const fromCursor = (d) => distance(d.center, point2);
|
|
10167
|
+
const byCursor = (a, b) => fromCursor(a) - fromCursor(b);
|
|
10168
|
+
let dots;
|
|
10169
|
+
let more;
|
|
10170
|
+
if (under.length > CROWD) {
|
|
10171
|
+
dots = under.sort(byCursor).slice(0, CROWD);
|
|
10172
|
+
more = true;
|
|
10173
|
+
} else {
|
|
10174
|
+
const nearest = under.reduce((a, b) => fromCursor(b) < fromCursor(a) ? b : a);
|
|
10175
|
+
const taken = new Set(under.map((d) => d.id));
|
|
10176
|
+
const box = members(queryBox(searchBox(nearest)), project);
|
|
10177
|
+
const neighbours = box.members.filter(isDot).filter((m) => !taken.has(m.id) && distance(m.center, nearest.center) <= m.radius + nearest.radius);
|
|
10178
|
+
dots = [...under, ...neighbours].sort(byCursor);
|
|
10179
|
+
more = box.cut;
|
|
10180
|
+
}
|
|
10181
|
+
const spot = dots[0].center;
|
|
10182
|
+
const onSpot = dots.filter((d) => distance(d.center, spot) < SAME_SPOT_PX).sort((a, b) => labelPriority(a.feature) - labelPriority(b.feature));
|
|
10183
|
+
const rest = dots.filter((d) => distance(d.center, spot) >= SAME_SPOT_PX);
|
|
10184
|
+
return { features: [...onSpot, ...rest].map((d) => d.feature), more };
|
|
10185
|
+
}
|
|
9762
10186
|
function computeBubbleDomain(values) {
|
|
9763
10187
|
let min = Infinity;
|
|
9764
10188
|
let max = -Infinity;
|
|
@@ -9854,12 +10278,11 @@ function createClusterGradientManager(map, sourceId, options) {
|
|
|
9854
10278
|
};
|
|
9855
10279
|
}
|
|
9856
10280
|
const OTHER_BUCKET_KEY = "__other__";
|
|
9857
|
-
const OTHER_BUCKET_LABEL = "Other";
|
|
9858
10281
|
const OTHER_BUCKET_COLOR = "#9ca3af";
|
|
9859
|
-
function toDisplayName(name) {
|
|
9860
|
-
return name === OTHER_BUCKET_KEY ?
|
|
10282
|
+
function toDisplayName(name, otherLabel) {
|
|
10283
|
+
return name === OTHER_BUCKET_KEY ? otherLabel : name;
|
|
9861
10284
|
}
|
|
9862
|
-
function createPieSVG(categories, total, size = 44, onSliceHover, badgeValue) {
|
|
10285
|
+
function createPieSVG(categories, total, otherLabel, size = 44, onSliceHover, badgeValue) {
|
|
9863
10286
|
const container = document.createElement("div");
|
|
9864
10287
|
container.style.width = `${size}px`;
|
|
9865
10288
|
container.style.height = `${size}px`;
|
|
@@ -9879,7 +10302,7 @@ function createPieSVG(categories, total, size = 44, onSliceHover, badgeValue) {
|
|
|
9879
10302
|
svg.appendChild(bgCircle);
|
|
9880
10303
|
const slicesSum = categories.reduce((s, c) => s + c.count, 0);
|
|
9881
10304
|
const remainder = Math.max(0, total - slicesSum);
|
|
9882
|
-
const renderList = remainder > 0 ? [...categories, { name: "__remainder__", displayName:
|
|
10305
|
+
const renderList = remainder > 0 ? [...categories, { name: "__remainder__", displayName: otherLabel, count: remainder, color: OTHER_BUCKET_COLOR }] : categories;
|
|
9883
10306
|
const nonZeroSlices = renderList.filter((c) => c.count > 0);
|
|
9884
10307
|
const isSingleFullSlice = nonZeroSlices.length === 1 && nonZeroSlices[0].count >= total;
|
|
9885
10308
|
if (isSingleFullSlice) {
|
|
@@ -10017,8 +10440,8 @@ function hideTooltip() {
|
|
|
10017
10440
|
function fingerprintCluster(pointCount, counts2, size, badgeValue) {
|
|
10018
10441
|
return `${size}|${pointCount}|${badgeValue ?? ""}|${counts2.join(",")}`;
|
|
10019
10442
|
}
|
|
10020
|
-
function buildPieElement(categories, pointCount, size, source, clusterId, map, coords, badgeValue) {
|
|
10021
|
-
const el = createPieSVG(categories, pointCount, size, (cat, event) => {
|
|
10443
|
+
function buildPieElement(categories, pointCount, otherLabel, size, source, clusterId, map, coords, badgeValue) {
|
|
10444
|
+
const el = createPieSVG(categories, pointCount, otherLabel, size, (cat, event) => {
|
|
10022
10445
|
if (cat) {
|
|
10023
10446
|
showTooltip(cat, event.clientX, event.clientY);
|
|
10024
10447
|
} else {
|
|
@@ -10035,7 +10458,7 @@ function buildPieElement(categories, pointCount, size, source, clusterId, map, c
|
|
|
10035
10458
|
});
|
|
10036
10459
|
return el;
|
|
10037
10460
|
}
|
|
10038
|
-
function renderClusterPies(map, sourceId, categoryValues, categoryColorMap, markers) {
|
|
10461
|
+
function renderClusterPies(map, sourceId, categoryValues, categoryColorMap, markers, otherLabel) {
|
|
10039
10462
|
const source = map.getSource(sourceId);
|
|
10040
10463
|
if (!source) return;
|
|
10041
10464
|
const clusters = map.querySourceFeatures(sourceId, {
|
|
@@ -10059,7 +10482,7 @@ function renderClusterPies(map, sourceId, categoryValues, categoryColorMap, mark
|
|
|
10059
10482
|
});
|
|
10060
10483
|
const categories = categoryValues.map((cat, i) => ({
|
|
10061
10484
|
name: cat,
|
|
10062
|
-
displayName: toDisplayName(cat),
|
|
10485
|
+
displayName: toDisplayName(cat, otherLabel),
|
|
10063
10486
|
count: allCounts[i],
|
|
10064
10487
|
color: categoryColorMap[cat] || "#3b82f6"
|
|
10065
10488
|
})).filter((c) => c.count > 0);
|
|
@@ -10070,7 +10493,7 @@ function renderClusterPies(map, sourceId, categoryValues, categoryColorMap, mark
|
|
|
10070
10493
|
existing.marker.setLngLat(coords);
|
|
10071
10494
|
return;
|
|
10072
10495
|
}
|
|
10073
|
-
const el = buildPieElement(categories, pointCount, size, source, clusterId, map, coords, badgeValue);
|
|
10496
|
+
const el = buildPieElement(categories, pointCount, otherLabel, size, source, clusterId, map, coords, badgeValue);
|
|
10074
10497
|
if (existing) {
|
|
10075
10498
|
existing.marker.remove();
|
|
10076
10499
|
}
|
|
@@ -10084,7 +10507,7 @@ function renderClusterPies(map, sourceId, categoryValues, categoryColorMap, mark
|
|
|
10084
10507
|
}
|
|
10085
10508
|
});
|
|
10086
10509
|
}
|
|
10087
|
-
function createClusterPieManager(map, sourceId, categoryValues, categoryColorMap) {
|
|
10510
|
+
function createClusterPieManager(map, sourceId, categoryValues, categoryColorMap, otherLabel = DEFAULT_MAP_LABELS.canvas.clusterOther) {
|
|
10088
10511
|
const markers = /* @__PURE__ */ new Map();
|
|
10089
10512
|
let updateScheduled = false;
|
|
10090
10513
|
function scheduleUpdate() {
|
|
@@ -10092,7 +10515,7 @@ function createClusterPieManager(map, sourceId, categoryValues, categoryColorMap
|
|
|
10092
10515
|
updateScheduled = true;
|
|
10093
10516
|
requestAnimationFrame(() => {
|
|
10094
10517
|
updateScheduled = false;
|
|
10095
|
-
renderClusterPies(map, sourceId, categoryValues, categoryColorMap, markers);
|
|
10518
|
+
renderClusterPies(map, sourceId, categoryValues, categoryColorMap, markers, otherLabel);
|
|
10096
10519
|
});
|
|
10097
10520
|
}
|
|
10098
10521
|
function onData(e) {
|
|
@@ -10116,6 +10539,7 @@ function createClusterPieManager(map, sourceId, categoryValues, categoryColorMap
|
|
|
10116
10539
|
}
|
|
10117
10540
|
function ClusterPieManager(props) {
|
|
10118
10541
|
const { map, sourceId, categoryValues, categoryColorMap, visible } = props;
|
|
10542
|
+
const otherLabel = useMapLabels().canvas.clusterOther;
|
|
10119
10543
|
const markersRef = useRef(/* @__PURE__ */ new Map());
|
|
10120
10544
|
const updateScheduled = useRef(false);
|
|
10121
10545
|
const updateMarkers = useCallback(() => {
|
|
@@ -10124,8 +10548,8 @@ function ClusterPieManager(props) {
|
|
|
10124
10548
|
markersRef.current.clear();
|
|
10125
10549
|
return;
|
|
10126
10550
|
}
|
|
10127
|
-
renderClusterPies(map, sourceId, categoryValues, categoryColorMap, markersRef.current);
|
|
10128
|
-
}, [map, sourceId, categoryValues, categoryColorMap, visible]);
|
|
10551
|
+
renderClusterPies(map, sourceId, categoryValues, categoryColorMap, markersRef.current, otherLabel);
|
|
10552
|
+
}, [map, sourceId, categoryValues, categoryColorMap, visible, otherLabel]);
|
|
10129
10553
|
useEffect(() => {
|
|
10130
10554
|
if (!map) return;
|
|
10131
10555
|
const scheduleUpdate = () => {
|
|
@@ -10377,6 +10801,16 @@ function extract3DFlightPaths(features, fields) {
|
|
|
10377
10801
|
});
|
|
10378
10802
|
return paths;
|
|
10379
10803
|
}
|
|
10804
|
+
function describeIngestError(result, labels) {
|
|
10805
|
+
switch (result.code) {
|
|
10806
|
+
case "invalid-format":
|
|
10807
|
+
return labels.invalidFormat;
|
|
10808
|
+
case "empty":
|
|
10809
|
+
return labels.noFeatures;
|
|
10810
|
+
default:
|
|
10811
|
+
return result.message;
|
|
10812
|
+
}
|
|
10813
|
+
}
|
|
10380
10814
|
const CAP_NOTICE_INTERVAL_MS = 5e3;
|
|
10381
10815
|
function basemapInsertAnchor(map) {
|
|
10382
10816
|
if (map.getLayer("satellite-layer")) return "satellite-layer";
|
|
@@ -10469,8 +10903,12 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
10469
10903
|
timelineFields,
|
|
10470
10904
|
keepTimebarExtra = false,
|
|
10471
10905
|
onOpenInNewTab,
|
|
10472
|
-
onEntityContextMenu
|
|
10906
|
+
onEntityContextMenu,
|
|
10907
|
+
labels: labelsProp
|
|
10473
10908
|
}, ref) {
|
|
10909
|
+
const labels = labelsProp ?? DEFAULT_MAP_LABELS;
|
|
10910
|
+
const labelsRef = useRef(labels);
|
|
10911
|
+
labelsRef.current = labels;
|
|
10474
10912
|
const mapContainer = useRef(null);
|
|
10475
10913
|
const [resolvedEndpoints] = useState(() => resolveEndpoints(endpoints));
|
|
10476
10914
|
const [baseMapStyle] = useState(() => {
|
|
@@ -10491,7 +10929,7 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
10491
10929
|
const tracePopupRef = useRef(null);
|
|
10492
10930
|
const tooltipElRef = useRef(null);
|
|
10493
10931
|
const layersRef = useRef([
|
|
10494
|
-
{ id:
|
|
10932
|
+
{ id: DEFAULT_LAYER_ID, name: DEFAULT_LAYER_NAME, visible: true, featureIds: [] }
|
|
10495
10933
|
]);
|
|
10496
10934
|
const activeEditingLayerIdRef = useRef("default");
|
|
10497
10935
|
const isApiAddingRef = useRef(false);
|
|
@@ -10507,12 +10945,16 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
10507
10945
|
var _a;
|
|
10508
10946
|
return ((_a = MAP_STYLES.find((style) => style.id === id)) == null ? void 0 : _a.icon) ?? Map$1;
|
|
10509
10947
|
};
|
|
10510
|
-
|
|
10948
|
+
const builtIns = resolvedEndpoints.builtInBasemaps.map((basemap) => ({
|
|
10949
|
+
id: basemap.id,
|
|
10950
|
+
name: basemap.name ?? builtInBasemapName(basemap.id, labels.mapOptions) ?? basemap.id
|
|
10951
|
+
}));
|
|
10952
|
+
return resolveBasemapChoices(basemapOrder, customBasemaps, builtIns).map((choice) => ({
|
|
10511
10953
|
id: choice.id,
|
|
10512
10954
|
name: choice.name,
|
|
10513
10955
|
icon: iconFor(choice.id)
|
|
10514
10956
|
}));
|
|
10515
|
-
}, [basemapOrder, customBasemaps, resolvedEndpoints]);
|
|
10957
|
+
}, [basemapOrder, customBasemaps, resolvedEndpoints, labels.mapOptions]);
|
|
10516
10958
|
const loadingBasemaps = useRef(/* @__PURE__ */ new Set());
|
|
10517
10959
|
const customBasemapRegistry = useRef(/* @__PURE__ */ new Map());
|
|
10518
10960
|
const clusterPieManagers = useRef(/* @__PURE__ */ new Map());
|
|
@@ -10545,7 +10987,7 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
10545
10987
|
const [autoFocusLabel, setAutoFocusLabel] = useState(false);
|
|
10546
10988
|
const [showLayers, setShowLayers] = useState(false);
|
|
10547
10989
|
const [layers, setLayers] = useState([
|
|
10548
|
-
{ id:
|
|
10990
|
+
{ id: DEFAULT_LAYER_ID, name: DEFAULT_LAYER_NAME, visible: true, featureIds: [] }
|
|
10549
10991
|
]);
|
|
10550
10992
|
const [activeEditingLayerId, setActiveEditingLayerId] = useState("default");
|
|
10551
10993
|
const history = useMapHistory();
|
|
@@ -10627,7 +11069,8 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
10627
11069
|
if (last != null && now - last < CAP_NOTICE_INTERVAL_MS) return;
|
|
10628
11070
|
capNoticeRef.current.set(key, now);
|
|
10629
11071
|
}
|
|
10630
|
-
|
|
11072
|
+
const layerName = shownLayerName({ id: info.layerId ?? "", name: info.layerName }, labelsRef.current.canvas);
|
|
11073
|
+
toast(formatFeatureCapToast({ ...info, layerName }, labelsRef.current.featureCap));
|
|
10631
11074
|
}, [onFeaturesTruncated, toast]);
|
|
10632
11075
|
const countExisting = useCallback(
|
|
10633
11076
|
(layer) => countLayerFeatures(layer, {
|
|
@@ -11434,7 +11877,7 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
11434
11877
|
const generation = ++state.generation;
|
|
11435
11878
|
state.inFlightFingerprint = fingerprint;
|
|
11436
11879
|
const passStart = performance.now();
|
|
11437
|
-
const progress = (_a = ingestProgressStoreRef.current) == null ? void 0 : _a.begin(layer.
|
|
11880
|
+
const progress = (_a = ingestProgressStoreRef.current) == null ? void 0 : _a.begin(shownLayerName(layer, labelsRef.current.canvas), { activity: "rendering" });
|
|
11438
11881
|
progress == null ? void 0 : progress.setTotal(features.length);
|
|
11439
11882
|
setLayerImporting(layer.id, true);
|
|
11440
11883
|
const ranges = layerFieldRanges(layer.visualConfig, (visit) => {
|
|
@@ -11985,7 +12428,10 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
11985
12428
|
map.current = mapInstance;
|
|
11986
12429
|
draw.current = drawInstance;
|
|
11987
12430
|
mapInstance.addSource(SHARED_SOURCE_ID, customSourceSpec());
|
|
11988
|
-
const sharedStack = buildCustomLayerStack(SHARED_SOURCE_ID, CUSTOM_LAYER_ROLES, {
|
|
12431
|
+
const sharedStack = buildCustomLayerStack(SHARED_SOURCE_ID, CUSTOM_LAYER_ROLES, {
|
|
12432
|
+
labelsVisible: false,
|
|
12433
|
+
newTextLabel: labelsRef.current.canvas.newTextLabel
|
|
12434
|
+
});
|
|
11989
12435
|
sharedStack.forEach((spec) => mapInstance.addLayer(spec));
|
|
11990
12436
|
const styleHost = {
|
|
11991
12437
|
getSource: (id) => mapInstance.getSource(id),
|
|
@@ -12014,6 +12460,7 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
12014
12460
|
return (_a2 = unbindHoverHandlersRef.current) == null ? void 0 : _a2.call(unbindHoverHandlersRef, id);
|
|
12015
12461
|
}),
|
|
12016
12462
|
labelsVisible: () => lastLabelVisibility.current,
|
|
12463
|
+
newTextLabel: () => labelsRef.current.canvas.newTextLabel,
|
|
12017
12464
|
hostIconInteractive: () => hostIconBoundRef.current
|
|
12018
12465
|
});
|
|
12019
12466
|
shardRegistryRef.current.registerShared(sharedStack.map((spec) => spec.id));
|
|
@@ -12091,7 +12538,7 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
12091
12538
|
data: { type: "FeatureCollection", features: [] },
|
|
12092
12539
|
maxzoom: 22
|
|
12093
12540
|
});
|
|
12094
|
-
buildSelectionOverlayStack().forEach((spec) => mapInstance.addLayer(spec));
|
|
12541
|
+
buildSelectionOverlayStack(labelsRef.current.canvas.newTextLabel).forEach((spec) => mapInstance.addLayer(spec));
|
|
12095
12542
|
if (tooltipElRef.current) {
|
|
12096
12543
|
const prevCleanup = tooltipElRef.current._cleanup;
|
|
12097
12544
|
try {
|
|
@@ -12216,7 +12663,7 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
12216
12663
|
const name = props.name;
|
|
12217
12664
|
let html = '<div class="text-sm space-y-0.5">';
|
|
12218
12665
|
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"
|
|
12666
|
+
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
12667
|
const otherProps = displayProps.filter(([k]) => k !== "name" && k !== "id");
|
|
12221
12668
|
if (otherProps.length > 0) {
|
|
12222
12669
|
html += '<div class="text-xs text-muted-foreground space-y-0.5">';
|
|
@@ -12249,7 +12696,7 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
12249
12696
|
const prevDisabled = tooltipPageIndex === 0;
|
|
12250
12697
|
const nextDisabled = tooltipPageIndex === tooltipFeatures.length - 1;
|
|
12251
12698
|
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="${
|
|
12699
|
+
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
12700
|
html = navHtml + html;
|
|
12254
12701
|
}
|
|
12255
12702
|
return html;
|
|
@@ -12444,17 +12891,18 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
12444
12891
|
const group = props.group !== "__all__" ? props.group : null;
|
|
12445
12892
|
const fromName = props.fromName || "";
|
|
12446
12893
|
const toName = props.toName || "";
|
|
12894
|
+
const traceLabels = labelsRef.current.canvas;
|
|
12447
12895
|
let html = '<div class="text-sm space-y-1">';
|
|
12448
12896
|
if (fromName || toName) {
|
|
12449
12897
|
html += `<div class="font-medium text-xs text-muted-foreground">${escapeHtml(fromName || "?")} → ${escapeHtml(toName || "?")}</div>`;
|
|
12450
12898
|
}
|
|
12451
12899
|
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"
|
|
12900
|
+
html += `<div><span class="text-muted-foreground">${escapeHtml(traceLabels.traceDuration)}</span> <span class="font-medium">${escapeHtml(duration)}</span></div>`;
|
|
12901
|
+
html += `<div><span class="text-muted-foreground">${escapeHtml(traceLabels.traceDistance)}</span> <span class="font-medium">${escapeHtml(distance2)}</span></div>`;
|
|
12902
|
+
html += `<div><span class="text-muted-foreground">${escapeHtml(traceLabels.traceAvgSpeed)}</span> <span class="font-medium">${escapeHtml(avgSpeed)}</span></div>`;
|
|
12455
12903
|
html += "</div>";
|
|
12456
12904
|
if (group) {
|
|
12457
|
-
html += `<div class="text-xs text-muted-foreground border-t border-border/50 mt-1 pt-1"
|
|
12905
|
+
html += `<div class="text-xs text-muted-foreground border-t border-border/50 mt-1 pt-1">${escapeHtml(traceLabels.traceGroup(group))}</div>`;
|
|
12458
12906
|
}
|
|
12459
12907
|
html += "</div>";
|
|
12460
12908
|
if (!tracePopupRef.current) {
|
|
@@ -12631,7 +13079,7 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
12631
13079
|
if (pendingKind === "text") {
|
|
12632
13080
|
newProps = {
|
|
12633
13081
|
...newProps,
|
|
12634
|
-
label:
|
|
13082
|
+
label: labelsRef.current.canvas.newTextLabel,
|
|
12635
13083
|
fontSize: 14,
|
|
12636
13084
|
fontColor: "#000000",
|
|
12637
13085
|
fontWeight: "normal"
|
|
@@ -12947,7 +13395,7 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
12947
13395
|
});
|
|
12948
13396
|
} catch (error) {
|
|
12949
13397
|
console.error("Failed to initialize map:", error);
|
|
12950
|
-
setMapError(error instanceof Error ? error.message :
|
|
13398
|
+
setMapError(error instanceof Error ? error.message : labelsRef.current.canvas.mapInitFailedFallback);
|
|
12951
13399
|
}
|
|
12952
13400
|
return () => {
|
|
12953
13401
|
var _a;
|
|
@@ -13085,8 +13533,8 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
13085
13533
|
const m = map.current;
|
|
13086
13534
|
if (!m || !isMapLoadedRef.current) {
|
|
13087
13535
|
toast({
|
|
13088
|
-
title:
|
|
13089
|
-
description:
|
|
13536
|
+
title: labelsRef.current.toasts.screenshotFailed,
|
|
13537
|
+
description: labelsRef.current.toasts.screenshotMapNotReady,
|
|
13090
13538
|
variant: "destructive"
|
|
13091
13539
|
});
|
|
13092
13540
|
throw new Error("Map is not ready");
|
|
@@ -13111,8 +13559,8 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
13111
13559
|
});
|
|
13112
13560
|
} catch (err) {
|
|
13113
13561
|
toast({
|
|
13114
|
-
title:
|
|
13115
|
-
description: err instanceof Error ? err.message :
|
|
13562
|
+
title: labelsRef.current.toasts.screenshotFailed,
|
|
13563
|
+
description: err instanceof Error ? err.message : labelsRef.current.toasts.screenshotNotRendered,
|
|
13116
13564
|
variant: "destructive"
|
|
13117
13565
|
});
|
|
13118
13566
|
throw err;
|
|
@@ -13878,8 +14326,8 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
13878
14326
|
if (!draw.current || !isMapLoaded) return;
|
|
13879
14327
|
if (!hasVisibleLayers && mode !== "simple_select" && mode !== "view_select") {
|
|
13880
14328
|
toast({
|
|
13881
|
-
title:
|
|
13882
|
-
description:
|
|
14329
|
+
title: labelsRef.current.toasts.noVisibleLayers,
|
|
14330
|
+
description: labelsRef.current.toasts.noVisibleLayersDescription,
|
|
13883
14331
|
variant: "destructive"
|
|
13884
14332
|
});
|
|
13885
14333
|
return;
|
|
@@ -13912,26 +14360,27 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
13912
14360
|
const handleClear = useCallback(() => {
|
|
13913
14361
|
if (!draw.current) return;
|
|
13914
14362
|
const activeLayer = layersRef.current.find((l) => l.id === activeEditingLayerId);
|
|
14363
|
+
const toastLabels = labelsRef.current.toasts;
|
|
13915
14364
|
if (!activeLayer) {
|
|
13916
14365
|
toast({
|
|
13917
|
-
title:
|
|
13918
|
-
description:
|
|
14366
|
+
title: toastLabels.noLayerSelected,
|
|
14367
|
+
description: toastLabels.noLayerSelectedDescription,
|
|
13919
14368
|
variant: "destructive"
|
|
13920
14369
|
});
|
|
13921
14370
|
return;
|
|
13922
14371
|
}
|
|
13923
14372
|
if (activeLayer.readOnly) {
|
|
13924
14373
|
toast({
|
|
13925
|
-
title:
|
|
13926
|
-
description:
|
|
14374
|
+
title: toastLabels.cannotClearHpLayer,
|
|
14375
|
+
description: toastLabels.cannotClearHpLayerDescription,
|
|
13927
14376
|
variant: "destructive"
|
|
13928
14377
|
});
|
|
13929
14378
|
return;
|
|
13930
14379
|
}
|
|
13931
14380
|
if (activeLayer.featureIds.length === 0) {
|
|
13932
14381
|
toast({
|
|
13933
|
-
title:
|
|
13934
|
-
description:
|
|
14382
|
+
title: toastLabels.layerEmpty,
|
|
14383
|
+
description: toastLabels.layerEmptyDescription
|
|
13935
14384
|
});
|
|
13936
14385
|
return;
|
|
13937
14386
|
}
|
|
@@ -13952,8 +14401,8 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
13952
14401
|
scheduleTimelineUpdate();
|
|
13953
14402
|
scheduleSync();
|
|
13954
14403
|
toast({
|
|
13955
|
-
title:
|
|
13956
|
-
description:
|
|
14404
|
+
title: toastLabels.layerCleared,
|
|
14405
|
+
description: toastLabels.layerClearedDescription(shownLayerName(activeLayer, labelsRef.current.canvas))
|
|
13957
14406
|
});
|
|
13958
14407
|
}, [activeEditingLayerId, saveStateForUndo, updateFeatureCount, scheduleTimelineUpdate, scheduleSync, toast]);
|
|
13959
14408
|
const handleDeleteSelected = useCallback(() => {
|
|
@@ -14254,7 +14703,7 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
14254
14703
|
const items = [
|
|
14255
14704
|
{
|
|
14256
14705
|
id: "create-point",
|
|
14257
|
-
label: canCreate ?
|
|
14706
|
+
label: canCreate ? labelsRef.current.canvas.createPointFeature : labelsRef.current.canvas.noEditableLayer,
|
|
14258
14707
|
disabled: !canCreate,
|
|
14259
14708
|
onSelect: () => {
|
|
14260
14709
|
createPointAtCoords(clickCoords[0], clickCoords[1]);
|
|
@@ -15297,8 +15746,8 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
15297
15746
|
if (!map.current) return;
|
|
15298
15747
|
if (!resolvedEndpoints.terrain) {
|
|
15299
15748
|
toast({
|
|
15300
|
-
title:
|
|
15301
|
-
description:
|
|
15749
|
+
title: labelsRef.current.toasts.terrainUnavailable,
|
|
15750
|
+
description: labelsRef.current.toasts.terrainUnavailableDescription,
|
|
15302
15751
|
variant: "destructive"
|
|
15303
15752
|
});
|
|
15304
15753
|
return;
|
|
@@ -15331,8 +15780,8 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
15331
15780
|
mapInstance.setLayoutProperty("terrain-hillshade", "visibility", "visible");
|
|
15332
15781
|
}
|
|
15333
15782
|
toast({
|
|
15334
|
-
title:
|
|
15335
|
-
description:
|
|
15783
|
+
title: labelsRef.current.toasts.terrainEnabled,
|
|
15784
|
+
description: labelsRef.current.toasts.terrainEnabledDescription
|
|
15336
15785
|
});
|
|
15337
15786
|
} else {
|
|
15338
15787
|
mapInstance.setTerrain(null);
|
|
@@ -16249,7 +16698,7 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
16249
16698
|
}
|
|
16250
16699
|
};
|
|
16251
16700
|
exportInFlightRef.current = true;
|
|
16252
|
-
const progress = ingestProgressStore.begin(layer.
|
|
16701
|
+
const progress = ingestProgressStore.begin(shownLayerName(layer, labelsRef.current.canvas), { activity: "preparing-download" });
|
|
16253
16702
|
progress.setTotal(features.length);
|
|
16254
16703
|
try {
|
|
16255
16704
|
const parts = await featureCollectionBlobPartsAsync(geojson, {
|
|
@@ -16263,8 +16712,8 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
16263
16712
|
} catch (error) {
|
|
16264
16713
|
console.error(`Failed to export layer "${layer.name}" as GeoJSON:`, error);
|
|
16265
16714
|
toast({
|
|
16266
|
-
title:
|
|
16267
|
-
description: error instanceof Error ? error.message :
|
|
16715
|
+
title: labelsRef.current.toasts.exportFailed,
|
|
16716
|
+
description: error instanceof Error ? error.message : labelsRef.current.toasts.exportFailedDescription,
|
|
16268
16717
|
variant: "destructive"
|
|
16269
16718
|
});
|
|
16270
16719
|
} finally {
|
|
@@ -16344,7 +16793,7 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
16344
16793
|
if (!draw.current || exportInFlightRef.current) return;
|
|
16345
16794
|
const { collection, mapFeature } = buildEnrichedExport();
|
|
16346
16795
|
exportInFlightRef.current = true;
|
|
16347
|
-
const progress = ingestProgressStore.begin("map_export.geojson", {
|
|
16796
|
+
const progress = ingestProgressStore.begin("map_export.geojson", { activity: "preparing-download" });
|
|
16348
16797
|
progress.setTotal(collection.features.length);
|
|
16349
16798
|
try {
|
|
16350
16799
|
const parts = await featureCollectionBlobPartsAsync(collection, {
|
|
@@ -16355,8 +16804,8 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
16355
16804
|
} catch (error) {
|
|
16356
16805
|
console.error("Failed to export the map as GeoJSON:", error);
|
|
16357
16806
|
toast({
|
|
16358
|
-
title:
|
|
16359
|
-
description: error instanceof Error ? error.message :
|
|
16807
|
+
title: labelsRef.current.toasts.exportFailed,
|
|
16808
|
+
description: error instanceof Error ? error.message : labelsRef.current.toasts.exportFailedDescription,
|
|
16360
16809
|
variant: "destructive"
|
|
16361
16810
|
});
|
|
16362
16811
|
} finally {
|
|
@@ -16431,8 +16880,11 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
16431
16880
|
targetLayerId = activeLayer.id;
|
|
16432
16881
|
targetLayerName = activeLayer.name;
|
|
16433
16882
|
toast({
|
|
16434
|
-
title:
|
|
16435
|
-
description:
|
|
16883
|
+
title: labelsRef.current.toasts.featuresAdded,
|
|
16884
|
+
description: labelsRef.current.toasts.featuresAddedDescription({
|
|
16885
|
+
count: addedIds.length,
|
|
16886
|
+
layerName: shownLayerName(activeLayer, labelsRef.current.canvas)
|
|
16887
|
+
})
|
|
16436
16888
|
});
|
|
16437
16889
|
} else {
|
|
16438
16890
|
const layerName = `${addedIds.length} workspace features`;
|
|
@@ -16449,8 +16901,8 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
16449
16901
|
targetLayerId = newLayerId;
|
|
16450
16902
|
targetLayerName = layerName;
|
|
16451
16903
|
toast({
|
|
16452
|
-
title:
|
|
16453
|
-
description:
|
|
16904
|
+
title: labelsRef.current.toasts.layerCreated,
|
|
16905
|
+
description: labelsRef.current.toasts.featuresAddedDescription({ count: addedIds.length, layerName })
|
|
16454
16906
|
});
|
|
16455
16907
|
}
|
|
16456
16908
|
if (capped.dropped > 0) {
|
|
@@ -16471,8 +16923,8 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
16471
16923
|
}
|
|
16472
16924
|
} catch (error) {
|
|
16473
16925
|
toast({
|
|
16474
|
-
title:
|
|
16475
|
-
description: error instanceof Error ? error.message :
|
|
16926
|
+
title: labelsRef.current.toasts.searchFailed,
|
|
16927
|
+
description: error instanceof Error ? error.message : labelsRef.current.toasts.searchFailedDescription,
|
|
16476
16928
|
variant: "destructive"
|
|
16477
16929
|
});
|
|
16478
16930
|
}
|
|
@@ -16579,8 +17031,8 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
16579
17031
|
}
|
|
16580
17032
|
const totalFeatures = newLayers.reduce((sum, l) => sum + l.featureIds.length, 0);
|
|
16581
17033
|
toast({
|
|
16582
|
-
title:
|
|
16583
|
-
description:
|
|
17034
|
+
title: labelsRef.current.toasts.mapRestored,
|
|
17035
|
+
description: labelsRef.current.toasts.mapRestoredDescription({ layerCount: newLayers.length, featureCount: totalFeatures })
|
|
16584
17036
|
});
|
|
16585
17037
|
if (restoreDropped > 0) {
|
|
16586
17038
|
notifyFeatureCap({
|
|
@@ -16633,13 +17085,13 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
16633
17085
|
scheduleTimelineUpdate();
|
|
16634
17086
|
scheduleSync();
|
|
16635
17087
|
toast({
|
|
16636
|
-
title:
|
|
16637
|
-
description:
|
|
17088
|
+
title: labelsRef.current.toasts.featuresLoaded,
|
|
17089
|
+
description: labelsRef.current.toasts.featuresLoadedDescription(prepared.features.length)
|
|
16638
17090
|
});
|
|
16639
17091
|
} catch (error) {
|
|
16640
17092
|
toast({
|
|
16641
|
-
title:
|
|
16642
|
-
description: error instanceof Error ? error.message :
|
|
17093
|
+
title: labelsRef.current.toasts.loadFailed,
|
|
17094
|
+
description: error instanceof Error ? error.message : labelsRef.current.toasts.loadFailedDescription,
|
|
16643
17095
|
variant: "destructive"
|
|
16644
17096
|
});
|
|
16645
17097
|
}
|
|
@@ -16669,15 +17121,15 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
16669
17121
|
});
|
|
16670
17122
|
setLayers((prev) => [...prev]);
|
|
16671
17123
|
toast({
|
|
16672
|
-
title:
|
|
16673
|
-
description:
|
|
17124
|
+
title: labelsRef.current.toasts.saved,
|
|
17125
|
+
description: labelsRef.current.toasts.savedDescription
|
|
16674
17126
|
});
|
|
16675
17127
|
} catch (error) {
|
|
16676
|
-
const
|
|
16677
|
-
if (!
|
|
17128
|
+
const cancelled = error instanceof Error && error.message.includes("cancelled");
|
|
17129
|
+
if (!cancelled) {
|
|
16678
17130
|
toast({
|
|
16679
|
-
title:
|
|
16680
|
-
description:
|
|
17131
|
+
title: labelsRef.current.toasts.saveFailed,
|
|
17132
|
+
description: error instanceof Error ? error.message : labelsRef.current.toasts.saveFailedDescription,
|
|
16681
17133
|
variant: "destructive"
|
|
16682
17134
|
});
|
|
16683
17135
|
}
|
|
@@ -16705,8 +17157,8 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
16705
17157
|
});
|
|
16706
17158
|
if (allFeatures.length === 0) {
|
|
16707
17159
|
toast({
|
|
16708
|
-
title:
|
|
16709
|
-
description:
|
|
17160
|
+
title: labelsRef.current.toasts.noFeatures,
|
|
17161
|
+
description: labelsRef.current.toasts.noFeaturesDescription
|
|
16710
17162
|
});
|
|
16711
17163
|
return;
|
|
16712
17164
|
}
|
|
@@ -16746,26 +17198,18 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
16746
17198
|
});
|
|
16747
17199
|
} catch (error) {
|
|
16748
17200
|
toast({
|
|
16749
|
-
title:
|
|
16750
|
-
description: error
|
|
17201
|
+
title: labelsRef.current.toasts.geojsonLoadFailed,
|
|
17202
|
+
description: describeIngestFailure(error, labelsRef.current),
|
|
16751
17203
|
variant: "destructive"
|
|
16752
17204
|
});
|
|
16753
17205
|
return;
|
|
16754
17206
|
}
|
|
16755
17207
|
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
|
-
}
|
|
17208
|
+
toast({
|
|
17209
|
+
title: result.code === "empty" ? labelsRef.current.toasts.emptyGeojson : labelsRef.current.toasts.geojsonLoadFailed,
|
|
17210
|
+
description: describeIngestError(result, labelsRef.current.ingest),
|
|
17211
|
+
variant: "destructive"
|
|
17212
|
+
});
|
|
16769
17213
|
return;
|
|
16770
17214
|
}
|
|
16771
17215
|
if (result.kind === "enriched") {
|
|
@@ -16829,10 +17273,13 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
16829
17273
|
{ padding: 50, maxZoom: 16, duration: 1e3 }
|
|
16830
17274
|
);
|
|
16831
17275
|
}
|
|
16832
|
-
const reprojectMsg2 = reprojected ? ` (reprojected from ${sourceCRS})` : "";
|
|
16833
17276
|
toast({
|
|
16834
|
-
title:
|
|
16835
|
-
description:
|
|
17277
|
+
title: labelsRef.current.toasts.layerCreated,
|
|
17278
|
+
description: labelsRef.current.toasts.hpLayerCreatedDescription({
|
|
17279
|
+
layerName: newLayer.name,
|
|
17280
|
+
count: addedIds.length,
|
|
17281
|
+
reprojectedFrom: reprojected ? String(sourceCRS) : null
|
|
17282
|
+
})
|
|
16836
17283
|
});
|
|
16837
17284
|
return;
|
|
16838
17285
|
}
|
|
@@ -16840,16 +17287,16 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
16840
17287
|
let targetLayer = currentLayers.find((l) => l.id === requestedTargetLayerId);
|
|
16841
17288
|
if (((_a = targetLayer == null ? void 0 : targetLayer.metadata) == null ? void 0 : _a.dataViewing) === true) {
|
|
16842
17289
|
toast({
|
|
16843
|
-
title:
|
|
16844
|
-
description:
|
|
17290
|
+
title: labelsRef.current.toasts.dataViewingLayer,
|
|
17291
|
+
description: labelsRef.current.toasts.dataViewingLayerDescription,
|
|
16845
17292
|
variant: "destructive"
|
|
16846
17293
|
});
|
|
16847
17294
|
return;
|
|
16848
17295
|
}
|
|
16849
17296
|
if (isHostOwnedLayer(targetLayer)) {
|
|
16850
17297
|
toast({
|
|
16851
|
-
title:
|
|
16852
|
-
description:
|
|
17298
|
+
title: labelsRef.current.toasts.hostOwnedLayer,
|
|
17299
|
+
description: labelsRef.current.toasts.hostOwnedLayerDescription,
|
|
16853
17300
|
variant: "destructive"
|
|
16854
17301
|
});
|
|
16855
17302
|
return;
|
|
@@ -16862,8 +17309,8 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
16862
17309
|
}
|
|
16863
17310
|
if (!targetLayer) {
|
|
16864
17311
|
toast({
|
|
16865
|
-
title:
|
|
16866
|
-
description:
|
|
17312
|
+
title: labelsRef.current.toasts.noLayerToLoadInto,
|
|
17313
|
+
description: labelsRef.current.toasts.noLayerToLoadIntoDescription,
|
|
16867
17314
|
variant: "destructive"
|
|
16868
17315
|
});
|
|
16869
17316
|
return;
|
|
@@ -16924,10 +17371,13 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
16924
17371
|
updateFeatureCount();
|
|
16925
17372
|
scheduleTimelineUpdate();
|
|
16926
17373
|
scheduleSync();
|
|
16927
|
-
const reprojectMsg = reprojected ? ` (reprojected from ${sourceCRS})` : "";
|
|
16928
17374
|
toast({
|
|
16929
|
-
title:
|
|
16930
|
-
description:
|
|
17375
|
+
title: labelsRef.current.toasts.geojsonLoaded,
|
|
17376
|
+
description: labelsRef.current.toasts.geojsonLoadedDescription({
|
|
17377
|
+
count: appendFeatures.length,
|
|
17378
|
+
reprojectedFrom: reprojected ? String(sourceCRS) : null,
|
|
17379
|
+
layerHidden: !(targetLayer == null ? void 0 : targetLayer.visible)
|
|
17380
|
+
})
|
|
16931
17381
|
});
|
|
16932
17382
|
}, [saveStateForUndo, updateFeatureCount, scheduleTimelineUpdate, scheduleSync, restoreEnrichedGeoJSON, toast, interceptGeoJSONFileLoad, ingestWithProgress, notifyFeatureCap, withAutoColor]);
|
|
16933
17383
|
const handleFileChange = useCallback((e) => {
|
|
@@ -16949,8 +17399,8 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
16949
17399
|
result = await ingestWithProgress(name, input, { idStrategy: "layer-index", layerId });
|
|
16950
17400
|
} catch (error) {
|
|
16951
17401
|
toast({
|
|
16952
|
-
title:
|
|
16953
|
-
description: error
|
|
17402
|
+
title: labelsRef.current.toasts.geojsonLoadFailed,
|
|
17403
|
+
description: describeIngestFailure(error, labelsRef.current),
|
|
16954
17404
|
variant: "destructive"
|
|
16955
17405
|
});
|
|
16956
17406
|
return;
|
|
@@ -16958,8 +17408,8 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
16958
17408
|
if (!map.current) return;
|
|
16959
17409
|
if (result.kind === "error") {
|
|
16960
17410
|
toast({
|
|
16961
|
-
title:
|
|
16962
|
-
description: result.
|
|
17411
|
+
title: labelsRef.current.toasts.geojsonLoadFailed,
|
|
17412
|
+
description: describeIngestError(result, labelsRef.current.ingest),
|
|
16963
17413
|
variant: "destructive"
|
|
16964
17414
|
});
|
|
16965
17415
|
return;
|
|
@@ -17018,10 +17468,13 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
17018
17468
|
features: addedIds.length,
|
|
17019
17469
|
totalMs: Math.round(performance.now() - startedAt)
|
|
17020
17470
|
});
|
|
17021
|
-
const reprojectMsg = reprojected ? ` (reprojected from ${sourceCRS})` : "";
|
|
17022
17471
|
toast({
|
|
17023
|
-
title:
|
|
17024
|
-
description:
|
|
17472
|
+
title: labelsRef.current.toasts.layerAdded,
|
|
17473
|
+
description: labelsRef.current.toasts.layerAddedDescription({
|
|
17474
|
+
layerName: newLayer.name,
|
|
17475
|
+
count: addedIds.length,
|
|
17476
|
+
reprojectedFrom: reprojected ? String(sourceCRS) : null
|
|
17477
|
+
})
|
|
17025
17478
|
});
|
|
17026
17479
|
}, [saveStateForUndo, updateFeatureCount, scheduleTimelineUpdate, scheduleSync, restoreEnrichedGeoJSON, toast, interceptGeoJSONFileLoad, ingestWithProgress, notifyFeatureCap, withAutoColor]);
|
|
17027
17480
|
const handleDropGeoJSON = useCallback((name, data) => {
|
|
@@ -17306,7 +17759,8 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
17306
17759
|
mapInstance,
|
|
17307
17760
|
sourceId,
|
|
17308
17761
|
categoryValues,
|
|
17309
|
-
categoryColorMap
|
|
17762
|
+
categoryColorMap,
|
|
17763
|
+
labelsRef.current.canvas.clusterOther
|
|
17310
17764
|
);
|
|
17311
17765
|
clusterPieManagers.current.set(layer.id, pieManager);
|
|
17312
17766
|
} else {
|
|
@@ -17482,18 +17936,18 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
17482
17936
|
/* @__PURE__ */ jsx("div", { className: "p-4 border-b border-border", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
17483
17937
|
/* @__PURE__ */ jsx("div", { className: "p-2 rounded-full bg-destructive/10", children: /* @__PURE__ */ jsx(AlertTriangle, { className: "w-6 h-6 text-destructive" }) }),
|
|
17484
17938
|
/* @__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:
|
|
17939
|
+
/* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold", children: labels.canvas.mapInitFailedTitle }),
|
|
17940
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: labels.canvas.mapInitFailedSubtitle })
|
|
17487
17941
|
] })
|
|
17488
17942
|
] }) }),
|
|
17489
17943
|
/* @__PURE__ */ jsxs("div", { className: "p-4 space-y-4", children: [
|
|
17490
17944
|
/* @__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:
|
|
17945
|
+
/* @__PURE__ */ jsx(Button, { type: "primary", onClick: () => window.location.reload(), className: "w-full", "data-testid": "button-reload", children: labels.canvas.refreshPage })
|
|
17492
17946
|
] })
|
|
17493
17947
|
] }) });
|
|
17494
17948
|
}
|
|
17495
17949
|
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: [
|
|
17950
|
+
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
17951
|
/* @__PURE__ */ jsx(
|
|
17498
17952
|
"div",
|
|
17499
17953
|
{
|
|
@@ -17780,9 +18234,9 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
17780
18234
|
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
18235
|
"data-testid": "measure-result-panel",
|
|
17782
18236
|
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:
|
|
18237
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: measureMode === "distance" ? labels.canvas.measureDistance : labels.canvas.measureArea }),
|
|
18238
|
+
/* @__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) }),
|
|
18239
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: labels.canvas.measureClearHint })
|
|
17786
18240
|
] })
|
|
17787
18241
|
}
|
|
17788
18242
|
),
|
|
@@ -17791,7 +18245,7 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
17791
18245
|
{
|
|
17792
18246
|
className: "absolute left-4 z-[200] transition-all",
|
|
17793
18247
|
style: { bottom: timelineEnabled ? timebarHeight + TIMEBAR_BOTTOM_OFFSET + 8 : 48 },
|
|
17794
|
-
children: /* @__PURE__ */ jsx(Tooltip, { title:
|
|
18248
|
+
children: /* @__PURE__ */ jsx(Tooltip, { title: labels.canvas.timelineToggle, placement: "right", children: /* @__PURE__ */ jsx(
|
|
17795
18249
|
Button,
|
|
17796
18250
|
{
|
|
17797
18251
|
type: "default",
|
|
@@ -17799,7 +18253,7 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
17799
18253
|
onClick: () => timelineStoreApi.getState().setEnabled(!timelineEnabled),
|
|
17800
18254
|
disabled: !isMapLoaded,
|
|
17801
18255
|
className: `!w-10 !h-10 !min-w-0 !p-0 bg-background shadow-lg ${timelineEnabled ? "bg-primary/10" : ""}`,
|
|
17802
|
-
"aria-label":
|
|
18256
|
+
"aria-label": labels.timebar.toggle,
|
|
17803
18257
|
"aria-pressed": timelineEnabled,
|
|
17804
18258
|
"data-testid": "button-toggle-timeline"
|
|
17805
18259
|
}
|
|
@@ -17807,18 +18261,15 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
17807
18261
|
}
|
|
17808
18262
|
),
|
|
17809
18263
|
enableLayers && /* @__PURE__ */ jsxs("div", { className: "absolute top-4 right-4 z-[200] flex items-center gap-2", children: [
|
|
17810
|
-
getMapUnsavedCount() > 0 && /* @__PURE__ */
|
|
18264
|
+
getMapUnsavedCount() > 0 && /* @__PURE__ */ jsx(
|
|
17811
18265
|
"div",
|
|
17812
18266
|
{
|
|
17813
18267
|
className: "px-2 py-1 bg-orange-500 text-white text-xs font-medium rounded-md shadow-lg",
|
|
17814
18268
|
"data-testid": "badge-unsaved-count",
|
|
17815
|
-
children:
|
|
17816
|
-
getMapUnsavedCount(),
|
|
17817
|
-
" unsaved"
|
|
17818
|
-
]
|
|
18269
|
+
children: labels.canvas.unsavedCount(getMapUnsavedCount())
|
|
17819
18270
|
}
|
|
17820
18271
|
),
|
|
17821
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
18272
|
+
/* @__PURE__ */ jsx(Tooltip, { title: labels.canvas.layersToggle, placement: "left", children: /* @__PURE__ */ jsx(
|
|
17822
18273
|
Button,
|
|
17823
18274
|
{
|
|
17824
18275
|
type: "default",
|
|
@@ -17826,7 +18277,7 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
17826
18277
|
onClick: handleToggleLayers,
|
|
17827
18278
|
disabled: !isMapLoaded,
|
|
17828
18279
|
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":
|
|
18280
|
+
"aria-label": labels.canvas.layersToggleAriaLabel,
|
|
17830
18281
|
"aria-pressed": showLayers,
|
|
17831
18282
|
"data-testid": "button-toggle-layers"
|
|
17832
18283
|
}
|
|
@@ -17978,22 +18429,23 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
|
|
|
17978
18429
|
"data-testid": "input-file-geojson"
|
|
17979
18430
|
}
|
|
17980
18431
|
)
|
|
17981
|
-
] }) }) }) });
|
|
18432
|
+
] }) }) }) }) });
|
|
17982
18433
|
});
|
|
17983
18434
|
function ActionPanel({ onSave, onLoad, disabled }) {
|
|
18435
|
+
const { actionPanel: labels } = useMapLabels();
|
|
17984
18436
|
return /* @__PURE__ */ jsxs(
|
|
17985
18437
|
"div",
|
|
17986
18438
|
{
|
|
17987
18439
|
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
18440
|
role: "group",
|
|
17989
|
-
"aria-label":
|
|
18441
|
+
"aria-label": labels.groupLabel,
|
|
17990
18442
|
"data-testid": "panel-actions",
|
|
17991
18443
|
children: [
|
|
17992
18444
|
/* @__PURE__ */ jsx(
|
|
17993
18445
|
Tooltip,
|
|
17994
18446
|
{
|
|
17995
18447
|
title: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
17996
|
-
/* @__PURE__ */ jsx("span", { children:
|
|
18448
|
+
/* @__PURE__ */ jsx("span", { children: labels.saveTooltip }),
|
|
17997
18449
|
/* @__PURE__ */ jsx("kbd", { className: "px-1.5 py-0.5 text-xs font-mono bg-white/20 rounded", children: "S" })
|
|
17998
18450
|
] }),
|
|
17999
18451
|
children: /* @__PURE__ */ jsxs(
|
|
@@ -18003,28 +18455,28 @@ function ActionPanel({ onSave, onLoad, disabled }) {
|
|
|
18003
18455
|
onClick: onSave,
|
|
18004
18456
|
disabled,
|
|
18005
18457
|
className: "gap-2 flex items-center",
|
|
18006
|
-
"aria-label":
|
|
18458
|
+
"aria-label": labels.saveAriaLabel,
|
|
18007
18459
|
"data-testid": "button-save-geojson",
|
|
18008
18460
|
children: [
|
|
18009
18461
|
/* @__PURE__ */ jsx(Download, { className: "w-4 h-4" }),
|
|
18010
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children:
|
|
18462
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: labels.save })
|
|
18011
18463
|
]
|
|
18012
18464
|
}
|
|
18013
18465
|
)
|
|
18014
18466
|
}
|
|
18015
18467
|
),
|
|
18016
|
-
/* @__PURE__ */ jsx(Tooltip, { title:
|
|
18468
|
+
/* @__PURE__ */ jsx(Tooltip, { title: labels.loadTooltip, children: /* @__PURE__ */ jsxs(
|
|
18017
18469
|
Button,
|
|
18018
18470
|
{
|
|
18019
18471
|
type: "default",
|
|
18020
18472
|
onClick: onLoad,
|
|
18021
18473
|
disabled,
|
|
18022
18474
|
className: "gap-2 flex items-center",
|
|
18023
|
-
"aria-label":
|
|
18475
|
+
"aria-label": labels.loadAriaLabel,
|
|
18024
18476
|
"data-testid": "button-load-geojson",
|
|
18025
18477
|
children: [
|
|
18026
18478
|
/* @__PURE__ */ jsx(Upload, { className: "w-4 h-4" }),
|
|
18027
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children:
|
|
18479
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: labels.load })
|
|
18028
18480
|
]
|
|
18029
18481
|
}
|
|
18030
18482
|
) })
|
|
@@ -18987,6 +19439,7 @@ export {
|
|
|
18987
19439
|
ActionPanel,
|
|
18988
19440
|
ClusterPieManager,
|
|
18989
19441
|
ColorPickerPopover,
|
|
19442
|
+
DEFAULT_MAP_LABELS,
|
|
18990
19443
|
DEFAULT_MAX_FEATURES_PER_LAYER,
|
|
18991
19444
|
DebugSidebar,
|
|
18992
19445
|
DrawingToolbar,
|