Use Array<Foo> instead of Array.<Foo>
This commit is contained in:
@@ -168,9 +168,9 @@ function generateSourceFiles(sourceFiles) {
|
||||
* for display purposes. This function mutates the original arrays.
|
||||
*
|
||||
* @private
|
||||
* @param {Array.<module:jsdoc/doclet.Doclet>} doclets - The array of classes and functions to
|
||||
* @param {Array<module:jsdoc/doclet.Doclet>} doclets - The array of classes and functions to
|
||||
* check.
|
||||
* @param {Array.<module:jsdoc/doclet.Doclet>} modules - The array of module doclets to search.
|
||||
* @param {Array<module:jsdoc/doclet.Doclet>} modules - The array of module doclets to search.
|
||||
*/
|
||||
function attachModuleSymbols(doclets, modules) {
|
||||
const symbols = {};
|
||||
|
||||
@@ -20,8 +20,8 @@ const twoPi = 2 * Math.PI;
|
||||
|
||||
/**
|
||||
* Convert an RGB pixel into an HCL pixel.
|
||||
* @param {Array.<number>} pixel A pixel in RGB space.
|
||||
* @return {Array.<number>} A pixel in HCL space.
|
||||
* @param {Array<number>} pixel A pixel in RGB space.
|
||||
* @return {Array<number>} A pixel in HCL space.
|
||||
*/
|
||||
function rgb2hcl(pixel) {
|
||||
const red = rgb2xyz(pixel[0]);
|
||||
@@ -55,8 +55,8 @@ function rgb2hcl(pixel) {
|
||||
|
||||
/**
|
||||
* Convert an HCL pixel into an RGB pixel.
|
||||
* @param {Array.<number>} pixel A pixel in HCL space.
|
||||
* @return {Array.<number>} A pixel in RGB space.
|
||||
* @param {Array<number>} pixel A pixel in HCL space.
|
||||
* @return {Array<number>} A pixel in RGB space.
|
||||
*/
|
||||
function hcl2rgb(pixel) {
|
||||
const h = pixel[0];
|
||||
|
||||
@@ -101,7 +101,7 @@ imagery.on('postcompose', function(event) {
|
||||
* Apply a convolution kernel to canvas. This works for any size kernel, but
|
||||
* performance starts degrading above 3 x 3.
|
||||
* @param {CanvasRenderingContext2D} context Canvas 2d context.
|
||||
* @param {Array.<number>} kernel Kernel.
|
||||
* @param {Array<number>} kernel Kernel.
|
||||
*/
|
||||
function convolve(context, kernel) {
|
||||
const canvas = context.canvas;
|
||||
|
||||
@@ -12,7 +12,7 @@ const bins = 10;
|
||||
/**
|
||||
* Calculate the Vegetation Greenness Index (VGI) from an input pixel. This
|
||||
* is a rough estimate assuming that pixel values correspond to reflectance.
|
||||
* @param {Array.<number>} pixel An array of [R, G, B, A] values.
|
||||
* @param {Array<number>} pixel An array of [R, G, B, A] values.
|
||||
* @return {number} The VGI value for the given pixel.
|
||||
*/
|
||||
function vgi(pixel) {
|
||||
|
||||
@@ -7,7 +7,7 @@ import {OSM, Raster, XYZ} from '../src/ol/source.js';
|
||||
/**
|
||||
* Generates a shaded relief image given elevation data. Uses a 3x3
|
||||
* neighborhood for determining slope and aspect.
|
||||
* @param {Array.<ImageData>} inputs Array of input images.
|
||||
* @param {Array<ImageData>} inputs Array of input images.
|
||||
* @param {Object} data Data added in the "beforeoperations" event.
|
||||
* @return {ImageData} Output image.
|
||||
*/
|
||||
|
||||
@@ -26,7 +26,7 @@ handlebars.registerHelper('indent', (text, options) => {
|
||||
* Create an inverted index of keywords from examples. Property names are
|
||||
* lowercased words. Property values are objects mapping example index to word
|
||||
* count.
|
||||
* @param {Array.<Object>} exampleData Array of example data objects.
|
||||
* @param {Array<Object>} exampleData Array of example data objects.
|
||||
* @return {Object} Word index.
|
||||
*/
|
||||
function createWordIndex(exampleData) {
|
||||
|
||||
@@ -62,7 +62,7 @@ export class CollectionEvent extends Event {
|
||||
class Collection extends BaseObject {
|
||||
|
||||
/**
|
||||
* @param {Array.<T>=} opt_array Array.
|
||||
* @param {Array<T>=} opt_array Array.
|
||||
* @param {module:ol/Collection~Options=} opt_options Collection options.
|
||||
*/
|
||||
constructor(opt_array, opt_options) {
|
||||
@@ -79,7 +79,7 @@ class Collection extends BaseObject {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {!Array.<T>}
|
||||
* @type {!Array<T>}
|
||||
*/
|
||||
this.array_ = opt_array ? opt_array : [];
|
||||
|
||||
@@ -106,7 +106,7 @@ class Collection extends BaseObject {
|
||||
/**
|
||||
* Add elements to the collection. This pushes each item in the provided array
|
||||
* to the end of the collection.
|
||||
* @param {!Array.<T>} arr Array.
|
||||
* @param {!Array<T>} arr Array.
|
||||
* @return {module:ol/Collection.<T>} This collection.
|
||||
* @api
|
||||
*/
|
||||
@@ -119,7 +119,7 @@ class Collection extends BaseObject {
|
||||
|
||||
/**
|
||||
* Iterate over each element, calling the provided callback.
|
||||
* @param {function(T, number, Array.<T>): *} f The function to call
|
||||
* @param {function(T, number, Array<T>): *} f The function to call
|
||||
* for every element. This function takes 3 arguments (the element, the
|
||||
* index and the array). The return value is ignored.
|
||||
* @api
|
||||
@@ -136,7 +136,7 @@ class Collection extends BaseObject {
|
||||
* is mutated, no events will be dispatched by the collection, and the
|
||||
* collection's "length" property won't be in sync with the actual length
|
||||
* of the array.
|
||||
* @return {!Array.<T>} Array.
|
||||
* @return {!Array<T>} Array.
|
||||
* @api
|
||||
*/
|
||||
getArray() {
|
||||
|
||||
@@ -78,7 +78,7 @@ class Feature extends BaseObject {
|
||||
/**
|
||||
* User provided style.
|
||||
* @private
|
||||
* @type {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction}
|
||||
* @type {module:ol/style/Style|Array<module:ol/style/Style>|module:ol/style/Style~StyleFunction}
|
||||
*/
|
||||
this.style_ = null;
|
||||
|
||||
@@ -170,7 +170,7 @@ class Feature extends BaseObject {
|
||||
/**
|
||||
* Get the feature's style. Will return what was provided to the
|
||||
* {@link module:ol/Feature~Feature#setStyle} method.
|
||||
* @return {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction} The feature style.
|
||||
* @return {module:ol/style/Style|Array<module:ol/style/Style>|module:ol/style/Style~StyleFunction} The feature style.
|
||||
* @api
|
||||
*/
|
||||
getStyle() {
|
||||
@@ -225,7 +225,7 @@ class Feature extends BaseObject {
|
||||
* Set the style for the feature. This can be a single style object, an array
|
||||
* of styles, or a function that takes a resolution and returns an array of
|
||||
* styles. If it is `null` the feature has no style (a `null` style).
|
||||
* @param {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction} style Style for this feature.
|
||||
* @param {module:ol/style/Style|Array<module:ol/style/Style>|module:ol/style/Style~StyleFunction} style Style for this feature.
|
||||
* @api
|
||||
* @fires module:ol/events/Event~Event#event:change
|
||||
*/
|
||||
@@ -273,7 +273,7 @@ class Feature extends BaseObject {
|
||||
* Convert the provided object into a feature style function. Functions passed
|
||||
* through unchanged. Arrays of module:ol/style/Style or single style objects wrapped
|
||||
* in a new feature style function.
|
||||
* @param {module:ol/style/Style~StyleFunction|!Array.<module:ol/style/Style>|!module:ol/style/Style} obj
|
||||
* @param {module:ol/style/Style~StyleFunction|!Array<module:ol/style/Style>|!module:ol/style/Style} obj
|
||||
* A feature style function, a single style, or an array of styles.
|
||||
* @return {module:ol/style/Style~StyleFunction} A style function.
|
||||
*/
|
||||
@@ -282,7 +282,7 @@ export function createStyleFunction(obj) {
|
||||
return obj;
|
||||
} else {
|
||||
/**
|
||||
* @type {Array.<module:ol/style/Style>}
|
||||
* @type {Array<module:ol/style/Style>}
|
||||
*/
|
||||
let styles;
|
||||
if (Array.isArray(obj)) {
|
||||
|
||||
@@ -27,7 +27,7 @@ const DEFAULT_STROKE_STYLE = new Stroke({
|
||||
|
||||
/**
|
||||
* TODO can be configurable
|
||||
* @type {Array.<number>}
|
||||
* @type {Array<number>}
|
||||
* @private
|
||||
*/
|
||||
const INTERVALS = [
|
||||
@@ -200,13 +200,13 @@ class Graticule {
|
||||
this.maxLines_ = options.maxLines !== undefined ? options.maxLines : 100;
|
||||
|
||||
/**
|
||||
* @type {Array.<module:ol/geom/LineString>}
|
||||
* @type {Array<module:ol/geom/LineString>}
|
||||
* @private
|
||||
*/
|
||||
this.meridians_ = [];
|
||||
|
||||
/**
|
||||
* @type {Array.<module:ol/geom/LineString>}
|
||||
* @type {Array<module:ol/geom/LineString>}
|
||||
* @private
|
||||
*/
|
||||
this.parallels_ = [];
|
||||
@@ -236,13 +236,13 @@ class Graticule {
|
||||
this.projectionCenterLonLat_ = null;
|
||||
|
||||
/**
|
||||
* @type {Array.<module:ol/Graticule~GraticuleLabelDataType>}
|
||||
* @type {Array<module:ol/Graticule~GraticuleLabelDataType>}
|
||||
* @private
|
||||
*/
|
||||
this.meridiansLabels_ = null;
|
||||
|
||||
/**
|
||||
* @type {Array.<module:ol/Graticule~GraticuleLabelDataType>}
|
||||
* @type {Array<module:ol/Graticule~GraticuleLabelDataType>}
|
||||
* @private
|
||||
*/
|
||||
this.parallelsLabels_ = null;
|
||||
@@ -526,9 +526,9 @@ class Graticule {
|
||||
const centerLat = this.projectionCenterLonLat_[1];
|
||||
let interval = -1;
|
||||
const target = Math.pow(this.targetSize_ * resolution, 2);
|
||||
/** @type {Array.<number>} **/
|
||||
/** @type {Array<number>} **/
|
||||
const p1 = [];
|
||||
/** @type {Array.<number>} **/
|
||||
/** @type {Array<number>} **/
|
||||
const p2 = [];
|
||||
for (let i = 0, ii = INTERVALS.length; i < ii; ++i) {
|
||||
const delta = INTERVALS[i] / 2;
|
||||
@@ -579,7 +579,7 @@ class Graticule {
|
||||
|
||||
/**
|
||||
* Get the list of meridians. Meridians are lines of equal longitude.
|
||||
* @return {Array.<module:ol/geom/LineString>} The meridians.
|
||||
* @return {Array<module:ol/geom/LineString>} The meridians.
|
||||
* @api
|
||||
*/
|
||||
getMeridians() {
|
||||
@@ -609,7 +609,7 @@ class Graticule {
|
||||
|
||||
/**
|
||||
* Get the list of parallels. Parallels are lines of equal latitude.
|
||||
* @return {Array.<module:ol/geom/LineString>} The parallels.
|
||||
* @return {Array<module:ol/geom/LineString>} The parallels.
|
||||
* @api
|
||||
*/
|
||||
getParallels() {
|
||||
|
||||
@@ -58,7 +58,7 @@ class ImageWrapper extends ImageBase {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<module:ol/events~EventsKey>}
|
||||
* @type {Array<module:ol/events~EventsKey>}
|
||||
*/
|
||||
this.imageListenerKeys_ = null;
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ class ImageTile extends Tile {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<module:ol/events~EventsKey>}
|
||||
* @type {Array<module:ol/events~EventsKey>}
|
||||
*/
|
||||
this.imageListenerKeys_ = null;
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ class Kinetic {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<number>}
|
||||
* @type {Array<number>}
|
||||
*/
|
||||
this.points_ = [];
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ class MapBrowserEventHandler extends EventTarget {
|
||||
this.dragging_ = false;
|
||||
|
||||
/**
|
||||
* @type {!Array.<module:ol/events~EventsKey>}
|
||||
* @type {!Array<module:ol/events~EventsKey>}
|
||||
* @private
|
||||
*/
|
||||
this.dragListenerKeys_ = [];
|
||||
|
||||
@@ -126,7 +126,7 @@ class BaseObject extends Observable {
|
||||
|
||||
/**
|
||||
* Get a list of object property names.
|
||||
* @return {Array.<string>} List of property names.
|
||||
* @return {Array<string>} List of property names.
|
||||
* @api
|
||||
*/
|
||||
getKeys() {
|
||||
|
||||
@@ -50,9 +50,9 @@ class Observable extends EventTarget {
|
||||
|
||||
/**
|
||||
* Listen for a certain type of event.
|
||||
* @param {string|Array.<string>} type The event type or array of event types.
|
||||
* @param {string|Array<string>} type The event type or array of event types.
|
||||
* @param {function(?): ?} listener The listener function.
|
||||
* @return {module:ol/events~EventsKey|Array.<module:ol/events~EventsKey>} Unique key for the listener. If
|
||||
* @return {module:ol/events~EventsKey|Array<module:ol/events~EventsKey>} Unique key for the listener. If
|
||||
* called with an array of event types as the first argument, the return
|
||||
* will be an array of keys.
|
||||
* @api
|
||||
@@ -72,9 +72,9 @@ class Observable extends EventTarget {
|
||||
|
||||
/**
|
||||
* Listen once for a certain type of event.
|
||||
* @param {string|Array.<string>} type The event type or array of event types.
|
||||
* @param {string|Array<string>} type The event type or array of event types.
|
||||
* @param {function(?): ?} listener The listener function.
|
||||
* @return {module:ol/events~EventsKey|Array.<module:ol/events~EventsKey>} Unique key for the listener. If
|
||||
* @return {module:ol/events~EventsKey|Array<module:ol/events~EventsKey>} Unique key for the listener. If
|
||||
* called with an array of event types as the first argument, the return
|
||||
* will be an array of keys.
|
||||
* @api
|
||||
@@ -94,7 +94,7 @@ class Observable extends EventTarget {
|
||||
|
||||
/**
|
||||
* Unlisten for a certain type of event.
|
||||
* @param {string|Array.<string>} type The event type or array of event types.
|
||||
* @param {string|Array<string>} type The event type or array of event types.
|
||||
* @param {function(?): ?} listener The listener function.
|
||||
* @api
|
||||
*/
|
||||
@@ -113,7 +113,7 @@ class Observable extends EventTarget {
|
||||
|
||||
/**
|
||||
* Removes an event listener using the key returned by `on()` or `once()`.
|
||||
* @param {module:ol/events~EventsKey|Array.<module:ol/events~EventsKey>} key The key returned by `on()`
|
||||
* @param {module:ol/events~EventsKey|Array<module:ol/events~EventsKey>} key The key returned by `on()`
|
||||
* or `once()` (or an array of keys).
|
||||
* @api
|
||||
*/
|
||||
|
||||
@@ -15,7 +15,7 @@ import {containsExtent} from './extent.js';
|
||||
* @property {number|string} [id] Set the overlay id. The overlay id can be used
|
||||
* with the {@link module:ol/Map~Map#getOverlayById} method.
|
||||
* @property {HTMLElement} [element] The overlay element.
|
||||
* @property {Array.<number>} [offset=[0, 0]] Offsets in pixels used when positioning
|
||||
* @property {Array<number>} [offset=[0, 0]] Offsets in pixels used when positioning
|
||||
* the overlay. The first element in the
|
||||
* array is the horizontal offset. A positive value shifts the overlay right.
|
||||
* The second element in the array is the vertical offset. A positive value
|
||||
@@ -248,12 +248,12 @@ class Overlay extends BaseObject {
|
||||
|
||||
/**
|
||||
* Get the offset of this overlay.
|
||||
* @return {Array.<number>} The offset.
|
||||
* @return {Array<number>} The offset.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
getOffset() {
|
||||
return /** @type {Array.<number>} */ (this.get(Property.OFFSET));
|
||||
return /** @type {Array<number>} */ (this.get(Property.OFFSET));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -371,7 +371,7 @@ class Overlay extends BaseObject {
|
||||
|
||||
/**
|
||||
* Set the offset for this overlay.
|
||||
* @param {Array.<number>} offset Offset.
|
||||
* @param {Array<number>} offset Offset.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
|
||||
@@ -42,14 +42,14 @@ import {create as createTransform, apply as applyTransform} from './transform.js
|
||||
* @property {module:ol/coordinate~Coordinate} focus
|
||||
* @property {number} index
|
||||
* @property {Object.<number, module:ol/layer/Layer~State>} layerStates
|
||||
* @property {Array.<module:ol/layer/Layer~State>} layerStatesArray
|
||||
* @property {Array<module:ol/layer/Layer~State>} layerStatesArray
|
||||
* @property {module:ol/transform~Transform} pixelToCoordinateTransform
|
||||
* @property {Array.<module:ol/PluggableMap~PostRenderFunction>} postRenderFunctions
|
||||
* @property {Array<module:ol/PluggableMap~PostRenderFunction>} postRenderFunctions
|
||||
* @property {module:ol/size~Size} size
|
||||
* @property {!Object.<string, boolean>} skippedFeatureUids
|
||||
* @property {module:ol/TileQueue} tileQueue
|
||||
* @property {Object.<string, Object.<string, module:ol/TileRange>>} usedTiles
|
||||
* @property {Array.<number>} viewHints
|
||||
* @property {Array<number>} viewHints
|
||||
* @property {!Object.<string, Object.<string, boolean>>} wantedTiles
|
||||
*/
|
||||
|
||||
@@ -85,12 +85,12 @@ import {create as createTransform, apply as applyTransform} from './transform.js
|
||||
/**
|
||||
* Object literal with config options for the map.
|
||||
* @typedef {Object} MapOptions
|
||||
* @property {module:ol/Collection.<module:ol/control/Control>|Array.<module:ol/control/Control>} [controls]
|
||||
* @property {module:ol/Collection.<module:ol/control/Control>|Array<module:ol/control/Control>} [controls]
|
||||
* Controls initially added to the map. If not specified,
|
||||
* {@link module:ol/control/util~defaults} is used.
|
||||
* @property {number} [pixelRatio=window.devicePixelRatio] The ratio between
|
||||
* physical pixels and device-independent pixels (dips) on the device.
|
||||
* @property {module:ol/Collection.<module:ol/interaction/Interaction>|Array.<module:ol/interaction/Interaction>} [interactions]
|
||||
* @property {module:ol/Collection.<module:ol/interaction/Interaction>|Array<module:ol/interaction/Interaction>} [interactions]
|
||||
* Interactions that are initially added to the map. If not specified,
|
||||
* {@link module:ol/interaction~defaults} is used.
|
||||
* @property {HTMLElement|Document|string} [keyboardEventTarget] The element to
|
||||
@@ -101,7 +101,7 @@ import {create as createTransform, apply as applyTransform} from './transform.js
|
||||
* map target (i.e. the user-provided div for the map). If this is not
|
||||
* `document`, the target element needs to be focused for key events to be
|
||||
* emitted, requiring that the target element has a `tabindex` attribute.
|
||||
* @property {Array.<module:ol/layer/Base>|module:ol/Collection.<module:ol/layer/Base>} [layers]
|
||||
* @property {Array<module:ol/layer/Base>|module:ol/Collection.<module:ol/layer/Base>} [layers]
|
||||
* Layers. If this is not defined, a map with no layers will be rendered. Note
|
||||
* that layers are rendered in the order supplied, so if you want, for example,
|
||||
* a vector layer to appear on top of a tile layer, it must come after the tile
|
||||
@@ -118,7 +118,7 @@ import {create as createTransform, apply as applyTransform} from './transform.js
|
||||
* @property {number} [moveTolerance=1] The minimum distance in pixels the
|
||||
* cursor must move to be detected as a map move event instead of a click.
|
||||
* Increasing this value can make it easier to click on the map.
|
||||
* @property {module:ol/Collection.<module:ol/Overlay>|Array.<module:ol/Overlay>} [overlays]
|
||||
* @property {module:ol/Collection.<module:ol/Overlay>|Array<module:ol/Overlay>} [overlays]
|
||||
* Overlays initially added to the map. By default, no overlays are added.
|
||||
* @property {HTMLElement|string} [target] The container for the map, either the
|
||||
* element itself or the `id` of the element. If not specified at construction
|
||||
@@ -236,7 +236,7 @@ class PluggableMap extends BaseObject {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<module:ol/events~EventsKey>}
|
||||
* @type {Array<module:ol/events~EventsKey>}
|
||||
*/
|
||||
this.layerGroupPropertyListenerKeys_ = null;
|
||||
|
||||
@@ -301,7 +301,7 @@ class PluggableMap extends BaseObject {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<module:ol/events~EventsKey>}
|
||||
* @type {Array<module:ol/events~EventsKey>}
|
||||
*/
|
||||
this.keyHandlerKeys_ = null;
|
||||
|
||||
@@ -354,7 +354,7 @@ class PluggableMap extends BaseObject {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {!Array.<module:ol/PluggableMap~PostRenderFunction>}
|
||||
* @type {!Array<module:ol/PluggableMap~PostRenderFunction>}
|
||||
*/
|
||||
this.postRenderFunctions_ = [];
|
||||
|
||||
@@ -577,7 +577,7 @@ class PluggableMap extends BaseObject {
|
||||
* Get all features that intersect a pixel on the viewport.
|
||||
* @param {module:ol/pixel~Pixel} pixel Pixel.
|
||||
* @param {module:ol/PluggableMap~AtPixelOptions=} opt_options Optional options.
|
||||
* @return {Array.<module:ol/Feature|module:ol/render/Feature>} The detected features or
|
||||
* @return {Array<module:ol/Feature|module:ol/render/Feature>} The detected features or
|
||||
* `null` if none were found.
|
||||
* @api
|
||||
*/
|
||||
|
||||
@@ -75,7 +75,7 @@ class VectorImageTile extends Tile {
|
||||
|
||||
/**
|
||||
* Keys of source tiles used by this tile. Use with {@link #getTile}.
|
||||
* @type {Array.<string>}
|
||||
* @type {Array<string>}
|
||||
*/
|
||||
this.tileKeys = [];
|
||||
|
||||
@@ -95,12 +95,12 @@ class VectorImageTile extends Tile {
|
||||
this.wrappedTileCoord = urlTileCoord;
|
||||
|
||||
/**
|
||||
* @type {Array.<module:ol/events~EventsKey>}
|
||||
* @type {Array<module:ol/events~EventsKey>}
|
||||
*/
|
||||
this.loadListenerKeys_ = [];
|
||||
|
||||
/**
|
||||
* @type {Array.<module:ol/events~EventsKey>}
|
||||
* @type {Array<module:ol/events~EventsKey>}
|
||||
*/
|
||||
this.sourceTileListenerKeys_ = [];
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ class VectorTile extends Tile {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<module:ol/Feature>}
|
||||
* @type {Array<module:ol/Feature>}
|
||||
*/
|
||||
this.features_ = null;
|
||||
|
||||
@@ -120,7 +120,7 @@ class VectorTile extends Tile {
|
||||
/**
|
||||
* Get the features for this tile. Geometries will be in the projection returned
|
||||
* by {@link module:ol/VectorTile~VectorTile#getProjection}.
|
||||
* @return {Array.<module:ol/Feature|module:ol/render/Feature>} Features.
|
||||
* @return {Array<module:ol/Feature|module:ol/render/Feature>} Features.
|
||||
* @api
|
||||
*/
|
||||
getFeatures() {
|
||||
@@ -166,7 +166,7 @@ class VectorTile extends Tile {
|
||||
|
||||
/**
|
||||
* Handler for successful tile load.
|
||||
* @param {Array.<module:ol/Feature>} features The loaded features.
|
||||
* @param {Array<module:ol/Feature>} features The loaded features.
|
||||
* @param {module:ol/proj/Projection} dataProjection Data projection.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
*/
|
||||
@@ -202,7 +202,7 @@ class VectorTile extends Tile {
|
||||
/**
|
||||
* Function for use in an {@link module:ol/source/VectorTile~VectorTile}'s `tileLoadFunction`.
|
||||
* Sets the features for the tile.
|
||||
* @param {Array.<module:ol/Feature>} features Features.
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @api
|
||||
*/
|
||||
setFeatures(features) {
|
||||
|
||||
@@ -56,7 +56,7 @@ import Units from './proj/Units.js';
|
||||
* @property {module:ol/size~Size} [size] The size in pixels of the box to fit
|
||||
* the extent into. Default is the current size of the first map in the DOM that
|
||||
* uses this view, or `[100, 100]` if no such map is found.
|
||||
* @property {!Array.<number>} [padding=[0, 0, 0, 0]] Padding (in pixels) to be
|
||||
* @property {!Array<number>} [padding=[0, 0, 0, 0]] Padding (in pixels) to be
|
||||
* cleared inside the view. Values in the array are top, right, bottom and left
|
||||
* padding.
|
||||
* @property {boolean} [constrainResolution=true] Constrain the resolution.
|
||||
@@ -121,7 +121,7 @@ import Units from './proj/Units.js';
|
||||
* alternative to setting this is to set `zoom`. Layer sources will not be
|
||||
* fetched if neither this nor `zoom` are defined, but they can be set later
|
||||
* with {@link #setZoom} or {@link #setResolution}.
|
||||
* @property {Array.<number>} [resolutions] Resolutions to determine the
|
||||
* @property {Array<number>} [resolutions] Resolutions to determine the
|
||||
* resolution constraint. If set the `maxResolution`, `minResolution`,
|
||||
* `minZoom`, `maxZoom`, and `zoomFactor` options are ignored.
|
||||
* @property {number} [rotation=0] The initial rotation for the view in radians
|
||||
@@ -238,13 +238,13 @@ class View extends BaseObject {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<number>}
|
||||
* @type {Array<number>}
|
||||
*/
|
||||
this.hints_ = [0, 0];
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<Array.<module:ol/View~Animation>>}
|
||||
* @type {Array<Array<module:ol/View~Animation>>}
|
||||
*/
|
||||
this.animations_ = [];
|
||||
|
||||
@@ -301,7 +301,7 @@ class View extends BaseObject {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<number>|undefined}
|
||||
* @type {Array<number>|undefined}
|
||||
*/
|
||||
this.resolutions_ = options.resolutions;
|
||||
|
||||
@@ -710,8 +710,8 @@ class View extends BaseObject {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Array.<number>=} opt_hints Destination array.
|
||||
* @return {Array.<number>} Hint.
|
||||
* @param {Array<number>=} opt_hints Destination array.
|
||||
* @return {Array<number>} Hint.
|
||||
*/
|
||||
getHints(opt_hints) {
|
||||
if (opt_hints !== undefined) {
|
||||
@@ -821,7 +821,7 @@ class View extends BaseObject {
|
||||
/**
|
||||
* Get the resolutions for the view. This returns the array of resolutions
|
||||
* passed to the constructor of the View, or undefined if none were given.
|
||||
* @return {Array.<number>|undefined} The resolutions of the view.
|
||||
* @return {Array<number>|undefined} The resolutions of the view.
|
||||
* @api
|
||||
*/
|
||||
getResolutions() {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* Performs a binary search on the provided sorted list and returns the index of the item if found. If it can't be found it'll return -1.
|
||||
* https://github.com/darkskyapp/binary-search
|
||||
*
|
||||
* @param {Array.<*>} haystack Items to search through.
|
||||
* @param {Array<*>} haystack Items to search through.
|
||||
* @param {*} needle The item to look for.
|
||||
* @param {Function=} opt_comparator Comparator function.
|
||||
* @return {number} The index of the item if found, -1 if not.
|
||||
@@ -53,7 +53,7 @@ export function numberSafeCompareFunction(a, b) {
|
||||
|
||||
/**
|
||||
* Whether the array contains the given object.
|
||||
* @param {Array.<*>} arr The array to test for the presence of the element.
|
||||
* @param {Array<*>} arr The array to test for the presence of the element.
|
||||
* @param {*} obj The object for which to test.
|
||||
* @return {boolean} The object is in the array.
|
||||
*/
|
||||
@@ -63,7 +63,7 @@ export function includes(arr, obj) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} arr Array.
|
||||
* @param {Array<number>} arr Array.
|
||||
* @param {number} target Target.
|
||||
* @param {number} direction 0 means return the nearest, > 0
|
||||
* means return the largest nearest, < 0 means return the
|
||||
@@ -109,7 +109,7 @@ export function linearFindNearest(arr, target, direction) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<*>} arr Array.
|
||||
* @param {Array<*>} arr Array.
|
||||
* @param {number} begin Begin index.
|
||||
* @param {number} end End index.
|
||||
*/
|
||||
@@ -125,8 +125,8 @@ export function reverseSubArray(arr, begin, end) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<VALUE>} arr The array to modify.
|
||||
* @param {!Array.<VALUE>|VALUE} data The elements or arrays of elements to add to arr.
|
||||
* @param {Array<VALUE>} arr The array to modify.
|
||||
* @param {!Array<VALUE>|VALUE} data The elements or arrays of elements to add to arr.
|
||||
* @template VALUE
|
||||
*/
|
||||
export function extend(arr, data) {
|
||||
@@ -139,7 +139,7 @@ export function extend(arr, data) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<VALUE>} arr The array to modify.
|
||||
* @param {Array<VALUE>} arr The array to modify.
|
||||
* @param {VALUE} obj The element to remove.
|
||||
* @template VALUE
|
||||
* @return {boolean} If the element was removed.
|
||||
@@ -155,7 +155,7 @@ export function remove(arr, obj) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<VALUE>} arr The array to search in.
|
||||
* @param {Array<VALUE>} arr The array to search in.
|
||||
* @param {function(VALUE, number, ?) : boolean} func The function to compare.
|
||||
* @template VALUE
|
||||
* @return {VALUE|null} The element found or null.
|
||||
@@ -194,7 +194,7 @@ export function equals(arr1, arr2) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<*>} arr The array to sort (modifies original).
|
||||
* @param {Array<*>} arr The array to sort (modifies original).
|
||||
* @param {Function} compareFnc Comparison function.
|
||||
*/
|
||||
export function stableSort(arr, compareFnc) {
|
||||
@@ -214,7 +214,7 @@ export function stableSort(arr, compareFnc) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<*>} arr The array to search in.
|
||||
* @param {Array<*>} arr The array to search in.
|
||||
* @param {Function} func Comparison function.
|
||||
* @return {number} Return index.
|
||||
*/
|
||||
@@ -229,7 +229,7 @@ export function findIndex(arr, func) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<*>} arr The array to test.
|
||||
* @param {Array<*>} arr The array to test.
|
||||
* @param {Function=} opt_func Comparison function.
|
||||
* @param {boolean=} opt_strict Strictly sorted (default false).
|
||||
* @return {boolean} Return index.
|
||||
|
||||
@@ -10,7 +10,7 @@ import {clamp} from './math.js';
|
||||
* red, green, and blue should be integers in the range 0..255 inclusive.
|
||||
* alpha should be a float in the range 0..1 inclusive. If no alpha value is
|
||||
* given then `1` will be used.
|
||||
* @typedef {Array.<number>} Color
|
||||
* @typedef {Array<number>} Color
|
||||
* @api
|
||||
*/
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@ class Attribution extends Control {
|
||||
|
||||
/**
|
||||
* A list of currently rendered resolutions.
|
||||
* @type {Array.<string>}
|
||||
* @type {Array<string>}
|
||||
* @private
|
||||
*/
|
||||
this.renderedAttributions_ = [];
|
||||
@@ -147,7 +147,7 @@ class Attribution extends Control {
|
||||
/**
|
||||
* Get a list of visible attributions.
|
||||
* @param {module:ol/PluggableMap~FrameState} frameState Frame state.
|
||||
* @return {Array.<string>} Attributions.
|
||||
* @return {Array<string>} Attributions.
|
||||
* @private
|
||||
*/
|
||||
getSourceAttributions_(frameState) {
|
||||
@@ -159,7 +159,7 @@ class Attribution extends Control {
|
||||
|
||||
/**
|
||||
* A list of visible attributions.
|
||||
* @type {Array.<string>}
|
||||
* @type {Array<string>}
|
||||
*/
|
||||
const visibleAttributions = [];
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ class Control extends BaseObject {
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {!Array.<module:ol/events~EventsKey>}
|
||||
* @type {!Array<module:ol/events~EventsKey>}
|
||||
*/
|
||||
this.listenerKeys = [];
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ const MIN_RATIO = 0.1;
|
||||
* @property {boolean} [collapsible=true] Whether the control can be collapsed or not.
|
||||
* @property {string|HTMLElement} [label='»'] Text label to use for the collapsed
|
||||
* overviewmap button. Instead of text, also an element (e.g. a `span` element) can be used.
|
||||
* @property {Array.<module:ol/layer/Layer>|module:ol/Collection.<module:ol/layer/Layer>} [layers]
|
||||
* @property {Array<module:ol/layer/Layer>|module:ol/Collection.<module:ol/layer/Layer>} [layers]
|
||||
* Layers for the overview map. If not set, then all main map layers are used
|
||||
* instead.
|
||||
* @property {function(module:ol/MapEvent)} [render] Function called when the control
|
||||
|
||||
@@ -31,7 +31,7 @@ export const Units = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Array.<number>}
|
||||
* @type {Array<number>}
|
||||
*/
|
||||
const LEADING_DIGITS = [1, 2, 5];
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import {padNumber} from './string.js';
|
||||
|
||||
/**
|
||||
* An array of numbers representing an xy coordinate. Example: `[16, 48]`.
|
||||
* @typedef {Array.<number>} Coordinate
|
||||
* @typedef {Array<number>} Coordinate
|
||||
* @api
|
||||
*/
|
||||
|
||||
@@ -82,7 +82,7 @@ export function closestOnCircle(coordinate, circle) {
|
||||
* is outside the segment.
|
||||
*
|
||||
* @param {module:ol/coordinate~Coordinate} coordinate The coordinate.
|
||||
* @param {Array.<module:ol/coordinate~Coordinate>} segment The two coordinates
|
||||
* @param {Array<module:ol/coordinate~Coordinate>} segment The two coordinates
|
||||
* of the segment.
|
||||
* @return {module:ol/coordinate~Coordinate} The foot of the perpendicular of
|
||||
* the coordinate to the segment.
|
||||
@@ -328,7 +328,7 @@ export function distance(coord1, coord2) {
|
||||
* Calculate the squared distance from a coordinate to a line segment.
|
||||
*
|
||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate of the point.
|
||||
* @param {Array.<module:ol/coordinate~Coordinate>} segment Line segment (2
|
||||
* @param {Array<module:ol/coordinate~Coordinate>} segment Line segment (2
|
||||
* coordinates).
|
||||
* @return {number} Squared distance from the point to the line segment.
|
||||
*/
|
||||
|
||||
@@ -75,7 +75,7 @@ export function findListener(listeners, listener, opt_this, opt_setDeleteIndex)
|
||||
/**
|
||||
* @param {module:ol/events/EventTarget~EventTargetLike} target Target.
|
||||
* @param {string} type Type.
|
||||
* @return {Array.<module:ol/events~EventsKey>|undefined} Listeners.
|
||||
* @return {Array<module:ol/events~EventsKey>|undefined} Listeners.
|
||||
*/
|
||||
export function getListeners(target, type) {
|
||||
const listenerMap = target.ol_lm;
|
||||
@@ -87,7 +87,7 @@ export function getListeners(target, type) {
|
||||
* Get the lookup of listeners. If one does not exist on the target, it is
|
||||
* created.
|
||||
* @param {module:ol/events/EventTarget~EventTargetLike} target Target.
|
||||
* @return {!Object.<string, Array.<module:ol/events~EventsKey>>} Map of
|
||||
* @return {!Object.<string, Array<module:ol/events~EventsKey>>} Map of
|
||||
* listeners by event type.
|
||||
*/
|
||||
function getListenerMap(target) {
|
||||
|
||||
@@ -46,7 +46,7 @@ class EventTarget extends Disposable {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {!Object.<string, Array.<module:ol/events~ListenerFunction>>}
|
||||
* @type {!Object.<string, Array<module:ol/events~ListenerFunction>>}
|
||||
*/
|
||||
this.listeners_ = {};
|
||||
|
||||
@@ -122,7 +122,7 @@ class EventTarget extends Disposable {
|
||||
* order that they will be called in.
|
||||
*
|
||||
* @param {string} type Type.
|
||||
* @return {Array.<module:ol/events~ListenerFunction>} Listeners.
|
||||
* @return {Array<module:ol/events~ListenerFunction>} Listeners.
|
||||
*/
|
||||
getListeners(type) {
|
||||
return this.listeners_[type];
|
||||
|
||||
@@ -8,14 +8,14 @@ import Relationship from './extent/Relationship.js';
|
||||
|
||||
/**
|
||||
* An array of numbers representing an extent: `[minx, miny, maxx, maxy]`.
|
||||
* @typedef {Array.<number>} Extent
|
||||
* @typedef {Array<number>} Extent
|
||||
* @api
|
||||
*/
|
||||
|
||||
/**
|
||||
* Build an extent that includes all given coordinates.
|
||||
*
|
||||
* @param {Array.<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
||||
* @param {Array<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
||||
* @return {module:ol/extent~Extent} Bounding extent.
|
||||
* @api
|
||||
*/
|
||||
@@ -29,8 +29,8 @@ export function boundingExtent(coordinates) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} xs Xs.
|
||||
* @param {Array.<number>} ys Ys.
|
||||
* @param {Array<number>} xs Xs.
|
||||
* @param {Array<number>} ys Ys.
|
||||
* @param {module:ol/extent~Extent=} opt_extent Destination extent.
|
||||
* @private
|
||||
* @return {module:ol/extent~Extent} Extent.
|
||||
@@ -249,7 +249,7 @@ export function createOrUpdateFromCoordinate(coordinate, opt_extent) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
||||
* @param {Array<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
||||
* @param {module:ol/extent~Extent=} opt_extent Extent.
|
||||
* @return {module:ol/extent~Extent} Extent.
|
||||
*/
|
||||
@@ -260,7 +260,7 @@ export function createOrUpdateFromCoordinates(coordinates, opt_extent) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
@@ -273,7 +273,7 @@ export function createOrUpdateFromFlatCoordinates(flatCoordinates, offset, end,
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} rings Rings.
|
||||
* @param {Array<Array<module:ol/coordinate~Coordinate>>} rings Rings.
|
||||
* @param {module:ol/extent~Extent=} opt_extent Extent.
|
||||
* @return {module:ol/extent~Extent} Extent.
|
||||
*/
|
||||
@@ -342,7 +342,7 @@ export function extendCoordinate(extent, coordinate) {
|
||||
|
||||
/**
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {Array.<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
||||
* @param {Array<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
||||
* @return {module:ol/extent~Extent} Extent.
|
||||
*/
|
||||
export function extendCoordinates(extent, coordinates) {
|
||||
@@ -355,7 +355,7 @@ export function extendCoordinates(extent, coordinates) {
|
||||
|
||||
/**
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
@@ -371,7 +371,7 @@ export function extendFlatCoordinates(extent, flatCoordinates, offset, end, stri
|
||||
|
||||
/**
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} rings Rings.
|
||||
* @param {Array<Array<module:ol/coordinate~Coordinate>>} rings Rings.
|
||||
* @return {module:ol/extent~Extent} Extent.
|
||||
*/
|
||||
export function extendRings(extent, rings) {
|
||||
|
||||
@@ -39,7 +39,7 @@ import FormatType from './format/FormatType.js';
|
||||
/**
|
||||
* @param {string|module:ol/featureloader~FeatureUrlFunction} url Feature URL service.
|
||||
* @param {module:ol/format/Feature} format Feature format.
|
||||
* @param {function(this:module:ol/VectorTile, Array.<module:ol/Feature>, module:ol/proj/Projection, module:ol/extent~Extent)|function(this:module:ol/source/Vector, Array.<module:ol/Feature>)} success
|
||||
* @param {function(this:module:ol/VectorTile, Array<module:ol/Feature>, module:ol/proj/Projection, module:ol/extent~Extent)|function(this:module:ol/source/Vector, Array<module:ol/Feature>)} success
|
||||
* Function called with the loaded features and optionally with the data
|
||||
* projection. Called with the vector tile or source as `this`.
|
||||
* @param {function(this:module:ol/VectorTile)|function(this:module:ol/source/Vector)} failure
|
||||
@@ -118,7 +118,7 @@ export function loadFeaturesXhr(url, format, success, failure) {
|
||||
export function xhr(url, format) {
|
||||
return loadFeaturesXhr(url, format,
|
||||
/**
|
||||
* @param {Array.<module:ol/Feature>} features The loaded features.
|
||||
* @param {Array<module:ol/Feature>} features The loaded features.
|
||||
* @param {module:ol/proj/Projection} dataProjection Data
|
||||
* projection.
|
||||
* @this {module:ol/source/Vector}
|
||||
|
||||
@@ -108,7 +108,7 @@ class EsriJSON extends JSONFeature {
|
||||
const options = opt_options ? opt_options : {};
|
||||
if (esriJSONObject.features) {
|
||||
const esriJSONFeatureCollection = /** @type {EsriJSONFeatureCollection} */ (object);
|
||||
/** @type {Array.<module:ol/Feature>} */
|
||||
/** @type {Array<module:ol/Feature>} */
|
||||
const features = [];
|
||||
const esriJSONFeatures = esriJSONFeatureCollection.features;
|
||||
options.idField = object.objectIdFieldName;
|
||||
@@ -188,7 +188,7 @@ class EsriJSON extends JSONFeature {
|
||||
/**
|
||||
* Encode an array of features as a EsriJSON object.
|
||||
*
|
||||
* @param {Array.<module:ol/Feature>} features Features.
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @return {Object} EsriJSON Object.
|
||||
* @override
|
||||
@@ -252,9 +252,9 @@ function readGeometry(object, opt_options) {
|
||||
* Checks if any polygons in this array contain any other polygons in this
|
||||
* array. It is used for checking for holes.
|
||||
* Logic inspired by: https://github.com/Esri/terraformer-arcgis-parser
|
||||
* @param {Array.<!Array.<!Array.<number>>>} rings Rings.
|
||||
* @param {Array<!Array<!Array<number>>>} rings Rings.
|
||||
* @param {module:ol/geom/GeometryLayout} layout Geometry layout.
|
||||
* @return {Array.<!Array.<!Array.<number>>>} Transformed rings.
|
||||
* @return {Array<!Array<!Array<number>>>} Transformed rings.
|
||||
*/
|
||||
function convertRings(rings, layout) {
|
||||
const flatRing = [];
|
||||
@@ -376,7 +376,7 @@ function readMultiPointGeometry(object) {
|
||||
function readMultiPolygonGeometry(object) {
|
||||
const layout = getGeometryLayout(object);
|
||||
return new MultiPolygon(
|
||||
/** @type {Array.<Array.<Array.<Array.<number>>>>} */(object.rings),
|
||||
/** @type {Array<Array<Array<Array<number>>>>} */(object.rings),
|
||||
layout);
|
||||
}
|
||||
|
||||
|
||||
@@ -141,7 +141,7 @@ class FeatureFormat {
|
||||
* @abstract
|
||||
* @param {Document|Node|ArrayBuffer|Object|string} source Source.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||
* @return {Array.<module:ol/Feature>} Features.
|
||||
* @return {Array<module:ol/Feature>} Features.
|
||||
*/
|
||||
readFeatures(source, opt_options) {}
|
||||
|
||||
@@ -178,7 +178,7 @@ class FeatureFormat {
|
||||
* Encode an array of features in this format.
|
||||
*
|
||||
* @abstract
|
||||
* @param {Array.<module:ol/Feature>} features Features.
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @return {string} Result.
|
||||
*/
|
||||
@@ -234,8 +234,8 @@ export function transformWithOptions(geometry, write, opt_options) {
|
||||
const power = Math.pow(10, opt_options.decimals);
|
||||
// if decimals option on write, round each coordinate appropriately
|
||||
/**
|
||||
* @param {Array.<number>} coordinates Coordinates.
|
||||
* @return {Array.<number>} Transformed coordinates.
|
||||
* @param {Array<number>} coordinates Coordinates.
|
||||
* @return {Array<number>} Transformed coordinates.
|
||||
*/
|
||||
const transform = function(coordinates) {
|
||||
for (let i = 0, ii = coordinates.length; i < ii; ++i) {
|
||||
|
||||
@@ -20,7 +20,7 @@ const GML = GML3;
|
||||
* Encode an array of features in GML 3.1.1 Simple Features.
|
||||
*
|
||||
* @function
|
||||
* @param {Array.<module:ol/Feature>} features Features.
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
||||
* @return {string} Result.
|
||||
* @api
|
||||
@@ -32,7 +32,7 @@ GML.prototype.writeFeatures;
|
||||
* Encode an array of features in the GML 3.1.1 format as an XML node.
|
||||
*
|
||||
* @function
|
||||
* @param {Array.<module:ol/Feature>} features Features.
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
||||
* @return {Node} Node.
|
||||
* @api
|
||||
|
||||
@@ -63,9 +63,9 @@ class GML2 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {Array.<number>|undefined} Flat coordinates.
|
||||
* @return {Array<number>|undefined} Flat coordinates.
|
||||
*/
|
||||
readFlatCoordinates_(node, objectStack) {
|
||||
const s = getAllTextContent(node, false).replace(/^\s*|\s*$/g, '');
|
||||
@@ -96,12 +96,12 @@ class GML2 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {module:ol/extent~Extent|undefined} Envelope.
|
||||
*/
|
||||
readBox_(node, objectStack) {
|
||||
/** @type {Array.<number>} */
|
||||
/** @type {Array<number>} */
|
||||
const flatCoordinates = pushParseAndPop([null],
|
||||
this.BOX_PARSERS_, node, objectStack, this);
|
||||
return createOrUpdate(flatCoordinates[1][0],
|
||||
@@ -111,15 +111,15 @@ class GML2 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
innerBoundaryIsParser_(node, objectStack) {
|
||||
/** @type {Array.<number>|undefined} */
|
||||
/** @type {Array<number>|undefined} */
|
||||
const flatLinearRing = pushParseAndPop(undefined,
|
||||
this.RING_PARSERS, node, objectStack, this);
|
||||
if (flatLinearRing) {
|
||||
const flatLinearRings = /** @type {Array.<Array.<number>>} */
|
||||
const flatLinearRings = /** @type {Array<Array<number>>} */
|
||||
(objectStack[objectStack.length - 1]);
|
||||
flatLinearRings.push(flatLinearRing);
|
||||
}
|
||||
@@ -127,15 +127,15 @@ class GML2 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
outerBoundaryIsParser_(node, objectStack) {
|
||||
/** @type {Array.<number>|undefined} */
|
||||
/** @type {Array<number>|undefined} */
|
||||
const flatLinearRing = pushParseAndPop(undefined,
|
||||
this.RING_PARSERS, node, objectStack, this);
|
||||
if (flatLinearRing) {
|
||||
const flatLinearRings = /** @type {Array.<Array.<number>>} */
|
||||
const flatLinearRings = /** @type {Array<Array<number>>} */
|
||||
(objectStack[objectStack.length - 1]);
|
||||
flatLinearRings[0] = flatLinearRing;
|
||||
}
|
||||
@@ -144,7 +144,7 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @const
|
||||
* @param {*} value Value.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @param {string=} opt_nodeName Node name.
|
||||
* @return {Node|undefined} Node.
|
||||
* @private
|
||||
@@ -174,7 +174,7 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
writeFeatureElement(node, feature, objectStack) {
|
||||
const fid = feature.getId();
|
||||
@@ -220,7 +220,7 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/LineString} geometry LineString geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeCurveOrLineString_(node, geometry, objectStack) {
|
||||
@@ -245,7 +245,7 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/LineString} line LineString geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeLineStringOrCurveMember_(node, line, objectStack) {
|
||||
@@ -259,7 +259,7 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/MultiLineString} geometry MultiLineString geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeMultiCurveOrLineString_(node, geometry, objectStack) {
|
||||
@@ -280,7 +280,7 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/Geometry|module:ol/extent~Extent} geometry Geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
writeGeometryElement(node, geometry, objectStack) {
|
||||
const context = /** @type {module:ol/format/Feature~WriteOptions} */ (objectStack[objectStack.length - 1]);
|
||||
@@ -320,7 +320,7 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/LineString|module:ol/geom/LinearRing} value Geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeCoordinates_(node, value, objectStack) {
|
||||
@@ -341,7 +341,7 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/LineString} line LineString geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeCurveSegments_(node, line, objectStack) {
|
||||
@@ -353,7 +353,7 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/Polygon} geometry Polygon geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeSurfaceOrPolygon_(node, geometry, objectStack) {
|
||||
@@ -380,7 +380,7 @@ class GML2 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {*} value Value.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @param {string=} opt_nodeName Node name.
|
||||
* @return {Node} Node.
|
||||
* @private
|
||||
@@ -399,7 +399,7 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/Polygon} polygon Polygon geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeSurfacePatches_(node, polygon, objectStack) {
|
||||
@@ -411,7 +411,7 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/LinearRing} ring LinearRing geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeRing_(node, ring, objectStack) {
|
||||
@@ -421,7 +421,7 @@ class GML2 extends GMLBase {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} point Point geometry.
|
||||
* @param {Array<number>} point Point geometry.
|
||||
* @param {string=} opt_srsName Optional srsName
|
||||
* @param {boolean=} opt_hasZ whether the geometry has a Z coordinate (is 3D) or not.
|
||||
* @return {string} The coords string.
|
||||
@@ -447,7 +447,7 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/Point} geometry Point geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writePoint_(node, geometry, objectStack) {
|
||||
@@ -467,7 +467,7 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/MultiPoint} geometry MultiPoint geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeMultiPoint_(node, geometry, objectStack) {
|
||||
@@ -487,7 +487,7 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/Point} point Point geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writePointMember_(node, point, objectStack) {
|
||||
@@ -499,7 +499,7 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/LinearRing} geometry LinearRing geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeLinearRing_(node, geometry, objectStack) {
|
||||
@@ -516,7 +516,7 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/MultiPolygon} geometry MultiPolygon geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeMultiSurfaceOrPolygon_(node, geometry, objectStack) {
|
||||
@@ -537,7 +537,7 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/Polygon} polygon Polygon geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeSurfaceOrPolygonMember_(node, polygon, objectStack) {
|
||||
@@ -552,7 +552,7 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeEnvelope(node, extent, objectStack) {
|
||||
@@ -573,7 +573,7 @@ class GML2 extends GMLBase {
|
||||
/**
|
||||
* @const
|
||||
* @param {*} value Value.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @param {string=} opt_nodeName Node name.
|
||||
* @return {Node|undefined} Node.
|
||||
* @private
|
||||
|
||||
@@ -103,12 +103,12 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {module:ol/geom/MultiLineString|undefined} MultiLineString.
|
||||
*/
|
||||
readMultiCurve_(node, objectStack) {
|
||||
/** @type {Array.<module:ol/geom/LineString>} */
|
||||
/** @type {Array<module:ol/geom/LineString>} */
|
||||
const lineStrings = pushParseAndPop([],
|
||||
this.MULTICURVE_PARSERS_, node, objectStack, this);
|
||||
if (lineStrings) {
|
||||
@@ -121,12 +121,12 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {module:ol/geom/MultiPolygon|undefined} MultiPolygon.
|
||||
*/
|
||||
readMultiSurface_(node, objectStack) {
|
||||
/** @type {Array.<module:ol/geom/Polygon>} */
|
||||
/** @type {Array<module:ol/geom/Polygon>} */
|
||||
const polygons = pushParseAndPop([],
|
||||
this.MULTISURFACE_PARSERS_, node, objectStack, this);
|
||||
if (polygons) {
|
||||
@@ -136,7 +136,7 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
curveMemberParser_(node, objectStack) {
|
||||
@@ -145,7 +145,7 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
surfaceMemberParser_(node, objectStack) {
|
||||
@@ -155,9 +155,9 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {Array.<(Array.<number>)>|undefined} flat coordinates.
|
||||
* @return {Array<(Array<number>)>|undefined} flat coordinates.
|
||||
*/
|
||||
readPatch_(node, objectStack) {
|
||||
return pushParseAndPop([null],
|
||||
@@ -166,9 +166,9 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {Array.<number>|undefined} flat coordinates.
|
||||
* @return {Array<number>|undefined} flat coordinates.
|
||||
*/
|
||||
readSegment_(node, objectStack) {
|
||||
return pushParseAndPop([null],
|
||||
@@ -177,9 +177,9 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {Array.<(Array.<number>)>|undefined} flat coordinates.
|
||||
* @return {Array<(Array<number>)>|undefined} flat coordinates.
|
||||
*/
|
||||
readPolygonPatch_(node, objectStack) {
|
||||
return pushParseAndPop([null],
|
||||
@@ -188,9 +188,9 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {Array.<number>|undefined} flat coordinates.
|
||||
* @return {Array<number>|undefined} flat coordinates.
|
||||
*/
|
||||
readLineStringSegment_(node, objectStack) {
|
||||
return pushParseAndPop([null],
|
||||
@@ -200,15 +200,15 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
interiorParser_(node, objectStack) {
|
||||
/** @type {Array.<number>|undefined} */
|
||||
/** @type {Array<number>|undefined} */
|
||||
const flatLinearRing = pushParseAndPop(undefined,
|
||||
this.RING_PARSERS, node, objectStack, this);
|
||||
if (flatLinearRing) {
|
||||
const flatLinearRings = /** @type {Array.<Array.<number>>} */
|
||||
const flatLinearRings = /** @type {Array<Array<number>>} */
|
||||
(objectStack[objectStack.length - 1]);
|
||||
flatLinearRings.push(flatLinearRing);
|
||||
}
|
||||
@@ -216,15 +216,15 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
exteriorParser_(node, objectStack) {
|
||||
/** @type {Array.<number>|undefined} */
|
||||
/** @type {Array<number>|undefined} */
|
||||
const flatLinearRing = pushParseAndPop(undefined,
|
||||
this.RING_PARSERS, node, objectStack, this);
|
||||
if (flatLinearRing) {
|
||||
const flatLinearRings = /** @type {Array.<Array.<number>>} */
|
||||
const flatLinearRings = /** @type {Array<Array<number>>} */
|
||||
(objectStack[objectStack.length - 1]);
|
||||
flatLinearRings[0] = flatLinearRing;
|
||||
}
|
||||
@@ -232,12 +232,12 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {module:ol/geom/Polygon|undefined} Polygon.
|
||||
*/
|
||||
readSurface_(node, objectStack) {
|
||||
/** @type {Array.<Array.<number>>} */
|
||||
/** @type {Array<Array<number>>} */
|
||||
const flatLinearRings = pushParseAndPop([null],
|
||||
this.SURFACE_PARSERS_, node, objectStack, this);
|
||||
if (flatLinearRings && flatLinearRings[0]) {
|
||||
@@ -256,12 +256,12 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {module:ol/geom/LineString|undefined} LineString.
|
||||
*/
|
||||
readCurve_(node, objectStack) {
|
||||
/** @type {Array.<number>} */
|
||||
/** @type {Array<number>} */
|
||||
const flatCoordinates = pushParseAndPop([null],
|
||||
this.CURVE_PARSERS_, node, objectStack, this);
|
||||
if (flatCoordinates) {
|
||||
@@ -274,12 +274,12 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {module:ol/extent~Extent|undefined} Envelope.
|
||||
*/
|
||||
readEnvelope_(node, objectStack) {
|
||||
/** @type {Array.<number>} */
|
||||
/** @type {Array<number>} */
|
||||
const flatCoordinates = pushParseAndPop([null],
|
||||
this.ENVELOPE_PARSERS_, node, objectStack, this);
|
||||
return createOrUpdate(flatCoordinates[1][0],
|
||||
@@ -289,14 +289,14 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {Array.<number>|undefined} Flat coordinates.
|
||||
* @return {Array<number>|undefined} Flat coordinates.
|
||||
*/
|
||||
readFlatPos_(node, objectStack) {
|
||||
let s = getAllTextContent(node, false);
|
||||
const re = /^\s*([+\-]?\d*\.?\d+(?:[eE][+\-]?\d+)?)\s*/;
|
||||
/** @type {Array.<number>} */
|
||||
/** @type {Array<number>} */
|
||||
const flatCoordinates = [];
|
||||
let m;
|
||||
while ((m = re.exec(s))) {
|
||||
@@ -334,9 +334,9 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {Array.<number>|undefined} Flat coordinates.
|
||||
* @return {Array<number>|undefined} Flat coordinates.
|
||||
*/
|
||||
readFlatPosList_(node, objectStack) {
|
||||
const s = getAllTextContent(node, false).replace(/^\s*|\s*$/g, '');
|
||||
@@ -381,7 +381,7 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/Point} value Point geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writePos_(node, value, objectStack) {
|
||||
@@ -411,7 +411,7 @@ class GML3 extends GMLBase {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} point Point geometry.
|
||||
* @param {Array<number>} point Point geometry.
|
||||
* @param {string=} opt_srsName Optional srsName
|
||||
* @param {boolean=} opt_hasZ whether the geometry has a Z coordinate (is 3D) or not.
|
||||
* @return {string} The coords string.
|
||||
@@ -437,7 +437,7 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/LineString|module:ol/geom/LinearRing} value Geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writePosList_(node, value, objectStack) {
|
||||
@@ -461,7 +461,7 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/Point} geometry Point geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writePoint_(node, geometry, objectStack) {
|
||||
@@ -478,7 +478,7 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
writeEnvelope(node, extent, objectStack) {
|
||||
const context = objectStack[objectStack.length - 1];
|
||||
@@ -498,7 +498,7 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/LinearRing} geometry LinearRing geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeLinearRing_(node, geometry, objectStack) {
|
||||
@@ -514,7 +514,7 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {*} value Value.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @param {string=} opt_nodeName Node name.
|
||||
* @return {Node} Node.
|
||||
* @private
|
||||
@@ -533,7 +533,7 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/Polygon} geometry Polygon geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeSurfaceOrPolygon_(node, geometry, objectStack) {
|
||||
@@ -561,7 +561,7 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/LineString} geometry LineString geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeCurveOrLineString_(node, geometry, objectStack) {
|
||||
@@ -586,7 +586,7 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/MultiPolygon} geometry MultiPolygon geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeMultiSurfaceOrPolygon_(node, geometry, objectStack) {
|
||||
@@ -607,7 +607,7 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/MultiPoint} geometry MultiPoint geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeMultiPoint_(node, geometry, objectStack) {
|
||||
@@ -627,7 +627,7 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/MultiLineString} geometry MultiLineString geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeMultiCurveOrLineString_(node, geometry, objectStack) {
|
||||
@@ -648,7 +648,7 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/LinearRing} ring LinearRing geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeRing_(node, ring, objectStack) {
|
||||
@@ -660,7 +660,7 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/Polygon} polygon Polygon geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeSurfaceOrPolygonMember_(node, polygon, objectStack) {
|
||||
@@ -675,7 +675,7 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/Point} point Point geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writePointMember_(node, point, objectStack) {
|
||||
@@ -687,7 +687,7 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/LineString} line LineString geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeLineStringOrCurveMember_(node, line, objectStack) {
|
||||
@@ -701,7 +701,7 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/Polygon} polygon Polygon geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeSurfacePatches_(node, polygon, objectStack) {
|
||||
@@ -713,7 +713,7 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/LineString} line LineString geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeCurveSegments_(node, line, objectStack) {
|
||||
@@ -726,7 +726,7 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/Geometry|module:ol/extent~Extent} geometry Geometry.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
writeGeometryElement(node, geometry, objectStack) {
|
||||
const context = /** @type {module:ol/format/Feature~WriteOptions} */ (objectStack[objectStack.length - 1]);
|
||||
@@ -752,7 +752,7 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
writeFeatureElement(node, feature, objectStack) {
|
||||
const fid = feature.getId();
|
||||
@@ -797,8 +797,8 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<module:ol/Feature>} features Features.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
* @private
|
||||
*/
|
||||
writeFeatureMembers_(node, features, objectStack) {
|
||||
@@ -821,7 +821,7 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @const
|
||||
* @param {*} value Value.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @param {string=} opt_nodeName Node name.
|
||||
* @return {Node|undefined} Node.
|
||||
* @private
|
||||
@@ -835,7 +835,7 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* @const
|
||||
* @param {*} value Value.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @param {string=} opt_nodeName Node name.
|
||||
* @return {Node|undefined} Node.
|
||||
* @private
|
||||
@@ -890,7 +890,7 @@ class GML3 extends GMLBase {
|
||||
/**
|
||||
* Encode an array of features in the GML 3.1.1 format as an XML node.
|
||||
*
|
||||
* @param {Array.<module:ol/Feature>} features Features.
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
||||
* @return {Node} Node.
|
||||
* @override
|
||||
@@ -1100,7 +1100,7 @@ GML3.prototype.SEGMENTS_PARSERS_ = {
|
||||
* Encode an array of features in GML 3.1.1 Simple Features.
|
||||
*
|
||||
* @function
|
||||
* @param {Array.<module:ol/Feature>} features Features.
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
||||
* @return {string} Result.
|
||||
* @api
|
||||
|
||||
@@ -52,7 +52,7 @@ const ONLY_WHITESPACE_RE = /^[\s\xa0]*$/;
|
||||
* feature namespaces themselves. So for instance there might be a featureType
|
||||
* item `topp:states` in the `featureType` array and then there will be a key
|
||||
* `topp` in the featureNS object with value `http://www.openplans.org/topp`.
|
||||
* @property {Array.<string>|string} [featureType] Feature type(s) to parse.
|
||||
* @property {Array<string>|string} [featureType] Feature type(s) to parse.
|
||||
* If multiple feature types need to be configured
|
||||
* which come from different feature namespaces, `featureNS` will be an object
|
||||
* with the keys being the prefixes used in the entries of featureType array.
|
||||
@@ -96,7 +96,7 @@ class GMLBase extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {Array.<string>|string|undefined}
|
||||
* @type {Array<string>|string|undefined}
|
||||
*/
|
||||
this.featureType = options.featureType;
|
||||
|
||||
@@ -131,8 +131,8 @@ class GMLBase extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Array.<module:ol/Feature> | undefined} Features.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Array<module:ol/Feature> | undefined} Features.
|
||||
*/
|
||||
readFeaturesInternal(node, objectStack) {
|
||||
const localName = node.localName;
|
||||
@@ -219,7 +219,7 @@ class GMLBase extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/geom/Geometry|undefined} Geometry.
|
||||
*/
|
||||
readGeometryElement(node, objectStack) {
|
||||
@@ -239,7 +239,7 @@ class GMLBase extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/Feature} Feature.
|
||||
*/
|
||||
readFeatureElement(node, objectStack) {
|
||||
@@ -280,7 +280,7 @@ class GMLBase extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/geom/Point|undefined} Point.
|
||||
*/
|
||||
readPoint(node, objectStack) {
|
||||
@@ -292,11 +292,11 @@ class GMLBase extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/geom/MultiPoint|undefined} MultiPoint.
|
||||
*/
|
||||
readMultiPoint(node, objectStack) {
|
||||
/** @type {Array.<Array.<number>>} */
|
||||
/** @type {Array<Array<number>>} */
|
||||
const coordinates = pushParseAndPop([],
|
||||
this.MULTIPOINT_PARSERS_, node, objectStack, this);
|
||||
if (coordinates) {
|
||||
@@ -308,11 +308,11 @@ class GMLBase extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/geom/MultiLineString|undefined} MultiLineString.
|
||||
*/
|
||||
readMultiLineString(node, objectStack) {
|
||||
/** @type {Array.<module:ol/geom/LineString>} */
|
||||
/** @type {Array<module:ol/geom/LineString>} */
|
||||
const lineStrings = pushParseAndPop([],
|
||||
this.MULTILINESTRING_PARSERS_, node, objectStack, this);
|
||||
if (lineStrings) {
|
||||
@@ -322,11 +322,11 @@ class GMLBase extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/geom/MultiPolygon|undefined} MultiPolygon.
|
||||
*/
|
||||
readMultiPolygon(node, objectStack) {
|
||||
/** @type {Array.<module:ol/geom/Polygon>} */
|
||||
/** @type {Array<module:ol/geom/Polygon>} */
|
||||
const polygons = pushParseAndPop([], this.MULTIPOLYGON_PARSERS_, node, objectStack, this);
|
||||
if (polygons) {
|
||||
return new MultiPolygon(polygons);
|
||||
@@ -335,7 +335,7 @@ class GMLBase extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
pointMemberParser_(node, objectStack) {
|
||||
@@ -344,7 +344,7 @@ class GMLBase extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
lineStringMemberParser_(node, objectStack) {
|
||||
@@ -353,7 +353,7 @@ class GMLBase extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
polygonMemberParser_(node, objectStack) {
|
||||
@@ -362,7 +362,7 @@ class GMLBase extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/geom/LineString|undefined} LineString.
|
||||
*/
|
||||
readLineString(node, objectStack) {
|
||||
@@ -377,9 +377,9 @@ class GMLBase extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {Array.<number>|undefined} LinearRing flat coordinates.
|
||||
* @return {Array<number>|undefined} LinearRing flat coordinates.
|
||||
*/
|
||||
readFlatLinearRing_(node, objectStack) {
|
||||
const ring = pushParseAndPop(null,
|
||||
@@ -394,7 +394,7 @@ class GMLBase extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/geom/LinearRing|undefined} LinearRing.
|
||||
*/
|
||||
readLinearRing(node, objectStack) {
|
||||
@@ -406,11 +406,11 @@ class GMLBase extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/geom/Polygon|undefined} Polygon.
|
||||
*/
|
||||
readPolygon(node, objectStack) {
|
||||
/** @type {Array.<Array.<number>>} */
|
||||
/** @type {Array<Array<number>>} */
|
||||
const flatLinearRings = pushParseAndPop([null],
|
||||
this.FLAT_LINEAR_RINGS_PARSERS_, node, objectStack, this);
|
||||
if (flatLinearRings && flatLinearRings[0]) {
|
||||
@@ -429,9 +429,9 @@ class GMLBase extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {Array.<number>} Flat coordinates.
|
||||
* @return {Array<number>} Flat coordinates.
|
||||
*/
|
||||
readFlatCoordinatesFromNode_(node, objectStack) {
|
||||
return pushParseAndPop(null, this.GEOMETRY_FLAT_COORDINATES_PARSERS_, node, objectStack, this);
|
||||
|
||||
@@ -19,7 +19,7 @@ import {createElementNS, makeArrayPusher, makeArraySerializer, makeChildAppender
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Array.<null|string>}
|
||||
* @type {Array<null|string>}
|
||||
*/
|
||||
const NAMESPACE_URIS = [
|
||||
null,
|
||||
@@ -38,7 +38,7 @@ const SCHEMA_LOCATION = 'http://www.topografix.com/GPX/1/1 ' +
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, function(Node, Array.<*>): (module:ol/Feature|undefined)>}
|
||||
* @type {Object.<string, function(Node, Array<*>): (module:ol/Feature|undefined)>}
|
||||
*/
|
||||
const FEATURE_READER = {
|
||||
'rte': readRte,
|
||||
@@ -138,7 +138,7 @@ class GPX extends XMLFeature {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Array.<module:ol/Feature>} features List of features.
|
||||
* @param {Array<module:ol/Feature>} features List of features.
|
||||
* @private
|
||||
*/
|
||||
handleReadExtensions_(features) {
|
||||
@@ -182,7 +182,7 @@ class GPX extends XMLFeature {
|
||||
return [];
|
||||
}
|
||||
if (node.localName == 'gpx') {
|
||||
/** @type {Array.<module:ol/Feature>} */
|
||||
/** @type {Array<module:ol/Feature>} */
|
||||
const features = pushParseAndPop([], GPX_PARSERS,
|
||||
node, [this.getReadOptions(node, opt_options)]);
|
||||
if (features) {
|
||||
@@ -200,7 +200,7 @@ class GPX extends XMLFeature {
|
||||
* LineString geometries are output as routes (`<rte>`), and MultiLineString
|
||||
* as tracks (`<trk>`).
|
||||
*
|
||||
* @param {Array.<module:ol/Feature>} features Features.
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
||||
* @return {Node} Node.
|
||||
* @override
|
||||
@@ -321,7 +321,7 @@ const WPT_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Array.<string>}
|
||||
* @type {Array<string>}
|
||||
*/
|
||||
const LINK_SEQUENCE = ['text', 'type'];
|
||||
|
||||
@@ -339,7 +339,7 @@ const LINK_SERIALIZERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Array.<string>>}
|
||||
* @type {Object.<string, Array<string>>}
|
||||
*/
|
||||
const RTE_SEQUENCE = makeStructureNS(
|
||||
NAMESPACE_URIS, [
|
||||
@@ -366,7 +366,7 @@ const RTE_SERIALIZERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Array.<string>>}
|
||||
* @type {Object.<string, Array<string>>}
|
||||
*/
|
||||
const RTEPT_TYPE_SEQUENCE = makeStructureNS(
|
||||
NAMESPACE_URIS, [
|
||||
@@ -376,7 +376,7 @@ const RTEPT_TYPE_SEQUENCE = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Array.<string>>}
|
||||
* @type {Object.<string, Array<string>>}
|
||||
*/
|
||||
const TRK_SEQUENCE = makeStructureNS(
|
||||
NAMESPACE_URIS, [
|
||||
@@ -403,7 +403,7 @@ const TRK_SERIALIZERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {function(*, Array.<*>, string=): (Node|undefined)}
|
||||
* @type {function(*, Array<*>, string=): (Node|undefined)}
|
||||
*/
|
||||
const TRKSEG_NODE_FACTORY = makeSimpleNodeFactory('trkpt');
|
||||
|
||||
@@ -420,7 +420,7 @@ const TRKSEG_SERIALIZERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Array.<string>>}
|
||||
* @type {Object.<string, Array<string>>}
|
||||
*/
|
||||
const WPT_TYPE_SEQUENCE = makeStructureNS(
|
||||
NAMESPACE_URIS, [
|
||||
@@ -470,7 +470,7 @@ const GEOMETRY_TYPE_TO_NODENAME = {
|
||||
|
||||
/**
|
||||
* @param {*} value Value.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @param {string=} opt_nodeName Node name.
|
||||
* @return {Node|undefined} Node.
|
||||
*/
|
||||
@@ -487,11 +487,11 @@ function GPX_NODE_FACTORY(value, objectStack, opt_nodeName) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {module:ol/format/GPX~LayoutOptions} layoutOptions Layout options.
|
||||
* @param {Node} node Node.
|
||||
* @param {!Object} values Values.
|
||||
* @return {Array.<number>} Flat coordinates.
|
||||
* @return {Array<number>} Flat coordinates.
|
||||
*/
|
||||
function appendCoordinate(flatCoordinates, layoutOptions, node, values) {
|
||||
flatCoordinates.push(
|
||||
@@ -520,8 +520,8 @@ function appendCoordinate(flatCoordinates, layoutOptions, node, values) {
|
||||
* and ends arrays by shrinking them accordingly (removing unused zero entries).
|
||||
*
|
||||
* @param {module:ol/format/GPX~LayoutOptions} layoutOptions Layout options.
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array.<number>=} ends Ends.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>=} ends Ends.
|
||||
* @return {module:ol/geom/GeometryLayout} Layout.
|
||||
*/
|
||||
function applyLayoutOptions(layoutOptions, flatCoordinates, ends) {
|
||||
@@ -561,7 +561,7 @@ function applyLayoutOptions(layoutOptions, flatCoordinates, ends) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function parseLink(node, objectStack) {
|
||||
const values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||
@@ -575,7 +575,7 @@ function parseLink(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function parseExtensions(node, objectStack) {
|
||||
const values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||
@@ -585,13 +585,13 @@ function parseExtensions(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function parseRtePt(node, objectStack) {
|
||||
const values = pushParseAndPop({}, RTEPT_PARSERS, node, objectStack);
|
||||
if (values) {
|
||||
const rteValues = /** @type {!Object} */ (objectStack[objectStack.length - 1]);
|
||||
const flatCoordinates = /** @type {Array.<number>} */ (rteValues['flatCoordinates']);
|
||||
const flatCoordinates = /** @type {Array<number>} */ (rteValues['flatCoordinates']);
|
||||
const layoutOptions = /** @type {module:ol/format/GPX~LayoutOptions} */ (rteValues['layoutOptions']);
|
||||
appendCoordinate(flatCoordinates, layoutOptions, node, values);
|
||||
}
|
||||
@@ -600,13 +600,13 @@ function parseRtePt(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function parseTrkPt(node, objectStack) {
|
||||
const values = pushParseAndPop({}, TRKPT_PARSERS, node, objectStack);
|
||||
if (values) {
|
||||
const trkValues = /** @type {!Object} */ (objectStack[objectStack.length - 1]);
|
||||
const flatCoordinates = /** @type {Array.<number>} */ (trkValues['flatCoordinates']);
|
||||
const flatCoordinates = /** @type {Array<number>} */ (trkValues['flatCoordinates']);
|
||||
const layoutOptions = /** @type {module:ol/format/GPX~LayoutOptions} */ (trkValues['layoutOptions']);
|
||||
appendCoordinate(flatCoordinates, layoutOptions, node, values);
|
||||
}
|
||||
@@ -615,21 +615,21 @@ function parseTrkPt(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function parseTrkSeg(node, objectStack) {
|
||||
const values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||
parseNode(TRKSEG_PARSERS, node, objectStack);
|
||||
const flatCoordinates = /** @type {Array.<number>} */
|
||||
const flatCoordinates = /** @type {Array<number>} */
|
||||
(values['flatCoordinates']);
|
||||
const ends = /** @type {Array.<number>} */ (values['ends']);
|
||||
const ends = /** @type {Array<number>} */ (values['ends']);
|
||||
ends.push(flatCoordinates.length);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/Feature|undefined} Track.
|
||||
*/
|
||||
function readRte(node, objectStack) {
|
||||
@@ -641,7 +641,7 @@ function readRte(node, objectStack) {
|
||||
if (!values) {
|
||||
return undefined;
|
||||
}
|
||||
const flatCoordinates = /** @type {Array.<number>} */
|
||||
const flatCoordinates = /** @type {Array<number>} */
|
||||
(values['flatCoordinates']);
|
||||
delete values['flatCoordinates'];
|
||||
const layoutOptions = /** @type {module:ol/format/GPX~LayoutOptions} */ (values['layoutOptions']);
|
||||
@@ -657,7 +657,7 @@ function readRte(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/Feature|undefined} Track.
|
||||
*/
|
||||
function readTrk(node, objectStack) {
|
||||
@@ -670,10 +670,10 @@ function readTrk(node, objectStack) {
|
||||
if (!values) {
|
||||
return undefined;
|
||||
}
|
||||
const flatCoordinates = /** @type {Array.<number>} */
|
||||
const flatCoordinates = /** @type {Array<number>} */
|
||||
(values['flatCoordinates']);
|
||||
delete values['flatCoordinates'];
|
||||
const ends = /** @type {Array.<number>} */ (values['ends']);
|
||||
const ends = /** @type {Array<number>} */ (values['ends']);
|
||||
delete values['ends'];
|
||||
const layoutOptions = /** @type {module:ol/format/GPX~LayoutOptions} */ (values['layoutOptions']);
|
||||
delete values['layoutOptions'];
|
||||
@@ -688,7 +688,7 @@ function readTrk(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/Feature|undefined} Waypoint.
|
||||
*/
|
||||
function readWpt(node, objectStack) {
|
||||
@@ -711,7 +711,7 @@ function readWpt(node, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {string} value Value for the link's `href` attribute.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeLink(node, value, objectStack) {
|
||||
node.setAttribute('href', value);
|
||||
@@ -730,7 +730,7 @@ function writeLink(node, value, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function writeWptType(node, coordinate, objectStack) {
|
||||
const context = objectStack[objectStack.length - 1];
|
||||
@@ -774,7 +774,7 @@ function writeWptType(node, coordinate, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function writeRte(node, feature, objectStack) {
|
||||
const options = /** @type {module:ol/format/Feature~WriteOptions} */ (objectStack[0]);
|
||||
@@ -798,7 +798,7 @@ function writeRte(node, feature, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function writeTrk(node, feature, objectStack) {
|
||||
const options = /** @type {module:ol/format/Feature~WriteOptions} */ (objectStack[0]);
|
||||
@@ -823,7 +823,7 @@ function writeTrk(node, feature, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/LineString} lineString LineString.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function writeTrkSeg(node, lineString, objectStack) {
|
||||
/** @type {module:ol/xml~NodeStackItem} */
|
||||
@@ -838,7 +838,7 @@ function writeTrkSeg(node, lineString, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function writeWpt(node, feature, objectStack) {
|
||||
const options = /** @type {module:ol/format/Feature~WriteOptions} */ (objectStack[0]);
|
||||
|
||||
@@ -115,7 +115,7 @@ class GeoJSON extends JSONFeature {
|
||||
*/
|
||||
readFeaturesFromObject(object, opt_options) {
|
||||
const geoJSONObject = /** @type {GeoJSONObject} */ (object);
|
||||
/** @type {Array.<module:ol/Feature>} */
|
||||
/** @type {Array<module:ol/Feature>} */
|
||||
let features = null;
|
||||
if (geoJSONObject.type === 'FeatureCollection') {
|
||||
const geoJSONFeatureCollection = /** @type {GeoJSONFeatureCollection} */ (object);
|
||||
@@ -196,7 +196,7 @@ class GeoJSON extends JSONFeature {
|
||||
/**
|
||||
* Encode an array of features as a GeoJSON object.
|
||||
*
|
||||
* @param {Array.<module:ol/Feature>} features Features.
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @return {GeoJSONFeatureCollection} GeoJSON Object.
|
||||
* @override
|
||||
|
||||
@@ -44,7 +44,7 @@ class JSONFeature extends FeatureFormat {
|
||||
*
|
||||
* @param {ArrayBuffer|Document|Node|Object|string} source Source.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||
* @return {Array.<module:ol/Feature>} Features.
|
||||
* @return {Array<module:ol/Feature>} Features.
|
||||
* @api
|
||||
*/
|
||||
readFeatures(source, opt_options) {
|
||||
@@ -66,7 +66,7 @@ class JSONFeature extends FeatureFormat {
|
||||
* @param {Object} object Object.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||
* @protected
|
||||
* @return {Array.<module:ol/Feature>} Features.
|
||||
* @return {Array<module:ol/Feature>} Features.
|
||||
*/
|
||||
readFeaturesFromObject(object, opt_options) {}
|
||||
|
||||
@@ -134,7 +134,7 @@ class JSONFeature extends FeatureFormat {
|
||||
/**
|
||||
* Encode an array of features as string.
|
||||
*
|
||||
* @param {Array.<module:ol/Feature>} features Features.
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @return {string} Encoded features.
|
||||
* @api
|
||||
@@ -145,7 +145,7 @@ class JSONFeature extends FeatureFormat {
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param {Array.<module:ol/Feature>} features Features.
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @return {Object} Object.
|
||||
*/
|
||||
|
||||
@@ -43,14 +43,14 @@ import {createElementNS, getAllTextContent, isDocument, isNode, makeArrayExtende
|
||||
|
||||
/**
|
||||
* @typedef {Object} GxTrackObject
|
||||
* @property {Array.<number>} flatCoordinates
|
||||
* @property {Array.<number>} whens
|
||||
* @property {Array<number>} flatCoordinates
|
||||
* @property {Array<number>} whens
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Array.<string>}
|
||||
* @type {Array<string>}
|
||||
*/
|
||||
const GX_NAMESPACE_URIS = [
|
||||
'http://www.google.com/kml/ext/2.2'
|
||||
@@ -59,7 +59,7 @@ const GX_NAMESPACE_URIS = [
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Array.<null|string>}
|
||||
* @type {Array<null|string>}
|
||||
*/
|
||||
const NAMESPACE_URIS = [
|
||||
null,
|
||||
@@ -165,7 +165,7 @@ const REGION_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Array.<string>>}
|
||||
* @type {Object.<string, Array<string>>}
|
||||
*/
|
||||
const KML_SEQUENCE = makeStructureNS(
|
||||
NAMESPACE_URIS, [
|
||||
@@ -295,13 +295,13 @@ export function getDefaultStyle() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {Array.<module:ol/style/Style>}
|
||||
* @type {Array<module:ol/style/Style>}
|
||||
*/
|
||||
let DEFAULT_STYLE_ARRAY = null;
|
||||
|
||||
/**
|
||||
* Get the default style array (or null if not yet set).
|
||||
* @return {Array.<module:ol/style/Style>} The default style.
|
||||
* @return {Array<module:ol/style/Style>} The default style.
|
||||
*/
|
||||
export function getDefaultStyleArray() {
|
||||
return DEFAULT_STYLE_ARRAY;
|
||||
@@ -377,7 +377,7 @@ function createStyleDefaults() {
|
||||
* @typedef {Object} Options
|
||||
* @property {boolean} [extractStyles=true] Extract styles from the KML.
|
||||
* @property {boolean} [showPointNames=true] Show names as labels for placemarks which contain points.
|
||||
* @property {Array.<module:ol/style/Style>} [defaultStyle] Default style. The
|
||||
* @property {Array<module:ol/style/Style>} [defaultStyle] Default style. The
|
||||
* default default style is the same as Google Earth.
|
||||
* @property {boolean} [writeStyles=true] Write styles into KML.
|
||||
*/
|
||||
@@ -420,7 +420,7 @@ class KML extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<module:ol/style/Style>}
|
||||
* @type {Array<module:ol/style/Style>}
|
||||
*/
|
||||
this.defaultStyle_ = options.defaultStyle ?
|
||||
options.defaultStyle : DEFAULT_STYLE_ARRAY;
|
||||
@@ -441,7 +441,7 @@ class KML extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {!Object.<string, (Array.<module:ol/style/Style>|string)>}
|
||||
* @type {!Object.<string, (Array<module:ol/style/Style>|string)>}
|
||||
*/
|
||||
this.sharedStyles_ = {};
|
||||
|
||||
@@ -456,9 +456,9 @@ class KML extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {Array.<module:ol/Feature>|undefined} Features.
|
||||
* @return {Array<module:ol/Feature>|undefined} Features.
|
||||
*/
|
||||
readDocumentOrFolder_(node, objectStack) {
|
||||
// FIXME use scope somehow
|
||||
@@ -470,7 +470,7 @@ class KML extends XMLFeature {
|
||||
'Style': this.readSharedStyle_.bind(this),
|
||||
'StyleMap': this.readSharedStyleMap_.bind(this)
|
||||
});
|
||||
/** @type {Array.<module:ol/Feature>} */
|
||||
/** @type {Array<module:ol/Feature>} */
|
||||
const features = pushParseAndPop([], parsersNS, node, objectStack, this);
|
||||
if (features) {
|
||||
return features;
|
||||
@@ -481,7 +481,7 @@ class KML extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
* @return {module:ol/Feature|undefined} Feature.
|
||||
*/
|
||||
@@ -524,7 +524,7 @@ class KML extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
readSharedStyle_(node, objectStack) {
|
||||
@@ -550,7 +550,7 @@ class KML extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @private
|
||||
*/
|
||||
readSharedStyleMap_(node, objectStack) {
|
||||
@@ -698,7 +698,7 @@ class KML extends XMLFeature {
|
||||
* Read the network links of the KML.
|
||||
*
|
||||
* @param {Document|Node|string} source Source.
|
||||
* @return {Array.<Object>} Network links.
|
||||
* @return {Array<Object>} Network links.
|
||||
* @api
|
||||
*/
|
||||
readNetworkLinks(source) {
|
||||
@@ -718,7 +718,7 @@ class KML extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Document} doc Document.
|
||||
* @return {Array.<Object>} Network links.
|
||||
* @return {Array<Object>} Network links.
|
||||
*/
|
||||
readNetworkLinksFromDocument(doc) {
|
||||
const networkLinks = [];
|
||||
@@ -732,7 +732,7 @@ class KML extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @return {Array.<Object>} Network links.
|
||||
* @return {Array<Object>} Network links.
|
||||
*/
|
||||
readNetworkLinksFromNode(node) {
|
||||
const networkLinks = [];
|
||||
@@ -760,7 +760,7 @@ class KML extends XMLFeature {
|
||||
* Read the regions of the KML.
|
||||
*
|
||||
* @param {Document|Node|string} source Source.
|
||||
* @return {Array.<Object>} Regions.
|
||||
* @return {Array<Object>} Regions.
|
||||
* @api
|
||||
*/
|
||||
readRegion(source) {
|
||||
@@ -780,7 +780,7 @@ class KML extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Document} doc Document.
|
||||
* @return {Array.<Object>} Region.
|
||||
* @return {Array<Object>} Region.
|
||||
*/
|
||||
readRegionFromDocument(doc) {
|
||||
const regions = [];
|
||||
@@ -794,7 +794,7 @@ class KML extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @return {Array.<Object>} Region.
|
||||
* @return {Array<Object>} Region.
|
||||
* @api
|
||||
*/
|
||||
readRegionFromNode(node) {
|
||||
@@ -823,7 +823,7 @@ class KML extends XMLFeature {
|
||||
* Encode an array of features in the KML format as an XML node. GeometryCollections,
|
||||
* MultiPoints, MultiLineStrings, and MultiPolygons are output as MultiGeometries.
|
||||
*
|
||||
* @param {Array.<module:ol/Feature>} features Features.
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
||||
* @return {Node} Node.
|
||||
* @override
|
||||
@@ -902,10 +902,10 @@ function createNameStyleFunction(foundStyle, name) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<module:ol/style/Style>|undefined} style Style.
|
||||
* @param {Array<module:ol/style/Style>|undefined} style Style.
|
||||
* @param {string} styleUrl Style URL.
|
||||
* @param {Array.<module:ol/style/Style>} defaultStyle Default style.
|
||||
* @param {!Object.<string, (Array.<module:ol/style/Style>|string)>} sharedStyles Shared styles.
|
||||
* @param {Array<module:ol/style/Style>} defaultStyle Default style.
|
||||
* @param {!Object.<string, (Array<module:ol/style/Style>|string)>} sharedStyles Shared styles.
|
||||
* @param {boolean|undefined} showPointNames true to show names for point placemarks.
|
||||
* @return {module:ol/style/Style~StyleFunction} Feature style function.
|
||||
*/
|
||||
@@ -915,7 +915,7 @@ function createFeatureStyleFunction(style, styleUrl, defaultStyle, sharedStyles,
|
||||
/**
|
||||
* @param {module:ol/Feature} feature feature.
|
||||
* @param {number} resolution Resolution.
|
||||
* @return {Array.<module:ol/style/Style>} Style.
|
||||
* @return {Array<module:ol/style/Style>} Style.
|
||||
*/
|
||||
function(feature, resolution) {
|
||||
let drawName = showPointNames;
|
||||
@@ -960,11 +960,11 @@ function createFeatureStyleFunction(style, styleUrl, defaultStyle, sharedStyles,
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<module:ol/style/Style>|string|undefined} styleValue Style value.
|
||||
* @param {Array.<module:ol/style/Style>} defaultStyle Default style.
|
||||
* @param {!Object.<string, (Array.<module:ol/style/Style>|string)>} sharedStyles
|
||||
* @param {Array<module:ol/style/Style>|string|undefined} styleValue Style value.
|
||||
* @param {Array<module:ol/style/Style>} defaultStyle Default style.
|
||||
* @param {!Object.<string, (Array<module:ol/style/Style>|string)>} sharedStyles
|
||||
* Shared styles.
|
||||
* @return {Array.<module:ol/style/Style>} Style.
|
||||
* @return {Array<module:ol/style/Style>} Style.
|
||||
*/
|
||||
function findStyle(styleValue, defaultStyle, sharedStyles) {
|
||||
if (Array.isArray(styleValue)) {
|
||||
@@ -1009,7 +1009,7 @@ function readColor(node) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @return {Array.<number>|undefined} Flat coordinates.
|
||||
* @return {Array<number>|undefined} Flat coordinates.
|
||||
*/
|
||||
export function readFlatCoordinates(node) {
|
||||
let s = getAllTextContent(node, false);
|
||||
@@ -1104,8 +1104,8 @@ const STYLE_MAP_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Array.<module:ol/style/Style>|string|undefined} StyleMap.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Array<module:ol/style/Style>|string|undefined} StyleMap.
|
||||
*/
|
||||
function readStyleMapValue(node, objectStack) {
|
||||
return pushParseAndPop(undefined,
|
||||
@@ -1128,7 +1128,7 @@ const ICON_STYLE_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function iconStyleParser(node, objectStack) {
|
||||
// FIXME refreshMode
|
||||
@@ -1242,7 +1242,7 @@ const LABEL_STYLE_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function labelStyleParser(node, objectStack) {
|
||||
// FIXME colorMode
|
||||
@@ -1277,7 +1277,7 @@ const LINE_STYLE_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function lineStyleParser(node, objectStack) {
|
||||
// FIXME colorMode
|
||||
@@ -1314,7 +1314,7 @@ const POLY_STYLE_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function polyStyleParser(node, objectStack) {
|
||||
// FIXME colorMode
|
||||
@@ -1352,8 +1352,8 @@ const FLAT_LINEAR_RING_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Array.<number>} LinearRing flat coordinates.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Array<number>} LinearRing flat coordinates.
|
||||
*/
|
||||
function readFlatLinearRing(node, objectStack) {
|
||||
return pushParseAndPop(null,
|
||||
@@ -1363,7 +1363,7 @@ function readFlatLinearRing(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function gxCoordParser(node, objectStack) {
|
||||
const gxTrackObject = /** @type {module:ol/format/KML~GxTrackObject} */
|
||||
@@ -1396,7 +1396,7 @@ const GX_MULTITRACK_GEOMETRY_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/geom/MultiLineString|undefined} MultiLineString.
|
||||
*/
|
||||
function readGxMultiTrack(node, objectStack) {
|
||||
@@ -1424,7 +1424,7 @@ const GX_TRACK_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/geom/LineString|undefined} LineString.
|
||||
*/
|
||||
function readGxTrack(node, objectStack) {
|
||||
@@ -1463,7 +1463,7 @@ const ICON_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object} Icon object.
|
||||
*/
|
||||
function readIcon(node, objectStack) {
|
||||
@@ -1489,8 +1489,8 @@ const GEOMETRY_FLAT_COORDINATES_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Array.<number>} Flat coordinates.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Array<number>} Flat coordinates.
|
||||
*/
|
||||
function readFlatCoordinatesFromNode(node, objectStack) {
|
||||
return pushParseAndPop(null,
|
||||
@@ -1512,7 +1512,7 @@ const EXTRUDE_AND_ALTITUDE_MODE_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/geom/LineString|undefined} LineString.
|
||||
*/
|
||||
function readLineString(node, objectStack) {
|
||||
@@ -1533,7 +1533,7 @@ function readLineString(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/geom/Polygon|undefined} Polygon.
|
||||
*/
|
||||
function readLinearRing(node, objectStack) {
|
||||
@@ -1568,7 +1568,7 @@ const MULTI_GEOMETRY_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/geom/Geometry} Geometry.
|
||||
*/
|
||||
function readMultiGeometry(node, objectStack) {
|
||||
@@ -1627,7 +1627,7 @@ function readMultiGeometry(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/geom/Point|undefined} Point.
|
||||
*/
|
||||
function readPoint(node, objectStack) {
|
||||
@@ -1659,7 +1659,7 @@ const FLAT_LINEAR_RINGS_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/geom/Polygon|undefined} Polygon.
|
||||
*/
|
||||
function readPolygon(node, objectStack) {
|
||||
@@ -1699,8 +1699,8 @@ const STYLE_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Array.<module:ol/style/Style>} Style.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Array<module:ol/style/Style>} Style.
|
||||
*/
|
||||
function readStyle(node, objectStack) {
|
||||
const styleObject = pushParseAndPop(
|
||||
@@ -1746,7 +1746,7 @@ function readStyle(node, objectStack) {
|
||||
* Reads an array of geometries and creates arrays for common geometry
|
||||
* properties. Then sets them to the multi geometry.
|
||||
* @param {module:ol/geom/MultiPoint|module:ol/geom/MultiLineString|module:ol/geom/MultiPolygon} multiGeometry A multi-geometry.
|
||||
* @param {Array.<module:ol/geom/Geometry>} geometries List of geometries.
|
||||
* @param {Array<module:ol/geom/Geometry>} geometries List of geometries.
|
||||
*/
|
||||
function setCommonGeometryProperties(multiGeometry, geometries) {
|
||||
const ii = geometries.length;
|
||||
@@ -1789,7 +1789,7 @@ const DATA_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function dataParser(node, objectStack) {
|
||||
const name = node.getAttribute('name');
|
||||
@@ -1817,7 +1817,7 @@ const EXTENDED_DATA_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function extendedDataParser(node, objectStack) {
|
||||
parseNode(EXTENDED_DATA_PARSERS, node, objectStack);
|
||||
@@ -1825,7 +1825,7 @@ function extendedDataParser(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function regionParser(node, objectStack) {
|
||||
parseNode(REGION_PARSERS, node, objectStack);
|
||||
@@ -1845,7 +1845,7 @@ const PAIR_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function pairDataParser(node, objectStack) {
|
||||
const pairObject = pushParseAndPop(
|
||||
@@ -1872,7 +1872,7 @@ function pairDataParser(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function placemarkStyleMapParser(node, objectStack) {
|
||||
const styleMapValue = readStyleMapValue(node, objectStack);
|
||||
@@ -1902,7 +1902,7 @@ const SCHEMA_DATA_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function schemaDataParser(node, objectStack) {
|
||||
parseNode(SCHEMA_DATA_PARSERS, node, objectStack);
|
||||
@@ -1911,7 +1911,7 @@ function schemaDataParser(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function simpleDataParser(node, objectStack) {
|
||||
const name = node.getAttribute('name');
|
||||
@@ -1941,7 +1941,7 @@ const LAT_LON_ALT_BOX_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function latLonAltBoxParser(node, objectStack) {
|
||||
const object = pushParseAndPop({}, LAT_LON_ALT_BOX_PARSERS, node, objectStack);
|
||||
@@ -1977,7 +1977,7 @@ const LOD_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function lodParser(node, objectStack) {
|
||||
const object = pushParseAndPop({}, LOD_PARSERS, node, objectStack);
|
||||
@@ -2004,14 +2004,14 @@ const INNER_BOUNDARY_IS_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function innerBoundaryIsParser(node, objectStack) {
|
||||
/** @type {Array.<number>|undefined} */
|
||||
/** @type {Array<number>|undefined} */
|
||||
const flatLinearRing = pushParseAndPop(undefined,
|
||||
INNER_BOUNDARY_IS_PARSERS, node, objectStack);
|
||||
if (flatLinearRing) {
|
||||
const flatLinearRings = /** @type {Array.<Array.<number>>} */
|
||||
const flatLinearRings = /** @type {Array<Array<number>>} */
|
||||
(objectStack[objectStack.length - 1]);
|
||||
flatLinearRings.push(flatLinearRing);
|
||||
}
|
||||
@@ -2030,14 +2030,14 @@ const OUTER_BOUNDARY_IS_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function outerBoundaryIsParser(node, objectStack) {
|
||||
/** @type {Array.<number>|undefined} */
|
||||
/** @type {Array<number>|undefined} */
|
||||
const flatLinearRing = pushParseAndPop(undefined,
|
||||
OUTER_BOUNDARY_IS_PARSERS, node, objectStack);
|
||||
if (flatLinearRing) {
|
||||
const flatLinearRings = /** @type {Array.<Array.<number>>} */
|
||||
const flatLinearRings = /** @type {Array<Array<number>>} */
|
||||
(objectStack[objectStack.length - 1]);
|
||||
flatLinearRings[0] = flatLinearRing;
|
||||
}
|
||||
@@ -2046,7 +2046,7 @@ function outerBoundaryIsParser(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function linkParser(node, objectStack) {
|
||||
parseNode(LINK_PARSERS, node, objectStack);
|
||||
@@ -2055,7 +2055,7 @@ function linkParser(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function whenParser(node, objectStack) {
|
||||
const gxTrackObject = /** @type {module:ol/format/KML~GxTrackObject} */
|
||||
@@ -2085,8 +2085,8 @@ function writeColorTextNode(node, color) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node to append a TextNode with the coordinates to.
|
||||
* @param {Array.<number>} coordinates Coordinates.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<number>} coordinates Coordinates.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function writeCoordinatesTextNode(node, coordinates, objectStack) {
|
||||
const context = objectStack[objectStack.length - 1];
|
||||
@@ -2138,7 +2138,7 @@ const EXTENDEDDATA_NODE_SERIALIZERS = makeStructureNS(
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {{name: *, value: *}} pair Name value pair.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function writeDataNode(node, pair, objectStack) {
|
||||
node.setAttribute('name', pair.name);
|
||||
@@ -2193,7 +2193,7 @@ const DOCUMENT_SERIALIZERS = makeStructureNS(
|
||||
/**
|
||||
* @const
|
||||
* @param {*} value Value.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @param {string=} opt_nodeName Node name.
|
||||
* @return {Node|undefined} Node.
|
||||
*/
|
||||
@@ -2205,8 +2205,8 @@ const DOCUMENT_NODE_FACTORY = function(value, objectStack, opt_nodeName) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<module:ol/Feature>} features Features.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @this {module:ol/format/KML}
|
||||
*/
|
||||
function writeDocument(node, features, objectStack) {
|
||||
@@ -2220,7 +2220,7 @@ function writeDocument(node, features, objectStack) {
|
||||
/**
|
||||
* A factory for creating Data nodes.
|
||||
* @const
|
||||
* @type {function(*, Array.<*>): (Node|undefined)}
|
||||
* @type {function(*, Array<*>): (Node|undefined)}
|
||||
*/
|
||||
const DATA_NODE_FACTORY = makeSimpleNodeFactory('Data');
|
||||
|
||||
@@ -2228,7 +2228,7 @@ const DATA_NODE_FACTORY = makeSimpleNodeFactory('Data');
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {{names: Array<string>, values: (Array<*>)}} namesAndValues Names and values.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function writeExtendedData(node, namesAndValues, objectStack) {
|
||||
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
|
||||
@@ -2245,7 +2245,7 @@ function writeExtendedData(node, namesAndValues, objectStack) {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Array.<string>>}
|
||||
* @type {Object.<string, Array<string>>}
|
||||
*/
|
||||
const ICON_SEQUENCE = makeStructureNS(
|
||||
NAMESPACE_URIS, [
|
||||
@@ -2275,7 +2275,7 @@ const ICON_SERIALIZERS = makeStructureNS(
|
||||
/**
|
||||
* @const
|
||||
* @param {*} value Value.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @param {string=} opt_nodeName Node name.
|
||||
* @return {Node|undefined} Node.
|
||||
*/
|
||||
@@ -2288,7 +2288,7 @@ const GX_NODE_FACTORY = function(value, objectStack, opt_nodeName) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Object} icon Icon object.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function writeIcon(node, icon, objectStack) {
|
||||
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
|
||||
@@ -2308,7 +2308,7 @@ function writeIcon(node, icon, objectStack) {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Array.<string>>}
|
||||
* @type {Object.<string, Array<string>>}
|
||||
*/
|
||||
const ICON_STYLE_SEQUENCE = makeStructureNS(
|
||||
NAMESPACE_URIS, [
|
||||
@@ -2332,7 +2332,7 @@ const ICON_STYLE_SERIALIZERS = makeStructureNS(
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/style/Icon} style Icon style.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function writeIconStyle(node, style, objectStack) {
|
||||
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
|
||||
@@ -2388,7 +2388,7 @@ function writeIconStyle(node, style, objectStack) {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Array.<string>>}
|
||||
* @type {Object.<string, Array<string>>}
|
||||
*/
|
||||
const LABEL_STYLE_SEQUENCE = makeStructureNS(
|
||||
NAMESPACE_URIS, [
|
||||
@@ -2410,7 +2410,7 @@ const LABEL_STYLE_SERIALIZERS = makeStructureNS(
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/style/Text} style style.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function writeLabelStyle(node, style, objectStack) {
|
||||
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
|
||||
@@ -2434,7 +2434,7 @@ function writeLabelStyle(node, style, objectStack) {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Array.<string>>}
|
||||
* @type {Object.<string, Array<string>>}
|
||||
*/
|
||||
const LINE_STYLE_SEQUENCE = makeStructureNS(
|
||||
NAMESPACE_URIS, [
|
||||
@@ -2456,7 +2456,7 @@ const LINE_STYLE_SERIALIZERS = makeStructureNS(
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/style/Stroke} style style.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function writeLineStyle(node, style, objectStack) {
|
||||
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
|
||||
@@ -2491,7 +2491,7 @@ const GEOMETRY_TYPE_TO_NODENAME = {
|
||||
/**
|
||||
* @const
|
||||
* @param {*} value Value.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @param {string=} opt_nodeName Node name.
|
||||
* @return {Node|undefined} Node.
|
||||
*/
|
||||
@@ -2507,7 +2507,7 @@ const GEOMETRY_NODE_FACTORY = function(value, objectStack, opt_nodeName) {
|
||||
/**
|
||||
* A factory for creating Point nodes.
|
||||
* @const
|
||||
* @type {function(*, Array.<*>, string=): (Node|undefined)}
|
||||
* @type {function(*, Array<*>, string=): (Node|undefined)}
|
||||
*/
|
||||
const POINT_NODE_FACTORY = makeSimpleNodeFactory('Point');
|
||||
|
||||
@@ -2515,7 +2515,7 @@ const POINT_NODE_FACTORY = makeSimpleNodeFactory('Point');
|
||||
/**
|
||||
* A factory for creating LineString nodes.
|
||||
* @const
|
||||
* @type {function(*, Array.<*>, string=): (Node|undefined)}
|
||||
* @type {function(*, Array<*>, string=): (Node|undefined)}
|
||||
*/
|
||||
const LINE_STRING_NODE_FACTORY = makeSimpleNodeFactory('LineString');
|
||||
|
||||
@@ -2523,7 +2523,7 @@ const LINE_STRING_NODE_FACTORY = makeSimpleNodeFactory('LineString');
|
||||
/**
|
||||
* A factory for creating LinearRing nodes.
|
||||
* @const
|
||||
* @type {function(*, Array.<*>, string=): (Node|undefined)}
|
||||
* @type {function(*, Array<*>, string=): (Node|undefined)}
|
||||
*/
|
||||
const LINEAR_RING_NODE_FACTORY = makeSimpleNodeFactory('LinearRing');
|
||||
|
||||
@@ -2531,7 +2531,7 @@ const LINEAR_RING_NODE_FACTORY = makeSimpleNodeFactory('LinearRing');
|
||||
/**
|
||||
* A factory for creating Polygon nodes.
|
||||
* @const
|
||||
* @type {function(*, Array.<*>, string=): (Node|undefined)}
|
||||
* @type {function(*, Array<*>, string=): (Node|undefined)}
|
||||
*/
|
||||
const POLYGON_NODE_FACTORY = makeSimpleNodeFactory('Polygon');
|
||||
|
||||
@@ -2555,15 +2555,15 @@ const MULTI_GEOMETRY_SERIALIZERS = makeStructureNS(
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/Geometry} geometry Geometry.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function writeMultiGeometry(node, geometry, objectStack) {
|
||||
/** @type {module:ol/xml~NodeStackItem} */
|
||||
const context = {node: node};
|
||||
const type = geometry.getType();
|
||||
/** @type {Array.<module:ol/geom/Geometry>} */
|
||||
/** @type {Array<module:ol/geom/Geometry>} */
|
||||
let geometries;
|
||||
/** @type {function(*, Array.<*>, string=): (Node|undefined)} */
|
||||
/** @type {function(*, Array<*>, string=): (Node|undefined)} */
|
||||
let factory;
|
||||
if (type == GeometryType.GEOMETRY_COLLECTION) {
|
||||
geometries = /** @type {module:ol/geom/GeometryCollection} */ (geometry).getGeometries();
|
||||
@@ -2602,7 +2602,7 @@ const BOUNDARY_IS_SERIALIZERS = makeStructureNS(
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/LinearRing} linearRing Linear ring.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function writeBoundaryIs(node, linearRing, objectStack) {
|
||||
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
|
||||
@@ -2637,7 +2637,7 @@ const PLACEMARK_SERIALIZERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Array.<string>>}
|
||||
* @type {Object.<string, Array<string>>}
|
||||
*/
|
||||
const PLACEMARK_SEQUENCE = makeStructureNS(
|
||||
NAMESPACE_URIS, [
|
||||
@@ -2649,7 +2649,7 @@ const PLACEMARK_SEQUENCE = makeStructureNS(
|
||||
/**
|
||||
* A factory for creating ExtendedData nodes.
|
||||
* @const
|
||||
* @type {function(*, Array.<*>): (Node|undefined)}
|
||||
* @type {function(*, Array<*>): (Node|undefined)}
|
||||
*/
|
||||
const EXTENDEDDATA_NODE_FACTORY = makeSimpleNodeFactory('ExtendedData');
|
||||
|
||||
@@ -2659,7 +2659,7 @@ const EXTENDEDDATA_NODE_FACTORY = makeSimpleNodeFactory('ExtendedData');
|
||||
* (ExtendedData).
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @this {module:ol/format/KML}
|
||||
*/
|
||||
function writePlacemark(node, feature, objectStack) {
|
||||
@@ -2723,7 +2723,7 @@ function writePlacemark(node, feature, objectStack) {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Array.<string>>}
|
||||
* @type {Object.<string, Array<string>>}
|
||||
*/
|
||||
const PRIMITIVE_GEOMETRY_SEQUENCE = makeStructureNS(
|
||||
NAMESPACE_URIS, [
|
||||
@@ -2747,7 +2747,7 @@ const PRIMITIVE_GEOMETRY_SERIALIZERS = makeStructureNS(
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/SimpleGeometry} geometry Geometry.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function writePrimitiveGeometry(node, geometry, objectStack) {
|
||||
const flatCoordinates = geometry.getFlatCoordinates();
|
||||
@@ -2783,7 +2783,7 @@ const POLYGON_SERIALIZERS = makeStructureNS(
|
||||
/**
|
||||
* A factory for creating innerBoundaryIs nodes.
|
||||
* @const
|
||||
* @type {function(*, Array.<*>, string=): (Node|undefined)}
|
||||
* @type {function(*, Array<*>, string=): (Node|undefined)}
|
||||
*/
|
||||
const INNER_BOUNDARY_NODE_FACTORY = makeSimpleNodeFactory('innerBoundaryIs');
|
||||
|
||||
@@ -2791,7 +2791,7 @@ const INNER_BOUNDARY_NODE_FACTORY = makeSimpleNodeFactory('innerBoundaryIs');
|
||||
/**
|
||||
* A factory for creating outerBoundaryIs nodes.
|
||||
* @const
|
||||
* @type {function(*, Array.<*>, string=): (Node|undefined)}
|
||||
* @type {function(*, Array<*>, string=): (Node|undefined)}
|
||||
*/
|
||||
const OUTER_BOUNDARY_NODE_FACTORY = makeSimpleNodeFactory('outerBoundaryIs');
|
||||
|
||||
@@ -2799,7 +2799,7 @@ const OUTER_BOUNDARY_NODE_FACTORY = makeSimpleNodeFactory('outerBoundaryIs');
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/geom/Polygon} polygon Polygon.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function writePolygon(node, polygon, objectStack) {
|
||||
const linearRings = polygon.getLinearRings();
|
||||
@@ -2831,7 +2831,7 @@ const POLY_STYLE_SERIALIZERS = makeStructureNS(
|
||||
/**
|
||||
* A factory for creating coordinates nodes.
|
||||
* @const
|
||||
* @type {function(*, Array.<*>, string=): (Node|undefined)}
|
||||
* @type {function(*, Array<*>, string=): (Node|undefined)}
|
||||
*/
|
||||
const COLOR_NODE_FACTORY = makeSimpleNodeFactory('color');
|
||||
|
||||
@@ -2839,7 +2839,7 @@ const COLOR_NODE_FACTORY = makeSimpleNodeFactory('color');
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/style/Fill} style Style.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function writePolyStyle(node, style, objectStack) {
|
||||
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
|
||||
@@ -2861,7 +2861,7 @@ function writeScaleTextNode(node, scale) {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Array.<string>>}
|
||||
* @type {Object.<string, Array<string>>}
|
||||
*/
|
||||
const STYLE_SEQUENCE = makeStructureNS(
|
||||
NAMESPACE_URIS, [
|
||||
@@ -2885,7 +2885,7 @@ const STYLE_SERIALIZERS = makeStructureNS(
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/style/Style} style Style.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function writeStyle(node, style, objectStack) {
|
||||
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
|
||||
|
||||
@@ -23,7 +23,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]
|
||||
* @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 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},
|
||||
@@ -32,7 +32,7 @@ import RenderFeature from '../render/Feature.js';
|
||||
* features.
|
||||
* @property {string} [layerName='layer'] Name of the feature attribute that
|
||||
* holds the layer name.
|
||||
* @property {Array.<string>} [layers] Layers to read features from. If not
|
||||
* @property {Array<string>} [layers] Layers to read features from. If not
|
||||
* provided, features will be read from all layers.
|
||||
*/
|
||||
|
||||
@@ -65,8 +65,8 @@ class MVT extends FeatureFormat {
|
||||
/**
|
||||
* @private
|
||||
* @type {function((module:ol/geom/Geometry|Object.<string,*>)=)|
|
||||
* function(module:ol/geom/GeometryType,Array.<number>,
|
||||
* (Array.<number>|Array.<Array.<number>>),Object.<string,*>,number)}
|
||||
* function(module:ol/geom/GeometryType,Array<number>,
|
||||
* (Array<number>|Array<Array<number>>),Object.<string,*>,number)}
|
||||
*/
|
||||
this.featureClass_ = options.featureClass ?
|
||||
options.featureClass : RenderFeature;
|
||||
@@ -85,7 +85,7 @@ class MVT extends FeatureFormat {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<string>}
|
||||
* @type {Array<string>}
|
||||
*/
|
||||
this.layers_ = options.layers ? options.layers : null;
|
||||
|
||||
@@ -103,8 +103,8 @@ class MVT extends FeatureFormat {
|
||||
* @suppress {missingProperties}
|
||||
* @param {Object} pbf PBF.
|
||||
* @param {Object} feature Raw feature.
|
||||
* @param {Array.<number>} flatCoordinates Array to store flat coordinates in.
|
||||
* @param {Array.<number>} ends Array to store ends in.
|
||||
* @param {Array<number>} flatCoordinates Array to store flat coordinates in.
|
||||
* @param {Array<number>} ends Array to store ends in.
|
||||
* @private
|
||||
*/
|
||||
readRawGeometry_(pbf, feature, flatCoordinates, ends) {
|
||||
@@ -252,7 +252,7 @@ class MVT extends FeatureFormat {
|
||||
|
||||
const pbf = new PBF(/** @type {ArrayBuffer} */ (source));
|
||||
const pbfLayers = pbf.readFields(layersPBFReader, {});
|
||||
/** @type {Array.<module:ol/Feature|module:ol/render/Feature>} */
|
||||
/** @type {Array<module:ol/Feature|module:ol/render/Feature>} */
|
||||
const features = [];
|
||||
for (const name in pbfLayers) {
|
||||
if (layers && layers.indexOf(name) == -1) {
|
||||
@@ -280,7 +280,7 @@ class MVT extends FeatureFormat {
|
||||
|
||||
/**
|
||||
* Sets the layers that features will be read from.
|
||||
* @param {Array.<string>} layers Layers.
|
||||
* @param {Array<string>} layers Layers.
|
||||
* @api
|
||||
*/
|
||||
setLayers(layers) {
|
||||
|
||||
@@ -17,7 +17,7 @@ import {pushParseAndPop, makeStructureNS} from '../xml.js';
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Array.<null>}
|
||||
* @type {Array<null>}
|
||||
*/
|
||||
const NAMESPACE_URIS = [null];
|
||||
|
||||
@@ -75,7 +75,7 @@ class OSMXML extends XMLFeature {
|
||||
// parse nodes in ways
|
||||
for (let j = 0; j < state.ways.length; j++) {
|
||||
const values = /** @type {Object} */ (state.ways[j]);
|
||||
/** @type {Array.<number>} */
|
||||
/** @type {Array<number>} */
|
||||
const flatCoordinates = [];
|
||||
for (let i = 0, ii = values.ndrefs.length; i < ii; i++) {
|
||||
const point = state.nodes[values.ndrefs[i]];
|
||||
@@ -133,7 +133,7 @@ const NODE_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function readNode(node, objectStack) {
|
||||
const options = /** @type {module:ol/format/Feature~ReadOptions} */ (objectStack[0]);
|
||||
@@ -162,7 +162,7 @@ function readNode(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function readWay(node, objectStack) {
|
||||
const id = node.getAttribute('id');
|
||||
@@ -178,7 +178,7 @@ function readWay(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function readNd(node, objectStack) {
|
||||
const values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||
@@ -188,7 +188,7 @@ function readNd(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function readTag(node, objectStack) {
|
||||
const values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||
|
||||
@@ -9,7 +9,7 @@ import {makeObjectPropertyPusher, makeObjectPropertySetter, makeStructureNS, pus
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Array.<null|string>}
|
||||
* @type {Array<null|string>}
|
||||
*/
|
||||
const NAMESPACE_URIS = [null, 'http://www.opengis.net/ows/1.1'];
|
||||
|
||||
@@ -206,7 +206,7 @@ const SERVICE_PROVIDER_PARSERS =
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} The address.
|
||||
*/
|
||||
function readAddress(node, objectStack) {
|
||||
@@ -217,7 +217,7 @@ function readAddress(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} The values.
|
||||
*/
|
||||
function readAllowedValues(node, objectStack) {
|
||||
@@ -228,7 +228,7 @@ function readAllowedValues(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} The constraint.
|
||||
*/
|
||||
function readConstraint(node, objectStack) {
|
||||
@@ -244,7 +244,7 @@ function readConstraint(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} The contact info.
|
||||
*/
|
||||
function readContactInfo(node, objectStack) {
|
||||
@@ -255,7 +255,7 @@ function readContactInfo(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} The DCP.
|
||||
*/
|
||||
function readDcp(node, objectStack) {
|
||||
@@ -266,7 +266,7 @@ function readDcp(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} The GET object.
|
||||
*/
|
||||
function readGet(node, objectStack) {
|
||||
@@ -281,7 +281,7 @@ function readGet(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} The HTTP object.
|
||||
*/
|
||||
function readHttp(node, objectStack) {
|
||||
@@ -291,7 +291,7 @@ function readHttp(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} The operation.
|
||||
*/
|
||||
function readOperation(node, objectStack) {
|
||||
@@ -309,7 +309,7 @@ function readOperation(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} The operations metadata.
|
||||
*/
|
||||
function readOperationsMetadata(node, objectStack) {
|
||||
@@ -321,7 +321,7 @@ function readOperationsMetadata(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} The phone.
|
||||
*/
|
||||
function readPhone(node, objectStack) {
|
||||
@@ -332,7 +332,7 @@ function readPhone(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} The service identification.
|
||||
*/
|
||||
function readServiceIdentification(node, objectStack) {
|
||||
@@ -344,7 +344,7 @@ function readServiceIdentification(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} The service contact.
|
||||
*/
|
||||
function readServiceContact(node, objectStack) {
|
||||
@@ -356,7 +356,7 @@ function readServiceContact(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} The service provider.
|
||||
*/
|
||||
function readServiceProvider(node, objectStack) {
|
||||
@@ -368,7 +368,7 @@ function readServiceProvider(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {string|undefined} The value.
|
||||
*/
|
||||
function readValue(node, objectStack) {
|
||||
|
||||
@@ -138,7 +138,7 @@ class Polyline extends TextFeature {
|
||||
*
|
||||
* Attention: This function will modify the passed array!
|
||||
*
|
||||
* @param {Array.<number>} numbers A list of n-dimensional points.
|
||||
* @param {Array<number>} numbers A list of n-dimensional points.
|
||||
* @param {number} stride The number of dimension of the points in the list.
|
||||
* @param {number=} opt_factor The factor by which the numbers will be
|
||||
* multiplied. The remaining decimal places will get rounded away.
|
||||
@@ -177,14 +177,14 @@ export function encodeDeltas(numbers, stride, opt_factor) {
|
||||
* encoded string.
|
||||
* @param {number=} opt_factor The factor by which the resulting numbers will
|
||||
* be divided. Default is `1e5`.
|
||||
* @return {Array.<number>} A list of n-dimensional points.
|
||||
* @return {Array<number>} A list of n-dimensional points.
|
||||
* @api
|
||||
*/
|
||||
export function decodeDeltas(encoded, stride, opt_factor) {
|
||||
const factor = opt_factor ? opt_factor : 1e5;
|
||||
let d;
|
||||
|
||||
/** @type {Array.<number>} */
|
||||
/** @type {Array<number>} */
|
||||
const lastNumbers = new Array(stride);
|
||||
for (d = 0; d < stride; ++d) {
|
||||
lastNumbers[d] = 0;
|
||||
@@ -209,7 +209,7 @@ export function decodeDeltas(encoded, stride, opt_factor) {
|
||||
*
|
||||
* Attention: This function will modify the passed array!
|
||||
*
|
||||
* @param {Array.<number>} numbers A list of floating point numbers.
|
||||
* @param {Array<number>} numbers A list of floating point numbers.
|
||||
* @param {number=} opt_factor The factor by which the numbers will be
|
||||
* multiplied. The remaining decimal places will get rounded away.
|
||||
* Default is `1e5`.
|
||||
@@ -232,7 +232,7 @@ export function encodeFloats(numbers, opt_factor) {
|
||||
* @param {string} encoded An encoded string.
|
||||
* @param {number=} opt_factor The factor by which the result will be divided.
|
||||
* Default is `1e5`.
|
||||
* @return {Array.<number>} A list of floating point numbers.
|
||||
* @return {Array<number>} A list of floating point numbers.
|
||||
* @api
|
||||
*/
|
||||
export function decodeFloats(encoded, opt_factor) {
|
||||
@@ -250,7 +250,7 @@ export function decodeFloats(encoded, opt_factor) {
|
||||
*
|
||||
* Attention: This function will modify the passed array!
|
||||
*
|
||||
* @param {Array.<number>} numbers A list of signed integers.
|
||||
* @param {Array<number>} numbers A list of signed integers.
|
||||
* @return {string} The encoded string.
|
||||
*/
|
||||
export function encodeSignedIntegers(numbers) {
|
||||
@@ -266,7 +266,7 @@ export function encodeSignedIntegers(numbers) {
|
||||
* Decode a list of signed integers from an encoded string
|
||||
*
|
||||
* @param {string} encoded An encoded string.
|
||||
* @return {Array.<number>} A list of signed integers.
|
||||
* @return {Array<number>} A list of signed integers.
|
||||
*/
|
||||
export function decodeSignedIntegers(encoded) {
|
||||
const numbers = decodeUnsignedIntegers(encoded);
|
||||
@@ -281,7 +281,7 @@ export function decodeSignedIntegers(encoded) {
|
||||
/**
|
||||
* Encode a list of unsigned integers and return an encoded string
|
||||
*
|
||||
* @param {Array.<number>} numbers A list of unsigned integers.
|
||||
* @param {Array<number>} numbers A list of unsigned integers.
|
||||
* @return {string} The encoded string.
|
||||
*/
|
||||
export function encodeUnsignedIntegers(numbers) {
|
||||
@@ -297,7 +297,7 @@ export function encodeUnsignedIntegers(numbers) {
|
||||
* Decode a list of unsigned integers from an encoded string
|
||||
*
|
||||
* @param {string} encoded An encoded string.
|
||||
* @return {Array.<number>} A list of unsigned integers.
|
||||
* @return {Array<number>} A list of unsigned integers.
|
||||
*/
|
||||
export function decodeUnsignedIntegers(encoded) {
|
||||
const numbers = [];
|
||||
|
||||
@@ -50,7 +50,7 @@ class TextFeature extends FeatureFormat {
|
||||
*
|
||||
* @param {Document|Node|Object|string} source Source.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||
* @return {Array.<module:ol/Feature>} Features.
|
||||
* @return {Array<module:ol/Feature>} Features.
|
||||
* @api
|
||||
*/
|
||||
readFeatures(source, opt_options) {
|
||||
@@ -62,7 +62,7 @@ class TextFeature extends FeatureFormat {
|
||||
* @param {string} text Text.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||
* @protected
|
||||
* @return {Array.<module:ol/Feature>} Features.
|
||||
* @return {Array<module:ol/Feature>} Features.
|
||||
*/
|
||||
readFeaturesFromText(text, opt_options) {}
|
||||
|
||||
@@ -133,7 +133,7 @@ class TextFeature extends FeatureFormat {
|
||||
/**
|
||||
* Encode an array of features as string.
|
||||
*
|
||||
* @param {Array.<module:ol/Feature>} features Features.
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @return {string} Encoded features.
|
||||
* @api
|
||||
@@ -144,7 +144,7 @@ class TextFeature extends FeatureFormat {
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param {Array.<module:ol/Feature>} features Features.
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @protected
|
||||
* @return {string} Text.
|
||||
|
||||
@@ -32,7 +32,7 @@ import {get as getProjection} from '../proj.js';
|
||||
* ```
|
||||
* will result in features that have a property `'layer'` set to `'example'`.
|
||||
* When not set, no property will be added to features.
|
||||
* @property {Array.<string>} [layers] Names of the TopoJSON topology's
|
||||
* @property {Array<string>} [layers] Names of the TopoJSON topology's
|
||||
* `objects`'s children to read features from. If not provided, features will
|
||||
* be read from all children.
|
||||
*/
|
||||
@@ -62,7 +62,7 @@ class TopoJSON extends JSONFeature {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<string>}
|
||||
* @type {Array<string>}
|
||||
*/
|
||||
this.layers_ = options.layers ? options.layers : null;
|
||||
|
||||
@@ -91,7 +91,7 @@ class TopoJSON extends JSONFeature {
|
||||
if (transform) {
|
||||
transformArcs(arcs, scale, translate);
|
||||
}
|
||||
/** @type {Array.<module:ol/Feature>} */
|
||||
/** @type {Array<module:ol/Feature>} */
|
||||
const features = [];
|
||||
const topoJSONFeatures = topoJSONTopology.objects;
|
||||
const property = this.layerName_;
|
||||
@@ -171,14 +171,14 @@ const GEOMETRY_READERS = {
|
||||
|
||||
/**
|
||||
* Concatenate arcs into a coordinate array.
|
||||
* @param {Array.<number>} indices Indices of arcs to concatenate. Negative
|
||||
* @param {Array<number>} indices Indices of arcs to concatenate. Negative
|
||||
* values indicate arcs need to be reversed.
|
||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs (already
|
||||
* @param {Array<Array<module:ol/coordinate~Coordinate>>} arcs Array of arcs (already
|
||||
* transformed).
|
||||
* @return {Array.<module:ol/coordinate~Coordinate>} Coordinates array.
|
||||
* @return {Array<module:ol/coordinate~Coordinate>} Coordinates array.
|
||||
*/
|
||||
function concatenateArcs(indices, arcs) {
|
||||
/** @type {Array.<module:ol/coordinate~Coordinate>} */
|
||||
/** @type {Array<module:ol/coordinate~Coordinate>} */
|
||||
const coordinates = [];
|
||||
let index, arc;
|
||||
for (let i = 0, ii = indices.length; i < ii; ++i) {
|
||||
@@ -208,8 +208,8 @@ function concatenateArcs(indices, arcs) {
|
||||
* Create a point from a TopoJSON geometry object.
|
||||
*
|
||||
* @param {TopoJSONGeometry} object TopoJSON object.
|
||||
* @param {Array.<number>} scale Scale for each dimension.
|
||||
* @param {Array.<number>} translate Translation for each dimension.
|
||||
* @param {Array<number>} scale Scale for each dimension.
|
||||
* @param {Array<number>} translate Translation for each dimension.
|
||||
* @return {module:ol/geom/Point} Geometry.
|
||||
*/
|
||||
function readPointGeometry(object, scale, translate) {
|
||||
@@ -225,8 +225,8 @@ function readPointGeometry(object, scale, translate) {
|
||||
* Create a multi-point from a TopoJSON geometry object.
|
||||
*
|
||||
* @param {TopoJSONGeometry} object TopoJSON object.
|
||||
* @param {Array.<number>} scale Scale for each dimension.
|
||||
* @param {Array.<number>} translate Translation for each dimension.
|
||||
* @param {Array<number>} scale Scale for each dimension.
|
||||
* @param {Array<number>} translate Translation for each dimension.
|
||||
* @return {module:ol/geom/MultiPoint} Geometry.
|
||||
*/
|
||||
function readMultiPointGeometry(object, scale, translate) {
|
||||
@@ -244,7 +244,7 @@ function readMultiPointGeometry(object, scale, translate) {
|
||||
* Create a linestring from a TopoJSON geometry object.
|
||||
*
|
||||
* @param {TopoJSONGeometry} object TopoJSON object.
|
||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||
* @param {Array<Array<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||
* @return {module:ol/geom/LineString} Geometry.
|
||||
*/
|
||||
function readLineStringGeometry(object, arcs) {
|
||||
@@ -257,7 +257,7 @@ function readLineStringGeometry(object, arcs) {
|
||||
* Create a multi-linestring from a TopoJSON geometry object.
|
||||
*
|
||||
* @param {TopoJSONGeometry} object TopoJSON object.
|
||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||
* @param {Array<Array<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||
* @return {module:ol/geom/MultiLineString} Geometry.
|
||||
*/
|
||||
function readMultiLineStringGeometry(object, arcs) {
|
||||
@@ -273,7 +273,7 @@ function readMultiLineStringGeometry(object, arcs) {
|
||||
* Create a polygon from a TopoJSON geometry object.
|
||||
*
|
||||
* @param {TopoJSONGeometry} object TopoJSON object.
|
||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||
* @param {Array<Array<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||
* @return {module:ol/geom/Polygon} Geometry.
|
||||
*/
|
||||
function readPolygonGeometry(object, arcs) {
|
||||
@@ -289,7 +289,7 @@ function readPolygonGeometry(object, arcs) {
|
||||
* Create a multi-polygon from a TopoJSON geometry object.
|
||||
*
|
||||
* @param {TopoJSONGeometry} object TopoJSON object.
|
||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||
* @param {Array<Array<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||
* @return {module:ol/geom/MultiPolygon} Geometry.
|
||||
*/
|
||||
function readMultiPolygonGeometry(object, arcs) {
|
||||
@@ -313,14 +313,14 @@ function readMultiPolygonGeometry(object, arcs) {
|
||||
*
|
||||
* @param {TopoJSONGeometryCollection} collection TopoJSON Geometry
|
||||
* object.
|
||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||
* @param {Array.<number>} scale Scale for each dimension.
|
||||
* @param {Array.<number>} translate Translation for each dimension.
|
||||
* @param {Array<Array<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||
* @param {Array<number>} scale Scale for each dimension.
|
||||
* @param {Array<number>} translate Translation for each dimension.
|
||||
* @param {string|undefined} property Property to set the `GeometryCollection`'s parent
|
||||
* object to.
|
||||
* @param {string} name Name of the `Topology`'s child object.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||
* @return {Array.<module:ol/Feature>} Array of features.
|
||||
* @return {Array<module:ol/Feature>} Array of features.
|
||||
*/
|
||||
function readFeaturesFromGeometryCollection(collection, arcs, scale, translate, property, name, opt_options) {
|
||||
const geometries = collection.geometries;
|
||||
@@ -337,9 +337,9 @@ function readFeaturesFromGeometryCollection(collection, arcs, scale, translate,
|
||||
* Create a feature from a TopoJSON geometry object.
|
||||
*
|
||||
* @param {TopoJSONGeometry} object TopoJSON geometry object.
|
||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||
* @param {Array.<number>} scale Scale for each dimension.
|
||||
* @param {Array.<number>} translate Translation for each dimension.
|
||||
* @param {Array<Array<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||
* @param {Array<number>} scale Scale for each dimension.
|
||||
* @param {Array<number>} translate Translation for each dimension.
|
||||
* @param {string|undefined} property Property to set the `GeometryCollection`'s parent
|
||||
* object to.
|
||||
* @param {string} name Name of the `Topology`'s child object.
|
||||
@@ -379,9 +379,9 @@ function readFeatureFromGeometry(object, arcs, scale, translate, property, name,
|
||||
* Apply a linear transform to array of arcs. The provided array of arcs is
|
||||
* modified in place.
|
||||
*
|
||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||
* @param {Array.<number>} scale Scale for each dimension.
|
||||
* @param {Array.<number>} translate Translation for each dimension.
|
||||
* @param {Array<Array<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||
* @param {Array<number>} scale Scale for each dimension.
|
||||
* @param {Array<number>} translate Translation for each dimension.
|
||||
*/
|
||||
function transformArcs(arcs, scale, translate) {
|
||||
for (let i = 0, ii = arcs.length; i < ii; ++i) {
|
||||
@@ -393,9 +393,9 @@ function transformArcs(arcs, scale, translate) {
|
||||
/**
|
||||
* Apply a linear transform to an arc. The provided arc is modified in place.
|
||||
*
|
||||
* @param {Array.<module:ol/coordinate~Coordinate>} arc Arc.
|
||||
* @param {Array.<number>} scale Scale for each dimension.
|
||||
* @param {Array.<number>} translate Translation for each dimension.
|
||||
* @param {Array<module:ol/coordinate~Coordinate>} arc Arc.
|
||||
* @param {Array<number>} scale Scale for each dimension.
|
||||
* @param {Array<number>} translate Translation for each dimension.
|
||||
*/
|
||||
function transformArc(arc, scale, translate) {
|
||||
let x = 0;
|
||||
@@ -416,8 +416,8 @@ function transformArc(arc, scale, translate) {
|
||||
* place.
|
||||
*
|
||||
* @param {module:ol/coordinate~Coordinate} vertex Vertex.
|
||||
* @param {Array.<number>} scale Scale for each dimension.
|
||||
* @param {Array.<number>} translate Translation for each dimension.
|
||||
* @param {Array<number>} scale Scale for each dimension.
|
||||
* @param {Array<number>} translate Translation for each dimension.
|
||||
*/
|
||||
function transformVertex(vertex, scale, translate) {
|
||||
vertex[0] = vertex[0] * scale[0] + translate[0];
|
||||
|
||||
@@ -82,7 +82,7 @@ const TRANSACTION_SERIALIZERS = {
|
||||
/**
|
||||
* @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 {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 {string} [schemaLocation] Optional schemaLocation to use for serialization, this will override the default.
|
||||
*/
|
||||
@@ -92,14 +92,14 @@ const TRANSACTION_SERIALIZERS = {
|
||||
* @typedef {Object} WriteGetFeatureOptions
|
||||
* @property {string} featureNS The namespace URI used for features.
|
||||
* @property {string} featurePrefix The prefix for the feature namespace.
|
||||
* @property {Array.<string>} featureTypes The feature type names.
|
||||
* @property {Array<string>} featureTypes The feature type names.
|
||||
* @property {string} [srsName] SRS name. No srsName attribute will be set on
|
||||
* geometries when this is not provided.
|
||||
* @property {string} [handle] Handle.
|
||||
* @property {string} [outputFormat] Output format.
|
||||
* @property {number} [maxFeatures] Maximum number of features to fetch.
|
||||
* @property {string} [geometryName] Geometry name to use in a BBOX filter.
|
||||
* @property {Array.<string>} [propertyNames] Optional list of property names to serialize.
|
||||
* @property {Array<string>} [propertyNames] Optional list of property names to serialize.
|
||||
* @property {number} [startIndex] Start index to use for WFS paging. This is a
|
||||
* WFS 2.0 feature backported to WFS 1.1.0 by some Web Feature Services.
|
||||
* @property {number} [count] Number of features to retrieve when paging. This is a
|
||||
@@ -123,7 +123,7 @@ const TRANSACTION_SERIALIZERS = {
|
||||
* @property {string} [handle] Handle.
|
||||
* @property {boolean} [hasZ] Must be set to true if the transaction is for
|
||||
* a 3D layer. This will allow the Z coordinate to be included in the transaction.
|
||||
* @property {Array.<Object>} nativeElements Native elements. Currently not supported.
|
||||
* @property {Array<Object>} nativeElements Native elements. Currently not supported.
|
||||
* @property {module:ol/format/GMLBase~Options} [gmlOptions] GML options for the WFS transaction writer.
|
||||
* @property {string} [version='1.1.0'] WFS version to use for the transaction. Can be either `1.0.0` or `1.1.0`.
|
||||
*/
|
||||
@@ -143,7 +143,7 @@ const TRANSACTION_SERIALIZERS = {
|
||||
* @property {number} totalDeleted
|
||||
* @property {number} totalInserted
|
||||
* @property {number} totalUpdated
|
||||
* @property {Array.<string>} insertIds
|
||||
* @property {Array<string>} insertIds
|
||||
*/
|
||||
|
||||
|
||||
@@ -214,7 +214,7 @@ class WFS extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<string>|string|undefined}
|
||||
* @type {Array<string>|string|undefined}
|
||||
*/
|
||||
this.featureType_ = options.featureType;
|
||||
|
||||
@@ -240,14 +240,14 @@ class WFS extends XMLFeature {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {Array.<string>|string|undefined} featureType
|
||||
* @return {Array<string>|string|undefined} featureType
|
||||
*/
|
||||
getFeatureType() {
|
||||
return this.featureType_;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Array.<string>|string|undefined} featureType Feature type(s) to parse.
|
||||
* @param {Array<string>|string|undefined} featureType Feature type(s) to parse.
|
||||
*/
|
||||
setFeatureType(featureType) {
|
||||
this.featureType_ = featureType;
|
||||
@@ -429,16 +429,16 @@ class WFS extends XMLFeature {
|
||||
};
|
||||
assert(Array.isArray(options.featureTypes),
|
||||
11); // `options.featureTypes` should be an Array
|
||||
writeGetFeature(node, /** @type {!Array.<string>} */ (options.featureTypes), [context]);
|
||||
writeGetFeature(node, /** @type {!Array<string>} */ (options.featureTypes), [context]);
|
||||
return node;
|
||||
}
|
||||
|
||||
/**
|
||||
* Encode format as WFS `Transaction` and return the Node.
|
||||
*
|
||||
* @param {Array.<module:ol/Feature>} inserts The features to insert.
|
||||
* @param {Array.<module:ol/Feature>} updates The features to update.
|
||||
* @param {Array.<module:ol/Feature>} deletes The features to delete.
|
||||
* @param {Array<module:ol/Feature>} inserts The features to insert.
|
||||
* @param {Array<module:ol/Feature>} updates The features to update.
|
||||
* @param {Array<module:ol/Feature>} deletes The features to delete.
|
||||
* @param {module:ol/format/WFS~WriteTransactionOptions} options Write options.
|
||||
* @return {Node} Result.
|
||||
* @api
|
||||
@@ -538,7 +538,7 @@ class WFS extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Transaction Summary.
|
||||
*/
|
||||
function readTransactionSummary(node, objectStack) {
|
||||
@@ -562,7 +562,7 @@ const OGC_FID_PARSERS = {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
*/
|
||||
function fidParser(node, objectStack) {
|
||||
parseNode(OGC_FID_PARSERS, node, objectStack);
|
||||
@@ -582,8 +582,8 @@ const INSERT_RESULTS_PARSERS = {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Array.<string>|undefined} Insert results.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Array<string>|undefined} Insert results.
|
||||
*/
|
||||
function readInsertResults(node, objectStack) {
|
||||
return pushParseAndPop(
|
||||
@@ -594,7 +594,7 @@ function readInsertResults(node, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeFeature(node, feature, objectStack) {
|
||||
const context = objectStack[objectStack.length - 1];
|
||||
@@ -614,7 +614,7 @@ function writeFeature(node, feature, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {number|string} fid Feature identifier.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeOgcFidFilter(node, fid, objectStack) {
|
||||
const filter = createElementNS(OGCNS, 'Filter');
|
||||
@@ -645,7 +645,7 @@ function getTypeName(featurePrefix, featureType) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeDelete(node, feature, objectStack) {
|
||||
const context = objectStack[objectStack.length - 1];
|
||||
@@ -666,7 +666,7 @@ function writeDelete(node, feature, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeUpdate(node, feature, objectStack) {
|
||||
const context = objectStack[objectStack.length - 1];
|
||||
@@ -706,7 +706,7 @@ function writeUpdate(node, feature, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Object} pair Property name and value.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeProperty(node, pair, objectStack) {
|
||||
const name = createElementNS(WFSNS, 'Name');
|
||||
@@ -735,7 +735,7 @@ function writeProperty(node, pair, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {{vendorId: string, safeToIgnore: boolean, value: string}} nativeElement The native element.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeNative(node, nativeElement, objectStack) {
|
||||
if (nativeElement.vendorId) {
|
||||
@@ -782,7 +782,7 @@ const GETFEATURE_SERIALIZERS = {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {string} featureType Feature type.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeQuery(node, featureType, objectStack) {
|
||||
const context = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||
@@ -822,7 +822,7 @@ function writeQuery(node, featureType, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/format/filter/Filter} filter Filter.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeFilterCondition(node, filter, objectStack) {
|
||||
/** @type {module:ol/xml~NodeStackItem} */
|
||||
@@ -837,7 +837,7 @@ function writeFilterCondition(node, filter, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/format/filter/Bbox} filter Filter.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeBboxFilter(node, filter, objectStack) {
|
||||
const context = objectStack[objectStack.length - 1];
|
||||
@@ -851,7 +851,7 @@ function writeBboxFilter(node, filter, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/format/filter/Contains} filter Filter.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeContainsFilter(node, filter, objectStack) {
|
||||
const context = objectStack[objectStack.length - 1];
|
||||
@@ -865,7 +865,7 @@ function writeContainsFilter(node, filter, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/format/filter/Intersects} filter Filter.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeIntersectsFilter(node, filter, objectStack) {
|
||||
const context = objectStack[objectStack.length - 1];
|
||||
@@ -879,7 +879,7 @@ function writeIntersectsFilter(node, filter, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/format/filter/Within} filter Filter.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeWithinFilter(node, filter, objectStack) {
|
||||
const context = objectStack[objectStack.length - 1];
|
||||
@@ -893,7 +893,7 @@ function writeWithinFilter(node, filter, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/format/filter/During} filter Filter.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeDuringFilter(node, filter, objectStack) {
|
||||
|
||||
@@ -918,7 +918,7 @@ function writeDuringFilter(node, filter, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/format/filter/LogicalNary} filter Filter.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeLogicalFilter(node, filter, objectStack) {
|
||||
/** @type {module:ol/xml~NodeStackItem} */
|
||||
@@ -937,7 +937,7 @@ function writeLogicalFilter(node, filter, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/format/filter/Not} filter Filter.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeNotFilter(node, filter, objectStack) {
|
||||
/** @type {module:ol/xml~NodeStackItem} */
|
||||
@@ -953,7 +953,7 @@ function writeNotFilter(node, filter, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/format/filter/ComparisonBinary} filter Filter.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeComparisonFilter(node, filter, objectStack) {
|
||||
if (filter.matchCase !== undefined) {
|
||||
@@ -967,7 +967,7 @@ function writeComparisonFilter(node, filter, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/format/filter/IsNull} filter Filter.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeIsNullFilter(node, filter, objectStack) {
|
||||
writeOgcPropertyName(node, filter.propertyName);
|
||||
@@ -977,7 +977,7 @@ function writeIsNullFilter(node, filter, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/format/filter/IsBetween} filter Filter.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeIsBetweenFilter(node, filter, objectStack) {
|
||||
writeOgcPropertyName(node, filter.propertyName);
|
||||
@@ -995,7 +995,7 @@ function writeIsBetweenFilter(node, filter, objectStack) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/format/filter/IsLike} filter Filter.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeIsLikeFilter(node, filter, objectStack) {
|
||||
node.setAttribute('wildCard', filter.wildCard);
|
||||
@@ -1069,8 +1069,8 @@ export function writeFilter(filter) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<string>} featureTypes Feature types.
|
||||
* @param {Array.<*>} objectStack Node stack.
|
||||
* @param {Array<string>} featureTypes Feature types.
|
||||
* @param {Array<*>} objectStack Node stack.
|
||||
*/
|
||||
function writeGetFeature(node, featureTypes, objectStack) {
|
||||
const context = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||
|
||||
@@ -321,7 +321,7 @@ class Parser {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {!Array.<module:ol/geom/Geometry>} A collection of geometries.
|
||||
* @return {!Array<module:ol/geom/Geometry>} A collection of geometries.
|
||||
* @private
|
||||
*/
|
||||
parseGeometryCollectionText_() {
|
||||
@@ -340,7 +340,7 @@ class Parser {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {Array.<number>} All values in a point.
|
||||
* @return {Array<number>} All values in a point.
|
||||
* @private
|
||||
*/
|
||||
parsePointText_() {
|
||||
@@ -356,7 +356,7 @@ class Parser {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {!Array.<!Array.<number>>} All points in a linestring.
|
||||
* @return {!Array<!Array<number>>} All points in a linestring.
|
||||
* @private
|
||||
*/
|
||||
parseLineStringText_() {
|
||||
@@ -372,7 +372,7 @@ class Parser {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {!Array.<!Array.<number>>} All points in a polygon.
|
||||
* @return {!Array<!Array<number>>} All points in a polygon.
|
||||
* @private
|
||||
*/
|
||||
parsePolygonText_() {
|
||||
@@ -388,7 +388,7 @@ class Parser {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {!Array.<!Array.<number>>} All points in a multipoint.
|
||||
* @return {!Array<!Array<number>>} All points in a multipoint.
|
||||
* @private
|
||||
*/
|
||||
parseMultiPointText_() {
|
||||
@@ -409,7 +409,7 @@ class Parser {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {!Array.<!Array.<number>>} All linestring points
|
||||
* @return {!Array<!Array<number>>} All linestring points
|
||||
* in a multilinestring.
|
||||
* @private
|
||||
*/
|
||||
@@ -426,7 +426,7 @@ class Parser {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {!Array.<!Array.<number>>} All polygon points in a multipolygon.
|
||||
* @return {!Array<!Array<number>>} All polygon points in a multipolygon.
|
||||
* @private
|
||||
*/
|
||||
parseMultiPolygonText_() {
|
||||
@@ -442,7 +442,7 @@ class Parser {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {!Array.<number>} A point.
|
||||
* @return {!Array<number>} A point.
|
||||
* @private
|
||||
*/
|
||||
parsePoint_() {
|
||||
@@ -463,7 +463,7 @@ class Parser {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {!Array.<!Array.<number>>} An array of points.
|
||||
* @return {!Array<!Array<number>>} An array of points.
|
||||
* @private
|
||||
*/
|
||||
parsePointList_() {
|
||||
@@ -475,7 +475,7 @@ class Parser {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {!Array.<!Array.<number>>} An array of points.
|
||||
* @return {!Array<!Array<number>>} An array of points.
|
||||
* @private
|
||||
*/
|
||||
parsePointTextList_() {
|
||||
@@ -487,7 +487,7 @@ class Parser {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {!Array.<!Array.<number>>} An array of points.
|
||||
* @return {!Array<!Array<number>>} An array of points.
|
||||
* @private
|
||||
*/
|
||||
parseLineStringTextList_() {
|
||||
@@ -499,7 +499,7 @@ class Parser {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {!Array.<!Array.<number>>} An array of points.
|
||||
* @return {!Array<!Array<number>>} An array of points.
|
||||
* @private
|
||||
*/
|
||||
parsePolygonTextList_() {
|
||||
|
||||
@@ -10,7 +10,7 @@ import {makeArrayPusher, makeObjectPropertyPusher, makeObjectPropertySetter,
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Array.<null|string>}
|
||||
* @type {Array<null|string>}
|
||||
*/
|
||||
const NAMESPACE_URIS = [
|
||||
null,
|
||||
@@ -287,7 +287,7 @@ const KEYWORDLIST_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Attribution object.
|
||||
*/
|
||||
function readAttribution(node, objectStack) {
|
||||
@@ -297,7 +297,7 @@ function readAttribution(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object} Bounding box object.
|
||||
*/
|
||||
function readBoundingBox(node, objectStack) {
|
||||
@@ -323,7 +323,7 @@ function readBoundingBox(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {module:ol/extent~Extent|undefined} Bounding box object.
|
||||
*/
|
||||
function readEXGeographicBoundingBox(node, objectStack) {
|
||||
@@ -355,7 +355,7 @@ function readEXGeographicBoundingBox(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Capability object.
|
||||
*/
|
||||
function readCapability(node, objectStack) {
|
||||
@@ -365,7 +365,7 @@ function readCapability(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Service object.
|
||||
*/
|
||||
function readService(node, objectStack) {
|
||||
@@ -375,7 +375,7 @@ function readService(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Contact information object.
|
||||
*/
|
||||
function readContactInformation(node, objectStack) {
|
||||
@@ -385,7 +385,7 @@ function readContactInformation(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Contact person object.
|
||||
*/
|
||||
function readContactPersonPrimary(node, objectStack) {
|
||||
@@ -395,7 +395,7 @@ function readContactPersonPrimary(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Contact address object.
|
||||
*/
|
||||
function readContactAddress(node, objectStack) {
|
||||
@@ -405,8 +405,8 @@ function readContactAddress(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Array.<string>|undefined} Format array.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Array<string>|undefined} Format array.
|
||||
*/
|
||||
function readException(node, objectStack) {
|
||||
return pushParseAndPop([], EXCEPTION_PARSERS, node, objectStack);
|
||||
@@ -415,7 +415,7 @@ function readException(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Layer object.
|
||||
*/
|
||||
function readCapabilityLayer(node, objectStack) {
|
||||
@@ -425,7 +425,7 @@ function readCapabilityLayer(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Layer object.
|
||||
*/
|
||||
function readLayer(node, objectStack) {
|
||||
@@ -497,7 +497,7 @@ function readLayer(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object} Dimension object.
|
||||
*/
|
||||
function readDimension(node, objectStack) {
|
||||
@@ -517,7 +517,7 @@ function readDimension(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Online resource object.
|
||||
*/
|
||||
function readFormatOnlineresource(node, objectStack) {
|
||||
@@ -527,7 +527,7 @@ function readFormatOnlineresource(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Request object.
|
||||
*/
|
||||
function readRequest(node, objectStack) {
|
||||
@@ -537,7 +537,7 @@ function readRequest(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} DCP type object.
|
||||
*/
|
||||
function readDCPType(node, objectStack) {
|
||||
@@ -547,7 +547,7 @@ function readDCPType(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} HTTP object.
|
||||
*/
|
||||
function readHTTP(node, objectStack) {
|
||||
@@ -557,7 +557,7 @@ function readHTTP(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Operation type object.
|
||||
*/
|
||||
function readOperationType(node, objectStack) {
|
||||
@@ -567,7 +567,7 @@ function readOperationType(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Online resource object.
|
||||
*/
|
||||
function readSizedFormatOnlineresource(node, objectStack) {
|
||||
@@ -586,7 +586,7 @@ function readSizedFormatOnlineresource(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Authority URL object.
|
||||
*/
|
||||
function readAuthorityURL(node, objectStack) {
|
||||
@@ -601,7 +601,7 @@ function readAuthorityURL(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Metadata URL object.
|
||||
*/
|
||||
function readMetadataURL(node, objectStack) {
|
||||
@@ -616,7 +616,7 @@ function readMetadataURL(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Style object.
|
||||
*/
|
||||
function readStyle(node, objectStack) {
|
||||
@@ -626,8 +626,8 @@ function readStyle(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Array.<string>|undefined} Keyword list.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Array<string>|undefined} Keyword list.
|
||||
*/
|
||||
function readKeywordList(node, objectStack) {
|
||||
return pushParseAndPop([], KEYWORDLIST_PARSERS, node, objectStack);
|
||||
|
||||
@@ -10,7 +10,7 @@ import {makeArrayPusher, makeStructureNS, pushParseAndPop} from '../xml.js';
|
||||
|
||||
/**
|
||||
* @typedef {Object} Options
|
||||
* @property {Array.<string>} [layers] If set, only features of the given layers will be returned by the format when read.
|
||||
* @property {Array<string>} [layers] If set, only features of the given layers will be returned by the format when read.
|
||||
*/
|
||||
|
||||
|
||||
@@ -61,20 +61,20 @@ class WMSGetFeatureInfo extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<string>}
|
||||
* @type {Array<string>}
|
||||
*/
|
||||
this.layers_ = options.layers ? options.layers : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {Array.<string>} layers
|
||||
* @return {Array<string>} layers
|
||||
*/
|
||||
getLayers() {
|
||||
return this.layers_;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Array.<string>} layers Layers to parse.
|
||||
* @param {Array<string>} layers Layers to parse.
|
||||
*/
|
||||
setLayers(layers) {
|
||||
this.layers_ = layers;
|
||||
@@ -82,14 +82,14 @@ class WMSGetFeatureInfo extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @return {Array.<module:ol/Feature>} Features.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Array<module:ol/Feature>} Features.
|
||||
* @private
|
||||
*/
|
||||
readFeatures_(node, objectStack) {
|
||||
node.setAttribute('namespaceURI', this.featureNS_);
|
||||
const localName = node.localName;
|
||||
/** @type {Array.<module:ol/Feature>} */
|
||||
/** @type {Array<module:ol/Feature>} */
|
||||
let features = [];
|
||||
if (node.childNodes.length === 0) {
|
||||
return features;
|
||||
|
||||
@@ -12,7 +12,7 @@ import {pushParseAndPop, makeStructureNS,
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Array.<null|string>}
|
||||
* @type {Array<null|string>}
|
||||
*/
|
||||
const NAMESPACE_URIS = [
|
||||
null,
|
||||
@@ -22,7 +22,7 @@ const NAMESPACE_URIS = [
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Array.<null|string>}
|
||||
* @type {Array<null|string>}
|
||||
*/
|
||||
const OWS_NAMESPACE_URIS = [
|
||||
null,
|
||||
@@ -219,7 +219,7 @@ const TM_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Attribution object.
|
||||
*/
|
||||
function readContents(node, objectStack) {
|
||||
@@ -229,7 +229,7 @@ function readContents(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Layers object.
|
||||
*/
|
||||
function readLayer(node, objectStack) {
|
||||
@@ -239,7 +239,7 @@ function readLayer(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Tile Matrix Set object.
|
||||
*/
|
||||
function readTileMatrixSet(node, objectStack) {
|
||||
@@ -249,7 +249,7 @@ function readTileMatrixSet(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Style object.
|
||||
*/
|
||||
function readStyle(node, objectStack) {
|
||||
@@ -266,7 +266,7 @@ function readStyle(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Tile Matrix Set Link object.
|
||||
*/
|
||||
function readTileMatrixSetLink(node, objectStack) {
|
||||
@@ -276,7 +276,7 @@ function readTileMatrixSetLink(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Dimension object.
|
||||
*/
|
||||
function readDimensions(node, objectStack) {
|
||||
@@ -286,7 +286,7 @@ function readDimensions(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Resource URL object.
|
||||
*/
|
||||
function readResourceUrl(node, objectStack) {
|
||||
@@ -309,7 +309,7 @@ function readResourceUrl(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} WGS84 BBox object.
|
||||
*/
|
||||
function readWgs84BoundingBox(node, objectStack) {
|
||||
@@ -323,7 +323,7 @@ function readWgs84BoundingBox(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Legend object.
|
||||
*/
|
||||
function readLegendUrl(node, objectStack) {
|
||||
@@ -336,7 +336,7 @@ function readLegendUrl(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} Coordinates object.
|
||||
*/
|
||||
function readCoordinates(node, objectStack) {
|
||||
@@ -355,7 +355,7 @@ function readCoordinates(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} TileMatrix object.
|
||||
*/
|
||||
function readTileMatrix(node, objectStack) {
|
||||
@@ -365,7 +365,7 @@ function readTileMatrix(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} TileMatrixSetLimits Object.
|
||||
*/
|
||||
function readTileMatrixLimitsList(node, objectStack) {
|
||||
@@ -375,7 +375,7 @@ function readTileMatrixLimitsList(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @param {Array.<*>} objectStack Object stack.
|
||||
* @param {Array<*>} objectStack Object stack.
|
||||
* @return {Object|undefined} TileMatrixLimits Array.
|
||||
*/
|
||||
function readTileMatrixLimits(node, objectStack) {
|
||||
|
||||
@@ -82,7 +82,7 @@ class XMLFeature extends FeatureFormat {
|
||||
* @function
|
||||
* @param {Document|Node|Object|string} source Source.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Options.
|
||||
* @return {Array.<module:ol/Feature>} Features.
|
||||
* @return {Array<module:ol/Feature>} Features.
|
||||
* @api
|
||||
*/
|
||||
readFeatures(source, opt_options) {
|
||||
@@ -103,10 +103,10 @@ class XMLFeature extends FeatureFormat {
|
||||
* @param {Document} doc Document.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Options.
|
||||
* @protected
|
||||
* @return {Array.<module:ol/Feature>} Features.
|
||||
* @return {Array<module:ol/Feature>} Features.
|
||||
*/
|
||||
readFeaturesFromDocument(doc, opt_options) {
|
||||
/** @type {Array.<module:ol/Feature>} */
|
||||
/** @type {Array<module:ol/Feature>} */
|
||||
const features = [];
|
||||
for (let n = doc.firstChild; n; n = n.nextSibling) {
|
||||
if (n.nodeType == Node.ELEMENT_NODE) {
|
||||
@@ -121,7 +121,7 @@ class XMLFeature extends FeatureFormat {
|
||||
* @param {Node} node Node.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Options.
|
||||
* @protected
|
||||
* @return {Array.<module:ol/Feature>} Features.
|
||||
* @return {Array<module:ol/Feature>} Features.
|
||||
*/
|
||||
readFeaturesFromNode(node, opt_options) {}
|
||||
|
||||
@@ -221,7 +221,7 @@ class XMLFeature extends FeatureFormat {
|
||||
/**
|
||||
* Encode an array of features as string.
|
||||
*
|
||||
* @param {Array.<module:ol/Feature>} features Features.
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @return {string} Result.
|
||||
* @api
|
||||
@@ -232,7 +232,7 @@ class XMLFeature extends FeatureFormat {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Array.<module:ol/Feature>} features Features.
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
||||
* @return {Node} Node.
|
||||
*/
|
||||
|
||||
@@ -22,7 +22,7 @@ class LogicalNary extends Filter {
|
||||
super(tagName);
|
||||
|
||||
/**
|
||||
* @type {Array.<module:ol/format/filter/Filter>}
|
||||
* @type {Array<module:ol/format/filter/Filter>}
|
||||
*/
|
||||
this.conditions = Array.prototype.slice.call(arguments, 1);
|
||||
assert(this.conditions.length >= 2, 57); // At least 2 conditions are required.
|
||||
|
||||
@@ -179,7 +179,7 @@ class Circle extends SimpleGeometry {
|
||||
if (!this.flatCoordinates) {
|
||||
this.flatCoordinates = [];
|
||||
}
|
||||
/** @type {Array.<number>} */
|
||||
/** @type {Array<number>} */
|
||||
const flatCoordinates = this.flatCoordinates;
|
||||
let offset = deflateCoordinate(
|
||||
flatCoordinates, 0, center, this.stride);
|
||||
|
||||
@@ -17,7 +17,7 @@ import {clear} from '../obj.js';
|
||||
class GeometryCollection extends Geometry {
|
||||
|
||||
/**
|
||||
* @param {Array.<module:ol/geom/Geometry>=} opt_geometries Geometries.
|
||||
* @param {Array<module:ol/geom/Geometry>=} opt_geometries Geometries.
|
||||
*/
|
||||
constructor(opt_geometries) {
|
||||
|
||||
@@ -25,7 +25,7 @@ class GeometryCollection extends Geometry {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<module:ol/geom/Geometry>}
|
||||
* @type {Array<module:ol/geom/Geometry>}
|
||||
*/
|
||||
this.geometries_ = opt_geometries ? opt_geometries : null;
|
||||
|
||||
@@ -114,7 +114,7 @@ class GeometryCollection extends Geometry {
|
||||
|
||||
/**
|
||||
* Return the geometries that make up this geometry collection.
|
||||
* @return {Array.<module:ol/geom/Geometry>} Geometries.
|
||||
* @return {Array<module:ol/geom/Geometry>} Geometries.
|
||||
* @api
|
||||
*/
|
||||
getGeometries() {
|
||||
@@ -122,7 +122,7 @@ class GeometryCollection extends Geometry {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {Array.<module:ol/geom/Geometry>} Geometries.
|
||||
* @return {Array<module:ol/geom/Geometry>} Geometries.
|
||||
*/
|
||||
getGeometriesArray() {
|
||||
return this.geometries_;
|
||||
@@ -228,7 +228,7 @@ class GeometryCollection extends Geometry {
|
||||
|
||||
/**
|
||||
* Set the geometries that make up this geometry collection.
|
||||
* @param {Array.<module:ol/geom/Geometry>} geometries Geometries.
|
||||
* @param {Array<module:ol/geom/Geometry>} geometries Geometries.
|
||||
* @api
|
||||
*/
|
||||
setGeometries(geometries) {
|
||||
@@ -236,7 +236,7 @@ class GeometryCollection extends Geometry {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Array.<module:ol/geom/Geometry>} geometries Geometries.
|
||||
* @param {Array<module:ol/geom/Geometry>} geometries Geometries.
|
||||
*/
|
||||
setGeometriesArray(geometries) {
|
||||
this.unlistenGeometriesChange_();
|
||||
@@ -283,8 +283,8 @@ class GeometryCollection extends Geometry {
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<module:ol/geom/Geometry>} geometries Geometries.
|
||||
* @return {Array.<module:ol/geom/Geometry>} Cloned geometries.
|
||||
* @param {Array<module:ol/geom/Geometry>} geometries Geometries.
|
||||
* @return {Array<module:ol/geom/Geometry>} Cloned geometries.
|
||||
*/
|
||||
function cloneGeometries(geometries) {
|
||||
const clonedGeometries = [];
|
||||
|
||||
@@ -24,7 +24,7 @@ import {douglasPeucker} from '../geom/flat/simplify.js';
|
||||
class LineString extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* @param {Array.<module:ol/coordinate~Coordinate>|Array.<number>} coordinates Coordinates.
|
||||
* @param {Array<module:ol/coordinate~Coordinate>|Array<number>} coordinates Coordinates.
|
||||
* For internal use, flat coordinates in combination with `opt_layout` are also accepted.
|
||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
||||
*/
|
||||
@@ -146,7 +146,7 @@ class LineString extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Return the coordinates of the linestring.
|
||||
* @return {Array.<module:ol/coordinate~Coordinate>} Coordinates.
|
||||
* @return {Array<module:ol/coordinate~Coordinate>} Coordinates.
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
@@ -182,7 +182,7 @@ class LineString extends SimpleGeometry {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {Array.<number>} Flat midpoint.
|
||||
* @return {Array<number>} Flat midpoint.
|
||||
*/
|
||||
getFlatMidpoint() {
|
||||
if (this.flatMidpointRevision_ != this.getRevision()) {
|
||||
@@ -223,7 +223,7 @@ class LineString extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Set the coordinates of the linestring.
|
||||
* @param {!Array.<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
||||
* @param {!Array<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
||||
* @override
|
||||
* @api
|
||||
|
||||
@@ -21,7 +21,7 @@ import {douglasPeucker} from '../geom/flat/simplify.js';
|
||||
class LinearRing extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* @param {Array.<module:ol/coordinate~Coordinate>|Array.<number>} coordinates Coordinates.
|
||||
* @param {Array<module:ol/coordinate~Coordinate>|Array<number>} coordinates Coordinates.
|
||||
* For internal use, flat coordinates in combination with `opt_layout` are also accepted.
|
||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
||||
*/
|
||||
@@ -87,7 +87,7 @@ class LinearRing extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Return the coordinates of the linear ring.
|
||||
* @return {Array.<module:ol/coordinate~Coordinate>} Coordinates.
|
||||
* @return {Array<module:ol/coordinate~Coordinate>} Coordinates.
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
@@ -122,7 +122,7 @@ class LinearRing extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Set the coordinates of the linear ring.
|
||||
* @param {!Array.<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
||||
* @param {!Array<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
||||
* @override
|
||||
* @api
|
||||
|
||||
@@ -23,18 +23,18 @@ import {douglasPeuckerArray} from '../geom/flat/simplify.js';
|
||||
class MultiLineString extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>|module:ol/geom~MultiLineString>|Array.<number>} coordinates
|
||||
* @param {Array<Array<module:ol/coordinate~Coordinate>|module:ol/geom~MultiLineString>|Array<number>} coordinates
|
||||
* Coordinates or LineString geometries. (For internal use, flat coordinates in
|
||||
* combination with `opt_layout` and `opt_ends` are also accepted.)
|
||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
||||
* @param {Array.<number>} opt_ends Flat coordinate ends for internal use.
|
||||
* @param {Array<number>} opt_ends Flat coordinate ends for internal use.
|
||||
*/
|
||||
constructor(coordinates, opt_layout, opt_ends) {
|
||||
|
||||
super();
|
||||
|
||||
/**
|
||||
* @type {Array.<number>}
|
||||
* @type {Array<number>}
|
||||
* @private
|
||||
*/
|
||||
this.ends_ = [];
|
||||
@@ -152,7 +152,7 @@ class MultiLineString extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Return the coordinates of the multilinestring.
|
||||
* @return {Array.<Array.<module:ol/coordinate~Coordinate>>} Coordinates.
|
||||
* @return {Array<Array<module:ol/coordinate~Coordinate>>} Coordinates.
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
@@ -162,7 +162,7 @@ class MultiLineString extends SimpleGeometry {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {Array.<number>} Ends.
|
||||
* @return {Array<number>} Ends.
|
||||
*/
|
||||
getEnds() {
|
||||
return this.ends_;
|
||||
@@ -184,14 +184,14 @@ class MultiLineString extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Return the linestrings of this multilinestring.
|
||||
* @return {Array.<module:ol/geom/LineString>} LineStrings.
|
||||
* @return {Array<module:ol/geom/LineString>} LineStrings.
|
||||
* @api
|
||||
*/
|
||||
getLineStrings() {
|
||||
const flatCoordinates = this.flatCoordinates;
|
||||
const ends = this.ends_;
|
||||
const layout = this.layout;
|
||||
/** @type {Array.<module:ol/geom/LineString>} */
|
||||
/** @type {Array<module:ol/geom/LineString>} */
|
||||
const lineStrings = [];
|
||||
let offset = 0;
|
||||
for (let i = 0, ii = ends.length; i < ii; ++i) {
|
||||
@@ -204,7 +204,7 @@ class MultiLineString extends SimpleGeometry {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {Array.<number>} Flat midpoints.
|
||||
* @return {Array<number>} Flat midpoints.
|
||||
*/
|
||||
getFlatMidpoints() {
|
||||
const midpoints = [];
|
||||
@@ -253,7 +253,7 @@ class MultiLineString extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Set the coordinates of the multilinestring.
|
||||
* @param {!Array.<Array.<module:ol/coordinate~Coordinate>>} coordinates Coordinates.
|
||||
* @param {!Array<Array<module:ol/coordinate~Coordinate>>} coordinates Coordinates.
|
||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
||||
* @override
|
||||
* @api
|
||||
|
||||
@@ -19,7 +19,7 @@ import {squaredDistance as squaredDx} from '../math.js';
|
||||
class MultiPoint extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* @param {Array.<module:ol/coordinate~Coordinate>|Array.<number>} coordinates Coordinates.
|
||||
* @param {Array<module:ol/coordinate~Coordinate>|Array<number>} coordinates Coordinates.
|
||||
* For internal use, flat coordinates in combination with `opt_layout` are also accepted.
|
||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
||||
*/
|
||||
@@ -82,7 +82,7 @@ class MultiPoint extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Return the coordinates of the multipoint.
|
||||
* @return {Array.<module:ol/coordinate~Coordinate>} Coordinates.
|
||||
* @return {Array<module:ol/coordinate~Coordinate>} Coordinates.
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
@@ -108,14 +108,14 @@ class MultiPoint extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Return the points of this multipoint.
|
||||
* @return {Array.<module:ol/geom/Point>} Points.
|
||||
* @return {Array<module:ol/geom/Point>} Points.
|
||||
* @api
|
||||
*/
|
||||
getPoints() {
|
||||
const flatCoordinates = this.flatCoordinates;
|
||||
const layout = this.layout;
|
||||
const stride = this.stride;
|
||||
/** @type {Array.<module:ol/geom/Point>} */
|
||||
/** @type {Array<module:ol/geom/Point>} */
|
||||
const points = [];
|
||||
for (let i = 0, ii = flatCoordinates.length; i < ii; i += stride) {
|
||||
const point = new Point(flatCoordinates.slice(i, i + stride), layout);
|
||||
@@ -151,7 +151,7 @@ class MultiPoint extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Set the coordinates of the multipoint.
|
||||
* @param {!Array.<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
||||
* @param {!Array<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
||||
* @override
|
||||
* @api
|
||||
|
||||
@@ -28,17 +28,17 @@ import {quantizeMultiArray} from '../geom/flat/simplify.js';
|
||||
class MultiPolygon extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* @param {Array.<Array.<Array.<module:ol/coordinate~Coordinate>>>|Array.<number>} coordinates Coordinates.
|
||||
* @param {Array<Array<Array<module:ol/coordinate~Coordinate>>>|Array<number>} coordinates Coordinates.
|
||||
* For internal use, flat coordinats in combination with `opt_layout` and `opt_endss` are also accepted.
|
||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
||||
* @param {Array.<number>} opt_endss Array of ends for internal use with flat coordinates.
|
||||
* @param {Array<number>} opt_endss Array of ends for internal use with flat coordinates.
|
||||
*/
|
||||
constructor(coordinates, opt_layout, opt_endss) {
|
||||
|
||||
super();
|
||||
|
||||
/**
|
||||
* @type {Array.<Array.<number>>}
|
||||
* @type {Array<Array<number>>}
|
||||
* @private
|
||||
*/
|
||||
this.endss_ = [];
|
||||
@@ -51,7 +51,7 @@ class MultiPolygon extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<number>}
|
||||
* @type {Array<number>}
|
||||
*/
|
||||
this.flatInteriorPoints_ = null;
|
||||
|
||||
@@ -75,7 +75,7 @@ class MultiPolygon extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<number>}
|
||||
* @type {Array<number>}
|
||||
*/
|
||||
this.orientedFlatCoordinates_ = null;
|
||||
|
||||
@@ -115,7 +115,7 @@ class MultiPolygon extends SimpleGeometry {
|
||||
* @api
|
||||
*/
|
||||
appendPolygon(polygon) {
|
||||
/** @type {Array.<number>} */
|
||||
/** @type {Array<number>} */
|
||||
let ends;
|
||||
if (!this.flatCoordinates) {
|
||||
this.flatCoordinates = polygon.getFlatCoordinates().slice();
|
||||
@@ -193,7 +193,7 @@ class MultiPolygon extends SimpleGeometry {
|
||||
* (clockwise for exterior and counter-clockwise for interior rings).
|
||||
* By default, coordinate orientation will depend on how the geometry was
|
||||
* constructed.
|
||||
* @return {Array.<Array.<Array.<module:ol/coordinate~Coordinate>>>} Coordinates.
|
||||
* @return {Array<Array<Array<module:ol/coordinate~Coordinate>>>} Coordinates.
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
@@ -212,14 +212,14 @@ class MultiPolygon extends SimpleGeometry {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {Array.<Array.<number>>} Endss.
|
||||
* @return {Array<Array<number>>} Endss.
|
||||
*/
|
||||
getEndss() {
|
||||
return this.endss_;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {Array.<number>} Flat interior points.
|
||||
* @return {Array<number>} Flat interior points.
|
||||
*/
|
||||
getFlatInteriorPoints() {
|
||||
if (this.flatInteriorPointsRevision_ != this.getRevision()) {
|
||||
@@ -244,7 +244,7 @@ class MultiPolygon extends SimpleGeometry {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {Array.<number>} Oriented flat coordinates.
|
||||
* @return {Array<number>} Oriented flat coordinates.
|
||||
*/
|
||||
getOrientedFlatCoordinates() {
|
||||
if (this.orientedRevision_ != this.getRevision()) {
|
||||
@@ -305,7 +305,7 @@ class MultiPolygon extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Return the polygons of this multipolygon.
|
||||
* @return {Array.<module:ol/geom/Polygon>} Polygons.
|
||||
* @return {Array<module:ol/geom/Polygon>} Polygons.
|
||||
* @api
|
||||
*/
|
||||
getPolygons() {
|
||||
@@ -348,7 +348,7 @@ class MultiPolygon extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Set the coordinates of the multipolygon.
|
||||
* @param {!Array.<Array.<Array.<module:ol/coordinate~Coordinate>>>} coordinates Coordinates.
|
||||
* @param {!Array<Array<Array<module:ol/coordinate~Coordinate>>>} coordinates Coordinates.
|
||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
||||
* @override
|
||||
* @api
|
||||
|
||||
@@ -29,7 +29,7 @@ import {modulo} from '../math.js';
|
||||
class Polygon extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* @param {!Array.<Array.<module:ol/coordinate~Coordinate>>|!Array.<number>} coordinates
|
||||
* @param {!Array<Array<module:ol/coordinate~Coordinate>>|!Array<number>} coordinates
|
||||
* Array of linear rings that define the polygon. The first linear ring of the
|
||||
* array defines the outer-boundary or surface of the polygon. Each subsequent
|
||||
* linear ring defines a hole in the surface of the polygon. A linear ring is
|
||||
@@ -37,14 +37,14 @@ class Polygon extends SimpleGeometry {
|
||||
* equivalent. (For internal use, flat coordinates in combination with
|
||||
* `opt_layout` and `opt_ends` are also accepted.)
|
||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
||||
* @param {Array.<number>=} opt_ends Ends (for internal use with flat coordinates).
|
||||
* @param {Array<number>=} opt_ends Ends (for internal use with flat coordinates).
|
||||
*/
|
||||
constructor(coordinates, opt_layout, opt_ends) {
|
||||
|
||||
super();
|
||||
|
||||
/**
|
||||
* @type {Array.<number>}
|
||||
* @type {Array<number>}
|
||||
* @private
|
||||
*/
|
||||
this.ends_ = [];
|
||||
@@ -81,7 +81,7 @@ class Polygon extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<number>}
|
||||
* @type {Array<number>}
|
||||
*/
|
||||
this.orientedFlatCoordinates_ = null;
|
||||
|
||||
@@ -162,7 +162,7 @@ class Polygon extends SimpleGeometry {
|
||||
* (clockwise for exterior and counter-clockwise for interior rings).
|
||||
* By default, coordinate orientation will depend on how the geometry was
|
||||
* constructed.
|
||||
* @return {Array.<Array.<module:ol/coordinate~Coordinate>>} Coordinates.
|
||||
* @return {Array<Array<module:ol/coordinate~Coordinate>>} Coordinates.
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
@@ -181,14 +181,14 @@ class Polygon extends SimpleGeometry {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {Array.<number>} Ends.
|
||||
* @return {Array<number>} Ends.
|
||||
*/
|
||||
getEnds() {
|
||||
return this.ends_;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {Array.<number>} Interior point.
|
||||
* @return {Array<number>} Interior point.
|
||||
*/
|
||||
getFlatInteriorPoint() {
|
||||
if (this.flatInteriorPointRevision_ != this.getRevision()) {
|
||||
@@ -242,7 +242,7 @@ class Polygon extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Return the linear rings of the polygon.
|
||||
* @return {Array.<module:ol/geom/LinearRing>} Linear rings.
|
||||
* @return {Array<module:ol/geom/LinearRing>} Linear rings.
|
||||
* @api
|
||||
*/
|
||||
getLinearRings() {
|
||||
@@ -261,7 +261,7 @@ class Polygon extends SimpleGeometry {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {Array.<number>} Oriented flat coordinates.
|
||||
* @return {Array<number>} Oriented flat coordinates.
|
||||
*/
|
||||
getOrientedFlatCoordinates() {
|
||||
if (this.orientedRevision_ != this.getRevision()) {
|
||||
@@ -312,7 +312,7 @@ class Polygon extends SimpleGeometry {
|
||||
|
||||
/**
|
||||
* Set the coordinates of the polygon.
|
||||
* @param {!Array.<Array.<module:ol/coordinate~Coordinate>>} coordinates Coordinates.
|
||||
* @param {!Array<Array<module:ol/coordinate~Coordinate>>} coordinates Coordinates.
|
||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
||||
* @override
|
||||
* @api
|
||||
@@ -347,7 +347,7 @@ export default Polygon;
|
||||
*/
|
||||
export function circular(center, radius, opt_n, opt_sphereRadius) {
|
||||
const n = opt_n ? opt_n : 32;
|
||||
/** @type {Array.<number>} */
|
||||
/** @type {Array<number>} */
|
||||
const flatCoordinates = [];
|
||||
for (let i = 0; i < n; ++i) {
|
||||
extend(flatCoordinates, sphereOffset(center, radius, 2 * Math.PI * i / n, opt_sphereRadius));
|
||||
|
||||
@@ -35,7 +35,7 @@ class SimpleGeometry extends Geometry {
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {Array.<number>}
|
||||
* @type {Array<number>}
|
||||
*/
|
||||
this.flatCoordinates = null;
|
||||
|
||||
@@ -65,7 +65,7 @@ class SimpleGeometry extends Geometry {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {Array.<number>} Flat coordinates.
|
||||
* @return {Array<number>} Flat coordinates.
|
||||
*/
|
||||
getFlatCoordinates() {
|
||||
return this.flatCoordinates;
|
||||
@@ -146,7 +146,7 @@ class SimpleGeometry extends Geometry {
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/GeometryLayout} layout Layout.
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
*/
|
||||
setFlatCoordinates(layout, flatCoordinates) {
|
||||
this.stride = getStrideForLayout(layout);
|
||||
@@ -300,8 +300,8 @@ SimpleGeometry.prototype.containsXY = FALSE;
|
||||
/**
|
||||
* @param {module:ol/geom/SimpleGeometry} simpleGeometry Simple geometry.
|
||||
* @param {module:ol/transform~Transform} transform Transform.
|
||||
* @param {Array.<number>=} opt_dest Destination.
|
||||
* @return {Array.<number>} Transformed flat coordinates.
|
||||
* @param {Array<number>=} opt_dest Destination.
|
||||
* @return {Array<number>} Transformed flat coordinates.
|
||||
*/
|
||||
export function transformGeom2D(simpleGeometry, transform, opt_dest) {
|
||||
const flatCoordinates = simpleGeometry.getFlatCoordinates();
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
@@ -26,9 +26,9 @@ export function linearRing(flatCoordinates, offset, end, stride) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {Array.<number>} ends Ends.
|
||||
* @param {Array<number>} ends Ends.
|
||||
* @param {number} stride Stride.
|
||||
* @return {number} Area.
|
||||
*/
|
||||
@@ -44,9 +44,9 @@ export function linearRings(flatCoordinates, offset, ends, stride) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {Array.<Array.<number>>} endss Endss.
|
||||
* @param {Array<Array<number>>} endss Endss.
|
||||
* @param {number} stride Stride.
|
||||
* @return {number} Area.
|
||||
*/
|
||||
|
||||
@@ -5,11 +5,11 @@ import {createEmpty, createOrUpdateFromFlatCoordinates} from '../../extent.js';
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {Array.<Array.<number>>} endss Endss.
|
||||
* @param {Array<Array<number>>} endss Endss.
|
||||
* @param {number} stride Stride.
|
||||
* @return {Array.<number>} Flat centers.
|
||||
* @return {Array<number>} Flat centers.
|
||||
*/
|
||||
export function linearRingss(flatCoordinates, offset, endss, stride) {
|
||||
const flatCenters = [];
|
||||
|
||||
@@ -8,13 +8,13 @@ import {lerp, squaredDistance as squaredDx} from '../../math.js';
|
||||
* Returns the point on the 2D line segment flatCoordinates[offset1] to
|
||||
* flatCoordinates[offset2] that is closest to the point (x, y). Extra
|
||||
* dimensions are linearly interpolated.
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset1 Offset 1.
|
||||
* @param {number} offset2 Offset 2.
|
||||
* @param {number} stride Stride.
|
||||
* @param {number} x X.
|
||||
* @param {number} y Y.
|
||||
* @param {Array.<number>} closestPoint Closest point.
|
||||
* @param {Array<number>} closestPoint Closest point.
|
||||
*/
|
||||
function assignClosest(flatCoordinates, offset1, offset2, stride, x, y, closestPoint) {
|
||||
const x1 = flatCoordinates[offset1];
|
||||
@@ -49,7 +49,7 @@ function assignClosest(flatCoordinates, offset1, offset2, stride, x, y, closestP
|
||||
/**
|
||||
* Return the squared of the largest distance between any pair of consecutive
|
||||
* coordinates.
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
@@ -74,9 +74,9 @@ export function maxSquaredDelta(flatCoordinates, offset, end, stride, max) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {Array.<number>} ends Ends.
|
||||
* @param {Array<number>} ends Ends.
|
||||
* @param {number} stride Stride.
|
||||
* @param {number} max Max squared delta.
|
||||
* @return {number} Max squared delta.
|
||||
@@ -93,9 +93,9 @@ export function arrayMaxSquaredDelta(flatCoordinates, offset, ends, stride, max)
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {Array.<Array.<number>>} endss Endss.
|
||||
* @param {Array<Array<number>>} endss Endss.
|
||||
* @param {number} stride Stride.
|
||||
* @param {number} max Max squared delta.
|
||||
* @return {number} Max squared delta.
|
||||
@@ -112,7 +112,7 @@ export function multiArrayMaxSquaredDelta(flatCoordinates, offset, endss, stride
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
@@ -120,9 +120,9 @@ export function multiArrayMaxSquaredDelta(flatCoordinates, offset, endss, stride
|
||||
* @param {boolean} isRing Is ring.
|
||||
* @param {number} x X.
|
||||
* @param {number} y Y.
|
||||
* @param {Array.<number>} closestPoint Closest point.
|
||||
* @param {Array<number>} closestPoint Closest point.
|
||||
* @param {number} minSquaredDistance Minimum squared distance.
|
||||
* @param {Array.<number>=} opt_tmpPoint Temporary point object.
|
||||
* @param {Array<number>=} opt_tmpPoint Temporary point object.
|
||||
* @return {number} Minimum squared distance.
|
||||
*/
|
||||
export function assignClosestPoint(flatCoordinates, offset, end,
|
||||
@@ -193,17 +193,17 @@ export function assignClosestPoint(flatCoordinates, offset, end,
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {Array.<number>} ends Ends.
|
||||
* @param {Array<number>} ends Ends.
|
||||
* @param {number} stride Stride.
|
||||
* @param {number} maxDelta Max delta.
|
||||
* @param {boolean} isRing Is ring.
|
||||
* @param {number} x X.
|
||||
* @param {number} y Y.
|
||||
* @param {Array.<number>} closestPoint Closest point.
|
||||
* @param {Array<number>} closestPoint Closest point.
|
||||
* @param {number} minSquaredDistance Minimum squared distance.
|
||||
* @param {Array.<number>=} opt_tmpPoint Temporary point object.
|
||||
* @param {Array<number>=} opt_tmpPoint Temporary point object.
|
||||
* @return {number} Minimum squared distance.
|
||||
*/
|
||||
export function assignClosestArrayPoint(flatCoordinates, offset, ends,
|
||||
@@ -222,17 +222,17 @@ export function assignClosestArrayPoint(flatCoordinates, offset, ends,
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {Array.<Array.<number>>} endss Endss.
|
||||
* @param {Array<Array<number>>} endss Endss.
|
||||
* @param {number} stride Stride.
|
||||
* @param {number} maxDelta Max delta.
|
||||
* @param {boolean} isRing Is ring.
|
||||
* @param {number} x X.
|
||||
* @param {number} y Y.
|
||||
* @param {Array.<number>} closestPoint Closest point.
|
||||
* @param {Array<number>} closestPoint Closest point.
|
||||
* @param {number} minSquaredDistance Minimum squared distance.
|
||||
* @param {Array.<number>=} opt_tmpPoint Temporary point object.
|
||||
* @param {Array<number>=} opt_tmpPoint Temporary point object.
|
||||
* @return {number} Minimum squared distance.
|
||||
*/
|
||||
export function assignClosestMultiArrayPoint(flatCoordinates, offset,
|
||||
|
||||
@@ -5,7 +5,7 @@ import {forEachCorner} from '../../extent.js';
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
@@ -26,7 +26,7 @@ export function linearRingContainsExtent(flatCoordinates, offset, end, stride, e
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
@@ -63,9 +63,9 @@ export function linearRingContainsXY(flatCoordinates, offset, end, stride, x, y)
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {Array.<number>} ends Ends.
|
||||
* @param {Array<number>} ends Ends.
|
||||
* @param {number} stride Stride.
|
||||
* @param {number} x X.
|
||||
* @param {number} y Y.
|
||||
@@ -88,9 +88,9 @@ export function linearRingsContainsXY(flatCoordinates, offset, ends, stride, x,
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {Array.<Array.<number>>} endss Endss.
|
||||
* @param {Array<Array<number>>} endss Endss.
|
||||
* @param {number} stride Stride.
|
||||
* @param {number} x X.
|
||||
* @param {number} y Y.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
||||
* @param {number} stride Stride.
|
||||
@@ -19,9 +19,9 @@ export function deflateCoordinate(flatCoordinates, offset, coordinate, stride) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {Array.<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
||||
* @param {Array<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
||||
* @param {number} stride Stride.
|
||||
* @return {number} offset Offset.
|
||||
*/
|
||||
@@ -37,12 +37,12 @@ export function deflateCoordinates(flatCoordinates, offset, coordinates, stride)
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} coordinatess Coordinatess.
|
||||
* @param {Array<Array<module:ol/coordinate~Coordinate>>} coordinatess Coordinatess.
|
||||
* @param {number} stride Stride.
|
||||
* @param {Array.<number>=} opt_ends Ends.
|
||||
* @return {Array.<number>} Ends.
|
||||
* @param {Array<number>=} opt_ends Ends.
|
||||
* @return {Array<number>} Ends.
|
||||
*/
|
||||
export function deflateCoordinatesArray(flatCoordinates, offset, coordinatess, stride, opt_ends) {
|
||||
const ends = opt_ends ? opt_ends : [];
|
||||
@@ -59,12 +59,12 @@ export function deflateCoordinatesArray(flatCoordinates, offset, coordinatess, s
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {Array.<Array.<Array.<module:ol/coordinate~Coordinate>>>} coordinatesss Coordinatesss.
|
||||
* @param {Array<Array<Array<module:ol/coordinate~Coordinate>>>} coordinatesss Coordinatesss.
|
||||
* @param {number} stride Stride.
|
||||
* @param {Array.<Array.<number>>=} opt_endss Endss.
|
||||
* @return {Array.<Array.<number>>} Endss.
|
||||
* @param {Array<Array<number>>=} opt_endss Endss.
|
||||
* @return {Array<Array<number>>} Endss.
|
||||
*/
|
||||
export function deflateMultiCoordinatesArray(flatCoordinates, offset, coordinatesss, stride, opt_endss) {
|
||||
const endss = opt_endss ? opt_endss : [];
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
* @param {Array.<number>=} opt_dest Destination.
|
||||
* @param {Array<number>=} opt_dest Destination.
|
||||
* @param {number=} opt_destOffset Destination offset.
|
||||
* @return {Array.<number>} Flat coordinates.
|
||||
* @return {Array<number>} Flat coordinates.
|
||||
*/
|
||||
export function flipXY(flatCoordinates, offset, end, stride, opt_dest, opt_destOffset) {
|
||||
let dest, destOffset;
|
||||
|
||||
@@ -10,13 +10,13 @@ import {get as getProjection, getTransform} from '../../proj.js';
|
||||
* @param {module:ol/proj~TransformFunction} transform Transform from longitude/latitude to
|
||||
* projected coordinates.
|
||||
* @param {number} squaredTolerance Squared tolerance.
|
||||
* @return {Array.<number>} Flat coordinates.
|
||||
* @return {Array<number>} Flat coordinates.
|
||||
*/
|
||||
function line(interpolate, transform, squaredTolerance) {
|
||||
// FIXME reduce garbage generation
|
||||
// FIXME optimize stack operations
|
||||
|
||||
/** @type {Array.<number>} */
|
||||
/** @type {Array<number>} */
|
||||
const flatCoordinates = [];
|
||||
|
||||
let geoA = interpolate(0);
|
||||
@@ -25,11 +25,11 @@ function line(interpolate, transform, squaredTolerance) {
|
||||
let a = transform(geoA);
|
||||
let b = transform(geoB);
|
||||
|
||||
/** @type {Array.<module:ol/coordinate~Coordinate>} */
|
||||
/** @type {Array<module:ol/coordinate~Coordinate>} */
|
||||
const geoStack = [geoB, geoA];
|
||||
/** @type {Array.<module:ol/coordinate~Coordinate>} */
|
||||
/** @type {Array<module:ol/coordinate~Coordinate>} */
|
||||
const stack = [b, a];
|
||||
/** @type {Array.<number>} */
|
||||
/** @type {Array<number>} */
|
||||
const fractionStack = [1, 0];
|
||||
|
||||
/** @type {!Object.<string, boolean>} */
|
||||
@@ -86,7 +86,7 @@ function line(interpolate, transform, squaredTolerance) {
|
||||
* @param {number} lat2 Latitude 2 in degrees.
|
||||
* @param {module:ol/proj/Projection} projection Projection.
|
||||
* @param {number} squaredTolerance Squared tolerance.
|
||||
* @return {Array.<number>} Flat coordinates.
|
||||
* @return {Array<number>} Flat coordinates.
|
||||
*/
|
||||
export function greatCircleArc(lon1, lat1, lon2, lat2, projection, squaredTolerance) {
|
||||
const geoProjection = getProjection('EPSG:4326');
|
||||
@@ -130,7 +130,7 @@ export function greatCircleArc(lon1, lat1, lon2, lat2, projection, squaredTolera
|
||||
* @param {number} lat2 Latitude 2.
|
||||
* @param {module:ol/proj/Projection} projection Projection.
|
||||
* @param {number} squaredTolerance Squared tolerance.
|
||||
* @return {Array.<number>} Flat coordinates.
|
||||
* @return {Array<number>} Flat coordinates.
|
||||
*/
|
||||
export function meridian(lon, lat1, lat2, projection, squaredTolerance) {
|
||||
const epsg4326Projection = getProjection('EPSG:4326');
|
||||
@@ -153,7 +153,7 @@ export function meridian(lon, lat1, lat2, projection, squaredTolerance) {
|
||||
* @param {number} lon2 Longitude 2.
|
||||
* @param {module:ol/proj/Projection} projection Projection.
|
||||
* @param {number} squaredTolerance Squared tolerance.
|
||||
* @return {Array.<number>} Flat coordinates.
|
||||
* @return {Array<number>} Flat coordinates.
|
||||
*/
|
||||
export function parallel(lat, lon1, lon2, projection, squaredTolerance) {
|
||||
const epsg4326Projection = getProjection('EPSG:4326');
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
* @param {Array.<module:ol/coordinate~Coordinate>=} opt_coordinates Coordinates.
|
||||
* @return {Array.<module:ol/coordinate~Coordinate>} Coordinates.
|
||||
* @param {Array<module:ol/coordinate~Coordinate>=} opt_coordinates Coordinates.
|
||||
* @return {Array<module:ol/coordinate~Coordinate>} Coordinates.
|
||||
*/
|
||||
export function inflateCoordinates(flatCoordinates, offset, end, stride, opt_coordinates) {
|
||||
const coordinates = opt_coordinates !== undefined ? opt_coordinates : [];
|
||||
@@ -23,12 +23,12 @@ export function inflateCoordinates(flatCoordinates, offset, end, stride, opt_coo
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {Array.<number>} ends Ends.
|
||||
* @param {Array<number>} ends Ends.
|
||||
* @param {number} stride Stride.
|
||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>=} opt_coordinatess Coordinatess.
|
||||
* @return {Array.<Array.<module:ol/coordinate~Coordinate>>} Coordinatess.
|
||||
* @param {Array<Array<module:ol/coordinate~Coordinate>>=} opt_coordinatess Coordinatess.
|
||||
* @return {Array<Array<module:ol/coordinate~Coordinate>>} Coordinatess.
|
||||
*/
|
||||
export function inflateCoordinatesArray(flatCoordinates, offset, ends, stride, opt_coordinatess) {
|
||||
const coordinatess = opt_coordinatess !== undefined ? opt_coordinatess : [];
|
||||
@@ -45,13 +45,13 @@ export function inflateCoordinatesArray(flatCoordinates, offset, ends, stride, o
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {Array.<Array.<number>>} endss Endss.
|
||||
* @param {Array<Array<number>>} endss Endss.
|
||||
* @param {number} stride Stride.
|
||||
* @param {Array.<Array.<Array.<module:ol/coordinate~Coordinate>>>=} opt_coordinatesss
|
||||
* @param {Array<Array<Array<module:ol/coordinate~Coordinate>>>=} opt_coordinatesss
|
||||
* Coordinatesss.
|
||||
* @return {Array.<Array.<Array.<module:ol/coordinate~Coordinate>>>} Coordinatesss.
|
||||
* @return {Array<Array<Array<module:ol/coordinate~Coordinate>>>} Coordinatesss.
|
||||
*/
|
||||
export function inflateMultiCoordinatesArray(flatCoordinates, offset, endss, stride, opt_coordinatesss) {
|
||||
const coordinatesss = opt_coordinatesss !== undefined ? opt_coordinatesss : [];
|
||||
|
||||
@@ -8,21 +8,21 @@ import {linearRingsContainsXY} from '../flat/contains.js';
|
||||
/**
|
||||
* Calculates a point that is likely to lie in the interior of the linear rings.
|
||||
* Inspired by JTS's com.vividsolutions.jts.geom.Geometry#getInteriorPoint.
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {Array.<number>} ends Ends.
|
||||
* @param {Array<number>} ends Ends.
|
||||
* @param {number} stride Stride.
|
||||
* @param {Array.<number>} flatCenters Flat centers.
|
||||
* @param {Array<number>} flatCenters Flat centers.
|
||||
* @param {number} flatCentersOffset Flat center offset.
|
||||
* @param {Array.<number>=} opt_dest Destination.
|
||||
* @return {Array.<number>} Destination point as XYM coordinate, where M is the
|
||||
* @param {Array<number>=} opt_dest Destination.
|
||||
* @return {Array<number>} Destination point as XYM coordinate, where M is the
|
||||
* length of the horizontal intersection that the point belongs to.
|
||||
*/
|
||||
export function getInteriorPointOfArray(flatCoordinates, offset,
|
||||
ends, stride, flatCenters, flatCentersOffset, opt_dest) {
|
||||
let i, ii, x, x1, x2, y1, y2;
|
||||
const y = flatCenters[flatCentersOffset + 1];
|
||||
/** @type {Array.<number>} */
|
||||
/** @type {Array<number>} */
|
||||
const intersections = [];
|
||||
// Calculate intersections with the horizontal line
|
||||
for (let r = 0, rr = ends.length; r < rr; ++r) {
|
||||
@@ -73,12 +73,12 @@ export function getInteriorPointOfArray(flatCoordinates, offset,
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {Array.<Array.<number>>} endss Endss.
|
||||
* @param {Array<Array<number>>} endss Endss.
|
||||
* @param {number} stride Stride.
|
||||
* @param {Array.<number>} flatCenters Flat centers.
|
||||
* @return {Array.<number>} Interior points as XYM coordinates, where M is the
|
||||
* @param {Array<number>} flatCenters Flat centers.
|
||||
* @return {Array<number>} Interior points as XYM coordinates, where M is the
|
||||
* length of the horizontal intersection that the point belongs to.
|
||||
*/
|
||||
export function getInteriorPointsOfMultiArray(flatCoordinates, offset, endss, stride, flatCenters) {
|
||||
|
||||
@@ -6,13 +6,13 @@ import {lerp} from '../../math.js';
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
* @param {number} fraction Fraction.
|
||||
* @param {Array.<number>=} opt_dest Destination.
|
||||
* @return {Array.<number>} Destination.
|
||||
* @param {Array<number>=} opt_dest Destination.
|
||||
* @return {Array<number>} Destination.
|
||||
*/
|
||||
export function interpolatePoint(flatCoordinates, offset, end, stride, fraction, opt_dest) {
|
||||
let pointX = NaN;
|
||||
@@ -65,7 +65,7 @@ export function interpolatePoint(flatCoordinates, offset, end, stride, fraction,
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
@@ -126,9 +126,9 @@ export function lineStringCoordinateAtM(flatCoordinates, offset, end, stride, m,
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {Array.<number>} ends Ends.
|
||||
* @param {Array<number>} ends Ends.
|
||||
* @param {number} stride Stride.
|
||||
* @param {number} m M.
|
||||
* @param {boolean} extrapolate Extrapolate.
|
||||
|
||||
@@ -7,7 +7,7 @@ import {forEach as forEachSegment} from '../flat/segments.js';
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
@@ -45,9 +45,9 @@ export function intersectsLineString(flatCoordinates, offset, end, stride, exten
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {Array.<number>} ends Ends.
|
||||
* @param {Array<number>} ends Ends.
|
||||
* @param {number} stride Stride.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @return {boolean} True if the geometry and the extent intersect.
|
||||
@@ -65,7 +65,7 @@ export function intersectsLineStringArray(flatCoordinates, offset, ends, stride,
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
@@ -94,9 +94,9 @@ export function intersectsLinearRing(flatCoordinates, offset, end, stride, exten
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {Array.<number>} ends Ends.
|
||||
* @param {Array<number>} ends Ends.
|
||||
* @param {number} stride Stride.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @return {boolean} True if the geometry and the extent intersect.
|
||||
@@ -119,9 +119,9 @@ export function intersectsLinearRingArray(flatCoordinates, offset, ends, stride,
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {Array.<Array.<number>>} endss Endss.
|
||||
* @param {Array<Array<number>>} endss Endss.
|
||||
* @param {number} stride Stride.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @return {boolean} True if the geometry and the extent intersect.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
@@ -26,7 +26,7 @@ export function lineStringLength(flatCoordinates, offset, end, stride) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
|
||||
@@ -5,7 +5,7 @@ import {coordinates as reverseCoordinates} from '../flat/reverse.js';
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
@@ -33,9 +33,9 @@ export function linearRingIsClockwise(flatCoordinates, offset, end, stride) {
|
||||
* is tested (first ring must be clockwise, remaining rings counter-clockwise).
|
||||
* To test for right-hand orientation, use the `opt_right` argument.
|
||||
*
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {Array.<number>} ends Array of end indexes.
|
||||
* @param {Array<number>} ends Array of end indexes.
|
||||
* @param {number} stride Stride.
|
||||
* @param {boolean=} opt_right Test for right-hand orientation
|
||||
* (counter-clockwise exterior ring and clockwise interior rings).
|
||||
@@ -67,9 +67,9 @@ export function linearRingIsOriented(flatCoordinates, offset, ends, stride, opt_
|
||||
* is tested (first ring must be clockwise, remaining rings counter-clockwise).
|
||||
* To test for right-hand orientation, use the `opt_right` argument.
|
||||
*
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {Array.<Array.<number>>} endss Array of array of end indexes.
|
||||
* @param {Array<Array<number>>} endss Array of array of end indexes.
|
||||
* @param {number} stride Stride.
|
||||
* @param {boolean=} opt_right Test for right-hand orientation
|
||||
* (counter-clockwise exterior ring and clockwise interior rings).
|
||||
@@ -92,9 +92,9 @@ export function linearRingsAreOriented(flatCoordinates, offset, endss, stride, o
|
||||
* counter-clockwise for interior rings). To orient according to the
|
||||
* right-hand rule, use the `opt_right` argument.
|
||||
*
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {Array.<number>} ends Ends.
|
||||
* @param {Array<number>} ends Ends.
|
||||
* @param {number} stride Stride.
|
||||
* @param {boolean=} opt_right Follow the right-hand rule for orientation.
|
||||
* @return {number} End.
|
||||
@@ -123,9 +123,9 @@ export function orientLinearRings(flatCoordinates, offset, ends, stride, opt_rig
|
||||
* counter-clockwise for interior rings). To orient according to the
|
||||
* right-hand rule, use the `opt_right` argument.
|
||||
*
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {Array.<Array.<number>>} endss Array of array of end indexes.
|
||||
* @param {Array<Array<number>>} endss Array of array of end indexes.
|
||||
* @param {number} stride Stride.
|
||||
* @param {boolean=} opt_right Follow the right-hand rule for orientation.
|
||||
* @return {number} End.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* This function calls `callback` for each segment of the flat coordinates
|
||||
* array. If the callback returns a truthy value the function returns that
|
||||
* value immediately. Otherwise the function returns `false`.
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
|
||||
@@ -31,15 +31,15 @@ import {squaredSegmentDistance, squaredDistance} from '../../math.js';
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
* @param {number} squaredTolerance Squared tolerance.
|
||||
* @param {boolean} highQuality Highest quality.
|
||||
* @param {Array.<number>=} opt_simplifiedFlatCoordinates Simplified flat
|
||||
* @param {Array<number>=} opt_simplifiedFlatCoordinates Simplified flat
|
||||
* coordinates.
|
||||
* @return {Array.<number>} Simplified line string.
|
||||
* @return {Array<number>} Simplified line string.
|
||||
*/
|
||||
export function simplifyLineString(flatCoordinates, offset, end,
|
||||
stride, squaredTolerance, highQuality, opt_simplifiedFlatCoordinates) {
|
||||
@@ -61,12 +61,12 @@ export function simplifyLineString(flatCoordinates, offset, end,
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
* @param {number} squaredTolerance Squared tolerance.
|
||||
* @param {Array.<number>} simplifiedFlatCoordinates Simplified flat
|
||||
* @param {Array<number>} simplifiedFlatCoordinates Simplified flat
|
||||
* coordinates.
|
||||
* @param {number} simplifiedOffset Simplified offset.
|
||||
* @return {number} Simplified offset.
|
||||
@@ -83,11 +83,11 @@ export function douglasPeucker(flatCoordinates, offset, end,
|
||||
}
|
||||
return simplifiedOffset;
|
||||
}
|
||||
/** @type {Array.<number>} */
|
||||
/** @type {Array<number>} */
|
||||
const markers = new Array(n);
|
||||
markers[0] = 1;
|
||||
markers[n - 1] = 1;
|
||||
/** @type {Array.<number>} */
|
||||
/** @type {Array<number>} */
|
||||
const stack = [offset, end - stride];
|
||||
let index = 0;
|
||||
while (stack.length > 0) {
|
||||
@@ -131,15 +131,15 @@ export function douglasPeucker(flatCoordinates, offset, end,
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {Array.<number>} ends Ends.
|
||||
* @param {Array<number>} ends Ends.
|
||||
* @param {number} stride Stride.
|
||||
* @param {number} squaredTolerance Squared tolerance.
|
||||
* @param {Array.<number>} simplifiedFlatCoordinates Simplified flat
|
||||
* @param {Array<number>} simplifiedFlatCoordinates Simplified flat
|
||||
* coordinates.
|
||||
* @param {number} simplifiedOffset Simplified offset.
|
||||
* @param {Array.<number>} simplifiedEnds Simplified ends.
|
||||
* @param {Array<number>} simplifiedEnds Simplified ends.
|
||||
* @return {number} Simplified offset.
|
||||
*/
|
||||
export function douglasPeuckerArray(flatCoordinates, offset,
|
||||
@@ -158,15 +158,15 @@ export function douglasPeuckerArray(flatCoordinates, offset,
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {Array.<Array.<number>>} endss Endss.
|
||||
* @param {Array<Array<number>>} endss Endss.
|
||||
* @param {number} stride Stride.
|
||||
* @param {number} squaredTolerance Squared tolerance.
|
||||
* @param {Array.<number>} simplifiedFlatCoordinates Simplified flat
|
||||
* @param {Array<number>} simplifiedFlatCoordinates Simplified flat
|
||||
* coordinates.
|
||||
* @param {number} simplifiedOffset Simplified offset.
|
||||
* @param {Array.<Array.<number>>} simplifiedEndss Simplified endss.
|
||||
* @param {Array<Array<number>>} simplifiedEndss Simplified endss.
|
||||
* @return {number} Simplified offset.
|
||||
*/
|
||||
export function douglasPeuckerMultiArray(
|
||||
@@ -186,12 +186,12 @@ export function douglasPeuckerMultiArray(
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
* @param {number} squaredTolerance Squared tolerance.
|
||||
* @param {Array.<number>} simplifiedFlatCoordinates Simplified flat
|
||||
* @param {Array<number>} simplifiedFlatCoordinates Simplified flat
|
||||
* coordinates.
|
||||
* @param {number} simplifiedOffset Simplified offset.
|
||||
* @return {number} Simplified offset.
|
||||
@@ -253,12 +253,12 @@ export function snap(value, tolerance) {
|
||||
* the common edge between two polygons will be simplified to the same line
|
||||
* string independently in both polygons. This implementation uses a single
|
||||
* pass over the coordinates and eliminates intermediate collinear points.
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
* @param {number} tolerance Tolerance.
|
||||
* @param {Array.<number>} simplifiedFlatCoordinates Simplified flat
|
||||
* @param {Array<number>} simplifiedFlatCoordinates Simplified flat
|
||||
* coordinates.
|
||||
* @param {number} simplifiedOffset Simplified offset.
|
||||
* @return {number} Simplified offset.
|
||||
@@ -337,15 +337,15 @@ export function quantize(flatCoordinates, offset, end, stride,
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {Array.<number>} ends Ends.
|
||||
* @param {Array<number>} ends Ends.
|
||||
* @param {number} stride Stride.
|
||||
* @param {number} tolerance Tolerance.
|
||||
* @param {Array.<number>} simplifiedFlatCoordinates Simplified flat
|
||||
* @param {Array<number>} simplifiedFlatCoordinates Simplified flat
|
||||
* coordinates.
|
||||
* @param {number} simplifiedOffset Simplified offset.
|
||||
* @param {Array.<number>} simplifiedEnds Simplified ends.
|
||||
* @param {Array<number>} simplifiedEnds Simplified ends.
|
||||
* @return {number} Simplified offset.
|
||||
*/
|
||||
export function quantizeArray(
|
||||
@@ -366,15 +366,15 @@ export function quantizeArray(
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {Array.<Array.<number>>} endss Endss.
|
||||
* @param {Array<Array<number>>} endss Endss.
|
||||
* @param {number} stride Stride.
|
||||
* @param {number} tolerance Tolerance.
|
||||
* @param {Array.<number>} simplifiedFlatCoordinates Simplified flat
|
||||
* @param {Array<number>} simplifiedFlatCoordinates Simplified flat
|
||||
* coordinates.
|
||||
* @param {number} simplifiedOffset Simplified offset.
|
||||
* @param {Array.<Array.<number>>} simplifiedEndss Simplified endss.
|
||||
* @param {Array<Array<number>>} simplifiedEndss Simplified endss.
|
||||
* @return {number} Simplified offset.
|
||||
*/
|
||||
export function quantizeMultiArray(
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
|
||||
/**
|
||||
* @param {number} maxAngle Maximum acceptable angle delta between segments.
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
* @return {Array.<number>} Start and end of the first suitable chunk of the
|
||||
* @return {Array<number>} Start and end of the first suitable chunk of the
|
||||
* given `flatCoordinates`.
|
||||
*/
|
||||
export function matchingChunk(maxAngle, flatCoordinates, offset, end, stride) {
|
||||
|
||||
@@ -5,7 +5,7 @@ import {lerp} from '../../math.js';
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Path to put text on.
|
||||
* @param {Array<number>} flatCoordinates Path to put text on.
|
||||
* @param {number} offset Start offset of the `flatCoordinates`.
|
||||
* @param {number} end End offset of the `flatCoordinates`.
|
||||
* @param {number} stride Stride.
|
||||
@@ -14,7 +14,7 @@ import {lerp} from '../../math.js';
|
||||
* width of the character passed as 1st argument.
|
||||
* @param {number} startM m along the path where the text starts.
|
||||
* @param {number} maxAngle Max angle between adjacent chars in radians.
|
||||
* @return {Array.<Array.<*>>} The result array of null if `maxAngle` was
|
||||
* @return {Array<Array<*>>} The result array of null if `maxAngle` was
|
||||
* exceeded. Entries of the array are x, y, anchorX, angle, chunk.
|
||||
*/
|
||||
export function drawTextOnPath(
|
||||
|
||||
@@ -5,7 +5,7 @@ import {linearRing as linearRingArea} from '../flat/area.js';
|
||||
|
||||
/**
|
||||
* Check if the linestring is a boundary.
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
* @param {module:ol/transform~Transform} transform Transform.
|
||||
* @param {Array.<number>=} opt_dest Destination.
|
||||
* @return {Array.<number>} Transformed coordinates.
|
||||
* @param {Array<number>=} opt_dest Destination.
|
||||
* @return {Array<number>} Transformed coordinates.
|
||||
*/
|
||||
export function transform2D(flatCoordinates, offset, end, stride, transform, opt_dest) {
|
||||
const dest = opt_dest ? opt_dest : [];
|
||||
@@ -29,14 +29,14 @@ export function transform2D(flatCoordinates, offset, end, stride, transform, opt
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
* @param {number} angle Angle.
|
||||
* @param {Array.<number>} anchor Rotation anchor point.
|
||||
* @param {Array.<number>=} opt_dest Destination.
|
||||
* @return {Array.<number>} Transformed coordinates.
|
||||
* @param {Array<number>} anchor Rotation anchor point.
|
||||
* @param {Array<number>=} opt_dest Destination.
|
||||
* @return {Array<number>} Transformed coordinates.
|
||||
*/
|
||||
export function rotate(flatCoordinates, offset, end, stride, angle, anchor, opt_dest) {
|
||||
const dest = opt_dest ? opt_dest : [];
|
||||
@@ -63,15 +63,15 @@ export function rotate(flatCoordinates, offset, end, stride, angle, anchor, opt_
|
||||
|
||||
/**
|
||||
* Scale the coordinates.
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
* @param {number} sx Scale factor in the x-direction.
|
||||
* @param {number} sy Scale factor in the y-direction.
|
||||
* @param {Array.<number>} anchor Scale anchor point.
|
||||
* @param {Array.<number>=} opt_dest Destination.
|
||||
* @return {Array.<number>} Transformed coordinates.
|
||||
* @param {Array<number>} anchor Scale anchor point.
|
||||
* @param {Array<number>=} opt_dest Destination.
|
||||
* @return {Array<number>} Transformed coordinates.
|
||||
*/
|
||||
export function scale(flatCoordinates, offset, end, stride, sx, sy, anchor, opt_dest) {
|
||||
const dest = opt_dest ? opt_dest : [];
|
||||
@@ -95,14 +95,14 @@ export function scale(flatCoordinates, offset, end, stride, sx, sy, anchor, opt_
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
* @param {number} deltaX Delta X.
|
||||
* @param {number} deltaY Delta Y.
|
||||
* @param {Array.<number>=} opt_dest Destination.
|
||||
* @return {Array.<number>} Transformed coordinates.
|
||||
* @param {Array<number>=} opt_dest Destination.
|
||||
* @return {Array<number>} Transformed coordinates.
|
||||
*/
|
||||
export function translate(flatCoordinates, offset, end, stride, deltaX, deltaY, opt_dest) {
|
||||
const dest = opt_dest ? opt_dest : [];
|
||||
|
||||
@@ -13,7 +13,7 @@ import {get as getProjection} from '../proj.js';
|
||||
|
||||
/**
|
||||
* @typedef {Object} Options
|
||||
* @property {Array.<function(new: module:ol/format/Feature)>} [formatConstructors] Format constructors.
|
||||
* @property {Array<function(new: module:ol/format/Feature)>} [formatConstructors] Format constructors.
|
||||
* @property {module: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
|
||||
* they are dropped on the target. If you want to add features to a vector
|
||||
@@ -47,7 +47,7 @@ class DragAndDropEvent extends Event {
|
||||
/**
|
||||
* @param {module:ol/interaction/DragAndDrop~DragAndDropEventType} type Type.
|
||||
* @param {File} file File.
|
||||
* @param {Array.<module:ol/Feature>=} opt_features Features.
|
||||
* @param {Array<module:ol/Feature>=} opt_features Features.
|
||||
* @param {module:ol/proj/Projection=} opt_projection Projection.
|
||||
*/
|
||||
constructor(type, file, opt_features, opt_projection) {
|
||||
@@ -56,7 +56,7 @@ class DragAndDropEvent extends Event {
|
||||
|
||||
/**
|
||||
* The features parsed from dropped data.
|
||||
* @type {Array.<module:ol/Feature>|undefined}
|
||||
* @type {Array<module:ol/Feature>|undefined}
|
||||
* @api
|
||||
*/
|
||||
this.features = opt_features;
|
||||
@@ -101,7 +101,7 @@ class DragAndDrop extends Interaction {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<function(new: module:ol/format/Feature)>}
|
||||
* @type {Array<function(new: module:ol/format/Feature)>}
|
||||
*/
|
||||
this.formatConstructors_ = options.formatConstructors ?
|
||||
options.formatConstructors : [];
|
||||
@@ -115,7 +115,7 @@ class DragAndDrop extends Interaction {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<module:ol/events~EventsKey>}
|
||||
* @type {Array<module:ol/events~EventsKey>}
|
||||
*/
|
||||
this.dropListenKeys_ = null;
|
||||
|
||||
@@ -220,7 +220,7 @@ class DragAndDrop extends Interaction {
|
||||
* @param {string} text Text.
|
||||
* @param {module:ol/format/Feature~ReadOptions} options Read options.
|
||||
* @private
|
||||
* @return {Array.<module:ol/Feature>} Features.
|
||||
* @return {Array<module:ol/Feature>} Features.
|
||||
*/
|
||||
tryReadFeatures_(format, text, options) {
|
||||
try {
|
||||
|
||||
@@ -56,7 +56,7 @@ import {createEditingStyle} from '../style/Style.js';
|
||||
* @property {module:ol/events/condition~Condition} [finishCondition] A function
|
||||
* that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a
|
||||
* boolean to indicate whether the drawing can be finished.
|
||||
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [style]
|
||||
* @property {module:ol/style/Style|Array<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [style]
|
||||
* Style for sketch features.
|
||||
* @property {module:ol/interaction/Draw~GeometryFunction} [geometryFunction]
|
||||
* Function that is called when a geometry's coordinates are updated.
|
||||
@@ -86,7 +86,7 @@ import {createEditingStyle} from '../style/Style.js';
|
||||
* arguments, and returns a geometry. The optional existing geometry is the
|
||||
* geometry that is returned when the function is called without a second
|
||||
* argument.
|
||||
* @typedef {function(!Array.<module:ol/coordinate~Coordinate>, module:ol/geom/SimpleGeometry=):
|
||||
* @typedef {function(!Array<module:ol/coordinate~Coordinate>, module:ol/geom/SimpleGeometry=):
|
||||
* module:ol/geom/SimpleGeometry} GeometryFunction
|
||||
*/
|
||||
|
||||
@@ -272,7 +272,7 @@ class Draw extends PointerInteraction {
|
||||
if (!geometryFunction) {
|
||||
if (this.type_ === GeometryType.CIRCLE) {
|
||||
/**
|
||||
* @param {!Array.<module:ol/coordinate~Coordinate>} coordinates
|
||||
* @param {!Array<module:ol/coordinate~Coordinate>} coordinates
|
||||
* The coordinates.
|
||||
* @param {module:ol/geom/SimpleGeometry=} opt_geometry Optional geometry.
|
||||
* @return {module:ol/geom/SimpleGeometry} A geometry.
|
||||
@@ -296,7 +296,7 @@ class Draw extends PointerInteraction {
|
||||
Constructor = Polygon;
|
||||
}
|
||||
/**
|
||||
* @param {!Array.<module:ol/coordinate~Coordinate>} coordinates
|
||||
* @param {!Array<module:ol/coordinate~Coordinate>} coordinates
|
||||
* The coordinates.
|
||||
* @param {module:ol/geom/SimpleGeometry=} opt_geometry Optional geometry.
|
||||
* @return {module:ol/geom/SimpleGeometry} A geometry.
|
||||
@@ -358,7 +358,7 @@ class Draw extends PointerInteraction {
|
||||
|
||||
/**
|
||||
* Sketch coordinates. Used when drawing a line or polygon.
|
||||
* @type {module:ol/coordinate~Coordinate|Array.<module:ol/coordinate~Coordinate>|Array.<Array.<module:ol/coordinate~Coordinate>>}
|
||||
* @type {module:ol/coordinate~Coordinate|Array<module:ol/coordinate~Coordinate>|Array<Array<module:ol/coordinate~Coordinate>>}
|
||||
* @private
|
||||
*/
|
||||
this.sketchCoords_ = null;
|
||||
@@ -372,7 +372,7 @@ class Draw extends PointerInteraction {
|
||||
|
||||
/**
|
||||
* Sketch line coordinates. Used when drawing a polygon or circle.
|
||||
* @type {Array.<module:ol/coordinate~Coordinate>}
|
||||
* @type {Array<module:ol/coordinate~Coordinate>}
|
||||
* @private
|
||||
*/
|
||||
this.sketchLineCoords_ = null;
|
||||
@@ -580,7 +580,7 @@ class Draw extends PointerInteraction {
|
||||
}
|
||||
last[0] = coordinate[0];
|
||||
last[1] = coordinate[1];
|
||||
this.geometryFunction_(/** @type {!Array.<module:ol/coordinate~Coordinate>} */ (this.sketchCoords_), geometry);
|
||||
this.geometryFunction_(/** @type {!Array<module:ol/coordinate~Coordinate>} */ (this.sketchCoords_), geometry);
|
||||
if (this.sketchPoint_) {
|
||||
const sketchPointGeom = /** @type {module:ol/geom/Point} */ (this.sketchPoint_.getGeometry());
|
||||
sketchPointGeom.setCoordinates(coordinate);
|
||||
|
||||
@@ -20,12 +20,12 @@ import {createEditingStyle} from '../style/Style.js';
|
||||
* @typedef {Object} Options
|
||||
* @property {module:ol/extent~Extent} [extent] Initial extent. Defaults to no
|
||||
* initial extent.
|
||||
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [boxStyle]
|
||||
* @property {module:ol/style/Style|Array<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [boxStyle]
|
||||
* Style for the drawn extent box. Defaults to
|
||||
* {@link module:ol/style/Style~createEditing()['Polygon']}
|
||||
* @property {number} [pixelTolerance=10] Pixel tolerance for considering the
|
||||
* pointer close enough to a segment or vertex for editing.
|
||||
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [pointerStyle]
|
||||
* @property {module:ol/style/Style|Array<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [pointerStyle]
|
||||
* Style for the cursor used to draw the extent. Defaults to
|
||||
* {@link module:ol/style/Style~createEditing()['Point']}
|
||||
* @property {boolean} [wrapX=false] Wrap the drawn extent across multiple maps
|
||||
|
||||
@@ -60,12 +60,12 @@ const ModifyEventType = {
|
||||
|
||||
/**
|
||||
* @typedef {Object} SegmentData
|
||||
* @property {Array.<number>} [depth]
|
||||
* @property {Array<number>} [depth]
|
||||
* @property {module:ol/Feature} feature
|
||||
* @property {module:ol/geom/SimpleGeometry} geometry
|
||||
* @property {number} index
|
||||
* @property {Array.<module:ol/extent~Extent>} segment
|
||||
* @property {Array.<module:ol/interaction/Modify~SegmentData>} [featureSegments]
|
||||
* @property {Array<module:ol/extent~Extent>} segment
|
||||
* @property {Array<module:ol/interaction/Modify~SegmentData>} [featureSegments]
|
||||
*/
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ const ModifyEventType = {
|
||||
* features. Default is {@link module:ol/events/condition~always}.
|
||||
* @property {number} [pixelTolerance=10] Pixel tolerance for considering the
|
||||
* pointer close enough to a segment or vertex for editing.
|
||||
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [style]
|
||||
* @property {module:ol/style/Style|Array<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [style]
|
||||
* Style used for the features being modified. By default the default edit
|
||||
* style is used (see {@link module:ol/style}).
|
||||
* @property {module:ol/source/Vector} [source] The vector source with
|
||||
@@ -388,7 +388,7 @@ class Modify extends PointerInteraction {
|
||||
*/
|
||||
removeFeatureSegmentData_(feature) {
|
||||
const rBush = this.rBush_;
|
||||
const /** @type {Array.<module:ol/interaction/Modify~SegmentData>} */ nodesToRemove = [];
|
||||
const /** @type {Array<module:ol/interaction/Modify~SegmentData>} */ nodesToRemove = [];
|
||||
rBush.forEach(
|
||||
/**
|
||||
* @param {module:ol/interaction/Modify~SegmentData} node RTree node.
|
||||
@@ -948,7 +948,7 @@ class Modify extends PointerInteraction {
|
||||
/**
|
||||
* @param {module:ol/geom/SimpleGeometry} geometry Geometry.
|
||||
* @param {number} index Index.
|
||||
* @param {Array.<number>|undefined} depth Depth.
|
||||
* @param {Array<number>|undefined} depth Depth.
|
||||
* @param {number} delta Delta (1 or -1).
|
||||
* @private
|
||||
*/
|
||||
|
||||
@@ -136,7 +136,7 @@ class PointerInteraction extends Interaction {
|
||||
this.trackedPointers_ = {};
|
||||
|
||||
/**
|
||||
* @type {Array.<module:ol/pointer/PointerEvent>}
|
||||
* @type {Array<module:ol/pointer/PointerEvent>}
|
||||
* @protected
|
||||
*/
|
||||
this.targetPointers = [];
|
||||
@@ -169,7 +169,7 @@ class PointerInteraction extends Interaction {
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<module:ol/pointer/PointerEvent>} pointerEvents List of events.
|
||||
* @param {Array<module:ol/pointer/PointerEvent>} pointerEvents List of events.
|
||||
* @return {module:ol/pixel~Pixel} Centroid pixel.
|
||||
*/
|
||||
export function centroid(pointerEvents) {
|
||||
|
||||
@@ -55,13 +55,13 @@ const SelectEventType = {
|
||||
* feature removes all from the selection.
|
||||
* See `toggle`, `add`, `remove` options for adding/removing extra features to/
|
||||
* from the selection.
|
||||
* @property {Array.<module:ol/layer/Layer>|function(module:ol/layer/Layer): boolean} [layers]
|
||||
* @property {Array<module:ol/layer/Layer>|function(module:ol/layer/Layer): boolean} [layers]
|
||||
* A list of layers from which features should be selected. Alternatively, a
|
||||
* filter function can be provided. The function will be called for each layer
|
||||
* in the map and should return `true` for layers that you want to be
|
||||
* selectable. If the option is absent, all visible layers will be considered
|
||||
* selectable.
|
||||
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [style]
|
||||
* @property {module:ol/style/Style|Array<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [style]
|
||||
* Style for the selected features. By default the default edit style is used
|
||||
* (see {@link module:ol/style}).
|
||||
* @property {module:ol/events/condition~Condition} [removeCondition] A function
|
||||
@@ -105,8 +105,8 @@ const SelectEventType = {
|
||||
class SelectEvent extends Event {
|
||||
/**
|
||||
* @param {SelectEventType} type The event type.
|
||||
* @param {Array.<module:ol/Feature>} selected Selected features.
|
||||
* @param {Array.<module:ol/Feature>} deselected Deselected features.
|
||||
* @param {Array<module:ol/Feature>} selected Selected features.
|
||||
* @param {Array<module:ol/Feature>} deselected Deselected features.
|
||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent Associated
|
||||
* {@link module:ol/MapBrowserEvent}.
|
||||
*/
|
||||
@@ -115,14 +115,14 @@ class SelectEvent extends Event {
|
||||
|
||||
/**
|
||||
* Selected features array.
|
||||
* @type {Array.<module:ol/Feature>}
|
||||
* @type {Array<module:ol/Feature>}
|
||||
* @api
|
||||
*/
|
||||
this.selected = selected;
|
||||
|
||||
/**
|
||||
* Deselected features array.
|
||||
* @type {Array.<module:ol/Feature>}
|
||||
* @type {Array<module:ol/Feature>}
|
||||
* @api
|
||||
*/
|
||||
this.deselected = deselected;
|
||||
|
||||
@@ -29,7 +29,7 @@ import RBush from '../structs/RBush.js';
|
||||
/**
|
||||
* @typedef {Object} SegmentData
|
||||
* @property {module:ol/Feature} feature
|
||||
* @property {Array.<module:ol/coordinate~Coordinate>} segment
|
||||
* @property {Array<module:ol/coordinate~Coordinate>} segment
|
||||
*/
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ class Snap extends PointerInteraction {
|
||||
this.features_ = options.features ? options.features : null;
|
||||
|
||||
/**
|
||||
* @type {Array.<module:ol/events~EventsKey>}
|
||||
* @type {Array<module:ol/events~EventsKey>}
|
||||
* @private
|
||||
*/
|
||||
this.featuresListenerKeys_ = [];
|
||||
@@ -224,7 +224,7 @@ class Snap extends PointerInteraction {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {module:ol/Collection.<module:ol/Feature>|Array.<module:ol/Feature>} Features.
|
||||
* @return {module:ol/Collection.<module:ol/Feature>|Array<module:ol/Feature>} Features.
|
||||
* @private
|
||||
*/
|
||||
getFeatures_() {
|
||||
@@ -235,7 +235,7 @@ class Snap extends PointerInteraction {
|
||||
features = this.source_.getFeatures();
|
||||
}
|
||||
return (
|
||||
/** @type {!Array.<module:ol/Feature>|!module:ol/Collection.<module:ol/Feature>} */ (features)
|
||||
/** @type {!Array<module:ol/Feature>|!module:ol/Collection.<module:ol/Feature>} */ (features)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ const TranslateEventType = {
|
||||
* @typedef {Object} Options
|
||||
* @property {module:ol/Collection.<module:ol/Feature>} [features] Only features contained in this collection will be able to be translated. If
|
||||
* not specified, all features on the map will be able to be translated.
|
||||
* @property {Array.<module:ol/layer/Layer>|function(module:ol/layer/Layer): boolean} [layers] A list of layers from which features should be
|
||||
* @property {Array<module:ol/layer/Layer>|function(module:ol/layer/Layer): boolean} [layers] A list of layers from which features should be
|
||||
* translated. Alternatively, a filter function can be provided. The
|
||||
* function will be called for each layer in the map and should return
|
||||
* `true` for layers that you want to be translatable. If the option is
|
||||
|
||||
@@ -100,17 +100,17 @@ class BaseLayer extends BaseObject {
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param {Array.<module:ol/layer/Layer>=} opt_array Array of layers (to be
|
||||
* @param {Array<module:ol/layer/Layer>=} opt_array Array of layers (to be
|
||||
* modified in place).
|
||||
* @return {Array.<module:ol/layer/Layer>} Array of layers.
|
||||
* @return {Array<module:ol/layer/Layer>} Array of layers.
|
||||
*/
|
||||
getLayersArray(opt_array) {}
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param {Array.<module:ol/layer/Layer~State>=} opt_states Optional list of layer
|
||||
* @param {Array<module:ol/layer/Layer~State>=} opt_states Optional list of layer
|
||||
* states (to be modified in place).
|
||||
* @return {Array.<module:ol/layer/Layer~State>} List of layer states.
|
||||
* @return {Array<module:ol/layer/Layer~State>} List of layer states.
|
||||
*/
|
||||
getLayerStatesArray(opt_states) {}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ import SourceState from '../source/State.js';
|
||||
* visible.
|
||||
* @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will
|
||||
* be visible.
|
||||
* @property {Array.<module:ol/layer/Base>|module:ol/Collection.<module:ol/layer/Base>} [layers] Child layers.
|
||||
* @property {Array<module:ol/layer/Base>|module:ol/Collection.<module:ol/layer/Base>} [layers] Child layers.
|
||||
*/
|
||||
|
||||
|
||||
@@ -64,13 +64,13 @@ class LayerGroup extends BaseLayer {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<module:ol/events~EventsKey>}
|
||||
* @type {Array<module:ol/events~EventsKey>}
|
||||
*/
|
||||
this.layersListenerKeys_ = [];
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Object.<string, Array.<module:ol/events~EventsKey>>}
|
||||
* @type {Object.<string, Array<module:ol/events~EventsKey>>}
|
||||
*/
|
||||
this.listenerKeys_ = {};
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import Style from '../style/Style.js';
|
||||
* visible.
|
||||
* @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will
|
||||
* be visible.
|
||||
* @property {Array.<string>} [gradient=['#00f', '#0ff', '#0f0', '#ff0', '#f00']] The color gradient
|
||||
* @property {Array<string>} [gradient=['#00f', '#0ff', '#0f0', '#ff0', '#f00']] The color gradient
|
||||
* of the heatmap, specified as an array of CSS color strings.
|
||||
* @property {number} [radius=8] Radius size in pixels.
|
||||
* @property {number} [blur=15] Blur size in pixels.
|
||||
@@ -54,7 +54,7 @@ const Property = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Array.<string>}
|
||||
* @type {Array<string>}
|
||||
*/
|
||||
const DEFAULT_GRADIENT = ['#00f', '#0ff', '#0f0', '#ff0', '#f00'];
|
||||
|
||||
@@ -105,7 +105,7 @@ class Heatmap extends VectorLayer {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<Array.<module:ol/style/Style>>}
|
||||
* @type {Array<Array<module:ol/style/Style>>}
|
||||
*/
|
||||
this.styleCache_ = null;
|
||||
|
||||
@@ -197,12 +197,12 @@ class Heatmap extends VectorLayer {
|
||||
|
||||
/**
|
||||
* Return the gradient colors as array of strings.
|
||||
* @return {Array.<string>} Colors.
|
||||
* @return {Array<string>} Colors.
|
||||
* @api
|
||||
* @observable
|
||||
*/
|
||||
getGradient() {
|
||||
return /** @type {Array.<string>} */ (this.get(Property.GRADIENT));
|
||||
return /** @type {Array<string>} */ (this.get(Property.GRADIENT));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -263,7 +263,7 @@ class Heatmap extends VectorLayer {
|
||||
|
||||
/**
|
||||
* Set the gradient colors as array of strings.
|
||||
* @param {Array.<string>} colors Gradient.
|
||||
* @param {Array<string>} colors Gradient.
|
||||
* @api
|
||||
* @observable
|
||||
*/
|
||||
@@ -284,7 +284,7 @@ class Heatmap extends VectorLayer {
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<string>} colors A list of colored.
|
||||
* @param {Array<string>} colors A list of colored.
|
||||
* @return {Uint8ClampedArray} An array.
|
||||
*/
|
||||
function createGradient(colors) {
|
||||
|
||||
@@ -39,7 +39,7 @@ import {createDefaultStyle, toFunction as toStyleFunction} from '../style/Style.
|
||||
* @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
|
||||
* @property {module:ol/style/Style|Array<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [style] Layer style. See
|
||||
* {@link module:ol/style} for default style which will be used if this is not defined.
|
||||
* @property {boolean} [updateWhileAnimating=false] When set to `true` and `renderMode`
|
||||
* is `vector`, feature batches will be recreated during animations. This means that no
|
||||
@@ -117,7 +117,7 @@ class VectorLayer extends Layer {
|
||||
|
||||
/**
|
||||
* User provided style.
|
||||
* @type {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction}
|
||||
* @type {module:ol/style/Style|Array<module:ol/style/Style>|module:ol/style/Style~StyleFunction}
|
||||
* @private
|
||||
*/
|
||||
this.style_ = null;
|
||||
@@ -194,7 +194,7 @@ class VectorLayer extends Layer {
|
||||
/**
|
||||
* Get the style for features. This returns whatever was passed to the `style`
|
||||
* option at construction or to the `setStyle` method.
|
||||
* @return {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction}
|
||||
* @return {module:ol/style/Style|Array<module:ol/style/Style>|module:ol/style/Style~StyleFunction}
|
||||
* Layer style.
|
||||
* @api
|
||||
*/
|
||||
@@ -242,7 +242,7 @@ class VectorLayer extends Layer {
|
||||
* 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 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.
|
||||
* @param {module:ol/style/Style|Array<module:ol/style/Style>|module:ol/style/Style~StyleFunction|null|undefined} style Layer style.
|
||||
* @api
|
||||
*/
|
||||
setStyle(style) {
|
||||
|
||||
@@ -68,7 +68,7 @@ export const RenderType = {
|
||||
* 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
|
||||
* @property {module:ol/style/Style|Array<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [style] Layer style. See
|
||||
* {@link module:ol/style} for default style which will be used if this is not defined.
|
||||
* @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
|
||||
@@ -80,7 +80,7 @@ export const RenderType = {
|
||||
* means no preloading.
|
||||
* @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
|
||||
* @property {module:ol/style/Style|Array<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [style] Layer style. See
|
||||
* {@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.
|
||||
*/
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* Strategy function for loading all features with a single request.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {number} resolution Resolution.
|
||||
* @return {Array.<module:ol/extent~Extent>} Extents.
|
||||
* @return {Array<module:ol/extent~Extent>} Extents.
|
||||
* @api
|
||||
*/
|
||||
export function all(extent, resolution) {
|
||||
@@ -20,7 +20,7 @@ export function all(extent, resolution) {
|
||||
* resolution.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {number} resolution Resolution.
|
||||
* @return {Array.<module:ol/extent~Extent>} Extents.
|
||||
* @return {Array<module:ol/extent~Extent>} Extents.
|
||||
* @api
|
||||
*/
|
||||
export function bbox(extent, resolution) {
|
||||
@@ -31,7 +31,7 @@ export function bbox(extent, resolution) {
|
||||
/**
|
||||
* Creates a strategy function for loading features based on a tile grid.
|
||||
* @param {module:ol/tilegrid/TileGrid} tileGrid Tile grid.
|
||||
* @return {function(module:ol/extent~Extent, number): Array.<module:ol/extent~Extent>} Loading strategy.
|
||||
* @return {function(module:ol/extent~Extent, number): Array<module:ol/extent~Extent>} Loading strategy.
|
||||
* @api
|
||||
*/
|
||||
export function tile(tileGrid) {
|
||||
@@ -39,12 +39,12 @@ export function tile(tileGrid) {
|
||||
/**
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {number} resolution Resolution.
|
||||
* @return {Array.<module:ol/extent~Extent>} Extents.
|
||||
* @return {Array<module:ol/extent~Extent>} Extents.
|
||||
*/
|
||||
function(extent, resolution) {
|
||||
const z = tileGrid.getZForResolution(resolution);
|
||||
const tileRange = tileGrid.getTileRangeForExtentAndZ(extent, z);
|
||||
/** @type {Array.<module:ol/extent~Extent>} */
|
||||
/** @type {Array<module:ol/extent~Extent>} */
|
||||
const extents = [];
|
||||
/** @type {module:ol/tilecoord~TileCoord} */
|
||||
const tileCoord = [z, 0, 0];
|
||||
|
||||
@@ -99,9 +99,9 @@ export function squaredDistance(x1, y1, x2, y2) {
|
||||
/**
|
||||
* Solves system of linear equations using Gaussian elimination method.
|
||||
*
|
||||
* @param {Array.<Array.<number>>} mat Augmented matrix (n x n + 1 column)
|
||||
* @param {Array<Array<number>>} mat Augmented matrix (n x n + 1 column)
|
||||
* in row-major order.
|
||||
* @return {Array.<number>} The resulting vector.
|
||||
* @return {Array<number>} The resulting vector.
|
||||
*/
|
||||
export function solveLinearSystem(mat) {
|
||||
const n = mat.length;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* An array with two elements, representing a pixel. The first element is the
|
||||
* x-coordinate, the second the y-coordinate of the pixel.
|
||||
* @typedef {Array.<number>} Pixel
|
||||
* @typedef {Array<number>} Pixel
|
||||
* @api
|
||||
*/
|
||||
|
||||
@@ -25,7 +25,7 @@ class EventSource {
|
||||
|
||||
/**
|
||||
* List of events supported by this source.
|
||||
* @return {Array.<string>} Event names
|
||||
* @return {Array<string>} Event names
|
||||
*/
|
||||
getEvents() {
|
||||
return Object.keys(this.mapping_);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user