@@ -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,8 +106,8 @@ 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.
|
||||
* @return {module:ol/Collection.<T>} This collection.
|
||||
* @param {!Array<T>} arr Array.
|
||||
* @return {module:ol/Collection<T>} This collection.
|
||||
* @api
|
||||
*/
|
||||
extend(arr) {
|
||||
@@ -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() {
|
||||
|
||||
@@ -54,7 +54,7 @@ import Style from './style/Style.js';
|
||||
*/
|
||||
class Feature extends BaseObject {
|
||||
/**
|
||||
* @param {module:ol/geom/Geometry|Object.<string, *>=} opt_geometryOrProperties
|
||||
* @param {module:ol/geom/Geometry|Object<string, *>=} opt_geometryOrProperties
|
||||
* You may pass a Geometry object directly, or an object literal containing
|
||||
* properties. If you pass an object literal, you may include a Geometry
|
||||
* associated with a `geometry` key.
|
||||
@@ -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;
|
||||
|
||||
@@ -104,7 +104,7 @@ class Feature extends BaseObject {
|
||||
const geometry = opt_geometryOrProperties;
|
||||
this.setGeometry(geometry);
|
||||
} else {
|
||||
/** @type {Object.<string, *>} */
|
||||
/** @type {Object<string, *>} */
|
||||
const properties = opt_geometryOrProperties;
|
||||
this.setProperties(properties);
|
||||
}
|
||||
@@ -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_ = [];
|
||||
@@ -68,7 +68,7 @@ class MapBrowserEventHandler extends EventTarget {
|
||||
this.activePointers_ = 0;
|
||||
|
||||
/**
|
||||
* @type {!Object.<number, boolean>}
|
||||
* @type {!Object<number, boolean>}
|
||||
* @private
|
||||
*/
|
||||
this.trackedTouches_ = {};
|
||||
|
||||
@@ -88,7 +88,7 @@ class ObjectEvent extends Event {
|
||||
class BaseObject extends Observable {
|
||||
|
||||
/**
|
||||
* @param {Object.<string, *>=} opt_values An object with key-value pairs.
|
||||
* @param {Object<string, *>=} opt_values An object with key-value pairs.
|
||||
*/
|
||||
constructor(opt_values) {
|
||||
super();
|
||||
@@ -101,7 +101,7 @@ class BaseObject extends Observable {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {!Object.<string, *>}
|
||||
* @type {!Object<string, *>}
|
||||
*/
|
||||
this.values_ = {};
|
||||
|
||||
@@ -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() {
|
||||
@@ -135,7 +135,7 @@ class BaseObject extends Observable {
|
||||
|
||||
/**
|
||||
* Get an object of all property names and values.
|
||||
* @return {Object.<string, *>} Object.
|
||||
* @return {Object<string, *>} Object.
|
||||
* @api
|
||||
*/
|
||||
getProperties() {
|
||||
@@ -176,7 +176,7 @@ class BaseObject extends Observable {
|
||||
/**
|
||||
* Sets a collection of key-value pairs. Note that this changes any existing
|
||||
* properties and adds new ones (it does not remove any existing properties).
|
||||
* @param {Object.<string, *>} values Values.
|
||||
* @param {Object<string, *>} values Values.
|
||||
* @param {boolean=} opt_silent Update without triggering an event.
|
||||
* @api
|
||||
*/
|
||||
@@ -205,7 +205,7 @@ class BaseObject extends Observable {
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object.<string, string>}
|
||||
* @type {Object<string, string>}
|
||||
*/
|
||||
const changeEventTypeCache = {};
|
||||
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -41,16 +41,16 @@ import {create as createTransform, apply as applyTransform} from './transform.js
|
||||
* @property {null|module:ol/extent~Extent} extent
|
||||
* @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 {Object<number, module:ol/layer/Layer~State>} layerStates
|
||||
* @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 {!Object<string, boolean>} skippedFeatureUids
|
||||
* @property {module:ol/TileQueue} tileQueue
|
||||
* @property {Object.<string, Object.<string, module:ol/TileRange>>} usedTiles
|
||||
* @property {Array.<number>} viewHints
|
||||
* @property {!Object.<string, Object.<string, boolean>>} wantedTiles
|
||||
* @property {Object<string, Object<string, module:ol/TileRange>>} usedTiles
|
||||
* @property {Array<number>} viewHints
|
||||
* @property {!Object<string, Object<string, boolean>>} wantedTiles
|
||||
*/
|
||||
|
||||
|
||||
@@ -74,23 +74,23 @@ import {create as createTransform, apply as applyTransform} from './transform.js
|
||||
|
||||
/**
|
||||
* @typedef {Object} MapOptionsInternal
|
||||
* @property {module:ol/Collection.<module:ol/control/Control>} [controls]
|
||||
* @property {module:ol/Collection.<module:ol/interaction/Interaction>} [interactions]
|
||||
* @property {module:ol/Collection<module:ol/control/Control>} [controls]
|
||||
* @property {module:ol/Collection<module:ol/interaction/Interaction>} [interactions]
|
||||
* @property {HTMLElement|Document} keyboardEventTarget
|
||||
* @property {module:ol/Collection.<module:ol/Overlay>} overlays
|
||||
* @property {Object.<string, *>} values
|
||||
* @property {module:ol/Collection<module:ol/Overlay>} overlays
|
||||
* @property {Object<string, *>} values
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
@@ -310,19 +310,19 @@ class PluggableMap extends BaseObject {
|
||||
listen(this.viewport_, EventType.MOUSEWHEEL, this.handleBrowserEvent, this);
|
||||
|
||||
/**
|
||||
* @type {module:ol/Collection.<module:ol/control/Control>}
|
||||
* @type {module:ol/Collection<module:ol/control/Control>}
|
||||
* @protected
|
||||
*/
|
||||
this.controls = optionsInternal.controls || new Collection();
|
||||
|
||||
/**
|
||||
* @type {module:ol/Collection.<module:ol/interaction/Interaction>}
|
||||
* @type {module:ol/Collection<module:ol/interaction/Interaction>}
|
||||
* @protected
|
||||
*/
|
||||
this.interactions = optionsInternal.interactions || new Collection();
|
||||
|
||||
/**
|
||||
* @type {module:ol/Collection.<module:ol/Overlay>}
|
||||
* @type {module:ol/Collection<module:ol/Overlay>}
|
||||
* @private
|
||||
*/
|
||||
this.overlays_ = optionsInternal.overlays;
|
||||
@@ -330,7 +330,7 @@ class PluggableMap extends BaseObject {
|
||||
/**
|
||||
* A lookup of overlays by id.
|
||||
* @private
|
||||
* @type {Object.<string, module:ol/Overlay>}
|
||||
* @type {Object<string, module:ol/Overlay>}
|
||||
*/
|
||||
this.overlayIdIndex_ = {};
|
||||
|
||||
@@ -354,7 +354,7 @@ class PluggableMap extends BaseObject {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {!Array.<module:ol/PluggableMap~PostRenderFunction>}
|
||||
* @type {!Array<module:ol/PluggableMap~PostRenderFunction>}
|
||||
*/
|
||||
this.postRenderFunctions_ = [];
|
||||
|
||||
@@ -368,7 +368,7 @@ class PluggableMap extends BaseObject {
|
||||
|
||||
/**
|
||||
* Uids of features to skip at rendering time.
|
||||
* @type {Object.<string, boolean>}
|
||||
* @type {Object<string, boolean>}
|
||||
* @private
|
||||
*/
|
||||
this.skippedFeatureUids_ = {};
|
||||
@@ -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
|
||||
*/
|
||||
@@ -716,7 +716,7 @@ class PluggableMap extends BaseObject {
|
||||
/**
|
||||
* Get the map controls. Modifying this collection changes the controls
|
||||
* associated with the map.
|
||||
* @return {module:ol/Collection.<module:ol/control/Control>} Controls.
|
||||
* @return {module:ol/Collection<module:ol/control/Control>} Controls.
|
||||
* @api
|
||||
*/
|
||||
getControls() {
|
||||
@@ -726,7 +726,7 @@ class PluggableMap extends BaseObject {
|
||||
/**
|
||||
* Get the map overlays. Modifying this collection changes the overlays
|
||||
* associated with the map.
|
||||
* @return {module:ol/Collection.<module:ol/Overlay>} Overlays.
|
||||
* @return {module:ol/Collection<module:ol/Overlay>} Overlays.
|
||||
* @api
|
||||
*/
|
||||
getOverlays() {
|
||||
@@ -751,7 +751,7 @@ class PluggableMap extends BaseObject {
|
||||
* associated with the map.
|
||||
*
|
||||
* Interactions are used for e.g. pan, zoom and rotate.
|
||||
* @return {module:ol/Collection.<module:ol/interaction/Interaction>} Interactions.
|
||||
* @return {module:ol/Collection<module:ol/interaction/Interaction>} Interactions.
|
||||
* @api
|
||||
*/
|
||||
getInteractions() {
|
||||
@@ -772,7 +772,7 @@ class PluggableMap extends BaseObject {
|
||||
|
||||
/**
|
||||
* Get the collection of layers associated with this map.
|
||||
* @return {!module:ol/Collection.<module:ol/layer/Base>} Layers.
|
||||
* @return {!module:ol/Collection<module:ol/layer/Base>} Layers.
|
||||
* @api
|
||||
*/
|
||||
getLayers() {
|
||||
@@ -1356,7 +1356,7 @@ function createOptionsInternal(options) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {Object.<string, *>}
|
||||
* @type {Object<string, *>}
|
||||
*/
|
||||
const values = {};
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ class Tile extends EventTarget {
|
||||
/**
|
||||
* Lookup of start times for rendering transitions. If the start time is
|
||||
* equal to -1, the transition is complete.
|
||||
* @type {Object.<number, number>}
|
||||
* @type {Object<number, number>}
|
||||
*/
|
||||
this.transitionStarts_ = {};
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ class TileCache extends LRUCache {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {!Object.<string, module:ol/TileRange>} usedTiles Used tiles.
|
||||
* @param {!Object<string, module:ol/TileRange>} usedTiles Used tiles.
|
||||
*/
|
||||
expireCache(usedTiles) {
|
||||
while (this.canExpireCache()) {
|
||||
|
||||
@@ -50,7 +50,7 @@ class TileQueue extends PriorityQueue {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {!Object.<string,boolean>}
|
||||
* @type {!Object<string,boolean>}
|
||||
*/
|
||||
this.tilesLoadingKeys_ = {};
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ class VectorImageTile extends Tile {
|
||||
* @param {module:ol/Tile~UrlFunction} tileUrlFunction Tile url function.
|
||||
* @param {module:ol/tilegrid/TileGrid} sourceTileGrid Tile grid of the source.
|
||||
* @param {module:ol/tilegrid/TileGrid} tileGrid Tile grid of the renderer.
|
||||
* @param {Object.<string, module:ol/VectorTile>} sourceTiles Source tiles.
|
||||
* @param {Object<string, module:ol/VectorTile>} sourceTiles Source tiles.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {module:ol/proj/Projection} projection Projection.
|
||||
* @param {function(new: module:ol/VectorTile, module:ol/tilecoord~TileCoord, module:ol/TileState, string,
|
||||
@@ -51,7 +51,7 @@ class VectorImageTile extends Tile {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {!Object.<string, CanvasRenderingContext2D>}
|
||||
* @type {!Object<string, CanvasRenderingContext2D>}
|
||||
*/
|
||||
this.context_ = {};
|
||||
|
||||
@@ -63,19 +63,19 @@ class VectorImageTile extends Tile {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {!Object.<string, module:ol/VectorImageTile~ReplayState>}
|
||||
* @type {!Object<string, module:ol/VectorImageTile~ReplayState>}
|
||||
*/
|
||||
this.replayState_ = {};
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Object.<string, module:ol/VectorTile>}
|
||||
* @type {Object<string, module:ol/VectorTile>}
|
||||
*/
|
||||
this.sourceTiles_ = sourceTiles;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
@@ -70,7 +70,7 @@ class VectorTile extends Tile {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Object.<string, module:ol/render/ReplayGroup>}
|
||||
* @type {Object<string, module:ol/render/ReplayGroup>}
|
||||
*/
|
||||
this.replayGroups_ = {};
|
||||
|
||||
@@ -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_ = [];
|
||||
|
||||
@@ -273,7 +273,7 @@ class View extends BaseObject {
|
||||
applyOptions_(options) {
|
||||
|
||||
/**
|
||||
* @type {Object.<string, *>}
|
||||
* @type {Object<string, *>}
|
||||
*/
|
||||
const properties = {};
|
||||
properties[ViewProperty.CENTER] = options.center !== undefined ?
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -84,7 +84,7 @@ export const fromString = (
|
||||
const MAX_CACHE_SIZE = 1024;
|
||||
|
||||
/**
|
||||
* @type {Object.<string, module:ol/color~Color>}
|
||||
* @type {Object<string, module:ol/color~Color>}
|
||||
*/
|
||||
const cache = {};
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@ class Attribution extends Control {
|
||||
|
||||
/**
|
||||
* A list of currently rendered resolutions.
|
||||
* @type {Array.<string>}
|
||||
* @type {Array<string>}
|
||||
* @private
|
||||
*/
|
||||
this.renderedAttributions_ = [];
|
||||
@@ -147,19 +147,19 @@ 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) {
|
||||
/**
|
||||
* Used to determine if an attribution already exists.
|
||||
* @type {!Object.<string, boolean>}
|
||||
* @type {!Object<string, boolean>}
|
||||
*/
|
||||
const lookup = {};
|
||||
|
||||
/**
|
||||
* 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];
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ import Zoom from './Zoom.js';
|
||||
*
|
||||
* @param {module:ol/control/util~DefaultsOptions=} opt_options
|
||||
* Defaults options.
|
||||
* @return {module:ol/Collection.<module:ol/control/Control>}
|
||||
* @return {module:ol/Collection<module:ol/control/Control>}
|
||||
* Controls.
|
||||
* @function module:ol/control.defaults
|
||||
* @api
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -62,7 +62,7 @@ export const CLASS_COLLAPSED = 'ol-collapsed';
|
||||
* Get the list of font families from a font spec. Note that this doesn't work
|
||||
* for font families that have commas in them.
|
||||
* @param {string} The CSS font property.
|
||||
* @return {Object.<string>} The font families (or null if the input spec is invalid).
|
||||
* @return {Object<string>} The font families (or null if the input spec is invalid).
|
||||
*/
|
||||
export const getFontFamilies = (function() {
|
||||
let style;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -34,19 +34,19 @@ class EventTarget extends Disposable {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {!Object.<string, number>}
|
||||
* @type {!Object<string, number>}
|
||||
*/
|
||||
this.pendingRemovals_ = {};
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {!Object.<string, number>}
|
||||
* @type {!Object<string, number>}
|
||||
*/
|
||||
this.dispatching_ = {};
|
||||
|
||||
/**
|
||||
* @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}
|
||||
|
||||
@@ -23,7 +23,7 @@ import {get as getProjection} from '../proj.js';
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<module:ol/geom/GeometryType, function(EsriJSONGeometry): module:ol/geom/Geometry>}
|
||||
* @type {Object<module:ol/geom/GeometryType, function(EsriJSONGeometry): module:ol/geom/Geometry>}
|
||||
*/
|
||||
const GEOMETRY_READERS = {};
|
||||
GEOMETRY_READERS[GeometryType.POINT] = readPointGeometry;
|
||||
@@ -36,7 +36,7 @@ GEOMETRY_READERS[GeometryType.MULTI_POLYGON] = readMultiPolygonGeometry;
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, function(module:ol/geom/Geometry, module:ol/format/Feature~WriteOptions=): (EsriJSONGeometry)>}
|
||||
* @type {Object<string, function(module:ol/geom/Geometry, module:ol/format/Feature~WriteOptions=): (EsriJSONGeometry)>}
|
||||
*/
|
||||
const GEOMETRY_WRITERS = {};
|
||||
GEOMETRY_WRITERS[GeometryType.POINT] = writePointGeometry;
|
||||
@@ -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
|
||||
|
||||
@@ -21,7 +21,7 @@ const schemaLocation = GMLNS + ' http://schemas.opengis.net/gml/2.1.2/feature.xs
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, string>}
|
||||
* @type {Object<string, string>}
|
||||
*/
|
||||
const MULTIGEOMETRY_TO_MEMBER_NODENAME = {
|
||||
'MultiLineString': 'lineStringMember',
|
||||
@@ -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
|
||||
@@ -587,7 +587,7 @@ class GML2 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML2.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
|
||||
@@ -598,7 +598,7 @@ GML2.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML2.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
|
||||
@@ -610,7 +610,7 @@ GML2.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML2.prototype.BOX_PARSERS_ = {
|
||||
@@ -622,7 +622,7 @@ GML2.prototype.BOX_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML2.prototype.GEOMETRY_PARSERS_ = {
|
||||
@@ -645,7 +645,7 @@ GML2.prototype.GEOMETRY_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML2.prototype.GEOMETRY_SERIALIZERS_ = {
|
||||
@@ -677,7 +677,7 @@ GML2.prototype.GEOMETRY_SERIALIZERS_ = {
|
||||
};
|
||||
|
||||
/**
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML2.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
|
||||
@@ -690,7 +690,7 @@ GML2.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
|
||||
};
|
||||
|
||||
/**
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML2.prototype.RING_SERIALIZERS_ = {
|
||||
@@ -701,7 +701,7 @@ GML2.prototype.RING_SERIALIZERS_ = {
|
||||
};
|
||||
|
||||
/**
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML2.prototype.POINTMEMBER_SERIALIZERS_ = {
|
||||
@@ -713,7 +713,7 @@ GML2.prototype.POINTMEMBER_SERIALIZERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML2.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
|
||||
@@ -726,7 +726,7 @@ GML2.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
|
||||
};
|
||||
|
||||
/**
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML2.prototype.ENVELOPE_SERIALIZERS_ = {
|
||||
|
||||
@@ -31,7 +31,7 @@ const schemaLocation = GMLNS +
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, string>}
|
||||
* @type {Object<string, string>}
|
||||
*/
|
||||
const MULTIGEOMETRY_TO_MEMBER_NODENAME = {
|
||||
'MultiLineString': 'lineStringMember',
|
||||
@@ -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
|
||||
@@ -920,7 +920,7 @@ class GML3 extends GMLBase {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
|
||||
@@ -933,7 +933,7 @@ GML3.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
|
||||
@@ -946,7 +946,7 @@ GML3.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.GEOMETRY_PARSERS_ = {
|
||||
@@ -976,7 +976,7 @@ GML3.prototype.GEOMETRY_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.MULTICURVE_PARSERS_ = {
|
||||
@@ -991,7 +991,7 @@ GML3.prototype.MULTICURVE_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.MULTISURFACE_PARSERS_ = {
|
||||
@@ -1006,7 +1006,7 @@ GML3.prototype.MULTISURFACE_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.CURVEMEMBER_PARSERS_ = {
|
||||
@@ -1020,7 +1020,7 @@ GML3.prototype.CURVEMEMBER_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.SURFACEMEMBER_PARSERS_ = {
|
||||
@@ -1033,7 +1033,7 @@ GML3.prototype.SURFACEMEMBER_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.SURFACE_PARSERS_ = {
|
||||
@@ -1045,7 +1045,7 @@ GML3.prototype.SURFACE_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.CURVE_PARSERS_ = {
|
||||
@@ -1057,7 +1057,7 @@ GML3.prototype.CURVE_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.ENVELOPE_PARSERS_ = {
|
||||
@@ -1072,7 +1072,7 @@ GML3.prototype.ENVELOPE_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.PATCHES_PARSERS_ = {
|
||||
@@ -1085,7 +1085,7 @@ GML3.prototype.PATCHES_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.SEGMENTS_PARSERS_ = {
|
||||
@@ -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
|
||||
@@ -1109,7 +1109,7 @@ GML3.prototype.writeFeatures;
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.RING_SERIALIZERS_ = {
|
||||
@@ -1121,7 +1121,7 @@ GML3.prototype.RING_SERIALIZERS_ = {
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.ENVELOPE_SERIALIZERS_ = {
|
||||
@@ -1133,7 +1133,7 @@ GML3.prototype.ENVELOPE_SERIALIZERS_ = {
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
|
||||
@@ -1147,7 +1147,7 @@ GML3.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.POINTMEMBER_SERIALIZERS_ = {
|
||||
@@ -1159,7 +1159,7 @@ GML3.prototype.POINTMEMBER_SERIALIZERS_ = {
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
|
||||
@@ -1173,7 +1173,7 @@ GML3.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
* @private
|
||||
*/
|
||||
GML3.prototype.GEOMETRY_SERIALIZERS_ = {
|
||||
|
||||
@@ -44,7 +44,7 @@ const ONLY_WHITESPACE_RE = /^[\s\xa0]*$/;
|
||||
|
||||
/**
|
||||
* @typedef {Object} Options
|
||||
* @property {Object.<string, string>|string} [featureNS] Feature
|
||||
* @property {Object<string, string>|string} [featureNS] Feature
|
||||
* namespace. If not defined will be derived from GML. If multiple
|
||||
* feature types have been configured which come from different feature
|
||||
* namespaces, this will be an object with the keys being the prefixes used
|
||||
@@ -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,13 +96,13 @@ class GMLBase extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {Array.<string>|string|undefined}
|
||||
* @type {Array<string>|string|undefined}
|
||||
*/
|
||||
this.featureType = options.featureType;
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {Object.<string, string>|string|undefined}
|
||||
* @type {Object<string, string>|string|undefined}
|
||||
*/
|
||||
this.featureNS = options.featureNS;
|
||||
|
||||
@@ -119,7 +119,7 @@ class GMLBase extends XMLFeature {
|
||||
this.schemaLocation = '';
|
||||
|
||||
/**
|
||||
* @type {Object.<string, Object.<string, Object>>}
|
||||
* @type {Object<string, Object<string, Object>>}
|
||||
*/
|
||||
this.FEATURE_COLLECTION_PARSERS = {};
|
||||
this.FEATURE_COLLECTION_PARSERS[GMLNS] = {
|
||||
@@ -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);
|
||||
@@ -471,7 +471,7 @@ class GMLBase extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GMLBase.prototype.MULTIPOINT_PARSERS_ = {
|
||||
@@ -484,7 +484,7 @@ GMLBase.prototype.MULTIPOINT_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GMLBase.prototype.MULTILINESTRING_PARSERS_ = {
|
||||
@@ -497,7 +497,7 @@ GMLBase.prototype.MULTILINESTRING_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GMLBase.prototype.MULTIPOLYGON_PARSERS_ = {
|
||||
@@ -510,7 +510,7 @@ GMLBase.prototype.MULTIPOLYGON_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GMLBase.prototype.POINTMEMBER_PARSERS_ = {
|
||||
@@ -522,7 +522,7 @@ GMLBase.prototype.POINTMEMBER_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GMLBase.prototype.LINESTRINGMEMBER_PARSERS_ = {
|
||||
@@ -534,7 +534,7 @@ GMLBase.prototype.LINESTRINGMEMBER_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @private
|
||||
*/
|
||||
GMLBase.prototype.POLYGONMEMBER_PARSERS_ = {
|
||||
@@ -546,7 +546,7 @@ GMLBase.prototype.POLYGONMEMBER_PARSERS_ = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
* @protected
|
||||
*/
|
||||
GMLBase.prototype.RING_PARSERS = {
|
||||
|
||||
@@ -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,
|
||||
@@ -49,7 +49,7 @@ const FEATURE_READER = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const GPX_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -61,7 +61,7 @@ const GPX_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const LINK_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -72,7 +72,7 @@ const LINK_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
*/
|
||||
const GPX_SERIALIZERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -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
|
||||
@@ -225,7 +225,7 @@ class GPX extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const RTE_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -243,7 +243,7 @@ const RTE_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const RTEPT_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -254,7 +254,7 @@ const RTEPT_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const TRK_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -272,7 +272,7 @@ const TRK_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const TRKSEG_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -282,7 +282,7 @@ const TRKSEG_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const TRKPT_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -293,7 +293,7 @@ const TRKPT_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const WPT_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -321,14 +321,14 @@ const WPT_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Array.<string>}
|
||||
* @type {Array<string>}
|
||||
*/
|
||||
const LINK_SEQUENCE = ['text', 'type'];
|
||||
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
*/
|
||||
const LINK_SERIALIZERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -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, [
|
||||
@@ -349,7 +349,7 @@ const RTE_SEQUENCE = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
*/
|
||||
const RTE_SERIALIZERS = 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, [
|
||||
@@ -386,7 +386,7 @@ const TRK_SEQUENCE = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
*/
|
||||
const TRK_SERIALIZERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -403,14 +403,14 @@ const TRK_SERIALIZERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {function(*, Array.<*>, string=): (Node|undefined)}
|
||||
* @type {function(*, Array<*>, string=): (Node|undefined)}
|
||||
*/
|
||||
const TRKSEG_NODE_FACTORY = makeSimpleNodeFactory('trkpt');
|
||||
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
*/
|
||||
const TRKSEG_SERIALIZERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -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, [
|
||||
@@ -432,7 +432,7 @@ const WPT_TYPE_SEQUENCE = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
*/
|
||||
const WPT_TYPE_SERIALIZERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -459,7 +459,7 @@ const WPT_TYPE_SERIALIZERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, string>}
|
||||
* @type {Object<string, string>}
|
||||
*/
|
||||
const GEOMETRY_TYPE_TO_NODENAME = {
|
||||
'Point': 'wpt',
|
||||
@@ -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
|
||||
@@ -231,7 +231,7 @@ class GeoJSON extends JSONFeature {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, function(GeoJSONObject): module:ol/geom/Geometry>}
|
||||
* @type {Object<string, function(GeoJSONObject): module:ol/geom/Geometry>}
|
||||
*/
|
||||
const GEOMETRY_READERS = {
|
||||
'Point': readPointGeometry,
|
||||
@@ -246,7 +246,7 @@ const GEOMETRY_READERS = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, function(module:ol/geom/Geometry, module:ol/format/Feature~WriteOptions=): (GeoJSONGeometry|GeoJSONGeometryCollection)>}
|
||||
* @type {Object<string, function(module:ol/geom/Geometry, module:ol/format/Feature~WriteOptions=): (GeoJSONGeometry|GeoJSONGeometryCollection)>}
|
||||
*/
|
||||
const GEOMETRY_WRITERS = {
|
||||
'Point': writePointGeometry,
|
||||
|
||||
@@ -94,7 +94,7 @@ class IGC extends TextFeature {
|
||||
readFeatureFromText(text, opt_options) {
|
||||
const altitudeMode = this.altitudeMode_;
|
||||
const lines = text.split(NEWLINE_RE);
|
||||
/** @type {Object.<string, string>} */
|
||||
/** @type {Object<string, string>} */
|
||||
const properties = {};
|
||||
const flatCoordinates = [];
|
||||
let year = 2000;
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -64,9 +64,9 @@ 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)}
|
||||
* @type {function((module:ol/geom/Geometry|Object<string,*>)=)|
|
||||
* 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,14 +17,14 @@ import {pushParseAndPop, makeStructureNS} from '../xml.js';
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Array.<null>}
|
||||
* @type {Array<null>}
|
||||
*/
|
||||
const NAMESPACE_URIS = [null];
|
||||
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const WAY_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -35,7 +35,7 @@ const WAY_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -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]];
|
||||
@@ -123,7 +123,7 @@ class OSMXML extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const NODE_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -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,14 +9,14 @@ 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'];
|
||||
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -56,7 +56,7 @@ class OWS extends XML {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const ADDRESS_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -71,7 +71,7 @@ const ADDRESS_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const ALLOWED_VALUES_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -81,7 +81,7 @@ const ALLOWED_VALUES_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const CONSTRAINT_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -91,7 +91,7 @@ const CONSTRAINT_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const CONTACT_INFO_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -102,7 +102,7 @@ const CONTACT_INFO_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const DCP_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -112,7 +112,7 @@ const DCP_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const HTTP_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -123,7 +123,7 @@ const HTTP_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const OPERATION_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -133,7 +133,7 @@ const OPERATION_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const OPERATIONS_METADATA_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -143,7 +143,7 @@ const OPERATIONS_METADATA_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const PHONE_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -154,7 +154,7 @@ const PHONE_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const REQUEST_METHOD_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -164,7 +164,7 @@ const REQUEST_METHOD_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const SERVICE_CONTACT_PARSERS =
|
||||
makeStructureNS(
|
||||
@@ -177,7 +177,7 @@ const SERVICE_CONTACT_PARSERS =
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const SERVICE_IDENTIFICATION_PARSERS =
|
||||
makeStructureNS(
|
||||
@@ -193,7 +193,7 @@ const SERVICE_IDENTIFICATION_PARSERS =
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const SERVICE_PROVIDER_PARSERS =
|
||||
makeStructureNS(
|
||||
@@ -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_;
|
||||
@@ -157,7 +157,7 @@ class TopoJSON extends JSONFeature {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, function(TopoJSONGeometry, Array, ...Array): module:ol/geom/Geometry>}
|
||||
* @type {Object<string, function(TopoJSONGeometry, Array, ...Array): module:ol/geom/Geometry>}
|
||||
*/
|
||||
const GEOMETRY_READERS = {
|
||||
'Point': readPointGeometry,
|
||||
@@ -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];
|
||||
|
||||
@@ -18,7 +18,7 @@ import {createElementNS, isDocument, isNode, makeArrayPusher, makeChildAppender,
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const FEATURE_COLLECTION_PARSERS = {
|
||||
'http://www.opengis.net/gml': {
|
||||
@@ -30,7 +30,7 @@ const FEATURE_COLLECTION_PARSERS = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const TRANSACTION_SUMMARY_PARSERS = {
|
||||
'http://www.opengis.net/wfs': {
|
||||
@@ -43,7 +43,7 @@ const TRANSACTION_SUMMARY_PARSERS = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const TRANSACTION_RESPONSE_PARSERS = {
|
||||
'http://www.opengis.net/wfs': {
|
||||
@@ -56,7 +56,7 @@ const TRANSACTION_RESPONSE_PARSERS = {
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
*/
|
||||
const QUERY_SERIALIZERS = {
|
||||
'http://www.opengis.net/wfs': {
|
||||
@@ -66,7 +66,7 @@ const QUERY_SERIALIZERS = {
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
*/
|
||||
const TRANSACTION_SERIALIZERS = {
|
||||
'http://www.opengis.net/wfs': {
|
||||
@@ -81,8 +81,8 @@ 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 {Object<string, string>|string} [featureNS] The namespace URI used for features.
|
||||
* @property {Array<string>|string} [featureType] The feature type to parse. Only used for read operations.
|
||||
* @property {module:ol/format/GMLBase} [gmlFormat] The GML format to use to parse the response. Default is `ol/format/GML3`.
|
||||
* @property {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
|
||||
*/
|
||||
|
||||
|
||||
@@ -178,7 +178,7 @@ const FESNS = 'http://www.opengis.net/fes';
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object.<string, string>}
|
||||
* @type {Object<string, string>}
|
||||
*/
|
||||
const SCHEMA_LOCATIONS = {
|
||||
'1.1.0': 'http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd',
|
||||
@@ -214,13 +214,13 @@ class WFS extends XMLFeature {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<string>|string|undefined}
|
||||
* @type {Array<string>|string|undefined}
|
||||
*/
|
||||
this.featureType_ = options.featureType;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Object.<string, string>|string|undefined}
|
||||
* @type {Object<string, string>|string|undefined}
|
||||
*/
|
||||
this.featureNS_ = options.featureNS;
|
||||
|
||||
@@ -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) {
|
||||
@@ -549,7 +549,7 @@ function readTransactionSummary(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const OGC_FID_PARSERS = {
|
||||
'http://www.opengis.net/ogc': {
|
||||
@@ -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);
|
||||
@@ -571,7 +571,7 @@ function fidParser(node, objectStack) {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const INSERT_RESULTS_PARSERS = {
|
||||
'http://www.opengis.net/wfs': {
|
||||
@@ -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) {
|
||||
@@ -751,7 +751,7 @@ function writeNative(node, nativeElement, objectStack) {
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||
*/
|
||||
const GETFEATURE_SERIALIZERS = {
|
||||
'http://www.opengis.net/wfs': {
|
||||
@@ -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]);
|
||||
|
||||
@@ -85,7 +85,7 @@ const TokenType = {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, string>}
|
||||
* @type {Object<string, string>}
|
||||
*/
|
||||
const WKTGeometryType = {};
|
||||
for (const type in GeometryType) {
|
||||
@@ -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_() {
|
||||
@@ -838,7 +838,7 @@ function encodeGeometryLayout(geom) {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, function(module:ol/geom/Geometry): string>}
|
||||
* @type {Object<string, function(module:ol/geom/Geometry): string>}
|
||||
*/
|
||||
const GeometryEncoder = {
|
||||
'Point': encodePointGeometry,
|
||||
|
||||
@@ -10,7 +10,7 @@ import {makeArrayPusher, makeObjectPropertyPusher, makeObjectPropertySetter,
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Array.<null|string>}
|
||||
* @type {Array<null|string>}
|
||||
*/
|
||||
const NAMESPACE_URIS = [
|
||||
null,
|
||||
@@ -20,7 +20,7 @@ const NAMESPACE_URIS = [
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -31,7 +31,7 @@ const PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const CAPABILITY_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -84,7 +84,7 @@ class WMSCapabilities extends XML {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const SERVICE_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -104,7 +104,7 @@ const SERVICE_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const CONTACT_INFORMATION_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -119,7 +119,7 @@ const CONTACT_INFORMATION_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const CONTACT_PERSON_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -130,7 +130,7 @@ const CONTACT_PERSON_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const CONTACT_ADDRESS_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -145,7 +145,7 @@ const CONTACT_ADDRESS_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const EXCEPTION_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -155,7 +155,7 @@ const EXCEPTION_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const LAYER_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -182,7 +182,7 @@ const LAYER_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const ATTRIBUTION_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -194,7 +194,7 @@ const ATTRIBUTION_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const EX_GEOGRAPHIC_BOUNDING_BOX_PARSERS =
|
||||
makeStructureNS(NAMESPACE_URIS, {
|
||||
@@ -207,7 +207,7 @@ const EX_GEOGRAPHIC_BOUNDING_BOX_PARSERS =
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const REQUEST_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -219,7 +219,7 @@ const REQUEST_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const OPERATIONTYPE_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -230,7 +230,7 @@ const OPERATIONTYPE_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const DCPTYPE_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -240,7 +240,7 @@ const DCPTYPE_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const HTTP_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -251,7 +251,7 @@ const HTTP_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const STYLE_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -266,7 +266,7 @@ const STYLE_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const FORMAT_ONLINERESOURCE_PARSERS =
|
||||
makeStructureNS(NAMESPACE_URIS, {
|
||||
@@ -277,7 +277,7 @@ const FORMAT_ONLINERESOURCE_PARSERS =
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const KEYWORDLIST_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -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,11 +425,11 @@ 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) {
|
||||
const parentLayerObject = /** @type {!Object.<string,*>} */ (objectStack[objectStack.length - 1]);
|
||||
const parentLayerObject = /** @type {!Object<string,*>} */ (objectStack[objectStack.length - 1]);
|
||||
|
||||
const layerObject = pushParseAndPop({}, LAYER_PARSERS, 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,
|
||||
@@ -32,7 +32,7 @@ const OWS_NAMESPACE_URIS = [
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -87,7 +87,7 @@ class WMTSCapabilities extends XML {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const CONTENTS_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -98,7 +98,7 @@ const CONTENTS_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const LAYER_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -117,7 +117,7 @@ const LAYER_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const STYLE_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -130,7 +130,7 @@ const STYLE_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const TMS_LINKS_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -140,7 +140,7 @@ const TMS_LINKS_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const TMS_LIMITS_LIST_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -150,7 +150,7 @@ const TMS_LIMITS_LIST_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const TMS_LIMITS_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -164,7 +164,7 @@ const TMS_LIMITS_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const DIMENSION_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -177,7 +177,7 @@ const DIMENSION_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const WGS84_BBOX_READERS = makeStructureNS(
|
||||
OWS_NAMESPACE_URIS, {
|
||||
@@ -188,7 +188,7 @@ const WGS84_BBOX_READERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const TMS_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -202,7 +202,7 @@ const TMS_PARSERS = makeStructureNS(
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||
*/
|
||||
const TM_PARSERS = makeStructureNS(
|
||||
NAMESPACE_URIS, {
|
||||
@@ -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);
|
||||
|
||||
@@ -47,7 +47,7 @@ class Geometry extends BaseObject {
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {Object.<string, module:ol/geom/Geometry>}
|
||||
* @type {Object<string, module:ol/geom/Geometry>}
|
||||
*/
|
||||
this.simplifiedGeometryCache = {};
|
||||
|
||||
|
||||
@@ -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,14 +25,14 @@ 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>} */
|
||||
/** @type {!Object<string, boolean>} */
|
||||
const fractions = {};
|
||||
|
||||
let maxIterations = 1e5;
|
||||
@@ -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 : [];
|
||||
|
||||
@@ -77,7 +77,7 @@ export {default as Translate} from './interaction/Translate.js';
|
||||
*
|
||||
* @param {module:ol/interaction/Interaction~DefaultsOptions=} opt_options
|
||||
* Defaults options.
|
||||
* @return {module:ol/Collection.<module:ol/interaction/Interaction>}
|
||||
* @return {module:ol/Collection<module:ol/interaction/Interaction>}
|
||||
* A collection of interactions to be used with the {@link module:ol/Map~Map}
|
||||
* constructor's `interactions` option.
|
||||
* @api
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -37,7 +37,7 @@ import {createEditingStyle} from '../style/Style.js';
|
||||
* actually add a point/vertex to the geometry being drawn. The default of `6`
|
||||
* was chosen for the draw interaction to behave correctly on mouse as well as
|
||||
* on touch devices.
|
||||
* @property {module:ol/Collection.<module:ol/Feature>} [features]
|
||||
* @property {module:ol/Collection<module:ol/Feature>} [features]
|
||||
* Destination collection for the drawn features.
|
||||
* @property {module:ol/source/Vector} [source] Destination source for
|
||||
* the drawn features.
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -208,7 +208,7 @@ class Draw extends PointerInteraction {
|
||||
|
||||
/**
|
||||
* Target collection for drawn features.
|
||||
* @type {module:ol/Collection.<module:ol/Feature>}
|
||||
* @type {module:ol/Collection<module:ol/Feature>}
|
||||
* @private
|
||||
*/
|
||||
this.features_ = options.features ? options.features : null;
|
||||
@@ -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,13 +87,13 @@ 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
|
||||
* features to modify. If a vector source is not provided, a feature collection
|
||||
* must be provided with the features option.
|
||||
* @property {module:ol/Collection.<module:ol/Feature>} [features]
|
||||
* @property {module:ol/Collection<module:ol/Feature>} [features]
|
||||
* The features the interaction works on. If a feature collection is not
|
||||
* provided, a vector source must be provided with the source option.
|
||||
* @property {boolean} [wrapX=false] Wrap the world horizontally on the sketch
|
||||
@@ -109,7 +109,7 @@ const ModifyEventType = {
|
||||
export class ModifyEvent extends Event {
|
||||
/**
|
||||
* @param {ModifyEventType} type Type.
|
||||
* @param {module:ol/Collection.<module:ol/Feature>} features
|
||||
* @param {module:ol/Collection<module:ol/Feature>} features
|
||||
* The features modified.
|
||||
* @param {module:ol/MapBrowserPointerEvent} mapBrowserPointerEvent
|
||||
* Associated {@link module:ol/MapBrowserPointerEvent}.
|
||||
@@ -119,7 +119,7 @@ export class ModifyEvent extends Event {
|
||||
|
||||
/**
|
||||
* The features being modified.
|
||||
* @type {module:ol/Collection.<module:ol/Feature>}
|
||||
* @type {module:ol/Collection<module:ol/Feature>}
|
||||
* @api
|
||||
*/
|
||||
this.features = features;
|
||||
@@ -203,7 +203,7 @@ class Modify extends PointerInteraction {
|
||||
|
||||
/**
|
||||
* Segments intersecting {@link this.vertexFeature_} by segment uid.
|
||||
* @type {Object.<string, boolean>}
|
||||
* @type {Object<string, boolean>}
|
||||
* @private
|
||||
*/
|
||||
this.vertexSegments_ = null;
|
||||
@@ -230,7 +230,7 @@ class Modify extends PointerInteraction {
|
||||
|
||||
/**
|
||||
* Segment RTree for each layer
|
||||
* @type {module:ol/structs/RBush.<module:ol/interaction/Modify~SegmentData>}
|
||||
* @type {module:ol/structs/RBush<module:ol/interaction/Modify~SegmentData>}
|
||||
* @private
|
||||
*/
|
||||
this.rBush_ = new RBush();
|
||||
@@ -281,7 +281,7 @@ class Modify extends PointerInteraction {
|
||||
/**
|
||||
* @const
|
||||
* @private
|
||||
* @type {!Object.<string, function(module:ol/Feature, module:ol/geom/Geometry)>}
|
||||
* @type {!Object<string, function(module:ol/Feature, module:ol/geom/Geometry)>}
|
||||
*/
|
||||
this.SEGMENT_WRITERS_ = {
|
||||
'Point': this.writePointGeometry_,
|
||||
@@ -318,7 +318,7 @@ class Modify extends PointerInteraction {
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {module:ol/Collection.<module:ol/Feature>}
|
||||
* @type {module:ol/Collection<module:ol/Feature>}
|
||||
* @private
|
||||
*/
|
||||
this.features_ = features;
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -130,13 +130,13 @@ class PointerInteraction extends Interaction {
|
||||
this.stopDown = options.stopDown ? options.stopDown : stopDown;
|
||||
|
||||
/**
|
||||
* @type {!Object.<string, module:ol/pointer/PointerEvent>}
|
||||
* @type {!Object<string, module:ol/pointer/PointerEvent>}
|
||||
* @private
|
||||
*/
|
||||
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
|
||||
@@ -80,7 +80,7 @@ const SelectEventType = {
|
||||
* @property {boolean} [multi=false] A boolean that determines if the default
|
||||
* behaviour should select only single features or all (overlapping) features at
|
||||
* the clicked map position. The default of `false` means single select.
|
||||
* @property {module:ol/Collection.<module:ol/Feature>} [features]
|
||||
* @property {module:ol/Collection<module:ol/Feature>} [features]
|
||||
* Collection where the interaction will place selected features. Optional. If
|
||||
* not set the interaction will create a collection. In any case the collection
|
||||
* used by the interaction is returned by
|
||||
@@ -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;
|
||||
@@ -251,7 +251,7 @@ class Select extends Interaction {
|
||||
* An association between selected feature (key)
|
||||
* and layer (value)
|
||||
* @private
|
||||
* @type {Object.<number, module:ol/layer/Layer>}
|
||||
* @type {Object<number, module:ol/layer/Layer>}
|
||||
*/
|
||||
this.featureLayerAssociation_ = {};
|
||||
|
||||
@@ -275,7 +275,7 @@ class Select extends Interaction {
|
||||
|
||||
/**
|
||||
* Get the selected features.
|
||||
* @return {module:ol/Collection.<module:ol/Feature>} Features collection.
|
||||
* @return {module:ol/Collection<module:ol/Feature>} Features collection.
|
||||
* @api
|
||||
*/
|
||||
getFeatures() {
|
||||
|
||||
@@ -29,13 +29,13 @@ 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
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {Object} Options
|
||||
* @property {module:ol/Collection.<module:ol/Feature>} [features] Snap to these features. Either this option or source should be provided.
|
||||
* @property {module:ol/Collection<module:ol/Feature>} [features] Snap to these features. Either this option or source should be provided.
|
||||
* @property {boolean} [edge=true] Snap to edges.
|
||||
* @property {boolean} [vertex=true] Snap to vertices.
|
||||
* @property {number} [pixelTolerance=10] Pixel tolerance for considering the pointer close enough to a segment or
|
||||
@@ -99,19 +99,19 @@ class Snap extends PointerInteraction {
|
||||
this.edge_ = options.edge !== undefined ? options.edge : true;
|
||||
|
||||
/**
|
||||
* @type {module:ol/Collection.<module:ol/Feature>}
|
||||
* @type {module:ol/Collection<module:ol/Feature>}
|
||||
* @private
|
||||
*/
|
||||
this.features_ = options.features ? options.features : null;
|
||||
|
||||
/**
|
||||
* @type {Array.<module:ol/events~EventsKey>}
|
||||
* @type {Array<module:ol/events~EventsKey>}
|
||||
* @private
|
||||
*/
|
||||
this.featuresListenerKeys_ = [];
|
||||
|
||||
/**
|
||||
* @type {Object.<number, module:ol/events~EventsKey>}
|
||||
* @type {Object<number, module:ol/events~EventsKey>}
|
||||
* @private
|
||||
*/
|
||||
this.featureChangeListenerKeys_ = {};
|
||||
@@ -119,7 +119,7 @@ class Snap extends PointerInteraction {
|
||||
/**
|
||||
* Extents are preserved so indexed segment can be quickly removed
|
||||
* when its feature geometry changes
|
||||
* @type {Object.<number, module:ol/extent~Extent>}
|
||||
* @type {Object<number, module:ol/extent~Extent>}
|
||||
* @private
|
||||
*/
|
||||
this.indexedFeaturesExtents_ = {};
|
||||
@@ -128,7 +128,7 @@ class Snap extends PointerInteraction {
|
||||
* If a feature geometry changes while a pointer drag|move event occurs, the
|
||||
* feature doesn't get updated right away. It will be at the next 'pointerup'
|
||||
* event fired.
|
||||
* @type {!Object.<number, module:ol/Feature>}
|
||||
* @type {!Object<number, module:ol/Feature>}
|
||||
* @private
|
||||
*/
|
||||
this.pendingFeatures_ = {};
|
||||
@@ -156,7 +156,7 @@ class Snap extends PointerInteraction {
|
||||
|
||||
/**
|
||||
* Segment RTree for each layer
|
||||
* @type {module:ol/structs/RBush.<module:ol/interaction/Snap~SegmentData>}
|
||||
* @type {module:ol/structs/RBush<module:ol/interaction/Snap~SegmentData>}
|
||||
* @private
|
||||
*/
|
||||
this.rBush_ = new RBush();
|
||||
@@ -165,7 +165,7 @@ class Snap extends PointerInteraction {
|
||||
/**
|
||||
* @const
|
||||
* @private
|
||||
* @type {Object.<string, function(module:ol/Feature, module:ol/geom/Geometry)>}
|
||||
* @type {Object<string, function(module:ol/Feature, module:ol/geom/Geometry)>}
|
||||
*/
|
||||
this.SEGMENT_WRITERS_ = {
|
||||
'Point': this.writePointGeometry_,
|
||||
@@ -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)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -38,9 +38,9 @@ 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
|
||||
* @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
|
||||
@@ -59,7 +59,7 @@ const TranslateEventType = {
|
||||
export class TranslateEvent extends Event {
|
||||
/**
|
||||
* @param {module:ol/interaction/Translate~TranslateEventType} type Type.
|
||||
* @param {module:ol/Collection.<module:ol/Feature>} features The features translated.
|
||||
* @param {module:ol/Collection<module:ol/Feature>} features The features translated.
|
||||
* @param {module:ol/coordinate~Coordinate} coordinate The event coordinate.
|
||||
*/
|
||||
constructor(type, features, coordinate) {
|
||||
@@ -68,7 +68,7 @@ export class TranslateEvent extends Event {
|
||||
|
||||
/**
|
||||
* The features being translated.
|
||||
* @type {module:ol/Collection.<module:ol/Feature>}
|
||||
* @type {module:ol/Collection<module:ol/Feature>}
|
||||
* @api
|
||||
*/
|
||||
this.features = features;
|
||||
@@ -116,7 +116,7 @@ class Translate extends PointerInteraction {
|
||||
|
||||
|
||||
/**
|
||||
* @type {module:ol/Collection.<module:ol/Feature>}
|
||||
* @type {module:ol/Collection<module:ol/Feature>}
|
||||
* @private
|
||||
*/
|
||||
this.features_ = options.features !== undefined ? options.features : null;
|
||||
|
||||
@@ -41,7 +41,7 @@ class BaseLayer extends BaseObject {
|
||||
super();
|
||||
|
||||
/**
|
||||
* @type {Object.<string, *>}
|
||||
* @type {Object<string, *>}
|
||||
*/
|
||||
const properties = assign({}, options);
|
||||
properties[LayerProperty.OPACITY] =
|
||||
@@ -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) {}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user