@dra2020/baseclient 1.0.95 → 1.0.96

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.
@@ -2658,8 +2658,12 @@ class GeoMultiCollection {
2658
2658
  if (!this.all.col) {
2659
2659
  // optimise case where one entry
2660
2660
  let n = this.nEntries;
2661
- if (n == 1)
2662
- this.all.col = this._col(this.nthEntry(0));
2661
+ if (n == 1) {
2662
+ let e = this.nthEntry(0);
2663
+ this.all.col = this._col(e);
2664
+ this.all.topo = this.all.topo || e.topo;
2665
+ this.all.map = this.all.map || e.map;
2666
+ }
2663
2667
  else {
2664
2668
  // Going from map to collection guarantees that any duplicates are removed
2665
2669
  this.all.col = geoMapToCollectionNonNull(this.allMap());
@@ -2679,8 +2683,12 @@ class GeoMultiCollection {
2679
2683
  if (!this.all.map) {
2680
2684
  // optimise case where one entry
2681
2685
  let n = this.nEntries;
2682
- if (n == 1)
2683
- this.all.map = this._map(this.nthEntry(0));
2686
+ if (n == 1) {
2687
+ let e = this.nthEntry(0);
2688
+ this.all.map = this._map(e);
2689
+ this.all.topo = this.all.topo || e.topo;
2690
+ this.all.col = this.all.col || e.col;
2691
+ }
2684
2692
  else {
2685
2693
  let map = {};
2686
2694
  this.all.map = map;
@@ -2695,8 +2703,12 @@ class GeoMultiCollection {
2695
2703
  if (!this.all.topo) {
2696
2704
  // optimise case where one entry
2697
2705
  let n = this.nEntries;
2698
- if (n == 1)
2699
- this.all.topo = this._topo(this.nthEntry(0));
2706
+ if (n == 1) {
2707
+ let e = this.nthEntry(0);
2708
+ this.all.topo = this._topo(e);
2709
+ this.all.col = this.all.col || e.col;
2710
+ this.all.map = this.all.map || e.map;
2711
+ }
2700
2712
  else
2701
2713
  this.all.topo = geoCollectionToTopoNonNull(this.allCol());
2702
2714
  }
@@ -2790,9 +2802,14 @@ class GeoMultiCollection {
2790
2802
  }
2791
2803
  forEach(cb) {
2792
2804
  this.forEachEntry(e => {
2793
- let col = this._col(e);
2794
2805
  if (e.col)
2795
- e.col.features.forEach(f => { if (this.hidden[f.properties.id] === undefined)
2806
+ e.col.features.forEach(f => { if (!this.hidden[f.properties.id])
2807
+ cb(f); });
2808
+ else if (e.topo)
2809
+ Object.values(e.topo.objects).forEach((f) => { if (!this.hidden[f.properties.id])
2810
+ cb(f); });
2811
+ else if (e.map)
2812
+ Object.values(e.map).forEach(f => { if (!this.hidden[f.properties.id])
2796
2813
  cb(f); });
2797
2814
  });
2798
2815
  }