feat(map): add persisted ghost pin sandbox

This commit is contained in:
DCCONSTRUCTIONS
2026-07-29 18:29:13 +03:00
parent b91d3b913e
commit 0c3855eac5
10 changed files with 1222 additions and 13 deletions
+34 -1
View File
@@ -22,7 +22,7 @@ after(async () => {
function serverDocument(overrides = {}) {
return {
schema_version: "missioncore.map-view/v2",
schema_version: "missioncore.map-view/v3",
revision: 0,
view: {
camera: {
@@ -89,6 +89,36 @@ function serverDocument(overrides = {}) {
grid: true,
targets: true,
},
ghost_pins: {
count: 12,
radius_meters: 5000,
simulation_enabled: false,
anchor: null,
positions: [],
presentation: {
color: "#6fb5fb",
opacity: 0.9,
stem_height_meters: 1500,
head_size_px: 6,
stem_width_px: 3,
outline_color: "#0c0d12",
outline_opacity: 0.6,
outline_width_px: 1,
label_mode: "attributes",
label_font_weight: 600,
label_size_px: 13,
label_color: "#f5f5f5",
label_background_color: "#0c0d12",
label_background_opacity: 0.86,
label_padding_x: 8,
label_padding_y: 5,
label_offset_x: 15,
label_offset_y: 10,
label_max_length: 48,
label_hide_camera_height_meters: 70000,
target_hide_camera_height_meters: 100000,
},
},
},
...overrides,
};
@@ -103,6 +133,8 @@ test("map view starts from the canonical Foundry camera without a fabricated sub
assert.equal(document.view.selectedSubjectId, null);
assert.equal(document.view.cacheIntent.enabled, true);
assert.equal(document.view.cacheIntent.noOverwrite, true);
assert.equal(document.view.ghostPins.count, 12);
assert.equal(document.view.ghostPins.positions.length, 0);
});
test("map view decodes and re-encodes the complete versioned contract", () => {
@@ -128,6 +160,7 @@ test("map view decodes and re-encodes the complete versioned contract", () => {
assert.equal(decoded.view.inspectorOpenSections[0], "camera");
assert.equal(encoded.view.camera.latitude, 55.7558);
assert.equal(encoded.view.cache_intent.no_overwrite, true);
assert.equal(encoded.view.ghost_pins.presentation.stem_height_meters, 1500);
assert.equal("schema_version" in encoded, false);
});