Updated type annotations
This commit is contained in:
@@ -14,7 +14,7 @@ import {get as getProjection, equivalent as equivalentProjection, transformExten
|
||||
* can not be derived from the data and if no `defaultDataProjection` is set for a format,
|
||||
* the features will not be reprojected.
|
||||
* @property {module:ol/extent~Extent} extent Tile extent of the tile being read. This is only used and
|
||||
* required for {@link ol.format.MVT}.
|
||||
* required for {@link module:ol/format/MVT}.
|
||||
* @property {module:ol/proj~ProjectionLike} featureProjection Projection of the feature geometries
|
||||
* created by the format reader. If not provided, features will be returned in the
|
||||
* `dataProjection`.
|
||||
@@ -230,7 +230,7 @@ export function transformWithOptions(geometry, write, opt_options) {
|
||||
write ? featureProjection : dataProjection,
|
||||
write ? dataProjection : featureProjection);
|
||||
} else {
|
||||
// FIXME this is necessary because ol.format.GML treats extents
|
||||
// FIXME this is necessary because GML treats extents
|
||||
// as geometries
|
||||
transformed = transformExtent(
|
||||
geometry,
|
||||
|
||||
@@ -67,8 +67,7 @@ export const GMLNS = 'http://www.opengis.net/gml';
|
||||
* instantiated in apps.
|
||||
* Feature base format for reading and writing data in the GML format.
|
||||
* This class cannot be instantiated, it contains only base content that
|
||||
* is shared with versioned format classes ol.format.GML2 and
|
||||
* ol.format.GML3.
|
||||
* is shared with versioned format classes GML2 and GML3.
|
||||
*
|
||||
* @constructor
|
||||
* @abstract
|
||||
|
||||
@@ -328,7 +328,7 @@ function writePolygonGeometry(geometry, opt_options) {
|
||||
|
||||
/**
|
||||
* Read a feature from a GeoJSON Feature source. Only works for Feature or
|
||||
* geometry types. Use {@link ol.format.GeoJSON#readFeatures} to read
|
||||
* geometry types. Use {@link module:ol/format/GeoJSON#readFeatures} to read
|
||||
* FeatureCollection source. If feature at source has an id, it will be used
|
||||
* as Feature id by calling {@link module:ol/Feature#setId} internally.
|
||||
*
|
||||
|
||||
@@ -25,7 +25,7 @@ import RenderFeature from '../render/Feature.js';
|
||||
/**
|
||||
* @typedef {Object} Options
|
||||
* @property {function((module:ol/geom/Geometry|Object.<string,*>)=)|function(module:ol/geom/GeometryType,Array.<number>,(Array.<number>|Array.<Array.<number>>),Object.<string,*>,number)} [featureClass]
|
||||
* Class for features returned by {@link ol.format.MVT#readFeatures}. Set to
|
||||
* Class for features returned by {@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 {@link module:ol/render/Feature~RenderFeature},
|
||||
* which is optimized for rendering and hit detection.
|
||||
|
||||
@@ -21,7 +21,7 @@ import {createElementNS, isDocument, isNode, makeArrayPusher, makeChildAppender,
|
||||
* @typedef {Object} Options
|
||||
* @property {Object.<string, string>|string} [featureNS] The namespace URI used for features.
|
||||
* @property {Array.<string>|string} [featureType] The feature type to parse. Only used for read operations.
|
||||
* @property {module:ol/format/GMLBase} [gmlFormat] The GML format to use to parse the response. Default is `ol.format.GML3`.
|
||||
* @property {module:ol/format/GMLBase} [gmlFormat] The GML format to use to parse the response. Default is `ol/format/GML3`.
|
||||
* @property {string} [schemaLocation] Optional schemaLocation to use for serialization, this will override the default.
|
||||
*/
|
||||
|
||||
@@ -45,7 +45,7 @@ import {createElementNS, isDocument, isNode, makeArrayPusher, makeChildAppender,
|
||||
* Web Feature Services have repurposed `maxfeatures` instead.
|
||||
* @property {module:ol/extent~Extent} [bbox] Extent to use for the BBOX filter.
|
||||
* @property {module:ol/format/filter/Filter} [filter] Filter condition. See
|
||||
* {@link ol.format.filter} for more information.
|
||||
* {@link module:ol/format/Filter} for more information.
|
||||
* @property {string} [resultType] Indicates what response should be returned,
|
||||
* E.g. `hits` only includes the `numberOfFeatures` attribute in the response and no features.
|
||||
*/
|
||||
|
||||
@@ -82,7 +82,7 @@ const LayerGroup = function(opt_options) {
|
||||
layers = new Collection(layers.slice(), {unique: true});
|
||||
} else {
|
||||
assert(layers instanceof Collection,
|
||||
43); // Expected `layers` to be an array or an `ol.Collection`
|
||||
43); // Expected `layers` to be an array or a `Collection`
|
||||
layers = layers;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -21,7 +21,7 @@ import Layer from '../layer/Layer.js';
|
||||
* @property {module:ol/PluggableMap} [map] Sets the layer as overlay on a map. The map will not manage
|
||||
* this layer in its layers collection, and the layer will be rendered on top. This is useful for
|
||||
* temporary layers. The standard way to add a layer to a map and have it managed by the map is to
|
||||
* use {@link ol.Map#addLayer}.
|
||||
* use {@link module:ol/Map#addLayer}.
|
||||
* @property {module:ol/source/Image} [source] Source for this layer.
|
||||
*/
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import SourceState from '../source/State.js';
|
||||
* @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will
|
||||
* be visible.
|
||||
* @property {module:ol/source/Source} [source] Source for this layer. If not provided to the constructor,
|
||||
* the source can be set by calling {@link ol.layer.Layer#setSource layer.setSource(source)} after
|
||||
* the source can be set by calling {@link module:ol/layer/Layer#setSource layer.setSource(source)} after
|
||||
* construction.
|
||||
*/
|
||||
|
||||
@@ -52,7 +52,7 @@ import SourceState from '../source/State.js';
|
||||
* Layers group together those properties that pertain to how the data is to be
|
||||
* displayed, irrespective of the source of that data.
|
||||
*
|
||||
* Layers are usually added to a map with {@link ol.Map#addLayer}. Components
|
||||
* Layers are usually added to a map with {@link module:ol/Map#addLayer}. Components
|
||||
* like {@link module:ol/interaction/Select~Select} use unmanaged layers
|
||||
* internally. These unmanaged layers are associated with the map using
|
||||
* {@link module:ol/layer/Layer~Layer#setMap} instead.
|
||||
@@ -191,12 +191,12 @@ Layer.prototype.handleSourcePropertyChange_ = function() {
|
||||
/**
|
||||
* Sets the layer to be rendered on top of other layers on a map. The map will
|
||||
* not manage this layer in its layers collection, and the callback in
|
||||
* {@link ol.Map#forEachLayerAtPixel} will receive `null` as layer. This
|
||||
* {@link module:ol/Map#forEachLayerAtPixel} will receive `null` as layer. This
|
||||
* is useful for temporary layers. To remove an unmanaged layer from the map,
|
||||
* use `#setMap(null)`.
|
||||
*
|
||||
* To add the layer to a map and have it managed by the map, use
|
||||
* {@link ol.Map#addLayer} instead.
|
||||
* {@link module:ol/Map#addLayer} instead.
|
||||
* @param {module:ol/PluggableMap} map Map.
|
||||
* @api
|
||||
*/
|
||||
|
||||
@@ -26,7 +26,7 @@ import {assign} from '../obj.js';
|
||||
* @property {module:ol/PluggableMap} [map] Sets the layer as overlay on a map. The map will not manage
|
||||
* this layer in its layers collection, and the layer will be rendered on top. This is useful for
|
||||
* temporary layers. The standard way to add a layer to a map and have it managed by the map is to
|
||||
* use {@link ol.Map#addLayer}.
|
||||
* use {@link module:ol/Map#addLayer}.
|
||||
* @property {boolean} [useInterimTilesOnError=true] Use interim tiles on error.
|
||||
*/
|
||||
|
||||
@@ -82,7 +82,7 @@ TileLayer.prototype.getPreload = function() {
|
||||
|
||||
|
||||
/**
|
||||
* Return the associated {@link ol.source.Tile tilesource} of the layer.
|
||||
* Return the associated {@link module:ol/source/Tile tilesource} of the layer.
|
||||
* @function
|
||||
* @return {module:ol/source/Tile} Source.
|
||||
* @api
|
||||
|
||||
@@ -36,12 +36,12 @@ import {createDefaultStyle, toFunction as toStyleFunction} from '../style/Style.
|
||||
* @property {module:ol/PluggableMap} [map] Sets the layer as overlay on a map. The map will not manage
|
||||
* this layer in its layers collection, and the layer will be rendered on top. This is useful for
|
||||
* temporary layers. The standard way to add a layer to a map and have it managed by the map is to
|
||||
* use {@link ol.Map#addLayer}.
|
||||
* use {@link module:ol/Map#addLayer}.
|
||||
* @property {boolean} [declutter=false] Declutter images and text. Decluttering is applied to all
|
||||
* image and text styles, and the priority is defined by the z-index of the style. Lower z-index
|
||||
* means higher priority.
|
||||
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [style] Layer style. See
|
||||
* {@link ol.style} for default style which will be used if this is not defined.
|
||||
* {@link module:ol/style} for default style which will be used if this is not defined.
|
||||
* @property {number} [maxTilesLoading=16] Maximum number tiles to load simultaneously.
|
||||
* @property {boolean} [updateWhileAnimating=false] When set to `true`, feature batches will be
|
||||
* recreated during animations. This means that no vectors will be shown clipped, but the setting
|
||||
@@ -262,7 +262,7 @@ VectorLayer.prototype.setRenderOrder = function(renderOrder) {
|
||||
* an array of styles. If it is `undefined` the default style is used. If
|
||||
* it is `null` the layer has no style (a `null` style), so only features
|
||||
* that have their own styles will be rendered in the layer. See
|
||||
* {@link ol.style} for information on the default style.
|
||||
* {@link module:ol/style} for information on the default style.
|
||||
* @param {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction|null|undefined}
|
||||
* style Layer style.
|
||||
* @api
|
||||
|
||||
@@ -64,13 +64,13 @@ export const RenderType = {
|
||||
* @property {module:ol/PluggableMap} [map] Sets the layer as overlay on a map. The map will not manage
|
||||
* this layer in its layers collection, and the layer will be rendered on top. This is useful for
|
||||
* temporary layers. The standard way to add a layer to a map and have it managed by the map is to
|
||||
* use {@link ol.Map#addLayer}.
|
||||
* use {@link module:ol/Map#addLayer}.
|
||||
* @property {boolean} [declutter=false] Declutter images and text. Decluttering is applied to all
|
||||
* image and text styles, and the priority is defined by the z-index of the style. Lower z-index
|
||||
* means higher priority. When set to `true`, a `renderMode` of `'image'` will be overridden with
|
||||
* `'hybrid'`.
|
||||
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [style] Layer style. See
|
||||
* {@link ol.style} for default style which will be used if this is not defined.
|
||||
* {@link module:ol/style} for default style which will be used if this is not defined.
|
||||
* @property {number} [maxTilesLoading=16] Maximum number tiles to load simultaneously.
|
||||
* @property {boolean} [updateWhileAnimating=false] When set to `true`, feature batches will be
|
||||
* recreated during animations. This means that no vectors will be shown clipped, but the setting
|
||||
@@ -83,7 +83,7 @@ export const RenderType = {
|
||||
* @property {module:ol/render~OrderFunction} [renderOrder] Render order. Function to be used when sorting
|
||||
* features before rendering. By default features are drawn in the order that they are created.
|
||||
* @property {(module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction)} [style] Layer style. See
|
||||
* {@link ol.style} for default style which will be used if this is not defined.
|
||||
* {@link module:ol/style} for default style which will be used if this is not defined.
|
||||
* @property {boolean} [useInterimTilesOnError=true] Use interim tiles on error.
|
||||
*/
|
||||
|
||||
|
||||
@@ -20,14 +20,14 @@ import {METERS_PER_UNIT} from '../proj/Units.js';
|
||||
* Function to determine resolution at a point. The function is called with a
|
||||
* `{number}` view resolution and an `{module:ol/coordinate~Coordinate}` as arguments, and returns
|
||||
* the `{number}` resolution at the passed coordinate. If this is `undefined`,
|
||||
* the default {@link ol.proj#getPointResolution} function will be used.
|
||||
* the default {@link module:ol/proj#getPointResolution} function will be used.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* Projection definition class. One of these is created for each projection
|
||||
* supported in the application and stored in the {@link ol.proj} namespace.
|
||||
* supported in the application and stored in the {@link module:ol/proj} namespace.
|
||||
* You can use these in applications, but this is not required, as API params
|
||||
* and options use {@link module:ol/proj~ProjectionLike} which means the simple string
|
||||
* code will suffice.
|
||||
@@ -264,7 +264,7 @@ Projection.prototype.setWorldExtent = function(worldExtent) {
|
||||
|
||||
|
||||
/**
|
||||
* Set the getPointResolution function (see {@link ol.proj#getPointResolution}
|
||||
* Set the getPointResolution function (see {@link module:ol/proj~getPointResolution}
|
||||
* for this projection.
|
||||
* @param {function(number, module:ol/coordinate~Coordinate):number} func Function
|
||||
* @api
|
||||
|
||||
@@ -21,7 +21,7 @@ const RenderEvent = function(
|
||||
Event.call(this, type);
|
||||
|
||||
/**
|
||||
* For canvas, this is an instance of {@link ol.render.canvas.Immediate}.
|
||||
* For canvas, this is an instance of {@link module:ol/render/canvas/Immediate}.
|
||||
* @type {module:ol/render/VectorContext|undefined}
|
||||
* @api
|
||||
*/
|
||||
|
||||
@@ -64,7 +64,7 @@ import {create as createTransform} from '../transform.js';
|
||||
* rendered extent of the group in pixel space. `count` is the number of styles
|
||||
* in the group, i.e. 2 when an image and a text are grouped, or 1 otherwise.
|
||||
* In addition to these four elements, declutter instruction arrays (i.e. the
|
||||
* arguments to @{link ol.render.canvas.drawImage} are appended to the array.
|
||||
* arguments to {@link module:ol/render/canvas~drawImage} are appended to the array.
|
||||
* @typedef {Array.<*>} DeclutterGroup
|
||||
*/
|
||||
|
||||
@@ -155,7 +155,7 @@ export const defaultLineWidth = 1;
|
||||
|
||||
/**
|
||||
* The label cache for text rendering. To change the default cache size of 2048
|
||||
* entries, use {@link ol.structs.LRUCache#setSize}.
|
||||
* entries, use {@link module:ol/structs/LRUCache#setSize}.
|
||||
* @type {module:ol/structs/LRUCache.<HTMLCanvasElement>}
|
||||
* @api
|
||||
*/
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
// FIXME test, especially polygons with holes and multipolygons
|
||||
// FIXME need to handle large thick features (where pixel size matters)
|
||||
// FIXME add offset and end to ol.geom.flat.transform.transform2D?
|
||||
// FIXME add offset and end to ol/geom/flat/transform~transform2D?
|
||||
|
||||
import {inherits} from '../../index.js';
|
||||
import {equals} from '../../array.js';
|
||||
@@ -448,7 +448,7 @@ CanvasImmediateRenderer.prototype.setStyle = function(style) {
|
||||
|
||||
/**
|
||||
* Render a geometry into the canvas. Call
|
||||
* {@link ol.render.canvas.Immediate#setStyle} first to set the rendering style.
|
||||
* {@link module:ol/render/canvas/Immediate#setStyle} first to set the rendering style.
|
||||
*
|
||||
* @param {module:ol/geom/Geometry|module:ol/render/Feature} geometry The geometry to render.
|
||||
* @override
|
||||
|
||||
@@ -452,7 +452,7 @@ CanvasReplayGroup.prototype.isEmpty = function() {
|
||||
* @param {number} viewRotation View rotation.
|
||||
* @param {Object.<string, boolean>} skippedFeaturesHash Ids of features to skip.
|
||||
* @param {Array.<module:ol/render/ReplayType~ReplayType>=} opt_replayTypes Ordered replay types to replay.
|
||||
* Default is {@link ol.render.replay.ORDER}
|
||||
* Default is {@link module:ol/render/replay~ORDER}
|
||||
* @param {Object.<string, module:ol/render/canvas~DeclutterGroup>=} opt_declutterReplays Declutter replays.
|
||||
*/
|
||||
CanvasReplayGroup.prototype.replay = function(context,
|
||||
|
||||
@@ -17,7 +17,7 @@ import WebGLBuffer from '../../webgl/Buffer.js';
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {ol.render.webgl.Replay}
|
||||
* @extends {module:ol/render/webgl/Replay}
|
||||
* @param {number} tolerance Tolerance.
|
||||
* @param {module:ol/extent~Extent} maxExtent Max extent.
|
||||
* @struct
|
||||
|
||||
@@ -88,7 +88,7 @@ inherits(WebGLImmediateRenderer, VectorContext);
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.render.webgl.ReplayGroup} replayGroup Replay group.
|
||||
* @param {module:ol/render/webgl/ReplayGroup} replayGroup Replay group.
|
||||
* @param {module:ol/geom/Geometry|module:ol/render/Feature} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
|
||||
@@ -37,7 +37,7 @@ const Instruction = {
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {ol.render.webgl.Replay}
|
||||
* @extends {module:ol/render/webgl/Replay}
|
||||
* @param {number} tolerance Tolerance.
|
||||
* @param {module:ol/extent~Extent} maxExtent Max extent.
|
||||
* @struct
|
||||
|
||||
@@ -38,7 +38,7 @@ import WebGLBuffer from '../../webgl/Buffer.js';
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {ol.render.webgl.Replay}
|
||||
* @extends {module:ol/render/webgl/Replay}
|
||||
* @param {number} tolerance Tolerance.
|
||||
* @param {module:ol/extent~Extent} maxExtent Max extent.
|
||||
* @struct
|
||||
|
||||
@@ -20,7 +20,7 @@ const HIT_DETECTION_SIZE = [1, 1];
|
||||
|
||||
/**
|
||||
* @type {Object.<module:ol/render/ReplayType~ReplayType,
|
||||
* function(new: ol.render.webgl.Replay, number,
|
||||
* function(new: module:ol/render/webgl/Replay, number,
|
||||
* module:ol/extent~Extent)>}
|
||||
*/
|
||||
const BATCH_CONSTRUCTORS = {
|
||||
@@ -64,7 +64,7 @@ const WebGLReplayGroup = function(tolerance, maxExtent, opt_renderBuffer) {
|
||||
/**
|
||||
* @private
|
||||
* @type {!Object.<string,
|
||||
* Object.<module:ol/render/ReplayType~ReplayType, ol.render.webgl.Replay>>}
|
||||
* Object.<module:ol/render/ReplayType~ReplayType, module:ol/render/webgl/Replay>>}
|
||||
*/
|
||||
this.replaysByZIndex_ = {};
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import {createTexture} from '../../webgl/Context.js';
|
||||
/**
|
||||
* @constructor
|
||||
* @abstract
|
||||
* @extends {ol.render.webgl.Replay}
|
||||
* @extends {module:ol/render/webgl/Replay}
|
||||
* @param {number} tolerance Tolerance.
|
||||
* @param {module:ol/extent~Extent} maxExtent Max extent.
|
||||
* @struct
|
||||
|
||||
@@ -53,7 +53,7 @@ const WebGLVectorLayerRenderer = function(mapRenderer, vectorLayer) {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {ol.render.webgl.ReplayGroup}
|
||||
* @type {module:ol/render/webgl/ReplayGroup}
|
||||
*/
|
||||
this.replayGroup_ = null;
|
||||
|
||||
@@ -307,7 +307,7 @@ WebGLVectorLayerRenderer.prototype.prepareFrame = function(frameState, layerStat
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {(module:ol/style/Style|Array.<module:ol/style/Style>)} styles The style or array of
|
||||
* styles.
|
||||
* @param {ol.render.webgl.ReplayGroup} replayGroup Replay group.
|
||||
* @param {module:ol/render/webgl/ReplayGroup} replayGroup Replay group.
|
||||
* @return {boolean} `true` if an image is loading.
|
||||
*/
|
||||
WebGLVectorLayerRenderer.prototype.renderFeature = function(feature, resolution, pixelRatio, styles, replayGroup) {
|
||||
|
||||
@@ -32,7 +32,7 @@ import {createXYZ, extentFromProjection, createForProjection} from '../tilegrid.
|
||||
* var data = // ... fetch data
|
||||
* var format = tile.getFormat();
|
||||
* tile.setFeatures(format.readFeatures(data, {
|
||||
* // uncomment the line below for ol.format.MVT only
|
||||
* // uncomment the line below for ol/format/MVT only
|
||||
* extent: tile.getExtent(),
|
||||
* featureProjection: map.getView().getProjection()
|
||||
* }));
|
||||
|
||||
Reference in New Issue
Block a user