@igo2/geo 20.1.0-next.1 → 20.1.0-next.2

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.
@@ -946,7 +946,7 @@ class PrintService {
946
946
  * @param baseMargins - Page margins
947
947
  */
948
948
  async handleMeasureLayer(doc, map, baseMargins) {
949
- if (map.layerController.all.find((layer) => layer.visible && layer.id.startsWith('igo-measures-'))) {
949
+ if (map.layerController.all.find((layer) => layer.visible && layer.id.toString().startsWith('igo-measures-'))) {
950
950
  let canvasOverlayHTMLMeasures;
951
951
  const mapOverlayMeasuresHTML = map.ol.getOverlayContainer();
952
952
  await html2canvas(mapOverlayMeasuresHTML, {
@@ -5088,7 +5088,10 @@ class LayerBase {
5088
5088
  return this.options.isIgoInternalLayer || false;
5089
5089
  }
5090
5090
  get id() {
5091
- return String(this.options.id);
5091
+ return this.options.id;
5092
+ }
5093
+ set id(value) {
5094
+ this.options.id = value;
5092
5095
  }
5093
5096
  get parentId() {
5094
5097
  return this.parent?.id ?? this.options.parentId;
@@ -5882,9 +5885,6 @@ let Layer = class Layer extends LayerBase {
5882
5885
  link;
5883
5886
  linkMaster;
5884
5887
  resolution$$;
5885
- get id() {
5886
- return String(this.options.id || this.dataSource.id);
5887
- }
5888
5888
  get visible() {
5889
5889
  return super.visible;
5890
5890
  }
@@ -6176,7 +6176,7 @@ class VectorLayer extends Layer {
6176
6176
  removeLayerFromIDB() {
6177
6177
  const geoDB = new GeoDB();
6178
6178
  const layerDB = new LayerDB();
6179
- merge(geoDB.delete(this.id), layerDB.delete(this.id)).subscribe();
6179
+ merge(geoDB.delete(this.id.toString()), layerDB.delete(this.id.toString())).subscribe();
6180
6180
  }
6181
6181
  maintainOptionsInIdb() {
6182
6182
  this.options.igoStyle.igoStyleObject = olStyleToBasicIgoStyle(this.ol);
@@ -6213,7 +6213,7 @@ class VectorLayer extends Layer {
6213
6213
  }));
6214
6214
  const geoDB = new GeoDB();
6215
6215
  geoDB
6216
- .update(this.options.sourceOptions.url || this.id, this.id, geojsonObject, InsertSourceInsertDBEnum.User, `${this.title}-${this.id}-${new Date()}`)
6216
+ .update(this.options.sourceOptions.url || this.id.toString(), this.id, geojsonObject, InsertSourceInsertDBEnum.User, `${this.title}-${this.id}-${new Date()}`)
6217
6217
  .pipe(first$1())
6218
6218
  .subscribe();
6219
6219
  }
@@ -12254,6 +12254,9 @@ class LayerController extends LayerSelectionModel {
12254
12254
  getById(id) {
12255
12255
  return this.all.find((layer) => layer.id && layer.id === id);
12256
12256
  }
12257
+ getByTitle(title) {
12258
+ return this.all.find((layer) => layer.title && layer.title === title);
12259
+ }
12257
12260
  getBySourceId(id) {
12258
12261
  return this.all.find((layer) => layer.dataSource?.id && layer.dataSource.id === id);
12259
12262
  }
@@ -12338,7 +12341,7 @@ class LayerController extends LayerSelectionModel {
12338
12341
  this._otherLayers.push(layer);
12339
12342
  }
12340
12343
  const parent = layer.parentId
12341
- ? this.getById(layer.parentId.split(TREE_SEPERATOR).pop())
12344
+ ? this.getById(layer.parentId.toString().split(TREE_SEPERATOR).pop())
12342
12345
  : undefined;
12343
12346
  layer.add(parent);
12344
12347
  return;
@@ -12869,7 +12872,7 @@ class LayerListComponent {
12869
12872
  activeChange = output();
12870
12873
  _transformer = (layer, level) => {
12871
12874
  return {
12872
- id: layer.id || layer.options.name,
12875
+ id: layer.id?.toString() || layer.options.name,
12873
12876
  isGroup: !!isLayerGroup(layer),
12874
12877
  descendantLevels: isLayerGroup(layer)
12875
12878
  ? layer.descendantsLevel
@@ -12907,11 +12910,12 @@ class LayerListComponent {
12907
12910
  : this.controller().deselect(layer);
12908
12911
  }
12909
12912
  getLayerType(layer) {
12913
+ const id = layer.id.toString();
12910
12914
  return layer.type === 'raster'
12911
12915
  ? 'raster'
12912
- : layer.id.includes('measure')
12916
+ : id.includes('measure')
12913
12917
  ? 'measure'
12914
- : layer.id.includes('draw')
12918
+ : id.includes('draw')
12915
12919
  ? 'draw'
12916
12920
  : 'vector';
12917
12921
  }
@@ -24683,7 +24687,7 @@ class DrawComponent {
24683
24687
  }
24684
24688
  createLayer(newTitle, isNewLayer) {
24685
24689
  for (const layer of this.allLayers) {
24686
- const numberId = Number(layer.id.replace('igo-draw-layer', ''));
24690
+ const numberId = Number(layer.id.toString().replace('igo-draw-layer', ''));
24687
24691
  this.layerCounterID = Math.max(numberId, this.layerCounterID);
24688
24692
  }
24689
24693
  this.activeDrawingLayer.set(new VectorLayer({
@@ -29778,7 +29782,7 @@ class ExportService {
29778
29782
  else if (layer.options.workspace?.enabled) {
29779
29783
  const wks = this.getWorkspaceByLayerId(layer.id, store);
29780
29784
  if (wks?.entityStore?.stateView.all().length) {
29781
- const features = this.getFeaturesFromWorkspace(wks, layer.id, data);
29785
+ const features = this.getFeaturesFromWorkspace(wks, layer.id.toString(), data);
29782
29786
  return of(features).pipe(catchError((e) => {
29783
29787
  throw e;
29784
29788
  }));
@@ -33107,7 +33111,7 @@ class SearchResultAddButtonComponent {
33107
33111
  // set layer id
33108
33112
  let layerCounterID = 0;
33109
33113
  for (const layer of this.allLayers) {
33110
- const numberId = Number(layer.id.replace('igo-search-layer', ''));
33114
+ const numberId = Number(layer.id.toString().replace('igo-search-layer', ''));
33111
33115
  layerCounterID = Math.max(numberId, layerCounterID);
33112
33116
  }
33113
33117
  this.dataSourceService
@@ -37081,11 +37085,16 @@ class EditionWorkspaceService {
37081
37085
  };
37082
37086
  wfsOlLayer.setLoader(loader);
37083
37087
  wfsOlLayer.refresh();
37088
+ const id = String(layer.id);
37084
37089
  for (const lay of map.layerController.all) {
37085
37090
  if (isLayerItem(lay) &&
37086
37091
  lay.id !== layer.id &&
37087
- lay.options.linkedLayers?.linkId.includes(layer.id.substr(0, layer.id.indexOf('.') - 1)) &&
37088
- lay.options.linkedLayers?.linkId.includes('WmsWorkspaceTableSrc')) {
37092
+ lay.options.linkedLayers?.linkId
37093
+ .toString()
37094
+ .includes(id.substr(0, id.indexOf('.') - 1)) &&
37095
+ lay.options.linkedLayers?.linkId
37096
+ .toString()
37097
+ .includes('WmsWorkspaceTableSrc')) {
37089
37098
  const wmsOlLayer = lay.dataSource.ol;
37090
37099
  const params = wmsOlLayer.getParams();
37091
37100
  params._t = new Date().getTime();