import ol_format_GeoJSONX from './GeoJSONX.js' import ol_format_Polyline from 'ol/format/Polyline.js' import ol_geom_Point from 'ol/geom/Point.js' import ol_geom_LineString from 'ol/geom/LineString.js' /** Feature format for reading and writing data in the GeoJSONP format, * using Polyline Algorithm to encode geometry. * @constructor * @extends {ol_format_GeoJSON} * @param {*} options options. * @param {number} options.decimals number of decimals to save, default 6 * @param {ol.ProjectionLike} options.dataProjection Projection of the data we are reading. If not provided `EPSG:4326` * @param {ol.ProjectionLike} options.featureProjection Projection of the feature geometries created by the format reader. If not provided, features will be returned in the dataProjection. */ var ol_format_GeoJSONP = class olformatGeoJSONP extends ol_format_GeoJSONX { constructor(options) { options = options || {} super(options) this._lineFormat = new ol_format_Polyline({ factor: Math.pow(10, options.decimals || 6) }) } /** Encode coordinates * @param {ol.coordinate|Array