@igo2/geo 21.0.0-next.11 → 21.0.0-next.13

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.
@@ -4235,10 +4235,6 @@ class GeoDB {
4235
4235
  }
4236
4236
  }));
4237
4237
  }
4238
- /** @deprecated Use delete method instead*/
4239
- deleteByKey(key) {
4240
- return this.delete(key);
4241
- }
4242
4238
  getRegionCountByID(id) {
4243
4239
  return this.getRegionByID(id).pipe(switchMap((datas) => {
4244
4240
  return of(datas.length);
@@ -4345,10 +4341,6 @@ class LayerDB {
4345
4341
  }
4346
4342
  }));
4347
4343
  }
4348
- /** @deprecated Use delete method instead*/
4349
- deleteByKey(key) {
4350
- return this.delete(key);
4351
- }
4352
4344
  /**
4353
4345
  * This method retrive all idb layer definition
4354
4346
  * @param layerId
@@ -5796,7 +5788,7 @@ class PrintService {
5796
5788
  let textProjScale = '';
5797
5789
  if (options.showProjection === true) {
5798
5790
  const projText = translate.instant('igo.geo.printForm.projection');
5799
- textProjScale += projText + ': ' + map.projection;
5791
+ textProjScale += projText + ': ' + map.projectionCode;
5800
5792
  }
5801
5793
  if (options.showScale === true) {
5802
5794
  if (options.showProjection === true) {
@@ -6239,7 +6231,8 @@ class PrintService {
6239
6231
  let projectionScaleText = '';
6240
6232
  if (projection !== false) {
6241
6233
  const projText = translate.instant('igo.geo.printForm.projection');
6242
- projectionScaleText = projText + ': ' + map.projection + ' ';
6234
+ projectionScaleText =
6235
+ projText + ': ' + map.projectionCode + ' ';
6243
6236
  }
6244
6237
  if (scale !== false) {
6245
6238
  const scaleText = translate.instant('igo.geo.printForm.scale');
@@ -6292,7 +6285,7 @@ class PrintService {
6292
6285
  let fileNameWithExt = 'map.' + format;
6293
6286
  if (format.toLowerCase() === 'tiff') {
6294
6287
  fileNameWithExt =
6295
- 'map' + map.projection.replace(':', '_') + '.' + format;
6288
+ 'map' + map.projectionCode.replace(':', '_') + '.' + format;
6296
6289
  }
6297
6290
  try {
6298
6291
  // Save the canvas as file
@@ -7894,7 +7887,7 @@ class FeatureStore extends EntityStore {
7894
7887
  setLayerFeatures(features, motion = FeatureMotion.Default, viewScale, areaRatio, getId) {
7895
7888
  getId = getId ? getId : getEntityId;
7896
7889
  this.checkLayer();
7897
- const olFeatures = features.map((feature) => featureToOl(feature, this.map.projection, getId));
7890
+ const olFeatures = features.map((feature) => featureToOl(feature, this.map.projectionCode, getId));
7898
7891
  this.setLayerOlFeatures(olFeatures, motion, viewScale, areaRatio);
7899
7892
  }
7900
7893
  /**
@@ -7905,7 +7898,7 @@ class FeatureStore extends EntityStore {
7905
7898
  this.checkLayer();
7906
7899
  const features = olFeatures.map((olFeature) => {
7907
7900
  olFeature.set('_featureStore', this, true);
7908
- return featureFromOl(olFeature, this.layer.map.projection);
7901
+ return featureFromOl(olFeature, this.layer.map.projectionCode);
7909
7902
  });
7910
7903
  this.load(features);
7911
7904
  }
@@ -7952,7 +7945,7 @@ class FeatureStore extends EntityStore {
7952
7945
  const extent = olextent.createEmpty();
7953
7946
  const olFeatures = [];
7954
7947
  features.forEach((feature) => {
7955
- olFeatures.push(featureToOl(feature, this.map.projection));
7948
+ olFeatures.push(featureToOl(feature, this.map.projectionCode));
7956
7949
  });
7957
7950
  const featuresExtent = computeOlFeaturesExtent(olFeatures, this.map.viewProjection);
7958
7951
  olextent.extend(extent, featuresExtent);
@@ -9809,7 +9802,7 @@ class DirectionsInputsComponent {
9809
9802
  * @param {Stop} stop - The stop to update with the new coordinates and text.
9810
9803
  */
