@dra2020/baseclient 1.0.91 → 1.0.92

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.
@@ -2457,7 +2457,6 @@ exports.geoNormalizeCollection = geoNormalizeCollection;
2457
2457
  function geoCollectionToMap(col) {
2458
2458
  if (col == null)
2459
2459
  return null;
2460
- record('coltomap', col.features.length);
2461
2460
  let map = {};
2462
2461
  col.features.forEach((f) => { map[String(f.properties.id)] = f; });
2463
2462
  return map;
@@ -2474,7 +2473,6 @@ function geoMapToCollectionNonNull(map) {
2474
2473
  return null;
2475
2474
  let col = { type: 'FeatureCollection', features: [] };
2476
2475
  Object.keys(map).forEach((geoid) => { col.features.push(map[geoid]); });
2477
- record('maptocol', col.features.length);
2478
2476
  return col;
2479
2477
  }
2480
2478
  exports.geoMapToCollectionNonNull = geoMapToCollectionNonNull;
@@ -2482,6 +2480,8 @@ function geoCollectionToTopo(col) {
2482
2480
  let topo = Poly.topoFromCollection(col);
2483
2481
  Poly.topoPack(topo);
2484
2482
  record('coltotopo', col.features.length);
2483
+ if (col.datasets)
2484
+ topo.datasets = col.datasets;
2485
2485
  return topo;
2486
2486
  }
2487
2487
  exports.geoCollectionToTopo = geoCollectionToTopo;
@@ -2493,6 +2493,8 @@ function geoTopoToCollection(topo) {
2493
2493
  let col = Poly.topoToCollection(topo);
2494
2494
  Poly.featurePack(col);
2495
2495
  record('topotocol', col.features.length);
2496
+ if (topo.datasets)
2497
+ col.datasets = topo.datasets;
2496
2498
  return col;
2497
2499
  }
2498
2500
  exports.geoTopoToCollection = geoTopoToCollection;
@@ -2635,9 +2637,16 @@ class GeoMultiCollection {
2635
2637
  let n = this.nEntries;
2636
2638
  if (n == 1)
2637
2639
  this.all.col = this._col(this.nthEntry(0));
2638
- else
2640
+ else {
2639
2641
  // Going from map to collection guarantees that any duplicates are removed
2640
2642
  this.all.col = geoMapToCollectionNonNull(this.allMap());
2643
+ this.forEachEntry(e => {
2644
+ if (e.col && e.col.datasets)
2645
+ this.all.col.datasets = e.col.datasets;
2646
+ if (e.topo && e.topo.datasets)
2647
+ this.all.col.datasets = e.topo.datasets;
2648
+ });
2649
+ }
2641
2650
  }
2642
2651
  return this.all.col;
2643
2652
  }