@geogirafe/lib-geoportal 1.2.0-dev.2791589363 → 1.2.0-dev.2795341874

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/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "name": "GeoGirafe PSC",
6
6
  "url": "https://doc.geogirafe.org"
7
7
  },
8
- "version": "1.2.0-dev.2791589363",
8
+ "version": "1.2.0-dev.2795341874",
9
9
  "type": "module",
10
10
  "engines": {
11
11
  "node": ">=20.19.0"
@@ -1 +1 @@
1
- {"version":"1.2.0-dev.2791589363", "build":"2791589363", "date":"26/08/2026"}
1
+ {"version":"1.2.0-dev.2795341874", "build":"2795341874", "date":"27/08/2026"}
@@ -22,6 +22,7 @@ declare class LocalFileManager extends GirafeSingleton {
22
22
  private splitIntoSimpleGeometries;
23
23
  private handleUnsupportedFiles;
24
24
  private validateAndCompleteFeatures;
25
+ private buildFeatureStyle;
25
26
  addLayer(layerFile: LayerLocalFile): void;
26
27
  getLayer(layerFile: LayerLocalFile): VectorLayer<VectorSource<Feature<Geometry, {
27
28
  [x: string]: any;
@@ -5,6 +5,7 @@ import DragAndDrop from 'ol/interaction/DragAndDrop.js';
5
5
  import { GPX, GeoJSON, IGC, KML, TopoJSON } from 'ol/format.js';
6
6
  import { Vector as VectorLayer } from 'ol/layer.js';
7
7
  import { Vector as VectorSource } from 'ol/source.js';
8
+ import { Circle, Fill, Stroke, Style } from 'ol/style.js';
8
9
  import LayerLocalFile from '../../models/layers/layerlocalfile.js';
9
10
  import { extend, intersects } from 'ol/extent.js';
10
11
  import { applyFeaturesToSelection } from '../utils/utils.js';
@@ -17,7 +18,7 @@ class LocalFileManager extends GirafeSingleton {
17
18
  supportedFileExtensions = ['gpx', 'geojson', 'igc', 'kml', 'topojson', 'json'];
18
19
  activeLayers = {};
19
20
  // Keeps track of which LayerLocalFile a given feature belongs to, so its layer name can be
20
- // used as a display fallback when the feature has no WFS-style id
21
+ // used as a display fallback when the feature has no WFS-style id
21
22
  featureLayerMap = new WeakMap();
22
23
  constructor(context) {
23
24
  super(context);
@@ -170,12 +171,25 @@ class LocalFileManager extends GirafeSingleton {
170
171
  globalExtent: globalExtent
171
172
  };
172
173
  }
174
+ buildFeatureStyle() {
175
+ const drawingConfig = this.context.configManager.Config.drawing;
176
+ return new Style({
177
+ fill: new Fill({ color: drawingConfig.defaultFillColor }),
178
+ stroke: new Stroke({ color: drawingConfig.defaultStrokeColor, width: drawingConfig.defaultStrokeWidth }),
179
+ image: new Circle({
180
+ radius: 10,
181
+ fill: new Fill({ color: drawingConfig.defaultFillColor }),
182
+ stroke: new Stroke({ color: drawingConfig.defaultStrokeColor, width: drawingConfig.defaultStrokeWidth })
183
+ })
184
+ });
185
+ }
173
186
  addLayer(layerFile) {
174
187
  const vectorSource = new VectorSource({
175
188
  features: layerFile._features
176
189
  });
177
190
  const olayer = new VectorLayer({
178
- source: vectorSource
191
+ source: vectorSource,
192
+ style: this.buildFeatureStyle()
179
193
  });
180
194
  this.map.addLayer(olayer);
181
195
  this.activeLayers[layerFile.treeItemId] = { layerFile: layerFile, olayer: olayer };