@dra2020/baseclient 1.0.93 → 1.0.94

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
@@ -52,6 +52,7 @@ export declare class GeoMultiCollection {
52
52
  nthEntry(n: number): GeoEntry;
53
53
  add(tag: string, topo: Poly.Topo, col: GeoFeatureCollection, map: GeoFeatureMap): void;
54
54
  addMulti(multi: GeoMultiCollection): void;
55
+ addAll(tag: string, multi: GeoMultiCollection): void;
55
56
  remove(tag: string): void;
56
57
  _onChange(): void;
57
58
  _col(e: GeoEntry): GeoFeatureCollection;
package/lib/geo/geo.ts CHANGED
@@ -294,6 +294,30 @@ export class GeoMultiCollection
294
294
  }
295
295
  }
296
296
 
297
+ // Add the "all" collection from the passed in multi, but do not force compute of any things not computed yet.
298
+ addAll(tag: string, multi: GeoMultiCollection): void
299
+ {
300
+ let nEntries = Util.countKeys(multi.entries);
301
+ if (nEntries)
302
+ {
303
+ // Make sure all collection is created
304
+ if (!multi.all.topo && !multi.all.col && !multi.all.map)
305
+ {
306
+ // Create cheapest one (collection if I need to create, otherwise copy from single entry)
307
+ if (nEntries > 1)
308
+ multi.allCol();
309
+ else
310
+ {
311
+ let e = multi.nthEntry(0);
312
+ multi.all.topo = e.topo;
313
+ multi.all.col = e.col;
314
+ multi.all.map = e.map;
315
+ }
316
+ }
317
+ this.add(tag, multi.all.topo, multi.all.col, multi.all.map);
318
+ }
319
+ }
320
+
297
321
  remove(tag: string): void
298
322
  {
299
323
  let entry = this.entries[tag];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dra2020/baseclient",
3
- "version": "1.0.93",
3
+ "version": "1.0.94",
4
4
  "description": "Utility functions for Javascript projects.",
5
5
  "main": "dist/baseclient.js",
6
6
  "types": "./dist/all/all.d.ts",