Module type for ol.format.Feature

This commit is contained in:
Frederic Junod
2018-03-22 11:33:46 +01:00
parent c19ddb1a19
commit d8c0e6e69b
11 changed files with 21 additions and 21 deletions

View File

@@ -26,7 +26,7 @@ import {loadFeaturesXhr} from './featureloader.js';
* @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate. * @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate.
* @param {module:ol/TileState~TileState} state State. * @param {module:ol/TileState~TileState} state State.
* @param {number} sourceRevision Source revision. * @param {number} sourceRevision Source revision.
* @param {module:ol/format/Feature~Feature} format Feature format. * @param {module:ol/format/Feature~FeatureFormat} format Feature format.
* @param {module:ol/Tile~LoadFunction} tileLoadFunction Tile load function. * @param {module:ol/Tile~LoadFunction} tileLoadFunction Tile load function.
* @param {module:ol/tilecoord~TileCoord} urlTileCoord Wrapped tile coordinate for source urls. * @param {module:ol/tilecoord~TileCoord} urlTileCoord Wrapped tile coordinate for source urls.
* @param {module:ol/Tile~UrlFunction} tileUrlFunction Tile url function. * @param {module:ol/Tile~UrlFunction} tileUrlFunction Tile url function.
@@ -36,7 +36,7 @@ import {loadFeaturesXhr} from './featureloader.js';
* @param {number} pixelRatio Pixel ratio. * @param {number} pixelRatio Pixel ratio.
* @param {module:ol/proj/Projection~Projection} projection Projection. * @param {module:ol/proj/Projection~Projection} projection Projection.
* @param {function(new: module:ol/VectorTile~VectorTile, module:ol/tilecoord~TileCoord, module:ol/TileState~TileState, string, * @param {function(new: module:ol/VectorTile~VectorTile, module:ol/tilecoord~TileCoord, module:ol/TileState~TileState, string,
* module:ol/format/Feature~Feature, module:ol/Tile~LoadFunction)} tileClass Class to * module:ol/format/Feature~FeatureFormat, module:ol/Tile~LoadFunction)} tileClass Class to
* instantiate for source tiles. * instantiate for source tiles.
* @param {function(this: module:ol/source/VectorTile~VectorTile, module:ol/events/Event~Event)} handleTileChange * @param {function(this: module:ol/source/VectorTile~VectorTile, module:ol/events/Event~Event)} handleTileChange
* Function to call when a source tile's state changes. * Function to call when a source tile's state changes.

View File

