From 95a28ec89bc77d10a119a96f1de7dd52c6afbb32 Mon Sep 17 00:00:00 2001 From: Joseph Birkner Date: Thu, 29 Aug 2024 17:25:17 +0200 Subject: [PATCH] Fix merged feature tile contributions. --- erdblick_app/app/visualization.model.ts | 9 +++++++++ libs/core/src/bindings.cpp | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/erdblick_app/app/visualization.model.ts b/erdblick_app/app/visualization.model.ts index 423c9a21..15084d91 100644 --- a/erdblick_app/app/visualization.model.ts +++ b/erdblick_app/app/visualization.model.ts @@ -233,7 +233,11 @@ export class TileVisualization { } }); } + this.primitiveCollection = visualization.primitiveCollection(); + for (const [mapLayerStyleRuleId, mergedPointVisualizations] of Object.entries(visualization.mergedPointFeatures())) { + this.pointMergeService.insert(mergedPointVisualizations as MergedPointVisualization[], this.tile.tileId, mapLayerStyleRuleId); + } visualization.delete(); return true; }); @@ -265,6 +269,11 @@ export class TileVisualization { return; } + // Remove point-merge contributions that were made by this map-layer+style visualization combo. + this.pointMergeService.remove( + this.tile.tileId, + `${this.tile.mapName}:${this.tile.layerName}:${this.style.name()}`); + if (this.primitiveCollection) { viewer.scene.primitives.remove(this.primitiveCollection); if (!this.primitiveCollection.isDestroyed()) diff --git a/libs/core/src/bindings.cpp b/libs/core/src/bindings.cpp index d627b618..a6dec682 100644 --- a/libs/core/src/bindings.cpp +++ b/libs/core/src/bindings.cpp @@ -371,7 +371,8 @@ EMSCRIPTEN_BINDINGS(erdblick) ////////// FeatureLayerStyle em::register_vector("FeatureStyleOptions"); em::class_("FeatureLayerStyle").constructor() - .function("options", &FeatureLayerStyle::options, em::allow_raw_pointers()); + .function("options", &FeatureLayerStyle::options, em::allow_raw_pointers()) + .function("name", &FeatureLayerStyle::name); em::enum_("SourceDataAddressFormat") .value("UNKNOWN", mapget::TileSourceDataLayer::SourceDataAddressFormat::Unknown)