@dra2020/baseclient 1.0.93 → 1.0.95

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,35 @@ 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
+ if (multi == null || Util.isEmpty(multi.entries))
301
+ this.remove(tag);
302
+ else
303
+ {
304
+ let nEntries = Util.countKeys(multi.entries);
305
+ if (nEntries)
306
+ {
307
+ // Make sure all collection is created
308
+ if (!multi.all.topo && !multi.all.col && !multi.all.map)
309
+ {
310
+ // Create cheapest one (collection if I need to create, otherwise copy from single entry)
311
+ if (nEntries > 1)
312
+ multi.allCol();
313
+ else
314
+ {
315
+ let e = multi.nthEntry(0);
316
+ multi.all.topo = e.topo;
317
+ multi.all.col = e.col;
318
+ multi.all.map = e.map;
319
+ }
320
+ }
321
+ this.add(tag, multi.all.topo, multi.all.col, multi.all.map);
322
+ }
323
+ }
324
+ }
325
+
297
326
  remove(tag: string): void
298
327
  {
299
328
  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.95",
4
4
  "description": "Utility functions for Javascript projects.",
5
5
  "main": "dist/baseclient.js",
6
6
  "types": "./dist/all/all.d.ts",