@dra2020/baseclient 1.0.109 → 1.0.111
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/baseclient.js +31 -10
- package/dist/baseclient.js.map +1 -1
- package/dist/geo/geo.d.ts +2 -0
- package/lib/geo/geo.ts +36 -11
- package/package.json +1 -1
package/dist/baseclient.js
CHANGED
|
@@ -2660,6 +2660,14 @@ class GeoMultiCollection {
|
|
|
2660
2660
|
}
|
|
2661
2661
|
return e.topo;
|
|
2662
2662
|
}
|
|
2663
|
+
_length(e) {
|
|
2664
|
+
if (e == null)
|
|
2665
|
+
return 0;
|
|
2666
|
+
return e.col ? e.col.features.length
|
|
2667
|
+
: e.map ? Util.countKeys(e.map)
|
|
2668
|
+
: e.topo ? Util.countKeys(e.topo.objects)
|
|
2669
|
+
: 0;
|
|
2670
|
+
}
|
|
2663
2671
|
colOf(tag) { return this._col(this.entries[tag]); }
|
|
2664
2672
|
mapOf(tag) { return this._map(this.entries[tag]); }
|
|
2665
2673
|
topoOf(tag) { return this._topo(this.entries[tag]); }
|
|
@@ -2719,6 +2727,25 @@ class GeoMultiCollection {
|
|
|
2719
2727
|
return this.all.map;
|
|
2720
2728
|
}
|
|
2721
2729
|
allTopo() {
|
|
2730
|
+
if (this.nEntries == 0)
|
|
2731
|
+
return null;
|
|
2732
|
+
if (!this.all.topo) {
|
|
2733
|
+
// optimise case where one entry
|
|
2734
|
+
let n = this.nEntries;
|
|
2735
|
+
if (n == 1) {
|
|
2736
|
+
let e = this.nthEntry(0);
|
|
2737
|
+
this.all.topo = this._topo(e);
|
|
2738
|
+
this.all.col = this.all.col || e.col;
|
|
2739
|
+
this.all.map = this.all.map || e.map;
|
|
2740
|
+
}
|
|
2741
|
+
else {
|
|
2742
|
+
// Old-style, goes through map (to filter hidden) and then collection
|
|
2743
|
+
this.all.topo = geoCollectionToTopoNonNull(this.allCol());
|
|
2744
|
+
}
|
|
2745
|
+
}
|
|
2746
|
+
return this.all.topo;
|
|
2747
|
+
}
|
|
2748
|
+
allNewTopo() {
|
|
2722
2749
|
if (this.nEntries == 0)
|
|
2723
2750
|
return null;
|
|
2724
2751
|
if (!this.all.topo) {
|
|
@@ -2734,8 +2761,9 @@ class GeoMultiCollection {
|
|
|
2734
2761
|
// Old-style, goes through map (to filter hidden) and then collection
|
|
2735
2762
|
// this.all.topo = geoCollectionToTopoNonNull(this.allCol());
|
|
2736
2763
|
// New style, use splice on packed topologies
|
|
2737
|
-
let topoarray = Object.values(this.entries).
|
|
2738
|
-
|
|
2764
|
+
let topoarray = Object.values(this.entries).filter((e) => this._length(e) > 0)
|
|
2765
|
+
.map((e) => { return { topology: this._topo(e), filterout: this.hidden }; });
|
|
2766
|
+
this.all.topo = topoarray.length == 0 ? null : topoarray.length == 1 ? topoarray[0].topology : Poly.topoSplice(topoarray);
|
|
2739
2767
|
}
|
|
2740
2768
|
}
|
|
2741
2769
|
return this.all.topo;
|
|
@@ -2787,14 +2815,7 @@ class GeoMultiCollection {
|
|
|
2787
2815
|
}
|
|
2788
2816
|
get length() {
|
|
2789
2817
|
let n = 0;
|
|
2790
|
-
this.forEachEntry(e =>
|
|
2791
|
-
if (e.col)
|
|
2792
|
-
n += e.col.features.length;
|
|
2793
|
-
else if (e.map)
|
|
2794
|
-
n += Util.countKeys(e.map);
|
|
2795
|
-
else if (e.topo)
|
|
2796
|
-
n += Util.countKeys(e.topo.objects);
|
|
2797
|
-
});
|
|
2818
|
+
this.forEachEntry(e => n += this._length(e));
|
|
2798
2819
|
return n;
|
|
2799
2820
|
}
|
|
2800
2821
|
// Use forEach in preference to iteration using this function
|