9811
9804
  useCoordinatesAsStop(coordinates, stop) {
9812
- const projectedCoordinates = olproj.transform(coordinates, this.stopsFeatureStore().layer.map?.projection, this.projection());
9805
+ const projectedCoordinates = olproj.transform(coordinates, this.stopsFeatureStore().layer.map?.projectionCode, this.projection());
9813
9806
  const roundedCoordinates = roundCoordTo(projectedCoordinates, this.coordRoundedDecimals());
9814
9807
  stop.text = roundCoordToString(projectedCoordinates, this.coordRoundedDecimals()).join(', ');
9815
9808
  stop.coordinates = roundedCoordinates;
@@ -9941,14 +9934,14 @@ class DirectionsResultsComponent {
9941
9934
  const map = stepsFeatureStore.layer.map;
9942
9935
  const vertexId = 'vertex';
9943
9936
  const geometry4326 = new olgeom.LineString(coordinates);
9944
- const geometryMapProjection = geometry4326.transform('EPSG:4326', map?.projection);
9937
+ const geometryMapProjection = geometry4326.transform('EPSG:4326', map?.projectionCode);
9945
9938
  const routeSegmentCoordinates = geometryMapProjection.getCoordinates();
9946
9939
  const lastPointCoordinates = routeSegmentCoordinates[0];
9947
9940
  const lastPointGeometry = new olgeom.Point(lastPointCoordinates);
9948
9941
  const lastPointFeature = new OlFeature({
9949
9942
  geometry: lastPointGeometry
9950
9943
  });
9951
- const projection = map?.projection;
9944
+ const projection = map?.projectionCode;
9952
9945
  const geojsonGeom = new OlGeoJSON().writeGeometryObject(lastPointGeometry, {
9953
9946
  featureProjection: projection,
9954
9947
  dataProjection: projection
@@ -10555,7 +10548,7 @@ class CapabilitiesService {
10555
10548
  isExtentInGeographic = false;
10556
10549
  }
10557
10550
  const extent = isExtentInGeographic
10558
- ? olproj.transformExtent(layer.EX_GeographicBoundingBox, 'EPSG:4326', this.mapService.getMap()?.projection)
10551
+ ? olproj.transformExtent(layer.EX_GeographicBoundingBox, 'EPSG:4326', this.mapService.getMap()?.projectionCode)
10559
10552
  : undefined;
10560
10553
  let queryFormat;
10561
10554
  const queryFormatMimeTypePriority = [
@@ -14102,7 +14095,7 @@ class MapGeolocationController extends MapController {
14102
14095
  const edgeRatios = position?.speed > 12.5
14103
14096
  ? [0.25, 0.25, 0.25, 0.25]
14104
14097
  : [0.15, 0.1, 0.1, 0.1];
14105
- const areOutOfView = featuresAreOutOfView(this.map.getExtent(), featuresExtent, edgeRatios);
14098
+ const areOutOfView = featuresAreOutOfView(this.map.viewController.getExtent(), featuresExtent, edgeRatios);
14106
14099
  let motion = this.followPosition && areOutOfView
14107
14100
  ? FeatureMotion.Move
14108
14101
  : FeatureMotion.None;
@@ -14495,10 +14488,6 @@ class IgoMap {
14495
14488
  defaultOptions = {
14496
14489
  controls: { attribution: false }
14497
14490
  };
14498
- /** @deprecated use projectionCode */
14499
- get projection() {
14500
- return this.projectionCode;
14501
- }
14502
14491
  get viewProjection() {
14503
14492
  return this.viewController.getOlProjection();
14504
14493
  }
@@ -14628,27 +14617,6 @@ class IgoMap {
14628
14617
  this.ol.addControl(control);
14629
14618
  });
14630
14619
  }
14631
- /**
14632
- * @deprecated
14633
- * TODO: Move to ViewController and update every place it's used
14634
- */
14635
- getCenter(projection) {
14636
- return this.viewController.getCenter(projection);
14637
- }
14638
- /**
14639
- * @deprecated
14640
- * TODO: Move to ViewController and update every place it's used
14641
- */
14642
- getExtent(projection) {
14643
- return this.viewController.getExtent(projection);
14644
- }
14645
- /**
14646
- * @deprecated
14647
- * TODO: Move to ViewController and update every place it's used
14648
- */
14649
- getZoom() {
14650
- return this.viewController.getZoom();
14651
- }
14652
14620
  /** @deprecated find a way to remove this method. For now we discourage to use it until we find the way to remove it */
14653
14621
  getLayerByOlUId(olUId) {
14654
14622
  return this.layerController.all.find((layer) => getUid(layer.ol) && getUid(layer.ol) === olUId);
@@ -14672,9 +14640,8 @@ class MapBase {
14672
14640
  options;
14673
14641
  // Getter
14674
14642
  layerController;
14675
- projection;
14676
- viewProjection;
14677
14643
  projectionCode;
14644
+ viewProjection;
14678
14645
  }
14679
14646
 
14680
14647
  class MapBrowserComponent {
@@ -14871,7 +14838,7 @@ class PointerPositionDirective {
14871
14838
  return this.component.map();
14872
14839
  }
14873
14840
  get mapProjection() {
14874
- return this.component.map().projection;
14841
+ return this.component.map().projectionCode;
14875
14842
  }
14876
14843
  /**
14877
14844
  * Start listening to pointermove
@@ -15314,9 +15281,9 @@ function detectFileEPSG(options) {
15314
15281
  const text = reader.result;
15315
15282
  const lines = text.split('\n');
15316
15283
  for (let line = 0; line <= nbLines; line++) {
15317
- const epsg = lines[line].match(/EPSG:\d{0,6}/gm);
15284
+ const epsg = lines[line].match(/EPSG:{1,2}\d{1,6}/gm);
15318
15285
  if (epsg !== null && epsg.length) {
15319
- resolve(epsg[0]);
15286
+ resolve(epsg[0].replace(/::/g, ':'));
15320
15287
  break;
15321
15288
  }
15322
15289
  else {
@@ -16974,7 +16941,7 @@ class SearchService {
16974
16941
  return [];
16975
16942
  }
16976
16943
  this.searchTerm.set(term);
16977
- const proj = this.mapService.getMap()?.projection || 'EPSG:3857';
16944
+ const proj = this.mapService.getMap()?.projectionCode || 'EPSG:3857';
16978
16945
  const response = stringToLonLat(term, proj, {
16979
16946
  forceNA: options.forceNA
16980
16947
  });
@@ -17212,7 +17179,7 @@ class DirectionsComponent {
17212
17179
  });
17213
17180
  this.selectedRoute.on('select', (evt) => {
17214
17181
  if (this.focusOnStop === false) {
17215
- const selectCoordinates = olproj.transform(evt.mapBrowserEvent.coordinate, this.routesFeatureStore().layer.map?.projection, this.projection);
17182
+ const selectCoordinates = olproj.transform(evt.mapBrowserEvent.coordinate, this.routesFeatureStore().layer.map?.projectionCode, this.projection);
17216
17183
  const addedStop = addStopToStore(this.stopsStore());
17217
17184
  addedStop.text = roundCoordToString(selectCoordinates, this.coordRoundedDecimals()).join(', ');
17218
17185
  addedStop.coordinates = [selectCoordinates[0], selectCoordinates[1]];
@@ -17231,7 +17198,7 @@ class DirectionsComponent {
17231
17198
  }
17232
17199
  const firstFeature = features.getArray()[0];
17233
17200
  const translatedStopId = firstFeature.getId();
17234
- const translationCoordinates = olproj.transform(firstFeature.getGeometry().getCoordinates(), this.stopsFeatureStore().layer.map?.projection, this.projection);
17201
+ const translationCoordinates = olproj.transform(firstFeature.getGeometry().getCoordinates(), this.stopsFeatureStore().layer.map?.projectionCode, this.projection);
17235
17202
  const translatedStop = this.stopsStore().get(translatedStopId);
17236
17203
  const roundedCoord = roundCoordTo(translationCoordinates, this.coordRoundedDecimals());
17237
17204
  translatedStop.coordinates = roundedCoord;
@@ -17931,7 +17898,7 @@ class DownloadService {
17931
17898
  else {
17932
17899
  wfsOptions = layer.dataSource.options.params;
17933
17900
  }
17934
- const currentExtent = olproj.transformExtent(layer.map.viewController.getExtent(), new olProjection({ code: layer.map.projection }), currentProj);
17901
+ const currentExtent = olproj.transformExtent(layer.map.viewController.getExtent(), new olProjection({ code: layer.map.projectionCode }), currentProj);
17935
17902
  const outputFormatDownload = wfsOptions.outputFormatDownload === undefined
17936
17903
  ? wfsOptions.outputFormat === undefined
17937
17904
  ? ''
@@ -19209,8 +19176,8 @@ class OgcFilterFormComponent {
19209
19176
  const currentFilter = this.currentFilter();
19210
19177
  if (this.snrc && currentFilter.igoSpatialSelector === 'snrc') {
19211
19178
  currentFilter.wkt_geometry =
19212
- this.wktService.snrcToWkt(this.snrc, this.map().projection)?.wktPoly ??
19213
- '';
19179
+ this.wktService.snrcToWkt(this.snrc, this.map().projectionCode)
19180
+ ?.wktPoly ?? '';
19214
19181
  }
19215
19182
  this.refreshFilters()?.();
19216
19183
  }
@@ -19221,7 +19188,7 @@ class OgcFilterFormComponent {
19221
19188
  }
19222
19189
  const currentFilter = this.currentFilter();
19223
19190
  if (currentFilter.igoSpatialSelector === 'fixedExtent') {
19224
- currentFilter.wkt_geometry = this.wktService.extentToWkt(this.map().projection, this.map().viewController.getExtent(), this.map().projection).wktPoly;
19191
+ currentFilter.wkt_geometry = this.wktService.extentToWkt(this.map().projectionCode, this.map().viewController.getExtent(), this.map().projectionCode).wktPoly;
19225
19192
  }
19226
19193
  if (refresh) {
19227
19194
  this.refreshFilters()?.();
@@ -20216,7 +20183,7 @@ class OgcFilterableItemComponent {
20216
20183
  operator: firstOperatorName,
20217
20184
  active: true,
20218
20185
  igoSpatialSelector: 'fixedExtent',
20219
- srsName: this.map().projection
20186
+ srsName: this.map().projectionCode
20220
20187
  }, fieldNameGeometry, lastLevel, this.defaultLogicalParent));
20221
20188
  this.datasource.options.ogcFilters.interfaceOgcFilters = arr;
20222
20189
  }
@@ -24307,7 +24274,7 @@ class DrawComponent {
24307
24274
  zIndex: 200,
24308
24275
  source: new FeatureDataSource(),
24309
24276
  style: (feature, resolution) => {
24310
- return this.drawStyleService.createIndividualElementStyle(feature, resolution, this.labelsAreShown, feature.get('fontStyle'), feature.get('drawingStyle').fill, feature.get('drawingStyle').stroke, feature.get('offsetX'), feature.get('offsetY'), this.map().projection, this.icon);
24277
+ return this.drawStyleService.createIndividualElementStyle(feature, resolution, this.labelsAreShown, feature.get('fontStyle'), feature.get('drawingStyle').fill, feature.get('drawingStyle').stroke, feature.get('offsetX'), feature.get('offsetY'), this.map().projectionCode, this.icon);
24311
24278
  },
24312
24279
  showInLayerList: true,
24313
24280
  exportable: true,
@@ -24634,7 +24601,7 @@ class DrawComponent {
24634
24601
  }
24635
24602
  const pointStyle = (feature, resolution) => {
24636
24603
  const geom = feature.getGeometry();
24637
- const coordinates = olproj.transform(geom.getCoordinates(), this.map().projection, 'EPSG:4326');
24604
+ const coordinates = olproj.transform(geom.getCoordinates(), this.map().projectionCode, 'EPSG:4326');
24638
24605
  const radius = radiusMeters / Math.cos((Math.PI / 180) * coordinates[1]) / resolution;
24639
24606
  this.activeDrawControl?.predefinedRadius$.next(radiusMeters);
24640
24607
  return new olstyle.Style({
@@ -24670,12 +24637,12 @@ class DrawComponent {
24670
24637
  elementStyle(labelsAreShown, isAnIcon) {
24671
24638
  if (isAnIcon) {
24672
24639
  this.activeStore.layer.ol.setStyle((feature, resolution) => {
24673
- return this.drawStyleService.createIndividualElementStyle(feature, resolution, labelsAreShown, feature.get('fontStyle'), feature.get('drawingStyle').fill, feature.get('drawingStyle').stroke, feature.get('offsetX'), feature.get('offsetY'), this.map().projection, this.icon);
24640
+ return this.drawStyleService.createIndividualElementStyle(feature, resolution, labelsAreShown, feature.get('fontStyle'), feature.get('drawingStyle').fill, feature.get('drawingStyle').stroke, feature.get('offsetX'), feature.get('offsetY'), this.map().projectionCode, this.icon);
24674
24641
  });
24675
24642
  }
24676
24643
  else {
24677
24644
  this.activeStore.layer.ol.setStyle((feature, resolution) => {
24678
- return this.drawStyleService.createIndividualElementStyle(feature, resolution, labelsAreShown, feature.get('fontStyle'), feature.get('drawingStyle').fill, feature.get('drawingStyle').stroke, feature.get('offsetX'), feature.get('offsetY'), this.map().projection);
24645
+ return this.drawStyleService.createIndividualElementStyle(feature, resolution, labelsAreShown, feature.get('fontStyle'), feature.get('drawingStyle').fill, feature.get('drawingStyle').stroke, feature.get('offsetX'), feature.get('offsetY'), this.map().projectionCode);
24679
24646
  });
24680
24647
  }
24681
24648
  }
@@ -26928,7 +26895,7 @@ class GeometryFormFieldInputComponent {
26928
26895
  olGeometry = this.circleToPoint(olGeometry);
26929
26896
  }
26930
26897
  const value = this.olGeoJSON.writeGeometryObject(olGeometry, {
26931
- featureProjection: this.map().projection,
26898
+ featureProjection: this.map().projectionCode,
26932
26899
  dataProjection: 'EPSG:4326'
26933
26900
  });
26934
26901
  if (olGeometry.get('radius')) {
@@ -26940,7 +26907,7 @@ class GeometryFormFieldInputComponent {
26940
26907
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
26941
26908
  circleToPoint(olGeometry) {
26942
26909
  const center = olGeometry.getCenter();
26943
- const coordinates = olproj.transform(center, this.map().projection, 'EPSG:4326');
26910
+ const coordinates = olproj.transform(center, this.map().projectionCode, 'EPSG:4326');
26944
26911
  const radius = Math.round(olGeometry.getRadius() * Math.cos((Math.PI / 180) * coordinates[1]));
26945
26912
  // Convert it to a point object
26946
26913
  olGeometry = new OlPoint(center);
@@ -26954,7 +26921,7 @@ class GeometryFormFieldInputComponent {
26954
26921
  addGeoJSONToOverlay(geometry) {
26955
26922
  const olGeometry = this.olGeoJSON.readGeometry(geometry, {
26956
26923
  dataProjection: 'EPSG:4326',
26957
- featureProjection: this.map().projection
26924
+ featureProjection: this.map().projectionCode
26958
26925
  });
26959
26926
  const olFeature = new OlFeature({
26960
26927
  geometry: olGeometry
@@ -26979,7 +26946,7 @@ class GeometryFormFieldInputComponent {
26979
26946
  * @param olGeometry OL Geometry
26980
26947
  */
26981
26948
  updateMeasureTooltip(olGeometry) {
26982
- const measure = measureOlGeometry(olGeometry, this.map().projection);
26949
+ const measure = measureOlGeometry(olGeometry, this.map().projectionCode);
26983
26950
  const lengths = measure.lengths;
26984
26951
  const lastIndex = olGeometry.getType() === 'Polygon'
26985
26952
  ? lengths.length - 2
@@ -27116,7 +27083,7 @@ class SpatialFilterItemComponent {
27116
27083
  this.radiusFormControl.setValue(this.radius);
27117
27084
  this.PointStyle = (feature, resolution) => {
27118
27085
  const geom = feature.getGeometry();
27119
- const coordinates = olproj.transform(geom.getCoordinates(), this.map().projection, 'EPSG:4326');
27086
+ const coordinates = olproj.transform(geom.getCoordinates(), this.map().projectionCode, 'EPSG:4326');
27120
27087
  return new olstyle.Style({
27121
27088
  image: new olstyle.Circle({
27122
27089
  radius: this.radius /
@@ -29243,9 +29210,9 @@ class ExportService {
29243
29210
  httpClient = inject(HttpClient);
29244
29211
  tableDataService = inject(TableDataService);
29245
29212
  static ogreFormats = {
29246
- GML: 'gml',
29247
- GPX: 'gpx',
29248
- KML: 'kml',
29213
+ GML: 'GML',
29214
+ GPX: 'GPX',
29215
+ KML: 'KML',
29249
29216
  Shapefile: 'ESRI Shapefile',
29250
29217
  CSV: 'CSV',
29251
29218
  /** @deprecated use CSV */
@@ -29330,7 +29297,7 @@ class ExportService {
29330
29297
  }
29331
29298
  return;
29332
29299
  }
29333
- this.exportWithOgre(olFeatures, options, title, projectionIn, projectionOut).subscribe({
29300
+ this.exportWithOgre(olFeatures, options, title, projectionIn, projectionOut)?.subscribe({
29334
29301
  complete: () => observer.complete(),
29335
29302
  error: (error) => observer.error(error)
29336
29303
  });
@@ -29424,47 +29391,63 @@ class ExportService {
29424
29391
  }
29425
29392
  }
29426
29393
  exportWithOgre(olFeatures, { format, csvSeparator = undefined }, title, projectionIn, projectionOut) {
29427
- const featuresText = new olformat.GeoJSON().writeFeatures(olFeatures, {
29394
+ if (!format) {
29395
+ return;
29396
+ }
29397
+ const features = new olformat.GeoJSON().writeFeaturesObject(olFeatures, {
29428
29398
  dataProjection: projectionOut,
29429
29399
  featureProjection: projectionIn
29430
29400
  });
29431
- const sizeError = this.checkOgrePayloadSize(featuresText);
29401
+ const sizeError = this.checkOgrePayloadSize(JSON.stringify(features));
29432
29402
  if (sizeError)
29433
29403
  return sizeError;
29434
29404
  const url = `${this.ogreUrl}/convertJson`;
29435
- const formData = new FormData();
29436
- formData.append('json', featuresText);
29437
- let outputName = format === 'Shapefile'
29438
- ? `${title}.zip`
29439
- : `${title}.${format.toLowerCase()}`;
29405
+ let outputName = title;
29440
29406
  let ogreFormat = ExportService.ogreFormats[format];
29407
+ let params = new HttpParams();
29441
29408
  if (isCsvExport(format)) {
29442
- outputName = `${title}.csv`;
29409
+ outputName = title;
29443
29410
  if (format === 'CSVcomma' || format === 'CSVsemicolon') {
29444
29411
  ogreFormat = 'CSV';
29445
29412
  }
29446
- formData.append('lco', `SEPARATOR=${csvSeparator}`);
29447
- if (format === 'CSVsemicolon') {
29448
- formData.append('lco', `SEPARATOR=${csvSeparator}`);
29449
- }
29413
+ params = params.append('lco', `SEPARATOR=${csvSeparator}`);
29450
29414
  }
29451
- formData.append('outputName', this.formatFilename(outputName));
29452
- formData.append('format', ogreFormat);
29453
- formData.append('forceUTF8', 'true');
29415
+ params = params
29416
+ .set('name', this.formatFilename(outputName))
29417
+ .set('format', ogreFormat)
29418
+ .set('forceUTF8', 'true');
29454
29419
  return this.httpClient
29455
- .post(url, formData, {
29456
- responseType: 'blob'
29420
+ .post(url, features, {
29421
+ params,
29422
+ responseType: 'blob',
29423
+ observe: 'response'
29457
29424
  })
29458
- .pipe(tap((value) => {
29459
- downloadBlob(value, outputName);
29425
+ .pipe(tap((response) => {
29426
+ if (!response.body) {
29427
+ return;
29428
+ }
29429
+ const filename = this.getFileName(response.headers, outputName, format);
29430
+ downloadBlob(response.body, filename);
29460
29431
  }));
29461
29432
  }
29433
+ getFileName(headers, outputName, format) {
29434
+ const contentDisposition = headers.get('content-disposition');
29435
+ const filenameMatch = contentDisposition?.match(/filename="?([^";\n]+)"?/);
29436
+ if (filenameMatch?.[1]) {
29437
+ return filenameMatch[1];
29438
+ }
29439
+ let extension = format.toLowerCase();
29440
+ if (format === 'Shapefile') {
29441
+ extension = 'zip';
29442
+ }
29443
+ return `${outputName}.${extension}`;
29444
+ }
29462
29445
  formatFilename(name) {
29463
29446
  return name
29464
29447
  .replaceAll(' ', '_')
29465
29448
  .normalize('NFD')
29466
29449
  .replace(/[\u0300-\u036f]/g, '')
29467
- .replace(/’/g, "'");
29450
+ .replace(/[^a-zA-Z0-9_-]/g, '');
29468
29451
  }
29469
29452
  nothingToExport(olFeatures, format) {
29470
29453
  if (olFeatures.length === 0) {
@@ -29598,12 +29581,12 @@ class ExportService {
29598
29581
  return geomTypes;
29599
29582
  }
29600
29583
  /**
29601
- * Checks if the given payload exceeds the OGRE maximum allowed size (2MB).
29584
+ * Checks if the given payload exceeds the OGRE maximum allowed size (50MB).
29602
29585
  * @param payload The GeoJSON payload as a string.
29603
29586
  * @returns An Observable that throws an error if the payload is too large, or undefined if the size is acceptable.
29604
29587
  */
29605
29588
  checkOgrePayloadSize(payload) {
29606
- const OGRE_MAX_SIZE = 2 * 1024 * 1024; // 2MB
29589
+ const OGRE_MAX_SIZE = 50 * 1024 * 1024; // 50MB
29607
29590
  const byteLength = new TextEncoder().encode(payload).length;
29608
29591
  if (byteLength > OGRE_MAX_SIZE) {
29609
29592
  const error = new Error();
@@ -29683,7 +29666,7 @@ class ImportOgreServerError extends ImportError {
29683
29666
  }
29684
29667
 
29685
29668
  function addLayerAndFeaturesToMap(features, map, contextUri, layerTitle, layerService, storeToIdb = false) {
29686
- const olFeatures = features.map((feature) => featureToOl(feature, map.projection));
29669
+ const olFeatures = features.map((feature) => featureToOl(feature, map.projectionCode));
29687
29670
  const id = uuid();
29688
29671
  const sourceOptions = {
29689
29672
  id,
@@ -30387,10 +30370,10 @@ class ImportExportComponent {
30387
30370
  }
30388
30371
  if (!isCSV || !data.combineLayers) {
30389
30372
  geomTypes.forEach((geomType) => {
30390
- if (geomType.type) {
30391
- fileName += geomType.type;
30392
- }
30393
- this.handleExport(geomType.features, data, fileName);
30373
+ const formattedFilename = geomType.type
30374
+ ? `${fileName}_${geomType.type}`
30375
+ : fileName;
30376
+ this.handleExport(geomType.features, data, formattedFilename);
30394
30377
  });
30395
30378
  }
30396
30379
  this.loading$.next(false);
@@ -31472,7 +31455,7 @@ class QueryDirective {
31472
31455
  const queryLayers = this.map.layerController.all.filter(layerIsQueryable);
31473
31456
  queries$.push(...this.queryService.query(queryLayers, {
31474
31457
  coordinates: event.coordinate,
31475
- projection: this.map.projection,
31458
+ projection: this.map.projectionCode,
31476
31459
  resolution
31477
31460
  }));
31478
31461
  if (queries$.length === 0) {
@@ -31514,7 +31497,7 @@ class QueryDirective {
31514
31497
  if (featureOL) {
31515
31498
  if (featureOL.get('features')) {
31516
31499
  for (const feature of featureOL.get('features')) {
31517
- const newFeature = featureFromOl(feature, this.map.projection);
31500
+ const newFeature = featureFromOl(feature, this.map.projectionCode);
31518
31501
  newFeature.meta = {
31519
31502
  title: feature.values_.nom,
31520
31503
  id: layerOL.values_._layer.id + '.' + feature.id_,
@@ -31527,7 +31510,7 @@ class QueryDirective {
31527
31510
  }
31528
31511
  }
31529
31512
  else if (featureOL instanceof RenderFeature) {
31530
- const newFeature = renderFeatureFromOl(featureOL, this.map.projection, layerOL);
31513
+ const newFeature = renderFeatureFromOl(featureOL, this.map.projectionCode, layerOL);
31531
31514
  newFeature.meta = {
31532
31515
  id: layerOL.values_._layer.id + '.' + newFeature.meta.id,
31533
31516
  sourceTitle: layerOL.values_.title,
@@ -31541,7 +31524,7 @@ class QueryDirective {
31541
31524
  clickedFeatures.push(newFeature);
31542
31525
  }
31543
31526
  else {
31544
- const newFeature = featureFromOl(featureOL, this.map.projection, layerOL);
31527
+ const newFeature = featureFromOl(featureOL, this.map.projectionCode, layerOL);
31545
31528
  newFeature.meta = {
31546
31529
  id: layerOL.values_._layer.id + '.' + newFeature.meta.id,
31547
31530
  sourceTitle: layerOL.values_.title,
@@ -31570,7 +31553,7 @@ class QueryDirective {
31570
31553
  .map((layer) => {
31571
31554
  const featuresOL = layer.dataSource.ol;
31572
31555
  featuresOL.forEachFeatureIntersectingExtent(dragExtent, (olFeature) => {
31573
- const newFeature = featureFromOl(olFeature, this.map.projection, layer.ol);
31556
+ const newFeature = featureFromOl(olFeature, this.map.projectionCode, layer.ol);
31574
31557
  newFeature.meta = {
31575
31558
  id: layer.id + '.' + olFeature.getId(),
31576
31559
  icon: olFeature.values_._icon,
@@ -32463,7 +32446,7 @@ class SearchResultsItemComponent {
32463
32446
  }
32464
32447
  const olFeature = this.format.readFeature(this.result().data, {
32465
32448
  dataProjection: this.result().data.projection,
32466
- featureProjection: map.projection
32449
+ featureProjection: map.projectionCode
32467
32450
  });
32468
32451
  moveToOlFeatures(map.viewController, olFeature, FeatureMotion.Default);
32469
32452
  }
@@ -33276,7 +33259,7 @@ class SearchPointerSummaryDirective {
33276
33259
  return this.component.map();
33277
33260
  }
33278
33261
  get mapProjection() {
33279
- return this.component.map().projection;
33262
+ return this.component.map().projectionCode;
33280
33263
  }
33281
33264
  /**
33282
33265
  * Start listening to pointermove and reverse search results.
@@ -33748,11 +33731,20 @@ var SearchSourceKind;
33748
33731
  (function (SearchSourceKind) {
33749
33732
  SearchSourceKind[SearchSourceKind["ICherche"] = 0] = "ICherche";
33750
33733
  SearchSourceKind[SearchSourceKind["IChercheReverse"] = 1] = "IChercheReverse";
33734
+ /**
33735
+ * @deprecated Deprecated source kind, will be removed in a future major version, likely in 23.x+.
33736
+ */
33751
33737
  SearchSourceKind[SearchSourceKind["Cadastre"] = 2] = "Cadastre";
33752
33738
  SearchSourceKind[SearchSourceKind["CoordinatesReverse"] = 3] = "CoordinatesReverse";
33753
33739
  SearchSourceKind[SearchSourceKind["ILayer"] = 4] = "ILayer";
33754
33740
  SearchSourceKind[SearchSourceKind["Nominatim"] = 5] = "Nominatim";
33741
+ /**
33742
+ * @deprecated Deprecated source kind, will be removed in a future major version, likely in 23.x+.
33743
+ */
33755
33744
  SearchSourceKind[SearchSourceKind["StoredQueries"] = 6] = "StoredQueries";
33745
+ /**
33746
+ * @deprecated Deprecated source kind, will be removed in a future major version, likely in 23.x+.
33747
+ */
33756
33748
  SearchSourceKind[SearchSourceKind["StoredQueriesReverse"] = 7] = "StoredQueriesReverse";
33757
33749
  SearchSourceKind[SearchSourceKind["Workspace"] = 8] = "Workspace";
33758
33750
  })(SearchSourceKind || (SearchSourceKind = {}));
@@ -34392,7 +34384,7 @@ class IChercheSearchSource extends SearchSource {
34392
34384
  */
34393
34385
  computeOptionsParam(term, options) {
34394
34386
  const hashtags = super.getHashtagsValid(term, 'type');
34395
- if (hashtags) {
34387
+ if (hashtags?.length) {
34396
34388
  options.params = Object.assign(options.params || {}, {
34397
34389
  type: hashtags.join(',')
34398
34390
  });
@@ -34989,7 +34981,7 @@ class ILayerSearchSource extends SearchSource {
34989
34981
  */
34990
34982
  computeOptionsParam(term, options) {
34991
34983
  const hashtags = super.getHashtagsValid(term, 'type');
34992
- if (hashtags) {
34984
+ if (hashtags?.length) {
34993
34985
  options.params = Object.assign(options.params || {}, {
34994
34986
  type: hashtags.join(',')
34995
34987
  });
@@ -35521,7 +35513,7 @@ class ToastComponent {
35521
35513
  if (feature?.geometry && map) {
35522
35514
  const olFeature = this.format.readFeature(this.feature, {
35523
35515
  dataProjection: feature?.projection,
35524
- featureProjection: map?.projection
35516
+ featureProjection: map?.projectionCode
35525
35517
  });
35526
35518
  moveToOlFeatures(map?.viewController, olFeature, FeatureMotion.Zoom);
35527
35519
  }
@@ -40641,6 +40633,7 @@ function provideSearch(sources, options) {
40641
40633
 
40642
40634
  /**
40643
40635
  * Cadastre search source
40636
+ * @deprecated This is a deprecated source. This type is available in ICherche. This search source will be deleted in in few next majors versions, likely in 23x+.
40644
40637
  */
40645
40638
  class CadastreSearchSource extends SearchSource {
40646
40639
  http = inject(HttpClient);
@@ -40773,6 +40766,7 @@ function cadastreSearchSourceFactory() {
40773
40766
  }
40774
40767
  /**
40775
40768
  * Function that returns a provider for the Cadastre search source
40769
+ * @deprecated This search source is deprecated and will be removed in a future major version, likely in 23.x+. As an alternative, provide iCherche. Within icherche, you could use the "cadastre type"
40776
40770
  */
40777
40771
  function provideCadastreSearchSource() {
40778
40772
  return {
@@ -40781,6 +40775,9 @@ function provideCadastreSearchSource() {
40781
40775
  multi: true
40782
40776
  };
40783
40777
  }
40778
+ /**
40779
+ * @deprecated This search source is deprecated and will be removed in a future major version, likely in 23.x+.
40780
+ */
40784
40781
  function withCadastreSource() {
40785
40782
  return {
40786
40783
  kind: SearchSourceKind.Cadastre,
@@ -40992,7 +40989,7 @@ class NominatimSearchSource extends SearchSource {
40992
40989
  */
40993
40990
  computeTermTags(term) {
40994
40991
  const hashtags = super.getHashtagsValid(term, 'amenity');
40995
- if (!hashtags) {
40992
+ if (hashtags?.length) {
40996
40993
  return this.computeTermSettings(term);
40997
40994
  }
40998
40995
  if (!hashtags.length) {
@@ -41065,6 +41062,7 @@ function withNominatimSource() {
41065
41062
 
41066
41063
  /**
41067
41064
  * StoredQueries search source
41065
+ * @deprecated This is a deprecated source. This type is available in ICherche. This search source will be deleted in in few next majors versions, likely in 23x+.
41068
41066
  */
41069
41067
  class StoredQueriesSearchSource extends SearchSource {
41070
41068
  http = inject(HttpClient);
@@ -41337,10 +41335,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
41337
41335
  }], ctorParameters: () => [], propDecorators: { getSearch: [] } });
41338
41336
  /**
41339
41337
  * StoredQueriesReverse search source
41338
+ * @deprecated This is a deprecated source. This type is available in ICherche. This search source will be deleted in in few next majors versions, likely in 23x+.
41340
41339
  */
41341
- // EXAMPLE CALLS
41342
- // https://ws.mapserver.transports.gouv.qc.ca/swtq?service=wfs&version=1.1.0&request=GetFeature&storedquery_id=lim_adm&srsname=epsg:4326&outputformat=text/xml;%20subtype=gml/3.1.1&long=-71.292469&lat=46.748107
41343
- //
41344
41340
  class StoredQueriesReverseSearchSource extends SearchSource {
41345
41341
  http = inject(HttpClient);
41346
41342
  languageService = inject(LanguageService);
@@ -41511,6 +41507,7 @@ function storedqueriesSearchSourceFactory() {
41511
41507
  }
41512
41508
  /**
41513
41509
  * Function that returns a provider for the StoredQueries search source
41510
+ * @deprecated This provider is deprecated and will be removed in a future major version, likely in 23.x+.
41514
41511
  */
41515
41512
  function provideStoredQueriesSearchSource() {
41516
41513
  return {
@@ -41519,6 +41516,9 @@ function provideStoredQueriesSearchSource() {
41519
41516
  multi: true
41520
41517
  };
41521
41518
  }
41519
+ /**
41520
+ * @deprecated This search source is deprecated and will be removed in a future major version, likely in 23.x+.
41521
+ */
41522
41522
  function withStoredQueriesSource() {
41523
41523
  return {
41524
41524
  kind: SearchSourceKind.StoredQueries,
@@ -41534,6 +41534,7 @@ function storedqueriesReverseSearchSourceFactory() {
41534
41534
  }
41535
41535
  /**
41536
41536
  * Function that returns a provider for the StoredQueriesReverse search source
41537
+ * @deprecated This provider is deprecated and will be removed in a future major version, likely in 23.x+.
41537
41538
  */
41538
41539
  function provideStoredQueriesReverseSearchSource() {
41539
41540
  return {
@@ -41542,6 +41543,9 @@ function provideStoredQueriesReverseSearchSource() {
41542
41543
  multi: true
41543
41544
  };
41544
41545
  }
41546
+ /**
41547
+ * @deprecated This search source is deprecated and will be removed in a future major version, likely in 23.x+.
41548
+ */
41545
41549
  function withStoredQueriesReverseSource() {
41546
41550
  return {
41547
41551
  kind: SearchSourceKind.StoredQueriesReverse,