@@ -6,6 +6,16 @@ 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.
|
||||||
@@ -131,7 +141,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 {import("../Feature.js").default} Feature.
|
* @return {FeatureLike} Feature.
|
||||||
*/
|
*/
|
||||||
readFeature(source, opt_options) {}
|
readFeature(source, opt_options) {}
|
||||||
|
|
||||||
@@ -141,7 +151,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<import("../Feature.js").default>} Features.
|
* @return {Array<FeatureLike>} Features.
|
||||||
*/
|
*/
|
||||||
readFeatures(source, opt_options) {}
|
readFeatures(source, opt_options) {}
|
||||||
|
|
||||||
|
|||||||
+12
-18
@@ -5,8 +5,8 @@
|
|||||||
|
|
||||||
import {assert} from '../asserts.js';
|
import {assert} from '../asserts.js';
|
||||||
import PBF from 'pbf';
|
import PBF from 'pbf';
|
||||||
import FeatureFormat, {transformWithOptions} from '../format/Feature.js';
|
import FeatureFormat, {transformWithOptions} from './Feature.js';
|
||||||
import FormatType from '../format/FormatType.js';
|
import FormatType from './FormatType.js';
|
||||||
import GeometryLayout from '../geom/GeometryLayout.js';
|
import GeometryLayout from '../geom/GeometryLayout.js';
|
||||||
import GeometryType from '../geom/GeometryType.js';
|
import GeometryType from '../geom/GeometryType.js';
|
||||||
import LineString from '../geom/LineString.js';
|
import LineString from '../geom/LineString.js';
|
||||||
@@ -23,17 +23,14 @@ import RenderFeature from '../render/Feature.js';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} Options
|
* @typedef {Object} Options
|
||||||
* @property {function((import("../geom/Geometry.js").default|Object<string,*>)=)|function(GeometryType,Array<number>,(Array<number>|Array<Array<number>>),Object<string,*>,number)} [featureClass]
|
* @property {import("./Feature.js").FeatureClass} [featureClass] Class for features returned by
|
||||||
* Class for features returned by {@link module:ol/format/MVT#readFeatures}. Set to
|
* {@link module:ol/format/MVT#readFeatures}. Set to {@link module:ol/Feature~Feature} to get full editing and geometry
|
||||||
* {@link module:ol/Feature~Feature} to get full editing and geometry support at the cost of
|
* support at the cost of decreased rendering performance. The default is
|
||||||
* decreased rendering performance. The default is {@link module:ol/render/Feature~RenderFeature},
|
* {@link module:ol/render/Feature~RenderFeature}, which is optimized for rendering and hit detection.
|
||||||
* which is optimized for rendering and hit detection.
|
* @property {string} [geometryName='geometry'] Geometry name to use when creating features.
|
||||||
* @property {string} [geometryName='geometry'] Geometry name to use when creating
|
* @property {string} [layerName='layer'] Name of the feature attribute that holds the layer name.
|
||||||
* features.
|
* @property {Array<string>} [layers] Layers to read features from. If not provided, features will be read from all
|
||||||
* @property {string} [layerName='layer'] Name of the feature attribute that
|
* layers.
|
||||||
* holds the layer name.
|
|
||||||
* @property {Array<string>} [layers] Layers to read features from. If not
|
|
||||||
* provided, features will be read from all layers.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -64,12 +61,9 @@ class MVT extends FeatureFormat {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {function((import("../geom/Geometry.js").default|Object<string,*>)=)|
|
* @type {import("./Feature.js").FeatureClass}
|
||||||
* function(GeometryType,Array<number>,
|
|
||||||
* (Array<number>|Array<Array<number>>),Object<string,*>,number)}
|
|
||||||
*/
|
*/
|
||||||
this.featureClass_ = options.featureClass ?
|
this.featureClass_ = options.featureClass ? options.featureClass : RenderFeature;
|
||||||
options.featureClass : RenderFeature;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ class DragAndDropEvent extends Event {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The features parsed from dropped data.
|
* The features parsed from dropped data.
|
||||||
* @type {Array<import("../Feature.js").default>|undefined}
|
* @type {Array<import("../format/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("../Feature.js").default>} Features.
|
* @return {Array<import("../format/Feature.js").FeatureLike>} Features.
|
||||||
*/
|
*/
|
||||||
tryReadFeatures_(format, text, options) {
|
tryReadFeatures_(format, text, options) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user