diff options
| author | Petri Hienonen <petri.hienonen@gmail.com> | 2025-11-09 22:17:04 +0200 |
|---|---|---|
| committer | Petri Hienonen <petri.hienonen@gmail.com> | 2025-11-09 22:17:04 +0200 |
| commit | 5eba467a7eb84409aa43df83de78ecb843a79d7b (patch) | |
| tree | d737d224b4b20ae4a29bad91125072018fdba80d /app/geometry.js | |
| parent | d9f3f48b634917c182fd8e0e764ef0575b1ce218 (diff) | |
| download | housing-5eba467a7eb84409aa43df83de78ecb843a79d7b.tar.zst | |
Update
Diffstat (limited to 'app/geometry.js')
| -rw-r--r-- | app/geometry.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/geometry.js b/app/geometry.js index 9b89106..d0f5467 100644 --- a/app/geometry.js +++ b/app/geometry.js @@ -146,7 +146,10 @@ export class Geometry { return Polygon.fromGeoJSON(geojson); case "MultiLineString": return MultiLineString.fromGeoJSON(geojson); + case "MultiPolygon": + return Polygon.fromGeoJSON(geojson); default: + debugger; throw new Error(`Invalid GeoJSON object: missing required 'type' property`); } } @@ -1031,7 +1034,6 @@ export class Feature { * @param {string|number} [id] - Feature ID */ constructor(geometry, properties = {}, id = "") { - this.type = "Feature"; this.geometry = geometry; this.properties = properties; this.id = id; @@ -1070,7 +1072,6 @@ export class Collection { * @param {Feature[]} features - Feature array */ constructor(features = []) { - this.type = "FeatureCollection"; this.features = features; } |
