@dra2020/baseclient 1.0.99 → 1.0.101

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.
@@ -2347,7 +2347,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
2347
2347
  return result;
2348
2348
  };
2349
2349
  Object.defineProperty(exports, "__esModule", ({ value: true }));
2350
- exports.geoIntersect = exports.geoIntersectOptions = exports.GeoMultiCollection = exports.geoMapEqual = exports.geoEqual = exports.geoTopoToCollectionNonNull = exports.geoTopoToCollection = exports.geoCollectionToTopoNonNull = exports.geoCollectionToTopo = exports.geoMapToCollectionNonNull = exports.geoMapToCollection = exports.geoCollectionToMap = exports.geoNormalizeCollection = exports.geoNormalizeFeature = exports.geoEnsureID = exports.dumpMetrics = void 0;
2350
+ exports.geoIntersect = exports.geoIntersectOptions = exports.GeoMultiCollection = exports.geoMapEqual = exports.geoEqual = exports.geoTopoToCollectionNonNull = exports.geoTopoToCollection = exports.geoCollectionToTopoNonNull = exports.geoCollectionToTopo = exports.geoMapToCollectionNonNull = exports.geoMapToCollection = exports.geoCollectionToMap = exports.geoNormalizeCollection = exports.geoNormalizeFeature = exports.geoEnsureID = exports.hidemapConcat = exports.dumpMetrics = void 0;
2351
2351
  const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
2352
2352
  const Poly = __importStar(__webpack_require__(/*! ../poly/all */ "./lib/poly/all.ts"));
2353
2353
  // Tracing/debugging aid
@@ -2364,6 +2364,14 @@ function dumpMetrics() {
2364
2364
  });
2365
2365
  }
2366
2366
  exports.dumpMetrics = dumpMetrics;
2367
+ function hidemapConcat(...args) {
2368
+ let hm = {};
2369
+ for (let i = 0; i < args.length; i++)
2370
+ if (args[i])
2371
+ Object.keys(args[i]).forEach(id => hm[id] = true);
2372
+ return hm;
2373
+ }
2374
+ exports.hidemapConcat = hidemapConcat;
2367
2375
  const NormalizeAll = { joinPolygons: true, checkRewind: true, ensureID: true };
2368
2376
  // set the canonical 'id' property from the best property value.
2369
2377
  // if joinPolygons is true, we do not enforce uniqueness.
@@ -2721,6 +2729,13 @@ class GeoMultiCollection {
2721
2729
  }
2722
2730
  return this.all.topo;
2723
2731
  }
2732
+ hideSetAll(hm) {
2733
+ // Prevents onChange when resetting to same value
2734
+ if (!Util.shallowEqual(this.hidden, hm)) {
2735
+ this.showAll();
2736
+ this.hide(hm);
2737
+ }
2738
+ }
2724
2739
  hide(id) {
2725
2740
  if (id) {
2726
2741
  if (typeof id === 'string') {
@@ -8472,6 +8487,8 @@ function polyPackSize(coords) {
8472
8487
  // Null feature?
8473
8488
  if (coords == null || (coords.length !== undefined && coords.length == 0))
8474
8489
  return 0;
8490
+ if (!Array.isArray(coords))
8491
+ return 0;
8475
8492
  let depth = Util.depthof(coords);
8476
8493
  if (depth == 3)
8477
8494
  coords = [[coords]];
@@ -8669,6 +8686,8 @@ function polyPack(coords, prepack) {
8669
8686
  if (coords && coords.geometry)
8670
8687
  coords = coords.geometry.coordinates;
8671
8688
  // Transparently handle polygon or multi-polygon
8689
+ if (!Array.isArray(coords))
8690
+ return null;
8672
8691
  let depth = Util.depthof(coords);
8673
8692
  if (depth == 2)
8674
8693
  coords = [[[coords]]];