Automated class transform
npx lebab --replace src --transform class
This commit is contained in:
@@ -15,9 +15,129 @@ import FormatType from '../format/FormatType.js';
|
||||
* @abstract
|
||||
* @extends {module:ol/format/Feature}
|
||||
*/
|
||||
const JSONFeature = function() {
|
||||
FeatureFormat.call(this);
|
||||
};
|
||||
class JSONFeature {
|
||||
constructor() {
|
||||
FeatureFormat.call(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
getType() {
|
||||
return FormatType.JSON;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
readFeature(source, opt_options) {
|
||||
return this.readFeatureFromObject(
|
||||
getObject(source), this.getReadOptions(source, opt_options));
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
readFeatures(source, opt_options) {
|
||||
return this.readFeaturesFromObject(
|
||||
getObject(source), this.getReadOptions(source, opt_options));
|
||||
}
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param {Object} object Object.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||
* @protected
|
||||
* @return {module:ol/Feature} Feature.
|
||||
*/
|
||||
readFeatureFromObject(object, opt_options) {}
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param {Object} object Object.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||
* @protected
|
||||
* @return {Array.<module:ol/Feature>} Features.
|
||||
*/
|
||||
readFeaturesFromObject(object, opt_options) {}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
readGeometry(source, opt_options) {
|
||||
return this.readGeometryFromObject(
|
||||
getObject(source), this.getReadOptions(source, opt_options));
|
||||
}
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param {Object} object Object.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||
* @protected
|
||||
* @return {module:ol/geom/Geometry} Geometry.
|
||||
*/
|
||||
readGeometryFromObject(object, opt_options) {}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
readProjection(source) {
|
||||
return this.readProjectionFromObject(getObject(source));
|
||||
}
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param {Object} object Object.
|
||||
* @protected
|
||||
* @return {module:ol/proj/Projection} Projection.
|
||||
*/
|
||||
readProjectionFromObject(object) {}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
writeFeature(feature, opt_options) {
|
||||
return JSON.stringify(this.writeFeatureObject(feature, opt_options));
|
||||
}
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @return {Object} Object.
|
||||
*/
|
||||
writeFeatureObject(feature, opt_options) {}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
writeFeatures(features, opt_options) {
|
||||
return JSON.stringify(this.writeFeaturesObject(features, opt_options));
|
||||
}
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param {Array.<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @return {Object} Object.
|
||||
*/
|
||||
writeFeaturesObject(features, opt_options) {}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
writeGeometry(geometry, opt_options) {
|
||||
return JSON.stringify(this.writeGeometryObject(geometry, opt_options));
|
||||
}
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param {module:ol/geom/Geometry} geometry Geometry.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @return {Object} Object.
|
||||
*/
|
||||
writeGeometryObject(geometry, opt_options) {}
|
||||
}
|
||||
|
||||
inherits(JSONFeature, FeatureFormat);
|
||||
|
||||
@@ -38,135 +158,4 @@ function getObject(source) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
JSONFeature.prototype.getType = function() {
|
||||
return FormatType.JSON;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
JSONFeature.prototype.readFeature = function(source, opt_options) {
|
||||
return this.readFeatureFromObject(
|
||||
getObject(source), this.getReadOptions(source, opt_options));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
JSONFeature.prototype.readFeatures = function(source, opt_options) {
|
||||
return this.readFeaturesFromObject(
|
||||
getObject(source), this.getReadOptions(source, opt_options));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param {Object} object Object.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||
* @protected
|
||||
* @return {module:ol/Feature} Feature.
|
||||
*/
|
||||
JSONFeature.prototype.readFeatureFromObject = function(object, opt_options) {};
|
||||
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param {Object} object Object.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||
* @protected
|
||||
* @return {Array.<module:ol/Feature>} Features.
|
||||
*/
|
||||
JSONFeature.prototype.readFeaturesFromObject = function(object, opt_options) {};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
JSONFeature.prototype.readGeometry = function(source, opt_options) {
|
||||
return this.readGeometryFromObject(
|
||||
getObject(source), this.getReadOptions(source, opt_options));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param {Object} object Object.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||
* @protected
|
||||
* @return {module:ol/geom/Geometry} Geometry.
|
||||
*/
|
||||
JSONFeature.prototype.readGeometryFromObject = function(object, opt_options) {};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
JSONFeature.prototype.readProjection = function(source) {
|
||||
return this.readProjectionFromObject(getObject(source));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param {Object} object Object.
|
||||
* @protected
|
||||
* @return {module:ol/proj/Projection} Projection.
|
||||
*/
|
||||
JSONFeature.prototype.readProjectionFromObject = function(object) {};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
JSONFeature.prototype.writeFeature = function(feature, opt_options) {
|
||||
return JSON.stringify(this.writeFeatureObject(feature, opt_options));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @return {Object} Object.
|
||||
*/
|
||||
JSONFeature.prototype.writeFeatureObject = function(feature, opt_options) {};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
JSONFeature.prototype.writeFeatures = function(features, opt_options) {
|
||||
return JSON.stringify(this.writeFeaturesObject(features, opt_options));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param {Array.<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @return {Object} Object.
|
||||
*/
|
||||
JSONFeature.prototype.writeFeaturesObject = function(features, opt_options) {};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
JSONFeature.prototype.writeGeometry = function(geometry, opt_options) {
|
||||
return JSON.stringify(this.writeGeometryObject(geometry, opt_options));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param {module:ol/geom/Geometry} geometry Geometry.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @return {Object} Object.
|
||||
*/
|
||||
JSONFeature.prototype.writeGeometryObject = function(geometry, opt_options) {};
|
||||
export default JSONFeature;
|
||||
|
||||
Reference in New Issue
Block a user