@dra2020/baseclient 1.0.113 → 1.0.115

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/dist/geo/geo.d.ts CHANGED
@@ -70,6 +70,7 @@ export declare class GeoMultiCollection {
70
70
  allCol(): GeoFeatureCollection;
71
71
  allMap(): GeoFeatureMap;
72
72
  allTopo(): Poly.Topo;
73
+ allOldTopo(): Poly.Topo;
73
74
  allNewTopo(): Poly.Topo;
74
75
  hideSetAll(hm: HideMap): void;
75
76
  hide(id: any): void;
package/lib/geo/geo.ts CHANGED
@@ -475,6 +475,13 @@ export class GeoMultiCollection
475
475
  }
476
476
 
477
477
  allTopo(): Poly.Topo
478
+ {
479
+ // Note that you can't actually switch between allNewTopo and allOldTopo
480
+ // without calling _onChange between the calls to reset the 'all' tag.
481
+ return this.allNewTopo();
482
+ }
483
+
484
+ allOldTopo(): Poly.Topo
478
485
  {
479
486
  if (this.nEntries == 0) return null;
480
487
  if (! this.all.topo)
@@ -504,22 +511,26 @@ export class GeoMultiCollection
504
511
  {
505
512
  // optimise case where one entry
506
513
  let n = this.nEntries;
514
+ let e = this.nthEntry(0);
507
515
  if (n == 1)
508
516
  {
509
- let e = this.nthEntry(0);
510
517
  this.all.topo = this._topo(e);
511
518
  this.all.col = this.all.col || e.col;
512
519
  this.all.map = this.all.map || e.map;
513
520
  }
514
- else
521
+ else if (e.topo)
515
522
  {
516
523
  // Old-style, goes through map (to filter hidden) and then collection
517
524
  // this.all.topo = geoCollectionToTopoNonNull(this.allCol());
518
525
  // New style, use splice on packed topologies
526
+ let filterout = Util.isEmpty(this.hidden) ? null : this.hidden; // splice function requires NULL for empty
519
527
  let topoarray = Object.values(this.entries).filter((e: GeoEntry) => this._length(e) > 0)
520
- .map((e: GeoEntry) => { return { topology: this._topo(e), filterout: this.hidden } });
528
+ .map((e: GeoEntry) => { return { topology: this._topo(e), filterout } });
521
529
  this.all.topo = topoarray.length == 0 ? null : topoarray.length == 1 ? topoarray[0].topology : Poly.topoSplice(topoarray);
522
530
  }
531
+ else
532
+ // Old-style, goes through map (to filter hidden) and then collection
533
+ this.all.topo = geoCollectionToTopoNonNull(this.allCol());
523
534
  }
524
535
  return this.all.topo;
525
536
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dra2020/baseclient",
3
- "version": "1.0.113",
3
+ "version": "1.0.115",
4
4
  "description": "Utility functions for Javascript projects.",
5
5
  "main": "dist/baseclient.js",
6
6
  "types": "./dist/all/all.d.ts",