Transformed types
Using the [ts.js codemod](https://gist.github.com/tschaub/1ea498c9d1e5268cf36d212b3949be4e): jscodeshift --transform ts.js src
This commit is contained in:
@@ -24,7 +24,7 @@ const Property = {
|
|||||||
export class CollectionEvent extends Event {
|
export class CollectionEvent extends Event {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/CollectionEventType} type Type.
|
* @param {import("./CollectionEventType.js").default} type Type.
|
||||||
* @param {*=} opt_element Element.
|
* @param {*=} opt_element Element.
|
||||||
*/
|
*/
|
||||||
constructor(type, opt_element) {
|
constructor(type, opt_element) {
|
||||||
@@ -63,7 +63,7 @@ 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 {Options=} opt_options Collection options.
|
||||||
*/
|
*/
|
||||||
constructor(opt_array, opt_options) {
|
constructor(opt_array, opt_options) {
|
||||||
|
|
||||||
@@ -107,7 +107,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 {import("./Collection.js").default<T>} This collection.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
extend(arr) {
|
extend(arr) {
|
||||||
|
|||||||
+16
-16
@@ -54,7 +54,7 @@ import Style from './style/Style.js';
|
|||||||
*/
|
*/
|
||||||
class Feature extends BaseObject {
|
class Feature extends BaseObject {
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/geom/Geometry|Object<string, *>=} opt_geometryOrProperties
|
* @param {import("./geom/Geometry.js").default|Object<string, *>=} opt_geometryOrProperties
|
||||||
* You may pass a Geometry object directly, or an object literal containing
|
* You may pass a Geometry object directly, or an object literal containing
|
||||||
* properties. If you pass an object literal, you may include a Geometry
|
* properties. If you pass an object literal, you may include a Geometry
|
||||||
* associated with a `geometry` key.
|
* associated with a `geometry` key.
|
||||||
@@ -78,19 +78,19 @@ 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 {import("./style/Style.js").default|Array<import("./style/Style.js").default>|import("./style/Style.js").StyleFunction}
|
||||||
*/
|
*/
|
||||||
this.style_ = null;
|
this.style_ = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {module:ol/style/Style~StyleFunction|undefined}
|
* @type {import("./style/Style.js").StyleFunction|undefined}
|
||||||
*/
|
*/
|
||||||
this.styleFunction_ = undefined;
|
this.styleFunction_ = undefined;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {?module:ol/events~EventsKey}
|
* @type {?import("./events.js").EventsKey}
|
||||||
*/
|
*/
|
||||||
this.geometryChangeKey_ = null;
|
this.geometryChangeKey_ = null;
|
||||||
|
|
||||||
@@ -114,7 +114,7 @@ class Feature extends BaseObject {
|
|||||||
/**
|
/**
|
||||||
* Clone this feature. If the original feature has a geometry it
|
* Clone this feature. If the original feature has a geometry it
|
||||||
* is also cloned. The feature id is not set in the clone.
|
* is also cloned. The feature id is not set in the clone.
|
||||||
* @return {module:ol/Feature} The clone.
|
* @return {import("./Feature.js").default} The clone.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
clone() {
|
clone() {
|
||||||
@@ -135,13 +135,13 @@ class Feature extends BaseObject {
|
|||||||
* Get the feature's default geometry. A feature may have any number of named
|
* Get the feature's default geometry. A feature may have any number of named
|
||||||
* geometries. The "default" geometry (the one that is rendered by default) is
|
* geometries. The "default" geometry (the one that is rendered by default) is
|
||||||
* set when calling {@link module:ol/Feature~Feature#setGeometry}.
|
* set when calling {@link module:ol/Feature~Feature#setGeometry}.
|
||||||
* @return {module:ol/geom/Geometry|undefined} The default geometry for the feature.
|
* @return {import("./geom/Geometry.js").default|undefined} The default geometry for the feature.
|
||||||
* @api
|
* @api
|
||||||
* @observable
|
* @observable
|
||||||
*/
|
*/
|
||||||
getGeometry() {
|
getGeometry() {
|
||||||
return (
|
return (
|
||||||
/** @type {module:ol/geom/Geometry|undefined} */ (this.get(this.geometryName_))
|
/** @type {import("./geom/Geometry.js").default|undefined} */ (this.get(this.geometryName_))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -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 {import("./style/Style.js").default|Array<import("./style/Style.js").default>|import("./style/Style.js").StyleFunction} The feature style.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getStyle() {
|
getStyle() {
|
||||||
@@ -179,7 +179,7 @@ class Feature extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the feature's style function.
|
* Get the feature's style function.
|
||||||
* @return {module:ol/style/Style~StyleFunction|undefined} Return a function
|
* @return {import("./style/Style.js").StyleFunction|undefined} Return a function
|
||||||
* representing the current style of this feature.
|
* representing the current style of this feature.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -213,7 +213,7 @@ class Feature extends BaseObject {
|
|||||||
/**
|
/**
|
||||||
* Set the default geometry for the feature. This will update the property
|
* Set the default geometry for the feature. This will update the property
|
||||||
* with the name returned by {@link module:ol/Feature~Feature#getGeometryName}.
|
* with the name returned by {@link module:ol/Feature~Feature#getGeometryName}.
|
||||||
* @param {module:ol/geom/Geometry|undefined} geometry The new geometry.
|
* @param {import("./geom/Geometry.js").default|undefined} geometry The new geometry.
|
||||||
* @api
|
* @api
|
||||||
* @observable
|
* @observable
|
||||||
*/
|
*/
|
||||||
@@ -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 {import("./style/Style.js").default|Array<import("./style/Style.js").default>|import("./style/Style.js").StyleFunction} style Style for this feature.
|
||||||
* @api
|
* @api
|
||||||
* @fires module:ol/events/Event~Event#event:change
|
* @fires module:ol/events/Event~Event#event:change
|
||||||
*/
|
*/
|
||||||
@@ -271,25 +271,25 @@ 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 import("./style/Style.js").default 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 {import("./style/Style.js").StyleFunction|!Array<import("./style/Style.js").default>|!import("./style/Style.js").default} 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 {import("./style/Style.js").StyleFunction} A style function.
|
||||||
*/
|
*/
|
||||||
export function createStyleFunction(obj) {
|
export function createStyleFunction(obj) {
|
||||||
if (typeof obj === 'function') {
|
if (typeof obj === 'function') {
|
||||||
return obj;
|
return obj;
|
||||||
} else {
|
} else {
|
||||||
/**
|
/**
|
||||||
* @type {Array<module:ol/style/Style>}
|
* @type {Array<import("./style/Style.js").default>}
|
||||||
*/
|
*/
|
||||||
let styles;
|
let styles;
|
||||||
if (Array.isArray(obj)) {
|
if (Array.isArray(obj)) {
|
||||||
styles = obj;
|
styles = obj;
|
||||||
} else {
|
} else {
|
||||||
assert(obj instanceof Style,
|
assert(obj instanceof Style,
|
||||||
41); // Expected an `module:ol/style/Style~Style` or an array of `module:ol/style/Style~Style`
|
41); // Expected an `import("./style/Style.js").Style` or an array of `import("./style/Style.js").Style`
|
||||||
styles = [obj];
|
styles = [obj];
|
||||||
}
|
}
|
||||||
return function() {
|
return function() {
|
||||||
|
|||||||
+11
-11
@@ -17,7 +17,7 @@ import {get as getProjection, getTransformFromProjections, identityTransform} fr
|
|||||||
* instantiation.
|
* instantiation.
|
||||||
* @property {PositionOptions} [trackingOptions] Tracking options.
|
* @property {PositionOptions} [trackingOptions] Tracking options.
|
||||||
* See http://www.w3.org/TR/geolocation-API/#position_options_interface.
|
* See http://www.w3.org/TR/geolocation-API/#position_options_interface.
|
||||||
* @property {module:ol/proj~ProjectionLike} [projection] The projection the position
|
* @property {import("./proj.js").ProjectionLike} [projection] The projection the position
|
||||||
* is reported in.
|
* is reported in.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ import {get as getProjection, getTransformFromProjections, identityTransform} fr
|
|||||||
class Geolocation extends BaseObject {
|
class Geolocation extends BaseObject {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/Geolocation~Options=} opt_options Options.
|
* @param {Options=} opt_options Options.
|
||||||
*/
|
*/
|
||||||
constructor(opt_options) {
|
constructor(opt_options) {
|
||||||
|
|
||||||
@@ -59,13 +59,13 @@ class Geolocation extends BaseObject {
|
|||||||
/**
|
/**
|
||||||
* The unprojected (EPSG:4326) device position.
|
* The unprojected (EPSG:4326) device position.
|
||||||
* @private
|
* @private
|
||||||
* @type {module:ol/coordinate~Coordinate}
|
* @type {import("./coordinate.js").Coordinate}
|
||||||
*/
|
*/
|
||||||
this.position_ = null;
|
this.position_ = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {module:ol/proj~TransformFunction}
|
* @type {import("./proj.js").TransformFunction}
|
||||||
*/
|
*/
|
||||||
this.transform_ = identityTransform;
|
this.transform_ = identityTransform;
|
||||||
|
|
||||||
@@ -192,13 +192,13 @@ class Geolocation extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a geometry of the position accuracy.
|
* Get a geometry of the position accuracy.
|
||||||
* @return {?module:ol/geom/Polygon} A geometry of the position accuracy.
|
* @return {?import("./geom/Polygon.js").default} A geometry of the position accuracy.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getAccuracyGeometry() {
|
getAccuracyGeometry() {
|
||||||
return (
|
return (
|
||||||
/** @type {?module:ol/geom/Polygon} */ (this.get(GeolocationProperty.ACCURACY_GEOMETRY) || null)
|
/** @type {?import("./geom/Polygon.js").default} */ (this.get(GeolocationProperty.ACCURACY_GEOMETRY) || null)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -238,27 +238,27 @@ class Geolocation extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the position of the device.
|
* Get the position of the device.
|
||||||
* @return {module:ol/coordinate~Coordinate|undefined} The current position of the device reported
|
* @return {import("./coordinate.js").Coordinate|undefined} The current position of the device reported
|
||||||
* in the current projection.
|
* in the current projection.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getPosition() {
|
getPosition() {
|
||||||
return (
|
return (
|
||||||
/** @type {module:ol/coordinate~Coordinate|undefined} */ (this.get(GeolocationProperty.POSITION))
|
/** @type {import("./coordinate.js").Coordinate|undefined} */ (this.get(GeolocationProperty.POSITION))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the projection associated with the position.
|
* Get the projection associated with the position.
|
||||||
* @return {module:ol/proj/Projection|undefined} The projection the position is
|
* @return {import("./proj/Projection.js").default|undefined} The projection the position is
|
||||||
* reported in.
|
* reported in.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getProjection() {
|
getProjection() {
|
||||||
return (
|
return (
|
||||||
/** @type {module:ol/proj/Projection|undefined} */ (this.get(GeolocationProperty.PROJECTION))
|
/** @type {import("./proj/Projection.js").default|undefined} */ (this.get(GeolocationProperty.PROJECTION))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -298,7 +298,7 @@ class Geolocation extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the projection to use for transforming the coordinates.
|
* Set the projection to use for transforming the coordinates.
|
||||||
* @param {module:ol/proj~ProjectionLike} projection The projection the position is
|
* @param {import("./proj.js").ProjectionLike} projection The projection the position is
|
||||||
* reported in.
|
* reported in.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api
|
||||||
|
|||||||
+38
-38
@@ -17,7 +17,7 @@ import Text from './style/Text.js';
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {module:ol/style/Stroke}
|
* @type {import("./style/Stroke.js").default}
|
||||||
* @private
|
* @private
|
||||||
* @const
|
* @const
|
||||||
*/
|
*/
|
||||||
@@ -36,13 +36,13 @@ const INTERVALS = [
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} GraticuleLabelDataType
|
* @typedef {Object} GraticuleLabelDataType
|
||||||
* @property {module:ol/geom/Point} geom
|
* @property {import("./geom/Point.js").default} geom
|
||||||
* @property {string} text
|
* @property {string} text
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} Options
|
* @typedef {Object} Options
|
||||||
* @property {module:ol/PluggableMap} [map] Reference to an
|
* @property {import("./PluggableMap.js").default} [map] Reference to an
|
||||||
* {@link module:ol/Map~Map} object.
|
* {@link module:ol/Map~Map} object.
|
||||||
* @property {number} [maxLines=100] The maximum number of meridians and
|
* @property {number} [maxLines=100] The maximum number of meridians and
|
||||||
* parallels from the center of the map. The default value of 100 means that at
|
* parallels from the center of the map. The default value of 100 means that at
|
||||||
@@ -50,7 +50,7 @@ const INTERVALS = [
|
|||||||
* appropriate for conformal projections like Spherical Mercator. If you
|
* appropriate for conformal projections like Spherical Mercator. If you
|
||||||
* increase the value, more lines will be drawn and the drawing performance will
|
* increase the value, more lines will be drawn and the drawing performance will
|
||||||
* decrease.
|
* decrease.
|
||||||
* @property {module:ol/style/Stroke} [strokeStyle='rgba(0,0,0,0.2)'] The
|
* @property {import("./style/Stroke.js").default} [strokeStyle='rgba(0,0,0,0.2)'] The
|
||||||
* stroke style to use for drawing the graticule. If not provided, a not fully
|
* stroke style to use for drawing the graticule. If not provided, a not fully
|
||||||
* opaque black will be used.
|
* opaque black will be used.
|
||||||
* @property {number} [targetSize=100] The target size of the graticule cells,
|
* @property {number} [targetSize=100] The target size of the graticule cells,
|
||||||
@@ -71,7 +71,7 @@ const INTERVALS = [
|
|||||||
* @property {number} [latLabelPosition=1] Latitude label position in fractions
|
* @property {number} [latLabelPosition=1] Latitude label position in fractions
|
||||||
* (0..1) of view extent. 0 means at the left of the viewport, 1 means at the
|
* (0..1) of view extent. 0 means at the left of the viewport, 1 means at the
|
||||||
* right.
|
* right.
|
||||||
* @property {module:ol/style/Text} [lonLabelStyle] Longitude label text
|
* @property {import("./style/Text.js").default} [lonLabelStyle] Longitude label text
|
||||||
* style. If not provided, the following style will be used:
|
* style. If not provided, the following style will be used:
|
||||||
* ```js
|
* ```js
|
||||||
* new Text({
|
* new Text({
|
||||||
@@ -89,7 +89,7 @@ const INTERVALS = [
|
|||||||
* Note that the default's `textBaseline` configuration will not work well for
|
* Note that the default's `textBaseline` configuration will not work well for
|
||||||
* `lonLabelPosition` configurations that position labels close to the top of
|
* `lonLabelPosition` configurations that position labels close to the top of
|
||||||
* the viewport.
|
* the viewport.
|
||||||
* @property {module:ol/style/Text} [latLabelStyle] Latitude label text style.
|
* @property {import("./style/Text.js").default} [latLabelStyle] Latitude label text style.
|
||||||
* If not provided, the following style will be used:
|
* If not provided, the following style will be used:
|
||||||
* ```js
|
* ```js
|
||||||
* new Text({
|
* new Text({
|
||||||
@@ -117,25 +117,25 @@ const INTERVALS = [
|
|||||||
class Graticule {
|
class Graticule {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/Graticule~Options=} opt_options Options.
|
* @param {Options=} opt_options Options.
|
||||||
*/
|
*/
|
||||||
constructor(opt_options) {
|
constructor(opt_options) {
|
||||||
const options = opt_options || {};
|
const options = opt_options || {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {module:ol/PluggableMap}
|
* @type {import("./PluggableMap.js").default}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.map_ = null;
|
this.map_ = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {?module:ol/events~EventsKey}
|
* @type {?import("./events.js").EventsKey}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.postcomposeListenerKey_ = null;
|
this.postcomposeListenerKey_ = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {module:ol/proj/Projection}
|
* @type {import("./proj/Projection.js").default}
|
||||||
*/
|
*/
|
||||||
this.projection_ = null;
|
this.projection_ = null;
|
||||||
|
|
||||||
@@ -200,49 +200,49 @@ 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<import("./geom/LineString.js").default>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.meridians_ = [];
|
this.meridians_ = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Array<module:ol/geom/LineString>}
|
* @type {Array<import("./geom/LineString.js").default>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.parallels_ = [];
|
this.parallels_ = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {module:ol/style/Stroke}
|
* @type {import("./style/Stroke.js").default}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.strokeStyle_ = options.strokeStyle !== undefined ? options.strokeStyle : DEFAULT_STROKE_STYLE;
|
this.strokeStyle_ = options.strokeStyle !== undefined ? options.strokeStyle : DEFAULT_STROKE_STYLE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {module:ol/proj~TransformFunction|undefined}
|
* @type {import("./proj.js").TransformFunction|undefined}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.fromLonLatTransform_ = undefined;
|
this.fromLonLatTransform_ = undefined;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {module:ol/proj~TransformFunction|undefined}
|
* @type {import("./proj.js").TransformFunction|undefined}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.toLonLatTransform_ = undefined;
|
this.toLonLatTransform_ = undefined;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {module:ol/coordinate~Coordinate}
|
* @type {import("./coordinate.js").Coordinate}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.projectionCenterLonLat_ = null;
|
this.projectionCenterLonLat_ = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Array<module:ol/Graticule~GraticuleLabelDataType>}
|
* @type {Array<GraticuleLabelDataType>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.meridiansLabels_ = null;
|
this.meridiansLabels_ = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Array<module:ol/Graticule~GraticuleLabelDataType>}
|
* @type {Array<GraticuleLabelDataType>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.parallelsLabels_ = null;
|
this.parallelsLabels_ = null;
|
||||||
@@ -282,7 +282,7 @@ class Graticule {
|
|||||||
options.latLabelPosition;
|
options.latLabelPosition;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {module:ol/style/Text}
|
* @type {import("./style/Text.js").default}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.lonLabelStyle_ = options.lonLabelStyle !== undefined ? options.lonLabelStyle :
|
this.lonLabelStyle_ = options.lonLabelStyle !== undefined ? options.lonLabelStyle :
|
||||||
@@ -299,7 +299,7 @@ class Graticule {
|
|||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {module:ol/style/Text}
|
* @type {import("./style/Text.js").default}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.latLabelStyle_ = options.latLabelStyle !== undefined ? options.latLabelStyle :
|
this.latLabelStyle_ = options.latLabelStyle !== undefined ? options.latLabelStyle :
|
||||||
@@ -327,7 +327,7 @@ class Graticule {
|
|||||||
* @param {number} minLat Minimal latitude.
|
* @param {number} minLat Minimal latitude.
|
||||||
* @param {number} maxLat Maximal latitude.
|
* @param {number} maxLat Maximal latitude.
|
||||||
* @param {number} squaredTolerance Squared tolerance.
|
* @param {number} squaredTolerance Squared tolerance.
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {import("./extent.js").Extent} extent Extent.
|
||||||
* @param {number} index Index.
|
* @param {number} index Index.
|
||||||
* @return {number} Index.
|
* @return {number} Index.
|
||||||
* @private
|
* @private
|
||||||
@@ -348,10 +348,10 @@ class Graticule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/geom/LineString} lineString Meridian
|
* @param {import("./geom/LineString.js").default} lineString Meridian
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {import("./extent.js").Extent} extent Extent.
|
||||||
* @param {number} index Index.
|
* @param {number} index Index.
|
||||||
* @return {module:ol/geom/Point} Meridian point.
|
* @return {import("./geom/Point.js").default} Meridian point.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
getMeridianPoint_(lineString, extent, index) {
|
getMeridianPoint_(lineString, extent, index) {
|
||||||
@@ -377,7 +377,7 @@ class Graticule {
|
|||||||
* @param {number} minLon Minimal longitude.
|
* @param {number} minLon Minimal longitude.
|
||||||
* @param {number} maxLon Maximal longitude.
|
* @param {number} maxLon Maximal longitude.
|
||||||
* @param {number} squaredTolerance Squared tolerance.
|
* @param {number} squaredTolerance Squared tolerance.
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {import("./extent.js").Extent} extent Extent.
|
||||||
* @param {number} index Index.
|
* @param {number} index Index.
|
||||||
* @return {number} Index.
|
* @return {number} Index.
|
||||||
* @private
|
* @private
|
||||||
@@ -398,10 +398,10 @@ class Graticule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/geom/LineString} lineString Parallels.
|
* @param {import("./geom/LineString.js").default} lineString Parallels.
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {import("./extent.js").Extent} extent Extent.
|
||||||
* @param {number} index Index.
|
* @param {number} index Index.
|
||||||
* @return {module:ol/geom/Point} Parallel point.
|
* @return {import("./geom/Point.js").default} Parallel point.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
getParallelPoint_(lineString, extent, index) {
|
getParallelPoint_(lineString, extent, index) {
|
||||||
@@ -423,8 +423,8 @@ class Graticule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {import("./extent.js").Extent} extent Extent.
|
||||||
* @param {module:ol/coordinate~Coordinate} center Center.
|
* @param {import("./coordinate.js").Coordinate} center Center.
|
||||||
* @param {number} resolution Resolution.
|
* @param {number} resolution Resolution.
|
||||||
* @param {number} squaredTolerance Squared tolerance.
|
* @param {number} squaredTolerance Squared tolerance.
|
||||||
* @private
|
* @private
|
||||||
@@ -549,7 +549,7 @@ class Graticule {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the map associated with this graticule.
|
* Get the map associated with this graticule.
|
||||||
* @return {module:ol/PluggableMap} The map.
|
* @return {import("./PluggableMap.js").default} The map.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getMap() {
|
getMap() {
|
||||||
@@ -561,7 +561,7 @@ class Graticule {
|
|||||||
* @param {number} minLat Minimal latitude.
|
* @param {number} minLat Minimal latitude.
|
||||||
* @param {number} maxLat Maximal latitude.
|
* @param {number} maxLat Maximal latitude.
|
||||||
* @param {number} squaredTolerance Squared tolerance.
|
* @param {number} squaredTolerance Squared tolerance.
|
||||||
* @return {module:ol/geom/LineString} The meridian line string.
|
* @return {import("./geom/LineString.js").default} The meridian line string.
|
||||||
* @param {number} index Index.
|
* @param {number} index Index.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -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<import("./geom/LineString.js").default>} The meridians.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getMeridians() {
|
getMeridians() {
|
||||||
@@ -591,7 +591,7 @@ class Graticule {
|
|||||||
* @param {number} minLon Minimal longitude.
|
* @param {number} minLon Minimal longitude.
|
||||||
* @param {number} maxLon Maximal longitude.
|
* @param {number} maxLon Maximal longitude.
|
||||||
* @param {number} squaredTolerance Squared tolerance.
|
* @param {number} squaredTolerance Squared tolerance.
|
||||||
* @return {module:ol/geom/LineString} The parallel line string.
|
* @return {import("./geom/LineString.js").default} The parallel line string.
|
||||||
* @param {number} index Index.
|
* @param {number} index Index.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -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<import("./geom/LineString.js").default>} The parallels.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getParallels() {
|
getParallels() {
|
||||||
@@ -617,7 +617,7 @@ class Graticule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/render/Event} e Event.
|
* @param {import("./render/Event.js").default} e Event.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
handlePostCompose_(e) {
|
handlePostCompose_(e) {
|
||||||
@@ -672,7 +672,7 @@ class Graticule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/proj/Projection} projection Projection.
|
* @param {import("./proj/Projection.js").default} projection Projection.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
updateProjectionInfo_(projection) {
|
updateProjectionInfo_(projection) {
|
||||||
@@ -703,7 +703,7 @@ class Graticule {
|
|||||||
/**
|
/**
|
||||||
* Set the map for this graticule. The graticule will be rendered on the
|
* Set the map for this graticule. The graticule will be rendered on the
|
||||||
* provided map.
|
* provided map.
|
||||||
* @param {module:ol/PluggableMap} map Map.
|
* @param {import("./PluggableMap.js").default} map Map.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
setMap(map) {
|
setMap(map) {
|
||||||
|
|||||||
+6
-6
@@ -22,7 +22,7 @@ import {getHeight} from './extent.js';
|
|||||||
* post requests or - in general - through XHR requests, where the src of the
|
* post requests or - in general - through XHR requests, where the src of the
|
||||||
* image element would be set to a data URI when the content is loaded.
|
* image element would be set to a data URI when the content is loaded.
|
||||||
*
|
*
|
||||||
* @typedef {function(module:ol/Image, string)} LoadFunction
|
* @typedef {function(import("./Image.js").default, string)} LoadFunction
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -30,12 +30,12 @@ import {getHeight} from './extent.js';
|
|||||||
class ImageWrapper extends ImageBase {
|
class ImageWrapper extends ImageBase {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {import("./extent.js").Extent} extent Extent.
|
||||||
* @param {number|undefined} resolution Resolution.
|
* @param {number|undefined} resolution Resolution.
|
||||||
* @param {number} pixelRatio Pixel ratio.
|
* @param {number} pixelRatio Pixel ratio.
|
||||||
* @param {string} src Image source URI.
|
* @param {string} src Image source URI.
|
||||||
* @param {?string} crossOrigin Cross origin.
|
* @param {?string} crossOrigin Cross origin.
|
||||||
* @param {module:ol/Image~LoadFunction} imageLoadFunction Image load function.
|
* @param {LoadFunction} imageLoadFunction Image load function.
|
||||||
*/
|
*/
|
||||||
constructor(extent, resolution, pixelRatio, src, crossOrigin, imageLoadFunction) {
|
constructor(extent, resolution, pixelRatio, src, crossOrigin, imageLoadFunction) {
|
||||||
|
|
||||||
@@ -58,19 +58,19 @@ class ImageWrapper extends ImageBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array<module:ol/events~EventsKey>}
|
* @type {Array<import("./events.js").EventsKey>}
|
||||||
*/
|
*/
|
||||||
this.imageListenerKeys_ = null;
|
this.imageListenerKeys_ = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @protected
|
* @protected
|
||||||
* @type {module:ol/ImageState}
|
* @type {import("./ImageState.js").default}
|
||||||
*/
|
*/
|
||||||
this.state = ImageState.IDLE;
|
this.state = ImageState.IDLE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {module:ol/Image~LoadFunction}
|
* @type {LoadFunction}
|
||||||
*/
|
*/
|
||||||
this.imageLoadFunction_ = imageLoadFunction;
|
this.imageLoadFunction_ = imageLoadFunction;
|
||||||
|
|
||||||
|
|||||||
+6
-6
@@ -10,10 +10,10 @@ import EventType from './events/EventType.js';
|
|||||||
class ImageBase extends EventTarget {
|
class ImageBase extends EventTarget {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {import("./extent.js").Extent} extent Extent.
|
||||||
* @param {number|undefined} resolution Resolution.
|
* @param {number|undefined} resolution Resolution.
|
||||||
* @param {number} pixelRatio Pixel ratio.
|
* @param {number} pixelRatio Pixel ratio.
|
||||||
* @param {module:ol/ImageState} state State.
|
* @param {import("./ImageState.js").default} state State.
|
||||||
*/
|
*/
|
||||||
constructor(extent, resolution, pixelRatio, state) {
|
constructor(extent, resolution, pixelRatio, state) {
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ class ImageBase extends EventTarget {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @protected
|
* @protected
|
||||||
* @type {module:ol/extent~Extent}
|
* @type {import("./extent.js").Extent}
|
||||||
*/
|
*/
|
||||||
this.extent = extent;
|
this.extent = extent;
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ class ImageBase extends EventTarget {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @protected
|
* @protected
|
||||||
* @type {module:ol/ImageState}
|
* @type {import("./ImageState.js").default}
|
||||||
*/
|
*/
|
||||||
this.state = state;
|
this.state = state;
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ class ImageBase extends EventTarget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {module:ol/extent~Extent} Extent.
|
* @return {import("./extent.js").Extent} Extent.
|
||||||
*/
|
*/
|
||||||
getExtent() {
|
getExtent() {
|
||||||
return this.extent;
|
return this.extent;
|
||||||
@@ -80,7 +80,7 @@ class ImageBase extends EventTarget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {module:ol/ImageState} State.
|
* @return {import("./ImageState.js").default} State.
|
||||||
*/
|
*/
|
||||||
getState() {
|
getState() {
|
||||||
return this.state;
|
return this.state;
|
||||||
|
|||||||
@@ -18,11 +18,11 @@ import ImageState from './ImageState.js';
|
|||||||
class ImageCanvas extends ImageBase {
|
class ImageCanvas extends ImageBase {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {import("./extent.js").Extent} extent Extent.
|
||||||
* @param {number} resolution Resolution.
|
* @param {number} resolution Resolution.
|
||||||
* @param {number} pixelRatio Pixel ratio.
|
* @param {number} pixelRatio Pixel ratio.
|
||||||
* @param {HTMLCanvasElement} canvas Canvas.
|
* @param {HTMLCanvasElement} canvas Canvas.
|
||||||
* @param {module:ol/ImageCanvas~Loader=} opt_loader Optional loader function to
|
* @param {Loader=} opt_loader Optional loader function to
|
||||||
* support asynchronous canvas drawing.
|
* support asynchronous canvas drawing.
|
||||||
*/
|
*/
|
||||||
constructor(extent, resolution, pixelRatio, canvas, opt_loader) {
|
constructor(extent, resolution, pixelRatio, canvas, opt_loader) {
|
||||||
@@ -33,7 +33,7 @@ class ImageCanvas extends ImageBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Optional canvas loader function.
|
* Optional canvas loader function.
|
||||||
* @type {?module:ol/ImageCanvas~Loader}
|
* @type {?Loader}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.loader_ = opt_loader !== undefined ? opt_loader : null;
|
this.loader_ = opt_loader !== undefined ? opt_loader : null;
|
||||||
|
|||||||
+8
-8
@@ -8,20 +8,20 @@ import {listenOnce, unlistenByKey} from './events.js';
|
|||||||
import EventType from './events/EventType.js';
|
import EventType from './events/EventType.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {function(new: module:ol/ImageTile, module:ol/tilecoord~TileCoord,
|
* @typedef {function(new: import("./ImageTile.js").default, import("./tilecoord.js").TileCoord,
|
||||||
* module:ol/TileState, string, ?string, module:ol/Tile~LoadFunction)} TileClass
|
* import("./TileState.js").default, string, ?string, import("./Tile.js").LoadFunction)} TileClass
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class ImageTile extends Tile {
|
class ImageTile extends Tile {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate.
|
* @param {import("./tilecoord.js").TileCoord} tileCoord Tile coordinate.
|
||||||
* @param {module:ol/TileState} state State.
|
* @param {import("./TileState.js").default} state State.
|
||||||
* @param {string} src Image source URI.
|
* @param {string} src Image source URI.
|
||||||
* @param {?string} crossOrigin Cross origin.
|
* @param {?string} crossOrigin Cross origin.
|
||||||
* @param {module:ol/Tile~LoadFunction} tileLoadFunction Tile load function.
|
* @param {import("./Tile.js").LoadFunction} tileLoadFunction Tile load function.
|
||||||
* @param {module:ol/Tile~Options=} opt_options Tile options.
|
* @param {import("./Tile.js").Options=} opt_options Tile options.
|
||||||
*/
|
*/
|
||||||
constructor(tileCoord, state, src, crossOrigin, tileLoadFunction, opt_options) {
|
constructor(tileCoord, state, src, crossOrigin, tileLoadFunction, opt_options) {
|
||||||
|
|
||||||
@@ -52,13 +52,13 @@ class ImageTile extends Tile {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array<module:ol/events~EventsKey>}
|
* @type {Array<import("./events.js").EventsKey>}
|
||||||
*/
|
*/
|
||||||
this.imageListenerKeys_ = null;
|
this.imageListenerKeys_ = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {module:ol/Tile~LoadFunction}
|
* @type {import("./Tile.js").LoadFunction}
|
||||||
*/
|
*/
|
||||||
this.tileLoadFunction_ = tileLoadFunction;
|
this.tileLoadFunction_ = tileLoadFunction;
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -56,8 +56,8 @@ import CanvasVectorTileLayerRenderer from './renderer/canvas/VectorTileLayer.js'
|
|||||||
* options or added with `addLayer` can be groups, which can contain further
|
* options or added with `addLayer` can be groups, which can contain further
|
||||||
* groups, and so on.
|
* groups, and so on.
|
||||||
*
|
*
|
||||||
* @fires module:ol/MapBrowserEvent~MapBrowserEvent
|
* @fires import("./MapBrowserEvent.js").MapBrowserEvent
|
||||||
* @fires module:ol/MapEvent~MapEvent
|
* @fires import("./MapEvent.js").MapEvent
|
||||||
* @fires module:ol/render/Event~RenderEvent#postcompose
|
* @fires module:ol/render/Event~RenderEvent#postcompose
|
||||||
* @fires module:ol/render/Event~RenderEvent#precompose
|
* @fires module:ol/render/Event~RenderEvent#precompose
|
||||||
* @api
|
* @api
|
||||||
@@ -65,7 +65,7 @@ import CanvasVectorTileLayerRenderer from './renderer/canvas/VectorTileLayer.js'
|
|||||||
class Map extends PluggableMap {
|
class Map extends PluggableMap {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/PluggableMap~MapOptions} options Map options.
|
* @param {import("./PluggableMap.js").MapOptions} options Map options.
|
||||||
*/
|
*/
|
||||||
constructor(options) {
|
constructor(options) {
|
||||||
options = assign({}, options);
|
options = assign({}, options);
|
||||||
|
|||||||
@@ -12,10 +12,10 @@ class MapBrowserEvent extends MapEvent {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} type Event type.
|
* @param {string} type Event type.
|
||||||
* @param {module:ol/PluggableMap} map Map.
|
* @param {import("./PluggableMap.js").default} map Map.
|
||||||
* @param {Event} browserEvent Browser event.
|
* @param {Event} browserEvent Browser event.
|
||||||
* @param {boolean=} opt_dragging Is the map currently being dragged?
|
* @param {boolean=} opt_dragging Is the map currently being dragged?
|
||||||
* @param {?module:ol/PluggableMap~FrameState=} opt_frameState Frame state.
|
* @param {?import("./PluggableMap.js").FrameState=} opt_frameState Frame state.
|
||||||
*/
|
*/
|
||||||
constructor(type, map, browserEvent, opt_dragging, opt_frameState) {
|
constructor(type, map, browserEvent, opt_dragging, opt_frameState) {
|
||||||
|
|
||||||
@@ -31,14 +31,14 @@ class MapBrowserEvent extends MapEvent {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The map pixel relative to the viewport corresponding to the original browser event.
|
* The map pixel relative to the viewport corresponding to the original browser event.
|
||||||
* @type {module:ol/pixel~Pixel}
|
* @type {import("./pixel.js").Pixel}
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
this.pixel = map.getEventPixel(browserEvent);
|
this.pixel = map.getEventPixel(browserEvent);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The coordinate in view projection corresponding to the original browser event.
|
* The coordinate in view projection corresponding to the original browser event.
|
||||||
* @type {module:ol/coordinate~Coordinate}
|
* @type {import("./coordinate.js").Coordinate}
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
this.coordinate = map.getCoordinateFromPixel(this.pixel);
|
this.coordinate = map.getCoordinateFromPixel(this.pixel);
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import PointerEventHandler from './pointer/PointerEventHandler.js';
|
|||||||
class MapBrowserEventHandler extends EventTarget {
|
class MapBrowserEventHandler extends EventTarget {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/PluggableMap} map The map with the viewport to listen to events on.
|
* @param {import("./PluggableMap.js").default} map The map with the viewport to listen to events on.
|
||||||
* @param {number=} moveTolerance The minimal distance the pointer must travel to trigger a move.
|
* @param {number=} moveTolerance The minimal distance the pointer must travel to trigger a move.
|
||||||
*/
|
*/
|
||||||
constructor(map, moveTolerance) {
|
constructor(map, moveTolerance) {
|
||||||
@@ -21,7 +21,7 @@ class MapBrowserEventHandler extends EventTarget {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the element that we will listen to the real events on.
|
* This is the element that we will listen to the real events on.
|
||||||
* @type {module:ol/PluggableMap}
|
* @type {import("./PluggableMap.js").default}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.map_ = map;
|
this.map_ = map;
|
||||||
@@ -39,7 +39,7 @@ class MapBrowserEventHandler extends EventTarget {
|
|||||||
this.dragging_ = false;
|
this.dragging_ = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {!Array<module:ol/events~EventsKey>}
|
* @type {!Array<import("./events.js").EventsKey>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.dragListenerKeys_ = [];
|
this.dragListenerKeys_ = [];
|
||||||
@@ -54,7 +54,7 @@ class MapBrowserEventHandler extends EventTarget {
|
|||||||
/**
|
/**
|
||||||
* The most recent "down" type event (or null if none have occurred).
|
* The most recent "down" type event (or null if none have occurred).
|
||||||
* Set on pointerdown.
|
* Set on pointerdown.
|
||||||
* @type {module:ol/pointer/PointerEvent}
|
* @type {import("./pointer/PointerEvent.js").default}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.down_ = null;
|
this.down_ = null;
|
||||||
@@ -77,7 +77,7 @@ class MapBrowserEventHandler extends EventTarget {
|
|||||||
* Event handler which generates pointer events for
|
* Event handler which generates pointer events for
|
||||||
* the viewport element.
|
* the viewport element.
|
||||||
*
|
*
|
||||||
* @type {module:ol/pointer/PointerEventHandler}
|
* @type {import("./pointer/PointerEventHandler.js").default}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.pointerEventHandler_ = new PointerEventHandler(element);
|
this.pointerEventHandler_ = new PointerEventHandler(element);
|
||||||
@@ -86,13 +86,13 @@ class MapBrowserEventHandler extends EventTarget {
|
|||||||
* Event handler which generates pointer events for
|
* Event handler which generates pointer events for
|
||||||
* the document (used when dragging).
|
* the document (used when dragging).
|
||||||
*
|
*
|
||||||
* @type {module:ol/pointer/PointerEventHandler}
|
* @type {import("./pointer/PointerEventHandler.js").default}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.documentPointerEventHandler_ = null;
|
this.documentPointerEventHandler_ = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {?module:ol/events~EventsKey}
|
* @type {?import("./events.js").EventsKey}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.pointerdownListenerKey_ = listen(this.pointerEventHandler_,
|
this.pointerdownListenerKey_ = listen(this.pointerEventHandler_,
|
||||||
@@ -100,7 +100,7 @@ class MapBrowserEventHandler extends EventTarget {
|
|||||||
this.handlePointerDown_, this);
|
this.handlePointerDown_, this);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {?module:ol/events~EventsKey}
|
* @type {?import("./events.js").EventsKey}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.relayedListenerKey_ = listen(this.pointerEventHandler_,
|
this.relayedListenerKey_ = listen(this.pointerEventHandler_,
|
||||||
@@ -110,7 +110,7 @@ class MapBrowserEventHandler extends EventTarget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/pointer/PointerEvent} pointerEvent Pointer
|
* @param {import("./pointer/PointerEvent.js").default} pointerEvent Pointer
|
||||||
* event.
|
* event.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -139,7 +139,7 @@ class MapBrowserEventHandler extends EventTarget {
|
|||||||
/**
|
/**
|
||||||
* Keeps track on how many pointers are currently active.
|
* Keeps track on how many pointers are currently active.
|
||||||
*
|
*
|
||||||
* @param {module:ol/pointer/PointerEvent} pointerEvent Pointer
|
* @param {import("./pointer/PointerEvent.js").default} pointerEvent Pointer
|
||||||
* event.
|
* event.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -156,7 +156,7 @@ class MapBrowserEventHandler extends EventTarget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/pointer/PointerEvent} pointerEvent Pointer
|
* @param {import("./pointer/PointerEvent.js").default} pointerEvent Pointer
|
||||||
* event.
|
* event.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -187,7 +187,7 @@ class MapBrowserEventHandler extends EventTarget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/pointer/PointerEvent} pointerEvent Pointer
|
* @param {import("./pointer/PointerEvent.js").default} pointerEvent Pointer
|
||||||
* event.
|
* event.
|
||||||
* @return {boolean} If the left mouse button was pressed.
|
* @return {boolean} If the left mouse button was pressed.
|
||||||
* @private
|
* @private
|
||||||
@@ -197,7 +197,7 @@ class MapBrowserEventHandler extends EventTarget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/pointer/PointerEvent} pointerEvent Pointer
|
* @param {import("./pointer/PointerEvent.js").default} pointerEvent Pointer
|
||||||
* event.
|
* event.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -245,7 +245,7 @@ class MapBrowserEventHandler extends EventTarget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/pointer/PointerEvent} pointerEvent Pointer
|
* @param {import("./pointer/PointerEvent.js").default} pointerEvent Pointer
|
||||||
* event.
|
* event.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -271,7 +271,7 @@ class MapBrowserEventHandler extends EventTarget {
|
|||||||
/**
|
/**
|
||||||
* Wrap and relay a pointer event. Note that this requires that the type
|
* Wrap and relay a pointer event. Note that this requires that the type
|
||||||
* string for the MapBrowserPointerEvent matches the PointerEvent type.
|
* string for the MapBrowserPointerEvent matches the PointerEvent type.
|
||||||
* @param {module:ol/pointer/PointerEvent} pointerEvent Pointer
|
* @param {import("./pointer/PointerEvent.js").default} pointerEvent Pointer
|
||||||
* event.
|
* event.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -282,7 +282,7 @@ class MapBrowserEventHandler extends EventTarget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/pointer/PointerEvent} pointerEvent Pointer
|
* @param {import("./pointer/PointerEvent.js").default} pointerEvent Pointer
|
||||||
* event.
|
* event.
|
||||||
* @return {boolean} Is moving.
|
* @return {boolean} Is moving.
|
||||||
* @private
|
* @private
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ class MapBrowserPointerEvent extends MapBrowserEvent {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} type Event type.
|
* @param {string} type Event type.
|
||||||
* @param {module:ol/PluggableMap} map Map.
|
* @param {import("./PluggableMap.js").default} map Map.
|
||||||
* @param {module:ol/pointer/PointerEvent} pointerEvent Pointer event.
|
* @param {import("./pointer/PointerEvent.js").default} pointerEvent Pointer event.
|
||||||
* @param {boolean=} opt_dragging Is the map currently being dragged?
|
* @param {boolean=} opt_dragging Is the map currently being dragged?
|
||||||
* @param {?module:ol/PluggableMap~FrameState=} opt_frameState Frame state.
|
* @param {?import("./PluggableMap.js").FrameState=} opt_frameState Frame state.
|
||||||
*/
|
*/
|
||||||
constructor(type, map, pointerEvent, opt_dragging, opt_frameState) {
|
constructor(type, map, pointerEvent, opt_dragging, opt_frameState) {
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ class MapBrowserPointerEvent extends MapBrowserEvent {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {module:ol/pointer/PointerEvent}
|
* @type {import("./pointer/PointerEvent.js").default}
|
||||||
*/
|
*/
|
||||||
this.pointerEvent = pointerEvent;
|
this.pointerEvent = pointerEvent;
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -12,8 +12,8 @@ class MapEvent extends Event {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} type Event type.
|
* @param {string} type Event type.
|
||||||
* @param {module:ol/PluggableMap} map Map.
|
* @param {import("./PluggableMap.js").default} map Map.
|
||||||
* @param {?module:ol/PluggableMap~FrameState=} opt_frameState Frame state.
|
* @param {?import("./PluggableMap.js").FrameState=} opt_frameState Frame state.
|
||||||
*/
|
*/
|
||||||
constructor(type, map, opt_frameState) {
|
constructor(type, map, opt_frameState) {
|
||||||
|
|
||||||
@@ -21,14 +21,14 @@ class MapEvent extends Event {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The map where the event occurred.
|
* The map where the event occurred.
|
||||||
* @type {module:ol/PluggableMap}
|
* @type {import("./PluggableMap.js").default}
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
this.map = map;
|
this.map = map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The frame state at the time of the event.
|
* The frame state at the time of the event.
|
||||||
* @type {?module:ol/PluggableMap~FrameState}
|
* @type {?import("./PluggableMap.js").FrameState}
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
this.frameState = opt_frameState !== undefined ? opt_frameState : null;
|
this.frameState = opt_frameState !== undefined ? opt_frameState : null;
|
||||||
|
|||||||
+1
-1
@@ -82,7 +82,7 @@ class ObjectEvent extends Event {
|
|||||||
* Properties can be deleted by using the unset method. E.g.
|
* Properties can be deleted by using the unset method. E.g.
|
||||||
* object.unset('foo').
|
* object.unset('foo').
|
||||||
*
|
*
|
||||||
* @fires module:ol/Object~ObjectEvent
|
* @fires ObjectEvent
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
class BaseObject extends Observable {
|
class BaseObject extends Observable {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import EventType from './events/EventType.js';
|
|||||||
* and unregistration. A generic `change` event is always available through
|
* and unregistration. A generic `change` event is always available through
|
||||||
* {@link module:ol/Observable~Observable#changed}.
|
* {@link module:ol/Observable~Observable#changed}.
|
||||||
*
|
*
|
||||||
* @fires module:ol/events/Event~Event
|
* @fires import("./events/Event.js").Event
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
class Observable extends EventTarget {
|
class Observable extends EventTarget {
|
||||||
@@ -52,7 +52,7 @@ 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 {import("./events.js").EventsKey|Array<import("./events.js").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
|
||||||
@@ -74,7 +74,7 @@ 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 {import("./events.js").EventsKey|Array<import("./events.js").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
|
||||||
@@ -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 {import("./events.js").EventsKey|Array<import("./events.js").EventsKey>} key The key returned by `on()`
|
||||||
* or `once()` (or an array of keys).
|
* or `once()` (or an array of keys).
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -123,7 +123,7 @@ export function unByKey(key) {
|
|||||||
unlistenByKey(key[i]);
|
unlistenByKey(key[i]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
unlistenByKey(/** @type {module:ol/events~EventsKey} */ (key));
|
unlistenByKey(/** @type {import("./events.js").EventsKey} */ (key));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+24
-24
@@ -20,9 +20,9 @@ import {containsExtent} from './extent.js';
|
|||||||
* 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
|
||||||
* shifts the overlay down.
|
* shifts the overlay down.
|
||||||
* @property {module:ol/coordinate~Coordinate} [position] The overlay position
|
* @property {import("./coordinate.js").Coordinate} [position] The overlay position
|
||||||
* in map projection.
|
* in map projection.
|
||||||
* @property {module:ol/OverlayPositioning} [positioning='top-left'] Defines how
|
* @property {import("./OverlayPositioning.js").default} [positioning='top-left'] Defines how
|
||||||
* the overlay is actually positioned with respect to its `position` property.
|
* the overlay is actually positioned with respect to its `position` property.
|
||||||
* Possible values are `'bottom-left'`, `'bottom-center'`, `'bottom-right'`,
|
* Possible values are `'bottom-left'`, `'bottom-center'`, `'bottom-right'`,
|
||||||
* `'center-left'`, `'center-center'`, `'center-right'`, `'top-left'`,
|
* `'center-left'`, `'center-center'`, `'center-right'`, `'top-left'`,
|
||||||
@@ -40,7 +40,7 @@ import {containsExtent} from './extent.js';
|
|||||||
* @property {boolean} [autoPan=false] If set to `true` the map is panned when
|
* @property {boolean} [autoPan=false] If set to `true` the map is panned when
|
||||||
* calling `setPosition`, so that the overlay is entirely visible in the current
|
* calling `setPosition`, so that the overlay is entirely visible in the current
|
||||||
* viewport.
|
* viewport.
|
||||||
* @property {module:ol/Overlay~PanOptions} [autoPanAnimation] The
|
* @property {PanOptions} [autoPanAnimation] The
|
||||||
* animation options used to pan the overlay into view. This animation is only
|
* animation options used to pan the overlay into view. This animation is only
|
||||||
* used when `autoPan` is enabled. A `duration` and `easing` may be provided to
|
* used when `autoPan` is enabled. A `duration` and `easing` may be provided to
|
||||||
* customize the animation.
|
* customize the animation.
|
||||||
@@ -97,7 +97,7 @@ const Property = {
|
|||||||
class Overlay extends BaseObject {
|
class Overlay extends BaseObject {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/Overlay~Options} options Overlay options.
|
* @param {Options} options Overlay options.
|
||||||
*/
|
*/
|
||||||
constructor(options) {
|
constructor(options) {
|
||||||
|
|
||||||
@@ -105,7 +105,7 @@ class Overlay extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @protected
|
* @protected
|
||||||
* @type {module:ol/Overlay~Options}
|
* @type {Options}
|
||||||
*/
|
*/
|
||||||
this.options = options;
|
this.options = options;
|
||||||
|
|
||||||
@@ -145,9 +145,9 @@ class Overlay extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @protected
|
* @protected
|
||||||
* @type {module:ol/Overlay~PanOptions}
|
* @type {PanOptions}
|
||||||
*/
|
*/
|
||||||
this.autoPanAnimation = options.autoPanAnimation || /** @type {module:ol/Overlay~PanOptions} */ ({});
|
this.autoPanAnimation = options.autoPanAnimation || /** @type {PanOptions} */ ({});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @protected
|
* @protected
|
||||||
@@ -174,7 +174,7 @@ class Overlay extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @protected
|
* @protected
|
||||||
* @type {?module:ol/events~EventsKey}
|
* @type {?import("./events.js").EventsKey}
|
||||||
*/
|
*/
|
||||||
this.mapPostrenderListenerKey = null;
|
this.mapPostrenderListenerKey = null;
|
||||||
|
|
||||||
@@ -205,7 +205,7 @@ class Overlay extends BaseObject {
|
|||||||
this.setOffset(options.offset !== undefined ? options.offset : [0, 0]);
|
this.setOffset(options.offset !== undefined ? options.offset : [0, 0]);
|
||||||
|
|
||||||
this.setPositioning(options.positioning !== undefined ?
|
this.setPositioning(options.positioning !== undefined ?
|
||||||
/** @type {module:ol/OverlayPositioning} */ (options.positioning) :
|
/** @type {import("./OverlayPositioning.js").default} */ (options.positioning) :
|
||||||
OverlayPositioning.TOP_LEFT);
|
OverlayPositioning.TOP_LEFT);
|
||||||
|
|
||||||
if (options.position !== undefined) {
|
if (options.position !== undefined) {
|
||||||
@@ -235,14 +235,14 @@ class Overlay extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the map associated with this overlay.
|
* Get the map associated with this overlay.
|
||||||
* @return {module:ol/PluggableMap|undefined} The map that the
|
* @return {import("./PluggableMap.js").default|undefined} The map that the
|
||||||
* overlay is part of.
|
* overlay is part of.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getMap() {
|
getMap() {
|
||||||
return (
|
return (
|
||||||
/** @type {module:ol/PluggableMap|undefined} */ (this.get(Property.MAP))
|
/** @type {import("./PluggableMap.js").default|undefined} */ (this.get(Property.MAP))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -258,27 +258,27 @@ class Overlay extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the current position of this overlay.
|
* Get the current position of this overlay.
|
||||||
* @return {module:ol/coordinate~Coordinate|undefined} The spatial point that the overlay is
|
* @return {import("./coordinate.js").Coordinate|undefined} The spatial point that the overlay is
|
||||||
* anchored at.
|
* anchored at.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getPosition() {
|
getPosition() {
|
||||||
return (
|
return (
|
||||||
/** @type {module:ol/coordinate~Coordinate|undefined} */ (this.get(Property.POSITION))
|
/** @type {import("./coordinate.js").Coordinate|undefined} */ (this.get(Property.POSITION))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the current positioning of this overlay.
|
* Get the current positioning of this overlay.
|
||||||
* @return {module:ol/OverlayPositioning} How the overlay is positioned
|
* @return {import("./OverlayPositioning.js").default} How the overlay is positioned
|
||||||
* relative to its point on the map.
|
* relative to its point on the map.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getPositioning() {
|
getPositioning() {
|
||||||
return (
|
return (
|
||||||
/** @type {module:ol/OverlayPositioning} */ (this.get(Property.POSITIONING))
|
/** @type {import("./OverlayPositioning.js").default} */ (this.get(Property.POSITIONING))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -360,7 +360,7 @@ class Overlay extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the map to be associated with this overlay.
|
* Set the map to be associated with this overlay.
|
||||||
* @param {module:ol/PluggableMap|undefined} map The map that the
|
* @param {import("./PluggableMap.js").default|undefined} map The map that the
|
||||||
* overlay is part of.
|
* overlay is part of.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api
|
||||||
@@ -382,7 +382,7 @@ class Overlay extends BaseObject {
|
|||||||
/**
|
/**
|
||||||
* Set the position for this overlay. If the position is `undefined` the
|
* Set the position for this overlay. If the position is `undefined` the
|
||||||
* overlay is hidden.
|
* overlay is hidden.
|
||||||
* @param {module:ol/coordinate~Coordinate|undefined} position The spatial point that the overlay
|
* @param {import("./coordinate.js").Coordinate|undefined} position The spatial point that the overlay
|
||||||
* is anchored at.
|
* is anchored at.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api
|
||||||
@@ -432,7 +432,7 @@ class Overlay extends BaseObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (delta[0] !== 0 || delta[1] !== 0) {
|
if (delta[0] !== 0 || delta[1] !== 0) {
|
||||||
const center = /** @type {module:ol/coordinate~Coordinate} */ (map.getView().getCenter());
|
const center = /** @type {import("./coordinate.js").Coordinate} */ (map.getView().getCenter());
|
||||||
const centerPx = map.getPixelFromCoordinate(center);
|
const centerPx = map.getPixelFromCoordinate(center);
|
||||||
const newCenterPx = [
|
const newCenterPx = [
|
||||||
centerPx[0] + delta[0],
|
centerPx[0] + delta[0],
|
||||||
@@ -451,8 +451,8 @@ class Overlay extends BaseObject {
|
|||||||
/**
|
/**
|
||||||
* Get the extent of an element relative to the document
|
* Get the extent of an element relative to the document
|
||||||
* @param {HTMLElement|undefined} element The element.
|
* @param {HTMLElement|undefined} element The element.
|
||||||
* @param {module:ol/size~Size|undefined} size The size of the element.
|
* @param {import("./size.js").Size|undefined} size The size of the element.
|
||||||
* @return {module:ol/extent~Extent} The extent.
|
* @return {import("./extent.js").Extent} The extent.
|
||||||
* @protected
|
* @protected
|
||||||
*/
|
*/
|
||||||
getRect(element, size) {
|
getRect(element, size) {
|
||||||
@@ -469,7 +469,7 @@ class Overlay extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the positioning for this overlay.
|
* Set the positioning for this overlay.
|
||||||
* @param {module:ol/OverlayPositioning} positioning how the overlay is
|
* @param {import("./OverlayPositioning.js").default} positioning how the overlay is
|
||||||
* positioned relative to its point on the map.
|
* positioned relative to its point on the map.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api
|
||||||
@@ -508,8 +508,8 @@ class Overlay extends BaseObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/pixel~Pixel} pixel The pixel location.
|
* @param {import("./pixel.js").Pixel} pixel The pixel location.
|
||||||
* @param {module:ol/size~Size|undefined} mapSize The map size.
|
* @param {import("./size.js").Size|undefined} mapSize The map size.
|
||||||
* @protected
|
* @protected
|
||||||
*/
|
*/
|
||||||
updateRenderedPosition(pixel, mapSize) {
|
updateRenderedPosition(pixel, mapSize) {
|
||||||
@@ -574,7 +574,7 @@ class Overlay extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* returns the options this Overlay has been created with
|
* returns the options this Overlay has been created with
|
||||||
* @return {module:ol/Overlay~Options} overlay options
|
* @return {Options} overlay options
|
||||||
*/
|
*/
|
||||||
getOptions() {
|
getOptions() {
|
||||||
return this.options;
|
return this.options;
|
||||||
|
|||||||
+112
-112
@@ -36,33 +36,33 @@ import {create as createTransform, apply as applyTransform} from './transform.js
|
|||||||
* @typedef {Object} FrameState
|
* @typedef {Object} FrameState
|
||||||
* @property {number} pixelRatio The pixel ratio of the frame.
|
* @property {number} pixelRatio The pixel ratio of the frame.
|
||||||
* @property {number} time The time when rendering of the frame was requested.
|
* @property {number} time The time when rendering of the frame was requested.
|
||||||
* @property {module:ol/View~State} viewState The state of the current view.
|
* @property {import("./View.js").State} viewState The state of the current view.
|
||||||
* @property {boolean} animate
|
* @property {boolean} animate
|
||||||
* @property {module:ol/transform~Transform} coordinateToPixelTransform
|
* @property {import("./transform.js").Transform} coordinateToPixelTransform
|
||||||
* @property {null|module:ol/extent~Extent} extent
|
* @property {null|import("./extent.js").Extent} extent
|
||||||
* @property {module:ol/coordinate~Coordinate} focus
|
* @property {import("./coordinate.js").Coordinate} focus
|
||||||
* @property {number} index
|
* @property {number} index
|
||||||
* @property {Object<number, module:ol/layer/Layer~State>} layerStates
|
* @property {Object<number, import("./layer/Layer.js").State>} layerStates
|
||||||
* @property {Array<module:ol/layer/Layer~State>} layerStatesArray
|
* @property {Array<import("./layer/Layer.js").State>} layerStatesArray
|
||||||
* @property {module:ol/transform~Transform} pixelToCoordinateTransform
|
* @property {import("./transform.js").Transform} pixelToCoordinateTransform
|
||||||
* @property {Array<module:ol/PluggableMap~PostRenderFunction>} postRenderFunctions
|
* @property {Array<PostRenderFunction>} postRenderFunctions
|
||||||
* @property {module:ol/size~Size} size
|
* @property {import("./size.js").Size} size
|
||||||
* @property {!Object<string, boolean>} skippedFeatureUids
|
* @property {!Object<string, boolean>} skippedFeatureUids
|
||||||
* @property {module:ol/TileQueue} tileQueue
|
* @property {import("./TileQueue.js").default} tileQueue
|
||||||
* @property {Object<string, Object<string, module:ol/TileRange>>} usedTiles
|
* @property {Object<string, Object<string, import("./TileRange.js").default>>} usedTiles
|
||||||
* @property {Array<number>} viewHints
|
* @property {Array<number>} viewHints
|
||||||
* @property {!Object<string, Object<string, boolean>>} wantedTiles
|
* @property {!Object<string, Object<string, boolean>>} wantedTiles
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {function(module:ol/PluggableMap, ?module:ol/PluggableMap~FrameState): boolean} PostRenderFunction
|
* @typedef {function(import("./PluggableMap.js").default, ?FrameState): boolean} PostRenderFunction
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} AtPixelOptions
|
* @typedef {Object} AtPixelOptions
|
||||||
* @property {undefined|function(module:ol/layer/Layer): boolean} layerFilter Layer filter
|
* @property {undefined|function(import("./layer/Layer.js").default): boolean} layerFilter Layer filter
|
||||||
* function. The filter function will receive one argument, the
|
* function. The filter function will receive one argument, the
|
||||||
* {@link module:ol/layer/Layer layer-candidate} and it should return a boolean value.
|
* {@link module:ol/layer/Layer layer-candidate} and it should return a boolean value.
|
||||||
* Only layers which are visible and for which this function returns `true`
|
* Only layers which are visible and for which this function returns `true`
|
||||||
@@ -75,10 +75,10 @@ import {create as createTransform, apply as applyTransform} from './transform.js
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} MapOptionsInternal
|
* @typedef {Object} MapOptionsInternal
|
||||||
* @property {module:ol/Collection<module:ol/control/Control>} [controls]
|
* @property {import("./Collection.js").default<import("./control/Control.js").default>} [controls]
|
||||||
* @property {module:ol/Collection<module:ol/interaction/Interaction>} [interactions]
|
* @property {import("./Collection.js").default<import("./interaction/Interaction.js").default>} [interactions]
|
||||||
* @property {HTMLElement|Document} keyboardEventTarget
|
* @property {HTMLElement|Document} keyboardEventTarget
|
||||||
* @property {module:ol/Collection<module:ol/Overlay>} overlays
|
* @property {import("./Collection.js").default<import("./Overlay.js").default>} overlays
|
||||||
* @property {Object<string, *>} values
|
* @property {Object<string, *>} values
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -86,12 +86,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 {import("./Collection.js").default<import("./control/Control.js").default>|Array<import("./control/Control.js").default>} [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 {import("./Collection.js").default<import("./interaction/Interaction.js").default>|Array<import("./interaction/Interaction.js").default>} [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
|
||||||
@@ -102,7 +102,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<import("./layer/Base.js").default>|import("./Collection.js").default<import("./layer/Base.js").default>} [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
|
||||||
@@ -119,21 +119,21 @@ 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 {import("./Collection.js").default<import("./Overlay.js").default>|Array<import("./Overlay.js").default>} [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
|
||||||
* time, {@link module:ol/Map~Map#setTarget} must be called for the map to be
|
* time, {@link module:ol/Map~Map#setTarget} must be called for the map to be
|
||||||
* rendered.
|
* rendered.
|
||||||
* @property {module:ol/View} [view] The map's view. No layer sources will be
|
* @property {import("./View.js").default} [view] The map's view. No layer sources will be
|
||||||
* fetched unless this is specified at construction time or through
|
* fetched unless this is specified at construction time or through
|
||||||
* {@link module:ol/Map~Map#setView}.
|
* {@link module:ol/Map~Map#setView}.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @fires module:ol/MapBrowserEvent~MapBrowserEvent
|
* @fires import("./MapBrowserEvent.js").MapBrowserEvent
|
||||||
* @fires module:ol/MapEvent~MapEvent
|
* @fires import("./MapEvent.js").MapEvent
|
||||||
* @fires module:ol/render/Event~RenderEvent#postcompose
|
* @fires module:ol/render/Event~RenderEvent#postcompose
|
||||||
* @fires module:ol/render/Event~RenderEvent#precompose
|
* @fires module:ol/render/Event~RenderEvent#precompose
|
||||||
* @fires module:ol/render/Event~RenderEvent#rendercomplete
|
* @fires module:ol/render/Event~RenderEvent#rendercomplete
|
||||||
@@ -142,7 +142,7 @@ import {create as createTransform, apply as applyTransform} from './transform.js
|
|||||||
class PluggableMap extends BaseObject {
|
class PluggableMap extends BaseObject {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/PluggableMap~MapOptions} options Map options.
|
* @param {MapOptions} options Map options.
|
||||||
*/
|
*/
|
||||||
constructor(options) {
|
constructor(options) {
|
||||||
|
|
||||||
@@ -195,13 +195,13 @@ class PluggableMap extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {module:ol/transform~Transform}
|
* @type {import("./transform.js").Transform}
|
||||||
*/
|
*/
|
||||||
this.coordinateToPixelTransform_ = createTransform();
|
this.coordinateToPixelTransform_ = createTransform();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {module:ol/transform~Transform}
|
* @type {import("./transform.js").Transform}
|
||||||
*/
|
*/
|
||||||
this.pixelToCoordinateTransform_ = createTransform();
|
this.pixelToCoordinateTransform_ = createTransform();
|
||||||
|
|
||||||
@@ -213,32 +213,32 @@ class PluggableMap extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {?module:ol/PluggableMap~FrameState}
|
* @type {?FrameState}
|
||||||
*/
|
*/
|
||||||
this.frameState_ = null;
|
this.frameState_ = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The extent at the previous 'moveend' event.
|
* The extent at the previous 'moveend' event.
|
||||||
* @private
|
* @private
|
||||||
* @type {module:ol/extent~Extent}
|
* @type {import("./extent.js").Extent}
|
||||||
*/
|
*/
|
||||||
this.previousExtent_ = null;
|
this.previousExtent_ = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {?module:ol/events~EventsKey}
|
* @type {?import("./events.js").EventsKey}
|
||||||
*/
|
*/
|
||||||
this.viewPropertyListenerKey_ = null;
|
this.viewPropertyListenerKey_ = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {?module:ol/events~EventsKey}
|
* @type {?import("./events.js").EventsKey}
|
||||||
*/
|
*/
|
||||||
this.viewChangeListenerKey_ = null;
|
this.viewChangeListenerKey_ = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array<module:ol/events~EventsKey>}
|
* @type {Array<import("./events.js").EventsKey>}
|
||||||
*/
|
*/
|
||||||
this.layerGroupPropertyListenerKeys_ = null;
|
this.layerGroupPropertyListenerKeys_ = null;
|
||||||
|
|
||||||
@@ -287,7 +287,7 @@ class PluggableMap extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {module:ol/MapBrowserEventHandler}
|
* @type {import("./MapBrowserEventHandler.js").default}
|
||||||
*/
|
*/
|
||||||
this.mapBrowserEventHandler_ = new MapBrowserEventHandler(this, options.moveTolerance);
|
this.mapBrowserEventHandler_ = new MapBrowserEventHandler(this, options.moveTolerance);
|
||||||
for (const key in MapBrowserEventType) {
|
for (const key in MapBrowserEventType) {
|
||||||
@@ -303,7 +303,7 @@ class PluggableMap extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array<module:ol/events~EventsKey>}
|
* @type {Array<import("./events.js").EventsKey>}
|
||||||
*/
|
*/
|
||||||
this.keyHandlerKeys_ = null;
|
this.keyHandlerKeys_ = null;
|
||||||
|
|
||||||
@@ -312,19 +312,19 @@ class PluggableMap extends BaseObject {
|
|||||||
listen(this.viewport_, EventType.MOUSEWHEEL, this.handleBrowserEvent, this);
|
listen(this.viewport_, EventType.MOUSEWHEEL, this.handleBrowserEvent, this);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {module:ol/Collection<module:ol/control/Control>}
|
* @type {import("./Collection.js").default<import("./control/Control.js").default>}
|
||||||
* @protected
|
* @protected
|
||||||
*/
|
*/
|
||||||
this.controls = optionsInternal.controls || new Collection();
|
this.controls = optionsInternal.controls || new Collection();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {module:ol/Collection<module:ol/interaction/Interaction>}
|
* @type {import("./Collection.js").default<import("./interaction/Interaction.js").default>}
|
||||||
* @protected
|
* @protected
|
||||||
*/
|
*/
|
||||||
this.interactions = optionsInternal.interactions || new Collection();
|
this.interactions = optionsInternal.interactions || new Collection();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {module:ol/Collection<module:ol/Overlay>}
|
* @type {import("./Collection.js").default<import("./Overlay.js").default>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.overlays_ = optionsInternal.overlays;
|
this.overlays_ = optionsInternal.overlays;
|
||||||
@@ -332,12 +332,12 @@ class PluggableMap extends BaseObject {
|
|||||||
/**
|
/**
|
||||||
* A lookup of overlays by id.
|
* A lookup of overlays by id.
|
||||||
* @private
|
* @private
|
||||||
* @type {Object<string, module:ol/Overlay>}
|
* @type {Object<string, import("./Overlay.js").default>}
|
||||||
*/
|
*/
|
||||||
this.overlayIdIndex_ = {};
|
this.overlayIdIndex_ = {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {module:ol/renderer/Map}
|
* @type {import("./renderer/Map.js").default}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.renderer_ = this.createRenderer();
|
this.renderer_ = this.createRenderer();
|
||||||
@@ -350,19 +350,19 @@ class PluggableMap extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {module:ol/coordinate~Coordinate}
|
* @type {import("./coordinate.js").Coordinate}
|
||||||
*/
|
*/
|
||||||
this.focus_ = null;
|
this.focus_ = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {!Array<module:ol/PluggableMap~PostRenderFunction>}
|
* @type {!Array<PostRenderFunction>}
|
||||||
*/
|
*/
|
||||||
this.postRenderFunctions_ = [];
|
this.postRenderFunctions_ = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {module:ol/TileQueue}
|
* @type {import("./TileQueue.js").default}
|
||||||
*/
|
*/
|
||||||
this.tileQueue_ = new TileQueue(
|
this.tileQueue_ = new TileQueue(
|
||||||
this.getTilePriority.bind(this),
|
this.getTilePriority.bind(this),
|
||||||
@@ -391,8 +391,8 @@ class PluggableMap extends BaseObject {
|
|||||||
|
|
||||||
this.controls.forEach(
|
this.controls.forEach(
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/control/Control} control Control.
|
* @param {import("./control/Control.js").default} control Control.
|
||||||
* @this {module:ol/PluggableMap}
|
* @this {import("./PluggableMap.js").default}
|
||||||
*/
|
*/
|
||||||
(function(control) {
|
(function(control) {
|
||||||
control.setMap(this);
|
control.setMap(this);
|
||||||
@@ -400,7 +400,7 @@ class PluggableMap extends BaseObject {
|
|||||||
|
|
||||||
listen(this.controls, CollectionEventType.ADD,
|
listen(this.controls, CollectionEventType.ADD,
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/Collection~CollectionEvent} event CollectionEvent.
|
* @param {import("./Collection.js").CollectionEvent} event CollectionEvent.
|
||||||
*/
|
*/
|
||||||
function(event) {
|
function(event) {
|
||||||
event.element.setMap(this);
|
event.element.setMap(this);
|
||||||
@@ -408,7 +408,7 @@ class PluggableMap extends BaseObject {
|
|||||||
|
|
||||||
listen(this.controls, CollectionEventType.REMOVE,
|
listen(this.controls, CollectionEventType.REMOVE,
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/Collection~CollectionEvent} event CollectionEvent.
|
* @param {import("./Collection.js").CollectionEvent} event CollectionEvent.
|
||||||
*/
|
*/
|
||||||
function(event) {
|
function(event) {
|
||||||
event.element.setMap(null);
|
event.element.setMap(null);
|
||||||
@@ -416,8 +416,8 @@ class PluggableMap extends BaseObject {
|
|||||||
|
|
||||||
this.interactions.forEach(
|
this.interactions.forEach(
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/interaction/Interaction} interaction Interaction.
|
* @param {import("./interaction/Interaction.js").default} interaction Interaction.
|
||||||
* @this {module:ol/PluggableMap}
|
* @this {import("./PluggableMap.js").default}
|
||||||
*/
|
*/
|
||||||
(function(interaction) {
|
(function(interaction) {
|
||||||
interaction.setMap(this);
|
interaction.setMap(this);
|
||||||
@@ -425,7 +425,7 @@ class PluggableMap extends BaseObject {
|
|||||||
|
|
||||||
listen(this.interactions, CollectionEventType.ADD,
|
listen(this.interactions, CollectionEventType.ADD,
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/Collection~CollectionEvent} event CollectionEvent.
|
* @param {import("./Collection.js").CollectionEvent} event CollectionEvent.
|
||||||
*/
|
*/
|
||||||
function(event) {
|
function(event) {
|
||||||
event.element.setMap(this);
|
event.element.setMap(this);
|
||||||
@@ -433,7 +433,7 @@ class PluggableMap extends BaseObject {
|
|||||||
|
|
||||||
listen(this.interactions, CollectionEventType.REMOVE,
|
listen(this.interactions, CollectionEventType.REMOVE,
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/Collection~CollectionEvent} event CollectionEvent.
|
* @param {import("./Collection.js").CollectionEvent} event CollectionEvent.
|
||||||
*/
|
*/
|
||||||
function(event) {
|
function(event) {
|
||||||
event.element.setMap(null);
|
event.element.setMap(null);
|
||||||
@@ -443,18 +443,18 @@ class PluggableMap extends BaseObject {
|
|||||||
|
|
||||||
listen(this.overlays_, CollectionEventType.ADD,
|
listen(this.overlays_, CollectionEventType.ADD,
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/Collection~CollectionEvent} event CollectionEvent.
|
* @param {import("./Collection.js").CollectionEvent} event CollectionEvent.
|
||||||
*/
|
*/
|
||||||
function(event) {
|
function(event) {
|
||||||
this.addOverlayInternal_(/** @type {module:ol/Overlay} */ (event.element));
|
this.addOverlayInternal_(/** @type {import("./Overlay.js").default} */ (event.element));
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
listen(this.overlays_, CollectionEventType.REMOVE,
|
listen(this.overlays_, CollectionEventType.REMOVE,
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/Collection~CollectionEvent} event CollectionEvent.
|
* @param {import("./Collection.js").CollectionEvent} event CollectionEvent.
|
||||||
*/
|
*/
|
||||||
function(event) {
|
function(event) {
|
||||||
const overlay = /** @type {module:ol/Overlay} */ (event.element);
|
const overlay = /** @type {import("./Overlay.js").default} */ (event.element);
|
||||||
const id = overlay.getId();
|
const id = overlay.getId();
|
||||||
if (id !== undefined) {
|
if (id !== undefined) {
|
||||||
delete this.overlayIdIndex_[id.toString()];
|
delete this.overlayIdIndex_[id.toString()];
|
||||||
@@ -470,7 +470,7 @@ class PluggableMap extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Add the given control to the map.
|
* Add the given control to the map.
|
||||||
* @param {module:ol/control/Control} control Control.
|
* @param {import("./control/Control.js").default} control Control.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
addControl(control) {
|
addControl(control) {
|
||||||
@@ -479,7 +479,7 @@ class PluggableMap extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Add the given interaction to the map.
|
* Add the given interaction to the map.
|
||||||
* @param {module:ol/interaction/Interaction} interaction Interaction to add.
|
* @param {import("./interaction/Interaction.js").default} interaction Interaction to add.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
addInteraction(interaction) {
|
addInteraction(interaction) {
|
||||||
@@ -490,7 +490,7 @@ class PluggableMap extends BaseObject {
|
|||||||
* Adds the given layer to the top of this map. If you want to add a layer
|
* Adds the given layer to the top of this map. If you want to add a layer
|
||||||
* elsewhere in the stack, use `getLayers()` and the methods available on
|
* elsewhere in the stack, use `getLayers()` and the methods available on
|
||||||
* {@link module:ol/Collection~Collection}.
|
* {@link module:ol/Collection~Collection}.
|
||||||
* @param {module:ol/layer/Base} layer Layer.
|
* @param {import("./layer/Base.js").default} layer Layer.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
addLayer(layer) {
|
addLayer(layer) {
|
||||||
@@ -500,7 +500,7 @@ class PluggableMap extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Add the given overlay to the map.
|
* Add the given overlay to the map.
|
||||||
* @param {module:ol/Overlay} overlay Overlay.
|
* @param {import("./Overlay.js").default} overlay Overlay.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
addOverlay(overlay) {
|
addOverlay(overlay) {
|
||||||
@@ -509,7 +509,7 @@ class PluggableMap extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This deals with map's overlay collection changes.
|
* This deals with map's overlay collection changes.
|
||||||
* @param {module:ol/Overlay} overlay Overlay.
|
* @param {import("./Overlay.js").default} overlay Overlay.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
addOverlayInternal_(overlay) {
|
addOverlayInternal_(overlay) {
|
||||||
@@ -545,16 +545,16 @@ class PluggableMap extends BaseObject {
|
|||||||
* Detect features that intersect a pixel on the viewport, and execute a
|
* Detect features that intersect a pixel on the viewport, and execute a
|
||||||
* callback with each intersecting feature. Layers included in the detection can
|
* callback with each intersecting feature. Layers included in the detection can
|
||||||
* be configured through the `layerFilter` option in `opt_options`.
|
* be configured through the `layerFilter` option in `opt_options`.
|
||||||
* @param {module:ol/pixel~Pixel} pixel Pixel.
|
* @param {import("./pixel.js").Pixel} pixel Pixel.
|
||||||
* @param {function(this: S, (module:ol/Feature|module:ol/render/Feature),
|
* @param {function(this: S, (import("./Feature.js").default|import("./render/Feature.js").default),
|
||||||
* module:ol/layer/Layer): T} callback Feature callback. The callback will be
|
* import("./layer/Layer.js").default): T} callback Feature callback. The callback will be
|
||||||
* called with two arguments. The first argument is one
|
* called with two arguments. The first argument is one
|
||||||
* {@link module:ol/Feature feature} or
|
* {@link module:ol/Feature feature} or
|
||||||
* {@link module:ol/render/Feature render feature} at the pixel, the second is
|
* {@link module:ol/render/Feature render feature} at the pixel, the second is
|
||||||
* the {@link module:ol/layer/Layer layer} of the feature and will be null for
|
* the {@link module:ol/layer/Layer layer} of the feature and will be null for
|
||||||
* unmanaged layers. To stop detection, callback functions can return a
|
* unmanaged layers. To stop detection, callback functions can return a
|
||||||
* truthy value.
|
* truthy value.
|
||||||
* @param {module:ol/PluggableMap~AtPixelOptions=} opt_options Optional options.
|
* @param {AtPixelOptions=} opt_options Optional options.
|
||||||
* @return {T|undefined} Callback result, i.e. the return value of last
|
* @return {T|undefined} Callback result, i.e. the return value of last
|
||||||
* callback execution, or the first truthy callback return value.
|
* callback execution, or the first truthy callback return value.
|
||||||
* @template S,T
|
* @template S,T
|
||||||
@@ -577,9 +577,9 @@ 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 {import("./pixel.js").Pixel} pixel Pixel.
|
||||||
* @param {module:ol/PluggableMap~AtPixelOptions=} opt_options Optional options.
|
* @param {AtPixelOptions=} opt_options Optional options.
|
||||||
* @return {Array<module:ol/Feature|module:ol/render/Feature>} The detected features or
|
* @return {Array<import("./Feature.js").default|import("./render/Feature.js").default>} The detected features or
|
||||||
* `null` if none were found.
|
* `null` if none were found.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -598,14 +598,14 @@ class PluggableMap extends BaseObject {
|
|||||||
* Detect layers that have a color value at a pixel on the viewport, and
|
* Detect layers that have a color value at a pixel on the viewport, and
|
||||||
* execute a callback with each matching layer. Layers included in the
|
* execute a callback with each matching layer. Layers included in the
|
||||||
* detection can be configured through `opt_layerFilter`.
|
* detection can be configured through `opt_layerFilter`.
|
||||||
* @param {module:ol/pixel~Pixel} pixel Pixel.
|
* @param {import("./pixel.js").Pixel} pixel Pixel.
|
||||||
* @param {function(this: S, module:ol/layer/Layer, (Uint8ClampedArray|Uint8Array)): T} callback
|
* @param {function(this: S, import("./layer/Layer.js").default, (Uint8ClampedArray|Uint8Array)): T} callback
|
||||||
* Layer callback. This callback will receive two arguments: first is the
|
* Layer callback. This callback will receive two arguments: first is the
|
||||||
* {@link module:ol/layer/Layer layer}, second argument is an array representing
|
* {@link module:ol/layer/Layer layer}, second argument is an array representing
|
||||||
* [R, G, B, A] pixel values (0 - 255) and will be `null` for layer types
|
* [R, G, B, A] pixel values (0 - 255) and will be `null` for layer types
|
||||||
* that do not currently support this argument. To stop detection, callback
|
* that do not currently support this argument. To stop detection, callback
|
||||||
* functions can return a truthy value.
|
* functions can return a truthy value.
|
||||||
* @param {module:ol/PluggableMap~AtPixelOptions=} opt_options Configuration options.
|
* @param {AtPixelOptions=} opt_options Configuration options.
|
||||||
* @return {T|undefined} Callback result, i.e. the return value of last
|
* @return {T|undefined} Callback result, i.e. the return value of last
|
||||||
* callback execution, or the first truthy callback return value.
|
* callback execution, or the first truthy callback return value.
|
||||||
* @template S,T
|
* @template S,T
|
||||||
@@ -615,7 +615,7 @@ class PluggableMap extends BaseObject {
|
|||||||
if (!this.frameState_) {
|
if (!this.frameState_) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const options = opt_options || /** @type {module:ol/PluggableMap~AtPixelOptions} */ ({});
|
const options = opt_options || /** @type {AtPixelOptions} */ ({});
|
||||||
const hitTolerance = options.hitTolerance !== undefined ?
|
const hitTolerance = options.hitTolerance !== undefined ?
|
||||||
opt_options.hitTolerance * this.frameState_.pixelRatio : 0;
|
opt_options.hitTolerance * this.frameState_.pixelRatio : 0;
|
||||||
const layerFilter = options.layerFilter || TRUE;
|
const layerFilter = options.layerFilter || TRUE;
|
||||||
@@ -626,8 +626,8 @@ class PluggableMap extends BaseObject {
|
|||||||
/**
|
/**
|
||||||
* Detect if features intersect a pixel on the viewport. Layers included in the
|
* Detect if features intersect a pixel on the viewport. Layers included in the
|
||||||
* detection can be configured through `opt_layerFilter`.
|
* detection can be configured through `opt_layerFilter`.
|
||||||
* @param {module:ol/pixel~Pixel} pixel Pixel.
|
* @param {import("./pixel.js").Pixel} pixel Pixel.
|
||||||
* @param {module:ol/PluggableMap~AtPixelOptions=} opt_options Optional options.
|
* @param {AtPixelOptions=} opt_options Optional options.
|
||||||
* @return {boolean} Is there a feature at the given pixel?
|
* @return {boolean} Is there a feature at the given pixel?
|
||||||
* @template U
|
* @template U
|
||||||
* @api
|
* @api
|
||||||
@@ -648,7 +648,7 @@ class PluggableMap extends BaseObject {
|
|||||||
/**
|
/**
|
||||||
* Returns the coordinate in view projection for a browser event.
|
* Returns the coordinate in view projection for a browser event.
|
||||||
* @param {Event} event Event.
|
* @param {Event} event Event.
|
||||||
* @return {module:ol/coordinate~Coordinate} Coordinate.
|
* @return {import("./coordinate.js").Coordinate} Coordinate.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getEventCoordinate(event) {
|
getEventCoordinate(event) {
|
||||||
@@ -658,7 +658,7 @@ class PluggableMap extends BaseObject {
|
|||||||
/**
|
/**
|
||||||
* Returns the map pixel position for a browser event relative to the viewport.
|
* Returns the map pixel position for a browser event relative to the viewport.
|
||||||
* @param {Event} event Event.
|
* @param {Event} event Event.
|
||||||
* @return {module:ol/pixel~Pixel} Pixel.
|
* @return {import("./pixel.js").Pixel} Pixel.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getEventPixel(event) {
|
getEventPixel(event) {
|
||||||
@@ -702,8 +702,8 @@ class PluggableMap extends BaseObject {
|
|||||||
/**
|
/**
|
||||||
* Get the coordinate for a given pixel. This returns a coordinate in the
|
* Get the coordinate for a given pixel. This returns a coordinate in the
|
||||||
* map view projection.
|
* map view projection.
|
||||||
* @param {module:ol/pixel~Pixel} pixel Pixel position in the map viewport.
|
* @param {import("./pixel.js").Pixel} pixel Pixel position in the map viewport.
|
||||||
* @return {module:ol/coordinate~Coordinate} The coordinate for the pixel position.
|
* @return {import("./coordinate.js").Coordinate} The coordinate for the pixel position.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getCoordinateFromPixel(pixel) {
|
getCoordinateFromPixel(pixel) {
|
||||||
@@ -718,7 +718,7 @@ class PluggableMap extends BaseObject {
|
|||||||
/**
|
/**
|
||||||
* Get the map controls. Modifying this collection changes the controls
|
* Get the map controls. Modifying this collection changes the controls
|
||||||
* associated with the map.
|
* associated with the map.
|
||||||
* @return {module:ol/Collection<module:ol/control/Control>} Controls.
|
* @return {import("./Collection.js").default<import("./control/Control.js").default>} Controls.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getControls() {
|
getControls() {
|
||||||
@@ -728,7 +728,7 @@ class PluggableMap extends BaseObject {
|
|||||||
/**
|
/**
|
||||||
* Get the map overlays. Modifying this collection changes the overlays
|
* Get the map overlays. Modifying this collection changes the overlays
|
||||||
* associated with the map.
|
* associated with the map.
|
||||||
* @return {module:ol/Collection<module:ol/Overlay>} Overlays.
|
* @return {import("./Collection.js").default<import("./Overlay.js").default>} Overlays.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getOverlays() {
|
getOverlays() {
|
||||||
@@ -740,7 +740,7 @@ class PluggableMap extends BaseObject {
|
|||||||
* Note that the index treats string and numeric identifiers as the same. So
|
* Note that the index treats string and numeric identifiers as the same. So
|
||||||
* `map.getOverlayById(2)` will return an overlay with id `'2'` or `2`.
|
* `map.getOverlayById(2)` will return an overlay with id `'2'` or `2`.
|
||||||
* @param {string|number} id Overlay identifier.
|
* @param {string|number} id Overlay identifier.
|
||||||
* @return {module:ol/Overlay} Overlay.
|
* @return {import("./Overlay.js").default} Overlay.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getOverlayById(id) {
|
getOverlayById(id) {
|
||||||
@@ -753,7 +753,7 @@ class PluggableMap extends BaseObject {
|
|||||||
* associated with the map.
|
* associated with the map.
|
||||||
*
|
*
|
||||||
* Interactions are used for e.g. pan, zoom and rotate.
|
* Interactions are used for e.g. pan, zoom and rotate.
|
||||||
* @return {module:ol/Collection<module:ol/interaction/Interaction>} Interactions.
|
* @return {import("./Collection.js").default<import("./interaction/Interaction.js").default>} Interactions.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getInteractions() {
|
getInteractions() {
|
||||||
@@ -762,19 +762,19 @@ class PluggableMap extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the layergroup associated with this map.
|
* Get the layergroup associated with this map.
|
||||||
* @return {module:ol/layer/Group} A layer group containing the layers in this map.
|
* @return {import("./layer/Group.js").default} A layer group containing the layers in this map.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getLayerGroup() {
|
getLayerGroup() {
|
||||||
return (
|
return (
|
||||||
/** @type {module:ol/layer/Group} */ (this.get(MapProperty.LAYERGROUP))
|
/** @type {import("./layer/Group.js").default} */ (this.get(MapProperty.LAYERGROUP))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the collection of layers associated with this map.
|
* Get the collection of layers associated with this map.
|
||||||
* @return {!module:ol/Collection<module:ol/layer/Base>} Layers.
|
* @return {!import("./Collection.js").default<import("./layer/Base.js").default>} Layers.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getLayers() {
|
getLayers() {
|
||||||
@@ -785,8 +785,8 @@ class PluggableMap extends BaseObject {
|
|||||||
/**
|
/**
|
||||||
* Get the pixel for a coordinate. This takes a coordinate in the map view
|
* Get the pixel for a coordinate. This takes a coordinate in the map view
|
||||||
* projection and returns the corresponding pixel.
|
* projection and returns the corresponding pixel.
|
||||||
* @param {module:ol/coordinate~Coordinate} coordinate A map coordinate.
|
* @param {import("./coordinate.js").Coordinate} coordinate A map coordinate.
|
||||||
* @return {module:ol/pixel~Pixel} A pixel position in the map viewport.
|
* @return {import("./pixel.js").Pixel} A pixel position in the map viewport.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getPixelFromCoordinate(coordinate) {
|
getPixelFromCoordinate(coordinate) {
|
||||||
@@ -800,7 +800,7 @@ class PluggableMap extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the map renderer.
|
* Get the map renderer.
|
||||||
* @return {module:ol/renderer/Map} Renderer
|
* @return {import("./renderer/Map.js").default} Renderer
|
||||||
*/
|
*/
|
||||||
getRenderer() {
|
getRenderer() {
|
||||||
return this.renderer_;
|
return this.renderer_;
|
||||||
@@ -808,26 +808,26 @@ class PluggableMap extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the size of this map.
|
* Get the size of this map.
|
||||||
* @return {module:ol/size~Size|undefined} The size in pixels of the map in the DOM.
|
* @return {import("./size.js").Size|undefined} The size in pixels of the map in the DOM.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getSize() {
|
getSize() {
|
||||||
return (
|
return (
|
||||||
/** @type {module:ol/size~Size|undefined} */ (this.get(MapProperty.SIZE))
|
/** @type {import("./size.js").Size|undefined} */ (this.get(MapProperty.SIZE))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the view associated with this map. A view manages properties such as
|
* Get the view associated with this map. A view manages properties such as
|
||||||
* center and resolution.
|
* center and resolution.
|
||||||
* @return {module:ol/View} The view that controls this map.
|
* @return {import("./View.js").default} The view that controls this map.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getView() {
|
getView() {
|
||||||
return (
|
return (
|
||||||
/** @type {module:ol/View} */ (this.get(MapProperty.VIEW))
|
/** @type {import("./View.js").default} */ (this.get(MapProperty.VIEW))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -863,9 +863,9 @@ class PluggableMap extends BaseObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/Tile} tile Tile.
|
* @param {import("./Tile.js").default} tile Tile.
|
||||||
* @param {string} tileSourceKey Tile source key.
|
* @param {string} tileSourceKey Tile source key.
|
||||||
* @param {module:ol/coordinate~Coordinate} tileCenter Tile center.
|
* @param {import("./coordinate.js").Coordinate} tileCenter Tile center.
|
||||||
* @param {number} tileResolution Tile resolution.
|
* @param {number} tileResolution Tile resolution.
|
||||||
* @return {number} Tile priority.
|
* @return {number} Tile priority.
|
||||||
*/
|
*/
|
||||||
@@ -902,7 +902,7 @@ class PluggableMap extends BaseObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent The event to handle.
|
* @param {import("./MapBrowserEvent.js").default} mapBrowserEvent The event to handle.
|
||||||
*/
|
*/
|
||||||
handleMapBrowserEvent(mapBrowserEvent) {
|
handleMapBrowserEvent(mapBrowserEvent) {
|
||||||
if (!this.frameState_) {
|
if (!this.frameState_) {
|
||||||
@@ -1122,8 +1122,8 @@ class PluggableMap extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove the given control from the map.
|
* Remove the given control from the map.
|
||||||
* @param {module:ol/control/Control} control Control.
|
* @param {import("./control/Control.js").default} control Control.
|
||||||
* @return {module:ol/control/Control|undefined} The removed control (or undefined
|
* @return {import("./control/Control.js").default|undefined} The removed control (or undefined
|
||||||
* if the control was not found).
|
* if the control was not found).
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -1133,8 +1133,8 @@ class PluggableMap extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove the given interaction from the map.
|
* Remove the given interaction from the map.
|
||||||
* @param {module:ol/interaction/Interaction} interaction Interaction to remove.
|
* @param {import("./interaction/Interaction.js").default} interaction Interaction to remove.
|
||||||
* @return {module:ol/interaction/Interaction|undefined} The removed interaction (or
|
* @return {import("./interaction/Interaction.js").default|undefined} The removed interaction (or
|
||||||
* undefined if the interaction was not found).
|
* undefined if the interaction was not found).
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -1144,8 +1144,8 @@ class PluggableMap extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes the given layer from the map.
|
* Removes the given layer from the map.
|
||||||
* @param {module:ol/layer/Base} layer Layer.
|
* @param {import("./layer/Base.js").default} layer Layer.
|
||||||
* @return {module:ol/layer/Base|undefined} The removed layer (or undefined if the
|
* @return {import("./layer/Base.js").default|undefined} The removed layer (or undefined if the
|
||||||
* layer was not found).
|
* layer was not found).
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -1156,8 +1156,8 @@ class PluggableMap extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove the given overlay from the map.
|
* Remove the given overlay from the map.
|
||||||
* @param {module:ol/Overlay} overlay Overlay.
|
* @param {import("./Overlay.js").default} overlay Overlay.
|
||||||
* @return {module:ol/Overlay|undefined} The removed overlay (or undefined
|
* @return {import("./Overlay.js").default|undefined} The removed overlay (or undefined
|
||||||
* if the overlay was not found).
|
* if the overlay was not found).
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -1176,7 +1176,7 @@ class PluggableMap extends BaseObject {
|
|||||||
const view = this.getView();
|
const view = this.getView();
|
||||||
const extent = createEmpty();
|
const extent = createEmpty();
|
||||||
const previousFrameState = this.frameState_;
|
const previousFrameState = this.frameState_;
|
||||||
/** @type {?module:ol/PluggableMap~FrameState} */
|
/** @type {?FrameState} */
|
||||||
let frameState = null;
|
let frameState = null;
|
||||||
if (size !== undefined && hasArea(size) && view && view.isDef()) {
|
if (size !== undefined && hasArea(size) && view && view.isDef()) {
|
||||||
const viewHints = view.getHints(this.frameState_ ? this.frameState_.viewHints : undefined);
|
const viewHints = view.getHints(this.frameState_ ? this.frameState_.viewHints : undefined);
|
||||||
@@ -1186,7 +1186,7 @@ class PluggableMap extends BaseObject {
|
|||||||
layerStates[getUid(layerStatesArray[i].layer)] = layerStatesArray[i];
|
layerStates[getUid(layerStatesArray[i].layer)] = layerStatesArray[i];
|
||||||
}
|
}
|
||||||
viewState = view.getState(this.pixelRatio_);
|
viewState = view.getState(this.pixelRatio_);
|
||||||
frameState = /** @type {module:ol/PluggableMap~FrameState} */ ({
|
frameState = /** @type {FrameState} */ ({
|
||||||
animate: false,
|
animate: false,
|
||||||
coordinateToPixelTransform: this.coordinateToPixelTransform_,
|
coordinateToPixelTransform: this.coordinateToPixelTransform_,
|
||||||
extent: extent,
|
extent: extent,
|
||||||
@@ -1252,7 +1252,7 @@ class PluggableMap extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the layergroup of this map.
|
* Sets the layergroup of this map.
|
||||||
* @param {module:ol/layer/Group} layerGroup A layer group containing the layers in this map.
|
* @param {import("./layer/Group.js").default} layerGroup A layer group containing the layers in this map.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -1262,7 +1262,7 @@ class PluggableMap extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the size of this map.
|
* Set the size of this map.
|
||||||
* @param {module:ol/size~Size|undefined} size The size in pixels of the map in the DOM.
|
* @param {import("./size.js").Size|undefined} size The size in pixels of the map in the DOM.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -1283,7 +1283,7 @@ class PluggableMap extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the view for this map.
|
* Set the view for this map.
|
||||||
* @param {module:ol/View} view The view that controls this map.
|
* @param {import("./View.js").default} view The view that controls this map.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -1292,7 +1292,7 @@ class PluggableMap extends BaseObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/Feature} feature Feature.
|
* @param {import("./Feature.js").default} feature Feature.
|
||||||
*/
|
*/
|
||||||
skipFeature(feature) {
|
skipFeature(feature) {
|
||||||
const featureUid = getUid(feature).toString();
|
const featureUid = getUid(feature).toString();
|
||||||
@@ -1328,7 +1328,7 @@ class PluggableMap extends BaseObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/Feature} feature Feature.
|
* @param {import("./Feature.js").default} feature Feature.
|
||||||
*/
|
*/
|
||||||
unskipFeature(feature) {
|
unskipFeature(feature) {
|
||||||
const featureUid = getUid(feature).toString();
|
const featureUid = getUid(feature).toString();
|
||||||
@@ -1340,7 +1340,7 @@ class PluggableMap extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {MapOptions} options Map options.
|
* @param {MapOptions} options Map options.
|
||||||
* @return {module:ol/PluggableMap~MapOptionsInternal} Internal map options.
|
* @return {MapOptionsInternal} Internal map options.
|
||||||
*/
|
*/
|
||||||
function createOptionsInternal(options) {
|
function createOptionsInternal(options) {
|
||||||
|
|
||||||
@@ -1374,7 +1374,7 @@ function createOptionsInternal(options) {
|
|||||||
controls = new Collection(options.controls.slice());
|
controls = new Collection(options.controls.slice());
|
||||||
} else {
|
} else {
|
||||||
assert(options.controls instanceof Collection,
|
assert(options.controls instanceof Collection,
|
||||||
47); // Expected `controls` to be an array or an `module:ol/Collection~Collection`
|
47); // Expected `controls` to be an array or an `import("./Collection.js").Collection`
|
||||||
controls = options.controls;
|
controls = options.controls;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1385,7 +1385,7 @@ function createOptionsInternal(options) {
|
|||||||
interactions = new Collection(options.interactions.slice());
|
interactions = new Collection(options.interactions.slice());
|
||||||
} else {
|
} else {
|
||||||
assert(options.interactions instanceof Collection,
|
assert(options.interactions instanceof Collection,
|
||||||
48); // Expected `interactions` to be an array or an `module:ol/Collection~Collection`
|
48); // Expected `interactions` to be an array or an `import("./Collection.js").Collection`
|
||||||
interactions = options.interactions;
|
interactions = options.interactions;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1396,7 +1396,7 @@ function createOptionsInternal(options) {
|
|||||||
overlays = new Collection(options.overlays.slice());
|
overlays = new Collection(options.overlays.slice());
|
||||||
} else {
|
} else {
|
||||||
assert(options.overlays instanceof Collection,
|
assert(options.overlays instanceof Collection,
|
||||||
49); // Expected `overlays` to be an array or an `module:ol/Collection~Collection`
|
49); // Expected `overlays` to be an array or an `import("./Collection.js").Collection`
|
||||||
overlays = options.overlays;
|
overlays = options.overlays;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -1415,7 +1415,7 @@ function createOptionsInternal(options) {
|
|||||||
export default PluggableMap;
|
export default PluggableMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array<module:ol/layer/Base>} layers Layers.
|
* @param {Array<import("./layer/Base.js").default>} layers Layers.
|
||||||
* @return {boolean} Layers have sources that are still loading.
|
* @return {boolean} Layers have sources that are still loading.
|
||||||
*/
|
*/
|
||||||
function getLoading(layers) {
|
function getLoading(layers) {
|
||||||
|
|||||||
+13
-13
@@ -40,7 +40,7 @@ import EventType from './events/EventType.js';
|
|||||||
* });
|
* });
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* @typedef {function(module:ol/Tile, string)} LoadFunction
|
* @typedef {function(import("./Tile.js").default, string)} LoadFunction
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -54,8 +54,8 @@ import EventType from './events/EventType.js';
|
|||||||
* and returns a `{string}` representing the tile URL, or undefined if no tile
|
* and returns a `{string}` representing the tile URL, or undefined if no tile
|
||||||
* should be requested for the passed tile coordinate.
|
* should be requested for the passed tile coordinate.
|
||||||
*
|
*
|
||||||
* @typedef {function(module:ol/tilecoord~TileCoord, number,
|
* @typedef {function(import("./tilecoord.js").TileCoord, number,
|
||||||
* module:ol/proj/Projection): (string|undefined)} UrlFunction
|
* import("./proj/Projection.js").default): (string|undefined)} UrlFunction
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -77,9 +77,9 @@ import EventType from './events/EventType.js';
|
|||||||
class Tile extends EventTarget {
|
class Tile extends EventTarget {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate.
|
* @param {import("./tilecoord.js").TileCoord} tileCoord Tile coordinate.
|
||||||
* @param {module:ol/TileState} state State.
|
* @param {import("./TileState.js").default} state State.
|
||||||
* @param {module:ol/Tile~Options=} opt_options Tile options.
|
* @param {Options=} opt_options Tile options.
|
||||||
*/
|
*/
|
||||||
constructor(tileCoord, state, opt_options) {
|
constructor(tileCoord, state, opt_options) {
|
||||||
super();
|
super();
|
||||||
@@ -87,13 +87,13 @@ class Tile extends EventTarget {
|
|||||||
const options = opt_options ? opt_options : {};
|
const options = opt_options ? opt_options : {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {module:ol/tilecoord~TileCoord}
|
* @type {import("./tilecoord.js").TileCoord}
|
||||||
*/
|
*/
|
||||||
this.tileCoord = tileCoord;
|
this.tileCoord = tileCoord;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @protected
|
* @protected
|
||||||
* @type {module:ol/TileState}
|
* @type {import("./TileState.js").default}
|
||||||
*/
|
*/
|
||||||
this.state = state;
|
this.state = state;
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ class Tile extends EventTarget {
|
|||||||
* An "interim" tile for this tile. The interim tile may be used while this
|
* An "interim" tile for this tile. The interim tile may be used while this
|
||||||
* one is loading, for "smooth" transitions when changing params/dimensions
|
* one is loading, for "smooth" transitions when changing params/dimensions
|
||||||
* on the source.
|
* on the source.
|
||||||
* @type {module:ol/Tile}
|
* @type {import("./Tile.js").default}
|
||||||
*/
|
*/
|
||||||
this.interimTile = null;
|
this.interimTile = null;
|
||||||
|
|
||||||
@@ -146,7 +146,7 @@ class Tile extends EventTarget {
|
|||||||
* Get the interim tile most suitable for rendering using the chain of interim
|
* Get the interim tile most suitable for rendering using the chain of interim
|
||||||
* tiles. This corresponds to the most recent tile that has been loaded, if no
|
* tiles. This corresponds to the most recent tile that has been loaded, if no
|
||||||
* such tile exists, the original tile is returned.
|
* such tile exists, the original tile is returned.
|
||||||
* @return {!module:ol/Tile} Best tile for rendering.
|
* @return {!import("./Tile.js").default} Best tile for rendering.
|
||||||
*/
|
*/
|
||||||
getInterimTile() {
|
getInterimTile() {
|
||||||
if (!this.interimTile) {
|
if (!this.interimTile) {
|
||||||
@@ -206,7 +206,7 @@ class Tile extends EventTarget {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the tile coordinate for this tile.
|
* Get the tile coordinate for this tile.
|
||||||
* @return {module:ol/tilecoord~TileCoord} The tile coordinate.
|
* @return {import("./tilecoord.js").TileCoord} The tile coordinate.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getTileCoord() {
|
getTileCoord() {
|
||||||
@@ -214,7 +214,7 @@ class Tile extends EventTarget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {module:ol/TileState} State.
|
* @return {import("./TileState.js").default} State.
|
||||||
*/
|
*/
|
||||||
getState() {
|
getState() {
|
||||||
return this.state;
|
return this.state;
|
||||||
@@ -225,7 +225,7 @@ class Tile extends EventTarget {
|
|||||||
* it is important to set the state correctly to {@link module:ol/TileState~ERROR}
|
* it is important to set the state correctly to {@link module:ol/TileState~ERROR}
|
||||||
* when the tile cannot be loaded. Otherwise the tile cannot be removed from
|
* when the tile cannot be loaded. Otherwise the tile cannot be removed from
|
||||||
* the tile queue and will block other requests.
|
* the tile queue and will block other requests.
|
||||||
* @param {module:ol/TileState} state State.
|
* @param {import("./TileState.js").default} state State.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
setState(state) {
|
setState(state) {
|
||||||
|
|||||||
+1
-1
@@ -16,7 +16,7 @@ class TileCache extends LRUCache {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {!Object<string, module:ol/TileRange>} usedTiles Used tiles.
|
* @param {!Object<string, import("./TileRange.js").default>} usedTiles Used tiles.
|
||||||
*/
|
*/
|
||||||
expireCache(usedTiles) {
|
expireCache(usedTiles) {
|
||||||
while (this.canExpireCache()) {
|
while (this.canExpireCache()) {
|
||||||
|
|||||||
+6
-6
@@ -8,14 +8,14 @@ import PriorityQueue from './structs/PriorityQueue.js';
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {function(module:ol/Tile, string, module:ol/coordinate~Coordinate, number): number} PriorityFunction
|
* @typedef {function(import("./Tile.js").default, string, import("./coordinate.js").Coordinate, number): number} PriorityFunction
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
class TileQueue extends PriorityQueue {
|
class TileQueue extends PriorityQueue {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/TileQueue~PriorityFunction} tilePriorityFunction Tile priority function.
|
* @param {PriorityFunction} tilePriorityFunction Tile priority function.
|
||||||
* @param {function(): ?} tileChangeCallback Function called on each tile change event.
|
* @param {function(): ?} tileChangeCallback Function called on each tile change event.
|
||||||
*/
|
*/
|
||||||
constructor(tilePriorityFunction, tileChangeCallback) {
|
constructor(tilePriorityFunction, tileChangeCallback) {
|
||||||
@@ -33,7 +33,7 @@ class TileQueue extends PriorityQueue {
|
|||||||
* @return {string} Key.
|
* @return {string} Key.
|
||||||
*/
|
*/
|
||||||
function(element) {
|
function(element) {
|
||||||
return (/** @type {module:ol/Tile} */ (element[0]).getKey());
|
return (/** @type {import("./Tile.js").default} */ (element[0]).getKey());
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -76,11 +76,11 @@ class TileQueue extends PriorityQueue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/events/Event} event Event.
|
* @param {import("./events/Event.js").default} event Event.
|
||||||
* @protected
|
* @protected
|
||||||
*/
|
*/
|
||||||
handleTileChange(event) {
|
handleTileChange(event) {
|
||||||
const tile = /** @type {module:ol/Tile} */ (event.target);
|
const tile = /** @type {import("./Tile.js").default} */ (event.target);
|
||||||
const state = tile.getState();
|
const state = tile.getState();
|
||||||
if (state === TileState.LOADED || state === TileState.ERROR ||
|
if (state === TileState.LOADED || state === TileState.ERROR ||
|
||||||
state === TileState.EMPTY || state === TileState.ABORT) {
|
state === TileState.EMPTY || state === TileState.ABORT) {
|
||||||
@@ -104,7 +104,7 @@ class TileQueue extends PriorityQueue {
|
|||||||
let state, tile, tileKey;
|
let state, tile, tileKey;
|
||||||
while (this.tilesLoading_ < maxTotalLoading && newLoads < maxNewLoads &&
|
while (this.tilesLoading_ < maxTotalLoading && newLoads < maxNewLoads &&
|
||||||
this.getCount() > 0) {
|
this.getCount() > 0) {
|
||||||
tile = /** @type {module:ol/Tile} */ (this.dequeue()[0]);
|
tile = /** @type {import("./Tile.js").default} */ (this.dequeue()[0]);
|
||||||
tileKey = tile.getKey();
|
tileKey = tile.getKey();
|
||||||
state = tile.getState();
|
state = tile.getState();
|
||||||
if (state === TileState.ABORT) {
|
if (state === TileState.ABORT) {
|
||||||
|
|||||||
+8
-8
@@ -39,7 +39,7 @@ class TileRange {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate.
|
* @param {import("./tilecoord.js").TileCoord} tileCoord Tile coordinate.
|
||||||
* @return {boolean} Contains tile coordinate.
|
* @return {boolean} Contains tile coordinate.
|
||||||
*/
|
*/
|
||||||
contains(tileCoord) {
|
contains(tileCoord) {
|
||||||
@@ -47,7 +47,7 @@ class TileRange {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/TileRange} tileRange Tile range.
|
* @param {import("./TileRange.js").default} tileRange Tile range.
|
||||||
* @return {boolean} Contains.
|
* @return {boolean} Contains.
|
||||||
*/
|
*/
|
||||||
containsTileRange(tileRange) {
|
containsTileRange(tileRange) {
|
||||||
@@ -65,7 +65,7 @@ class TileRange {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/TileRange} tileRange Tile range.
|
* @param {import("./TileRange.js").default} tileRange Tile range.
|
||||||
* @return {boolean} Equals.
|
* @return {boolean} Equals.
|
||||||
*/
|
*/
|
||||||
equals(tileRange) {
|
equals(tileRange) {
|
||||||
@@ -74,7 +74,7 @@ class TileRange {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/TileRange} tileRange Tile range.
|
* @param {import("./TileRange.js").default} tileRange Tile range.
|
||||||
*/
|
*/
|
||||||
extend(tileRange) {
|
extend(tileRange) {
|
||||||
if (tileRange.minX < this.minX) {
|
if (tileRange.minX < this.minX) {
|
||||||
@@ -99,7 +99,7 @@ class TileRange {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {module:ol/size~Size} Size.
|
* @return {import("./size.js").Size} Size.
|
||||||
*/
|
*/
|
||||||
getSize() {
|
getSize() {
|
||||||
return [this.getWidth(), this.getHeight()];
|
return [this.getWidth(), this.getHeight()];
|
||||||
@@ -113,7 +113,7 @@ class TileRange {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/TileRange} tileRange Tile range.
|
* @param {import("./TileRange.js").default} tileRange Tile range.
|
||||||
* @return {boolean} Intersects.
|
* @return {boolean} Intersects.
|
||||||
*/
|
*/
|
||||||
intersects(tileRange) {
|
intersects(tileRange) {
|
||||||
@@ -130,8 +130,8 @@ class TileRange {
|
|||||||
* @param {number} maxX Maximum X.
|
* @param {number} maxX Maximum X.
|
||||||
* @param {number} minY Minimum Y.
|
* @param {number} minY Minimum Y.
|
||||||
* @param {number} maxY Maximum Y.
|
* @param {number} maxY Maximum Y.
|
||||||
* @param {module:ol/TileRange=} tileRange TileRange.
|
* @param {import("./TileRange.js").default=} tileRange TileRange.
|
||||||
* @return {module:ol/TileRange} Tile range.
|
* @return {import("./TileRange.js").default} Tile range.
|
||||||
*/
|
*/
|
||||||
export function createOrUpdate(minX, maxX, minY, maxY, tileRange) {
|
export function createOrUpdate(minX, maxX, minY, maxY, tileRange) {
|
||||||
if (tileRange !== undefined) {
|
if (tileRange !== undefined) {
|
||||||
|
|||||||
+27
-27
@@ -15,7 +15,7 @@ import {VOID} from './functions.js';
|
|||||||
/**
|
/**
|
||||||
* @typedef {Object} ReplayState
|
* @typedef {Object} ReplayState
|
||||||
* @property {boolean} dirty
|
* @property {boolean} dirty
|
||||||
* @property {null|module:ol/render~OrderFunction} renderedRenderOrder
|
* @property {null|import("./render.js").OrderFunction} renderedRenderOrder
|
||||||
* @property {number} renderedTileRevision
|
* @property {number} renderedTileRevision
|
||||||
* @property {number} renderedRevision
|
* @property {number} renderedRevision
|
||||||
*/
|
*/
|
||||||
@@ -24,22 +24,22 @@ import {VOID} from './functions.js';
|
|||||||
class VectorImageTile extends Tile {
|
class VectorImageTile extends Tile {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate.
|
* @param {import("./tilecoord.js").TileCoord} tileCoord Tile coordinate.
|
||||||
* @param {module:ol/TileState} state State.
|
* @param {import("./TileState.js").default} state State.
|
||||||
* @param {number} sourceRevision Source revision.
|
* @param {number} sourceRevision Source revision.
|
||||||
* @param {module:ol/format/Feature} format Feature format.
|
* @param {import("./format/Feature.js").default} format Feature format.
|
||||||
* @param {module:ol/Tile~LoadFunction} tileLoadFunction Tile load function.
|
* @param {import("./Tile.js").LoadFunction} tileLoadFunction Tile load function.
|
||||||
* @param {module:ol/tilecoord~TileCoord} urlTileCoord Wrapped tile coordinate for source urls.
|
* @param {import("./tilecoord.js").TileCoord} urlTileCoord Wrapped tile coordinate for source urls.
|
||||||
* @param {module:ol/Tile~UrlFunction} tileUrlFunction Tile url function.
|
* @param {import("./Tile.js").UrlFunction} tileUrlFunction Tile url function.
|
||||||
* @param {module:ol/tilegrid/TileGrid} sourceTileGrid Tile grid of the source.
|
* @param {import("./tilegrid/TileGrid.js").default} sourceTileGrid Tile grid of the source.
|
||||||
* @param {module:ol/tilegrid/TileGrid} tileGrid Tile grid of the renderer.
|
* @param {import("./tilegrid/TileGrid.js").default} tileGrid Tile grid of the renderer.
|
||||||
* @param {Object<string, module:ol/VectorTile>} sourceTiles Source tiles.
|
* @param {Object<string, import("./VectorTile.js").default>} sourceTiles Source tiles.
|
||||||
* @param {number} pixelRatio Pixel ratio.
|
* @param {number} pixelRatio Pixel ratio.
|
||||||
* @param {module:ol/proj/Projection} projection Projection.
|
* @param {import("./proj/Projection.js").default} projection Projection.
|
||||||
* @param {function(new: module:ol/VectorTile, module:ol/tilecoord~TileCoord, module:ol/TileState, string,
|
* @param {function(new: import("./VectorTile.js").default, import("./tilecoord.js").TileCoord, import("./TileState.js").default, string,
|
||||||
* module:ol/format/Feature, module:ol/Tile~LoadFunction)} tileClass Class to
|
* import("./format/Feature.js").default, import("./Tile.js").LoadFunction)} tileClass Class to
|
||||||
* instantiate for source tiles.
|
* instantiate for source tiles.
|
||||||
* @param {function(this: module:ol/source/VectorTile, module:ol/events/Event)} handleTileChange
|
* @param {function(this: import("./source/VectorTile.js").default, import("./events/Event.js").default)} handleTileChange
|
||||||
* Function to call when a source tile's state changes.
|
* Function to call when a source tile's state changes.
|
||||||
* @param {number} zoom Integer zoom to render the tile for.
|
* @param {number} zoom Integer zoom to render the tile for.
|
||||||
*/
|
*/
|
||||||
@@ -57,19 +57,19 @@ class VectorImageTile extends Tile {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {module:ol/featureloader~FeatureLoader}
|
* @type {import("./featureloader.js").FeatureLoader}
|
||||||
*/
|
*/
|
||||||
this.loader_;
|
this.loader_;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {!Object<string, module:ol/VectorImageTile~ReplayState>}
|
* @type {!Object<string, ReplayState>}
|
||||||
*/
|
*/
|
||||||
this.replayState_ = {};
|
this.replayState_ = {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Object<string, module:ol/VectorTile>}
|
* @type {Object<string, import("./VectorTile.js").default>}
|
||||||
*/
|
*/
|
||||||
this.sourceTiles_ = sourceTiles;
|
this.sourceTiles_ = sourceTiles;
|
||||||
|
|
||||||
@@ -80,7 +80,7 @@ class VectorImageTile extends Tile {
|
|||||||
this.tileKeys = [];
|
this.tileKeys = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {module:ol/extent~Extent}
|
* @type {import("./extent.js").Extent}
|
||||||
*/
|
*/
|
||||||
this.extent = null;
|
this.extent = null;
|
||||||
|
|
||||||
@@ -90,17 +90,17 @@ class VectorImageTile extends Tile {
|
|||||||
this.sourceRevision_ = sourceRevision;
|
this.sourceRevision_ = sourceRevision;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {module:ol/tilecoord~TileCoord}
|
* @type {import("./tilecoord.js").TileCoord}
|
||||||
*/
|
*/
|
||||||
this.wrappedTileCoord = urlTileCoord;
|
this.wrappedTileCoord = urlTileCoord;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Array<module:ol/events~EventsKey>}
|
* @type {Array<import("./events.js").EventsKey>}
|
||||||
*/
|
*/
|
||||||
this.loadListenerKeys_ = [];
|
this.loadListenerKeys_ = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Array<module:ol/events~EventsKey>}
|
* @type {Array<import("./events.js").EventsKey>}
|
||||||
*/
|
*/
|
||||||
this.sourceTileListenerKeys_ = [];
|
this.sourceTileListenerKeys_ = [];
|
||||||
|
|
||||||
@@ -188,7 +188,7 @@ class VectorImageTile extends Tile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/layer/Layer} layer Layer.
|
* @param {import("./layer/Layer.js").default} layer Layer.
|
||||||
* @return {CanvasRenderingContext2D} The rendering context.
|
* @return {CanvasRenderingContext2D} The rendering context.
|
||||||
*/
|
*/
|
||||||
getContext(layer) {
|
getContext(layer) {
|
||||||
@@ -201,7 +201,7 @@ class VectorImageTile extends Tile {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the Canvas for this tile.
|
* Get the Canvas for this tile.
|
||||||
* @param {module:ol/layer/Layer} layer Layer.
|
* @param {import("./layer/Layer.js").default} layer Layer.
|
||||||
* @return {HTMLCanvasElement} Canvas.
|
* @return {HTMLCanvasElement} Canvas.
|
||||||
*/
|
*/
|
||||||
getImage(layer) {
|
getImage(layer) {
|
||||||
@@ -210,8 +210,8 @@ class VectorImageTile extends Tile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/layer/Layer} layer Layer.
|
* @param {import("./layer/Layer.js").default} layer Layer.
|
||||||
* @return {module:ol/VectorImageTile~ReplayState} The replay state.
|
* @return {ReplayState} The replay state.
|
||||||
*/
|
*/
|
||||||
getReplayState(layer) {
|
getReplayState(layer) {
|
||||||
const key = getUid(layer).toString();
|
const key = getUid(layer).toString();
|
||||||
@@ -235,7 +235,7 @@ class VectorImageTile extends Tile {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} tileKey Key (tileCoord) of the source tile.
|
* @param {string} tileKey Key (tileCoord) of the source tile.
|
||||||
* @return {module:ol/VectorTile} Source tile.
|
* @return {import("./VectorTile.js").default} Source tile.
|
||||||
*/
|
*/
|
||||||
getTile(tileKey) {
|
getTile(tileKey) {
|
||||||
return this.sourceTiles_[tileKey];
|
return this.sourceTiles_[tileKey];
|
||||||
@@ -319,7 +319,7 @@ export default VectorImageTile;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the loader for a tile.
|
* Sets the loader for a tile.
|
||||||
* @param {module:ol/VectorTile} tile Vector tile.
|
* @param {import("./VectorTile.js").default} tile Vector tile.
|
||||||
* @param {string} url URL.
|
* @param {string} url URL.
|
||||||
*/
|
*/
|
||||||
export function defaultLoadFunction(tile, url) {
|
export function defaultLoadFunction(tile, url) {
|
||||||
|
|||||||
+30
-30
@@ -7,26 +7,26 @@ import TileState from './TileState.js';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {module:ol/extent~Extent}
|
* @type {import("./extent.js").Extent}
|
||||||
*/
|
*/
|
||||||
const DEFAULT_EXTENT = [0, 0, 4096, 4096];
|
const DEFAULT_EXTENT = [0, 0, 4096, 4096];
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {function(new: module:ol/VectorTile, module:ol/tilecoord~TileCoord,
|
* @typedef {function(new: import("./VectorTile.js").default, import("./tilecoord.js").TileCoord,
|
||||||
* module:ol/TileState, string, ?string, module:ol/Tile~LoadFunction)} TileClass
|
* import("./TileState.js").default, string, ?string, import("./Tile.js").LoadFunction)} TileClass
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class VectorTile extends Tile {
|
class VectorTile extends Tile {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate.
|
* @param {import("./tilecoord.js").TileCoord} tileCoord Tile coordinate.
|
||||||
* @param {module:ol/TileState} state State.
|
* @param {import("./TileState.js").default} state State.
|
||||||
* @param {string} src Data source url.
|
* @param {string} src Data source url.
|
||||||
* @param {module:ol/format/Feature} format Feature format.
|
* @param {import("./format/Feature.js").default} format Feature format.
|
||||||
* @param {module:ol/Tile~LoadFunction} tileLoadFunction Tile load function.
|
* @param {import("./Tile.js").LoadFunction} tileLoadFunction Tile load function.
|
||||||
* @param {module:ol/Tile~Options=} opt_options Tile options.
|
* @param {import("./Tile.js").Options=} opt_options Tile options.
|
||||||
*/
|
*/
|
||||||
constructor(tileCoord, state, src, format, tileLoadFunction, opt_options) {
|
constructor(tileCoord, state, src, format, tileLoadFunction, opt_options) {
|
||||||
|
|
||||||
@@ -39,44 +39,44 @@ class VectorTile extends Tile {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {module:ol/extent~Extent}
|
* @type {import("./extent.js").Extent}
|
||||||
*/
|
*/
|
||||||
this.extent_ = null;
|
this.extent_ = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {module:ol/format/Feature}
|
* @type {import("./format/Feature.js").default}
|
||||||
*/
|
*/
|
||||||
this.format_ = format;
|
this.format_ = format;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array<module:ol/Feature>}
|
* @type {Array<import("./Feature.js").default>}
|
||||||
*/
|
*/
|
||||||
this.features_ = null;
|
this.features_ = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {module:ol/featureloader~FeatureLoader}
|
* @type {import("./featureloader.js").FeatureLoader}
|
||||||
*/
|
*/
|
||||||
this.loader_;
|
this.loader_;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Data projection
|
* Data projection
|
||||||
* @private
|
* @private
|
||||||
* @type {module:ol/proj/Projection}
|
* @type {import("./proj/Projection.js").default}
|
||||||
*/
|
*/
|
||||||
this.projection_ = null;
|
this.projection_ = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Object<string, module:ol/render/ReplayGroup>}
|
* @type {Object<string, import("./render/ReplayGroup.js").default>}
|
||||||
*/
|
*/
|
||||||
this.replayGroups_ = {};
|
this.replayGroups_ = {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {module:ol/Tile~LoadFunction}
|
* @type {import("./Tile.js").LoadFunction}
|
||||||
*/
|
*/
|
||||||
this.tileLoadFunction_ = tileLoadFunction;
|
this.tileLoadFunction_ = tileLoadFunction;
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ class VectorTile extends Tile {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the extent of the vector tile.
|
* Gets the extent of the vector tile.
|
||||||
* @return {module:ol/extent~Extent} The extent.
|
* @return {import("./extent.js").Extent} The extent.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getExtent() {
|
getExtent() {
|
||||||
@@ -110,7 +110,7 @@ class VectorTile extends Tile {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the feature format assigned for reading this tile's features.
|
* Get the feature format assigned for reading this tile's features.
|
||||||
* @return {module:ol/format/Feature} Feature format.
|
* @return {import("./format/Feature.js").default} Feature format.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getFormat() {
|
getFormat() {
|
||||||
@@ -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<import("./Feature.js").default|import("./render/Feature.js").default>} Features.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getFeatures() {
|
getFeatures() {
|
||||||
@@ -137,7 +137,7 @@ class VectorTile extends Tile {
|
|||||||
/**
|
/**
|
||||||
* Get the feature projection of features returned by
|
* Get the feature projection of features returned by
|
||||||
* {@link module:ol/VectorTile~VectorTile#getFeatures}.
|
* {@link module:ol/VectorTile~VectorTile#getFeatures}.
|
||||||
* @return {module:ol/proj/Projection} Feature projection.
|
* @return {import("./proj/Projection.js").default} Feature projection.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getProjection() {
|
getProjection() {
|
||||||
@@ -145,9 +145,9 @@ class VectorTile extends Tile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/layer/Layer} layer Layer.
|
* @param {import("./layer/Layer.js").default} layer Layer.
|
||||||
* @param {string} key Key.
|
* @param {string} key Key.
|
||||||
* @return {module:ol/render/ReplayGroup} Replay group.
|
* @return {import("./render/ReplayGroup.js").default} Replay group.
|
||||||
*/
|
*/
|
||||||
getReplayGroup(layer, key) {
|
getReplayGroup(layer, key) {
|
||||||
return this.replayGroups_[getUid(layer) + ',' + key];
|
return this.replayGroups_[getUid(layer) + ',' + key];
|
||||||
@@ -166,9 +166,9 @@ 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<import("./Feature.js").default>} features The loaded features.
|
||||||
* @param {module:ol/proj/Projection} dataProjection Data projection.
|
* @param {import("./proj/Projection.js").default} dataProjection Data projection.
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {import("./extent.js").Extent} extent Extent.
|
||||||
*/
|
*/
|
||||||
onLoad(features, dataProjection, extent) {
|
onLoad(features, dataProjection, extent) {
|
||||||
this.setProjection(dataProjection);
|
this.setProjection(dataProjection);
|
||||||
@@ -192,7 +192,7 @@ class VectorTile extends Tile {
|
|||||||
* sources using {@link module:ol/format/MVT~MVT} as feature format, the
|
* sources using {@link module:ol/format/MVT~MVT} as feature format, the
|
||||||
* {@link module:ol/format/MVT~MVT#getLastExtent} method will return the correct
|
* {@link module:ol/format/MVT~MVT#getLastExtent} method will return the correct
|
||||||
* extent. The default is `[0, 0, 4096, 4096]`.
|
* extent. The default is `[0, 0, 4096, 4096]`.
|
||||||
* @param {module:ol/extent~Extent} extent The extent.
|
* @param {import("./extent.js").Extent} extent The extent.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
setExtent(extent) {
|
setExtent(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<import("./Feature.js").default>} features Features.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
setFeatures(features) {
|
setFeatures(features) {
|
||||||
@@ -214,7 +214,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 projection of the features that were added with
|
* Sets the projection of the features that were added with
|
||||||
* {@link module:ol/VectorTile~VectorTile#setFeatures}.
|
* {@link module:ol/VectorTile~VectorTile#setFeatures}.
|
||||||
* @param {module:ol/proj/Projection} projection Feature projection.
|
* @param {import("./proj/Projection.js").default} projection Feature projection.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
setProjection(projection) {
|
setProjection(projection) {
|
||||||
@@ -222,9 +222,9 @@ class VectorTile extends Tile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/layer/Layer} layer Layer.
|
* @param {import("./layer/Layer.js").default} layer Layer.
|
||||||
* @param {string} key Key.
|
* @param {string} key Key.
|
||||||
* @param {module:ol/render/ReplayGroup} replayGroup Replay group.
|
* @param {import("./render/ReplayGroup.js").default} replayGroup Replay group.
|
||||||
*/
|
*/
|
||||||
setReplayGroup(layer, key, replayGroup) {
|
setReplayGroup(layer, key, replayGroup) {
|
||||||
this.replayGroups_[getUid(layer) + ',' + key] = replayGroup;
|
this.replayGroups_[getUid(layer) + ',' + key] = replayGroup;
|
||||||
@@ -232,7 +232,7 @@ class VectorTile extends Tile {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the feature loader for reading this tile's features.
|
* Set the feature loader for reading this tile's features.
|
||||||
* @param {module:ol/featureloader~FeatureLoader} loader Feature loader.
|
* @param {import("./featureloader.js").FeatureLoader} loader Feature loader.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
setLoader(loader) {
|
setLoader(loader) {
|
||||||
|
|||||||
+60
-60
@@ -28,13 +28,13 @@ import Units from './proj/Units.js';
|
|||||||
* An animation configuration
|
* An animation configuration
|
||||||
*
|
*
|
||||||
* @typedef {Object} Animation
|
* @typedef {Object} Animation
|
||||||
* @property {module:ol/coordinate~Coordinate} [sourceCenter]
|
* @property {import("./coordinate.js").Coordinate} [sourceCenter]
|
||||||
* @property {module:ol/coordinate~Coordinate} [targetCenter]
|
* @property {import("./coordinate.js").Coordinate} [targetCenter]
|
||||||
* @property {number} [sourceResolution]
|
* @property {number} [sourceResolution]
|
||||||
* @property {number} [targetResolution]
|
* @property {number} [targetResolution]
|
||||||
* @property {number} [sourceRotation]
|
* @property {number} [sourceRotation]
|
||||||
* @property {number} [targetRotation]
|
* @property {number} [targetRotation]
|
||||||
* @property {module:ol/coordinate~Coordinate} [anchor]
|
* @property {import("./coordinate.js").Coordinate} [anchor]
|
||||||
* @property {number} start
|
* @property {number} start
|
||||||
* @property {number} duration
|
* @property {number} duration
|
||||||
* @property {boolean} complete
|
* @property {boolean} complete
|
||||||
@@ -45,15 +45,15 @@ import Units from './proj/Units.js';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} Constraints
|
* @typedef {Object} Constraints
|
||||||
* @property {module:ol/centerconstraint~Type} center
|
* @property {import("./centerconstraint.js").Type} center
|
||||||
* @property {module:ol/resolutionconstraint~Type} resolution
|
* @property {import("./resolutionconstraint.js").Type} resolution
|
||||||
* @property {module:ol/rotationconstraint~Type} rotation
|
* @property {import("./rotationconstraint.js").Type} rotation
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} FitOptions
|
* @typedef {Object} FitOptions
|
||||||
* @property {module:ol/size~Size} [size] The size in pixels of the box to fit
|
* @property {import("./size.js").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
|
||||||
@@ -80,7 +80,7 @@ import Units from './proj/Units.js';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} ViewOptions
|
* @typedef {Object} ViewOptions
|
||||||
* @property {module:ol/coordinate~Coordinate} [center] The initial center for
|
* @property {import("./coordinate.js").Coordinate} [center] The initial center for
|
||||||
* the view. The coordinate system for the center is specified with the
|
* the view. The coordinate system for the center is specified with the
|
||||||
* `projection` option. Layer sources will not be fetched if this is not set,
|
* `projection` option. Layer sources will not be fetched if this is not set,
|
||||||
* but the center can be set later with {@link #setCenter}.
|
* but the center can be set later with {@link #setCenter}.
|
||||||
@@ -92,7 +92,7 @@ import Units from './proj/Units.js';
|
|||||||
* If `false`, a rotation constraint that always sets the rotation to zero is
|
* If `false`, a rotation constraint that always sets the rotation to zero is
|
||||||
* used. The `constrainRotation` option has no effect if `enableRotation` is
|
* used. The `constrainRotation` option has no effect if `enableRotation` is
|
||||||
* `false`.
|
* `false`.
|
||||||
* @property {module:ol/extent~Extent} [extent] The extent that constrains the
|
* @property {import("./extent.js").Extent} [extent] The extent that constrains the
|
||||||
* center, in other words, center cannot be set outside this extent.
|
* center, in other words, center cannot be set outside this extent.
|
||||||
* @property {number} [maxResolution] The maximum resolution used to determine
|
* @property {number} [maxResolution] The maximum resolution used to determine
|
||||||
* the resolution constraint. It is used together with `minResolution` (or
|
* the resolution constraint. It is used together with `minResolution` (or
|
||||||
@@ -114,7 +114,7 @@ import Units from './proj/Units.js';
|
|||||||
* resolution constraint. It is used together with `maxZoom` (or
|
* resolution constraint. It is used together with `maxZoom` (or
|
||||||
* `minResolution`) and `zoomFactor`. Note that if `maxResolution` is also
|
* `minResolution`) and `zoomFactor`. Note that if `maxResolution` is also
|
||||||
* provided, it is given precedence over `minZoom`.
|
* provided, it is given precedence over `minZoom`.
|
||||||
* @property {module:ol/proj~ProjectionLike} [projection='EPSG:3857'] The
|
* @property {import("./proj.js").ProjectionLike} [projection='EPSG:3857'] The
|
||||||
* projection. The default is Spherical Mercator.
|
* projection. The default is Spherical Mercator.
|
||||||
* @property {number} [resolution] The initial resolution for the view. The
|
* @property {number} [resolution] The initial resolution for the view. The
|
||||||
* units are `projection` units per pixel (e.g. meters per pixel). An
|
* units are `projection` units per pixel (e.g. meters per pixel). An
|
||||||
@@ -136,7 +136,7 @@ import Units from './proj/Units.js';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} AnimationOptions
|
* @typedef {Object} AnimationOptions
|
||||||
* @property {module:ol/coordinate~Coordinate|undefined} center The center of the view at the end of
|
* @property {import("./coordinate.js").Coordinate|undefined} center The center of the view at the end of
|
||||||
* the animation.
|
* the animation.
|
||||||
* @property {number|undefined} zoom The zoom level of the view at the end of the
|
* @property {number|undefined} zoom The zoom level of the view at the end of the
|
||||||
* animation. This takes precedence over `resolution`.
|
* animation. This takes precedence over `resolution`.
|
||||||
@@ -144,7 +144,7 @@ import Units from './proj/Units.js';
|
|||||||
* of the animation. If `zoom` is also provided, this option will be ignored.
|
* of the animation. If `zoom` is also provided, this option will be ignored.
|
||||||
* @property {number|undefined} rotation The rotation of the view at the end of
|
* @property {number|undefined} rotation The rotation of the view at the end of
|
||||||
* the animation.
|
* the animation.
|
||||||
* @property {module:ol/coordinate~Coordinate|undefined} anchor Optional anchor to remained fixed
|
* @property {import("./coordinate.js").Coordinate|undefined} anchor Optional anchor to remained fixed
|
||||||
* during a rotation or resolution animation.
|
* during a rotation or resolution animation.
|
||||||
* @property {number} [duration=1000] The duration of the animation in milliseconds.
|
* @property {number} [duration=1000] The duration of the animation in milliseconds.
|
||||||
* @property {function(number):number} [easing] The easing function used
|
* @property {function(number):number} [easing] The easing function used
|
||||||
@@ -157,8 +157,8 @@ import Units from './proj/Units.js';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} State
|
* @typedef {Object} State
|
||||||
* @property {module:ol/coordinate~Coordinate} center
|
* @property {import("./coordinate.js").Coordinate} center
|
||||||
* @property {module:ol/proj/Projection} projection
|
* @property {import("./proj/Projection.js").default} projection
|
||||||
* @property {number} resolution
|
* @property {number} resolution
|
||||||
* @property {number} rotation
|
* @property {number} rotation
|
||||||
* @property {number} zoom
|
* @property {number} zoom
|
||||||
@@ -229,7 +229,7 @@ const DEFAULT_MIN_ZOOM = 0;
|
|||||||
class View extends BaseObject {
|
class View extends BaseObject {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/View~ViewOptions=} opt_options View options.
|
* @param {ViewOptions=} opt_options View options.
|
||||||
*/
|
*/
|
||||||
constructor(opt_options) {
|
constructor(opt_options) {
|
||||||
super();
|
super();
|
||||||
@@ -244,7 +244,7 @@ class View extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array<Array<module:ol/View~Animation>>}
|
* @type {Array<Array<Animation>>}
|
||||||
*/
|
*/
|
||||||
this.animations_ = [];
|
this.animations_ = [];
|
||||||
|
|
||||||
@@ -259,7 +259,7 @@ class View extends BaseObject {
|
|||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @const
|
* @const
|
||||||
* @type {module:ol/proj/Projection}
|
* @type {import("./proj/Projection.js").default}
|
||||||
*/
|
*/
|
||||||
this.projection_ = createProjection(options.projection, 'EPSG:3857');
|
this.projection_ = createProjection(options.projection, 'EPSG:3857');
|
||||||
|
|
||||||
@@ -268,7 +268,7 @@ class View extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set up the view with the given options.
|
* Set up the view with the given options.
|
||||||
* @param {module:ol/View~ViewOptions} options View options.
|
* @param {ViewOptions} options View options.
|
||||||
*/
|
*/
|
||||||
applyOptions_(options) {
|
applyOptions_(options) {
|
||||||
|
|
||||||
@@ -317,7 +317,7 @@ class View extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {module:ol/View~Constraints}
|
* @type {Constraints}
|
||||||
*/
|
*/
|
||||||
this.constraints_ = {
|
this.constraints_ = {
|
||||||
center: centerConstraint,
|
center: centerConstraint,
|
||||||
@@ -342,7 +342,7 @@ class View extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {module:ol/View~ViewOptions}
|
* @type {ViewOptions}
|
||||||
*/
|
*/
|
||||||
this.options_ = options;
|
this.options_ = options;
|
||||||
|
|
||||||
@@ -353,8 +353,8 @@ class View extends BaseObject {
|
|||||||
* current resolution (or zoom), center, and rotation are applied to any stored
|
* current resolution (or zoom), center, and rotation are applied to any stored
|
||||||
* options. The provided options can be used to apply new min/max zoom or
|
* options. The provided options can be used to apply new min/max zoom or
|
||||||
* resolution limits.
|
* resolution limits.
|
||||||
* @param {module:ol/View~ViewOptions} newOptions New options to be applied.
|
* @param {ViewOptions} newOptions New options to be applied.
|
||||||
* @return {module:ol/View~ViewOptions} New options updated with the current view state.
|
* @return {ViewOptions} New options updated with the current view state.
|
||||||
*/
|
*/
|
||||||
getUpdatedOptions_(newOptions) {
|
getUpdatedOptions_(newOptions) {
|
||||||
const options = assign({}, this.options_);
|
const options = assign({}, this.options_);
|
||||||
@@ -400,7 +400,7 @@ class View extends BaseObject {
|
|||||||
* calling `view.setCenter()`, `view.setResolution()`, or `view.setRotation()`
|
* calling `view.setCenter()`, `view.setResolution()`, or `view.setRotation()`
|
||||||
* (or another method that calls one of these).
|
* (or another method that calls one of these).
|
||||||
*
|
*
|
||||||
* @param {...(module:ol/View~AnimationOptions|function(boolean))} var_args Animation
|
* @param {...(AnimationOptions|function(boolean))} var_args Animation
|
||||||
* options. Multiple animations can be run in series by passing multiple
|
* options. Multiple animations can be run in series by passing multiple
|
||||||
* options objects. To run multiple animations in parallel, call the method
|
* options objects. To run multiple animations in parallel, call the method
|
||||||
* multiple times. An optional callback can be provided as a final
|
* multiple times. An optional callback can be provided as a final
|
||||||
@@ -438,9 +438,9 @@ class View extends BaseObject {
|
|||||||
let rotation = this.getRotation();
|
let rotation = this.getRotation();
|
||||||
const series = [];
|
const series = [];
|
||||||
for (let i = 0; i < animationCount; ++i) {
|
for (let i = 0; i < animationCount; ++i) {
|
||||||
const options = /** @type {module:ol/View~AnimationOptions} */ (arguments[i]);
|
const options = /** @type {AnimationOptions} */ (arguments[i]);
|
||||||
|
|
||||||
const animation = /** @type {module:ol/View~Animation} */ ({
|
const animation = /** @type {Animation} */ ({
|
||||||
start: start,
|
start: start,
|
||||||
complete: false,
|
complete: false,
|
||||||
anchor: options.anchor,
|
anchor: options.anchor,
|
||||||
@@ -603,8 +603,8 @@ class View extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {number} rotation Target rotation.
|
* @param {number} rotation Target rotation.
|
||||||
* @param {module:ol/coordinate~Coordinate} anchor Rotation anchor.
|
* @param {import("./coordinate.js").Coordinate} anchor Rotation anchor.
|
||||||
* @return {module:ol/coordinate~Coordinate|undefined} Center for rotation and anchor.
|
* @return {import("./coordinate.js").Coordinate|undefined} Center for rotation and anchor.
|
||||||
*/
|
*/
|
||||||
calculateCenterRotate(rotation, anchor) {
|
calculateCenterRotate(rotation, anchor) {
|
||||||
let center;
|
let center;
|
||||||
@@ -619,8 +619,8 @@ class View extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {number} resolution Target resolution.
|
* @param {number} resolution Target resolution.
|
||||||
* @param {module:ol/coordinate~Coordinate} anchor Zoom anchor.
|
* @param {import("./coordinate.js").Coordinate} anchor Zoom anchor.
|
||||||
* @return {module:ol/coordinate~Coordinate|undefined} Center for resolution and anchor.
|
* @return {import("./coordinate.js").Coordinate|undefined} Center for resolution and anchor.
|
||||||
*/
|
*/
|
||||||
calculateCenterZoom(resolution, anchor) {
|
calculateCenterZoom(resolution, anchor) {
|
||||||
let center;
|
let center;
|
||||||
@@ -636,7 +636,7 @@ class View extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @return {module:ol/size~Size} Viewport size or `[100, 100]` when no viewport is found.
|
* @return {import("./size.js").Size} Viewport size or `[100, 100]` when no viewport is found.
|
||||||
*/
|
*/
|
||||||
getSizeFromViewport_() {
|
getSizeFromViewport_() {
|
||||||
const size = [100, 100];
|
const size = [100, 100];
|
||||||
@@ -652,8 +652,8 @@ class View extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the constrained center of this view.
|
* Get the constrained center of this view.
|
||||||
* @param {module:ol/coordinate~Coordinate|undefined} center Center.
|
* @param {import("./coordinate.js").Coordinate|undefined} center Center.
|
||||||
* @return {module:ol/coordinate~Coordinate|undefined} Constrained center.
|
* @return {import("./coordinate.js").Coordinate|undefined} Constrained center.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
constrainCenter(center) {
|
constrainCenter(center) {
|
||||||
@@ -688,18 +688,18 @@ class View extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the view center.
|
* Get the view center.
|
||||||
* @return {module:ol/coordinate~Coordinate|undefined} The center of the view.
|
* @return {import("./coordinate.js").Coordinate|undefined} The center of the view.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getCenter() {
|
getCenter() {
|
||||||
return (
|
return (
|
||||||
/** @type {module:ol/coordinate~Coordinate|undefined} */ (this.get(ViewProperty.CENTER))
|
/** @type {import("./coordinate.js").Coordinate|undefined} */ (this.get(ViewProperty.CENTER))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {module:ol/View~Constraints} Constraints.
|
* @return {Constraints} Constraints.
|
||||||
*/
|
*/
|
||||||
getConstraints() {
|
getConstraints() {
|
||||||
return this.constraints_;
|
return this.constraints_;
|
||||||
@@ -724,14 +724,14 @@ class View extends BaseObject {
|
|||||||
* The size is the pixel dimensions of the box into which the calculated extent
|
* The size is the pixel dimensions of the box into which the calculated extent
|
||||||
* should fit. In most cases you want to get the extent of the entire map,
|
* should fit. In most cases you want to get the extent of the entire map,
|
||||||
* that is `map.getSize()`.
|
* that is `map.getSize()`.
|
||||||
* @param {module:ol/size~Size=} opt_size Box pixel size. If not provided, the size of the
|
* @param {import("./size.js").Size=} opt_size Box pixel size. If not provided, the size of the
|
||||||
* first map that uses this view will be used.
|
* first map that uses this view will be used.
|
||||||
* @return {module:ol/extent~Extent} Extent.
|
* @return {import("./extent.js").Extent} Extent.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
calculateExtent(opt_size) {
|
calculateExtent(opt_size) {
|
||||||
const size = opt_size || this.getSizeFromViewport_();
|
const size = opt_size || this.getSizeFromViewport_();
|
||||||
const center = /** @type {!module:ol/coordinate~Coordinate} */ (this.getCenter());
|
const center = /** @type {!import("./coordinate.js").Coordinate} */ (this.getCenter());
|
||||||
assert(center, 1); // The view center is not defined
|
assert(center, 1); // The view center is not defined
|
||||||
const resolution = /** @type {!number} */ (this.getResolution());
|
const resolution = /** @type {!number} */ (this.getResolution());
|
||||||
assert(resolution !== undefined, 2); // The view resolution is not defined
|
assert(resolution !== undefined, 2); // The view resolution is not defined
|
||||||
@@ -797,7 +797,7 @@ class View extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the view projection.
|
* Get the view projection.
|
||||||
* @return {module:ol/proj/Projection} The projection of the view.
|
* @return {import("./proj/Projection.js").default} The projection of the view.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getProjection() {
|
getProjection() {
|
||||||
@@ -826,8 +826,8 @@ class View extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the resolution for a provided extent (in map units) and size (in pixels).
|
* Get the resolution for a provided extent (in map units) and size (in pixels).
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {import("./extent.js").Extent} extent Extent.
|
||||||
* @param {module:ol/size~Size=} opt_size Box pixel size.
|
* @param {import("./size.js").Size=} opt_size Box pixel size.
|
||||||
* @return {number} The resolution at which the provided extent will render at
|
* @return {number} The resolution at which the provided extent will render at
|
||||||
* the given size.
|
* the given size.
|
||||||
* @api
|
* @api
|
||||||
@@ -895,16 +895,16 @@ class View extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {number} pixelRatio Pixel ratio for center rounding.
|
* @param {number} pixelRatio Pixel ratio for center rounding.
|
||||||
* @return {module:ol/View~State} View state.
|
* @return {State} View state.
|
||||||
*/
|
*/
|
||||||
getState(pixelRatio) {
|
getState(pixelRatio) {
|
||||||
const center = /** @type {module:ol/coordinate~Coordinate} */ (this.getCenter());
|
const center = /** @type {import("./coordinate.js").Coordinate} */ (this.getCenter());
|
||||||
const projection = this.getProjection();
|
const projection = this.getProjection();
|
||||||
const resolution = /** @type {number} */ (this.getResolution());
|
const resolution = /** @type {number} */ (this.getResolution());
|
||||||
const pixelResolution = resolution / pixelRatio;
|
const pixelResolution = resolution / pixelRatio;
|
||||||
const rotation = this.getRotation();
|
const rotation = this.getRotation();
|
||||||
return (
|
return (
|
||||||
/** @type {module:ol/View~State} */ ({
|
/** @type {State} */ ({
|
||||||
center: [
|
center: [
|
||||||
Math.round(center[0] / pixelResolution) * pixelResolution,
|
Math.round(center[0] / pixelResolution) * pixelResolution,
|
||||||
Math.round(center[1] / pixelResolution) * pixelResolution
|
Math.round(center[1] / pixelResolution) * pixelResolution
|
||||||
@@ -974,9 +974,9 @@ class View extends BaseObject {
|
|||||||
* The size is pixel dimensions of the box to fit the extent into.
|
* The size is pixel dimensions of the box to fit the extent into.
|
||||||
* In most cases you will want to use the map size, that is `map.getSize()`.
|
* In most cases you will want to use the map size, that is `map.getSize()`.
|
||||||
* Takes care of the map angle.
|
* Takes care of the map angle.
|
||||||
* @param {module:ol/geom/SimpleGeometry|module:ol/extent~Extent} geometryOrExtent The geometry or
|
* @param {import("./geom/SimpleGeometry.js").default|import("./extent.js").Extent} geometryOrExtent The geometry or
|
||||||
* extent to fit the view to.
|
* extent to fit the view to.
|
||||||
* @param {module:ol/View~FitOptions=} opt_options Options.
|
* @param {FitOptions=} opt_options Options.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
fit(geometryOrExtent, opt_options) {
|
fit(geometryOrExtent, opt_options) {
|
||||||
@@ -985,7 +985,7 @@ class View extends BaseObject {
|
|||||||
if (!size) {
|
if (!size) {
|
||||||
size = this.getSizeFromViewport_();
|
size = this.getSizeFromViewport_();
|
||||||
}
|
}
|
||||||
/** @type {module:ol/geom/SimpleGeometry} */
|
/** @type {import("./geom/SimpleGeometry.js").default} */
|
||||||
let geometry;
|
let geometry;
|
||||||
if (!(geometryOrExtent instanceof SimpleGeometry)) {
|
if (!(geometryOrExtent instanceof SimpleGeometry)) {
|
||||||
assert(Array.isArray(geometryOrExtent),
|
assert(Array.isArray(geometryOrExtent),
|
||||||
@@ -1076,9 +1076,9 @@ class View extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Center on coordinate and view position.
|
* Center on coordinate and view position.
|
||||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
* @param {import("./coordinate.js").Coordinate} coordinate Coordinate.
|
||||||
* @param {module:ol/size~Size} size Box pixel size.
|
* @param {import("./size.js").Size} size Box pixel size.
|
||||||
* @param {module:ol/pixel~Pixel} position Position on the view to center on.
|
* @param {import("./pixel.js").Pixel} position Position on the view to center on.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
centerOn(coordinate, size, position) {
|
centerOn(coordinate, size, position) {
|
||||||
@@ -1110,7 +1110,7 @@ class View extends BaseObject {
|
|||||||
/**
|
/**
|
||||||
* Rotate the view around a given coordinate.
|
* Rotate the view around a given coordinate.
|
||||||
* @param {number} rotation New rotation value for the view.
|
* @param {number} rotation New rotation value for the view.
|
||||||
* @param {module:ol/coordinate~Coordinate=} opt_anchor The rotation center.
|
* @param {import("./coordinate.js").Coordinate=} opt_anchor The rotation center.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
rotate(rotation, opt_anchor) {
|
rotate(rotation, opt_anchor) {
|
||||||
@@ -1123,7 +1123,7 @@ class View extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the center of the current view.
|
* Set the center of the current view.
|
||||||
* @param {module:ol/coordinate~Coordinate|undefined} center The center of the view.
|
* @param {import("./coordinate.js").Coordinate|undefined} center The center of the view.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -1135,7 +1135,7 @@ class View extends BaseObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/ViewHint} hint Hint.
|
* @param {import("./ViewHint.js").default} hint Hint.
|
||||||
* @param {number} delta Delta.
|
* @param {number} delta Delta.
|
||||||
* @return {number} New value.
|
* @return {number} New value.
|
||||||
*/
|
*/
|
||||||
@@ -1194,8 +1194,8 @@ function animationCallback(callback, returnValue) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/View~ViewOptions} options View options.
|
* @param {ViewOptions} options View options.
|
||||||
* @return {module:ol/centerconstraint~Type} The constraint.
|
* @return {import("./centerconstraint.js").Type} The constraint.
|
||||||
*/
|
*/
|
||||||
export function createCenterConstraint(options) {
|
export function createCenterConstraint(options) {
|
||||||
if (options.extent !== undefined) {
|
if (options.extent !== undefined) {
|
||||||
@@ -1207,8 +1207,8 @@ export function createCenterConstraint(options) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/View~ViewOptions} options View options.
|
* @param {ViewOptions} options View options.
|
||||||
* @return {{constraint: module:ol/resolutionconstraint~Type, maxResolution: number,
|
* @return {{constraint: import("./resolutionconstraint.js").Type, maxResolution: number,
|
||||||
* minResolution: number, minZoom: number, zoomFactor: number}} The constraint.
|
* minResolution: number, minZoom: number, zoomFactor: number}} The constraint.
|
||||||
*/
|
*/
|
||||||
export function createResolutionConstraint(options) {
|
export function createResolutionConstraint(options) {
|
||||||
@@ -1289,8 +1289,8 @@ export function createResolutionConstraint(options) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/View~ViewOptions} options View options.
|
* @param {ViewOptions} options View options.
|
||||||
* @return {module:ol/rotationconstraint~Type} Rotation constraint.
|
* @return {import("./rotationconstraint.js").Type} Rotation constraint.
|
||||||
*/
|
*/
|
||||||
export function createRotationConstraint(options) {
|
export function createRotationConstraint(options) {
|
||||||
const enableRotation = options.enableRotation !== undefined ?
|
const enableRotation = options.enableRotation !== undefined ?
|
||||||
@@ -1314,7 +1314,7 @@ export function createRotationConstraint(options) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine if an animation involves no view change.
|
* Determine if an animation involves no view change.
|
||||||
* @param {module:ol/View~Animation} animation The animation.
|
* @param {Animation} animation The animation.
|
||||||
* @return {boolean} The animation involves no view change.
|
* @return {boolean} The animation involves no view change.
|
||||||
*/
|
*/
|
||||||
export function isNoopAnimation(animation) {
|
export function isNoopAnimation(animation) {
|
||||||
|
|||||||
+3
-3
@@ -56,8 +56,8 @@ import WebGLVectorLayerRenderer from './renderer/webgl/VectorLayer.js';
|
|||||||
* {@link module:ol/layer/Base}, so layers entered in the options or added
|
* {@link module:ol/layer/Base}, so layers entered in the options or added
|
||||||
* with `addLayer` can be groups, which can contain further groups, and so on.
|
* with `addLayer` can be groups, which can contain further groups, and so on.
|
||||||
*
|
*
|
||||||
* @fires module:ol/MapBrowserEvent~MapBrowserEvent
|
* @fires import("./MapBrowserEvent.js").MapBrowserEvent
|
||||||
* @fires module:ol/MapEvent~MapEvent
|
* @fires import("./MapEvent.js").MapEvent
|
||||||
* @fires module:ol/render/Event~RenderEvent#postcompose
|
* @fires module:ol/render/Event~RenderEvent#postcompose
|
||||||
* @fires module:ol/render/Event~RenderEvent#precompose
|
* @fires module:ol/render/Event~RenderEvent#precompose
|
||||||
* @api
|
* @api
|
||||||
@@ -65,7 +65,7 @@ import WebGLVectorLayerRenderer from './renderer/webgl/VectorLayer.js';
|
|||||||
class WebGLMap extends PluggableMap {
|
class WebGLMap extends PluggableMap {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/PluggableMap~MapOptions} options Map options.
|
* @param {import("./PluggableMap.js").MapOptions} options Map options.
|
||||||
*/
|
*/
|
||||||
constructor(options) {
|
constructor(options) {
|
||||||
options = assign({}, options);
|
options = assign({}, options);
|
||||||
|
|||||||
@@ -5,19 +5,19 @@ import {clamp} from './math.js';
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {function((module:ol/coordinate~Coordinate|undefined)): (module:ol/coordinate~Coordinate|undefined)} Type
|
* @typedef {function((import("./coordinate.js").Coordinate|undefined)): (import("./coordinate.js").Coordinate|undefined)} Type
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {import("./extent.js").Extent} extent Extent.
|
||||||
* @return {module:ol/centerconstraint~Type} The constraint.
|
* @return {Type} The constraint.
|
||||||
*/
|
*/
|
||||||
export function createExtent(extent) {
|
export function createExtent(extent) {
|
||||||
return (
|
return (
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/coordinate~Coordinate=} center Center.
|
* @param {import("./coordinate.js").Coordinate=} center Center.
|
||||||
* @return {module:ol/coordinate~Coordinate|undefined} Center.
|
* @return {import("./coordinate.js").Coordinate|undefined} Center.
|
||||||
*/
|
*/
|
||||||
function(center) {
|
function(center) {
|
||||||
if (center) {
|
if (center) {
|
||||||
@@ -34,8 +34,8 @@ export function createExtent(extent) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/coordinate~Coordinate=} center Center.
|
* @param {import("./coordinate.js").Coordinate=} center Center.
|
||||||
* @return {module:ol/coordinate~Coordinate|undefined} Center.
|
* @return {import("./coordinate.js").Coordinate|undefined} Center.
|
||||||
*/
|
*/
|
||||||
export function none(center) {
|
export function none(center) {
|
||||||
return center;
|
return center;
|
||||||
|
|||||||
+11
-11
@@ -35,7 +35,7 @@ const NAMED_COLOR_RE_ = /^([a-z]*)$/i;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the color as an rgba string.
|
* Return the color as an rgba string.
|
||||||
* @param {module:ol/color~Color|string} color Color.
|
* @param {Color|string} color Color.
|
||||||
* @return {string} Rgba string.
|
* @return {string} Rgba string.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -68,7 +68,7 @@ function fromNamed(color) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} s String.
|
* @param {string} s String.
|
||||||
* @return {module:ol/color~Color} Color.
|
* @return {Color} Color.
|
||||||
*/
|
*/
|
||||||
export const fromString = (
|
export const fromString = (
|
||||||
function() {
|
function() {
|
||||||
@@ -84,7 +84,7 @@ export const fromString = (
|
|||||||
const MAX_CACHE_SIZE = 1024;
|
const MAX_CACHE_SIZE = 1024;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object<string, module:ol/color~Color>}
|
* @type {Object<string, Color>}
|
||||||
*/
|
*/
|
||||||
const cache = {};
|
const cache = {};
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ export const fromString = (
|
|||||||
return (
|
return (
|
||||||
/**
|
/**
|
||||||
* @param {string} s String.
|
* @param {string} s String.
|
||||||
* @return {module:ol/color~Color} Color.
|
* @return {Color} Color.
|
||||||
*/
|
*/
|
||||||
function(s) {
|
function(s) {
|
||||||
let color;
|
let color;
|
||||||
@@ -125,8 +125,8 @@ export const fromString = (
|
|||||||
/**
|
/**
|
||||||
* Return the color as an array. This function maintains a cache of calculated
|
* Return the color as an array. This function maintains a cache of calculated
|
||||||
* arrays which means the result should not be modified.
|
* arrays which means the result should not be modified.
|
||||||
* @param {module:ol/color~Color|string} color Color.
|
* @param {Color|string} color Color.
|
||||||
* @return {module:ol/color~Color} Color.
|
* @return {Color} Color.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function asArray(color) {
|
export function asArray(color) {
|
||||||
@@ -140,7 +140,7 @@ export function asArray(color) {
|
|||||||
/**
|
/**
|
||||||
* @param {string} s String.
|
* @param {string} s String.
|
||||||
* @private
|
* @private
|
||||||
* @return {module:ol/color~Color} Color.
|
* @return {Color} Color.
|
||||||
*/
|
*/
|
||||||
function fromStringInternal_(s) {
|
function fromStringInternal_(s) {
|
||||||
let r, g, b, a, color;
|
let r, g, b, a, color;
|
||||||
@@ -186,15 +186,15 @@ function fromStringInternal_(s) {
|
|||||||
assert(false, 14); // Invalid color
|
assert(false, 14); // Invalid color
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
/** @type {module:ol/color~Color} */ (color)
|
/** @type {Color} */ (color)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO this function is only used in the test, we probably shouldn't export it
|
* TODO this function is only used in the test, we probably shouldn't export it
|
||||||
* @param {module:ol/color~Color} color Color.
|
* @param {Color} color Color.
|
||||||
* @return {module:ol/color~Color} Clamped color.
|
* @return {Color} Clamped color.
|
||||||
*/
|
*/
|
||||||
export function normalize(color) {
|
export function normalize(color) {
|
||||||
color[0] = clamp((color[0] + 0.5) | 0, 0, 255);
|
color[0] = clamp((color[0] + 0.5) | 0, 0, 255);
|
||||||
@@ -206,7 +206,7 @@ export function normalize(color) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/color~Color} color Color.
|
* @param {Color} color Color.
|
||||||
* @return {string} String.
|
* @return {string} String.
|
||||||
*/
|
*/
|
||||||
export function toString(color) {
|
export function toString(color) {
|
||||||
|
|||||||
+3
-3
@@ -18,15 +18,15 @@ import {toString} from './color.js';
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/color~Color|module:ol/colorlike~ColorLike} color Color.
|
* @param {import("./color.js").Color|ColorLike} color Color.
|
||||||
* @return {module:ol/colorlike~ColorLike} The color as an {@link ol/colorlike~ColorLike}.
|
* @return {ColorLike} The color as an {@link ol/colorlike~ColorLike}.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function asColorLike(color) {
|
export function asColorLike(color) {
|
||||||
if (isColorLike(color)) {
|
if (isColorLike(color)) {
|
||||||
return /** @type {string|CanvasPattern|CanvasGradient} */ (color);
|
return /** @type {string|CanvasPattern|CanvasGradient} */ (color);
|
||||||
} else {
|
} else {
|
||||||
return toString(/** @type {module:ol/color~Color} */ (color));
|
return toString(/** @type {import("./color.js").Color} */ (color));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ import {visibleAtResolution} from '../layer/Layer.js';
|
|||||||
* @property {string|HTMLElement} [collapseLabel='»'] Text label to use
|
* @property {string|HTMLElement} [collapseLabel='»'] Text label to use
|
||||||
* for the expanded attributions button.
|
* for the expanded attributions button.
|
||||||
* Instead of text, also an element (e.g. a `span` element) can be used.
|
* Instead of text, also an element (e.g. a `span` element) can be used.
|
||||||
* @property {function(module:ol/MapEvent)} [render] Function called when
|
* @property {function(import("../MapEvent.js").default)} [render] Function called when
|
||||||
* the control should be re-rendered. This is called in a `requestAnimationFrame`
|
* the control should be re-rendered. This is called in a `requestAnimationFrame`
|
||||||
* callback.
|
* callback.
|
||||||
*/
|
*/
|
||||||
@@ -46,7 +46,7 @@ import {visibleAtResolution} from '../layer/Layer.js';
|
|||||||
class Attribution extends Control {
|
class Attribution extends Control {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/control/Attribution~Options=} opt_options Attribution options.
|
* @param {Options=} opt_options Attribution options.
|
||||||
*/
|
*/
|
||||||
constructor(opt_options) {
|
constructor(opt_options) {
|
||||||
|
|
||||||
@@ -146,7 +146,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 {import("../PluggableMap.js").FrameState} frameState Frame state.
|
||||||
* @return {Array<string>} Attributions.
|
* @return {Array<string>} Attributions.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -205,7 +205,7 @@ class Attribution extends Control {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @param {?module:ol/PluggableMap~FrameState} frameState Frame state.
|
* @param {?import("../PluggableMap.js").FrameState} frameState Frame state.
|
||||||
*/
|
*/
|
||||||
updateElement_(frameState) {
|
updateElement_(frameState) {
|
||||||
if (!frameState) {
|
if (!frameState) {
|
||||||
@@ -315,8 +315,8 @@ class Attribution extends Control {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the attribution element.
|
* Update the attribution element.
|
||||||
* @param {module:ol/MapEvent} mapEvent Map event.
|
* @param {import("../MapEvent.js").default} mapEvent Map event.
|
||||||
* @this {module:ol/control/Attribution}
|
* @this {import("./Attribution.js").default}
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function render(mapEvent) {
|
export function render(mapEvent) {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import {listen, unlistenByKey} from '../events.js';
|
|||||||
* @property {HTMLElement} [element] The element is the control's
|
* @property {HTMLElement} [element] The element is the control's
|
||||||
* container element. This only needs to be specified if you're developing
|
* container element. This only needs to be specified if you're developing
|
||||||
* a custom control.
|
* a custom control.
|
||||||
* @property {function(module:ol/MapEvent)} [render] Function called when
|
* @property {function(import("../MapEvent.js").default)} [render] Function called when
|
||||||
* the control should be re-rendered. This is called in a `requestAnimationFrame`
|
* the control should be re-rendered. This is called in a `requestAnimationFrame`
|
||||||
* callback.
|
* callback.
|
||||||
* @property {HTMLElement|string} [target] Specify a target if you want
|
* @property {HTMLElement|string} [target] Specify a target if you want
|
||||||
@@ -48,7 +48,7 @@ import {listen, unlistenByKey} from '../events.js';
|
|||||||
class Control extends BaseObject {
|
class Control extends BaseObject {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/control/Control~Options} options Control options.
|
* @param {Options} options Control options.
|
||||||
*/
|
*/
|
||||||
constructor(options) {
|
constructor(options) {
|
||||||
|
|
||||||
@@ -68,18 +68,18 @@ class Control extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {module:ol/PluggableMap}
|
* @type {import("../PluggableMap.js").default}
|
||||||
*/
|
*/
|
||||||
this.map_ = null;
|
this.map_ = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @protected
|
* @protected
|
||||||
* @type {!Array<module:ol/events~EventsKey>}
|
* @type {!Array<import("../events.js").EventsKey>}
|
||||||
*/
|
*/
|
||||||
this.listenerKeys = [];
|
this.listenerKeys = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {function(module:ol/MapEvent)}
|
* @type {function(import("../MapEvent.js").default)}
|
||||||
*/
|
*/
|
||||||
this.render = options.render ? options.render : VOID;
|
this.render = options.render ? options.render : VOID;
|
||||||
|
|
||||||
@@ -99,7 +99,7 @@ class Control extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the map associated with this control.
|
* Get the map associated with this control.
|
||||||
* @return {module:ol/PluggableMap} Map.
|
* @return {import("../PluggableMap.js").default} Map.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getMap() {
|
getMap() {
|
||||||
@@ -110,7 +110,7 @@ class Control extends BaseObject {
|
|||||||
* Remove the control from its current map and attach it to the new map.
|
* Remove the control from its current map and attach it to the new map.
|
||||||
* Subclasses may set up event handlers to get notified about changes to
|
* Subclasses may set up event handlers to get notified about changes to
|
||||||
* the map here.
|
* the map here.
|
||||||
* @param {module:ol/PluggableMap} map Map.
|
* @param {import("../PluggableMap.js").default} map Map.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
setMap(map) {
|
setMap(map) {
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ const getChangeType = (function() {
|
|||||||
class FullScreen extends Control {
|
class FullScreen extends Control {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/control/FullScreen~Options=} opt_options Options.
|
* @param {Options=} opt_options Options.
|
||||||
*/
|
*/
|
||||||
constructor(opt_options) {
|
constructor(opt_options) {
|
||||||
|
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ const COORDINATE_FORMAT = 'coordinateFormat';
|
|||||||
/**
|
/**
|
||||||
* @typedef {Object} Options
|
* @typedef {Object} Options
|
||||||
* @property {string} [className='ol-mouse-position'] CSS class name.
|
* @property {string} [className='ol-mouse-position'] CSS class name.
|
||||||
* @property {module:ol/coordinate~CoordinateFormat} [coordinateFormat] Coordinate format.
|
* @property {import("../coordinate.js").CoordinateFormat} [coordinateFormat] Coordinate format.
|
||||||
* @property {module:ol/proj~ProjectionLike} projection Projection.
|
* @property {import("../proj.js").ProjectionLike} projection Projection.
|
||||||
* @property {function(module:ol/MapEvent)} [render] Function called when the
|
* @property {function(import("../MapEvent.js").default)} [render] Function called when the
|
||||||
* control should be re-rendered. This is called in a `requestAnimationFrame`
|
* control should be re-rendered. This is called in a `requestAnimationFrame`
|
||||||
* callback.
|
* callback.
|
||||||
* @property {Element|string} [target] Specify a target if you want the
|
* @property {Element|string} [target] Specify a target if you want the
|
||||||
@@ -49,7 +49,7 @@ const COORDINATE_FORMAT = 'coordinateFormat';
|
|||||||
class MousePosition extends Control {
|
class MousePosition extends Control {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/control/MousePosition~Options=} opt_options Mouse position options.
|
* @param {Options=} opt_options Mouse position options.
|
||||||
*/
|
*/
|
||||||
constructor(opt_options) {
|
constructor(opt_options) {
|
||||||
|
|
||||||
@@ -95,19 +95,19 @@ class MousePosition extends Control {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {module:ol/proj/Projection}
|
* @type {import("../proj/Projection.js").default}
|
||||||
*/
|
*/
|
||||||
this.mapProjection_ = null;
|
this.mapProjection_ = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {?module:ol/proj~TransformFunction}
|
* @type {?import("../proj.js").TransformFunction}
|
||||||
*/
|
*/
|
||||||
this.transform_ = null;
|
this.transform_ = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {module:ol/pixel~Pixel}
|
* @type {import("../pixel.js").Pixel}
|
||||||
*/
|
*/
|
||||||
this.lastMouseMovePixel_ = null;
|
this.lastMouseMovePixel_ = null;
|
||||||
|
|
||||||
@@ -123,27 +123,27 @@ class MousePosition extends Control {
|
|||||||
/**
|
/**
|
||||||
* Return the coordinate format type used to render the current position or
|
* Return the coordinate format type used to render the current position or
|
||||||
* undefined.
|
* undefined.
|
||||||
* @return {module:ol/coordinate~CoordinateFormat|undefined} The format to render the current
|
* @return {import("../coordinate.js").CoordinateFormat|undefined} The format to render the current
|
||||||
* position in.
|
* position in.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getCoordinateFormat() {
|
getCoordinateFormat() {
|
||||||
return (
|
return (
|
||||||
/** @type {module:ol/coordinate~CoordinateFormat|undefined} */ (this.get(COORDINATE_FORMAT))
|
/** @type {import("../coordinate.js").CoordinateFormat|undefined} */ (this.get(COORDINATE_FORMAT))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the projection that is used to report the mouse position.
|
* Return the projection that is used to report the mouse position.
|
||||||
* @return {module:ol/proj/Projection|undefined} The projection to report mouse
|
* @return {import("../proj/Projection.js").default|undefined} The projection to report mouse
|
||||||
* position in.
|
* position in.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getProjection() {
|
getProjection() {
|
||||||
return (
|
return (
|
||||||
/** @type {module:ol/proj/Projection|undefined} */ (this.get(PROJECTION))
|
/** @type {import("../proj/Projection.js").default|undefined} */ (this.get(PROJECTION))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -187,7 +187,7 @@ class MousePosition extends Control {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the coordinate format type used to render the current position.
|
* Set the coordinate format type used to render the current position.
|
||||||
* @param {module:ol/coordinate~CoordinateFormat} format The format to render the current
|
* @param {import("../coordinate.js").CoordinateFormat} format The format to render the current
|
||||||
* position in.
|
* position in.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api
|
||||||
@@ -198,7 +198,7 @@ class MousePosition extends Control {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the projection that is used to report the mouse position.
|
* Set the projection that is used to report the mouse position.
|
||||||
* @param {module:ol/proj~ProjectionLike} projection The projection to report mouse
|
* @param {import("../proj.js").ProjectionLike} projection The projection to report mouse
|
||||||
* position in.
|
* position in.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api
|
||||||
@@ -208,7 +208,7 @@ class MousePosition extends Control {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {?module:ol/pixel~Pixel} pixel Pixel.
|
* @param {?import("../pixel.js").Pixel} pixel Pixel.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
updateHTML_(pixel) {
|
updateHTML_(pixel) {
|
||||||
@@ -245,8 +245,8 @@ class MousePosition extends Control {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the mouseposition element.
|
* Update the mouseposition element.
|
||||||
* @param {module:ol/MapEvent} mapEvent Map event.
|
* @param {import("../MapEvent.js").default} mapEvent Map event.
|
||||||
* @this {module:ol/control/MousePosition}
|
* @this {import("./MousePosition.js").default}
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function render(mapEvent) {
|
export function render(mapEvent) {
|
||||||
|
|||||||
@@ -44,15 +44,15 @@ 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<import("../layer/Layer.js").default>|import("../Collection.js").default<import("../layer/Layer.js").default>} [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(import("../MapEvent.js").default)} [render] Function called when the control
|
||||||
* should be re-rendered. This is called in a `requestAnimationFrame` callback.
|
* should be re-rendered. This is called in a `requestAnimationFrame` callback.
|
||||||
* @property {HTMLElement|string} [target] Specify a target if you want the control
|
* @property {HTMLElement|string} [target] Specify a target if you want the control
|
||||||
* to be rendered outside of the map's viewport.
|
* to be rendered outside of the map's viewport.
|
||||||
* @property {string} [tipLabel='Overview map'] Text label to use for the button tip.
|
* @property {string} [tipLabel='Overview map'] Text label to use for the button tip.
|
||||||
* @property {module:ol/View} [view] Custom view for the overview map. If not provided,
|
* @property {import("../View.js").default} [view] Custom view for the overview map. If not provided,
|
||||||
* a default view with an EPSG:3857 projection will be used.
|
* a default view with an EPSG:3857 projection will be used.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ const MIN_RATIO = 0.1;
|
|||||||
class OverviewMap extends Control {
|
class OverviewMap extends Control {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/control/OverviewMap~Options=} opt_options OverviewMap options.
|
* @param {Options=} opt_options OverviewMap options.
|
||||||
*/
|
*/
|
||||||
constructor(opt_options) {
|
constructor(opt_options) {
|
||||||
|
|
||||||
@@ -144,7 +144,7 @@ class OverviewMap extends Control {
|
|||||||
this.ovmapDiv_.className = 'ol-overviewmap-map';
|
this.ovmapDiv_.className = 'ol-overviewmap-map';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {module:ol/Map}
|
* @type {import("../Map.js").default}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.ovmap_ = new Map({
|
this.ovmap_ = new Map({
|
||||||
@@ -157,7 +157,7 @@ class OverviewMap extends Control {
|
|||||||
if (options.layers) {
|
if (options.layers) {
|
||||||
options.layers.forEach(
|
options.layers.forEach(
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/layer/Layer} layer Layer.
|
* @param {import("../layer/Layer.js").default} layer Layer.
|
||||||
*/
|
*/
|
||||||
(function(layer) {
|
(function(layer) {
|
||||||
ovmap.addLayer(layer);
|
ovmap.addLayer(layer);
|
||||||
@@ -169,7 +169,7 @@ class OverviewMap extends Control {
|
|||||||
box.style.boxSizing = 'border-box';
|
box.style.boxSizing = 'border-box';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {module:ol/Overlay}
|
* @type {import("../Overlay.js").default}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.boxOverlay_ = new Overlay({
|
this.boxOverlay_ = new Overlay({
|
||||||
@@ -268,12 +268,12 @@ class OverviewMap extends Control {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle map property changes. This only deals with changes to the map's view.
|
* Handle map property changes. This only deals with changes to the map's view.
|
||||||
* @param {module:ol/Object~ObjectEvent} event The propertychange event.
|
* @param {import("../Object.js").ObjectEvent} event The propertychange event.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
handleMapPropertyChange_(event) {
|
handleMapPropertyChange_(event) {
|
||||||
if (event.key === MapProperty.VIEW) {
|
if (event.key === MapProperty.VIEW) {
|
||||||
const oldView = /** @type {module:ol/View} */ (event.oldValue);
|
const oldView = /** @type {import("../View.js").default} */ (event.oldValue);
|
||||||
if (oldView) {
|
if (oldView) {
|
||||||
this.unbindView_(oldView);
|
this.unbindView_(oldView);
|
||||||
}
|
}
|
||||||
@@ -284,7 +284,7 @@ class OverviewMap extends Control {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Register listeners for view property changes.
|
* Register listeners for view property changes.
|
||||||
* @param {module:ol/View} view The view.
|
* @param {import("../View.js").default} view The view.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
bindView_(view) {
|
bindView_(view) {
|
||||||
@@ -295,7 +295,7 @@ class OverviewMap extends Control {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Unregister listeners for view property changes.
|
* Unregister listeners for view property changes.
|
||||||
* @param {module:ol/View} view The view.
|
* @param {import("../View.js").default} view The view.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
unbindView_(view) {
|
unbindView_(view) {
|
||||||
@@ -333,12 +333,12 @@ class OverviewMap extends Control {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const mapSize = /** @type {module:ol/size~Size} */ (map.getSize());
|
const mapSize = /** @type {import("../size.js").Size} */ (map.getSize());
|
||||||
|
|
||||||
const view = map.getView();
|
const view = map.getView();
|
||||||
const extent = view.calculateExtent(mapSize);
|
const extent = view.calculateExtent(mapSize);
|
||||||
|
|
||||||
const ovmapSize = /** @type {module:ol/size~Size} */ (ovmap.getSize());
|
const ovmapSize = /** @type {import("../size.js").Size} */ (ovmap.getSize());
|
||||||
|
|
||||||
const ovview = ovmap.getView();
|
const ovview = ovmap.getView();
|
||||||
const ovextent = ovview.calculateExtent(ovmapSize);
|
const ovextent = ovview.calculateExtent(ovmapSize);
|
||||||
@@ -377,7 +377,7 @@ class OverviewMap extends Control {
|
|||||||
const map = this.getMap();
|
const map = this.getMap();
|
||||||
const ovmap = this.ovmap_;
|
const ovmap = this.ovmap_;
|
||||||
|
|
||||||
const mapSize = /** @type {module:ol/size~Size} */ (map.getSize());
|
const mapSize = /** @type {import("../size.js").Size} */ (map.getSize());
|
||||||
|
|
||||||
const view = map.getView();
|
const view = map.getView();
|
||||||
const extent = view.calculateExtent(mapSize);
|
const extent = view.calculateExtent(mapSize);
|
||||||
@@ -422,7 +422,7 @@ class OverviewMap extends Control {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const mapSize = /** @type {module:ol/size~Size} */ (map.getSize());
|
const mapSize = /** @type {import("../size.js").Size} */ (map.getSize());
|
||||||
|
|
||||||
const view = map.getView();
|
const view = map.getView();
|
||||||
|
|
||||||
@@ -450,8 +450,8 @@ class OverviewMap extends Control {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {number} rotation Target rotation.
|
* @param {number} rotation Target rotation.
|
||||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
* @param {import("../coordinate.js").Coordinate} coordinate Coordinate.
|
||||||
* @return {module:ol/coordinate~Coordinate|undefined} Coordinate for rotation and center anchor.
|
* @return {import("../coordinate.js").Coordinate|undefined} Coordinate for rotation and center anchor.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
calculateCoordinateRotate_(rotation, coordinate) {
|
calculateCoordinateRotate_(rotation, coordinate) {
|
||||||
@@ -558,7 +558,7 @@ class OverviewMap extends Control {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the overview map.
|
* Return the overview map.
|
||||||
* @return {module:ol/PluggableMap} Overview map.
|
* @return {import("../PluggableMap.js").default} Overview map.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getOverviewMap() {
|
getOverviewMap() {
|
||||||
@@ -569,8 +569,8 @@ class OverviewMap extends Control {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the overview map element.
|
* Update the overview map element.
|
||||||
* @param {module:ol/MapEvent} mapEvent Map event.
|
* @param {import("../MapEvent.js").default} mapEvent Map event.
|
||||||
* @this {module:ol/control/OverviewMap}
|
* @this {import("./OverviewMap.js").default}
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function render(mapEvent) {
|
export function render(mapEvent) {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import EventType from '../events/EventType.js';
|
|||||||
* @property {string} [tipLabel='Reset rotation'] Text label to use for the rotate tip.
|
* @property {string} [tipLabel='Reset rotation'] Text label to use for the rotate tip.
|
||||||
* @property {number} [duration=250] Animation duration in milliseconds.
|
* @property {number} [duration=250] Animation duration in milliseconds.
|
||||||
* @property {boolean} [autoHide=true] Hide the control when rotation is 0.
|
* @property {boolean} [autoHide=true] Hide the control when rotation is 0.
|
||||||
* @property {function(module:ol/MapEvent)} [render] Function called when the control should
|
* @property {function(import("../MapEvent.js").default)} [render] Function called when the control should
|
||||||
* be re-rendered. This is called in a `requestAnimationFrame` callback.
|
* be re-rendered. This is called in a `requestAnimationFrame` callback.
|
||||||
* @property {function()} [resetNorth] Function called when the control is clicked.
|
* @property {function()} [resetNorth] Function called when the control is clicked.
|
||||||
* This will override the default `resetNorth`.
|
* This will override the default `resetNorth`.
|
||||||
@@ -36,7 +36,7 @@ import EventType from '../events/EventType.js';
|
|||||||
class Rotate extends Control {
|
class Rotate extends Control {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/control/Rotate~Options=} opt_options Rotate options.
|
* @param {Options=} opt_options Rotate options.
|
||||||
*/
|
*/
|
||||||
constructor(opt_options) {
|
constructor(opt_options) {
|
||||||
|
|
||||||
@@ -149,8 +149,8 @@ class Rotate extends Control {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the rotate control element.
|
* Update the rotate control element.
|
||||||
* @param {module:ol/MapEvent} mapEvent Map event.
|
* @param {import("../MapEvent.js").default} mapEvent Map event.
|
||||||
* @this {module:ol/control/Rotate}
|
* @this {import("./Rotate.js").default}
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function render(mapEvent) {
|
export function render(mapEvent) {
|
||||||
|
|||||||
+10
-10
@@ -40,11 +40,11 @@ const LEADING_DIGITS = [1, 2, 5];
|
|||||||
* @typedef {Object} Options
|
* @typedef {Object} Options
|
||||||
* @property {string} [className='ol-scale-line'] CSS Class name.
|
* @property {string} [className='ol-scale-line'] CSS Class name.
|
||||||
* @property {number} [minWidth=64] Minimum width in pixels.
|
* @property {number} [minWidth=64] Minimum width in pixels.
|
||||||
* @property {function(module:ol/MapEvent)} [render] Function called when the control
|
* @property {function(import("../MapEvent.js").default)} [render] Function called when the control
|
||||||
* should be re-rendered. This is called in a `requestAnimationFrame` callback.
|
* should be re-rendered. This is called in a `requestAnimationFrame` callback.
|
||||||
* @property {HTMLElement|string} [target] Specify a target if you want the control
|
* @property {HTMLElement|string} [target] Specify a target if you want the control
|
||||||
* to be rendered outside of the map's viewport.
|
* to be rendered outside of the map's viewport.
|
||||||
* @property {module:ol/control/ScaleLine~Units|string} [units='metric'] Units.
|
* @property {Units|string} [units='metric'] Units.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@ const LEADING_DIGITS = [1, 2, 5];
|
|||||||
class ScaleLine extends Control {
|
class ScaleLine extends Control {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/control/ScaleLine~Options=} opt_options Scale line options.
|
* @param {Options=} opt_options Scale line options.
|
||||||
*/
|
*/
|
||||||
constructor(opt_options) {
|
constructor(opt_options) {
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ class ScaleLine extends Control {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {?module:ol/View~State}
|
* @type {?import("../View.js").State}
|
||||||
*/
|
*/
|
||||||
this.viewState_ = null;
|
this.viewState_ = null;
|
||||||
|
|
||||||
@@ -121,21 +121,21 @@ class ScaleLine extends Control {
|
|||||||
this, getChangeEventType(UNITS_PROP),
|
this, getChangeEventType(UNITS_PROP),
|
||||||
this.handleUnitsChanged_, this);
|
this.handleUnitsChanged_, this);
|
||||||
|
|
||||||
this.setUnits(/** @type {module:ol/control/ScaleLine~Units} */ (options.units) ||
|
this.setUnits(/** @type {Units} */ (options.units) ||
|
||||||
Units.METRIC);
|
Units.METRIC);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the units to use in the scale line.
|
* Return the units to use in the scale line.
|
||||||
* @return {module:ol/control/ScaleLine~Units|undefined} The units
|
* @return {Units|undefined} The units
|
||||||
* to use in the scale line.
|
* to use in the scale line.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getUnits() {
|
getUnits() {
|
||||||
return (
|
return (
|
||||||
/** @type {module:ol/control/ScaleLine~Units|undefined} */ (this.get(UNITS_PROP))
|
/** @type {Units|undefined} */ (this.get(UNITS_PROP))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -148,7 +148,7 @@ class ScaleLine extends Control {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the units to use in the scale line.
|
* Set the units to use in the scale line.
|
||||||
* @param {module:ol/control/ScaleLine~Units} units The units to use in the scale line.
|
* @param {Units} units The units to use in the scale line.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -282,8 +282,8 @@ class ScaleLine extends Control {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the scale line element.
|
* Update the scale line element.
|
||||||
* @param {module:ol/MapEvent} mapEvent Map event.
|
* @param {import("../MapEvent.js").default} mapEvent Map event.
|
||||||
* @this {module:ol/control/ScaleLine}
|
* @this {import("./ScaleLine.js").default}
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function render(mapEvent) {
|
export function render(mapEvent) {
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ import {easeOut} from '../easing.js';
|
|||||||
class Zoom extends Control {
|
class Zoom extends Control {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/control/Zoom~Options=} opt_options Zoom options.
|
* @param {Options=} opt_options Zoom options.
|
||||||
*/
|
*/
|
||||||
constructor(opt_options) {
|
constructor(opt_options) {
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ const Direction = {
|
|||||||
* @typedef {Object} Options
|
* @typedef {Object} Options
|
||||||
* @property {string} [className='ol-zoomslider'] CSS class name.
|
* @property {string} [className='ol-zoomslider'] CSS class name.
|
||||||
* @property {number} [duration=200] Animation duration in milliseconds.
|
* @property {number} [duration=200] Animation duration in milliseconds.
|
||||||
* @property {function(module:ol/MapEvent)} [render] Function called when the control
|
* @property {function(import("../MapEvent.js").default)} [render] Function called when the control
|
||||||
* should be re-rendered. This is called in a `requestAnimationFrame` callback.
|
* should be re-rendered. This is called in a `requestAnimationFrame` callback.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ const Direction = {
|
|||||||
class ZoomSlider extends Control {
|
class ZoomSlider extends Control {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/control/ZoomSlider~Options=} opt_options Zoom slider options.
|
* @param {Options=} opt_options Zoom slider options.
|
||||||
*/
|
*/
|
||||||
constructor(opt_options) {
|
constructor(opt_options) {
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ class ZoomSlider extends Control {
|
|||||||
/**
|
/**
|
||||||
* The calculated thumb size (border box plus margins). Set when initSlider_
|
* The calculated thumb size (border box plus margins). Set when initSlider_
|
||||||
* is called.
|
* is called.
|
||||||
* @type {module:ol/size~Size}
|
* @type {import("../size.js").Size}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.thumbSize_ = null;
|
this.thumbSize_ = null;
|
||||||
@@ -133,7 +133,7 @@ class ZoomSlider extends Control {
|
|||||||
containerElement.className = className + ' ' + CLASS_UNSELECTABLE + ' ' + CLASS_CONTROL;
|
containerElement.className = className + ' ' + CLASS_UNSELECTABLE + ' ' + CLASS_CONTROL;
|
||||||
containerElement.appendChild(thumbElement);
|
containerElement.appendChild(thumbElement);
|
||||||
/**
|
/**
|
||||||
* @type {module:ol/pointer/PointerEventHandler}
|
* @type {import("../pointer/PointerEventHandler.js").default}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.dragger_ = new PointerEventHandler(containerElement);
|
this.dragger_ = new PointerEventHandler(containerElement);
|
||||||
@@ -222,7 +222,7 @@ class ZoomSlider extends Control {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle dragger start events.
|
* Handle dragger start events.
|
||||||
* @param {module:ol/pointer/PointerEvent} event The drag event.
|
* @param {import("../pointer/PointerEvent.js").default} event The drag event.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
handleDraggerStart_(event) {
|
handleDraggerStart_(event) {
|
||||||
@@ -237,7 +237,7 @@ class ZoomSlider extends Control {
|
|||||||
/**
|
/**
|
||||||
* Handle dragger drag events.
|
* Handle dragger drag events.
|
||||||
*
|
*
|
||||||
* @param {module:ol/pointer/PointerEvent|Event} event The drag event.
|
* @param {import("../pointer/PointerEvent.js").default|Event} event The drag event.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
handleDraggerDrag_(event) {
|
handleDraggerDrag_(event) {
|
||||||
@@ -256,7 +256,7 @@ class ZoomSlider extends Control {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle dragger end events.
|
* Handle dragger end events.
|
||||||
* @param {module:ol/pointer/PointerEvent|Event} event The drag event.
|
* @param {import("../pointer/PointerEvent.js").default|Event} event The drag event.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
handleDraggerEnd_(event) {
|
handleDraggerEnd_(event) {
|
||||||
@@ -344,8 +344,8 @@ class ZoomSlider extends Control {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the zoomslider element.
|
* Update the zoomslider element.
|
||||||
* @param {module:ol/MapEvent} mapEvent Map event.
|
* @param {import("../MapEvent.js").default} mapEvent Map event.
|
||||||
* @this {module:ol/control/ZoomSlider}
|
* @this {import("./ZoomSlider.js").default}
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function render(mapEvent) {
|
export function render(mapEvent) {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import {CLASS_CONTROL, CLASS_UNSELECTABLE} from '../css.js';
|
|||||||
* @property {string|HTMLElement} [label='E'] Text label to use for the button.
|
* @property {string|HTMLElement} [label='E'] Text label to use for the button.
|
||||||
* Instead of text, also an element (e.g. a `span` element) can be used.
|
* Instead of text, also an element (e.g. a `span` element) can be used.
|
||||||
* @property {string} [tipLabel='Fit to extent'] Text label to use for the button tip.
|
* @property {string} [tipLabel='Fit to extent'] Text label to use for the button tip.
|
||||||
* @property {module:ol/extent~Extent} [extent] The extent to zoom to. If undefined the validity
|
* @property {import("../extent.js").Extent} [extent] The extent to zoom to. If undefined the validity
|
||||||
* extent of the view projection is used.
|
* extent of the view projection is used.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@ import {CLASS_CONTROL, CLASS_UNSELECTABLE} from '../css.js';
|
|||||||
class ZoomToExtent extends Control {
|
class ZoomToExtent extends Control {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/control/ZoomToExtent~Options=} opt_options Options.
|
* @param {Options=} opt_options Options.
|
||||||
*/
|
*/
|
||||||
constructor(opt_options) {
|
constructor(opt_options) {
|
||||||
const options = opt_options ? opt_options : {};
|
const options = opt_options ? opt_options : {};
|
||||||
@@ -41,7 +41,7 @@ class ZoomToExtent extends Control {
|
|||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {module:ol/extent~Extent}
|
* @type {import("../extent.js").Extent}
|
||||||
* @protected
|
* @protected
|
||||||
*/
|
*/
|
||||||
this.extent = options.extent ? options.extent : null;
|
this.extent = options.extent ? options.extent : null;
|
||||||
|
|||||||
@@ -11,14 +11,14 @@ import Zoom from './Zoom.js';
|
|||||||
* @typedef {Object} DefaultsOptions
|
* @typedef {Object} DefaultsOptions
|
||||||
* @property {boolean} [attribution=true] Include
|
* @property {boolean} [attribution=true] Include
|
||||||
* {@link module:ol/control/Attribution~Attribution}.
|
* {@link module:ol/control/Attribution~Attribution}.
|
||||||
* @property {module:ol/control/Attribution~Options} [attributionOptions]
|
* @property {import("./Attribution.js").Options} [attributionOptions]
|
||||||
* Options for {@link module:ol/control/Attribution~Attribution}.
|
* Options for {@link module:ol/control/Attribution~Attribution}.
|
||||||
* @property {boolean} [rotate=true] Include
|
* @property {boolean} [rotate=true] Include
|
||||||
* {@link module:ol/control/Rotate~Rotate}.
|
* {@link module:ol/control/Rotate~Rotate}.
|
||||||
* @property {module:ol/control/Rotate~Options} [rotateOptions] Options
|
* @property {import("./Rotate.js").Options} [rotateOptions] Options
|
||||||
* for {@link module:ol/control/Rotate~Rotate}.
|
* for {@link module:ol/control/Rotate~Rotate}.
|
||||||
* @property {boolean} [zoom] Include {@link module:ol/control/Zoom~Zoom}.
|
* @property {boolean} [zoom] Include {@link module:ol/control/Zoom~Zoom}.
|
||||||
* @property {module:ol/control/Zoom~Options} [zoomOptions] Options for
|
* @property {import("./Zoom.js").Options} [zoomOptions] Options for
|
||||||
* {@link module:ol/control/Zoom~Zoom}.
|
* {@link module:ol/control/Zoom~Zoom}.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -32,9 +32,9 @@ import Zoom from './Zoom.js';
|
|||||||
* * {@link module:ol/control/Rotate~Rotate}
|
* * {@link module:ol/control/Rotate~Rotate}
|
||||||
* * {@link module:ol/control/Attribution~Attribution}
|
* * {@link module:ol/control/Attribution~Attribution}
|
||||||
*
|
*
|
||||||
* @param {module:ol/control/util~DefaultsOptions=} opt_options
|
* @param {DefaultsOptions=} opt_options
|
||||||
* Defaults options.
|
* Defaults options.
|
||||||
* @return {module:ol/Collection<module:ol/control/Control>}
|
* @return {import("../Collection.js").default<import("./Control.js").default>}
|
||||||
* Controls.
|
* Controls.
|
||||||
* @function module:ol/control.defaults
|
* @function module:ol/control.defaults
|
||||||
* @api
|
* @api
|
||||||
|
|||||||
+28
-28
@@ -16,7 +16,7 @@ import {padNumber} from './string.js';
|
|||||||
* A function that takes a {@link module:ol/coordinate~Coordinate} and
|
* A function that takes a {@link module:ol/coordinate~Coordinate} and
|
||||||
* transforms it into a `{string}`.
|
* transforms it into a `{string}`.
|
||||||
*
|
*
|
||||||
* @typedef {function((module:ol/coordinate~Coordinate|undefined)): string} CoordinateFormat
|
* @typedef {function((Coordinate|undefined)): string} CoordinateFormat
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -33,9 +33,9 @@ import {padNumber} from './string.js';
|
|||||||
* add(coord, [-2, 4]);
|
* add(coord, [-2, 4]);
|
||||||
* // coord is now [5.85, 51.983333]
|
* // coord is now [5.85, 51.983333]
|
||||||
*
|
*
|
||||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
* @param {Coordinate} coordinate Coordinate.
|
||||||
* @param {module:ol/coordinate~Coordinate} delta Delta.
|
* @param {Coordinate} delta Delta.
|
||||||
* @return {module:ol/coordinate~Coordinate} The input coordinate adjusted by
|
* @return {Coordinate} The input coordinate adjusted by
|
||||||
* the given delta.
|
* the given delta.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -49,9 +49,9 @@ export function add(coordinate, delta) {
|
|||||||
/**
|
/**
|
||||||
* Calculates the point closest to the passed coordinate on the passed circle.
|
* Calculates the point closest to the passed coordinate on the passed circle.
|
||||||
*
|
*
|
||||||
* @param {module:ol/coordinate~Coordinate} coordinate The coordinate.
|
* @param {Coordinate} coordinate The coordinate.
|
||||||
* @param {module:ol/geom/Circle} circle The circle.
|
* @param {import("./geom/Circle.js").default} circle The circle.
|
||||||
* @return {module:ol/coordinate~Coordinate} Closest point on the circumference.
|
* @return {Coordinate} Closest point on the circumference.
|
||||||
*/
|
*/
|
||||||
export function closestOnCircle(coordinate, circle) {
|
export function closestOnCircle(coordinate, circle) {
|
||||||
const r = circle.getRadius();
|
const r = circle.getRadius();
|
||||||
@@ -81,10 +81,10 @@ export function closestOnCircle(coordinate, circle) {
|
|||||||
* the foot is on the segment, or the closest segment coordinate when the foot
|
* the foot is on the segment, or the closest segment coordinate when the foot
|
||||||
* is outside the segment.
|
* is outside the segment.
|
||||||
*
|
*
|
||||||
* @param {module:ol/coordinate~Coordinate} coordinate The coordinate.
|
* @param {Coordinate} coordinate The coordinate.
|
||||||
* @param {Array<module:ol/coordinate~Coordinate>} segment The two coordinates
|
* @param {Array<Coordinate>} segment The two coordinates
|
||||||
* of the segment.
|
* of the segment.
|
||||||
* @return {module:ol/coordinate~Coordinate} The foot of the perpendicular of
|
* @return {Coordinate} The foot of the perpendicular of
|
||||||
* the coordinate to the segment.
|
* the coordinate to the segment.
|
||||||
*/
|
*/
|
||||||
export function closestOnSegment(coordinate, segment) {
|
export function closestOnSegment(coordinate, segment) {
|
||||||
@@ -118,7 +118,7 @@ export function closestOnSegment(coordinate, segment) {
|
|||||||
/**
|
/**
|
||||||
* Returns a {@link module:ol/coordinate~CoordinateFormat} function that can be
|
* Returns a {@link module:ol/coordinate~CoordinateFormat} function that can be
|
||||||
* used to format
|
* used to format
|
||||||
* a {module:ol/coordinate~Coordinate} to a string.
|
* a {Coordinate} to a string.
|
||||||
*
|
*
|
||||||
* Example without specifying the fractional digits:
|
* Example without specifying the fractional digits:
|
||||||
*
|
*
|
||||||
@@ -140,13 +140,13 @@ export function closestOnSegment(coordinate, segment) {
|
|||||||
*
|
*
|
||||||
* @param {number=} opt_fractionDigits The number of digits to include
|
* @param {number=} opt_fractionDigits The number of digits to include
|
||||||
* after the decimal point. Default is `0`.
|
* after the decimal point. Default is `0`.
|
||||||
* @return {module:ol/coordinate~CoordinateFormat} Coordinate format.
|
* @return {CoordinateFormat} Coordinate format.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function createStringXY(opt_fractionDigits) {
|
export function createStringXY(opt_fractionDigits) {
|
||||||
return (
|
return (
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
* @param {Coordinate} coordinate Coordinate.
|
||||||
* @return {string} String XY.
|
* @return {string} String XY.
|
||||||
*/
|
*/
|
||||||
function(coordinate) {
|
function(coordinate) {
|
||||||
@@ -213,7 +213,7 @@ export function degreesToStringHDMS(hemispheres, degrees, opt_fractionDigits) {
|
|||||||
* var out = format(coord, template, 2);
|
* var out = format(coord, template, 2);
|
||||||
* // out is now 'Coordinate is (7.85|47.98).'
|
* // out is now 'Coordinate is (7.85|47.98).'
|
||||||
*
|
*
|
||||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
* @param {Coordinate} coordinate Coordinate.
|
||||||
* @param {string} template A template string with `{x}` and `{y}` placeholders
|
* @param {string} template A template string with `{x}` and `{y}` placeholders
|
||||||
* that will be replaced by first and second coordinate values.
|
* that will be replaced by first and second coordinate values.
|
||||||
* @param {number=} opt_fractionDigits The number of digits to include
|
* @param {number=} opt_fractionDigits The number of digits to include
|
||||||
@@ -233,8 +233,8 @@ export function format(coordinate, template, opt_fractionDigits) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/coordinate~Coordinate} coordinate1 First coordinate.
|
* @param {Coordinate} coordinate1 First coordinate.
|
||||||
* @param {module:ol/coordinate~Coordinate} coordinate2 Second coordinate.
|
* @param {Coordinate} coordinate2 Second coordinate.
|
||||||
* @return {boolean} The two coordinates are equal.
|
* @return {boolean} The two coordinates are equal.
|
||||||
*/
|
*/
|
||||||
export function equals(coordinate1, coordinate2) {
|
export function equals(coordinate1, coordinate2) {
|
||||||
@@ -262,9 +262,9 @@ export function equals(coordinate1, coordinate2) {
|
|||||||
* rotate(coord, rotateRadians);
|
* rotate(coord, rotateRadians);
|
||||||
* // coord is now [-47.983333, 7.85]
|
* // coord is now [-47.983333, 7.85]
|
||||||
*
|
*
|
||||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
* @param {Coordinate} coordinate Coordinate.
|
||||||
* @param {number} angle Angle in radian.
|
* @param {number} angle Angle in radian.
|
||||||
* @return {module:ol/coordinate~Coordinate} Coordinate.
|
* @return {Coordinate} Coordinate.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function rotate(coordinate, angle) {
|
export function rotate(coordinate, angle) {
|
||||||
@@ -291,9 +291,9 @@ export function rotate(coordinate, angle) {
|
|||||||
* scaleCoordinate(coord, scale);
|
* scaleCoordinate(coord, scale);
|
||||||
* // coord is now [9.42, 57.5799996]
|
* // coord is now [9.42, 57.5799996]
|
||||||
*
|
*
|
||||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
* @param {Coordinate} coordinate Coordinate.
|
||||||
* @param {number} scale Scale factor.
|
* @param {number} scale Scale factor.
|
||||||
* @return {module:ol/coordinate~Coordinate} Coordinate.
|
* @return {Coordinate} Coordinate.
|
||||||
*/
|
*/
|
||||||
export function scale(coordinate, scale) {
|
export function scale(coordinate, scale) {
|
||||||
coordinate[0] *= scale;
|
coordinate[0] *= scale;
|
||||||
@@ -303,8 +303,8 @@ export function scale(coordinate, scale) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/coordinate~Coordinate} coord1 First coordinate.
|
* @param {Coordinate} coord1 First coordinate.
|
||||||
* @param {module:ol/coordinate~Coordinate} coord2 Second coordinate.
|
* @param {Coordinate} coord2 Second coordinate.
|
||||||
* @return {number} Squared distance between coord1 and coord2.
|
* @return {number} Squared distance between coord1 and coord2.
|
||||||
*/
|
*/
|
||||||
export function squaredDistance(coord1, coord2) {
|
export function squaredDistance(coord1, coord2) {
|
||||||
@@ -315,8 +315,8 @@ export function squaredDistance(coord1, coord2) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/coordinate~Coordinate} coord1 First coordinate.
|
* @param {Coordinate} coord1 First coordinate.
|
||||||
* @param {module:ol/coordinate~Coordinate} coord2 Second coordinate.
|
* @param {Coordinate} coord2 Second coordinate.
|
||||||
* @return {number} Distance between coord1 and coord2.
|
* @return {number} Distance between coord1 and coord2.
|
||||||
*/
|
*/
|
||||||
export function distance(coord1, coord2) {
|
export function distance(coord1, coord2) {
|
||||||
@@ -327,8 +327,8 @@ 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 {Coordinate} coordinate Coordinate of the point.
|
||||||
* @param {Array<module:ol/coordinate~Coordinate>} segment Line segment (2
|
* @param {Array<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.
|
||||||
*/
|
*/
|
||||||
@@ -358,7 +358,7 @@ export function squaredDistanceToSegment(coordinate, segment) {
|
|||||||
* var out = toStringHDMS(coord, 1);
|
* var out = toStringHDMS(coord, 1);
|
||||||
* // out is now '47° 58′ 60.0″ N 7° 50′ 60.0″ E'
|
* // out is now '47° 58′ 60.0″ N 7° 50′ 60.0″ E'
|
||||||
*
|
*
|
||||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
* @param {Coordinate} coordinate Coordinate.
|
||||||
* @param {number=} opt_fractionDigits The number of digits to include
|
* @param {number=} opt_fractionDigits The number of digits to include
|
||||||
* after the decimal point. Default is `0`.
|
* after the decimal point. Default is `0`.
|
||||||
* @return {string} Hemisphere, degrees, minutes and seconds.
|
* @return {string} Hemisphere, degrees, minutes and seconds.
|
||||||
@@ -393,7 +393,7 @@ export function toStringHDMS(coordinate, opt_fractionDigits) {
|
|||||||
* var out = toStringXY(coord, 1);
|
* var out = toStringXY(coord, 1);
|
||||||
* // out is now '7.8, 48.0'
|
* // out is now '7.8, 48.0'
|
||||||
*
|
*
|
||||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
* @param {Coordinate} coordinate Coordinate.
|
||||||
* @param {number=} opt_fractionDigits The number of digits to include
|
* @param {number=} opt_fractionDigits The number of digits to include
|
||||||
* after the decimal point. Default is `0`.
|
* after the decimal point. Default is `0`.
|
||||||
* @return {string} XY.
|
* @return {string} XY.
|
||||||
|
|||||||
+24
-24
@@ -8,11 +8,11 @@ import {clear} from './obj.js';
|
|||||||
* Key to use with {@link module:ol/Observable~Observable#unByKey}.
|
* Key to use with {@link module:ol/Observable~Observable#unByKey}.
|
||||||
* @typedef {Object} EventsKey
|
* @typedef {Object} EventsKey
|
||||||
* @property {Object} [bindTo]
|
* @property {Object} [bindTo]
|
||||||
* @property {module:ol/events~ListenerFunction} [boundListener]
|
* @property {ListenerFunction} [boundListener]
|
||||||
* @property {boolean} callOnce
|
* @property {boolean} callOnce
|
||||||
* @property {number} [deleteIndex]
|
* @property {number} [deleteIndex]
|
||||||
* @property {module:ol/events~ListenerFunction} listener
|
* @property {ListenerFunction} listener
|
||||||
* @property {module:ol/events/Target~EventTargetLike} target
|
* @property {import("./events/Target.js").EventTargetLike} target
|
||||||
* @property {string} type
|
* @property {string} type
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -22,14 +22,14 @@ import {clear} from './obj.js';
|
|||||||
* Listener function. This function is called with an event object as argument.
|
* Listener function. This function is called with an event object as argument.
|
||||||
* When the function returns `false`, event propagation will stop.
|
* When the function returns `false`, event propagation will stop.
|
||||||
*
|
*
|
||||||
* @typedef {function(module:ol/events/Event)|function(module:ol/events/Event): boolean} ListenerFunction
|
* @typedef {function(import("./events/Event.js").default)|function(import("./events/Event.js").default): boolean} ListenerFunction
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/events~EventsKey} listenerObj Listener object.
|
* @param {EventsKey} listenerObj Listener object.
|
||||||
* @return {module:ol/events~ListenerFunction} Bound listener.
|
* @return {ListenerFunction} Bound listener.
|
||||||
*/
|
*/
|
||||||
export function bindListener(listenerObj) {
|
export function bindListener(listenerObj) {
|
||||||
const boundListener = function(evt) {
|
const boundListener = function(evt) {
|
||||||
@@ -49,12 +49,12 @@ export function bindListener(listenerObj) {
|
|||||||
* Finds the matching {@link module:ol/events~EventsKey} in the given listener
|
* Finds the matching {@link module:ol/events~EventsKey} in the given listener
|
||||||
* array.
|
* array.
|
||||||
*
|
*
|
||||||
* @param {!Array<!module:ol/events~EventsKey>} listeners Array of listeners.
|
* @param {!Array<!EventsKey>} listeners Array of listeners.
|
||||||
* @param {!Function} listener The listener function.
|
* @param {!Function} listener The listener function.
|
||||||
* @param {Object=} opt_this The `this` value inside the listener.
|
* @param {Object=} opt_this The `this` value inside the listener.
|
||||||
* @param {boolean=} opt_setDeleteIndex Set the deleteIndex on the matching
|
* @param {boolean=} opt_setDeleteIndex Set the deleteIndex on the matching
|
||||||
* listener, for {@link module:ol/events~unlistenByKey}.
|
* listener, for {@link module:ol/events~unlistenByKey}.
|
||||||
* @return {module:ol/events~EventsKey|undefined} The matching listener object.
|
* @return {EventsKey|undefined} The matching listener object.
|
||||||
*/
|
*/
|
||||||
export function findListener(listeners, listener, opt_this, opt_setDeleteIndex) {
|
export function findListener(listeners, listener, opt_this, opt_setDeleteIndex) {
|
||||||
let listenerObj;
|
let listenerObj;
|
||||||
@@ -73,9 +73,9 @@ export function findListener(listeners, listener, opt_this, opt_setDeleteIndex)
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/events/Target~EventTargetLike} target Target.
|
* @param {import("./events/Target.js").EventTargetLike} target Target.
|
||||||
* @param {string} type Type.
|
* @param {string} type Type.
|
||||||
* @return {Array<module:ol/events~EventsKey>|undefined} Listeners.
|
* @return {Array<EventsKey>|undefined} Listeners.
|
||||||
*/
|
*/
|
||||||
export function getListeners(target, type) {
|
export function getListeners(target, type) {
|
||||||
const listenerMap = target.ol_lm;
|
const listenerMap = target.ol_lm;
|
||||||
@@ -86,8 +86,8 @@ 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/Target~EventTargetLike} target Target.
|
* @param {import("./events/Target.js").EventTargetLike} target Target.
|
||||||
* @return {!Object<string, Array<module:ol/events~EventsKey>>} Map of
|
* @return {!Object<string, Array<EventsKey>>} Map of
|
||||||
* listeners by event type.
|
* listeners by event type.
|
||||||
*/
|
*/
|
||||||
function getListenerMap(target) {
|
function getListenerMap(target) {
|
||||||
@@ -103,7 +103,7 @@ function getListenerMap(target) {
|
|||||||
* Clean up all listener objects of the given type. All properties on the
|
* Clean up all listener objects of the given type. All properties on the
|
||||||
* listener objects will be removed, and if no listeners remain in the listener
|
* listener objects will be removed, and if no listeners remain in the listener
|
||||||
* map, it will be removed from the target.
|
* map, it will be removed from the target.
|
||||||
* @param {module:ol/events/Target~EventTargetLike} target Target.
|
* @param {import("./events/Target.js").EventTargetLike} target Target.
|
||||||
* @param {string} type Type.
|
* @param {string} type Type.
|
||||||
*/
|
*/
|
||||||
function removeListeners(target, type) {
|
function removeListeners(target, type) {
|
||||||
@@ -132,13 +132,13 @@ function removeListeners(target, type) {
|
|||||||
* This function efficiently binds a `listener` to a `this` object, and returns
|
* This function efficiently binds a `listener` to a `this` object, and returns
|
||||||
* a key for use with {@link module:ol/events~unlistenByKey}.
|
* a key for use with {@link module:ol/events~unlistenByKey}.
|
||||||
*
|
*
|
||||||
* @param {module:ol/events/Target~EventTargetLike} target Event target.
|
* @param {import("./events/Target.js").EventTargetLike} target Event target.
|
||||||
* @param {string} type Event type.
|
* @param {string} type Event type.
|
||||||
* @param {module:ol/events~ListenerFunction} listener Listener.
|
* @param {ListenerFunction} listener Listener.
|
||||||
* @param {Object=} opt_this Object referenced by the `this` keyword in the
|
* @param {Object=} opt_this Object referenced by the `this` keyword in the
|
||||||
* listener. Default is the `target`.
|
* listener. Default is the `target`.
|
||||||
* @param {boolean=} opt_once If true, add the listener as one-off listener.
|
* @param {boolean=} opt_once If true, add the listener as one-off listener.
|
||||||
* @return {module:ol/events~EventsKey} Unique key for the listener.
|
* @return {EventsKey} Unique key for the listener.
|
||||||
*/
|
*/
|
||||||
export function listen(target, type, listener, opt_this, opt_once) {
|
export function listen(target, type, listener, opt_this, opt_once) {
|
||||||
const listenerMap = getListenerMap(target);
|
const listenerMap = getListenerMap(target);
|
||||||
@@ -153,7 +153,7 @@ export function listen(target, type, listener, opt_this, opt_once) {
|
|||||||
listenerObj.callOnce = false;
|
listenerObj.callOnce = false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
listenerObj = /** @type {module:ol/events~EventsKey} */ ({
|
listenerObj = /** @type {EventsKey} */ ({
|
||||||
bindTo: opt_this,
|
bindTo: opt_this,
|
||||||
callOnce: !!opt_once,
|
callOnce: !!opt_once,
|
||||||
listener: listener,
|
listener: listener,
|
||||||
@@ -181,12 +181,12 @@ export function listen(target, type, listener, opt_this, opt_once) {
|
|||||||
* function, the self-unregistering listener will be turned into a permanent
|
* function, the self-unregistering listener will be turned into a permanent
|
||||||
* listener.
|
* listener.
|
||||||
*
|
*
|
||||||
* @param {module:ol/events/Target~EventTargetLike} target Event target.
|
* @param {import("./events/Target.js").EventTargetLike} target Event target.
|
||||||
* @param {string} type Event type.
|
* @param {string} type Event type.
|
||||||
* @param {module:ol/events~ListenerFunction} listener Listener.
|
* @param {ListenerFunction} listener Listener.
|
||||||
* @param {Object=} opt_this Object referenced by the `this` keyword in the
|
* @param {Object=} opt_this Object referenced by the `this` keyword in the
|
||||||
* listener. Default is the `target`.
|
* listener. Default is the `target`.
|
||||||
* @return {module:ol/events~EventsKey} Key for unlistenByKey.
|
* @return {EventsKey} Key for unlistenByKey.
|
||||||
*/
|
*/
|
||||||
export function listenOnce(target, type, listener, opt_this) {
|
export function listenOnce(target, type, listener, opt_this) {
|
||||||
return listen(target, type, listener, opt_this, true);
|
return listen(target, type, listener, opt_this, true);
|
||||||
@@ -200,9 +200,9 @@ export function listenOnce(target, type, listener, opt_this) {
|
|||||||
* To return a listener, this function needs to be called with the exact same
|
* To return a listener, this function needs to be called with the exact same
|
||||||
* arguments that were used for a previous {@link module:ol/events~listen} call.
|
* arguments that were used for a previous {@link module:ol/events~listen} call.
|
||||||
*
|
*
|
||||||
* @param {module:ol/events/Target~EventTargetLike} target Event target.
|
* @param {import("./events/Target.js").EventTargetLike} target Event target.
|
||||||
* @param {string} type Event type.
|
* @param {string} type Event type.
|
||||||
* @param {module:ol/events~ListenerFunction} listener Listener.
|
* @param {ListenerFunction} listener Listener.
|
||||||
* @param {Object=} opt_this Object referenced by the `this` keyword in the
|
* @param {Object=} opt_this Object referenced by the `this` keyword in the
|
||||||
* listener. Default is the `target`.
|
* listener. Default is the `target`.
|
||||||
*/
|
*/
|
||||||
@@ -224,7 +224,7 @@ export function unlisten(target, type, listener, opt_this) {
|
|||||||
* The argument passed to this function is the key returned from
|
* The argument passed to this function is the key returned from
|
||||||
* {@link module:ol/events~listen} or {@link module:ol/events~listenOnce}.
|
* {@link module:ol/events~listen} or {@link module:ol/events~listenOnce}.
|
||||||
*
|
*
|
||||||
* @param {module:ol/events~EventsKey} key The key.
|
* @param {EventsKey} key The key.
|
||||||
*/
|
*/
|
||||||
export function unlistenByKey(key) {
|
export function unlistenByKey(key) {
|
||||||
if (key && key.target) {
|
if (key && key.target) {
|
||||||
@@ -248,7 +248,7 @@ export function unlistenByKey(key) {
|
|||||||
* Unregisters all event listeners on an event target. Inspired by
|
* Unregisters all event listeners on an event target. Inspired by
|
||||||
* https://google.github.io/closure-library/api/source/closure/goog/events/events.js.src.html
|
* https://google.github.io/closure-library/api/source/closure/goog/events/events.js.src.html
|
||||||
*
|
*
|
||||||
* @param {module:ol/events/Target~EventTargetLike} target Target.
|
* @param {import("./events/Target.js").EventTargetLike} target Target.
|
||||||
*/
|
*/
|
||||||
export function unlistenAll(target) {
|
export function unlistenAll(target) {
|
||||||
const listenerMap = getListenerMap(target);
|
const listenerMap = getListenerMap(target);
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ class Event {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Event|module:ol/events/Event} evt Event
|
* @param {Event|import("./Event.js").default} evt Event
|
||||||
*/
|
*/
|
||||||
export function stopPropagation(evt) {
|
export function stopPropagation(evt) {
|
||||||
evt.stopPropagation();
|
evt.stopPropagation();
|
||||||
@@ -69,7 +69,7 @@ export function stopPropagation(evt) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Event|module:ol/events/Event} evt Event
|
* @param {Event|import("./Event.js").default} evt Event
|
||||||
*/
|
*/
|
||||||
export function preventDefault(evt) {
|
export function preventDefault(evt) {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import Event from '../events/Event.js';
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {EventTarget|module:ol/events/Target} EventTargetLike
|
* @typedef {EventTarget|import("./Target.js").default} EventTargetLike
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ class Target extends Disposable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {!Object<string, Array<module:ol/events~ListenerFunction>>}
|
* @type {!Object<string, Array<import("../events.js").ListenerFunction>>}
|
||||||
*/
|
*/
|
||||||
this.listeners_ = {};
|
this.listeners_ = {};
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ class Target extends Disposable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} type Type.
|
* @param {string} type Type.
|
||||||
* @param {module:ol/events~ListenerFunction} listener Listener.
|
* @param {import("../events.js").ListenerFunction} listener Listener.
|
||||||
*/
|
*/
|
||||||
addEventListener(type, listener) {
|
addEventListener(type, listener) {
|
||||||
let listeners = this.listeners_[type];
|
let listeners = this.listeners_[type];
|
||||||
@@ -72,8 +72,8 @@ class Target extends Disposable {
|
|||||||
* Object with a `type` property.
|
* Object with a `type` property.
|
||||||
*
|
*
|
||||||
* @param {{type: string,
|
* @param {{type: string,
|
||||||
* target: (module:ol/events/Target~EventTargetLike|undefined)}|
|
* target: (EventTargetLike|undefined)}|
|
||||||
* module:ol/events/Event|string} event Event object.
|
* import("./Event.js").default|string} event Event object.
|
||||||
* @return {boolean|undefined} `false` if anyone called preventDefault on the
|
* @return {boolean|undefined} `false` if anyone called preventDefault on the
|
||||||
* event object or if any of the listeners returned false.
|
* event object or if any of the listeners returned false.
|
||||||
* @function
|
* @function
|
||||||
@@ -122,7 +122,7 @@ class Target 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<import("../events.js").ListenerFunction>} Listeners.
|
||||||
*/
|
*/
|
||||||
getListeners(type) {
|
getListeners(type) {
|
||||||
return this.listeners_[type];
|
return this.listeners_[type];
|
||||||
@@ -141,7 +141,7 @@ class Target extends Disposable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} type Type.
|
* @param {string} type Type.
|
||||||
* @param {module:ol/events~ListenerFunction} listener Listener.
|
* @param {import("../events.js").ListenerFunction} listener Listener.
|
||||||
*/
|
*/
|
||||||
removeEventListener(type, listener) {
|
removeEventListener(type, listener) {
|
||||||
const listeners = this.listeners_[type];
|
const listeners = this.listeners_[type];
|
||||||
|
|||||||
+18
-18
@@ -11,7 +11,7 @@ import {WEBKIT, MAC} from '../has.js';
|
|||||||
* A function that takes an {@link module:ol/MapBrowserEvent} and returns a
|
* A function that takes an {@link module:ol/MapBrowserEvent} and returns a
|
||||||
* `{boolean}`. If the condition is met, true should be returned.
|
* `{boolean}`. If the condition is met, true should be returned.
|
||||||
*
|
*
|
||||||
* @typedef {function(this: ?, module:ol/MapBrowserEvent): boolean} Condition
|
* @typedef {function(this: ?, import("../MapBrowserEvent.js").default): boolean} Condition
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -19,7 +19,7 @@ import {WEBKIT, MAC} from '../has.js';
|
|||||||
* Return `true` if only the alt-key is pressed, `false` otherwise (e.g. when
|
* Return `true` if only the alt-key is pressed, `false` otherwise (e.g. when
|
||||||
* additionally the shift-key is pressed).
|
* additionally the shift-key is pressed).
|
||||||
*
|
*
|
||||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event.
|
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||||
* @return {boolean} True if only the alt key is pressed.
|
* @return {boolean} True if only the alt key is pressed.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -36,7 +36,7 @@ export const altKeyOnly = function(mapBrowserEvent) {
|
|||||||
* Return `true` if only the alt-key and shift-key is pressed, `false` otherwise
|
* Return `true` if only the alt-key and shift-key is pressed, `false` otherwise
|
||||||
* (e.g. when additionally the platform-modifier-key is pressed).
|
* (e.g. when additionally the platform-modifier-key is pressed).
|
||||||
*
|
*
|
||||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event.
|
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||||
* @return {boolean} True if only the alt and shift keys are pressed.
|
* @return {boolean} True if only the alt and shift keys are pressed.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -53,7 +53,7 @@ export const altShiftKeysOnly = function(mapBrowserEvent) {
|
|||||||
* Return `true` if the map has the focus. This condition requires a map target
|
* Return `true` if the map has the focus. This condition requires a map target
|
||||||
* element with a `tabindex` attribute, e.g. `<div id="map" tabindex="1">`.
|
* element with a `tabindex` attribute, e.g. `<div id="map" tabindex="1">`.
|
||||||
*
|
*
|
||||||
* @param {module:ol/MapBrowserEvent} event Map browser event.
|
* @param {import("../MapBrowserEvent.js").default} event Map browser event.
|
||||||
* @return {boolean} The map has the focus.
|
* @return {boolean} The map has the focus.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -65,7 +65,7 @@ export const focus = function(event) {
|
|||||||
/**
|
/**
|
||||||
* Return always true.
|
* Return always true.
|
||||||
*
|
*
|
||||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event.
|
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||||
* @return {boolean} True.
|
* @return {boolean} True.
|
||||||
* @function
|
* @function
|
||||||
* @api
|
* @api
|
||||||
@@ -76,7 +76,7 @@ export const always = TRUE;
|
|||||||
/**
|
/**
|
||||||
* Return `true` if the event is a `click` event, `false` otherwise.
|
* Return `true` if the event is a `click` event, `false` otherwise.
|
||||||
*
|
*
|
||||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event.
|
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||||
* @return {boolean} True if the event is a map `click` event.
|
* @return {boolean} True if the event is a map `click` event.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -91,7 +91,7 @@ export const click = function(mapBrowserEvent) {
|
|||||||
* By definition, this includes left-click on windows/linux, and left-click
|
* By definition, this includes left-click on windows/linux, and left-click
|
||||||
* without the ctrl key on Macs.
|
* without the ctrl key on Macs.
|
||||||
*
|
*
|
||||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event.
|
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||||
* @return {boolean} The result.
|
* @return {boolean} The result.
|
||||||
*/
|
*/
|
||||||
export const mouseActionButton = function(mapBrowserEvent) {
|
export const mouseActionButton = function(mapBrowserEvent) {
|
||||||
@@ -104,7 +104,7 @@ export const mouseActionButton = function(mapBrowserEvent) {
|
|||||||
/**
|
/**
|
||||||
* Return always false.
|
* Return always false.
|
||||||
*
|
*
|
||||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event.
|
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||||
* @return {boolean} False.
|
* @return {boolean} False.
|
||||||
* @function
|
* @function
|
||||||
* @api
|
* @api
|
||||||
@@ -116,7 +116,7 @@ export const never = FALSE;
|
|||||||
* Return `true` if the browser event is a `pointermove` event, `false`
|
* Return `true` if the browser event is a `pointermove` event, `false`
|
||||||
* otherwise.
|
* otherwise.
|
||||||
*
|
*
|
||||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event.
|
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||||
* @return {boolean} True if the browser event is a `pointermove` event.
|
* @return {boolean} True if the browser event is a `pointermove` event.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -128,7 +128,7 @@ export const pointerMove = function(mapBrowserEvent) {
|
|||||||
/**
|
/**
|
||||||
* Return `true` if the event is a map `singleclick` event, `false` otherwise.
|
* Return `true` if the event is a map `singleclick` event, `false` otherwise.
|
||||||
*
|
*
|
||||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event.
|
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||||
* @return {boolean} True if the event is a map `singleclick` event.
|
* @return {boolean} True if the event is a map `singleclick` event.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -140,7 +140,7 @@ export const singleClick = function(mapBrowserEvent) {
|
|||||||
/**
|
/**
|
||||||
* Return `true` if the event is a map `dblclick` event, `false` otherwise.
|
* Return `true` if the event is a map `dblclick` event, `false` otherwise.
|
||||||
*
|
*
|
||||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event.
|
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||||
* @return {boolean} True if the event is a map `dblclick` event.
|
* @return {boolean} True if the event is a map `dblclick` event.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -153,7 +153,7 @@ export const doubleClick = function(mapBrowserEvent) {
|
|||||||
* Return `true` if no modifier key (alt-, shift- or platform-modifier-key) is
|
* Return `true` if no modifier key (alt-, shift- or platform-modifier-key) is
|
||||||
* pressed.
|
* pressed.
|
||||||
*
|
*
|
||||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event.
|
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||||
* @return {boolean} True only if there no modifier keys are pressed.
|
* @return {boolean} True only if there no modifier keys are pressed.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -171,7 +171,7 @@ export const noModifierKeys = function(mapBrowserEvent) {
|
|||||||
* ctrl-key otherwise) is pressed, `false` otherwise (e.g. when additionally
|
* ctrl-key otherwise) is pressed, `false` otherwise (e.g. when additionally
|
||||||
* the shift-key is pressed).
|
* the shift-key is pressed).
|
||||||
*
|
*
|
||||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event.
|
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||||
* @return {boolean} True if only the platform modifier key is pressed.
|
* @return {boolean} True if only the platform modifier key is pressed.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -187,7 +187,7 @@ export const platformModifierKeyOnly = function(mapBrowserEvent) {
|
|||||||
* Return `true` if only the shift-key is pressed, `false` otherwise (e.g. when
|
* Return `true` if only the shift-key is pressed, `false` otherwise (e.g. when
|
||||||
* additionally the alt-key is pressed).
|
* additionally the alt-key is pressed).
|
||||||
*
|
*
|
||||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event.
|
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||||
* @return {boolean} True if only the shift key is pressed.
|
* @return {boolean} True if only the shift key is pressed.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -204,7 +204,7 @@ export const shiftKeyOnly = function(mapBrowserEvent) {
|
|||||||
* Return `true` if the target element is not editable, i.e. not a `<input>`-,
|
* Return `true` if the target element is not editable, i.e. not a `<input>`-,
|
||||||
* `<select>`- or `<textarea>`-element, `false` otherwise.
|
* `<select>`- or `<textarea>`-element, `false` otherwise.
|
||||||
*
|
*
|
||||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event.
|
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||||
* @return {boolean} True only if the target element is not editable.
|
* @return {boolean} True only if the target element is not editable.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -221,7 +221,7 @@ export const targetNotEditable = function(mapBrowserEvent) {
|
|||||||
/**
|
/**
|
||||||
* Return `true` if the event originates from a mouse device.
|
* Return `true` if the event originates from a mouse device.
|
||||||
*
|
*
|
||||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event.
|
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||||
* @return {boolean} True if the event originates from a mouse device.
|
* @return {boolean} True if the event originates from a mouse device.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -229,7 +229,7 @@ export const mouseOnly = function(mapBrowserEvent) {
|
|||||||
assert(mapBrowserEvent.pointerEvent, 56); // mapBrowserEvent must originate from a pointer event
|
assert(mapBrowserEvent.pointerEvent, 56); // mapBrowserEvent must originate from a pointer event
|
||||||
// see http://www.w3.org/TR/pointerevents/#widl-PointerEvent-pointerType
|
// see http://www.w3.org/TR/pointerevents/#widl-PointerEvent-pointerType
|
||||||
return (
|
return (
|
||||||
/** @type {module:ol/MapBrowserEvent} */ (mapBrowserEvent).pointerEvent.pointerType == 'mouse'
|
/** @type {import("../MapBrowserEvent.js").default} */ (mapBrowserEvent).pointerEvent.pointerType == 'mouse'
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -239,7 +239,7 @@ export const mouseOnly = function(mapBrowserEvent) {
|
|||||||
* contact with the surface or if the left mouse button is pressed.
|
* contact with the surface or if the left mouse button is pressed.
|
||||||
* See http://www.w3.org/TR/pointerevents/#button-states.
|
* See http://www.w3.org/TR/pointerevents/#button-states.
|
||||||
*
|
*
|
||||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event.
|
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||||
* @return {boolean} True if the event originates from a primary pointer.
|
* @return {boolean} True if the event originates from a primary pointer.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
|
|||||||
+100
-100
@@ -15,8 +15,8 @@ import Relationship from './extent/Relationship.js';
|
|||||||
/**
|
/**
|
||||||
* 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<import("./coordinate.js").Coordinate>} coordinates Coordinates.
|
||||||
* @return {module:ol/extent~Extent} Bounding extent.
|
* @return {Extent} Bounding extent.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function boundingExtent(coordinates) {
|
export function boundingExtent(coordinates) {
|
||||||
@@ -31,9 +31,9 @@ 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 {Extent=} opt_extent Destination extent.
|
||||||
* @private
|
* @private
|
||||||
* @return {module:ol/extent~Extent} Extent.
|
* @return {Extent} Extent.
|
||||||
*/
|
*/
|
||||||
function _boundingExtentXYs(xs, ys, opt_extent) {
|
function _boundingExtentXYs(xs, ys, opt_extent) {
|
||||||
const minX = Math.min.apply(null, xs);
|
const minX = Math.min.apply(null, xs);
|
||||||
@@ -46,10 +46,10 @@ function _boundingExtentXYs(xs, ys, opt_extent) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return extent increased by the provided value.
|
* Return extent increased by the provided value.
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {Extent} extent Extent.
|
||||||
* @param {number} value The amount by which the extent should be buffered.
|
* @param {number} value The amount by which the extent should be buffered.
|
||||||
* @param {module:ol/extent~Extent=} opt_extent Extent.
|
* @param {Extent=} opt_extent Extent.
|
||||||
* @return {module:ol/extent~Extent} Extent.
|
* @return {Extent} Extent.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function buffer(extent, value, opt_extent) {
|
export function buffer(extent, value, opt_extent) {
|
||||||
@@ -73,9 +73,9 @@ export function buffer(extent, value, opt_extent) {
|
|||||||
/**
|
/**
|
||||||
* Creates a clone of an extent.
|
* Creates a clone of an extent.
|
||||||
*
|
*
|
||||||
* @param {module:ol/extent~Extent} extent Extent to clone.
|
* @param {Extent} extent Extent to clone.
|
||||||
* @param {module:ol/extent~Extent=} opt_extent Extent.
|
* @param {Extent=} opt_extent Extent.
|
||||||
* @return {module:ol/extent~Extent} The clone.
|
* @return {Extent} The clone.
|
||||||
*/
|
*/
|
||||||
export function clone(extent, opt_extent) {
|
export function clone(extent, opt_extent) {
|
||||||
if (opt_extent) {
|
if (opt_extent) {
|
||||||
@@ -91,7 +91,7 @@ export function clone(extent, opt_extent) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {Extent} extent Extent.
|
||||||
* @param {number} x X.
|
* @param {number} x X.
|
||||||
* @param {number} y Y.
|
* @param {number} y Y.
|
||||||
* @return {number} Closest squared distance.
|
* @return {number} Closest squared distance.
|
||||||
@@ -119,8 +119,8 @@ export function closestSquaredDistanceXY(extent, x, y) {
|
|||||||
/**
|
/**
|
||||||
* Check if the passed coordinate is contained or on the edge of the extent.
|
* Check if the passed coordinate is contained or on the edge of the extent.
|
||||||
*
|
*
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {Extent} extent Extent.
|
||||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
* @param {import("./coordinate.js").Coordinate} coordinate Coordinate.
|
||||||
* @return {boolean} The coordinate is contained in the extent.
|
* @return {boolean} The coordinate is contained in the extent.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -135,8 +135,8 @@ export function containsCoordinate(extent, coordinate) {
|
|||||||
* An extent is deemed contained if it lies completely within the other extent,
|
* An extent is deemed contained if it lies completely within the other extent,
|
||||||
* including if they share one or more edges.
|
* including if they share one or more edges.
|
||||||
*
|
*
|
||||||
* @param {module:ol/extent~Extent} extent1 Extent 1.
|
* @param {Extent} extent1 Extent 1.
|
||||||
* @param {module:ol/extent~Extent} extent2 Extent 2.
|
* @param {Extent} extent2 Extent 2.
|
||||||
* @return {boolean} The second extent is contained by or on the edge of the
|
* @return {boolean} The second extent is contained by or on the edge of the
|
||||||
* first.
|
* first.
|
||||||
* @api
|
* @api
|
||||||
@@ -150,7 +150,7 @@ export function containsExtent(extent1, extent2) {
|
|||||||
/**
|
/**
|
||||||
* Check if the passed coordinate is contained or on the edge of the extent.
|
* Check if the passed coordinate is contained or on the edge of the extent.
|
||||||
*
|
*
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {Extent} extent Extent.
|
||||||
* @param {number} x X coordinate.
|
* @param {number} x X coordinate.
|
||||||
* @param {number} y Y coordinate.
|
* @param {number} y Y coordinate.
|
||||||
* @return {boolean} The x, y values are contained in the extent.
|
* @return {boolean} The x, y values are contained in the extent.
|
||||||
@@ -163,10 +163,10 @@ export function containsXY(extent, x, y) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the relationship between a coordinate and extent.
|
* Get the relationship between a coordinate and extent.
|
||||||
* @param {module:ol/extent~Extent} extent The extent.
|
* @param {Extent} extent The extent.
|
||||||
* @param {module:ol/coordinate~Coordinate} coordinate The coordinate.
|
* @param {import("./coordinate.js").Coordinate} coordinate The coordinate.
|
||||||
* @return {module:ol/extent/Relationship} The relationship (bitwise compare with
|
* @return {import("./extent/Relationship.js").default} The relationship (bitwise compare with
|
||||||
* module:ol/extent/Relationship~Relationship).
|
* import("./extent/Relationship.js").Relationship).
|
||||||
*/
|
*/
|
||||||
export function coordinateRelationship(extent, coordinate) {
|
export function coordinateRelationship(extent, coordinate) {
|
||||||
const minX = extent[0];
|
const minX = extent[0];
|
||||||
@@ -195,7 +195,7 @@ export function coordinateRelationship(extent, coordinate) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Create an empty extent.
|
* Create an empty extent.
|
||||||
* @return {module:ol/extent~Extent} Empty extent.
|
* @return {Extent} Empty extent.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function createEmpty() {
|
export function createEmpty() {
|
||||||
@@ -209,8 +209,8 @@ export function createEmpty() {
|
|||||||
* @param {number} minY Minimum Y.
|
* @param {number} minY Minimum Y.
|
||||||
* @param {number} maxX Maximum X.
|
* @param {number} maxX Maximum X.
|
||||||
* @param {number} maxY Maximum Y.
|
* @param {number} maxY Maximum Y.
|
||||||
* @param {module:ol/extent~Extent=} opt_extent Destination extent.
|
* @param {Extent=} opt_extent Destination extent.
|
||||||
* @return {module:ol/extent~Extent} Extent.
|
* @return {Extent} Extent.
|
||||||
*/
|
*/
|
||||||
export function createOrUpdate(minX, minY, maxX, maxY, opt_extent) {
|
export function createOrUpdate(minX, minY, maxX, maxY, opt_extent) {
|
||||||
if (opt_extent) {
|
if (opt_extent) {
|
||||||
@@ -227,8 +227,8 @@ export function createOrUpdate(minX, minY, maxX, maxY, opt_extent) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new empty extent or make the provided one empty.
|
* Create a new empty extent or make the provided one empty.
|
||||||
* @param {module:ol/extent~Extent=} opt_extent Extent.
|
* @param {Extent=} opt_extent Extent.
|
||||||
* @return {module:ol/extent~Extent} Extent.
|
* @return {Extent} Extent.
|
||||||
*/
|
*/
|
||||||
export function createOrUpdateEmpty(opt_extent) {
|
export function createOrUpdateEmpty(opt_extent) {
|
||||||
return createOrUpdate(
|
return createOrUpdate(
|
||||||
@@ -237,9 +237,9 @@ export function createOrUpdateEmpty(opt_extent) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
* @param {import("./coordinate.js").Coordinate} coordinate Coordinate.
|
||||||
* @param {module:ol/extent~Extent=} opt_extent Extent.
|
* @param {Extent=} opt_extent Extent.
|
||||||
* @return {module:ol/extent~Extent} Extent.
|
* @return {Extent} Extent.
|
||||||
*/
|
*/
|
||||||
export function createOrUpdateFromCoordinate(coordinate, opt_extent) {
|
export function createOrUpdateFromCoordinate(coordinate, opt_extent) {
|
||||||
const x = coordinate[0];
|
const x = coordinate[0];
|
||||||
@@ -249,9 +249,9 @@ export function createOrUpdateFromCoordinate(coordinate, opt_extent) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
* @param {Array<import("./coordinate.js").Coordinate>} coordinates Coordinates.
|
||||||
* @param {module:ol/extent~Extent=} opt_extent Extent.
|
* @param {Extent=} opt_extent Extent.
|
||||||
* @return {module:ol/extent~Extent} Extent.
|
* @return {Extent} Extent.
|
||||||
*/
|
*/
|
||||||
export function createOrUpdateFromCoordinates(coordinates, opt_extent) {
|
export function createOrUpdateFromCoordinates(coordinates, opt_extent) {
|
||||||
const extent = createOrUpdateEmpty(opt_extent);
|
const extent = createOrUpdateEmpty(opt_extent);
|
||||||
@@ -264,8 +264,8 @@ export function createOrUpdateFromCoordinates(coordinates, opt_extent) {
|
|||||||
* @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/extent~Extent=} opt_extent Extent.
|
* @param {Extent=} opt_extent Extent.
|
||||||
* @return {module:ol/extent~Extent} Extent.
|
* @return {Extent} Extent.
|
||||||
*/
|
*/
|
||||||
export function createOrUpdateFromFlatCoordinates(flatCoordinates, offset, end, stride, opt_extent) {
|
export function createOrUpdateFromFlatCoordinates(flatCoordinates, offset, end, stride, opt_extent) {
|
||||||
const extent = createOrUpdateEmpty(opt_extent);
|
const extent = createOrUpdateEmpty(opt_extent);
|
||||||
@@ -273,9 +273,9 @@ export function createOrUpdateFromFlatCoordinates(flatCoordinates, offset, end,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array<Array<module:ol/coordinate~Coordinate>>} rings Rings.
|
* @param {Array<Array<import("./coordinate.js").Coordinate>>} rings Rings.
|
||||||
* @param {module:ol/extent~Extent=} opt_extent Extent.
|
* @param {Extent=} opt_extent Extent.
|
||||||
* @return {module:ol/extent~Extent} Extent.
|
* @return {Extent} Extent.
|
||||||
*/
|
*/
|
||||||
export function createOrUpdateFromRings(rings, opt_extent) {
|
export function createOrUpdateFromRings(rings, opt_extent) {
|
||||||
const extent = createOrUpdateEmpty(opt_extent);
|
const extent = createOrUpdateEmpty(opt_extent);
|
||||||
@@ -285,8 +285,8 @@ export function createOrUpdateFromRings(rings, opt_extent) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine if two extents are equivalent.
|
* Determine if two extents are equivalent.
|
||||||
* @param {module:ol/extent~Extent} extent1 Extent 1.
|
* @param {Extent} extent1 Extent 1.
|
||||||
* @param {module:ol/extent~Extent} extent2 Extent 2.
|
* @param {Extent} extent2 Extent 2.
|
||||||
* @return {boolean} The two extents are equivalent.
|
* @return {boolean} The two extents are equivalent.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -298,9 +298,9 @@ export function equals(extent1, extent2) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Modify an extent to include another extent.
|
* Modify an extent to include another extent.
|
||||||
* @param {module:ol/extent~Extent} extent1 The extent to be modified.
|
* @param {Extent} extent1 The extent to be modified.
|
||||||
* @param {module:ol/extent~Extent} extent2 The extent that will be included in the first.
|
* @param {Extent} extent2 The extent that will be included in the first.
|
||||||
* @return {module:ol/extent~Extent} A reference to the first (extended) extent.
|
* @return {Extent} A reference to the first (extended) extent.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function extend(extent1, extent2) {
|
export function extend(extent1, extent2) {
|
||||||
@@ -321,8 +321,8 @@ export function extend(extent1, extent2) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {Extent} extent Extent.
|
||||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
* @param {import("./coordinate.js").Coordinate} coordinate Coordinate.
|
||||||
*/
|
*/
|
||||||
export function extendCoordinate(extent, coordinate) {
|
export function extendCoordinate(extent, coordinate) {
|
||||||
if (coordinate[0] < extent[0]) {
|
if (coordinate[0] < extent[0]) {
|
||||||
@@ -341,9 +341,9 @@ export function extendCoordinate(extent, coordinate) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {Extent} extent Extent.
|
||||||
* @param {Array<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
* @param {Array<import("./coordinate.js").Coordinate>} coordinates Coordinates.
|
||||||
* @return {module:ol/extent~Extent} Extent.
|
* @return {Extent} Extent.
|
||||||
*/
|
*/
|
||||||
export function extendCoordinates(extent, coordinates) {
|
export function extendCoordinates(extent, coordinates) {
|
||||||
for (let i = 0, ii = coordinates.length; i < ii; ++i) {
|
for (let i = 0, ii = coordinates.length; i < ii; ++i) {
|
||||||
@@ -354,12 +354,12 @@ export function extendCoordinates(extent, coordinates) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {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.
|
||||||
* @return {module:ol/extent~Extent} Extent.
|
* @return {Extent} Extent.
|
||||||
*/
|
*/
|
||||||
export function extendFlatCoordinates(extent, flatCoordinates, offset, end, stride) {
|
export function extendFlatCoordinates(extent, flatCoordinates, offset, end, stride) {
|
||||||
for (; offset < end; offset += stride) {
|
for (; offset < end; offset += stride) {
|
||||||
@@ -370,9 +370,9 @@ export function extendFlatCoordinates(extent, flatCoordinates, offset, end, stri
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {Extent} extent Extent.
|
||||||
* @param {Array<Array<module:ol/coordinate~Coordinate>>} rings Rings.
|
* @param {Array<Array<import("./coordinate.js").Coordinate>>} rings Rings.
|
||||||
* @return {module:ol/extent~Extent} Extent.
|
* @return {Extent} Extent.
|
||||||
*/
|
*/
|
||||||
export function extendRings(extent, rings) {
|
export function extendRings(extent, rings) {
|
||||||
for (let i = 0, ii = rings.length; i < ii; ++i) {
|
for (let i = 0, ii = rings.length; i < ii; ++i) {
|
||||||
@@ -383,7 +383,7 @@ export function extendRings(extent, rings) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {Extent} extent Extent.
|
||||||
* @param {number} x X.
|
* @param {number} x X.
|
||||||
* @param {number} y Y.
|
* @param {number} y Y.
|
||||||
*/
|
*/
|
||||||
@@ -399,8 +399,8 @@ export function extendXY(extent, x, y) {
|
|||||||
* This function calls `callback` for each corner of the extent. If the
|
* This function calls `callback` for each corner of the extent. If the
|
||||||
* callback returns a truthy value the function returns that value
|
* callback returns a truthy value the function returns that value
|
||||||
* immediately. Otherwise the function returns `false`.
|
* immediately. Otherwise the function returns `false`.
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {Extent} extent Extent.
|
||||||
* @param {function(this:T, module:ol/coordinate~Coordinate): S} callback Callback.
|
* @param {function(this:T, import("./coordinate.js").Coordinate): S} callback Callback.
|
||||||
* @param {T=} opt_this Value to use as `this` when executing `callback`.
|
* @param {T=} opt_this Value to use as `this` when executing `callback`.
|
||||||
* @return {S|boolean} Value.
|
* @return {S|boolean} Value.
|
||||||
* @template S, T
|
* @template S, T
|
||||||
@@ -429,7 +429,7 @@ export function forEachCorner(extent, callback, opt_this) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the size of an extent.
|
* Get the size of an extent.
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {Extent} extent Extent.
|
||||||
* @return {number} Area.
|
* @return {number} Area.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -444,8 +444,8 @@ export function getArea(extent) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the bottom left coordinate of an extent.
|
* Get the bottom left coordinate of an extent.
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {Extent} extent Extent.
|
||||||
* @return {module:ol/coordinate~Coordinate} Bottom left coordinate.
|
* @return {import("./coordinate.js").Coordinate} Bottom left coordinate.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function getBottomLeft(extent) {
|
export function getBottomLeft(extent) {
|
||||||
@@ -455,8 +455,8 @@ export function getBottomLeft(extent) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the bottom right coordinate of an extent.
|
* Get the bottom right coordinate of an extent.
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {Extent} extent Extent.
|
||||||
* @return {module:ol/coordinate~Coordinate} Bottom right coordinate.
|
* @return {import("./coordinate.js").Coordinate} Bottom right coordinate.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function getBottomRight(extent) {
|
export function getBottomRight(extent) {
|
||||||
@@ -466,8 +466,8 @@ export function getBottomRight(extent) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the center coordinate of an extent.
|
* Get the center coordinate of an extent.
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {Extent} extent Extent.
|
||||||
* @return {module:ol/coordinate~Coordinate} Center.
|
* @return {import("./coordinate.js").Coordinate} Center.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function getCenter(extent) {
|
export function getCenter(extent) {
|
||||||
@@ -477,9 +477,9 @@ export function getCenter(extent) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a corner coordinate of an extent.
|
* Get a corner coordinate of an extent.
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {Extent} extent Extent.
|
||||||
* @param {module:ol/extent/Corner} corner Corner.
|
* @param {import("./extent/Corner.js").default} corner Corner.
|
||||||
* @return {module:ol/coordinate~Coordinate} Corner coordinate.
|
* @return {import("./coordinate.js").Coordinate} Corner coordinate.
|
||||||
*/
|
*/
|
||||||
export function getCorner(extent, corner) {
|
export function getCorner(extent, corner) {
|
||||||
let coordinate;
|
let coordinate;
|
||||||
@@ -495,14 +495,14 @@ export function getCorner(extent, corner) {
|
|||||||
assert(false, 13); // Invalid corner
|
assert(false, 13); // Invalid corner
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
/** @type {!module:ol/coordinate~Coordinate} */ (coordinate)
|
/** @type {!import("./coordinate.js").Coordinate} */ (coordinate)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/extent~Extent} extent1 Extent 1.
|
* @param {Extent} extent1 Extent 1.
|
||||||
* @param {module:ol/extent~Extent} extent2 Extent 2.
|
* @param {Extent} extent2 Extent 2.
|
||||||
* @return {number} Enlarged area.
|
* @return {number} Enlarged area.
|
||||||
*/
|
*/
|
||||||
export function getEnlargedArea(extent1, extent2) {
|
export function getEnlargedArea(extent1, extent2) {
|
||||||
@@ -515,12 +515,12 @@ export function getEnlargedArea(extent1, extent2) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/coordinate~Coordinate} center Center.
|
* @param {import("./coordinate.js").Coordinate} center Center.
|
||||||
* @param {number} resolution Resolution.
|
* @param {number} resolution Resolution.
|
||||||
* @param {number} rotation Rotation.
|
* @param {number} rotation Rotation.
|
||||||
* @param {module:ol/size~Size} size Size.
|
* @param {import("./size.js").Size} size Size.
|
||||||
* @param {module:ol/extent~Extent=} opt_extent Destination extent.
|
* @param {Extent=} opt_extent Destination extent.
|
||||||
* @return {module:ol/extent~Extent} Extent.
|
* @return {Extent} Extent.
|
||||||
*/
|
*/
|
||||||
export function getForViewAndSize(center, resolution, rotation, size, opt_extent) {
|
export function getForViewAndSize(center, resolution, rotation, size, opt_extent) {
|
||||||
const dx = resolution * size[0] / 2;
|
const dx = resolution * size[0] / 2;
|
||||||
@@ -550,7 +550,7 @@ export function getForViewAndSize(center, resolution, rotation, size, opt_extent
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the height of an extent.
|
* Get the height of an extent.
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {Extent} extent Extent.
|
||||||
* @return {number} Height.
|
* @return {number} Height.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -560,8 +560,8 @@ export function getHeight(extent) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/extent~Extent} extent1 Extent 1.
|
* @param {Extent} extent1 Extent 1.
|
||||||
* @param {module:ol/extent~Extent} extent2 Extent 2.
|
* @param {Extent} extent2 Extent 2.
|
||||||
* @return {number} Intersection area.
|
* @return {number} Intersection area.
|
||||||
*/
|
*/
|
||||||
export function getIntersectionArea(extent1, extent2) {
|
export function getIntersectionArea(extent1, extent2) {
|
||||||
@@ -572,10 +572,10 @@ export function getIntersectionArea(extent1, extent2) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the intersection of two extents.
|
* Get the intersection of two extents.
|
||||||
* @param {module:ol/extent~Extent} extent1 Extent 1.
|
* @param {Extent} extent1 Extent 1.
|
||||||
* @param {module:ol/extent~Extent} extent2 Extent 2.
|
* @param {Extent} extent2 Extent 2.
|
||||||
* @param {module:ol/extent~Extent=} opt_extent Optional extent to populate with intersection.
|
* @param {Extent=} opt_extent Optional extent to populate with intersection.
|
||||||
* @return {module:ol/extent~Extent} Intersecting extent.
|
* @return {Extent} Intersecting extent.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function getIntersection(extent1, extent2, opt_extent) {
|
export function getIntersection(extent1, extent2, opt_extent) {
|
||||||
@@ -609,7 +609,7 @@ export function getIntersection(extent1, extent2, opt_extent) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {Extent} extent Extent.
|
||||||
* @return {number} Margin.
|
* @return {number} Margin.
|
||||||
*/
|
*/
|
||||||
export function getMargin(extent) {
|
export function getMargin(extent) {
|
||||||
@@ -619,8 +619,8 @@ export function getMargin(extent) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the size (width, height) of an extent.
|
* Get the size (width, height) of an extent.
|
||||||
* @param {module:ol/extent~Extent} extent The extent.
|
* @param {Extent} extent The extent.
|
||||||
* @return {module:ol/size~Size} The extent size.
|
* @return {import("./size.js").Size} The extent size.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function getSize(extent) {
|
export function getSize(extent) {
|
||||||
@@ -630,8 +630,8 @@ export function getSize(extent) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the top left coordinate of an extent.
|
* Get the top left coordinate of an extent.
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {Extent} extent Extent.
|
||||||
* @return {module:ol/coordinate~Coordinate} Top left coordinate.
|
* @return {import("./coordinate.js").Coordinate} Top left coordinate.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function getTopLeft(extent) {
|
export function getTopLeft(extent) {
|
||||||
@@ -641,8 +641,8 @@ export function getTopLeft(extent) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the top right coordinate of an extent.
|
* Get the top right coordinate of an extent.
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {Extent} extent Extent.
|
||||||
* @return {module:ol/coordinate~Coordinate} Top right coordinate.
|
* @return {import("./coordinate.js").Coordinate} Top right coordinate.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function getTopRight(extent) {
|
export function getTopRight(extent) {
|
||||||
@@ -652,7 +652,7 @@ export function getTopRight(extent) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the width of an extent.
|
* Get the width of an extent.
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {Extent} extent Extent.
|
||||||
* @return {number} Width.
|
* @return {number} Width.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -663,8 +663,8 @@ export function getWidth(extent) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine if one extent intersects another.
|
* Determine if one extent intersects another.
|
||||||
* @param {module:ol/extent~Extent} extent1 Extent 1.
|
* @param {Extent} extent1 Extent 1.
|
||||||
* @param {module:ol/extent~Extent} extent2 Extent.
|
* @param {Extent} extent2 Extent.
|
||||||
* @return {boolean} The two extents intersect.
|
* @return {boolean} The two extents intersect.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -678,7 +678,7 @@ export function intersects(extent1, extent2) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine if an extent is empty.
|
* Determine if an extent is empty.
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {Extent} extent Extent.
|
||||||
* @return {boolean} Is empty.
|
* @return {boolean} Is empty.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -688,9 +688,9 @@ export function isEmpty(extent) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {Extent} extent Extent.
|
||||||
* @param {module:ol/extent~Extent=} opt_extent Extent.
|
* @param {Extent=} opt_extent Extent.
|
||||||
* @return {module:ol/extent~Extent} Extent.
|
* @return {Extent} Extent.
|
||||||
*/
|
*/
|
||||||
export function returnOrUpdate(extent, opt_extent) {
|
export function returnOrUpdate(extent, opt_extent) {
|
||||||
if (opt_extent) {
|
if (opt_extent) {
|
||||||
@@ -706,7 +706,7 @@ export function returnOrUpdate(extent, opt_extent) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {Extent} extent Extent.
|
||||||
* @param {number} value Value.
|
* @param {number} value Value.
|
||||||
*/
|
*/
|
||||||
export function scaleFromCenter(extent, value) {
|
export function scaleFromCenter(extent, value) {
|
||||||
@@ -722,9 +722,9 @@ export function scaleFromCenter(extent, value) {
|
|||||||
/**
|
/**
|
||||||
* Determine if the segment between two coordinates intersects (crosses,
|
* Determine if the segment between two coordinates intersects (crosses,
|
||||||
* touches, or is contained by) the provided extent.
|
* touches, or is contained by) the provided extent.
|
||||||
* @param {module:ol/extent~Extent} extent The extent.
|
* @param {Extent} extent The extent.
|
||||||
* @param {module:ol/coordinate~Coordinate} start Segment start coordinate.
|
* @param {import("./coordinate.js").Coordinate} start Segment start coordinate.
|
||||||
* @param {module:ol/coordinate~Coordinate} end Segment end coordinate.
|
* @param {import("./coordinate.js").Coordinate} end Segment end coordinate.
|
||||||
* @return {boolean} The segment intersects the extent.
|
* @return {boolean} The segment intersects the extent.
|
||||||
*/
|
*/
|
||||||
export function intersectsSegment(extent, start, end) {
|
export function intersectsSegment(extent, start, end) {
|
||||||
@@ -777,11 +777,11 @@ export function intersectsSegment(extent, start, end) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Apply a transform function to the extent.
|
* Apply a transform function to the extent.
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {Extent} extent Extent.
|
||||||
* @param {module:ol/proj~TransformFunction} transformFn Transform function.
|
* @param {import("./proj.js").TransformFunction} transformFn Transform function.
|
||||||
* Called with `[minX, minY, maxX, maxY]` extent coordinates.
|
* Called with `[minX, minY, maxX, maxY]` extent coordinates.
|
||||||
* @param {module:ol/extent~Extent=} opt_extent Destination extent.
|
* @param {Extent=} opt_extent Destination extent.
|
||||||
* @return {module:ol/extent~Extent} Extent.
|
* @return {Extent} Extent.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function applyTransform(extent, transformFn, opt_extent) {
|
export function applyTransform(extent, transformFn, opt_extent) {
|
||||||
|
|||||||
+17
-17
@@ -17,8 +17,8 @@ import FormatType from './format/FormatType.js';
|
|||||||
*
|
*
|
||||||
* The function is responsible for loading the features and adding them to the
|
* The function is responsible for loading the features and adding them to the
|
||||||
* source.
|
* source.
|
||||||
* @typedef {function(this:module:ol/source/Vector, module:ol/extent~Extent, number,
|
* @typedef {function(this:import("./source/Vector.js").default, import("./extent.js").Extent, number,
|
||||||
* module:ol/proj/Projection)} FeatureLoader
|
* import("./proj/Projection.js").default)} FeatureLoader
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -31,29 +31,29 @@ import FormatType from './format/FormatType.js';
|
|||||||
* to be loaded, a `{number}` representing the resolution (map units per pixel)
|
* to be loaded, a `{number}` representing the resolution (map units per pixel)
|
||||||
* and an {@link module:ol/proj/Projection} for the projection as
|
* and an {@link module:ol/proj/Projection} for the projection as
|
||||||
* arguments and returns a `{string}` representing the URL.
|
* arguments and returns a `{string}` representing the URL.
|
||||||
* @typedef {function(module:ol/extent~Extent, number, module:ol/proj/Projection): string} FeatureUrlFunction
|
* @typedef {function(import("./extent.js").Extent, number, import("./proj/Projection.js").default): string} FeatureUrlFunction
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string|module:ol/featureloader~FeatureUrlFunction} url Feature URL service.
|
* @param {string|FeatureUrlFunction} url Feature URL service.
|
||||||
* @param {module:ol/format/Feature} format Feature format.
|
* @param {import("./format/Feature.js").default} 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:import("./VectorTile.js").default, Array<import("./Feature.js").default>, import("./proj/Projection.js").default, import("./extent.js").Extent)|function(this:import("./source/Vector.js").default, Array<import("./Feature.js").default>)} 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:import("./VectorTile.js").default)|function(this:import("./source/Vector.js").default)} failure
|
||||||
* Function called when loading failed. Called with the vector tile or
|
* Function called when loading failed. Called with the vector tile or
|
||||||
* source as `this`.
|
* source as `this`.
|
||||||
* @return {module:ol/featureloader~FeatureLoader} The feature loader.
|
* @return {FeatureLoader} The feature loader.
|
||||||
*/
|
*/
|
||||||
export function loadFeaturesXhr(url, format, success, failure) {
|
export function loadFeaturesXhr(url, format, success, failure) {
|
||||||
return (
|
return (
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {import("./extent.js").Extent} extent Extent.
|
||||||
* @param {number} resolution Resolution.
|
* @param {number} resolution Resolution.
|
||||||
* @param {module:ol/proj/Projection} projection Projection.
|
* @param {import("./proj/Projection.js").default} projection Projection.
|
||||||
* @this {module:ol/source/Vector|module:ol/VectorTile}
|
* @this {import("./source/Vector.js").default|import("./VectorTile.js").default}
|
||||||
*/
|
*/
|
||||||
function(extent, resolution, projection) {
|
function(extent, resolution, projection) {
|
||||||
const xhr = new XMLHttpRequest();
|
const xhr = new XMLHttpRequest();
|
||||||
@@ -110,18 +110,18 @@ export function loadFeaturesXhr(url, format, success, failure) {
|
|||||||
* Create an XHR feature loader for a `url` and `format`. The feature loader
|
* Create an XHR feature loader for a `url` and `format`. The feature loader
|
||||||
* loads features (with XHR), parses the features, and adds them to the
|
* loads features (with XHR), parses the features, and adds them to the
|
||||||
* vector source.
|
* vector source.
|
||||||
* @param {string|module:ol/featureloader~FeatureUrlFunction} url Feature URL service.
|
* @param {string|FeatureUrlFunction} url Feature URL service.
|
||||||
* @param {module:ol/format/Feature} format Feature format.
|
* @param {import("./format/Feature.js").default} format Feature format.
|
||||||
* @return {module:ol/featureloader~FeatureLoader} The feature loader.
|
* @return {FeatureLoader} The feature loader.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
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<import("./Feature.js").default>} features The loaded features.
|
||||||
* @param {module:ol/proj/Projection} dataProjection Data
|
* @param {import("./proj/Projection.js").default} dataProjection Data
|
||||||
* projection.
|
* projection.
|
||||||
* @this {module:ol/source/Vector}
|
* @this {import("./source/Vector.js").default}
|
||||||
*/
|
*/
|
||||||
function(features, dataProjection) {
|
function(features, dataProjection) {
|
||||||
this.addFeatures(features);
|
this.addFeatures(features);
|
||||||
|
|||||||
+50
-50
@@ -23,7 +23,7 @@ import {get as getProjection} from '../proj.js';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<module:ol/geom/GeometryType, function(EsriJSONGeometry): module:ol/geom/Geometry>}
|
* @type {Object<import("../geom/GeometryType.js").default, function(EsriJSONGeometry): import("../geom/Geometry.js").default>}
|
||||||
*/
|
*/
|
||||||
const GEOMETRY_READERS = {};
|
const GEOMETRY_READERS = {};
|
||||||
GEOMETRY_READERS[GeometryType.POINT] = readPointGeometry;
|
GEOMETRY_READERS[GeometryType.POINT] = readPointGeometry;
|
||||||
@@ -36,7 +36,7 @@ GEOMETRY_READERS[GeometryType.MULTI_POLYGON] = readMultiPolygonGeometry;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, function(module:ol/geom/Geometry, module:ol/format/Feature~WriteOptions=): (EsriJSONGeometry)>}
|
* @type {Object<string, function(import("../geom/Geometry.js").default, import("./Feature.js").WriteOptions=): (EsriJSONGeometry)>}
|
||||||
*/
|
*/
|
||||||
const GEOMETRY_WRITERS = {};
|
const GEOMETRY_WRITERS = {};
|
||||||
GEOMETRY_WRITERS[GeometryType.POINT] = writePointGeometry;
|
GEOMETRY_WRITERS[GeometryType.POINT] = writePointGeometry;
|
||||||
@@ -62,7 +62,7 @@ GEOMETRY_WRITERS[GeometryType.MULTI_POLYGON] = writeMultiPolygonGeometry;
|
|||||||
class EsriJSON extends JSONFeature {
|
class EsriJSON extends JSONFeature {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/format/EsriJSON~Options=} opt_options Options.
|
* @param {Options=} opt_options Options.
|
||||||
*/
|
*/
|
||||||
constructor(opt_options) {
|
constructor(opt_options) {
|
||||||
|
|
||||||
@@ -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<import("../Feature.js").default>} */
|
||||||
const features = [];
|
const features = [];
|
||||||
const esriJSONFeatures = esriJSONFeatureCollection.features;
|
const esriJSONFeatures = esriJSONFeatureCollection.features;
|
||||||
options.idField = object.objectIdFieldName;
|
options.idField = object.objectIdFieldName;
|
||||||
@@ -144,8 +144,8 @@ class EsriJSON extends JSONFeature {
|
|||||||
/**
|
/**
|
||||||
* Encode a geometry as a EsriJSON object.
|
* Encode a geometry as a EsriJSON object.
|
||||||
*
|
*
|
||||||
* @param {module:ol/geom/Geometry} geometry Geometry.
|
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
* @return {EsriJSONGeometry} Object.
|
* @return {EsriJSONGeometry} Object.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
@@ -157,8 +157,8 @@ class EsriJSON extends JSONFeature {
|
|||||||
/**
|
/**
|
||||||
* Encode a feature as a esriJSON Feature object.
|
* Encode a feature as a esriJSON Feature object.
|
||||||
*
|
*
|
||||||
* @param {module:ol/Feature} feature Feature.
|
* @param {import("../Feature.js").default} feature Feature.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
* @return {Object} Object.
|
* @return {Object} Object.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
@@ -188,8 +188,8 @@ 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<import("../Feature.js").default>} features Features.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
* @return {Object} EsriJSON Object.
|
* @return {Object} EsriJSON Object.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
@@ -209,14 +209,14 @@ class EsriJSON extends JSONFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {EsriJSONGeometry} object Object.
|
* @param {EsriJSONGeometry} object Object.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
* @param {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||||
* @return {module:ol/geom/Geometry} Geometry.
|
* @return {import("../geom/Geometry.js").default} Geometry.
|
||||||
*/
|
*/
|
||||||
function readGeometry(object, opt_options) {
|
function readGeometry(object, opt_options) {
|
||||||
if (!object) {
|
if (!object) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
/** @type {module:ol/geom/GeometryType} */
|
/** @type {import("../geom/GeometryType.js").default} */
|
||||||
let type;
|
let type;
|
||||||
if (typeof object.x === 'number' && typeof object.y === 'number') {
|
if (typeof object.x === 'number' && typeof object.y === 'number') {
|
||||||
type = GeometryType.POINT;
|
type = GeometryType.POINT;
|
||||||
@@ -242,7 +242,7 @@ function readGeometry(object, opt_options) {
|
|||||||
}
|
}
|
||||||
const geometryReader = GEOMETRY_READERS[type];
|
const geometryReader = GEOMETRY_READERS[type];
|
||||||
return (
|
return (
|
||||||
/** @type {module:ol/geom/Geometry} */ (transformWithOptions(geometryReader(object), false, opt_options))
|
/** @type {import("../geom/Geometry.js").default} */ (transformWithOptions(geometryReader(object), false, opt_options))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -253,7 +253,7 @@ function readGeometry(object, opt_options) {
|
|||||||
* 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 {import("../geom/GeometryLayout.js").default} 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) {
|
||||||
@@ -302,7 +302,7 @@ function convertRings(rings, layout) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {EsriJSONGeometry} object Object.
|
* @param {EsriJSONGeometry} object Object.
|
||||||
* @return {module:ol/geom/Geometry} Point.
|
* @return {import("../geom/Geometry.js").default} Point.
|
||||||
*/
|
*/
|
||||||
function readPointGeometry(object) {
|
function readPointGeometry(object) {
|
||||||
let point;
|
let point;
|
||||||
@@ -324,7 +324,7 @@ function readPointGeometry(object) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {EsriJSONGeometry} object Object.
|
* @param {EsriJSONGeometry} object Object.
|
||||||
* @return {module:ol/geom/Geometry} LineString.
|
* @return {import("../geom/Geometry.js").default} LineString.
|
||||||
*/
|
*/
|
||||||
function readLineStringGeometry(object) {
|
function readLineStringGeometry(object) {
|
||||||
const layout = getGeometryLayout(object);
|
const layout = getGeometryLayout(object);
|
||||||
@@ -334,7 +334,7 @@ function readLineStringGeometry(object) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {EsriJSONGeometry} object Object.
|
* @param {EsriJSONGeometry} object Object.
|
||||||
* @return {module:ol/geom/Geometry} MultiLineString.
|
* @return {import("../geom/Geometry.js").default} MultiLineString.
|
||||||
*/
|
*/
|
||||||
function readMultiLineStringGeometry(object) {
|
function readMultiLineStringGeometry(object) {
|
||||||
const layout = getGeometryLayout(object);
|
const layout = getGeometryLayout(object);
|
||||||
@@ -344,7 +344,7 @@ function readMultiLineStringGeometry(object) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {EsriJSONGeometry} object Object.
|
* @param {EsriJSONGeometry} object Object.
|
||||||
* @return {module:ol/geom/GeometryLayout} The geometry layout to use.
|
* @return {import("../geom/GeometryLayout.js").default} The geometry layout to use.
|
||||||
*/
|
*/
|
||||||
function getGeometryLayout(object) {
|
function getGeometryLayout(object) {
|
||||||
let layout = GeometryLayout.XY;
|
let layout = GeometryLayout.XY;
|
||||||
@@ -361,7 +361,7 @@ function getGeometryLayout(object) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {EsriJSONGeometry} object Object.
|
* @param {EsriJSONGeometry} object Object.
|
||||||
* @return {module:ol/geom/Geometry} MultiPoint.
|
* @return {import("../geom/Geometry.js").default} MultiPoint.
|
||||||
*/
|
*/
|
||||||
function readMultiPointGeometry(object) {
|
function readMultiPointGeometry(object) {
|
||||||
const layout = getGeometryLayout(object);
|
const layout = getGeometryLayout(object);
|
||||||
@@ -371,7 +371,7 @@ function readMultiPointGeometry(object) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {EsriJSONGeometry} object Object.
|
* @param {EsriJSONGeometry} object Object.
|
||||||
* @return {module:ol/geom/Geometry} MultiPolygon.
|
* @return {import("../geom/Geometry.js").default} MultiPolygon.
|
||||||
*/
|
*/
|
||||||
function readMultiPolygonGeometry(object) {
|
function readMultiPolygonGeometry(object) {
|
||||||
const layout = getGeometryLayout(object);
|
const layout = getGeometryLayout(object);
|
||||||
@@ -383,7 +383,7 @@ function readMultiPolygonGeometry(object) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {EsriJSONGeometry} object Object.
|
* @param {EsriJSONGeometry} object Object.
|
||||||
* @return {module:ol/geom/Geometry} Polygon.
|
* @return {import("../geom/Geometry.js").default} Polygon.
|
||||||
*/
|
*/
|
||||||
function readPolygonGeometry(object) {
|
function readPolygonGeometry(object) {
|
||||||
const layout = getGeometryLayout(object);
|
const layout = getGeometryLayout(object);
|
||||||
@@ -392,14 +392,14 @@ function readPolygonGeometry(object) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/geom/Geometry} geometry Geometry.
|
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
* @return {EsriJSONGeometry} EsriJSON geometry.
|
* @return {EsriJSONGeometry} EsriJSON geometry.
|
||||||
*/
|
*/
|
||||||
function writePointGeometry(geometry, opt_options) {
|
function writePointGeometry(geometry, opt_options) {
|
||||||
const coordinates = /** @type {module:ol/geom/Point} */ (geometry).getCoordinates();
|
const coordinates = /** @type {import("../geom/Point.js").default} */ (geometry).getCoordinates();
|
||||||
let esriJSON;
|
let esriJSON;
|
||||||
const layout = /** @type {module:ol/geom/Point} */ (geometry).getLayout();
|
const layout = /** @type {import("../geom/Point.js").default} */ (geometry).getLayout();
|
||||||
if (layout === GeometryLayout.XYZ) {
|
if (layout === GeometryLayout.XYZ) {
|
||||||
esriJSON = /** @type {EsriJSONPoint} */ ({
|
esriJSON = /** @type {EsriJSONPoint} */ ({
|
||||||
x: coordinates[0],
|
x: coordinates[0],
|
||||||
@@ -432,7 +432,7 @@ function writePointGeometry(geometry, opt_options) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/geom/SimpleGeometry} geometry Geometry.
|
* @param {import("../geom/SimpleGeometry.js").default} geometry Geometry.
|
||||||
* @return {Object} Object with boolean hasZ and hasM keys.
|
* @return {Object} Object with boolean hasZ and hasM keys.
|
||||||
*/
|
*/
|
||||||
function getHasZM(geometry) {
|
function getHasZM(geometry) {
|
||||||
@@ -447,18 +447,18 @@ function getHasZM(geometry) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/geom/Geometry} geometry Geometry.
|
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
* @return {EsriJSONPolyline} EsriJSON geometry.
|
* @return {EsriJSONPolyline} EsriJSON geometry.
|
||||||
*/
|
*/
|
||||||
function writeLineStringGeometry(geometry, opt_options) {
|
function writeLineStringGeometry(geometry, opt_options) {
|
||||||
const hasZM = getHasZM(/** @type {module:ol/geom/LineString} */(geometry));
|
const hasZM = getHasZM(/** @type {import("../geom/LineString.js").default} */(geometry));
|
||||||
return (
|
return (
|
||||||
/** @type {EsriJSONPolyline} */ {
|
/** @type {EsriJSONPolyline} */ {
|
||||||
hasZ: hasZM.hasZ,
|
hasZ: hasZM.hasZ,
|
||||||
hasM: hasZM.hasM,
|
hasM: hasZM.hasM,
|
||||||
paths: [
|
paths: [
|
||||||
/** @type {module:ol/geom/LineString} */ (geometry).getCoordinates()
|
/** @type {import("../geom/LineString.js").default} */ (geometry).getCoordinates()
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -466,65 +466,65 @@ function writeLineStringGeometry(geometry, opt_options) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/geom/Geometry} geometry Geometry.
|
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
* @return {EsriJSONPolygon} EsriJSON geometry.
|
* @return {EsriJSONPolygon} EsriJSON geometry.
|
||||||
*/
|
*/
|
||||||
function writePolygonGeometry(geometry, opt_options) {
|
function writePolygonGeometry(geometry, opt_options) {
|
||||||
// Esri geometries use the left-hand rule
|
// Esri geometries use the left-hand rule
|
||||||
const hasZM = getHasZM(/** @type {module:ol/geom/Polygon} */(geometry));
|
const hasZM = getHasZM(/** @type {import("../geom/Polygon.js").default} */(geometry));
|
||||||
return (
|
return (
|
||||||
/** @type {EsriJSONPolygon} */ {
|
/** @type {EsriJSONPolygon} */ {
|
||||||
hasZ: hasZM.hasZ,
|
hasZ: hasZM.hasZ,
|
||||||
hasM: hasZM.hasM,
|
hasM: hasZM.hasM,
|
||||||
rings: /** @type {module:ol/geom/Polygon} */ (geometry).getCoordinates(false)
|
rings: /** @type {import("../geom/Polygon.js").default} */ (geometry).getCoordinates(false)
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/geom/Geometry} geometry Geometry.
|
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
* @return {EsriJSONPolyline} EsriJSON geometry.
|
* @return {EsriJSONPolyline} EsriJSON geometry.
|
||||||
*/
|
*/
|
||||||
function writeMultiLineStringGeometry(geometry, opt_options) {
|
function writeMultiLineStringGeometry(geometry, opt_options) {
|
||||||
const hasZM = getHasZM(/** @type {module:ol/geom/MultiLineString} */(geometry));
|
const hasZM = getHasZM(/** @type {import("../geom/MultiLineString.js").default} */(geometry));
|
||||||
return (
|
return (
|
||||||
/** @type {EsriJSONPolyline} */ {
|
/** @type {EsriJSONPolyline} */ {
|
||||||
hasZ: hasZM.hasZ,
|
hasZ: hasZM.hasZ,
|
||||||
hasM: hasZM.hasM,
|
hasM: hasZM.hasM,
|
||||||
paths: /** @type {module:ol/geom/MultiLineString} */ (geometry).getCoordinates()
|
paths: /** @type {import("../geom/MultiLineString.js").default} */ (geometry).getCoordinates()
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/geom/Geometry} geometry Geometry.
|
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
* @return {EsriJSONMultipoint} EsriJSON geometry.
|
* @return {EsriJSONMultipoint} EsriJSON geometry.
|
||||||
*/
|
*/
|
||||||
function writeMultiPointGeometry(geometry, opt_options) {
|
function writeMultiPointGeometry(geometry, opt_options) {
|
||||||
const hasZM = getHasZM(/** @type {module:ol/geom/MultiPoint} */(geometry));
|
const hasZM = getHasZM(/** @type {import("../geom/MultiPoint.js").default} */(geometry));
|
||||||
return (
|
return (
|
||||||
/** @type {EsriJSONMultipoint} */ {
|
/** @type {EsriJSONMultipoint} */ {
|
||||||
hasZ: hasZM.hasZ,
|
hasZ: hasZM.hasZ,
|
||||||
hasM: hasZM.hasM,
|
hasM: hasZM.hasM,
|
||||||
points: /** @type {module:ol/geom/MultiPoint} */ (geometry).getCoordinates()
|
points: /** @type {import("../geom/MultiPoint.js").default} */ (geometry).getCoordinates()
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/geom/Geometry} geometry Geometry.
|
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
* @return {EsriJSONPolygon} EsriJSON geometry.
|
* @return {EsriJSONPolygon} EsriJSON geometry.
|
||||||
*/
|
*/
|
||||||
function writeMultiPolygonGeometry(geometry, opt_options) {
|
function writeMultiPolygonGeometry(geometry, opt_options) {
|
||||||
const hasZM = getHasZM(/** @type {module:ol/geom/MultiPolygon} */(geometry));
|
const hasZM = getHasZM(/** @type {import("../geom/MultiPolygon.js").default} */(geometry));
|
||||||
const coordinates = /** @type {module:ol/geom/MultiPolygon} */ (geometry).getCoordinates(false);
|
const coordinates = /** @type {import("../geom/MultiPolygon.js").default} */ (geometry).getCoordinates(false);
|
||||||
const output = [];
|
const output = [];
|
||||||
for (let i = 0; i < coordinates.length; i++) {
|
for (let i = 0; i < coordinates.length; i++) {
|
||||||
for (let x = coordinates[i].length - 1; x >= 0; x--) {
|
for (let x = coordinates[i].length - 1; x >= 0; x--) {
|
||||||
@@ -540,13 +540,13 @@ function writeMultiPolygonGeometry(geometry, opt_options) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/geom/Geometry} geometry Geometry.
|
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
* @return {EsriJSONGeometry} EsriJSON geometry.
|
* @return {EsriJSONGeometry} EsriJSON geometry.
|
||||||
*/
|
*/
|
||||||
function writeGeometry(geometry, opt_options) {
|
function writeGeometry(geometry, opt_options) {
|
||||||
const geometryWriter = GEOMETRY_WRITERS[geometry.getType()];
|
const geometryWriter = GEOMETRY_WRITERS[geometry.getType()];
|
||||||
return geometryWriter(/** @type {module:ol/geom/Geometry} */(
|
return geometryWriter(/** @type {import("../geom/Geometry.js").default} */(
|
||||||
transformWithOptions(geometry, true, opt_options)), opt_options);
|
transformWithOptions(geometry, true, opt_options)), opt_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+31
-31
@@ -8,14 +8,14 @@ import {get as getProjection, equivalent as equivalentProjection, transformExten
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} ReadOptions
|
* @typedef {Object} ReadOptions
|
||||||
* @property {module:ol/proj~ProjectionLike} [dataProjection] Projection of the data we are reading.
|
* @property {import("../proj.js").ProjectionLike} [dataProjection] Projection of the data we are reading.
|
||||||
* If not provided, the projection will be derived from the data (where possible) or
|
* If not provided, the projection will be derived from the data (where possible) or
|
||||||
* the `dataProjection` of the format is assigned (where set). If the projection
|
* the `dataProjection` of the format is assigned (where set). If the projection
|
||||||
* can not be derived from the data and if no `dataProjection` is set for a format,
|
* can not be derived from the data and if no `dataProjection` is set for a format,
|
||||||
* the features will not be reprojected.
|
* the features will not be reprojected.
|
||||||
* @property {module:ol/extent~Extent} [extent] Tile extent of the tile being read. This is only used and
|
* @property {import("../extent.js").Extent} [extent] Tile extent of the tile being read. This is only used and
|
||||||
* required for {@link module:ol/format/MVT}.
|
* required for {@link module:ol/format/MVT}.
|
||||||
* @property {module:ol/proj~ProjectionLike} [featureProjection] Projection of the feature geometries
|
* @property {import("../proj.js").ProjectionLike} [featureProjection] Projection of the feature geometries
|
||||||
* created by the format reader. If not provided, features will be returned in the
|
* created by the format reader. If not provided, features will be returned in the
|
||||||
* `dataProjection`.
|
* `dataProjection`.
|
||||||
*/
|
*/
|
||||||
@@ -23,11 +23,11 @@ import {get as getProjection, equivalent as equivalentProjection, transformExten
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} WriteOptions
|
* @typedef {Object} WriteOptions
|
||||||
* @property {module:ol/proj~ProjectionLike} [dataProjection] Projection of the data we are writing.
|
* @property {import("../proj.js").ProjectionLike} [dataProjection] Projection of the data we are writing.
|
||||||
* If not provided, the `dataProjection` of the format is assigned (where set).
|
* If not provided, the `dataProjection` of the format is assigned (where set).
|
||||||
* If no `dataProjection` is set for a format, the features will be returned
|
* If no `dataProjection` is set for a format, the features will be returned
|
||||||
* in the `featureProjection`.
|
* in the `featureProjection`.
|
||||||
* @property {module:ol/proj~ProjectionLike} [featureProjection] Projection of the feature geometries
|
* @property {import("../proj.js").ProjectionLike} [featureProjection] Projection of the feature geometries
|
||||||
* that will be serialized by the format writer. If not provided, geometries are assumed
|
* that will be serialized by the format writer. If not provided, geometries are assumed
|
||||||
* to be in the `dataProjection` if that is set; in other words, they are not transformed.
|
* to be in the `dataProjection` if that is set; in other words, they are not transformed.
|
||||||
* @property {boolean} [rightHanded] When writing geometries, follow the right-hand
|
* @property {boolean} [rightHanded] When writing geometries, follow the right-hand
|
||||||
@@ -52,7 +52,7 @@ import {get as getProjection, equivalent as equivalentProjection, transformExten
|
|||||||
* Abstract base class; normally only used for creating subclasses and not
|
* Abstract base class; normally only used for creating subclasses and not
|
||||||
* instantiated in apps.
|
* instantiated in apps.
|
||||||
* Base class for feature formats.
|
* Base class for feature formats.
|
||||||
* {module:ol/format/Feature~FeatureFormat} subclasses provide the ability to decode and encode
|
* {FeatureFormat} subclasses provide the ability to decode and encode
|
||||||
* {@link module:ol/Feature~Feature} objects from a variety of commonly used geospatial
|
* {@link module:ol/Feature~Feature} objects from a variety of commonly used geospatial
|
||||||
* file formats. See the documentation for each format for more details.
|
* file formats. See the documentation for each format for more details.
|
||||||
*
|
*
|
||||||
@@ -64,13 +64,13 @@ class FeatureFormat {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @protected
|
* @protected
|
||||||
* @type {module:ol/proj/Projection}
|
* @type {import("../proj/Projection.js").default}
|
||||||
*/
|
*/
|
||||||
this.dataProjection = null;
|
this.dataProjection = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @protected
|
* @protected
|
||||||
* @type {module:ol/proj/Projection}
|
* @type {import("../proj/Projection.js").default}
|
||||||
*/
|
*/
|
||||||
this.defaultFeatureProjection = null;
|
this.defaultFeatureProjection = null;
|
||||||
|
|
||||||
@@ -79,8 +79,8 @@ class FeatureFormat {
|
|||||||
/**
|
/**
|
||||||
* Adds the data projection to the read options.
|
* Adds the data projection to the read options.
|
||||||
* @param {Document|Node|Object|string} source Source.
|
* @param {Document|Node|Object|string} source Source.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Options.
|
* @param {ReadOptions=} opt_options Options.
|
||||||
* @return {module:ol/format/Feature~ReadOptions|undefined} Options.
|
* @return {ReadOptions|undefined} Options.
|
||||||
* @protected
|
* @protected
|
||||||
*/
|
*/
|
||||||
getReadOptions(source, opt_options) {
|
getReadOptions(source, opt_options) {
|
||||||
@@ -98,10 +98,10 @@ class FeatureFormat {
|
|||||||
/**
|
/**
|
||||||
* Sets the `dataProjection` on the options, if no `dataProjection`
|
* Sets the `dataProjection` on the options, if no `dataProjection`
|
||||||
* is set.
|
* is set.
|
||||||
* @param {module:ol/format/Feature~WriteOptions|module:ol/format/Feature~ReadOptions|undefined} options
|
* @param {WriteOptions|ReadOptions|undefined} options
|
||||||
* Options.
|
* Options.
|
||||||
* @protected
|
* @protected
|
||||||
* @return {module:ol/format/Feature~WriteOptions|module:ol/format/Feature~ReadOptions|undefined}
|
* @return {WriteOptions|ReadOptions|undefined}
|
||||||
* Updated options.
|
* Updated options.
|
||||||
*/
|
*/
|
||||||
adaptOptions(options) {
|
adaptOptions(options) {
|
||||||
@@ -113,7 +113,7 @@ class FeatureFormat {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the extent from the source of the last {@link readFeatures} call.
|
* Get the extent from the source of the last {@link readFeatures} call.
|
||||||
* @return {module:ol/extent~Extent} Tile extent.
|
* @return {import("../extent.js").Extent} Tile extent.
|
||||||
*/
|
*/
|
||||||
getLastExtent() {
|
getLastExtent() {
|
||||||
return null;
|
return null;
|
||||||
@@ -121,7 +121,7 @@ class FeatureFormat {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @abstract
|
* @abstract
|
||||||
* @return {module:ol/format/FormatType} Format.
|
* @return {import("./FormatType.js").default} Format.
|
||||||
*/
|
*/
|
||||||
getType() {}
|
getType() {}
|
||||||
|
|
||||||
@@ -130,8 +130,8 @@ class FeatureFormat {
|
|||||||
*
|
*
|
||||||
* @abstract
|
* @abstract
|
||||||
* @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 {ReadOptions=} opt_options Read options.
|
||||||
* @return {module:ol/Feature} Feature.
|
* @return {import("../Feature.js").default} Feature.
|
||||||
*/
|
*/
|
||||||
readFeature(source, opt_options) {}
|
readFeature(source, opt_options) {}
|
||||||
|
|
||||||
@@ -140,8 +140,8 @@ 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 {ReadOptions=} opt_options Read options.
|
||||||
* @return {Array<module:ol/Feature>} Features.
|
* @return {Array<import("../Feature.js").default>} Features.
|
||||||
*/
|
*/
|
||||||
readFeatures(source, opt_options) {}
|
readFeatures(source, opt_options) {}
|
||||||
|
|
||||||
@@ -150,8 +150,8 @@ class FeatureFormat {
|
|||||||
*
|
*
|
||||||
* @abstract
|
* @abstract
|
||||||
* @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 {ReadOptions=} opt_options Read options.
|
||||||
* @return {module:ol/geom/Geometry} Geometry.
|
* @return {import("../geom/Geometry.js").default} Geometry.
|
||||||
*/
|
*/
|
||||||
readGeometry(source, opt_options) {}
|
readGeometry(source, opt_options) {}
|
||||||
|
|
||||||
@@ -160,7 +160,7 @@ class FeatureFormat {
|
|||||||
*
|
*
|
||||||
* @abstract
|
* @abstract
|
||||||
* @param {Document|Node|Object|string} source Source.
|
* @param {Document|Node|Object|string} source Source.
|
||||||
* @return {module:ol/proj/Projection} Projection.
|
* @return {import("../proj/Projection.js").default} Projection.
|
||||||
*/
|
*/
|
||||||
readProjection(source) {}
|
readProjection(source) {}
|
||||||
|
|
||||||
@@ -168,8 +168,8 @@ class FeatureFormat {
|
|||||||
* Encode a feature in this format.
|
* Encode a feature in this format.
|
||||||
*
|
*
|
||||||
* @abstract
|
* @abstract
|
||||||
* @param {module:ol/Feature} feature Feature.
|
* @param {import("../Feature.js").default} feature Feature.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {WriteOptions=} opt_options Write options.
|
||||||
* @return {string} Result.
|
* @return {string} Result.
|
||||||
*/
|
*/
|
||||||
writeFeature(feature, opt_options) {}
|
writeFeature(feature, opt_options) {}
|
||||||
@@ -178,8 +178,8 @@ 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<import("../Feature.js").default>} features Features.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {WriteOptions=} opt_options Write options.
|
||||||
* @return {string} Result.
|
* @return {string} Result.
|
||||||
*/
|
*/
|
||||||
writeFeatures(features, opt_options) {}
|
writeFeatures(features, opt_options) {}
|
||||||
@@ -188,8 +188,8 @@ class FeatureFormat {
|
|||||||
* Write a single geometry in this format.
|
* Write a single geometry in this format.
|
||||||
*
|
*
|
||||||
* @abstract
|
* @abstract
|
||||||
* @param {module:ol/geom/Geometry} geometry Geometry.
|
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {WriteOptions=} opt_options Write options.
|
||||||
* @return {string} Result.
|
* @return {string} Result.
|
||||||
*/
|
*/
|
||||||
writeGeometry(geometry, opt_options) {}
|
writeGeometry(geometry, opt_options) {}
|
||||||
@@ -198,11 +198,11 @@ class FeatureFormat {
|
|||||||
export default FeatureFormat;
|
export default FeatureFormat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/geom/Geometry|module:ol/extent~Extent} geometry Geometry.
|
* @param {import("../geom/Geometry.js").default|import("../extent.js").Extent} geometry Geometry.
|
||||||
* @param {boolean} write Set to true for writing, false for reading.
|
* @param {boolean} write Set to true for writing, false for reading.
|
||||||
* @param {module:ol/format/Feature~WriteOptions|module:ol/format/Feature~ReadOptions|undefined} opt_options
|
* @param {WriteOptions|ReadOptions|undefined} opt_options
|
||||||
* Options.
|
* Options.
|
||||||
* @return {module:ol/geom/Geometry|module:ol/extent~Extent} Transformed geometry.
|
* @return {import("../geom/Geometry.js").default|import("../extent.js").Extent} Transformed geometry.
|
||||||
*/
|
*/
|
||||||
export function transformWithOptions(geometry, write, opt_options) {
|
export function transformWithOptions(geometry, write, opt_options) {
|
||||||
const featureProjection = opt_options ?
|
const featureProjection = opt_options ?
|
||||||
@@ -210,7 +210,7 @@ export function transformWithOptions(geometry, write, opt_options) {
|
|||||||
const dataProjection = opt_options ?
|
const dataProjection = opt_options ?
|
||||||
getProjection(opt_options.dataProjection) : null;
|
getProjection(opt_options.dataProjection) : null;
|
||||||
/**
|
/**
|
||||||
* @type {module:ol/geom/Geometry|module:ol/extent~Extent}
|
* @type {import("../geom/Geometry.js").default|import("../extent.js").Extent}
|
||||||
*/
|
*/
|
||||||
let transformed;
|
let transformed;
|
||||||
if (featureProjection && dataProjection &&
|
if (featureProjection && dataProjection &&
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import GML3 from '../format/GML3.js';
|
|||||||
* version 3.1.1.
|
* version 3.1.1.
|
||||||
* Currently only supports GML 3.1.1 Simple Features profile.
|
* Currently only supports GML 3.1.1 Simple Features profile.
|
||||||
*
|
*
|
||||||
* @param {module:ol/format/GMLBase~Options=} opt_options
|
* @param {import("./GMLBase.js").Options=} opt_options
|
||||||
* Optional configuration object.
|
* Optional configuration object.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -20,8 +20,8 @@ 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<import("../Feature.js").default>} features Features.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Options.
|
||||||
* @return {string} Result.
|
* @return {string} Result.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -32,8 +32,8 @@ 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<import("../Feature.js").default>} features Features.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Options.
|
||||||
* @return {Node} Node.
|
* @return {Node} Node.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
|
|||||||
+37
-37
@@ -41,10 +41,10 @@ const MULTIGEOMETRY_TO_MEMBER_NODENAME = {
|
|||||||
class GML2 extends GMLBase {
|
class GML2 extends GMLBase {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/format/GMLBase~Options=} opt_options Optional configuration object.
|
* @param {import("./GMLBase.js").Options=} opt_options Optional configuration object.
|
||||||
*/
|
*/
|
||||||
constructor(opt_options) {
|
constructor(opt_options) {
|
||||||
const options = /** @type {module:ol/format/GMLBase~Options} */
|
const options = /** @type {import("./GMLBase.js").Options} */
|
||||||
(opt_options ? opt_options : {});
|
(opt_options ? opt_options : {});
|
||||||
|
|
||||||
super(options);
|
super(options);
|
||||||
@@ -69,7 +69,7 @@ class GML2 extends GMLBase {
|
|||||||
*/
|
*/
|
||||||
readFlatCoordinates_(node, objectStack) {
|
readFlatCoordinates_(node, objectStack) {
|
||||||
const s = getAllTextContent(node, false).replace(/^\s*|\s*$/g, '');
|
const s = getAllTextContent(node, false).replace(/^\s*|\s*$/g, '');
|
||||||
const context = /** @type {module:ol/xml~NodeStackItem} */ (objectStack[0]);
|
const context = /** @type {import("../xml.js").NodeStackItem} */ (objectStack[0]);
|
||||||
const containerSrs = context['srsName'];
|
const containerSrs = context['srsName'];
|
||||||
let axisOrientation = 'enu';
|
let axisOrientation = 'enu';
|
||||||
if (containerSrs) {
|
if (containerSrs) {
|
||||||
@@ -98,7 +98,7 @@ class GML2 extends GMLBase {
|
|||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {Array<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {module:ol/extent~Extent|undefined} Envelope.
|
* @return {import("../extent.js").Extent|undefined} Envelope.
|
||||||
*/
|
*/
|
||||||
readBox_(node, objectStack) {
|
readBox_(node, objectStack) {
|
||||||
/** @type {Array<number>} */
|
/** @type {Array<number>} */
|
||||||
@@ -156,7 +156,7 @@ class GML2 extends GMLBase {
|
|||||||
const multiCurve = context['multiCurve'];
|
const multiCurve = context['multiCurve'];
|
||||||
let nodeName;
|
let nodeName;
|
||||||
if (!Array.isArray(value)) {
|
if (!Array.isArray(value)) {
|
||||||
nodeName = /** @type {module:ol/geom/Geometry} */ (value).getType();
|
nodeName = /** @type {import("../geom/Geometry.js").default} */ (value).getType();
|
||||||
if (nodeName === 'MultiPolygon' && multiSurface === true) {
|
if (nodeName === 'MultiPolygon' && multiSurface === true) {
|
||||||
nodeName = 'MultiSurface';
|
nodeName = 'MultiSurface';
|
||||||
} else if (nodeName === 'Polygon' && surface === true) {
|
} else if (nodeName === 'Polygon' && surface === true) {
|
||||||
@@ -173,7 +173,7 @@ class GML2 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {module:ol/Feature} feature Feature.
|
* @param {import("../Feature.js").default} feature Feature.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
writeFeatureElement(node, feature, objectStack) {
|
writeFeatureElement(node, feature, objectStack) {
|
||||||
@@ -210,7 +210,7 @@ class GML2 extends GMLBase {
|
|||||||
}
|
}
|
||||||
const item = assign({}, context);
|
const item = assign({}, context);
|
||||||
item.node = node;
|
item.node = node;
|
||||||
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */
|
pushSerializeAndPop(/** @type {import("../xml.js").NodeStackItem} */
|
||||||
(item), context.serializers,
|
(item), context.serializers,
|
||||||
makeSimpleNodeFactory(undefined, featureNS),
|
makeSimpleNodeFactory(undefined, featureNS),
|
||||||
values,
|
values,
|
||||||
@@ -219,7 +219,7 @@ class GML2 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {module:ol/geom/LineString} geometry LineString geometry.
|
* @param {import("../geom/LineString.js").default} geometry LineString geometry.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -244,7 +244,7 @@ class GML2 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {module:ol/geom/LineString} line LineString geometry.
|
* @param {import("../geom/LineString.js").default} line LineString geometry.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -258,7 +258,7 @@ class GML2 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {module:ol/geom/MultiLineString} geometry MultiLineString geometry.
|
* @param {import("../geom/MultiLineString.js").default} geometry MultiLineString geometry.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -279,11 +279,11 @@ class GML2 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/Geometry|module:ol/extent~Extent} geometry Geometry.
|
* @param {import("../geom/Geometry.js").default|import("../extent.js").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 {import("./Feature.js").WriteOptions} */ (objectStack[objectStack.length - 1]);
|
||||||
const item = assign({}, context);
|
const item = assign({}, context);
|
||||||
item.node = node;
|
item.node = node;
|
||||||
let value;
|
let value;
|
||||||
@@ -295,9 +295,9 @@ class GML2 extends GMLBase {
|
|||||||
value = geometry;
|
value = geometry;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
value = transformWithOptions(/** @type {module:ol/geom/Geometry} */ (geometry), true, context);
|
value = transformWithOptions(/** @type {import("../geom/Geometry.js").default} */ (geometry), true, context);
|
||||||
}
|
}
|
||||||
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */
|
pushSerializeAndPop(/** @type {import("../xml.js").NodeStackItem} */
|
||||||
(item), this.GEOMETRY_SERIALIZERS_,
|
(item), this.GEOMETRY_SERIALIZERS_,
|
||||||
this.GEOMETRY_NODE_FACTORY_, [value],
|
this.GEOMETRY_NODE_FACTORY_, [value],
|
||||||
objectStack, undefined, this);
|
objectStack, undefined, this);
|
||||||
@@ -319,7 +319,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 {import("../geom/LineString.js").default|import("../geom/LinearRing.js").default} value Geometry.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -340,7 +340,7 @@ class GML2 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/LineString} line LineString geometry.
|
* @param {import("../geom/LineString.js").default} line LineString geometry.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -352,7 +352,7 @@ class GML2 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {module:ol/geom/Polygon} geometry Polygon geometry.
|
* @param {import("../geom/Polygon.js").default} geometry Polygon geometry.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -398,7 +398,7 @@ class GML2 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/Polygon} polygon Polygon geometry.
|
* @param {import("../geom/Polygon.js").default} polygon Polygon geometry.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -410,7 +410,7 @@ class GML2 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/LinearRing} ring LinearRing geometry.
|
* @param {import("../geom/LinearRing.js").default} ring LinearRing geometry.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -446,7 +446,7 @@ class GML2 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {module:ol/geom/Point} geometry Point geometry.
|
* @param {import("../geom/Point.js").default} geometry Point geometry.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -466,7 +466,7 @@ class GML2 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {module:ol/geom/MultiPoint} geometry MultiPoint geometry.
|
* @param {import("../geom/MultiPoint.js").default} geometry MultiPoint geometry.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -486,7 +486,7 @@ class GML2 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/Point} point Point geometry.
|
* @param {import("../geom/Point.js").default} point Point geometry.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -498,7 +498,7 @@ class GML2 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {module:ol/geom/LinearRing} geometry LinearRing geometry.
|
* @param {import("../geom/LinearRing.js").default} geometry LinearRing geometry.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -515,7 +515,7 @@ class GML2 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {module:ol/geom/MultiPolygon} geometry MultiPolygon geometry.
|
* @param {import("../geom/MultiPolygon.js").default} geometry MultiPolygon geometry.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -536,7 +536,7 @@ class GML2 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/Polygon} polygon Polygon geometry.
|
* @param {import("../geom/Polygon.js").default} polygon Polygon geometry.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -551,7 +551,7 @@ class GML2 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {import("../extent.js").Extent} extent Extent.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -563,7 +563,7 @@ class GML2 extends GMLBase {
|
|||||||
}
|
}
|
||||||
const keys = ['lowerCorner', 'upperCorner'];
|
const keys = ['lowerCorner', 'upperCorner'];
|
||||||
const values = [extent[0] + ' ' + extent[1], extent[2] + ' ' + extent[3]];
|
const values = [extent[0] + ' ' + extent[1], extent[2] + ' ' + extent[3]];
|
||||||
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */
|
pushSerializeAndPop(/** @type {import("../xml.js").NodeStackItem} */
|
||||||
({node: node}), this.ENVELOPE_SERIALIZERS_,
|
({node: node}), this.ENVELOPE_SERIALIZERS_,
|
||||||
OBJECT_PROPERTY_NODE_FACTORY,
|
OBJECT_PROPERTY_NODE_FACTORY,
|
||||||
values,
|
values,
|
||||||
@@ -587,7 +587,7 @@ class GML2 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML2.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
|
GML2.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
|
||||||
@@ -598,7 +598,7 @@ GML2.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML2.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
|
GML2.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
|
||||||
@@ -610,7 +610,7 @@ GML2.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML2.prototype.BOX_PARSERS_ = {
|
GML2.prototype.BOX_PARSERS_ = {
|
||||||
@@ -622,7 +622,7 @@ GML2.prototype.BOX_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML2.prototype.GEOMETRY_PARSERS_ = {
|
GML2.prototype.GEOMETRY_PARSERS_ = {
|
||||||
@@ -645,7 +645,7 @@ GML2.prototype.GEOMETRY_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML2.prototype.GEOMETRY_SERIALIZERS_ = {
|
GML2.prototype.GEOMETRY_SERIALIZERS_ = {
|
||||||
@@ -677,7 +677,7 @@ GML2.prototype.GEOMETRY_SERIALIZERS_ = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML2.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
|
GML2.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
|
||||||
@@ -690,7 +690,7 @@ GML2.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML2.prototype.RING_SERIALIZERS_ = {
|
GML2.prototype.RING_SERIALIZERS_ = {
|
||||||
@@ -701,7 +701,7 @@ GML2.prototype.RING_SERIALIZERS_ = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML2.prototype.POINTMEMBER_SERIALIZERS_ = {
|
GML2.prototype.POINTMEMBER_SERIALIZERS_ = {
|
||||||
@@ -713,7 +713,7 @@ GML2.prototype.POINTMEMBER_SERIALIZERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML2.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
|
GML2.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
|
||||||
@@ -726,7 +726,7 @@ GML2.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML2.prototype.ENVELOPE_SERIALIZERS_ = {
|
GML2.prototype.ENVELOPE_SERIALIZERS_ = {
|
||||||
|
|||||||
+59
-59
@@ -52,10 +52,10 @@ const MULTIGEOMETRY_TO_MEMBER_NODENAME = {
|
|||||||
class GML3 extends GMLBase {
|
class GML3 extends GMLBase {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/format/GMLBase~Options=} opt_options Optional configuration object.
|
* @param {import("./GMLBase.js").Options=} opt_options Optional configuration object.
|
||||||
*/
|
*/
|
||||||
constructor(opt_options) {
|
constructor(opt_options) {
|
||||||
const options = /** @type {module:ol/format/GMLBase~Options} */
|
const options = /** @type {import("./GMLBase.js").Options} */
|
||||||
(opt_options ? opt_options : {});
|
(opt_options ? opt_options : {});
|
||||||
|
|
||||||
super(options);
|
super(options);
|
||||||
@@ -105,10 +105,10 @@ class GML3 extends GMLBase {
|
|||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {Array<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {module:ol/geom/MultiLineString|undefined} MultiLineString.
|
* @return {import("../geom/MultiLineString.js").default|undefined} MultiLineString.
|
||||||
*/
|
*/
|
||||||
readMultiCurve_(node, objectStack) {
|
readMultiCurve_(node, objectStack) {
|
||||||
/** @type {Array<module:ol/geom/LineString>} */
|
/** @type {Array<import("../geom/LineString.js").default>} */
|
||||||
const lineStrings = pushParseAndPop([],
|
const lineStrings = pushParseAndPop([],
|
||||||
this.MULTICURVE_PARSERS_, node, objectStack, this);
|
this.MULTICURVE_PARSERS_, node, objectStack, this);
|
||||||
if (lineStrings) {
|
if (lineStrings) {
|
||||||
@@ -123,10 +123,10 @@ class GML3 extends GMLBase {
|
|||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {Array<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {module:ol/geom/MultiPolygon|undefined} MultiPolygon.
|
* @return {import("../geom/MultiPolygon.js").default|undefined} MultiPolygon.
|
||||||
*/
|
*/
|
||||||
readMultiSurface_(node, objectStack) {
|
readMultiSurface_(node, objectStack) {
|
||||||
/** @type {Array<module:ol/geom/Polygon>} */
|
/** @type {Array<import("../geom/Polygon.js").default>} */
|
||||||
const polygons = pushParseAndPop([],
|
const polygons = pushParseAndPop([],
|
||||||
this.MULTISURFACE_PARSERS_, node, objectStack, this);
|
this.MULTISURFACE_PARSERS_, node, objectStack, this);
|
||||||
if (polygons) {
|
if (polygons) {
|
||||||
@@ -234,7 +234,7 @@ class GML3 extends GMLBase {
|
|||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {Array<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {module:ol/geom/Polygon|undefined} Polygon.
|
* @return {import("../geom/Polygon.js").default|undefined} Polygon.
|
||||||
*/
|
*/
|
||||||
readSurface_(node, objectStack) {
|
readSurface_(node, objectStack) {
|
||||||
/** @type {Array<Array<number>>} */
|
/** @type {Array<Array<number>>} */
|
||||||
@@ -258,7 +258,7 @@ class GML3 extends GMLBase {
|
|||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {Array<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {module:ol/geom/LineString|undefined} LineString.
|
* @return {import("../geom/LineString.js").default|undefined} LineString.
|
||||||
*/
|
*/
|
||||||
readCurve_(node, objectStack) {
|
readCurve_(node, objectStack) {
|
||||||
/** @type {Array<number>} */
|
/** @type {Array<number>} */
|
||||||
@@ -276,7 +276,7 @@ class GML3 extends GMLBase {
|
|||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {Array<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {module:ol/extent~Extent|undefined} Envelope.
|
* @return {import("../extent.js").Extent|undefined} Envelope.
|
||||||
*/
|
*/
|
||||||
readEnvelope_(node, objectStack) {
|
readEnvelope_(node, objectStack) {
|
||||||
/** @type {Array<number>} */
|
/** @type {Array<number>} */
|
||||||
@@ -380,7 +380,7 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {module:ol/geom/Point} value Point geometry.
|
* @param {import("../geom/Point.js").default} value Point geometry.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -436,7 +436,7 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {module:ol/geom/LineString|module:ol/geom/LinearRing} value Geometry.
|
* @param {import("../geom/LineString.js").default|import("../geom/LinearRing.js").default} value Geometry.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -460,7 +460,7 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {module:ol/geom/Point} geometry Point geometry.
|
* @param {import("../geom/Point.js").default} geometry Point geometry.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -477,7 +477,7 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {import("../extent.js").Extent} extent Extent.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
writeEnvelope(node, extent, objectStack) {
|
writeEnvelope(node, extent, objectStack) {
|
||||||
@@ -488,7 +488,7 @@ class GML3 extends GMLBase {
|
|||||||
}
|
}
|
||||||
const keys = ['lowerCorner', 'upperCorner'];
|
const keys = ['lowerCorner', 'upperCorner'];
|
||||||
const values = [extent[0] + ' ' + extent[1], extent[2] + ' ' + extent[3]];
|
const values = [extent[0] + ' ' + extent[1], extent[2] + ' ' + extent[3]];
|
||||||
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */
|
pushSerializeAndPop(/** @type {import("../xml.js").NodeStackItem} */
|
||||||
({node: node}), this.ENVELOPE_SERIALIZERS_,
|
({node: node}), this.ENVELOPE_SERIALIZERS_,
|
||||||
OBJECT_PROPERTY_NODE_FACTORY,
|
OBJECT_PROPERTY_NODE_FACTORY,
|
||||||
values,
|
values,
|
||||||
@@ -497,7 +497,7 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {module:ol/geom/LinearRing} geometry LinearRing geometry.
|
* @param {import("../geom/LinearRing.js").default} geometry LinearRing geometry.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -532,7 +532,7 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {module:ol/geom/Polygon} geometry Polygon geometry.
|
* @param {import("../geom/Polygon.js").default} geometry Polygon geometry.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -560,7 +560,7 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {module:ol/geom/LineString} geometry LineString geometry.
|
* @param {import("../geom/LineString.js").default} geometry LineString geometry.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -585,7 +585,7 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {module:ol/geom/MultiPolygon} geometry MultiPolygon geometry.
|
* @param {import("../geom/MultiPolygon.js").default} geometry MultiPolygon geometry.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -606,7 +606,7 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {module:ol/geom/MultiPoint} geometry MultiPoint geometry.
|
* @param {import("../geom/MultiPoint.js").default} geometry MultiPoint geometry.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -626,7 +626,7 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {module:ol/geom/MultiLineString} geometry MultiLineString geometry.
|
* @param {import("../geom/MultiLineString.js").default} geometry MultiLineString geometry.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -647,7 +647,7 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/LinearRing} ring LinearRing geometry.
|
* @param {import("../geom/LinearRing.js").default} ring LinearRing geometry.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -659,7 +659,7 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/Polygon} polygon Polygon geometry.
|
* @param {import("../geom/Polygon.js").default} polygon Polygon geometry.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -674,7 +674,7 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/Point} point Point geometry.
|
* @param {import("../geom/Point.js").default} point Point geometry.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -686,7 +686,7 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/LineString} line LineString geometry.
|
* @param {import("../geom/LineString.js").default} line LineString geometry.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -700,7 +700,7 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/Polygon} polygon Polygon geometry.
|
* @param {import("../geom/Polygon.js").default} polygon Polygon geometry.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -712,7 +712,7 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/LineString} line LineString geometry.
|
* @param {import("../geom/LineString.js").default} line LineString geometry.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -725,11 +725,11 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/Geometry|module:ol/extent~Extent} geometry Geometry.
|
* @param {import("../geom/Geometry.js").default|import("../extent.js").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 {import("./Feature.js").WriteOptions} */ (objectStack[objectStack.length - 1]);
|
||||||
const item = assign({}, context);
|
const item = assign({}, context);
|
||||||
item.node = node;
|
item.node = node;
|
||||||
let value;
|
let value;
|
||||||
@@ -741,9 +741,9 @@ class GML3 extends GMLBase {
|
|||||||
value = geometry;
|
value = geometry;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
value = transformWithOptions(/** @type {module:ol/geom/Geometry} */ (geometry), true, context);
|
value = transformWithOptions(/** @type {import("../geom/Geometry.js").default} */ (geometry), true, context);
|
||||||
}
|
}
|
||||||
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */
|
pushSerializeAndPop(/** @type {import("../xml.js").NodeStackItem} */
|
||||||
(item), this.GEOMETRY_SERIALIZERS_,
|
(item), this.GEOMETRY_SERIALIZERS_,
|
||||||
this.GEOMETRY_NODE_FACTORY_, [value],
|
this.GEOMETRY_NODE_FACTORY_, [value],
|
||||||
objectStack, undefined, this);
|
objectStack, undefined, this);
|
||||||
@@ -751,7 +751,7 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {module:ol/Feature} feature Feature.
|
* @param {import("../Feature.js").default} feature Feature.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
writeFeatureElement(node, feature, objectStack) {
|
writeFeatureElement(node, feature, objectStack) {
|
||||||
@@ -788,7 +788,7 @@ class GML3 extends GMLBase {
|
|||||||
}
|
}
|
||||||
const item = assign({}, context);
|
const item = assign({}, context);
|
||||||
item.node = node;
|
item.node = node;
|
||||||
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */
|
pushSerializeAndPop(/** @type {import("../xml.js").NodeStackItem} */
|
||||||
(item), context.serializers,
|
(item), context.serializers,
|
||||||
makeSimpleNodeFactory(undefined, featureNS),
|
makeSimpleNodeFactory(undefined, featureNS),
|
||||||
values,
|
values,
|
||||||
@@ -797,7 +797,7 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array<module:ol/Feature>} features Features.
|
* @param {Array<import("../Feature.js").default>} features Features.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -811,7 +811,7 @@ class GML3 extends GMLBase {
|
|||||||
this.writeFeatureElement, this);
|
this.writeFeatureElement, this);
|
||||||
const item = assign({}, context);
|
const item = assign({}, context);
|
||||||
item.node = node;
|
item.node = node;
|
||||||
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */
|
pushSerializeAndPop(/** @type {import("../xml.js").NodeStackItem} */
|
||||||
(item),
|
(item),
|
||||||
serializers,
|
serializers,
|
||||||
makeSimpleNodeFactory(featureType, featureNS), features,
|
makeSimpleNodeFactory(featureType, featureNS), features,
|
||||||
@@ -848,7 +848,7 @@ class GML3 extends GMLBase {
|
|||||||
const multiCurve = context['multiCurve'];
|
const multiCurve = context['multiCurve'];
|
||||||
let nodeName;
|
let nodeName;
|
||||||
if (!Array.isArray(value)) {
|
if (!Array.isArray(value)) {
|
||||||
nodeName = /** @type {module:ol/geom/Geometry} */ (value).getType();
|
nodeName = /** @type {import("../geom/Geometry.js").default} */ (value).getType();
|
||||||
if (nodeName === 'MultiPolygon' && multiSurface === true) {
|
if (nodeName === 'MultiPolygon' && multiSurface === true) {
|
||||||
nodeName = 'MultiSurface';
|
nodeName = 'MultiSurface';
|
||||||
} else if (nodeName === 'Polygon' && surface === true) {
|
} else if (nodeName === 'Polygon' && surface === true) {
|
||||||
@@ -868,8 +868,8 @@ class GML3 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* Encode a geometry in GML 3.1.1 Simple Features.
|
* Encode a geometry in GML 3.1.1 Simple Features.
|
||||||
*
|
*
|
||||||
* @param {module:ol/geom/Geometry} geometry Geometry.
|
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Options.
|
||||||
* @return {Node} Node.
|
* @return {Node} Node.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
@@ -890,8 +890,8 @@ 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<import("../Feature.js").default>} features Features.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Options.
|
||||||
* @return {Element} Node.
|
* @return {Element} Node.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
@@ -920,7 +920,7 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML3.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
|
GML3.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
|
||||||
@@ -933,7 +933,7 @@ GML3.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML3.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
|
GML3.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
|
||||||
@@ -946,7 +946,7 @@ GML3.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML3.prototype.GEOMETRY_PARSERS_ = {
|
GML3.prototype.GEOMETRY_PARSERS_ = {
|
||||||
@@ -976,7 +976,7 @@ GML3.prototype.GEOMETRY_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML3.prototype.MULTICURVE_PARSERS_ = {
|
GML3.prototype.MULTICURVE_PARSERS_ = {
|
||||||
@@ -991,7 +991,7 @@ GML3.prototype.MULTICURVE_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML3.prototype.MULTISURFACE_PARSERS_ = {
|
GML3.prototype.MULTISURFACE_PARSERS_ = {
|
||||||
@@ -1006,7 +1006,7 @@ GML3.prototype.MULTISURFACE_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML3.prototype.CURVEMEMBER_PARSERS_ = {
|
GML3.prototype.CURVEMEMBER_PARSERS_ = {
|
||||||
@@ -1020,7 +1020,7 @@ GML3.prototype.CURVEMEMBER_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML3.prototype.SURFACEMEMBER_PARSERS_ = {
|
GML3.prototype.SURFACEMEMBER_PARSERS_ = {
|
||||||
@@ -1033,7 +1033,7 @@ GML3.prototype.SURFACEMEMBER_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML3.prototype.SURFACE_PARSERS_ = {
|
GML3.prototype.SURFACE_PARSERS_ = {
|
||||||
@@ -1045,7 +1045,7 @@ GML3.prototype.SURFACE_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML3.prototype.CURVE_PARSERS_ = {
|
GML3.prototype.CURVE_PARSERS_ = {
|
||||||
@@ -1057,7 +1057,7 @@ GML3.prototype.CURVE_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML3.prototype.ENVELOPE_PARSERS_ = {
|
GML3.prototype.ENVELOPE_PARSERS_ = {
|
||||||
@@ -1072,7 +1072,7 @@ GML3.prototype.ENVELOPE_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML3.prototype.PATCHES_PARSERS_ = {
|
GML3.prototype.PATCHES_PARSERS_ = {
|
||||||
@@ -1085,7 +1085,7 @@ GML3.prototype.PATCHES_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML3.prototype.SEGMENTS_PARSERS_ = {
|
GML3.prototype.SEGMENTS_PARSERS_ = {
|
||||||
@@ -1100,8 +1100,8 @@ 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<import("../Feature.js").default>} features Features.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Options.
|
||||||
* @return {string} Result.
|
* @return {string} Result.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -1109,7 +1109,7 @@ GML3.prototype.writeFeatures;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML3.prototype.RING_SERIALIZERS_ = {
|
GML3.prototype.RING_SERIALIZERS_ = {
|
||||||
@@ -1121,7 +1121,7 @@ GML3.prototype.RING_SERIALIZERS_ = {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML3.prototype.ENVELOPE_SERIALIZERS_ = {
|
GML3.prototype.ENVELOPE_SERIALIZERS_ = {
|
||||||
@@ -1133,7 +1133,7 @@ GML3.prototype.ENVELOPE_SERIALIZERS_ = {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML3.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
|
GML3.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
|
||||||
@@ -1147,7 +1147,7 @@ GML3.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML3.prototype.POINTMEMBER_SERIALIZERS_ = {
|
GML3.prototype.POINTMEMBER_SERIALIZERS_ = {
|
||||||
@@ -1159,7 +1159,7 @@ GML3.prototype.POINTMEMBER_SERIALIZERS_ = {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML3.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
|
GML3.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
|
||||||
@@ -1173,7 +1173,7 @@ GML3.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML3.prototype.GEOMETRY_SERIALIZERS_ = {
|
GML3.prototype.GEOMETRY_SERIALIZERS_ = {
|
||||||
|
|||||||
+23
-23
@@ -87,12 +87,12 @@ const ONLY_WHITESPACE_RE = /^[\s\xa0]*$/;
|
|||||||
class GMLBase extends XMLFeature {
|
class GMLBase extends XMLFeature {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/format/GMLBase~Options=} opt_options Optional configuration object.
|
* @param {Options=} opt_options Optional configuration object.
|
||||||
*/
|
*/
|
||||||
constructor(opt_options) {
|
constructor(opt_options) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
const options = /** @type {module:ol/format/GMLBase~Options} */ (opt_options ? opt_options : {});
|
const options = /** @type {Options} */ (opt_options ? opt_options : {});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @protected
|
* @protected
|
||||||
@@ -132,7 +132,7 @@ class GMLBase extends XMLFeature {
|
|||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {Array<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Array<module:ol/Feature> | undefined} Features.
|
* @return {Array<import("../Feature.js").default> | undefined} Features.
|
||||||
*/
|
*/
|
||||||
readFeaturesInternal(node, objectStack) {
|
readFeaturesInternal(node, objectStack) {
|
||||||
const localName = node.localName;
|
const localName = node.localName;
|
||||||
@@ -220,17 +220,17 @@ class GMLBase extends XMLFeature {
|
|||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {Array<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/geom/Geometry|undefined} Geometry.
|
* @return {import("../geom/Geometry.js").default|undefined} Geometry.
|
||||||
*/
|
*/
|
||||||
readGeometryElement(node, objectStack) {
|
readGeometryElement(node, objectStack) {
|
||||||
const context = /** @type {Object} */ (objectStack[0]);
|
const context = /** @type {Object} */ (objectStack[0]);
|
||||||
context['srsName'] = node.firstElementChild.getAttribute('srsName');
|
context['srsName'] = node.firstElementChild.getAttribute('srsName');
|
||||||
context['srsDimension'] = node.firstElementChild.getAttribute('srsDimension');
|
context['srsDimension'] = node.firstElementChild.getAttribute('srsDimension');
|
||||||
/** @type {module:ol/geom/Geometry} */
|
/** @type {import("../geom/Geometry.js").default} */
|
||||||
const geometry = pushParseAndPop(null, this.GEOMETRY_PARSERS_, node, objectStack, this);
|
const geometry = pushParseAndPop(null, this.GEOMETRY_PARSERS_, node, objectStack, this);
|
||||||
if (geometry) {
|
if (geometry) {
|
||||||
return (
|
return (
|
||||||
/** @type {module:ol/geom/Geometry} */ (transformWithOptions(geometry, false, context))
|
/** @type {import("../geom/Geometry.js").default} */ (transformWithOptions(geometry, false, context))
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return undefined;
|
return undefined;
|
||||||
@@ -240,7 +240,7 @@ class GMLBase extends XMLFeature {
|
|||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {Array<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/Feature} Feature.
|
* @return {import("../Feature.js").default} Feature.
|
||||||
*/
|
*/
|
||||||
readFeatureElement(node, objectStack) {
|
readFeatureElement(node, objectStack) {
|
||||||
let n;
|
let n;
|
||||||
@@ -281,7 +281,7 @@ class GMLBase extends XMLFeature {
|
|||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {Array<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/geom/Point|undefined} Point.
|
* @return {import("../geom/Point.js").default|undefined} Point.
|
||||||
*/
|
*/
|
||||||
readPoint(node, objectStack) {
|
readPoint(node, objectStack) {
|
||||||
const flatCoordinates = this.readFlatCoordinatesFromNode_(node, objectStack);
|
const flatCoordinates = this.readFlatCoordinatesFromNode_(node, objectStack);
|
||||||
@@ -293,7 +293,7 @@ class GMLBase extends XMLFeature {
|
|||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {Array<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/geom/MultiPoint|undefined} MultiPoint.
|
* @return {import("../geom/MultiPoint.js").default|undefined} MultiPoint.
|
||||||
*/
|
*/
|
||||||
readMultiPoint(node, objectStack) {
|
readMultiPoint(node, objectStack) {
|
||||||
/** @type {Array<Array<number>>} */
|
/** @type {Array<Array<number>>} */
|
||||||
@@ -309,10 +309,10 @@ class GMLBase extends XMLFeature {
|
|||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {Array<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/geom/MultiLineString|undefined} MultiLineString.
|
* @return {import("../geom/MultiLineString.js").default|undefined} MultiLineString.
|
||||||
*/
|
*/
|
||||||
readMultiLineString(node, objectStack) {
|
readMultiLineString(node, objectStack) {
|
||||||
/** @type {Array<module:ol/geom/LineString>} */
|
/** @type {Array<import("../geom/LineString.js").default>} */
|
||||||
const lineStrings = pushParseAndPop([],
|
const lineStrings = pushParseAndPop([],
|
||||||
this.MULTILINESTRING_PARSERS_, node, objectStack, this);
|
this.MULTILINESTRING_PARSERS_, node, objectStack, this);
|
||||||
if (lineStrings) {
|
if (lineStrings) {
|
||||||
@@ -323,10 +323,10 @@ class GMLBase extends XMLFeature {
|
|||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {Array<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/geom/MultiPolygon|undefined} MultiPolygon.
|
* @return {import("../geom/MultiPolygon.js").default|undefined} MultiPolygon.
|
||||||
*/
|
*/
|
||||||
readMultiPolygon(node, objectStack) {
|
readMultiPolygon(node, objectStack) {
|
||||||
/** @type {Array<module:ol/geom/Polygon>} */
|
/** @type {Array<import("../geom/Polygon.js").default>} */
|
||||||
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);
|
||||||
@@ -363,7 +363,7 @@ class GMLBase extends XMLFeature {
|
|||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {Array<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/geom/LineString|undefined} LineString.
|
* @return {import("../geom/LineString.js").default|undefined} LineString.
|
||||||
*/
|
*/
|
||||||
readLineString(node, objectStack) {
|
readLineString(node, objectStack) {
|
||||||
const flatCoordinates = this.readFlatCoordinatesFromNode_(node, objectStack);
|
const flatCoordinates = this.readFlatCoordinatesFromNode_(node, objectStack);
|
||||||
@@ -395,7 +395,7 @@ class GMLBase extends XMLFeature {
|
|||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {Array<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/geom/LinearRing|undefined} LinearRing.
|
* @return {import("../geom/LinearRing.js").default|undefined} LinearRing.
|
||||||
*/
|
*/
|
||||||
readLinearRing(node, objectStack) {
|
readLinearRing(node, objectStack) {
|
||||||
const flatCoordinates = this.readFlatCoordinatesFromNode_(node, objectStack);
|
const flatCoordinates = this.readFlatCoordinatesFromNode_(node, objectStack);
|
||||||
@@ -407,7 +407,7 @@ class GMLBase extends XMLFeature {
|
|||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {Array<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/geom/Polygon|undefined} Polygon.
|
* @return {import("../geom/Polygon.js").default|undefined} Polygon.
|
||||||
*/
|
*/
|
||||||
readPolygon(node, objectStack) {
|
readPolygon(node, objectStack) {
|
||||||
/** @type {Array<Array<number>>} */
|
/** @type {Array<Array<number>>} */
|
||||||
@@ -471,7 +471,7 @@ class GMLBase extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GMLBase.prototype.MULTIPOINT_PARSERS_ = {
|
GMLBase.prototype.MULTIPOINT_PARSERS_ = {
|
||||||
@@ -484,7 +484,7 @@ GMLBase.prototype.MULTIPOINT_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GMLBase.prototype.MULTILINESTRING_PARSERS_ = {
|
GMLBase.prototype.MULTILINESTRING_PARSERS_ = {
|
||||||
@@ -497,7 +497,7 @@ GMLBase.prototype.MULTILINESTRING_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GMLBase.prototype.MULTIPOLYGON_PARSERS_ = {
|
GMLBase.prototype.MULTIPOLYGON_PARSERS_ = {
|
||||||
@@ -510,7 +510,7 @@ GMLBase.prototype.MULTIPOLYGON_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GMLBase.prototype.POINTMEMBER_PARSERS_ = {
|
GMLBase.prototype.POINTMEMBER_PARSERS_ = {
|
||||||
@@ -522,7 +522,7 @@ GMLBase.prototype.POINTMEMBER_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GMLBase.prototype.LINESTRINGMEMBER_PARSERS_ = {
|
GMLBase.prototype.LINESTRINGMEMBER_PARSERS_ = {
|
||||||
@@ -534,7 +534,7 @@ GMLBase.prototype.LINESTRINGMEMBER_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GMLBase.prototype.POLYGONMEMBER_PARSERS_ = {
|
GMLBase.prototype.POLYGONMEMBER_PARSERS_ = {
|
||||||
@@ -546,7 +546,7 @@ GMLBase.prototype.POLYGONMEMBER_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
* @protected
|
* @protected
|
||||||
*/
|
*/
|
||||||
GMLBase.prototype.RING_PARSERS = {
|
GMLBase.prototype.RING_PARSERS = {
|
||||||
|
|||||||
+53
-53
@@ -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<*>): (import("../Feature.js").default|undefined)>}
|
||||||
*/
|
*/
|
||||||
const FEATURE_READER = {
|
const FEATURE_READER = {
|
||||||
'rte': readRte,
|
'rte': readRte,
|
||||||
@@ -49,7 +49,7 @@ const FEATURE_READER = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const GPX_PARSERS = makeStructureNS(
|
const GPX_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -61,7 +61,7 @@ const GPX_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const LINK_PARSERS = makeStructureNS(
|
const LINK_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -72,7 +72,7 @@ const LINK_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||||
*/
|
*/
|
||||||
const GPX_SERIALIZERS = makeStructureNS(
|
const GPX_SERIALIZERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -84,7 +84,7 @@ const GPX_SERIALIZERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} Options
|
* @typedef {Object} Options
|
||||||
* @property {function(module:ol/Feature, Node)} [readExtensions] Callback function
|
* @property {function(import("../Feature.js").default, Node)} [readExtensions] Callback function
|
||||||
* to process `extensions` nodes. To prevent memory leaks, this callback function must
|
* to process `extensions` nodes. To prevent memory leaks, this callback function must
|
||||||
* not store any references to the node. Note that the `extensions`
|
* not store any references to the node. Note that the `extensions`
|
||||||
* node is not allowed in GPX 1.0. Moreover, only `extensions`
|
* node is not allowed in GPX 1.0. Moreover, only `extensions`
|
||||||
@@ -117,7 +117,7 @@ const GPX_SERIALIZERS = makeStructureNS(
|
|||||||
class GPX extends XMLFeature {
|
class GPX extends XMLFeature {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/format/GPX~Options=} opt_options Options.
|
* @param {Options=} opt_options Options.
|
||||||
*/
|
*/
|
||||||
constructor(opt_options) {
|
constructor(opt_options) {
|
||||||
super();
|
super();
|
||||||
@@ -131,14 +131,14 @@ class GPX extends XMLFeature {
|
|||||||
this.dataProjection = getProjection('EPSG:4326');
|
this.dataProjection = getProjection('EPSG:4326');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {function(module:ol/Feature, Node)|undefined}
|
* @type {function(import("../Feature.js").default, Node)|undefined}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.readExtensions_ = options.readExtensions;
|
this.readExtensions_ = options.readExtensions;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array<module:ol/Feature>} features List of features.
|
* @param {Array<import("../Feature.js").default>} 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<import("../Feature.js").default>} */
|
||||||
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,8 +200,8 @@ 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<import("../Feature.js").default>} features Features.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Options.
|
||||||
* @return {Node} Node.
|
* @return {Node} Node.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
@@ -216,7 +216,7 @@ class GPX extends XMLFeature {
|
|||||||
gpx.setAttribute('version', '1.1');
|
gpx.setAttribute('version', '1.1');
|
||||||
gpx.setAttribute('creator', 'OpenLayers');
|
gpx.setAttribute('creator', 'OpenLayers');
|
||||||
|
|
||||||
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */
|
pushSerializeAndPop(/** @type {import("../xml.js").NodeStackItem} */
|
||||||
({node: gpx}), GPX_SERIALIZERS, GPX_NODE_FACTORY, features, [opt_options]);
|
({node: gpx}), GPX_SERIALIZERS, GPX_NODE_FACTORY, features, [opt_options]);
|
||||||
return gpx;
|
return gpx;
|
||||||
}
|
}
|
||||||
@@ -225,7 +225,7 @@ class GPX extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const RTE_PARSERS = makeStructureNS(
|
const RTE_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -243,7 +243,7 @@ const RTE_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const RTEPT_PARSERS = makeStructureNS(
|
const RTEPT_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -254,7 +254,7 @@ const RTEPT_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const TRK_PARSERS = makeStructureNS(
|
const TRK_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -272,7 +272,7 @@ const TRK_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const TRKSEG_PARSERS = makeStructureNS(
|
const TRKSEG_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -282,7 +282,7 @@ const TRKSEG_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const TRKPT_PARSERS = makeStructureNS(
|
const TRKPT_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -293,7 +293,7 @@ const TRKPT_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const WPT_PARSERS = makeStructureNS(
|
const WPT_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -328,7 +328,7 @@ const LINK_SEQUENCE = ['text', 'type'];
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||||
*/
|
*/
|
||||||
const LINK_SERIALIZERS = makeStructureNS(
|
const LINK_SERIALIZERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -349,7 +349,7 @@ const RTE_SEQUENCE = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||||
*/
|
*/
|
||||||
const RTE_SERIALIZERS = makeStructureNS(
|
const RTE_SERIALIZERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -386,7 +386,7 @@ const TRK_SEQUENCE = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||||
*/
|
*/
|
||||||
const TRK_SERIALIZERS = makeStructureNS(
|
const TRK_SERIALIZERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -410,7 +410,7 @@ const TRKSEG_NODE_FACTORY = makeSimpleNodeFactory('trkpt');
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||||
*/
|
*/
|
||||||
const TRKSEG_SERIALIZERS = makeStructureNS(
|
const TRKSEG_SERIALIZERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -432,7 +432,7 @@ const WPT_TYPE_SEQUENCE = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||||
*/
|
*/
|
||||||
const WPT_TYPE_SERIALIZERS = makeStructureNS(
|
const WPT_TYPE_SERIALIZERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -475,7 +475,7 @@ const GEOMETRY_TYPE_TO_NODENAME = {
|
|||||||
* @return {Node|undefined} Node.
|
* @return {Node|undefined} Node.
|
||||||
*/
|
*/
|
||||||
function GPX_NODE_FACTORY(value, objectStack, opt_nodeName) {
|
function GPX_NODE_FACTORY(value, objectStack, opt_nodeName) {
|
||||||
const geometry = /** @type {module:ol/Feature} */ (value).getGeometry();
|
const geometry = /** @type {import("../Feature.js").default} */ (value).getGeometry();
|
||||||
if (geometry) {
|
if (geometry) {
|
||||||
const nodeName = GEOMETRY_TYPE_TO_NODENAME[geometry.getType()];
|
const nodeName = GEOMETRY_TYPE_TO_NODENAME[geometry.getType()];
|
||||||
if (nodeName) {
|
if (nodeName) {
|
||||||
@@ -488,7 +488,7 @@ 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 {LayoutOptions} layoutOptions Layout options.
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {!Object} values Values.
|
* @param {!Object} values Values.
|
||||||
* @return {Array<number>} Flat coordinates.
|
* @return {Array<number>} Flat coordinates.
|
||||||
@@ -519,10 +519,10 @@ function appendCoordinate(flatCoordinates, layoutOptions, node, values) {
|
|||||||
* Choose GeometryLayout based on flags in layoutOptions and adjust flatCoordinates
|
* Choose GeometryLayout based on flags in layoutOptions and adjust flatCoordinates
|
||||||
* 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 {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 {import("../geom/GeometryLayout.js").default} Layout.
|
||||||
*/
|
*/
|
||||||
function applyLayoutOptions(layoutOptions, flatCoordinates, ends) {
|
function applyLayoutOptions(layoutOptions, flatCoordinates, ends) {
|
||||||
let layout = GeometryLayout.XY;
|
let layout = GeometryLayout.XY;
|
||||||
@@ -592,7 +592,7 @@ function parseRtePt(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 {LayoutOptions} */ (rteValues['layoutOptions']);
|
||||||
appendCoordinate(flatCoordinates, layoutOptions, node, values);
|
appendCoordinate(flatCoordinates, layoutOptions, node, values);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -607,7 +607,7 @@ function parseTrkPt(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 {LayoutOptions} */ (trkValues['layoutOptions']);
|
||||||
appendCoordinate(flatCoordinates, layoutOptions, node, values);
|
appendCoordinate(flatCoordinates, layoutOptions, node, values);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -630,10 +630,10 @@ function parseTrkSeg(node, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {Array<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/Feature|undefined} Track.
|
* @return {import("../Feature.js").default|undefined} Track.
|
||||||
*/
|
*/
|
||||||
function readRte(node, objectStack) {
|
function readRte(node, objectStack) {
|
||||||
const options = /** @type {module:ol/format/Feature~ReadOptions} */ (objectStack[0]);
|
const options = /** @type {import("./Feature.js").ReadOptions} */ (objectStack[0]);
|
||||||
const values = pushParseAndPop({
|
const values = pushParseAndPop({
|
||||||
'flatCoordinates': [],
|
'flatCoordinates': [],
|
||||||
'layoutOptions': {}
|
'layoutOptions': {}
|
||||||
@@ -644,7 +644,7 @@ function readRte(node, objectStack) {
|
|||||||
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 {LayoutOptions} */ (values['layoutOptions']);
|
||||||
delete values['layoutOptions'];
|
delete values['layoutOptions'];
|
||||||
const layout = applyLayoutOptions(layoutOptions, flatCoordinates);
|
const layout = applyLayoutOptions(layoutOptions, flatCoordinates);
|
||||||
const geometry = new LineString(flatCoordinates, layout);
|
const geometry = new LineString(flatCoordinates, layout);
|
||||||
@@ -658,10 +658,10 @@ function readRte(node, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {Array<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/Feature|undefined} Track.
|
* @return {import("../Feature.js").default|undefined} Track.
|
||||||
*/
|
*/
|
||||||
function readTrk(node, objectStack) {
|
function readTrk(node, objectStack) {
|
||||||
const options = /** @type {module:ol/format/Feature~ReadOptions} */ (objectStack[0]);
|
const options = /** @type {import("./Feature.js").ReadOptions} */ (objectStack[0]);
|
||||||
const values = pushParseAndPop({
|
const values = pushParseAndPop({
|
||||||
'flatCoordinates': [],
|
'flatCoordinates': [],
|
||||||
'ends': [],
|
'ends': [],
|
||||||
@@ -675,7 +675,7 @@ function readTrk(node, objectStack) {
|
|||||||
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 {LayoutOptions} */ (values['layoutOptions']);
|
||||||
delete values['layoutOptions'];
|
delete values['layoutOptions'];
|
||||||
const layout = applyLayoutOptions(layoutOptions, flatCoordinates, ends);
|
const layout = applyLayoutOptions(layoutOptions, flatCoordinates, ends);
|
||||||
const geometry = new MultiLineString(flatCoordinates, layout, ends);
|
const geometry = new MultiLineString(flatCoordinates, layout, ends);
|
||||||
@@ -689,15 +689,15 @@ function readTrk(node, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {Array<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/Feature|undefined} Waypoint.
|
* @return {import("../Feature.js").default|undefined} Waypoint.
|
||||||
*/
|
*/
|
||||||
function readWpt(node, objectStack) {
|
function readWpt(node, objectStack) {
|
||||||
const options = /** @type {module:ol/format/Feature~ReadOptions} */ (objectStack[0]);
|
const options = /** @type {import("./Feature.js").ReadOptions} */ (objectStack[0]);
|
||||||
const values = pushParseAndPop({}, WPT_PARSERS, node, objectStack);
|
const values = pushParseAndPop({}, WPT_PARSERS, node, objectStack);
|
||||||
if (!values) {
|
if (!values) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
const layoutOptions = /** @type {module:ol/format/GPX~LayoutOptions} */ ({});
|
const layoutOptions = /** @type {LayoutOptions} */ ({});
|
||||||
const coordinates = appendCoordinate([], layoutOptions, node, values);
|
const coordinates = appendCoordinate([], layoutOptions, node, values);
|
||||||
const layout = applyLayoutOptions(layoutOptions, coordinates);
|
const layout = applyLayoutOptions(layoutOptions, coordinates);
|
||||||
const geometry = new Point(coordinates, layout);
|
const geometry = new Point(coordinates, layout);
|
||||||
@@ -721,7 +721,7 @@ function writeLink(node, value, objectStack) {
|
|||||||
properties['linkText'],
|
properties['linkText'],
|
||||||
properties['linkType']
|
properties['linkType']
|
||||||
];
|
];
|
||||||
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */ ({node: node}),
|
pushSerializeAndPop(/** @type {import("../xml.js").NodeStackItem} */ ({node: node}),
|
||||||
LINK_SERIALIZERS, OBJECT_PROPERTY_NODE_FACTORY,
|
LINK_SERIALIZERS, OBJECT_PROPERTY_NODE_FACTORY,
|
||||||
link, objectStack, LINK_SEQUENCE);
|
link, objectStack, LINK_SEQUENCE);
|
||||||
}
|
}
|
||||||
@@ -729,7 +729,7 @@ function writeLink(node, value, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
* @param {import("../coordinate.js").Coordinate} coordinate Coordinate.
|
||||||
* @param {Array<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function writeWptType(node, coordinate, objectStack) {
|
function writeWptType(node, coordinate, objectStack) {
|
||||||
@@ -764,7 +764,7 @@ function writeWptType(node, coordinate, objectStack) {
|
|||||||
RTEPT_TYPE_SEQUENCE[namespaceURI] :
|
RTEPT_TYPE_SEQUENCE[namespaceURI] :
|
||||||
WPT_TYPE_SEQUENCE[namespaceURI];
|
WPT_TYPE_SEQUENCE[namespaceURI];
|
||||||
const values = makeSequence(properties, orderedKeys);
|
const values = makeSequence(properties, orderedKeys);
|
||||||
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */
|
pushSerializeAndPop(/** @type {import("../xml.js").NodeStackItem} */
|
||||||
({node: node, 'properties': properties}),
|
({node: node, 'properties': properties}),
|
||||||
WPT_TYPE_SERIALIZERS, OBJECT_PROPERTY_NODE_FACTORY,
|
WPT_TYPE_SERIALIZERS, OBJECT_PROPERTY_NODE_FACTORY,
|
||||||
values, objectStack, orderedKeys);
|
values, objectStack, orderedKeys);
|
||||||
@@ -773,16 +773,16 @@ function writeWptType(node, coordinate, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/Feature} feature Feature.
|
* @param {import("../Feature.js").default} 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 {import("./Feature.js").WriteOptions} */ (objectStack[0]);
|
||||||
const properties = feature.getProperties();
|
const properties = feature.getProperties();
|
||||||
const context = {node: node, 'properties': properties};
|
const context = {node: node, 'properties': properties};
|
||||||
let geometry = feature.getGeometry();
|
let geometry = feature.getGeometry();
|
||||||
if (geometry) {
|
if (geometry) {
|
||||||
geometry = /** @type {module:ol/geom/LineString} */ (transformWithOptions(geometry, true, options));
|
geometry = /** @type {import("../geom/LineString.js").default} */ (transformWithOptions(geometry, true, options));
|
||||||
context['geometryLayout'] = geometry.getLayout();
|
context['geometryLayout'] = geometry.getLayout();
|
||||||
properties['rtept'] = geometry.getCoordinates();
|
properties['rtept'] = geometry.getCoordinates();
|
||||||
}
|
}
|
||||||
@@ -797,17 +797,17 @@ function writeRte(node, feature, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/Feature} feature Feature.
|
* @param {import("../Feature.js").default} 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 {import("./Feature.js").WriteOptions} */ (objectStack[0]);
|
||||||
const properties = feature.getProperties();
|
const properties = feature.getProperties();
|
||||||
/** @type {module:ol/xml~NodeStackItem} */
|
/** @type {import("../xml.js").NodeStackItem} */
|
||||||
const context = {node: node, 'properties': properties};
|
const context = {node: node, 'properties': properties};
|
||||||
let geometry = feature.getGeometry();
|
let geometry = feature.getGeometry();
|
||||||
if (geometry) {
|
if (geometry) {
|
||||||
geometry = /** @type {module:ol/geom/MultiLineString} */
|
geometry = /** @type {import("../geom/MultiLineString.js").default} */
|
||||||
(transformWithOptions(geometry, true, options));
|
(transformWithOptions(geometry, true, options));
|
||||||
properties['trkseg'] = geometry.getLineStrings();
|
properties['trkseg'] = geometry.getLineStrings();
|
||||||
}
|
}
|
||||||
@@ -822,11 +822,11 @@ function writeTrk(node, feature, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/LineString} lineString LineString.
|
* @param {import("../geom/LineString.js").default} 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 {import("../xml.js").NodeStackItem} */
|
||||||
const context = {node: node, 'geometryLayout': lineString.getLayout(),
|
const context = {node: node, 'geometryLayout': lineString.getLayout(),
|
||||||
'properties': {}};
|
'properties': {}};
|
||||||
pushSerializeAndPop(context,
|
pushSerializeAndPop(context,
|
||||||
@@ -837,16 +837,16 @@ function writeTrkSeg(node, lineString, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {module:ol/Feature} feature Feature.
|
* @param {import("../Feature.js").default} 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 {import("./Feature.js").WriteOptions} */ (objectStack[0]);
|
||||||
const context = objectStack[objectStack.length - 1];
|
const context = objectStack[objectStack.length - 1];
|
||||||
context['properties'] = feature.getProperties();
|
context['properties'] = feature.getProperties();
|
||||||
let geometry = feature.getGeometry();
|
let geometry = feature.getGeometry();
|
||||||
if (geometry) {
|
if (geometry) {
|
||||||
geometry = /** @type {module:ol/geom/Point} */
|
geometry = /** @type {import("../geom/Point.js").default} */
|
||||||
(transformWithOptions(geometry, true, options));
|
(transformWithOptions(geometry, true, options));
|
||||||
context['geometryLayout'] = geometry.getLayout();
|
context['geometryLayout'] = geometry.getLayout();
|
||||||
writeWptType(node, geometry.getCoordinates(), objectStack);
|
writeWptType(node, geometry.getCoordinates(), objectStack);
|
||||||
|
|||||||
+43
-43
@@ -21,8 +21,8 @@ import {get as getProjection} from '../proj.js';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} Options
|
* @typedef {Object} Options
|
||||||
* @property {module:ol/proj~ProjectionLike} [dataProjection='EPSG:4326'] Default data projection.
|
* @property {import("../proj.js").ProjectionLike} [dataProjection='EPSG:4326'] Default data projection.
|
||||||
* @property {module:ol/proj~ProjectionLike} [featureProjection] Projection for features read or
|
* @property {import("../proj.js").ProjectionLike} [featureProjection] Projection for features read or
|
||||||
* written by the format. Options passed to read or write methods will take precedence.
|
* written by the format. Options passed to read or write methods will take precedence.
|
||||||
* @property {string} [geometryName] Geometry name to use when creating features.
|
* @property {string} [geometryName] Geometry name to use when creating features.
|
||||||
* @property {boolean} [extractGeometryName=false] Certain GeoJSON providers include
|
* @property {boolean} [extractGeometryName=false] Certain GeoJSON providers include
|
||||||
@@ -41,7 +41,7 @@ import {get as getProjection} from '../proj.js';
|
|||||||
class GeoJSON extends JSONFeature {
|
class GeoJSON extends JSONFeature {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/format/GeoJSON~Options=} opt_options Options.
|
* @param {Options=} opt_options Options.
|
||||||
*/
|
*/
|
||||||
constructor(opt_options) {
|
constructor(opt_options) {
|
||||||
|
|
||||||
@@ -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<import("../Feature.js").default>} */
|
||||||
let features = null;
|
let features = null;
|
||||||
if (geoJSONObject.type === 'FeatureCollection') {
|
if (geoJSONObject.type === 'FeatureCollection') {
|
||||||
const geoJSONFeatureCollection = /** @type {GeoJSONFeatureCollection} */ (object);
|
const geoJSONFeatureCollection = /** @type {GeoJSONFeatureCollection} */ (object);
|
||||||
@@ -154,15 +154,15 @@ class GeoJSON extends JSONFeature {
|
|||||||
projection = this.dataProjection;
|
projection = this.dataProjection;
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
/** @type {module:ol/proj/Projection} */ (projection)
|
/** @type {import("../proj/Projection.js").default} */ (projection)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Encode a feature as a GeoJSON Feature object.
|
* Encode a feature as a GeoJSON Feature object.
|
||||||
*
|
*
|
||||||
* @param {module:ol/Feature} feature Feature.
|
* @param {import("../Feature.js").default} feature Feature.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
* @return {GeoJSONFeature} Object.
|
* @return {GeoJSONFeature} Object.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
@@ -196,8 +196,8 @@ 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<import("../Feature.js").default>} features Features.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
* @return {GeoJSONFeatureCollection} GeoJSON Object.
|
* @return {GeoJSONFeatureCollection} GeoJSON Object.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
@@ -217,8 +217,8 @@ class GeoJSON extends JSONFeature {
|
|||||||
/**
|
/**
|
||||||
* Encode a geometry as a GeoJSON object.
|
* Encode a geometry as a GeoJSON object.
|
||||||
*
|
*
|
||||||
* @param {module:ol/geom/Geometry} geometry Geometry.
|
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
* @return {GeoJSONGeometry|GeoJSONGeometryCollection} Object.
|
* @return {GeoJSONGeometry|GeoJSONGeometryCollection} Object.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
@@ -231,7 +231,7 @@ class GeoJSON extends JSONFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, function(GeoJSONObject): module:ol/geom/Geometry>}
|
* @type {Object<string, function(GeoJSONObject): import("../geom/Geometry.js").default>}
|
||||||
*/
|
*/
|
||||||
const GEOMETRY_READERS = {
|
const GEOMETRY_READERS = {
|
||||||
'Point': readPointGeometry,
|
'Point': readPointGeometry,
|
||||||
@@ -246,7 +246,7 @@ const GEOMETRY_READERS = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, function(module:ol/geom/Geometry, module:ol/format/Feature~WriteOptions=): (GeoJSONGeometry|GeoJSONGeometryCollection)>}
|
* @type {Object<string, function(import("../geom/Geometry.js").default, import("./Feature.js").WriteOptions=): (GeoJSONGeometry|GeoJSONGeometryCollection)>}
|
||||||
*/
|
*/
|
||||||
const GEOMETRY_WRITERS = {
|
const GEOMETRY_WRITERS = {
|
||||||
'Point': writePointGeometry,
|
'Point': writePointGeometry,
|
||||||
@@ -262,8 +262,8 @@ const GEOMETRY_WRITERS = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {GeoJSONGeometry|GeoJSONGeometryCollection} object Object.
|
* @param {GeoJSONGeometry|GeoJSONGeometryCollection} object Object.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
* @param {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||||
* @return {module:ol/geom/Geometry} Geometry.
|
* @return {import("../geom/Geometry.js").default} Geometry.
|
||||||
*/
|
*/
|
||||||
function readGeometry(object, opt_options) {
|
function readGeometry(object, opt_options) {
|
||||||
if (!object) {
|
if (!object) {
|
||||||
@@ -271,21 +271,21 @@ function readGeometry(object, opt_options) {
|
|||||||
}
|
}
|
||||||
const geometryReader = GEOMETRY_READERS[object.type];
|
const geometryReader = GEOMETRY_READERS[object.type];
|
||||||
return (
|
return (
|
||||||
/** @type {module:ol/geom/Geometry} */ (transformWithOptions(geometryReader(object), false, opt_options))
|
/** @type {import("../geom/Geometry.js").default} */ (transformWithOptions(geometryReader(object), false, opt_options))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {GeoJSONGeometryCollection} object Object.
|
* @param {GeoJSONGeometryCollection} object Object.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
* @param {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||||
* @return {module:ol/geom/GeometryCollection} Geometry collection.
|
* @return {import("../geom/GeometryCollection.js").default} Geometry collection.
|
||||||
*/
|
*/
|
||||||
function readGeometryCollectionGeometry(object, opt_options) {
|
function readGeometryCollectionGeometry(object, opt_options) {
|
||||||
const geometries = object.geometries.map(
|
const geometries = object.geometries.map(
|
||||||
/**
|
/**
|
||||||
* @param {GeoJSONGeometry} geometry Geometry.
|
* @param {GeoJSONGeometry} geometry Geometry.
|
||||||
* @return {module:ol/geom/Geometry} geometry Geometry.
|
* @return {import("../geom/Geometry.js").default} geometry Geometry.
|
||||||
*/
|
*/
|
||||||
function(geometry) {
|
function(geometry) {
|
||||||
return readGeometry(geometry, opt_options);
|
return readGeometry(geometry, opt_options);
|
||||||
@@ -296,7 +296,7 @@ function readGeometryCollectionGeometry(object, opt_options) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {GeoJSONGeometry} object Object.
|
* @param {GeoJSONGeometry} object Object.
|
||||||
* @return {module:ol/geom/Point} Point.
|
* @return {import("../geom/Point.js").default} Point.
|
||||||
*/
|
*/
|
||||||
function readPointGeometry(object) {
|
function readPointGeometry(object) {
|
||||||
return new Point(object.coordinates);
|
return new Point(object.coordinates);
|
||||||
@@ -305,7 +305,7 @@ function readPointGeometry(object) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {GeoJSONGeometry} object Object.
|
* @param {GeoJSONGeometry} object Object.
|
||||||
* @return {module:ol/geom/LineString} LineString.
|
* @return {import("../geom/LineString.js").default} LineString.
|
||||||
*/
|
*/
|
||||||
function readLineStringGeometry(object) {
|
function readLineStringGeometry(object) {
|
||||||
return new LineString(object.coordinates);
|
return new LineString(object.coordinates);
|
||||||
@@ -314,7 +314,7 @@ function readLineStringGeometry(object) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {GeoJSONGeometry} object Object.
|
* @param {GeoJSONGeometry} object Object.
|
||||||
* @return {module:ol/geom/MultiLineString} MultiLineString.
|
* @return {import("../geom/MultiLineString.js").default} MultiLineString.
|
||||||
*/
|
*/
|
||||||
function readMultiLineStringGeometry(object) {
|
function readMultiLineStringGeometry(object) {
|
||||||
return new MultiLineString(object.coordinates);
|
return new MultiLineString(object.coordinates);
|
||||||
@@ -323,7 +323,7 @@ function readMultiLineStringGeometry(object) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {GeoJSONGeometry} object Object.
|
* @param {GeoJSONGeometry} object Object.
|
||||||
* @return {module:ol/geom/MultiPoint} MultiPoint.
|
* @return {import("../geom/MultiPoint.js").default} MultiPoint.
|
||||||
*/
|
*/
|
||||||
function readMultiPointGeometry(object) {
|
function readMultiPointGeometry(object) {
|
||||||
return new MultiPoint(object.coordinates);
|
return new MultiPoint(object.coordinates);
|
||||||
@@ -332,7 +332,7 @@ function readMultiPointGeometry(object) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {GeoJSONGeometry} object Object.
|
* @param {GeoJSONGeometry} object Object.
|
||||||
* @return {module:ol/geom/MultiPolygon} MultiPolygon.
|
* @return {import("../geom/MultiPolygon.js").default} MultiPolygon.
|
||||||
*/
|
*/
|
||||||
function readMultiPolygonGeometry(object) {
|
function readMultiPolygonGeometry(object) {
|
||||||
return new MultiPolygon(object.coordinates);
|
return new MultiPolygon(object.coordinates);
|
||||||
@@ -341,7 +341,7 @@ function readMultiPolygonGeometry(object) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {GeoJSONGeometry} object Object.
|
* @param {GeoJSONGeometry} object Object.
|
||||||
* @return {module:ol/geom/Polygon} Polygon.
|
* @return {import("../geom/Polygon.js").default} Polygon.
|
||||||
*/
|
*/
|
||||||
function readPolygonGeometry(object) {
|
function readPolygonGeometry(object) {
|
||||||
return new Polygon(object.coordinates);
|
return new Polygon(object.coordinates);
|
||||||
@@ -349,19 +349,19 @@ function readPolygonGeometry(object) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/geom/Geometry} geometry Geometry.
|
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
* @return {GeoJSONGeometry|GeoJSONGeometryCollection} GeoJSON geometry.
|
* @return {GeoJSONGeometry|GeoJSONGeometryCollection} GeoJSON geometry.
|
||||||
*/
|
*/
|
||||||
function writeGeometry(geometry, opt_options) {
|
function writeGeometry(geometry, opt_options) {
|
||||||
const geometryWriter = GEOMETRY_WRITERS[geometry.getType()];
|
const geometryWriter = GEOMETRY_WRITERS[geometry.getType()];
|
||||||
return geometryWriter(/** @type {module:ol/geom/Geometry} */ (
|
return geometryWriter(/** @type {import("../geom/Geometry.js").default} */ (
|
||||||
transformWithOptions(geometry, true, opt_options)), opt_options);
|
transformWithOptions(geometry, true, opt_options)), opt_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/geom/Geometry} geometry Geometry.
|
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
||||||
* @return {GeoJSONGeometryCollection} Empty GeoJSON geometry collection.
|
* @return {GeoJSONGeometryCollection} Empty GeoJSON geometry collection.
|
||||||
*/
|
*/
|
||||||
function writeEmptyGeometryCollectionGeometry(geometry) {
|
function writeEmptyGeometryCollectionGeometry(geometry) {
|
||||||
@@ -373,8 +373,8 @@ function writeEmptyGeometryCollectionGeometry(geometry) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/geom/GeometryCollection} geometry Geometry.
|
* @param {import("../geom/GeometryCollection.js").default} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
* @return {GeoJSONGeometryCollection} GeoJSON geometry collection.
|
* @return {GeoJSONGeometryCollection} GeoJSON geometry collection.
|
||||||
*/
|
*/
|
||||||
function writeGeometryCollectionGeometry(geometry, opt_options) {
|
function writeGeometryCollectionGeometry(geometry, opt_options) {
|
||||||
@@ -391,8 +391,8 @@ function writeGeometryCollectionGeometry(geometry, opt_options) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/geom/LineString} geometry Geometry.
|
* @param {import("../geom/LineString.js").default} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
* @return {GeoJSONGeometry} GeoJSON geometry.
|
* @return {GeoJSONGeometry} GeoJSON geometry.
|
||||||
*/
|
*/
|
||||||
function writeLineStringGeometry(geometry, opt_options) {
|
function writeLineStringGeometry(geometry, opt_options) {
|
||||||
@@ -404,8 +404,8 @@ function writeLineStringGeometry(geometry, opt_options) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/geom/MultiLineString} geometry Geometry.
|
* @param {import("../geom/MultiLineString.js").default} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
* @return {GeoJSONGeometry} GeoJSON geometry.
|
* @return {GeoJSONGeometry} GeoJSON geometry.
|
||||||
*/
|
*/
|
||||||
function writeMultiLineStringGeometry(geometry, opt_options) {
|
function writeMultiLineStringGeometry(geometry, opt_options) {
|
||||||
@@ -417,8 +417,8 @@ function writeMultiLineStringGeometry(geometry, opt_options) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/geom/MultiPoint} geometry Geometry.
|
* @param {import("../geom/MultiPoint.js").default} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
* @return {GeoJSONGeometry} GeoJSON geometry.
|
* @return {GeoJSONGeometry} GeoJSON geometry.
|
||||||
*/
|
*/
|
||||||
function writeMultiPointGeometry(geometry, opt_options) {
|
function writeMultiPointGeometry(geometry, opt_options) {
|
||||||
@@ -430,8 +430,8 @@ function writeMultiPointGeometry(geometry, opt_options) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/geom/MultiPolygon} geometry Geometry.
|
* @param {import("../geom/MultiPolygon.js").default} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
* @return {GeoJSONGeometry} GeoJSON geometry.
|
* @return {GeoJSONGeometry} GeoJSON geometry.
|
||||||
*/
|
*/
|
||||||
function writeMultiPolygonGeometry(geometry, opt_options) {
|
function writeMultiPolygonGeometry(geometry, opt_options) {
|
||||||
@@ -447,8 +447,8 @@ function writeMultiPolygonGeometry(geometry, opt_options) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/geom/Point} geometry Geometry.
|
* @param {import("../geom/Point.js").default} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
* @return {GeoJSONGeometry} GeoJSON geometry.
|
* @return {GeoJSONGeometry} GeoJSON geometry.
|
||||||
*/
|
*/
|
||||||
function writePointGeometry(geometry, opt_options) {
|
function writePointGeometry(geometry, opt_options) {
|
||||||
@@ -460,8 +460,8 @@ function writePointGeometry(geometry, opt_options) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/geom/Polygon} geometry Geometry.
|
* @param {import("../geom/Polygon.js").default} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
* @return {GeoJSONGeometry} GeoJSON geometry.
|
* @return {GeoJSONGeometry} GeoJSON geometry.
|
||||||
*/
|
*/
|
||||||
function writePolygonGeometry(geometry, opt_options) {
|
function writePolygonGeometry(geometry, opt_options) {
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ const NEWLINE_RE = /\r\n|\r|\n/;
|
|||||||
class IGC extends TextFeature {
|
class IGC extends TextFeature {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/format/IGC~Options=} opt_options Options.
|
* @param {Options=} opt_options Options.
|
||||||
*/
|
*/
|
||||||
constructor(opt_options) {
|
constructor(opt_options) {
|
||||||
super();
|
super();
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ class JSONFeature extends FeatureFormat {
|
|||||||
* read a feature collection.
|
* read a feature collection.
|
||||||
*
|
*
|
||||||
* @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 {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||||
* @return {module:ol/Feature} Feature.
|
* @return {import("../Feature.js").default} Feature.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
readFeature(source, opt_options) {
|
readFeature(source, opt_options) {
|
||||||
@@ -43,8 +43,8 @@ class JSONFeature extends FeatureFormat {
|
|||||||
* collection.
|
* collection.
|
||||||
*
|
*
|
||||||
* @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 {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||||
* @return {Array<module:ol/Feature>} Features.
|
* @return {Array<import("../Feature.js").default>} Features.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
readFeatures(source, opt_options) {
|
readFeatures(source, opt_options) {
|
||||||
@@ -55,18 +55,18 @@ class JSONFeature extends FeatureFormat {
|
|||||||
/**
|
/**
|
||||||
* @abstract
|
* @abstract
|
||||||
* @param {Object} object Object.
|
* @param {Object} object Object.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
* @param {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||||
* @protected
|
* @protected
|
||||||
* @return {module:ol/Feature} Feature.
|
* @return {import("../Feature.js").default} Feature.
|
||||||
*/
|
*/
|
||||||
readFeatureFromObject(object, opt_options) {}
|
readFeatureFromObject(object, opt_options) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @abstract
|
* @abstract
|
||||||
* @param {Object} object Object.
|
* @param {Object} object Object.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
* @param {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||||
* @protected
|
* @protected
|
||||||
* @return {Array<module:ol/Feature>} Features.
|
* @return {Array<import("../Feature.js").default>} Features.
|
||||||
*/
|
*/
|
||||||
readFeaturesFromObject(object, opt_options) {}
|
readFeaturesFromObject(object, opt_options) {}
|
||||||
|
|
||||||
@@ -74,8 +74,8 @@ class JSONFeature extends FeatureFormat {
|
|||||||
* Read a geometry.
|
* Read a geometry.
|
||||||
*
|
*
|
||||||
* @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 {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||||
* @return {module:ol/geom/Geometry} Geometry.
|
* @return {import("../geom/Geometry.js").default} Geometry.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
readGeometry(source, opt_options) {
|
readGeometry(source, opt_options) {
|
||||||
@@ -86,9 +86,9 @@ class JSONFeature extends FeatureFormat {
|
|||||||
/**
|
/**
|
||||||
* @abstract
|
* @abstract
|
||||||
* @param {Object} object Object.
|
* @param {Object} object Object.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
* @param {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||||
* @protected
|
* @protected
|
||||||
* @return {module:ol/geom/Geometry} Geometry.
|
* @return {import("../geom/Geometry.js").default} Geometry.
|
||||||
*/
|
*/
|
||||||
readGeometryFromObject(object, opt_options) {}
|
readGeometryFromObject(object, opt_options) {}
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ class JSONFeature extends FeatureFormat {
|
|||||||
* Read the projection.
|
* Read the projection.
|
||||||
*
|
*
|
||||||
* @param {ArrayBuffer|Document|Node|Object|string} source Source.
|
* @param {ArrayBuffer|Document|Node|Object|string} source Source.
|
||||||
* @return {module:ol/proj/Projection} Projection.
|
* @return {import("../proj/Projection.js").default} Projection.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
readProjection(source) {
|
readProjection(source) {
|
||||||
@@ -107,15 +107,15 @@ class JSONFeature extends FeatureFormat {
|
|||||||
* @abstract
|
* @abstract
|
||||||
* @param {Object} object Object.
|
* @param {Object} object Object.
|
||||||
* @protected
|
* @protected
|
||||||
* @return {module:ol/proj/Projection} Projection.
|
* @return {import("../proj/Projection.js").default} Projection.
|
||||||
*/
|
*/
|
||||||
readProjectionFromObject(object) {}
|
readProjectionFromObject(object) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Encode a feature as string.
|
* Encode a feature as string.
|
||||||
*
|
*
|
||||||
* @param {module:ol/Feature} feature Feature.
|
* @param {import("../Feature.js").default} feature Feature.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
* @return {string} Encoded feature.
|
* @return {string} Encoded feature.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -125,8 +125,8 @@ class JSONFeature extends FeatureFormat {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @abstract
|
* @abstract
|
||||||
* @param {module:ol/Feature} feature Feature.
|
* @param {import("../Feature.js").default} feature Feature.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
* @return {Object} Object.
|
* @return {Object} Object.
|
||||||
*/
|
*/
|
||||||
writeFeatureObject(feature, opt_options) {}
|
writeFeatureObject(feature, opt_options) {}
|
||||||
@@ -134,8 +134,8 @@ 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<import("../Feature.js").default>} features Features.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
* @return {string} Encoded features.
|
* @return {string} Encoded features.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -145,8 +145,8 @@ class JSONFeature extends FeatureFormat {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @abstract
|
* @abstract
|
||||||
* @param {Array<module:ol/Feature>} features Features.
|
* @param {Array<import("../Feature.js").default>} features Features.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
* @return {Object} Object.
|
* @return {Object} Object.
|
||||||
*/
|
*/
|
||||||
writeFeaturesObject(features, opt_options) {}
|
writeFeaturesObject(features, opt_options) {}
|
||||||
@@ -154,8 +154,8 @@ class JSONFeature extends FeatureFormat {
|
|||||||
/**
|
/**
|
||||||
* Encode a geometry as string.
|
* Encode a geometry as string.
|
||||||
*
|
*
|
||||||
* @param {module:ol/geom/Geometry} geometry Geometry.
|
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
* @return {string} Encoded geometry.
|
* @return {string} Encoded geometry.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -165,8 +165,8 @@ class JSONFeature extends FeatureFormat {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @abstract
|
* @abstract
|
||||||
* @param {module:ol/geom/Geometry} geometry Geometry.
|
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
* @return {Object} Object.
|
* @return {Object} Object.
|
||||||
*/
|
*/
|
||||||
writeGeometryObject(geometry, opt_options) {}
|
writeGeometryObject(geometry, opt_options) {}
|
||||||
|
|||||||
+150
-150
File diff suppressed because it is too large
Load Diff
+12
-12
@@ -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((import("../geom/Geometry.js").default|Object<string,*>)=)|function(import("../geom/GeometryType.js").default,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},
|
||||||
@@ -41,13 +41,13 @@ import RenderFeature from '../render/Feature.js';
|
|||||||
* @classdesc
|
* @classdesc
|
||||||
* Feature format for reading data in the Mapbox MVT format.
|
* Feature format for reading data in the Mapbox MVT format.
|
||||||
*
|
*
|
||||||
* @param {module:ol/format/MVT~Options=} opt_options Options.
|
* @param {Options=} opt_options Options.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
class MVT extends FeatureFormat {
|
class MVT extends FeatureFormat {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/format/MVT~Options=} opt_options Options.
|
* @param {Options=} opt_options Options.
|
||||||
*/
|
*/
|
||||||
constructor(opt_options) {
|
constructor(opt_options) {
|
||||||
super();
|
super();
|
||||||
@@ -55,7 +55,7 @@ class MVT extends FeatureFormat {
|
|||||||
const options = opt_options ? opt_options : {};
|
const options = opt_options ? opt_options : {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {module:ol/proj/Projection}
|
* @type {import("../proj/Projection.js").default}
|
||||||
*/
|
*/
|
||||||
this.dataProjection = new Projection({
|
this.dataProjection = new Projection({
|
||||||
code: '',
|
code: '',
|
||||||
@@ -64,8 +64,8 @@ class MVT extends FeatureFormat {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {function((module:ol/geom/Geometry|Object<string,*>)=)|
|
* @type {function((import("../geom/Geometry.js").default|Object<string,*>)=)|
|
||||||
* function(module:ol/geom/GeometryType,Array<number>,
|
* function(import("../geom/GeometryType.js").default,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 ?
|
||||||
@@ -91,7 +91,7 @@ class MVT extends FeatureFormat {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {module:ol/extent~Extent}
|
* @type {import("../extent.js").Extent}
|
||||||
*/
|
*/
|
||||||
this.extent_ = null;
|
this.extent_ = null;
|
||||||
|
|
||||||
@@ -166,8 +166,8 @@ class MVT extends FeatureFormat {
|
|||||||
* @private
|
* @private
|
||||||
* @param {Object} pbf PBF
|
* @param {Object} pbf PBF
|
||||||
* @param {Object} rawFeature Raw Mapbox feature.
|
* @param {Object} rawFeature Raw Mapbox feature.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
* @param {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||||
* @return {module:ol/Feature|module:ol/render/Feature} Feature.
|
* @return {import("../Feature.js").default|import("../render/Feature.js").default} Feature.
|
||||||
*/
|
*/
|
||||||
createFeature_(pbf, rawFeature, opt_options) {
|
createFeature_(pbf, rawFeature, opt_options) {
|
||||||
const type = rawFeature.type;
|
const type = rawFeature.type;
|
||||||
@@ -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<import("../Feature.js").default|import("../render/Feature.js").default>} */
|
||||||
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) {
|
||||||
@@ -397,10 +397,10 @@ function readRawFeature(pbf, layer, i) {
|
|||||||
* @param {number} type The raw feature's geometry type
|
* @param {number} type The raw feature's geometry type
|
||||||
* @param {number} numEnds Number of ends of the flat coordinates of the
|
* @param {number} numEnds Number of ends of the flat coordinates of the
|
||||||
* geometry.
|
* geometry.
|
||||||
* @return {module:ol/geom/GeometryType} The geometry type.
|
* @return {import("../geom/GeometryType.js").default} The geometry type.
|
||||||
*/
|
*/
|
||||||
function getGeometryType(type, numEnds) {
|
function getGeometryType(type, numEnds) {
|
||||||
/** @type {module:ol/geom/GeometryType} */
|
/** @type {import("../geom/GeometryType.js").default} */
|
||||||
let geometryType;
|
let geometryType;
|
||||||
if (type === 1) {
|
if (type === 1) {
|
||||||
geometryType = numEnds === 1 ?
|
geometryType = numEnds === 1 ?
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ const NAMESPACE_URIS = [null];
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const WAY_PARSERS = makeStructureNS(
|
const WAY_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -35,7 +35,7 @@ const WAY_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const PARSERS = makeStructureNS(
|
const PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -106,7 +106,7 @@ class OSMXML extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const NODE_PARSERS = makeStructureNS(
|
const NODE_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -119,10 +119,10 @@ const NODE_PARSERS = makeStructureNS(
|
|||||||
* @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 {import("./Feature.js").ReadOptions} */ (objectStack[0]);
|
||||||
const state = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
const state = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||||
const id = node.getAttribute('id');
|
const id = node.getAttribute('id');
|
||||||
/** @type {module:ol/coordinate~Coordinate} */
|
/** @type {import("../coordinate.js").Coordinate} */
|
||||||
const coordinates = [
|
const coordinates = [
|
||||||
parseFloat(node.getAttribute('lon')),
|
parseFloat(node.getAttribute('lon')),
|
||||||
parseFloat(node.getAttribute('lat'))
|
parseFloat(node.getAttribute('lat'))
|
||||||
|
|||||||
+14
-14
@@ -16,7 +16,7 @@ const NAMESPACE_URIS = [null, 'http://www.opengis.net/ows/1.1'];
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const PARSERS = makeStructureNS(
|
const PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -56,7 +56,7 @@ class OWS extends XML {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const ADDRESS_PARSERS = makeStructureNS(
|
const ADDRESS_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -71,7 +71,7 @@ const ADDRESS_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const ALLOWED_VALUES_PARSERS = makeStructureNS(
|
const ALLOWED_VALUES_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -81,7 +81,7 @@ const ALLOWED_VALUES_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const CONSTRAINT_PARSERS = makeStructureNS(
|
const CONSTRAINT_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -91,7 +91,7 @@ const CONSTRAINT_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const CONTACT_INFO_PARSERS = makeStructureNS(
|
const CONTACT_INFO_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -102,7 +102,7 @@ const CONTACT_INFO_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const DCP_PARSERS = makeStructureNS(
|
const DCP_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -112,7 +112,7 @@ const DCP_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const HTTP_PARSERS = makeStructureNS(
|
const HTTP_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -123,7 +123,7 @@ const HTTP_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const OPERATION_PARSERS = makeStructureNS(
|
const OPERATION_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -133,7 +133,7 @@ const OPERATION_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const OPERATIONS_METADATA_PARSERS = makeStructureNS(
|
const OPERATIONS_METADATA_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -143,7 +143,7 @@ const OPERATIONS_METADATA_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const PHONE_PARSERS = makeStructureNS(
|
const PHONE_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -154,7 +154,7 @@ const PHONE_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const REQUEST_METHOD_PARSERS = makeStructureNS(
|
const REQUEST_METHOD_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -164,7 +164,7 @@ const REQUEST_METHOD_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const SERVICE_CONTACT_PARSERS =
|
const SERVICE_CONTACT_PARSERS =
|
||||||
makeStructureNS(
|
makeStructureNS(
|
||||||
@@ -177,7 +177,7 @@ const SERVICE_CONTACT_PARSERS =
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const SERVICE_IDENTIFICATION_PARSERS =
|
const SERVICE_IDENTIFICATION_PARSERS =
|
||||||
makeStructureNS(
|
makeStructureNS(
|
||||||
@@ -193,7 +193,7 @@ const SERVICE_IDENTIFICATION_PARSERS =
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const SERVICE_PROVIDER_PARSERS =
|
const SERVICE_PROVIDER_PARSERS =
|
||||||
makeStructureNS(
|
makeStructureNS(
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import {get as getProjection} from '../proj.js';
|
|||||||
/**
|
/**
|
||||||
* @typedef {Object} Options
|
* @typedef {Object} Options
|
||||||
* @property {number} [factor=1e5] The factor by which the coordinates values will be scaled.
|
* @property {number} [factor=1e5] The factor by which the coordinates values will be scaled.
|
||||||
* @property {module:ol/geom/GeometryLayout} [geometryLayout='XY'] Layout of the
|
* @property {import("../geom/GeometryLayout.js").default} [geometryLayout='XY'] Layout of the
|
||||||
* feature geometries created by the format reader.
|
* feature geometries created by the format reader.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ import {get as getProjection} from '../proj.js';
|
|||||||
class Polyline extends TextFeature {
|
class Polyline extends TextFeature {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/format/Polyline~Options=} opt_options Optional configuration object.
|
* @param {Options=} opt_options Optional configuration object.
|
||||||
*/
|
*/
|
||||||
constructor(opt_options) {
|
constructor(opt_options) {
|
||||||
super();
|
super();
|
||||||
@@ -59,7 +59,7 @@ class Polyline extends TextFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {module:ol/geom/GeometryLayout}
|
* @type {import("../geom/GeometryLayout.js").default}
|
||||||
*/
|
*/
|
||||||
this.geometryLayout_ = options.geometryLayout ?
|
this.geometryLayout_ = options.geometryLayout ?
|
||||||
options.geometryLayout : GeometryLayout.XY;
|
options.geometryLayout : GeometryLayout.XY;
|
||||||
@@ -91,7 +91,7 @@ class Polyline extends TextFeature {
|
|||||||
const coordinates = inflateCoordinates(flatCoordinates, 0, flatCoordinates.length, stride);
|
const coordinates = inflateCoordinates(flatCoordinates, 0, flatCoordinates.length, stride);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
/** @type {module:ol/geom/Geometry} */ (transformWithOptions(
|
/** @type {import("../geom/Geometry.js").default} */ (transformWithOptions(
|
||||||
new LineString(coordinates, this.geometryLayout_),
|
new LineString(coordinates, this.geometryLayout_),
|
||||||
false,
|
false,
|
||||||
this.adaptOptions(opt_options)
|
this.adaptOptions(opt_options)
|
||||||
@@ -123,7 +123,7 @@ class Polyline extends TextFeature {
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
writeGeometryText(geometry, opt_options) {
|
writeGeometryText(geometry, opt_options) {
|
||||||
geometry = /** @type {module:ol/geom/LineString} */
|
geometry = /** @type {import("../geom/LineString.js").default} */
|
||||||
(transformWithOptions(geometry, true, this.adaptOptions(opt_options)));
|
(transformWithOptions(geometry, true, this.adaptOptions(opt_options)));
|
||||||
const flatCoordinates = geometry.getFlatCoordinates();
|
const flatCoordinates = geometry.getFlatCoordinates();
|
||||||
const stride = geometry.getStride();
|
const stride = geometry.getStride();
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ class TextFeature extends FeatureFormat {
|
|||||||
* Read the feature from the source.
|
* Read the feature from the source.
|
||||||
*
|
*
|
||||||
* @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 {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||||
* @return {module:ol/Feature} Feature.
|
* @return {import("../Feature.js").default} Feature.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
readFeature(source, opt_options) {
|
readFeature(source, opt_options) {
|
||||||
@@ -39,9 +39,9 @@ class TextFeature extends FeatureFormat {
|
|||||||
/**
|
/**
|
||||||
* @abstract
|
* @abstract
|
||||||
* @param {string} text Text.
|
* @param {string} text Text.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
* @param {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||||
* @protected
|
* @protected
|
||||||
* @return {module:ol/Feature} Feature.
|
* @return {import("../Feature.js").default} Feature.
|
||||||
*/
|
*/
|
||||||
readFeatureFromText(text, opt_options) {}
|
readFeatureFromText(text, opt_options) {}
|
||||||
|
|
||||||
@@ -49,8 +49,8 @@ class TextFeature extends FeatureFormat {
|
|||||||
* Read the features from the source.
|
* Read the features from the source.
|
||||||
*
|
*
|
||||||
* @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 {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||||
* @return {Array<module:ol/Feature>} Features.
|
* @return {Array<import("../Feature.js").default>} Features.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
readFeatures(source, opt_options) {
|
readFeatures(source, opt_options) {
|
||||||
@@ -60,9 +60,9 @@ class TextFeature extends FeatureFormat {
|
|||||||
/**
|
/**
|
||||||
* @abstract
|
* @abstract
|
||||||
* @param {string} text Text.
|
* @param {string} text Text.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
* @param {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||||
* @protected
|
* @protected
|
||||||
* @return {Array<module:ol/Feature>} Features.
|
* @return {Array<import("../Feature.js").default>} Features.
|
||||||
*/
|
*/
|
||||||
readFeaturesFromText(text, opt_options) {}
|
readFeaturesFromText(text, opt_options) {}
|
||||||
|
|
||||||
@@ -70,8 +70,8 @@ class TextFeature extends FeatureFormat {
|
|||||||
* Read the geometry from the source.
|
* Read the geometry from the source.
|
||||||
*
|
*
|
||||||
* @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 {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||||
* @return {module:ol/geom/Geometry} Geometry.
|
* @return {import("../geom/Geometry.js").default} Geometry.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
readGeometry(source, opt_options) {
|
readGeometry(source, opt_options) {
|
||||||
@@ -81,9 +81,9 @@ class TextFeature extends FeatureFormat {
|
|||||||
/**
|
/**
|
||||||
* @abstract
|
* @abstract
|
||||||
* @param {string} text Text.
|
* @param {string} text Text.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
* @param {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||||
* @protected
|
* @protected
|
||||||
* @return {module:ol/geom/Geometry} Geometry.
|
* @return {import("../geom/Geometry.js").default} Geometry.
|
||||||
*/
|
*/
|
||||||
readGeometryFromText(text, opt_options) {}
|
readGeometryFromText(text, opt_options) {}
|
||||||
|
|
||||||
@@ -92,7 +92,7 @@ class TextFeature extends FeatureFormat {
|
|||||||
*
|
*
|
||||||
* @function
|
* @function
|
||||||
* @param {Document|Node|Object|string} source Source.
|
* @param {Document|Node|Object|string} source Source.
|
||||||
* @return {module:ol/proj/Projection} Projection.
|
* @return {import("../proj/Projection.js").default} Projection.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
readProjection(source) {
|
readProjection(source) {
|
||||||
@@ -102,7 +102,7 @@ class TextFeature extends FeatureFormat {
|
|||||||
/**
|
/**
|
||||||
* @param {string} text Text.
|
* @param {string} text Text.
|
||||||
* @protected
|
* @protected
|
||||||
* @return {module:ol/proj/Projection} Projection.
|
* @return {import("../proj/Projection.js").default} Projection.
|
||||||
*/
|
*/
|
||||||
readProjectionFromText(text) {
|
readProjectionFromText(text) {
|
||||||
return this.dataProjection;
|
return this.dataProjection;
|
||||||
@@ -112,8 +112,8 @@ class TextFeature extends FeatureFormat {
|
|||||||
* Encode a feature as a string.
|
* Encode a feature as a string.
|
||||||
*
|
*
|
||||||
* @function
|
* @function
|
||||||
* @param {module:ol/Feature} feature Feature.
|
* @param {import("../Feature.js").default} feature Feature.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
* @return {string} Encoded feature.
|
* @return {string} Encoded feature.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -123,8 +123,8 @@ class TextFeature extends FeatureFormat {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @abstract
|
* @abstract
|
||||||
* @param {module:ol/Feature} feature Features.
|
* @param {import("../Feature.js").default} feature Features.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
* @protected
|
* @protected
|
||||||
* @return {string} Text.
|
* @return {string} Text.
|
||||||
*/
|
*/
|
||||||
@@ -133,8 +133,8 @@ 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<import("../Feature.js").default>} features Features.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
* @return {string} Encoded features.
|
* @return {string} Encoded features.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -144,8 +144,8 @@ class TextFeature extends FeatureFormat {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @abstract
|
* @abstract
|
||||||
* @param {Array<module:ol/Feature>} features Features.
|
* @param {Array<import("../Feature.js").default>} features Features.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
* @protected
|
* @protected
|
||||||
* @return {string} Text.
|
* @return {string} Text.
|
||||||
*/
|
*/
|
||||||
@@ -155,8 +155,8 @@ class TextFeature extends FeatureFormat {
|
|||||||
* Write a single geometry.
|
* Write a single geometry.
|
||||||
*
|
*
|
||||||
* @function
|
* @function
|
||||||
* @param {module:ol/geom/Geometry} geometry Geometry.
|
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
* @return {string} Geometry.
|
* @return {string} Geometry.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -166,8 +166,8 @@ class TextFeature extends FeatureFormat {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @abstract
|
* @abstract
|
||||||
* @param {module:ol/geom/Geometry} geometry Geometry.
|
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
* @protected
|
* @protected
|
||||||
* @return {string} Text.
|
* @return {string} Text.
|
||||||
*/
|
*/
|
||||||
|
|||||||
+27
-27
@@ -15,7 +15,7 @@ import {get as getProjection} from '../proj.js';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} Options
|
* @typedef {Object} Options
|
||||||
* @property {module:ol/proj~ProjectionLike} [dataProjection='EPSG:4326'] Default data projection.
|
* @property {import("../proj.js").ProjectionLike} [dataProjection='EPSG:4326'] Default data projection.
|
||||||
* @property {string} [layerName] Set the name of the TopoJSON topology
|
* @property {string} [layerName] Set the name of the TopoJSON topology
|
||||||
* `objects`'s children as feature property with the specified name. This means
|
* `objects`'s children as feature property with the specified name. This means
|
||||||
* that when set to `'layer'`, a topology like
|
* that when set to `'layer'`, a topology like
|
||||||
@@ -47,7 +47,7 @@ import {get as getProjection} from '../proj.js';
|
|||||||
class TopoJSON extends JSONFeature {
|
class TopoJSON extends JSONFeature {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/format/TopoJSON~Options=} opt_options Options.
|
* @param {Options=} opt_options Options.
|
||||||
*/
|
*/
|
||||||
constructor(opt_options) {
|
constructor(opt_options) {
|
||||||
super();
|
super();
|
||||||
@@ -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<import("../Feature.js").default>} */
|
||||||
const features = [];
|
const features = [];
|
||||||
const topoJSONFeatures = topoJSONTopology.objects;
|
const topoJSONFeatures = topoJSONTopology.objects;
|
||||||
const property = this.layerName_;
|
const property = this.layerName_;
|
||||||
@@ -128,7 +128,7 @@ class TopoJSON extends JSONFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, function(TopoJSONGeometry, Array, ...Array): module:ol/geom/Geometry>}
|
* @type {Object<string, function(TopoJSONGeometry, Array, ...Array): import("../geom/Geometry.js").default>}
|
||||||
*/
|
*/
|
||||||
const GEOMETRY_READERS = {
|
const GEOMETRY_READERS = {
|
||||||
'Point': readPointGeometry,
|
'Point': readPointGeometry,
|
||||||
@@ -144,12 +144,12 @@ 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<import("../coordinate.js").Coordinate>>} arcs Array of arcs (already
|
||||||
* transformed).
|
* transformed).
|
||||||
* @return {Array<module:ol/coordinate~Coordinate>} Coordinates array.
|
* @return {Array<import("../coordinate.js").Coordinate>} Coordinates array.
|
||||||
*/
|
*/
|
||||||
function concatenateArcs(indices, arcs) {
|
function concatenateArcs(indices, arcs) {
|
||||||
/** @type {Array<module:ol/coordinate~Coordinate>} */
|
/** @type {Array<import("../coordinate.js").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) {
|
||||||
@@ -181,7 +181,7 @@ function concatenateArcs(indices, arcs) {
|
|||||||
* @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 {import("../geom/Point.js").default} Geometry.
|
||||||
*/
|
*/
|
||||||
function readPointGeometry(object, scale, translate) {
|
function readPointGeometry(object, scale, translate) {
|
||||||
const coordinates = object.coordinates;
|
const coordinates = object.coordinates;
|
||||||
@@ -198,7 +198,7 @@ function readPointGeometry(object, scale, translate) {
|
|||||||
* @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 {import("../geom/MultiPoint.js").default} Geometry.
|
||||||
*/
|
*/
|
||||||
function readMultiPointGeometry(object, scale, translate) {
|
function readMultiPointGeometry(object, scale, translate) {
|
||||||
const coordinates = object.coordinates;
|
const coordinates = object.coordinates;
|
||||||
@@ -215,8 +215,8 @@ 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<import("../coordinate.js").Coordinate>>} arcs Array of arcs.
|
||||||
* @return {module:ol/geom/LineString} Geometry.
|
* @return {import("../geom/LineString.js").default} Geometry.
|
||||||
*/
|
*/
|
||||||
function readLineStringGeometry(object, arcs) {
|
function readLineStringGeometry(object, arcs) {
|
||||||
const coordinates = concatenateArcs(object.arcs, arcs);
|
const coordinates = concatenateArcs(object.arcs, arcs);
|
||||||
@@ -228,8 +228,8 @@ 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<import("../coordinate.js").Coordinate>>} arcs Array of arcs.
|
||||||
* @return {module:ol/geom/MultiLineString} Geometry.
|
* @return {import("../geom/MultiLineString.js").default} Geometry.
|
||||||
*/
|
*/
|
||||||
function readMultiLineStringGeometry(object, arcs) {
|
function readMultiLineStringGeometry(object, arcs) {
|
||||||
const coordinates = [];
|
const coordinates = [];
|
||||||
@@ -244,8 +244,8 @@ 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<import("../coordinate.js").Coordinate>>} arcs Array of arcs.
|
||||||
* @return {module:ol/geom/Polygon} Geometry.
|
* @return {import("../geom/Polygon.js").default} Geometry.
|
||||||
*/
|
*/
|
||||||
function readPolygonGeometry(object, arcs) {
|
function readPolygonGeometry(object, arcs) {
|
||||||
const coordinates = [];
|
const coordinates = [];
|
||||||
@@ -260,8 +260,8 @@ 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<import("../coordinate.js").Coordinate>>} arcs Array of arcs.
|
||||||
* @return {module:ol/geom/MultiPolygon} Geometry.
|
* @return {import("../geom/MultiPolygon.js").default} Geometry.
|
||||||
*/
|
*/
|
||||||
function readMultiPolygonGeometry(object, arcs) {
|
function readMultiPolygonGeometry(object, arcs) {
|
||||||
const coordinates = [];
|
const coordinates = [];
|
||||||
@@ -284,14 +284,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<import("../coordinate.js").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 {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||||
* @return {Array<module:ol/Feature>} Array of features.
|
* @return {Array<import("../Feature.js").default>} 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;
|
||||||
@@ -308,14 +308,14 @@ 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<import("../coordinate.js").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 {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||||
* @return {module:ol/Feature} Feature.
|
* @return {import("../Feature.js").default} Feature.
|
||||||
*/
|
*/
|
||||||
function readFeatureFromGeometry(object, arcs, scale, translate, property, name, opt_options) {
|
function readFeatureFromGeometry(object, arcs, scale, translate, property, name, opt_options) {
|
||||||
let geometry;
|
let geometry;
|
||||||
@@ -327,7 +327,7 @@ function readFeatureFromGeometry(object, arcs, scale, translate, property, name,
|
|||||||
geometry = geometryReader(object, arcs);
|
geometry = geometryReader(object, arcs);
|
||||||
}
|
}
|
||||||
const feature = new Feature();
|
const feature = new Feature();
|
||||||
feature.setGeometry(/** @type {module:ol/geom/Geometry} */ (
|
feature.setGeometry(/** @type {import("../geom/Geometry.js").default} */ (
|
||||||
transformWithOptions(geometry, false, opt_options)));
|
transformWithOptions(geometry, false, opt_options)));
|
||||||
if (object.id !== undefined) {
|
if (object.id !== undefined) {
|
||||||
feature.setId(object.id);
|
feature.setId(object.id);
|
||||||
@@ -350,7 +350,7 @@ 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<import("../coordinate.js").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.
|
||||||
*/
|
*/
|
||||||
@@ -364,7 +364,7 @@ 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<import("../coordinate.js").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.
|
||||||
*/
|
*/
|
||||||
@@ -386,7 +386,7 @@ function transformArc(arc, scale, translate) {
|
|||||||
* Apply a linear transform to a vertex. The provided vertex is modified in
|
* Apply a linear transform to a vertex. The provided vertex is modified in
|
||||||
* place.
|
* place.
|
||||||
*
|
*
|
||||||
* @param {module:ol/coordinate~Coordinate} vertex Vertex.
|
* @param {import("../coordinate.js").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.
|
||||||
*/
|
*/
|
||||||
|
|||||||
+53
-53
@@ -18,7 +18,7 @@ import {createElementNS, isDocument, isNode, makeArrayPusher, makeChildAppender,
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const FEATURE_COLLECTION_PARSERS = {
|
const FEATURE_COLLECTION_PARSERS = {
|
||||||
'http://www.opengis.net/gml': {
|
'http://www.opengis.net/gml': {
|
||||||
@@ -30,7 +30,7 @@ const FEATURE_COLLECTION_PARSERS = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const TRANSACTION_SUMMARY_PARSERS = {
|
const TRANSACTION_SUMMARY_PARSERS = {
|
||||||
'http://www.opengis.net/wfs': {
|
'http://www.opengis.net/wfs': {
|
||||||
@@ -43,7 +43,7 @@ const TRANSACTION_SUMMARY_PARSERS = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const TRANSACTION_RESPONSE_PARSERS = {
|
const TRANSACTION_RESPONSE_PARSERS = {
|
||||||
'http://www.opengis.net/wfs': {
|
'http://www.opengis.net/wfs': {
|
||||||
@@ -56,7 +56,7 @@ const TRANSACTION_RESPONSE_PARSERS = {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||||
*/
|
*/
|
||||||
const QUERY_SERIALIZERS = {
|
const QUERY_SERIALIZERS = {
|
||||||
'http://www.opengis.net/wfs': {
|
'http://www.opengis.net/wfs': {
|
||||||
@@ -66,7 +66,7 @@ const QUERY_SERIALIZERS = {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||||
*/
|
*/
|
||||||
const TRANSACTION_SERIALIZERS = {
|
const TRANSACTION_SERIALIZERS = {
|
||||||
'http://www.opengis.net/wfs': {
|
'http://www.opengis.net/wfs': {
|
||||||
@@ -83,7 +83,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 {import("./GMLBase.js").default} [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.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -105,8 +105,8 @@ const TRANSACTION_SERIALIZERS = {
|
|||||||
* @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
|
||||||
* WFS 2.0 feature backported to WFS 1.1.0 by some Web Feature Services. Please note that some
|
* WFS 2.0 feature backported to WFS 1.1.0 by some Web Feature Services. Please note that some
|
||||||
* Web Feature Services have repurposed `maxfeatures` instead.
|
* Web Feature Services have repurposed `maxfeatures` instead.
|
||||||
* @property {module:ol/extent~Extent} [bbox] Extent to use for the BBOX filter.
|
* @property {import("../extent.js").Extent} [bbox] Extent to use for the BBOX filter.
|
||||||
* @property {module:ol/format/filter/Filter} [filter] Filter condition. See
|
* @property {import("./filter/Filter.js").default} [filter] Filter condition. See
|
||||||
* {@link module:ol/format/Filter} for more information.
|
* {@link module:ol/format/Filter} for more information.
|
||||||
* @property {string} [resultType] Indicates what response should be returned,
|
* @property {string} [resultType] Indicates what response should be returned,
|
||||||
* E.g. `hits` only includes the `numberOfFeatures` attribute in the response and no features.
|
* E.g. `hits` only includes the `numberOfFeatures` attribute in the response and no features.
|
||||||
@@ -124,7 +124,7 @@ const TRANSACTION_SERIALIZERS = {
|
|||||||
* @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 {import("./GMLBase.js").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`.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -133,7 +133,7 @@ const TRANSACTION_SERIALIZERS = {
|
|||||||
* Number of features; bounds/extent.
|
* Number of features; bounds/extent.
|
||||||
* @typedef {Object} FeatureCollectionMetadata
|
* @typedef {Object} FeatureCollectionMetadata
|
||||||
* @property {number} numberOfFeatures
|
* @property {number} numberOfFeatures
|
||||||
* @property {module:ol/extent~Extent} bounds
|
* @property {import("../extent.js").Extent} bounds
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -205,7 +205,7 @@ const DEFAULT_VERSION = '1.1.0';
|
|||||||
class WFS extends XMLFeature {
|
class WFS extends XMLFeature {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/format/WFS~Options=} opt_options Optional configuration object.
|
* @param {Options=} opt_options Optional configuration object.
|
||||||
*/
|
*/
|
||||||
constructor(opt_options) {
|
constructor(opt_options) {
|
||||||
super();
|
super();
|
||||||
@@ -226,7 +226,7 @@ class WFS extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {module:ol/format/GMLBase}
|
* @type {import("./GMLBase.js").default}
|
||||||
*/
|
*/
|
||||||
this.gmlFormat_ = options.gmlFormat ?
|
this.gmlFormat_ = options.gmlFormat ?
|
||||||
options.gmlFormat : new GML3();
|
options.gmlFormat : new GML3();
|
||||||
@@ -257,7 +257,7 @@ class WFS extends XMLFeature {
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
readFeaturesFromNode(node, opt_options) {
|
readFeaturesFromNode(node, opt_options) {
|
||||||
const context = /** @type {module:ol/xml~NodeStackItem} */ ({
|
const context = /** @type {import("../xml.js").NodeStackItem} */ ({
|
||||||
'featureType': this.featureType_,
|
'featureType': this.featureType_,
|
||||||
'featureNS': this.featureNS_
|
'featureNS': this.featureNS_
|
||||||
});
|
});
|
||||||
@@ -279,7 +279,7 @@ class WFS extends XMLFeature {
|
|||||||
* Read transaction response of the source.
|
* Read transaction response of the source.
|
||||||
*
|
*
|
||||||
* @param {Document|Element|Object|string} source Source.
|
* @param {Document|Element|Object|string} source Source.
|
||||||
* @return {module:ol/format/WFS~TransactionResponse|undefined} Transaction response.
|
* @return {TransactionResponse|undefined} Transaction response.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
readTransactionResponse(source) {
|
readTransactionResponse(source) {
|
||||||
@@ -300,7 +300,7 @@ class WFS extends XMLFeature {
|
|||||||
* Read feature collection metadata of the source.
|
* Read feature collection metadata of the source.
|
||||||
*
|
*
|
||||||
* @param {Document|Element|Object|string} source Source.
|
* @param {Document|Element|Object|string} source Source.
|
||||||
* @return {module:ol/format/WFS~FeatureCollectionMetadata|undefined}
|
* @return {FeatureCollectionMetadata|undefined}
|
||||||
* FeatureCollection metadata.
|
* FeatureCollection metadata.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -321,7 +321,7 @@ class WFS extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Document} doc Document.
|
* @param {Document} doc Document.
|
||||||
* @return {module:ol/format/WFS~FeatureCollectionMetadata|undefined}
|
* @return {FeatureCollectionMetadata|undefined}
|
||||||
* FeatureCollection metadata.
|
* FeatureCollection metadata.
|
||||||
*/
|
*/
|
||||||
readFeatureCollectionMetadataFromDocument(doc) {
|
readFeatureCollectionMetadataFromDocument(doc) {
|
||||||
@@ -335,7 +335,7 @@ class WFS extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @return {module:ol/format/WFS~FeatureCollectionMetadata|undefined}
|
* @return {FeatureCollectionMetadata|undefined}
|
||||||
* FeatureCollection metadata.
|
* FeatureCollection metadata.
|
||||||
*/
|
*/
|
||||||
readFeatureCollectionMetadataFromNode(node) {
|
readFeatureCollectionMetadataFromNode(node) {
|
||||||
@@ -344,13 +344,13 @@ class WFS extends XMLFeature {
|
|||||||
node.getAttribute('numberOfFeatures'));
|
node.getAttribute('numberOfFeatures'));
|
||||||
result['numberOfFeatures'] = value;
|
result['numberOfFeatures'] = value;
|
||||||
return pushParseAndPop(
|
return pushParseAndPop(
|
||||||
/** @type {module:ol/format/WFS~FeatureCollectionMetadata} */ (result),
|
/** @type {FeatureCollectionMetadata} */ (result),
|
||||||
FEATURE_COLLECTION_PARSERS, node, [], this.gmlFormat_);
|
FEATURE_COLLECTION_PARSERS, node, [], this.gmlFormat_);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Document} doc Document.
|
* @param {Document} doc Document.
|
||||||
* @return {module:ol/format/WFS~TransactionResponse|undefined} Transaction response.
|
* @return {TransactionResponse|undefined} Transaction response.
|
||||||
*/
|
*/
|
||||||
readTransactionResponseFromDocument(doc) {
|
readTransactionResponseFromDocument(doc) {
|
||||||
for (let n = doc.firstChild; n; n = n.nextSibling) {
|
for (let n = doc.firstChild; n; n = n.nextSibling) {
|
||||||
@@ -363,18 +363,18 @@ class WFS extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @return {module:ol/format/WFS~TransactionResponse|undefined} Transaction response.
|
* @return {TransactionResponse|undefined} Transaction response.
|
||||||
*/
|
*/
|
||||||
readTransactionResponseFromNode(node) {
|
readTransactionResponseFromNode(node) {
|
||||||
return pushParseAndPop(
|
return pushParseAndPop(
|
||||||
/** @type {module:ol/format/WFS~TransactionResponse} */({}),
|
/** @type {TransactionResponse} */({}),
|
||||||
TRANSACTION_RESPONSE_PARSERS, node, []);
|
TRANSACTION_RESPONSE_PARSERS, node, []);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Encode format as WFS `GetFeature` and return the Node.
|
* Encode format as WFS `GetFeature` and return the Node.
|
||||||
*
|
*
|
||||||
* @param {module:ol/format/WFS~WriteGetFeatureOptions} options Options.
|
* @param {WriteGetFeatureOptions} options Options.
|
||||||
* @return {Node} Result.
|
* @return {Node} Result.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -417,7 +417,7 @@ class WFS extends XMLFeature {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
node.setAttributeNS(XML_SCHEMA_INSTANCE_URI, 'xsi:schemaLocation', this.schemaLocation_);
|
node.setAttributeNS(XML_SCHEMA_INSTANCE_URI, 'xsi:schemaLocation', this.schemaLocation_);
|
||||||
/** @type {module:ol/xml~NodeStackItem} */
|
/** @type {import("../xml.js").NodeStackItem} */
|
||||||
const context = {
|
const context = {
|
||||||
node: node,
|
node: node,
|
||||||
'srsName': options.srsName,
|
'srsName': options.srsName,
|
||||||
@@ -436,10 +436,10 @@ class WFS extends XMLFeature {
|
|||||||
/**
|
/**
|
||||||
* 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<import("../Feature.js").default>} inserts The features to insert.
|
||||||
* @param {Array<module:ol/Feature>} updates The features to update.
|
* @param {Array<import("../Feature.js").default>} updates The features to update.
|
||||||
* @param {Array<module:ol/Feature>} deletes The features to delete.
|
* @param {Array<import("../Feature.js").default>} deletes The features to delete.
|
||||||
* @param {module:ol/format/WFS~WriteTransactionOptions} options Write options.
|
* @param {WriteTransactionOptions} options Write options.
|
||||||
* @return {Node} Result.
|
* @return {Node} Result.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -451,7 +451,7 @@ class WFS extends XMLFeature {
|
|||||||
node.setAttribute('service', 'WFS');
|
node.setAttribute('service', 'WFS');
|
||||||
node.setAttribute('version', version);
|
node.setAttribute('version', version);
|
||||||
let baseObj;
|
let baseObj;
|
||||||
/** @type {module:ol/xml~NodeStackItem} */
|
/** @type {import("../xml.js").NodeStackItem} */
|
||||||
let obj;
|
let obj;
|
||||||
if (options) {
|
if (options) {
|
||||||
baseObj = options.gmlOptions ? options.gmlOptions : {};
|
baseObj = options.gmlOptions ? options.gmlOptions : {};
|
||||||
@@ -549,7 +549,7 @@ function readTransactionSummary(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const OGC_FID_PARSERS = {
|
const OGC_FID_PARSERS = {
|
||||||
'http://www.opengis.net/ogc': {
|
'http://www.opengis.net/ogc': {
|
||||||
@@ -571,7 +571,7 @@ function fidParser(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const INSERT_RESULTS_PARSERS = {
|
const INSERT_RESULTS_PARSERS = {
|
||||||
'http://www.opengis.net/wfs': {
|
'http://www.opengis.net/wfs': {
|
||||||
@@ -593,7 +593,7 @@ function readInsertResults(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {module:ol/Feature} feature Feature.
|
* @param {import("../Feature.js").default} feature Feature.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeFeature(node, feature, objectStack) {
|
function writeFeature(node, feature, objectStack) {
|
||||||
@@ -644,7 +644,7 @@ function getTypeName(featurePrefix, featureType) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {module:ol/Feature} feature Feature.
|
* @param {import("../Feature.js").default} feature Feature.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeDelete(node, feature, objectStack) {
|
function writeDelete(node, feature, objectStack) {
|
||||||
@@ -665,7 +665,7 @@ function writeDelete(node, feature, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {module:ol/Feature} feature Feature.
|
* @param {import("../Feature.js").default} feature Feature.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeUpdate(node, feature, objectStack) {
|
function writeUpdate(node, feature, objectStack) {
|
||||||
@@ -692,7 +692,7 @@ function writeUpdate(node, feature, objectStack) {
|
|||||||
values.push({name: name, value: value});
|
values.push({name: name, value: value});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */ (
|
pushSerializeAndPop(/** @type {import("../xml.js").NodeStackItem} */ (
|
||||||
{'gmlVersion': context['gmlVersion'], node: node,
|
{'gmlVersion': context['gmlVersion'], node: node,
|
||||||
'hasZ': context['hasZ'], 'srsName': context['srsName']}),
|
'hasZ': context['hasZ'], 'srsName': context['srsName']}),
|
||||||
TRANSACTION_SERIALIZERS,
|
TRANSACTION_SERIALIZERS,
|
||||||
@@ -751,7 +751,7 @@ function writeNative(node, nativeElement, objectStack) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, import("../xml.js").Serializer>>}
|
||||||
*/
|
*/
|
||||||
const GETFEATURE_SERIALIZERS = {
|
const GETFEATURE_SERIALIZERS = {
|
||||||
'http://www.opengis.net/wfs': {
|
'http://www.opengis.net/wfs': {
|
||||||
@@ -804,7 +804,7 @@ function writeQuery(node, featureType, objectStack) {
|
|||||||
if (featureNS) {
|
if (featureNS) {
|
||||||
node.setAttributeNS(XMLNS, 'xmlns:' + featurePrefix, featureNS);
|
node.setAttributeNS(XMLNS, 'xmlns:' + featurePrefix, featureNS);
|
||||||
}
|
}
|
||||||
const item = /** @type {module:ol/xml~NodeStackItem} */ (assign({}, context));
|
const item = /** @type {import("../xml.js").NodeStackItem} */ (assign({}, context));
|
||||||
item.node = node;
|
item.node = node;
|
||||||
pushSerializeAndPop(item,
|
pushSerializeAndPop(item,
|
||||||
QUERY_SERIALIZERS,
|
QUERY_SERIALIZERS,
|
||||||
@@ -821,11 +821,11 @@ function writeQuery(node, featureType, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/format/filter/Filter} filter Filter.
|
* @param {import("./filter/Filter.js").default} 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 {import("../xml.js").NodeStackItem} */
|
||||||
const item = {node: node};
|
const item = {node: node};
|
||||||
pushSerializeAndPop(item,
|
pushSerializeAndPop(item,
|
||||||
GETFEATURE_SERIALIZERS,
|
GETFEATURE_SERIALIZERS,
|
||||||
@@ -836,7 +836,7 @@ function writeFilterCondition(node, filter, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/format/filter/Bbox} filter Filter.
|
* @param {import("./filter/Bbox.js").default} filter Filter.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeBboxFilter(node, filter, objectStack) {
|
function writeBboxFilter(node, filter, objectStack) {
|
||||||
@@ -850,7 +850,7 @@ function writeBboxFilter(node, filter, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/format/filter/Contains} filter Filter.
|
* @param {import("./filter/Contains.js").default} filter Filter.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeContainsFilter(node, filter, objectStack) {
|
function writeContainsFilter(node, filter, objectStack) {
|
||||||
@@ -864,7 +864,7 @@ function writeContainsFilter(node, filter, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/format/filter/Intersects} filter Filter.
|
* @param {import("./filter/Intersects.js").default} filter Filter.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeIntersectsFilter(node, filter, objectStack) {
|
function writeIntersectsFilter(node, filter, objectStack) {
|
||||||
@@ -878,7 +878,7 @@ function writeIntersectsFilter(node, filter, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/format/filter/Within} filter Filter.
|
* @param {import("./filter/Within.js").default} filter Filter.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeWithinFilter(node, filter, objectStack) {
|
function writeWithinFilter(node, filter, objectStack) {
|
||||||
@@ -892,7 +892,7 @@ function writeWithinFilter(node, filter, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/format/filter/During} filter Filter.
|
* @param {import("./filter/During.js").default} filter Filter.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeDuringFilter(node, filter, objectStack) {
|
function writeDuringFilter(node, filter, objectStack) {
|
||||||
@@ -917,11 +917,11 @@ function writeDuringFilter(node, filter, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/format/filter/LogicalNary} filter Filter.
|
* @param {import("./filter/LogicalNary.js").default} 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 {import("../xml.js").NodeStackItem} */
|
||||||
const item = {node: node};
|
const item = {node: node};
|
||||||
const conditions = filter.conditions;
|
const conditions = filter.conditions;
|
||||||
for (let i = 0, ii = conditions.length; i < ii; ++i) {
|
for (let i = 0, ii = conditions.length; i < ii; ++i) {
|
||||||
@@ -936,11 +936,11 @@ function writeLogicalFilter(node, filter, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/format/filter/Not} filter Filter.
|
* @param {import("./filter/Not.js").default} 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 {import("../xml.js").NodeStackItem} */
|
||||||
const item = {node: node};
|
const item = {node: node};
|
||||||
const condition = filter.condition;
|
const condition = filter.condition;
|
||||||
pushSerializeAndPop(item,
|
pushSerializeAndPop(item,
|
||||||
@@ -952,7 +952,7 @@ function writeNotFilter(node, filter, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {module:ol/format/filter/ComparisonBinary} filter Filter.
|
* @param {import("./filter/ComparisonBinary.js").default} filter Filter.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeComparisonFilter(node, filter, objectStack) {
|
function writeComparisonFilter(node, filter, objectStack) {
|
||||||
@@ -966,7 +966,7 @@ function writeComparisonFilter(node, filter, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/format/filter/IsNull} filter Filter.
|
* @param {import("./filter/IsNull.js").default} filter Filter.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeIsNullFilter(node, filter, objectStack) {
|
function writeIsNullFilter(node, filter, objectStack) {
|
||||||
@@ -976,7 +976,7 @@ function writeIsNullFilter(node, filter, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/format/filter/IsBetween} filter Filter.
|
* @param {import("./filter/IsBetween.js").default} filter Filter.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeIsBetweenFilter(node, filter, objectStack) {
|
function writeIsBetweenFilter(node, filter, objectStack) {
|
||||||
@@ -994,7 +994,7 @@ function writeIsBetweenFilter(node, filter, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {module:ol/format/filter/IsLike} filter Filter.
|
* @param {import("./filter/IsLike.js").default} filter Filter.
|
||||||
* @param {Array<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeIsLikeFilter(node, filter, objectStack) {
|
function writeIsLikeFilter(node, filter, objectStack) {
|
||||||
@@ -1056,7 +1056,7 @@ function writeTimeInstant(node, time) {
|
|||||||
/**
|
/**
|
||||||
* Encode filter as WFS `Filter` and return the Node.
|
* Encode filter as WFS `Filter` and return the Node.
|
||||||
*
|
*
|
||||||
* @param {module:ol/format/filter/Filter} filter Filter.
|
* @param {import("./filter/Filter.js").default} filter Filter.
|
||||||
* @return {Node} Result.
|
* @return {Node} Result.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -1074,7 +1074,7 @@ export function writeFilter(filter) {
|
|||||||
*/
|
*/
|
||||||
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]);
|
||||||
const item = /** @type {module:ol/xml~NodeStackItem} */ (assign({}, context));
|
const item = /** @type {import("../xml.js").NodeStackItem} */ (assign({}, context));
|
||||||
item.node = node;
|
item.node = node;
|
||||||
pushSerializeAndPop(item,
|
pushSerializeAndPop(item,
|
||||||
GETFEATURE_SERIALIZERS,
|
GETFEATURE_SERIALIZERS,
|
||||||
|
|||||||
+27
-27
@@ -17,7 +17,7 @@ import SimpleGeometry from '../geom/SimpleGeometry.js';
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @enum {function (new:module:ol/geom/Geometry, Array, module:ol/geom/GeometryLayout)}
|
* @enum {function (new:import("../geom/Geometry.js").default, Array, import("../geom/GeometryLayout.js").default)}
|
||||||
*/
|
*/
|
||||||
const GeometryConstructor = {
|
const GeometryConstructor = {
|
||||||
'POINT': Point,
|
'POINT': Point,
|
||||||
@@ -155,7 +155,7 @@ class Lexer {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetch and return the next token.
|
* Fetch and return the next token.
|
||||||
* @return {!module:ol/format/WKT~Token} Next string token.
|
* @return {!Token} Next string token.
|
||||||
*/
|
*/
|
||||||
nextToken() {
|
nextToken() {
|
||||||
const c = this.nextChar_();
|
const c = this.nextChar_();
|
||||||
@@ -232,24 +232,24 @@ class Lexer {
|
|||||||
class Parser {
|
class Parser {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/format/WKT~Lexer} lexer The lexer.
|
* @param {Lexer} lexer The lexer.
|
||||||
*/
|
*/
|
||||||
constructor(lexer) {
|
constructor(lexer) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {module:ol/format/WKT~Lexer}
|
* @type {Lexer}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.lexer_ = lexer;
|
this.lexer_ = lexer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {module:ol/format/WKT~Token}
|
* @type {Token}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.token_;
|
this.token_;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {module:ol/geom/GeometryLayout}
|
* @type {import("../geom/GeometryLayout.js").default}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.layout_ = GeometryLayout.XY;
|
this.layout_ = GeometryLayout.XY;
|
||||||
@@ -265,7 +265,7 @@ class Parser {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests if the given type matches the type of the current token.
|
* Tests if the given type matches the type of the current token.
|
||||||
* @param {module:ol/format/WKT~TokenType} type Token type.
|
* @param {TokenType} type Token type.
|
||||||
* @return {boolean} Whether the token matches the given type.
|
* @return {boolean} Whether the token matches the given type.
|
||||||
*/
|
*/
|
||||||
isTokenType(type) {
|
isTokenType(type) {
|
||||||
@@ -275,7 +275,7 @@ class Parser {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* If the given type matches the current token, consume it.
|
* If the given type matches the current token, consume it.
|
||||||
* @param {module:ol/format/WKT~TokenType} type Token type.
|
* @param {TokenType} type Token type.
|
||||||
* @return {boolean} Whether the token matches the given type.
|
* @return {boolean} Whether the token matches the given type.
|
||||||
*/
|
*/
|
||||||
match(type) {
|
match(type) {
|
||||||
@@ -288,7 +288,7 @@ class Parser {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Try to parse the tokens provided by the lexer.
|
* Try to parse the tokens provided by the lexer.
|
||||||
* @return {module:ol/geom/Geometry} The geometry.
|
* @return {import("../geom/Geometry.js").default} The geometry.
|
||||||
*/
|
*/
|
||||||
parse() {
|
parse() {
|
||||||
this.consume_();
|
this.consume_();
|
||||||
@@ -298,7 +298,7 @@ class Parser {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Try to parse the dimensional info.
|
* Try to parse the dimensional info.
|
||||||
* @return {module:ol/geom/GeometryLayout} The layout.
|
* @return {import("../geom/GeometryLayout.js").default} The layout.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
parseGeometryLayout_() {
|
parseGeometryLayout_() {
|
||||||
@@ -321,7 +321,7 @@ class Parser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {!Array<module:ol/geom/Geometry>} A collection of geometries.
|
* @return {!Array<import("../geom/Geometry.js").default>} A collection of geometries.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
parseGeometryCollectionText_() {
|
parseGeometryCollectionText_() {
|
||||||
@@ -534,7 +534,7 @@ class Parser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {!module:ol/geom/Geometry} The geometry.
|
* @return {!import("../geom/Geometry.js").default} The geometry.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
parseGeometry_() {
|
parseGeometry_() {
|
||||||
@@ -607,7 +607,7 @@ class Parser {
|
|||||||
class WKT extends TextFeature {
|
class WKT extends TextFeature {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/format/WKT~Options=} opt_options Options.
|
* @param {Options=} opt_options Options.
|
||||||
*/
|
*/
|
||||||
constructor(opt_options) {
|
constructor(opt_options) {
|
||||||
super();
|
super();
|
||||||
@@ -628,7 +628,7 @@ class WKT extends TextFeature {
|
|||||||
/**
|
/**
|
||||||
* Parse a WKT string.
|
* Parse a WKT string.
|
||||||
* @param {string} wkt WKT string.
|
* @param {string} wkt WKT string.
|
||||||
* @return {module:ol/geom/Geometry|undefined}
|
* @return {import("../geom/Geometry.js").default|undefined}
|
||||||
* The geometry created.
|
* The geometry created.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -659,7 +659,7 @@ class WKT extends TextFeature {
|
|||||||
const geometry = this.readGeometryFromText(text, opt_options);
|
const geometry = this.readGeometryFromText(text, opt_options);
|
||||||
if (this.splitCollection_ &&
|
if (this.splitCollection_ &&
|
||||||
geometry.getType() == GeometryType.GEOMETRY_COLLECTION) {
|
geometry.getType() == GeometryType.GEOMETRY_COLLECTION) {
|
||||||
geometries = (/** @type {module:ol/geom/GeometryCollection} */ (geometry))
|
geometries = (/** @type {import("../geom/GeometryCollection.js").default} */ (geometry))
|
||||||
.getGeometriesArray();
|
.getGeometriesArray();
|
||||||
} else {
|
} else {
|
||||||
geometries = [geometry];
|
geometries = [geometry];
|
||||||
@@ -680,7 +680,7 @@ class WKT extends TextFeature {
|
|||||||
const geometry = this.parse_(text);
|
const geometry = this.parse_(text);
|
||||||
if (geometry) {
|
if (geometry) {
|
||||||
return (
|
return (
|
||||||
/** @type {module:ol/geom/Geometry} */ (transformWithOptions(geometry, false, opt_options))
|
/** @type {import("../geom/Geometry.js").default} */ (transformWithOptions(geometry, false, opt_options))
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
@@ -717,14 +717,14 @@ class WKT extends TextFeature {
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
writeGeometryText(geometry, opt_options) {
|
writeGeometryText(geometry, opt_options) {
|
||||||
return encode(/** @type {module:ol/geom/Geometry} */ (
|
return encode(/** @type {import("../geom/Geometry.js").default} */ (
|
||||||
transformWithOptions(geometry, true, opt_options)));
|
transformWithOptions(geometry, true, opt_options)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/geom/Point} geom Point geometry.
|
* @param {import("../geom/Point.js").default} geom Point geometry.
|
||||||
* @return {string} Coordinates part of Point as WKT.
|
* @return {string} Coordinates part of Point as WKT.
|
||||||
*/
|
*/
|
||||||
function encodePointGeometry(geom) {
|
function encodePointGeometry(geom) {
|
||||||
@@ -737,7 +737,7 @@ function encodePointGeometry(geom) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/geom/MultiPoint} geom MultiPoint geometry.
|
* @param {import("../geom/MultiPoint.js").default} geom MultiPoint geometry.
|
||||||
* @return {string} Coordinates part of MultiPoint as WKT.
|
* @return {string} Coordinates part of MultiPoint as WKT.
|
||||||
*/
|
*/
|
||||||
function encodeMultiPointGeometry(geom) {
|
function encodeMultiPointGeometry(geom) {
|
||||||
@@ -751,7 +751,7 @@ function encodeMultiPointGeometry(geom) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/geom/GeometryCollection} geom GeometryCollection geometry.
|
* @param {import("../geom/GeometryCollection.js").default} geom GeometryCollection geometry.
|
||||||
* @return {string} Coordinates part of GeometryCollection as WKT.
|
* @return {string} Coordinates part of GeometryCollection as WKT.
|
||||||
*/
|
*/
|
||||||
function encodeGeometryCollectionGeometry(geom) {
|
function encodeGeometryCollectionGeometry(geom) {
|
||||||
@@ -765,7 +765,7 @@ function encodeGeometryCollectionGeometry(geom) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/geom/LineString|module:ol/geom/LinearRing} geom LineString geometry.
|
* @param {import("../geom/LineString.js").default|import("../geom/LinearRing.js").default} geom LineString geometry.
|
||||||
* @return {string} Coordinates part of LineString as WKT.
|
* @return {string} Coordinates part of LineString as WKT.
|
||||||
*/
|
*/
|
||||||
function encodeLineStringGeometry(geom) {
|
function encodeLineStringGeometry(geom) {
|
||||||
@@ -779,7 +779,7 @@ function encodeLineStringGeometry(geom) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/geom/MultiLineString} geom MultiLineString geometry.
|
* @param {import("../geom/MultiLineString.js").default} geom MultiLineString geometry.
|
||||||
* @return {string} Coordinates part of MultiLineString as WKT.
|
* @return {string} Coordinates part of MultiLineString as WKT.
|
||||||
*/
|
*/
|
||||||
function encodeMultiLineStringGeometry(geom) {
|
function encodeMultiLineStringGeometry(geom) {
|
||||||
@@ -793,7 +793,7 @@ function encodeMultiLineStringGeometry(geom) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/geom/Polygon} geom Polygon geometry.
|
* @param {import("../geom/Polygon.js").default} geom Polygon geometry.
|
||||||
* @return {string} Coordinates part of Polygon as WKT.
|
* @return {string} Coordinates part of Polygon as WKT.
|
||||||
*/
|
*/
|
||||||
function encodePolygonGeometry(geom) {
|
function encodePolygonGeometry(geom) {
|
||||||
@@ -807,7 +807,7 @@ function encodePolygonGeometry(geom) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/geom/MultiPolygon} geom MultiPolygon geometry.
|
* @param {import("../geom/MultiPolygon.js").default} geom MultiPolygon geometry.
|
||||||
* @return {string} Coordinates part of MultiPolygon as WKT.
|
* @return {string} Coordinates part of MultiPolygon as WKT.
|
||||||
*/
|
*/
|
||||||
function encodeMultiPolygonGeometry(geom) {
|
function encodeMultiPolygonGeometry(geom) {
|
||||||
@@ -820,7 +820,7 @@ function encodeMultiPolygonGeometry(geom) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/geom/SimpleGeometry} geom SimpleGeometry geometry.
|
* @param {import("../geom/SimpleGeometry.js").default} geom SimpleGeometry geometry.
|
||||||
* @return {string} Potential dimensional information for WKT type.
|
* @return {string} Potential dimensional information for WKT type.
|
||||||
*/
|
*/
|
||||||
function encodeGeometryLayout(geom) {
|
function encodeGeometryLayout(geom) {
|
||||||
@@ -838,7 +838,7 @@ function encodeGeometryLayout(geom) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, function(module:ol/geom/Geometry): string>}
|
* @type {Object<string, function(import("../geom/Geometry.js").default): string>}
|
||||||
*/
|
*/
|
||||||
const GeometryEncoder = {
|
const GeometryEncoder = {
|
||||||
'Point': encodePointGeometry,
|
'Point': encodePointGeometry,
|
||||||
@@ -853,7 +853,7 @@ const GeometryEncoder = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Encode a geometry as WKT.
|
* Encode a geometry as WKT.
|
||||||
* @param {module:ol/geom/Geometry} geom The geometry to encode.
|
* @param {import("../geom/Geometry.js").default} geom The geometry to encode.
|
||||||
* @return {string} WKT string for the geometry.
|
* @return {string} WKT string for the geometry.
|
||||||
*/
|
*/
|
||||||
function encode(geom) {
|
function encode(geom) {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ const NAMESPACE_URIS = [
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const PARSERS = makeStructureNS(
|
const PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -31,7 +31,7 @@ const PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const CAPABILITY_PARSERS = makeStructureNS(
|
const CAPABILITY_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -84,7 +84,7 @@ class WMSCapabilities extends XML {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const SERVICE_PARSERS = makeStructureNS(
|
const SERVICE_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -104,7 +104,7 @@ const SERVICE_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const CONTACT_INFORMATION_PARSERS = makeStructureNS(
|
const CONTACT_INFORMATION_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -119,7 +119,7 @@ const CONTACT_INFORMATION_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const CONTACT_PERSON_PARSERS = makeStructureNS(
|
const CONTACT_PERSON_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -130,7 +130,7 @@ const CONTACT_PERSON_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const CONTACT_ADDRESS_PARSERS = makeStructureNS(
|
const CONTACT_ADDRESS_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -145,7 +145,7 @@ const CONTACT_ADDRESS_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const EXCEPTION_PARSERS = makeStructureNS(
|
const EXCEPTION_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -155,7 +155,7 @@ const EXCEPTION_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const LAYER_PARSERS = makeStructureNS(
|
const LAYER_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -182,7 +182,7 @@ const LAYER_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const ATTRIBUTION_PARSERS = makeStructureNS(
|
const ATTRIBUTION_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -194,7 +194,7 @@ const ATTRIBUTION_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const EX_GEOGRAPHIC_BOUNDING_BOX_PARSERS =
|
const EX_GEOGRAPHIC_BOUNDING_BOX_PARSERS =
|
||||||
makeStructureNS(NAMESPACE_URIS, {
|
makeStructureNS(NAMESPACE_URIS, {
|
||||||
@@ -207,7 +207,7 @@ const EX_GEOGRAPHIC_BOUNDING_BOX_PARSERS =
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const REQUEST_PARSERS = makeStructureNS(
|
const REQUEST_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -219,7 +219,7 @@ const REQUEST_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const OPERATIONTYPE_PARSERS = makeStructureNS(
|
const OPERATIONTYPE_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -230,7 +230,7 @@ const OPERATIONTYPE_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const DCPTYPE_PARSERS = makeStructureNS(
|
const DCPTYPE_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -240,7 +240,7 @@ const DCPTYPE_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const HTTP_PARSERS = makeStructureNS(
|
const HTTP_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -251,7 +251,7 @@ const HTTP_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const STYLE_PARSERS = makeStructureNS(
|
const STYLE_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -266,7 +266,7 @@ const STYLE_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const FORMAT_ONLINERESOURCE_PARSERS =
|
const FORMAT_ONLINERESOURCE_PARSERS =
|
||||||
makeStructureNS(NAMESPACE_URIS, {
|
makeStructureNS(NAMESPACE_URIS, {
|
||||||
@@ -277,7 +277,7 @@ const FORMAT_ONLINERESOURCE_PARSERS =
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const KEYWORDLIST_PARSERS = makeStructureNS(
|
const KEYWORDLIST_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -324,7 +324,7 @@ function readBoundingBox(node, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {Array<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/extent~Extent|undefined} Bounding box object.
|
* @return {import("../extent.js").Extent|undefined} Bounding box object.
|
||||||
*/
|
*/
|
||||||
function readEXGeographicBoundingBox(node, objectStack) {
|
function readEXGeographicBoundingBox(node, objectStack) {
|
||||||
const geographicBoundingBox = pushParseAndPop(
|
const geographicBoundingBox = pushParseAndPop(
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ const layerIdentifier = '_layer';
|
|||||||
class WMSGetFeatureInfo extends XMLFeature {
|
class WMSGetFeatureInfo extends XMLFeature {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/format/WMSGetFeatureInfo~Options=} opt_options Options.
|
* @param {Options=} opt_options Options.
|
||||||
*/
|
*/
|
||||||
constructor(opt_options) {
|
constructor(opt_options) {
|
||||||
super();
|
super();
|
||||||
@@ -54,7 +54,7 @@ class WMSGetFeatureInfo extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {module:ol/format/GML2}
|
* @type {import("./GML2.js").default}
|
||||||
*/
|
*/
|
||||||
this.gmlFormat_ = new GML2();
|
this.gmlFormat_ = new GML2();
|
||||||
|
|
||||||
@@ -83,13 +83,13 @@ class WMSGetFeatureInfo extends XMLFeature {
|
|||||||
/**
|
/**
|
||||||
* @param {Element} node Node.
|
* @param {Element} node Node.
|
||||||
* @param {Array<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Array<module:ol/Feature>} Features.
|
* @return {Array<import("../Feature.js").default>} 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<import("../Feature.js").default>} */
|
||||||
let features = [];
|
let features = [];
|
||||||
if (node.childNodes.length === 0) {
|
if (node.childNodes.length === 0) {
|
||||||
return features;
|
return features;
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ const OWS_NAMESPACE_URIS = [
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const PARSERS = makeStructureNS(
|
const PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -51,7 +51,7 @@ class WMTSCapabilities extends XML {
|
|||||||
super();
|
super();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {module:ol/format/OWS}
|
* @type {import("./OWS.js").default}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.owsParser_ = new OWS();
|
this.owsParser_ = new OWS();
|
||||||
@@ -87,7 +87,7 @@ class WMTSCapabilities extends XML {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const CONTENTS_PARSERS = makeStructureNS(
|
const CONTENTS_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -98,7 +98,7 @@ const CONTENTS_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const LAYER_PARSERS = makeStructureNS(
|
const LAYER_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -117,7 +117,7 @@ const LAYER_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const STYLE_PARSERS = makeStructureNS(
|
const STYLE_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -130,7 +130,7 @@ const STYLE_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const TMS_LINKS_PARSERS = makeStructureNS(
|
const TMS_LINKS_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -140,7 +140,7 @@ const TMS_LINKS_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const TMS_LIMITS_LIST_PARSERS = makeStructureNS(
|
const TMS_LIMITS_LIST_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -150,7 +150,7 @@ const TMS_LIMITS_LIST_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const TMS_LIMITS_PARSERS = makeStructureNS(
|
const TMS_LIMITS_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -164,7 +164,7 @@ const TMS_LIMITS_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const DIMENSION_PARSERS = makeStructureNS(
|
const DIMENSION_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -177,7 +177,7 @@ const DIMENSION_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const WGS84_BBOX_READERS = makeStructureNS(
|
const WGS84_BBOX_READERS = makeStructureNS(
|
||||||
OWS_NAMESPACE_URIS, {
|
OWS_NAMESPACE_URIS, {
|
||||||
@@ -188,7 +188,7 @@ const WGS84_BBOX_READERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const TMS_PARSERS = makeStructureNS(
|
const TMS_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -202,7 +202,7 @@ const TMS_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, import("../xml.js").Parser>>}
|
||||||
*/
|
*/
|
||||||
const TM_PARSERS = makeStructureNS(
|
const TM_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
|
|||||||
+28
-28
@@ -36,8 +36,8 @@ class XMLFeature extends FeatureFormat {
|
|||||||
* Read a single feature.
|
* Read a single feature.
|
||||||
*
|
*
|
||||||
* @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 {import("./Feature.js").ReadOptions=} opt_options Read options.
|
||||||
* @return {module:ol/Feature} Feature.
|
* @return {import("../Feature.js").default} Feature.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
readFeature(source, opt_options) {
|
readFeature(source, opt_options) {
|
||||||
@@ -55,8 +55,8 @@ class XMLFeature extends FeatureFormat {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Document} doc Document.
|
* @param {Document} doc Document.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Options.
|
* @param {import("./Feature.js").ReadOptions=} opt_options Options.
|
||||||
* @return {module:ol/Feature} Feature.
|
* @return {import("../Feature.js").default} Feature.
|
||||||
*/
|
*/
|
||||||
readFeatureFromDocument(doc, opt_options) {
|
readFeatureFromDocument(doc, opt_options) {
|
||||||
const features = this.readFeaturesFromDocument(doc, opt_options);
|
const features = this.readFeaturesFromDocument(doc, opt_options);
|
||||||
@@ -69,8 +69,8 @@ class XMLFeature extends FeatureFormat {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Options.
|
* @param {import("./Feature.js").ReadOptions=} opt_options Options.
|
||||||
* @return {module:ol/Feature} Feature.
|
* @return {import("../Feature.js").default} Feature.
|
||||||
*/
|
*/
|
||||||
readFeatureFromNode(node, opt_options) {
|
readFeatureFromNode(node, opt_options) {
|
||||||
return null; // not implemented
|
return null; // not implemented
|
||||||
@@ -81,8 +81,8 @@ 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 {import("./Feature.js").ReadOptions=} opt_options Options.
|
||||||
* @return {Array<module:ol/Feature>} Features.
|
* @return {Array<import("../Feature.js").default>} Features.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
readFeatures(source, opt_options) {
|
readFeatures(source, opt_options) {
|
||||||
@@ -101,12 +101,12 @@ class XMLFeature extends FeatureFormat {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Document} doc Document.
|
* @param {Document} doc Document.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Options.
|
* @param {import("./Feature.js").ReadOptions=} opt_options Options.
|
||||||
* @protected
|
* @protected
|
||||||
* @return {Array<module:ol/Feature>} Features.
|
* @return {Array<import("../Feature.js").default>} Features.
|
||||||
*/
|
*/
|
||||||
readFeaturesFromDocument(doc, opt_options) {
|
readFeaturesFromDocument(doc, opt_options) {
|
||||||
/** @type {Array<module:ol/Feature>} */
|
/** @type {Array<import("../Feature.js").default>} */
|
||||||
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) {
|
||||||
@@ -119,9 +119,9 @@ class XMLFeature extends FeatureFormat {
|
|||||||
/**
|
/**
|
||||||
* @abstract
|
* @abstract
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Options.
|
* @param {import("./Feature.js").ReadOptions=} opt_options Options.
|
||||||
* @protected
|
* @protected
|
||||||
* @return {Array<module:ol/Feature>} Features.
|
* @return {Array<import("../Feature.js").default>} Features.
|
||||||
*/
|
*/
|
||||||
readFeaturesFromNode(node, opt_options) {}
|
readFeaturesFromNode(node, opt_options) {}
|
||||||
|
|
||||||
@@ -144,9 +144,9 @@ class XMLFeature extends FeatureFormat {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Document} doc Document.
|
* @param {Document} doc Document.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Options.
|
* @param {import("./Feature.js").ReadOptions=} opt_options Options.
|
||||||
* @protected
|
* @protected
|
||||||
* @return {module:ol/geom/Geometry} Geometry.
|
* @return {import("../geom/Geometry.js").default} Geometry.
|
||||||
*/
|
*/
|
||||||
readGeometryFromDocument(doc, opt_options) {
|
readGeometryFromDocument(doc, opt_options) {
|
||||||
return null; // not implemented
|
return null; // not implemented
|
||||||
@@ -154,9 +154,9 @@ class XMLFeature extends FeatureFormat {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Options.
|
* @param {import("./Feature.js").ReadOptions=} opt_options Options.
|
||||||
* @protected
|
* @protected
|
||||||
* @return {module:ol/geom/Geometry} Geometry.
|
* @return {import("../geom/Geometry.js").default} Geometry.
|
||||||
*/
|
*/
|
||||||
readGeometryFromNode(node, opt_options) {
|
readGeometryFromNode(node, opt_options) {
|
||||||
return null; // not implemented
|
return null; // not implemented
|
||||||
@@ -166,7 +166,7 @@ class XMLFeature extends FeatureFormat {
|
|||||||
* Read the projection from the source.
|
* Read the projection from the source.
|
||||||
*
|
*
|
||||||
* @param {Document|Node|Object|string} source Source.
|
* @param {Document|Node|Object|string} source Source.
|
||||||
* @return {module:ol/proj/Projection} Projection.
|
* @return {import("../proj/Projection.js").default} Projection.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
readProjection(source) {
|
readProjection(source) {
|
||||||
@@ -185,7 +185,7 @@ class XMLFeature extends FeatureFormat {
|
|||||||
/**
|
/**
|
||||||
* @param {Document} doc Document.
|
* @param {Document} doc Document.
|
||||||
* @protected
|
* @protected
|
||||||
* @return {module:ol/proj/Projection} Projection.
|
* @return {import("../proj/Projection.js").default} Projection.
|
||||||
*/
|
*/
|
||||||
readProjectionFromDocument(doc) {
|
readProjectionFromDocument(doc) {
|
||||||
return this.dataProjection;
|
return this.dataProjection;
|
||||||
@@ -194,7 +194,7 @@ class XMLFeature extends FeatureFormat {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @protected
|
* @protected
|
||||||
* @return {module:ol/proj/Projection} Projection.
|
* @return {import("../proj/Projection.js").default} Projection.
|
||||||
*/
|
*/
|
||||||
readProjectionFromNode(node) {
|
readProjectionFromNode(node) {
|
||||||
return this.dataProjection;
|
return this.dataProjection;
|
||||||
@@ -209,8 +209,8 @@ class XMLFeature extends FeatureFormat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/Feature} feature Feature.
|
* @param {import("../Feature.js").default} feature Feature.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Options.
|
||||||
* @protected
|
* @protected
|
||||||
* @return {Node} Node.
|
* @return {Node} Node.
|
||||||
*/
|
*/
|
||||||
@@ -221,8 +221,8 @@ 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<import("../Feature.js").default>} features Features.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Write options.
|
||||||
* @return {string} Result.
|
* @return {string} Result.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -232,8 +232,8 @@ class XMLFeature extends FeatureFormat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array<module:ol/Feature>} features Features.
|
* @param {Array<import("../Feature.js").default>} features Features.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Options.
|
||||||
* @return {Node} Node.
|
* @return {Node} Node.
|
||||||
*/
|
*/
|
||||||
writeFeaturesNode(features, opt_options) {
|
writeFeaturesNode(features, opt_options) {
|
||||||
@@ -249,8 +249,8 @@ class XMLFeature extends FeatureFormat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/geom/Geometry} geometry Geometry.
|
* @param {import("../geom/Geometry.js").default} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
* @param {import("./Feature.js").WriteOptions=} opt_options Options.
|
||||||
* @return {Node} Node.
|
* @return {Node} Node.
|
||||||
*/
|
*/
|
||||||
writeGeometryNode(geometry, opt_options) {
|
writeGeometryNode(geometry, opt_options) {
|
||||||
|
|||||||
+24
-24
@@ -23,8 +23,8 @@ import Within from '../format/filter/Within.js';
|
|||||||
/**
|
/**
|
||||||
* Create a logical `<And>` operator between two or more filter conditions.
|
* Create a logical `<And>` operator between two or more filter conditions.
|
||||||
*
|
*
|
||||||
* @param {...module:ol/format/filter/Filter} conditions Filter conditions.
|
* @param {...import("./filter/Filter.js").default} conditions Filter conditions.
|
||||||
* @returns {!module:ol/format/filter/And} `<And>` operator.
|
* @returns {!import("./filter/And.js").default} `<And>` operator.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function and(conditions) {
|
export function and(conditions) {
|
||||||
@@ -36,8 +36,8 @@ export function and(conditions) {
|
|||||||
/**
|
/**
|
||||||
* Create a logical `<Or>` operator between two or more filter conditions.
|
* Create a logical `<Or>` operator between two or more filter conditions.
|
||||||
*
|
*
|
||||||
* @param {...module:ol/format/filter/Filter} conditions Filter conditions.
|
* @param {...import("./filter/Filter.js").default} conditions Filter conditions.
|
||||||
* @returns {!module:ol/format/filter/Or} `<Or>` operator.
|
* @returns {!import("./filter/Or.js").default} `<Or>` operator.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function or(conditions) {
|
export function or(conditions) {
|
||||||
@@ -49,8 +49,8 @@ export function or(conditions) {
|
|||||||
/**
|
/**
|
||||||
* Represents a logical `<Not>` operator for a filter condition.
|
* Represents a logical `<Not>` operator for a filter condition.
|
||||||
*
|
*
|
||||||
* @param {!module:ol/format/filter/Filter} condition Filter condition.
|
* @param {!import("./filter/Filter.js").default} condition Filter condition.
|
||||||
* @returns {!module:ol/format/filter/Not} `<Not>` operator.
|
* @returns {!import("./filter/Not.js").default} `<Not>` operator.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function not(condition) {
|
export function not(condition) {
|
||||||
@@ -63,10 +63,10 @@ export function not(condition) {
|
|||||||
* intersects a fixed bounding box
|
* intersects a fixed bounding box
|
||||||
*
|
*
|
||||||
* @param {!string} geometryName Geometry name to use.
|
* @param {!string} geometryName Geometry name to use.
|
||||||
* @param {!module:ol/extent~Extent} extent Extent.
|
* @param {!import("../extent.js").Extent} extent Extent.
|
||||||
* @param {string=} opt_srsName SRS name. No srsName attribute will be
|
* @param {string=} opt_srsName SRS name. No srsName attribute will be
|
||||||
* set on geometries when this is not provided.
|
* set on geometries when this is not provided.
|
||||||
* @returns {!module:ol/format/filter/Bbox} `<BBOX>` operator.
|
* @returns {!import("./filter/Bbox.js").default} `<BBOX>` operator.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function bbox(geometryName, extent, opt_srsName) {
|
export function bbox(geometryName, extent, opt_srsName) {
|
||||||
@@ -78,10 +78,10 @@ export function bbox(geometryName, extent, opt_srsName) {
|
|||||||
* contains a given geometry.
|
* contains a given geometry.
|
||||||
*
|
*
|
||||||
* @param {!string} geometryName Geometry name to use.
|
* @param {!string} geometryName Geometry name to use.
|
||||||
* @param {!module:ol/geom/Geometry} geometry Geometry.
|
* @param {!import("../geom/Geometry.js").default} geometry Geometry.
|
||||||
* @param {string=} opt_srsName SRS name. No srsName attribute will be
|
* @param {string=} opt_srsName SRS name. No srsName attribute will be
|
||||||
* set on geometries when this is not provided.
|
* set on geometries when this is not provided.
|
||||||
* @returns {!module:ol/format/filter/Contains} `<Contains>` operator.
|
* @returns {!import("./filter/Contains.js").default} `<Contains>` operator.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function contains(geometryName, geometry, opt_srsName) {
|
export function contains(geometryName, geometry, opt_srsName) {
|
||||||
@@ -93,10 +93,10 @@ export function contains(geometryName, geometry, opt_srsName) {
|
|||||||
* intersects a given geometry.
|
* intersects a given geometry.
|
||||||
*
|
*
|
||||||
* @param {!string} geometryName Geometry name to use.
|
* @param {!string} geometryName Geometry name to use.
|
||||||
* @param {!module:ol/geom/Geometry} geometry Geometry.
|
* @param {!import("../geom/Geometry.js").default} geometry Geometry.
|
||||||
* @param {string=} opt_srsName SRS name. No srsName attribute will be
|
* @param {string=} opt_srsName SRS name. No srsName attribute will be
|
||||||
* set on geometries when this is not provided.
|
* set on geometries when this is not provided.
|
||||||
* @returns {!module:ol/format/filter/Intersects} `<Intersects>` operator.
|
* @returns {!import("./filter/Intersects.js").default} `<Intersects>` operator.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function intersects(geometryName, geometry, opt_srsName) {
|
export function intersects(geometryName, geometry, opt_srsName) {
|
||||||
@@ -108,10 +108,10 @@ export function intersects(geometryName, geometry, opt_srsName) {
|
|||||||
* is within a given geometry.
|
* is within a given geometry.
|
||||||
*
|
*
|
||||||
* @param {!string} geometryName Geometry name to use.
|
* @param {!string} geometryName Geometry name to use.
|
||||||
* @param {!module:ol/geom/Geometry} geometry Geometry.
|
* @param {!import("../geom/Geometry.js").default} geometry Geometry.
|
||||||
* @param {string=} opt_srsName SRS name. No srsName attribute will be
|
* @param {string=} opt_srsName SRS name. No srsName attribute will be
|
||||||
* set on geometries when this is not provided.
|
* set on geometries when this is not provided.
|
||||||
* @returns {!module:ol/format/filter/Within} `<Within>` operator.
|
* @returns {!import("./filter/Within.js").default} `<Within>` operator.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function within(geometryName, geometry, opt_srsName) {
|
export function within(geometryName, geometry, opt_srsName) {
|
||||||
@@ -125,7 +125,7 @@ export function within(geometryName, geometry, opt_srsName) {
|
|||||||
* @param {!string} propertyName Name of the context property to compare.
|
* @param {!string} propertyName Name of the context property to compare.
|
||||||
* @param {!(string|number)} expression The value to compare.
|
* @param {!(string|number)} expression The value to compare.
|
||||||
* @param {boolean=} opt_matchCase Case-sensitive?
|
* @param {boolean=} opt_matchCase Case-sensitive?
|
||||||
* @returns {!module:ol/format/filter/EqualTo} `<PropertyIsEqualTo>` operator.
|
* @returns {!import("./filter/EqualTo.js").default} `<PropertyIsEqualTo>` operator.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function equalTo(propertyName, expression, opt_matchCase) {
|
export function equalTo(propertyName, expression, opt_matchCase) {
|
||||||
@@ -139,7 +139,7 @@ export function equalTo(propertyName, expression, opt_matchCase) {
|
|||||||
* @param {!string} propertyName Name of the context property to compare.
|
* @param {!string} propertyName Name of the context property to compare.
|
||||||
* @param {!(string|number)} expression The value to compare.
|
* @param {!(string|number)} expression The value to compare.
|
||||||
* @param {boolean=} opt_matchCase Case-sensitive?
|
* @param {boolean=} opt_matchCase Case-sensitive?
|
||||||
* @returns {!module:ol/format/filter/NotEqualTo} `<PropertyIsNotEqualTo>` operator.
|
* @returns {!import("./filter/NotEqualTo.js").default} `<PropertyIsNotEqualTo>` operator.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function notEqualTo(propertyName, expression, opt_matchCase) {
|
export function notEqualTo(propertyName, expression, opt_matchCase) {
|
||||||
@@ -152,7 +152,7 @@ export function notEqualTo(propertyName, expression, opt_matchCase) {
|
|||||||
*
|
*
|
||||||
* @param {!string} propertyName Name of the context property to compare.
|
* @param {!string} propertyName Name of the context property to compare.
|
||||||
* @param {!number} expression The value to compare.
|
* @param {!number} expression The value to compare.
|
||||||
* @returns {!module:ol/format/filter/LessThan} `<PropertyIsLessThan>` operator.
|
* @returns {!import("./filter/LessThan.js").default} `<PropertyIsLessThan>` operator.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function lessThan(propertyName, expression) {
|
export function lessThan(propertyName, expression) {
|
||||||
@@ -165,7 +165,7 @@ export function lessThan(propertyName, expression) {
|
|||||||
*
|
*
|
||||||
* @param {!string} propertyName Name of the context property to compare.
|
* @param {!string} propertyName Name of the context property to compare.
|
||||||
* @param {!number} expression The value to compare.
|
* @param {!number} expression The value to compare.
|
||||||
* @returns {!module:ol/format/filter/LessThanOrEqualTo} `<PropertyIsLessThanOrEqualTo>` operator.
|
* @returns {!import("./filter/LessThanOrEqualTo.js").default} `<PropertyIsLessThanOrEqualTo>` operator.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function lessThanOrEqualTo(propertyName, expression) {
|
export function lessThanOrEqualTo(propertyName, expression) {
|
||||||
@@ -178,7 +178,7 @@ export function lessThanOrEqualTo(propertyName, expression) {
|
|||||||
*
|
*
|
||||||
* @param {!string} propertyName Name of the context property to compare.
|
* @param {!string} propertyName Name of the context property to compare.
|
||||||
* @param {!number} expression The value to compare.
|
* @param {!number} expression The value to compare.
|
||||||
* @returns {!module:ol/format/filter/GreaterThan} `<PropertyIsGreaterThan>` operator.
|
* @returns {!import("./filter/GreaterThan.js").default} `<PropertyIsGreaterThan>` operator.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function greaterThan(propertyName, expression) {
|
export function greaterThan(propertyName, expression) {
|
||||||
@@ -191,7 +191,7 @@ export function greaterThan(propertyName, expression) {
|
|||||||
*
|
*
|
||||||
* @param {!string} propertyName Name of the context property to compare.
|
* @param {!string} propertyName Name of the context property to compare.
|
||||||
* @param {!number} expression The value to compare.
|
* @param {!number} expression The value to compare.
|
||||||
* @returns {!module:ol/format/filter/GreaterThanOrEqualTo} `<PropertyIsGreaterThanOrEqualTo>` operator.
|
* @returns {!import("./filter/GreaterThanOrEqualTo.js").default} `<PropertyIsGreaterThanOrEqualTo>` operator.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function greaterThanOrEqualTo(propertyName, expression) {
|
export function greaterThanOrEqualTo(propertyName, expression) {
|
||||||
@@ -204,7 +204,7 @@ export function greaterThanOrEqualTo(propertyName, expression) {
|
|||||||
* is null.
|
* is null.
|
||||||
*
|
*
|
||||||
* @param {!string} propertyName Name of the context property to compare.
|
* @param {!string} propertyName Name of the context property to compare.
|
||||||
* @returns {!module:ol/format/filter/IsNull} `<PropertyIsNull>` operator.
|
* @returns {!import("./filter/IsNull.js").default} `<PropertyIsNull>` operator.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function isNull(propertyName) {
|
export function isNull(propertyName) {
|
||||||
@@ -219,7 +219,7 @@ export function isNull(propertyName) {
|
|||||||
* @param {!string} propertyName Name of the context property to compare.
|
* @param {!string} propertyName Name of the context property to compare.
|
||||||
* @param {!number} lowerBoundary The lower bound of the range.
|
* @param {!number} lowerBoundary The lower bound of the range.
|
||||||
* @param {!number} upperBoundary The upper bound of the range.
|
* @param {!number} upperBoundary The upper bound of the range.
|
||||||
* @returns {!module:ol/format/filter/IsBetween} `<PropertyIsBetween>` operator.
|
* @returns {!import("./filter/IsBetween.js").default} `<PropertyIsBetween>` operator.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function between(propertyName, lowerBoundary, upperBoundary) {
|
export function between(propertyName, lowerBoundary, upperBoundary) {
|
||||||
@@ -240,7 +240,7 @@ export function between(propertyName, lowerBoundary, upperBoundary) {
|
|||||||
* @param {string=} opt_escapeChar Escape character which can be used to escape
|
* @param {string=} opt_escapeChar Escape character which can be used to escape
|
||||||
* the pattern characters. Default is '!'.
|
* the pattern characters. Default is '!'.
|
||||||
* @param {boolean=} opt_matchCase Case-sensitive?
|
* @param {boolean=} opt_matchCase Case-sensitive?
|
||||||
* @returns {!module:ol/format/filter/IsLike} `<PropertyIsLike>` operator.
|
* @returns {!import("./filter/IsLike.js").default} `<PropertyIsLike>` operator.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function like(propertyName, pattern,
|
export function like(propertyName, pattern,
|
||||||
@@ -256,7 +256,7 @@ export function like(propertyName, pattern,
|
|||||||
* @param {!string} propertyName Name of the context property to compare.
|
* @param {!string} propertyName Name of the context property to compare.
|
||||||
* @param {!string} begin The begin date in ISO-8601 format.
|
* @param {!string} begin The begin date in ISO-8601 format.
|
||||||
* @param {!string} end The end date in ISO-8601 format.
|
* @param {!string} end The end date in ISO-8601 format.
|
||||||
* @returns {!module:ol/format/filter/During} `<During>` operator.
|
* @returns {!import("./filter/During.js").default} `<During>` operator.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function during(propertyName, begin, end) {
|
export function during(propertyName, begin, end) {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import LogicalNary from '../filter/LogicalNary.js';
|
|||||||
class And extends LogicalNary {
|
class And extends LogicalNary {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {...module:ol/format/filter/Filter} conditions Conditions.
|
* @param {...import("./Filter.js").default} conditions Conditions.
|
||||||
*/
|
*/
|
||||||
constructor(conditions) {
|
constructor(conditions) {
|
||||||
const params = ['And'].concat(Array.prototype.slice.call(arguments));
|
const params = ['And'].concat(Array.prototype.slice.call(arguments));
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class Bbox extends Filter {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {!string} geometryName Geometry name to use.
|
* @param {!string} geometryName Geometry name to use.
|
||||||
* @param {!module:ol/extent~Extent} extent Extent.
|
* @param {!import("../../extent.js").Extent} extent Extent.
|
||||||
* @param {string=} opt_srsName SRS name. No srsName attribute will be set
|
* @param {string=} opt_srsName SRS name. No srsName attribute will be set
|
||||||
* on geometries when this is not provided.
|
* on geometries when this is not provided.
|
||||||
*/
|
*/
|
||||||
@@ -28,7 +28,7 @@ class Bbox extends Filter {
|
|||||||
this.geometryName = geometryName;
|
this.geometryName = geometryName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {module:ol/extent~Extent}
|
* @type {import("../../extent.js").Extent}
|
||||||
*/
|
*/
|
||||||
this.extent = extent;
|
this.extent = extent;
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class Contains extends Spatial {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {!string} geometryName Geometry name to use.
|
* @param {!string} geometryName Geometry name to use.
|
||||||
* @param {!module:ol/geom/Geometry} geometry Geometry.
|
* @param {!import("../../geom/Geometry.js").default} geometry Geometry.
|
||||||
* @param {string=} opt_srsName SRS name. No srsName attribute will be
|
* @param {string=} opt_srsName SRS name. No srsName attribute will be
|
||||||
* set on geometries when this is not provided.
|
* set on geometries when this is not provided.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class Intersects extends Spatial {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {!string} geometryName Geometry name to use.
|
* @param {!string} geometryName Geometry name to use.
|
||||||
* @param {!module:ol/geom/Geometry} geometry Geometry.
|
* @param {!import("../../geom/Geometry.js").default} geometry Geometry.
|
||||||
* @param {string=} opt_srsName SRS name. No srsName attribute will be
|
* @param {string=} opt_srsName SRS name. No srsName attribute will be
|
||||||
* set on geometries when this is not provided.
|
* set on geometries when this is not provided.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -15,14 +15,14 @@ class LogicalNary extends Filter {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {!string} tagName The XML tag name for this filter.
|
* @param {!string} tagName The XML tag name for this filter.
|
||||||
* @param {...module:ol/format/filter/Filter} conditions Conditions.
|
* @param {...import("./Filter.js").default} conditions Conditions.
|
||||||
*/
|
*/
|
||||||
constructor(tagName, conditions) {
|
constructor(tagName, conditions) {
|
||||||
|
|
||||||
super(tagName);
|
super(tagName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Array<module:ol/format/filter/Filter>}
|
* @type {Array<import("./Filter.js").default>}
|
||||||
*/
|
*/
|
||||||
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.
|
||||||
|
|||||||
@@ -11,14 +11,14 @@ import Filter from '../filter/Filter.js';
|
|||||||
class Not extends Filter {
|
class Not extends Filter {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {!module:ol/format/filter/Filter} condition Filter condition.
|
* @param {!import("./Filter.js").default} condition Filter condition.
|
||||||
*/
|
*/
|
||||||
constructor(condition) {
|
constructor(condition) {
|
||||||
|
|
||||||
super('Not');
|
super('Not');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {!module:ol/format/filter/Filter}
|
* @type {!import("./Filter.js").default}
|
||||||
*/
|
*/
|
||||||
this.condition = condition;
|
this.condition = condition;
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import LogicalNary from '../filter/LogicalNary.js';
|
|||||||
class Or extends LogicalNary {
|
class Or extends LogicalNary {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {...module:ol/format/filter/Filter} conditions Conditions.
|
* @param {...import("./Filter.js").default} conditions Conditions.
|
||||||
*/
|
*/
|
||||||
constructor(conditions) {
|
constructor(conditions) {
|
||||||
const params = ['Or'].concat(Array.prototype.slice.call(arguments));
|
const params = ['Or'].concat(Array.prototype.slice.call(arguments));
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class Spatial extends Filter {
|
|||||||
/**
|
/**
|
||||||
* @param {!string} tagName The XML tag name for this filter.
|
* @param {!string} tagName The XML tag name for this filter.
|
||||||
* @param {!string} geometryName Geometry name to use.
|
* @param {!string} geometryName Geometry name to use.
|
||||||
* @param {!module:ol/geom/Geometry} geometry Geometry.
|
* @param {!import("../../geom/Geometry.js").default} geometry Geometry.
|
||||||
* @param {string=} opt_srsName SRS name. No srsName attribute will be
|
* @param {string=} opt_srsName SRS name. No srsName attribute will be
|
||||||
* set on geometries when this is not provided.
|
* set on geometries when this is not provided.
|
||||||
*/
|
*/
|
||||||
@@ -30,7 +30,7 @@ class Spatial extends Filter {
|
|||||||
this.geometryName = geometryName || 'the_geom';
|
this.geometryName = geometryName || 'the_geom';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {module:ol/geom/Geometry}
|
* @type {import("../../geom/Geometry.js").default}
|
||||||
*/
|
*/
|
||||||
this.geometry = geometry;
|
this.geometry = geometry;
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class Within extends Spatial {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {!string} geometryName Geometry name to use.
|
* @param {!string} geometryName Geometry name to use.
|
||||||
* @param {!module:ol/geom/Geometry} geometry Geometry.
|
* @param {!import("../../geom/Geometry.js").default} geometry Geometry.
|
||||||
* @param {string=} opt_srsName SRS name. No srsName attribute will be
|
* @param {string=} opt_srsName SRS name. No srsName attribute will be
|
||||||
* set on geometries when this is not provided.
|
* set on geometries when this is not provided.
|
||||||
*/
|
*/
|
||||||
|
|||||||
+10
-10
@@ -15,11 +15,11 @@ import {deflateCoordinate} from '../geom/flat/deflate.js';
|
|||||||
class Circle extends SimpleGeometry {
|
class Circle extends SimpleGeometry {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {!module:ol/coordinate~Coordinate} center Center.
|
* @param {!import("../coordinate.js").Coordinate} center Center.
|
||||||
* For internal use, flat coordinates in combination with `opt_layout` and no
|
* For internal use, flat coordinates in combination with `opt_layout` and no
|
||||||
* `opt_radius` are also accepted.
|
* `opt_radius` are also accepted.
|
||||||
* @param {number=} opt_radius Radius.
|
* @param {number=} opt_radius Radius.
|
||||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
* @param {import("./GeometryLayout.js").default=} opt_layout Layout.
|
||||||
*/
|
*/
|
||||||
constructor(center, opt_radius, opt_layout) {
|
constructor(center, opt_radius, opt_layout) {
|
||||||
super();
|
super();
|
||||||
@@ -33,7 +33,7 @@ class Circle extends SimpleGeometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Make a complete copy of the geometry.
|
* Make a complete copy of the geometry.
|
||||||
* @return {!module:ol/geom/Circle} Clone.
|
* @return {!import("./Circle.js").default} Clone.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -81,7 +81,7 @@ class Circle extends SimpleGeometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the center of the circle as {@link module:ol/coordinate~Coordinate coordinate}.
|
* Return the center of the circle as {@link module:ol/coordinate~Coordinate coordinate}.
|
||||||
* @return {module:ol/coordinate~Coordinate} Center.
|
* @return {import("../coordinate.js").Coordinate} Center.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getCenter() {
|
getCenter() {
|
||||||
@@ -151,7 +151,7 @@ class Circle extends SimpleGeometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the center of the circle as {@link module:ol/coordinate~Coordinate coordinate}.
|
* Set the center of the circle as {@link module:ol/coordinate~Coordinate coordinate}.
|
||||||
* @param {module:ol/coordinate~Coordinate} center Center.
|
* @param {import("../coordinate.js").Coordinate} center Center.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
setCenter(center) {
|
setCenter(center) {
|
||||||
@@ -169,9 +169,9 @@ class Circle extends SimpleGeometry {
|
|||||||
/**
|
/**
|
||||||
* Set the center (as {@link module:ol/coordinate~Coordinate coordinate}) and the radius (as
|
* Set the center (as {@link module:ol/coordinate~Coordinate coordinate}) and the radius (as
|
||||||
* number) of the circle.
|
* number) of the circle.
|
||||||
* @param {!module:ol/coordinate~Coordinate} center Center.
|
* @param {!import("../coordinate.js").Coordinate} center Center.
|
||||||
* @param {number} radius Radius.
|
* @param {number} radius Radius.
|
||||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
* @param {import("./GeometryLayout.js").default=} opt_layout Layout.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
setCenterAndRadius(center, radius, opt_layout) {
|
setCenterAndRadius(center, radius, opt_layout) {
|
||||||
@@ -226,11 +226,11 @@ class Circle extends SimpleGeometry {
|
|||||||
* correspond to the shape that would be obtained by transforming every point
|
* correspond to the shape that would be obtained by transforming every point
|
||||||
* of the original circle.
|
* of the original circle.
|
||||||
*
|
*
|
||||||
* @param {module:ol/proj~ProjectionLike} source The current projection. Can be a
|
* @param {import("../proj.js").ProjectionLike} source The current projection. Can be a
|
||||||
* string identifier or a {@link module:ol/proj/Projection~Projection} object.
|
* string identifier or a {@link module:ol/proj/Projection~Projection} object.
|
||||||
* @param {module:ol/proj~ProjectionLike} destination The desired projection. Can be a
|
* @param {import("../proj.js").ProjectionLike} destination The desired projection. Can be a
|
||||||
* string identifier or a {@link module:ol/proj/Projection~Projection} object.
|
* string identifier or a {@link module:ol/proj/Projection~Projection} object.
|
||||||
* @return {module:ol/geom/Circle} This geometry. Note that original geometry is
|
* @return {import("./Circle.js").default} This geometry. Note that original geometry is
|
||||||
* modified in place.
|
* modified in place.
|
||||||
* @function
|
* @function
|
||||||
* @api
|
* @api
|
||||||
|
|||||||
+23
-23
@@ -11,7 +11,7 @@ import {create as createTransform, compose as composeTransform} from '../transfo
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {module:ol/transform~Transform}
|
* @type {import("../transform.js").Transform}
|
||||||
*/
|
*/
|
||||||
const tmpTransform = createTransform();
|
const tmpTransform = createTransform();
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@ class Geometry extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {module:ol/extent~Extent}
|
* @type {import("../extent.js").Extent}
|
||||||
*/
|
*/
|
||||||
this.extent_ = createEmpty();
|
this.extent_ = createEmpty();
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ class Geometry extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @protected
|
* @protected
|
||||||
* @type {Object<string, module:ol/geom/Geometry>}
|
* @type {Object<string, import("./Geometry.js").default>}
|
||||||
*/
|
*/
|
||||||
this.simplifiedGeometryCache = {};
|
this.simplifiedGeometryCache = {};
|
||||||
|
|
||||||
@@ -68,7 +68,7 @@ class Geometry extends BaseObject {
|
|||||||
/**
|
/**
|
||||||
* Make a complete copy of the geometry.
|
* Make a complete copy of the geometry.
|
||||||
* @abstract
|
* @abstract
|
||||||
* @return {!module:ol/geom/Geometry} Clone.
|
* @return {!import("./Geometry.js").default} Clone.
|
||||||
*/
|
*/
|
||||||
clone() {}
|
clone() {}
|
||||||
|
|
||||||
@@ -76,7 +76,7 @@ class Geometry extends BaseObject {
|
|||||||
* @abstract
|
* @abstract
|
||||||
* @param {number} x X.
|
* @param {number} x X.
|
||||||
* @param {number} y Y.
|
* @param {number} y Y.
|
||||||
* @param {module:ol/coordinate~Coordinate} closestPoint Closest point.
|
* @param {import("../coordinate.js").Coordinate} closestPoint Closest point.
|
||||||
* @param {number} minSquaredDistance Minimum squared distance.
|
* @param {number} minSquaredDistance Minimum squared distance.
|
||||||
* @return {number} Minimum squared distance.
|
* @return {number} Minimum squared distance.
|
||||||
*/
|
*/
|
||||||
@@ -85,9 +85,9 @@ class Geometry extends BaseObject {
|
|||||||
/**
|
/**
|
||||||
* Return the closest point of the geometry to the passed point as
|
* Return the closest point of the geometry to the passed point as
|
||||||
* {@link module:ol/coordinate~Coordinate coordinate}.
|
* {@link module:ol/coordinate~Coordinate coordinate}.
|
||||||
* @param {module:ol/coordinate~Coordinate} point Point.
|
* @param {import("../coordinate.js").Coordinate} point Point.
|
||||||
* @param {module:ol/coordinate~Coordinate=} opt_closestPoint Closest point.
|
* @param {import("../coordinate.js").Coordinate=} opt_closestPoint Closest point.
|
||||||
* @return {module:ol/coordinate~Coordinate} Closest point.
|
* @return {import("../coordinate.js").Coordinate} Closest point.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getClosestPoint(point, opt_closestPoint) {
|
getClosestPoint(point, opt_closestPoint) {
|
||||||
@@ -99,7 +99,7 @@ class Geometry extends BaseObject {
|
|||||||
/**
|
/**
|
||||||
* Returns true if this geometry includes the specified coordinate. If the
|
* Returns true if this geometry includes the specified coordinate. If the
|
||||||
* coordinate is on the boundary of the geometry, returns false.
|
* coordinate is on the boundary of the geometry, returns false.
|
||||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
* @param {import("../coordinate.js").Coordinate} coordinate Coordinate.
|
||||||
* @return {boolean} Contains coordinate.
|
* @return {boolean} Contains coordinate.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -109,16 +109,16 @@ class Geometry extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @abstract
|
* @abstract
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {import("../extent.js").Extent} extent Extent.
|
||||||
* @protected
|
* @protected
|
||||||
* @return {module:ol/extent~Extent} extent Extent.
|
* @return {import("../extent.js").Extent} extent Extent.
|
||||||
*/
|
*/
|
||||||
computeExtent(extent) {}
|
computeExtent(extent) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the extent of the geometry.
|
* Get the extent of the geometry.
|
||||||
* @param {module:ol/extent~Extent=} opt_extent Extent.
|
* @param {import("../extent.js").Extent=} opt_extent Extent.
|
||||||
* @return {module:ol/extent~Extent} extent Extent.
|
* @return {import("../extent.js").Extent} extent Extent.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getExtent(opt_extent) {
|
getExtent(opt_extent) {
|
||||||
@@ -134,7 +134,7 @@ class Geometry extends BaseObject {
|
|||||||
* coordinates in place.
|
* coordinates in place.
|
||||||
* @abstract
|
* @abstract
|
||||||
* @param {number} angle Rotation angle in radians.
|
* @param {number} angle Rotation angle in radians.
|
||||||
* @param {module:ol/coordinate~Coordinate} anchor The rotation center.
|
* @param {import("../coordinate.js").Coordinate} anchor The rotation center.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
rotate(angle, anchor) {}
|
rotate(angle, anchor) {}
|
||||||
@@ -146,7 +146,7 @@ class Geometry extends BaseObject {
|
|||||||
* @param {number} sx The scaling factor in the x-direction.
|
* @param {number} sx The scaling factor in the x-direction.
|
||||||
* @param {number=} opt_sy The scaling factor in the y-direction (defaults to
|
* @param {number=} opt_sy The scaling factor in the y-direction (defaults to
|
||||||
* sx).
|
* sx).
|
||||||
* @param {module:ol/coordinate~Coordinate=} opt_anchor The scale origin (defaults to the center
|
* @param {import("../coordinate.js").Coordinate=} opt_anchor The scale origin (defaults to the center
|
||||||
* of the geometry extent).
|
* of the geometry extent).
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -160,7 +160,7 @@ class Geometry extends BaseObject {
|
|||||||
* simplification is used to preserve topology.
|
* simplification is used to preserve topology.
|
||||||
* @function
|
* @function
|
||||||
* @param {number} tolerance The tolerance distance for simplification.
|
* @param {number} tolerance The tolerance distance for simplification.
|
||||||
* @return {module:ol/geom/Geometry} A new, simplified version of the original
|
* @return {import("./Geometry.js").default} A new, simplified version of the original
|
||||||
* geometry.
|
* geometry.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -174,14 +174,14 @@ class Geometry extends BaseObject {
|
|||||||
* See https://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm.
|
* See https://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm.
|
||||||
* @abstract
|
* @abstract
|
||||||
* @param {number} squaredTolerance Squared tolerance.
|
* @param {number} squaredTolerance Squared tolerance.
|
||||||
* @return {module:ol/geom/Geometry} Simplified geometry.
|
* @return {import("./Geometry.js").default} Simplified geometry.
|
||||||
*/
|
*/
|
||||||
getSimplifiedGeometry(squaredTolerance) {}
|
getSimplifiedGeometry(squaredTolerance) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the type of this geometry.
|
* Get the type of this geometry.
|
||||||
* @abstract
|
* @abstract
|
||||||
* @return {module:ol/geom/GeometryType} Geometry type.
|
* @return {import("./GeometryType.js").default} Geometry type.
|
||||||
*/
|
*/
|
||||||
getType() {}
|
getType() {}
|
||||||
|
|
||||||
@@ -191,14 +191,14 @@ class Geometry extends BaseObject {
|
|||||||
* If you do not want the geometry modified in place, first `clone()` it and
|
* If you do not want the geometry modified in place, first `clone()` it and
|
||||||
* then use this function on the clone.
|
* then use this function on the clone.
|
||||||
* @abstract
|
* @abstract
|
||||||
* @param {module:ol/proj~TransformFunction} transformFn Transform.
|
* @param {import("../proj.js").TransformFunction} transformFn Transform.
|
||||||
*/
|
*/
|
||||||
applyTransform(transformFn) {}
|
applyTransform(transformFn) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test if the geometry and the passed extent intersect.
|
* Test if the geometry and the passed extent intersect.
|
||||||
* @abstract
|
* @abstract
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {import("../extent.js").Extent} extent Extent.
|
||||||
* @return {boolean} `true` if the geometry and the extent intersect.
|
* @return {boolean} `true` if the geometry and the extent intersect.
|
||||||
*/
|
*/
|
||||||
intersectsExtent(extent) {}
|
intersectsExtent(extent) {}
|
||||||
@@ -220,11 +220,11 @@ class Geometry extends BaseObject {
|
|||||||
* If you do not want the geometry modified in place, first `clone()` it and
|
* If you do not want the geometry modified in place, first `clone()` it and
|
||||||
* then use this function on the clone.
|
* then use this function on the clone.
|
||||||
*
|
*
|
||||||
* @param {module:ol/proj~ProjectionLike} source The current projection. Can be a
|
* @param {import("../proj.js").ProjectionLike} source The current projection. Can be a
|
||||||
* string identifier or a {@link module:ol/proj/Projection~Projection} object.
|
* string identifier or a {@link module:ol/proj/Projection~Projection} object.
|
||||||
* @param {module:ol/proj~ProjectionLike} destination The desired projection. Can be a
|
* @param {import("../proj.js").ProjectionLike} destination The desired projection. Can be a
|
||||||
* string identifier or a {@link module:ol/proj/Projection~Projection} object.
|
* string identifier or a {@link module:ol/proj/Projection~Projection} object.
|
||||||
* @return {module:ol/geom/Geometry} This geometry. Note that original geometry is
|
* @return {import("./Geometry.js").default} This geometry. Note that original geometry is
|
||||||
* modified in place.
|
* modified in place.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -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<import("./Geometry.js").default>=} 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<import("./Geometry.js").default>}
|
||||||
*/
|
*/
|
||||||
this.geometries_ = opt_geometries ? opt_geometries : null;
|
this.geometries_ = opt_geometries ? opt_geometries : null;
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ class GeometryCollection extends Geometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Make a complete copy of the geometry.
|
* Make a complete copy of the geometry.
|
||||||
* @return {!module:ol/geom/GeometryCollection} Clone.
|
* @return {!import("./GeometryCollection.js").default} Clone.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -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<import("./Geometry.js").default>} Geometries.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getGeometries() {
|
getGeometries() {
|
||||||
@@ -122,7 +122,7 @@ class GeometryCollection extends Geometry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {Array<module:ol/geom/Geometry>} Geometries.
|
* @return {Array<import("./Geometry.js").default>} 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<import("./Geometry.js").default>} 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<import("./Geometry.js").default>} geometries Geometries.
|
||||||
*/
|
*/
|
||||||
setGeometriesArray(geometries) {
|
setGeometriesArray(geometries) {
|
||||||
this.unlistenGeometriesChange_();
|
this.unlistenGeometriesChange_();
|
||||||
@@ -280,8 +280,8 @@ class GeometryCollection extends Geometry {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array<module:ol/geom/Geometry>} geometries Geometries.
|
* @param {Array<import("./Geometry.js").default>} geometries Geometries.
|
||||||
* @return {Array<module:ol/geom/Geometry>} Cloned geometries.
|
* @return {Array<import("./Geometry.js").default>} Cloned geometries.
|
||||||
*/
|
*/
|
||||||
function cloneGeometries(geometries) {
|
function cloneGeometries(geometries) {
|
||||||
const clonedGeometries = [];
|
const clonedGeometries = [];
|
||||||
|
|||||||
+12
-12
@@ -24,9 +24,9 @@ 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<import("../coordinate.js").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 {import("./GeometryLayout.js").default=} opt_layout Layout.
|
||||||
*/
|
*/
|
||||||
constructor(coordinates, opt_layout) {
|
constructor(coordinates, opt_layout) {
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ class LineString extends SimpleGeometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {module:ol/coordinate~Coordinate}
|
* @type {import("../coordinate.js").Coordinate}
|
||||||
*/
|
*/
|
||||||
this.flatMidpoint_ = null;
|
this.flatMidpoint_ = null;
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ class LineString extends SimpleGeometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Append the passed coordinate to the coordinates of the linestring.
|
* Append the passed coordinate to the coordinates of the linestring.
|
||||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
* @param {import("../coordinate.js").Coordinate} coordinate Coordinate.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
appendCoordinate(coordinate) {
|
appendCoordinate(coordinate) {
|
||||||
@@ -80,7 +80,7 @@ class LineString extends SimpleGeometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Make a complete copy of the geometry.
|
* Make a complete copy of the geometry.
|
||||||
* @return {!module:ol/geom/LineString} Clone.
|
* @return {!import("./LineString.js").default} Clone.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -110,7 +110,7 @@ class LineString extends SimpleGeometry {
|
|||||||
* If the callback returns a truthy value the function returns that
|
* 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 {function(this: S, module:ol/coordinate~Coordinate, module:ol/coordinate~Coordinate): T} callback Function
|
* @param {function(this: S, import("../coordinate.js").Coordinate, import("../coordinate.js").Coordinate): T} callback Function
|
||||||
* called for each segment.
|
* called for each segment.
|
||||||
* @return {T|boolean} Value.
|
* @return {T|boolean} Value.
|
||||||
* @template T,S
|
* @template T,S
|
||||||
@@ -131,7 +131,7 @@ class LineString extends SimpleGeometry {
|
|||||||
*
|
*
|
||||||
* @param {number} m M.
|
* @param {number} m M.
|
||||||
* @param {boolean=} opt_extrapolate Extrapolate. Default is `false`.
|
* @param {boolean=} opt_extrapolate Extrapolate. Default is `false`.
|
||||||
* @return {module:ol/coordinate~Coordinate} Coordinate.
|
* @return {import("../coordinate.js").Coordinate} Coordinate.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getCoordinateAtM(m, opt_extrapolate) {
|
getCoordinateAtM(m, opt_extrapolate) {
|
||||||
@@ -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<import("../coordinate.js").Coordinate>} Coordinates.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -160,9 +160,9 @@ class LineString extends SimpleGeometry {
|
|||||||
* The `fraction` is a number between 0 and 1, where 0 is the start of the
|
* The `fraction` is a number between 0 and 1, where 0 is the start of the
|
||||||
* linestring and 1 is the end.
|
* linestring and 1 is the end.
|
||||||
* @param {number} fraction Fraction.
|
* @param {number} fraction Fraction.
|
||||||
* @param {module:ol/coordinate~Coordinate=} opt_dest Optional coordinate whose values will
|
* @param {import("../coordinate.js").Coordinate=} opt_dest Optional coordinate whose values will
|
||||||
* be modified. If not provided, a new coordinate will be returned.
|
* be modified. If not provided, a new coordinate will be returned.
|
||||||
* @return {module:ol/coordinate~Coordinate} Coordinate of the interpolated point.
|
* @return {import("../coordinate.js").Coordinate} Coordinate of the interpolated point.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getCoordinateAt(fraction, opt_dest) {
|
getCoordinateAt(fraction, opt_dest) {
|
||||||
@@ -223,8 +223,8 @@ 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<import("../coordinate.js").Coordinate>} coordinates Coordinates.
|
||||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
* @param {import("./GeometryLayout.js").default=} opt_layout Layout.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -21,9 +21,9 @@ 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<import("../coordinate.js").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 {import("./GeometryLayout.js").default=} opt_layout Layout.
|
||||||
*/
|
*/
|
||||||
constructor(coordinates, opt_layout) {
|
constructor(coordinates, opt_layout) {
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ class LinearRing extends SimpleGeometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Make a complete copy of the geometry.
|
* Make a complete copy of the geometry.
|
||||||
* @return {!module:ol/geom/LinearRing} Clone.
|
* @return {!import("./LinearRing.js").default} Clone.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -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<import("../coordinate.js").Coordinate>} Coordinates.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -122,8 +122,8 @@ 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<import("../coordinate.js").Coordinate>} coordinates Coordinates.
|
||||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
* @param {import("./GeometryLayout.js").default=} opt_layout Layout.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -23,10 +23,10 @@ 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<import("../coordinate.js").Coordinate>|import("../geom.js").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 {import("./GeometryLayout.js").default=} 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) {
|
||||||
@@ -76,7 +76,7 @@ class MultiLineString extends SimpleGeometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Append the passed linestring to the multilinestring.
|
* Append the passed linestring to the multilinestring.
|
||||||
* @param {module:ol/geom/LineString} lineString LineString.
|
* @param {import("./LineString.js").default} lineString LineString.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
appendLineString(lineString) {
|
appendLineString(lineString) {
|
||||||
@@ -91,7 +91,7 @@ class MultiLineString extends SimpleGeometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Make a complete copy of the geometry.
|
* Make a complete copy of the geometry.
|
||||||
* @return {!module:ol/geom/MultiLineString} Clone.
|
* @return {!import("./MultiLineString.js").default} Clone.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -135,7 +135,7 @@ class MultiLineString extends SimpleGeometry {
|
|||||||
* @param {number} m M.
|
* @param {number} m M.
|
||||||
* @param {boolean=} opt_extrapolate Extrapolate. Default is `false`.
|
* @param {boolean=} opt_extrapolate Extrapolate. Default is `false`.
|
||||||
* @param {boolean=} opt_interpolate Interpolate. Default is `false`.
|
* @param {boolean=} opt_interpolate Interpolate. Default is `false`.
|
||||||
* @return {module:ol/coordinate~Coordinate} Coordinate.
|
* @return {import("../coordinate.js").Coordinate} Coordinate.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getCoordinateAtM(m, opt_extrapolate, opt_interpolate) {
|
getCoordinateAtM(m, opt_extrapolate, opt_interpolate) {
|
||||||
@@ -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<import("../coordinate.js").Coordinate>>} Coordinates.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -171,7 +171,7 @@ class MultiLineString extends SimpleGeometry {
|
|||||||
/**
|
/**
|
||||||
* Return the linestring at the specified index.
|
* Return the linestring at the specified index.
|
||||||
* @param {number} index Index.
|
* @param {number} index Index.
|
||||||
* @return {module:ol/geom/LineString} LineString.
|
* @return {import("./LineString.js").default} LineString.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getLineString(index) {
|
getLineString(index) {
|
||||||
@@ -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<import("./LineString.js").default>} 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<import("./LineString.js").default>} */
|
||||||
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) {
|
||||||
@@ -253,8 +253,8 @@ 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<import("../coordinate.js").Coordinate>>} coordinates Coordinates.
|
||||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
* @param {import("./GeometryLayout.js").default=} opt_layout Layout.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
|
|||||||
+10
-10
@@ -19,9 +19,9 @@ 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<import("../coordinate.js").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 {import("./GeometryLayout.js").default=} opt_layout Layout.
|
||||||
*/
|
*/
|
||||||
constructor(coordinates, opt_layout) {
|
constructor(coordinates, opt_layout) {
|
||||||
super();
|
super();
|
||||||
@@ -34,7 +34,7 @@ class MultiPoint extends SimpleGeometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Append the passed point to this multipoint.
|
* Append the passed point to this multipoint.
|
||||||
* @param {module:ol/geom/Point} point Point.
|
* @param {import("./Point.js").default} point Point.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
appendPoint(point) {
|
appendPoint(point) {
|
||||||
@@ -48,7 +48,7 @@ class MultiPoint extends SimpleGeometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Make a complete copy of the geometry.
|
* Make a complete copy of the geometry.
|
||||||
* @return {!module:ol/geom/MultiPoint} Clone.
|
* @return {!import("./MultiPoint.js").default} Clone.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -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<import("../coordinate.js").Coordinate>} Coordinates.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -94,7 +94,7 @@ class MultiPoint extends SimpleGeometry {
|
|||||||
/**
|
/**
|
||||||
* Return the point at the specified index.
|
* Return the point at the specified index.
|
||||||
* @param {number} index Index.
|
* @param {number} index Index.
|
||||||
* @return {module:ol/geom/Point} Point.
|
* @return {import("./Point.js").default} Point.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getPoint(index) {
|
getPoint(index) {
|
||||||
@@ -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<import("./Point.js").default>} 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<import("./Point.js").default>} */
|
||||||
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,8 +151,8 @@ 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<import("../coordinate.js").Coordinate>} coordinates Coordinates.
|
||||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
* @param {import("./GeometryLayout.js").default=} opt_layout Layout.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
|
|||||||
+10
-10
@@ -28,9 +28,9 @@ 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<import("../coordinate.js").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 {import("./GeometryLayout.js").default=} 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) {
|
||||||
@@ -111,7 +111,7 @@ class MultiPolygon extends SimpleGeometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Append the passed polygon to this multipolygon.
|
* Append the passed polygon to this multipolygon.
|
||||||
* @param {module:ol/geom/Polygon} polygon Polygon.
|
* @param {import("./Polygon.js").default} polygon Polygon.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
appendPolygon(polygon) {
|
appendPolygon(polygon) {
|
||||||
@@ -135,7 +135,7 @@ class MultiPolygon extends SimpleGeometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Make a complete copy of the geometry.
|
* Make a complete copy of the geometry.
|
||||||
* @return {!module:ol/geom/MultiPolygon} Clone.
|
* @return {!import("./MultiPolygon.js").default} Clone.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -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<import("../coordinate.js").Coordinate>>>} Coordinates.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -235,7 +235,7 @@ class MultiPolygon extends SimpleGeometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the interior points as {@link module:ol/geom/MultiPoint multipoint}.
|
* Return the interior points as {@link module:ol/geom/MultiPoint multipoint}.
|
||||||
* @return {module:ol/geom/MultiPoint} Interior points as XYM coordinates, where M is
|
* @return {import("./MultiPoint.js").default} Interior points as XYM coordinates, where M is
|
||||||
* the length of the horizontal intersection that the point belongs to.
|
* the length of the horizontal intersection that the point belongs to.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -279,7 +279,7 @@ class MultiPolygon extends SimpleGeometry {
|
|||||||
/**
|
/**
|
||||||
* Return the polygon at the specified index.
|
* Return the polygon at the specified index.
|
||||||
* @param {number} index Index.
|
* @param {number} index Index.
|
||||||
* @return {module:ol/geom/Polygon} Polygon.
|
* @return {import("./Polygon.js").default} Polygon.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getPolygon(index) {
|
getPolygon(index) {
|
||||||
@@ -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<import("./Polygon.js").default>} Polygons.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getPolygons() {
|
getPolygons() {
|
||||||
@@ -348,8 +348,8 @@ 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<import("../coordinate.js").Coordinate>>>} coordinates Coordinates.
|
||||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
* @param {import("./GeometryLayout.js").default=} opt_layout Layout.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ import {squaredDistance as squaredDx} from '../math.js';
|
|||||||
class Point extends SimpleGeometry {
|
class Point extends SimpleGeometry {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/coordinate~Coordinate} coordinates Coordinates.
|
* @param {import("../coordinate.js").Coordinate} coordinates Coordinates.
|
||||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
* @param {import("./GeometryLayout.js").default=} opt_layout Layout.
|
||||||
*/
|
*/
|
||||||
constructor(coordinates, opt_layout) {
|
constructor(coordinates, opt_layout) {
|
||||||
super();
|
super();
|
||||||
@@ -26,7 +26,7 @@ class Point extends SimpleGeometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Make a complete copy of the geometry.
|
* Make a complete copy of the geometry.
|
||||||
* @return {!module:ol/geom/Point} Clone.
|
* @return {!import("./Point.js").default} Clone.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -55,7 +55,7 @@ class Point extends SimpleGeometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the coordinate of the point.
|
* Return the coordinate of the point.
|
||||||
* @return {module:ol/coordinate~Coordinate} Coordinates.
|
* @return {import("../coordinate.js").Coordinate} Coordinates.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
|
|||||||
+19
-19
@@ -29,14 +29,14 @@ 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<import("../coordinate.js").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
|
||||||
* an array of vertices' coordinates where the first coordinate and the last are
|
* an array of vertices' coordinates where the first coordinate and the last are
|
||||||
* 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 {import("./GeometryLayout.js").default=} 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) {
|
||||||
@@ -57,7 +57,7 @@ class Polygon extends SimpleGeometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {module:ol/coordinate~Coordinate}
|
* @type {import("../coordinate.js").Coordinate}
|
||||||
*/
|
*/
|
||||||
this.flatInteriorPoint_ = null;
|
this.flatInteriorPoint_ = null;
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ class Polygon extends SimpleGeometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Append the passed linear ring to this polygon.
|
* Append the passed linear ring to this polygon.
|
||||||
* @param {module:ol/geom/LinearRing} linearRing Linear ring.
|
* @param {import("./LinearRing.js").default} linearRing Linear ring.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
appendLinearRing(linearRing) {
|
appendLinearRing(linearRing) {
|
||||||
@@ -111,7 +111,7 @@ class Polygon extends SimpleGeometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Make a complete copy of the geometry.
|
* Make a complete copy of the geometry.
|
||||||
* @return {!module:ol/geom/Polygon} Clone.
|
* @return {!import("./Polygon.js").default} Clone.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -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<import("../coordinate.js").Coordinate>>} Coordinates.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -203,7 +203,7 @@ class Polygon extends SimpleGeometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return an interior point of the polygon.
|
* Return an interior point of the polygon.
|
||||||
* @return {module:ol/geom/Point} Interior point as XYM coordinate, where M is the
|
* @return {import("./Point.js").default} Interior 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.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -229,7 +229,7 @@ class Polygon extends SimpleGeometry {
|
|||||||
* at index `1` and beyond.
|
* at index `1` and beyond.
|
||||||
*
|
*
|
||||||
* @param {number} index Index.
|
* @param {number} index Index.
|
||||||
* @return {module:ol/geom/LinearRing} Linear ring.
|
* @return {import("./LinearRing.js").default} Linear ring.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getLinearRing(index) {
|
getLinearRing(index) {
|
||||||
@@ -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<import("./LinearRing.js").default>} Linear rings.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getLinearRings() {
|
getLinearRings() {
|
||||||
@@ -312,8 +312,8 @@ 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<import("../coordinate.js").Coordinate>>} coordinates Coordinates.
|
||||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
* @param {import("./GeometryLayout.js").default=} opt_layout Layout.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -335,14 +335,14 @@ export default Polygon;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Create an approximation of a circle on the surface of a sphere.
|
* Create an approximation of a circle on the surface of a sphere.
|
||||||
* @param {module:ol/coordinate~Coordinate} center Center (`[lon, lat]` in degrees).
|
* @param {import("../coordinate.js").Coordinate} center Center (`[lon, lat]` in degrees).
|
||||||
* @param {number} radius The great-circle distance from the center to
|
* @param {number} radius The great-circle distance from the center to
|
||||||
* the polygon vertices.
|
* the polygon vertices.
|
||||||
* @param {number=} opt_n Optional number of vertices for the resulting
|
* @param {number=} opt_n Optional number of vertices for the resulting
|
||||||
* polygon. Default is `32`.
|
* polygon. Default is `32`.
|
||||||
* @param {number=} opt_sphereRadius Optional radius for the sphere (defaults to
|
* @param {number=} opt_sphereRadius Optional radius for the sphere (defaults to
|
||||||
* the Earth's mean radius using the WGS84 ellipsoid).
|
* the Earth's mean radius using the WGS84 ellipsoid).
|
||||||
* @return {module:ol/geom/Polygon} The "circular" polygon.
|
* @return {import("./Polygon.js").default} The "circular" polygon.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function circular(center, radius, opt_n, opt_sphereRadius) {
|
export function circular(center, radius, opt_n, opt_sphereRadius) {
|
||||||
@@ -359,8 +359,8 @@ export function circular(center, radius, opt_n, opt_sphereRadius) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a polygon from an extent. The layout used is `XY`.
|
* Create a polygon from an extent. The layout used is `XY`.
|
||||||
* @param {module:ol/extent~Extent} extent The extent.
|
* @param {import("../extent.js").Extent} extent The extent.
|
||||||
* @return {module:ol/geom/Polygon} The polygon.
|
* @return {import("./Polygon.js").default} The polygon.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function fromExtent(extent) {
|
export function fromExtent(extent) {
|
||||||
@@ -376,11 +376,11 @@ export function fromExtent(extent) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a regular polygon from a circle.
|
* Create a regular polygon from a circle.
|
||||||
* @param {module:ol/geom/Circle} circle Circle geometry.
|
* @param {import("./Circle.js").default} circle Circle geometry.
|
||||||
* @param {number=} opt_sides Number of sides of the polygon. Default is 32.
|
* @param {number=} opt_sides Number of sides of the polygon. Default is 32.
|
||||||
* @param {number=} opt_angle Start angle for the first vertex of the polygon in
|
* @param {number=} opt_angle Start angle for the first vertex of the polygon in
|
||||||
* radians. Default is 0.
|
* radians. Default is 0.
|
||||||
* @return {module:ol/geom/Polygon} Polygon geometry.
|
* @return {import("./Polygon.js").default} Polygon geometry.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function fromCircle(circle, opt_sides, opt_angle) {
|
export function fromCircle(circle, opt_sides, opt_angle) {
|
||||||
@@ -406,8 +406,8 @@ export function fromCircle(circle, opt_sides, opt_angle) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Modify the coordinates of a polygon to make it a regular polygon.
|
* Modify the coordinates of a polygon to make it a regular polygon.
|
||||||
* @param {module:ol/geom/Polygon} polygon Polygon geometry.
|
* @param {import("./Polygon.js").default} polygon Polygon geometry.
|
||||||
* @param {module:ol/coordinate~Coordinate} center Center of the regular polygon.
|
* @param {import("../coordinate.js").Coordinate} center Center of the regular polygon.
|
||||||
* @param {number} radius Radius of the regular polygon.
|
* @param {number} radius Radius of the regular polygon.
|
||||||
* @param {number=} opt_angle Start angle for the first vertex of the polygon in
|
* @param {number=} opt_angle Start angle for the first vertex of the polygon in
|
||||||
* radians. Default is 0.
|
* radians. Default is 0.
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class SimpleGeometry extends Geometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @protected
|
* @protected
|
||||||
* @type {module:ol/geom/GeometryLayout}
|
* @type {import("./GeometryLayout.js").default}
|
||||||
*/
|
*/
|
||||||
this.layout = GeometryLayout.XY;
|
this.layout = GeometryLayout.XY;
|
||||||
|
|
||||||
@@ -57,7 +57,7 @@ class SimpleGeometry extends Geometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the first coordinate of the geometry.
|
* Return the first coordinate of the geometry.
|
||||||
* @return {module:ol/coordinate~Coordinate} First coordinate.
|
* @return {import("../coordinate.js").Coordinate} First coordinate.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getFirstCoordinate() {
|
getFirstCoordinate() {
|
||||||
@@ -73,7 +73,7 @@ class SimpleGeometry extends Geometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the last coordinate of the geometry.
|
* Return the last coordinate of the geometry.
|
||||||
* @return {module:ol/coordinate~Coordinate} Last point.
|
* @return {import("../coordinate.js").Coordinate} Last point.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getLastCoordinate() {
|
getLastCoordinate() {
|
||||||
@@ -82,7 +82,7 @@ class SimpleGeometry extends Geometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the {@link module:ol/geom/GeometryLayout~GeometryLayout layout} of the geometry.
|
* Return the {@link module:ol/geom/GeometryLayout~GeometryLayout layout} of the geometry.
|
||||||
* @return {module:ol/geom/GeometryLayout} Layout.
|
* @return {import("./GeometryLayout.js").default} Layout.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getLayout() {
|
getLayout() {
|
||||||
@@ -130,7 +130,7 @@ class SimpleGeometry extends Geometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {number} squaredTolerance Squared tolerance.
|
* @param {number} squaredTolerance Squared tolerance.
|
||||||
* @return {module:ol/geom/SimpleGeometry} Simplified geometry.
|
* @return {import("./SimpleGeometry.js").default} Simplified geometry.
|
||||||
* @protected
|
* @protected
|
||||||
*/
|
*/
|
||||||
getSimplifiedGeometryInternal(squaredTolerance) {
|
getSimplifiedGeometryInternal(squaredTolerance) {
|
||||||
@@ -145,7 +145,7 @@ class SimpleGeometry extends Geometry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/geom/GeometryLayout} layout Layout.
|
* @param {import("./GeometryLayout.js").default} layout Layout.
|
||||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||||
*/
|
*/
|
||||||
setFlatCoordinates(layout, flatCoordinates) {
|
setFlatCoordinates(layout, flatCoordinates) {
|
||||||
@@ -157,12 +157,12 @@ class SimpleGeometry extends Geometry {
|
|||||||
/**
|
/**
|
||||||
* @abstract
|
* @abstract
|
||||||
* @param {!Array} coordinates Coordinates.
|
* @param {!Array} coordinates Coordinates.
|
||||||
* @param {module:ol/geom/GeometryLayout=} opt_layout Layout.
|
* @param {import("./GeometryLayout.js").default=} opt_layout Layout.
|
||||||
*/
|
*/
|
||||||
setCoordinates(coordinates, opt_layout) {}
|
setCoordinates(coordinates, opt_layout) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/geom/GeometryLayout|undefined} layout Layout.
|
* @param {import("./GeometryLayout.js").default|undefined} layout Layout.
|
||||||
* @param {Array} coordinates Coordinates.
|
* @param {Array} coordinates Coordinates.
|
||||||
* @param {number} nesting Nesting.
|
* @param {number} nesting Nesting.
|
||||||
* @protected
|
* @protected
|
||||||
@@ -257,7 +257,7 @@ class SimpleGeometry extends Geometry {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @return {module:ol/geom/GeometryLayout} layout Layout.
|
* @return {import("./GeometryLayout.js").default} layout Layout.
|
||||||
*/
|
*/
|
||||||
function getLayoutForStride(stride) {
|
function getLayoutForStride(stride) {
|
||||||
let layout;
|
let layout;
|
||||||
@@ -269,13 +269,13 @@ function getLayoutForStride(stride) {
|
|||||||
layout = GeometryLayout.XYZM;
|
layout = GeometryLayout.XYZM;
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
/** @type {module:ol/geom/GeometryLayout} */ (layout)
|
/** @type {import("./GeometryLayout.js").default} */ (layout)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/geom/GeometryLayout} layout Layout.
|
* @param {import("./GeometryLayout.js").default} layout Layout.
|
||||||
* @return {number} Stride.
|
* @return {number} Stride.
|
||||||
*/
|
*/
|
||||||
export function getStrideForLayout(layout) {
|
export function getStrideForLayout(layout) {
|
||||||
@@ -298,8 +298,8 @@ SimpleGeometry.prototype.containsXY = FALSE;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/geom/SimpleGeometry} simpleGeometry Simple geometry.
|
* @param {import("./SimpleGeometry.js").default} simpleGeometry Simple geometry.
|
||||||
* @param {module:ol/transform~Transform} transform Transform.
|
* @param {import("../transform.js").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.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -9,13 +9,13 @@ import {forEachCorner} from '../../extent.js';
|
|||||||
* @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/extent~Extent} extent Extent.
|
* @param {import("../../extent.js").Extent} extent Extent.
|
||||||
* @return {boolean} Contains extent.
|
* @return {boolean} Contains extent.
|
||||||
*/
|
*/
|
||||||
export function linearRingContainsExtent(flatCoordinates, offset, end, stride, extent) {
|
export function linearRingContainsExtent(flatCoordinates, offset, end, stride, extent) {
|
||||||
const outside = forEachCorner(extent,
|
const outside = forEachCorner(extent,
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
* @param {import("../../coordinate.js").Coordinate} coordinate Coordinate.
|
||||||
* @return {boolean} Contains (x, y).
|
* @return {boolean} Contains (x, y).
|
||||||
*/
|
*/
|
||||||
function(coordinate) {
|
function(coordinate) {
|
||||||
|
|||||||
@@ -6,7 +6,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 {import("../../coordinate.js").Coordinate} coordinate Coordinate.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @return {number} offset Offset.
|
* @return {number} offset Offset.
|
||||||
*/
|
*/
|
||||||
@@ -21,7 +21,7 @@ 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<import("../../coordinate.js").Coordinate>} coordinates Coordinates.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @return {number} offset Offset.
|
* @return {number} offset Offset.
|
||||||
*/
|
*/
|
||||||
@@ -39,7 +39,7 @@ 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<import("../../coordinate.js").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.
|
||||||
@@ -61,7 +61,7 @@ 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<import("../../coordinate.js").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.
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import {get as getProjection, getTransform} from '../../proj.js';
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {function(number): module:ol/coordinate~Coordinate} interpolate Interpolate function.
|
* @param {function(number): import("../../coordinate.js").Coordinate} interpolate Interpolate function.
|
||||||
* @param {module:ol/proj~TransformFunction} transform Transform from longitude/latitude to
|
* @param {import("../../proj.js").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.
|
||||||
@@ -25,9 +25,9 @@ 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<import("../../coordinate.js").Coordinate>} */
|
||||||
const geoStack = [geoB, geoA];
|
const geoStack = [geoB, geoA];
|
||||||
/** @type {Array<module:ol/coordinate~Coordinate>} */
|
/** @type {Array<import("../../coordinate.js").Coordinate>} */
|
||||||
const stack = [b, a];
|
const stack = [b, a];
|
||||||
/** @type {Array<number>} */
|
/** @type {Array<number>} */
|
||||||
const fractionStack = [1, 0];
|
const fractionStack = [1, 0];
|
||||||
@@ -84,7 +84,7 @@ function line(interpolate, transform, squaredTolerance) {
|
|||||||
* @param {number} lat1 Latitude 1 in degrees.
|
* @param {number} lat1 Latitude 1 in degrees.
|
||||||
* @param {number} lon2 Longitude 2 in degrees.
|
* @param {number} lon2 Longitude 2 in degrees.
|
||||||
* @param {number} lat2 Latitude 2 in degrees.
|
* @param {number} lat2 Latitude 2 in degrees.
|
||||||
* @param {module:ol/proj/Projection} projection Projection.
|
* @param {import("../../proj/Projection.js").default} projection Projection.
|
||||||
* @param {number} squaredTolerance Squared tolerance.
|
* @param {number} squaredTolerance Squared tolerance.
|
||||||
* @return {Array<number>} Flat coordinates.
|
* @return {Array<number>} Flat coordinates.
|
||||||
*/
|
*/
|
||||||
@@ -102,7 +102,7 @@ export function greatCircleArc(lon1, lat1, lon2, lat2, projection, squaredTolera
|
|||||||
return line(
|
return line(
|
||||||
/**
|
/**
|
||||||
* @param {number} frac Fraction.
|
* @param {number} frac Fraction.
|
||||||
* @return {module:ol/coordinate~Coordinate} Coordinate.
|
* @return {import("../../coordinate.js").Coordinate} Coordinate.
|
||||||
*/
|
*/
|
||||||
function(frac) {
|
function(frac) {
|
||||||
if (1 <= d) {
|
if (1 <= d) {
|
||||||
@@ -128,7 +128,7 @@ export function greatCircleArc(lon1, lat1, lon2, lat2, projection, squaredTolera
|
|||||||
* @param {number} lon Longitude.
|
* @param {number} lon Longitude.
|
||||||
* @param {number} lat1 Latitude 1.
|
* @param {number} lat1 Latitude 1.
|
||||||
* @param {number} lat2 Latitude 2.
|
* @param {number} lat2 Latitude 2.
|
||||||
* @param {module:ol/proj/Projection} projection Projection.
|
* @param {import("../../proj/Projection.js").default} projection Projection.
|
||||||
* @param {number} squaredTolerance Squared tolerance.
|
* @param {number} squaredTolerance Squared tolerance.
|
||||||
* @return {Array<number>} Flat coordinates.
|
* @return {Array<number>} Flat coordinates.
|
||||||
*/
|
*/
|
||||||
@@ -137,7 +137,7 @@ export function meridian(lon, lat1, lat2, projection, squaredTolerance) {
|
|||||||
return line(
|
return line(
|
||||||
/**
|
/**
|
||||||
* @param {number} frac Fraction.
|
* @param {number} frac Fraction.
|
||||||
* @return {module:ol/coordinate~Coordinate} Coordinate.
|
* @return {import("../../coordinate.js").Coordinate} Coordinate.
|
||||||
*/
|
*/
|
||||||
function(frac) {
|
function(frac) {
|
||||||
return [lon, lat1 + ((lat2 - lat1) * frac)];
|
return [lon, lat1 + ((lat2 - lat1) * frac)];
|
||||||
@@ -151,7 +151,7 @@ export function meridian(lon, lat1, lat2, projection, squaredTolerance) {
|
|||||||
* @param {number} lat Latitude.
|
* @param {number} lat Latitude.
|
||||||
* @param {number} lon1 Longitude 1.
|
* @param {number} lon1 Longitude 1.
|
||||||
* @param {number} lon2 Longitude 2.
|
* @param {number} lon2 Longitude 2.
|
||||||
* @param {module:ol/proj/Projection} projection Projection.
|
* @param {import("../../proj/Projection.js").default} projection Projection.
|
||||||
* @param {number} squaredTolerance Squared tolerance.
|
* @param {number} squaredTolerance Squared tolerance.
|
||||||
* @return {Array<number>} Flat coordinates.
|
* @return {Array<number>} Flat coordinates.
|
||||||
*/
|
*/
|
||||||
@@ -160,7 +160,7 @@ export function parallel(lat, lon1, lon2, projection, squaredTolerance) {
|
|||||||
return line(
|
return line(
|
||||||
/**
|
/**
|
||||||
* @param {number} frac Fraction.
|
* @param {number} frac Fraction.
|
||||||
* @return {module:ol/coordinate~Coordinate} Coordinate.
|
* @return {import("../../coordinate.js").Coordinate} Coordinate.
|
||||||
*/
|
*/
|
||||||
function(frac) {
|
function(frac) {
|
||||||
return [lon1 + ((lon2 - lon1) * frac), lat];
|
return [lon1 + ((lon2 - lon1) * frac), lat];
|
||||||
|
|||||||
@@ -8,8 +8,8 @@
|
|||||||
* @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<import("../../coordinate.js").Coordinate>=} opt_coordinates Coordinates.
|
||||||
* @return {Array<module:ol/coordinate~Coordinate>} Coordinates.
|
* @return {Array<import("../../coordinate.js").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 : [];
|
||||||
@@ -27,8 +27,8 @@ export function inflateCoordinates(flatCoordinates, offset, end, stride, opt_coo
|
|||||||
* @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<import("../../coordinate.js").Coordinate>>=} opt_coordinatess Coordinatess.
|
||||||
* @return {Array<Array<module:ol/coordinate~Coordinate>>} Coordinatess.
|
* @return {Array<Array<import("../../coordinate.js").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 : [];
|
||||||
@@ -49,9 +49,9 @@ export function inflateCoordinatesArray(flatCoordinates, offset, ends, stride, o
|
|||||||
* @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<import("../../coordinate.js").Coordinate>>>=} opt_coordinatesss
|
||||||
* Coordinatesss.
|
* Coordinatesss.
|
||||||
* @return {Array<Array<Array<module:ol/coordinate~Coordinate>>>} Coordinatesss.
|
* @return {Array<Array<Array<import("../../coordinate.js").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 : [];
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ export function interpolatePoint(flatCoordinates, offset, end, stride, fraction,
|
|||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @param {number} m M.
|
* @param {number} m M.
|
||||||
* @param {boolean} extrapolate Extrapolate.
|
* @param {boolean} extrapolate Extrapolate.
|
||||||
* @return {module:ol/coordinate~Coordinate} Coordinate.
|
* @return {import("../../coordinate.js").Coordinate} Coordinate.
|
||||||
*/
|
*/
|
||||||
export function lineStringCoordinateAtM(flatCoordinates, offset, end, stride, m, extrapolate) {
|
export function lineStringCoordinateAtM(flatCoordinates, offset, end, stride, m, extrapolate) {
|
||||||
if (end == offset) {
|
if (end == offset) {
|
||||||
@@ -133,7 +133,7 @@ export function lineStringCoordinateAtM(flatCoordinates, offset, end, stride, m,
|
|||||||
* @param {number} m M.
|
* @param {number} m M.
|
||||||
* @param {boolean} extrapolate Extrapolate.
|
* @param {boolean} extrapolate Extrapolate.
|
||||||
* @param {boolean} interpolate Interpolate.
|
* @param {boolean} interpolate Interpolate.
|
||||||
* @return {module:ol/coordinate~Coordinate} Coordinate.
|
* @return {import("../../coordinate.js").Coordinate} Coordinate.
|
||||||
*/
|
*/
|
||||||
export function lineStringsCoordinateAtM(
|
export function lineStringsCoordinateAtM(
|
||||||
flatCoordinates, offset, ends, stride, m, extrapolate, interpolate) {
|
flatCoordinates, offset, ends, stride, m, extrapolate, interpolate) {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import {forEach as forEachSegment} from '../flat/segments.js';
|
|||||||
* @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/extent~Extent} extent Extent.
|
* @param {import("../../extent.js").Extent} extent Extent.
|
||||||
* @return {boolean} True if the geometry and the extent intersect.
|
* @return {boolean} True if the geometry and the extent intersect.
|
||||||
*/
|
*/
|
||||||
export function intersectsLineString(flatCoordinates, offset, end, stride, extent) {
|
export function intersectsLineString(flatCoordinates, offset, end, stride, extent) {
|
||||||
@@ -33,8 +33,8 @@ export function intersectsLineString(flatCoordinates, offset, end, stride, exten
|
|||||||
}
|
}
|
||||||
return forEachSegment(flatCoordinates, offset, end, stride,
|
return forEachSegment(flatCoordinates, offset, end, stride,
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/coordinate~Coordinate} point1 Start point.
|
* @param {import("../../coordinate.js").Coordinate} point1 Start point.
|
||||||
* @param {module:ol/coordinate~Coordinate} point2 End point.
|
* @param {import("../../coordinate.js").Coordinate} point2 End point.
|
||||||
* @return {boolean} `true` if the segment and the extent intersect,
|
* @return {boolean} `true` if the segment and the extent intersect,
|
||||||
* `false` otherwise.
|
* `false` otherwise.
|
||||||
*/
|
*/
|
||||||
@@ -49,7 +49,7 @@ export function intersectsLineString(flatCoordinates, offset, end, stride, exten
|
|||||||
* @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 {import("../../extent.js").Extent} extent Extent.
|
||||||
* @return {boolean} True if the geometry and the extent intersect.
|
* @return {boolean} True if the geometry and the extent intersect.
|
||||||
*/
|
*/
|
||||||
export function intersectsLineStringArray(flatCoordinates, offset, ends, stride, extent) {
|
export function intersectsLineStringArray(flatCoordinates, offset, ends, stride, extent) {
|
||||||
@@ -69,7 +69,7 @@ export function intersectsLineStringArray(flatCoordinates, offset, ends, stride,
|
|||||||
* @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/extent~Extent} extent Extent.
|
* @param {import("../../extent.js").Extent} extent Extent.
|
||||||
* @return {boolean} True if the geometry and the extent intersect.
|
* @return {boolean} True if the geometry and the extent intersect.
|
||||||
*/
|
*/
|
||||||
export function intersectsLinearRing(flatCoordinates, offset, end, stride, extent) {
|
export function intersectsLinearRing(flatCoordinates, offset, end, stride, extent) {
|
||||||
@@ -98,7 +98,7 @@ export function intersectsLinearRing(flatCoordinates, offset, end, stride, exten
|
|||||||
* @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 {import("../../extent.js").Extent} extent Extent.
|
||||||
* @return {boolean} True if the geometry and the extent intersect.
|
* @return {boolean} True if the geometry and the extent intersect.
|
||||||
*/
|
*/
|
||||||
export function intersectsLinearRingArray(flatCoordinates, offset, ends, stride, extent) {
|
export function intersectsLinearRingArray(flatCoordinates, offset, ends, stride, extent) {
|
||||||
@@ -123,7 +123,7 @@ export function intersectsLinearRingArray(flatCoordinates, offset, ends, stride,
|
|||||||
* @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 {import("../../extent.js").Extent} extent Extent.
|
||||||
* @return {boolean} True if the geometry and the extent intersect.
|
* @return {boolean} True if the geometry and the extent intersect.
|
||||||
*/
|
*/
|
||||||
export function intersectsLinearRingMultiArray(flatCoordinates, offset, endss, stride, extent) {
|
export function intersectsLinearRingMultiArray(flatCoordinates, offset, endss, stride, extent) {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
* @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 {function(this: S, module:ol/coordinate~Coordinate, module:ol/coordinate~Coordinate): T} callback Function
|
* @param {function(this: S, import("../../coordinate.js").Coordinate, import("../../coordinate.js").Coordinate): T} callback Function
|
||||||
* called for each segment.
|
* called for each segment.
|
||||||
* @param {S=} opt_this The object to be used as the value of 'this'
|
* @param {S=} opt_this The object to be used as the value of 'this'
|
||||||
* within callback.
|
* within callback.
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
* @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 {import("../../transform.js").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.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -80,8 +80,8 @@ export {default as Translate} from './interaction/Translate.js';
|
|||||||
* * {@link module:ol/interaction/MouseWheelZoom~MouseWheelZoom}
|
* * {@link module:ol/interaction/MouseWheelZoom~MouseWheelZoom}
|
||||||
* * {@link module:ol/interaction/DragZoom~DragZoom}
|
* * {@link module:ol/interaction/DragZoom~DragZoom}
|
||||||
*
|
*
|
||||||
* @param {module:ol/interaction~DefaultsOptions=} opt_options Defaults options.
|
* @param {DefaultsOptions=} opt_options Defaults options.
|
||||||
* @return {module:ol/Collection<module:ol/interaction/Interaction>}
|
* @return {import("./Collection.js").default<import("./interaction/Interaction.js").default>}
|
||||||
* A collection of interactions to be used with the {@link module:ol/Map~Map}
|
* A collection of interactions to be used with the {@link module:ol/Map~Map}
|
||||||
* constructor's `interactions` option.
|
* constructor's `interactions` option.
|
||||||
* @api
|
* @api
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import Interaction, {zoomByDelta} from '../interaction/Interaction.js';
|
|||||||
class DoubleClickZoom extends Interaction {
|
class DoubleClickZoom extends Interaction {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/interaction/DoubleClickZoom~Options=} opt_options Options.
|
* @param {Options=} opt_options Options.
|
||||||
*/
|
*/
|
||||||
constructor(opt_options) {
|
constructor(opt_options) {
|
||||||
super({
|
super({
|
||||||
@@ -49,9 +49,9 @@ class DoubleClickZoom extends Interaction {
|
|||||||
/**
|
/**
|
||||||
* Handles the {@link module:ol/MapBrowserEvent map browser event} (if it was a
|
* Handles the {@link module:ol/MapBrowserEvent map browser event} (if it was a
|
||||||
* doubleclick) and eventually zooms the map.
|
* doubleclick) and eventually zooms the map.
|
||||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event.
|
* @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event.
|
||||||
* @return {boolean} `false` to stop event propagation.
|
* @return {boolean} `false` to stop event propagation.
|
||||||
* @this {module:ol/interaction/DoubleClickZoom}
|
* @this {import("./DoubleClickZoom.js").default}
|
||||||
*/
|
*/
|
||||||
function handleEvent(mapBrowserEvent) {
|
function handleEvent(mapBrowserEvent) {
|
||||||
let stopEvent = false;
|
let stopEvent = false;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user