Merge pull request #8052 from fredj/jsdoc_module

More Jsdoc module fixes
This commit is contained in:
Frédéric Junod
2018-04-19 16:22:52 +02:00
committed by GitHub
41 changed files with 128 additions and 165 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ import GML3 from '../format/GML3.js';
* @constructor * @constructor
* @param {module:ol/format/GMLBase~Options=} opt_options * @param {module:ol/format/GMLBase~Options=} opt_options
* Optional configuration object. * Optional configuration object.
* @extends {ol.format.GMLBase} * @extends {module:ol/format/GMLBase~GMLBase}
* @api * @api
*/ */
const GML = GML3; const GML = GML3;
+1 -1
View File
@@ -27,7 +27,7 @@ const schemaLocation = GMLNS + ' http://schemas.opengis.net/gml/2.1.2/feature.xs
* *
* @constructor * @constructor
* @param {module:ol/format/GMLBase~Options=} opt_options Optional configuration object. * @param {module:ol/format/GMLBase~Options=} opt_options Optional configuration object.
* @extends {ol.format.GMLBase} * @extends {module:ol/format/GMLBase~GMLBase}
* @api * @api
*/ */
const GML2 = function(opt_options) { const GML2 = function(opt_options) {
+1 -1
View File
@@ -39,7 +39,7 @@ const schemaLocation = GMLNS +
* @constructor * @constructor
* @param {module:ol/format/GMLBase~Options=} opt_options * @param {module:ol/format/GMLBase~Options=} opt_options
* Optional configuration object. * Optional configuration object.
* @extends {ol.format.GMLBase} * @extends {module:ol/format/GMLBase~GMLBase}
* @api * @api
*/ */
const GML3 = function(opt_options) { const GML3 = function(opt_options) {
+2 -2
View File
@@ -118,7 +118,7 @@ const DEFAULT_VERSION = '1.1.0';
* Feature format for reading and writing data in the WFS format. * Feature format for reading and writing data in the WFS format.
* By default, supports WFS version 1.1.0. You can pass a GML format * By default, supports WFS version 1.1.0. You can pass a GML format
* as option if you want to read a WFS that contains GML2 (WFS 1.0.0). * as option if you want to read a WFS that contains GML2 (WFS 1.0.0).
* Also see {@link ol.format.GMLBase} which is used by this format. * Also see {@link module:ol/format/GMLBase~GMLBase} which is used by this format.
* *
* @constructor * @constructor
* @param {module:ol/format/WFS~Options=} opt_options Optional configuration object. * @param {module:ol/format/WFS~Options=} opt_options Optional configuration object.
@@ -142,7 +142,7 @@ const WFS = function(opt_options) {
/** /**
* @private * @private
* @type {ol.format.GMLBase} * @type {module:ol/format/GMLBase~GMLBase}
*/ */
this.gmlFormat_ = options.gmlFormat ? this.gmlFormat_ = options.gmlFormat ?
options.gmlFormat : new GML3(); options.gmlFormat : new GML3();
+2 -2
View File
@@ -246,7 +246,7 @@ Parser.prototype.consume_ = function() {
/** /**
* Tests if the given type matches the type of the current token. * Tests if the given type matches the type of the current token.
* @param {ol.format.TokenType} type Token type. * @param {module:ol/format/WKT~TokenType} type Token type.
* @return {boolean} Whether the token matches the given type. * @return {boolean} Whether the token matches the given type.
*/ */
Parser.prototype.isTokenType = function(type) { Parser.prototype.isTokenType = function(type) {
@@ -257,7 +257,7 @@ Parser.prototype.isTokenType = function(type) {
/** /**
* If the given type matches the current token, consume it. * If the given type matches the current token, consume it.
* @param {ol.format.TokenType} type Token type. * @param {module:ol/format/WKT~TokenType} type Token type.
* @return {boolean} Whether the token matches the given type. * @return {boolean} Whether the token matches the given type.
*/ */
Parser.prototype.match = function(type) { Parser.prototype.match = function(type) {
+2 -2
View File
@@ -15,7 +15,7 @@ import {get as getProjection} from '../proj.js';
/** /**
* @typedef {Object} Options * @typedef {Object} Options
* @property {Array.<function(new: module:ol/format/Feature~FeatureFormat)>} [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 {module:ol/source/Vector~VectorSource} [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
* source without removing the existing features (append only), instead of * source without removing the existing features (append only), instead of
@@ -120,7 +120,7 @@ const DragAndDrop = function(opt_options) {
/** /**
* @private * @private
* @type {ol.source.Vector} * @type {module:ol/source/Vector~VectorSource}
*/ */
this.source_ = options.source || null; this.source_ = options.source || null;
+1 -1
View File
@@ -169,7 +169,7 @@ BaseLayer.prototype.getOpacity = function() {
/** /**
* @abstract * @abstract
* @return {ol.source.State} Source state. * @return {module:ol/source/State~State} Source state.
*/ */
BaseLayer.prototype.getSourceState = function() {}; BaseLayer.prototype.getSourceState = function() {};
+1 -1
View File
@@ -33,7 +33,7 @@ import Style from '../style/Style.js';
* @property {string|function(module:ol/Feature~Feature):number} [weight='weight'] The feature * @property {string|function(module:ol/Feature~Feature):number} [weight='weight'] The feature
* attribute to use for the weight or a function that returns a weight from a feature. Weight values * attribute to use for the weight or a function that returns a weight from a feature. Weight values
* should range from 0 to 1 (and values outside will be clamped to that range). * should range from 0 to 1 (and values outside will be clamped to that range).
* @property {ol.source.Vector} [source] Source. * @property {module:ol/source/Vector~VectorSource} [source] Source.
*/ */
+3 -3
View File
@@ -22,7 +22,7 @@ import Layer from '../layer/Layer.js';
* this layer in its layers collection, and the layer will be rendered on top. This is useful for * 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 * 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 ol.Map#addLayer}.
* @property {ol.source.Image} [source] Source for this layer. * @property {module:ol/source/Image~ImageSource} [source] Source for this layer.
*/ */
@@ -57,9 +57,9 @@ inherits(ImageLayer, Layer);
/** /**
* Return the associated {@link ol.source.Image source} of the image layer. * Return the associated {@link module:ol/source/Image~ImageSource source} of the image layer.
* @function * @function
* @return {ol.source.Image} Source. * @return {module:ol/source/Image~ImageSource} Source.
* @api * @api
*/ */
ImageLayer.prototype.getSource; ImageLayer.prototype.getSource;
+4 -4
View File
@@ -24,7 +24,7 @@ import SourceState from '../source/State.js';
* visible. * visible.
* @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will * @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will
* be visible. * be visible.
* @property {ol.source.Source} [source] Source for this layer. If not provided to the constructor, * @property {module:ol/source/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 ol.layer.Layer#setSource layer.setSource(source)} after
* construction. * construction.
*/ */
@@ -142,13 +142,13 @@ Layer.prototype.getLayerStatesArray = function(opt_states) {
/** /**
* Get the layer source. * Get the layer source.
* @return {ol.source.Source} The layer source (or `null` if not yet set). * @return {module:ol/source/Source~Source} The layer source (or `null` if not yet set).
* @observable * @observable
* @api * @api
*/ */
Layer.prototype.getSource = function() { Layer.prototype.getSource = function() {
const source = this.get(LayerProperty.SOURCE); const source = this.get(LayerProperty.SOURCE);
return /** @type {ol.source.Source} */ (source) || null; return /** @type {module:ol/source/Source~Source} */ (source) || null;
}; };
@@ -226,7 +226,7 @@ Layer.prototype.setMap = function(map) {
/** /**
* Set the layer source. * Set the layer source.
* @param {ol.source.Source} source The layer source. * @param {module:ol/source/Source~Source} source The layer source.
* @observable * @observable
* @api * @api
*/ */
+3 -3
View File
@@ -32,7 +32,7 @@ import {createDefaultStyle, toFunction as toStyleFunction} from '../style/Style.
* texts are always rotated with the view and pixels are scaled during zoom animations. * texts are always rotated with the view and pixels are scaled during zoom animations.
* * `'vector'`: Vector layers are rendered as vectors. Most accurate rendering even during * * `'vector'`: Vector layers are rendered as vectors. Most accurate rendering even during
* animations, but slower performance. * animations, but slower performance.
* @property {ol.source.Vector} [source] Source. * @property {module:ol/source/Vector~VectorSource} [source] Source.
* @property {module:ol/PluggableMap~PluggableMap} [map] Sets the layer as overlay on a map. The map will not manage * @property {module:ol/PluggableMap~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 * 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 * temporary layers. The standard way to add a layer to a map and have it managed by the map is to
@@ -181,9 +181,9 @@ VectorLayer.prototype.getRenderOrder = function() {
/** /**
* Return the associated {@link ol.source.Vector vectorsource} of the layer. * Return the associated {@link module:ol/source/Vector~VectorSource vectorsource} of the layer.
* @function * @function
* @return {ol.source.Vector} Source. * @return {module:ol/source/Vector~VectorSource} Source.
* @api * @api
*/ */
VectorLayer.prototype.getSource; VectorLayer.prototype.getSource;
+3 -3
View File
@@ -40,7 +40,7 @@ import {assign} from '../obj.js';
* animations, but slower performance than the other options. * animations, but slower performance than the other options.
* *
* When `declutter` is set to `true`, `'hybrid'` will be used instead of `'image'`. * When `declutter` is set to `true`, `'hybrid'` will be used instead of `'image'`.
* @property {ol.source.VectorTile} [source] Source. * @property {module:ol/source/VectorTile~VectorTile} [source] Source.
* @property {module:ol/PluggableMap~PluggableMap} [map] Sets the layer as overlay on a map. The map will not manage * @property {module:ol/PluggableMap~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 * 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 * temporary layers. The standard way to add a layer to a map and have it managed by the map is to
@@ -161,9 +161,9 @@ VectorTileLayer.prototype.setUseInterimTilesOnError = function(useInterimTilesOn
/** /**
* Return the associated {@link ol.source.VectorTile vectortilesource} of the layer. * Return the associated {@link module:ol/source/VectorTile~VectorTile vectortilesource} of the layer.
* @function * @function
* @return {ol.source.VectorTile} Source. * @return {module:ol/source/VectorTile~VectorTile} Source.
* @api * @api
*/ */
VectorTileLayer.prototype.getSource; VectorTileLayer.prototype.getSource;
+1 -1
View File
@@ -128,7 +128,7 @@ CanvasVectorLayerRenderer.prototype.composeFrame = function(frameState, layerSta
const projection = viewState.projection; const projection = viewState.projection;
const rotation = viewState.rotation; const rotation = viewState.rotation;
const projectionExtent = projection.getExtent(); const projectionExtent = projection.getExtent();
const vectorSource = /** @type {ol.source.Vector} */ (this.getLayer().getSource()); const vectorSource = /** @type {module:ol/source/Vector~VectorSource} */ (this.getLayer().getSource());
let transform = this.getTransform(frameState, 0); let transform = this.getTransform(frameState, 0);
+5 -5
View File
@@ -165,7 +165,7 @@ CanvasVectorTileLayerRenderer.prototype.createReplayGroup_ = function(tile, fram
return; return;
} }
const source = /** @type {ol.source.VectorTile} */ (layer.getSource()); const source = /** @type {module:ol/source/VectorTile~VectorTile} */ (layer.getSource());
const sourceTileGrid = source.getTileGrid(); const sourceTileGrid = source.getTileGrid();
const tileGrid = source.getTileGridForProjection(projection); const tileGrid = source.getTileGridForProjection(projection);
const resolution = tileGrid.getResolution(tile.tileCoord[0]); const resolution = tileGrid.getResolution(tile.tileCoord[0]);
@@ -269,7 +269,7 @@ CanvasVectorTileLayerRenderer.prototype.forEachFeatureAtCoordinate = function(co
/** @type {Array.<module:ol/VectorImageTile~VectorImageTile>} */ /** @type {Array.<module:ol/VectorImageTile~VectorImageTile>} */
const renderedTiles = this.renderedTiles; const renderedTiles = this.renderedTiles;
const source = /** @type {ol.source.VectorTile} */ (layer.getSource()); const source = /** @type {module:ol/source/VectorTile~VectorTile} */ (layer.getSource());
const tileGrid = source.getTileGridForProjection(frameState.viewState.projection); const tileGrid = source.getTileGridForProjection(frameState.viewState.projection);
let bufferedExtent, found; let bufferedExtent, found;
let i, ii, replayGroup; let i, ii, replayGroup;
@@ -314,7 +314,7 @@ CanvasVectorTileLayerRenderer.prototype.forEachFeatureAtCoordinate = function(co
*/ */
CanvasVectorTileLayerRenderer.prototype.getReplayTransform_ = function(tile, frameState) { CanvasVectorTileLayerRenderer.prototype.getReplayTransform_ = function(tile, frameState) {
const layer = this.getLayer(); const layer = this.getLayer();
const source = /** @type {ol.source.VectorTile} */ (layer.getSource()); const source = /** @type {module:ol/source/VectorTile~VectorTile} */ (layer.getSource());
const tileGrid = source.getTileGrid(); const tileGrid = source.getTileGrid();
const tileCoord = tile.tileCoord; const tileCoord = tile.tileCoord;
const tileResolution = tileGrid.getResolution(tileCoord[0]); const tileResolution = tileGrid.getResolution(tileCoord[0]);
@@ -363,7 +363,7 @@ CanvasVectorTileLayerRenderer.prototype.handleStyleImageChange_ = function(event
CanvasVectorTileLayerRenderer.prototype.postCompose = function(context, frameState, layerState) { CanvasVectorTileLayerRenderer.prototype.postCompose = function(context, frameState, layerState) {
const layer = this.getLayer(); const layer = this.getLayer();
const declutterReplays = layer.getDeclutter() ? {} : null; const declutterReplays = layer.getDeclutter() ? {} : null;
const source = /** @type {ol.source.VectorTile} */ (layer.getSource()); const source = /** @type {module:ol/source/VectorTile~VectorTile} */ (layer.getSource());
const renderMode = layer.getRenderMode(); const renderMode = layer.getRenderMode();
const replayTypes = VECTOR_REPLAYS[renderMode]; const replayTypes = VECTOR_REPLAYS[renderMode];
const pixelRatio = frameState.pixelRatio; const pixelRatio = frameState.pixelRatio;
@@ -488,7 +488,7 @@ CanvasVectorTileLayerRenderer.prototype.renderTileImage_ = function(
const tileCoord = tile.wrappedTileCoord; const tileCoord = tile.wrappedTileCoord;
const z = tileCoord[0]; const z = tileCoord[0];
const pixelRatio = frameState.pixelRatio; const pixelRatio = frameState.pixelRatio;
const source = /** @type {ol.source.VectorTile} */ (layer.getSource()); const source = /** @type {module:ol/source/VectorTile~VectorTile} */ (layer.getSource());
const tileGrid = source.getTileGridForProjection(frameState.viewState.projection); const tileGrid = source.getTileGridForProjection(frameState.viewState.projection);
const resolution = tileGrid.getResolution(z); const resolution = tileGrid.getResolution(z);
const context = tile.getContext(layer); const context = tile.getContext(layer);
+1 -1
View File
@@ -20,7 +20,7 @@ import Triangulation from '../reproj/Triangulation.js';
/** /**
* @classdesc * @classdesc
* Class encapsulating single reprojected image. * Class encapsulating single reprojected image.
* See {@link ol.source.Image}. * See {@link module:ol/source/Image~ImageSource}.
* *
* @constructor * @constructor
* @extends {module:ol/ImageBase~ImageBase} * @extends {module:ol/ImageBase~ImageBase}
+1 -1
View File
@@ -21,7 +21,7 @@ import Triangulation from '../reproj/Triangulation.js';
/** /**
* @classdesc * @classdesc
* Class encapsulating single reprojected tile. * Class encapsulating single reprojected tile.
* See {@link ol.source.TileImage}. * See {@link module:ol/source/TileImage~TileImage}.
* *
* @constructor * @constructor
* @extends {module:ol/Tile~Tile} * @extends {module:ol/Tile~Tile}
+1 -1
View File
@@ -37,7 +37,7 @@ import {createXYZ, extentFromProjection} from '../tilegrid.js';
* Layer source for Bing Maps tile data. * Layer source for Bing Maps tile data.
* *
* @constructor * @constructor
* @extends {ol.source.TileImage} * @extends {module:ol/source/TileImage~TileImage}
* @param {module:ol/source/BingMaps~Options=} options Bing Maps options. * @param {module:ol/source/BingMaps~Options=} options Bing Maps options.
* @api * @api
*/ */
+1 -1
View File
@@ -36,7 +36,7 @@ import XYZ from '../source/XYZ.js';
* Layer source for the CartoDB Maps API. * Layer source for the CartoDB Maps API.
* *
* @constructor * @constructor
* @extends {ol.source.XYZ} * @extends {module:ol/source/XYZ~XYZ}
* @param {module:ol/source/CartoDB~Options=} options CartoDB options. * @param {module:ol/source/CartoDB~Options=} options CartoDB options.
* @api * @api
*/ */
+5 -5
View File
@@ -16,7 +16,7 @@ import VectorSource from '../source/Vector.js';
* @typedef {Object} Options * @typedef {Object} Options
* @property {ol.AttributionLike} [attributions] Attributions. * @property {ol.AttributionLike} [attributions] Attributions.
* @property {number} [distance=20] Minimum distance in pixels between clusters. * @property {number} [distance=20] Minimum distance in pixels between clusters.
* @property {ol.Extent} [extent] Extent. * @property {module:ol/extent~Extent} [extent] Extent.
* @property {ol.format.Feature} [format] Format. * @property {ol.format.Feature} [format] Format.
* @property {function(module:ol/Feature~Feature):module:ol/geom/Point~Point} [geometryFunction] * @property {function(module:ol/Feature~Feature):module:ol/geom/Point~Point} [geometryFunction]
* Function that takes an {@link module:ol/Feature~Feature} as argument and returns an * Function that takes an {@link module:ol/Feature~Feature} as argument and returns an
@@ -32,7 +32,7 @@ import VectorSource from '../source/Vector.js';
* See {@link module:ol/geom/Polygon~Polygon#getInteriorPoint} for a way to get a cluster * See {@link module:ol/geom/Polygon~Polygon#getInteriorPoint} for a way to get a cluster
* calculation point for polygons. * calculation point for polygons.
* @property {module:ol/proj~ProjectionLike} projection Projection. * @property {module:ol/proj~ProjectionLike} projection Projection.
* @property {ol.source.Vector} source Source. * @property {module:ol/source/Vector~VectorSource} source Source.
* @property {boolean} [wrapX=true] Whether to wrap the world horizontally. * @property {boolean} [wrapX=true] Whether to wrap the world horizontally.
*/ */
@@ -45,7 +45,7 @@ import VectorSource from '../source/Vector.js';
* *
* @constructor * @constructor
* @param {module:ol/source/Cluster~Options=} options Cluster options. * @param {module:ol/source/Cluster~Options=} options Cluster options.
* @extends {ol.source.Vector} * @extends {module:ol/source/Vector~VectorSource}
* @api * @api
*/ */
const Cluster = function(options) { const Cluster = function(options) {
@@ -87,7 +87,7 @@ const Cluster = function(options) {
}; };
/** /**
* @type {ol.source.Vector} * @type {module:ol/source/Vector~VectorSource}
* @protected * @protected
*/ */
this.source = options.source; this.source = options.source;
@@ -110,7 +110,7 @@ Cluster.prototype.getDistance = function() {
/** /**
* Get a reference to the wrapped source. * Get a reference to the wrapped source.
* @return {ol.source.Vector} Source. * @return {module:ol/source/Vector~VectorSource} Source.
* @api * @api
*/ */
Cluster.prototype.getSource = function() { Cluster.prototype.getSource = function() {
+3 -3
View File
@@ -43,7 +43,7 @@ const ImageSourceEventType = {
/** /**
* @classdesc * @classdesc
* Events emitted by {@link ol.source.Image} instances are instances of this * Events emitted by {@link module:ol/source/Image~ImageSource} instances are instances of this
* type. * type.
* *
* @constructor * @constructor
@@ -73,7 +73,7 @@ inherits(ImageSourceEvent, Event);
* @property {module:ol/extent~Extent} [extent] * @property {module:ol/extent~Extent} [extent]
* @property {module:ol/proj~ProjectionLike} projection * @property {module:ol/proj~ProjectionLike} projection
* @property {Array.<number>} [resolutions] * @property {Array.<number>} [resolutions]
* @property {ol.source.State} [state] * @property {module:ol/source/State~State} [state]
*/ */
@@ -85,7 +85,7 @@ inherits(ImageSourceEvent, Event);
* *
* @constructor * @constructor
* @abstract * @abstract
* @extends {ol.source.Source} * @extends {module:ol/source/Source~Source}
* @param {module:ol/source/Image~Options} options Single image source options. * @param {module:ol/source/Image~Options} options Single image source options.
* @api * @api
*/ */
+1 -1
View File
@@ -50,7 +50,7 @@ import {appendParams} from '../uri.js';
* *
* @constructor * @constructor
* @fires ol.source.Image.Event * @fires ol.source.Image.Event
* @extends {ol.source.Image} * @extends {module:ol/source/Image~ImageSource}
* @param {module:ol/source/ImageArcGISRest~Options=} opt_options Image ArcGIS Rest Options. * @param {module:ol/source/ImageArcGISRest~Options=} opt_options Image ArcGIS Rest Options.
* @api * @api
*/ */
+4 -4
View File
@@ -11,9 +11,9 @@ import ImageSource from '../source/Image.js';
* @property {ol.AttributionLike} [attributions] Attributions. * @property {ol.AttributionLike} [attributions] Attributions.
* @property {ol.CanvasFunctionType} [canvasFunction] Canvas function. * @property {ol.CanvasFunctionType} [canvasFunction] Canvas function.
* The function returning the canvas element used by the source * The function returning the canvas element used by the source
* as an image. The arguments passed to the function are: `{ol.Extent}` the * as an image. The arguments passed to the function are: `{module:ol/extent~Extent}` the
* image extent, `{number}` the image resolution, `{number}` the device pixel * image extent, `{number}` the image resolution, `{number}` the device pixel
* ratio, `{ol.Size}` the image size, and `{module:ol/proj/Projection~Projection}` the image * ratio, `{module:ol/size~Size}` the image size, and `{module:ol/proj/Projection~Projection}` the image
* projection. The canvas returned by this function is cached by the source. If * projection. The canvas returned by this function is cached by the source. If
* the value returned by the function is later changed then * the value returned by the function is later changed then
* `changed` should be called on the source for the source to * `changed` should be called on the source for the source to
@@ -23,7 +23,7 @@ import ImageSource from '../source/Image.js';
* width and height of the map viewport, and so on. Must be `1` or higher. * width and height of the map viewport, and so on. Must be `1` or higher.
* @property {Array.<number>} [resolutions] Resolutions. * @property {Array.<number>} [resolutions] Resolutions.
* If specified, new canvases will be created for these resolutions * If specified, new canvases will be created for these resolutions
* @property {ol.source.State} [state] Source state. * @property {module:ol/source/State~State} [state] Source state.
*/ */
@@ -32,7 +32,7 @@ import ImageSource from '../source/Image.js';
* Base class for image sources where a canvas element is the image. * Base class for image sources where a canvas element is the image.
* *
* @constructor * @constructor
* @extends {ol.source.Image} * @extends {module:ol/source/Image~ImageSource}
* @param {module:ol/source/ImageCanvas~Options=} options ImageCanvas options. * @param {module:ol/source/ImageCanvas~Options=} options ImageCanvas options.
* @api * @api
*/ */
+1 -1
View File
@@ -34,7 +34,7 @@ import {appendParams} from '../uri.js';
* *
* @constructor * @constructor
* @fires ol.source.Image.Event * @fires ol.source.Image.Event
* @extends {ol.source.Image} * @extends {module:ol/source/Image~ImageSource}
* @param {module:ol/source/ImageMapGuide~Options=} options ImageMapGuide options. * @param {module:ol/source/ImageMapGuide~Options=} options ImageMapGuide options.
* @api * @api
*/ */
+3 -3
View File
@@ -18,11 +18,11 @@ import ImageSource, {defaultImageLoadFunction} from '../source/Image.js';
* you must provide a `crossOrigin` value if you are using the WebGL renderer or if you want to * you must provide a `crossOrigin` value if you are using the WebGL renderer or if you want to
* access pixel data with the Canvas renderer. See * access pixel data with the Canvas renderer. See
* {@link https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image} for more detail. * {@link https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image} for more detail.
* @property {ol.Extent} [imageExtent] Extent of the image in map coordinates. * @property {module:ol/extent~Extent} [imageExtent] Extent of the image in map coordinates.
* This is the [left, bottom, right, top] map coordinates of your image. * This is the [left, bottom, right, top] map coordinates of your image.
* @property {ol.ImageLoadFunctionType} [imageLoadFunction] Optional function to load an image given a URL. * @property {ol.ImageLoadFunctionType} [imageLoadFunction] Optional function to load an image given a URL.
* @property {module:ol/proj~ProjectionLike} projection Projection. * @property {module:ol/proj~ProjectionLike} projection Projection.
* @property {ol.Size} [imageSize] Size of the image in pixels. Usually the image size is auto-detected, so this * @property {module:ol/size~Size} [imageSize] Size of the image in pixels. Usually the image size is auto-detected, so this
* only needs to be set if auto-detection fails for some reason. * only needs to be set if auto-detection fails for some reason.
* @property {string} url Image URL. * @property {string} url Image URL.
*/ */
@@ -33,7 +33,7 @@ import ImageSource, {defaultImageLoadFunction} from '../source/Image.js';
* A layer source for displaying a single, static image. * A layer source for displaying a single, static image.
* *
* @constructor * @constructor
* @extends {ol.source.Image} * @extends {module:ol/source/Image~ImageSource}
* @param {module:ol/source/ImageStatic~Options=} options ImageStatic options. * @param {module:ol/source/ImageStatic~Options=} options ImageStatic options.
* @api * @api
*/ */
+1 -1
View File
@@ -49,7 +49,7 @@ import {appendParams} from '../uri.js';
* *
* @constructor * @constructor
* @fires ol.source.Image.Event * @fires ol.source.Image.Event
* @extends {ol.source.Image} * @extends {module:ol/source/Image~ImageSource}
* @param {module:ol/source/ImageWMS~Options=} [opt_options] ImageWMS options. * @param {module:ol/source/ImageWMS~Options=} [opt_options] ImageWMS options.
* @api * @api
*/ */
+1 -1
View File
@@ -46,7 +46,7 @@ export const ATTRIBUTION = '&copy; ' +
* Layer source for the OpenStreetMap tile server. * Layer source for the OpenStreetMap tile server.
* *
* @constructor * @constructor
* @extends {ol.source.XYZ} * @extends {module:ol/source/XYZ~XYZ}
* @param {module:ol/source/OSM~Options=} [opt_options] Open Street Map options. * @param {module:ol/source/OSM~Options=} [opt_options] Open Street Map options.
* @api * @api
*/ */
+5 -5
View File
@@ -84,7 +84,7 @@ inherits(RasterSourceEvent, Event);
/** /**
* @typedef {Object} Options * @typedef {Object} Options
* @property {Array.<ol.source.Source>} sources Input sources. * @property {Array.<module:ol/source/Source~Source>} sources Input sources.
* @property {ol.RasterOperation} [operation] Raster operation. * @property {ol.RasterOperation} [operation] Raster operation.
* The operation will be called with data from input sources * The operation will be called with data from input sources
* and the output will be assigned to the raster source. * and the output will be assigned to the raster source.
@@ -109,7 +109,7 @@ inherits(RasterSourceEvent, Event);
* output pixel values. * output pixel values.
* *
* @constructor * @constructor
* @extends {ol.source.Image} * @extends {module:ol/source/Image~ImageSource}
* @fires ol.source.Raster.Event * @fires ol.source.Raster.Event
* @param {module:ol/source/Raster~Options=} options Options. * @param {module:ol/source/Raster~Options=} options Options.
* @api * @api
@@ -436,7 +436,7 @@ function getLayerStatesArray(renderers) {
/** /**
* Create renderers for all sources. * Create renderers for all sources.
* @param {Array.<ol.source.Source>} sources The sources. * @param {Array.<module:ol/source/Source~Source>} sources The sources.
* @return {Array.<ol.renderer.canvas.Layer>} Array of layer renderers. * @return {Array.<ol.renderer.canvas.Layer>} Array of layer renderers.
*/ */
function createRenderers(sources) { function createRenderers(sources) {
@@ -451,7 +451,7 @@ function createRenderers(sources) {
/** /**
* Create a renderer for the provided source. * Create a renderer for the provided source.
* @param {ol.source.Source} source The source. * @param {module:ol/source/Source~Source} source The source.
* @return {ol.renderer.canvas.Layer} The renderer. * @return {ol.renderer.canvas.Layer} The renderer.
*/ */
function createRenderer(source) { function createRenderer(source) {
@@ -467,7 +467,7 @@ function createRenderer(source) {
/** /**
* Create an image renderer for the provided source. * Create an image renderer for the provided source.
* @param {ol.source.Image} source The source. * @param {module:ol/source/Image~ImageSource} source The source.
* @return {ol.renderer.canvas.Layer} The renderer. * @return {ol.renderer.canvas.Layer} The renderer.
*/ */
function createImageRenderer(source) { function createImageRenderer(source) {
+5 -5
View File
@@ -12,7 +12,7 @@ import SourceState from '../source/State.js';
* @typedef {Object} Options * @typedef {Object} Options
* @property {ol.AttributionLike} [attributions] * @property {ol.AttributionLike} [attributions]
* @property {module:ol/proj~ProjectionLike} projection * @property {module:ol/proj~ProjectionLike} projection
* @property {ol.source.State} [state] * @property {module:ol/source/State~State} [state]
* @property {boolean} [wrapX] * @property {boolean} [wrapX]
*/ */
@@ -49,7 +49,7 @@ const Source = function(options) {
/** /**
* @private * @private
* @type {ol.source.State} * @type {module:ol/source/State~State}
*/ */
this.state_ = options.state !== undefined ? this.state_ = options.state !== undefined ?
options.state : SourceState.READY; options.state : SourceState.READY;
@@ -129,8 +129,8 @@ Source.prototype.getResolutions = function() {};
/** /**
* Get the state of the source, see {@link ol.source.State} for possible states. * Get the state of the source, see {@link module:ol/source/State~State} for possible states.
* @return {ol.source.State} State. * @return {module:ol/source/State~State} State.
* @api * @api
*/ */
Source.prototype.getState = function() { Source.prototype.getState = function() {
@@ -170,7 +170,7 @@ Source.prototype.setAttributions = function(attributions) {
/** /**
* Set the state of the source. * Set the state of the source.
* @param {ol.source.State} state State. * @param {module:ol/source/State~State} state State.
* @protected * @protected
*/ */
Source.prototype.setState = function(state) { Source.prototype.setState = function(state) {
+1 -1
View File
@@ -114,7 +114,7 @@ const ProviderConfig = {
* Layer source for the Stamen tile server. * Layer source for the Stamen tile server.
* *
* @constructor * @constructor
* @extends {ol.source.XYZ} * @extends {module:ol/source/XYZ~XYZ}
* @param {module:ol/source/Stamen~Options=} options Stamen options. * @param {module:ol/source/Stamen~Options=} options Stamen options.
* @api * @api
*/ */
+3 -3
View File
@@ -20,8 +20,8 @@ import {wrapX, getForProjection as getTileGridForProjection} from '../tilegrid.j
* @property {boolean} [opaque] * @property {boolean} [opaque]
* @property {number} [tilePixelRatio] * @property {number} [tilePixelRatio]
* @property {module:ol/proj~ProjectionLike} [projection] * @property {module:ol/proj~ProjectionLike} [projection]
* @property {ol.source.State} [state] * @property {module:ol/source/State~State} [state]
* @property {ol.tilegrid.TileGrid} [tileGrid] * @property {module:ol/tilegrid/TileGrid~TileGrid} [tileGrid]
* @property {boolean} [wrapX=true] * @property {boolean} [wrapX=true]
* @property {number} [transition] * @property {number} [transition]
*/ */
@@ -35,7 +35,7 @@ import {wrapX, getForProjection as getTileGridForProjection} from '../tilegrid.j
* *
* @constructor * @constructor
* @abstract * @abstract
* @extends {ol.source.Source} * @extends {module:ol/source/Source~Source}
* @param {module:ol/source/Tile~Options=} options SourceTile source options. * @param {module:ol/source/Tile~Options=} options SourceTile source options.
* @api * @api
*/ */
+2 -2
View File
@@ -16,10 +16,10 @@ import {appendParams} from '../uri.js';
* Services are supported. * Services are supported.
* *
* For cached ArcGIS services, better performance is available using the * For cached ArcGIS services, better performance is available using the
* {@link ol.source.XYZ} data source. * {@link module:ol/source/XYZ~XYZ} data source.
* *
* @constructor * @constructor
* @extends {ol.source.TileImage} * @extends {module:ol/source/TileImage~TileImage}
* @param {olx.source.TileArcGISRestOptions=} opt_options Tile ArcGIS Rest * @param {olx.source.TileArcGISRestOptions=} opt_options Tile ArcGIS Rest
* options. * options.
* @api * @api
+1 -1
View File
@@ -78,7 +78,7 @@ LabeledTile.prototype.load = function() {};
/** /**
* @typedef {Object} Options * @typedef {Object} Options
* @property {module:ol/proj~ProjectionLike} projection Projection. * @property {module:ol/proj~ProjectionLike} projection Projection.
* @property {ol.tilegrid.TileGrid} [tileGrid] Tile grid. * @property {module:ol/tilegrid/TileGrid~TileGrid} [tileGrid] Tile grid.
* @property {boolean} [wrapX=true] Whether to wrap the world horizontally. * @property {boolean} [wrapX=true] Whether to wrap the world horizontally.
*/ */
+6 -6
View File
@@ -1,5 +1,5 @@
/** /**
* @module ol/source/TileImage * @module module:ol/source/TileImage~TileImage
*/ */
import {ENABLE_RASTER_REPROJECTION} from '../reproj/common.js'; import {ENABLE_RASTER_REPROJECTION} from '../reproj/common.js';
import {getUid, inherits} from '../index.js'; import {getUid, inherits} from '../index.js';
@@ -26,12 +26,12 @@ import {getForProjection as getTileGridForProjection} from '../tilegrid.js';
* @property {module:ol/proj~ProjectionLike} projection Projection. * @property {module:ol/proj~ProjectionLike} projection Projection.
* @property {boolean} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels). * @property {boolean} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels).
* Higher values can increase reprojection performance, but decrease precision. * Higher values can increase reprojection performance, but decrease precision.
* @property {ol.source.State} [state] Source state. * @property {module:ol/source/State~State} [state] Source state.
* @property {function(new: ol.ImageTile, ol.TileCoord, * @property {function(new: module:ol/ImageTile~ImageTile, module:ol/tilecoord~TileCoord,
* ol.TileState, string, ?string, * module:ol/TileState~TileState, string, ?string,
* ol.TileLoadFunctionType)} [tileClass] Class used to instantiate image tiles. * ol.TileLoadFunctionType)} [tileClass] Class used to instantiate image tiles.
* Default is {@link ol.ImageTile}. * Default is {@link module:ol/ImageTile~ImageTile}.
* @property {ol.tilegrid.TileGrid} [tileGrid] Tile grid. * @property {module:ol/tilegrid/TileGrid~TileGrid} [tileGrid] Tile grid.
* @property {ol.TileLoadFunctionType} [tileLoadFunction] Optional function to load a tile given a URL. The default is * @property {ol.TileLoadFunctionType} [tileLoadFunction] Optional function to load a tile given a URL. The default is
* ```js * ```js
* function(imageTile, src) { * function(imageTile, src) {
+1 -1
View File
@@ -49,7 +49,7 @@ import {createXYZ, extentFromProjection} from '../tilegrid.js';
* Layer source for tile data in TileJSON format. * Layer source for tile data in TileJSON format.
* *
* @constructor * @constructor
* @extends {ol.source.TileImage} * @extends {module:ol/source/TileImage~TileImage}
* @param {module:ol/source/TileJSON~Options=} options TileJSON options. * @param {module:ol/source/TileJSON~Options=} options TileJSON options.
* @api * @api
*/ */
+5 -5
View File
@@ -43,11 +43,11 @@ import {appendParams} from '../uri.js';
* @property {module:ol/proj~ProjectionLike} projection Projection. * @property {module:ol/proj~ProjectionLike} projection Projection.
* @property {boolean} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels). * @property {boolean} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels).
* Higher values can increase reprojection performance, but decrease precision. * Higher values can increase reprojection performance, but decrease precision.
* @property {function(new: ol.ImageTile, ol.TileCoord, * @property {function(new: module:ol/ImageTile~ImageTile, module:ol/tilecoord~TileCoord,
* ol.TileState, string, ?string, * module:ol/TileState~TileState, string, ?string,
* ol.TileLoadFunctionType)} [tileClass] Class used to instantiate image tiles. * ol.TileLoadFunctionType)} [tileClass] Class used to instantiate image tiles.
* Default is {@link ol.ImageTile}. * Default is {@link module:ol/ImageTile~ImageTile}.
* @property {ol.tilegrid.TileGrid} [tileGrid] Tile grid. Base this on the resolutions, * @property {module:ol/tilegrid/TileGrid~TileGrid} [tileGrid] Tile grid. Base this on the resolutions,
* tilesize and extent supported by the server. * tilesize and extent supported by the server.
* If this is not defined, a default grid will be used: if there is a projection * If this is not defined, a default grid will be used: if there is a projection
* extent, the grid will be based on that; if not, a grid based on a global * extent, the grid will be based on that; if not, a grid based on a global
@@ -78,7 +78,7 @@ import {appendParams} from '../uri.js';
* Layer source for tile data from WMS servers. * Layer source for tile data from WMS servers.
* *
* @constructor * @constructor
* @extends {ol.source.TileImage} * @extends {module:ol/source/TileImage~TileImage}
* @param {module:ol/source/TileWMS~Options=} [opt_options] Tile WMS options. * @param {module:ol/source/TileWMS~Options=} [opt_options] Tile WMS options.
* @api * @api
*/ */
+2 -2
View File
@@ -15,8 +15,8 @@ import {getKeyZXY} from '../tilecoord.js';
* @property {module:ol/extent~Extent} [extent] * @property {module:ol/extent~Extent} [extent]
* @property {boolean} [opaque] * @property {boolean} [opaque]
* @property {module:ol/proj~ProjectionLike} [projection] * @property {module:ol/proj~ProjectionLike} [projection]
* @property {ol.source.State} [state] * @property {module:ol/source/State~State} [state]
* @property {ol.tilegrid.TileGrid} [tileGrid] * @property {module:ol/tilegrid/TileGrid~TileGrid} [tileGrid]
* @property {module:ol/Tile~LoadFunction} tileLoadFunction * @property {module:ol/Tile~LoadFunction} tileLoadFunction
* @property {number} [tilePixelRatio] * @property {number} [tilePixelRatio]
* @property {module:ol/Tile~UrlFunction} [tileUrlFunction] * @property {module:ol/Tile~UrlFunction} [tileUrlFunction]
+15 -15
View File
@@ -24,7 +24,7 @@ import RBush from '../structs/RBush.js';
/** /**
* @classdesc * @classdesc
* Events emitted by {@link ol.source.Vector} instances are instances of this * Events emitted by {@link module:ol/source/Vector~VectorSource} instances are instances of this
* type. * type.
* *
* @constructor * @constructor
@@ -54,7 +54,7 @@ inherits(VectorSourceEvent, Event);
* @property {Array.<module:ol/Feature~Feature>|ol.Collection.<module:ol/Feature~Feature>} [features] * @property {Array.<module:ol/Feature~Feature>|ol.Collection.<module:ol/Feature~Feature>} [features]
* Features. If provided as {@link ol.Collection}, the features in the source * Features. If provided as {@link ol.Collection}, the features in the source
* and the collection will stay in sync. * and the collection will stay in sync.
* @property {ol.format.Feature} [format] The feature format used by the XHR * @property {module:ol/format/Feature~FeatureFormat} [format] The feature format used by the XHR
* feature loader when `url` is set. Required if `url` is set, otherwise ignored. * feature loader when `url` is set. Required if `url` is set, otherwise ignored.
* @property {module:ol/Feature~FeatureLoader} [loader] * @property {module:ol/Feature~FeatureLoader} [loader]
* The loader function used to load features, from a remote source for example. * The loader function used to load features, from a remote source for example.
@@ -64,7 +64,7 @@ inherits(VectorSourceEvent, Event);
* Example: * Example:
* *
* ```js * ```js
* var vectorSource = new ol.source.Vector({ * var vectorSource = new module:ol/source/Vector~VectorSource({
* format: new ol.format.GeoJSON(), * format: new ol.format.GeoJSON(),
* loader: function(extent, resolution, projection) { * loader: function(extent, resolution, projection) {
* var proj = projection.getCode(); * var proj = projection.getCode();
@@ -119,15 +119,15 @@ inherits(VectorSourceEvent, Event);
* `false` may improve performance. * `false` may improve performance.
* *
* Note that * Note that
* {@link ol.source.Vector#getFeaturesInExtent}, * {@link module:ol/source/Vector~VectorSource#getFeaturesInExtent},
* {@link ol.source.Vector#getClosestFeatureToCoordinate} and * {@link module:ol/source/Vector~VectorSource#getClosestFeatureToCoordinate} and
* {@link ol.source.Vector#getExtent} cannot be used when `useSpatialIndex` is * {@link module:ol/source/Vector~VectorSource#getExtent} cannot be used when `useSpatialIndex` is
* set to `false`, and {@link ol.source.Vector#forEachFeatureInExtent} will loop * set to `false`, and {@link module:ol/source/Vector~VectorSource#forEachFeatureInExtent} will loop
* through all features. * through all features.
* *
* When set to `false`, the features will be maintained in an * When set to `false`, the features will be maintained in an
* {@link ol.Collection}, which can be retrieved through * {@link ol.Collection}, which can be retrieved through
* {@link ol.source.Vector#getFeaturesCollection}. * {@link module:ol/source/Vector~VectorSource#getFeaturesCollection}.
* @property {boolean} [wrapX=true] Wrap the world horizontally. For vector editing across the * @property {boolean} [wrapX=true] Wrap the world horizontally. For vector editing across the
* -180° and 180° meridians to work properly, this should be set to `false`. The * -180° and 180° meridians to work properly, this should be set to `false`. The
* resulting geometry coordinates will then exceed the world bounds. * resulting geometry coordinates will then exceed the world bounds.
@@ -137,11 +137,11 @@ inherits(VectorSourceEvent, Event);
/** /**
* @classdesc * @classdesc
* Provides a source of features for vector layers. Vector features provided * Provides a source of features for vector layers. Vector features provided
* by this source are suitable for editing. See {@link ol.source.VectorTile} for * by this source are suitable for editing. See {@link module:ol/source/VectorTile~VectorTile} for
* vector data that is optimized for rendering. * vector data that is optimized for rendering.
* *
* @constructor * @constructor
* @extends {ol.source.Source} * @extends {module:ol/source/Source~Source}
* @fires ol.source.Vector.Event * @fires ol.source.Vector.Event
* @param {module:ol/source/Vector~Options=} opt_options Vector source options. * @param {module:ol/source/Vector~Options=} opt_options Vector source options.
* @api * @api
@@ -266,7 +266,7 @@ inherits(VectorSource, Source);
/** /**
* Add a single feature to the source. If you want to add a batch of features * Add a single feature to the source. If you want to add a batch of features
* at once, call {@link ol.source.Vector#addFeatures source.addFeatures()} * at once, call {@link module:ol/source/Vector~VectorSource#addFeatures source.addFeatures()}
* instead. A feature will not be added to the source if feature with * instead. A feature will not be added to the source if feature with
* the same id is already there. The reason for this behavior is to avoid * the same id is already there. The reason for this behavior is to avoid
* feature duplication when using bbox or tile loading strategies. * feature duplication when using bbox or tile loading strategies.
@@ -536,11 +536,11 @@ VectorSource.prototype.forEachFeatureAtCoordinateDirect = function(coordinate, c
* value, iteration will stop and the function will return the same value. * value, iteration will stop and the function will return the same value.
* *
* If you are interested in features whose geometry intersects an extent, call * If you are interested in features whose geometry intersects an extent, call
* the {@link ol.source.Vector#forEachFeatureIntersectingExtent * the {@link module:ol/source/Vector~VectorSource#forEachFeatureIntersectingExtent
* source.forEachFeatureIntersectingExtent()} method instead. * source.forEachFeatureIntersectingExtent()} method instead.
* *
* When `useSpatialIndex` is set to false, this method will loop through all * When `useSpatialIndex` is set to false, this method will loop through all
* features, equivalent to {@link ol.source.Vector#forEachFeature}. * features, equivalent to {@link module:ol/source/Vector~VectorSource#forEachFeature}.
* *
* @param {module:ol/extent~Extent} extent Extent. * @param {module:ol/extent~Extent} extent Extent.
* @param {function(module:ol/Feature~Feature): T} callback Called with each feature * @param {function(module:ol/Feature~Feature): T} callback Called with each feature
@@ -564,7 +564,7 @@ VectorSource.prototype.forEachFeatureInExtent = function(extent, callback) {
* value, iteration will stop and the function will return the same value. * value, iteration will stop and the function will return the same value.
* *
* If you only want to test for bounding box intersection, call the * If you only want to test for bounding box intersection, call the
* {@link ol.source.Vector#forEachFeatureInExtent * {@link module:ol/source/Vector~VectorSource#forEachFeatureInExtent
* source.forEachFeatureInExtent()} method instead. * source.forEachFeatureInExtent()} method instead.
* *
* @param {module:ol/extent~Extent} extent Extent. * @param {module:ol/extent~Extent} extent Extent.
@@ -899,7 +899,7 @@ VectorSource.prototype.removeLoadedExtent = function(extent) {
/** /**
* Remove a single feature from the source. If you want to remove all features * Remove a single feature from the source. If you want to remove all features
* at once, use the {@link ol.source.Vector#clear source.clear()} method * at once, use the {@link module:ol/source/Vector~VectorSource#clear source.clear()} method
* instead. * instead.
* @param {module:ol/Feature~Feature} feature Feature to remove. * @param {module:ol/Feature~Feature} feature Feature to remove.
* @api * @api
+17 -17
View File
@@ -4,7 +4,7 @@
import {inherits} from '../index.js'; import {inherits} from '../index.js';
import TileState from '../TileState.js'; import TileState from '../TileState.js';
import VectorImageTile, {defaultLoadFunction} from '../VectorImageTile.js'; import VectorImageTile, {defaultLoadFunction} from '../VectorImageTile.js';
import VectorTile from '../VectorTile.js'; import Tile from '../VectorTile.js';
import {toSize} from '../size.js'; import {toSize} from '../size.js';
import UrlTile from '../source/UrlTile.js'; import UrlTile from '../source/UrlTile.js';
import {getKeyZXY} from '../tilecoord.js'; import {getKeyZXY} from '../tilecoord.js';
@@ -14,18 +14,18 @@ import {createXYZ, extentFromProjection, createForProjection} from '../tilegrid.
* @typedef {Object} Options * @typedef {Object} Options
* @property {ol.AttributionLike} [attributions] Attributions. * @property {ol.AttributionLike} [attributions] Attributions.
* @property {number} [cacheSize=128] Cache size. * @property {number} [cacheSize=128] Cache size.
* @property {ol.format.Feature} [format] Feature format for tiles. Used and required by the default. * @property {module:ol/format/Feature~FeatureFormat} [format] Feature format for tiles. Used and required by the default.
* @property {boolean} [overlaps=true] This source may have overlapping geometries. Setting this * @property {boolean} [overlaps=true] This source may have overlapping geometries. Setting this
* to `false` (e.g. for sources with polygons that represent administrative * to `false` (e.g. for sources with polygons that represent administrative
* boundaries or TopoJSON sources) allows the renderer to optimise fill and * boundaries or TopoJSON sources) allows the renderer to optimise fill and
* stroke operations. * stroke operations.
* @property {module:ol/proj~ProjectionLike} projection Projection. * @property {module:ol/proj~ProjectionLike} projection Projection.
* @property {ol.source.State} [state] Source state. * @property {module:ol/source/State~State} [state] Source state.
* @property {function(new: ol.VectorTile, ol.TileCoord, * @property {function(new: ol.VectorTile, module:ol/tilecoord~TileCoord,
* ol.TileState, string, ?string, * module:ol/TileState~TileState, string, ?string,
* ol.TileLoadFunctionType)} [tileClass] Class used to instantiate image tiles. * ol.TileLoadFunctionType)} [tileClass] Class used to instantiate image tiles.
* Default is {@link ol.VectorTile}. * Default is {@link ol.VectorTile}.
* @property {ol.tilegrid.TileGrid} [tileGrid] Tile grid. * @property {module:ol/tilegrid/TileGrid~TileGrid} [tileGrid] Tile grid.
* @property {ol.TileLoadFunctionType} [tileLoadFunction] * @property {ol.TileLoadFunctionType} [tileLoadFunction]
* Optional function to load a tile given a URL. Could look like this: * Optional function to load a tile given a URL. Could look like this:
* ```js * ```js
@@ -61,7 +61,7 @@ import {createXYZ, extentFromProjection, createForProjection} from '../tilegrid.
* with vector features from the server, it is not meant for feature editing. * with vector features from the server, it is not meant for feature editing.
* Features are optimized for rendering, their geometries are clipped at or near * Features are optimized for rendering, their geometries are clipped at or near
* tile boundaries and simplified for a view resolution. See * tile boundaries and simplified for a view resolution. See
* {@link ol.source.Vector} for vector sources that are suitable for feature * {@link module:ol/source/Vector~VectorSource} for vector sources that are suitable for feature
* editing. * editing.
* *
* @constructor * @constructor
@@ -70,7 +70,7 @@ import {createXYZ, extentFromProjection, createForProjection} from '../tilegrid.
* @param {module:ol/source/VectorTile~Options=} options Vector tile options. * @param {module:ol/source/VectorTile~Options=} options Vector tile options.
* @api * @api
*/ */
const VectorTileSource = function(options) { const VectorTile = function(options) {
const projection = options.projection || 'EPSG:3857'; const projection = options.projection || 'EPSG:3857';
const extent = options.extent || extentFromProjection(projection); const extent = options.extent || extentFromProjection(projection);
@@ -121,7 +121,7 @@ const VectorTileSource = function(options) {
* @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,
* module:ol/format/Feature~FeatureFormat, 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 : Tile;
/** /**
* @private * @private
@@ -131,13 +131,13 @@ const VectorTileSource = function(options) {
}; };
inherits(VectorTileSource, UrlTile); inherits(VectorTile, UrlTile);
/** /**
* @return {boolean} The source can have overlapping geometries. * @return {boolean} The source can have overlapping geometries.
*/ */
VectorTileSource.prototype.getOverlaps = function() { VectorTile.prototype.getOverlaps = function() {
return this.overlaps_; return this.overlaps_;
}; };
@@ -145,7 +145,7 @@ VectorTileSource.prototype.getOverlaps = function() {
* clear {@link module:ol/TileCache~TileCache} and delete all source tiles * clear {@link module:ol/TileCache~TileCache} and delete all source tiles
* @api * @api
*/ */
VectorTileSource.prototype.clear = function() { VectorTile.prototype.clear = function() {
this.tileCache.clear(); this.tileCache.clear();
this.sourceTiles_ = {}; this.sourceTiles_ = {};
}; };
@@ -153,7 +153,7 @@ VectorTileSource.prototype.clear = function() {
/** /**
* @inheritDoc * @inheritDoc
*/ */
VectorTileSource.prototype.getTile = function(z, x, y, pixelRatio, projection) { VectorTile.prototype.getTile = function(z, x, y, pixelRatio, projection) {
const tileCoordKey = getKeyZXY(z, x, y); const tileCoordKey = getKeyZXY(z, x, y);
if (this.tileCache.containsKey(tileCoordKey)) { if (this.tileCache.containsKey(tileCoordKey)) {
return /** @type {!module:ol/Tile~Tile} */ (this.tileCache.get(tileCoordKey)); return /** @type {!module:ol/Tile~Tile} */ (this.tileCache.get(tileCoordKey));
@@ -180,7 +180,7 @@ VectorTileSource.prototype.getTile = function(z, x, y, pixelRatio, projection) {
/** /**
* @inheritDoc * @inheritDoc
*/ */
VectorTileSource.prototype.getTileGridForProjection = function(projection) { VectorTile.prototype.getTileGridForProjection = function(projection) {
const code = projection.getCode(); const code = projection.getCode();
let tileGrid = this.tileGrids_[code]; let tileGrid = this.tileGrids_[code];
if (!tileGrid) { if (!tileGrid) {
@@ -197,7 +197,7 @@ VectorTileSource.prototype.getTileGridForProjection = function(projection) {
/** /**
* @inheritDoc * @inheritDoc
*/ */
VectorTileSource.prototype.getTilePixelRatio = function(pixelRatio) { VectorTile.prototype.getTilePixelRatio = function(pixelRatio) {
return pixelRatio; return pixelRatio;
}; };
@@ -205,9 +205,9 @@ VectorTileSource.prototype.getTilePixelRatio = function(pixelRatio) {
/** /**
* @inheritDoc * @inheritDoc
*/ */
VectorTileSource.prototype.getTilePixelSize = function(z, pixelRatio, projection) { VectorTile.prototype.getTilePixelSize = function(z, pixelRatio, projection) {
const tileGrid = this.getTileGridForProjection(projection); const tileGrid = this.getTileGridForProjection(projection);
const tileSize = toSize(tileGrid.getTileSize(z), this.tmpSize); const tileSize = toSize(tileGrid.getTileSize(z), this.tmpSize);
return [Math.round(tileSize[0] * pixelRatio), Math.round(tileSize[1] * pixelRatio)]; return [Math.round(tileSize[0] * pixelRatio), Math.round(tileSize[1] * pixelRatio)];
}; };
export default VectorTileSource; export default VectorTile;
+5 -42
View File
@@ -20,16 +20,16 @@ import {appendParams} from '../uri.js';
* you must provide a `crossOrigin` value if you are using the WebGL renderer or if you want to * you must provide a `crossOrigin` value if you are using the WebGL renderer or if you want to
* access pixel data with the Canvas renderer. See * access pixel data with the Canvas renderer. See
* {@link https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image} for more detail. * {@link https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image} for more detail.
* @property {ol.tilegrid.WMTS} tileGrid Tile grid. * @property {module:ol/tilegrid/WMTS~WMTSTileGrid} tileGrid Tile grid.
* @property {module:ol/proj~ProjectionLike} projection Projection. * @property {module:ol/proj~ProjectionLike} projection Projection.
* @property {boolean} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels). * @property {boolean} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels).
* Higher values can increase reprojection performance, but decrease precision. * Higher values can increase reprojection performance, but decrease precision.
* @property {ol.source.WMTSRequestEncoding|string} [requestEncoding='KVP'] Request encoding. * @property {ol.source.WMTSRequestEncoding|string} [requestEncoding='KVP'] Request encoding.
* @property {string} layer Layer name as advertised in the WMTS capabilities. * @property {string} layer Layer name as advertised in the WMTS capabilities.
* @property {string} style Style name as advertised in the WMTS capabilities. * @property {string} style Style name as advertised in the WMTS capabilities.
* @property {function(new: ol.ImageTile, ol.TileCoord, * @property {function(new: module:ol/ImageTile~ImageTile, module:ol/tilecoord~TileCoord,
* ol.TileState, string, ?string, * module:ol/TileState~TileState, string, ?string,
* ol.TileLoadFunctionType)} [tileClass] Class used to instantiate image tiles. Default is {@link ol.ImageTile}. * ol.TileLoadFunctionType)} [tileClass] Class used to instantiate image tiles. Default is {@link module:ol/ImageTile~ImageTile}.
* @property {number} [tilePixelRatio=1] The pixel ratio used by the tile service. * @property {number} [tilePixelRatio=1] The pixel ratio used by the tile service.
* For example, if the tile service advertizes 256px by 256px tiles but actually sends 512px * For example, if the tile service advertizes 256px by 256px tiles but actually sends 512px
* by 512px images (for retina/hidpi devices) then `tilePixelRatio` * by 512px images (for retina/hidpi devices) then `tilePixelRatio`
@@ -55,43 +55,6 @@ import {appendParams} from '../uri.js';
* @property {boolean} [wrapX=false] Whether to wrap the world horizontally. * @property {boolean} [wrapX=false] Whether to wrap the world horizontally.
* @property {number} [transition] Duration of the opacity transition for rendering. * @property {number} [transition] Duration of the opacity transition for rendering.
* To disable the opacity transition, pass `transition: 0`. * To disable the opacity transition, pass `transition: 0`.
* At least a `LAYERS` param is required. `STYLES` is
* `''` by default. `VERSION` is `1.3.0` by default. `WIDTH`, `HEIGHT`, `BBOX`
* and `CRS` (`SRS` for WMS version < 1.3.0) will be set dynamically.
* @property {number} [gutter=0]
* The size in pixels of the gutter around image tiles to ignore. By setting
* this property to a non-zero value, images will be requested that are wider
* and taller than the tile size by a value of `2 x gutter`.
* Using a non-zero value allows artifacts of rendering at tile edges to be
* ignored. If you control the WMS service it is recommended to address
* "artifacts at tile edges" issues by properly configuring the WMS service. For
* example, MapServer has a `tile_map_edge_buffer` configuration parameter for
* this. See http://mapserver.org/output/tile_mode.html.
* @property {boolean} [hidpi=true] Use the `ol.Map#pixelRatio` value when requesting
* the image from the remote server.
* @property {function(new: ol.ImageTile, ol.TileCoord,
* ol.TileState, string, ?string,
* ol.TileLoadFunctionType)} [tileClass] Class used to instantiate image tiles.
* Default is {@link ol.ImageTile}.
* @property {ol.tilegrid.TileGrid} [tileGrid] Tile grid. Base this on the resolutions,
* tilesize and extent supported by the server.
* If this is not defined, a default grid will be used: if there is a projection
* extent, the grid will be based on that; if not, a grid based on a global
* extent with origin at 0,0 will be used..
* @property {ol.source.WMSServerType|string} [serverType]
* The type of the remote WMS server. Currently only used when `hidpi` is
* `true`.
* @property {string} [url] WMS service URL.
* @property {Array.<string>} [urls] WMS service urls.
* Use this instead of `url` when the WMS supports multiple urls for GetMap requests.
* @property {boolean} [wrapX=true] Whether to wrap the world horizontally.
* When set to `false`, only one world
* will be rendered. When `true`, tiles will be requested for one world only,
* but they will be wrapped horizontally to render multiple worlds.
* @property {number} [transition] Duration of the opacity transition for rendering.
* To disable the opacity transition, pass `transition: 0`.
*/ */
@@ -100,7 +63,7 @@ import {appendParams} from '../uri.js';
* Layer source for tile data from WMTS servers. * Layer source for tile data from WMTS servers.
* *
* @constructor * @constructor
* @extends {ol.source.TileImage} * @extends {module:ol/source/TileImage~TileImage}
* @param {module:ol/source/WMTS~Options=} options WMTS options. * @param {module:ol/source/WMTS~Options=} options WMTS options.
* @api * @api
*/ */
+4 -4
View File
@@ -19,7 +19,7 @@ import {createXYZ, extentFromProjection} from '../tilegrid.js';
* Higher values can increase reprojection performance, but decrease precision. * Higher values can increase reprojection performance, but decrease precision.
* @property {number} [maxZoom=18] Optional max zoom level. * @property {number} [maxZoom=18] Optional max zoom level.
* @property {number} [maxZoom=0] Optional min zoom level. * @property {number} [maxZoom=0] Optional min zoom level.
* @property {ol.tilegrid.WMTS} tileGrid Tile grid. * @property {module:ol/tilegrid/TileGrid~TileGrid} [tileGrid] Tile grid.
* @property {ol.TileLoadFunctionType} [tileLoadFunction] Optional function to load a tile given a URL. The default is * @property {ol.TileLoadFunctionType} [tileLoadFunction] Optional function to load a tile given a URL. The default is
* ```js * ```js
* function(imageTile, src) { * function(imageTile, src) {
@@ -30,7 +30,7 @@ import {createXYZ, extentFromProjection} from '../tilegrid.js';
* For example, if the tile service advertizes 256px by 256px tiles but actually sends 512px * For example, if the tile service advertizes 256px by 256px tiles but actually sends 512px
* by 512px images (for retina/hidpi devices) then `tilePixelRatio` * by 512px images (for retina/hidpi devices) then `tilePixelRatio`
* should be set to `2`. * should be set to `2`.
* @property {number|ol.Size} [tileSize=[256, 256]] The tile size used by the tile service. * @property {number|module:ol/size~Size} [tileSize=[256, 256]] The tile size used by the tile service.
* @property {ol.TileUrlFunctionType} [tileUrlFunction] Optional function to get * @property {ol.TileUrlFunctionType} [tileUrlFunction] Optional function to get
* tile URL given a tile coordinate and the projection. * tile URL given a tile coordinate and the projection.
* Required if url or urls are not provided. * Required if url or urls are not provided.
@@ -52,7 +52,7 @@ import {createXYZ, extentFromProjection} from '../tilegrid.js';
* TMS where `x` 0 and `y` 0 are in the bottom left can be used by * TMS where `x` 0 and `y` 0 are in the bottom left can be used by
* using the `{-y}` placeholder in the URL template, so long as the * using the `{-y}` placeholder in the URL template, so long as the
* source does not have a custom tile grid. In this case, * source does not have a custom tile grid. In this case,
* {@link ol.source.TileImage} can be used with a `tileUrlFunction` * {@link module:ol/source/TileImage~TileImage} can be used with a `tileUrlFunction`
* such as: * such as:
* *
* tileUrlFunction: function(coordinate) { * tileUrlFunction: function(coordinate) {
@@ -62,7 +62,7 @@ import {createXYZ, extentFromProjection} from '../tilegrid.js';
* *
* *
* @constructor * @constructor
* @extends {ol.source.TileImage} * @extends {module:ol/source/TileImage~TileImage}
* @param {module:ol/source/XYZ~Options=} opt_options XYZ options. * @param {module:ol/source/XYZ~Options=} opt_options XYZ options.
* @api * @api
*/ */
+3 -3
View File
@@ -102,8 +102,8 @@ CustomTile.prototype.getImage = function() {
* A `{?-?}` template pattern, for example `subdomain{a-f}.domain.com`, may be * A `{?-?}` template pattern, for example `subdomain{a-f}.domain.com`, may be
* used instead of defining each one separately in the `urls` option. * used instead of defining each one separately in the `urls` option.
* @property {string} [tierSizeCalculation] Tier size calculation method: `default` or `truncated`. * @property {string} [tierSizeCalculation] Tier size calculation method: `default` or `truncated`.
* @property {ol.Size} [size] Size of the image. * @property {module:ol/size~Size} [size] Size of the image.
* @property {ol.Extent} [extent] Extent for the TileGrid that is created. * @property {module:ol/extent~Extent} [extent] Extent for the TileGrid that is created.
* Default sets the TileGrid in the * Default sets the TileGrid in the
* fourth quadrant, meaning extent is `[0, -height, width, 0]`. To change the * fourth quadrant, meaning extent is `[0, -height, width, 0]`. To change the
* extent to the first quadrant (the default for OpenLayers 2) set the extent * extent to the first quadrant (the default for OpenLayers 2) set the extent
@@ -120,7 +120,7 @@ CustomTile.prototype.getImage = function() {
* Imaging Protocol are supported). * Imaging Protocol are supported).
* *
* @constructor * @constructor
* @extends {ol.source.TileImage} * @extends {module:ol/source/TileImage~TileImage}
* @param {module:ol/source/Zoomify~Options=} opt_options Options. * @param {module:ol/source/Zoomify~Options=} opt_options Options.
* @api * @api
*/ */