dgeoutils 2.4.23 → 2.4.24
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/cjs/DPolygon.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { LineString, Polygon, Geometry as GeoJsonGeometry, Feature, FeatureColle
|
|
|
7
7
|
interface DeepArray<T> extends Array<T | DeepArray<T>> {
|
|
8
8
|
}
|
|
9
9
|
export declare const MIN_POINTS_IN_VALID_POLYGON = 3;
|
|
10
|
+
declare type SetterFunction<T> = (t: DPolygon) => T;
|
|
10
11
|
export declare class DPolygon {
|
|
11
12
|
private pPoints;
|
|
12
13
|
properties: Record<string, any>;
|
|
@@ -116,6 +117,7 @@ export declare class DPolygon {
|
|
|
116
117
|
get closed(): boolean;
|
|
117
118
|
buffer(v: number, quadrantSegments?: number, type?: number): DPolygon;
|
|
118
119
|
sideBuffers(v: number, quadrantSegments?: number): [DPolygon, DPolygon];
|
|
120
|
+
setProperties(v: SetterFunction<Record<string, any>> | Record<string, any>): DPolygon;
|
|
119
121
|
bezier(step?: number): DPolygon;
|
|
120
122
|
setGrowingHeight(from: number, to: number): DPolygon;
|
|
121
123
|
loopPointsGenerator(): () => Generator<[DPoint, DPoint, undefined, number]>;
|
package/dist/cjs/DPolygon.js
CHANGED
|
@@ -775,7 +775,7 @@ var DPolygon = (function () {
|
|
|
775
775
|
DPolygon.prototype.clone = function () {
|
|
776
776
|
var res = new DPolygon(this.points.map(function (r) { return r.clone(); }));
|
|
777
777
|
res.holes = this.holes.map(function (h) { return h.clone(); });
|
|
778
|
-
res.properties = this.properties;
|
|
778
|
+
res.properties = __assign({}, this.properties);
|
|
779
779
|
return res;
|
|
780
780
|
};
|
|
781
781
|
DPolygon.prototype.equal = function (p) {
|
|
@@ -1409,6 +1409,10 @@ var DPolygon = (function () {
|
|
|
1409
1409
|
buffer.unshift(buffer.pop());
|
|
1410
1410
|
return [linePart.reverse(), buffer];
|
|
1411
1411
|
};
|
|
1412
|
+
DPolygon.prototype.setProperties = function (v) {
|
|
1413
|
+
this.properties = typeof v === 'object' ? v : v(this);
|
|
1414
|
+
return this;
|
|
1415
|
+
};
|
|
1412
1416
|
DPolygon.prototype.bezier = function (step) {
|
|
1413
1417
|
if (step === void 0) { step = 0.1; }
|
|
1414
1418
|
var res = new DPolygon();
|
package/dist/es2015/DPolygon.js
CHANGED
|
@@ -458,7 +458,7 @@ export class DPolygon {
|
|
|
458
458
|
clone() {
|
|
459
459
|
const res = new DPolygon(this.points.map((r) => r.clone()));
|
|
460
460
|
res.holes = this.holes.map((h) => h.clone());
|
|
461
|
-
res.properties = this.properties;
|
|
461
|
+
res.properties = Object.assign({}, this.properties);
|
|
462
462
|
return res;
|
|
463
463
|
}
|
|
464
464
|
equal(p) {
|
|
@@ -958,6 +958,10 @@ export class DPolygon {
|
|
|
958
958
|
buffer.unshift(buffer.pop());
|
|
959
959
|
return [linePart.reverse(), buffer];
|
|
960
960
|
}
|
|
961
|
+
setProperties(v) {
|
|
962
|
+
this.properties = typeof v === 'object' ? v : v(this);
|
|
963
|
+
return this;
|
|
964
|
+
}
|
|
961
965
|
bezier(step = 0.1) {
|
|
962
966
|
const res = new DPolygon();
|
|
963
967
|
for (let i = 0; i < 1; i += step) {
|
package/dist/esm/DPolygon.js
CHANGED
|
@@ -772,7 +772,7 @@ var DPolygon = (function () {
|
|
|
772
772
|
DPolygon.prototype.clone = function () {
|
|
773
773
|
var res = new DPolygon(this.points.map(function (r) { return r.clone(); }));
|
|
774
774
|
res.holes = this.holes.map(function (h) { return h.clone(); });
|
|
775
|
-
res.properties = this.properties;
|
|
775
|
+
res.properties = __assign({}, this.properties);
|
|
776
776
|
return res;
|
|
777
777
|
};
|
|
778
778
|
DPolygon.prototype.equal = function (p) {
|
|
@@ -1406,6 +1406,10 @@ var DPolygon = (function () {
|
|
|
1406
1406
|
buffer.unshift(buffer.pop());
|
|
1407
1407
|
return [linePart.reverse(), buffer];
|
|
1408
1408
|
};
|
|
1409
|
+
DPolygon.prototype.setProperties = function (v) {
|
|
1410
|
+
this.properties = typeof v === 'object' ? v : v(this);
|
|
1411
|
+
return this;
|
|
1412
|
+
};
|
|
1409
1413
|
DPolygon.prototype.bezier = function (step) {
|
|
1410
1414
|
if (step === void 0) { step = 0.1; }
|
|
1411
1415
|
var res = new DPolygon();
|