@dra2020/baseclient 1.0.98 → 1.0.100

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') {
@@ -10167,7 +10182,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
10167
10182
  return result;
10168
10183
  };
10169
10184
  Object.defineProperty(exports, "__esModule", ({ value: true }));
10170
- exports.FsmUnion = exports.polyDifference = exports.polyIntersects = void 0;
10185
+ exports.FsmUnion = exports.polyDifference = exports.polyIntersectArea = exports.polyIntersects = void 0;
10171
10186
  const PC = __importStar(__webpack_require__(/*! polygon-clipping */ "polygon-clipping"));
10172
10187
  const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
10173
10188
  const FSM = __importStar(__webpack_require__(/*! ../fsm/all */ "./lib/fsm/all.ts"));
@@ -10226,6 +10241,26 @@ function polyIntersects(p1, p2) {
10226
10241
  return bIntersects;
10227
10242
  }
10228
10243
  exports.polyIntersects = polyIntersects;
10244
+ function polyIntersectArea(p1, p2) {
10245
+ let pp1 = Poly.polyNormalize(p1);
10246
+ let pp2 = Poly.polyNormalize(p2);
10247
+ let area = 0;
10248
+ PP.polyPackEachRing(pp1, (buffer1, iPoly1, iRing1, iOffset1, nPoints1) => {
10249
+ if (iRing1 == 0) {
10250
+ let c1 = unpackCoords(buffer1, iOffset1, nPoints1);
10251
+ PP.polyPackEachRing(pp2, (buffer2, iPoly2, iRing2, iOffset2, nPoints2) => {
10252
+ if (iRing2 == 0) {
10253
+ let c2 = unpackCoords(buffer2, iOffset2, nPoints2);
10254
+ let result = _intersection(c1, c2);
10255
+ if (result && result.length > 0)
10256
+ area += Poly.polyArea(result);
10257
+ }
10258
+ });
10259
+ }
10260
+ });
10261
+ return area;
10262
+ }
10263
+ exports.polyIntersectArea = polyIntersectArea;
10229
10264
  function polyDifference(main, parts) {
10230
10265
  main = PP.polyUnpack(coords(main));
10231
10266
  // need to explode multipolygon so that "exploded" is a valid multipolygon input to underlying difference routine