@@ -11,7 +11,7 @@ import TileState from './TileState.js';
* @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate. * @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate.
* @param {module:ol/TileState~TileState} state State. * @param {module:ol/TileState~TileState} state State.
* @param {string} src Data source url. * @param {string} src Data source url.
* @param {module:ol/format/Feature~Feature} format Feature format. * @param {module:ol/format/Feature~FeatureFormat} format Feature format.
* @param {module:ol/Tile~LoadFunction} tileLoadFunction Tile load function. * @param {module:ol/Tile~LoadFunction} tileLoadFunction Tile load function.
* @param {module:ol/Tile~Options=} opt_options Tile options. * @param {module:ol/Tile~Options=} opt_options Tile options.
*/ */
@@ -32,7 +32,7 @@ const VectorTile = function(tileCoord, state, src, format, tileLoadFunction, opt
/** /**
* @private * @private
* @type {module:ol/format/Feature~Feature} * @type {module:ol/format/Feature~FeatureFormat}
*/ */
this.format_ = format; this.format_ = format;
@@ -108,7 +108,7 @@ VectorTile.prototype.getExtent = function() {
/** /**
* Get the feature format assigned for reading this tile's features. * Get the feature format assigned for reading this tile's features.
* @return {module:ol/format/Feature~Feature} Feature format. * @return {module:ol/format/Feature~FeatureFormat} Feature format.
* @api * @api
*/ */
VectorTile.prototype.getFormat = function() { VectorTile.prototype.getFormat = function() {

View File

@@ -38,7 +38,7 @@ import FormatType from './format/FormatType.js';
/** /**
* @param {string|module:ol/featureloader~FeatureUrlFunction} url Feature URL service. * @param {string|module:ol/featureloader~FeatureUrlFunction} url Feature URL service.
* @param {module:ol/format/Feature~Feature} format Feature format. * @param {module:ol/format/Feature~FeatureFormat} format Feature format.
* @param {function(this:module:ol/VectorTile~VectorTile, Array.<module:ol/Feature~Feature>, module:ol/proj/Projection~Projection, module:ol/extent~Extent)|function(this:module:ol/source/Vector~Vector, Array.<module:ol/Feature~Feature>)} success * @param {function(this:module:ol/VectorTile~VectorTile, Array.<module:ol/Feature~Feature>, module:ol/proj/Projection~Projection, module:ol/extent~Extent)|function(this:module:ol/source/Vector~Vector, Array.<module:ol/Feature~Feature>)} success
* Function called with the loaded features and optionally with the data * Function called with the loaded features and optionally with the data
* projection. Called with the vector tile or source as `this`. * projection. Called with the vector tile or source as `this`.
@@ -111,7 +111,7 @@ export function loadFeaturesXhr(url, format, success, failure) {
* loads features (with XHR), parses the features, and adds them to the * loads features (with XHR), parses the features, and adds them to the
* vector source. * vector source.
* @param {string|module:ol/featureloader~FeatureUrlFunction} url Feature URL service. * @param {string|module:ol/featureloader~FeatureUrlFunction} url Feature URL service.
* @param {module:ol/format/Feature~Feature} format Feature format. * @param {module:ol/format/Feature~FeatureFormat} format Feature format.
* @return {module:ol/featureloader~FeatureLoader} The feature loader. * @return {module:ol/featureloader~FeatureLoader} The feature loader.
* @api * @api
*/ */

View File

@@ -52,7 +52,7 @@ import {get as getProjection, equivalent as equivalentProjection, transformExten
* Abstract base class; normally only used for creating subclasses and not * Abstract base class; normally only used for creating subclasses and not
* instantiated in apps. * instantiated in apps.
* Base class for feature formats. * Base class for feature formats.
* {ol.format.Feature} subclasses provide the ability to decode and encode * {module:ol/format/Feature~FeatureFormat} subclasses provide the ability to decode and encode
* {@link module:ol/Feature~Feature} objects from a variety of commonly used geospatial * {@link module:ol/Feature~Feature} objects from a variety of commonly used geospatial
* file formats. See the documentation for each format for more details. * file formats. See the documentation for each format for more details.
* *

View File

@@ -13,7 +13,7 @@ import FormatType from '../format/FormatType.js';
* *
* @constructor * @constructor
* @abstract * @abstract
* @extends {ol.format.Feature} * @extends {module:ol/format/Feature~FeatureFormat}
*/ */
const JSONFeature = function() { const JSONFeature = function() {
FeatureFormat.call(this); FeatureFormat.call(this);

View File

@@ -43,7 +43,7 @@ import RenderFeature from '../render/Feature.js';
* Feature format for reading data in the Mapbox MVT format. * Feature format for reading data in the Mapbox MVT format.
* *
* @constructor * @constructor
* @extends {ol.format.Feature} * @extends {module:ol/format/Feature~FeatureFormat}
* @param {module:ol/format/MVT~Options=} opt_options Options. * @param {module:ol/format/MVT~Options=} opt_options Options.
* @api * @api
*/ */

View File

@@ -13,7 +13,7 @@ import FormatType from '../format/FormatType.js';
* *
* @constructor * @constructor
* @abstract * @abstract
* @extends {ol.format.Feature} * @extends {module:ol/format/Feature~FeatureFormat}
*/ */
const TextFeature = function() { const TextFeature = function() {
FeatureFormat.call(this); FeatureFormat.call(this);

View File

@@ -15,7 +15,7 @@ import {isDocument, isNode, parse} from '../xml.js';
* *
* @constructor * @constructor
* @abstract * @abstract
* @extends {ol.format.Feature} * @extends {module:ol/format/Feature~FeatureFormat}
*/ */
const XMLFeature = function() { const XMLFeature = function() {

View File

@@ -14,7 +14,7 @@ import {get as getProjection} from '../proj.js';
/** /**
* @typedef {Object} Options * @typedef {Object} Options
* @property {Array.<function(new: ol.format.Feature)>} [formatConstructors] Format constructors. * @property {Array.<function(new: module:ol/format/Feature~FeatureFormat)>} [formatConstructors] Format constructors.
* @property {ol.source.Vector} [source] Optional vector source where features will be added. If a source is provided * @property {ol.source.Vector} [source] Optional vector source where features will be added. If a source is provided
* all existing features will be removed and new features will be added when * all existing features will be removed and new features will be added when
* they are dropped on the target. If you want to add features to a vector * they are dropped on the target. If you want to add features to a vector
@@ -100,7 +100,7 @@ const DragAndDrop = function(opt_options) {
/** /**
* @private * @private
* @type {Array.<function(new: ol.format.Feature)>} * @type {Array.<function(new: module:ol/format/Feature~FeatureFormat)>}
*/ */
this.formatConstructors_ = options.formatConstructors ? this.formatConstructors_ = options.formatConstructors ?
options.formatConstructors : []; options.formatConstructors : [];
@@ -183,7 +183,7 @@ DragAndDrop.prototype.handleResult_ = function(file, event) {
*/ */
const formatConstructor = formatConstructors[i]; const formatConstructor = formatConstructors[i];
/** /**
* @type {ol.format.Feature} * @type {module:ol/format/Feature~FeatureFormat}
*/ */
const format = new formatConstructor(); const format = new formatConstructor();
features = this.tryReadFeatures_(format, result, { features = this.tryReadFeatures_(format, result, {
@@ -247,7 +247,7 @@ DragAndDrop.prototype.setMap = function(map) {
/** /**
* @param {ol.format.Feature} format Format. * @param {module:ol/format/Feature~FeatureFormat} format Format.
* @param {string} text Text. * @param {string} text Text.
* @param {module:ol/format/Feature~ReadOptions} options Read options. * @param {module:ol/format/Feature~ReadOptions} options Read options.
* @private * @private

View File

@@ -79,7 +79,7 @@ const VectorSource = function(opt_options) {
/** /**
* @private * @private
* @type {ol.format.Feature|undefined} * @type {module:ol/format/Feature~FeatureFormat|undefined}
*/ */
this.format_ = options.format; this.format_ = options.format;
@@ -100,7 +100,7 @@ const VectorSource = function(opt_options) {
} else if (this.url_ !== undefined) { } else if (this.url_ !== undefined) {
assert(this.format_, 7); // `format` must be set when `url` is set assert(this.format_, 7); // `format` must be set when `url` is set
// create a XHR feature loader for "url" and "format" // create a XHR feature loader for "url" and "format"
this.loader_ = xhr(this.url_, /** @type {ol.format.Feature} */ (this.format_)); this.loader_ = xhr(this.url_, /** @type {module:ol/format/Feature~FeatureFormat} */ (this.format_));
} }
/** /**
@@ -656,7 +656,7 @@ VectorSource.prototype.getFeatureById = function(id) {
/** /**
* Get the format associated with this source. * Get the format associated with this source.
* *
* @return {ol.format.Feature|undefined} The feature format. * @return {module:ol/format/Feature~FeatureFormat|undefined} The feature format.
* @api * @api
*/ */
VectorSource.prototype.getFormat = function() { VectorSource.prototype.getFormat = function() {

View File

@@ -56,7 +56,7 @@ const VectorTileSource = function(options) {
/** /**
* @private * @private
* @type {ol.format.Feature} * @type {module:ol/format/Feature~FeatureFormat}
*/ */
this.format_ = options.format ? options.format : null; this.format_ = options.format ? options.format : null;
@@ -75,7 +75,7 @@ const VectorTileSource = function(options) {
/** /**
* @protected * @protected
* @type {function(new: module:ol/VectorTile~VectorTile, module:ol/tilecoord~TileCoord, module:ol/TileState~TileState, string, * @type {function(new: module:ol/VectorTile~VectorTile, module:ol/tilecoord~TileCoord, module:ol/TileState~TileState, string,
* ol.format.Feature, module:ol/Tile~LoadFunction)} * module:ol/format/Feature~FeatureFormat, module:ol/Tile~LoadFunction)}
*/ */
this.tileClass = options.tileClass ? options.tileClass : VectorTile; this.tileClass = options.tileClass ? options.tileClass : VectorTile;