Move FeatureClass and FeatureLike to ol/Feature

This commit is contained in:
Kevin Schmidt
2018-10-01 08:59:55 -06:00
parent 7056eb8536
commit c5a9d5b0bc
4 changed files with 14 additions and 16 deletions

View File

@@ -8,6 +8,14 @@ import BaseObject, {getChangeEventType} from './Object.js';
import Geometry from './geom/Geometry.js'; import Geometry from './geom/Geometry.js';
import Style from './style/Style.js'; import Style from './style/Style.js';
/**
* @typedef {typeof Feature|typeof import("./render/Feature.js").default} FeatureClass
*/
/**
* @typedef {Feature|import("./render/Feature.js").default} FeatureLike
*/
/** /**
* @classdesc * @classdesc
* A vector object for geographic features with a geometry and other * A vector object for geographic features with a geometry and other

View File

@@ -6,16 +6,6 @@ import {assign} from '../obj.js';
import {get as getProjection, equivalent as equivalentProjection, transformExtent} from '../proj.js'; import {get as getProjection, equivalent as equivalentProjection, transformExtent} from '../proj.js';
/**
* @typedef {typeof import("../Feature.js").default|typeof import("../render/Feature.js").default} FeatureClass
*/
/**
* @typedef {import("../Feature.js").default|import("../render/Feature.js").default} FeatureLike
*/
/** /**
* @typedef {Object} ReadOptions * @typedef {Object} ReadOptions
* @property {import("../proj.js").ProjectionLike} [dataProjection] Projection of the data we are reading. * @property {import("../proj.js").ProjectionLike} [dataProjection] Projection of the data we are reading.
@@ -141,7 +131,7 @@ class FeatureFormat {
* @abstract * @abstract
* @param {Document|Node|Object|string} source Source. * @param {Document|Node|Object|string} source Source.
* @param {ReadOptions=} opt_options Read options. * @param {ReadOptions=} opt_options Read options.
* @return {FeatureLike} Feature. * @return {import("../Feature.js").FeatureLike} Feature.
*/ */
readFeature(source, opt_options) {} readFeature(source, opt_options) {}
@@ -151,7 +141,7 @@ class FeatureFormat {
* @abstract * @abstract
* @param {Document|Node|ArrayBuffer|Object|string} source Source. * @param {Document|Node|ArrayBuffer|Object|string} source Source.
* @param {ReadOptions=} opt_options Read options. * @param {ReadOptions=} opt_options Read options.
* @return {Array<FeatureLike>} Features. * @return {Array<import("../Feature.js").FeatureLike>} Features.
*/ */
readFeatures(source, opt_options) {} readFeatures(source, opt_options) {}

View File

@@ -23,7 +23,7 @@ import RenderFeature from '../render/Feature.js';
/** /**
* @typedef {Object} Options * @typedef {Object} Options
* @property {import("./Feature.js").FeatureClass} [featureClass] Class for features returned by * @property {import("../Feature.js").FeatureClass} [featureClass] Class for features returned by
* {@link module:ol/format/MVT#readFeatures}. Set to {@link module:ol/Feature~Feature} to get full editing and geometry * {@link module:ol/format/MVT#readFeatures}. Set to {@link module:ol/Feature~Feature} to get full editing and geometry
* support at the cost of decreased rendering performance. The default is * support at the cost of decreased rendering performance. The default is
* {@link module:ol/render/Feature~RenderFeature}, which is optimized for rendering and hit detection. * {@link module:ol/render/Feature~RenderFeature}, which is optimized for rendering and hit detection.
@@ -61,7 +61,7 @@ class MVT extends FeatureFormat {
/** /**
* @private * @private
* @type {import("./Feature.js").FeatureClass} * @type {import("../Feature.js").FeatureClass}
*/ */
this.featureClass_ = options.featureClass ? options.featureClass : RenderFeature; this.featureClass_ = options.featureClass ? options.featureClass : RenderFeature;

View File

@@ -56,7 +56,7 @@ class DragAndDropEvent extends Event {
/** /**
* The features parsed from dropped data. * The features parsed from dropped data.
* @type {Array<import("../format/Feature.js").FeatureLike>|undefined} * @type {Array<import("../Feature.js").FeatureLike>|undefined}
* @api * @api
*/ */
this.features = opt_features; this.features = opt_features;
@@ -220,7 +220,7 @@ class DragAndDrop extends Interaction {
* @param {string} text Text. * @param {string} text Text.
* @param {import("../format/Feature.js").ReadOptions} options Read options. * @param {import("../format/Feature.js").ReadOptions} options Read options.
* @private * @private
* @return {Array<import("../format/Feature.js").FeatureLike>} Features. * @return {Array<import("../Feature.js").FeatureLike>} Features.
*/ */
tryReadFeatures_(format, text, options) { tryReadFeatures_(format, text, options) {
try { try {