"use strict";(self.webpackChunkassets=self.webpackChunkassets||[]).push([[163],{2563:(t,o,e)=>{e.r(o),e.d(o,{default:()=>s});var n=e(3487),i=e(5137);function r(t){return[t.x,t.y]}class s{constructor(t,o){this.geometryFactory=t||new i.A,this.ol=o||"undefined"!=typeof ol&&ol}inject(t,o,e,n,i,r,s,g){this.ol={geom:{Point:t,LineString:o,LinearRing:e,Polygon:n,MultiPoint:i,MultiLineString:r,MultiPolygon:s,GeometryCollection:g}}}read(t){const o=this.ol;return t instanceof o.geom.Point?this.convertFromPoint(t):t instanceof o.geom.LineString?this.convertFromLineString(t):t instanceof o.geom.LinearRing?this.convertFromLinearRing(t):t instanceof o.geom.Polygon?this.convertFromPolygon(t):t instanceof o.geom.MultiPoint?this.convertFromMultiPoint(t):t instanceof o.geom.MultiLineString?this.convertFromMultiLineString(t):t instanceof o.geom.MultiPolygon?this.convertFromMultiPolygon(t):t instanceof o.geom.GeometryCollection?this.convertFromCollection(t):void 0}convertFromPoint(t){const o=t.getCoordinates();return this.geometryFactory.createPoint(new n.A(o[0],o[1]))}convertFromLineString(t){return this.geometryFactory.createLineString(t.getCoordinates().map((function(t){return new n.A(t[0],t[1])})))}convertFromLinearRing(t){return this.geometryFactory.createLinearRing(t.getCoordinates().map((function(t){return new n.A(t[0],t[1])})))}convertFromPolygon(t){const o=t.getLinearRings();let e=null;const n=[];for(let t=0;t<o.length;t++){const i=this.convertFromLinearRing(o[t]);0===t?e=i:n.push(i)}return this.geometryFactory.createPolygon(e,n)}convertFromMultiPoint(t){const o=t.getPoints().map((function(t){return this.convertFromPoint(t)}),this);return this.geometryFactory.createMultiPoint(o)}convertFromMultiLineString(t){const o=t.getLineStrings().map((function(t){return this.convertFromLineString(t)}),this);return this.geometryFactory.createMultiLineString(o)}convertFromMultiPolygon(t){const o=t.getPolygons().map((function(t){return this.convertFromPolygon(t)}),this);return this.geometryFactory.createMultiPolygon(o)}convertFromCollection(t){const o=t.getGeometries().map((function(t){return this.read(t)}),this);return this.geometryFactory.createGeometryCollection(o)}write(t){return"Point"===t.getGeometryType()?this.convertToPoint(t.getCoordinate()):"LineString"===t.getGeometryType()?this.convertToLineString(t):"LinearRing"===t.getGeometryType()?this.convertToLinearRing(t):"Polygon"===t.getGeometryType()?this.convertToPolygon(t):"MultiPoint"===t.getGeometryType()?this.convertToMultiPoint(t):"MultiLineString"===t.getGeometryType()?this.convertToMultiLineString(t):"MultiPolygon"===t.getGeometryType()?this.convertToMultiPolygon(t):"GeometryCollection"===t.getGeometryType()?this.convertToCollection(t):void 0}convertToPoint(t){return new this.ol.geom.Point([t.x,t.y])}convertToLineString(t){const o=t._points._coordinates.map(r);return new this.ol.geom.LineString(o)}convertToLinearRing(t){const o=t._points._coordinates.map(r);return new this.ol.geom.LinearRing(o)}convertToPolygon(t){const o=[t._shell._points._coordinates.map(r)];for(let e=0;e<t._holes.length;e++)o.push(t._holes[e]._points._coordinates.map(r));return new this.ol.geom.Polygon(o)}convertToMultiPoint(t){return new this.ol.geom.MultiPoint(t.getCoordinates().map(r))}convertToMultiLineString(t){const o=[];for(let e=0;e<t._geometries.length;e++)o.push(this.convertToLineString(t._geometries[e]).getCoordinates());return new this.ol.geom.MultiLineString(o)}convertToMultiPolygon(t){const o=[];for(let e=0;e<t._geometries.length;e++)o.push(this.convertToPolygon(t._geometries[e]).getCoordinates());return new this.ol.geom.MultiPolygon(o)}convertToCollection(t){const o=[];for(let e=0;e<t._geometries.length;e++){const n=t._geometries[e];o.push(this.write(n))}return new this.ol.geom.GeometryCollection(o)}}}}]);
//# sourceMappingURL=OLparser.bundle.js.map