Use Array<Foo> instead of Array.<Foo>
This commit is contained in:
@@ -168,9 +168,9 @@ function generateSourceFiles(sourceFiles) {
|
|||||||
* for display purposes. This function mutates the original arrays.
|
* for display purposes. This function mutates the original arrays.
|
||||||
*
|
*
|
||||||
* @private
|
* @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.
|
* 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) {
|
function attachModuleSymbols(doclets, modules) {
|
||||||
const symbols = {};
|
const symbols = {};
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ const twoPi = 2 * Math.PI;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert an RGB pixel into an HCL pixel.
|
* Convert an RGB pixel into an HCL pixel.
|
||||||
* @param {Array.<number>} pixel A pixel in RGB space.
|
* @param {Array<number>} pixel A pixel in RGB space.
|
||||||
* @return {Array.<number>} A pixel in HCL space.
|
* @return {Array<number>} A pixel in HCL space.
|
||||||
*/
|
*/
|
||||||
function rgb2hcl(pixel) {
|
function rgb2hcl(pixel) {
|
||||||
const red = rgb2xyz(pixel[0]);
|
const red = rgb2xyz(pixel[0]);
|
||||||
@@ -55,8 +55,8 @@ function rgb2hcl(pixel) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert an HCL pixel into an RGB pixel.
|
* Convert an HCL pixel into an RGB pixel.
|
||||||
* @param {Array.<number>} pixel A pixel in HCL space.
|
* @param {Array<number>} pixel A pixel in HCL space.
|
||||||
* @return {Array.<number>} A pixel in RGB space.
|
* @return {Array<number>} A pixel in RGB space.
|
||||||
*/
|
*/
|
||||||
function hcl2rgb(pixel) {
|
function hcl2rgb(pixel) {
|
||||||
const h = pixel[0];
|
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
|
* Apply a convolution kernel to canvas. This works for any size kernel, but
|
||||||
* performance starts degrading above 3 x 3.
|
* performance starts degrading above 3 x 3.
|
||||||
* @param {CanvasRenderingContext2D} context Canvas 2d context.
|
* @param {CanvasRenderingContext2D} context Canvas 2d context.
|
||||||
* @param {Array.<number>} kernel Kernel.
|
* @param {Array<number>} kernel Kernel.
|
||||||
*/
|
*/
|
||||||
function convolve(context, kernel) {
|
function convolve(context, kernel) {
|
||||||
const canvas = context.canvas;
|
const canvas = context.canvas;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ const bins = 10;
|
|||||||
/**
|
/**
|
||||||
* Calculate the Vegetation Greenness Index (VGI) from an input pixel. This
|
* Calculate the Vegetation Greenness Index (VGI) from an input pixel. This
|
||||||
* is a rough estimate assuming that pixel values correspond to reflectance.
|
* 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.
|
* @return {number} The VGI value for the given pixel.
|
||||||
*/
|
*/
|
||||||
function vgi(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
|
* Generates a shaded relief image given elevation data. Uses a 3x3
|
||||||
* neighborhood for determining slope and aspect.
|
* 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.
|
* @param {Object} data Data added in the "beforeoperations" event.
|
||||||
* @return {ImageData} Output image.
|
* @return {ImageData} Output image.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ handlebars.registerHelper('indent', (text, options) => {
|
|||||||
* Create an inverted index of keywords from examples. Property names are
|
* Create an inverted index of keywords from examples. Property names are
|
||||||
* lowercased words. Property values are objects mapping example index to word
|
* lowercased words. Property values are objects mapping example index to word
|
||||||
* count.
|
* count.
|
||||||
* @param {Array.<Object>} exampleData Array of example data objects.
|
* @param {Array<Object>} exampleData Array of example data objects.
|
||||||
* @return {Object} Word index.
|
* @return {Object} Word index.
|
||||||
*/
|
*/
|
||||||
function createWordIndex(exampleData) {
|
function createWordIndex(exampleData) {
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ export class CollectionEvent extends Event {
|
|||||||
class Collection extends BaseObject {
|
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.
|
* @param {module:ol/Collection~Options=} opt_options Collection options.
|
||||||
*/
|
*/
|
||||||
constructor(opt_array, opt_options) {
|
constructor(opt_array, opt_options) {
|
||||||
@@ -79,7 +79,7 @@ class Collection extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {!Array.<T>}
|
* @type {!Array<T>}
|
||||||
*/
|
*/
|
||||||
this.array_ = opt_array ? opt_array : [];
|
this.array_ = opt_array ? opt_array : [];
|
||||||
|
|
||||||
@@ -106,7 +106,7 @@ class Collection extends BaseObject {
|
|||||||
/**
|
/**
|
||||||
* Add elements to the collection. This pushes each item in the provided array
|
* Add elements to the collection. This pushes each item in the provided array
|
||||||
* to the end of the collection.
|
* to the end of the collection.
|
||||||
* @param {!Array.<T>} arr Array.
|
* @param {!Array<T>} arr Array.
|
||||||
* @return {module:ol/Collection.<T>} This collection.
|
* @return {module:ol/Collection.<T>} This collection.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -119,7 +119,7 @@ class Collection extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Iterate over each element, calling the provided callback.
|
* 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
|
* for every element. This function takes 3 arguments (the element, the
|
||||||
* index and the array). The return value is ignored.
|
* index and the array). The return value is ignored.
|
||||||
* @api
|
* @api
|
||||||
@@ -136,7 +136,7 @@ class Collection extends BaseObject {
|
|||||||
* is mutated, no events will be dispatched by the collection, and the
|
* 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
|
* collection's "length" property won't be in sync with the actual length
|
||||||
* of the array.
|
* of the array.
|
||||||
* @return {!Array.<T>} Array.
|
* @return {!Array<T>} Array.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getArray() {
|
getArray() {
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ class Feature extends BaseObject {
|
|||||||
/**
|
/**
|
||||||
* User provided style.
|
* User provided style.
|
||||||
* @private
|
* @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;
|
this.style_ = null;
|
||||||
|
|
||||||
@@ -170,7 +170,7 @@ class Feature extends BaseObject {
|
|||||||
/**
|
/**
|
||||||
* Get the feature's style. Will return what was provided to the
|
* Get the feature's style. Will return what was provided to the
|
||||||
* {@link module:ol/Feature~Feature#setStyle} method.
|
* {@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
|
* @api
|
||||||
*/
|
*/
|
||||||
getStyle() {
|
getStyle() {
|
||||||
@@ -225,7 +225,7 @@ class Feature extends BaseObject {
|
|||||||
* Set the style for the feature. This can be a single style object, an array
|
* 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
|
* 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).
|
* 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
|
* @api
|
||||||
* @fires module:ol/events/Event~Event#event:change
|
* @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
|
* Convert the provided object into a feature style function. Functions passed
|
||||||
* through unchanged. Arrays of module:ol/style/Style or single style objects wrapped
|
* through unchanged. Arrays of module:ol/style/Style or single style objects wrapped
|
||||||
* in a new feature style function.
|
* 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.
|
* A feature style function, a single style, or an array of styles.
|
||||||
* @return {module:ol/style/Style~StyleFunction} A style function.
|
* @return {module:ol/style/Style~StyleFunction} A style function.
|
||||||
*/
|
*/
|
||||||
@@ -282,7 +282,7 @@ export function createStyleFunction(obj) {
|
|||||||
return obj;
|
return obj;
|
||||||
} else {
|
} else {
|
||||||
/**
|
/**
|
||||||
* @type {Array.<module:ol/style/Style>}
|
* @type {Array<module:ol/style/Style>}
|
||||||
*/
|
*/
|
||||||
let styles;
|
let styles;
|
||||||
if (Array.isArray(obj)) {
|
if (Array.isArray(obj)) {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ const DEFAULT_STROKE_STYLE = new Stroke({
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO can be configurable
|
* TODO can be configurable
|
||||||
* @type {Array.<number>}
|
* @type {Array<number>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
const INTERVALS = [
|
const INTERVALS = [
|
||||||
@@ -200,13 +200,13 @@ class Graticule {
|
|||||||
this.maxLines_ = options.maxLines !== undefined ? options.maxLines : 100;
|
this.maxLines_ = options.maxLines !== undefined ? options.maxLines : 100;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Array.<module:ol/geom/LineString>}
|
* @type {Array<module:ol/geom/LineString>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.meridians_ = [];
|
this.meridians_ = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Array.<module:ol/geom/LineString>}
|
* @type {Array<module:ol/geom/LineString>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.parallels_ = [];
|
this.parallels_ = [];
|
||||||
@@ -236,13 +236,13 @@ class Graticule {
|
|||||||
this.projectionCenterLonLat_ = null;
|
this.projectionCenterLonLat_ = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Array.<module:ol/Graticule~GraticuleLabelDataType>}
|
* @type {Array<module:ol/Graticule~GraticuleLabelDataType>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.meridiansLabels_ = null;
|
this.meridiansLabels_ = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Array.<module:ol/Graticule~GraticuleLabelDataType>}
|
* @type {Array<module:ol/Graticule~GraticuleLabelDataType>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.parallelsLabels_ = null;
|
this.parallelsLabels_ = null;
|
||||||
@@ -526,9 +526,9 @@ class Graticule {
|
|||||||
const centerLat = this.projectionCenterLonLat_[1];
|
const centerLat = this.projectionCenterLonLat_[1];
|
||||||
let interval = -1;
|
let interval = -1;
|
||||||
const target = Math.pow(this.targetSize_ * resolution, 2);
|
const target = Math.pow(this.targetSize_ * resolution, 2);
|
||||||
/** @type {Array.<number>} **/
|
/** @type {Array<number>} **/
|
||||||
const p1 = [];
|
const p1 = [];
|
||||||
/** @type {Array.<number>} **/
|
/** @type {Array<number>} **/
|
||||||
const p2 = [];
|
const p2 = [];
|
||||||
for (let i = 0, ii = INTERVALS.length; i < ii; ++i) {
|
for (let i = 0, ii = INTERVALS.length; i < ii; ++i) {
|
||||||
const delta = INTERVALS[i] / 2;
|
const delta = INTERVALS[i] / 2;
|
||||||
@@ -579,7 +579,7 @@ class Graticule {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the list of meridians. Meridians are lines of equal longitude.
|
* 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
|
* @api
|
||||||
*/
|
*/
|
||||||
getMeridians() {
|
getMeridians() {
|
||||||
@@ -609,7 +609,7 @@ class Graticule {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the list of parallels. Parallels are lines of equal latitude.
|
* 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
|
* @api
|
||||||
*/
|
*/
|
||||||
getParallels() {
|
getParallels() {
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ class ImageWrapper extends ImageBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array.<module:ol/events~EventsKey>}
|
* @type {Array<module:ol/events~EventsKey>}
|
||||||
*/
|
*/
|
||||||
this.imageListenerKeys_ = null;
|
this.imageListenerKeys_ = null;
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ class ImageTile extends Tile {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array.<module:ol/events~EventsKey>}
|
* @type {Array<module:ol/events~EventsKey>}
|
||||||
*/
|
*/
|
||||||
this.imageListenerKeys_ = null;
|
this.imageListenerKeys_ = null;
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class Kinetic {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array.<number>}
|
* @type {Array<number>}
|
||||||
*/
|
*/
|
||||||
this.points_ = [];
|
this.points_ = [];
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class MapBrowserEventHandler extends EventTarget {
|
|||||||
this.dragging_ = false;
|
this.dragging_ = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {!Array.<module:ol/events~EventsKey>}
|
* @type {!Array<module:ol/events~EventsKey>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.dragListenerKeys_ = [];
|
this.dragListenerKeys_ = [];
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ class BaseObject extends Observable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a list of object property names.
|
* Get a list of object property names.
|
||||||
* @return {Array.<string>} List of property names.
|
* @return {Array<string>} List of property names.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getKeys() {
|
getKeys() {
|
||||||
|
|||||||
@@ -50,9 +50,9 @@ class Observable extends EventTarget {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Listen for a certain type of event.
|
* 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.
|
* @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
|
* called with an array of event types as the first argument, the return
|
||||||
* will be an array of keys.
|
* will be an array of keys.
|
||||||
* @api
|
* @api
|
||||||
@@ -72,9 +72,9 @@ class Observable extends EventTarget {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Listen once for a certain type of event.
|
* 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.
|
* @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
|
* called with an array of event types as the first argument, the return
|
||||||
* will be an array of keys.
|
* will be an array of keys.
|
||||||
* @api
|
* @api
|
||||||
@@ -94,7 +94,7 @@ class Observable extends EventTarget {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Unlisten for a certain type of event.
|
* 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.
|
* @param {function(?): ?} listener The listener function.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -113,7 +113,7 @@ class Observable extends EventTarget {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes an event listener using the key returned by `on()` or `once()`.
|
* 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).
|
* or `once()` (or an array of keys).
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import {containsExtent} from './extent.js';
|
|||||||
* @property {number|string} [id] Set the overlay id. The overlay id can be used
|
* @property {number|string} [id] Set the overlay id. The overlay id can be used
|
||||||
* with the {@link module:ol/Map~Map#getOverlayById} method.
|
* with the {@link module:ol/Map~Map#getOverlayById} method.
|
||||||
* @property {HTMLElement} [element] The overlay element.
|
* @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
|
* the overlay. The first element in the
|
||||||
* array is the horizontal offset. A positive value shifts the overlay right.
|
* 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
|
* 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.
|
* Get the offset of this overlay.
|
||||||
* @return {Array.<number>} The offset.
|
* @return {Array<number>} The offset.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getOffset() {
|
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.
|
* Set the offset for this overlay.
|
||||||
* @param {Array.<number>} offset Offset.
|
* @param {Array<number>} offset Offset.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -42,14 +42,14 @@ import {create as createTransform, apply as applyTransform} from './transform.js
|
|||||||
* @property {module:ol/coordinate~Coordinate} focus
|
* @property {module:ol/coordinate~Coordinate} focus
|
||||||
* @property {number} index
|
* @property {number} index
|
||||||
* @property {Object.<number, module:ol/layer/Layer~State>} layerStates
|
* @property {Object.<number, module:ol/layer/Layer~State>} layerStates
|
||||||
* @property {Array.<module:ol/layer/Layer~State>} layerStatesArray
|
* @property {Array<module:ol/layer/Layer~State>} layerStatesArray
|
||||||
* @property {module:ol/transform~Transform} pixelToCoordinateTransform
|
* @property {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 {module:ol/size~Size} size
|
||||||
* @property {!Object.<string, boolean>} skippedFeatureUids
|
* @property {!Object.<string, boolean>} skippedFeatureUids
|
||||||
* @property {module:ol/TileQueue} tileQueue
|
* @property {module:ol/TileQueue} tileQueue
|
||||||
* @property {Object.<string, Object.<string, module:ol/TileRange>>} usedTiles
|
* @property {Object.<string, Object.<string, module:ol/TileRange>>} usedTiles
|
||||||
* @property {Array.<number>} viewHints
|
* @property {Array<number>} viewHints
|
||||||
* @property {!Object.<string, Object.<string, boolean>>} wantedTiles
|
* @property {!Object.<string, Object.<string, boolean>>} wantedTiles
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -85,12 +85,12 @@ import {create as createTransform, apply as applyTransform} from './transform.js
|
|||||||
/**
|
/**
|
||||||
* Object literal with config options for the map.
|
* Object literal with config options for the map.
|
||||||
* @typedef {Object} MapOptions
|
* @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,
|
* Controls initially added to the map. If not specified,
|
||||||
* {@link module:ol/control/util~defaults} is used.
|
* {@link module:ol/control/util~defaults} is used.
|
||||||
* @property {number} [pixelRatio=window.devicePixelRatio] The ratio between
|
* @property {number} [pixelRatio=window.devicePixelRatio] The ratio between
|
||||||
* physical pixels and device-independent pixels (dips) on the device.
|
* 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,
|
* Interactions that are initially added to the map. If not specified,
|
||||||
* {@link module:ol/interaction~defaults} is used.
|
* {@link module:ol/interaction~defaults} is used.
|
||||||
* @property {HTMLElement|Document|string} [keyboardEventTarget] The element to
|
* @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
|
* 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
|
* `document`, the target element needs to be focused for key events to be
|
||||||
* emitted, requiring that the target element has a `tabindex` attribute.
|
* 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
|
* 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,
|
* 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
|
* 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
|
* @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.
|
* 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.
|
* 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.
|
* Overlays initially added to the map. By default, no overlays are added.
|
||||||
* @property {HTMLElement|string} [target] The container for the map, either the
|
* @property {HTMLElement|string} [target] The container for the map, either the
|
||||||
* element itself or the `id` of the element. If not specified at construction
|
* element itself or the `id` of the element. If not specified at construction
|
||||||
@@ -236,7 +236,7 @@ class PluggableMap extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array.<module:ol/events~EventsKey>}
|
* @type {Array<module:ol/events~EventsKey>}
|
||||||
*/
|
*/
|
||||||
this.layerGroupPropertyListenerKeys_ = null;
|
this.layerGroupPropertyListenerKeys_ = null;
|
||||||
|
|
||||||
@@ -301,7 +301,7 @@ class PluggableMap extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array.<module:ol/events~EventsKey>}
|
* @type {Array<module:ol/events~EventsKey>}
|
||||||
*/
|
*/
|
||||||
this.keyHandlerKeys_ = null;
|
this.keyHandlerKeys_ = null;
|
||||||
|
|
||||||
@@ -354,7 +354,7 @@ class PluggableMap extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {!Array.<module:ol/PluggableMap~PostRenderFunction>}
|
* @type {!Array<module:ol/PluggableMap~PostRenderFunction>}
|
||||||
*/
|
*/
|
||||||
this.postRenderFunctions_ = [];
|
this.postRenderFunctions_ = [];
|
||||||
|
|
||||||
@@ -577,7 +577,7 @@ class PluggableMap extends BaseObject {
|
|||||||
* Get all features that intersect a pixel on the viewport.
|
* Get all features that intersect a pixel on the viewport.
|
||||||
* @param {module:ol/pixel~Pixel} pixel Pixel.
|
* @param {module:ol/pixel~Pixel} pixel Pixel.
|
||||||
* @param {module:ol/PluggableMap~AtPixelOptions=} opt_options Optional options.
|
* @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.
|
* `null` if none were found.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ class VectorImageTile extends Tile {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Keys of source tiles used by this tile. Use with {@link #getTile}.
|
* Keys of source tiles used by this tile. Use with {@link #getTile}.
|
||||||
* @type {Array.<string>}
|
* @type {Array<string>}
|
||||||
*/
|
*/
|
||||||
this.tileKeys = [];
|
this.tileKeys = [];
|
||||||
|
|
||||||
@@ -95,12 +95,12 @@ class VectorImageTile extends Tile {
|
|||||||
this.wrappedTileCoord = urlTileCoord;
|
this.wrappedTileCoord = urlTileCoord;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Array.<module:ol/events~EventsKey>}
|
* @type {Array<module:ol/events~EventsKey>}
|
||||||
*/
|
*/
|
||||||
this.loadListenerKeys_ = [];
|
this.loadListenerKeys_ = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Array.<module:ol/events~EventsKey>}
|
* @type {Array<module:ol/events~EventsKey>}
|
||||||
*/
|
*/
|
||||||
this.sourceTileListenerKeys_ = [];
|
this.sourceTileListenerKeys_ = [];
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ class VectorTile extends Tile {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array.<module:ol/Feature>}
|
* @type {Array<module:ol/Feature>}
|
||||||
*/
|
*/
|
||||||
this.features_ = null;
|
this.features_ = null;
|
||||||
|
|
||||||
@@ -120,7 +120,7 @@ class VectorTile extends Tile {
|
|||||||
/**
|
/**
|
||||||
* Get the features for this tile. Geometries will be in the projection returned
|
* Get the features for this tile. Geometries will be in the projection returned
|
||||||
* by {@link module:ol/VectorTile~VectorTile#getProjection}.
|
* 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
|
* @api
|
||||||
*/
|
*/
|
||||||
getFeatures() {
|
getFeatures() {
|
||||||
@@ -166,7 +166,7 @@ class VectorTile extends Tile {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Handler for successful tile load.
|
* 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/proj/Projection} dataProjection Data projection.
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @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`.
|
* Function for use in an {@link module:ol/source/VectorTile~VectorTile}'s `tileLoadFunction`.
|
||||||
* Sets the features for the tile.
|
* Sets the features for the tile.
|
||||||
* @param {Array.<module:ol/Feature>} features Features.
|
* @param {Array<module:ol/Feature>} features Features.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
setFeatures(features) {
|
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
|
* @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
|
* 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.
|
* 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
|
* cleared inside the view. Values in the array are top, right, bottom and left
|
||||||
* padding.
|
* padding.
|
||||||
* @property {boolean} [constrainResolution=true] Constrain the resolution.
|
* @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
|
* 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
|
* fetched if neither this nor `zoom` are defined, but they can be set later
|
||||||
* with {@link #setZoom} or {@link #setResolution}.
|
* 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`,
|
* resolution constraint. If set the `maxResolution`, `minResolution`,
|
||||||
* `minZoom`, `maxZoom`, and `zoomFactor` options are ignored.
|
* `minZoom`, `maxZoom`, and `zoomFactor` options are ignored.
|
||||||
* @property {number} [rotation=0] The initial rotation for the view in radians
|
* @property {number} [rotation=0] The initial rotation for the view in radians
|
||||||
@@ -238,13 +238,13 @@ class View extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array.<number>}
|
* @type {Array<number>}
|
||||||
*/
|
*/
|
||||||
this.hints_ = [0, 0];
|
this.hints_ = [0, 0];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array.<Array.<module:ol/View~Animation>>}
|
* @type {Array<Array<module:ol/View~Animation>>}
|
||||||
*/
|
*/
|
||||||
this.animations_ = [];
|
this.animations_ = [];
|
||||||
|
|
||||||
@@ -301,7 +301,7 @@ class View extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array.<number>|undefined}
|
* @type {Array<number>|undefined}
|
||||||
*/
|
*/
|
||||||
this.resolutions_ = options.resolutions;
|
this.resolutions_ = options.resolutions;
|
||||||
|
|
||||||
@@ -710,8 +710,8 @@ class View extends BaseObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array.<number>=} opt_hints Destination array.
|
* @param {Array<number>=} opt_hints Destination array.
|
||||||
* @return {Array.<number>} Hint.
|
* @return {Array<number>} Hint.
|
||||||
*/
|
*/
|
||||||
getHints(opt_hints) {
|
getHints(opt_hints) {
|
||||||
if (opt_hints !== undefined) {
|
if (opt_hints !== undefined) {
|
||||||
@@ -821,7 +821,7 @@ class View extends BaseObject {
|
|||||||
/**
|
/**
|
||||||
* Get the resolutions for the view. This returns the array of resolutions
|
* 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.
|
* 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
|
* @api
|
||||||
*/
|
*/
|
||||||
getResolutions() {
|
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.
|
* 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
|
* 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 {*} needle The item to look for.
|
||||||
* @param {Function=} opt_comparator Comparator function.
|
* @param {Function=} opt_comparator Comparator function.
|
||||||
* @return {number} The index of the item if found, -1 if not.
|
* @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.
|
* 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.
|
* @param {*} obj The object for which to test.
|
||||||
* @return {boolean} The object is in the array.
|
* @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} target Target.
|
||||||
* @param {number} direction 0 means return the nearest, > 0
|
* @param {number} direction 0 means return the nearest, > 0
|
||||||
* means return the largest nearest, < 0 means return the
|
* 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} begin Begin index.
|
||||||
* @param {number} end End 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>} arr The array to modify.
|
||||||
* @param {!Array.<VALUE>|VALUE} data The elements or arrays of elements to add to arr.
|
* @param {!Array<VALUE>|VALUE} data The elements or arrays of elements to add to arr.
|
||||||
* @template VALUE
|
* @template VALUE
|
||||||
*/
|
*/
|
||||||
export function extend(arr, data) {
|
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.
|
* @param {VALUE} obj The element to remove.
|
||||||
* @template VALUE
|
* @template VALUE
|
||||||
* @return {boolean} If the element was removed.
|
* @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.
|
* @param {function(VALUE, number, ?) : boolean} func The function to compare.
|
||||||
* @template VALUE
|
* @template VALUE
|
||||||
* @return {VALUE|null} The element found or null.
|
* @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.
|
* @param {Function} compareFnc Comparison function.
|
||||||
*/
|
*/
|
||||||
export function stableSort(arr, compareFnc) {
|
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.
|
* @param {Function} func Comparison function.
|
||||||
* @return {number} Return index.
|
* @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 {Function=} opt_func Comparison function.
|
||||||
* @param {boolean=} opt_strict Strictly sorted (default false).
|
* @param {boolean=} opt_strict Strictly sorted (default false).
|
||||||
* @return {boolean} Return index.
|
* @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.
|
* 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
|
* alpha should be a float in the range 0..1 inclusive. If no alpha value is
|
||||||
* given then `1` will be used.
|
* given then `1` will be used.
|
||||||
* @typedef {Array.<number>} Color
|
* @typedef {Array<number>} Color
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ class Attribution extends Control {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* A list of currently rendered resolutions.
|
* A list of currently rendered resolutions.
|
||||||
* @type {Array.<string>}
|
* @type {Array<string>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.renderedAttributions_ = [];
|
this.renderedAttributions_ = [];
|
||||||
@@ -147,7 +147,7 @@ class Attribution extends Control {
|
|||||||
/**
|
/**
|
||||||
* Get a list of visible attributions.
|
* Get a list of visible attributions.
|
||||||
* @param {module:ol/PluggableMap~FrameState} frameState Frame state.
|
* @param {module:ol/PluggableMap~FrameState} frameState Frame state.
|
||||||
* @return {Array.<string>} Attributions.
|
* @return {Array<string>} Attributions.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
getSourceAttributions_(frameState) {
|
getSourceAttributions_(frameState) {
|
||||||
@@ -159,7 +159,7 @@ class Attribution extends Control {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* A list of visible attributions.
|
* A list of visible attributions.
|
||||||
* @type {Array.<string>}
|
* @type {Array<string>}
|
||||||
*/
|
*/
|
||||||
const visibleAttributions = [];
|
const visibleAttributions = [];
|
||||||
|
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ class Control extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @protected
|
* @protected
|
||||||
* @type {!Array.<module:ol/events~EventsKey>}
|
* @type {!Array<module:ol/events~EventsKey>}
|
||||||
*/
|
*/
|
||||||
this.listenerKeys = [];
|
this.listenerKeys = [];
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ const MIN_RATIO = 0.1;
|
|||||||
* @property {boolean} [collapsible=true] Whether the control can be collapsed or not.
|
* @property {boolean} [collapsible=true] Whether the control can be collapsed or not.
|
||||||
* @property {string|HTMLElement} [label='»'] Text label to use for the collapsed
|
* @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.
|
* 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
|
* Layers for the overview map. If not set, then all main map layers are used
|
||||||
* instead.
|
* instead.
|
||||||
* @property {function(module:ol/MapEvent)} [render] Function called when the control
|
* @property {function(module:ol/MapEvent)} [render] Function called when the control
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export const Units = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Array.<number>}
|
* @type {Array<number>}
|
||||||
*/
|
*/
|
||||||
const LEADING_DIGITS = [1, 2, 5];
|
const LEADING_DIGITS = [1, 2, 5];
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import {padNumber} from './string.js';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* An array of numbers representing an xy coordinate. Example: `[16, 48]`.
|
* An array of numbers representing an xy coordinate. Example: `[16, 48]`.
|
||||||
* @typedef {Array.<number>} Coordinate
|
* @typedef {Array<number>} Coordinate
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -82,7 +82,7 @@ export function closestOnCircle(coordinate, circle) {
|
|||||||
* is outside the segment.
|
* is outside the segment.
|
||||||
*
|
*
|
||||||
* @param {module:ol/coordinate~Coordinate} coordinate The coordinate.
|
* @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.
|
* of the segment.
|
||||||
* @return {module:ol/coordinate~Coordinate} The foot of the perpendicular of
|
* @return {module:ol/coordinate~Coordinate} The foot of the perpendicular of
|
||||||
* the coordinate to the segment.
|
* 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.
|
* Calculate the squared distance from a coordinate to a line segment.
|
||||||
*
|
*
|
||||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate of the point.
|
* @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).
|
* coordinates).
|
||||||
* @return {number} Squared distance from the point to the line segment.
|
* @return {number} Squared distance from the point to the line segment.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ export function findListener(listeners, listener, opt_this, opt_setDeleteIndex)
|
|||||||
/**
|
/**
|
||||||
* @param {module:ol/events/EventTarget~EventTargetLike} target Target.
|
* @param {module:ol/events/EventTarget~EventTargetLike} target Target.
|
||||||
* @param {string} type Type.
|
* @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) {
|
export function getListeners(target, type) {
|
||||||
const listenerMap = target.ol_lm;
|
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
|
* Get the lookup of listeners. If one does not exist on the target, it is
|
||||||
* created.
|
* created.
|
||||||
* @param {module:ol/events/EventTarget~EventTargetLike} target Target.
|
* @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.
|
* listeners by event type.
|
||||||
*/
|
*/
|
||||||
function getListenerMap(target) {
|
function getListenerMap(target) {
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ class EventTarget extends Disposable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {!Object.<string, Array.<module:ol/events~ListenerFunction>>}
|
* @type {!Object.<string, Array<module:ol/events~ListenerFunction>>}
|
||||||
*/
|
*/
|
||||||
this.listeners_ = {};
|
this.listeners_ = {};
|
||||||
|
|
||||||
@@ -122,7 +122,7 @@ class EventTarget extends Disposable {
|
|||||||
* order that they will be called in.
|
* order that they will be called in.
|
||||||
*
|
*
|
||||||
* @param {string} type Type.
|
* @param {string} type Type.
|
||||||
* @return {Array.<module:ol/events~ListenerFunction>} Listeners.
|
* @return {Array<module:ol/events~ListenerFunction>} Listeners.
|
||||||
*/
|
*/
|
||||||
getListeners(type) {
|
getListeners(type) {
|
||||||
return this.listeners_[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]`.
|
* An array of numbers representing an extent: `[minx, miny, maxx, maxy]`.
|
||||||
* @typedef {Array.<number>} Extent
|
* @typedef {Array<number>} Extent
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build an extent that includes all given coordinates.
|
* 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.
|
* @return {module:ol/extent~Extent} Bounding extent.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -29,8 +29,8 @@ export function boundingExtent(coordinates) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array.<number>} xs Xs.
|
* @param {Array<number>} xs Xs.
|
||||||
* @param {Array.<number>} ys Ys.
|
* @param {Array<number>} ys Ys.
|
||||||
* @param {module:ol/extent~Extent=} opt_extent Destination extent.
|
* @param {module:ol/extent~Extent=} opt_extent Destination extent.
|
||||||
* @private
|
* @private
|
||||||
* @return {module:ol/extent~Extent} Extent.
|
* @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.
|
* @param {module:ol/extent~Extent=} opt_extent Extent.
|
||||||
* @return {module:ol/extent~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} offset Offset.
|
||||||
* @param {number} end End.
|
* @param {number} end End.
|
||||||
* @param {number} stride Stride.
|
* @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.
|
* @param {module:ol/extent~Extent=} opt_extent Extent.
|
||||||
* @return {module:ol/extent~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 {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.
|
* @return {module:ol/extent~Extent} Extent.
|
||||||
*/
|
*/
|
||||||
export function extendCoordinates(extent, coordinates) {
|
export function extendCoordinates(extent, coordinates) {
|
||||||
@@ -355,7 +355,7 @@ export function extendCoordinates(extent, coordinates) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @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} offset Offset.
|
||||||
* @param {number} end End.
|
* @param {number} end End.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
@@ -371,7 +371,7 @@ export function extendFlatCoordinates(extent, flatCoordinates, offset, end, stri
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @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.
|
* @return {module:ol/extent~Extent} Extent.
|
||||||
*/
|
*/
|
||||||
export function extendRings(extent, rings) {
|
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 {string|module:ol/featureloader~FeatureUrlFunction} url Feature URL service.
|
||||||
* @param {module:ol/format/Feature} format Feature format.
|
* @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
|
* Function called with the loaded features and optionally with the data
|
||||||
* projection. Called with the vector tile or source as `this`.
|
* projection. Called with the vector tile or source as `this`.
|
||||||
* @param {function(this:module:ol/VectorTile)|function(this:module:ol/source/Vector)} failure
|
* @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) {
|
export function xhr(url, format) {
|
||||||
return loadFeaturesXhr(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
|
* @param {module:ol/proj/Projection} dataProjection Data
|
||||||
* projection.
|
* projection.
|
||||||
* @this {module:ol/source/Vector}
|
* @this {module:ol/source/Vector}
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ class EsriJSON extends JSONFeature {
|
|||||||
const options = opt_options ? opt_options : {};
|
const options = opt_options ? opt_options : {};
|
||||||
if (esriJSONObject.features) {
|
if (esriJSONObject.features) {
|
||||||
const esriJSONFeatureCollection = /** @type {EsriJSONFeatureCollection} */ (object);
|
const esriJSONFeatureCollection = /** @type {EsriJSONFeatureCollection} */ (object);
|
||||||
/** @type {Array.<module:ol/Feature>} */
|
/** @type {Array<module:ol/Feature>} */
|
||||||
const features = [];
|
const features = [];
|
||||||
const esriJSONFeatures = esriJSONFeatureCollection.features;
|
const esriJSONFeatures = esriJSONFeatureCollection.features;
|
||||||
options.idField = object.objectIdFieldName;
|
options.idField = object.objectIdFieldName;
|
||||||
@@ -188,7 +188,7 @@ class EsriJSON extends JSONFeature {
|
|||||||
/**
|
/**
|
||||||
* Encode an array of features as a EsriJSON object.
|
* 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.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||||
* @return {Object} EsriJSON Object.
|
* @return {Object} EsriJSON Object.
|
||||||
* @override
|
* @override
|
||||||
@@ -252,9 +252,9 @@ function readGeometry(object, opt_options) {
|
|||||||
* Checks if any polygons in this array contain any other polygons in this
|
* Checks if any polygons in this array contain any other polygons in this
|
||||||
* array. It is used for checking for holes.
|
* array. It is used for checking for holes.
|
||||||
* Logic inspired by: https://github.com/Esri/terraformer-arcgis-parser
|
* 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.
|
* @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) {
|
function convertRings(rings, layout) {
|
||||||
const flatRing = [];
|
const flatRing = [];
|
||||||
@@ -376,7 +376,7 @@ function readMultiPointGeometry(object) {
|
|||||||
function readMultiPolygonGeometry(object) {
|
function readMultiPolygonGeometry(object) {
|
||||||
const layout = getGeometryLayout(object);
|
const layout = getGeometryLayout(object);
|
||||||
return new MultiPolygon(
|
return new MultiPolygon(
|
||||||
/** @type {Array.<Array.<Array.<Array.<number>>>>} */(object.rings),
|
/** @type {Array<Array<Array<Array<number>>>>} */(object.rings),
|
||||||
layout);
|
layout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ class FeatureFormat {
|
|||||||
* @abstract
|
* @abstract
|
||||||
* @param {Document|Node|ArrayBuffer|Object|string} source Source.
|
* @param {Document|Node|ArrayBuffer|Object|string} source Source.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
* @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) {}
|
readFeatures(source, opt_options) {}
|
||||||
|
|
||||||
@@ -178,7 +178,7 @@ class FeatureFormat {
|
|||||||
* Encode an array of features in this format.
|
* Encode an array of features in this format.
|
||||||
*
|
*
|
||||||
* @abstract
|
* @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.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||||
* @return {string} Result.
|
* @return {string} Result.
|
||||||
*/
|
*/
|
||||||
@@ -234,8 +234,8 @@ export function transformWithOptions(geometry, write, opt_options) {
|
|||||||
const power = Math.pow(10, opt_options.decimals);
|
const power = Math.pow(10, opt_options.decimals);
|
||||||
// if decimals option on write, round each coordinate appropriately
|
// if decimals option on write, round each coordinate appropriately
|
||||||
/**
|
/**
|
||||||
* @param {Array.<number>} coordinates Coordinates.
|
* @param {Array<number>} coordinates Coordinates.
|
||||||
* @return {Array.<number>} Transformed coordinates.
|
* @return {Array<number>} Transformed coordinates.
|
||||||
*/
|
*/
|
||||||
const transform = function(coordinates) {
|
const transform = function(coordinates) {
|
||||||
for (let i = 0, ii = coordinates.length; i < ii; ++i) {
|
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.
|
* Encode an array of features in GML 3.1.1 Simple Features.
|
||||||
*
|
*
|
||||||
* @function
|
* @function
|
||||||
* @param {Array.<module:ol/Feature>} features Features.
|
* @param {Array<module:ol/Feature>} features Features.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
||||||
* @return {string} Result.
|
* @return {string} Result.
|
||||||
* @api
|
* @api
|
||||||
@@ -32,7 +32,7 @@ GML.prototype.writeFeatures;
|
|||||||
* Encode an array of features in the GML 3.1.1 format as an XML node.
|
* Encode an array of features in the GML 3.1.1 format as an XML node.
|
||||||
*
|
*
|
||||||
* @function
|
* @function
|
||||||
* @param {Array.<module:ol/Feature>} features Features.
|
* @param {Array<module:ol/Feature>} features Features.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
||||||
* @return {Node} Node.
|
* @return {Node} Node.
|
||||||
* @api
|
* @api
|
||||||
|
|||||||
@@ -63,9 +63,9 @@ class GML2 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {Array.<number>|undefined} Flat coordinates.
|
* @return {Array<number>|undefined} Flat coordinates.
|
||||||
*/
|
*/
|
||||||
readFlatCoordinates_(node, objectStack) {
|
readFlatCoordinates_(node, objectStack) {
|
||||||
const s = getAllTextContent(node, false).replace(/^\s*|\s*$/g, '');
|
const s = getAllTextContent(node, false).replace(/^\s*|\s*$/g, '');
|
||||||
@@ -96,12 +96,12 @@ class GML2 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {module:ol/extent~Extent|undefined} Envelope.
|
* @return {module:ol/extent~Extent|undefined} Envelope.
|
||||||
*/
|
*/
|
||||||
readBox_(node, objectStack) {
|
readBox_(node, objectStack) {
|
||||||
/** @type {Array.<number>} */
|
/** @type {Array<number>} */
|
||||||
const flatCoordinates = pushParseAndPop([null],
|
const flatCoordinates = pushParseAndPop([null],
|
||||||
this.BOX_PARSERS_, node, objectStack, this);
|
this.BOX_PARSERS_, node, objectStack, this);
|
||||||
return createOrUpdate(flatCoordinates[1][0],
|
return createOrUpdate(flatCoordinates[1][0],
|
||||||
@@ -111,15 +111,15 @@ class GML2 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
innerBoundaryIsParser_(node, objectStack) {
|
innerBoundaryIsParser_(node, objectStack) {
|
||||||
/** @type {Array.<number>|undefined} */
|
/** @type {Array<number>|undefined} */
|
||||||
const flatLinearRing = pushParseAndPop(undefined,
|
const flatLinearRing = pushParseAndPop(undefined,
|
||||||
this.RING_PARSERS, node, objectStack, this);
|
this.RING_PARSERS, node, objectStack, this);
|
||||||
if (flatLinearRing) {
|
if (flatLinearRing) {
|
||||||
const flatLinearRings = /** @type {Array.<Array.<number>>} */
|
const flatLinearRings = /** @type {Array<Array<number>>} */
|
||||||
(objectStack[objectStack.length - 1]);
|
(objectStack[objectStack.length - 1]);
|
||||||
flatLinearRings.push(flatLinearRing);
|
flatLinearRings.push(flatLinearRing);
|
||||||
}
|
}
|
||||||
@@ -127,15 +127,15 @@ class GML2 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
outerBoundaryIsParser_(node, objectStack) {
|
outerBoundaryIsParser_(node, objectStack) {
|
||||||
/** @type {Array.<number>|undefined} */
|
/** @type {Array<number>|undefined} */
|
||||||
const flatLinearRing = pushParseAndPop(undefined,
|
const flatLinearRing = pushParseAndPop(undefined,
|
||||||
this.RING_PARSERS, node, objectStack, this);
|
this.RING_PARSERS, node, objectStack, this);
|
||||||
if (flatLinearRing) {
|
if (flatLinearRing) {
|
||||||
const flatLinearRings = /** @type {Array.<Array.<number>>} */
|
const flatLinearRings = /** @type {Array<Array<number>>} */
|
||||||
(objectStack[objectStack.length - 1]);
|
(objectStack[objectStack.length - 1]);
|
||||||
flatLinearRings[0] = flatLinearRing;
|
flatLinearRings[0] = flatLinearRing;
|
||||||
}
|
}
|
||||||
@@ -144,7 +144,7 @@ class GML2 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @param {*} value Value.
|
* @param {*} value Value.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @param {string=} opt_nodeName Node name.
|
* @param {string=} opt_nodeName Node name.
|
||||||
* @return {Node|undefined} Node.
|
* @return {Node|undefined} Node.
|
||||||
* @private
|
* @private
|
||||||
@@ -174,7 +174,7 @@ class GML2 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/Feature} feature Feature.
|
* @param {module:ol/Feature} feature Feature.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
writeFeatureElement(node, feature, objectStack) {
|
writeFeatureElement(node, feature, objectStack) {
|
||||||
const fid = feature.getId();
|
const fid = feature.getId();
|
||||||
@@ -220,7 +220,7 @@ class GML2 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/LineString} geometry LineString geometry.
|
* @param {module:ol/geom/LineString} geometry LineString geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeCurveOrLineString_(node, geometry, objectStack) {
|
writeCurveOrLineString_(node, geometry, objectStack) {
|
||||||
@@ -245,7 +245,7 @@ class GML2 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/LineString} line LineString geometry.
|
* @param {module:ol/geom/LineString} line LineString geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeLineStringOrCurveMember_(node, line, objectStack) {
|
writeLineStringOrCurveMember_(node, line, objectStack) {
|
||||||
@@ -259,7 +259,7 @@ class GML2 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/MultiLineString} geometry MultiLineString geometry.
|
* @param {module:ol/geom/MultiLineString} geometry MultiLineString geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeMultiCurveOrLineString_(node, geometry, objectStack) {
|
writeMultiCurveOrLineString_(node, geometry, objectStack) {
|
||||||
@@ -280,7 +280,7 @@ class GML2 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/Geometry|module:ol/extent~Extent} geometry Geometry.
|
* @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) {
|
writeGeometryElement(node, geometry, objectStack) {
|
||||||
const context = /** @type {module:ol/format/Feature~WriteOptions} */ (objectStack[objectStack.length - 1]);
|
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 {Node} node Node.
|
||||||
* @param {module:ol/geom/LineString|module:ol/geom/LinearRing} value Geometry.
|
* @param {module:ol/geom/LineString|module:ol/geom/LinearRing} value Geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeCoordinates_(node, value, objectStack) {
|
writeCoordinates_(node, value, objectStack) {
|
||||||
@@ -341,7 +341,7 @@ class GML2 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/LineString} line LineString geometry.
|
* @param {module:ol/geom/LineString} line LineString geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeCurveSegments_(node, line, objectStack) {
|
writeCurveSegments_(node, line, objectStack) {
|
||||||
@@ -353,7 +353,7 @@ class GML2 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/Polygon} geometry Polygon geometry.
|
* @param {module:ol/geom/Polygon} geometry Polygon geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeSurfaceOrPolygon_(node, geometry, objectStack) {
|
writeSurfaceOrPolygon_(node, geometry, objectStack) {
|
||||||
@@ -380,7 +380,7 @@ class GML2 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {*} value Value.
|
* @param {*} value Value.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @param {string=} opt_nodeName Node name.
|
* @param {string=} opt_nodeName Node name.
|
||||||
* @return {Node} Node.
|
* @return {Node} Node.
|
||||||
* @private
|
* @private
|
||||||
@@ -399,7 +399,7 @@ class GML2 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/Polygon} polygon Polygon geometry.
|
* @param {module:ol/geom/Polygon} polygon Polygon geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeSurfacePatches_(node, polygon, objectStack) {
|
writeSurfacePatches_(node, polygon, objectStack) {
|
||||||
@@ -411,7 +411,7 @@ class GML2 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/LinearRing} ring LinearRing geometry.
|
* @param {module:ol/geom/LinearRing} ring LinearRing geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeRing_(node, ring, objectStack) {
|
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 {string=} opt_srsName Optional srsName
|
||||||
* @param {boolean=} opt_hasZ whether the geometry has a Z coordinate (is 3D) or not.
|
* @param {boolean=} opt_hasZ whether the geometry has a Z coordinate (is 3D) or not.
|
||||||
* @return {string} The coords string.
|
* @return {string} The coords string.
|
||||||
@@ -447,7 +447,7 @@ class GML2 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/Point} geometry Point geometry.
|
* @param {module:ol/geom/Point} geometry Point geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writePoint_(node, geometry, objectStack) {
|
writePoint_(node, geometry, objectStack) {
|
||||||
@@ -467,7 +467,7 @@ class GML2 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/MultiPoint} geometry MultiPoint geometry.
|
* @param {module:ol/geom/MultiPoint} geometry MultiPoint geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeMultiPoint_(node, geometry, objectStack) {
|
writeMultiPoint_(node, geometry, objectStack) {
|
||||||
@@ -487,7 +487,7 @@ class GML2 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/Point} point Point geometry.
|
* @param {module:ol/geom/Point} point Point geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writePointMember_(node, point, objectStack) {
|
writePointMember_(node, point, objectStack) {
|
||||||
@@ -499,7 +499,7 @@ class GML2 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/LinearRing} geometry LinearRing geometry.
|
* @param {module:ol/geom/LinearRing} geometry LinearRing geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeLinearRing_(node, geometry, objectStack) {
|
writeLinearRing_(node, geometry, objectStack) {
|
||||||
@@ -516,7 +516,7 @@ class GML2 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/MultiPolygon} geometry MultiPolygon geometry.
|
* @param {module:ol/geom/MultiPolygon} geometry MultiPolygon geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeMultiSurfaceOrPolygon_(node, geometry, objectStack) {
|
writeMultiSurfaceOrPolygon_(node, geometry, objectStack) {
|
||||||
@@ -537,7 +537,7 @@ class GML2 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/Polygon} polygon Polygon geometry.
|
* @param {module:ol/geom/Polygon} polygon Polygon geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeSurfaceOrPolygonMember_(node, polygon, objectStack) {
|
writeSurfaceOrPolygonMember_(node, polygon, objectStack) {
|
||||||
@@ -552,7 +552,7 @@ class GML2 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {module:ol/extent~Extent} extent Extent.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeEnvelope(node, extent, objectStack) {
|
writeEnvelope(node, extent, objectStack) {
|
||||||
@@ -573,7 +573,7 @@ class GML2 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @param {*} value Value.
|
* @param {*} value Value.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @param {string=} opt_nodeName Node name.
|
* @param {string=} opt_nodeName Node name.
|
||||||
* @return {Node|undefined} Node.
|
* @return {Node|undefined} Node.
|
||||||
* @private
|
* @private
|
||||||
|
|||||||
@@ -103,12 +103,12 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {module:ol/geom/MultiLineString|undefined} MultiLineString.
|
* @return {module:ol/geom/MultiLineString|undefined} MultiLineString.
|
||||||
*/
|
*/
|
||||||
readMultiCurve_(node, objectStack) {
|
readMultiCurve_(node, objectStack) {
|
||||||
/** @type {Array.<module:ol/geom/LineString>} */
|
/** @type {Array<module:ol/geom/LineString>} */
|
||||||
const lineStrings = pushParseAndPop([],
|
const lineStrings = pushParseAndPop([],
|
||||||
this.MULTICURVE_PARSERS_, node, objectStack, this);
|
this.MULTICURVE_PARSERS_, node, objectStack, this);
|
||||||
if (lineStrings) {
|
if (lineStrings) {
|
||||||
@@ -121,12 +121,12 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {module:ol/geom/MultiPolygon|undefined} MultiPolygon.
|
* @return {module:ol/geom/MultiPolygon|undefined} MultiPolygon.
|
||||||
*/
|
*/
|
||||||
readMultiSurface_(node, objectStack) {
|
readMultiSurface_(node, objectStack) {
|
||||||
/** @type {Array.<module:ol/geom/Polygon>} */
|
/** @type {Array<module:ol/geom/Polygon>} */
|
||||||
const polygons = pushParseAndPop([],
|
const polygons = pushParseAndPop([],
|
||||||
this.MULTISURFACE_PARSERS_, node, objectStack, this);
|
this.MULTISURFACE_PARSERS_, node, objectStack, this);
|
||||||
if (polygons) {
|
if (polygons) {
|
||||||
@@ -136,7 +136,7 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
curveMemberParser_(node, objectStack) {
|
curveMemberParser_(node, objectStack) {
|
||||||
@@ -145,7 +145,7 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
surfaceMemberParser_(node, objectStack) {
|
surfaceMemberParser_(node, objectStack) {
|
||||||
@@ -155,9 +155,9 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {Array.<(Array.<number>)>|undefined} flat coordinates.
|
* @return {Array<(Array<number>)>|undefined} flat coordinates.
|
||||||
*/
|
*/
|
||||||
readPatch_(node, objectStack) {
|
readPatch_(node, objectStack) {
|
||||||
return pushParseAndPop([null],
|
return pushParseAndPop([null],
|
||||||
@@ -166,9 +166,9 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {Array.<number>|undefined} flat coordinates.
|
* @return {Array<number>|undefined} flat coordinates.
|
||||||
*/
|
*/
|
||||||
readSegment_(node, objectStack) {
|
readSegment_(node, objectStack) {
|
||||||
return pushParseAndPop([null],
|
return pushParseAndPop([null],
|
||||||
@@ -177,9 +177,9 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {Array.<(Array.<number>)>|undefined} flat coordinates.
|
* @return {Array<(Array<number>)>|undefined} flat coordinates.
|
||||||
*/
|
*/
|
||||||
readPolygonPatch_(node, objectStack) {
|
readPolygonPatch_(node, objectStack) {
|
||||||
return pushParseAndPop([null],
|
return pushParseAndPop([null],
|
||||||
@@ -188,9 +188,9 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {Array.<number>|undefined} flat coordinates.
|
* @return {Array<number>|undefined} flat coordinates.
|
||||||
*/
|
*/
|
||||||
readLineStringSegment_(node, objectStack) {
|
readLineStringSegment_(node, objectStack) {
|
||||||
return pushParseAndPop([null],
|
return pushParseAndPop([null],
|
||||||
@@ -200,15 +200,15 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
interiorParser_(node, objectStack) {
|
interiorParser_(node, objectStack) {
|
||||||
/** @type {Array.<number>|undefined} */
|
/** @type {Array<number>|undefined} */
|
||||||
const flatLinearRing = pushParseAndPop(undefined,
|
const flatLinearRing = pushParseAndPop(undefined,
|
||||||
this.RING_PARSERS, node, objectStack, this);
|
this.RING_PARSERS, node, objectStack, this);
|
||||||
if (flatLinearRing) {
|
if (flatLinearRing) {
|
||||||
const flatLinearRings = /** @type {Array.<Array.<number>>} */
|
const flatLinearRings = /** @type {Array<Array<number>>} */
|
||||||
(objectStack[objectStack.length - 1]);
|
(objectStack[objectStack.length - 1]);
|
||||||
flatLinearRings.push(flatLinearRing);
|
flatLinearRings.push(flatLinearRing);
|
||||||
}
|
}
|
||||||
@@ -216,15 +216,15 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
exteriorParser_(node, objectStack) {
|
exteriorParser_(node, objectStack) {
|
||||||
/** @type {Array.<number>|undefined} */
|
/** @type {Array<number>|undefined} */
|
||||||
const flatLinearRing = pushParseAndPop(undefined,
|
const flatLinearRing = pushParseAndPop(undefined,
|
||||||
this.RING_PARSERS, node, objectStack, this);
|
this.RING_PARSERS, node, objectStack, this);
|
||||||
if (flatLinearRing) {
|
if (flatLinearRing) {
|
||||||
const flatLinearRings = /** @type {Array.<Array.<number>>} */
|
const flatLinearRings = /** @type {Array<Array<number>>} */
|
||||||
(objectStack[objectStack.length - 1]);
|
(objectStack[objectStack.length - 1]);
|
||||||
flatLinearRings[0] = flatLinearRing;
|
flatLinearRings[0] = flatLinearRing;
|
||||||
}
|
}
|
||||||
@@ -232,12 +232,12 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {module:ol/geom/Polygon|undefined} Polygon.
|
* @return {module:ol/geom/Polygon|undefined} Polygon.
|
||||||
*/
|
*/
|
||||||
readSurface_(node, objectStack) {
|
readSurface_(node, objectStack) {
|
||||||
/** @type {Array.<Array.<number>>} */
|
/** @type {Array<Array<number>>} */
|
||||||
const flatLinearRings = pushParseAndPop([null],
|
const flatLinearRings = pushParseAndPop([null],
|
||||||
this.SURFACE_PARSERS_, node, objectStack, this);
|
this.SURFACE_PARSERS_, node, objectStack, this);
|
||||||
if (flatLinearRings && flatLinearRings[0]) {
|
if (flatLinearRings && flatLinearRings[0]) {
|
||||||
@@ -256,12 +256,12 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {module:ol/geom/LineString|undefined} LineString.
|
* @return {module:ol/geom/LineString|undefined} LineString.
|
||||||
*/
|
*/
|
||||||
readCurve_(node, objectStack) {
|
readCurve_(node, objectStack) {
|
||||||
/** @type {Array.<number>} */
|
/** @type {Array<number>} */
|
||||||
const flatCoordinates = pushParseAndPop([null],
|
const flatCoordinates = pushParseAndPop([null],
|
||||||
this.CURVE_PARSERS_, node, objectStack, this);
|
this.CURVE_PARSERS_, node, objectStack, this);
|
||||||
if (flatCoordinates) {
|
if (flatCoordinates) {
|
||||||
@@ -274,12 +274,12 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {module:ol/extent~Extent|undefined} Envelope.
|
* @return {module:ol/extent~Extent|undefined} Envelope.
|
||||||
*/
|
*/
|
||||||
readEnvelope_(node, objectStack) {
|
readEnvelope_(node, objectStack) {
|
||||||
/** @type {Array.<number>} */
|
/** @type {Array<number>} */
|
||||||
const flatCoordinates = pushParseAndPop([null],
|
const flatCoordinates = pushParseAndPop([null],
|
||||||
this.ENVELOPE_PARSERS_, node, objectStack, this);
|
this.ENVELOPE_PARSERS_, node, objectStack, this);
|
||||||
return createOrUpdate(flatCoordinates[1][0],
|
return createOrUpdate(flatCoordinates[1][0],
|
||||||
@@ -289,14 +289,14 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {Array.<number>|undefined} Flat coordinates.
|
* @return {Array<number>|undefined} Flat coordinates.
|
||||||
*/
|
*/
|
||||||
readFlatPos_(node, objectStack) {
|
readFlatPos_(node, objectStack) {
|
||||||
let s = getAllTextContent(node, false);
|
let s = getAllTextContent(node, false);
|
||||||
const re = /^\s*([+\-]?\d*\.?\d+(?:[eE][+\-]?\d+)?)\s*/;
|
const re = /^\s*([+\-]?\d*\.?\d+(?:[eE][+\-]?\d+)?)\s*/;
|
||||||
/** @type {Array.<number>} */
|
/** @type {Array<number>} */
|
||||||
const flatCoordinates = [];
|
const flatCoordinates = [];
|
||||||
let m;
|
let m;
|
||||||
while ((m = re.exec(s))) {
|
while ((m = re.exec(s))) {
|
||||||
@@ -334,9 +334,9 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {Array.<number>|undefined} Flat coordinates.
|
* @return {Array<number>|undefined} Flat coordinates.
|
||||||
*/
|
*/
|
||||||
readFlatPosList_(node, objectStack) {
|
readFlatPosList_(node, objectStack) {
|
||||||
const s = getAllTextContent(node, false).replace(/^\s*|\s*$/g, '');
|
const s = getAllTextContent(node, false).replace(/^\s*|\s*$/g, '');
|
||||||
@@ -381,7 +381,7 @@ class GML3 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/Point} value Point geometry.
|
* @param {module:ol/geom/Point} value Point geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writePos_(node, value, objectStack) {
|
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 {string=} opt_srsName Optional srsName
|
||||||
* @param {boolean=} opt_hasZ whether the geometry has a Z coordinate (is 3D) or not.
|
* @param {boolean=} opt_hasZ whether the geometry has a Z coordinate (is 3D) or not.
|
||||||
* @return {string} The coords string.
|
* @return {string} The coords string.
|
||||||
@@ -437,7 +437,7 @@ class GML3 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/LineString|module:ol/geom/LinearRing} value Geometry.
|
* @param {module:ol/geom/LineString|module:ol/geom/LinearRing} value Geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writePosList_(node, value, objectStack) {
|
writePosList_(node, value, objectStack) {
|
||||||
@@ -461,7 +461,7 @@ class GML3 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/Point} geometry Point geometry.
|
* @param {module:ol/geom/Point} geometry Point geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writePoint_(node, geometry, objectStack) {
|
writePoint_(node, geometry, objectStack) {
|
||||||
@@ -478,7 +478,7 @@ class GML3 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {module:ol/extent~Extent} extent Extent.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
writeEnvelope(node, extent, objectStack) {
|
writeEnvelope(node, extent, objectStack) {
|
||||||
const context = objectStack[objectStack.length - 1];
|
const context = objectStack[objectStack.length - 1];
|
||||||
@@ -498,7 +498,7 @@ class GML3 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/LinearRing} geometry LinearRing geometry.
|
* @param {module:ol/geom/LinearRing} geometry LinearRing geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeLinearRing_(node, geometry, objectStack) {
|
writeLinearRing_(node, geometry, objectStack) {
|
||||||
@@ -514,7 +514,7 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {*} value Value.
|
* @param {*} value Value.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @param {string=} opt_nodeName Node name.
|
* @param {string=} opt_nodeName Node name.
|
||||||
* @return {Node} Node.
|
* @return {Node} Node.
|
||||||
* @private
|
* @private
|
||||||
@@ -533,7 +533,7 @@ class GML3 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/Polygon} geometry Polygon geometry.
|
* @param {module:ol/geom/Polygon} geometry Polygon geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeSurfaceOrPolygon_(node, geometry, objectStack) {
|
writeSurfaceOrPolygon_(node, geometry, objectStack) {
|
||||||
@@ -561,7 +561,7 @@ class GML3 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/LineString} geometry LineString geometry.
|
* @param {module:ol/geom/LineString} geometry LineString geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeCurveOrLineString_(node, geometry, objectStack) {
|
writeCurveOrLineString_(node, geometry, objectStack) {
|
||||||
@@ -586,7 +586,7 @@ class GML3 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/MultiPolygon} geometry MultiPolygon geometry.
|
* @param {module:ol/geom/MultiPolygon} geometry MultiPolygon geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeMultiSurfaceOrPolygon_(node, geometry, objectStack) {
|
writeMultiSurfaceOrPolygon_(node, geometry, objectStack) {
|
||||||
@@ -607,7 +607,7 @@ class GML3 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/MultiPoint} geometry MultiPoint geometry.
|
* @param {module:ol/geom/MultiPoint} geometry MultiPoint geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeMultiPoint_(node, geometry, objectStack) {
|
writeMultiPoint_(node, geometry, objectStack) {
|
||||||
@@ -627,7 +627,7 @@ class GML3 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/MultiLineString} geometry MultiLineString geometry.
|
* @param {module:ol/geom/MultiLineString} geometry MultiLineString geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeMultiCurveOrLineString_(node, geometry, objectStack) {
|
writeMultiCurveOrLineString_(node, geometry, objectStack) {
|
||||||
@@ -648,7 +648,7 @@ class GML3 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/LinearRing} ring LinearRing geometry.
|
* @param {module:ol/geom/LinearRing} ring LinearRing geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeRing_(node, ring, objectStack) {
|
writeRing_(node, ring, objectStack) {
|
||||||
@@ -660,7 +660,7 @@ class GML3 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/Polygon} polygon Polygon geometry.
|
* @param {module:ol/geom/Polygon} polygon Polygon geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeSurfaceOrPolygonMember_(node, polygon, objectStack) {
|
writeSurfaceOrPolygonMember_(node, polygon, objectStack) {
|
||||||
@@ -675,7 +675,7 @@ class GML3 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/Point} point Point geometry.
|
* @param {module:ol/geom/Point} point Point geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writePointMember_(node, point, objectStack) {
|
writePointMember_(node, point, objectStack) {
|
||||||
@@ -687,7 +687,7 @@ class GML3 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/LineString} line LineString geometry.
|
* @param {module:ol/geom/LineString} line LineString geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeLineStringOrCurveMember_(node, line, objectStack) {
|
writeLineStringOrCurveMember_(node, line, objectStack) {
|
||||||
@@ -701,7 +701,7 @@ class GML3 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/Polygon} polygon Polygon geometry.
|
* @param {module:ol/geom/Polygon} polygon Polygon geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeSurfacePatches_(node, polygon, objectStack) {
|
writeSurfacePatches_(node, polygon, objectStack) {
|
||||||
@@ -713,7 +713,7 @@ class GML3 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/LineString} line LineString geometry.
|
* @param {module:ol/geom/LineString} line LineString geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeCurveSegments_(node, line, objectStack) {
|
writeCurveSegments_(node, line, objectStack) {
|
||||||
@@ -726,7 +726,7 @@ class GML3 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/Geometry|module:ol/extent~Extent} geometry Geometry.
|
* @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) {
|
writeGeometryElement(node, geometry, objectStack) {
|
||||||
const context = /** @type {module:ol/format/Feature~WriteOptions} */ (objectStack[objectStack.length - 1]);
|
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 {Node} node Node.
|
||||||
* @param {module:ol/Feature} feature Feature.
|
* @param {module:ol/Feature} feature Feature.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
writeFeatureElement(node, feature, objectStack) {
|
writeFeatureElement(node, feature, objectStack) {
|
||||||
const fid = feature.getId();
|
const fid = feature.getId();
|
||||||
@@ -797,8 +797,8 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<module:ol/Feature>} features Features.
|
* @param {Array<module:ol/Feature>} features Features.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeFeatureMembers_(node, features, objectStack) {
|
writeFeatureMembers_(node, features, objectStack) {
|
||||||
@@ -821,7 +821,7 @@ class GML3 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @param {*} value Value.
|
* @param {*} value Value.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @param {string=} opt_nodeName Node name.
|
* @param {string=} opt_nodeName Node name.
|
||||||
* @return {Node|undefined} Node.
|
* @return {Node|undefined} Node.
|
||||||
* @private
|
* @private
|
||||||
@@ -835,7 +835,7 @@ class GML3 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @param {*} value Value.
|
* @param {*} value Value.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @param {string=} opt_nodeName Node name.
|
* @param {string=} opt_nodeName Node name.
|
||||||
* @return {Node|undefined} Node.
|
* @return {Node|undefined} Node.
|
||||||
* @private
|
* @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.
|
* 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.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
||||||
* @return {Node} Node.
|
* @return {Node} Node.
|
||||||
* @override
|
* @override
|
||||||
@@ -1100,7 +1100,7 @@ GML3.prototype.SEGMENTS_PARSERS_ = {
|
|||||||
* Encode an array of features in GML 3.1.1 Simple Features.
|
* Encode an array of features in GML 3.1.1 Simple Features.
|
||||||
*
|
*
|
||||||
* @function
|
* @function
|
||||||
* @param {Array.<module:ol/Feature>} features Features.
|
* @param {Array<module:ol/Feature>} features Features.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
||||||
* @return {string} Result.
|
* @return {string} Result.
|
||||||
* @api
|
* @api
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ const ONLY_WHITESPACE_RE = /^[\s\xa0]*$/;
|
|||||||
* feature namespaces themselves. So for instance there might be a featureType
|
* 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
|
* 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`.
|
* `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
|
* If multiple feature types need to be configured
|
||||||
* which come from different feature namespaces, `featureNS` will be an object
|
* which come from different feature namespaces, `featureNS` will be an object
|
||||||
* with the keys being the prefixes used in the entries of featureType array.
|
* with the keys being the prefixes used in the entries of featureType array.
|
||||||
@@ -96,7 +96,7 @@ class GMLBase extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @protected
|
* @protected
|
||||||
* @type {Array.<string>|string|undefined}
|
* @type {Array<string>|string|undefined}
|
||||||
*/
|
*/
|
||||||
this.featureType = options.featureType;
|
this.featureType = options.featureType;
|
||||||
|
|
||||||
@@ -131,8 +131,8 @@ class GMLBase extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Array.<module:ol/Feature> | undefined} Features.
|
* @return {Array<module:ol/Feature> | undefined} Features.
|
||||||
*/
|
*/
|
||||||
readFeaturesInternal(node, objectStack) {
|
readFeaturesInternal(node, objectStack) {
|
||||||
const localName = node.localName;
|
const localName = node.localName;
|
||||||
@@ -219,7 +219,7 @@ class GMLBase extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/geom/Geometry|undefined} Geometry.
|
* @return {module:ol/geom/Geometry|undefined} Geometry.
|
||||||
*/
|
*/
|
||||||
readGeometryElement(node, objectStack) {
|
readGeometryElement(node, objectStack) {
|
||||||
@@ -239,7 +239,7 @@ class GMLBase extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/Feature} Feature.
|
* @return {module:ol/Feature} Feature.
|
||||||
*/
|
*/
|
||||||
readFeatureElement(node, objectStack) {
|
readFeatureElement(node, objectStack) {
|
||||||
@@ -280,7 +280,7 @@ class GMLBase extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/geom/Point|undefined} Point.
|
* @return {module:ol/geom/Point|undefined} Point.
|
||||||
*/
|
*/
|
||||||
readPoint(node, objectStack) {
|
readPoint(node, objectStack) {
|
||||||
@@ -292,11 +292,11 @@ class GMLBase extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/geom/MultiPoint|undefined} MultiPoint.
|
* @return {module:ol/geom/MultiPoint|undefined} MultiPoint.
|
||||||
*/
|
*/
|
||||||
readMultiPoint(node, objectStack) {
|
readMultiPoint(node, objectStack) {
|
||||||
/** @type {Array.<Array.<number>>} */
|
/** @type {Array<Array<number>>} */
|
||||||
const coordinates = pushParseAndPop([],
|
const coordinates = pushParseAndPop([],
|
||||||
this.MULTIPOINT_PARSERS_, node, objectStack, this);
|
this.MULTIPOINT_PARSERS_, node, objectStack, this);
|
||||||
if (coordinates) {
|
if (coordinates) {
|
||||||
@@ -308,11 +308,11 @@ class GMLBase extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/geom/MultiLineString|undefined} MultiLineString.
|
* @return {module:ol/geom/MultiLineString|undefined} MultiLineString.
|
||||||
*/
|
*/
|
||||||
readMultiLineString(node, objectStack) {
|
readMultiLineString(node, objectStack) {
|
||||||
/** @type {Array.<module:ol/geom/LineString>} */
|
/** @type {Array<module:ol/geom/LineString>} */
|
||||||
const lineStrings = pushParseAndPop([],
|
const lineStrings = pushParseAndPop([],
|
||||||
this.MULTILINESTRING_PARSERS_, node, objectStack, this);
|
this.MULTILINESTRING_PARSERS_, node, objectStack, this);
|
||||||
if (lineStrings) {
|
if (lineStrings) {
|
||||||
@@ -322,11 +322,11 @@ class GMLBase extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/geom/MultiPolygon|undefined} MultiPolygon.
|
* @return {module:ol/geom/MultiPolygon|undefined} MultiPolygon.
|
||||||
*/
|
*/
|
||||||
readMultiPolygon(node, objectStack) {
|
readMultiPolygon(node, objectStack) {
|
||||||
/** @type {Array.<module:ol/geom/Polygon>} */
|
/** @type {Array<module:ol/geom/Polygon>} */
|
||||||
const polygons = pushParseAndPop([], this.MULTIPOLYGON_PARSERS_, node, objectStack, this);
|
const polygons = pushParseAndPop([], this.MULTIPOLYGON_PARSERS_, node, objectStack, this);
|
||||||
if (polygons) {
|
if (polygons) {
|
||||||
return new MultiPolygon(polygons);
|
return new MultiPolygon(polygons);
|
||||||
@@ -335,7 +335,7 @@ class GMLBase extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
pointMemberParser_(node, objectStack) {
|
pointMemberParser_(node, objectStack) {
|
||||||
@@ -344,7 +344,7 @@ class GMLBase extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
lineStringMemberParser_(node, objectStack) {
|
lineStringMemberParser_(node, objectStack) {
|
||||||
@@ -353,7 +353,7 @@ class GMLBase extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
polygonMemberParser_(node, objectStack) {
|
polygonMemberParser_(node, objectStack) {
|
||||||
@@ -362,7 +362,7 @@ class GMLBase extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/geom/LineString|undefined} LineString.
|
* @return {module:ol/geom/LineString|undefined} LineString.
|
||||||
*/
|
*/
|
||||||
readLineString(node, objectStack) {
|
readLineString(node, objectStack) {
|
||||||
@@ -377,9 +377,9 @@ class GMLBase extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {Array.<number>|undefined} LinearRing flat coordinates.
|
* @return {Array<number>|undefined} LinearRing flat coordinates.
|
||||||
*/
|
*/
|
||||||
readFlatLinearRing_(node, objectStack) {
|
readFlatLinearRing_(node, objectStack) {
|
||||||
const ring = pushParseAndPop(null,
|
const ring = pushParseAndPop(null,
|
||||||
@@ -394,7 +394,7 @@ class GMLBase extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/geom/LinearRing|undefined} LinearRing.
|
* @return {module:ol/geom/LinearRing|undefined} LinearRing.
|
||||||
*/
|
*/
|
||||||
readLinearRing(node, objectStack) {
|
readLinearRing(node, objectStack) {
|
||||||
@@ -406,11 +406,11 @@ class GMLBase extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/geom/Polygon|undefined} Polygon.
|
* @return {module:ol/geom/Polygon|undefined} Polygon.
|
||||||
*/
|
*/
|
||||||
readPolygon(node, objectStack) {
|
readPolygon(node, objectStack) {
|
||||||
/** @type {Array.<Array.<number>>} */
|
/** @type {Array<Array<number>>} */
|
||||||
const flatLinearRings = pushParseAndPop([null],
|
const flatLinearRings = pushParseAndPop([null],
|
||||||
this.FLAT_LINEAR_RINGS_PARSERS_, node, objectStack, this);
|
this.FLAT_LINEAR_RINGS_PARSERS_, node, objectStack, this);
|
||||||
if (flatLinearRings && flatLinearRings[0]) {
|
if (flatLinearRings && flatLinearRings[0]) {
|
||||||
@@ -429,9 +429,9 @@ class GMLBase extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {Array.<number>} Flat coordinates.
|
* @return {Array<number>} Flat coordinates.
|
||||||
*/
|
*/
|
||||||
readFlatCoordinatesFromNode_(node, objectStack) {
|
readFlatCoordinatesFromNode_(node, objectStack) {
|
||||||
return pushParseAndPop(null, this.GEOMETRY_FLAT_COORDINATES_PARSERS_, node, objectStack, this);
|
return pushParseAndPop(null, this.GEOMETRY_FLAT_COORDINATES_PARSERS_, node, objectStack, this);
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import {createElementNS, makeArrayPusher, makeArraySerializer, makeChildAppender
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Array.<null|string>}
|
* @type {Array<null|string>}
|
||||||
*/
|
*/
|
||||||
const NAMESPACE_URIS = [
|
const NAMESPACE_URIS = [
|
||||||
null,
|
null,
|
||||||
@@ -38,7 +38,7 @@ const SCHEMA_LOCATION = 'http://www.topografix.com/GPX/1/1 ' +
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, function(Node, Array.<*>): (module:ol/Feature|undefined)>}
|
* @type {Object.<string, function(Node, Array<*>): (module:ol/Feature|undefined)>}
|
||||||
*/
|
*/
|
||||||
const FEATURE_READER = {
|
const FEATURE_READER = {
|
||||||
'rte': readRte,
|
'rte': readRte,
|
||||||
@@ -138,7 +138,7 @@ class GPX extends XMLFeature {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array.<module:ol/Feature>} features List of features.
|
* @param {Array<module:ol/Feature>} features List of features.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
handleReadExtensions_(features) {
|
handleReadExtensions_(features) {
|
||||||
@@ -182,7 +182,7 @@ class GPX extends XMLFeature {
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
if (node.localName == 'gpx') {
|
if (node.localName == 'gpx') {
|
||||||
/** @type {Array.<module:ol/Feature>} */
|
/** @type {Array<module:ol/Feature>} */
|
||||||
const features = pushParseAndPop([], GPX_PARSERS,
|
const features = pushParseAndPop([], GPX_PARSERS,
|
||||||
node, [this.getReadOptions(node, opt_options)]);
|
node, [this.getReadOptions(node, opt_options)]);
|
||||||
if (features) {
|
if (features) {
|
||||||
@@ -200,7 +200,7 @@ class GPX extends XMLFeature {
|
|||||||
* LineString geometries are output as routes (`<rte>`), and MultiLineString
|
* LineString geometries are output as routes (`<rte>`), and MultiLineString
|
||||||
* as tracks (`<trk>`).
|
* 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.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
||||||
* @return {Node} Node.
|
* @return {Node} Node.
|
||||||
* @override
|
* @override
|
||||||
@@ -321,7 +321,7 @@ const WPT_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Array.<string>}
|
* @type {Array<string>}
|
||||||
*/
|
*/
|
||||||
const LINK_SEQUENCE = ['text', 'type'];
|
const LINK_SEQUENCE = ['text', 'type'];
|
||||||
|
|
||||||
@@ -339,7 +339,7 @@ const LINK_SERIALIZERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Array.<string>>}
|
* @type {Object.<string, Array<string>>}
|
||||||
*/
|
*/
|
||||||
const RTE_SEQUENCE = makeStructureNS(
|
const RTE_SEQUENCE = makeStructureNS(
|
||||||
NAMESPACE_URIS, [
|
NAMESPACE_URIS, [
|
||||||
@@ -366,7 +366,7 @@ const RTE_SERIALIZERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Array.<string>>}
|
* @type {Object.<string, Array<string>>}
|
||||||
*/
|
*/
|
||||||
const RTEPT_TYPE_SEQUENCE = makeStructureNS(
|
const RTEPT_TYPE_SEQUENCE = makeStructureNS(
|
||||||
NAMESPACE_URIS, [
|
NAMESPACE_URIS, [
|
||||||
@@ -376,7 +376,7 @@ const RTEPT_TYPE_SEQUENCE = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Array.<string>>}
|
* @type {Object.<string, Array<string>>}
|
||||||
*/
|
*/
|
||||||
const TRK_SEQUENCE = makeStructureNS(
|
const TRK_SEQUENCE = makeStructureNS(
|
||||||
NAMESPACE_URIS, [
|
NAMESPACE_URIS, [
|
||||||
@@ -403,7 +403,7 @@ const TRK_SERIALIZERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {function(*, Array.<*>, string=): (Node|undefined)}
|
* @type {function(*, Array<*>, string=): (Node|undefined)}
|
||||||
*/
|
*/
|
||||||
const TRKSEG_NODE_FACTORY = makeSimpleNodeFactory('trkpt');
|
const TRKSEG_NODE_FACTORY = makeSimpleNodeFactory('trkpt');
|
||||||
|
|
||||||
@@ -420,7 +420,7 @@ const TRKSEG_SERIALIZERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Array.<string>>}
|
* @type {Object.<string, Array<string>>}
|
||||||
*/
|
*/
|
||||||
const WPT_TYPE_SEQUENCE = makeStructureNS(
|
const WPT_TYPE_SEQUENCE = makeStructureNS(
|
||||||
NAMESPACE_URIS, [
|
NAMESPACE_URIS, [
|
||||||
@@ -470,7 +470,7 @@ const GEOMETRY_TYPE_TO_NODENAME = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {*} value Value.
|
* @param {*} value Value.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @param {string=} opt_nodeName Node name.
|
* @param {string=} opt_nodeName Node name.
|
||||||
* @return {Node|undefined} Node.
|
* @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 {module:ol/format/GPX~LayoutOptions} layoutOptions Layout options.
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {!Object} values Values.
|
* @param {!Object} values Values.
|
||||||
* @return {Array.<number>} Flat coordinates.
|
* @return {Array<number>} Flat coordinates.
|
||||||
*/
|
*/
|
||||||
function appendCoordinate(flatCoordinates, layoutOptions, node, values) {
|
function appendCoordinate(flatCoordinates, layoutOptions, node, values) {
|
||||||
flatCoordinates.push(
|
flatCoordinates.push(
|
||||||
@@ -520,8 +520,8 @@ function appendCoordinate(flatCoordinates, layoutOptions, node, values) {
|
|||||||
* and ends arrays by shrinking them accordingly (removing unused zero entries).
|
* and ends arrays by shrinking them accordingly (removing unused zero entries).
|
||||||
*
|
*
|
||||||
* @param {module:ol/format/GPX~LayoutOptions} layoutOptions Layout options.
|
* @param {module:ol/format/GPX~LayoutOptions} layoutOptions Layout options.
|
||||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||||
* @param {Array.<number>=} ends Ends.
|
* @param {Array<number>=} ends Ends.
|
||||||
* @return {module:ol/geom/GeometryLayout} Layout.
|
* @return {module:ol/geom/GeometryLayout} Layout.
|
||||||
*/
|
*/
|
||||||
function applyLayoutOptions(layoutOptions, flatCoordinates, ends) {
|
function applyLayoutOptions(layoutOptions, flatCoordinates, ends) {
|
||||||
@@ -561,7 +561,7 @@ function applyLayoutOptions(layoutOptions, flatCoordinates, ends) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function parseLink(node, objectStack) {
|
function parseLink(node, objectStack) {
|
||||||
const values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
const values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||||
@@ -575,7 +575,7 @@ function parseLink(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function parseExtensions(node, objectStack) {
|
function parseExtensions(node, objectStack) {
|
||||||
const values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
const values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||||
@@ -585,13 +585,13 @@ function parseExtensions(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function parseRtePt(node, objectStack) {
|
function parseRtePt(node, objectStack) {
|
||||||
const values = pushParseAndPop({}, RTEPT_PARSERS, node, objectStack);
|
const values = pushParseAndPop({}, RTEPT_PARSERS, node, objectStack);
|
||||||
if (values) {
|
if (values) {
|
||||||
const rteValues = /** @type {!Object} */ (objectStack[objectStack.length - 1]);
|
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']);
|
const layoutOptions = /** @type {module:ol/format/GPX~LayoutOptions} */ (rteValues['layoutOptions']);
|
||||||
appendCoordinate(flatCoordinates, layoutOptions, node, values);
|
appendCoordinate(flatCoordinates, layoutOptions, node, values);
|
||||||
}
|
}
|
||||||
@@ -600,13 +600,13 @@ function parseRtePt(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function parseTrkPt(node, objectStack) {
|
function parseTrkPt(node, objectStack) {
|
||||||
const values = pushParseAndPop({}, TRKPT_PARSERS, node, objectStack);
|
const values = pushParseAndPop({}, TRKPT_PARSERS, node, objectStack);
|
||||||
if (values) {
|
if (values) {
|
||||||
const trkValues = /** @type {!Object} */ (objectStack[objectStack.length - 1]);
|
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']);
|
const layoutOptions = /** @type {module:ol/format/GPX~LayoutOptions} */ (trkValues['layoutOptions']);
|
||||||
appendCoordinate(flatCoordinates, layoutOptions, node, values);
|
appendCoordinate(flatCoordinates, layoutOptions, node, values);
|
||||||
}
|
}
|
||||||
@@ -615,21 +615,21 @@ function parseTrkPt(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function parseTrkSeg(node, objectStack) {
|
function parseTrkSeg(node, objectStack) {
|
||||||
const values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
const values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||||
parseNode(TRKSEG_PARSERS, node, objectStack);
|
parseNode(TRKSEG_PARSERS, node, objectStack);
|
||||||
const flatCoordinates = /** @type {Array.<number>} */
|
const flatCoordinates = /** @type {Array<number>} */
|
||||||
(values['flatCoordinates']);
|
(values['flatCoordinates']);
|
||||||
const ends = /** @type {Array.<number>} */ (values['ends']);
|
const ends = /** @type {Array<number>} */ (values['ends']);
|
||||||
ends.push(flatCoordinates.length);
|
ends.push(flatCoordinates.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/Feature|undefined} Track.
|
* @return {module:ol/Feature|undefined} Track.
|
||||||
*/
|
*/
|
||||||
function readRte(node, objectStack) {
|
function readRte(node, objectStack) {
|
||||||
@@ -641,7 +641,7 @@ function readRte(node, objectStack) {
|
|||||||
if (!values) {
|
if (!values) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
const flatCoordinates = /** @type {Array.<number>} */
|
const flatCoordinates = /** @type {Array<number>} */
|
||||||
(values['flatCoordinates']);
|
(values['flatCoordinates']);
|
||||||
delete values['flatCoordinates'];
|
delete values['flatCoordinates'];
|
||||||
const layoutOptions = /** @type {module:ol/format/GPX~LayoutOptions} */ (values['layoutOptions']);
|
const layoutOptions = /** @type {module:ol/format/GPX~LayoutOptions} */ (values['layoutOptions']);
|
||||||
@@ -657,7 +657,7 @@ function readRte(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/Feature|undefined} Track.
|
* @return {module:ol/Feature|undefined} Track.
|
||||||
*/
|
*/
|
||||||
function readTrk(node, objectStack) {
|
function readTrk(node, objectStack) {
|
||||||
@@ -670,10 +670,10 @@ function readTrk(node, objectStack) {
|
|||||||
if (!values) {
|
if (!values) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
const flatCoordinates = /** @type {Array.<number>} */
|
const flatCoordinates = /** @type {Array<number>} */
|
||||||
(values['flatCoordinates']);
|
(values['flatCoordinates']);
|
||||||
delete values['flatCoordinates'];
|
delete values['flatCoordinates'];
|
||||||
const ends = /** @type {Array.<number>} */ (values['ends']);
|
const ends = /** @type {Array<number>} */ (values['ends']);
|
||||||
delete values['ends'];
|
delete values['ends'];
|
||||||
const layoutOptions = /** @type {module:ol/format/GPX~LayoutOptions} */ (values['layoutOptions']);
|
const layoutOptions = /** @type {module:ol/format/GPX~LayoutOptions} */ (values['layoutOptions']);
|
||||||
delete values['layoutOptions'];
|
delete values['layoutOptions'];
|
||||||
@@ -688,7 +688,7 @@ function readTrk(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/Feature|undefined} Waypoint.
|
* @return {module:ol/Feature|undefined} Waypoint.
|
||||||
*/
|
*/
|
||||||
function readWpt(node, objectStack) {
|
function readWpt(node, objectStack) {
|
||||||
@@ -711,7 +711,7 @@ function readWpt(node, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {string} value Value for the link's `href` attribute.
|
* @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) {
|
function writeLink(node, value, objectStack) {
|
||||||
node.setAttribute('href', value);
|
node.setAttribute('href', value);
|
||||||
@@ -730,7 +730,7 @@ function writeLink(node, value, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function writeWptType(node, coordinate, objectStack) {
|
function writeWptType(node, coordinate, objectStack) {
|
||||||
const context = objectStack[objectStack.length - 1];
|
const context = objectStack[objectStack.length - 1];
|
||||||
@@ -774,7 +774,7 @@ function writeWptType(node, coordinate, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/Feature} feature Feature.
|
* @param {module:ol/Feature} feature Feature.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function writeRte(node, feature, objectStack) {
|
function writeRte(node, feature, objectStack) {
|
||||||
const options = /** @type {module:ol/format/Feature~WriteOptions} */ (objectStack[0]);
|
const options = /** @type {module:ol/format/Feature~WriteOptions} */ (objectStack[0]);
|
||||||
@@ -798,7 +798,7 @@ function writeRte(node, feature, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/Feature} feature Feature.
|
* @param {module:ol/Feature} feature Feature.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function writeTrk(node, feature, objectStack) {
|
function writeTrk(node, feature, objectStack) {
|
||||||
const options = /** @type {module:ol/format/Feature~WriteOptions} */ (objectStack[0]);
|
const options = /** @type {module:ol/format/Feature~WriteOptions} */ (objectStack[0]);
|
||||||
@@ -823,7 +823,7 @@ function writeTrk(node, feature, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/LineString} lineString LineString.
|
* @param {module:ol/geom/LineString} lineString LineString.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function writeTrkSeg(node, lineString, objectStack) {
|
function writeTrkSeg(node, lineString, objectStack) {
|
||||||
/** @type {module:ol/xml~NodeStackItem} */
|
/** @type {module:ol/xml~NodeStackItem} */
|
||||||
@@ -838,7 +838,7 @@ function writeTrkSeg(node, lineString, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/Feature} feature Feature.
|
* @param {module:ol/Feature} feature Feature.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function writeWpt(node, feature, objectStack) {
|
function writeWpt(node, feature, objectStack) {
|
||||||
const options = /** @type {module:ol/format/Feature~WriteOptions} */ (objectStack[0]);
|
const options = /** @type {module:ol/format/Feature~WriteOptions} */ (objectStack[0]);
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ class GeoJSON extends JSONFeature {
|
|||||||
*/
|
*/
|
||||||
readFeaturesFromObject(object, opt_options) {
|
readFeaturesFromObject(object, opt_options) {
|
||||||
const geoJSONObject = /** @type {GeoJSONObject} */ (object);
|
const geoJSONObject = /** @type {GeoJSONObject} */ (object);
|
||||||
/** @type {Array.<module:ol/Feature>} */
|
/** @type {Array<module:ol/Feature>} */
|
||||||
let features = null;
|
let features = null;
|
||||||
if (geoJSONObject.type === 'FeatureCollection') {
|
if (geoJSONObject.type === 'FeatureCollection') {
|
||||||
const geoJSONFeatureCollection = /** @type {GeoJSONFeatureCollection} */ (object);
|
const geoJSONFeatureCollection = /** @type {GeoJSONFeatureCollection} */ (object);
|
||||||
@@ -196,7 +196,7 @@ class GeoJSON extends JSONFeature {
|
|||||||
/**
|
/**
|
||||||
* Encode an array of features as a GeoJSON object.
|
* 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.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||||
* @return {GeoJSONFeatureCollection} GeoJSON Object.
|
* @return {GeoJSONFeatureCollection} GeoJSON Object.
|
||||||
* @override
|
* @override
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class JSONFeature extends FeatureFormat {
|
|||||||
*
|
*
|
||||||
* @param {ArrayBuffer|Document|Node|Object|string} source Source.
|
* @param {ArrayBuffer|Document|Node|Object|string} source Source.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||||
* @return {Array.<module:ol/Feature>} Features.
|
* @return {Array<module:ol/Feature>} Features.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
readFeatures(source, opt_options) {
|
readFeatures(source, opt_options) {
|
||||||
@@ -66,7 +66,7 @@ class JSONFeature extends FeatureFormat {
|
|||||||
* @param {Object} object Object.
|
* @param {Object} object Object.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||||
* @protected
|
* @protected
|
||||||
* @return {Array.<module:ol/Feature>} Features.
|
* @return {Array<module:ol/Feature>} Features.
|
||||||
*/
|
*/
|
||||||
readFeaturesFromObject(object, opt_options) {}
|
readFeaturesFromObject(object, opt_options) {}
|
||||||
|
|
||||||
@@ -134,7 +134,7 @@ class JSONFeature extends FeatureFormat {
|
|||||||
/**
|
/**
|
||||||
* Encode an array of features as string.
|
* 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.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||||
* @return {string} Encoded features.
|
* @return {string} Encoded features.
|
||||||
* @api
|
* @api
|
||||||
@@ -145,7 +145,7 @@ class JSONFeature extends FeatureFormat {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @abstract
|
* @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.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||||
* @return {Object} Object.
|
* @return {Object} Object.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -43,14 +43,14 @@ import {createElementNS, getAllTextContent, isDocument, isNode, makeArrayExtende
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} GxTrackObject
|
* @typedef {Object} GxTrackObject
|
||||||
* @property {Array.<number>} flatCoordinates
|
* @property {Array<number>} flatCoordinates
|
||||||
* @property {Array.<number>} whens
|
* @property {Array<number>} whens
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Array.<string>}
|
* @type {Array<string>}
|
||||||
*/
|
*/
|
||||||
const GX_NAMESPACE_URIS = [
|
const GX_NAMESPACE_URIS = [
|
||||||
'http://www.google.com/kml/ext/2.2'
|
'http://www.google.com/kml/ext/2.2'
|
||||||
@@ -59,7 +59,7 @@ const GX_NAMESPACE_URIS = [
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Array.<null|string>}
|
* @type {Array<null|string>}
|
||||||
*/
|
*/
|
||||||
const NAMESPACE_URIS = [
|
const NAMESPACE_URIS = [
|
||||||
null,
|
null,
|
||||||
@@ -165,7 +165,7 @@ const REGION_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Array.<string>>}
|
* @type {Object.<string, Array<string>>}
|
||||||
*/
|
*/
|
||||||
const KML_SEQUENCE = makeStructureNS(
|
const KML_SEQUENCE = makeStructureNS(
|
||||||
NAMESPACE_URIS, [
|
NAMESPACE_URIS, [
|
||||||
@@ -295,13 +295,13 @@ export function getDefaultStyle() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Array.<module:ol/style/Style>}
|
* @type {Array<module:ol/style/Style>}
|
||||||
*/
|
*/
|
||||||
let DEFAULT_STYLE_ARRAY = null;
|
let DEFAULT_STYLE_ARRAY = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the default style array (or null if not yet set).
|
* Get the default style array (or null if not yet set).
|
||||||
* @return {Array.<module:ol/style/Style>} The default style.
|
* @return {Array<module:ol/style/Style>} The default style.
|
||||||
*/
|
*/
|
||||||
export function getDefaultStyleArray() {
|
export function getDefaultStyleArray() {
|
||||||
return DEFAULT_STYLE_ARRAY;
|
return DEFAULT_STYLE_ARRAY;
|
||||||
@@ -377,7 +377,7 @@ function createStyleDefaults() {
|
|||||||
* @typedef {Object} Options
|
* @typedef {Object} Options
|
||||||
* @property {boolean} [extractStyles=true] Extract styles from the KML.
|
* @property {boolean} [extractStyles=true] Extract styles from the KML.
|
||||||
* @property {boolean} [showPointNames=true] Show names as labels for placemarks which contain points.
|
* @property {boolean} [showPointNames=true] Show names as labels for placemarks which contain points.
|
||||||
* @property {Array.<module:ol/style/Style>} [defaultStyle] Default style. The
|
* @property {Array<module:ol/style/Style>} [defaultStyle] Default style. The
|
||||||
* default default style is the same as Google Earth.
|
* default default style is the same as Google Earth.
|
||||||
* @property {boolean} [writeStyles=true] Write styles into KML.
|
* @property {boolean} [writeStyles=true] Write styles into KML.
|
||||||
*/
|
*/
|
||||||
@@ -420,7 +420,7 @@ class KML extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array.<module:ol/style/Style>}
|
* @type {Array<module:ol/style/Style>}
|
||||||
*/
|
*/
|
||||||
this.defaultStyle_ = options.defaultStyle ?
|
this.defaultStyle_ = options.defaultStyle ?
|
||||||
options.defaultStyle : DEFAULT_STYLE_ARRAY;
|
options.defaultStyle : DEFAULT_STYLE_ARRAY;
|
||||||
@@ -441,7 +441,7 @@ class KML extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {!Object.<string, (Array.<module:ol/style/Style>|string)>}
|
* @type {!Object.<string, (Array<module:ol/style/Style>|string)>}
|
||||||
*/
|
*/
|
||||||
this.sharedStyles_ = {};
|
this.sharedStyles_ = {};
|
||||||
|
|
||||||
@@ -456,9 +456,9 @@ class KML extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {Array.<module:ol/Feature>|undefined} Features.
|
* @return {Array<module:ol/Feature>|undefined} Features.
|
||||||
*/
|
*/
|
||||||
readDocumentOrFolder_(node, objectStack) {
|
readDocumentOrFolder_(node, objectStack) {
|
||||||
// FIXME use scope somehow
|
// FIXME use scope somehow
|
||||||
@@ -470,7 +470,7 @@ class KML extends XMLFeature {
|
|||||||
'Style': this.readSharedStyle_.bind(this),
|
'Style': this.readSharedStyle_.bind(this),
|
||||||
'StyleMap': this.readSharedStyleMap_.bind(this)
|
'StyleMap': this.readSharedStyleMap_.bind(this)
|
||||||
});
|
});
|
||||||
/** @type {Array.<module:ol/Feature>} */
|
/** @type {Array<module:ol/Feature>} */
|
||||||
const features = pushParseAndPop([], parsersNS, node, objectStack, this);
|
const features = pushParseAndPop([], parsersNS, node, objectStack, this);
|
||||||
if (features) {
|
if (features) {
|
||||||
return features;
|
return features;
|
||||||
@@ -481,7 +481,7 @@ class KML extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {module:ol/Feature|undefined} Feature.
|
* @return {module:ol/Feature|undefined} Feature.
|
||||||
*/
|
*/
|
||||||
@@ -524,7 +524,7 @@ class KML extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
readSharedStyle_(node, objectStack) {
|
readSharedStyle_(node, objectStack) {
|
||||||
@@ -550,7 +550,7 @@ class KML extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
readSharedStyleMap_(node, objectStack) {
|
readSharedStyleMap_(node, objectStack) {
|
||||||
@@ -698,7 +698,7 @@ class KML extends XMLFeature {
|
|||||||
* Read the network links of the KML.
|
* Read the network links of the KML.
|
||||||
*
|
*
|
||||||
* @param {Document|Node|string} source Source.
|
* @param {Document|Node|string} source Source.
|
||||||
* @return {Array.<Object>} Network links.
|
* @return {Array<Object>} Network links.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
readNetworkLinks(source) {
|
readNetworkLinks(source) {
|
||||||
@@ -718,7 +718,7 @@ class KML extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Document} doc Document.
|
* @param {Document} doc Document.
|
||||||
* @return {Array.<Object>} Network links.
|
* @return {Array<Object>} Network links.
|
||||||
*/
|
*/
|
||||||
readNetworkLinksFromDocument(doc) {
|
readNetworkLinksFromDocument(doc) {
|
||||||
const networkLinks = [];
|
const networkLinks = [];
|
||||||
@@ -732,7 +732,7 @@ class KML extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @return {Array.<Object>} Network links.
|
* @return {Array<Object>} Network links.
|
||||||
*/
|
*/
|
||||||
readNetworkLinksFromNode(node) {
|
readNetworkLinksFromNode(node) {
|
||||||
const networkLinks = [];
|
const networkLinks = [];
|
||||||
@@ -760,7 +760,7 @@ class KML extends XMLFeature {
|
|||||||
* Read the regions of the KML.
|
* Read the regions of the KML.
|
||||||
*
|
*
|
||||||
* @param {Document|Node|string} source Source.
|
* @param {Document|Node|string} source Source.
|
||||||
* @return {Array.<Object>} Regions.
|
* @return {Array<Object>} Regions.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
readRegion(source) {
|
readRegion(source) {
|
||||||
@@ -780,7 +780,7 @@ class KML extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Document} doc Document.
|
* @param {Document} doc Document.
|
||||||
* @return {Array.<Object>} Region.
|
* @return {Array<Object>} Region.
|
||||||
*/
|
*/
|
||||||
readRegionFromDocument(doc) {
|
readRegionFromDocument(doc) {
|
||||||
const regions = [];
|
const regions = [];
|
||||||
@@ -794,7 +794,7 @@ class KML extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @return {Array.<Object>} Region.
|
* @return {Array<Object>} Region.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
readRegionFromNode(node) {
|
readRegionFromNode(node) {
|
||||||
@@ -823,7 +823,7 @@ class KML extends XMLFeature {
|
|||||||
* Encode an array of features in the KML format as an XML node. GeometryCollections,
|
* Encode an array of features in the KML format as an XML node. GeometryCollections,
|
||||||
* MultiPoints, MultiLineStrings, and MultiPolygons are output as MultiGeometries.
|
* MultiPoints, MultiLineStrings, and MultiPolygons are output as MultiGeometries.
|
||||||
*
|
*
|
||||||
* @param {Array.<module:ol/Feature>} features Features.
|
* @param {Array<module:ol/Feature>} features Features.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
||||||
* @return {Node} Node.
|
* @return {Node} Node.
|
||||||
* @override
|
* @override
|
||||||
@@ -902,10 +902,10 @@ function createNameStyleFunction(foundStyle, name) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array.<module:ol/style/Style>|undefined} style Style.
|
* @param {Array<module:ol/style/Style>|undefined} style Style.
|
||||||
* @param {string} styleUrl Style URL.
|
* @param {string} styleUrl Style URL.
|
||||||
* @param {Array.<module:ol/style/Style>} defaultStyle Default style.
|
* @param {Array<module:ol/style/Style>} defaultStyle Default style.
|
||||||
* @param {!Object.<string, (Array.<module:ol/style/Style>|string)>} sharedStyles Shared styles.
|
* @param {!Object.<string, (Array<module:ol/style/Style>|string)>} sharedStyles Shared styles.
|
||||||
* @param {boolean|undefined} showPointNames true to show names for point placemarks.
|
* @param {boolean|undefined} showPointNames true to show names for point placemarks.
|
||||||
* @return {module:ol/style/Style~StyleFunction} Feature style function.
|
* @return {module:ol/style/Style~StyleFunction} Feature style function.
|
||||||
*/
|
*/
|
||||||
@@ -915,7 +915,7 @@ function createFeatureStyleFunction(style, styleUrl, defaultStyle, sharedStyles,
|
|||||||
/**
|
/**
|
||||||
* @param {module:ol/Feature} feature feature.
|
* @param {module:ol/Feature} feature feature.
|
||||||
* @param {number} resolution Resolution.
|
* @param {number} resolution Resolution.
|
||||||
* @return {Array.<module:ol/style/Style>} Style.
|
* @return {Array<module:ol/style/Style>} Style.
|
||||||
*/
|
*/
|
||||||
function(feature, resolution) {
|
function(feature, resolution) {
|
||||||
let drawName = showPointNames;
|
let drawName = showPointNames;
|
||||||
@@ -960,11 +960,11 @@ function createFeatureStyleFunction(style, styleUrl, defaultStyle, sharedStyles,
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array.<module:ol/style/Style>|string|undefined} styleValue Style value.
|
* @param {Array<module:ol/style/Style>|string|undefined} styleValue Style value.
|
||||||
* @param {Array.<module:ol/style/Style>} defaultStyle Default style.
|
* @param {Array<module:ol/style/Style>} defaultStyle Default style.
|
||||||
* @param {!Object.<string, (Array.<module:ol/style/Style>|string)>} sharedStyles
|
* @param {!Object.<string, (Array<module:ol/style/Style>|string)>} sharedStyles
|
||||||
* Shared styles.
|
* Shared styles.
|
||||||
* @return {Array.<module:ol/style/Style>} Style.
|
* @return {Array<module:ol/style/Style>} Style.
|
||||||
*/
|
*/
|
||||||
function findStyle(styleValue, defaultStyle, sharedStyles) {
|
function findStyle(styleValue, defaultStyle, sharedStyles) {
|
||||||
if (Array.isArray(styleValue)) {
|
if (Array.isArray(styleValue)) {
|
||||||
@@ -1009,7 +1009,7 @@ function readColor(node) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @return {Array.<number>|undefined} Flat coordinates.
|
* @return {Array<number>|undefined} Flat coordinates.
|
||||||
*/
|
*/
|
||||||
export function readFlatCoordinates(node) {
|
export function readFlatCoordinates(node) {
|
||||||
let s = getAllTextContent(node, false);
|
let s = getAllTextContent(node, false);
|
||||||
@@ -1104,8 +1104,8 @@ const STYLE_MAP_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Array.<module:ol/style/Style>|string|undefined} StyleMap.
|
* @return {Array<module:ol/style/Style>|string|undefined} StyleMap.
|
||||||
*/
|
*/
|
||||||
function readStyleMapValue(node, objectStack) {
|
function readStyleMapValue(node, objectStack) {
|
||||||
return pushParseAndPop(undefined,
|
return pushParseAndPop(undefined,
|
||||||
@@ -1128,7 +1128,7 @@ const ICON_STYLE_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function iconStyleParser(node, objectStack) {
|
function iconStyleParser(node, objectStack) {
|
||||||
// FIXME refreshMode
|
// FIXME refreshMode
|
||||||
@@ -1242,7 +1242,7 @@ const LABEL_STYLE_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function labelStyleParser(node, objectStack) {
|
function labelStyleParser(node, objectStack) {
|
||||||
// FIXME colorMode
|
// FIXME colorMode
|
||||||
@@ -1277,7 +1277,7 @@ const LINE_STYLE_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function lineStyleParser(node, objectStack) {
|
function lineStyleParser(node, objectStack) {
|
||||||
// FIXME colorMode
|
// FIXME colorMode
|
||||||
@@ -1314,7 +1314,7 @@ const POLY_STYLE_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function polyStyleParser(node, objectStack) {
|
function polyStyleParser(node, objectStack) {
|
||||||
// FIXME colorMode
|
// FIXME colorMode
|
||||||
@@ -1352,8 +1352,8 @@ const FLAT_LINEAR_RING_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Array.<number>} LinearRing flat coordinates.
|
* @return {Array<number>} LinearRing flat coordinates.
|
||||||
*/
|
*/
|
||||||
function readFlatLinearRing(node, objectStack) {
|
function readFlatLinearRing(node, objectStack) {
|
||||||
return pushParseAndPop(null,
|
return pushParseAndPop(null,
|
||||||
@@ -1363,7 +1363,7 @@ function readFlatLinearRing(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function gxCoordParser(node, objectStack) {
|
function gxCoordParser(node, objectStack) {
|
||||||
const gxTrackObject = /** @type {module:ol/format/KML~GxTrackObject} */
|
const gxTrackObject = /** @type {module:ol/format/KML~GxTrackObject} */
|
||||||
@@ -1396,7 +1396,7 @@ const GX_MULTITRACK_GEOMETRY_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/geom/MultiLineString|undefined} MultiLineString.
|
* @return {module:ol/geom/MultiLineString|undefined} MultiLineString.
|
||||||
*/
|
*/
|
||||||
function readGxMultiTrack(node, objectStack) {
|
function readGxMultiTrack(node, objectStack) {
|
||||||
@@ -1424,7 +1424,7 @@ const GX_TRACK_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/geom/LineString|undefined} LineString.
|
* @return {module:ol/geom/LineString|undefined} LineString.
|
||||||
*/
|
*/
|
||||||
function readGxTrack(node, objectStack) {
|
function readGxTrack(node, objectStack) {
|
||||||
@@ -1463,7 +1463,7 @@ const ICON_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object} Icon object.
|
* @return {Object} Icon object.
|
||||||
*/
|
*/
|
||||||
function readIcon(node, objectStack) {
|
function readIcon(node, objectStack) {
|
||||||
@@ -1489,8 +1489,8 @@ const GEOMETRY_FLAT_COORDINATES_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Array.<number>} Flat coordinates.
|
* @return {Array<number>} Flat coordinates.
|
||||||
*/
|
*/
|
||||||
function readFlatCoordinatesFromNode(node, objectStack) {
|
function readFlatCoordinatesFromNode(node, objectStack) {
|
||||||
return pushParseAndPop(null,
|
return pushParseAndPop(null,
|
||||||
@@ -1512,7 +1512,7 @@ const EXTRUDE_AND_ALTITUDE_MODE_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/geom/LineString|undefined} LineString.
|
* @return {module:ol/geom/LineString|undefined} LineString.
|
||||||
*/
|
*/
|
||||||
function readLineString(node, objectStack) {
|
function readLineString(node, objectStack) {
|
||||||
@@ -1533,7 +1533,7 @@ function readLineString(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/geom/Polygon|undefined} Polygon.
|
* @return {module:ol/geom/Polygon|undefined} Polygon.
|
||||||
*/
|
*/
|
||||||
function readLinearRing(node, objectStack) {
|
function readLinearRing(node, objectStack) {
|
||||||
@@ -1568,7 +1568,7 @@ const MULTI_GEOMETRY_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/geom/Geometry} Geometry.
|
* @return {module:ol/geom/Geometry} Geometry.
|
||||||
*/
|
*/
|
||||||
function readMultiGeometry(node, objectStack) {
|
function readMultiGeometry(node, objectStack) {
|
||||||
@@ -1627,7 +1627,7 @@ function readMultiGeometry(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/geom/Point|undefined} Point.
|
* @return {module:ol/geom/Point|undefined} Point.
|
||||||
*/
|
*/
|
||||||
function readPoint(node, objectStack) {
|
function readPoint(node, objectStack) {
|
||||||
@@ -1659,7 +1659,7 @@ const FLAT_LINEAR_RINGS_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/geom/Polygon|undefined} Polygon.
|
* @return {module:ol/geom/Polygon|undefined} Polygon.
|
||||||
*/
|
*/
|
||||||
function readPolygon(node, objectStack) {
|
function readPolygon(node, objectStack) {
|
||||||
@@ -1699,8 +1699,8 @@ const STYLE_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Array.<module:ol/style/Style>} Style.
|
* @return {Array<module:ol/style/Style>} Style.
|
||||||
*/
|
*/
|
||||||
function readStyle(node, objectStack) {
|
function readStyle(node, objectStack) {
|
||||||
const styleObject = pushParseAndPop(
|
const styleObject = pushParseAndPop(
|
||||||
@@ -1746,7 +1746,7 @@ function readStyle(node, objectStack) {
|
|||||||
* Reads an array of geometries and creates arrays for common geometry
|
* Reads an array of geometries and creates arrays for common geometry
|
||||||
* properties. Then sets them to the multi geometry.
|
* properties. Then sets them to the multi geometry.
|
||||||
* @param {module:ol/geom/MultiPoint|module:ol/geom/MultiLineString|module:ol/geom/MultiPolygon} multiGeometry A multi-geometry.
|
* @param {module:ol/geom/MultiPoint|module:ol/geom/MultiLineString|module:ol/geom/MultiPolygon} multiGeometry A multi-geometry.
|
||||||
* @param {Array.<module:ol/geom/Geometry>} geometries List of geometries.
|
* @param {Array<module:ol/geom/Geometry>} geometries List of geometries.
|
||||||
*/
|
*/
|
||||||
function setCommonGeometryProperties(multiGeometry, geometries) {
|
function setCommonGeometryProperties(multiGeometry, geometries) {
|
||||||
const ii = geometries.length;
|
const ii = geometries.length;
|
||||||
@@ -1789,7 +1789,7 @@ const DATA_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function dataParser(node, objectStack) {
|
function dataParser(node, objectStack) {
|
||||||
const name = node.getAttribute('name');
|
const name = node.getAttribute('name');
|
||||||
@@ -1817,7 +1817,7 @@ const EXTENDED_DATA_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function extendedDataParser(node, objectStack) {
|
function extendedDataParser(node, objectStack) {
|
||||||
parseNode(EXTENDED_DATA_PARSERS, node, objectStack);
|
parseNode(EXTENDED_DATA_PARSERS, node, objectStack);
|
||||||
@@ -1825,7 +1825,7 @@ function extendedDataParser(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function regionParser(node, objectStack) {
|
function regionParser(node, objectStack) {
|
||||||
parseNode(REGION_PARSERS, node, objectStack);
|
parseNode(REGION_PARSERS, node, objectStack);
|
||||||
@@ -1845,7 +1845,7 @@ const PAIR_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function pairDataParser(node, objectStack) {
|
function pairDataParser(node, objectStack) {
|
||||||
const pairObject = pushParseAndPop(
|
const pairObject = pushParseAndPop(
|
||||||
@@ -1872,7 +1872,7 @@ function pairDataParser(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function placemarkStyleMapParser(node, objectStack) {
|
function placemarkStyleMapParser(node, objectStack) {
|
||||||
const styleMapValue = readStyleMapValue(node, objectStack);
|
const styleMapValue = readStyleMapValue(node, objectStack);
|
||||||
@@ -1902,7 +1902,7 @@ const SCHEMA_DATA_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function schemaDataParser(node, objectStack) {
|
function schemaDataParser(node, objectStack) {
|
||||||
parseNode(SCHEMA_DATA_PARSERS, node, objectStack);
|
parseNode(SCHEMA_DATA_PARSERS, node, objectStack);
|
||||||
@@ -1911,7 +1911,7 @@ function schemaDataParser(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function simpleDataParser(node, objectStack) {
|
function simpleDataParser(node, objectStack) {
|
||||||
const name = node.getAttribute('name');
|
const name = node.getAttribute('name');
|
||||||
@@ -1941,7 +1941,7 @@ const LAT_LON_ALT_BOX_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function latLonAltBoxParser(node, objectStack) {
|
function latLonAltBoxParser(node, objectStack) {
|
||||||
const object = pushParseAndPop({}, LAT_LON_ALT_BOX_PARSERS, node, objectStack);
|
const object = pushParseAndPop({}, LAT_LON_ALT_BOX_PARSERS, node, objectStack);
|
||||||
@@ -1977,7 +1977,7 @@ const LOD_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function lodParser(node, objectStack) {
|
function lodParser(node, objectStack) {
|
||||||
const object = pushParseAndPop({}, LOD_PARSERS, node, objectStack);
|
const object = pushParseAndPop({}, LOD_PARSERS, node, objectStack);
|
||||||
@@ -2004,14 +2004,14 @@ const INNER_BOUNDARY_IS_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function innerBoundaryIsParser(node, objectStack) {
|
function innerBoundaryIsParser(node, objectStack) {
|
||||||
/** @type {Array.<number>|undefined} */
|
/** @type {Array<number>|undefined} */
|
||||||
const flatLinearRing = pushParseAndPop(undefined,
|
const flatLinearRing = pushParseAndPop(undefined,
|
||||||
INNER_BOUNDARY_IS_PARSERS, node, objectStack);
|
INNER_BOUNDARY_IS_PARSERS, node, objectStack);
|
||||||
if (flatLinearRing) {
|
if (flatLinearRing) {
|
||||||
const flatLinearRings = /** @type {Array.<Array.<number>>} */
|
const flatLinearRings = /** @type {Array<Array<number>>} */
|
||||||
(objectStack[objectStack.length - 1]);
|
(objectStack[objectStack.length - 1]);
|
||||||
flatLinearRings.push(flatLinearRing);
|
flatLinearRings.push(flatLinearRing);
|
||||||
}
|
}
|
||||||
@@ -2030,14 +2030,14 @@ const OUTER_BOUNDARY_IS_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function outerBoundaryIsParser(node, objectStack) {
|
function outerBoundaryIsParser(node, objectStack) {
|
||||||
/** @type {Array.<number>|undefined} */
|
/** @type {Array<number>|undefined} */
|
||||||
const flatLinearRing = pushParseAndPop(undefined,
|
const flatLinearRing = pushParseAndPop(undefined,
|
||||||
OUTER_BOUNDARY_IS_PARSERS, node, objectStack);
|
OUTER_BOUNDARY_IS_PARSERS, node, objectStack);
|
||||||
if (flatLinearRing) {
|
if (flatLinearRing) {
|
||||||
const flatLinearRings = /** @type {Array.<Array.<number>>} */
|
const flatLinearRings = /** @type {Array<Array<number>>} */
|
||||||
(objectStack[objectStack.length - 1]);
|
(objectStack[objectStack.length - 1]);
|
||||||
flatLinearRings[0] = flatLinearRing;
|
flatLinearRings[0] = flatLinearRing;
|
||||||
}
|
}
|
||||||
@@ -2046,7 +2046,7 @@ function outerBoundaryIsParser(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function linkParser(node, objectStack) {
|
function linkParser(node, objectStack) {
|
||||||
parseNode(LINK_PARSERS, node, objectStack);
|
parseNode(LINK_PARSERS, node, objectStack);
|
||||||
@@ -2055,7 +2055,7 @@ function linkParser(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function whenParser(node, objectStack) {
|
function whenParser(node, objectStack) {
|
||||||
const gxTrackObject = /** @type {module:ol/format/KML~GxTrackObject} */
|
const gxTrackObject = /** @type {module:ol/format/KML~GxTrackObject} */
|
||||||
@@ -2085,8 +2085,8 @@ function writeColorTextNode(node, color) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node to append a TextNode with the coordinates to.
|
* @param {Node} node Node to append a TextNode with the coordinates to.
|
||||||
* @param {Array.<number>} coordinates Coordinates.
|
* @param {Array<number>} coordinates Coordinates.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function writeCoordinatesTextNode(node, coordinates, objectStack) {
|
function writeCoordinatesTextNode(node, coordinates, objectStack) {
|
||||||
const context = objectStack[objectStack.length - 1];
|
const context = objectStack[objectStack.length - 1];
|
||||||
@@ -2138,7 +2138,7 @@ const EXTENDEDDATA_NODE_SERIALIZERS = makeStructureNS(
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {{name: *, value: *}} pair Name value pair.
|
* @param {{name: *, value: *}} pair Name value pair.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function writeDataNode(node, pair, objectStack) {
|
function writeDataNode(node, pair, objectStack) {
|
||||||
node.setAttribute('name', pair.name);
|
node.setAttribute('name', pair.name);
|
||||||
@@ -2193,7 +2193,7 @@ const DOCUMENT_SERIALIZERS = makeStructureNS(
|
|||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @param {*} value Value.
|
* @param {*} value Value.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @param {string=} opt_nodeName Node name.
|
* @param {string=} opt_nodeName Node name.
|
||||||
* @return {Node|undefined} Node.
|
* @return {Node|undefined} Node.
|
||||||
*/
|
*/
|
||||||
@@ -2205,8 +2205,8 @@ const DOCUMENT_NODE_FACTORY = function(value, objectStack, opt_nodeName) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<module:ol/Feature>} features Features.
|
* @param {Array<module:ol/Feature>} features Features.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @this {module:ol/format/KML}
|
* @this {module:ol/format/KML}
|
||||||
*/
|
*/
|
||||||
function writeDocument(node, features, objectStack) {
|
function writeDocument(node, features, objectStack) {
|
||||||
@@ -2220,7 +2220,7 @@ function writeDocument(node, features, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* A factory for creating Data nodes.
|
* A factory for creating Data nodes.
|
||||||
* @const
|
* @const
|
||||||
* @type {function(*, Array.<*>): (Node|undefined)}
|
* @type {function(*, Array<*>): (Node|undefined)}
|
||||||
*/
|
*/
|
||||||
const DATA_NODE_FACTORY = makeSimpleNodeFactory('Data');
|
const DATA_NODE_FACTORY = makeSimpleNodeFactory('Data');
|
||||||
|
|
||||||
@@ -2228,7 +2228,7 @@ const DATA_NODE_FACTORY = makeSimpleNodeFactory('Data');
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {{names: Array<string>, values: (Array<*>)}} namesAndValues Names and values.
|
* @param {{names: Array<string>, values: (Array<*>)}} namesAndValues Names and values.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function writeExtendedData(node, namesAndValues, objectStack) {
|
function writeExtendedData(node, namesAndValues, objectStack) {
|
||||||
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
|
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
|
||||||
@@ -2245,7 +2245,7 @@ function writeExtendedData(node, namesAndValues, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Array.<string>>}
|
* @type {Object.<string, Array<string>>}
|
||||||
*/
|
*/
|
||||||
const ICON_SEQUENCE = makeStructureNS(
|
const ICON_SEQUENCE = makeStructureNS(
|
||||||
NAMESPACE_URIS, [
|
NAMESPACE_URIS, [
|
||||||
@@ -2275,7 +2275,7 @@ const ICON_SERIALIZERS = makeStructureNS(
|
|||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @param {*} value Value.
|
* @param {*} value Value.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @param {string=} opt_nodeName Node name.
|
* @param {string=} opt_nodeName Node name.
|
||||||
* @return {Node|undefined} Node.
|
* @return {Node|undefined} Node.
|
||||||
*/
|
*/
|
||||||
@@ -2288,7 +2288,7 @@ const GX_NODE_FACTORY = function(value, objectStack, opt_nodeName) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Object} icon Icon object.
|
* @param {Object} icon Icon object.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function writeIcon(node, icon, objectStack) {
|
function writeIcon(node, icon, objectStack) {
|
||||||
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
|
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
|
||||||
@@ -2308,7 +2308,7 @@ function writeIcon(node, icon, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Array.<string>>}
|
* @type {Object.<string, Array<string>>}
|
||||||
*/
|
*/
|
||||||
const ICON_STYLE_SEQUENCE = makeStructureNS(
|
const ICON_STYLE_SEQUENCE = makeStructureNS(
|
||||||
NAMESPACE_URIS, [
|
NAMESPACE_URIS, [
|
||||||
@@ -2332,7 +2332,7 @@ const ICON_STYLE_SERIALIZERS = makeStructureNS(
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/style/Icon} style Icon style.
|
* @param {module:ol/style/Icon} style Icon style.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function writeIconStyle(node, style, objectStack) {
|
function writeIconStyle(node, style, objectStack) {
|
||||||
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
|
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
|
||||||
@@ -2388,7 +2388,7 @@ function writeIconStyle(node, style, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Array.<string>>}
|
* @type {Object.<string, Array<string>>}
|
||||||
*/
|
*/
|
||||||
const LABEL_STYLE_SEQUENCE = makeStructureNS(
|
const LABEL_STYLE_SEQUENCE = makeStructureNS(
|
||||||
NAMESPACE_URIS, [
|
NAMESPACE_URIS, [
|
||||||
@@ -2410,7 +2410,7 @@ const LABEL_STYLE_SERIALIZERS = makeStructureNS(
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/style/Text} style style.
|
* @param {module:ol/style/Text} style style.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function writeLabelStyle(node, style, objectStack) {
|
function writeLabelStyle(node, style, objectStack) {
|
||||||
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
|
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
|
||||||
@@ -2434,7 +2434,7 @@ function writeLabelStyle(node, style, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Array.<string>>}
|
* @type {Object.<string, Array<string>>}
|
||||||
*/
|
*/
|
||||||
const LINE_STYLE_SEQUENCE = makeStructureNS(
|
const LINE_STYLE_SEQUENCE = makeStructureNS(
|
||||||
NAMESPACE_URIS, [
|
NAMESPACE_URIS, [
|
||||||
@@ -2456,7 +2456,7 @@ const LINE_STYLE_SERIALIZERS = makeStructureNS(
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/style/Stroke} style style.
|
* @param {module:ol/style/Stroke} style style.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function writeLineStyle(node, style, objectStack) {
|
function writeLineStyle(node, style, objectStack) {
|
||||||
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
|
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
|
||||||
@@ -2491,7 +2491,7 @@ const GEOMETRY_TYPE_TO_NODENAME = {
|
|||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @param {*} value Value.
|
* @param {*} value Value.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @param {string=} opt_nodeName Node name.
|
* @param {string=} opt_nodeName Node name.
|
||||||
* @return {Node|undefined} Node.
|
* @return {Node|undefined} Node.
|
||||||
*/
|
*/
|
||||||
@@ -2507,7 +2507,7 @@ const GEOMETRY_NODE_FACTORY = function(value, objectStack, opt_nodeName) {
|
|||||||
/**
|
/**
|
||||||
* A factory for creating Point nodes.
|
* A factory for creating Point nodes.
|
||||||
* @const
|
* @const
|
||||||
* @type {function(*, Array.<*>, string=): (Node|undefined)}
|
* @type {function(*, Array<*>, string=): (Node|undefined)}
|
||||||
*/
|
*/
|
||||||
const POINT_NODE_FACTORY = makeSimpleNodeFactory('Point');
|
const POINT_NODE_FACTORY = makeSimpleNodeFactory('Point');
|
||||||
|
|
||||||
@@ -2515,7 +2515,7 @@ const POINT_NODE_FACTORY = makeSimpleNodeFactory('Point');
|
|||||||
/**
|
/**
|
||||||
* A factory for creating LineString nodes.
|
* A factory for creating LineString nodes.
|
||||||
* @const
|
* @const
|
||||||
* @type {function(*, Array.<*>, string=): (Node|undefined)}
|
* @type {function(*, Array<*>, string=): (Node|undefined)}
|
||||||
*/
|
*/
|
||||||
const LINE_STRING_NODE_FACTORY = makeSimpleNodeFactory('LineString');
|
const LINE_STRING_NODE_FACTORY = makeSimpleNodeFactory('LineString');
|
||||||
|
|
||||||
@@ -2523,7 +2523,7 @@ const LINE_STRING_NODE_FACTORY = makeSimpleNodeFactory('LineString');
|
|||||||
/**
|
/**
|
||||||
* A factory for creating LinearRing nodes.
|
* A factory for creating LinearRing nodes.
|
||||||
* @const
|
* @const
|
||||||
* @type {function(*, Array.<*>, string=): (Node|undefined)}
|
* @type {function(*, Array<*>, string=): (Node|undefined)}
|
||||||
*/
|
*/
|
||||||
const LINEAR_RING_NODE_FACTORY = makeSimpleNodeFactory('LinearRing');
|
const LINEAR_RING_NODE_FACTORY = makeSimpleNodeFactory('LinearRing');
|
||||||
|
|
||||||
@@ -2531,7 +2531,7 @@ const LINEAR_RING_NODE_FACTORY = makeSimpleNodeFactory('LinearRing');
|
|||||||
/**
|
/**
|
||||||
* A factory for creating Polygon nodes.
|
* A factory for creating Polygon nodes.
|
||||||
* @const
|
* @const
|
||||||
* @type {function(*, Array.<*>, string=): (Node|undefined)}
|
* @type {function(*, Array<*>, string=): (Node|undefined)}
|
||||||
*/
|
*/
|
||||||
const POLYGON_NODE_FACTORY = makeSimpleNodeFactory('Polygon');
|
const POLYGON_NODE_FACTORY = makeSimpleNodeFactory('Polygon');
|
||||||
|
|
||||||
@@ -2555,15 +2555,15 @@ const MULTI_GEOMETRY_SERIALIZERS = makeStructureNS(
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/Geometry} geometry Geometry.
|
* @param {module:ol/geom/Geometry} geometry Geometry.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function writeMultiGeometry(node, geometry, objectStack) {
|
function writeMultiGeometry(node, geometry, objectStack) {
|
||||||
/** @type {module:ol/xml~NodeStackItem} */
|
/** @type {module:ol/xml~NodeStackItem} */
|
||||||
const context = {node: node};
|
const context = {node: node};
|
||||||
const type = geometry.getType();
|
const type = geometry.getType();
|
||||||
/** @type {Array.<module:ol/geom/Geometry>} */
|
/** @type {Array<module:ol/geom/Geometry>} */
|
||||||
let geometries;
|
let geometries;
|
||||||
/** @type {function(*, Array.<*>, string=): (Node|undefined)} */
|
/** @type {function(*, Array<*>, string=): (Node|undefined)} */
|
||||||
let factory;
|
let factory;
|
||||||
if (type == GeometryType.GEOMETRY_COLLECTION) {
|
if (type == GeometryType.GEOMETRY_COLLECTION) {
|
||||||
geometries = /** @type {module:ol/geom/GeometryCollection} */ (geometry).getGeometries();
|
geometries = /** @type {module:ol/geom/GeometryCollection} */ (geometry).getGeometries();
|
||||||
@@ -2602,7 +2602,7 @@ const BOUNDARY_IS_SERIALIZERS = makeStructureNS(
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/LinearRing} linearRing Linear ring.
|
* @param {module:ol/geom/LinearRing} linearRing Linear ring.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function writeBoundaryIs(node, linearRing, objectStack) {
|
function writeBoundaryIs(node, linearRing, objectStack) {
|
||||||
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
|
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
|
||||||
@@ -2637,7 +2637,7 @@ const PLACEMARK_SERIALIZERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Array.<string>>}
|
* @type {Object.<string, Array<string>>}
|
||||||
*/
|
*/
|
||||||
const PLACEMARK_SEQUENCE = makeStructureNS(
|
const PLACEMARK_SEQUENCE = makeStructureNS(
|
||||||
NAMESPACE_URIS, [
|
NAMESPACE_URIS, [
|
||||||
@@ -2649,7 +2649,7 @@ const PLACEMARK_SEQUENCE = makeStructureNS(
|
|||||||
/**
|
/**
|
||||||
* A factory for creating ExtendedData nodes.
|
* A factory for creating ExtendedData nodes.
|
||||||
* @const
|
* @const
|
||||||
* @type {function(*, Array.<*>): (Node|undefined)}
|
* @type {function(*, Array<*>): (Node|undefined)}
|
||||||
*/
|
*/
|
||||||
const EXTENDEDDATA_NODE_FACTORY = makeSimpleNodeFactory('ExtendedData');
|
const EXTENDEDDATA_NODE_FACTORY = makeSimpleNodeFactory('ExtendedData');
|
||||||
|
|
||||||
@@ -2659,7 +2659,7 @@ const EXTENDEDDATA_NODE_FACTORY = makeSimpleNodeFactory('ExtendedData');
|
|||||||
* (ExtendedData).
|
* (ExtendedData).
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/Feature} feature Feature.
|
* @param {module:ol/Feature} feature Feature.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @this {module:ol/format/KML}
|
* @this {module:ol/format/KML}
|
||||||
*/
|
*/
|
||||||
function writePlacemark(node, feature, objectStack) {
|
function writePlacemark(node, feature, objectStack) {
|
||||||
@@ -2723,7 +2723,7 @@ function writePlacemark(node, feature, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Array.<string>>}
|
* @type {Object.<string, Array<string>>}
|
||||||
*/
|
*/
|
||||||
const PRIMITIVE_GEOMETRY_SEQUENCE = makeStructureNS(
|
const PRIMITIVE_GEOMETRY_SEQUENCE = makeStructureNS(
|
||||||
NAMESPACE_URIS, [
|
NAMESPACE_URIS, [
|
||||||
@@ -2747,7 +2747,7 @@ const PRIMITIVE_GEOMETRY_SERIALIZERS = makeStructureNS(
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/SimpleGeometry} geometry Geometry.
|
* @param {module:ol/geom/SimpleGeometry} geometry Geometry.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function writePrimitiveGeometry(node, geometry, objectStack) {
|
function writePrimitiveGeometry(node, geometry, objectStack) {
|
||||||
const flatCoordinates = geometry.getFlatCoordinates();
|
const flatCoordinates = geometry.getFlatCoordinates();
|
||||||
@@ -2783,7 +2783,7 @@ const POLYGON_SERIALIZERS = makeStructureNS(
|
|||||||
/**
|
/**
|
||||||
* A factory for creating innerBoundaryIs nodes.
|
* A factory for creating innerBoundaryIs nodes.
|
||||||
* @const
|
* @const
|
||||||
* @type {function(*, Array.<*>, string=): (Node|undefined)}
|
* @type {function(*, Array<*>, string=): (Node|undefined)}
|
||||||
*/
|
*/
|
||||||
const INNER_BOUNDARY_NODE_FACTORY = makeSimpleNodeFactory('innerBoundaryIs');
|
const INNER_BOUNDARY_NODE_FACTORY = makeSimpleNodeFactory('innerBoundaryIs');
|
||||||
|
|
||||||
@@ -2791,7 +2791,7 @@ const INNER_BOUNDARY_NODE_FACTORY = makeSimpleNodeFactory('innerBoundaryIs');
|
|||||||
/**
|
/**
|
||||||
* A factory for creating outerBoundaryIs nodes.
|
* A factory for creating outerBoundaryIs nodes.
|
||||||
* @const
|
* @const
|
||||||
* @type {function(*, Array.<*>, string=): (Node|undefined)}
|
* @type {function(*, Array<*>, string=): (Node|undefined)}
|
||||||
*/
|
*/
|
||||||
const OUTER_BOUNDARY_NODE_FACTORY = makeSimpleNodeFactory('outerBoundaryIs');
|
const OUTER_BOUNDARY_NODE_FACTORY = makeSimpleNodeFactory('outerBoundaryIs');
|
||||||
|
|
||||||
@@ -2799,7 +2799,7 @@ const OUTER_BOUNDARY_NODE_FACTORY = makeSimpleNodeFactory('outerBoundaryIs');
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/Polygon} polygon Polygon.
|
* @param {module:ol/geom/Polygon} polygon Polygon.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function writePolygon(node, polygon, objectStack) {
|
function writePolygon(node, polygon, objectStack) {
|
||||||
const linearRings = polygon.getLinearRings();
|
const linearRings = polygon.getLinearRings();
|
||||||
@@ -2831,7 +2831,7 @@ const POLY_STYLE_SERIALIZERS = makeStructureNS(
|
|||||||
/**
|
/**
|
||||||
* A factory for creating coordinates nodes.
|
* A factory for creating coordinates nodes.
|
||||||
* @const
|
* @const
|
||||||
* @type {function(*, Array.<*>, string=): (Node|undefined)}
|
* @type {function(*, Array<*>, string=): (Node|undefined)}
|
||||||
*/
|
*/
|
||||||
const COLOR_NODE_FACTORY = makeSimpleNodeFactory('color');
|
const COLOR_NODE_FACTORY = makeSimpleNodeFactory('color');
|
||||||
|
|
||||||
@@ -2839,7 +2839,7 @@ const COLOR_NODE_FACTORY = makeSimpleNodeFactory('color');
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/style/Fill} style Style.
|
* @param {module:ol/style/Fill} style Style.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function writePolyStyle(node, style, objectStack) {
|
function writePolyStyle(node, style, objectStack) {
|
||||||
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
|
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
|
||||||
@@ -2861,7 +2861,7 @@ function writeScaleTextNode(node, scale) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Array.<string>>}
|
* @type {Object.<string, Array<string>>}
|
||||||
*/
|
*/
|
||||||
const STYLE_SEQUENCE = makeStructureNS(
|
const STYLE_SEQUENCE = makeStructureNS(
|
||||||
NAMESPACE_URIS, [
|
NAMESPACE_URIS, [
|
||||||
@@ -2885,7 +2885,7 @@ const STYLE_SERIALIZERS = makeStructureNS(
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/style/Style} style Style.
|
* @param {module:ol/style/Style} style Style.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function writeStyle(node, style, objectStack) {
|
function writeStyle(node, style, objectStack) {
|
||||||
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
|
const /** @type {module:ol/xml~NodeStackItem} */ context = {node: node};
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import RenderFeature from '../render/Feature.js';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} Options
|
* @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
|
* 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
|
* {@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},
|
* decreased rendering performance. The default is {@link module:ol/render/Feature~RenderFeature},
|
||||||
@@ -32,7 +32,7 @@ import RenderFeature from '../render/Feature.js';
|
|||||||
* features.
|
* features.
|
||||||
* @property {string} [layerName='layer'] Name of the feature attribute that
|
* @property {string} [layerName='layer'] Name of the feature attribute that
|
||||||
* holds the layer name.
|
* 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.
|
* provided, features will be read from all layers.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -65,8 +65,8 @@ class MVT extends FeatureFormat {
|
|||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {function((module:ol/geom/Geometry|Object.<string,*>)=)|
|
* @type {function((module:ol/geom/Geometry|Object.<string,*>)=)|
|
||||||
* function(module:ol/geom/GeometryType,Array.<number>,
|
* function(module:ol/geom/GeometryType,Array<number>,
|
||||||
* (Array.<number>|Array.<Array.<number>>),Object.<string,*>,number)}
|
* (Array<number>|Array<Array<number>>),Object.<string,*>,number)}
|
||||||
*/
|
*/
|
||||||
this.featureClass_ = options.featureClass ?
|
this.featureClass_ = options.featureClass ?
|
||||||
options.featureClass : RenderFeature;
|
options.featureClass : RenderFeature;
|
||||||
@@ -85,7 +85,7 @@ class MVT extends FeatureFormat {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array.<string>}
|
* @type {Array<string>}
|
||||||
*/
|
*/
|
||||||
this.layers_ = options.layers ? options.layers : null;
|
this.layers_ = options.layers ? options.layers : null;
|
||||||
|
|
||||||
@@ -103,8 +103,8 @@ class MVT extends FeatureFormat {
|
|||||||
* @suppress {missingProperties}
|
* @suppress {missingProperties}
|
||||||
* @param {Object} pbf PBF.
|
* @param {Object} pbf PBF.
|
||||||
* @param {Object} feature Raw feature.
|
* @param {Object} feature Raw feature.
|
||||||
* @param {Array.<number>} flatCoordinates Array to store flat coordinates in.
|
* @param {Array<number>} flatCoordinates Array to store flat coordinates in.
|
||||||
* @param {Array.<number>} ends Array to store ends in.
|
* @param {Array<number>} ends Array to store ends in.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
readRawGeometry_(pbf, feature, flatCoordinates, ends) {
|
readRawGeometry_(pbf, feature, flatCoordinates, ends) {
|
||||||
@@ -252,7 +252,7 @@ class MVT extends FeatureFormat {
|
|||||||
|
|
||||||
const pbf = new PBF(/** @type {ArrayBuffer} */ (source));
|
const pbf = new PBF(/** @type {ArrayBuffer} */ (source));
|
||||||
const pbfLayers = pbf.readFields(layersPBFReader, {});
|
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 = [];
|
const features = [];
|
||||||
for (const name in pbfLayers) {
|
for (const name in pbfLayers) {
|
||||||
if (layers && layers.indexOf(name) == -1) {
|
if (layers && layers.indexOf(name) == -1) {
|
||||||
@@ -280,7 +280,7 @@ class MVT extends FeatureFormat {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the layers that features will be read from.
|
* Sets the layers that features will be read from.
|
||||||
* @param {Array.<string>} layers Layers.
|
* @param {Array<string>} layers Layers.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
setLayers(layers) {
|
setLayers(layers) {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import {pushParseAndPop, makeStructureNS} from '../xml.js';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Array.<null>}
|
* @type {Array<null>}
|
||||||
*/
|
*/
|
||||||
const NAMESPACE_URIS = [null];
|
const NAMESPACE_URIS = [null];
|
||||||
|
|
||||||
@@ -75,7 +75,7 @@ class OSMXML extends XMLFeature {
|
|||||||
// parse nodes in ways
|
// parse nodes in ways
|
||||||
for (let j = 0; j < state.ways.length; j++) {
|
for (let j = 0; j < state.ways.length; j++) {
|
||||||
const values = /** @type {Object} */ (state.ways[j]);
|
const values = /** @type {Object} */ (state.ways[j]);
|
||||||
/** @type {Array.<number>} */
|
/** @type {Array<number>} */
|
||||||
const flatCoordinates = [];
|
const flatCoordinates = [];
|
||||||
for (let i = 0, ii = values.ndrefs.length; i < ii; i++) {
|
for (let i = 0, ii = values.ndrefs.length; i < ii; i++) {
|
||||||
const point = state.nodes[values.ndrefs[i]];
|
const point = state.nodes[values.ndrefs[i]];
|
||||||
@@ -133,7 +133,7 @@ const NODE_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function readNode(node, objectStack) {
|
function readNode(node, objectStack) {
|
||||||
const options = /** @type {module:ol/format/Feature~ReadOptions} */ (objectStack[0]);
|
const options = /** @type {module:ol/format/Feature~ReadOptions} */ (objectStack[0]);
|
||||||
@@ -162,7 +162,7 @@ function readNode(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function readWay(node, objectStack) {
|
function readWay(node, objectStack) {
|
||||||
const id = node.getAttribute('id');
|
const id = node.getAttribute('id');
|
||||||
@@ -178,7 +178,7 @@ function readWay(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function readNd(node, objectStack) {
|
function readNd(node, objectStack) {
|
||||||
const values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
const values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||||
@@ -188,7 +188,7 @@ function readNd(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function readTag(node, objectStack) {
|
function readTag(node, objectStack) {
|
||||||
const values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
const values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import {makeObjectPropertyPusher, makeObjectPropertySetter, makeStructureNS, pus
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Array.<null|string>}
|
* @type {Array<null|string>}
|
||||||
*/
|
*/
|
||||||
const NAMESPACE_URIS = [null, 'http://www.opengis.net/ows/1.1'];
|
const NAMESPACE_URIS = [null, 'http://www.opengis.net/ows/1.1'];
|
||||||
|
|
||||||
@@ -206,7 +206,7 @@ const SERVICE_PROVIDER_PARSERS =
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} The address.
|
* @return {Object|undefined} The address.
|
||||||
*/
|
*/
|
||||||
function readAddress(node, objectStack) {
|
function readAddress(node, objectStack) {
|
||||||
@@ -217,7 +217,7 @@ function readAddress(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} The values.
|
* @return {Object|undefined} The values.
|
||||||
*/
|
*/
|
||||||
function readAllowedValues(node, objectStack) {
|
function readAllowedValues(node, objectStack) {
|
||||||
@@ -228,7 +228,7 @@ function readAllowedValues(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} The constraint.
|
* @return {Object|undefined} The constraint.
|
||||||
*/
|
*/
|
||||||
function readConstraint(node, objectStack) {
|
function readConstraint(node, objectStack) {
|
||||||
@@ -244,7 +244,7 @@ function readConstraint(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} The contact info.
|
* @return {Object|undefined} The contact info.
|
||||||
*/
|
*/
|
||||||
function readContactInfo(node, objectStack) {
|
function readContactInfo(node, objectStack) {
|
||||||
@@ -255,7 +255,7 @@ function readContactInfo(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} The DCP.
|
* @return {Object|undefined} The DCP.
|
||||||
*/
|
*/
|
||||||
function readDcp(node, objectStack) {
|
function readDcp(node, objectStack) {
|
||||||
@@ -266,7 +266,7 @@ function readDcp(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} The GET object.
|
* @return {Object|undefined} The GET object.
|
||||||
*/
|
*/
|
||||||
function readGet(node, objectStack) {
|
function readGet(node, objectStack) {
|
||||||
@@ -281,7 +281,7 @@ function readGet(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} The HTTP object.
|
* @return {Object|undefined} The HTTP object.
|
||||||
*/
|
*/
|
||||||
function readHttp(node, objectStack) {
|
function readHttp(node, objectStack) {
|
||||||
@@ -291,7 +291,7 @@ function readHttp(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} The operation.
|
* @return {Object|undefined} The operation.
|
||||||
*/
|
*/
|
||||||
function readOperation(node, objectStack) {
|
function readOperation(node, objectStack) {
|
||||||
@@ -309,7 +309,7 @@ function readOperation(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} The operations metadata.
|
* @return {Object|undefined} The operations metadata.
|
||||||
*/
|
*/
|
||||||
function readOperationsMetadata(node, objectStack) {
|
function readOperationsMetadata(node, objectStack) {
|
||||||
@@ -321,7 +321,7 @@ function readOperationsMetadata(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} The phone.
|
* @return {Object|undefined} The phone.
|
||||||
*/
|
*/
|
||||||
function readPhone(node, objectStack) {
|
function readPhone(node, objectStack) {
|
||||||
@@ -332,7 +332,7 @@ function readPhone(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} The service identification.
|
* @return {Object|undefined} The service identification.
|
||||||
*/
|
*/
|
||||||
function readServiceIdentification(node, objectStack) {
|
function readServiceIdentification(node, objectStack) {
|
||||||
@@ -344,7 +344,7 @@ function readServiceIdentification(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} The service contact.
|
* @return {Object|undefined} The service contact.
|
||||||
*/
|
*/
|
||||||
function readServiceContact(node, objectStack) {
|
function readServiceContact(node, objectStack) {
|
||||||
@@ -356,7 +356,7 @@ function readServiceContact(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} The service provider.
|
* @return {Object|undefined} The service provider.
|
||||||
*/
|
*/
|
||||||
function readServiceProvider(node, objectStack) {
|
function readServiceProvider(node, objectStack) {
|
||||||
@@ -368,7 +368,7 @@ function readServiceProvider(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {string|undefined} The value.
|
* @return {string|undefined} The value.
|
||||||
*/
|
*/
|
||||||
function readValue(node, objectStack) {
|
function readValue(node, objectStack) {
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ class Polyline extends TextFeature {
|
|||||||
*
|
*
|
||||||
* Attention: This function will modify the passed array!
|
* 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} stride The number of dimension of the points in the list.
|
||||||
* @param {number=} opt_factor The factor by which the numbers will be
|
* @param {number=} opt_factor The factor by which the numbers will be
|
||||||
* multiplied. The remaining decimal places will get rounded away.
|
* multiplied. The remaining decimal places will get rounded away.
|
||||||
@@ -177,14 +177,14 @@ export function encodeDeltas(numbers, stride, opt_factor) {
|
|||||||
* encoded string.
|
* encoded string.
|
||||||
* @param {number=} opt_factor The factor by which the resulting numbers will
|
* @param {number=} opt_factor The factor by which the resulting numbers will
|
||||||
* be divided. Default is `1e5`.
|
* be divided. Default is `1e5`.
|
||||||
* @return {Array.<number>} A list of n-dimensional points.
|
* @return {Array<number>} A list of n-dimensional points.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function decodeDeltas(encoded, stride, opt_factor) {
|
export function decodeDeltas(encoded, stride, opt_factor) {
|
||||||
const factor = opt_factor ? opt_factor : 1e5;
|
const factor = opt_factor ? opt_factor : 1e5;
|
||||||
let d;
|
let d;
|
||||||
|
|
||||||
/** @type {Array.<number>} */
|
/** @type {Array<number>} */
|
||||||
const lastNumbers = new Array(stride);
|
const lastNumbers = new Array(stride);
|
||||||
for (d = 0; d < stride; ++d) {
|
for (d = 0; d < stride; ++d) {
|
||||||
lastNumbers[d] = 0;
|
lastNumbers[d] = 0;
|
||||||
@@ -209,7 +209,7 @@ export function decodeDeltas(encoded, stride, opt_factor) {
|
|||||||
*
|
*
|
||||||
* Attention: This function will modify the passed array!
|
* 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
|
* @param {number=} opt_factor The factor by which the numbers will be
|
||||||
* multiplied. The remaining decimal places will get rounded away.
|
* multiplied. The remaining decimal places will get rounded away.
|
||||||
* Default is `1e5`.
|
* Default is `1e5`.
|
||||||
@@ -232,7 +232,7 @@ export function encodeFloats(numbers, opt_factor) {
|
|||||||
* @param {string} encoded An encoded string.
|
* @param {string} encoded An encoded string.
|
||||||
* @param {number=} opt_factor The factor by which the result will be divided.
|
* @param {number=} opt_factor The factor by which the result will be divided.
|
||||||
* Default is `1e5`.
|
* Default is `1e5`.
|
||||||
* @return {Array.<number>} A list of floating point numbers.
|
* @return {Array<number>} A list of floating point numbers.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function decodeFloats(encoded, opt_factor) {
|
export function decodeFloats(encoded, opt_factor) {
|
||||||
@@ -250,7 +250,7 @@ export function decodeFloats(encoded, opt_factor) {
|
|||||||
*
|
*
|
||||||
* Attention: This function will modify the passed array!
|
* 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.
|
* @return {string} The encoded string.
|
||||||
*/
|
*/
|
||||||
export function encodeSignedIntegers(numbers) {
|
export function encodeSignedIntegers(numbers) {
|
||||||
@@ -266,7 +266,7 @@ export function encodeSignedIntegers(numbers) {
|
|||||||
* Decode a list of signed integers from an encoded string
|
* Decode a list of signed integers from an encoded string
|
||||||
*
|
*
|
||||||
* @param {string} encoded 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) {
|
export function decodeSignedIntegers(encoded) {
|
||||||
const numbers = decodeUnsignedIntegers(encoded);
|
const numbers = decodeUnsignedIntegers(encoded);
|
||||||
@@ -281,7 +281,7 @@ export function decodeSignedIntegers(encoded) {
|
|||||||
/**
|
/**
|
||||||
* Encode a list of unsigned integers and return an encoded string
|
* 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.
|
* @return {string} The encoded string.
|
||||||
*/
|
*/
|
||||||
export function encodeUnsignedIntegers(numbers) {
|
export function encodeUnsignedIntegers(numbers) {
|
||||||
@@ -297,7 +297,7 @@ export function encodeUnsignedIntegers(numbers) {
|
|||||||
* Decode a list of unsigned integers from an encoded string
|
* Decode a list of unsigned integers from an encoded string
|
||||||
*
|
*
|
||||||
* @param {string} encoded 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) {
|
export function decodeUnsignedIntegers(encoded) {
|
||||||
const numbers = [];
|
const numbers = [];
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ class TextFeature extends FeatureFormat {
|
|||||||
*
|
*
|
||||||
* @param {Document|Node|Object|string} source Source.
|
* @param {Document|Node|Object|string} source Source.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||||
* @return {Array.<module:ol/Feature>} Features.
|
* @return {Array<module:ol/Feature>} Features.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
readFeatures(source, opt_options) {
|
readFeatures(source, opt_options) {
|
||||||
@@ -62,7 +62,7 @@ class TextFeature extends FeatureFormat {
|
|||||||
* @param {string} text Text.
|
* @param {string} text Text.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||||
* @protected
|
* @protected
|
||||||
* @return {Array.<module:ol/Feature>} Features.
|
* @return {Array<module:ol/Feature>} Features.
|
||||||
*/
|
*/
|
||||||
readFeaturesFromText(text, opt_options) {}
|
readFeaturesFromText(text, opt_options) {}
|
||||||
|
|
||||||
@@ -133,7 +133,7 @@ class TextFeature extends FeatureFormat {
|
|||||||
/**
|
/**
|
||||||
* Encode an array of features as string.
|
* 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.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||||
* @return {string} Encoded features.
|
* @return {string} Encoded features.
|
||||||
* @api
|
* @api
|
||||||
@@ -144,7 +144,7 @@ class TextFeature extends FeatureFormat {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @abstract
|
* @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.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||||
* @protected
|
* @protected
|
||||||
* @return {string} Text.
|
* @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'`.
|
* will result in features that have a property `'layer'` set to `'example'`.
|
||||||
* When not set, no property will be added to features.
|
* 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
|
* `objects`'s children to read features from. If not provided, features will
|
||||||
* be read from all children.
|
* be read from all children.
|
||||||
*/
|
*/
|
||||||
@@ -62,7 +62,7 @@ class TopoJSON extends JSONFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array.<string>}
|
* @type {Array<string>}
|
||||||
*/
|
*/
|
||||||
this.layers_ = options.layers ? options.layers : null;
|
this.layers_ = options.layers ? options.layers : null;
|
||||||
|
|
||||||
@@ -91,7 +91,7 @@ class TopoJSON extends JSONFeature {
|
|||||||
if (transform) {
|
if (transform) {
|
||||||
transformArcs(arcs, scale, translate);
|
transformArcs(arcs, scale, translate);
|
||||||
}
|
}
|
||||||
/** @type {Array.<module:ol/Feature>} */
|
/** @type {Array<module:ol/Feature>} */
|
||||||
const features = [];
|
const features = [];
|
||||||
const topoJSONFeatures = topoJSONTopology.objects;
|
const topoJSONFeatures = topoJSONTopology.objects;
|
||||||
const property = this.layerName_;
|
const property = this.layerName_;
|
||||||
@@ -171,14 +171,14 @@ const GEOMETRY_READERS = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Concatenate arcs into a coordinate array.
|
* 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.
|
* 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).
|
* transformed).
|
||||||
* @return {Array.<module:ol/coordinate~Coordinate>} Coordinates array.
|
* @return {Array<module:ol/coordinate~Coordinate>} Coordinates array.
|
||||||
*/
|
*/
|
||||||
function concatenateArcs(indices, arcs) {
|
function concatenateArcs(indices, arcs) {
|
||||||
/** @type {Array.<module:ol/coordinate~Coordinate>} */
|
/** @type {Array<module:ol/coordinate~Coordinate>} */
|
||||||
const coordinates = [];
|
const coordinates = [];
|
||||||
let index, arc;
|
let index, arc;
|
||||||
for (let i = 0, ii = indices.length; i < ii; ++i) {
|
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.
|
* Create a point from a TopoJSON geometry object.
|
||||||
*
|
*
|
||||||
* @param {TopoJSONGeometry} object TopoJSON object.
|
* @param {TopoJSONGeometry} object TopoJSON object.
|
||||||
* @param {Array.<number>} scale Scale for each dimension.
|
* @param {Array<number>} scale Scale for each dimension.
|
||||||
* @param {Array.<number>} translate Translation for each dimension.
|
* @param {Array<number>} translate Translation for each dimension.
|
||||||
* @return {module:ol/geom/Point} Geometry.
|
* @return {module:ol/geom/Point} Geometry.
|
||||||
*/
|
*/
|
||||||
function readPointGeometry(object, scale, translate) {
|
function readPointGeometry(object, scale, translate) {
|
||||||
@@ -225,8 +225,8 @@ function readPointGeometry(object, scale, translate) {
|
|||||||
* Create a multi-point from a TopoJSON geometry object.
|
* Create a multi-point from a TopoJSON geometry object.
|
||||||
*
|
*
|
||||||
* @param {TopoJSONGeometry} object TopoJSON object.
|
* @param {TopoJSONGeometry} object TopoJSON object.
|
||||||
* @param {Array.<number>} scale Scale for each dimension.
|
* @param {Array<number>} scale Scale for each dimension.
|
||||||
* @param {Array.<number>} translate Translation for each dimension.
|
* @param {Array<number>} translate Translation for each dimension.
|
||||||
* @return {module:ol/geom/MultiPoint} Geometry.
|
* @return {module:ol/geom/MultiPoint} Geometry.
|
||||||
*/
|
*/
|
||||||
function readMultiPointGeometry(object, scale, translate) {
|
function readMultiPointGeometry(object, scale, translate) {
|
||||||
@@ -244,7 +244,7 @@ function readMultiPointGeometry(object, scale, translate) {
|
|||||||
* Create a linestring from a TopoJSON geometry object.
|
* Create a linestring from a TopoJSON geometry object.
|
||||||
*
|
*
|
||||||
* @param {TopoJSONGeometry} object TopoJSON 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.
|
* @return {module:ol/geom/LineString} Geometry.
|
||||||
*/
|
*/
|
||||||
function readLineStringGeometry(object, arcs) {
|
function readLineStringGeometry(object, arcs) {
|
||||||
@@ -257,7 +257,7 @@ function readLineStringGeometry(object, arcs) {
|
|||||||
* Create a multi-linestring from a TopoJSON geometry object.
|
* Create a multi-linestring from a TopoJSON geometry object.
|
||||||
*
|
*
|
||||||
* @param {TopoJSONGeometry} object TopoJSON 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.
|
* @return {module:ol/geom/MultiLineString} Geometry.
|
||||||
*/
|
*/
|
||||||
function readMultiLineStringGeometry(object, arcs) {
|
function readMultiLineStringGeometry(object, arcs) {
|
||||||
@@ -273,7 +273,7 @@ function readMultiLineStringGeometry(object, arcs) {
|
|||||||
* Create a polygon from a TopoJSON geometry object.
|
* Create a polygon from a TopoJSON geometry object.
|
||||||
*
|
*
|
||||||
* @param {TopoJSONGeometry} object TopoJSON 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.
|
* @return {module:ol/geom/Polygon} Geometry.
|
||||||
*/
|
*/
|
||||||
function readPolygonGeometry(object, arcs) {
|
function readPolygonGeometry(object, arcs) {
|
||||||
@@ -289,7 +289,7 @@ function readPolygonGeometry(object, arcs) {
|
|||||||
* Create a multi-polygon from a TopoJSON geometry object.
|
* Create a multi-polygon from a TopoJSON geometry object.
|
||||||
*
|
*
|
||||||
* @param {TopoJSONGeometry} object TopoJSON 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.
|
* @return {module:ol/geom/MultiPolygon} Geometry.
|
||||||
*/
|
*/
|
||||||
function readMultiPolygonGeometry(object, arcs) {
|
function readMultiPolygonGeometry(object, arcs) {
|
||||||
@@ -313,14 +313,14 @@ function readMultiPolygonGeometry(object, arcs) {
|
|||||||
*
|
*
|
||||||
* @param {TopoJSONGeometryCollection} collection TopoJSON Geometry
|
* @param {TopoJSONGeometryCollection} collection TopoJSON Geometry
|
||||||
* object.
|
* object.
|
||||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
* @param {Array<Array<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||||
* @param {Array.<number>} scale Scale for each dimension.
|
* @param {Array<number>} scale Scale for each dimension.
|
||||||
* @param {Array.<number>} translate Translation for each dimension.
|
* @param {Array<number>} translate Translation for each dimension.
|
||||||
* @param {string|undefined} property Property to set the `GeometryCollection`'s parent
|
* @param {string|undefined} property Property to set the `GeometryCollection`'s parent
|
||||||
* object to.
|
* object to.
|
||||||
* @param {string} name Name of the `Topology`'s child object.
|
* @param {string} name Name of the `Topology`'s child object.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
* @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) {
|
function readFeaturesFromGeometryCollection(collection, arcs, scale, translate, property, name, opt_options) {
|
||||||
const geometries = collection.geometries;
|
const geometries = collection.geometries;
|
||||||
@@ -337,9 +337,9 @@ function readFeaturesFromGeometryCollection(collection, arcs, scale, translate,
|
|||||||
* Create a feature from a TopoJSON geometry object.
|
* Create a feature from a TopoJSON geometry object.
|
||||||
*
|
*
|
||||||
* @param {TopoJSONGeometry} object TopoJSON geometry object.
|
* @param {TopoJSONGeometry} object TopoJSON geometry object.
|
||||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
* @param {Array<Array<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||||
* @param {Array.<number>} scale Scale for each dimension.
|
* @param {Array<number>} scale Scale for each dimension.
|
||||||
* @param {Array.<number>} translate Translation for each dimension.
|
* @param {Array<number>} translate Translation for each dimension.
|
||||||
* @param {string|undefined} property Property to set the `GeometryCollection`'s parent
|
* @param {string|undefined} property Property to set the `GeometryCollection`'s parent
|
||||||
* object to.
|
* object to.
|
||||||
* @param {string} name Name of the `Topology`'s child object.
|
* @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
|
* Apply a linear transform to array of arcs. The provided array of arcs is
|
||||||
* modified in place.
|
* modified in place.
|
||||||
*
|
*
|
||||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
* @param {Array<Array<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||||
* @param {Array.<number>} scale Scale for each dimension.
|
* @param {Array<number>} scale Scale for each dimension.
|
||||||
* @param {Array.<number>} translate Translation for each dimension.
|
* @param {Array<number>} translate Translation for each dimension.
|
||||||
*/
|
*/
|
||||||
function transformArcs(arcs, scale, translate) {
|
function transformArcs(arcs, scale, translate) {
|
||||||
for (let i = 0, ii = arcs.length; i < ii; ++i) {
|
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.
|
* Apply a linear transform to an arc. The provided arc is modified in place.
|
||||||
*
|
*
|
||||||
* @param {Array.<module:ol/coordinate~Coordinate>} arc Arc.
|
* @param {Array<module:ol/coordinate~Coordinate>} arc Arc.
|
||||||
* @param {Array.<number>} scale Scale for each dimension.
|
* @param {Array<number>} scale Scale for each dimension.
|
||||||
* @param {Array.<number>} translate Translation for each dimension.
|
* @param {Array<number>} translate Translation for each dimension.
|
||||||
*/
|
*/
|
||||||
function transformArc(arc, scale, translate) {
|
function transformArc(arc, scale, translate) {
|
||||||
let x = 0;
|
let x = 0;
|
||||||
@@ -416,8 +416,8 @@ function transformArc(arc, scale, translate) {
|
|||||||
* place.
|
* place.
|
||||||
*
|
*
|
||||||
* @param {module:ol/coordinate~Coordinate} vertex Vertex.
|
* @param {module:ol/coordinate~Coordinate} vertex Vertex.
|
||||||
* @param {Array.<number>} scale Scale for each dimension.
|
* @param {Array<number>} scale Scale for each dimension.
|
||||||
* @param {Array.<number>} translate Translation for each dimension.
|
* @param {Array<number>} translate Translation for each dimension.
|
||||||
*/
|
*/
|
||||||
function transformVertex(vertex, scale, translate) {
|
function transformVertex(vertex, scale, translate) {
|
||||||
vertex[0] = vertex[0] * scale[0] + translate[0];
|
vertex[0] = vertex[0] * scale[0] + translate[0];
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ const TRANSACTION_SERIALIZERS = {
|
|||||||
/**
|
/**
|
||||||
* @typedef {Object} Options
|
* @typedef {Object} Options
|
||||||
* @property {Object.<string, string>|string} [featureNS] The namespace URI used for features.
|
* @property {Object.<string, string>|string} [featureNS] The namespace URI used for features.
|
||||||
* @property {Array.<string>|string} [featureType] The feature type to parse. Only used for read operations.
|
* @property {Array<string>|string} [featureType] The feature type to parse. Only used for read operations.
|
||||||
* @property {module:ol/format/GMLBase} [gmlFormat] The GML format to use to parse the response. Default is `ol/format/GML3`.
|
* @property {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.
|
* @property {string} [schemaLocation] Optional schemaLocation to use for serialization, this will override the default.
|
||||||
*/
|
*/
|
||||||
@@ -92,14 +92,14 @@ const TRANSACTION_SERIALIZERS = {
|
|||||||
* @typedef {Object} WriteGetFeatureOptions
|
* @typedef {Object} WriteGetFeatureOptions
|
||||||
* @property {string} featureNS The namespace URI used for features.
|
* @property {string} featureNS The namespace URI used for features.
|
||||||
* @property {string} featurePrefix The prefix for the feature namespace.
|
* @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
|
* @property {string} [srsName] SRS name. No srsName attribute will be set on
|
||||||
* geometries when this is not provided.
|
* geometries when this is not provided.
|
||||||
* @property {string} [handle] Handle.
|
* @property {string} [handle] Handle.
|
||||||
* @property {string} [outputFormat] Output format.
|
* @property {string} [outputFormat] Output format.
|
||||||
* @property {number} [maxFeatures] Maximum number of features to fetch.
|
* @property {number} [maxFeatures] Maximum number of features to fetch.
|
||||||
* @property {string} [geometryName] Geometry name to use in a BBOX filter.
|
* @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
|
* @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.
|
* 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
|
* @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 {string} [handle] Handle.
|
||||||
* @property {boolean} [hasZ] Must be set to true if the transaction is for
|
* @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.
|
* 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 {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`.
|
* @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} totalDeleted
|
||||||
* @property {number} totalInserted
|
* @property {number} totalInserted
|
||||||
* @property {number} totalUpdated
|
* @property {number} totalUpdated
|
||||||
* @property {Array.<string>} insertIds
|
* @property {Array<string>} insertIds
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -214,7 +214,7 @@ class WFS extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array.<string>|string|undefined}
|
* @type {Array<string>|string|undefined}
|
||||||
*/
|
*/
|
||||||
this.featureType_ = options.featureType;
|
this.featureType_ = options.featureType;
|
||||||
|
|
||||||
@@ -240,14 +240,14 @@ class WFS extends XMLFeature {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {Array.<string>|string|undefined} featureType
|
* @return {Array<string>|string|undefined} featureType
|
||||||
*/
|
*/
|
||||||
getFeatureType() {
|
getFeatureType() {
|
||||||
return this.featureType_;
|
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) {
|
setFeatureType(featureType) {
|
||||||
this.featureType_ = featureType;
|
this.featureType_ = featureType;
|
||||||
@@ -429,16 +429,16 @@ class WFS extends XMLFeature {
|
|||||||
};
|
};
|
||||||
assert(Array.isArray(options.featureTypes),
|
assert(Array.isArray(options.featureTypes),
|
||||||
11); // `options.featureTypes` should be an Array
|
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;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Encode format as WFS `Transaction` and return the 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>} inserts The features to insert.
|
||||||
* @param {Array.<module:ol/Feature>} updates The features to update.
|
* @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>} deletes The features to delete.
|
||||||
* @param {module:ol/format/WFS~WriteTransactionOptions} options Write options.
|
* @param {module:ol/format/WFS~WriteTransactionOptions} options Write options.
|
||||||
* @return {Node} Result.
|
* @return {Node} Result.
|
||||||
* @api
|
* @api
|
||||||
@@ -538,7 +538,7 @@ class WFS extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Transaction Summary.
|
* @return {Object|undefined} Transaction Summary.
|
||||||
*/
|
*/
|
||||||
function readTransactionSummary(node, objectStack) {
|
function readTransactionSummary(node, objectStack) {
|
||||||
@@ -562,7 +562,7 @@ const OGC_FID_PARSERS = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function fidParser(node, objectStack) {
|
function fidParser(node, objectStack) {
|
||||||
parseNode(OGC_FID_PARSERS, node, objectStack);
|
parseNode(OGC_FID_PARSERS, node, objectStack);
|
||||||
@@ -582,8 +582,8 @@ const INSERT_RESULTS_PARSERS = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Array.<string>|undefined} Insert results.
|
* @return {Array<string>|undefined} Insert results.
|
||||||
*/
|
*/
|
||||||
function readInsertResults(node, objectStack) {
|
function readInsertResults(node, objectStack) {
|
||||||
return pushParseAndPop(
|
return pushParseAndPop(
|
||||||
@@ -594,7 +594,7 @@ function readInsertResults(node, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/Feature} feature Feature.
|
* @param {module:ol/Feature} feature Feature.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeFeature(node, feature, objectStack) {
|
function writeFeature(node, feature, objectStack) {
|
||||||
const context = objectStack[objectStack.length - 1];
|
const context = objectStack[objectStack.length - 1];
|
||||||
@@ -614,7 +614,7 @@ function writeFeature(node, feature, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {number|string} fid Feature identifier.
|
* @param {number|string} fid Feature identifier.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeOgcFidFilter(node, fid, objectStack) {
|
function writeOgcFidFilter(node, fid, objectStack) {
|
||||||
const filter = createElementNS(OGCNS, 'Filter');
|
const filter = createElementNS(OGCNS, 'Filter');
|
||||||
@@ -645,7 +645,7 @@ function getTypeName(featurePrefix, featureType) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/Feature} feature Feature.
|
* @param {module:ol/Feature} feature Feature.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeDelete(node, feature, objectStack) {
|
function writeDelete(node, feature, objectStack) {
|
||||||
const context = objectStack[objectStack.length - 1];
|
const context = objectStack[objectStack.length - 1];
|
||||||
@@ -666,7 +666,7 @@ function writeDelete(node, feature, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/Feature} feature Feature.
|
* @param {module:ol/Feature} feature Feature.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeUpdate(node, feature, objectStack) {
|
function writeUpdate(node, feature, objectStack) {
|
||||||
const context = objectStack[objectStack.length - 1];
|
const context = objectStack[objectStack.length - 1];
|
||||||
@@ -706,7 +706,7 @@ function writeUpdate(node, feature, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Object} pair Property name and value.
|
* @param {Object} pair Property name and value.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeProperty(node, pair, objectStack) {
|
function writeProperty(node, pair, objectStack) {
|
||||||
const name = createElementNS(WFSNS, 'Name');
|
const name = createElementNS(WFSNS, 'Name');
|
||||||
@@ -735,7 +735,7 @@ function writeProperty(node, pair, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {{vendorId: string, safeToIgnore: boolean, value: string}} nativeElement The native element.
|
* @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) {
|
function writeNative(node, nativeElement, objectStack) {
|
||||||
if (nativeElement.vendorId) {
|
if (nativeElement.vendorId) {
|
||||||
@@ -782,7 +782,7 @@ const GETFEATURE_SERIALIZERS = {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {string} featureType Feature type.
|
* @param {string} featureType Feature type.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeQuery(node, featureType, objectStack) {
|
function writeQuery(node, featureType, objectStack) {
|
||||||
const context = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
const context = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||||
@@ -822,7 +822,7 @@ function writeQuery(node, featureType, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/format/filter/Filter} filter Filter.
|
* @param {module:ol/format/filter/Filter} filter Filter.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeFilterCondition(node, filter, objectStack) {
|
function writeFilterCondition(node, filter, objectStack) {
|
||||||
/** @type {module:ol/xml~NodeStackItem} */
|
/** @type {module:ol/xml~NodeStackItem} */
|
||||||
@@ -837,7 +837,7 @@ function writeFilterCondition(node, filter, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/format/filter/Bbox} filter Filter.
|
* @param {module:ol/format/filter/Bbox} filter Filter.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeBboxFilter(node, filter, objectStack) {
|
function writeBboxFilter(node, filter, objectStack) {
|
||||||
const context = objectStack[objectStack.length - 1];
|
const context = objectStack[objectStack.length - 1];
|
||||||
@@ -851,7 +851,7 @@ function writeBboxFilter(node, filter, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/format/filter/Contains} filter Filter.
|
* @param {module:ol/format/filter/Contains} filter Filter.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeContainsFilter(node, filter, objectStack) {
|
function writeContainsFilter(node, filter, objectStack) {
|
||||||
const context = objectStack[objectStack.length - 1];
|
const context = objectStack[objectStack.length - 1];
|
||||||
@@ -865,7 +865,7 @@ function writeContainsFilter(node, filter, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/format/filter/Intersects} filter Filter.
|
* @param {module:ol/format/filter/Intersects} filter Filter.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeIntersectsFilter(node, filter, objectStack) {
|
function writeIntersectsFilter(node, filter, objectStack) {
|
||||||
const context = objectStack[objectStack.length - 1];
|
const context = objectStack[objectStack.length - 1];
|
||||||
@@ -879,7 +879,7 @@ function writeIntersectsFilter(node, filter, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/format/filter/Within} filter Filter.
|
* @param {module:ol/format/filter/Within} filter Filter.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeWithinFilter(node, filter, objectStack) {
|
function writeWithinFilter(node, filter, objectStack) {
|
||||||
const context = objectStack[objectStack.length - 1];
|
const context = objectStack[objectStack.length - 1];
|
||||||
@@ -893,7 +893,7 @@ function writeWithinFilter(node, filter, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/format/filter/During} filter Filter.
|
* @param {module:ol/format/filter/During} filter Filter.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeDuringFilter(node, filter, objectStack) {
|
function writeDuringFilter(node, filter, objectStack) {
|
||||||
|
|
||||||
@@ -918,7 +918,7 @@ function writeDuringFilter(node, filter, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/format/filter/LogicalNary} filter Filter.
|
* @param {module:ol/format/filter/LogicalNary} filter Filter.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeLogicalFilter(node, filter, objectStack) {
|
function writeLogicalFilter(node, filter, objectStack) {
|
||||||
/** @type {module:ol/xml~NodeStackItem} */
|
/** @type {module:ol/xml~NodeStackItem} */
|
||||||
@@ -937,7 +937,7 @@ function writeLogicalFilter(node, filter, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/format/filter/Not} filter Filter.
|
* @param {module:ol/format/filter/Not} filter Filter.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeNotFilter(node, filter, objectStack) {
|
function writeNotFilter(node, filter, objectStack) {
|
||||||
/** @type {module:ol/xml~NodeStackItem} */
|
/** @type {module:ol/xml~NodeStackItem} */
|
||||||
@@ -953,7 +953,7 @@ function writeNotFilter(node, filter, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/format/filter/ComparisonBinary} filter Filter.
|
* @param {module:ol/format/filter/ComparisonBinary} filter Filter.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeComparisonFilter(node, filter, objectStack) {
|
function writeComparisonFilter(node, filter, objectStack) {
|
||||||
if (filter.matchCase !== undefined) {
|
if (filter.matchCase !== undefined) {
|
||||||
@@ -967,7 +967,7 @@ function writeComparisonFilter(node, filter, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/format/filter/IsNull} filter Filter.
|
* @param {module:ol/format/filter/IsNull} filter Filter.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeIsNullFilter(node, filter, objectStack) {
|
function writeIsNullFilter(node, filter, objectStack) {
|
||||||
writeOgcPropertyName(node, filter.propertyName);
|
writeOgcPropertyName(node, filter.propertyName);
|
||||||
@@ -977,7 +977,7 @@ function writeIsNullFilter(node, filter, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/format/filter/IsBetween} filter Filter.
|
* @param {module:ol/format/filter/IsBetween} filter Filter.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeIsBetweenFilter(node, filter, objectStack) {
|
function writeIsBetweenFilter(node, filter, objectStack) {
|
||||||
writeOgcPropertyName(node, filter.propertyName);
|
writeOgcPropertyName(node, filter.propertyName);
|
||||||
@@ -995,7 +995,7 @@ function writeIsBetweenFilter(node, filter, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/format/filter/IsLike} filter Filter.
|
* @param {module:ol/format/filter/IsLike} filter Filter.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeIsLikeFilter(node, filter, objectStack) {
|
function writeIsLikeFilter(node, filter, objectStack) {
|
||||||
node.setAttribute('wildCard', filter.wildCard);
|
node.setAttribute('wildCard', filter.wildCard);
|
||||||
@@ -1069,8 +1069,8 @@ export function writeFilter(filter) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<string>} featureTypes Feature types.
|
* @param {Array<string>} featureTypes Feature types.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeGetFeature(node, featureTypes, objectStack) {
|
function writeGetFeature(node, featureTypes, objectStack) {
|
||||||
const context = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
const context = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||||
|
|||||||
@@ -321,7 +321,7 @@ class Parser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {!Array.<module:ol/geom/Geometry>} A collection of geometries.
|
* @return {!Array<module:ol/geom/Geometry>} A collection of geometries.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
parseGeometryCollectionText_() {
|
parseGeometryCollectionText_() {
|
||||||
@@ -340,7 +340,7 @@ class Parser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {Array.<number>} All values in a point.
|
* @return {Array<number>} All values in a point.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
parsePointText_() {
|
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
|
* @private
|
||||||
*/
|
*/
|
||||||
parseLineStringText_() {
|
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
|
* @private
|
||||||
*/
|
*/
|
||||||
parsePolygonText_() {
|
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
|
* @private
|
||||||
*/
|
*/
|
||||||
parseMultiPointText_() {
|
parseMultiPointText_() {
|
||||||
@@ -409,7 +409,7 @@ class Parser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {!Array.<!Array.<number>>} All linestring points
|
* @return {!Array<!Array<number>>} All linestring points
|
||||||
* in a multilinestring.
|
* in a multilinestring.
|
||||||
* @private
|
* @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
|
* @private
|
||||||
*/
|
*/
|
||||||
parseMultiPolygonText_() {
|
parseMultiPolygonText_() {
|
||||||
@@ -442,7 +442,7 @@ class Parser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {!Array.<number>} A point.
|
* @return {!Array<number>} A point.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
parsePoint_() {
|
parsePoint_() {
|
||||||
@@ -463,7 +463,7 @@ class Parser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {!Array.<!Array.<number>>} An array of points.
|
* @return {!Array<!Array<number>>} An array of points.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
parsePointList_() {
|
parsePointList_() {
|
||||||
@@ -475,7 +475,7 @@ class Parser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {!Array.<!Array.<number>>} An array of points.
|
* @return {!Array<!Array<number>>} An array of points.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
parsePointTextList_() {
|
parsePointTextList_() {
|
||||||
@@ -487,7 +487,7 @@ class Parser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {!Array.<!Array.<number>>} An array of points.
|
* @return {!Array<!Array<number>>} An array of points.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
parseLineStringTextList_() {
|
parseLineStringTextList_() {
|
||||||
@@ -499,7 +499,7 @@ class Parser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {!Array.<!Array.<number>>} An array of points.
|
* @return {!Array<!Array<number>>} An array of points.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
parsePolygonTextList_() {
|
parsePolygonTextList_() {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {makeArrayPusher, makeObjectPropertyPusher, makeObjectPropertySetter,
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Array.<null|string>}
|
* @type {Array<null|string>}
|
||||||
*/
|
*/
|
||||||
const NAMESPACE_URIS = [
|
const NAMESPACE_URIS = [
|
||||||
null,
|
null,
|
||||||
@@ -287,7 +287,7 @@ const KEYWORDLIST_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Attribution object.
|
* @return {Object|undefined} Attribution object.
|
||||||
*/
|
*/
|
||||||
function readAttribution(node, objectStack) {
|
function readAttribution(node, objectStack) {
|
||||||
@@ -297,7 +297,7 @@ function readAttribution(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object} Bounding box object.
|
* @return {Object} Bounding box object.
|
||||||
*/
|
*/
|
||||||
function readBoundingBox(node, objectStack) {
|
function readBoundingBox(node, objectStack) {
|
||||||
@@ -323,7 +323,7 @@ function readBoundingBox(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/extent~Extent|undefined} Bounding box object.
|
* @return {module:ol/extent~Extent|undefined} Bounding box object.
|
||||||
*/
|
*/
|
||||||
function readEXGeographicBoundingBox(node, objectStack) {
|
function readEXGeographicBoundingBox(node, objectStack) {
|
||||||
@@ -355,7 +355,7 @@ function readEXGeographicBoundingBox(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Capability object.
|
* @return {Object|undefined} Capability object.
|
||||||
*/
|
*/
|
||||||
function readCapability(node, objectStack) {
|
function readCapability(node, objectStack) {
|
||||||
@@ -365,7 +365,7 @@ function readCapability(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Service object.
|
* @return {Object|undefined} Service object.
|
||||||
*/
|
*/
|
||||||
function readService(node, objectStack) {
|
function readService(node, objectStack) {
|
||||||
@@ -375,7 +375,7 @@ function readService(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Contact information object.
|
* @return {Object|undefined} Contact information object.
|
||||||
*/
|
*/
|
||||||
function readContactInformation(node, objectStack) {
|
function readContactInformation(node, objectStack) {
|
||||||
@@ -385,7 +385,7 @@ function readContactInformation(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Contact person object.
|
* @return {Object|undefined} Contact person object.
|
||||||
*/
|
*/
|
||||||
function readContactPersonPrimary(node, objectStack) {
|
function readContactPersonPrimary(node, objectStack) {
|
||||||
@@ -395,7 +395,7 @@ function readContactPersonPrimary(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Contact address object.
|
* @return {Object|undefined} Contact address object.
|
||||||
*/
|
*/
|
||||||
function readContactAddress(node, objectStack) {
|
function readContactAddress(node, objectStack) {
|
||||||
@@ -405,8 +405,8 @@ function readContactAddress(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Array.<string>|undefined} Format array.
|
* @return {Array<string>|undefined} Format array.
|
||||||
*/
|
*/
|
||||||
function readException(node, objectStack) {
|
function readException(node, objectStack) {
|
||||||
return pushParseAndPop([], EXCEPTION_PARSERS, node, objectStack);
|
return pushParseAndPop([], EXCEPTION_PARSERS, node, objectStack);
|
||||||
@@ -415,7 +415,7 @@ function readException(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Layer object.
|
* @return {Object|undefined} Layer object.
|
||||||
*/
|
*/
|
||||||
function readCapabilityLayer(node, objectStack) {
|
function readCapabilityLayer(node, objectStack) {
|
||||||
@@ -425,7 +425,7 @@ function readCapabilityLayer(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Layer object.
|
* @return {Object|undefined} Layer object.
|
||||||
*/
|
*/
|
||||||
function readLayer(node, objectStack) {
|
function readLayer(node, objectStack) {
|
||||||
@@ -497,7 +497,7 @@ function readLayer(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object} Dimension object.
|
* @return {Object} Dimension object.
|
||||||
*/
|
*/
|
||||||
function readDimension(node, objectStack) {
|
function readDimension(node, objectStack) {
|
||||||
@@ -517,7 +517,7 @@ function readDimension(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Online resource object.
|
* @return {Object|undefined} Online resource object.
|
||||||
*/
|
*/
|
||||||
function readFormatOnlineresource(node, objectStack) {
|
function readFormatOnlineresource(node, objectStack) {
|
||||||
@@ -527,7 +527,7 @@ function readFormatOnlineresource(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Request object.
|
* @return {Object|undefined} Request object.
|
||||||
*/
|
*/
|
||||||
function readRequest(node, objectStack) {
|
function readRequest(node, objectStack) {
|
||||||
@@ -537,7 +537,7 @@ function readRequest(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} DCP type object.
|
* @return {Object|undefined} DCP type object.
|
||||||
*/
|
*/
|
||||||
function readDCPType(node, objectStack) {
|
function readDCPType(node, objectStack) {
|
||||||
@@ -547,7 +547,7 @@ function readDCPType(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} HTTP object.
|
* @return {Object|undefined} HTTP object.
|
||||||
*/
|
*/
|
||||||
function readHTTP(node, objectStack) {
|
function readHTTP(node, objectStack) {
|
||||||
@@ -557,7 +557,7 @@ function readHTTP(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Operation type object.
|
* @return {Object|undefined} Operation type object.
|
||||||
*/
|
*/
|
||||||
function readOperationType(node, objectStack) {
|
function readOperationType(node, objectStack) {
|
||||||
@@ -567,7 +567,7 @@ function readOperationType(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Online resource object.
|
* @return {Object|undefined} Online resource object.
|
||||||
*/
|
*/
|
||||||
function readSizedFormatOnlineresource(node, objectStack) {
|
function readSizedFormatOnlineresource(node, objectStack) {
|
||||||
@@ -586,7 +586,7 @@ function readSizedFormatOnlineresource(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Authority URL object.
|
* @return {Object|undefined} Authority URL object.
|
||||||
*/
|
*/
|
||||||
function readAuthorityURL(node, objectStack) {
|
function readAuthorityURL(node, objectStack) {
|
||||||
@@ -601,7 +601,7 @@ function readAuthorityURL(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Metadata URL object.
|
* @return {Object|undefined} Metadata URL object.
|
||||||
*/
|
*/
|
||||||
function readMetadataURL(node, objectStack) {
|
function readMetadataURL(node, objectStack) {
|
||||||
@@ -616,7 +616,7 @@ function readMetadataURL(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Style object.
|
* @return {Object|undefined} Style object.
|
||||||
*/
|
*/
|
||||||
function readStyle(node, objectStack) {
|
function readStyle(node, objectStack) {
|
||||||
@@ -626,8 +626,8 @@ function readStyle(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Array.<string>|undefined} Keyword list.
|
* @return {Array<string>|undefined} Keyword list.
|
||||||
*/
|
*/
|
||||||
function readKeywordList(node, objectStack) {
|
function readKeywordList(node, objectStack) {
|
||||||
return pushParseAndPop([], KEYWORDLIST_PARSERS, node, objectStack);
|
return pushParseAndPop([], KEYWORDLIST_PARSERS, node, objectStack);
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {makeArrayPusher, makeStructureNS, pushParseAndPop} from '../xml.js';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} Options
|
* @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
|
* @private
|
||||||
* @type {Array.<string>}
|
* @type {Array<string>}
|
||||||
*/
|
*/
|
||||||
this.layers_ = options.layers ? options.layers : null;
|
this.layers_ = options.layers ? options.layers : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {Array.<string>} layers
|
* @return {Array<string>} layers
|
||||||
*/
|
*/
|
||||||
getLayers() {
|
getLayers() {
|
||||||
return this.layers_;
|
return this.layers_;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array.<string>} layers Layers to parse.
|
* @param {Array<string>} layers Layers to parse.
|
||||||
*/
|
*/
|
||||||
setLayers(layers) {
|
setLayers(layers) {
|
||||||
this.layers_ = layers;
|
this.layers_ = layers;
|
||||||
@@ -82,14 +82,14 @@ class WMSGetFeatureInfo extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Array.<module:ol/Feature>} Features.
|
* @return {Array<module:ol/Feature>} Features.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
readFeatures_(node, objectStack) {
|
readFeatures_(node, objectStack) {
|
||||||
node.setAttribute('namespaceURI', this.featureNS_);
|
node.setAttribute('namespaceURI', this.featureNS_);
|
||||||
const localName = node.localName;
|
const localName = node.localName;
|
||||||
/** @type {Array.<module:ol/Feature>} */
|
/** @type {Array<module:ol/Feature>} */
|
||||||
let features = [];
|
let features = [];
|
||||||
if (node.childNodes.length === 0) {
|
if (node.childNodes.length === 0) {
|
||||||
return features;
|
return features;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import {pushParseAndPop, makeStructureNS,
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Array.<null|string>}
|
* @type {Array<null|string>}
|
||||||
*/
|
*/
|
||||||
const NAMESPACE_URIS = [
|
const NAMESPACE_URIS = [
|
||||||
null,
|
null,
|
||||||
@@ -22,7 +22,7 @@ const NAMESPACE_URIS = [
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Array.<null|string>}
|
* @type {Array<null|string>}
|
||||||
*/
|
*/
|
||||||
const OWS_NAMESPACE_URIS = [
|
const OWS_NAMESPACE_URIS = [
|
||||||
null,
|
null,
|
||||||
@@ -219,7 +219,7 @@ const TM_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Attribution object.
|
* @return {Object|undefined} Attribution object.
|
||||||
*/
|
*/
|
||||||
function readContents(node, objectStack) {
|
function readContents(node, objectStack) {
|
||||||
@@ -229,7 +229,7 @@ function readContents(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Layers object.
|
* @return {Object|undefined} Layers object.
|
||||||
*/
|
*/
|
||||||
function readLayer(node, objectStack) {
|
function readLayer(node, objectStack) {
|
||||||
@@ -239,7 +239,7 @@ function readLayer(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Tile Matrix Set object.
|
* @return {Object|undefined} Tile Matrix Set object.
|
||||||
*/
|
*/
|
||||||
function readTileMatrixSet(node, objectStack) {
|
function readTileMatrixSet(node, objectStack) {
|
||||||
@@ -249,7 +249,7 @@ function readTileMatrixSet(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Style object.
|
* @return {Object|undefined} Style object.
|
||||||
*/
|
*/
|
||||||
function readStyle(node, objectStack) {
|
function readStyle(node, objectStack) {
|
||||||
@@ -266,7 +266,7 @@ function readStyle(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Tile Matrix Set Link object.
|
* @return {Object|undefined} Tile Matrix Set Link object.
|
||||||
*/
|
*/
|
||||||
function readTileMatrixSetLink(node, objectStack) {
|
function readTileMatrixSetLink(node, objectStack) {
|
||||||
@@ -276,7 +276,7 @@ function readTileMatrixSetLink(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Dimension object.
|
* @return {Object|undefined} Dimension object.
|
||||||
*/
|
*/
|
||||||
function readDimensions(node, objectStack) {
|
function readDimensions(node, objectStack) {
|
||||||
@@ -286,7 +286,7 @@ function readDimensions(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Resource URL object.
|
* @return {Object|undefined} Resource URL object.
|
||||||
*/
|
*/
|
||||||
function readResourceUrl(node, objectStack) {
|
function readResourceUrl(node, objectStack) {
|
||||||
@@ -309,7 +309,7 @@ function readResourceUrl(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} WGS84 BBox object.
|
* @return {Object|undefined} WGS84 BBox object.
|
||||||
*/
|
*/
|
||||||
function readWgs84BoundingBox(node, objectStack) {
|
function readWgs84BoundingBox(node, objectStack) {
|
||||||
@@ -323,7 +323,7 @@ function readWgs84BoundingBox(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Legend object.
|
* @return {Object|undefined} Legend object.
|
||||||
*/
|
*/
|
||||||
function readLegendUrl(node, objectStack) {
|
function readLegendUrl(node, objectStack) {
|
||||||
@@ -336,7 +336,7 @@ function readLegendUrl(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Coordinates object.
|
* @return {Object|undefined} Coordinates object.
|
||||||
*/
|
*/
|
||||||
function readCoordinates(node, objectStack) {
|
function readCoordinates(node, objectStack) {
|
||||||
@@ -355,7 +355,7 @@ function readCoordinates(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} TileMatrix object.
|
* @return {Object|undefined} TileMatrix object.
|
||||||
*/
|
*/
|
||||||
function readTileMatrix(node, objectStack) {
|
function readTileMatrix(node, objectStack) {
|
||||||
@@ -365,7 +365,7 @@ function readTileMatrix(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} TileMatrixSetLimits Object.
|
* @return {Object|undefined} TileMatrixSetLimits Object.
|
||||||
*/
|
*/
|
||||||
function readTileMatrixLimitsList(node, objectStack) {
|
function readTileMatrixLimitsList(node, objectStack) {
|
||||||
@@ -375,7 +375,7 @@ function readTileMatrixLimitsList(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} TileMatrixLimits Array.
|
* @return {Object|undefined} TileMatrixLimits Array.
|
||||||
*/
|
*/
|
||||||
function readTileMatrixLimits(node, objectStack) {
|
function readTileMatrixLimits(node, objectStack) {
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ class XMLFeature extends FeatureFormat {
|
|||||||
* @function
|
* @function
|
||||||
* @param {Document|Node|Object|string} source Source.
|
* @param {Document|Node|Object|string} source Source.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Options.
|
* @param {module:ol/format/Feature~ReadOptions=} opt_options Options.
|
||||||
* @return {Array.<module:ol/Feature>} Features.
|
* @return {Array<module:ol/Feature>} Features.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
readFeatures(source, opt_options) {
|
readFeatures(source, opt_options) {
|
||||||
@@ -103,10 +103,10 @@ class XMLFeature extends FeatureFormat {
|
|||||||
* @param {Document} doc Document.
|
* @param {Document} doc Document.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Options.
|
* @param {module:ol/format/Feature~ReadOptions=} opt_options Options.
|
||||||
* @protected
|
* @protected
|
||||||
* @return {Array.<module:ol/Feature>} Features.
|
* @return {Array<module:ol/Feature>} Features.
|
||||||
*/
|
*/
|
||||||
readFeaturesFromDocument(doc, opt_options) {
|
readFeaturesFromDocument(doc, opt_options) {
|
||||||
/** @type {Array.<module:ol/Feature>} */
|
/** @type {Array<module:ol/Feature>} */
|
||||||
const features = [];
|
const features = [];
|
||||||
for (let n = doc.firstChild; n; n = n.nextSibling) {
|
for (let n = doc.firstChild; n; n = n.nextSibling) {
|
||||||
if (n.nodeType == Node.ELEMENT_NODE) {
|
if (n.nodeType == Node.ELEMENT_NODE) {
|
||||||
@@ -121,7 +121,7 @@ class XMLFeature extends FeatureFormat {
|
|||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Options.
|
* @param {module:ol/format/Feature~ReadOptions=} opt_options Options.
|
||||||
* @protected
|
* @protected
|
||||||
* @return {Array.<module:ol/Feature>} Features.
|
* @return {Array<module:ol/Feature>} Features.
|
||||||
*/
|
*/
|
||||||
readFeaturesFromNode(node, opt_options) {}
|
readFeaturesFromNode(node, opt_options) {}
|
||||||
|
|
||||||
@@ -221,7 +221,7 @@ class XMLFeature extends FeatureFormat {
|
|||||||
/**
|
/**
|
||||||
* Encode an array of features as string.
|
* 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.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||||
* @return {string} Result.
|
* @return {string} Result.
|
||||||
* @api
|
* @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.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
||||||
* @return {Node} Node.
|
* @return {Node} Node.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class LogicalNary extends Filter {
|
|||||||
super(tagName);
|
super(tagName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Array.<module:ol/format/filter/Filter>}
|
* @type {Array<module:ol/format/filter/Filter>}
|
||||||
*/
|
*/
|
||||||
this.conditions = Array.prototype.slice.call(arguments, 1);
|
this.conditions = Array.prototype.slice.call(arguments, 1);
|
||||||
assert(this.conditions.length >= 2, 57); // At least 2 conditions are required.
|
assert(this.conditions.length >= 2, 57); // At least 2 conditions are required.
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ class Circle extends SimpleGeometry {
|
|||||||
if (!this.flatCoordinates) {
|
if (!this.flatCoordinates) {
|
||||||
this.flatCoordinates = [];
|
this.flatCoordinates = [];
|
||||||
}
|
}
|
||||||
/** @type {Array.<number>} */
|
/** @type {Array<number>} */
|
||||||
const flatCoordinates = this.flatCoordinates;
|
const flatCoordinates = this.flatCoordinates;
|
||||||
let offset = deflateCoordinate(
|
let offset = deflateCoordinate(
|
||||||
flatCoordinates, 0, center, this.stride);
|
flatCoordinates, 0, center, this.stride);
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import {clear} from '../obj.js';
|
|||||||
class GeometryCollection extends Geometry {
|
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) {
|
constructor(opt_geometries) {
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ class GeometryCollection extends Geometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array.<module:ol/geom/Geometry>}
|
* @type {Array<module:ol/geom/Geometry>}
|
||||||
*/
|
*/
|
||||||
this.geometries_ = opt_geometries ? opt_geometries : null;
|
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 the geometries that make up this geometry collection.
|
||||||
* @return {Array.<module:ol/geom/Geometry>} Geometries.
|
* @return {Array<module:ol/geom/Geometry>} Geometries.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getGeometries() {
|
getGeometries() {
|
||||||
@@ -122,7 +122,7 @@ class GeometryCollection extends Geometry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {Array.<module:ol/geom/Geometry>} Geometries.
|
* @return {Array<module:ol/geom/Geometry>} Geometries.
|
||||||
*/
|
*/
|
||||||
getGeometriesArray() {
|
getGeometriesArray() {
|
||||||
return this.geometries_;
|
return this.geometries_;
|
||||||
@@ -228,7 +228,7 @@ class GeometryCollection extends Geometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the geometries that make up this geometry collection.
|
* 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
|
* @api
|
||||||
*/
|
*/
|
||||||
setGeometries(geometries) {
|
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) {
|
setGeometriesArray(geometries) {
|
||||||
this.unlistenGeometriesChange_();
|
this.unlistenGeometriesChange_();
|
||||||
@@ -283,8 +283,8 @@ class GeometryCollection extends Geometry {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array.<module:ol/geom/Geometry>} geometries Geometries.
|
* @param {Array<module:ol/geom/Geometry>} geometries Geometries.
|
||||||
* @return {Array.<module:ol/geom/Geometry>} Cloned geometries.
|
* @return {Array<module:ol/geom/Geometry>} Cloned geometries.
|
||||||
*/
|
*/
|
||||||
function cloneGeometries(geometries) {
|
function cloneGeometries(geometries) {
|
||||||
const clonedGeometries = [];
|
const clonedGeometries = [];
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import {douglasPeucker} from '../geom/flat/simplify.js';
|
|||||||
class LineString extends SimpleGeometry {
|
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.
|
* For internal use, flat coordinates in combination with `opt_layout` are also accepted.
|
||||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
||||||
*/
|
*/
|
||||||
@@ -146,7 +146,7 @@ class LineString extends SimpleGeometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the coordinates of the linestring.
|
* Return the coordinates of the linestring.
|
||||||
* @return {Array.<module:ol/coordinate~Coordinate>} Coordinates.
|
* @return {Array<module:ol/coordinate~Coordinate>} Coordinates.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -182,7 +182,7 @@ class LineString extends SimpleGeometry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {Array.<number>} Flat midpoint.
|
* @return {Array<number>} Flat midpoint.
|
||||||
*/
|
*/
|
||||||
getFlatMidpoint() {
|
getFlatMidpoint() {
|
||||||
if (this.flatMidpointRevision_ != this.getRevision()) {
|
if (this.flatMidpointRevision_ != this.getRevision()) {
|
||||||
@@ -223,7 +223,7 @@ class LineString extends SimpleGeometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the coordinates of the linestring.
|
* 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.
|
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import {douglasPeucker} from '../geom/flat/simplify.js';
|
|||||||
class LinearRing extends SimpleGeometry {
|
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.
|
* For internal use, flat coordinates in combination with `opt_layout` are also accepted.
|
||||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
||||||
*/
|
*/
|
||||||
@@ -87,7 +87,7 @@ class LinearRing extends SimpleGeometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the coordinates of the linear ring.
|
* Return the coordinates of the linear ring.
|
||||||
* @return {Array.<module:ol/coordinate~Coordinate>} Coordinates.
|
* @return {Array<module:ol/coordinate~Coordinate>} Coordinates.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -122,7 +122,7 @@ class LinearRing extends SimpleGeometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the coordinates of the linear ring.
|
* 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.
|
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
|
|||||||
@@ -23,18 +23,18 @@ import {douglasPeuckerArray} from '../geom/flat/simplify.js';
|
|||||||
class MultiLineString extends SimpleGeometry {
|
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
|
* Coordinates or LineString geometries. (For internal use, flat coordinates in
|
||||||
* combination with `opt_layout` and `opt_ends` are also accepted.)
|
* combination with `opt_layout` and `opt_ends` are also accepted.)
|
||||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
* @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) {
|
constructor(coordinates, opt_layout, opt_ends) {
|
||||||
|
|
||||||
super();
|
super();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Array.<number>}
|
* @type {Array<number>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.ends_ = [];
|
this.ends_ = [];
|
||||||
@@ -152,7 +152,7 @@ class MultiLineString extends SimpleGeometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the coordinates of the multilinestring.
|
* Return the coordinates of the multilinestring.
|
||||||
* @return {Array.<Array.<module:ol/coordinate~Coordinate>>} Coordinates.
|
* @return {Array<Array<module:ol/coordinate~Coordinate>>} Coordinates.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -162,7 +162,7 @@ class MultiLineString extends SimpleGeometry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {Array.<number>} Ends.
|
* @return {Array<number>} Ends.
|
||||||
*/
|
*/
|
||||||
getEnds() {
|
getEnds() {
|
||||||
return this.ends_;
|
return this.ends_;
|
||||||
@@ -184,14 +184,14 @@ class MultiLineString extends SimpleGeometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the linestrings of this multilinestring.
|
* Return the linestrings of this multilinestring.
|
||||||
* @return {Array.<module:ol/geom/LineString>} LineStrings.
|
* @return {Array<module:ol/geom/LineString>} LineStrings.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getLineStrings() {
|
getLineStrings() {
|
||||||
const flatCoordinates = this.flatCoordinates;
|
const flatCoordinates = this.flatCoordinates;
|
||||||
const ends = this.ends_;
|
const ends = this.ends_;
|
||||||
const layout = this.layout;
|
const layout = this.layout;
|
||||||
/** @type {Array.<module:ol/geom/LineString>} */
|
/** @type {Array<module:ol/geom/LineString>} */
|
||||||
const lineStrings = [];
|
const lineStrings = [];
|
||||||
let offset = 0;
|
let offset = 0;
|
||||||
for (let i = 0, ii = ends.length; i < ii; ++i) {
|
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() {
|
getFlatMidpoints() {
|
||||||
const midpoints = [];
|
const midpoints = [];
|
||||||
@@ -253,7 +253,7 @@ class MultiLineString extends SimpleGeometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the coordinates of the multilinestring.
|
* 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.
|
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import {squaredDistance as squaredDx} from '../math.js';
|
|||||||
class MultiPoint extends SimpleGeometry {
|
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.
|
* For internal use, flat coordinates in combination with `opt_layout` are also accepted.
|
||||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
||||||
*/
|
*/
|
||||||
@@ -82,7 +82,7 @@ class MultiPoint extends SimpleGeometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the coordinates of the multipoint.
|
* Return the coordinates of the multipoint.
|
||||||
* @return {Array.<module:ol/coordinate~Coordinate>} Coordinates.
|
* @return {Array<module:ol/coordinate~Coordinate>} Coordinates.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -108,14 +108,14 @@ class MultiPoint extends SimpleGeometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the points of this multipoint.
|
* Return the points of this multipoint.
|
||||||
* @return {Array.<module:ol/geom/Point>} Points.
|
* @return {Array<module:ol/geom/Point>} Points.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getPoints() {
|
getPoints() {
|
||||||
const flatCoordinates = this.flatCoordinates;
|
const flatCoordinates = this.flatCoordinates;
|
||||||
const layout = this.layout;
|
const layout = this.layout;
|
||||||
const stride = this.stride;
|
const stride = this.stride;
|
||||||
/** @type {Array.<module:ol/geom/Point>} */
|
/** @type {Array<module:ol/geom/Point>} */
|
||||||
const points = [];
|
const points = [];
|
||||||
for (let i = 0, ii = flatCoordinates.length; i < ii; i += stride) {
|
for (let i = 0, ii = flatCoordinates.length; i < ii; i += stride) {
|
||||||
const point = new Point(flatCoordinates.slice(i, i + stride), layout);
|
const point = new Point(flatCoordinates.slice(i, i + stride), layout);
|
||||||
@@ -151,7 +151,7 @@ class MultiPoint extends SimpleGeometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the coordinates of the multipoint.
|
* 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.
|
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
|
|||||||
@@ -28,17 +28,17 @@ import {quantizeMultiArray} from '../geom/flat/simplify.js';
|
|||||||
class MultiPolygon extends SimpleGeometry {
|
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.
|
* 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 {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) {
|
constructor(coordinates, opt_layout, opt_endss) {
|
||||||
|
|
||||||
super();
|
super();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Array.<Array.<number>>}
|
* @type {Array<Array<number>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.endss_ = [];
|
this.endss_ = [];
|
||||||
@@ -51,7 +51,7 @@ class MultiPolygon extends SimpleGeometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array.<number>}
|
* @type {Array<number>}
|
||||||
*/
|
*/
|
||||||
this.flatInteriorPoints_ = null;
|
this.flatInteriorPoints_ = null;
|
||||||
|
|
||||||
@@ -75,7 +75,7 @@ class MultiPolygon extends SimpleGeometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array.<number>}
|
* @type {Array<number>}
|
||||||
*/
|
*/
|
||||||
this.orientedFlatCoordinates_ = null;
|
this.orientedFlatCoordinates_ = null;
|
||||||
|
|
||||||
@@ -115,7 +115,7 @@ class MultiPolygon extends SimpleGeometry {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
appendPolygon(polygon) {
|
appendPolygon(polygon) {
|
||||||
/** @type {Array.<number>} */
|
/** @type {Array<number>} */
|
||||||
let ends;
|
let ends;
|
||||||
if (!this.flatCoordinates) {
|
if (!this.flatCoordinates) {
|
||||||
this.flatCoordinates = polygon.getFlatCoordinates().slice();
|
this.flatCoordinates = polygon.getFlatCoordinates().slice();
|
||||||
@@ -193,7 +193,7 @@ class MultiPolygon extends SimpleGeometry {
|
|||||||
* (clockwise for exterior and counter-clockwise for interior rings).
|
* (clockwise for exterior and counter-clockwise for interior rings).
|
||||||
* By default, coordinate orientation will depend on how the geometry was
|
* By default, coordinate orientation will depend on how the geometry was
|
||||||
* constructed.
|
* constructed.
|
||||||
* @return {Array.<Array.<Array.<module:ol/coordinate~Coordinate>>>} Coordinates.
|
* @return {Array<Array<Array<module:ol/coordinate~Coordinate>>>} Coordinates.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -212,14 +212,14 @@ class MultiPolygon extends SimpleGeometry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {Array.<Array.<number>>} Endss.
|
* @return {Array<Array<number>>} Endss.
|
||||||
*/
|
*/
|
||||||
getEndss() {
|
getEndss() {
|
||||||
return this.endss_;
|
return this.endss_;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {Array.<number>} Flat interior points.
|
* @return {Array<number>} Flat interior points.
|
||||||
*/
|
*/
|
||||||
getFlatInteriorPoints() {
|
getFlatInteriorPoints() {
|
||||||
if (this.flatInteriorPointsRevision_ != this.getRevision()) {
|
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() {
|
getOrientedFlatCoordinates() {
|
||||||
if (this.orientedRevision_ != this.getRevision()) {
|
if (this.orientedRevision_ != this.getRevision()) {
|
||||||
@@ -305,7 +305,7 @@ class MultiPolygon extends SimpleGeometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the polygons of this multipolygon.
|
* Return the polygons of this multipolygon.
|
||||||
* @return {Array.<module:ol/geom/Polygon>} Polygons.
|
* @return {Array<module:ol/geom/Polygon>} Polygons.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getPolygons() {
|
getPolygons() {
|
||||||
@@ -348,7 +348,7 @@ class MultiPolygon extends SimpleGeometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the coordinates of the multipolygon.
|
* 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.
|
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import {modulo} from '../math.js';
|
|||||||
class Polygon extends SimpleGeometry {
|
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 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
|
* 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
|
* 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
|
* equivalent. (For internal use, flat coordinates in combination with
|
||||||
* `opt_layout` and `opt_ends` are also accepted.)
|
* `opt_layout` and `opt_ends` are also accepted.)
|
||||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
* @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) {
|
constructor(coordinates, opt_layout, opt_ends) {
|
||||||
|
|
||||||
super();
|
super();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Array.<number>}
|
* @type {Array<number>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.ends_ = [];
|
this.ends_ = [];
|
||||||
@@ -81,7 +81,7 @@ class Polygon extends SimpleGeometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array.<number>}
|
* @type {Array<number>}
|
||||||
*/
|
*/
|
||||||
this.orientedFlatCoordinates_ = null;
|
this.orientedFlatCoordinates_ = null;
|
||||||
|
|
||||||
@@ -162,7 +162,7 @@ class Polygon extends SimpleGeometry {
|
|||||||
* (clockwise for exterior and counter-clockwise for interior rings).
|
* (clockwise for exterior and counter-clockwise for interior rings).
|
||||||
* By default, coordinate orientation will depend on how the geometry was
|
* By default, coordinate orientation will depend on how the geometry was
|
||||||
* constructed.
|
* constructed.
|
||||||
* @return {Array.<Array.<module:ol/coordinate~Coordinate>>} Coordinates.
|
* @return {Array<Array<module:ol/coordinate~Coordinate>>} Coordinates.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -181,14 +181,14 @@ class Polygon extends SimpleGeometry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {Array.<number>} Ends.
|
* @return {Array<number>} Ends.
|
||||||
*/
|
*/
|
||||||
getEnds() {
|
getEnds() {
|
||||||
return this.ends_;
|
return this.ends_;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {Array.<number>} Interior point.
|
* @return {Array<number>} Interior point.
|
||||||
*/
|
*/
|
||||||
getFlatInteriorPoint() {
|
getFlatInteriorPoint() {
|
||||||
if (this.flatInteriorPointRevision_ != this.getRevision()) {
|
if (this.flatInteriorPointRevision_ != this.getRevision()) {
|
||||||
@@ -242,7 +242,7 @@ class Polygon extends SimpleGeometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the linear rings of the polygon.
|
* Return the linear rings of the polygon.
|
||||||
* @return {Array.<module:ol/geom/LinearRing>} Linear rings.
|
* @return {Array<module:ol/geom/LinearRing>} Linear rings.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getLinearRings() {
|
getLinearRings() {
|
||||||
@@ -261,7 +261,7 @@ class Polygon extends SimpleGeometry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {Array.<number>} Oriented flat coordinates.
|
* @return {Array<number>} Oriented flat coordinates.
|
||||||
*/
|
*/
|
||||||
getOrientedFlatCoordinates() {
|
getOrientedFlatCoordinates() {
|
||||||
if (this.orientedRevision_ != this.getRevision()) {
|
if (this.orientedRevision_ != this.getRevision()) {
|
||||||
@@ -312,7 +312,7 @@ class Polygon extends SimpleGeometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the coordinates of the polygon.
|
* 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.
|
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
@@ -347,7 +347,7 @@ export default Polygon;
|
|||||||
*/
|
*/
|
||||||
export function circular(center, radius, opt_n, opt_sphereRadius) {
|
export function circular(center, radius, opt_n, opt_sphereRadius) {
|
||||||
const n = opt_n ? opt_n : 32;
|
const n = opt_n ? opt_n : 32;
|
||||||
/** @type {Array.<number>} */
|
/** @type {Array<number>} */
|
||||||
const flatCoordinates = [];
|
const flatCoordinates = [];
|
||||||
for (let i = 0; i < n; ++i) {
|
for (let i = 0; i < n; ++i) {
|
||||||
extend(flatCoordinates, sphereOffset(center, radius, 2 * Math.PI * i / n, opt_sphereRadius));
|
extend(flatCoordinates, sphereOffset(center, radius, 2 * Math.PI * i / n, opt_sphereRadius));
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class SimpleGeometry extends Geometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @protected
|
* @protected
|
||||||
* @type {Array.<number>}
|
* @type {Array<number>}
|
||||||
*/
|
*/
|
||||||
this.flatCoordinates = null;
|
this.flatCoordinates = null;
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ class SimpleGeometry extends Geometry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {Array.<number>} Flat coordinates.
|
* @return {Array<number>} Flat coordinates.
|
||||||
*/
|
*/
|
||||||
getFlatCoordinates() {
|
getFlatCoordinates() {
|
||||||
return this.flatCoordinates;
|
return this.flatCoordinates;
|
||||||
@@ -146,7 +146,7 @@ class SimpleGeometry extends Geometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/geom/GeometryLayout} layout Layout.
|
* @param {module:ol/geom/GeometryLayout} layout Layout.
|
||||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||||
*/
|
*/
|
||||||
setFlatCoordinates(layout, flatCoordinates) {
|
setFlatCoordinates(layout, flatCoordinates) {
|
||||||
this.stride = getStrideForLayout(layout);
|
this.stride = getStrideForLayout(layout);
|
||||||
@@ -300,8 +300,8 @@ SimpleGeometry.prototype.containsXY = FALSE;
|
|||||||
/**
|
/**
|
||||||
* @param {module:ol/geom/SimpleGeometry} simpleGeometry Simple geometry.
|
* @param {module:ol/geom/SimpleGeometry} simpleGeometry Simple geometry.
|
||||||
* @param {module:ol/transform~Transform} transform Transform.
|
* @param {module:ol/transform~Transform} transform Transform.
|
||||||
* @param {Array.<number>=} opt_dest Destination.
|
* @param {Array<number>=} opt_dest Destination.
|
||||||
* @return {Array.<number>} Transformed flat coordinates.
|
* @return {Array<number>} Transformed flat coordinates.
|
||||||
*/
|
*/
|
||||||
export function transformGeom2D(simpleGeometry, transform, opt_dest) {
|
export function transformGeom2D(simpleGeometry, transform, opt_dest) {
|
||||||
const flatCoordinates = simpleGeometry.getFlatCoordinates();
|
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} offset Offset.
|
||||||
* @param {number} end End.
|
* @param {number} end End.
|
||||||
* @param {number} stride Stride.
|
* @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 {number} offset Offset.
|
||||||
* @param {Array.<number>} ends Ends.
|
* @param {Array<number>} ends Ends.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @return {number} Area.
|
* @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 {number} offset Offset.
|
||||||
* @param {Array.<Array.<number>>} endss Endss.
|
* @param {Array<Array<number>>} endss Endss.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @return {number} Area.
|
* @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 {number} offset Offset.
|
||||||
* @param {Array.<Array.<number>>} endss Endss.
|
* @param {Array<Array<number>>} endss Endss.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @return {Array.<number>} Flat centers.
|
* @return {Array<number>} Flat centers.
|
||||||
*/
|
*/
|
||||||
export function linearRingss(flatCoordinates, offset, endss, stride) {
|
export function linearRingss(flatCoordinates, offset, endss, stride) {
|
||||||
const flatCenters = [];
|
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
|
* Returns the point on the 2D line segment flatCoordinates[offset1] to
|
||||||
* flatCoordinates[offset2] that is closest to the point (x, y). Extra
|
* flatCoordinates[offset2] that is closest to the point (x, y). Extra
|
||||||
* dimensions are linearly interpolated.
|
* dimensions are linearly interpolated.
|
||||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||||
* @param {number} offset1 Offset 1.
|
* @param {number} offset1 Offset 1.
|
||||||
* @param {number} offset2 Offset 2.
|
* @param {number} offset2 Offset 2.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @param {number} x X.
|
* @param {number} x X.
|
||||||
* @param {number} y Y.
|
* @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) {
|
function assignClosest(flatCoordinates, offset1, offset2, stride, x, y, closestPoint) {
|
||||||
const x1 = flatCoordinates[offset1];
|
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
|
* Return the squared of the largest distance between any pair of consecutive
|
||||||
* coordinates.
|
* coordinates.
|
||||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||||
* @param {number} offset Offset.
|
* @param {number} offset Offset.
|
||||||
* @param {number} end End.
|
* @param {number} end End.
|
||||||
* @param {number} stride Stride.
|
* @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 {number} offset Offset.
|
||||||
* @param {Array.<number>} ends Ends.
|
* @param {Array<number>} ends Ends.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @param {number} max Max squared delta.
|
* @param {number} max Max squared delta.
|
||||||
* @return {number} 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 {number} offset Offset.
|
||||||
* @param {Array.<Array.<number>>} endss Endss.
|
* @param {Array<Array<number>>} endss Endss.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @param {number} max Max squared delta.
|
* @param {number} max Max squared delta.
|
||||||
* @return {number} 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} offset Offset.
|
||||||
* @param {number} end End.
|
* @param {number} end End.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
@@ -120,9 +120,9 @@ export function multiArrayMaxSquaredDelta(flatCoordinates, offset, endss, stride
|
|||||||
* @param {boolean} isRing Is ring.
|
* @param {boolean} isRing Is ring.
|
||||||
* @param {number} x X.
|
* @param {number} x X.
|
||||||
* @param {number} y Y.
|
* @param {number} y Y.
|
||||||
* @param {Array.<number>} closestPoint Closest point.
|
* @param {Array<number>} closestPoint Closest point.
|
||||||
* @param {number} minSquaredDistance Minimum squared distance.
|
* @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.
|
* @return {number} Minimum squared distance.
|
||||||
*/
|
*/
|
||||||
export function assignClosestPoint(flatCoordinates, offset, end,
|
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 {number} offset Offset.
|
||||||
* @param {Array.<number>} ends Ends.
|
* @param {Array<number>} ends Ends.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @param {number} maxDelta Max delta.
|
* @param {number} maxDelta Max delta.
|
||||||
* @param {boolean} isRing Is ring.
|
* @param {boolean} isRing Is ring.
|
||||||
* @param {number} x X.
|
* @param {number} x X.
|
||||||
* @param {number} y Y.
|
* @param {number} y Y.
|
||||||
* @param {Array.<number>} closestPoint Closest point.
|
* @param {Array<number>} closestPoint Closest point.
|
||||||
* @param {number} minSquaredDistance Minimum squared distance.
|
* @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.
|
* @return {number} Minimum squared distance.
|
||||||
*/
|
*/
|
||||||
export function assignClosestArrayPoint(flatCoordinates, offset, ends,
|
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 {number} offset Offset.
|
||||||
* @param {Array.<Array.<number>>} endss Endss.
|
* @param {Array<Array<number>>} endss Endss.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @param {number} maxDelta Max delta.
|
* @param {number} maxDelta Max delta.
|
||||||
* @param {boolean} isRing Is ring.
|
* @param {boolean} isRing Is ring.
|
||||||
* @param {number} x X.
|
* @param {number} x X.
|
||||||
* @param {number} y Y.
|
* @param {number} y Y.
|
||||||
* @param {Array.<number>} closestPoint Closest point.
|
* @param {Array<number>} closestPoint Closest point.
|
||||||
* @param {number} minSquaredDistance Minimum squared distance.
|
* @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.
|
* @return {number} Minimum squared distance.
|
||||||
*/
|
*/
|
||||||
export function assignClosestMultiArrayPoint(flatCoordinates, offset,
|
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} offset Offset.
|
||||||
* @param {number} end End.
|
* @param {number} end End.
|
||||||
* @param {number} stride Stride.
|
* @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} offset Offset.
|
||||||
* @param {number} end End.
|
* @param {number} end End.
|
||||||
* @param {number} stride Stride.
|
* @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 {number} offset Offset.
|
||||||
* @param {Array.<number>} ends Ends.
|
* @param {Array<number>} ends Ends.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @param {number} x X.
|
* @param {number} x X.
|
||||||
* @param {number} y Y.
|
* @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 {number} offset Offset.
|
||||||
* @param {Array.<Array.<number>>} endss Endss.
|
* @param {Array<Array<number>>} endss Endss.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @param {number} x X.
|
* @param {number} x X.
|
||||||
* @param {number} y Y.
|
* @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 {number} offset Offset.
|
||||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
||||||
* @param {number} stride Stride.
|
* @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 {number} offset Offset.
|
||||||
* @param {Array.<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
* @param {Array<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @return {number} offset Offset.
|
* @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 {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 {number} stride Stride.
|
||||||
* @param {Array.<number>=} opt_ends Ends.
|
* @param {Array<number>=} opt_ends Ends.
|
||||||
* @return {Array.<number>} Ends.
|
* @return {Array<number>} Ends.
|
||||||
*/
|
*/
|
||||||
export function deflateCoordinatesArray(flatCoordinates, offset, coordinatess, stride, opt_ends) {
|
export function deflateCoordinatesArray(flatCoordinates, offset, coordinatess, stride, opt_ends) {
|
||||||
const ends = opt_ends ? 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 {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 {number} stride Stride.
|
||||||
* @param {Array.<Array.<number>>=} opt_endss Endss.
|
* @param {Array<Array<number>>=} opt_endss Endss.
|
||||||
* @return {Array.<Array.<number>>} Endss.
|
* @return {Array<Array<number>>} Endss.
|
||||||
*/
|
*/
|
||||||
export function deflateMultiCoordinatesArray(flatCoordinates, offset, coordinatesss, stride, opt_endss) {
|
export function deflateMultiCoordinatesArray(flatCoordinates, offset, coordinatesss, stride, opt_endss) {
|
||||||
const endss = opt_endss ? 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} offset Offset.
|
||||||
* @param {number} end End.
|
* @param {number} end End.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @param {Array.<number>=} opt_dest Destination.
|
* @param {Array<number>=} opt_dest Destination.
|
||||||
* @param {number=} opt_destOffset Destination offset.
|
* @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) {
|
export function flipXY(flatCoordinates, offset, end, stride, opt_dest, opt_destOffset) {
|
||||||
let dest, 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
|
* @param {module:ol/proj~TransformFunction} transform Transform from longitude/latitude to
|
||||||
* projected coordinates.
|
* projected coordinates.
|
||||||
* @param {number} squaredTolerance Squared tolerance.
|
* @param {number} squaredTolerance Squared tolerance.
|
||||||
* @return {Array.<number>} Flat coordinates.
|
* @return {Array<number>} Flat coordinates.
|
||||||
*/
|
*/
|
||||||
function line(interpolate, transform, squaredTolerance) {
|
function line(interpolate, transform, squaredTolerance) {
|
||||||
// FIXME reduce garbage generation
|
// FIXME reduce garbage generation
|
||||||
// FIXME optimize stack operations
|
// FIXME optimize stack operations
|
||||||
|
|
||||||
/** @type {Array.<number>} */
|
/** @type {Array<number>} */
|
||||||
const flatCoordinates = [];
|
const flatCoordinates = [];
|
||||||
|
|
||||||
let geoA = interpolate(0);
|
let geoA = interpolate(0);
|
||||||
@@ -25,11 +25,11 @@ function line(interpolate, transform, squaredTolerance) {
|
|||||||
let a = transform(geoA);
|
let a = transform(geoA);
|
||||||
let b = transform(geoB);
|
let b = transform(geoB);
|
||||||
|
|
||||||
/** @type {Array.<module:ol/coordinate~Coordinate>} */
|
/** @type {Array<module:ol/coordinate~Coordinate>} */
|
||||||
const geoStack = [geoB, geoA];
|
const geoStack = [geoB, geoA];
|
||||||
/** @type {Array.<module:ol/coordinate~Coordinate>} */
|
/** @type {Array<module:ol/coordinate~Coordinate>} */
|
||||||
const stack = [b, a];
|
const stack = [b, a];
|
||||||
/** @type {Array.<number>} */
|
/** @type {Array<number>} */
|
||||||
const fractionStack = [1, 0];
|
const fractionStack = [1, 0];
|
||||||
|
|
||||||
/** @type {!Object.<string, boolean>} */
|
/** @type {!Object.<string, boolean>} */
|
||||||
@@ -86,7 +86,7 @@ function line(interpolate, transform, squaredTolerance) {
|
|||||||
* @param {number} lat2 Latitude 2 in degrees.
|
* @param {number} lat2 Latitude 2 in degrees.
|
||||||
* @param {module:ol/proj/Projection} projection Projection.
|
* @param {module:ol/proj/Projection} projection Projection.
|
||||||
* @param {number} squaredTolerance Squared tolerance.
|
* @param {number} squaredTolerance Squared tolerance.
|
||||||
* @return {Array.<number>} Flat coordinates.
|
* @return {Array<number>} Flat coordinates.
|
||||||
*/
|
*/
|
||||||
export function greatCircleArc(lon1, lat1, lon2, lat2, projection, squaredTolerance) {
|
export function greatCircleArc(lon1, lat1, lon2, lat2, projection, squaredTolerance) {
|
||||||
const geoProjection = getProjection('EPSG:4326');
|
const geoProjection = getProjection('EPSG:4326');
|
||||||
@@ -130,7 +130,7 @@ export function greatCircleArc(lon1, lat1, lon2, lat2, projection, squaredTolera
|
|||||||
* @param {number} lat2 Latitude 2.
|
* @param {number} lat2 Latitude 2.
|
||||||
* @param {module:ol/proj/Projection} projection Projection.
|
* @param {module:ol/proj/Projection} projection Projection.
|
||||||
* @param {number} squaredTolerance Squared tolerance.
|
* @param {number} squaredTolerance Squared tolerance.
|
||||||
* @return {Array.<number>} Flat coordinates.
|
* @return {Array<number>} Flat coordinates.
|
||||||
*/
|
*/
|
||||||
export function meridian(lon, lat1, lat2, projection, squaredTolerance) {
|
export function meridian(lon, lat1, lat2, projection, squaredTolerance) {
|
||||||
const epsg4326Projection = getProjection('EPSG:4326');
|
const epsg4326Projection = getProjection('EPSG:4326');
|
||||||
@@ -153,7 +153,7 @@ export function meridian(lon, lat1, lat2, projection, squaredTolerance) {
|
|||||||
* @param {number} lon2 Longitude 2.
|
* @param {number} lon2 Longitude 2.
|
||||||
* @param {module:ol/proj/Projection} projection Projection.
|
* @param {module:ol/proj/Projection} projection Projection.
|
||||||
* @param {number} squaredTolerance Squared tolerance.
|
* @param {number} squaredTolerance Squared tolerance.
|
||||||
* @return {Array.<number>} Flat coordinates.
|
* @return {Array<number>} Flat coordinates.
|
||||||
*/
|
*/
|
||||||
export function parallel(lat, lon1, lon2, projection, squaredTolerance) {
|
export function parallel(lat, lon1, lon2, projection, squaredTolerance) {
|
||||||
const epsg4326Projection = getProjection('EPSG:4326');
|
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} offset Offset.
|
||||||
* @param {number} end End.
|
* @param {number} end End.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @param {Array.<module:ol/coordinate~Coordinate>=} opt_coordinates Coordinates.
|
* @param {Array<module:ol/coordinate~Coordinate>=} opt_coordinates Coordinates.
|
||||||
* @return {Array.<module:ol/coordinate~Coordinate>} Coordinates.
|
* @return {Array<module:ol/coordinate~Coordinate>} Coordinates.
|
||||||
*/
|
*/
|
||||||
export function inflateCoordinates(flatCoordinates, offset, end, stride, opt_coordinates) {
|
export function inflateCoordinates(flatCoordinates, offset, end, stride, opt_coordinates) {
|
||||||
const coordinates = opt_coordinates !== undefined ? 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 {number} offset Offset.
|
||||||
* @param {Array.<number>} ends Ends.
|
* @param {Array<number>} ends Ends.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>=} opt_coordinatess Coordinatess.
|
* @param {Array<Array<module:ol/coordinate~Coordinate>>=} opt_coordinatess Coordinatess.
|
||||||
* @return {Array.<Array.<module:ol/coordinate~Coordinate>>} Coordinatess.
|
* @return {Array<Array<module:ol/coordinate~Coordinate>>} Coordinatess.
|
||||||
*/
|
*/
|
||||||
export function inflateCoordinatesArray(flatCoordinates, offset, ends, stride, opt_coordinatess) {
|
export function inflateCoordinatesArray(flatCoordinates, offset, ends, stride, opt_coordinatess) {
|
||||||
const coordinatess = opt_coordinatess !== undefined ? 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 {number} offset Offset.
|
||||||
* @param {Array.<Array.<number>>} endss Endss.
|
* @param {Array<Array<number>>} endss Endss.
|
||||||
* @param {number} stride Stride.
|
* @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.
|
* 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) {
|
export function inflateMultiCoordinatesArray(flatCoordinates, offset, endss, stride, opt_coordinatesss) {
|
||||||
const coordinatesss = opt_coordinatesss !== undefined ? 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.
|
* 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.
|
* 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 {number} offset Offset.
|
||||||
* @param {Array.<number>} ends Ends.
|
* @param {Array<number>} ends Ends.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @param {Array.<number>} flatCenters Flat centers.
|
* @param {Array<number>} flatCenters Flat centers.
|
||||||
* @param {number} flatCentersOffset Flat center offset.
|
* @param {number} flatCentersOffset Flat center offset.
|
||||||
* @param {Array.<number>=} opt_dest Destination.
|
* @param {Array<number>=} opt_dest Destination.
|
||||||
* @return {Array.<number>} Destination point as XYM coordinate, where M is the
|
* @return {Array<number>} Destination point as XYM coordinate, where M is the
|
||||||
* length of the horizontal intersection that the point belongs to.
|
* length of the horizontal intersection that the point belongs to.
|
||||||
*/
|
*/
|
||||||
export function getInteriorPointOfArray(flatCoordinates, offset,
|
export function getInteriorPointOfArray(flatCoordinates, offset,
|
||||||
ends, stride, flatCenters, flatCentersOffset, opt_dest) {
|
ends, stride, flatCenters, flatCentersOffset, opt_dest) {
|
||||||
let i, ii, x, x1, x2, y1, y2;
|
let i, ii, x, x1, x2, y1, y2;
|
||||||
const y = flatCenters[flatCentersOffset + 1];
|
const y = flatCenters[flatCentersOffset + 1];
|
||||||
/** @type {Array.<number>} */
|
/** @type {Array<number>} */
|
||||||
const intersections = [];
|
const intersections = [];
|
||||||
// Calculate intersections with the horizontal line
|
// Calculate intersections with the horizontal line
|
||||||
for (let r = 0, rr = ends.length; r < rr; ++r) {
|
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 {number} offset Offset.
|
||||||
* @param {Array.<Array.<number>>} endss Endss.
|
* @param {Array<Array<number>>} endss Endss.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @param {Array.<number>} flatCenters Flat centers.
|
* @param {Array<number>} flatCenters Flat centers.
|
||||||
* @return {Array.<number>} Interior points as XYM coordinates, where M is the
|
* @return {Array<number>} Interior points as XYM coordinates, where M is the
|
||||||
* length of the horizontal intersection that the point belongs to.
|
* length of the horizontal intersection that the point belongs to.
|
||||||
*/
|
*/
|
||||||
export function getInteriorPointsOfMultiArray(flatCoordinates, offset, endss, stride, flatCenters) {
|
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} offset Offset.
|
||||||
* @param {number} end End.
|
* @param {number} end End.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @param {number} fraction Fraction.
|
* @param {number} fraction Fraction.
|
||||||
* @param {Array.<number>=} opt_dest Destination.
|
* @param {Array<number>=} opt_dest Destination.
|
||||||
* @return {Array.<number>} Destination.
|
* @return {Array<number>} Destination.
|
||||||
*/
|
*/
|
||||||
export function interpolatePoint(flatCoordinates, offset, end, stride, fraction, opt_dest) {
|
export function interpolatePoint(flatCoordinates, offset, end, stride, fraction, opt_dest) {
|
||||||
let pointX = NaN;
|
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} offset Offset.
|
||||||
* @param {number} end End.
|
* @param {number} end End.
|
||||||
* @param {number} stride Stride.
|
* @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 {number} offset Offset.
|
||||||
* @param {Array.<number>} ends Ends.
|
* @param {Array<number>} ends Ends.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @param {number} m M.
|
* @param {number} m M.
|
||||||
* @param {boolean} extrapolate Extrapolate.
|
* @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} offset Offset.
|
||||||
* @param {number} end End.
|
* @param {number} end End.
|
||||||
* @param {number} stride Stride.
|
* @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 {number} offset Offset.
|
||||||
* @param {Array.<number>} ends Ends.
|
* @param {Array<number>} ends Ends.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {module:ol/extent~Extent} extent Extent.
|
||||||
* @return {boolean} True if the geometry and the extent intersect.
|
* @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} offset Offset.
|
||||||
* @param {number} end End.
|
* @param {number} end End.
|
||||||
* @param {number} stride Stride.
|
* @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 {number} offset Offset.
|
||||||
* @param {Array.<number>} ends Ends.
|
* @param {Array<number>} ends Ends.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {module:ol/extent~Extent} extent Extent.
|
||||||
* @return {boolean} True if the geometry and the extent intersect.
|
* @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 {number} offset Offset.
|
||||||
* @param {Array.<Array.<number>>} endss Endss.
|
* @param {Array<Array<number>>} endss Endss.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {module:ol/extent~Extent} extent Extent.
|
||||||
* @return {boolean} True if the geometry and the extent intersect.
|
* @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} offset Offset.
|
||||||
* @param {number} end End.
|
* @param {number} end End.
|
||||||
* @param {number} stride Stride.
|
* @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} offset Offset.
|
||||||
* @param {number} end End.
|
* @param {number} end End.
|
||||||
* @param {number} stride Stride.
|
* @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} offset Offset.
|
||||||
* @param {number} end End.
|
* @param {number} end End.
|
||||||
* @param {number} stride Stride.
|
* @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).
|
* is tested (first ring must be clockwise, remaining rings counter-clockwise).
|
||||||
* To test for right-hand orientation, use the `opt_right` argument.
|
* 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 {number} offset Offset.
|
||||||
* @param {Array.<number>} ends Array of end indexes.
|
* @param {Array<number>} ends Array of end indexes.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @param {boolean=} opt_right Test for right-hand orientation
|
* @param {boolean=} opt_right Test for right-hand orientation
|
||||||
* (counter-clockwise exterior ring and clockwise interior rings).
|
* (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).
|
* is tested (first ring must be clockwise, remaining rings counter-clockwise).
|
||||||
* To test for right-hand orientation, use the `opt_right` argument.
|
* 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 {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 {number} stride Stride.
|
||||||
* @param {boolean=} opt_right Test for right-hand orientation
|
* @param {boolean=} opt_right Test for right-hand orientation
|
||||||
* (counter-clockwise exterior ring and clockwise interior rings).
|
* (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
|
* counter-clockwise for interior rings). To orient according to the
|
||||||
* right-hand rule, use the `opt_right` argument.
|
* 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 {number} offset Offset.
|
||||||
* @param {Array.<number>} ends Ends.
|
* @param {Array<number>} ends Ends.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @param {boolean=} opt_right Follow the right-hand rule for orientation.
|
* @param {boolean=} opt_right Follow the right-hand rule for orientation.
|
||||||
* @return {number} End.
|
* @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
|
* counter-clockwise for interior rings). To orient according to the
|
||||||
* right-hand rule, use the `opt_right` argument.
|
* 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 {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 {number} stride Stride.
|
||||||
* @param {boolean=} opt_right Follow the right-hand rule for orientation.
|
* @param {boolean=} opt_right Follow the right-hand rule for orientation.
|
||||||
* @return {number} End.
|
* @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} offset Offset.
|
||||||
* @param {number} end End.
|
* @param {number} end End.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
* This function calls `callback` for each segment of the flat coordinates
|
* This function calls `callback` for each segment of the flat coordinates
|
||||||
* array. If the callback returns a truthy value the function returns that
|
* array. If the callback returns a truthy value the function returns that
|
||||||
* value immediately. Otherwise the function returns `false`.
|
* 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} offset Offset.
|
||||||
* @param {number} end End.
|
* @param {number} end End.
|
||||||
* @param {number} stride Stride.
|
* @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} offset Offset.
|
||||||
* @param {number} end End.
|
* @param {number} end End.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @param {number} squaredTolerance Squared tolerance.
|
* @param {number} squaredTolerance Squared tolerance.
|
||||||
* @param {boolean} highQuality Highest quality.
|
* @param {boolean} highQuality Highest quality.
|
||||||
* @param {Array.<number>=} opt_simplifiedFlatCoordinates Simplified flat
|
* @param {Array<number>=} opt_simplifiedFlatCoordinates Simplified flat
|
||||||
* coordinates.
|
* coordinates.
|
||||||
* @return {Array.<number>} Simplified line string.
|
* @return {Array<number>} Simplified line string.
|
||||||
*/
|
*/
|
||||||
export function simplifyLineString(flatCoordinates, offset, end,
|
export function simplifyLineString(flatCoordinates, offset, end,
|
||||||
stride, squaredTolerance, highQuality, opt_simplifiedFlatCoordinates) {
|
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} offset Offset.
|
||||||
* @param {number} end End.
|
* @param {number} end End.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @param {number} squaredTolerance Squared tolerance.
|
* @param {number} squaredTolerance Squared tolerance.
|
||||||
* @param {Array.<number>} simplifiedFlatCoordinates Simplified flat
|
* @param {Array<number>} simplifiedFlatCoordinates Simplified flat
|
||||||
* coordinates.
|
* coordinates.
|
||||||
* @param {number} simplifiedOffset Simplified offset.
|
* @param {number} simplifiedOffset Simplified offset.
|
||||||
* @return {number} Simplified offset.
|
* @return {number} Simplified offset.
|
||||||
@@ -83,11 +83,11 @@ export function douglasPeucker(flatCoordinates, offset, end,
|
|||||||
}
|
}
|
||||||
return simplifiedOffset;
|
return simplifiedOffset;
|
||||||
}
|
}
|
||||||
/** @type {Array.<number>} */
|
/** @type {Array<number>} */
|
||||||
const markers = new Array(n);
|
const markers = new Array(n);
|
||||||
markers[0] = 1;
|
markers[0] = 1;
|
||||||
markers[n - 1] = 1;
|
markers[n - 1] = 1;
|
||||||
/** @type {Array.<number>} */
|
/** @type {Array<number>} */
|
||||||
const stack = [offset, end - stride];
|
const stack = [offset, end - stride];
|
||||||
let index = 0;
|
let index = 0;
|
||||||
while (stack.length > 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 {number} offset Offset.
|
||||||
* @param {Array.<number>} ends Ends.
|
* @param {Array<number>} ends Ends.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @param {number} squaredTolerance Squared tolerance.
|
* @param {number} squaredTolerance Squared tolerance.
|
||||||
* @param {Array.<number>} simplifiedFlatCoordinates Simplified flat
|
* @param {Array<number>} simplifiedFlatCoordinates Simplified flat
|
||||||
* coordinates.
|
* coordinates.
|
||||||
* @param {number} simplifiedOffset Simplified offset.
|
* @param {number} simplifiedOffset Simplified offset.
|
||||||
* @param {Array.<number>} simplifiedEnds Simplified ends.
|
* @param {Array<number>} simplifiedEnds Simplified ends.
|
||||||
* @return {number} Simplified offset.
|
* @return {number} Simplified offset.
|
||||||
*/
|
*/
|
||||||
export function douglasPeuckerArray(flatCoordinates, 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 {number} offset Offset.
|
||||||
* @param {Array.<Array.<number>>} endss Endss.
|
* @param {Array<Array<number>>} endss Endss.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @param {number} squaredTolerance Squared tolerance.
|
* @param {number} squaredTolerance Squared tolerance.
|
||||||
* @param {Array.<number>} simplifiedFlatCoordinates Simplified flat
|
* @param {Array<number>} simplifiedFlatCoordinates Simplified flat
|
||||||
* coordinates.
|
* coordinates.
|
||||||
* @param {number} simplifiedOffset Simplified offset.
|
* @param {number} simplifiedOffset Simplified offset.
|
||||||
* @param {Array.<Array.<number>>} simplifiedEndss Simplified endss.
|
* @param {Array<Array<number>>} simplifiedEndss Simplified endss.
|
||||||
* @return {number} Simplified offset.
|
* @return {number} Simplified offset.
|
||||||
*/
|
*/
|
||||||
export function douglasPeuckerMultiArray(
|
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} offset Offset.
|
||||||
* @param {number} end End.
|
* @param {number} end End.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @param {number} squaredTolerance Squared tolerance.
|
* @param {number} squaredTolerance Squared tolerance.
|
||||||
* @param {Array.<number>} simplifiedFlatCoordinates Simplified flat
|
* @param {Array<number>} simplifiedFlatCoordinates Simplified flat
|
||||||
* coordinates.
|
* coordinates.
|
||||||
* @param {number} simplifiedOffset Simplified offset.
|
* @param {number} simplifiedOffset Simplified offset.
|
||||||
* @return {number} 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
|
* the common edge between two polygons will be simplified to the same line
|
||||||
* string independently in both polygons. This implementation uses a single
|
* string independently in both polygons. This implementation uses a single
|
||||||
* pass over the coordinates and eliminates intermediate collinear points.
|
* 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} offset Offset.
|
||||||
* @param {number} end End.
|
* @param {number} end End.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @param {number} tolerance Tolerance.
|
* @param {number} tolerance Tolerance.
|
||||||
* @param {Array.<number>} simplifiedFlatCoordinates Simplified flat
|
* @param {Array<number>} simplifiedFlatCoordinates Simplified flat
|
||||||
* coordinates.
|
* coordinates.
|
||||||
* @param {number} simplifiedOffset Simplified offset.
|
* @param {number} simplifiedOffset Simplified offset.
|
||||||
* @return {number} 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 {number} offset Offset.
|
||||||
* @param {Array.<number>} ends Ends.
|
* @param {Array<number>} ends Ends.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @param {number} tolerance Tolerance.
|
* @param {number} tolerance Tolerance.
|
||||||
* @param {Array.<number>} simplifiedFlatCoordinates Simplified flat
|
* @param {Array<number>} simplifiedFlatCoordinates Simplified flat
|
||||||
* coordinates.
|
* coordinates.
|
||||||
* @param {number} simplifiedOffset Simplified offset.
|
* @param {number} simplifiedOffset Simplified offset.
|
||||||
* @param {Array.<number>} simplifiedEnds Simplified ends.
|
* @param {Array<number>} simplifiedEnds Simplified ends.
|
||||||
* @return {number} Simplified offset.
|
* @return {number} Simplified offset.
|
||||||
*/
|
*/
|
||||||
export function quantizeArray(
|
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 {number} offset Offset.
|
||||||
* @param {Array.<Array.<number>>} endss Endss.
|
* @param {Array<Array<number>>} endss Endss.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @param {number} tolerance Tolerance.
|
* @param {number} tolerance Tolerance.
|
||||||
* @param {Array.<number>} simplifiedFlatCoordinates Simplified flat
|
* @param {Array<number>} simplifiedFlatCoordinates Simplified flat
|
||||||
* coordinates.
|
* coordinates.
|
||||||
* @param {number} simplifiedOffset Simplified offset.
|
* @param {number} simplifiedOffset Simplified offset.
|
||||||
* @param {Array.<Array.<number>>} simplifiedEndss Simplified endss.
|
* @param {Array<Array<number>>} simplifiedEndss Simplified endss.
|
||||||
* @return {number} Simplified offset.
|
* @return {number} Simplified offset.
|
||||||
*/
|
*/
|
||||||
export function quantizeMultiArray(
|
export function quantizeMultiArray(
|
||||||
|
|||||||
@@ -5,11 +5,11 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {number} maxAngle Maximum acceptable angle delta between segments.
|
* @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} offset Offset.
|
||||||
* @param {number} end End.
|
* @param {number} end End.
|
||||||
* @param {number} stride Stride.
|
* @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`.
|
* given `flatCoordinates`.
|
||||||
*/
|
*/
|
||||||
export function matchingChunk(maxAngle, flatCoordinates, offset, end, stride) {
|
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} offset Start offset of the `flatCoordinates`.
|
||||||
* @param {number} end End offset of the `flatCoordinates`.
|
* @param {number} end End offset of the `flatCoordinates`.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
@@ -14,7 +14,7 @@ import {lerp} from '../../math.js';
|
|||||||
* width of the character passed as 1st argument.
|
* width of the character passed as 1st argument.
|
||||||
* @param {number} startM m along the path where the text starts.
|
* @param {number} startM m along the path where the text starts.
|
||||||
* @param {number} maxAngle Max angle between adjacent chars in radians.
|
* @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.
|
* exceeded. Entries of the array are x, y, anchorX, angle, chunk.
|
||||||
*/
|
*/
|
||||||
export function drawTextOnPath(
|
export function drawTextOnPath(
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {linearRing as linearRingArea} from '../flat/area.js';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the linestring is a boundary.
|
* 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} offset Offset.
|
||||||
* @param {number} end End.
|
* @param {number} end End.
|
||||||
* @param {number} stride Stride.
|
* @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} offset Offset.
|
||||||
* @param {number} end End.
|
* @param {number} end End.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @param {module:ol/transform~Transform} transform Transform.
|
* @param {module:ol/transform~Transform} transform Transform.
|
||||||
* @param {Array.<number>=} opt_dest Destination.
|
* @param {Array<number>=} opt_dest Destination.
|
||||||
* @return {Array.<number>} Transformed coordinates.
|
* @return {Array<number>} Transformed coordinates.
|
||||||
*/
|
*/
|
||||||
export function transform2D(flatCoordinates, offset, end, stride, transform, opt_dest) {
|
export function transform2D(flatCoordinates, offset, end, stride, transform, opt_dest) {
|
||||||
const dest = opt_dest ? 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} offset Offset.
|
||||||
* @param {number} end End.
|
* @param {number} end End.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @param {number} angle Angle.
|
* @param {number} angle Angle.
|
||||||
* @param {Array.<number>} anchor Rotation anchor point.
|
* @param {Array<number>} anchor Rotation anchor point.
|
||||||
* @param {Array.<number>=} opt_dest Destination.
|
* @param {Array<number>=} opt_dest Destination.
|
||||||
* @return {Array.<number>} Transformed coordinates.
|
* @return {Array<number>} Transformed coordinates.
|
||||||
*/
|
*/
|
||||||
export function rotate(flatCoordinates, offset, end, stride, angle, anchor, opt_dest) {
|
export function rotate(flatCoordinates, offset, end, stride, angle, anchor, opt_dest) {
|
||||||
const dest = opt_dest ? 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.
|
* Scale the coordinates.
|
||||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||||
* @param {number} offset Offset.
|
* @param {number} offset Offset.
|
||||||
* @param {number} end End.
|
* @param {number} end End.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @param {number} sx Scale factor in the x-direction.
|
* @param {number} sx Scale factor in the x-direction.
|
||||||
* @param {number} sy Scale factor in the y-direction.
|
* @param {number} sy Scale factor in the y-direction.
|
||||||
* @param {Array.<number>} anchor Scale anchor point.
|
* @param {Array<number>} anchor Scale anchor point.
|
||||||
* @param {Array.<number>=} opt_dest Destination.
|
* @param {Array<number>=} opt_dest Destination.
|
||||||
* @return {Array.<number>} Transformed coordinates.
|
* @return {Array<number>} Transformed coordinates.
|
||||||
*/
|
*/
|
||||||
export function scale(flatCoordinates, offset, end, stride, sx, sy, anchor, opt_dest) {
|
export function scale(flatCoordinates, offset, end, stride, sx, sy, anchor, opt_dest) {
|
||||||
const dest = opt_dest ? 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} offset Offset.
|
||||||
* @param {number} end End.
|
* @param {number} end End.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @param {number} deltaX Delta X.
|
* @param {number} deltaX Delta X.
|
||||||
* @param {number} deltaY Delta Y.
|
* @param {number} deltaY Delta Y.
|
||||||
* @param {Array.<number>=} opt_dest Destination.
|
* @param {Array<number>=} opt_dest Destination.
|
||||||
* @return {Array.<number>} Transformed coordinates.
|
* @return {Array<number>} Transformed coordinates.
|
||||||
*/
|
*/
|
||||||
export function translate(flatCoordinates, offset, end, stride, deltaX, deltaY, opt_dest) {
|
export function translate(flatCoordinates, offset, end, stride, deltaX, deltaY, opt_dest) {
|
||||||
const dest = opt_dest ? opt_dest : [];
|
const dest = opt_dest ? opt_dest : [];
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import {get as getProjection} from '../proj.js';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} Options
|
* @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
|
* @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
|
* all existing features will be removed and new features will be added when
|
||||||
* they are dropped on the target. If you want to add features to a vector
|
* they are dropped on the target. If you want to add features to a vector
|
||||||
@@ -47,7 +47,7 @@ class DragAndDropEvent extends Event {
|
|||||||
/**
|
/**
|
||||||
* @param {module:ol/interaction/DragAndDrop~DragAndDropEventType} type Type.
|
* @param {module:ol/interaction/DragAndDrop~DragAndDropEventType} type Type.
|
||||||
* @param {File} file File.
|
* @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.
|
* @param {module:ol/proj/Projection=} opt_projection Projection.
|
||||||
*/
|
*/
|
||||||
constructor(type, file, opt_features, opt_projection) {
|
constructor(type, file, opt_features, opt_projection) {
|
||||||
@@ -56,7 +56,7 @@ class DragAndDropEvent extends Event {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The features parsed from dropped data.
|
* The features parsed from dropped data.
|
||||||
* @type {Array.<module:ol/Feature>|undefined}
|
* @type {Array<module:ol/Feature>|undefined}
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
this.features = opt_features;
|
this.features = opt_features;
|
||||||
@@ -101,7 +101,7 @@ class DragAndDrop extends Interaction {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array.<function(new: module:ol/format/Feature)>}
|
* @type {Array<function(new: module:ol/format/Feature)>}
|
||||||
*/
|
*/
|
||||||
this.formatConstructors_ = options.formatConstructors ?
|
this.formatConstructors_ = options.formatConstructors ?
|
||||||
options.formatConstructors : [];
|
options.formatConstructors : [];
|
||||||
@@ -115,7 +115,7 @@ class DragAndDrop extends Interaction {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array.<module:ol/events~EventsKey>}
|
* @type {Array<module:ol/events~EventsKey>}
|
||||||
*/
|
*/
|
||||||
this.dropListenKeys_ = null;
|
this.dropListenKeys_ = null;
|
||||||
|
|
||||||
@@ -220,7 +220,7 @@ class DragAndDrop extends Interaction {
|
|||||||
* @param {string} text Text.
|
* @param {string} text Text.
|
||||||
* @param {module:ol/format/Feature~ReadOptions} options Read options.
|
* @param {module:ol/format/Feature~ReadOptions} options Read options.
|
||||||
* @private
|
* @private
|
||||||
* @return {Array.<module:ol/Feature>} Features.
|
* @return {Array<module:ol/Feature>} Features.
|
||||||
*/
|
*/
|
||||||
tryReadFeatures_(format, text, options) {
|
tryReadFeatures_(format, text, options) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ import {createEditingStyle} from '../style/Style.js';
|
|||||||
* @property {module:ol/events/condition~Condition} [finishCondition] A function
|
* @property {module:ol/events/condition~Condition} [finishCondition] A function
|
||||||
* that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a
|
* that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a
|
||||||
* boolean to indicate whether the drawing can be finished.
|
* 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.
|
* Style for sketch features.
|
||||||
* @property {module:ol/interaction/Draw~GeometryFunction} [geometryFunction]
|
* @property {module:ol/interaction/Draw~GeometryFunction} [geometryFunction]
|
||||||
* Function that is called when a geometry's coordinates are updated.
|
* 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
|
* arguments, and returns a geometry. The optional existing geometry is the
|
||||||
* geometry that is returned when the function is called without a second
|
* geometry that is returned when the function is called without a second
|
||||||
* argument.
|
* 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
|
* module:ol/geom/SimpleGeometry} GeometryFunction
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -272,7 +272,7 @@ class Draw extends PointerInteraction {
|
|||||||
if (!geometryFunction) {
|
if (!geometryFunction) {
|
||||||
if (this.type_ === GeometryType.CIRCLE) {
|
if (this.type_ === GeometryType.CIRCLE) {
|
||||||
/**
|
/**
|
||||||
* @param {!Array.<module:ol/coordinate~Coordinate>} coordinates
|
* @param {!Array<module:ol/coordinate~Coordinate>} coordinates
|
||||||
* The coordinates.
|
* The coordinates.
|
||||||
* @param {module:ol/geom/SimpleGeometry=} opt_geometry Optional geometry.
|
* @param {module:ol/geom/SimpleGeometry=} opt_geometry Optional geometry.
|
||||||
* @return {module:ol/geom/SimpleGeometry} A geometry.
|
* @return {module:ol/geom/SimpleGeometry} A geometry.
|
||||||
@@ -296,7 +296,7 @@ class Draw extends PointerInteraction {
|
|||||||
Constructor = Polygon;
|
Constructor = Polygon;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @param {!Array.<module:ol/coordinate~Coordinate>} coordinates
|
* @param {!Array<module:ol/coordinate~Coordinate>} coordinates
|
||||||
* The coordinates.
|
* The coordinates.
|
||||||
* @param {module:ol/geom/SimpleGeometry=} opt_geometry Optional geometry.
|
* @param {module:ol/geom/SimpleGeometry=} opt_geometry Optional geometry.
|
||||||
* @return {module:ol/geom/SimpleGeometry} A 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.
|
* 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
|
* @private
|
||||||
*/
|
*/
|
||||||
this.sketchCoords_ = null;
|
this.sketchCoords_ = null;
|
||||||
@@ -372,7 +372,7 @@ class Draw extends PointerInteraction {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sketch line coordinates. Used when drawing a polygon or circle.
|
* Sketch line coordinates. Used when drawing a polygon or circle.
|
||||||
* @type {Array.<module:ol/coordinate~Coordinate>}
|
* @type {Array<module:ol/coordinate~Coordinate>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.sketchLineCoords_ = null;
|
this.sketchLineCoords_ = null;
|
||||||
@@ -580,7 +580,7 @@ class Draw extends PointerInteraction {
|
|||||||
}
|
}
|
||||||
last[0] = coordinate[0];
|
last[0] = coordinate[0];
|
||||||
last[1] = coordinate[1];
|
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_) {
|
if (this.sketchPoint_) {
|
||||||
const sketchPointGeom = /** @type {module:ol/geom/Point} */ (this.sketchPoint_.getGeometry());
|
const sketchPointGeom = /** @type {module:ol/geom/Point} */ (this.sketchPoint_.getGeometry());
|
||||||
sketchPointGeom.setCoordinates(coordinate);
|
sketchPointGeom.setCoordinates(coordinate);
|
||||||
|
|||||||
@@ -20,12 +20,12 @@ import {createEditingStyle} from '../style/Style.js';
|
|||||||
* @typedef {Object} Options
|
* @typedef {Object} Options
|
||||||
* @property {module:ol/extent~Extent} [extent] Initial extent. Defaults to no
|
* @property {module:ol/extent~Extent} [extent] Initial extent. Defaults to no
|
||||||
* initial extent.
|
* 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
|
* Style for the drawn extent box. Defaults to
|
||||||
* {@link module:ol/style/Style~createEditing()['Polygon']}
|
* {@link module:ol/style/Style~createEditing()['Polygon']}
|
||||||
* @property {number} [pixelTolerance=10] Pixel tolerance for considering the
|
* @property {number} [pixelTolerance=10] Pixel tolerance for considering the
|
||||||
* pointer close enough to a segment or vertex for editing.
|
* 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
|
* Style for the cursor used to draw the extent. Defaults to
|
||||||
* {@link module:ol/style/Style~createEditing()['Point']}
|
* {@link module:ol/style/Style~createEditing()['Point']}
|
||||||
* @property {boolean} [wrapX=false] Wrap the drawn extent across multiple maps
|
* @property {boolean} [wrapX=false] Wrap the drawn extent across multiple maps
|
||||||
|
|||||||
@@ -60,12 +60,12 @@ const ModifyEventType = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} SegmentData
|
* @typedef {Object} SegmentData
|
||||||
* @property {Array.<number>} [depth]
|
* @property {Array<number>} [depth]
|
||||||
* @property {module:ol/Feature} feature
|
* @property {module:ol/Feature} feature
|
||||||
* @property {module:ol/geom/SimpleGeometry} geometry
|
* @property {module:ol/geom/SimpleGeometry} geometry
|
||||||
* @property {number} index
|
* @property {number} index
|
||||||
* @property {Array.<module:ol/extent~Extent>} segment
|
* @property {Array<module:ol/extent~Extent>} segment
|
||||||
* @property {Array.<module:ol/interaction/Modify~SegmentData>} [featureSegments]
|
* @property {Array<module:ol/interaction/Modify~SegmentData>} [featureSegments]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ const ModifyEventType = {
|
|||||||
* features. Default is {@link module:ol/events/condition~always}.
|
* features. Default is {@link module:ol/events/condition~always}.
|
||||||
* @property {number} [pixelTolerance=10] Pixel tolerance for considering the
|
* @property {number} [pixelTolerance=10] Pixel tolerance for considering the
|
||||||
* pointer close enough to a segment or vertex for editing.
|
* 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 used for the features being modified. By default the default edit
|
||||||
* style is used (see {@link module:ol/style}).
|
* style is used (see {@link module:ol/style}).
|
||||||
* @property {module:ol/source/Vector} [source] The vector source with
|
* @property {module:ol/source/Vector} [source] The vector source with
|
||||||
@@ -388,7 +388,7 @@ class Modify extends PointerInteraction {
|
|||||||
*/
|
*/
|
||||||
removeFeatureSegmentData_(feature) {
|
removeFeatureSegmentData_(feature) {
|
||||||
const rBush = this.rBush_;
|
const rBush = this.rBush_;
|
||||||
const /** @type {Array.<module:ol/interaction/Modify~SegmentData>} */ nodesToRemove = [];
|
const /** @type {Array<module:ol/interaction/Modify~SegmentData>} */ nodesToRemove = [];
|
||||||
rBush.forEach(
|
rBush.forEach(
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/interaction/Modify~SegmentData} node RTree node.
|
* @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 {module:ol/geom/SimpleGeometry} geometry Geometry.
|
||||||
* @param {number} index Index.
|
* @param {number} index Index.
|
||||||
* @param {Array.<number>|undefined} depth Depth.
|
* @param {Array<number>|undefined} depth Depth.
|
||||||
* @param {number} delta Delta (1 or -1).
|
* @param {number} delta Delta (1 or -1).
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ class PointerInteraction extends Interaction {
|
|||||||
this.trackedPointers_ = {};
|
this.trackedPointers_ = {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Array.<module:ol/pointer/PointerEvent>}
|
* @type {Array<module:ol/pointer/PointerEvent>}
|
||||||
* @protected
|
* @protected
|
||||||
*/
|
*/
|
||||||
this.targetPointers = [];
|
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.
|
* @return {module:ol/pixel~Pixel} Centroid pixel.
|
||||||
*/
|
*/
|
||||||
export function centroid(pointerEvents) {
|
export function centroid(pointerEvents) {
|
||||||
|
|||||||
@@ -55,13 +55,13 @@ const SelectEventType = {
|
|||||||
* feature removes all from the selection.
|
* feature removes all from the selection.
|
||||||
* See `toggle`, `add`, `remove` options for adding/removing extra features to/
|
* See `toggle`, `add`, `remove` options for adding/removing extra features to/
|
||||||
* from the selection.
|
* 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
|
* 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
|
* 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
|
* 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. If the option is absent, all visible layers will be considered
|
||||||
* selectable.
|
* 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
|
* Style for the selected features. By default the default edit style is used
|
||||||
* (see {@link module:ol/style}).
|
* (see {@link module:ol/style}).
|
||||||
* @property {module:ol/events/condition~Condition} [removeCondition] A function
|
* @property {module:ol/events/condition~Condition} [removeCondition] A function
|
||||||
@@ -105,8 +105,8 @@ const SelectEventType = {
|
|||||||
class SelectEvent extends Event {
|
class SelectEvent extends Event {
|
||||||
/**
|
/**
|
||||||
* @param {SelectEventType} type The event type.
|
* @param {SelectEventType} type The event type.
|
||||||
* @param {Array.<module:ol/Feature>} selected Selected features.
|
* @param {Array<module:ol/Feature>} selected Selected features.
|
||||||
* @param {Array.<module:ol/Feature>} deselected Deselected features.
|
* @param {Array<module:ol/Feature>} deselected Deselected features.
|
||||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent Associated
|
* @param {module:ol/MapBrowserEvent} mapBrowserEvent Associated
|
||||||
* {@link module:ol/MapBrowserEvent}.
|
* {@link module:ol/MapBrowserEvent}.
|
||||||
*/
|
*/
|
||||||
@@ -115,14 +115,14 @@ class SelectEvent extends Event {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Selected features array.
|
* Selected features array.
|
||||||
* @type {Array.<module:ol/Feature>}
|
* @type {Array<module:ol/Feature>}
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
this.selected = selected;
|
this.selected = selected;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deselected features array.
|
* Deselected features array.
|
||||||
* @type {Array.<module:ol/Feature>}
|
* @type {Array<module:ol/Feature>}
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
this.deselected = deselected;
|
this.deselected = deselected;
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import RBush from '../structs/RBush.js';
|
|||||||
/**
|
/**
|
||||||
* @typedef {Object} SegmentData
|
* @typedef {Object} SegmentData
|
||||||
* @property {module:ol/Feature} feature
|
* @property {module:ol/Feature} feature
|
||||||
* @property {Array.<module:ol/coordinate~Coordinate>} segment
|
* @property {Array<module:ol/coordinate~Coordinate>} segment
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -105,7 +105,7 @@ class Snap extends PointerInteraction {
|
|||||||
this.features_ = options.features ? options.features : null;
|
this.features_ = options.features ? options.features : null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Array.<module:ol/events~EventsKey>}
|
* @type {Array<module:ol/events~EventsKey>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.featuresListenerKeys_ = [];
|
this.featuresListenerKeys_ = [];
|
||||||
@@ -224,7 +224,7 @@ class Snap extends PointerInteraction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {module:ol/Collection.<module:ol/Feature>|Array.<module:ol/Feature>} Features.
|
* @return {module:ol/Collection.<module:ol/Feature>|Array<module:ol/Feature>} Features.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
getFeatures_() {
|
getFeatures_() {
|
||||||
@@ -235,7 +235,7 @@ class Snap extends PointerInteraction {
|
|||||||
features = this.source_.getFeatures();
|
features = this.source_.getFeatures();
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
/** @type {!Array.<module:ol/Feature>|!module:ol/Collection.<module:ol/Feature>} */ (features)
|
/** @type {!Array<module:ol/Feature>|!module:ol/Collection.<module:ol/Feature>} */ (features)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ const TranslateEventType = {
|
|||||||
* @typedef {Object} Options
|
* @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.
|
* 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
|
* translated. Alternatively, a filter function can be provided. The
|
||||||
* function will be called for each layer in the map and should return
|
* 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
|
* `true` for layers that you want to be translatable. If the option is
|
||||||
|
|||||||
@@ -100,17 +100,17 @@ class BaseLayer extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @abstract
|
* @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).
|
* modified in place).
|
||||||
* @return {Array.<module:ol/layer/Layer>} Array of layers.
|
* @return {Array<module:ol/layer/Layer>} Array of layers.
|
||||||
*/
|
*/
|
||||||
getLayersArray(opt_array) {}
|
getLayersArray(opt_array) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @abstract
|
* @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).
|
* 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) {}
|
getLayerStatesArray(opt_states) {}
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import SourceState from '../source/State.js';
|
|||||||
* visible.
|
* visible.
|
||||||
* @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will
|
* @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will
|
||||||
* be visible.
|
* be visible.
|
||||||
* @property {Array.<module:ol/layer/Base>|module:ol/Collection.<module:ol/layer/Base>} [layers] Child layers.
|
* @property {Array<module:ol/layer/Base>|module:ol/Collection.<module:ol/layer/Base>} [layers] Child layers.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -64,13 +64,13 @@ class LayerGroup extends BaseLayer {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array.<module:ol/events~EventsKey>}
|
* @type {Array<module:ol/events~EventsKey>}
|
||||||
*/
|
*/
|
||||||
this.layersListenerKeys_ = [];
|
this.layersListenerKeys_ = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Object.<string, Array.<module:ol/events~EventsKey>>}
|
* @type {Object.<string, Array<module:ol/events~EventsKey>>}
|
||||||
*/
|
*/
|
||||||
this.listenerKeys_ = {};
|
this.listenerKeys_ = {};
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import Style from '../style/Style.js';
|
|||||||
* visible.
|
* visible.
|
||||||
* @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will
|
* @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will
|
||||||
* be visible.
|
* be visible.
|
||||||
* @property {Array.<string>} [gradient=['#00f', '#0ff', '#0f0', '#ff0', '#f00']] The color gradient
|
* @property {Array<string>} [gradient=['#00f', '#0ff', '#0f0', '#ff0', '#f00']] The color gradient
|
||||||
* of the heatmap, specified as an array of CSS color strings.
|
* of the heatmap, specified as an array of CSS color strings.
|
||||||
* @property {number} [radius=8] Radius size in pixels.
|
* @property {number} [radius=8] Radius size in pixels.
|
||||||
* @property {number} [blur=15] Blur size in pixels.
|
* @property {number} [blur=15] Blur size in pixels.
|
||||||
@@ -54,7 +54,7 @@ const Property = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Array.<string>}
|
* @type {Array<string>}
|
||||||
*/
|
*/
|
||||||
const DEFAULT_GRADIENT = ['#00f', '#0ff', '#0f0', '#ff0', '#f00'];
|
const DEFAULT_GRADIENT = ['#00f', '#0ff', '#0f0', '#ff0', '#f00'];
|
||||||
|
|
||||||
@@ -105,7 +105,7 @@ class Heatmap extends VectorLayer {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array.<Array.<module:ol/style/Style>>}
|
* @type {Array<Array<module:ol/style/Style>>}
|
||||||
*/
|
*/
|
||||||
this.styleCache_ = null;
|
this.styleCache_ = null;
|
||||||
|
|
||||||
@@ -197,12 +197,12 @@ class Heatmap extends VectorLayer {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the gradient colors as array of strings.
|
* Return the gradient colors as array of strings.
|
||||||
* @return {Array.<string>} Colors.
|
* @return {Array<string>} Colors.
|
||||||
* @api
|
* @api
|
||||||
* @observable
|
* @observable
|
||||||
*/
|
*/
|
||||||
getGradient() {
|
getGradient() {
|
||||||
return /** @type {Array.<string>} */ (this.get(Property.GRADIENT));
|
return /** @type {Array<string>} */ (this.get(Property.GRADIENT));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -263,7 +263,7 @@ class Heatmap extends VectorLayer {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the gradient colors as array of strings.
|
* Set the gradient colors as array of strings.
|
||||||
* @param {Array.<string>} colors Gradient.
|
* @param {Array<string>} colors Gradient.
|
||||||
* @api
|
* @api
|
||||||
* @observable
|
* @observable
|
||||||
*/
|
*/
|
||||||
@@ -284,7 +284,7 @@ class Heatmap extends VectorLayer {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array.<string>} colors A list of colored.
|
* @param {Array<string>} colors A list of colored.
|
||||||
* @return {Uint8ClampedArray} An array.
|
* @return {Uint8ClampedArray} An array.
|
||||||
*/
|
*/
|
||||||
function createGradient(colors) {
|
function createGradient(colors) {
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ import {createDefaultStyle, toFunction as toStyleFunction} from '../style/Style.
|
|||||||
* @property {boolean} [declutter=false] Declutter images and text. Decluttering is applied to all
|
* @property {boolean} [declutter=false] Declutter images and text. Decluttering is applied to all
|
||||||
* image and text styles, and the priority is defined by the z-index of the style. Lower z-index
|
* image and text styles, and the priority is defined by the z-index of the style. Lower z-index
|
||||||
* means higher priority.
|
* means higher priority.
|
||||||
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [style] Layer style. See
|
* @property {module:ol/style/Style|Array<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [style] Layer style. See
|
||||||
* {@link module:ol/style} for default style which will be used if this is not defined.
|
* {@link module:ol/style} for default style which will be used if this is not defined.
|
||||||
* @property {boolean} [updateWhileAnimating=false] When set to `true` and `renderMode`
|
* @property {boolean} [updateWhileAnimating=false] When set to `true` and `renderMode`
|
||||||
* is `vector`, feature batches will be recreated during animations. This means that no
|
* is `vector`, feature batches will be recreated during animations. This means that no
|
||||||
@@ -117,7 +117,7 @@ class VectorLayer extends Layer {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* User provided style.
|
* User provided style.
|
||||||
* @type {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction}
|
* @type {module:ol/style/Style|Array<module:ol/style/Style>|module:ol/style/Style~StyleFunction}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.style_ = null;
|
this.style_ = null;
|
||||||
@@ -194,7 +194,7 @@ class VectorLayer extends Layer {
|
|||||||
/**
|
/**
|
||||||
* Get the style for features. This returns whatever was passed to the `style`
|
* Get the style for features. This returns whatever was passed to the `style`
|
||||||
* option at construction or to the `setStyle` method.
|
* option at construction or to the `setStyle` method.
|
||||||
* @return {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction}
|
* @return {module:ol/style/Style|Array<module:ol/style/Style>|module:ol/style/Style~StyleFunction}
|
||||||
* Layer style.
|
* Layer style.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -242,7 +242,7 @@ class VectorLayer extends Layer {
|
|||||||
* it is `null` the layer has no style (a `null` style), so only features
|
* it is `null` the layer has no style (a `null` style), so only features
|
||||||
* that have their own styles will be rendered in the layer. See
|
* that have their own styles will be rendered in the layer. See
|
||||||
* {@link module:ol/style} for information on the default style.
|
* {@link module:ol/style} for information on the default style.
|
||||||
* @param {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction|null|undefined} style Layer style.
|
* @param {module:ol/style/Style|Array<module:ol/style/Style>|module:ol/style/Style~StyleFunction|null|undefined} style Layer style.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
setStyle(style) {
|
setStyle(style) {
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ export const RenderType = {
|
|||||||
* image and text styles, and the priority is defined by the z-index of the style. Lower z-index
|
* image and text styles, and the priority is defined by the z-index of the style. Lower z-index
|
||||||
* means higher priority. When set to `true`, a `renderMode` of `'image'` will be overridden with
|
* means higher priority. When set to `true`, a `renderMode` of `'image'` will be overridden with
|
||||||
* `'hybrid'`.
|
* `'hybrid'`.
|
||||||
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [style] Layer style. See
|
* @property {module:ol/style/Style|Array<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [style] Layer style. See
|
||||||
* {@link module:ol/style} for default style which will be used if this is not defined.
|
* {@link module:ol/style} for default style which will be used if this is not defined.
|
||||||
* @property {boolean} [updateWhileAnimating=false] When set to `true`, feature batches will be
|
* @property {boolean} [updateWhileAnimating=false] When set to `true`, feature batches will be
|
||||||
* recreated during animations. This means that no vectors will be shown clipped, but the setting
|
* recreated during animations. This means that no vectors will be shown clipped, but the setting
|
||||||
@@ -80,7 +80,7 @@ export const RenderType = {
|
|||||||
* means no preloading.
|
* means no preloading.
|
||||||
* @property {module:ol/render~OrderFunction} [renderOrder] Render order. Function to be used when sorting
|
* @property {module:ol/render~OrderFunction} [renderOrder] Render order. Function to be used when sorting
|
||||||
* features before rendering. By default features are drawn in the order that they are created.
|
* features before rendering. By default features are drawn in the order that they are created.
|
||||||
* @property {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [style] Layer style. See
|
* @property {module:ol/style/Style|Array<module:ol/style/Style>|module:ol/style/Style~StyleFunction} [style] Layer style. See
|
||||||
* {@link module:ol/style} for default style which will be used if this is not defined.
|
* {@link module:ol/style} for default style which will be used if this is not defined.
|
||||||
* @property {boolean} [useInterimTilesOnError=true] Use interim tiles on error.
|
* @property {boolean} [useInterimTilesOnError=true] Use interim tiles on error.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
* Strategy function for loading all features with a single request.
|
* Strategy function for loading all features with a single request.
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {module:ol/extent~Extent} extent Extent.
|
||||||
* @param {number} resolution Resolution.
|
* @param {number} resolution Resolution.
|
||||||
* @return {Array.<module:ol/extent~Extent>} Extents.
|
* @return {Array<module:ol/extent~Extent>} Extents.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function all(extent, resolution) {
|
export function all(extent, resolution) {
|
||||||
@@ -20,7 +20,7 @@ export function all(extent, resolution) {
|
|||||||
* resolution.
|
* resolution.
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {module:ol/extent~Extent} extent Extent.
|
||||||
* @param {number} resolution Resolution.
|
* @param {number} resolution Resolution.
|
||||||
* @return {Array.<module:ol/extent~Extent>} Extents.
|
* @return {Array<module:ol/extent~Extent>} Extents.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function bbox(extent, resolution) {
|
export function bbox(extent, resolution) {
|
||||||
@@ -31,7 +31,7 @@ export function bbox(extent, resolution) {
|
|||||||
/**
|
/**
|
||||||
* Creates a strategy function for loading features based on a tile grid.
|
* Creates a strategy function for loading features based on a tile grid.
|
||||||
* @param {module:ol/tilegrid/TileGrid} tileGrid Tile grid.
|
* @param {module:ol/tilegrid/TileGrid} tileGrid Tile grid.
|
||||||
* @return {function(module:ol/extent~Extent, number): Array.<module:ol/extent~Extent>} Loading strategy.
|
* @return {function(module:ol/extent~Extent, number): Array<module:ol/extent~Extent>} Loading strategy.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function tile(tileGrid) {
|
export function tile(tileGrid) {
|
||||||
@@ -39,12 +39,12 @@ export function tile(tileGrid) {
|
|||||||
/**
|
/**
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {module:ol/extent~Extent} extent Extent.
|
||||||
* @param {number} resolution Resolution.
|
* @param {number} resolution Resolution.
|
||||||
* @return {Array.<module:ol/extent~Extent>} Extents.
|
* @return {Array<module:ol/extent~Extent>} Extents.
|
||||||
*/
|
*/
|
||||||
function(extent, resolution) {
|
function(extent, resolution) {
|
||||||
const z = tileGrid.getZForResolution(resolution);
|
const z = tileGrid.getZForResolution(resolution);
|
||||||
const tileRange = tileGrid.getTileRangeForExtentAndZ(extent, z);
|
const tileRange = tileGrid.getTileRangeForExtentAndZ(extent, z);
|
||||||
/** @type {Array.<module:ol/extent~Extent>} */
|
/** @type {Array<module:ol/extent~Extent>} */
|
||||||
const extents = [];
|
const extents = [];
|
||||||
/** @type {module:ol/tilecoord~TileCoord} */
|
/** @type {module:ol/tilecoord~TileCoord} */
|
||||||
const tileCoord = [z, 0, 0];
|
const tileCoord = [z, 0, 0];
|
||||||
|
|||||||
@@ -99,9 +99,9 @@ export function squaredDistance(x1, y1, x2, y2) {
|
|||||||
/**
|
/**
|
||||||
* Solves system of linear equations using Gaussian elimination method.
|
* Solves system of linear equations using Gaussian elimination method.
|
||||||
*
|
*
|
||||||
* @param {Array.<Array.<number>>} mat Augmented matrix (n x n + 1 column)
|
* @param {Array<Array<number>>} mat Augmented matrix (n x n + 1 column)
|
||||||
* in row-major order.
|
* in row-major order.
|
||||||
* @return {Array.<number>} The resulting vector.
|
* @return {Array<number>} The resulting vector.
|
||||||
*/
|
*/
|
||||||
export function solveLinearSystem(mat) {
|
export function solveLinearSystem(mat) {
|
||||||
const n = mat.length;
|
const n = mat.length;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* An array with two elements, representing a pixel. The first element is the
|
* An array with two elements, representing a pixel. The first element is the
|
||||||
* x-coordinate, the second the y-coordinate of the pixel.
|
* x-coordinate, the second the y-coordinate of the pixel.
|
||||||
* @typedef {Array.<number>} Pixel
|
* @typedef {Array<number>} Pixel
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class EventSource {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* List of events supported by this source.
|
* List of events supported by this source.
|
||||||
* @return {Array.<string>} Event names
|
* @return {Array<string>} Event names
|
||||||
*/
|
*/
|
||||||
getEvents() {
|
getEvents() {
|
||||||
return Object.keys(this.mapping_);
|
return Object.keys(this.mapping_);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user