Skip to content

Commit d9ea23e

Browse files
committed
fix bug with triangle having polygon geometry type.
1 parent b550dbf commit d9ea23e

File tree

4 files changed

+8
-12
lines changed

4 files changed

+8
-12
lines changed

README.md

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ Software source code previously released under an open source license and then m
2424

2525
View the latest [JS Docs](http://ngageoint.github.io/simple-features-js)
2626

27-
### Browser Usage ###
2827

2928
#### Browser Usage ####
3029
```html

lib/Triangle.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@ export class Triangle extends Polygon {
1616
*/
1717
public constructor (...args: any[]) {
1818
if (args.length === 0) {
19-
super(GeometryType.POLYGON, false, false);
19+
super(GeometryType.TRIANGLE, false, false);
2020
} else if (args.length === 1 && args[0] instanceof Triangle) {
21-
super(GeometryType.POLYGON, args[0].hasZ, args[0].hasM);
21+
super(GeometryType.TRIANGLE, args[0].hasZ, args[0].hasM);
2222
args[0].rings.forEach(ring => this.addRing(ring.copy() as LineString));
2323
} else if (args.length === 1 && args[0] instanceof LineString) {
24-
super(GeometryType.POLYGON, args[0].hasZ, args[0].hasM);
24+
super(GeometryType.TRIANGLE, args[0].hasZ, args[0].hasM);
2525
this.addRing(args[0]);
2626
} else if (args.length === 1 && args[0].length != null) {
27-
super(GeometryType.POLYGON, args[0].hasZ, args[0].hasM);
27+
super(GeometryType.TRIANGLE, args[0].hasZ, args[0].hasM);
2828
this.rings = (args[0] as Array<LineString>)
2929
} else if (args.length === 2) {
30-
super(GeometryType.POLYGON, args[0], args[1]);
30+
super(GeometryType.TRIANGLE, args[0], args[1]);
3131
} else if (args.length === 3) {
3232
super(args[0], args[1], args[2]);
3333
}

package-lock.json

+2-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ngageoint/simple-features-js",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "Simple Features JavaScript Library",
55
"keywords": [
66
"NGA",

0 commit comments

Comments
 (0)