@dra2020/baseclient 1.0.26 → 1.0.27
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 +25 -13
- package/dist/baseclient.js.map +1 -1
- package/dist/poly/boundbox.d.ts +1 -0
- package/lib/geo/geo.ts +21 -9
- package/lib/poly/boundbox.ts +6 -1
- package/package.json +1 -1
package/dist/baseclient.js
CHANGED
|
@@ -1429,6 +1429,7 @@ class GeoMultiCollection {
|
|
|
1429
1429
|
this.add(tag, topo, col, map);
|
|
1430
1430
|
}
|
|
1431
1431
|
empty() {
|
|
1432
|
+
this.all = { tag: 'all' };
|
|
1432
1433
|
this.entries = {};
|
|
1433
1434
|
this.hidden = {};
|
|
1434
1435
|
this._onChange();
|
|
@@ -1469,7 +1470,8 @@ class GeoMultiCollection {
|
|
|
1469
1470
|
}
|
|
1470
1471
|
}
|
|
1471
1472
|
_onChange() {
|
|
1472
|
-
this.all
|
|
1473
|
+
if (this.all.topo || this.all.col || this.all.map)
|
|
1474
|
+
this.all = { tag: 'all' };
|
|
1473
1475
|
this.stamp++;
|
|
1474
1476
|
}
|
|
1475
1477
|
_col(e) {
|
|
@@ -1560,28 +1562,34 @@ class GeoMultiCollection {
|
|
|
1560
1562
|
}
|
|
1561
1563
|
hide(id) {
|
|
1562
1564
|
if (id) {
|
|
1563
|
-
if (typeof id === 'string')
|
|
1564
|
-
this.hidden[id]
|
|
1565
|
+
if (typeof id === 'string') {
|
|
1566
|
+
if (!this.hidden[id]) {
|
|
1567
|
+
this.hidden[id] = true;
|
|
1568
|
+
this._onChange();
|
|
1569
|
+
}
|
|
1570
|
+
}
|
|
1565
1571
|
else if (Array.isArray(id))
|
|
1566
|
-
id.forEach((i) =>
|
|
1572
|
+
id.forEach((i) => this.hide(i));
|
|
1567
1573
|
else if (typeof id === 'object')
|
|
1568
1574
|
for (let p in id)
|
|
1569
1575
|
if (id.hasOwnProperty(p))
|
|
1570
|
-
this.
|
|
1571
|
-
this._onChange();
|
|
1576
|
+
this.hide(p);
|
|
1572
1577
|
}
|
|
1573
1578
|
}
|
|
1574
1579
|
show(id) {
|
|
1575
1580
|
if (id) {
|
|
1576
|
-
if (typeof id === 'string')
|
|
1577
|
-
|
|
1581
|
+
if (typeof id === 'string') {
|
|
1582
|
+
if (this.hidden[id]) {
|
|
1583
|
+
delete this.hidden[id];
|
|
1584
|
+
this._onChange();
|
|
1585
|
+
}
|
|
1586
|
+
}
|
|
1578
1587
|
else if (Array.isArray(id))
|
|
1579
|
-
id.forEach((i) =>
|
|
1588
|
+
id.forEach((i) => this.show(i));
|
|
1580
1589
|
else if (typeof id === 'object')
|
|
1581
1590
|
for (let p in id)
|
|
1582
1591
|
if (id.hasOwnProperty(p))
|
|
1583
|
-
|
|
1584
|
-
this._onChange();
|
|
1592
|
+
this.show(p);
|
|
1585
1593
|
}
|
|
1586
1594
|
}
|
|
1587
1595
|
showAll() {
|
|
@@ -4740,7 +4748,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
4740
4748
|
return result;
|
|
4741
4749
|
};
|
|
4742
4750
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4743
|
-
exports.boundboxContains = exports.boundboxIntersects = exports.boundboxArea = exports.boundboxPoly = exports.boundbox = exports.boundboxExtend = exports.clipLon = exports.boundboxCY = exports.boundboxCX = exports.boundboxHeight = exports.boundboxWidth = void 0;
|
|
4751
|
+
exports.boundboxContains = exports.boundboxIntersects = exports.boundboxArea = exports.boundboxEmpty = exports.boundboxPoly = exports.boundbox = exports.boundboxExtend = exports.clipLon = exports.boundboxCY = exports.boundboxCX = exports.boundboxHeight = exports.boundboxWidth = void 0;
|
|
4744
4752
|
const P = __importStar(__webpack_require__(/*! ./poly */ "./lib/poly/poly.ts"));
|
|
4745
4753
|
function boundboxWidth(bb) { return Math.abs(bb.right - bb.left); }
|
|
4746
4754
|
exports.boundboxWidth = boundboxWidth;
|
|
@@ -4797,7 +4805,7 @@ function boundbox(poly, bbox) {
|
|
|
4797
4805
|
boundbox(poly[i], bbox);
|
|
4798
4806
|
}
|
|
4799
4807
|
// single point
|
|
4800
|
-
else
|
|
4808
|
+
else if (Array.isArray(poly) && poly.length >= 2)
|
|
4801
4809
|
boundboxExtend(bbox, poly[0], poly[1]);
|
|
4802
4810
|
}
|
|
4803
4811
|
return bbox;
|
|
@@ -4807,6 +4815,10 @@ function boundboxPoly(bb) {
|
|
|
4807
4815
|
return [[[bb.left, bb.top], [bb.left, bb.bottom], [bb.right, bb.bottom], [bb.right, bb.top], [bb.left, bb.top]]];
|
|
4808
4816
|
}
|
|
4809
4817
|
exports.boundboxPoly = boundboxPoly;
|
|
4818
|
+
function boundboxEmpty(bb) {
|
|
4819
|
+
return !bb || bb.left === undefined || P.polyArea(boundboxPoly(bb)) == 0;
|
|
4820
|
+
}
|
|
4821
|
+
exports.boundboxEmpty = boundboxEmpty;
|
|
4810
4822
|
function boundboxArea(poly) {
|
|
4811
4823
|
return P.polyArea(boundboxPoly(boundbox(poly)));
|
|
4812
4824
|
}
|