@smartnet360/svelte-components 0.0.78 → 0.0.79
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.
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
import type { Map as MapboxMap } from 'mapbox-gl';
|
|
8
8
|
export interface SelectedFeature {
|
|
9
9
|
id: string;
|
|
10
|
+
siteId?: string;
|
|
11
|
+
cellName?: string;
|
|
10
12
|
layerId?: string;
|
|
11
13
|
properties?: Record<string, any>;
|
|
12
14
|
}
|
|
@@ -39,11 +41,11 @@ export declare class FeatureSelectionStore {
|
|
|
39
41
|
/**
|
|
40
42
|
* Toggle a feature in the selection
|
|
41
43
|
*/
|
|
42
|
-
toggleFeatureSelection(id: string, layerId?: string, properties?: Record<string, any
|
|
44
|
+
toggleFeatureSelection(id: string, layerId?: string, properties?: Record<string, any>, siteId?: string, cellName?: string): void;
|
|
43
45
|
/**
|
|
44
46
|
* Add a feature to the selection
|
|
45
47
|
*/
|
|
46
|
-
addFeatureSelection(id: string, layerId?: string, properties?: Record<string, any
|
|
48
|
+
addFeatureSelection(id: string, layerId?: string, properties?: Record<string, any>, siteId?: string, cellName?: string): void;
|
|
47
49
|
/**
|
|
48
50
|
* Remove a feature from the selection
|
|
49
51
|
*/
|
|
@@ -40,9 +40,11 @@ export class FeatureSelectionStore {
|
|
|
40
40
|
id: feature.id
|
|
41
41
|
});
|
|
42
42
|
const featureId = feature.properties?.id || feature.id;
|
|
43
|
+
const siteId = feature.properties?.siteId;
|
|
44
|
+
const cellName = feature.properties?.cellName;
|
|
43
45
|
if (featureId) {
|
|
44
|
-
console.log('[FeatureSelection] Found feature with ID:', featureId);
|
|
45
|
-
this.toggleFeatureSelection(String(featureId), feature.layer?.id, feature.properties || undefined);
|
|
46
|
+
console.log('[FeatureSelection] Found feature with ID:', featureId, 'siteId:', siteId, 'cellName:', cellName);
|
|
47
|
+
this.toggleFeatureSelection(String(featureId), feature.layer?.id, feature.properties || undefined, siteId, cellName);
|
|
46
48
|
break; // Only select the topmost feature
|
|
47
49
|
}
|
|
48
50
|
else {
|
|
@@ -76,7 +78,7 @@ export class FeatureSelectionStore {
|
|
|
76
78
|
/**
|
|
77
79
|
* Toggle a feature in the selection
|
|
78
80
|
*/
|
|
79
|
-
toggleFeatureSelection(id, layerId, properties) {
|
|
81
|
+
toggleFeatureSelection(id, layerId, properties, siteId, cellName) {
|
|
80
82
|
const index = this.selectedFeatures.findIndex(f => f.id === id);
|
|
81
83
|
if (index >= 0) {
|
|
82
84
|
// Remove if already selected
|
|
@@ -84,16 +86,16 @@ export class FeatureSelectionStore {
|
|
|
84
86
|
}
|
|
85
87
|
else {
|
|
86
88
|
// Add if not selected
|
|
87
|
-
this.selectedFeatures.push({ id, layerId, properties });
|
|
89
|
+
this.selectedFeatures.push({ id, layerId, properties, siteId, cellName });
|
|
88
90
|
}
|
|
89
91
|
}
|
|
90
92
|
/**
|
|
91
93
|
* Add a feature to the selection
|
|
92
94
|
*/
|
|
93
|
-
addFeatureSelection(id, layerId, properties) {
|
|
95
|
+
addFeatureSelection(id, layerId, properties, siteId, cellName) {
|
|
94
96
|
const exists = this.selectedFeatures.some(f => f.id === id);
|
|
95
97
|
if (!exists) {
|
|
96
|
-
this.selectedFeatures.push({ id, layerId, properties });
|
|
98
|
+
this.selectedFeatures.push({ id, layerId, properties, siteId, cellName });
|
|
97
99
|
}
|
|
98
100
|
}
|
|
99
101
|
/**
|