Module types for ol/geom
This commit is contained in:
@@ -43,7 +43,7 @@ Unknown `serverType` configured.
|
|||||||
|
|
||||||
### 10
|
### 10
|
||||||
|
|
||||||
The default `geometryFunction` can only handle `ol.geom.Point` geometries.
|
The default `geometryFunction` can only handle `ol/geom/Point` geometries.
|
||||||
|
|
||||||
### 11
|
### 11
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ const map = new Map({
|
|||||||
const zoomtoswitzerlandbest = document.getElementById('zoomtoswitzerlandbest');
|
const zoomtoswitzerlandbest = document.getElementById('zoomtoswitzerlandbest');
|
||||||
zoomtoswitzerlandbest.addEventListener('click', function() {
|
zoomtoswitzerlandbest.addEventListener('click', function() {
|
||||||
const feature = source.getFeatures()[0];
|
const feature = source.getFeatures()[0];
|
||||||
const polygon = /** @type {ol.geom.SimpleGeometry} */ (feature.getGeometry());
|
const polygon = /** @type {module:ol/geom/SimpleGeometry~SimpleGeometry} */ (feature.getGeometry());
|
||||||
view.fit(polygon, {padding: [170, 50, 30, 150], constrainResolution: false});
|
view.fit(polygon, {padding: [170, 50, 30, 150], constrainResolution: false});
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ const zoomtoswitzerlandconstrained =
|
|||||||
document.getElementById('zoomtoswitzerlandconstrained');
|
document.getElementById('zoomtoswitzerlandconstrained');
|
||||||
zoomtoswitzerlandconstrained.addEventListener('click', function() {
|
zoomtoswitzerlandconstrained.addEventListener('click', function() {
|
||||||
const feature = source.getFeatures()[0];
|
const feature = source.getFeatures()[0];
|
||||||
const polygon = /** @type {ol.geom.SimpleGeometry} */ (feature.getGeometry());
|
const polygon = /** @type {module:ol/geom/SimpleGeometry~SimpleGeometry} */ (feature.getGeometry());
|
||||||
view.fit(polygon, {padding: [170, 50, 30, 150]});
|
view.fit(polygon, {padding: [170, 50, 30, 150]});
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
@@ -77,21 +77,21 @@ const zoomtoswitzerlandnearest =
|
|||||||
document.getElementById('zoomtoswitzerlandnearest');
|
document.getElementById('zoomtoswitzerlandnearest');
|
||||||
zoomtoswitzerlandnearest.addEventListener('click', function() {
|
zoomtoswitzerlandnearest.addEventListener('click', function() {
|
||||||
const feature = source.getFeatures()[0];
|
const feature = source.getFeatures()[0];
|
||||||
const polygon = /** @type {ol.geom.SimpleGeometry} */ (feature.getGeometry());
|
const polygon = /** @type {module:ol/geom/SimpleGeometry~SimpleGeometry} */ (feature.getGeometry());
|
||||||
view.fit(polygon, {padding: [170, 50, 30, 150], nearest: true});
|
view.fit(polygon, {padding: [170, 50, 30, 150], nearest: true});
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
const zoomtolausanne = document.getElementById('zoomtolausanne');
|
const zoomtolausanne = document.getElementById('zoomtolausanne');
|
||||||
zoomtolausanne.addEventListener('click', function() {
|
zoomtolausanne.addEventListener('click', function() {
|
||||||
const feature = source.getFeatures()[1];
|
const feature = source.getFeatures()[1];
|
||||||
const point = /** @type {ol.geom.SimpleGeometry} */ (feature.getGeometry());
|
const point = /** @type {module:ol/geom/SimpleGeometry~SimpleGeometry} */ (feature.getGeometry());
|
||||||
view.fit(point, {padding: [170, 50, 30, 150], minResolution: 50});
|
view.fit(point, {padding: [170, 50, 30, 150], minResolution: 50});
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
const centerlausanne = document.getElementById('centerlausanne');
|
const centerlausanne = document.getElementById('centerlausanne');
|
||||||
centerlausanne.addEventListener('click', function() {
|
centerlausanne.addEventListener('click', function() {
|
||||||
const feature = source.getFeatures()[1];
|
const feature = source.getFeatures()[1];
|
||||||
const point = /** @type {ol.geom.Point} */ (feature.getGeometry());
|
const point = /** @type {module:ol/geom/Point~Point} */ (feature.getGeometry());
|
||||||
const size = /** @type {ol.Size} */ (map.getSize());
|
const size = /** @type {ol.Size} */ (map.getSize());
|
||||||
view.centerOn(point.getCoordinates(), size, [570, 500]);
|
view.centerOn(point.getCoordinates(), size, [570, 500]);
|
||||||
}, false);
|
}, false);
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ const polyline = [
|
|||||||
'~@ym@yjA??a@cFd@kBrCgDbAUnAcBhAyAdk@et@??kF}D??OL'
|
'~@ym@yjA??a@cFd@kBrCgDbAUnAcBhAyAdk@et@??kF}D??OL'
|
||||||
].join('');
|
].join('');
|
||||||
|
|
||||||
const route = /** @type {ol.geom.LineString} */ (new Polyline({
|
const route = /** @type {module:ol/geom/LineString~LineString} */ (new Polyline({
|
||||||
factor: 1e6
|
factor: 1e6
|
||||||
}).readGeometry(polyline, {
|
}).readGeometry(polyline, {
|
||||||
dataProjection: 'EPSG:4326',
|
dataProjection: 'EPSG:4326',
|
||||||
@@ -197,7 +197,7 @@ function stopAnimation(ended) {
|
|||||||
|
|
||||||
// if animation cancelled set the marker at the beginning
|
// if animation cancelled set the marker at the beginning
|
||||||
const coord = ended ? routeCoords[routeLength - 1] : routeCoords[0];
|
const coord = ended ? routeCoords[routeLength - 1] : routeCoords[0];
|
||||||
/** @type {ol.geom.Point} */ (geoMarker.getGeometry())
|
/** @type {module:ol/geom/Point~Point} */ (geoMarker.getGeometry())
|
||||||
.setCoordinates(coord);
|
.setCoordinates(coord);
|
||||||
//remove listener
|
//remove listener
|
||||||
map.un('postcompose', moveFeature);
|
map.un('postcompose', moveFeature);
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ map.addOverlay(marker);
|
|||||||
// is time aware.
|
// is time aware.
|
||||||
// The Z dimension is actually used to store the rotation (heading).
|
// The Z dimension is actually used to store the rotation (heading).
|
||||||
const positions = new LineString([],
|
const positions = new LineString([],
|
||||||
/** @type {ol.geom.GeometryLayout} */ ('XYZM'));
|
/** @type {module:ol/geom/GeometryLayout~GeometryLayout} */ ('XYZM'));
|
||||||
|
|
||||||
// Geolocation Control
|
// Geolocation Control
|
||||||
const geolocation = new Geolocation({
|
const geolocation = new Geolocation({
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ document.getElementById('time').addEventListener('input', function() {
|
|||||||
const value = parseInt(this.value, 10) / 100;
|
const value = parseInt(this.value, 10) / 100;
|
||||||
const m = time.start + (time.duration * value);
|
const m = time.start + (time.duration * value);
|
||||||
vectorSource.forEachFeature(function(feature) {
|
vectorSource.forEachFeature(function(feature) {
|
||||||
const geometry = /** @type {ol.geom.LineString} */ (feature.getGeometry());
|
const geometry = /** @type {module:ol/geom/LineString~LineString} */ (feature.getGeometry());
|
||||||
const coordinate = geometry.getCoordinateAtM(m, true);
|
const coordinate = geometry.getCoordinateAtM(m, true);
|
||||||
let highlight = feature.get('highlight');
|
let highlight = feature.get('highlight');
|
||||||
if (highlight === undefined) {
|
if (highlight === undefined) {
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ let draw; // global so we can remove it later
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Format length output.
|
* Format length output.
|
||||||
* @param {ol.geom.LineString} line The line.
|
* @param {module:ol/geom/LineString~LineString} line The line.
|
||||||
* @return {string} The formatted length.
|
* @return {string} The formatted length.
|
||||||
*/
|
*/
|
||||||
const formatLength = function(line) {
|
const formatLength = function(line) {
|
||||||
@@ -159,7 +159,7 @@ const formatLength = function(line) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Format area output.
|
* Format area output.
|
||||||
* @param {ol.geom.Polygon} polygon The polygon.
|
* @param {module:ol/geom/Polygon~Polygon} polygon The polygon.
|
||||||
* @return {string} Formatted area.
|
* @return {string} Formatted area.
|
||||||
*/
|
*/
|
||||||
const formatArea = function(polygon) {
|
const formatArea = function(polygon) {
|
||||||
|
|||||||
@@ -243,7 +243,7 @@ olx.interaction.DragZoomOptions.prototype.out;
|
|||||||
* source: (ol.source.Vector|undefined),
|
* source: (ol.source.Vector|undefined),
|
||||||
* dragVertexDelay: (number|undefined),
|
* dragVertexDelay: (number|undefined),
|
||||||
* snapTolerance: (number|undefined),
|
* snapTolerance: (number|undefined),
|
||||||
* type: (ol.geom.GeometryType|string),
|
* type: (module:ol/geom/GeometryType~GeometryType|string),
|
||||||
* stopClick: (boolean|undefined),
|
* stopClick: (boolean|undefined),
|
||||||
* maxPoints: (number|undefined),
|
* maxPoints: (number|undefined),
|
||||||
* minPoints: (number|undefined),
|
* minPoints: (number|undefined),
|
||||||
@@ -306,7 +306,7 @@ olx.interaction.DrawOptions.prototype.snapTolerance;
|
|||||||
/**
|
/**
|
||||||
* Drawing type ('Point', 'LineString', 'Polygon', 'MultiPoint',
|
* Drawing type ('Point', 'LineString', 'Polygon', 'MultiPoint',
|
||||||
* 'MultiLineString', 'MultiPolygon' or 'Circle').
|
* 'MultiLineString', 'MultiPolygon' or 'Circle').
|
||||||
* @type {ol.geom.GeometryType|string}
|
* @type {module:ol/geom/GeometryType~GeometryType|string}
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
olx.interaction.DrawOptions.prototype.type;
|
olx.interaction.DrawOptions.prototype.type;
|
||||||
@@ -432,7 +432,7 @@ olx.interaction.ExtentOptions.prototype.extent;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Style for the drawn extent box.
|
* Style for the drawn extent box.
|
||||||
* Defaults to ol.style.Style.createDefaultEditing()[ol.geom.GeometryType.POLYGON]
|
* Defaults to ol.style.Style.createDefaultEditing()[module:ol/geom/GeometryType~GeometryType.POLYGON]
|
||||||
* @type {ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction|undefined}
|
* @type {ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction|undefined}
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -448,7 +448,7 @@ olx.interaction.ExtentOptions.prototype.pixelTolerance;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Style for the cursor used to draw the extent.
|
* Style for the cursor used to draw the extent.
|
||||||
* Defaults to ol.style.Style.createDefaultEditing()[ol.geom.GeometryType.POINT]
|
* Defaults to ol.style.Style.createDefaultEditing()[module:ol/geom/GeometryType~GeometryType.POINT]
|
||||||
* @type {ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction|undefined}
|
* @type {ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction|undefined}
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -1868,7 +1868,7 @@ olx.layer.VectorTileOptions.prototype.zIndex;
|
|||||||
/**
|
/**
|
||||||
* @typedef {{context: CanvasRenderingContext2D,
|
* @typedef {{context: CanvasRenderingContext2D,
|
||||||
* feature: (ol.Feature|ol.render.Feature),
|
* feature: (ol.Feature|ol.render.Feature),
|
||||||
* geometry: ol.geom.SimpleGeometry,
|
* geometry: module:ol/geom/SimpleGeometry~SimpleGeometry,
|
||||||
* pixelRatio: number,
|
* pixelRatio: number,
|
||||||
* resolution: number,
|
* resolution: number,
|
||||||
* rotation: number}}
|
* rotation: number}}
|
||||||
@@ -2017,7 +2017,7 @@ olx.source.BingMapsOptions.prototype.transition;
|
|||||||
* distance: (number|undefined),
|
* distance: (number|undefined),
|
||||||
* extent: (ol.Extent|undefined),
|
* extent: (ol.Extent|undefined),
|
||||||
* format: (ol.format.Feature|undefined),
|
* format: (ol.format.Feature|undefined),
|
||||||
* geometryFunction: (undefined|function(ol.Feature):ol.geom.Point),
|
* geometryFunction: (undefined|function(ol.Feature):module:ol/geom/Point~Point),
|
||||||
* projection: ol.ProjectionLike,
|
* projection: ol.ProjectionLike,
|
||||||
* source: ol.source.Vector,
|
* source: ol.source.Vector,
|
||||||
* wrapX: (boolean|undefined)}}
|
* wrapX: (boolean|undefined)}}
|
||||||
@@ -2051,7 +2051,7 @@ olx.source.ClusterOptions.prototype.extent;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Function that takes an {@link ol.Feature} as argument and returns an
|
* Function that takes an {@link ol.Feature} as argument and returns an
|
||||||
* {@link ol.geom.Point} as cluster calculation point for the feature. When a
|
* {@link module:ol/geom/Point~Point} as cluster calculation point for the feature. When a
|
||||||
* feature should not be considered for clustering, the function should return
|
* feature should not be considered for clustering, the function should return
|
||||||
* `null`. The default, which works when the underyling source contains point
|
* `null`. The default, which works when the underyling source contains point
|
||||||
* features only, is
|
* features only, is
|
||||||
@@ -2060,9 +2060,9 @@ olx.source.ClusterOptions.prototype.extent;
|
|||||||
* return feature.getGeometry();
|
* return feature.getGeometry();
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
* See {@link ol.geom.Polygon#getInteriorPoint} for a way to get a cluster
|
* See {@link module:ol/geom/Polygon~Polygon#getInteriorPoint} for a way to get a cluster
|
||||||
* calculation point for polygons.
|
* calculation point for polygons.
|
||||||
* @type {undefined|function(ol.Feature):ol.geom.Point}
|
* @type {undefined|function(ol.Feature):module:ol/geom/Point~Point}
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
olx.source.ClusterOptions.prototype.geometryFunction;
|
olx.source.ClusterOptions.prototype.geometryFunction;
|
||||||
@@ -5079,7 +5079,7 @@ olx.style.TextOptions.prototype.padding;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {{geometry: (undefined|string|ol.geom.Geometry|ol.StyleGeometryFunction),
|
* @typedef {{geometry: (undefined|string|module:ol/geom/Geometry~Geometry|ol.StyleGeometryFunction),
|
||||||
* fill: (ol.style.Fill|undefined),
|
* fill: (ol.style.Fill|undefined),
|
||||||
* image: (ol.style.Image|undefined),
|
* image: (ol.style.Image|undefined),
|
||||||
* renderer: (ol.StyleRenderFunction|undefined),
|
* renderer: (ol.StyleRenderFunction|undefined),
|
||||||
@@ -5093,7 +5093,7 @@ olx.style.StyleOptions;
|
|||||||
/**
|
/**
|
||||||
* Feature property or geometry or function returning a geometry to render for
|
* Feature property or geometry or function returning a geometry to render for
|
||||||
* this style.
|
* this style.
|
||||||
* @type {undefined|string|ol.geom.Geometry|ol.StyleGeometryFunction}
|
* @type {undefined|string|module:ol/geom/Geometry~Geometry|ol.StyleGeometryFunction}
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
olx.style.StyleOptions.prototype.geometry;
|
olx.style.StyleOptions.prototype.geometry;
|
||||||
|
|||||||
@@ -83,7 +83,7 @@
|
|||||||
* @property {number|undefined} dragVertexDelay Delay in milliseconds after pointerdown before the current vertex can be
|
* @property {number|undefined} dragVertexDelay Delay in milliseconds after pointerdown before the current vertex can be
|
||||||
* dragged to its exact position. Default is 500 ms.
|
* dragged to its exact position. Default is 500 ms.
|
||||||
* @property {number|undefined} snapTolerance Pixel distance for snapping to the drawing finish. Default is `12`.
|
* @property {number|undefined} snapTolerance Pixel distance for snapping to the drawing finish. Default is `12`.
|
||||||
* @property {ol.geom.GeometryType|string} type Drawing type ('Point', 'LineString', 'Polygon', 'MultiPoint',
|
* @property {module:ol/geom/GeometryType~GeometryType|string} type Drawing type ('Point', 'LineString', 'Polygon', 'MultiPoint',
|
||||||
* 'MultiLineString', 'MultiPolygon' or 'Circle').
|
* 'MultiLineString', 'MultiPolygon' or 'Circle').
|
||||||
* @property {boolean|undefined} stopClick Stop click, singleclick, and doubleclick events from firing during drawing.
|
* @property {boolean|undefined} stopClick Stop click, singleclick, and doubleclick events from firing during drawing.
|
||||||
* Default is `false`.
|
* Default is `false`.
|
||||||
@@ -116,11 +116,11 @@
|
|||||||
* @typedef {Object} interaction_ExtentOptions
|
* @typedef {Object} interaction_ExtentOptions
|
||||||
* @property {ol.Extent|undefined} extent Initial extent. Defaults to no initial extent
|
* @property {ol.Extent|undefined} extent Initial extent. Defaults to no initial extent
|
||||||
* @property {ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction|undefined} boxStyle Style for the drawn extent box.
|
* @property {ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction|undefined} boxStyle Style for the drawn extent box.
|
||||||
* Defaults to ol.style.Style.createDefaultEditing()[ol.geom.GeometryType.POLYGON]
|
* Defaults to ol.style.Style.createDefaultEditing()[module:ol/geom/GeometryType~GeometryType.POLYGON]
|
||||||
* @property {number|undefined} pixelTolerance Pixel tolerance for considering the pointer close enough to a segment or
|
* @property {number|undefined} pixelTolerance Pixel tolerance for considering the pointer close enough to a segment or
|
||||||
* vertex for editing. Default is `10`.
|
* vertex for editing. Default is `10`.
|
||||||
* @property {ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction|undefined} pointerStyle Style for the cursor used to draw the extent.
|
* @property {ol.style.Style|Array.<ol.style.Style>|ol.StyleFunction|undefined} pointerStyle Style for the cursor used to draw the extent.
|
||||||
* Defaults to ol.style.Style.createDefaultEditing()[ol.geom.GeometryType.POINT]
|
* Defaults to ol.style.Style.createDefaultEditing()[module:ol/geom/GeometryType~GeometryType.POINT]
|
||||||
* @property {boolean|undefined} wrapX Wrap the drawn extent across multiple maps in the X direction?
|
* @property {boolean|undefined} wrapX Wrap the drawn extent across multiple maps in the X direction?
|
||||||
* Only affects visuals, not functionality. Defaults to false.
|
* Only affects visuals, not functionality. Defaults to false.
|
||||||
*/
|
*/
|
||||||
@@ -532,8 +532,8 @@
|
|||||||
* @property {ol.AttributionLike|undefined} attributions Attributions.
|
* @property {ol.AttributionLike|undefined} attributions Attributions.
|
||||||
* @property {number|undefined} distance Minimum distance in pixels between clusters. Default is `20`.
|
* @property {number|undefined} distance Minimum distance in pixels between clusters. Default is `20`.
|
||||||
* @property {ol.Extent|undefined} extent Extent.
|
* @property {ol.Extent|undefined} extent Extent.
|
||||||
* @property {undefined|function(ol.Feature):ol.geom.Point} geometryFunction Function that takes an {@link ol.Feature} as argument and returns an
|
* @property {undefined|function(ol.Feature):module:ol/geom/Point~Point} geometryFunction Function that takes an {@link ol.Feature} as argument and returns an
|
||||||
* {@link ol.geom.Point} as cluster calculation point for the feature. When a
|
* {@link module:ol/geom/Point~Point} as cluster calculation point for the feature. When a
|
||||||
* feature should not be considered for clustering, the function should return
|
* feature should not be considered for clustering, the function should return
|
||||||
* `null`. The default, which works when the underyling source contains point
|
* `null`. The default, which works when the underyling source contains point
|
||||||
* features only, is
|
* features only, is
|
||||||
@@ -542,7 +542,7 @@
|
|||||||
* return feature.getGeometry();
|
* return feature.getGeometry();
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
* See {@link ol.geom.Polygon#getInteriorPoint} for a way to get a cluster
|
* See {@link module:ol/geom/Polygon~Polygon#getInteriorPoint} for a way to get a cluster
|
||||||
* calculation point for polygons.
|
* calculation point for polygons.
|
||||||
* @property {ol.format.Feature|undefined} format Format.
|
* @property {ol.format.Feature|undefined} format Format.
|
||||||
* @property {ol.ProjectionLike} projection Projection.
|
* @property {ol.ProjectionLike} projection Projection.
|
||||||
@@ -1362,7 +1362,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} style_StyleOptions
|
* @typedef {Object} style_StyleOptions
|
||||||
* @property {undefined|string|ol.geom.Geometry|ol.StyleGeometryFunction} geometry Feature property or geometry or function returning a geometry to render for
|
* @property {undefined|string|module:ol/geom/Geometry~Geometry|ol.StyleGeometryFunction} geometry Feature property or geometry or function returning a geometry to render for
|
||||||
* this style.
|
* this style.
|
||||||
* @property {ol.style.Fill|undefined} fill Fill style.
|
* @property {ol.style.Fill|undefined} fill Fill style.
|
||||||
* @property {ol.style.Image|undefined} image Image style.
|
* @property {ol.style.Image|undefined} image Image style.
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import {get as getProjection} from '../proj.js';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<ol.geom.GeometryType, function(EsriJSONGeometry): ol.geom.Geometry>}
|
* @type {Object.<module:ol/geom/GeometryType~GeometryType, function(EsriJSONGeometry): module:ol/geom/Geometry~Geometry>}
|
||||||
*/
|
*/
|
||||||
const GEOMETRY_READERS = {};
|
const GEOMETRY_READERS = {};
|
||||||
GEOMETRY_READERS[GeometryType.POINT] = readPointGeometry;
|
GEOMETRY_READERS[GeometryType.POINT] = readPointGeometry;
|
||||||
@@ -37,7 +37,7 @@ GEOMETRY_READERS[GeometryType.MULTI_POLYGON] = readMultiPolygonGeometry;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, function(ol.geom.Geometry, module:ol/format/Feature~WriteOptions=): (EsriJSONGeometry)>}
|
* @type {Object.<string, function(module:ol/geom/Geometry~Geometry, module:ol/format/Feature~WriteOptions=): (EsriJSONGeometry)>}
|
||||||
*/
|
*/
|
||||||
const GEOMETRY_WRITERS = {};
|
const GEOMETRY_WRITERS = {};
|
||||||
GEOMETRY_WRITERS[GeometryType.POINT] = writePointGeometry;
|
GEOMETRY_WRITERS[GeometryType.POINT] = writePointGeometry;
|
||||||
@@ -84,13 +84,13 @@ inherits(EsriJSON, JSONFeature);
|
|||||||
/**
|
/**
|
||||||
* @param {EsriJSONGeometry} object Object.
|
* @param {EsriJSONGeometry} object Object.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||||
* @return {ol.geom.Geometry} Geometry.
|
* @return {module:ol/geom/Geometry~Geometry} Geometry.
|
||||||
*/
|
*/
|
||||||
function readGeometry(object, opt_options) {
|
function readGeometry(object, opt_options) {
|
||||||
if (!object) {
|
if (!object) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
/** @type {ol.geom.GeometryType} */
|
/** @type {module:ol/geom/GeometryType~GeometryType} */
|
||||||
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;
|
||||||
@@ -115,7 +115,7 @@ function readGeometry(object, opt_options) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const geometryReader = GEOMETRY_READERS[type];
|
const geometryReader = GEOMETRY_READERS[type];
|
||||||
return /** @type {ol.geom.Geometry} */ (transformWithOptions(
|
return /** @type {module:ol/geom/Geometry~Geometry} */ (transformWithOptions(
|
||||||
geometryReader(object), false, opt_options)
|
geometryReader(object), false, opt_options)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -127,7 +127,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 {ol.geom.GeometryLayout} layout Geometry layout.
|
* @param {module:ol/geom/GeometryLayout~GeometryLayout} layout Geometry layout.
|
||||||
* @return {Array.<!Array.<!Array.<number>>>} Transformed rings.
|
* @return {Array.<!Array.<!Array.<number>>>} Transformed rings.
|
||||||
*/
|
*/
|
||||||
function convertRings(rings, layout) {
|
function convertRings(rings, layout) {
|
||||||
@@ -176,7 +176,7 @@ function convertRings(rings, layout) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {EsriJSONGeometry} object Object.
|
* @param {EsriJSONGeometry} object Object.
|
||||||
* @return {ol.geom.Geometry} Point.
|
* @return {module:ol/geom/Geometry~Geometry} Point.
|
||||||
*/
|
*/
|
||||||
function readPointGeometry(object) {
|
function readPointGeometry(object) {
|
||||||
let point;
|
let point;
|
||||||
@@ -198,7 +198,7 @@ function readPointGeometry(object) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {EsriJSONGeometry} object Object.
|
* @param {EsriJSONGeometry} object Object.
|
||||||
* @return {ol.geom.Geometry} LineString.
|
* @return {module:ol/geom/Geometry~Geometry} LineString.
|
||||||
*/
|
*/
|
||||||
function readLineStringGeometry(object) {
|
function readLineStringGeometry(object) {
|
||||||
const layout = getGeometryLayout(object);
|
const layout = getGeometryLayout(object);
|
||||||
@@ -208,7 +208,7 @@ function readLineStringGeometry(object) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {EsriJSONGeometry} object Object.
|
* @param {EsriJSONGeometry} object Object.
|
||||||
* @return {ol.geom.Geometry} MultiLineString.
|
* @return {module:ol/geom/Geometry~Geometry} MultiLineString.
|
||||||
*/
|
*/
|
||||||
function readMultiLineStringGeometry(object) {
|
function readMultiLineStringGeometry(object) {
|
||||||
const layout = getGeometryLayout(object);
|
const layout = getGeometryLayout(object);
|
||||||
@@ -218,7 +218,7 @@ function readMultiLineStringGeometry(object) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {EsriJSONGeometry} object Object.
|
* @param {EsriJSONGeometry} object Object.
|
||||||
* @return {ol.geom.GeometryLayout} The geometry layout to use.
|
* @return {module:ol/geom/GeometryLayout~GeometryLayout} The geometry layout to use.
|
||||||
*/
|
*/
|
||||||
function getGeometryLayout(object) {
|
function getGeometryLayout(object) {
|
||||||
let layout = GeometryLayout.XY;
|
let layout = GeometryLayout.XY;
|
||||||
@@ -235,7 +235,7 @@ function getGeometryLayout(object) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {EsriJSONGeometry} object Object.
|
* @param {EsriJSONGeometry} object Object.
|
||||||
* @return {ol.geom.Geometry} MultiPoint.
|
* @return {module:ol/geom/Geometry~Geometry} MultiPoint.
|
||||||
*/
|
*/
|
||||||
function readMultiPointGeometry(object) {
|
function readMultiPointGeometry(object) {
|
||||||
const layout = getGeometryLayout(object);
|
const layout = getGeometryLayout(object);
|
||||||
@@ -245,7 +245,7 @@ function readMultiPointGeometry(object) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {EsriJSONGeometry} object Object.
|
* @param {EsriJSONGeometry} object Object.
|
||||||
* @return {ol.geom.Geometry} MultiPolygon.
|
* @return {module:ol/geom/Geometry~Geometry} MultiPolygon.
|
||||||
*/
|
*/
|
||||||
function readMultiPolygonGeometry(object) {
|
function readMultiPolygonGeometry(object) {
|
||||||
const layout = getGeometryLayout(object);
|
const layout = getGeometryLayout(object);
|
||||||
@@ -257,7 +257,7 @@ function readMultiPolygonGeometry(object) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {EsriJSONGeometry} object Object.
|
* @param {EsriJSONGeometry} object Object.
|
||||||
* @return {ol.geom.Geometry} Polygon.
|
* @return {module:ol/geom/Geometry~Geometry} Polygon.
|
||||||
*/
|
*/
|
||||||
function readPolygonGeometry(object) {
|
function readPolygonGeometry(object) {
|
||||||
const layout = getGeometryLayout(object);
|
const layout = getGeometryLayout(object);
|
||||||
@@ -266,14 +266,14 @@ function readPolygonGeometry(object) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.Geometry} geometry Geometry.
|
* @param {module:ol/geom/Geometry~Geometry} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {module:ol/format/Feature~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 {ol.geom.Point} */ (geometry).getCoordinates();
|
const coordinates = /** @type {module:ol/geom/Point~Point} */ (geometry).getCoordinates();
|
||||||
let esriJSON;
|
let esriJSON;
|
||||||
const layout = /** @type {ol.geom.Point} */ (geometry).getLayout();
|
const layout = /** @type {module:ol/geom/Point~Point} */ (geometry).getLayout();
|
||||||
if (layout === GeometryLayout.XYZ) {
|
if (layout === GeometryLayout.XYZ) {
|
||||||
esriJSON = /** @type {EsriJSONPoint} */ ({
|
esriJSON = /** @type {EsriJSONPoint} */ ({
|
||||||
x: coordinates[0],
|
x: coordinates[0],
|
||||||
@@ -306,7 +306,7 @@ function writePointGeometry(geometry, opt_options) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.SimpleGeometry} geometry Geometry.
|
* @param {module:ol/geom/SimpleGeometry~SimpleGeometry} 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) {
|
||||||
@@ -321,76 +321,76 @@ function getHasZM(geometry) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.Geometry} geometry Geometry.
|
* @param {module:ol/geom/Geometry~Geometry} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {module:ol/format/Feature~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 {ol.geom.LineString} */(geometry));
|
const hasZM = getHasZM(/** @type {module:ol/geom/LineString~LineString} */(geometry));
|
||||||
return /** @type {EsriJSONPolyline} */ ({
|
return /** @type {EsriJSONPolyline} */ ({
|
||||||
hasZ: hasZM.hasZ,
|
hasZ: hasZM.hasZ,
|
||||||
hasM: hasZM.hasM,
|
hasM: hasZM.hasM,
|
||||||
paths: [
|
paths: [
|
||||||
/** @type {ol.geom.LineString} */ (geometry).getCoordinates()
|
/** @type {module:ol/geom/LineString~LineString} */ (geometry).getCoordinates()
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.Geometry} geometry Geometry.
|
* @param {module:ol/geom/Geometry~Geometry} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {module:ol/format/Feature~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 {ol.geom.Polygon} */(geometry));
|
const hasZM = getHasZM(/** @type {module:ol/geom/Polygon~Polygon} */(geometry));
|
||||||
return /** @type {EsriJSONPolygon} */ ({
|
return /** @type {EsriJSONPolygon} */ ({
|
||||||
hasZ: hasZM.hasZ,
|
hasZ: hasZM.hasZ,
|
||||||
hasM: hasZM.hasM,
|
hasM: hasZM.hasM,
|
||||||
rings: /** @type {ol.geom.Polygon} */ (geometry).getCoordinates(false)
|
rings: /** @type {module:ol/geom/Polygon~Polygon} */ (geometry).getCoordinates(false)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.Geometry} geometry Geometry.
|
* @param {module:ol/geom/Geometry~Geometry} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {module:ol/format/Feature~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 {ol.geom.MultiLineString} */(geometry));
|
const hasZM = getHasZM(/** @type {module:ol/geom/MultiLineString~MultiLineString} */(geometry));
|
||||||
return /** @type {EsriJSONPolyline} */ ({
|
return /** @type {EsriJSONPolyline} */ ({
|
||||||
hasZ: hasZM.hasZ,
|
hasZ: hasZM.hasZ,
|
||||||
hasM: hasZM.hasM,
|
hasM: hasZM.hasM,
|
||||||
paths: /** @type {ol.geom.MultiLineString} */ (geometry).getCoordinates()
|
paths: /** @type {module:ol/geom/MultiLineString~MultiLineString} */ (geometry).getCoordinates()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.Geometry} geometry Geometry.
|
* @param {module:ol/geom/Geometry~Geometry} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {module:ol/format/Feature~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 {ol.geom.MultiPoint} */(geometry));
|
const hasZM = getHasZM(/** @type {module:ol/geom/MultiPoint~MultiPoint} */(geometry));
|
||||||
return /** @type {EsriJSONMultipoint} */ ({
|
return /** @type {EsriJSONMultipoint} */ ({
|
||||||
hasZ: hasZM.hasZ,
|
hasZ: hasZM.hasZ,
|
||||||
hasM: hasZM.hasM,
|
hasM: hasZM.hasM,
|
||||||
points: /** @type {ol.geom.MultiPoint} */ (geometry).getCoordinates()
|
points: /** @type {module:ol/geom/MultiPoint~MultiPoint} */ (geometry).getCoordinates()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.Geometry} geometry Geometry.
|
* @param {module:ol/geom/Geometry~Geometry} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {module:ol/format/Feature~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 {ol.geom.MultiPolygon} */(geometry));
|
const hasZM = getHasZM(/** @type {module:ol/geom/MultiPolygon~MultiPolygon} */(geometry));
|
||||||
const coordinates = /** @type {ol.geom.MultiPolygon} */ (geometry).getCoordinates(false);
|
const coordinates = /** @type {module:ol/geom/MultiPolygon~MultiPolygon} */ (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--) {
|
||||||
@@ -481,7 +481,7 @@ EsriJSON.prototype.readFeaturesFromObject = function(object, opt_options) {
|
|||||||
* @function
|
* @function
|
||||||
* @param {ArrayBuffer|Document|Node|Object|string} source Source.
|
* @param {ArrayBuffer|Document|Node|Object|string} source Source.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||||
* @return {ol.geom.Geometry} Geometry.
|
* @return {module:ol/geom/Geometry~Geometry} Geometry.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
EsriJSON.prototype.readGeometry;
|
EsriJSON.prototype.readGeometry;
|
||||||
@@ -521,13 +521,13 @@ EsriJSON.prototype.readProjectionFromObject = function(object) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.Geometry} geometry Geometry.
|
* @param {module:ol/geom/Geometry~Geometry} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {module:ol/format/Feature~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 {ol.geom.Geometry} */(
|
return geometryWriter(/** @type {module:ol/geom/Geometry~Geometry} */(
|
||||||
transformWithOptions(geometry, true, opt_options)), opt_options);
|
transformWithOptions(geometry, true, opt_options)), opt_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -536,7 +536,7 @@ function writeGeometry(geometry, opt_options) {
|
|||||||
* Encode a geometry as a EsriJSON string.
|
* Encode a geometry as a EsriJSON string.
|
||||||
*
|
*
|
||||||
* @function
|
* @function
|
||||||
* @param {ol.geom.Geometry} geometry Geometry.
|
* @param {module:ol/geom/Geometry~Geometry} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||||
* @return {string} EsriJSON.
|
* @return {string} EsriJSON.
|
||||||
* @api
|
* @api
|
||||||
@@ -547,7 +547,7 @@ EsriJSON.prototype.writeGeometry;
|
|||||||
/**
|
/**
|
||||||
* Encode a geometry as a EsriJSON object.
|
* Encode a geometry as a EsriJSON object.
|
||||||
*
|
*
|
||||||
* @param {ol.geom.Geometry} geometry Geometry.
|
* @param {module:ol/geom/Geometry~Geometry} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||||
* @return {EsriJSONGeometry} Object.
|
* @return {EsriJSONGeometry} Object.
|
||||||
* @override
|
* @override
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ FeatureFormat.prototype.readFeatures = function(source, opt_options) {};
|
|||||||
* @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 {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||||
* @return {ol.geom.Geometry} Geometry.
|
* @return {module:ol/geom/Geometry~Geometry} Geometry.
|
||||||
*/
|
*/
|
||||||
FeatureFormat.prototype.readGeometry = function(source, opt_options) {};
|
FeatureFormat.prototype.readGeometry = function(source, opt_options) {};
|
||||||
|
|
||||||
@@ -199,7 +199,7 @@ FeatureFormat.prototype.writeFeatures = function(features, opt_options) {};
|
|||||||
* Write a single geometry in this format.
|
* Write a single geometry in this format.
|
||||||
*
|
*
|
||||||
* @abstract
|
* @abstract
|
||||||
* @param {ol.geom.Geometry} geometry Geometry.
|
* @param {module:ol/geom/Geometry~Geometry} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||||
* @return {string} Result.
|
* @return {string} Result.
|
||||||
*/
|
*/
|
||||||
@@ -208,11 +208,11 @@ FeatureFormat.prototype.writeGeometry = function(geometry, opt_options) {};
|
|||||||
export default FeatureFormat;
|
export default FeatureFormat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.Geometry|module:ol/extent~Extent} geometry Geometry.
|
* @param {module:ol/geom/Geometry~Geometry|module:ol/extent~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)=} opt_options
|
* @param {(module:ol/format/Feature~WriteOptions|module:ol/format/Feature~ReadOptions)=} opt_options
|
||||||
* Options.
|
* Options.
|
||||||
* @return {ol.geom.Geometry|module:ol/extent~Extent} Transformed geometry.
|
* @return {module:ol/geom/Geometry~Geometry|module:ol/extent~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 ?
|
||||||
@@ -220,7 +220,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 {ol.geom.Geometry|module:ol/extent~Extent}
|
* @type {module:ol/geom/Geometry~Geometry|module:ol/extent~Extent}
|
||||||
*/
|
*/
|
||||||
let transformed;
|
let transformed;
|
||||||
if (featureProjection && dataProjection &&
|
if (featureProjection && dataProjection &&
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ GML2.prototype.GEOMETRY_NODE_FACTORY_ = function(value, objectStack, opt_nodeNam
|
|||||||
const multiCurve = context['multiCurve'];
|
const multiCurve = context['multiCurve'];
|
||||||
let nodeName;
|
let nodeName;
|
||||||
if (!Array.isArray(value)) {
|
if (!Array.isArray(value)) {
|
||||||
nodeName = /** @type {ol.geom.Geometry} */ (value).getType();
|
nodeName = /** @type {module:ol/geom/Geometry~Geometry} */ (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) {
|
||||||
@@ -215,7 +215,7 @@ GML2.prototype.writeFeatureElement = function(node, feature, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {ol.geom.LineString} geometry LineString geometry.
|
* @param {module:ol/geom/LineString~LineString} geometry LineString geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array.<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -241,7 +241,7 @@ GML2.prototype.writeCurveOrLineString_ = function(node, geometry, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {ol.geom.LineString} line LineString geometry.
|
* @param {module:ol/geom/LineString~LineString} line LineString geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array.<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -256,7 +256,7 @@ GML2.prototype.writeLineStringOrCurveMember_ = function(node, line, objectStack)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {ol.geom.MultiLineString} geometry MultiLineString geometry.
|
* @param {module:ol/geom/MultiLineString~MultiLineString} geometry MultiLineString geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array.<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -278,7 +278,7 @@ GML2.prototype.writeMultiCurveOrLineString_ = function(node, geometry, objectSta
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {ol.geom.Geometry|module:ol/extent~Extent} geometry Geometry.
|
* @param {module:ol/geom/Geometry~Geometry|module:ol/extent~Extent} geometry Geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array.<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
GML2.prototype.writeGeometryElement = function(node, geometry, objectStack) {
|
GML2.prototype.writeGeometryElement = function(node, geometry, objectStack) {
|
||||||
@@ -294,7 +294,7 @@ GML2.prototype.writeGeometryElement = function(node, geometry, objectStack) {
|
|||||||
value = geometry;
|
value = geometry;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
value = transformWithOptions(/** @type {ol.geom.Geometry} */ (geometry), true, context);
|
value = transformWithOptions(/** @type {module:ol/geom/Geometry~Geometry} */ (geometry), true, context);
|
||||||
}
|
}
|
||||||
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */
|
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */
|
||||||
(item), this.GEOMETRY_SERIALIZERS_,
|
(item), this.GEOMETRY_SERIALIZERS_,
|
||||||
@@ -320,7 +320,7 @@ GML2.prototype.createCoordinatesNode_ = function(namespaceURI) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {ol.geom.LineString|ol.geom.LinearRing} value Geometry.
|
* @param {module:ol/geom/LineString~LineString|module:ol/geom/LinearRing~LinearRing} value Geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array.<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -342,7 +342,7 @@ GML2.prototype.writeCoordinates_ = function(node, value, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {ol.geom.LineString} line LineString geometry.
|
* @param {module:ol/geom/LineString~LineString} line LineString geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array.<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -355,7 +355,7 @@ GML2.prototype.writeCurveSegments_ = function(node, line, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {ol.geom.Polygon} geometry Polygon geometry.
|
* @param {module:ol/geom/Polygon~Polygon} geometry Polygon geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array.<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -403,7 +403,7 @@ GML2.prototype.RING_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {ol.geom.Polygon} polygon Polygon geometry.
|
* @param {module:ol/geom/Polygon~Polygon} polygon Polygon geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array.<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -416,7 +416,7 @@ GML2.prototype.writeSurfacePatches_ = function(node, polygon, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {ol.geom.LinearRing} ring LinearRing geometry.
|
* @param {module:ol/geom/LinearRing~LinearRing} ring LinearRing geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array.<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -454,7 +454,7 @@ GML2.prototype.getCoords_ = function(point, opt_srsName, opt_hasZ) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {ol.geom.Point} geometry Point geometry.
|
* @param {module:ol/geom/Point~Point} geometry Point geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array.<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -475,7 +475,7 @@ GML2.prototype.writePoint_ = function(node, geometry, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {ol.geom.MultiPoint} geometry MultiPoint geometry.
|
* @param {module:ol/geom/MultiPoint~MultiPoint} geometry MultiPoint geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array.<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -496,7 +496,7 @@ GML2.prototype.writeMultiPoint_ = function(node, geometry, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {ol.geom.Point} point Point geometry.
|
* @param {module:ol/geom/Point~Point} point Point geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array.<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -509,7 +509,7 @@ GML2.prototype.writePointMember_ = function(node, point, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {ol.geom.LinearRing} geometry LinearRing geometry.
|
* @param {module:ol/geom/LinearRing~LinearRing} geometry LinearRing geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array.<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -527,7 +527,7 @@ GML2.prototype.writeLinearRing_ = function(node, geometry, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {ol.geom.MultiPolygon} geometry MultiPolygon geometry.
|
* @param {module:ol/geom/MultiPolygon~MultiPolygon} geometry MultiPolygon geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array.<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -549,7 +549,7 @@ GML2.prototype.writeMultiSurfaceOrPolygon_ = function(node, geometry, objectStac
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {ol.geom.Polygon} polygon Polygon geometry.
|
* @param {module:ol/geom/Polygon~Polygon} polygon Polygon geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array.<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -96,10 +96,10 @@ inherits(GML3, GMLBase);
|
|||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array.<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {ol.geom.MultiLineString|undefined} MultiLineString.
|
* @return {module:ol/geom/MultiLineString~MultiLineString|undefined} MultiLineString.
|
||||||
*/
|
*/
|
||||||
GML3.prototype.readMultiCurve_ = function(node, objectStack) {
|
GML3.prototype.readMultiCurve_ = function(node, objectStack) {
|
||||||
/** @type {Array.<ol.geom.LineString>} */
|
/** @type {Array.<module:ol/geom/LineString~LineString>} */
|
||||||
const lineStrings = pushParseAndPop([],
|
const lineStrings = pushParseAndPop([],
|
||||||
this.MULTICURVE_PARSERS_, node, objectStack, this);
|
this.MULTICURVE_PARSERS_, node, objectStack, this);
|
||||||
if (lineStrings) {
|
if (lineStrings) {
|
||||||
@@ -116,10 +116,10 @@ GML3.prototype.readMultiCurve_ = function(node, objectStack) {
|
|||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array.<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {ol.geom.MultiPolygon|undefined} MultiPolygon.
|
* @return {module:ol/geom/MultiPolygon~MultiPolygon|undefined} MultiPolygon.
|
||||||
*/
|
*/
|
||||||
GML3.prototype.readMultiSurface_ = function(node, objectStack) {
|
GML3.prototype.readMultiSurface_ = function(node, objectStack) {
|
||||||
/** @type {Array.<ol.geom.Polygon>} */
|
/** @type {Array.<module:ol/geom/Polygon~Polygon>} */
|
||||||
const polygons = pushParseAndPop([],
|
const polygons = pushParseAndPop([],
|
||||||
this.MULTISURFACE_PARSERS_, node, objectStack, this);
|
this.MULTISURFACE_PARSERS_, node, objectStack, this);
|
||||||
if (polygons) {
|
if (polygons) {
|
||||||
@@ -240,7 +240,7 @@ GML3.prototype.exteriorParser_ = function(node, objectStack) {
|
|||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array.<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {ol.geom.Polygon|undefined} Polygon.
|
* @return {module:ol/geom/Polygon~Polygon|undefined} Polygon.
|
||||||
*/
|
*/
|
||||||
GML3.prototype.readSurface_ = function(node, objectStack) {
|
GML3.prototype.readSurface_ = function(node, objectStack) {
|
||||||
/** @type {Array.<Array.<number>>} */
|
/** @type {Array.<Array.<number>>} */
|
||||||
@@ -268,7 +268,7 @@ GML3.prototype.readSurface_ = function(node, objectStack) {
|
|||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array.<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {ol.geom.LineString|undefined} LineString.
|
* @return {module:ol/geom/LineString~LineString|undefined} LineString.
|
||||||
*/
|
*/
|
||||||
GML3.prototype.readCurve_ = function(node, objectStack) {
|
GML3.prototype.readCurve_ = function(node, objectStack) {
|
||||||
/** @type {Array.<number>} */
|
/** @type {Array.<number>} */
|
||||||
@@ -573,7 +573,7 @@ GML3.prototype.SEGMENTS_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {ol.geom.Point} value Point geometry.
|
* @param {module:ol/geom/Point~Point} value Point geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array.<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -631,7 +631,7 @@ GML3.prototype.getCoords_ = function(point, opt_srsName, opt_hasZ) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {ol.geom.LineString|ol.geom.LinearRing} value Geometry.
|
* @param {module:ol/geom/LineString~LineString|module:ol/geom/LinearRing~LinearRing} value Geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array.<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -656,7 +656,7 @@ GML3.prototype.writePosList_ = function(node, value, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {ol.geom.Point} geometry Point geometry.
|
* @param {module:ol/geom/Point~Point} geometry Point geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array.<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -695,7 +695,7 @@ GML3.prototype.writeEnvelope = function(node, extent, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {ol.geom.LinearRing} geometry LinearRing geometry.
|
* @param {module:ol/geom/LinearRing~LinearRing} geometry LinearRing geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array.<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -732,7 +732,7 @@ GML3.prototype.RING_NODE_FACTORY_ = function(value, objectStack, opt_nodeName) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {ol.geom.Polygon} geometry Polygon geometry.
|
* @param {module:ol/geom/Polygon~Polygon} geometry Polygon geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array.<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -761,7 +761,7 @@ GML3.prototype.writeSurfaceOrPolygon_ = function(node, geometry, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {ol.geom.LineString} geometry LineString geometry.
|
* @param {module:ol/geom/LineString~LineString} geometry LineString geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array.<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -787,7 +787,7 @@ GML3.prototype.writeCurveOrLineString_ = function(node, geometry, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {ol.geom.MultiPolygon} geometry MultiPolygon geometry.
|
* @param {module:ol/geom/MultiPolygon~MultiPolygon} geometry MultiPolygon geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array.<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -809,7 +809,7 @@ GML3.prototype.writeMultiSurfaceOrPolygon_ = function(node, geometry, objectStac
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {ol.geom.MultiPoint} geometry MultiPoint geometry.
|
* @param {module:ol/geom/MultiPoint~MultiPoint} geometry MultiPoint geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array.<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -830,7 +830,7 @@ GML3.prototype.writeMultiPoint_ = function(node, geometry, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {ol.geom.MultiLineString} geometry MultiLineString geometry.
|
* @param {module:ol/geom/MultiLineString~MultiLineString} geometry MultiLineString geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array.<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -852,7 +852,7 @@ GML3.prototype.writeMultiCurveOrLineString_ = function(node, geometry, objectSta
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {ol.geom.LinearRing} ring LinearRing geometry.
|
* @param {module:ol/geom/LinearRing~LinearRing} ring LinearRing geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array.<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -865,7 +865,7 @@ GML3.prototype.writeRing_ = function(node, ring, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {ol.geom.Polygon} polygon Polygon geometry.
|
* @param {module:ol/geom/Polygon~Polygon} polygon Polygon geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array.<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -881,7 +881,7 @@ GML3.prototype.writeSurfaceOrPolygonMember_ = function(node, polygon, objectStac
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {ol.geom.Point} point Point geometry.
|
* @param {module:ol/geom/Point~Point} point Point geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array.<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -894,7 +894,7 @@ GML3.prototype.writePointMember_ = function(node, point, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {ol.geom.LineString} line LineString geometry.
|
* @param {module:ol/geom/LineString~LineString} line LineString geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array.<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -909,7 +909,7 @@ GML3.prototype.writeLineStringOrCurveMember_ = function(node, line, objectStack)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {ol.geom.Polygon} polygon Polygon geometry.
|
* @param {module:ol/geom/Polygon~Polygon} polygon Polygon geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array.<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -922,7 +922,7 @@ GML3.prototype.writeSurfacePatches_ = function(node, polygon, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {ol.geom.LineString} line LineString geometry.
|
* @param {module:ol/geom/LineString~LineString} line LineString geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array.<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -936,7 +936,7 @@ GML3.prototype.writeCurveSegments_ = function(node, line, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {ol.geom.Geometry|module:ol/extent~Extent} geometry Geometry.
|
* @param {module:ol/geom/Geometry~Geometry|module:ol/extent~Extent} geometry Geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array.<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
GML3.prototype.writeGeometryElement = function(node, geometry, objectStack) {
|
GML3.prototype.writeGeometryElement = function(node, geometry, objectStack) {
|
||||||
@@ -952,7 +952,7 @@ GML3.prototype.writeGeometryElement = function(node, geometry, objectStack) {
|
|||||||
value = geometry;
|
value = geometry;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
value = transformWithOptions(/** @type {ol.geom.Geometry} */ (geometry), true, context);
|
value = transformWithOptions(/** @type {module:ol/geom/Geometry~Geometry} */ (geometry), true, context);
|
||||||
}
|
}
|
||||||
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */
|
pushSerializeAndPop(/** @type {module:ol/xml~NodeStackItem} */
|
||||||
(item), this.GEOMETRY_SERIALIZERS_,
|
(item), this.GEOMETRY_SERIALIZERS_,
|
||||||
@@ -1075,7 +1075,7 @@ GML3.prototype.GEOMETRY_NODE_FACTORY_ = function(value, objectStack, opt_nodeNam
|
|||||||
const multiCurve = context['multiCurve'];
|
const multiCurve = context['multiCurve'];
|
||||||
let nodeName;
|
let nodeName;
|
||||||
if (!Array.isArray(value)) {
|
if (!Array.isArray(value)) {
|
||||||
nodeName = /** @type {ol.geom.Geometry} */ (value).getType();
|
nodeName = /** @type {module:ol/geom/Geometry~Geometry} */ (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) {
|
||||||
@@ -1096,7 +1096,7 @@ GML3.prototype.GEOMETRY_NODE_FACTORY_ = function(value, objectStack, opt_nodeNam
|
|||||||
/**
|
/**
|
||||||
* Encode a geometry in GML 3.1.1 Simple Features.
|
* Encode a geometry in GML 3.1.1 Simple Features.
|
||||||
*
|
*
|
||||||
* @param {ol.geom.Geometry} geometry Geometry.
|
* @param {module:ol/geom/Geometry~Geometry} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
||||||
* @return {Node} Node.
|
* @return {Node} Node.
|
||||||
* @override
|
* @override
|
||||||
|
|||||||
@@ -224,16 +224,16 @@ GMLBase.prototype.readFeaturesInternal = function(node, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array.<*>} objectStack Object stack.
|
||||||
* @return {ol.geom.Geometry|undefined} Geometry.
|
* @return {module:ol/geom/Geometry~Geometry|undefined} Geometry.
|
||||||
*/
|
*/
|
||||||
GMLBase.prototype.readGeometryElement = function(node, objectStack) {
|
GMLBase.prototype.readGeometryElement = function(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 {ol.geom.Geometry} */
|
/** @type {module:ol/geom/Geometry~Geometry} */
|
||||||
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 /** @type {ol.geom.Geometry} */ (transformWithOptions(geometry, false, context));
|
return /** @type {module:ol/geom/Geometry~Geometry} */ (transformWithOptions(geometry, false, context));
|
||||||
} else {
|
} else {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
@@ -285,7 +285,7 @@ GMLBase.prototype.readFeatureElement = function(node, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array.<*>} objectStack Object stack.
|
||||||
* @return {ol.geom.Point|undefined} Point.
|
* @return {module:ol/geom/Point~Point|undefined} Point.
|
||||||
*/
|
*/
|
||||||
GMLBase.prototype.readPoint = function(node, objectStack) {
|
GMLBase.prototype.readPoint = function(node, objectStack) {
|
||||||
const flatCoordinates = this.readFlatCoordinatesFromNode_(node, objectStack);
|
const flatCoordinates = this.readFlatCoordinatesFromNode_(node, objectStack);
|
||||||
@@ -300,7 +300,7 @@ GMLBase.prototype.readPoint = function(node, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array.<*>} objectStack Object stack.
|
||||||
* @return {ol.geom.MultiPoint|undefined} MultiPoint.
|
* @return {module:ol/geom/MultiPoint~MultiPoint|undefined} MultiPoint.
|
||||||
*/
|
*/
|
||||||
GMLBase.prototype.readMultiPoint = function(node, objectStack) {
|
GMLBase.prototype.readMultiPoint = function(node, objectStack) {
|
||||||
/** @type {Array.<Array.<number>>} */
|
/** @type {Array.<Array.<number>>} */
|
||||||
@@ -317,10 +317,10 @@ GMLBase.prototype.readMultiPoint = function(node, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array.<*>} objectStack Object stack.
|
||||||
* @return {ol.geom.MultiLineString|undefined} MultiLineString.
|
* @return {module:ol/geom/MultiLineString~MultiLineString|undefined} MultiLineString.
|
||||||
*/
|
*/
|
||||||
GMLBase.prototype.readMultiLineString = function(node, objectStack) {
|
GMLBase.prototype.readMultiLineString = function(node, objectStack) {
|
||||||
/** @type {Array.<ol.geom.LineString>} */
|
/** @type {Array.<module:ol/geom/LineString~LineString>} */
|
||||||
const lineStrings = pushParseAndPop([],
|
const lineStrings = pushParseAndPop([],
|
||||||
this.MULTILINESTRING_PARSERS_, node, objectStack, this);
|
this.MULTILINESTRING_PARSERS_, node, objectStack, this);
|
||||||
if (lineStrings) {
|
if (lineStrings) {
|
||||||
@@ -336,10 +336,10 @@ GMLBase.prototype.readMultiLineString = function(node, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array.<*>} objectStack Object stack.
|
||||||
* @return {ol.geom.MultiPolygon|undefined} MultiPolygon.
|
* @return {module:ol/geom/MultiPolygon~MultiPolygon|undefined} MultiPolygon.
|
||||||
*/
|
*/
|
||||||
GMLBase.prototype.readMultiPolygon = function(node, objectStack) {
|
GMLBase.prototype.readMultiPolygon = function(node, objectStack) {
|
||||||
/** @type {Array.<ol.geom.Polygon>} */
|
/** @type {Array.<module:ol/geom/Polygon~Polygon>} */
|
||||||
const polygons = pushParseAndPop([], this.MULTIPOLYGON_PARSERS_, node, objectStack, this);
|
const polygons = pushParseAndPop([], this.MULTIPOLYGON_PARSERS_, node, objectStack, this);
|
||||||
if (polygons) {
|
if (polygons) {
|
||||||
const multiPolygon = new MultiPolygon(null);
|
const multiPolygon = new MultiPolygon(null);
|
||||||
@@ -384,7 +384,7 @@ GMLBase.prototype.polygonMemberParser_ = function(node, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array.<*>} objectStack Object stack.
|
||||||
* @return {ol.geom.LineString|undefined} LineString.
|
* @return {module:ol/geom/LineString~LineString|undefined} LineString.
|
||||||
*/
|
*/
|
||||||
GMLBase.prototype.readLineString = function(node, objectStack) {
|
GMLBase.prototype.readLineString = function(node, objectStack) {
|
||||||
const flatCoordinates = this.readFlatCoordinatesFromNode_(node, objectStack);
|
const flatCoordinates = this.readFlatCoordinatesFromNode_(node, objectStack);
|
||||||
@@ -419,7 +419,7 @@ GMLBase.prototype.readFlatLinearRing_ = function(node, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array.<*>} objectStack Object stack.
|
||||||
* @return {ol.geom.LinearRing|undefined} LinearRing.
|
* @return {module:ol/geom/LinearRing~LinearRing|undefined} LinearRing.
|
||||||
*/
|
*/
|
||||||
GMLBase.prototype.readLinearRing = function(node, objectStack) {
|
GMLBase.prototype.readLinearRing = function(node, objectStack) {
|
||||||
const flatCoordinates = this.readFlatCoordinatesFromNode_(node, objectStack);
|
const flatCoordinates = this.readFlatCoordinatesFromNode_(node, objectStack);
|
||||||
@@ -436,7 +436,7 @@ GMLBase.prototype.readLinearRing = function(node, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array.<*>} objectStack Object stack.
|
||||||
* @return {ol.geom.Polygon|undefined} Polygon.
|
* @return {module:ol/geom/Polygon~Polygon|undefined} Polygon.
|
||||||
*/
|
*/
|
||||||
GMLBase.prototype.readPolygon = function(node, objectStack) {
|
GMLBase.prototype.readPolygon = function(node, objectStack) {
|
||||||
/** @type {Array.<Array.<number>>} */
|
/** @type {Array.<Array.<number>>} */
|
||||||
|
|||||||
@@ -423,7 +423,7 @@ function appendCoordinate(flatCoordinates, layoutOptions, node, values) {
|
|||||||
* @param {ol.LayoutOptions} layoutOptions Layout options.
|
* @param {ol.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 {ol.geom.GeometryLayout} Layout.
|
* @return {module:ol/geom/GeometryLayout~GeometryLayout} Layout.
|
||||||
*/
|
*/
|
||||||
function applyLayoutOptions(layoutOptions, flatCoordinates, ends) {
|
function applyLayoutOptions(layoutOptions, flatCoordinates, ends) {
|
||||||
let layout = GeometryLayout.XY;
|
let layout = GeometryLayout.XY;
|
||||||
@@ -785,7 +785,7 @@ function writeRte(node, feature, objectStack) {
|
|||||||
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 {ol.geom.LineString} */ (transformWithOptions(geometry, true, options));
|
geometry = /** @type {module:ol/geom/LineString~LineString} */ (transformWithOptions(geometry, true, options));
|
||||||
context['geometryLayout'] = geometry.getLayout();
|
context['geometryLayout'] = geometry.getLayout();
|
||||||
properties['rtept'] = geometry.getCoordinates();
|
properties['rtept'] = geometry.getCoordinates();
|
||||||
}
|
}
|
||||||
@@ -810,7 +810,7 @@ function writeTrk(node, feature, objectStack) {
|
|||||||
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 {ol.geom.MultiLineString} */
|
geometry = /** @type {module:ol/geom/MultiLineString~MultiLineString} */
|
||||||
(transformWithOptions(geometry, true, options));
|
(transformWithOptions(geometry, true, options));
|
||||||
properties['trkseg'] = geometry.getLineStrings();
|
properties['trkseg'] = geometry.getLineStrings();
|
||||||
}
|
}
|
||||||
@@ -825,7 +825,7 @@ function writeTrk(node, feature, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {ol.geom.LineString} lineString LineString.
|
* @param {module:ol/geom/LineString~LineString} lineString LineString.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array.<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function writeTrkSeg(node, lineString, objectStack) {
|
function writeTrkSeg(node, lineString, objectStack) {
|
||||||
@@ -849,7 +849,7 @@ function writeWpt(node, feature, objectStack) {
|
|||||||
context['properties'] = feature.getProperties();
|
context['properties'] = feature.getProperties();
|
||||||
let geometry = feature.getGeometry();
|
let geometry = feature.getGeometry();
|
||||||
if (geometry) {
|
if (geometry) {
|
||||||
geometry = /** @type {ol.geom.Point} */
|
geometry = /** @type {module:ol/geom/Point~Point} */
|
||||||
(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);
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ inherits(GeoJSON, JSONFeature);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, function(GeoJSONObject): ol.geom.Geometry>}
|
* @type {Object.<string, function(GeoJSONObject): module:ol/geom/Geometry~Geometry>}
|
||||||
*/
|
*/
|
||||||
const GEOMETRY_READERS = {
|
const GEOMETRY_READERS = {
|
||||||
'Point': readPointGeometry,
|
'Point': readPointGeometry,
|
||||||
@@ -98,7 +98,7 @@ const GEOMETRY_READERS = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, function(ol.geom.Geometry, module:ol/format/Feature~WriteOptions=): (GeoJSONGeometry|GeoJSONGeometryCollection)>}
|
* @type {Object.<string, function(module:ol/geom/Geometry~Geometry, module:ol/format/Feature~WriteOptions=): (GeoJSONGeometry|GeoJSONGeometryCollection)>}
|
||||||
*/
|
*/
|
||||||
const GEOMETRY_WRITERS = {
|
const GEOMETRY_WRITERS = {
|
||||||
'Point': writePointGeometry,
|
'Point': writePointGeometry,
|
||||||
@@ -115,14 +115,14 @@ const GEOMETRY_WRITERS = {
|
|||||||
/**
|
/**
|
||||||
* @param {GeoJSONGeometry|GeoJSONGeometryCollection} object Object.
|
* @param {GeoJSONGeometry|GeoJSONGeometryCollection} object Object.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||||
* @return {ol.geom.Geometry} Geometry.
|
* @return {module:ol/geom/Geometry~Geometry} Geometry.
|
||||||
*/
|
*/
|
||||||
function readGeometry(object, opt_options) {
|
function readGeometry(object, opt_options) {
|
||||||
if (!object) {
|
if (!object) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
const geometryReader = GEOMETRY_READERS[object.type];
|
const geometryReader = GEOMETRY_READERS[object.type];
|
||||||
return /** @type {ol.geom.Geometry} */ (transformWithOptions(
|
return /** @type {module:ol/geom/Geometry~Geometry} */ (transformWithOptions(
|
||||||
geometryReader(object), false, opt_options)
|
geometryReader(object), false, opt_options)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -131,13 +131,13 @@ function readGeometry(object, opt_options) {
|
|||||||
/**
|
/**
|
||||||
* @param {GeoJSONGeometryCollection} object Object.
|
* @param {GeoJSONGeometryCollection} object Object.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||||
* @return {ol.geom.GeometryCollection} Geometry collection.
|
* @return {module:ol/geom/GeometryCollection~GeometryCollection} 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 {ol.geom.Geometry} geometry Geometry.
|
* @return {module:ol/geom/Geometry~Geometry} geometry Geometry.
|
||||||
*/
|
*/
|
||||||
function(geometry) {
|
function(geometry) {
|
||||||
return readGeometry(geometry, opt_options);
|
return readGeometry(geometry, opt_options);
|
||||||
@@ -148,7 +148,7 @@ function readGeometryCollectionGeometry(object, opt_options) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {GeoJSONGeometry} object Object.
|
* @param {GeoJSONGeometry} object Object.
|
||||||
* @return {ol.geom.Point} Point.
|
* @return {module:ol/geom/Point~Point} Point.
|
||||||
*/
|
*/
|
||||||
function readPointGeometry(object) {
|
function readPointGeometry(object) {
|
||||||
return new Point(object.coordinates);
|
return new Point(object.coordinates);
|
||||||
@@ -157,7 +157,7 @@ function readPointGeometry(object) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {GeoJSONGeometry} object Object.
|
* @param {GeoJSONGeometry} object Object.
|
||||||
* @return {ol.geom.LineString} LineString.
|
* @return {module:ol/geom/LineString~LineString} LineString.
|
||||||
*/
|
*/
|
||||||
function readLineStringGeometry(object) {
|
function readLineStringGeometry(object) {
|
||||||
return new LineString(object.coordinates);
|
return new LineString(object.coordinates);
|
||||||
@@ -166,7 +166,7 @@ function readLineStringGeometry(object) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {GeoJSONGeometry} object Object.
|
* @param {GeoJSONGeometry} object Object.
|
||||||
* @return {ol.geom.MultiLineString} MultiLineString.
|
* @return {module:ol/geom/MultiLineString~MultiLineString} MultiLineString.
|
||||||
*/
|
*/
|
||||||
function readMultiLineStringGeometry(object) {
|
function readMultiLineStringGeometry(object) {
|
||||||
return new MultiLineString(object.coordinates);
|
return new MultiLineString(object.coordinates);
|
||||||
@@ -175,7 +175,7 @@ function readMultiLineStringGeometry(object) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {GeoJSONGeometry} object Object.
|
* @param {GeoJSONGeometry} object Object.
|
||||||
* @return {ol.geom.MultiPoint} MultiPoint.
|
* @return {module:ol/geom/MultiPoint~MultiPoint} MultiPoint.
|
||||||
*/
|
*/
|
||||||
function readMultiPointGeometry(object) {
|
function readMultiPointGeometry(object) {
|
||||||
return new MultiPoint(object.coordinates);
|
return new MultiPoint(object.coordinates);
|
||||||
@@ -184,7 +184,7 @@ function readMultiPointGeometry(object) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {GeoJSONGeometry} object Object.
|
* @param {GeoJSONGeometry} object Object.
|
||||||
* @return {ol.geom.MultiPolygon} MultiPolygon.
|
* @return {module:ol/geom/MultiPolygon~MultiPolygon} MultiPolygon.
|
||||||
*/
|
*/
|
||||||
function readMultiPolygonGeometry(object) {
|
function readMultiPolygonGeometry(object) {
|
||||||
return new MultiPolygon(object.coordinates);
|
return new MultiPolygon(object.coordinates);
|
||||||
@@ -193,7 +193,7 @@ function readMultiPolygonGeometry(object) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {GeoJSONGeometry} object Object.
|
* @param {GeoJSONGeometry} object Object.
|
||||||
* @return {ol.geom.Polygon} Polygon.
|
* @return {module:ol/geom/Polygon~Polygon} Polygon.
|
||||||
*/
|
*/
|
||||||
function readPolygonGeometry(object) {
|
function readPolygonGeometry(object) {
|
||||||
return new Polygon(object.coordinates);
|
return new Polygon(object.coordinates);
|
||||||
@@ -201,19 +201,19 @@ function readPolygonGeometry(object) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.Geometry} geometry Geometry.
|
* @param {module:ol/geom/Geometry~Geometry} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {module:ol/format/Feature~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 {ol.geom.Geometry} */ (
|
return geometryWriter(/** @type {module:ol/geom/Geometry~Geometry} */ (
|
||||||
transformWithOptions(geometry, true, opt_options)), opt_options);
|
transformWithOptions(geometry, true, opt_options)), opt_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.Geometry} geometry Geometry.
|
* @param {module:ol/geom/Geometry~Geometry} geometry Geometry.
|
||||||
* @return {GeoJSONGeometryCollection} Empty GeoJSON geometry collection.
|
* @return {GeoJSONGeometryCollection} Empty GeoJSON geometry collection.
|
||||||
*/
|
*/
|
||||||
function writeEmptyGeometryCollectionGeometry(geometry) {
|
function writeEmptyGeometryCollectionGeometry(geometry) {
|
||||||
@@ -225,7 +225,7 @@ function writeEmptyGeometryCollectionGeometry(geometry) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.GeometryCollection} geometry Geometry.
|
* @param {module:ol/geom/GeometryCollection~GeometryCollection} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||||
* @return {GeoJSONGeometryCollection} GeoJSON geometry collection.
|
* @return {GeoJSONGeometryCollection} GeoJSON geometry collection.
|
||||||
*/
|
*/
|
||||||
@@ -243,7 +243,7 @@ function writeGeometryCollectionGeometry(geometry, opt_options) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.LineString} geometry Geometry.
|
* @param {module:ol/geom/LineString~LineString} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||||
* @return {GeoJSONGeometry} GeoJSON geometry.
|
* @return {GeoJSONGeometry} GeoJSON geometry.
|
||||||
*/
|
*/
|
||||||
@@ -256,7 +256,7 @@ function writeLineStringGeometry(geometry, opt_options) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.MultiLineString} geometry Geometry.
|
* @param {module:ol/geom/MultiLineString~MultiLineString} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||||
* @return {GeoJSONGeometry} GeoJSON geometry.
|
* @return {GeoJSONGeometry} GeoJSON geometry.
|
||||||
*/
|
*/
|
||||||
@@ -269,7 +269,7 @@ function writeMultiLineStringGeometry(geometry, opt_options) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.MultiPoint} geometry Geometry.
|
* @param {module:ol/geom/MultiPoint~MultiPoint} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||||
* @return {GeoJSONGeometry} GeoJSON geometry.
|
* @return {GeoJSONGeometry} GeoJSON geometry.
|
||||||
*/
|
*/
|
||||||
@@ -282,7 +282,7 @@ function writeMultiPointGeometry(geometry, opt_options) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.MultiPolygon} geometry Geometry.
|
* @param {module:ol/geom/MultiPolygon~MultiPolygon} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||||
* @return {GeoJSONGeometry} GeoJSON geometry.
|
* @return {GeoJSONGeometry} GeoJSON geometry.
|
||||||
*/
|
*/
|
||||||
@@ -299,7 +299,7 @@ function writeMultiPolygonGeometry(geometry, opt_options) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.Point} geometry Geometry.
|
* @param {module:ol/geom/Point~Point} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||||
* @return {GeoJSONGeometry} GeoJSON geometry.
|
* @return {GeoJSONGeometry} GeoJSON geometry.
|
||||||
*/
|
*/
|
||||||
@@ -312,7 +312,7 @@ function writePointGeometry(geometry, opt_options) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.Polygon} geometry Geometry.
|
* @param {module:ol/geom/Polygon~Polygon} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||||
* @return {GeoJSONGeometry} GeoJSON geometry.
|
* @return {GeoJSONGeometry} GeoJSON geometry.
|
||||||
*/
|
*/
|
||||||
@@ -419,7 +419,7 @@ GeoJSON.prototype.readFeaturesFromObject = function(object, opt_options) {
|
|||||||
* @function
|
* @function
|
||||||
* @param {Document|Node|Object|string} source Source.
|
* @param {Document|Node|Object|string} source Source.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||||
* @return {ol.geom.Geometry} Geometry.
|
* @return {module:ol/geom/Geometry~Geometry} Geometry.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
GeoJSON.prototype.readGeometry;
|
GeoJSON.prototype.readGeometry;
|
||||||
@@ -551,7 +551,7 @@ GeoJSON.prototype.writeFeaturesObject = function(features, opt_options) {
|
|||||||
* Encode a geometry as a GeoJSON string.
|
* Encode a geometry as a GeoJSON string.
|
||||||
*
|
*
|
||||||
* @function
|
* @function
|
||||||
* @param {ol.geom.Geometry} geometry Geometry.
|
* @param {module:ol/geom/Geometry~Geometry} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||||
* @return {string} GeoJSON.
|
* @return {string} GeoJSON.
|
||||||
* @api
|
* @api
|
||||||
@@ -562,7 +562,7 @@ GeoJSON.prototype.writeGeometry;
|
|||||||
/**
|
/**
|
||||||
* Encode a geometry as a GeoJSON object.
|
* Encode a geometry as a GeoJSON object.
|
||||||
*
|
*
|
||||||
* @param {ol.geom.Geometry} geometry Geometry.
|
* @param {module:ol/geom/Geometry~Geometry} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||||
* @return {GeoJSONGeometry|GeoJSONGeometryCollection} Object.
|
* @return {GeoJSONGeometry|GeoJSONGeometryCollection} Object.
|
||||||
* @override
|
* @override
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ JSONFeature.prototype.readGeometry = function(source, opt_options) {
|
|||||||
* @param {Object} object Object.
|
* @param {Object} object Object.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||||
* @protected
|
* @protected
|
||||||
* @return {ol.geom.Geometry} Geometry.
|
* @return {module:ol/geom/Geometry~Geometry} Geometry.
|
||||||
*/
|
*/
|
||||||
JSONFeature.prototype.readGeometryFromObject = function(object, opt_options) {};
|
JSONFeature.prototype.readGeometryFromObject = function(object, opt_options) {};
|
||||||
|
|
||||||
@@ -164,7 +164,7 @@ JSONFeature.prototype.writeGeometry = function(geometry, opt_options) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @abstract
|
* @abstract
|
||||||
* @param {ol.geom.Geometry} geometry Geometry.
|
* @param {module:ol/geom/Geometry~Geometry} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||||
* @return {Object} Object.
|
* @return {Object} Object.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -890,7 +890,7 @@ const GX_MULTITRACK_GEOMETRY_PARSERS = makeStructureNS(
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array.<*>} objectStack Object stack.
|
||||||
* @return {ol.geom.MultiLineString|undefined} MultiLineString.
|
* @return {module:ol/geom/MultiLineString~MultiLineString|undefined} MultiLineString.
|
||||||
*/
|
*/
|
||||||
function readGxMultiTrack(node, objectStack) {
|
function readGxMultiTrack(node, objectStack) {
|
||||||
const lineStrings = pushParseAndPop([],
|
const lineStrings = pushParseAndPop([],
|
||||||
@@ -920,7 +920,7 @@ const GX_TRACK_PARSERS = makeStructureNS(
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array.<*>} objectStack Object stack.
|
||||||
* @return {ol.geom.LineString|undefined} LineString.
|
* @return {module:ol/geom/LineString~LineString|undefined} LineString.
|
||||||
*/
|
*/
|
||||||
function readGxTrack(node, objectStack) {
|
function readGxTrack(node, objectStack) {
|
||||||
const gxTrackObject = pushParseAndPop(
|
const gxTrackObject = pushParseAndPop(
|
||||||
@@ -1010,7 +1010,7 @@ const EXTRUDE_AND_ALTITUDE_MODE_PARSERS = makeStructureNS(
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array.<*>} objectStack Object stack.
|
||||||
* @return {ol.geom.LineString|undefined} LineString.
|
* @return {module:ol/geom/LineString~LineString|undefined} LineString.
|
||||||
*/
|
*/
|
||||||
function readLineString(node, objectStack) {
|
function readLineString(node, objectStack) {
|
||||||
const properties = pushParseAndPop({},
|
const properties = pushParseAndPop({},
|
||||||
@@ -1032,7 +1032,7 @@ function readLineString(node, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array.<*>} objectStack Object stack.
|
||||||
* @return {ol.geom.Polygon|undefined} Polygon.
|
* @return {module:ol/geom/Polygon~Polygon|undefined} Polygon.
|
||||||
*/
|
*/
|
||||||
function readLinearRing(node, objectStack) {
|
function readLinearRing(node, objectStack) {
|
||||||
const properties = pushParseAndPop({},
|
const properties = pushParseAndPop({},
|
||||||
@@ -1069,7 +1069,7 @@ const MULTI_GEOMETRY_PARSERS = makeStructureNS(
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array.<*>} objectStack Object stack.
|
||||||
* @return {ol.geom.Geometry} Geometry.
|
* @return {module:ol/geom/Geometry~Geometry} Geometry.
|
||||||
*/
|
*/
|
||||||
function readMultiGeometry(node, objectStack) {
|
function readMultiGeometry(node, objectStack) {
|
||||||
const geometries = pushParseAndPop([],
|
const geometries = pushParseAndPop([],
|
||||||
@@ -1080,7 +1080,7 @@ function readMultiGeometry(node, objectStack) {
|
|||||||
if (geometries.length === 0) {
|
if (geometries.length === 0) {
|
||||||
return new GeometryCollection(geometries);
|
return new GeometryCollection(geometries);
|
||||||
}
|
}
|
||||||
/** @type {ol.geom.Geometry} */
|
/** @type {module:ol/geom/Geometry~Geometry} */
|
||||||
let multiGeometry;
|
let multiGeometry;
|
||||||
let homogeneous = true;
|
let homogeneous = true;
|
||||||
const type = geometries[0].getType();
|
const type = geometries[0].getType();
|
||||||
@@ -1122,14 +1122,14 @@ function readMultiGeometry(node, objectStack) {
|
|||||||
} else {
|
} else {
|
||||||
multiGeometry = new GeometryCollection(geometries);
|
multiGeometry = new GeometryCollection(geometries);
|
||||||
}
|
}
|
||||||
return /** @type {ol.geom.Geometry} */ (multiGeometry);
|
return /** @type {module:ol/geom/Geometry~Geometry} */ (multiGeometry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array.<*>} objectStack Object stack.
|
||||||
* @return {ol.geom.Point|undefined} Point.
|
* @return {module:ol/geom/Point~Point|undefined} Point.
|
||||||
*/
|
*/
|
||||||
function readPoint(node, objectStack) {
|
function readPoint(node, objectStack) {
|
||||||
const properties = pushParseAndPop({},
|
const properties = pushParseAndPop({},
|
||||||
@@ -1162,7 +1162,7 @@ const FLAT_LINEAR_RINGS_PARSERS = makeStructureNS(
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array.<*>} objectStack Object stack.
|
||||||
* @return {ol.geom.Polygon|undefined} Polygon.
|
* @return {module:ol/geom/Polygon~Polygon|undefined} Polygon.
|
||||||
*/
|
*/
|
||||||
function readPolygon(node, objectStack) {
|
function readPolygon(node, objectStack) {
|
||||||
const properties = pushParseAndPop(/** @type {Object<string,*>} */ ({}),
|
const properties = pushParseAndPop(/** @type {Object<string,*>} */ ({}),
|
||||||
@@ -1248,9 +1248,9 @@ function readStyle(node, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* Reads an array of geometries and creates arrays for common geometry
|
* Reads an array of geometries and creates arrays for common geometry
|
||||||
* properties. Then sets them to the multi geometry.
|
* properties. Then sets them to the multi geometry.
|
||||||
* @param {ol.geom.MultiPoint|ol.geom.MultiLineString|ol.geom.MultiPolygon}
|
* @param {module:ol/geom/MultiPoint~MultiPoint|module:ol/geom/MultiLineString~MultiLineString|module:ol/geom/MultiPolygon~MultiPolygon}
|
||||||
* multiGeometry A multi-geometry.
|
* multiGeometry A multi-geometry.
|
||||||
* @param {Array.<ol.geom.Geometry>} geometries List of geometries.
|
* @param {Array.<module:ol/geom/Geometry~Geometry>} geometries List of geometries.
|
||||||
*/
|
*/
|
||||||
function setCommonGeometryProperties(multiGeometry, geometries) {
|
function setCommonGeometryProperties(multiGeometry, geometries) {
|
||||||
const ii = geometries.length;
|
const ii = geometries.length;
|
||||||
@@ -2499,7 +2499,7 @@ const GEOMETRY_NODE_FACTORY = function(value, objectStack, opt_nodeName) {
|
|||||||
if (value) {
|
if (value) {
|
||||||
const parentNode = objectStack[objectStack.length - 1].node;
|
const parentNode = objectStack[objectStack.length - 1].node;
|
||||||
return createElementNS(parentNode.namespaceURI,
|
return createElementNS(parentNode.namespaceURI,
|
||||||
GEOMETRY_TYPE_TO_NODENAME[/** @type {ol.geom.Geometry} */ (value).getType()]);
|
GEOMETRY_TYPE_TO_NODENAME[/** @type {module:ol/geom/Geometry~Geometry} */ (value).getType()]);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -2554,30 +2554,30 @@ const MULTI_GEOMETRY_SERIALIZERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {ol.geom.Geometry} geometry Geometry.
|
* @param {module:ol/geom/Geometry~Geometry} geometry Geometry.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array.<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function writeMultiGeometry(node, geometry, objectStack) {
|
function writeMultiGeometry(node, geometry, objectStack) {
|
||||||
/** @type {module:ol/xml~NodeStackItem} */
|
/** @type {module:ol/xml~NodeStackItem} */
|
||||||
const context = {node: node};
|
const context = {node: node};
|
||||||
const type = geometry.getType();
|
const type = geometry.getType();
|
||||||
/** @type {Array.<ol.geom.Geometry>} */
|
/** @type {Array.<module:ol/geom/Geometry~Geometry>} */
|
||||||
let geometries;
|
let geometries;
|
||||||
/** @type {function(*, Array.<*>, string=): (Node|undefined)} */
|
/** @type {function(*, Array.<*>, string=): (Node|undefined)} */
|
||||||
let factory;
|
let factory;
|
||||||
if (type == GeometryType.GEOMETRY_COLLECTION) {
|
if (type == GeometryType.GEOMETRY_COLLECTION) {
|
||||||
geometries = /** @type {ol.geom.GeometryCollection} */ (geometry).getGeometries();
|
geometries = /** @type {module:ol/geom/GeometryCollection~GeometryCollection} */ (geometry).getGeometries();
|
||||||
factory = GEOMETRY_NODE_FACTORY;
|
factory = GEOMETRY_NODE_FACTORY;
|
||||||
} else if (type == GeometryType.MULTI_POINT) {
|
} else if (type == GeometryType.MULTI_POINT) {
|
||||||
geometries = /** @type {ol.geom.MultiPoint} */ (geometry).getPoints();
|
geometries = /** @type {module:ol/geom/MultiPoint~MultiPoint} */ (geometry).getPoints();
|
||||||
factory = POINT_NODE_FACTORY;
|
factory = POINT_NODE_FACTORY;
|
||||||
} else if (type == GeometryType.MULTI_LINE_STRING) {
|
} else if (type == GeometryType.MULTI_LINE_STRING) {
|
||||||
geometries =
|
geometries =
|
||||||
(/** @type {ol.geom.MultiLineString} */ (geometry)).getLineStrings();
|
(/** @type {module:ol/geom/MultiLineString~MultiLineString} */ (geometry)).getLineStrings();
|
||||||
factory = LINE_STRING_NODE_FACTORY;
|
factory = LINE_STRING_NODE_FACTORY;
|
||||||
} else if (type == GeometryType.MULTI_POLYGON) {
|
} else if (type == GeometryType.MULTI_POLYGON) {
|
||||||
geometries =
|
geometries =
|
||||||
(/** @type {ol.geom.MultiPolygon} */ (geometry)).getPolygons();
|
(/** @type {module:ol/geom/MultiPolygon~MultiPolygon} */ (geometry)).getPolygons();
|
||||||
factory = POLYGON_NODE_FACTORY;
|
factory = POLYGON_NODE_FACTORY;
|
||||||
} else {
|
} else {
|
||||||
assert(false, 39); // Unknown geometry type
|
assert(false, 39); // Unknown geometry type
|
||||||
@@ -2601,7 +2601,7 @@ const BOUNDARY_IS_SERIALIZERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {ol.geom.LinearRing} linearRing Linear ring.
|
* @param {module:ol/geom/LinearRing~LinearRing} linearRing Linear ring.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array.<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function writeBoundaryIs(node, linearRing, objectStack) {
|
function writeBoundaryIs(node, linearRing, objectStack) {
|
||||||
@@ -2746,7 +2746,7 @@ const PRIMITIVE_GEOMETRY_SERIALIZERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {ol.geom.SimpleGeometry} geometry Geometry.
|
* @param {module:ol/geom/SimpleGeometry~SimpleGeometry} geometry Geometry.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array.<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function writePrimitiveGeometry(node, geometry, objectStack) {
|
function writePrimitiveGeometry(node, geometry, objectStack) {
|
||||||
@@ -2798,7 +2798,7 @@ const OUTER_BOUNDARY_NODE_FACTORY = makeSimpleNodeFactory('outerBoundaryIs');
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {ol.geom.Polygon} polygon Polygon.
|
* @param {module:ol/geom/Polygon~Polygon} polygon Polygon.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array.<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function writePolygon(node, polygon, objectStack) {
|
function writePolygon(node, polygon, objectStack) {
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import RenderFeature from '../render/Feature.js';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} Options
|
* @typedef {Object} Options
|
||||||
* @property {undefined|function((ol.geom.Geometry|Object.<string,*>)=)|function(ol.geom.GeometryType,Array.<number>,(Array.<number>|Array.<Array.<number>>),Object.<string,*>,number)} featureClass
|
* @property {undefined|function((module:ol/geom/Geometry~Geometry|Object.<string,*>)=)|function(module:ol/geom/GeometryType~GeometryType,Array.<number>,(Array.<number>|Array.<Array.<number>>),Object.<string,*>,number)} featureClass
|
||||||
* Class for features returned by {@link ol.format.MVT#readFeatures}. Set to
|
* Class for features returned by {@link ol.format.MVT#readFeatures}. Set to
|
||||||
* {@link ol.Feature} to get full editing and geometry support at the cost of
|
* {@link ol.Feature} to get full editing and geometry support at the cost of
|
||||||
* decreased rendering performance. The default is {@link ol.render.Feature},
|
* decreased rendering performance. The default is {@link ol.render.Feature},
|
||||||
@@ -63,8 +63,8 @@ const MVT = function(opt_options) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {function((ol.geom.Geometry|Object.<string,*>)=)|
|
* @type {function((module:ol/geom/Geometry~Geometry|Object.<string,*>)=)|
|
||||||
* function(ol.geom.GeometryType,Array.<number>,
|
* function(module:ol/geom/GeometryType~GeometryType,Array.<number>,
|
||||||
* (Array.<number>|Array.<Array.<number>>),Object.<string,*>,number)}
|
* (Array.<number>|Array.<Array.<number>>),Object.<string,*>,number)}
|
||||||
*/
|
*/
|
||||||
this.featureClass_ = options.featureClass ?
|
this.featureClass_ = options.featureClass ?
|
||||||
@@ -272,10 +272,10 @@ MVT.prototype.readRawGeometry_ = function(pbf, feature, flatCoordinates, ends) {
|
|||||||
* @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 {ol.geom.GeometryType} The geometry type.
|
* @return {module:ol/geom/GeometryType~GeometryType} The geometry type.
|
||||||
*/
|
*/
|
||||||
function getGeometryType(type, numEnds) {
|
function getGeometryType(type, numEnds) {
|
||||||
/** @type {ol.geom.GeometryType} */
|
/** @type {module:ol/geom/GeometryType~GeometryType} */
|
||||||
let geometryType;
|
let geometryType;
|
||||||
if (type === 1) {
|
if (type === 1) {
|
||||||
geometryType = numEnds === 1 ?
|
geometryType = numEnds === 1 ?
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ import {get as getProjection} from '../proj.js';
|
|||||||
* @typedef {Object} Options
|
* @typedef {Object} Options
|
||||||
* @property {number|undefined} factor The factor by which the coordinates
|
* @property {number|undefined} factor The factor by which the coordinates
|
||||||
* values will be scaled. Default is `1e5`.
|
* values will be scaled. Default is `1e5`.
|
||||||
* @property {ol.geom.GeometryLayout|undefined} geometryLayout Layout of the
|
* @property {module:ol/geom/GeometryLayout~GeometryLayout|undefined} geometryLayout Layout of the
|
||||||
* feature geometries created by the format reader. Default is `ol.geom.GeometryLayout.XY`.
|
* feature geometries created by the format reader. Default is `module:ol/geom/GeometryLayout~GeometryLayout.XY`.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ const Polyline = function(opt_options) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {ol.geom.GeometryLayout}
|
* @type {module:ol/geom/GeometryLayout~GeometryLayout}
|
||||||
*/
|
*/
|
||||||
this.geometryLayout_ = options.geometryLayout ?
|
this.geometryLayout_ = options.geometryLayout ?
|
||||||
options.geometryLayout : GeometryLayout.XY;
|
options.geometryLayout : GeometryLayout.XY;
|
||||||
@@ -315,7 +315,7 @@ Polyline.prototype.readFeaturesFromText = function(text, opt_options) {
|
|||||||
* @function
|
* @function
|
||||||
* @param {Document|Node|Object|string} source Source.
|
* @param {Document|Node|Object|string} source Source.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||||
* @return {ol.geom.Geometry} Geometry.
|
* @return {module:ol/geom/Geometry~Geometry} Geometry.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
Polyline.prototype.readGeometry;
|
Polyline.prototype.readGeometry;
|
||||||
@@ -330,7 +330,7 @@ Polyline.prototype.readGeometryFromText = function(text, opt_options) {
|
|||||||
flipXY(flatCoordinates, 0, flatCoordinates.length, stride, flatCoordinates);
|
flipXY(flatCoordinates, 0, flatCoordinates.length, stride, flatCoordinates);
|
||||||
const coordinates = inflateCoordinates(flatCoordinates, 0, flatCoordinates.length, stride);
|
const coordinates = inflateCoordinates(flatCoordinates, 0, flatCoordinates.length, stride);
|
||||||
|
|
||||||
return /** @type {ol.geom.Geometry} */ (transformWithOptions(
|
return /** @type {module:ol/geom/Geometry~Geometry} */ (transformWithOptions(
|
||||||
new LineString(coordinates, this.geometryLayout_), false,
|
new LineString(coordinates, this.geometryLayout_), false,
|
||||||
this.adaptOptions(opt_options))
|
this.adaptOptions(opt_options))
|
||||||
);
|
);
|
||||||
@@ -374,7 +374,7 @@ Polyline.prototype.writeFeaturesText = function(features, opt_options) {
|
|||||||
* Write a single geometry in Polyline format.
|
* Write a single geometry in Polyline format.
|
||||||
*
|
*
|
||||||
* @function
|
* @function
|
||||||
* @param {ol.geom.Geometry} geometry Geometry.
|
* @param {module:ol/geom/Geometry~Geometry} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||||
* @return {string} Geometry.
|
* @return {string} Geometry.
|
||||||
* @api
|
* @api
|
||||||
@@ -386,7 +386,7 @@ Polyline.prototype.writeGeometry;
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
Polyline.prototype.writeGeometryText = function(geometry, opt_options) {
|
Polyline.prototype.writeGeometryText = function(geometry, opt_options) {
|
||||||
geometry = /** @type {ol.geom.LineString} */
|
geometry = /** @type {module:ol/geom/LineString~LineString} */
|
||||||
(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();
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ TextFeature.prototype.readGeometry = function(source, opt_options) {
|
|||||||
* @param {string} text Text.
|
* @param {string} text Text.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||||
* @protected
|
* @protected
|
||||||
* @return {ol.geom.Geometry} Geometry.
|
* @return {module:ol/geom/Geometry~Geometry} Geometry.
|
||||||
*/
|
*/
|
||||||
TextFeature.prototype.readGeometryFromText = function(text, opt_options) {};
|
TextFeature.prototype.readGeometryFromText = function(text, opt_options) {};
|
||||||
|
|
||||||
@@ -161,7 +161,7 @@ TextFeature.prototype.writeGeometry = function(geometry, opt_options) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @abstract
|
* @abstract
|
||||||
* @param {ol.geom.Geometry} geometry Geometry.
|
* @param {module:ol/geom/Geometry~Geometry} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||||
* @protected
|
* @protected
|
||||||
* @return {string} Text.
|
* @return {string} Text.
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ inherits(TopoJSON, JSONFeature);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, function(TopoJSONGeometry, Array, ...Array): ol.geom.Geometry>}
|
* @type {Object.<string, function(TopoJSONGeometry, Array, ...Array): module:ol/geom/Geometry~Geometry>}
|
||||||
*/
|
*/
|
||||||
const GEOMETRY_READERS = {
|
const GEOMETRY_READERS = {
|
||||||
'Point': readPointGeometry,
|
'Point': readPointGeometry,
|
||||||
@@ -134,7 +134,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 {ol.geom.Point} Geometry.
|
* @return {module:ol/geom/Point~Point} Geometry.
|
||||||
*/
|
*/
|
||||||
function readPointGeometry(object, scale, translate) {
|
function readPointGeometry(object, scale, translate) {
|
||||||
const coordinates = object.coordinates;
|
const coordinates = object.coordinates;
|
||||||
@@ -151,7 +151,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 {ol.geom.MultiPoint} Geometry.
|
* @return {module:ol/geom/MultiPoint~MultiPoint} Geometry.
|
||||||
*/
|
*/
|
||||||
function readMultiPointGeometry(object, scale, translate) {
|
function readMultiPointGeometry(object, scale, translate) {
|
||||||
const coordinates = object.coordinates;
|
const coordinates = object.coordinates;
|
||||||
@@ -169,7 +169,7 @@ function readMultiPointGeometry(object, scale, translate) {
|
|||||||
*
|
*
|
||||||
* @param {TopoJSONGeometry} object TopoJSON object.
|
* @param {TopoJSONGeometry} object TopoJSON object.
|
||||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||||
* @return {ol.geom.LineString} Geometry.
|
* @return {module:ol/geom/LineString~LineString} Geometry.
|
||||||
*/
|
*/
|
||||||
function readLineStringGeometry(object, arcs) {
|
function readLineStringGeometry(object, arcs) {
|
||||||
const coordinates = concatenateArcs(object.arcs, arcs);
|
const coordinates = concatenateArcs(object.arcs, arcs);
|
||||||
@@ -182,7 +182,7 @@ function readLineStringGeometry(object, arcs) {
|
|||||||
*
|
*
|
||||||
* @param {TopoJSONGeometry} object TopoJSON object.
|
* @param {TopoJSONGeometry} object TopoJSON object.
|
||||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||||
* @return {ol.geom.MultiLineString} Geometry.
|
* @return {module:ol/geom/MultiLineString~MultiLineString} Geometry.
|
||||||
*/
|
*/
|
||||||
function readMultiLineStringGeometry(object, arcs) {
|
function readMultiLineStringGeometry(object, arcs) {
|
||||||
const coordinates = [];
|
const coordinates = [];
|
||||||
@@ -198,7 +198,7 @@ function readMultiLineStringGeometry(object, arcs) {
|
|||||||
*
|
*
|
||||||
* @param {TopoJSONGeometry} object TopoJSON object.
|
* @param {TopoJSONGeometry} object TopoJSON object.
|
||||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||||
* @return {ol.geom.Polygon} Geometry.
|
* @return {module:ol/geom/Polygon~Polygon} Geometry.
|
||||||
*/
|
*/
|
||||||
function readPolygonGeometry(object, arcs) {
|
function readPolygonGeometry(object, arcs) {
|
||||||
const coordinates = [];
|
const coordinates = [];
|
||||||
@@ -214,7 +214,7 @@ function readPolygonGeometry(object, arcs) {
|
|||||||
*
|
*
|
||||||
* @param {TopoJSONGeometry} object TopoJSON object.
|
* @param {TopoJSONGeometry} object TopoJSON object.
|
||||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||||
* @return {ol.geom.MultiPolygon} Geometry.
|
* @return {module:ol/geom/MultiPolygon~MultiPolygon} Geometry.
|
||||||
*/
|
*/
|
||||||
function readMultiPolygonGeometry(object, arcs) {
|
function readMultiPolygonGeometry(object, arcs) {
|
||||||
const coordinates = [];
|
const coordinates = [];
|
||||||
@@ -280,7 +280,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 {ol.geom.Geometry} */ (
|
feature.setGeometry(/** @type {module:ol/geom/Geometry~Geometry} */ (
|
||||||
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);
|
||||||
|
|||||||
@@ -223,7 +223,7 @@ const Parser = function(lexer) {
|
|||||||
this.token_;
|
this.token_;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {ol.geom.GeometryLayout}
|
* @type {module:ol/geom/GeometryLayout~GeometryLayout}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.layout_ = GeometryLayout.XY;
|
this.layout_ = GeometryLayout.XY;
|
||||||
@@ -265,7 +265,7 @@ Parser.prototype.match = function(type) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Try to parse the tokens provided by the lexer.
|
* Try to parse the tokens provided by the lexer.
|
||||||
* @return {ol.geom.Geometry} The geometry.
|
* @return {module:ol/geom/Geometry~Geometry} The geometry.
|
||||||
*/
|
*/
|
||||||
Parser.prototype.parse = function() {
|
Parser.prototype.parse = function() {
|
||||||
this.consume_();
|
this.consume_();
|
||||||
@@ -276,7 +276,7 @@ Parser.prototype.parse = function() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Try to parse the dimensional info.
|
* Try to parse the dimensional info.
|
||||||
* @return {ol.geom.GeometryLayout} The layout.
|
* @return {module:ol/geom/GeometryLayout~GeometryLayout} The layout.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
Parser.prototype.parseGeometryLayout_ = function() {
|
Parser.prototype.parseGeometryLayout_ = function() {
|
||||||
@@ -300,7 +300,7 @@ Parser.prototype.parseGeometryLayout_ = function() {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {!Array.<ol.geom.Geometry>} A collection of geometries.
|
* @return {!Array.<module:ol/geom/Geometry~Geometry>} A collection of geometries.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
Parser.prototype.parseGeometryCollectionText_ = function() {
|
Parser.prototype.parseGeometryCollectionText_ = function() {
|
||||||
@@ -556,7 +556,7 @@ inherits(WKT, TextFeature);
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.Point} geom Point geometry.
|
* @param {module:ol/geom/Point~Point} 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) {
|
||||||
@@ -569,7 +569,7 @@ function encodePointGeometry(geom) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.MultiPoint} geom MultiPoint geometry.
|
* @param {module:ol/geom/MultiPoint~MultiPoint} 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) {
|
||||||
@@ -583,7 +583,7 @@ function encodeMultiPointGeometry(geom) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.GeometryCollection} geom GeometryCollection geometry.
|
* @param {module:ol/geom/GeometryCollection~GeometryCollection} 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) {
|
||||||
@@ -597,7 +597,7 @@ function encodeGeometryCollectionGeometry(geom) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.LineString|ol.geom.LinearRing} geom LineString geometry.
|
* @param {module:ol/geom/LineString~LineString|module:ol/geom/LinearRing~LinearRing} 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) {
|
||||||
@@ -611,7 +611,7 @@ function encodeLineStringGeometry(geom) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.MultiLineString} geom MultiLineString geometry.
|
* @param {module:ol/geom/MultiLineString~MultiLineString} 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) {
|
||||||
@@ -625,7 +625,7 @@ function encodeMultiLineStringGeometry(geom) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.Polygon} geom Polygon geometry.
|
* @param {module:ol/geom/Polygon~Polygon} 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) {
|
||||||
@@ -639,7 +639,7 @@ function encodePolygonGeometry(geom) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.MultiPolygon} geom MultiPolygon geometry.
|
* @param {module:ol/geom/MultiPolygon~MultiPolygon} 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) {
|
||||||
@@ -652,7 +652,7 @@ function encodeMultiPolygonGeometry(geom) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.SimpleGeometry} geom SimpleGeometry geometry.
|
* @param {module:ol/geom/SimpleGeometry~SimpleGeometry} 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) {
|
||||||
@@ -670,7 +670,7 @@ function encodeGeometryLayout(geom) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, function(ol.geom.Geometry): string>}
|
* @type {Object.<string, function(module:ol/geom/Geometry~Geometry): string>}
|
||||||
*/
|
*/
|
||||||
const GeometryEncoder = {
|
const GeometryEncoder = {
|
||||||
'Point': encodePointGeometry,
|
'Point': encodePointGeometry,
|
||||||
@@ -685,7 +685,7 @@ const GeometryEncoder = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Encode a geometry as WKT.
|
* Encode a geometry as WKT.
|
||||||
* @param {ol.geom.Geometry} geom The geometry to encode.
|
* @param {module:ol/geom/Geometry~Geometry} 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) {
|
||||||
@@ -709,7 +709,7 @@ function encode(geom) {
|
|||||||
/**
|
/**
|
||||||
* Parse a WKT string.
|
* Parse a WKT string.
|
||||||
* @param {string} wkt WKT string.
|
* @param {string} wkt WKT string.
|
||||||
* @return {ol.geom.Geometry|undefined}
|
* @return {module:ol/geom/Geometry~Geometry|undefined}
|
||||||
* The geometry created.
|
* The geometry created.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -766,7 +766,7 @@ WKT.prototype.readFeaturesFromText = function(text, opt_options) {
|
|||||||
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 {ol.geom.GeometryCollection} */ (geometry))
|
geometries = (/** @type {module:ol/geom/GeometryCollection~GeometryCollection} */ (geometry))
|
||||||
.getGeometriesArray();
|
.getGeometriesArray();
|
||||||
} else {
|
} else {
|
||||||
geometries = [geometry];
|
geometries = [geometry];
|
||||||
@@ -787,7 +787,7 @@ WKT.prototype.readFeaturesFromText = function(text, opt_options) {
|
|||||||
* @function
|
* @function
|
||||||
* @param {Document|Node|Object|string} source Source.
|
* @param {Document|Node|Object|string} source Source.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||||
* @return {ol.geom.Geometry} Geometry.
|
* @return {module:ol/geom/Geometry~Geometry} Geometry.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
WKT.prototype.readGeometry;
|
WKT.prototype.readGeometry;
|
||||||
@@ -799,7 +799,7 @@ WKT.prototype.readGeometry;
|
|||||||
WKT.prototype.readGeometryFromText = function(text, opt_options) {
|
WKT.prototype.readGeometryFromText = function(text, opt_options) {
|
||||||
const geometry = this.parse_(text);
|
const geometry = this.parse_(text);
|
||||||
if (geometry) {
|
if (geometry) {
|
||||||
return /** @type {ol.geom.Geometry} */ (transformWithOptions(geometry, false, opt_options));
|
return /** @type {module:ol/geom/Geometry~Geometry} */ (transformWithOptions(geometry, false, opt_options));
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -807,7 +807,7 @@ WKT.prototype.readGeometryFromText = function(text, opt_options) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @enum {function (new:ol.geom.Geometry, Array, ol.geom.GeometryLayout)}
|
* @enum {function (new:module:ol/geom/Geometry~Geometry, Array, module:ol/geom/GeometryLayout~GeometryLayout)}
|
||||||
*/
|
*/
|
||||||
const GeometryConstructor = {
|
const GeometryConstructor = {
|
||||||
'POINT': Point,
|
'POINT': Point,
|
||||||
@@ -833,7 +833,7 @@ const GeometryParser = {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {!ol.geom.Geometry} The geometry.
|
* @return {!module:ol/geom/Geometry~Geometry} The geometry.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
Parser.prototype.parseGeometry_ = function() {
|
Parser.prototype.parseGeometry_ = function() {
|
||||||
@@ -914,7 +914,7 @@ WKT.prototype.writeFeaturesText = function(features, opt_options) {
|
|||||||
* Write a single geometry as a WKT string.
|
* Write a single geometry as a WKT string.
|
||||||
*
|
*
|
||||||
* @function
|
* @function
|
||||||
* @param {ol.geom.Geometry} geometry Geometry.
|
* @param {module:ol/geom/Geometry~Geometry} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||||
* @return {string} WKT string.
|
* @return {string} WKT string.
|
||||||
* @api
|
* @api
|
||||||
@@ -926,7 +926,7 @@ WKT.prototype.writeGeometry;
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
WKT.prototype.writeGeometryText = function(geometry, opt_options) {
|
WKT.prototype.writeGeometryText = function(geometry, opt_options) {
|
||||||
return encode(/** @type {ol.geom.Geometry} */ (
|
return encode(/** @type {module:ol/geom/Geometry~Geometry} */ (
|
||||||
transformWithOptions(geometry, true, opt_options)));
|
transformWithOptions(geometry, true, opt_options)));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ XMLFeature.prototype.readGeometry = function(source, opt_options) {
|
|||||||
* @param {Document} doc Document.
|
* @param {Document} doc Document.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Options.
|
* @param {module:ol/format/Feature~ReadOptions=} opt_options Options.
|
||||||
* @protected
|
* @protected
|
||||||
* @return {ol.geom.Geometry} Geometry.
|
* @return {module:ol/geom/Geometry~Geometry} Geometry.
|
||||||
*/
|
*/
|
||||||
XMLFeature.prototype.readGeometryFromDocument = function(doc, opt_options) {
|
XMLFeature.prototype.readGeometryFromDocument = function(doc, opt_options) {
|
||||||
return null; // not implemented
|
return null; // not implemented
|
||||||
@@ -160,7 +160,7 @@ XMLFeature.prototype.readGeometryFromDocument = function(doc, opt_options) {
|
|||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Options.
|
* @param {module:ol/format/Feature~ReadOptions=} opt_options Options.
|
||||||
* @protected
|
* @protected
|
||||||
* @return {ol.geom.Geometry} Geometry.
|
* @return {module:ol/geom/Geometry~Geometry} Geometry.
|
||||||
*/
|
*/
|
||||||
XMLFeature.prototype.readGeometryFromNode = function(node, opt_options) {
|
XMLFeature.prototype.readGeometryFromNode = function(node, opt_options) {
|
||||||
return null; // not implemented
|
return null; // not implemented
|
||||||
@@ -253,7 +253,7 @@ XMLFeature.prototype.writeGeometry = function(geometry, opt_options) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.Geometry} geometry Geometry.
|
* @param {module:ol/geom/Geometry~Geometry} geometry Geometry.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
||||||
* @return {Node} Node.
|
* @return {Node} Node.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ 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 {!ol.geom.Geometry} geometry Geometry.
|
* @param {!module:ol/geom/Geometry~Geometry} 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 {!ol.format.filter.Contains} `<Contains>` operator.
|
* @returns {!ol.format.filter.Contains} `<Contains>` operator.
|
||||||
@@ -93,7 +93,7 @@ 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 {!ol.geom.Geometry} geometry Geometry.
|
* @param {!module:ol/geom/Geometry~Geometry} 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 {!ol.format.filter.Intersects} `<Intersects>` operator.
|
* @returns {!ol.format.filter.Intersects} `<Intersects>` operator.
|
||||||
@@ -108,7 +108,7 @@ 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 {!ol.geom.Geometry} geometry Geometry.
|
* @param {!module:ol/geom/Geometry~Geometry} 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 {!ol.format.filter.Within} `<Within>` operator.
|
* @returns {!ol.format.filter.Within} `<Within>` operator.
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import Spatial from '../filter/Spatial.js';
|
|||||||
*
|
*
|
||||||
* @constructor
|
* @constructor
|
||||||
* @param {!string} geometryName Geometry name to use.
|
* @param {!string} geometryName Geometry name to use.
|
||||||
* @param {!ol.geom.Geometry} geometry Geometry.
|
* @param {!module:ol/geom/Geometry~Geometry} 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.
|
||||||
* @extends {ol.format.filter.Spatial}
|
* @extends {ol.format.filter.Spatial}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import Spatial from '../filter/Spatial.js';
|
|||||||
*
|
*
|
||||||
* @constructor
|
* @constructor
|
||||||
* @param {!string} geometryName Geometry name to use.
|
* @param {!string} geometryName Geometry name to use.
|
||||||
* @param {!ol.geom.Geometry} geometry Geometry.
|
* @param {!module:ol/geom/Geometry~Geometry} 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.
|
||||||
* @extends {ol.format.filter.Spatial}
|
* @extends {ol.format.filter.Spatial}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import Filter from '../filter/Filter.js';
|
|||||||
* @abstract
|
* @abstract
|
||||||
* @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 {!ol.geom.Geometry} geometry Geometry.
|
* @param {!module:ol/geom/Geometry~Geometry} 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.
|
||||||
* @extends {ol.format.filter.Filter}
|
* @extends {ol.format.filter.Filter}
|
||||||
@@ -31,7 +31,7 @@ const Spatial = function(tagName, geometryName, geometry, opt_srsName) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @public
|
* @public
|
||||||
* @type {ol.geom.Geometry}
|
* @type {module:ol/geom/Geometry~Geometry}
|
||||||
*/
|
*/
|
||||||
this.geometry = geometry;
|
this.geometry = geometry;
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import Spatial from '../filter/Spatial.js';
|
|||||||
*
|
*
|
||||||
* @constructor
|
* @constructor
|
||||||
* @param {!string} geometryName Geometry name to use.
|
* @param {!string} geometryName Geometry name to use.
|
||||||
* @param {!ol.geom.Geometry} geometry Geometry.
|
* @param {!module:ol/geom/Geometry~Geometry} 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.
|
||||||
* @extends {ol.format.filter.Spatial}
|
* @extends {ol.format.filter.Spatial}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
* `readFeatures` returning an `Array.<ol.Feature>`
|
* `readFeatures` returning an `Array.<ol.Feature>`
|
||||||
* `readFeature` returning an `ol.Feature`
|
* `readFeature` returning an `ol.Feature`
|
||||||
* `readGeometry` returning an `ol.geom.Geometry`
|
* `readGeometry` returning an `module:ol/geom/Geometry~Geometry`
|
||||||
|
|
||||||
Having different functions for multiple return types allows both the user to specify what type of data they want and for the compiler to properly type check the code. Depending on the format, it is entirely reasonable to leave one or more of these methods unimplemented, or provide sensible default implementations.
|
Having different functions for multiple return types allows both the user to specify what type of data they want and for the compiler to properly type check the code. Depending on the format, it is entirely reasonable to leave one or more of these methods unimplemented, or provide sensible default implementations.
|
||||||
|
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ import {deflateCoordinate} from '../geom/flat/deflate.js';
|
|||||||
* Circle geometry.
|
* Circle geometry.
|
||||||
*
|
*
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.geom.SimpleGeometry}
|
* @extends {module:ol/geom/SimpleGeometry~SimpleGeometry}
|
||||||
* @param {module:ol/coordinate~Coordinate} center Center.
|
* @param {module:ol/coordinate~Coordinate} center Center.
|
||||||
* @param {number=} opt_radius Radius.
|
* @param {number=} opt_radius Radius.
|
||||||
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
* @param {module:ol/geom/GeometryLayout~GeometryLayout=} opt_layout Layout.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
const Circle = function(center, opt_radius, opt_layout) {
|
const Circle = function(center, opt_radius, opt_layout) {
|
||||||
@@ -30,7 +30,7 @@ inherits(Circle, SimpleGeometry);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Make a complete copy of the geometry.
|
* Make a complete copy of the geometry.
|
||||||
* @return {!ol.geom.Circle} Clone.
|
* @return {!module:ol/geom/Circle~Circle} Clone.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -179,7 +179,7 @@ Circle.prototype.setCenter = function(center) {
|
|||||||
* number) of the circle.
|
* number) of the circle.
|
||||||
* @param {module:ol/coordinate~Coordinate} center Center.
|
* @param {module:ol/coordinate~Coordinate} center Center.
|
||||||
* @param {number} radius Radius.
|
* @param {number} radius Radius.
|
||||||
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
* @param {module:ol/geom/GeometryLayout~GeometryLayout=} opt_layout Layout.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
Circle.prototype.setCenterAndRadius = function(center, radius, opt_layout) {
|
Circle.prototype.setCenterAndRadius = function(center, radius, opt_layout) {
|
||||||
@@ -217,7 +217,7 @@ Circle.prototype.setCoordinates = function(coordinates, opt_layout) {};
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.GeometryLayout} layout Layout.
|
* @param {module:ol/geom/GeometryLayout~GeometryLayout} layout Layout.
|
||||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||||
*/
|
*/
|
||||||
Circle.prototype.setFlatCoordinates = function(layout, flatCoordinates) {
|
Circle.prototype.setFlatCoordinates = function(layout, flatCoordinates) {
|
||||||
@@ -254,7 +254,7 @@ Circle.prototype.setRadius = function(radius) {
|
|||||||
* string identifier or a {@link ol.proj.Projection} object.
|
* string identifier or a {@link ol.proj.Projection} object.
|
||||||
* @param {module:ol/proj~ProjectionLike} destination The desired projection. Can be a
|
* @param {module:ol/proj~ProjectionLike} destination The desired projection. Can be a
|
||||||
* string identifier or a {@link ol.proj.Projection} object.
|
* string identifier or a {@link ol.proj.Projection} object.
|
||||||
* @return {ol.geom.Circle} This geometry. Note that original geometry is
|
* @return {module:ol/geom/Circle~Circle} This geometry. Note that original geometry is
|
||||||
* modified in place.
|
* modified in place.
|
||||||
* @function
|
* @function
|
||||||
* @api
|
* @api
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ const Geometry = function() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @protected
|
* @protected
|
||||||
* @type {Object.<string, ol.geom.Geometry>}
|
* @type {Object.<string, module:ol/geom/Geometry~Geometry>}
|
||||||
*/
|
*/
|
||||||
this.simplifiedGeometryCache = {};
|
this.simplifiedGeometryCache = {};
|
||||||
|
|
||||||
@@ -72,7 +72,7 @@ inherits(Geometry, BaseObject);
|
|||||||
/**
|
/**
|
||||||
* Make a complete copy of the geometry.
|
* Make a complete copy of the geometry.
|
||||||
* @abstract
|
* @abstract
|
||||||
* @return {!ol.geom.Geometry} Clone.
|
* @return {!module:ol/geom/Geometry~Geometry} Clone.
|
||||||
*/
|
*/
|
||||||
Geometry.prototype.clone = function() {};
|
Geometry.prototype.clone = function() {};
|
||||||
|
|
||||||
@@ -180,7 +180,7 @@ Geometry.prototype.scale = function(sx, opt_sy, opt_anchor) {};
|
|||||||
* 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 {ol.geom.Geometry} A new, simplified version of the original
|
* @return {module:ol/geom/Geometry~Geometry} A new, simplified version of the original
|
||||||
* geometry.
|
* geometry.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -195,7 +195,7 @@ Geometry.prototype.simplify = function(tolerance) {
|
|||||||
* @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 {ol.geom.Geometry} Simplified geometry.
|
* @return {module:ol/geom/Geometry~Geometry} Simplified geometry.
|
||||||
*/
|
*/
|
||||||
Geometry.prototype.getSimplifiedGeometry = function(squaredTolerance) {};
|
Geometry.prototype.getSimplifiedGeometry = function(squaredTolerance) {};
|
||||||
|
|
||||||
@@ -203,7 +203,7 @@ Geometry.prototype.getSimplifiedGeometry = function(squaredTolerance) {};
|
|||||||
/**
|
/**
|
||||||
* Get the type of this geometry.
|
* Get the type of this geometry.
|
||||||
* @abstract
|
* @abstract
|
||||||
* @return {ol.geom.GeometryType} Geometry type.
|
* @return {module:ol/geom/GeometryType~GeometryType} Geometry type.
|
||||||
*/
|
*/
|
||||||
Geometry.prototype.getType = function() {};
|
Geometry.prototype.getType = function() {};
|
||||||
|
|
||||||
@@ -249,7 +249,7 @@ Geometry.prototype.translate = function(deltaX, deltaY) {};
|
|||||||
* string identifier or a {@link ol.proj.Projection} object.
|
* string identifier or a {@link ol.proj.Projection} object.
|
||||||
* @param {module:ol/proj~ProjectionLike} destination The desired projection. Can be a
|
* @param {module:ol/proj~ProjectionLike} destination The desired projection. Can be a
|
||||||
* string identifier or a {@link ol.proj.Projection} object.
|
* string identifier or a {@link ol.proj.Projection} object.
|
||||||
* @return {ol.geom.Geometry} This geometry. Note that original geometry is
|
* @return {module:ol/geom/Geometry~Geometry} This geometry. Note that original geometry is
|
||||||
* modified in place.
|
* modified in place.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ import {clear} from '../obj.js';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @classdesc
|
* @classdesc
|
||||||
* An array of {@link ol.geom.Geometry} objects.
|
* An array of {@link module:ol/geom/Geometry~Geometry} objects.
|
||||||
*
|
*
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.geom.Geometry}
|
* @extends {module:ol/geom/Geometry~Geometry}
|
||||||
* @param {Array.<ol.geom.Geometry>=} opt_geometries Geometries.
|
* @param {Array.<module:ol/geom/Geometry~Geometry>=} opt_geometries Geometries.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
const GeometryCollection = function(opt_geometries) {
|
const GeometryCollection = function(opt_geometries) {
|
||||||
@@ -24,7 +24,7 @@ const GeometryCollection = function(opt_geometries) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array.<ol.geom.Geometry>}
|
* @type {Array.<module:ol/geom/Geometry~Geometry>}
|
||||||
*/
|
*/
|
||||||
this.geometries_ = opt_geometries ? opt_geometries : null;
|
this.geometries_ = opt_geometries ? opt_geometries : null;
|
||||||
|
|
||||||
@@ -35,8 +35,8 @@ inherits(GeometryCollection, Geometry);
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array.<ol.geom.Geometry>} geometries Geometries.
|
* @param {Array.<module:ol/geom/Geometry~Geometry>} geometries Geometries.
|
||||||
* @return {Array.<ol.geom.Geometry>} Cloned geometries.
|
* @return {Array.<module:ol/geom/Geometry~Geometry>} Cloned geometries.
|
||||||
*/
|
*/
|
||||||
function cloneGeometries(geometries) {
|
function cloneGeometries(geometries) {
|
||||||
const clonedGeometries = [];
|
const clonedGeometries = [];
|
||||||
@@ -79,7 +79,7 @@ GeometryCollection.prototype.listenGeometriesChange_ = function() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Make a complete copy of the geometry.
|
* Make a complete copy of the geometry.
|
||||||
* @return {!ol.geom.GeometryCollection} Clone.
|
* @return {!module:ol/geom/GeometryCollection~GeometryCollection} Clone.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -135,7 +135,7 @@ GeometryCollection.prototype.computeExtent = function(extent) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the geometries that make up this geometry collection.
|
* Return the geometries that make up this geometry collection.
|
||||||
* @return {Array.<ol.geom.Geometry>} Geometries.
|
* @return {Array.<module:ol/geom/Geometry~Geometry>} Geometries.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
GeometryCollection.prototype.getGeometries = function() {
|
GeometryCollection.prototype.getGeometries = function() {
|
||||||
@@ -144,7 +144,7 @@ GeometryCollection.prototype.getGeometries = function() {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {Array.<ol.geom.Geometry>} Geometries.
|
* @return {Array.<module:ol/geom/Geometry~Geometry>} Geometries.
|
||||||
*/
|
*/
|
||||||
GeometryCollection.prototype.getGeometriesArray = function() {
|
GeometryCollection.prototype.getGeometriesArray = function() {
|
||||||
return this.geometries_;
|
return this.geometries_;
|
||||||
@@ -257,7 +257,7 @@ GeometryCollection.prototype.scale = function(sx, opt_sy, opt_anchor) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the geometries that make up this geometry collection.
|
* Set the geometries that make up this geometry collection.
|
||||||
* @param {Array.<ol.geom.Geometry>} geometries Geometries.
|
* @param {Array.<module:ol/geom/Geometry~Geometry>} geometries Geometries.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
GeometryCollection.prototype.setGeometries = function(geometries) {
|
GeometryCollection.prototype.setGeometries = function(geometries) {
|
||||||
@@ -266,7 +266,7 @@ GeometryCollection.prototype.setGeometries = function(geometries) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array.<ol.geom.Geometry>} geometries Geometries.
|
* @param {Array.<module:ol/geom/Geometry~Geometry>} geometries Geometries.
|
||||||
*/
|
*/
|
||||||
GeometryCollection.prototype.setGeometriesArray = function(geometries) {
|
GeometryCollection.prototype.setGeometriesArray = function(geometries) {
|
||||||
this.unlistenGeometriesChange_();
|
this.unlistenGeometriesChange_();
|
||||||
|
|||||||
@@ -21,9 +21,9 @@ import {douglasPeucker} from '../geom/flat/simplify.js';
|
|||||||
* Linestring geometry.
|
* Linestring geometry.
|
||||||
*
|
*
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.geom.SimpleGeometry}
|
* @extends {module:ol/geom/SimpleGeometry~SimpleGeometry}
|
||||||
* @param {Array.<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
* @param {Array.<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
||||||
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
* @param {module:ol/geom/GeometryLayout~GeometryLayout=} opt_layout Layout.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
const LineString = function(coordinates, opt_layout) {
|
const LineString = function(coordinates, opt_layout) {
|
||||||
@@ -78,7 +78,7 @@ LineString.prototype.appendCoordinate = function(coordinate) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Make a complete copy of the geometry.
|
* Make a complete copy of the geometry.
|
||||||
* @return {!ol.geom.LineString} Clone.
|
* @return {!module:ol/geom/LineString~LineString} Clone.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -238,7 +238,7 @@ LineString.prototype.intersectsExtent = function(extent) {
|
|||||||
/**
|
/**
|
||||||
* Set the coordinates of the linestring.
|
* Set the coordinates of the linestring.
|
||||||
* @param {Array.<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
* @param {Array.<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
||||||
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
* @param {module:ol/geom/GeometryLayout~GeometryLayout=} opt_layout Layout.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -258,7 +258,7 @@ LineString.prototype.setCoordinates = function(coordinates, opt_layout) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.GeometryLayout} layout Layout.
|
* @param {module:ol/geom/GeometryLayout~GeometryLayout} layout Layout.
|
||||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||||
*/
|
*/
|
||||||
LineString.prototype.setFlatCoordinates = function(layout, flatCoordinates) {
|
LineString.prototype.setFlatCoordinates = function(layout, flatCoordinates) {
|
||||||
|
|||||||
@@ -18,9 +18,9 @@ import {douglasPeucker} from '../geom/flat/simplify.js';
|
|||||||
* on its own.
|
* on its own.
|
||||||
*
|
*
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.geom.SimpleGeometry}
|
* @extends {module:ol/geom/SimpleGeometry~SimpleGeometry}
|
||||||
* @param {Array.<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
* @param {Array.<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
||||||
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
* @param {module:ol/geom/GeometryLayout~GeometryLayout=} opt_layout Layout.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
const LinearRing = function(coordinates, opt_layout) {
|
const LinearRing = function(coordinates, opt_layout) {
|
||||||
@@ -48,7 +48,7 @@ inherits(LinearRing, SimpleGeometry);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Make a complete copy of the geometry.
|
* Make a complete copy of the geometry.
|
||||||
* @return {!ol.geom.LinearRing} Clone.
|
* @return {!module:ol/geom/LinearRing~LinearRing} Clone.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -132,7 +132,7 @@ LinearRing.prototype.intersectsExtent = function(extent) {};
|
|||||||
/**
|
/**
|
||||||
* Set the coordinates of the linear ring.
|
* Set the coordinates of the linear ring.
|
||||||
* @param {Array.<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
* @param {Array.<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
||||||
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
* @param {module:ol/geom/GeometryLayout~GeometryLayout=} opt_layout Layout.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -152,7 +152,7 @@ LinearRing.prototype.setCoordinates = function(coordinates, opt_layout) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.GeometryLayout} layout Layout.
|
* @param {module:ol/geom/GeometryLayout~GeometryLayout} layout Layout.
|
||||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||||
*/
|
*/
|
||||||
LinearRing.prototype.setFlatCoordinates = function(layout, flatCoordinates) {
|
LinearRing.prototype.setFlatCoordinates = function(layout, flatCoordinates) {
|
||||||
|
|||||||
@@ -20,9 +20,9 @@ import {douglasPeuckerArray} from '../geom/flat/simplify.js';
|
|||||||
* Multi-linestring geometry.
|
* Multi-linestring geometry.
|
||||||
*
|
*
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.geom.SimpleGeometry}
|
* @extends {module:ol/geom/SimpleGeometry~SimpleGeometry}
|
||||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} coordinates Coordinates.
|
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} coordinates Coordinates.
|
||||||
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
* @param {module:ol/geom/GeometryLayout~GeometryLayout=} opt_layout Layout.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
const MultiLineString = function(coordinates, opt_layout) {
|
const MultiLineString = function(coordinates, opt_layout) {
|
||||||
@@ -56,7 +56,7 @@ inherits(MultiLineString, SimpleGeometry);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Append the passed linestring to the multilinestring.
|
* Append the passed linestring to the multilinestring.
|
||||||
* @param {ol.geom.LineString} lineString LineString.
|
* @param {module:ol/geom/LineString~LineString} lineString LineString.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
MultiLineString.prototype.appendLineString = function(lineString) {
|
MultiLineString.prototype.appendLineString = function(lineString) {
|
||||||
@@ -72,7 +72,7 @@ MultiLineString.prototype.appendLineString = function(lineString) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Make a complete copy of the geometry.
|
* Make a complete copy of the geometry.
|
||||||
* @return {!ol.geom.MultiLineString} Clone.
|
* @return {!module:ol/geom/MultiLineString~MultiLineString} Clone.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -160,7 +160,7 @@ MultiLineString.prototype.getEnds = function() {
|
|||||||
/**
|
/**
|
||||||
* Return the linestring at the specified index.
|
* Return the linestring at the specified index.
|
||||||
* @param {number} index Index.
|
* @param {number} index Index.
|
||||||
* @return {ol.geom.LineString} LineString.
|
* @return {module:ol/geom/LineString~LineString} LineString.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
MultiLineString.prototype.getLineString = function(index) {
|
MultiLineString.prototype.getLineString = function(index) {
|
||||||
@@ -176,14 +176,14 @@ MultiLineString.prototype.getLineString = function(index) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the linestrings of this multilinestring.
|
* Return the linestrings of this multilinestring.
|
||||||
* @return {Array.<ol.geom.LineString>} LineStrings.
|
* @return {Array.<module:ol/geom/LineString~LineString>} LineStrings.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
MultiLineString.prototype.getLineStrings = function() {
|
MultiLineString.prototype.getLineStrings = function() {
|
||||||
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.<ol.geom.LineString>} */
|
/** @type {Array.<module:ol/geom/LineString~LineString>} */
|
||||||
const lineStrings = [];
|
const lineStrings = [];
|
||||||
let offset = 0;
|
let offset = 0;
|
||||||
for (let i = 0, ii = ends.length; i < ii; ++i) {
|
for (let i = 0, ii = ends.length; i < ii; ++i) {
|
||||||
@@ -255,7 +255,7 @@ MultiLineString.prototype.intersectsExtent = function(extent) {
|
|||||||
/**
|
/**
|
||||||
* Set the coordinates of the multilinestring.
|
* Set the coordinates of the multilinestring.
|
||||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} coordinates Coordinates.
|
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} coordinates Coordinates.
|
||||||
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
* @param {module:ol/geom/GeometryLayout~GeometryLayout=} opt_layout Layout.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -276,7 +276,7 @@ MultiLineString.prototype.setCoordinates = function(coordinates, opt_layout) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.GeometryLayout} layout Layout.
|
* @param {module:ol/geom/GeometryLayout~GeometryLayout} layout Layout.
|
||||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||||
* @param {Array.<number>} ends Ends.
|
* @param {Array.<number>} ends Ends.
|
||||||
*/
|
*/
|
||||||
@@ -288,7 +288,7 @@ MultiLineString.prototype.setFlatCoordinates = function(layout, flatCoordinates,
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array.<ol.geom.LineString>} lineStrings LineStrings.
|
* @param {Array.<module:ol/geom/LineString~LineString>} lineStrings LineStrings.
|
||||||
*/
|
*/
|
||||||
MultiLineString.prototype.setLineStrings = function(lineStrings) {
|
MultiLineString.prototype.setLineStrings = function(lineStrings) {
|
||||||
let layout = this.getLayout();
|
let layout = this.getLayout();
|
||||||
|
|||||||
@@ -17,9 +17,9 @@ import {squaredDistance as squaredDx} from '../math.js';
|
|||||||
* Multi-point geometry.
|
* Multi-point geometry.
|
||||||
*
|
*
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.geom.SimpleGeometry}
|
* @extends {module:ol/geom/SimpleGeometry~SimpleGeometry}
|
||||||
* @param {Array.<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
* @param {Array.<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
||||||
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
* @param {module:ol/geom/GeometryLayout~GeometryLayout=} opt_layout Layout.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
const MultiPoint = function(coordinates, opt_layout) {
|
const MultiPoint = function(coordinates, opt_layout) {
|
||||||
@@ -32,7 +32,7 @@ inherits(MultiPoint, SimpleGeometry);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Append the passed point to this multipoint.
|
* Append the passed point to this multipoint.
|
||||||
* @param {ol.geom.Point} point Point.
|
* @param {module:ol/geom/Point~Point} point Point.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
MultiPoint.prototype.appendPoint = function(point) {
|
MultiPoint.prototype.appendPoint = function(point) {
|
||||||
@@ -47,7 +47,7 @@ MultiPoint.prototype.appendPoint = function(point) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Make a complete copy of the geometry.
|
* Make a complete copy of the geometry.
|
||||||
* @return {!ol.geom.MultiPoint} Clone.
|
* @return {!module:ol/geom/MultiPoint~MultiPoint} Clone.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -97,7 +97,7 @@ MultiPoint.prototype.getCoordinates = function() {
|
|||||||
/**
|
/**
|
||||||
* Return the point at the specified index.
|
* Return the point at the specified index.
|
||||||
* @param {number} index Index.
|
* @param {number} index Index.
|
||||||
* @return {ol.geom.Point} Point.
|
* @return {module:ol/geom/Point~Point} Point.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
MultiPoint.prototype.getPoint = function(index) {
|
MultiPoint.prototype.getPoint = function(index) {
|
||||||
@@ -114,14 +114,14 @@ MultiPoint.prototype.getPoint = function(index) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the points of this multipoint.
|
* Return the points of this multipoint.
|
||||||
* @return {Array.<ol.geom.Point>} Points.
|
* @return {Array.<module:ol/geom/Point~Point>} Points.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
MultiPoint.prototype.getPoints = function() {
|
MultiPoint.prototype.getPoints = function() {
|
||||||
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.<ol.geom.Point>} */
|
/** @type {Array.<module:ol/geom/Point~Point>} */
|
||||||
const points = [];
|
const points = [];
|
||||||
for (let i = 0, ii = flatCoordinates.length; i < ii; i += stride) {
|
for (let i = 0, ii = flatCoordinates.length; i < ii; i += stride) {
|
||||||
const point = new Point(null);
|
const point = new Point(null);
|
||||||
@@ -162,7 +162,7 @@ MultiPoint.prototype.intersectsExtent = function(extent) {
|
|||||||
/**
|
/**
|
||||||
* Set the coordinates of the multipoint.
|
* Set the coordinates of the multipoint.
|
||||||
* @param {Array.<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
* @param {Array.<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
||||||
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
* @param {module:ol/geom/GeometryLayout~GeometryLayout=} opt_layout Layout.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -182,7 +182,7 @@ MultiPoint.prototype.setCoordinates = function(coordinates, opt_layout) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.GeometryLayout} layout Layout.
|
* @param {module:ol/geom/GeometryLayout~GeometryLayout} layout Layout.
|
||||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||||
*/
|
*/
|
||||||
MultiPoint.prototype.setFlatCoordinates = function(layout, flatCoordinates) {
|
MultiPoint.prototype.setFlatCoordinates = function(layout, flatCoordinates) {
|
||||||
|
|||||||
@@ -25,9 +25,9 @@ import {quantizeMultiArray} from '../geom/flat/simplify.js';
|
|||||||
* Multi-polygon geometry.
|
* Multi-polygon geometry.
|
||||||
*
|
*
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.geom.SimpleGeometry}
|
* @extends {module:ol/geom/SimpleGeometry~SimpleGeometry}
|
||||||
* @param {Array.<Array.<Array.<module:ol/coordinate~Coordinate>>>} coordinates Coordinates.
|
* @param {Array.<Array.<Array.<module:ol/coordinate~Coordinate>>>} coordinates Coordinates.
|
||||||
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
* @param {module:ol/geom/GeometryLayout~GeometryLayout=} opt_layout Layout.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
const MultiPolygon = function(coordinates, opt_layout) {
|
const MultiPolygon = function(coordinates, opt_layout) {
|
||||||
@@ -85,7 +85,7 @@ inherits(MultiPolygon, SimpleGeometry);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Append the passed polygon to this multipolygon.
|
* Append the passed polygon to this multipolygon.
|
||||||
* @param {ol.geom.Polygon} polygon Polygon.
|
* @param {module:ol/geom/Polygon~Polygon} polygon Polygon.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
MultiPolygon.prototype.appendPolygon = function(polygon) {
|
MultiPolygon.prototype.appendPolygon = function(polygon) {
|
||||||
@@ -110,7 +110,7 @@ MultiPolygon.prototype.appendPolygon = function(polygon) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Make a complete copy of the geometry.
|
* Make a complete copy of the geometry.
|
||||||
* @return {!ol.geom.MultiPolygon} Clone.
|
* @return {!module:ol/geom/MultiPolygon~MultiPolygon} Clone.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -219,8 +219,8 @@ MultiPolygon.prototype.getFlatInteriorPoints = function() {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the interior points as {@link ol.geom.MultiPoint multipoint}.
|
* Return the interior points as {@link module:ol/geom/MultiPoint~MultiPoint multipoint}.
|
||||||
* @return {ol.geom.MultiPoint} Interior points as XYM coordinates, where M is
|
* @return {module:ol/geom/MultiPoint~MultiPoint} 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
|
||||||
*/
|
*/
|
||||||
@@ -273,7 +273,7 @@ MultiPolygon.prototype.getSimplifiedGeometryInternal = function(squaredTolerance
|
|||||||
/**
|
/**
|
||||||
* Return the polygon at the specified index.
|
* Return the polygon at the specified index.
|
||||||
* @param {number} index Index.
|
* @param {number} index Index.
|
||||||
* @return {ol.geom.Polygon} Polygon.
|
* @return {module:ol/geom/Polygon~Polygon} Polygon.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
MultiPolygon.prototype.getPolygon = function(index) {
|
MultiPolygon.prototype.getPolygon = function(index) {
|
||||||
@@ -303,7 +303,7 @@ MultiPolygon.prototype.getPolygon = function(index) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the polygons of this multipolygon.
|
* Return the polygons of this multipolygon.
|
||||||
* @return {Array.<ol.geom.Polygon>} Polygons.
|
* @return {Array.<module:ol/geom/Polygon~Polygon>} Polygons.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
MultiPolygon.prototype.getPolygons = function() {
|
MultiPolygon.prototype.getPolygons = function() {
|
||||||
@@ -352,7 +352,7 @@ MultiPolygon.prototype.intersectsExtent = function(extent) {
|
|||||||
/**
|
/**
|
||||||
* Set the coordinates of the multipolygon.
|
* Set the coordinates of the multipolygon.
|
||||||
* @param {Array.<Array.<Array.<module:ol/coordinate~Coordinate>>>} coordinates Coordinates.
|
* @param {Array.<Array.<Array.<module:ol/coordinate~Coordinate>>>} coordinates Coordinates.
|
||||||
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
* @param {module:ol/geom/GeometryLayout~GeometryLayout=} opt_layout Layout.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -379,7 +379,7 @@ MultiPolygon.prototype.setCoordinates = function(coordinates, opt_layout) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.GeometryLayout} layout Layout.
|
* @param {module:ol/geom/GeometryLayout~GeometryLayout} layout Layout.
|
||||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||||
* @param {Array.<Array.<number>>} endss Endss.
|
* @param {Array.<Array.<number>>} endss Endss.
|
||||||
*/
|
*/
|
||||||
@@ -391,7 +391,7 @@ MultiPolygon.prototype.setFlatCoordinates = function(layout, flatCoordinates, en
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array.<ol.geom.Polygon>} polygons Polygons.
|
* @param {Array.<module:ol/geom/Polygon~Polygon>} polygons Polygons.
|
||||||
*/
|
*/
|
||||||
MultiPolygon.prototype.setPolygons = function(polygons) {
|
MultiPolygon.prototype.setPolygons = function(polygons) {
|
||||||
let layout = this.getLayout();
|
let layout = this.getLayout();
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ import {squaredDistance as squaredDx} from '../math.js';
|
|||||||
* Point geometry.
|
* Point geometry.
|
||||||
*
|
*
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.geom.SimpleGeometry}
|
* @extends {module:ol/geom/SimpleGeometry~SimpleGeometry}
|
||||||
* @param {module:ol/coordinate~Coordinate} coordinates Coordinates.
|
* @param {module:ol/coordinate~Coordinate} coordinates Coordinates.
|
||||||
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
* @param {module:ol/geom/GeometryLayout~GeometryLayout=} opt_layout Layout.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
const Point = function(coordinates, opt_layout) {
|
const Point = function(coordinates, opt_layout) {
|
||||||
@@ -29,7 +29,7 @@ inherits(Point, SimpleGeometry);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Make a complete copy of the geometry.
|
* Make a complete copy of the geometry.
|
||||||
* @return {!ol.geom.Point} Clone.
|
* @return {!module:ol/geom/Point~Point} Clone.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -116,7 +116,7 @@ Point.prototype.setCoordinates = function(coordinates, opt_layout) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.GeometryLayout} layout Layout.
|
* @param {module:ol/geom/GeometryLayout~GeometryLayout} layout Layout.
|
||||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||||
*/
|
*/
|
||||||
Point.prototype.setFlatCoordinates = function(layout, flatCoordinates) {
|
Point.prototype.setFlatCoordinates = function(layout, flatCoordinates) {
|
||||||
|
|||||||
@@ -26,14 +26,14 @@ import {modulo} from '../math.js';
|
|||||||
* Polygon geometry.
|
* Polygon geometry.
|
||||||
*
|
*
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.geom.SimpleGeometry}
|
* @extends {module:ol/geom/SimpleGeometry~SimpleGeometry}
|
||||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} coordinates Array of linear
|
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} coordinates Array of linear
|
||||||
* rings that define the polygon. The first linear ring of the array
|
* rings that define the polygon. The first linear ring of the array
|
||||||
* defines the outer-boundary or surface of the polygon. Each subsequent
|
* 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
|
* 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
|
* is an array of vertices' coordinates where the first coordinate and the
|
||||||
* last are equivalent.
|
* last are equivalent.
|
||||||
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
* @param {module:ol/geom/GeometryLayout~GeometryLayout=} opt_layout Layout.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
const Polygon = function(coordinates, opt_layout) {
|
const Polygon = function(coordinates, opt_layout) {
|
||||||
@@ -91,7 +91,7 @@ inherits(Polygon, SimpleGeometry);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Append the passed linear ring to this polygon.
|
* Append the passed linear ring to this polygon.
|
||||||
* @param {ol.geom.LinearRing} linearRing Linear ring.
|
* @param {module:ol/geom/LinearRing~LinearRing} linearRing Linear ring.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
Polygon.prototype.appendLinearRing = function(linearRing) {
|
Polygon.prototype.appendLinearRing = function(linearRing) {
|
||||||
@@ -107,7 +107,7 @@ Polygon.prototype.appendLinearRing = function(linearRing) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Make a complete copy of the geometry.
|
* Make a complete copy of the geometry.
|
||||||
* @return {!ol.geom.Polygon} Clone.
|
* @return {!module:ol/geom/Polygon~Polygon} Clone.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -209,7 +209,7 @@ Polygon.prototype.getFlatInteriorPoint = function() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return an interior point of the polygon.
|
* Return an interior point of the polygon.
|
||||||
* @return {ol.geom.Point} Interior point as XYM coordinate, where M is the
|
* @return {module:ol/geom/Point~Point} 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
|
||||||
*/
|
*/
|
||||||
@@ -237,7 +237,7 @@ Polygon.prototype.getLinearRingCount = function() {
|
|||||||
* at index `1` and beyond.
|
* at index `1` and beyond.
|
||||||
*
|
*
|
||||||
* @param {number} index Index.
|
* @param {number} index Index.
|
||||||
* @return {ol.geom.LinearRing} Linear ring.
|
* @return {module:ol/geom/LinearRing~LinearRing} Linear ring.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
Polygon.prototype.getLinearRing = function(index) {
|
Polygon.prototype.getLinearRing = function(index) {
|
||||||
@@ -253,7 +253,7 @@ Polygon.prototype.getLinearRing = function(index) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the linear rings of the polygon.
|
* Return the linear rings of the polygon.
|
||||||
* @return {Array.<ol.geom.LinearRing>} Linear rings.
|
* @return {Array.<module:ol/geom/LinearRing~LinearRing>} Linear rings.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
Polygon.prototype.getLinearRings = function() {
|
Polygon.prototype.getLinearRings = function() {
|
||||||
@@ -333,7 +333,7 @@ Polygon.prototype.intersectsExtent = function(extent) {
|
|||||||
/**
|
/**
|
||||||
* Set the coordinates of the polygon.
|
* Set the coordinates of the polygon.
|
||||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} coordinates Coordinates.
|
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} coordinates Coordinates.
|
||||||
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
* @param {module:ol/geom/GeometryLayout~GeometryLayout=} opt_layout Layout.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -354,7 +354,7 @@ Polygon.prototype.setCoordinates = function(coordinates, opt_layout) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.GeometryLayout} layout Layout.
|
* @param {module:ol/geom/GeometryLayout~GeometryLayout} layout Layout.
|
||||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||||
* @param {Array.<number>} ends Ends.
|
* @param {Array.<number>} ends Ends.
|
||||||
*/
|
*/
|
||||||
@@ -376,7 +376,7 @@ export default Polygon;
|
|||||||
* 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 {ol.geom.Polygon} The "circular" polygon.
|
* @return {module:ol/geom/Polygon~Polygon} The "circular" polygon.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function circular(center, radius, opt_n, opt_sphereRadius) {
|
export function circular(center, radius, opt_n, opt_sphereRadius) {
|
||||||
@@ -396,7 +396,7 @@ 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 {module:ol/extent~Extent} extent The extent.
|
||||||
* @return {ol.geom.Polygon} The polygon.
|
* @return {module:ol/geom/Polygon~Polygon} The polygon.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function fromExtent(extent) {
|
export function fromExtent(extent) {
|
||||||
@@ -415,11 +415,11 @@ export function fromExtent(extent) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a regular polygon from a circle.
|
* Create a regular polygon from a circle.
|
||||||
* @param {ol.geom.Circle} circle Circle geometry.
|
* @param {module:ol/geom/Circle~Circle} 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 {ol.geom.Polygon} Polygon geometry.
|
* @return {module:ol/geom/Polygon~Polygon} Polygon geometry.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function fromCircle(circle, opt_sides, opt_angle) {
|
export function fromCircle(circle, opt_sides, opt_angle) {
|
||||||
@@ -441,7 +441,7 @@ 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 {ol.geom.Polygon} polygon Polygon geometry.
|
* @param {module:ol/geom/Polygon~Polygon} polygon Polygon geometry.
|
||||||
* @param {module:ol/coordinate~Coordinate} center Center of the regular polygon.
|
* @param {module:ol/coordinate~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
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import {clear} from '../obj.js';
|
|||||||
*
|
*
|
||||||
* @constructor
|
* @constructor
|
||||||
* @abstract
|
* @abstract
|
||||||
* @extends {ol.geom.Geometry}
|
* @extends {module:ol/geom/Geometry~Geometry}
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
const SimpleGeometry = function() {
|
const SimpleGeometry = function() {
|
||||||
@@ -25,7 +25,7 @@ const SimpleGeometry = function() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @protected
|
* @protected
|
||||||
* @type {ol.geom.GeometryLayout}
|
* @type {module:ol/geom/GeometryLayout~GeometryLayout}
|
||||||
*/
|
*/
|
||||||
this.layout = GeometryLayout.XY;
|
this.layout = GeometryLayout.XY;
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ inherits(SimpleGeometry, Geometry);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
* @return {ol.geom.GeometryLayout} layout Layout.
|
* @return {module:ol/geom/GeometryLayout~GeometryLayout} layout Layout.
|
||||||
*/
|
*/
|
||||||
function getLayoutForStride(stride) {
|
function getLayoutForStride(stride) {
|
||||||
let layout;
|
let layout;
|
||||||
@@ -59,12 +59,12 @@ function getLayoutForStride(stride) {
|
|||||||
} else if (stride == 4) {
|
} else if (stride == 4) {
|
||||||
layout = GeometryLayout.XYZM;
|
layout = GeometryLayout.XYZM;
|
||||||
}
|
}
|
||||||
return /** @type {ol.geom.GeometryLayout} */ (layout);
|
return /** @type {module:ol/geom/GeometryLayout~GeometryLayout} */ (layout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.GeometryLayout} layout Layout.
|
* @param {module:ol/geom/GeometryLayout~GeometryLayout} layout Layout.
|
||||||
* @return {number} Stride.
|
* @return {number} Stride.
|
||||||
*/
|
*/
|
||||||
export function getStrideForLayout(layout) {
|
export function getStrideForLayout(layout) {
|
||||||
@@ -131,8 +131,8 @@ SimpleGeometry.prototype.getLastCoordinate = function() {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the {@link ol.geom.GeometryLayout layout} of the geometry.
|
* Return the {@link module:ol/geom/GeometryLayout~GeometryLayout layout} of the geometry.
|
||||||
* @return {ol.geom.GeometryLayout} Layout.
|
* @return {module:ol/geom/GeometryLayout~GeometryLayout} Layout.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
SimpleGeometry.prototype.getLayout = function() {
|
SimpleGeometry.prototype.getLayout = function() {
|
||||||
@@ -182,7 +182,7 @@ SimpleGeometry.prototype.getSimplifiedGeometry = function(squaredTolerance) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {number} squaredTolerance Squared tolerance.
|
* @param {number} squaredTolerance Squared tolerance.
|
||||||
* @return {ol.geom.SimpleGeometry} Simplified geometry.
|
* @return {module:ol/geom/SimpleGeometry~SimpleGeometry} Simplified geometry.
|
||||||
* @protected
|
* @protected
|
||||||
*/
|
*/
|
||||||
SimpleGeometry.prototype.getSimplifiedGeometryInternal = function(squaredTolerance) {
|
SimpleGeometry.prototype.getSimplifiedGeometryInternal = function(squaredTolerance) {
|
||||||
@@ -199,7 +199,7 @@ SimpleGeometry.prototype.getStride = function() {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.GeometryLayout} layout Layout.
|
* @param {module:ol/geom/GeometryLayout~GeometryLayout} layout Layout.
|
||||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||||
* @protected
|
* @protected
|
||||||
*/
|
*/
|
||||||
@@ -213,13 +213,13 @@ SimpleGeometry.prototype.setFlatCoordinatesInternal = function(layout, flatCoord
|
|||||||
/**
|
/**
|
||||||
* @abstract
|
* @abstract
|
||||||
* @param {Array} coordinates Coordinates.
|
* @param {Array} coordinates Coordinates.
|
||||||
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
* @param {module:ol/geom/GeometryLayout~GeometryLayout=} opt_layout Layout.
|
||||||
*/
|
*/
|
||||||
SimpleGeometry.prototype.setCoordinates = function(coordinates, opt_layout) {};
|
SimpleGeometry.prototype.setCoordinates = function(coordinates, opt_layout) {};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.GeometryLayout|undefined} layout Layout.
|
* @param {module:ol/geom/GeometryLayout~GeometryLayout|undefined} layout Layout.
|
||||||
* @param {Array} coordinates Coordinates.
|
* @param {Array} coordinates Coordinates.
|
||||||
* @param {number} nesting Nesting.
|
* @param {number} nesting Nesting.
|
||||||
* @protected
|
* @protected
|
||||||
@@ -316,7 +316,7 @@ SimpleGeometry.prototype.translate = function(deltaX, deltaY) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.SimpleGeometry} simpleGeometry Simple geometry.
|
* @param {module:ol/geom/SimpleGeometry~SimpleGeometry} simpleGeometry Simple geometry.
|
||||||
* @param {module:ol/transform~Transform} transform Transform.
|
* @param {module:ol/transform~Transform} transform Transform.
|
||||||
* @param {Array.<number>=} opt_dest Destination.
|
* @param {Array.<number>=} opt_dest Destination.
|
||||||
* @return {Array.<number>} Transformed flat coordinates.
|
* @return {Array.<number>} Transformed flat coordinates.
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ function handleDragEvent(mapBrowserEvent) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns geometry of last drawn box.
|
* Returns geometry of last drawn box.
|
||||||
* @return {ol.geom.Polygon} Geometry.
|
* @return {module:ol/geom/Polygon~Polygon} Geometry.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
DragBox.prototype.getGeometry = function() {
|
DragBox.prototype.getGeometry = function() {
|
||||||
|
|||||||
@@ -159,10 +159,10 @@ const Draw = function(options) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Geometry type.
|
* Geometry type.
|
||||||
* @type {ol.geom.GeometryType}
|
* @type {module:ol/geom/GeometryType~GeometryType}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.type_ = /** @type {ol.geom.GeometryType} */ (options.type);
|
this.type_ = /** @type {module:ol/geom/GeometryType~GeometryType} */ (options.type);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Drawing mode (derived from geometry type.
|
* Drawing mode (derived from geometry type.
|
||||||
@@ -211,11 +211,11 @@ const Draw = function(options) {
|
|||||||
/**
|
/**
|
||||||
* @param {!Array.<module:ol/coordinate~Coordinate>} coordinates
|
* @param {!Array.<module:ol/coordinate~Coordinate>} coordinates
|
||||||
* The coordinates.
|
* The coordinates.
|
||||||
* @param {ol.geom.SimpleGeometry=} opt_geometry Optional geometry.
|
* @param {module:ol/geom/SimpleGeometry~SimpleGeometry=} opt_geometry Optional geometry.
|
||||||
* @return {ol.geom.SimpleGeometry} A geometry.
|
* @return {module:ol/geom/SimpleGeometry~SimpleGeometry} A geometry.
|
||||||
*/
|
*/
|
||||||
geometryFunction = function(coordinates, opt_geometry) {
|
geometryFunction = function(coordinates, opt_geometry) {
|
||||||
const circle = opt_geometry ? /** @type {ol.geom.Circle} */ (opt_geometry) :
|
const circle = opt_geometry ? /** @type {module:ol/geom/Circle~Circle} */ (opt_geometry) :
|
||||||
new Circle([NaN, NaN]);
|
new Circle([NaN, NaN]);
|
||||||
const squaredLength = squaredCoordinateDistance(
|
const squaredLength = squaredCoordinateDistance(
|
||||||
coordinates[0], coordinates[1]);
|
coordinates[0], coordinates[1]);
|
||||||
@@ -235,8 +235,8 @@ const Draw = function(options) {
|
|||||||
/**
|
/**
|
||||||
* @param {!Array.<module:ol/coordinate~Coordinate>} coordinates
|
* @param {!Array.<module:ol/coordinate~Coordinate>} coordinates
|
||||||
* The coordinates.
|
* The coordinates.
|
||||||
* @param {ol.geom.SimpleGeometry=} opt_geometry Optional geometry.
|
* @param {module:ol/geom/SimpleGeometry~SimpleGeometry=} opt_geometry Optional geometry.
|
||||||
* @return {ol.geom.SimpleGeometry} A geometry.
|
* @return {module:ol/geom/SimpleGeometry~SimpleGeometry} A geometry.
|
||||||
*/
|
*/
|
||||||
geometryFunction = function(coordinates, opt_geometry) {
|
geometryFunction = function(coordinates, opt_geometry) {
|
||||||
let geometry = opt_geometry;
|
let geometry = opt_geometry;
|
||||||
@@ -601,7 +601,7 @@ Draw.prototype.createOrUpdateSketchPoint_ = function(event) {
|
|||||||
this.sketchPoint_ = new Feature(new Point(coordinates));
|
this.sketchPoint_ = new Feature(new Point(coordinates));
|
||||||
this.updateSketchFeatures_();
|
this.updateSketchFeatures_();
|
||||||
} else {
|
} else {
|
||||||
const sketchPointGeom = /** @type {ol.geom.Point} */ (this.sketchPoint_.getGeometry());
|
const sketchPointGeom = /** @type {module:ol/geom/Point~Point} */ (this.sketchPoint_.getGeometry());
|
||||||
sketchPointGeom.setCoordinates(coordinates);
|
sketchPointGeom.setCoordinates(coordinates);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -645,7 +645,7 @@ Draw.prototype.startDrawing_ = function(event) {
|
|||||||
*/
|
*/
|
||||||
Draw.prototype.modifyDrawing_ = function(event) {
|
Draw.prototype.modifyDrawing_ = function(event) {
|
||||||
let coordinate = event.coordinate;
|
let coordinate = event.coordinate;
|
||||||
const geometry = /** @type {ol.geom.SimpleGeometry} */ (this.sketchFeature_.getGeometry());
|
const geometry = /** @type {module:ol/geom/SimpleGeometry~SimpleGeometry} */ (this.sketchFeature_.getGeometry());
|
||||||
let coordinates, last;
|
let coordinates, last;
|
||||||
if (this.mode_ === Mode.POINT) {
|
if (this.mode_ === Mode.POINT) {
|
||||||
last = this.sketchCoords_;
|
last = this.sketchCoords_;
|
||||||
@@ -664,7 +664,7 @@ Draw.prototype.modifyDrawing_ = function(event) {
|
|||||||
last[1] = coordinate[1];
|
last[1] = coordinate[1];
|
||||||
this.geometryFunction_(/** @type {!Array.<module:ol/coordinate~Coordinate>} */ (this.sketchCoords_), geometry);
|
this.geometryFunction_(/** @type {!Array.<module:ol/coordinate~Coordinate>} */ (this.sketchCoords_), geometry);
|
||||||
if (this.sketchPoint_) {
|
if (this.sketchPoint_) {
|
||||||
const sketchPointGeom = /** @type {ol.geom.Point} */ (this.sketchPoint_.getGeometry());
|
const sketchPointGeom = /** @type {module:ol/geom/Point~Point} */ (this.sketchPoint_.getGeometry());
|
||||||
sketchPointGeom.setCoordinates(coordinate);
|
sketchPointGeom.setCoordinates(coordinate);
|
||||||
}
|
}
|
||||||
let sketchLineGeom;
|
let sketchLineGeom;
|
||||||
@@ -674,11 +674,11 @@ Draw.prototype.modifyDrawing_ = function(event) {
|
|||||||
this.sketchLine_ = new Feature(new LineString(null));
|
this.sketchLine_ = new Feature(new LineString(null));
|
||||||
}
|
}
|
||||||
const ring = geometry.getLinearRing(0);
|
const ring = geometry.getLinearRing(0);
|
||||||
sketchLineGeom = /** @type {ol.geom.LineString} */ (this.sketchLine_.getGeometry());
|
sketchLineGeom = /** @type {module:ol/geom/LineString~LineString} */ (this.sketchLine_.getGeometry());
|
||||||
sketchLineGeom.setFlatCoordinates(
|
sketchLineGeom.setFlatCoordinates(
|
||||||
ring.getLayout(), ring.getFlatCoordinates());
|
ring.getLayout(), ring.getFlatCoordinates());
|
||||||
} else if (this.sketchLineCoords_) {
|
} else if (this.sketchLineCoords_) {
|
||||||
sketchLineGeom = /** @type {ol.geom.LineString} */ (this.sketchLine_.getGeometry());
|
sketchLineGeom = /** @type {module:ol/geom/LineString~LineString} */ (this.sketchLine_.getGeometry());
|
||||||
sketchLineGeom.setCoordinates(this.sketchLineCoords_);
|
sketchLineGeom.setCoordinates(this.sketchLineCoords_);
|
||||||
}
|
}
|
||||||
this.updateSketchFeatures_();
|
this.updateSketchFeatures_();
|
||||||
@@ -692,7 +692,7 @@ Draw.prototype.modifyDrawing_ = function(event) {
|
|||||||
*/
|
*/
|
||||||
Draw.prototype.addToDrawing_ = function(event) {
|
Draw.prototype.addToDrawing_ = function(event) {
|
||||||
const coordinate = event.coordinate;
|
const coordinate = event.coordinate;
|
||||||
const geometry = /** @type {ol.geom.SimpleGeometry} */ (this.sketchFeature_.getGeometry());
|
const geometry = /** @type {module:ol/geom/SimpleGeometry~SimpleGeometry} */ (this.sketchFeature_.getGeometry());
|
||||||
let done;
|
let done;
|
||||||
let coordinates;
|
let coordinates;
|
||||||
if (this.mode_ === Mode.LINE_STRING) {
|
if (this.mode_ === Mode.LINE_STRING) {
|
||||||
@@ -737,7 +737,7 @@ Draw.prototype.removeLastPoint = function() {
|
|||||||
if (!this.sketchFeature_) {
|
if (!this.sketchFeature_) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const geometry = /** @type {ol.geom.SimpleGeometry} */ (this.sketchFeature_.getGeometry());
|
const geometry = /** @type {module:ol/geom/SimpleGeometry~SimpleGeometry} */ (this.sketchFeature_.getGeometry());
|
||||||
let coordinates, sketchLineGeom;
|
let coordinates, sketchLineGeom;
|
||||||
if (this.mode_ === Mode.LINE_STRING) {
|
if (this.mode_ === Mode.LINE_STRING) {
|
||||||
coordinates = this.sketchCoords_;
|
coordinates = this.sketchCoords_;
|
||||||
@@ -749,7 +749,7 @@ Draw.prototype.removeLastPoint = function() {
|
|||||||
} else if (this.mode_ === Mode.POLYGON) {
|
} else if (this.mode_ === Mode.POLYGON) {
|
||||||
coordinates = this.sketchCoords_[0];
|
coordinates = this.sketchCoords_[0];
|
||||||
coordinates.splice(-2, 1);
|
coordinates.splice(-2, 1);
|
||||||
sketchLineGeom = /** @type {ol.geom.LineString} */ (this.sketchLine_.getGeometry());
|
sketchLineGeom = /** @type {module:ol/geom/LineString~LineString} */ (this.sketchLine_.getGeometry());
|
||||||
sketchLineGeom.setCoordinates(coordinates);
|
sketchLineGeom.setCoordinates(coordinates);
|
||||||
this.geometryFunction_(this.sketchCoords_, geometry);
|
this.geometryFunction_(this.sketchCoords_, geometry);
|
||||||
}
|
}
|
||||||
@@ -774,7 +774,7 @@ Draw.prototype.finishDrawing = function() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let coordinates = this.sketchCoords_;
|
let coordinates = this.sketchCoords_;
|
||||||
const geometry = /** @type {ol.geom.SimpleGeometry} */ (sketchFeature.getGeometry());
|
const geometry = /** @type {module:ol/geom/SimpleGeometry~SimpleGeometry} */ (sketchFeature.getGeometry());
|
||||||
if (this.mode_ === Mode.LINE_STRING) {
|
if (this.mode_ === Mode.LINE_STRING) {
|
||||||
// remove the redundant last point
|
// remove the redundant last point
|
||||||
coordinates.pop();
|
coordinates.pop();
|
||||||
@@ -835,7 +835,7 @@ Draw.prototype.abortDrawing_ = function() {
|
|||||||
*/
|
*/
|
||||||
Draw.prototype.extend = function(feature) {
|
Draw.prototype.extend = function(feature) {
|
||||||
const geometry = feature.getGeometry();
|
const geometry = feature.getGeometry();
|
||||||
const lineString = /** @type {ol.geom.LineString} */ (geometry);
|
const lineString = /** @type {module:ol/geom/LineString~LineString} */ (geometry);
|
||||||
this.sketchFeature_ = feature;
|
this.sketchFeature_ = feature;
|
||||||
this.sketchCoords_ = lineString.getCoordinates();
|
this.sketchCoords_ = lineString.getCoordinates();
|
||||||
const last = this.sketchCoords_[this.sketchCoords_.length - 1];
|
const last = this.sketchCoords_[this.sketchCoords_.length - 1];
|
||||||
@@ -889,7 +889,7 @@ Draw.prototype.updateState_ = function() {
|
|||||||
/**
|
/**
|
||||||
* Create a `geometryFunction` for `type: 'Circle'` that will create a regular
|
* Create a `geometryFunction` for `type: 'Circle'` that will create a regular
|
||||||
* polygon with a user specified number of sides and start angle instead of an
|
* polygon with a user specified number of sides and start angle instead of an
|
||||||
* `ol.geom.Circle` geometry.
|
* `module:ol/geom/Circle~Circle` geometry.
|
||||||
* @param {number=} opt_sides Number of sides of the regular polygon. Default is
|
* @param {number=} opt_sides Number of sides of the regular polygon. Default is
|
||||||
* 32.
|
* 32.
|
||||||
* @param {number=} opt_angle Angle of the first point in radians. 0 means East.
|
* @param {number=} opt_angle Angle of the first point in radians. 0 means East.
|
||||||
@@ -906,7 +906,7 @@ export function createRegularPolygon(opt_sides, opt_angle) {
|
|||||||
const end = coordinates[1];
|
const end = coordinates[1];
|
||||||
const radius = Math.sqrt(
|
const radius = Math.sqrt(
|
||||||
squaredCoordinateDistance(center, end));
|
squaredCoordinateDistance(center, end));
|
||||||
const geometry = opt_geometry ? /** @type {ol.geom.Polygon} */ (opt_geometry) :
|
const geometry = opt_geometry ? /** @type {module:ol/geom/Polygon~Polygon} */ (opt_geometry) :
|
||||||
fromCircle(new Circle(center), opt_sides);
|
fromCircle(new Circle(center), opt_sides);
|
||||||
const angle = opt_angle ? opt_angle :
|
const angle = opt_angle ? opt_angle :
|
||||||
Math.atan((end[1] - center[1]) / (end[0] - center[0]));
|
Math.atan((end[1] - center[1]) / (end[0] - center[0]));
|
||||||
@@ -945,7 +945,7 @@ export function createBox() {
|
|||||||
/**
|
/**
|
||||||
* Get the drawing mode. The mode for mult-part geometries is the same as for
|
* Get the drawing mode. The mode for mult-part geometries is the same as for
|
||||||
* their single-part cousins.
|
* their single-part cousins.
|
||||||
* @param {ol.geom.GeometryType} type Geometry type.
|
* @param {module:ol/geom/GeometryType~GeometryType} type Geometry type.
|
||||||
* @return {ol.interaction.Mode} Drawing mode.
|
* @return {ol.interaction.Mode} Drawing mode.
|
||||||
*/
|
*/
|
||||||
function getMode(type) {
|
function getMode(type) {
|
||||||
|
|||||||
@@ -419,7 +419,7 @@ ExtentInteraction.prototype.createOrUpdatePointerFeature_ = function(vertex) {
|
|||||||
this.vertexFeature_ = vertexFeature;
|
this.vertexFeature_ = vertexFeature;
|
||||||
this.vertexOverlay_.getSource().addFeature(vertexFeature);
|
this.vertexOverlay_.getSource().addFeature(vertexFeature);
|
||||||
} else {
|
} else {
|
||||||
const geometry = /** @type {ol.geom.Point} */ (vertexFeature.getGeometry());
|
const geometry = /** @type {module:ol/geom/Point~Point} */ (vertexFeature.getGeometry());
|
||||||
geometry.setCoordinates(vertex);
|
geometry.setCoordinates(vertex);
|
||||||
}
|
}
|
||||||
return vertexFeature;
|
return vertexFeature;
|
||||||
|
|||||||
@@ -223,7 +223,7 @@ const Modify = function(options) {
|
|||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @private
|
* @private
|
||||||
* @type {!Object.<string, function(ol.Feature, ol.geom.Geometry)>}
|
* @type {!Object.<string, function(ol.Feature, module:ol/geom/Geometry~Geometry)>}
|
||||||
*/
|
*/
|
||||||
this.SEGMENT_WRITERS_ = {
|
this.SEGMENT_WRITERS_ = {
|
||||||
'Point': this.writePointGeometry_,
|
'Point': this.writePointGeometry_,
|
||||||
@@ -444,7 +444,7 @@ Modify.prototype.handleFeatureRemove_ = function(evt) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.Feature} feature Feature
|
* @param {ol.Feature} feature Feature
|
||||||
* @param {ol.geom.Point} geometry Geometry.
|
* @param {module:ol/geom/Point~Point} geometry Geometry.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
Modify.prototype.writePointGeometry_ = function(feature, geometry) {
|
Modify.prototype.writePointGeometry_ = function(feature, geometry) {
|
||||||
@@ -460,7 +460,7 @@ Modify.prototype.writePointGeometry_ = function(feature, geometry) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.Feature} feature Feature
|
* @param {ol.Feature} feature Feature
|
||||||
* @param {ol.geom.MultiPoint} geometry Geometry.
|
* @param {module:ol/geom/MultiPoint~MultiPoint} geometry Geometry.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
Modify.prototype.writeMultiPointGeometry_ = function(feature, geometry) {
|
Modify.prototype.writeMultiPointGeometry_ = function(feature, geometry) {
|
||||||
@@ -481,7 +481,7 @@ Modify.prototype.writeMultiPointGeometry_ = function(feature, geometry) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.Feature} feature Feature
|
* @param {ol.Feature} feature Feature
|
||||||
* @param {ol.geom.LineString} geometry Geometry.
|
* @param {module:ol/geom/LineString~LineString} geometry Geometry.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
Modify.prototype.writeLineStringGeometry_ = function(feature, geometry) {
|
Modify.prototype.writeLineStringGeometry_ = function(feature, geometry) {
|
||||||
@@ -501,7 +501,7 @@ Modify.prototype.writeLineStringGeometry_ = function(feature, geometry) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.Feature} feature Feature
|
* @param {ol.Feature} feature Feature
|
||||||
* @param {ol.geom.MultiLineString} geometry Geometry.
|
* @param {module:ol/geom/MultiLineString~MultiLineString} geometry Geometry.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
Modify.prototype.writeMultiLineStringGeometry_ = function(feature, geometry) {
|
Modify.prototype.writeMultiLineStringGeometry_ = function(feature, geometry) {
|
||||||
@@ -525,7 +525,7 @@ Modify.prototype.writeMultiLineStringGeometry_ = function(feature, geometry) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.Feature} feature Feature
|
* @param {ol.Feature} feature Feature
|
||||||
* @param {ol.geom.Polygon} geometry Geometry.
|
* @param {module:ol/geom/Polygon~Polygon} geometry Geometry.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
Modify.prototype.writePolygonGeometry_ = function(feature, geometry) {
|
Modify.prototype.writePolygonGeometry_ = function(feature, geometry) {
|
||||||
@@ -549,7 +549,7 @@ Modify.prototype.writePolygonGeometry_ = function(feature, geometry) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.Feature} feature Feature
|
* @param {ol.Feature} feature Feature
|
||||||
* @param {ol.geom.MultiPolygon} geometry Geometry.
|
* @param {module:ol/geom/MultiPolygon~MultiPolygon} geometry Geometry.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
Modify.prototype.writeMultiPolygonGeometry_ = function(feature, geometry) {
|
Modify.prototype.writeMultiPolygonGeometry_ = function(feature, geometry) {
|
||||||
@@ -582,7 +582,7 @@ Modify.prototype.writeMultiPolygonGeometry_ = function(feature, geometry) {
|
|||||||
* the circumference, and is not a line segment.
|
* the circumference, and is not a line segment.
|
||||||
*
|
*
|
||||||
* @param {ol.Feature} feature Feature.
|
* @param {ol.Feature} feature Feature.
|
||||||
* @param {ol.geom.Circle} geometry Geometry.
|
* @param {module:ol/geom/Circle~Circle} geometry Geometry.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
Modify.prototype.writeCircleGeometry_ = function(feature, geometry) {
|
Modify.prototype.writeCircleGeometry_ = function(feature, geometry) {
|
||||||
@@ -608,7 +608,7 @@ Modify.prototype.writeCircleGeometry_ = function(feature, geometry) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.Feature} feature Feature
|
* @param {ol.Feature} feature Feature
|
||||||
* @param {ol.geom.GeometryCollection} geometry Geometry.
|
* @param {module:ol/geom/GeometryCollection~GeometryCollection} geometry Geometry.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
Modify.prototype.writeGeometryCollectionGeometry_ = function(feature, geometry) {
|
Modify.prototype.writeGeometryCollectionGeometry_ = function(feature, geometry) {
|
||||||
@@ -631,7 +631,7 @@ Modify.prototype.createOrUpdateVertexFeature_ = function(coordinates) {
|
|||||||
this.vertexFeature_ = vertexFeature;
|
this.vertexFeature_ = vertexFeature;
|
||||||
this.overlay_.getSource().addFeature(vertexFeature);
|
this.overlay_.getSource().addFeature(vertexFeature);
|
||||||
} else {
|
} else {
|
||||||
const geometry = /** @type {ol.geom.Point} */ (vertexFeature.getGeometry());
|
const geometry = /** @type {module:ol/geom/Point~Point} */ (vertexFeature.getGeometry());
|
||||||
geometry.setCoordinates(coordinates);
|
geometry.setCoordinates(coordinates);
|
||||||
}
|
}
|
||||||
return vertexFeature;
|
return vertexFeature;
|
||||||
@@ -664,7 +664,7 @@ function handleDownEvent(evt) {
|
|||||||
const vertexFeature = this.vertexFeature_;
|
const vertexFeature = this.vertexFeature_;
|
||||||
if (vertexFeature) {
|
if (vertexFeature) {
|
||||||
const insertVertices = [];
|
const insertVertices = [];
|
||||||
const geometry = /** @type {ol.geom.Point} */ (vertexFeature.getGeometry());
|
const geometry = /** @type {module:ol/geom/Point~Point} */ (vertexFeature.getGeometry());
|
||||||
const vertex = geometry.getCoordinates();
|
const vertex = geometry.getCoordinates();
|
||||||
const vertexExtent = boundingExtent([vertex]);
|
const vertexExtent = boundingExtent([vertex]);
|
||||||
const segmentDataMatches = this.rBush_.getInExtent(vertexExtent);
|
const segmentDataMatches = this.rBush_.getInExtent(vertexExtent);
|
||||||
@@ -956,7 +956,7 @@ function pointDistanceToSegmentDataSquared(pointCoordinates, segmentData) {
|
|||||||
const geometry = segmentData.geometry;
|
const geometry = segmentData.geometry;
|
||||||
|
|
||||||
if (geometry.getType() === GeometryType.CIRCLE) {
|
if (geometry.getType() === GeometryType.CIRCLE) {
|
||||||
const circleGeometry = /** @type {ol.geom.Circle} */ (geometry);
|
const circleGeometry = /** @type {module:ol/geom/Circle~Circle} */ (geometry);
|
||||||
|
|
||||||
if (segmentData.index === CIRCLE_CIRCUMFERENCE_INDEX) {
|
if (segmentData.index === CIRCLE_CIRCUMFERENCE_INDEX) {
|
||||||
const distanceToCenterSquared =
|
const distanceToCenterSquared =
|
||||||
@@ -1191,7 +1191,7 @@ Modify.prototype.removeVertex_ = function() {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.SimpleGeometry} geometry Geometry.
|
* @param {module:ol/geom/SimpleGeometry~SimpleGeometry} geometry Geometry.
|
||||||
* @param {Array} coordinates Coordinates.
|
* @param {Array} coordinates Coordinates.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -1203,7 +1203,7 @@ Modify.prototype.setGeometryCoordinates_ = function(geometry, coordinates) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.SimpleGeometry} geometry Geometry.
|
* @param {module:ol/geom/SimpleGeometry~SimpleGeometry} geometry Geometry.
|
||||||
* @param {number} index Index.
|
* @param {number} index Index.
|
||||||
* @param {Array.<number>|undefined} depth Depth.
|
* @param {Array.<number>|undefined} depth Depth.
|
||||||
* @param {number} delta Delta (1 or -1).
|
* @param {number} delta Delta (1 or -1).
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ const Snap = function(opt_options) {
|
|||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @private
|
* @private
|
||||||
* @type {Object.<string, function(ol.Feature, ol.geom.Geometry)>}
|
* @type {Object.<string, function(ol.Feature, module:ol/geom/Geometry~Geometry)>}
|
||||||
*/
|
*/
|
||||||
this.SEGMENT_WRITERS_ = {
|
this.SEGMENT_WRITERS_ = {
|
||||||
'Point': this.writePointGeometry_,
|
'Point': this.writePointGeometry_,
|
||||||
@@ -383,7 +383,7 @@ Snap.prototype.snapTo = function(pixel, pixelCoordinate, map) {
|
|||||||
} else if (this.edge_) {
|
} else if (this.edge_) {
|
||||||
if (isCircle) {
|
if (isCircle) {
|
||||||
vertex = closestOnCircle(pixelCoordinate,
|
vertex = closestOnCircle(pixelCoordinate,
|
||||||
/** @type {ol.geom.Circle} */ (segments[0].feature.getGeometry()));
|
/** @type {module:ol/geom/Circle~Circle} */ (segments[0].feature.getGeometry()));
|
||||||
} else {
|
} else {
|
||||||
vertex = closestOnSegment(pixelCoordinate, closestSegment);
|
vertex = closestOnSegment(pixelCoordinate, closestSegment);
|
||||||
}
|
}
|
||||||
@@ -428,7 +428,7 @@ Snap.prototype.updateFeature_ = function(feature) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.Feature} feature Feature
|
* @param {ol.Feature} feature Feature
|
||||||
* @param {ol.geom.Circle} geometry Geometry.
|
* @param {module:ol/geom/Circle~Circle} geometry Geometry.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
Snap.prototype.writeCircleGeometry_ = function(feature, geometry) {
|
Snap.prototype.writeCircleGeometry_ = function(feature, geometry) {
|
||||||
@@ -447,7 +447,7 @@ Snap.prototype.writeCircleGeometry_ = function(feature, geometry) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.Feature} feature Feature
|
* @param {ol.Feature} feature Feature
|
||||||
* @param {ol.geom.GeometryCollection} geometry Geometry.
|
* @param {module:ol/geom/GeometryCollection~GeometryCollection} geometry Geometry.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
Snap.prototype.writeGeometryCollectionGeometry_ = function(feature, geometry) {
|
Snap.prototype.writeGeometryCollectionGeometry_ = function(feature, geometry) {
|
||||||
@@ -463,7 +463,7 @@ Snap.prototype.writeGeometryCollectionGeometry_ = function(feature, geometry) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.Feature} feature Feature
|
* @param {ol.Feature} feature Feature
|
||||||
* @param {ol.geom.LineString} geometry Geometry.
|
* @param {module:ol/geom/LineString~LineString} geometry Geometry.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
Snap.prototype.writeLineStringGeometry_ = function(feature, geometry) {
|
Snap.prototype.writeLineStringGeometry_ = function(feature, geometry) {
|
||||||
@@ -481,7 +481,7 @@ Snap.prototype.writeLineStringGeometry_ = function(feature, geometry) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.Feature} feature Feature
|
* @param {ol.Feature} feature Feature
|
||||||
* @param {ol.geom.MultiLineString} geometry Geometry.
|
* @param {module:ol/geom/MultiLineString~MultiLineString} geometry Geometry.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
Snap.prototype.writeMultiLineStringGeometry_ = function(feature, geometry) {
|
Snap.prototype.writeMultiLineStringGeometry_ = function(feature, geometry) {
|
||||||
@@ -502,7 +502,7 @@ Snap.prototype.writeMultiLineStringGeometry_ = function(feature, geometry) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.Feature} feature Feature
|
* @param {ol.Feature} feature Feature
|
||||||
* @param {ol.geom.MultiPoint} geometry Geometry.
|
* @param {module:ol/geom/MultiPoint~MultiPoint} geometry Geometry.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
Snap.prototype.writeMultiPointGeometry_ = function(feature, geometry) {
|
Snap.prototype.writeMultiPointGeometry_ = function(feature, geometry) {
|
||||||
@@ -520,7 +520,7 @@ Snap.prototype.writeMultiPointGeometry_ = function(feature, geometry) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.Feature} feature Feature
|
* @param {ol.Feature} feature Feature
|
||||||
* @param {ol.geom.MultiPolygon} geometry Geometry.
|
* @param {module:ol/geom/MultiPolygon~MultiPolygon} geometry Geometry.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
Snap.prototype.writeMultiPolygonGeometry_ = function(feature, geometry) {
|
Snap.prototype.writeMultiPolygonGeometry_ = function(feature, geometry) {
|
||||||
@@ -544,7 +544,7 @@ Snap.prototype.writeMultiPolygonGeometry_ = function(feature, geometry) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.Feature} feature Feature
|
* @param {ol.Feature} feature Feature
|
||||||
* @param {ol.geom.Point} geometry Geometry.
|
* @param {module:ol/geom/Point~Point} geometry Geometry.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
Snap.prototype.writePointGeometry_ = function(feature, geometry) {
|
Snap.prototype.writePointGeometry_ = function(feature, geometry) {
|
||||||
@@ -559,7 +559,7 @@ Snap.prototype.writePointGeometry_ = function(feature, geometry) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.Feature} feature Feature
|
* @param {ol.Feature} feature Feature
|
||||||
* @param {ol.geom.Polygon} geometry Geometry.
|
* @param {module:ol/geom/Polygon~Polygon} geometry Geometry.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
Snap.prototype.writePolygonGeometry_ = function(feature, geometry) {
|
Snap.prototype.writePolygonGeometry_ = function(feature, geometry) {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import Polygon from '../geom/Polygon.js';
|
|||||||
const RenderBox = function(className) {
|
const RenderBox = function(className) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {ol.geom.Polygon}
|
* @type {module:ol/geom/Polygon~Polygon}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.geometry_ = null;
|
this.geometry_ = null;
|
||||||
@@ -126,7 +126,7 @@ RenderBox.prototype.createOrUpdateGeometry = function() {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {ol.geom.Polygon} Geometry.
|
* @return {module:ol/geom/Polygon~Polygon} Geometry.
|
||||||
*/
|
*/
|
||||||
RenderBox.prototype.getGeometry = function() {
|
RenderBox.prototype.getGeometry = function() {
|
||||||
return this.geometry_;
|
return this.geometry_;
|
||||||
|
|||||||
@@ -12,12 +12,12 @@ import {transform2D} from '../geom/flat/transform.js';
|
|||||||
import {create as createTransform, compose as composeTransform} from '../transform.js';
|
import {create as createTransform, compose as composeTransform} from '../transform.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Lightweight, read-only, {@link ol.Feature} and {@link ol.geom.Geometry} like
|
* Lightweight, read-only, {@link ol.Feature} and {@link module:ol/geom/Geometry~Geometry} like
|
||||||
* structure, optimized for vector tile rendering and styling. Geometry access
|
* structure, optimized for vector tile rendering and styling. Geometry access
|
||||||
* through the API is limited to getting the type and extent of the geometry.
|
* through the API is limited to getting the type and extent of the geometry.
|
||||||
*
|
*
|
||||||
* @constructor
|
* @constructor
|
||||||
* @param {ol.geom.GeometryType} type Geometry type.
|
* @param {module:ol/geom/GeometryType~GeometryType} type Geometry type.
|
||||||
* @param {Array.<number>} flatCoordinates Flat coordinates. These always need
|
* @param {Array.<number>} flatCoordinates Flat coordinates. These always need
|
||||||
* to be right-handed for polygons.
|
* to be right-handed for polygons.
|
||||||
* @param {Array.<number>|Array.<Array.<number>>} ends Ends or Endss.
|
* @param {Array.<number>|Array.<Array.<number>>} ends Ends or Endss.
|
||||||
@@ -39,7 +39,7 @@ const RenderFeature = function(type, flatCoordinates, ends, properties, id) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {ol.geom.GeometryType}
|
* @type {module:ol/geom/GeometryType~GeometryType}
|
||||||
*/
|
*/
|
||||||
this.type_ = type;
|
this.type_ = type;
|
||||||
|
|
||||||
@@ -249,7 +249,7 @@ RenderFeature.prototype.getStyleFunction = UNDEFINED;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the type of this feature's geometry.
|
* Get the type of this feature's geometry.
|
||||||
* @return {ol.geom.GeometryType} Geometry type.
|
* @return {module:ol/geom/GeometryType~GeometryType} Geometry type.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
RenderFeature.prototype.getType = function() {
|
RenderFeature.prototype.getType = function() {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ const VectorContext = function() {
|
|||||||
/**
|
/**
|
||||||
* Render a geometry with a custom renderer.
|
* Render a geometry with a custom renderer.
|
||||||
*
|
*
|
||||||
* @param {ol.geom.SimpleGeometry} geometry Geometry.
|
* @param {module:ol/geom/SimpleGeometry~SimpleGeometry} geometry Geometry.
|
||||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||||
* @param {Function} renderer Renderer.
|
* @param {Function} renderer Renderer.
|
||||||
*/
|
*/
|
||||||
@@ -26,7 +26,7 @@ VectorContext.prototype.drawCustom = function(geometry, feature, renderer) {};
|
|||||||
/**
|
/**
|
||||||
* Render a geometry.
|
* Render a geometry.
|
||||||
*
|
*
|
||||||
* @param {ol.geom.Geometry} geometry The geometry to render.
|
* @param {module:ol/geom/Geometry~Geometry} geometry The geometry to render.
|
||||||
*/
|
*/
|
||||||
VectorContext.prototype.drawGeometry = function(geometry) {};
|
VectorContext.prototype.drawGeometry = function(geometry) {};
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@ VectorContext.prototype.setStyle = function(style) {};
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.Circle} circleGeometry Circle geometry.
|
* @param {module:ol/geom/Circle~Circle} circleGeometry Circle geometry.
|
||||||
* @param {ol.Feature} feature Feature.
|
* @param {ol.Feature} feature Feature.
|
||||||
*/
|
*/
|
||||||
VectorContext.prototype.drawCircle = function(circleGeometry, feature) {};
|
VectorContext.prototype.drawCircle = function(circleGeometry, feature) {};
|
||||||
@@ -54,7 +54,7 @@ VectorContext.prototype.drawFeature = function(feature, style) {};
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.GeometryCollection} geometryCollectionGeometry Geometry
|
* @param {module:ol/geom/GeometryCollection~GeometryCollection} geometryCollectionGeometry Geometry
|
||||||
* collection.
|
* collection.
|
||||||
* @param {ol.Feature} feature Feature.
|
* @param {ol.Feature} feature Feature.
|
||||||
*/
|
*/
|
||||||
@@ -62,7 +62,7 @@ VectorContext.prototype.drawGeometryCollection = function(geometryCollectionGeom
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.LineString|ol.render.Feature} lineStringGeometry Line
|
* @param {module:ol/geom/LineString~LineString|ol.render.Feature} lineStringGeometry Line
|
||||||
* string geometry.
|
* string geometry.
|
||||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||||
*/
|
*/
|
||||||
@@ -70,7 +70,7 @@ VectorContext.prototype.drawLineString = function(lineStringGeometry, feature) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.MultiLineString|ol.render.Feature} multiLineStringGeometry
|
* @param {module:ol/geom/MultiLineString~MultiLineString|ol.render.Feature} multiLineStringGeometry
|
||||||
* MultiLineString geometry.
|
* MultiLineString geometry.
|
||||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||||
*/
|
*/
|
||||||
@@ -78,7 +78,7 @@ VectorContext.prototype.drawMultiLineString = function(multiLineStringGeometry,
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.MultiPoint|ol.render.Feature} multiPointGeometry MultiPoint
|
* @param {module:ol/geom/MultiPoint~MultiPoint|ol.render.Feature} multiPointGeometry MultiPoint
|
||||||
* geometry.
|
* geometry.
|
||||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||||
*/
|
*/
|
||||||
@@ -86,21 +86,21 @@ VectorContext.prototype.drawMultiPoint = function(multiPointGeometry, feature) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.MultiPolygon} multiPolygonGeometry MultiPolygon geometry.
|
* @param {module:ol/geom/MultiPolygon~MultiPolygon} multiPolygonGeometry MultiPolygon geometry.
|
||||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||||
*/
|
*/
|
||||||
VectorContext.prototype.drawMultiPolygon = function(multiPolygonGeometry, feature) {};
|
VectorContext.prototype.drawMultiPolygon = function(multiPolygonGeometry, feature) {};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.Point|ol.render.Feature} pointGeometry Point geometry.
|
* @param {module:ol/geom/Point~Point|ol.render.Feature} pointGeometry Point geometry.
|
||||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||||
*/
|
*/
|
||||||
VectorContext.prototype.drawPoint = function(pointGeometry, feature) {};
|
VectorContext.prototype.drawPoint = function(pointGeometry, feature) {};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.Polygon|ol.render.Feature} polygonGeometry Polygon
|
* @param {module:ol/geom/Polygon~Polygon|ol.render.Feature} polygonGeometry Polygon
|
||||||
* geometry.
|
* geometry.
|
||||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||||
*/
|
*/
|
||||||
@@ -108,7 +108,7 @@ VectorContext.prototype.drawPolygon = function(polygonGeometry, feature) {};
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.Geometry|ol.render.Feature} geometry Geometry.
|
* @param {module:ol/geom/Geometry~Geometry|ol.render.Feature} geometry Geometry.
|
||||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||||
*/
|
*/
|
||||||
VectorContext.prototype.drawText = function(geometry, feature) {};
|
VectorContext.prototype.drawText = function(geometry, feature) {};
|
||||||
|
|||||||
@@ -394,7 +394,7 @@ CanvasImmediateRenderer.prototype.drawRings_ = function(flatCoordinates, offset,
|
|||||||
* Render a circle geometry into the canvas. Rendering is immediate and uses
|
* Render a circle geometry into the canvas. Rendering is immediate and uses
|
||||||
* the current fill and stroke styles.
|
* the current fill and stroke styles.
|
||||||
*
|
*
|
||||||
* @param {ol.geom.Circle} geometry Circle geometry.
|
* @param {module:ol/geom/Circle~Circle} geometry Circle geometry.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -450,7 +450,7 @@ CanvasImmediateRenderer.prototype.setStyle = function(style) {
|
|||||||
* Render a geometry into the canvas. Call
|
* Render a geometry into the canvas. Call
|
||||||
* {@link ol.render.canvas.Immediate#setStyle} first to set the rendering style.
|
* {@link ol.render.canvas.Immediate#setStyle} first to set the rendering style.
|
||||||
*
|
*
|
||||||
* @param {ol.geom.Geometry|ol.render.Feature} geometry The geometry to render.
|
* @param {module:ol/geom/Geometry~Geometry|ol.render.Feature} geometry The geometry to render.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -458,28 +458,28 @@ CanvasImmediateRenderer.prototype.drawGeometry = function(geometry) {
|
|||||||
const type = geometry.getType();
|
const type = geometry.getType();
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case GeometryType.POINT:
|
case GeometryType.POINT:
|
||||||
this.drawPoint(/** @type {ol.geom.Point} */ (geometry));
|
this.drawPoint(/** @type {module:ol/geom/Point~Point} */ (geometry));
|
||||||
break;
|
break;
|
||||||
case GeometryType.LINE_STRING:
|
case GeometryType.LINE_STRING:
|
||||||
this.drawLineString(/** @type {ol.geom.LineString} */ (geometry));
|
this.drawLineString(/** @type {module:ol/geom/LineString~LineString} */ (geometry));
|
||||||
break;
|
break;
|
||||||
case GeometryType.POLYGON:
|
case GeometryType.POLYGON:
|
||||||
this.drawPolygon(/** @type {ol.geom.Polygon} */ (geometry));
|
this.drawPolygon(/** @type {module:ol/geom/Polygon~Polygon} */ (geometry));
|
||||||
break;
|
break;
|
||||||
case GeometryType.MULTI_POINT:
|
case GeometryType.MULTI_POINT:
|
||||||
this.drawMultiPoint(/** @type {ol.geom.MultiPoint} */ (geometry));
|
this.drawMultiPoint(/** @type {module:ol/geom/MultiPoint~MultiPoint} */ (geometry));
|
||||||
break;
|
break;
|
||||||
case GeometryType.MULTI_LINE_STRING:
|
case GeometryType.MULTI_LINE_STRING:
|
||||||
this.drawMultiLineString(/** @type {ol.geom.MultiLineString} */ (geometry));
|
this.drawMultiLineString(/** @type {module:ol/geom/MultiLineString~MultiLineString} */ (geometry));
|
||||||
break;
|
break;
|
||||||
case GeometryType.MULTI_POLYGON:
|
case GeometryType.MULTI_POLYGON:
|
||||||
this.drawMultiPolygon(/** @type {ol.geom.MultiPolygon} */ (geometry));
|
this.drawMultiPolygon(/** @type {module:ol/geom/MultiPolygon~MultiPolygon} */ (geometry));
|
||||||
break;
|
break;
|
||||||
case GeometryType.GEOMETRY_COLLECTION:
|
case GeometryType.GEOMETRY_COLLECTION:
|
||||||
this.drawGeometryCollection(/** @type {ol.geom.GeometryCollection} */ (geometry));
|
this.drawGeometryCollection(/** @type {module:ol/geom/GeometryCollection~GeometryCollection} */ (geometry));
|
||||||
break;
|
break;
|
||||||
case GeometryType.CIRCLE:
|
case GeometryType.CIRCLE:
|
||||||
this.drawCircle(/** @type {ol.geom.Circle} */ (geometry));
|
this.drawCircle(/** @type {module:ol/geom/Circle~Circle} */ (geometry));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
@@ -511,7 +511,7 @@ CanvasImmediateRenderer.prototype.drawFeature = function(feature, style) {
|
|||||||
* Render a GeometryCollection to the canvas. Rendering is immediate and
|
* Render a GeometryCollection to the canvas. Rendering is immediate and
|
||||||
* uses the current styles appropriate for each geometry in the collection.
|
* uses the current styles appropriate for each geometry in the collection.
|
||||||
*
|
*
|
||||||
* @param {ol.geom.GeometryCollection} geometry Geometry collection.
|
* @param {module:ol/geom/GeometryCollection~GeometryCollection} geometry Geometry collection.
|
||||||
* @override
|
* @override
|
||||||
*/
|
*/
|
||||||
CanvasImmediateRenderer.prototype.drawGeometryCollection = function(geometry) {
|
CanvasImmediateRenderer.prototype.drawGeometryCollection = function(geometry) {
|
||||||
@@ -526,7 +526,7 @@ CanvasImmediateRenderer.prototype.drawGeometryCollection = function(geometry) {
|
|||||||
* Render a Point geometry into the canvas. Rendering is immediate and uses
|
* Render a Point geometry into the canvas. Rendering is immediate and uses
|
||||||
* the current style.
|
* the current style.
|
||||||
*
|
*
|
||||||
* @param {ol.geom.Point|ol.render.Feature} geometry Point geometry.
|
* @param {module:ol/geom/Point~Point|ol.render.Feature} geometry Point geometry.
|
||||||
* @override
|
* @override
|
||||||
*/
|
*/
|
||||||
CanvasImmediateRenderer.prototype.drawPoint = function(geometry) {
|
CanvasImmediateRenderer.prototype.drawPoint = function(geometry) {
|
||||||
@@ -545,7 +545,7 @@ CanvasImmediateRenderer.prototype.drawPoint = function(geometry) {
|
|||||||
* Render a MultiPoint geometry into the canvas. Rendering is immediate and
|
* Render a MultiPoint geometry into the canvas. Rendering is immediate and
|
||||||
* uses the current style.
|
* uses the current style.
|
||||||
*
|
*
|
||||||
* @param {ol.geom.MultiPoint|ol.render.Feature} geometry MultiPoint geometry.
|
* @param {module:ol/geom/MultiPoint~MultiPoint|ol.render.Feature} geometry MultiPoint geometry.
|
||||||
* @override
|
* @override
|
||||||
*/
|
*/
|
||||||
CanvasImmediateRenderer.prototype.drawMultiPoint = function(geometry) {
|
CanvasImmediateRenderer.prototype.drawMultiPoint = function(geometry) {
|
||||||
@@ -564,7 +564,7 @@ CanvasImmediateRenderer.prototype.drawMultiPoint = function(geometry) {
|
|||||||
* Render a LineString into the canvas. Rendering is immediate and uses
|
* Render a LineString into the canvas. Rendering is immediate and uses
|
||||||
* the current style.
|
* the current style.
|
||||||
*
|
*
|
||||||
* @param {ol.geom.LineString|ol.render.Feature} geometry LineString geometry.
|
* @param {module:ol/geom/LineString~LineString|ol.render.Feature} geometry LineString geometry.
|
||||||
* @override
|
* @override
|
||||||
*/
|
*/
|
||||||
CanvasImmediateRenderer.prototype.drawLineString = function(geometry) {
|
CanvasImmediateRenderer.prototype.drawLineString = function(geometry) {
|
||||||
@@ -591,7 +591,7 @@ CanvasImmediateRenderer.prototype.drawLineString = function(geometry) {
|
|||||||
* Render a MultiLineString geometry into the canvas. Rendering is immediate
|
* Render a MultiLineString geometry into the canvas. Rendering is immediate
|
||||||
* and uses the current style.
|
* and uses the current style.
|
||||||
*
|
*
|
||||||
* @param {ol.geom.MultiLineString|ol.render.Feature} geometry MultiLineString
|
* @param {module:ol/geom/MultiLineString~MultiLineString|ol.render.Feature} geometry MultiLineString
|
||||||
* geometry.
|
* geometry.
|
||||||
* @override
|
* @override
|
||||||
*/
|
*/
|
||||||
@@ -624,7 +624,7 @@ CanvasImmediateRenderer.prototype.drawMultiLineString = function(geometry) {
|
|||||||
* Render a Polygon geometry into the canvas. Rendering is immediate and uses
|
* Render a Polygon geometry into the canvas. Rendering is immediate and uses
|
||||||
* the current style.
|
* the current style.
|
||||||
*
|
*
|
||||||
* @param {ol.geom.Polygon|ol.render.Feature} geometry Polygon geometry.
|
* @param {module:ol/geom/Polygon~Polygon|ol.render.Feature} geometry Polygon geometry.
|
||||||
* @override
|
* @override
|
||||||
*/
|
*/
|
||||||
CanvasImmediateRenderer.prototype.drawPolygon = function(geometry) {
|
CanvasImmediateRenderer.prototype.drawPolygon = function(geometry) {
|
||||||
@@ -659,7 +659,7 @@ CanvasImmediateRenderer.prototype.drawPolygon = function(geometry) {
|
|||||||
/**
|
/**
|
||||||
* Render MultiPolygon geometry into the canvas. Rendering is immediate and
|
* Render MultiPolygon geometry into the canvas. Rendering is immediate and
|
||||||
* uses the current style.
|
* uses the current style.
|
||||||
* @param {ol.geom.MultiPolygon} geometry MultiPolygon geometry.
|
* @param {module:ol/geom/MultiPolygon~MultiPolygon} geometry MultiPolygon geometry.
|
||||||
* @override
|
* @override
|
||||||
*/
|
*/
|
||||||
CanvasImmediateRenderer.prototype.drawMultiPolygon = function(geometry) {
|
CanvasImmediateRenderer.prototype.drawMultiPolygon = function(geometry) {
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ CanvasPolygonReplay.prototype.finish = function() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @param {ol.geom.Geometry|ol.render.Feature} geometry Geometry.
|
* @param {module:ol/geom/Geometry~Geometry|ol.render.Feature} geometry Geometry.
|
||||||
*/
|
*/
|
||||||
CanvasPolygonReplay.prototype.setFillStrokeStyles_ = function(geometry) {
|
CanvasPolygonReplay.prototype.setFillStrokeStyles_ = function(geometry) {
|
||||||
const state = this.state;
|
const state = this.state;
|
||||||
|
|||||||
@@ -407,7 +407,7 @@ CanvasReplay.prototype.drawCustom = function(geometry, feature, renderer) {
|
|||||||
let flatCoordinates, replayEnd, replayEnds, replayEndss;
|
let flatCoordinates, replayEnd, replayEnds, replayEndss;
|
||||||
let offset;
|
let offset;
|
||||||
if (type == GeometryType.MULTI_POLYGON) {
|
if (type == GeometryType.MULTI_POLYGON) {
|
||||||
geometry = /** @type {ol.geom.MultiPolygon} */ (geometry);
|
geometry = /** @type {module:ol/geom/MultiPolygon~MultiPolygon} */ (geometry);
|
||||||
flatCoordinates = geometry.getOrientedFlatCoordinates();
|
flatCoordinates = geometry.getOrientedFlatCoordinates();
|
||||||
replayEndss = [];
|
replayEndss = [];
|
||||||
const endss = geometry.getEndss();
|
const endss = geometry.getEndss();
|
||||||
@@ -422,10 +422,10 @@ CanvasReplay.prototype.drawCustom = function(geometry, feature, renderer) {
|
|||||||
} else if (type == GeometryType.POLYGON || type == GeometryType.MULTI_LINE_STRING) {
|
} else if (type == GeometryType.POLYGON || type == GeometryType.MULTI_LINE_STRING) {
|
||||||
replayEnds = [];
|
replayEnds = [];
|
||||||
flatCoordinates = (type == GeometryType.POLYGON) ?
|
flatCoordinates = (type == GeometryType.POLYGON) ?
|
||||||
/** @type {ol.geom.Polygon} */ (geometry).getOrientedFlatCoordinates() :
|
/** @type {module:ol/geom/Polygon~Polygon} */ (geometry).getOrientedFlatCoordinates() :
|
||||||
geometry.getFlatCoordinates();
|
geometry.getFlatCoordinates();
|
||||||
offset = this.drawCustomCoordinates_(flatCoordinates, 0,
|
offset = this.drawCustomCoordinates_(flatCoordinates, 0,
|
||||||
/** @type {ol.geom.Polygon|ol.geom.MultiLineString} */ (geometry).getEnds(),
|
/** @type {module:ol/geom/Polygon~Polygon|module:ol/geom/MultiLineString~MultiLineString} */ (geometry).getEnds(),
|
||||||
stride, replayEnds);
|
stride, replayEnds);
|
||||||
this.instructions.push([CanvasInstruction.CUSTOM,
|
this.instructions.push([CanvasInstruction.CUSTOM,
|
||||||
replayBegin, replayEnds, geometry, renderer, inflateCoordinatesArray]);
|
replayBegin, replayEnds, geometry, renderer, inflateCoordinatesArray]);
|
||||||
@@ -448,7 +448,7 @@ CanvasReplay.prototype.drawCustom = function(geometry, feature, renderer) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @protected
|
* @protected
|
||||||
* @param {ol.geom.Geometry|ol.render.Feature} geometry Geometry.
|
* @param {module:ol/geom/Geometry~Geometry|ol.render.Feature} geometry Geometry.
|
||||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||||
*/
|
*/
|
||||||
CanvasReplay.prototype.beginGeometry = function(geometry, feature) {
|
CanvasReplay.prototype.beginGeometry = function(geometry, feature) {
|
||||||
@@ -638,7 +638,7 @@ CanvasReplay.prototype.replay_ = function(
|
|||||||
case CanvasInstruction.CUSTOM:
|
case CanvasInstruction.CUSTOM:
|
||||||
d = /** @type {number} */ (instruction[1]);
|
d = /** @type {number} */ (instruction[1]);
|
||||||
dd = instruction[2];
|
dd = instruction[2];
|
||||||
const geometry = /** @type {ol.geom.SimpleGeometry} */ (instruction[3]);
|
const geometry = /** @type {module:ol/geom/SimpleGeometry~SimpleGeometry} */ (instruction[3]);
|
||||||
const renderer = instruction[4];
|
const renderer = instruction[4];
|
||||||
const fn = instruction.length == 6 ? instruction[5] : undefined;
|
const fn = instruction.length == 6 ? instruction[5] : undefined;
|
||||||
state.geometry = geometry;
|
state.geometry = geometry;
|
||||||
@@ -967,7 +967,7 @@ CanvasReplay.prototype.setFillStrokeStyle = function(fillStyle, strokeStyle) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.CanvasFillStrokeState} state State.
|
* @param {ol.CanvasFillStrokeState} state State.
|
||||||
* @param {ol.geom.Geometry|ol.render.Feature} geometry Geometry.
|
* @param {module:ol/geom/Geometry~Geometry|ol.render.Feature} geometry Geometry.
|
||||||
* @return {Array.<*>} Fill instruction.
|
* @return {Array.<*>} Fill instruction.
|
||||||
*/
|
*/
|
||||||
CanvasReplay.prototype.createFill = function(state, geometry) {
|
CanvasReplay.prototype.createFill = function(state, geometry) {
|
||||||
@@ -1005,8 +1005,8 @@ CanvasReplay.prototype.createStroke = function(state) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.CanvasFillStrokeState} state State.
|
* @param {ol.CanvasFillStrokeState} state State.
|
||||||
* @param {function(this:ol.render.canvas.Replay, ol.CanvasFillStrokeState, (ol.geom.Geometry|ol.render.Feature)):Array.<*>} createFill Create fill.
|
* @param {function(this:ol.render.canvas.Replay, ol.CanvasFillStrokeState, (module:ol/geom/Geometry~Geometry|ol.render.Feature)):Array.<*>} createFill Create fill.
|
||||||
* @param {ol.geom.Geometry|ol.render.Feature} geometry Geometry.
|
* @param {module:ol/geom/Geometry~Geometry|ol.render.Feature} geometry Geometry.
|
||||||
*/
|
*/
|
||||||
CanvasReplay.prototype.updateFillStyle = function(state, createFill, geometry) {
|
CanvasReplay.prototype.updateFillStyle = function(state, createFill, geometry) {
|
||||||
const fillStyle = state.fillStyle;
|
const fillStyle = state.fillStyle;
|
||||||
@@ -1053,7 +1053,7 @@ CanvasReplay.prototype.updateStrokeStyle = function(state, applyStroke) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.geom.Geometry|ol.render.Feature} geometry Geometry.
|
* @param {module:ol/geom/Geometry~Geometry|ol.render.Feature} geometry Geometry.
|
||||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||||
*/
|
*/
|
||||||
CanvasReplay.prototype.endGeometry = function(geometry, feature) {
|
CanvasReplay.prototype.endGeometry = function(geometry, feature) {
|
||||||
|
|||||||
@@ -226,24 +226,24 @@ CanvasTextReplay.prototype.drawText = function(geometry, feature) {
|
|||||||
end = flatCoordinates.length;
|
end = flatCoordinates.length;
|
||||||
break;
|
break;
|
||||||
case GeometryType.LINE_STRING:
|
case GeometryType.LINE_STRING:
|
||||||
flatCoordinates = /** @type {ol.geom.LineString} */ (geometry).getFlatMidpoint();
|
flatCoordinates = /** @type {module:ol/geom/LineString~LineString} */ (geometry).getFlatMidpoint();
|
||||||
break;
|
break;
|
||||||
case GeometryType.CIRCLE:
|
case GeometryType.CIRCLE:
|
||||||
flatCoordinates = /** @type {ol.geom.Circle} */ (geometry).getCenter();
|
flatCoordinates = /** @type {module:ol/geom/Circle~Circle} */ (geometry).getCenter();
|
||||||
break;
|
break;
|
||||||
case GeometryType.MULTI_LINE_STRING:
|
case GeometryType.MULTI_LINE_STRING:
|
||||||
flatCoordinates = /** @type {ol.geom.MultiLineString} */ (geometry).getFlatMidpoints();
|
flatCoordinates = /** @type {module:ol/geom/MultiLineString~MultiLineString} */ (geometry).getFlatMidpoints();
|
||||||
end = flatCoordinates.length;
|
end = flatCoordinates.length;
|
||||||
break;
|
break;
|
||||||
case GeometryType.POLYGON:
|
case GeometryType.POLYGON:
|
||||||
flatCoordinates = /** @type {ol.geom.Polygon} */ (geometry).getFlatInteriorPoint();
|
flatCoordinates = /** @type {module:ol/geom/Polygon~Polygon} */ (geometry).getFlatInteriorPoint();
|
||||||
if (!textState.overflow && flatCoordinates[2] / this.resolution < width) {
|
if (!textState.overflow && flatCoordinates[2] / this.resolution < width) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
stride = 3;
|
stride = 3;
|
||||||
break;
|
break;
|
||||||
case GeometryType.MULTI_POLYGON:
|
case GeometryType.MULTI_POLYGON:
|
||||||
const interiorPoints = /** @type {ol.geom.MultiPolygon} */ (geometry).getFlatInteriorPoints();
|
const interiorPoints = /** @type {module:ol/geom/MultiPolygon~MultiPolygon} */ (geometry).getFlatInteriorPoints();
|
||||||
flatCoordinates = [];
|
flatCoordinates = [];
|
||||||
for (i = 0, ii = interiorPoints.length; i < ii; i += 3) {
|
for (i = 0, ii = interiorPoints.length; i < ii; i += 3) {
|
||||||
if (textState.overflow || interiorPoints[i + 2] / this.resolution >= width) {
|
if (textState.overflow || interiorPoints[i + 2] / this.resolution >= width) {
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ inherits(WebGLImmediateRenderer, VectorContext);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.render.webgl.ReplayGroup} replayGroup Replay group.
|
* @param {ol.render.webgl.ReplayGroup} replayGroup Replay group.
|
||||||
* @param {ol.geom.Geometry|ol.render.Feature} geometry Geometry.
|
* @param {module:ol/geom/Geometry~Geometry|ol.render.Feature} geometry Geometry.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
WebGLImmediateRenderer.prototype.drawText_ = function(replayGroup, geometry) {
|
WebGLImmediateRenderer.prototype.drawText_ = function(replayGroup, geometry) {
|
||||||
@@ -130,7 +130,7 @@ WebGLImmediateRenderer.prototype.setStyle = function(style) {
|
|||||||
* Render a geometry into the canvas. Call
|
* Render a geometry into the canvas. Call
|
||||||
* {@link ol.render.webgl.Immediate#setStyle} first to set the rendering style.
|
* {@link ol.render.webgl.Immediate#setStyle} first to set the rendering style.
|
||||||
*
|
*
|
||||||
* @param {ol.geom.Geometry|ol.render.Feature} geometry The geometry to render.
|
* @param {module:ol/geom/Geometry~Geometry|ol.render.Feature} geometry The geometry to render.
|
||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -138,28 +138,28 @@ WebGLImmediateRenderer.prototype.drawGeometry = function(geometry) {
|
|||||||
const type = geometry.getType();
|
const type = geometry.getType();
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case GeometryType.POINT:
|
case GeometryType.POINT:
|
||||||
this.drawPoint(/** @type {ol.geom.Point} */ (geometry), null);
|
this.drawPoint(/** @type {module:ol/geom/Point~Point} */ (geometry), null);
|
||||||
break;
|
break;
|
||||||
case GeometryType.LINE_STRING:
|
case GeometryType.LINE_STRING:
|
||||||
this.drawLineString(/** @type {ol.geom.LineString} */ (geometry), null);
|
this.drawLineString(/** @type {module:ol/geom/LineString~LineString} */ (geometry), null);
|
||||||
break;
|
break;
|
||||||
case GeometryType.POLYGON:
|
case GeometryType.POLYGON:
|
||||||
this.drawPolygon(/** @type {ol.geom.Polygon} */ (geometry), null);
|
this.drawPolygon(/** @type {module:ol/geom/Polygon~Polygon} */ (geometry), null);
|
||||||
break;
|
break;
|
||||||
case GeometryType.MULTI_POINT:
|
case GeometryType.MULTI_POINT:
|
||||||
this.drawMultiPoint(/** @type {ol.geom.MultiPoint} */ (geometry), null);
|
this.drawMultiPoint(/** @type {module:ol/geom/MultiPoint~MultiPoint} */ (geometry), null);
|
||||||
break;
|
break;
|
||||||
case GeometryType.MULTI_LINE_STRING:
|
case GeometryType.MULTI_LINE_STRING:
|
||||||
this.drawMultiLineString(/** @type {ol.geom.MultiLineString} */ (geometry), null);
|
this.drawMultiLineString(/** @type {module:ol/geom/MultiLineString~MultiLineString} */ (geometry), null);
|
||||||
break;
|
break;
|
||||||
case GeometryType.MULTI_POLYGON:
|
case GeometryType.MULTI_POLYGON:
|
||||||
this.drawMultiPolygon(/** @type {ol.geom.MultiPolygon} */ (geometry), null);
|
this.drawMultiPolygon(/** @type {module:ol/geom/MultiPolygon~MultiPolygon} */ (geometry), null);
|
||||||
break;
|
break;
|
||||||
case GeometryType.GEOMETRY_COLLECTION:
|
case GeometryType.GEOMETRY_COLLECTION:
|
||||||
this.drawGeometryCollection(/** @type {ol.geom.GeometryCollection} */ (geometry), null);
|
this.drawGeometryCollection(/** @type {module:ol/geom/GeometryCollection~GeometryCollection} */ (geometry), null);
|
||||||
break;
|
break;
|
||||||
case GeometryType.CIRCLE:
|
case GeometryType.CIRCLE:
|
||||||
this.drawCircle(/** @type {ol.geom.Circle} */ (geometry), null);
|
this.drawCircle(/** @type {module:ol/geom/Circle~Circle} */ (geometry), null);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// pass
|
// pass
|
||||||
|
|||||||
@@ -136,20 +136,20 @@ WebGLTextReplay.prototype.drawText = function(geometry, feature) {
|
|||||||
stride = geometry.getStride();
|
stride = geometry.getStride();
|
||||||
break;
|
break;
|
||||||
case GeometryType.CIRCLE:
|
case GeometryType.CIRCLE:
|
||||||
flatCoordinates = /** @type {ol.geom.Circle} */ (geometry).getCenter();
|
flatCoordinates = /** @type {module:ol/geom/Circle~Circle} */ (geometry).getCenter();
|
||||||
break;
|
break;
|
||||||
case GeometryType.LINE_STRING:
|
case GeometryType.LINE_STRING:
|
||||||
flatCoordinates = /** @type {ol.geom.LineString} */ (geometry).getFlatMidpoint();
|
flatCoordinates = /** @type {module:ol/geom/LineString~LineString} */ (geometry).getFlatMidpoint();
|
||||||
break;
|
break;
|
||||||
case GeometryType.MULTI_LINE_STRING:
|
case GeometryType.MULTI_LINE_STRING:
|
||||||
flatCoordinates = /** @type {ol.geom.MultiLineString} */ (geometry).getFlatMidpoints();
|
flatCoordinates = /** @type {module:ol/geom/MultiLineString~MultiLineString} */ (geometry).getFlatMidpoints();
|
||||||
end = flatCoordinates.length;
|
end = flatCoordinates.length;
|
||||||
break;
|
break;
|
||||||
case GeometryType.POLYGON:
|
case GeometryType.POLYGON:
|
||||||
flatCoordinates = /** @type {ol.geom.Polygon} */ (geometry).getFlatInteriorPoint();
|
flatCoordinates = /** @type {module:ol/geom/Polygon~Polygon} */ (geometry).getFlatInteriorPoint();
|
||||||
break;
|
break;
|
||||||
case GeometryType.MULTI_POLYGON:
|
case GeometryType.MULTI_POLYGON:
|
||||||
flatCoordinates = /** @type {ol.geom.MultiPolygon} */ (geometry).getFlatInteriorPoints();
|
flatCoordinates = /** @type {module:ol/geom/MultiPolygon~MultiPolygon} */ (geometry).getFlatInteriorPoints();
|
||||||
end = flatCoordinates.length;
|
end = flatCoordinates.length;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ const SIMPLIFY_TOLERANCE = 0.5;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<ol.geom.GeometryType,
|
* @type {Object.<module:ol/geom/GeometryType~GeometryType,
|
||||||
* function(ol.render.ReplayGroup, ol.geom.Geometry,
|
* function(ol.render.ReplayGroup, module:ol/geom/Geometry~Geometry,
|
||||||
* ol.style.Style, Object)>}
|
* ol.style.Style, Object)>}
|
||||||
*/
|
*/
|
||||||
const GEOMETRY_RENDERERS = {
|
const GEOMETRY_RENDERERS = {
|
||||||
@@ -65,7 +65,7 @@ export function getTolerance(resolution, pixelRatio) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.render.ReplayGroup} replayGroup Replay group.
|
* @param {ol.render.ReplayGroup} replayGroup Replay group.
|
||||||
* @param {ol.geom.Circle} geometry Geometry.
|
* @param {module:ol/geom/Circle~Circle} geometry Geometry.
|
||||||
* @param {ol.style.Style} style Style.
|
* @param {ol.style.Style} style Style.
|
||||||
* @param {ol.Feature} feature Feature.
|
* @param {ol.Feature} feature Feature.
|
||||||
*/
|
*/
|
||||||
@@ -142,26 +142,26 @@ function renderFeatureInternal(replayGroup, feature, style, squaredTolerance) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.render.ReplayGroup} replayGroup Replay group.
|
* @param {ol.render.ReplayGroup} replayGroup Replay group.
|
||||||
* @param {ol.geom.Geometry} geometry Geometry.
|
* @param {module:ol/geom/Geometry~Geometry} geometry Geometry.
|
||||||
* @param {ol.style.Style} style Style.
|
* @param {ol.style.Style} style Style.
|
||||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||||
*/
|
*/
|
||||||
function renderGeometry(replayGroup, geometry, style, feature) {
|
function renderGeometry(replayGroup, geometry, style, feature) {
|
||||||
if (geometry.getType() == GeometryType.GEOMETRY_COLLECTION) {
|
if (geometry.getType() == GeometryType.GEOMETRY_COLLECTION) {
|
||||||
const geometries = /** @type {ol.geom.GeometryCollection} */ (geometry).getGeometries();
|
const geometries = /** @type {module:ol/geom/GeometryCollection~GeometryCollection} */ (geometry).getGeometries();
|
||||||
for (let i = 0, ii = geometries.length; i < ii; ++i) {
|
for (let i = 0, ii = geometries.length; i < ii; ++i) {
|
||||||
renderGeometry(replayGroup, geometries[i], style, feature);
|
renderGeometry(replayGroup, geometries[i], style, feature);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const replay = replayGroup.getReplay(style.getZIndex(), ReplayType.DEFAULT);
|
const replay = replayGroup.getReplay(style.getZIndex(), ReplayType.DEFAULT);
|
||||||
replay.drawCustom(/** @type {ol.geom.SimpleGeometry} */ (geometry), feature, style.getRenderer());
|
replay.drawCustom(/** @type {module:ol/geom/SimpleGeometry~SimpleGeometry} */ (geometry), feature, style.getRenderer());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.render.ReplayGroup} replayGroup Replay group.
|
* @param {ol.render.ReplayGroup} replayGroup Replay group.
|
||||||
* @param {ol.geom.GeometryCollection} geometry Geometry.
|
* @param {module:ol/geom/GeometryCollection~GeometryCollection} geometry Geometry.
|
||||||
* @param {ol.style.Style} style Style.
|
* @param {ol.style.Style} style Style.
|
||||||
* @param {ol.Feature} feature Feature.
|
* @param {ol.Feature} feature Feature.
|
||||||
*/
|
*/
|
||||||
@@ -178,7 +178,7 @@ function renderGeometryCollectionGeometry(replayGroup, geometry, style, feature)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.render.ReplayGroup} replayGroup Replay group.
|
* @param {ol.render.ReplayGroup} replayGroup Replay group.
|
||||||
* @param {ol.geom.LineString|ol.render.Feature} geometry Geometry.
|
* @param {module:ol/geom/LineString~LineString|ol.render.Feature} geometry Geometry.
|
||||||
* @param {ol.style.Style} style Style.
|
* @param {ol.style.Style} style Style.
|
||||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||||
*/
|
*/
|
||||||
@@ -200,7 +200,7 @@ function renderLineStringGeometry(replayGroup, geometry, style, feature) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.render.ReplayGroup} replayGroup Replay group.
|
* @param {ol.render.ReplayGroup} replayGroup Replay group.
|
||||||
* @param {ol.geom.MultiLineString|ol.render.Feature} geometry Geometry.
|
* @param {module:ol/geom/MultiLineString~MultiLineString|ol.render.Feature} geometry Geometry.
|
||||||
* @param {ol.style.Style} style Style.
|
* @param {ol.style.Style} style Style.
|
||||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||||
*/
|
*/
|
||||||
@@ -222,7 +222,7 @@ function renderMultiLineStringGeometry(replayGroup, geometry, style, feature) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.render.ReplayGroup} replayGroup Replay group.
|
* @param {ol.render.ReplayGroup} replayGroup Replay group.
|
||||||
* @param {ol.geom.MultiPolygon} geometry Geometry.
|
* @param {module:ol/geom/MultiPolygon~MultiPolygon} geometry Geometry.
|
||||||
* @param {ol.style.Style} style Style.
|
* @param {ol.style.Style} style Style.
|
||||||
* @param {ol.Feature} feature Feature.
|
* @param {ol.Feature} feature Feature.
|
||||||
*/
|
*/
|
||||||
@@ -245,7 +245,7 @@ function renderMultiPolygonGeometry(replayGroup, geometry, style, feature) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.render.ReplayGroup} replayGroup Replay group.
|
* @param {ol.render.ReplayGroup} replayGroup Replay group.
|
||||||
* @param {ol.geom.Point|ol.render.Feature} geometry Geometry.
|
* @param {module:ol/geom/Point~Point|ol.render.Feature} geometry Geometry.
|
||||||
* @param {ol.style.Style} style Style.
|
* @param {ol.style.Style} style Style.
|
||||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||||
*/
|
*/
|
||||||
@@ -270,7 +270,7 @@ function renderPointGeometry(replayGroup, geometry, style, feature) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.render.ReplayGroup} replayGroup Replay group.
|
* @param {ol.render.ReplayGroup} replayGroup Replay group.
|
||||||
* @param {ol.geom.MultiPoint|ol.render.Feature} geometry Geometry.
|
* @param {module:ol/geom/MultiPoint~MultiPoint|ol.render.Feature} geometry Geometry.
|
||||||
* @param {ol.style.Style} style Style.
|
* @param {ol.style.Style} style Style.
|
||||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||||
*/
|
*/
|
||||||
@@ -295,7 +295,7 @@ function renderMultiPointGeometry(replayGroup, geometry, style, feature) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.render.ReplayGroup} replayGroup Replay group.
|
* @param {ol.render.ReplayGroup} replayGroup Replay group.
|
||||||
* @param {ol.geom.Polygon|ol.render.Feature} geometry Geometry.
|
* @param {module:ol/geom/Polygon~Polygon|ol.render.Feature} geometry Geometry.
|
||||||
* @param {ol.style.Style} style Style.
|
* @param {ol.style.Style} style Style.
|
||||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -51,13 +51,13 @@ const Cluster = function(options) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.Feature} feature Feature.
|
* @param {ol.Feature} feature Feature.
|
||||||
* @return {ol.geom.Point} Cluster calculation point.
|
* @return {module:ol/geom/Point~Point} Cluster calculation point.
|
||||||
* @protected
|
* @protected
|
||||||
*/
|
*/
|
||||||
this.geometryFunction = options.geometryFunction || function(feature) {
|
this.geometryFunction = options.geometryFunction || function(feature) {
|
||||||
const geometry = /** @type {ol.geom.Point} */ (feature.getGeometry());
|
const geometry = /** @type {module:ol/geom/Point~Point} */ (feature.getGeometry());
|
||||||
assert(geometry instanceof Point,
|
assert(geometry instanceof Point,
|
||||||
10); // The default `geometryFunction` can only handle `ol.geom.Point` geometries
|
10); // The default `geometryFunction` can only handle `module:ol/geom/Point~Point` geometries
|
||||||
return geometry;
|
return geometry;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ const Style = function(opt_options) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {string|ol.geom.Geometry|ol.StyleGeometryFunction}
|
* @type {string|module:ol/geom/Geometry~Geometry|ol.StyleGeometryFunction}
|
||||||
*/
|
*/
|
||||||
this.geometry_ = null;
|
this.geometry_ = null;
|
||||||
|
|
||||||
@@ -122,7 +122,7 @@ Style.prototype.setRenderer = function(renderer) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the geometry to be rendered.
|
* Get the geometry to be rendered.
|
||||||
* @return {string|ol.geom.Geometry|ol.StyleGeometryFunction}
|
* @return {string|module:ol/geom/Geometry~Geometry|ol.StyleGeometryFunction}
|
||||||
* Feature property or geometry or function that returns the geometry that will
|
* Feature property or geometry or function that returns the geometry that will
|
||||||
* be rendered with this style.
|
* be rendered with this style.
|
||||||
* @api
|
* @api
|
||||||
@@ -236,7 +236,7 @@ Style.prototype.getZIndex = function() {
|
|||||||
/**
|
/**
|
||||||
* Set a geometry that is rendered instead of the feature's geometry.
|
* Set a geometry that is rendered instead of the feature's geometry.
|
||||||
*
|
*
|
||||||
* @param {string|ol.geom.Geometry|ol.StyleGeometryFunction} geometry
|
* @param {string|module:ol/geom/Geometry~Geometry|ol.StyleGeometryFunction} geometry
|
||||||
* Feature property or geometry or function returning a geometry to render
|
* Feature property or geometry or function returning a geometry to render
|
||||||
* for this style.
|
* for this style.
|
||||||
* @api
|
* @api
|
||||||
@@ -246,13 +246,13 @@ Style.prototype.setGeometry = function(geometry) {
|
|||||||
this.geometryFunction_ = geometry;
|
this.geometryFunction_ = geometry;
|
||||||
} else if (typeof geometry === 'string') {
|
} else if (typeof geometry === 'string') {
|
||||||
this.geometryFunction_ = function(feature) {
|
this.geometryFunction_ = function(feature) {
|
||||||
return /** @type {ol.geom.Geometry} */ (feature.get(geometry));
|
return /** @type {module:ol/geom/Geometry~Geometry} */ (feature.get(geometry));
|
||||||
};
|
};
|
||||||
} else if (!geometry) {
|
} else if (!geometry) {
|
||||||
this.geometryFunction_ = defaultGeometryFunction;
|
this.geometryFunction_ = defaultGeometryFunction;
|
||||||
} else if (geometry !== undefined) {
|
} else if (geometry !== undefined) {
|
||||||
this.geometryFunction_ = function() {
|
this.geometryFunction_ = function() {
|
||||||
return /** @type {ol.geom.Geometry} */ (geometry);
|
return /** @type {module:ol/geom/Geometry~Geometry} */ (geometry);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
this.geometry_ = geometry;
|
this.geometry_ = geometry;
|
||||||
@@ -346,10 +346,10 @@ export function createDefaultStyle(feature, resolution) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Default styles for editing features.
|
* Default styles for editing features.
|
||||||
* @return {Object.<ol.geom.GeometryType, Array.<ol.style.Style>>} Styles
|
* @return {Object.<module:ol/geom/GeometryType~GeometryType, Array.<ol.style.Style>>} Styles
|
||||||
*/
|
*/
|
||||||
export function createEditingStyle() {
|
export function createEditingStyle() {
|
||||||
/** @type {Object.<ol.geom.GeometryType, Array.<ol.style.Style>>} */
|
/** @type {Object.<module:ol/geom/GeometryType~GeometryType, Array.<ol.style.Style>>} */
|
||||||
const styles = {};
|
const styles = {};
|
||||||
const white = [255, 255, 255, 1];
|
const white = [255, 255, 255, 1];
|
||||||
const blue = [0, 153, 255, 1];
|
const blue = [0, 153, 255, 1];
|
||||||
@@ -419,7 +419,7 @@ export function createEditingStyle() {
|
|||||||
* Function that is called with a feature and returns its default geometry.
|
* Function that is called with a feature and returns its default geometry.
|
||||||
* @param {ol.Feature|ol.render.Feature} feature Feature to get the geometry
|
* @param {ol.Feature|ol.render.Feature} feature Feature to get the geometry
|
||||||
* for.
|
* for.
|
||||||
* @return {ol.geom.Geometry|ol.render.Feature|undefined} Geometry to render.
|
* @return {module:ol/geom/Geometry~Geometry|ol.render.Feature|undefined} Geometry to render.
|
||||||
*/
|
*/
|
||||||
function defaultGeometryFunction(feature) {
|
function defaultGeometryFunction(feature) {
|
||||||
return feature.getGeometry();
|
return feature.getGeometry();
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Text placement. One of `'point'`, `'line'`. Default is `'point'`. Note that
|
* Text placement. One of `'point'`, `'line'`. Default is `'point'`. Note that
|
||||||
* `'line'` requires the underlying geometry to be a {@link ol.geom.LineString},
|
* `'line'` requires the underlying geometry to be a {@link module:ol/geom/LineString~LineString},
|
||||||
* {@link ol.geom.Polygon}, {@link ol.geom.MultiLineString} or
|
* {@link module:ol/geom/Polygon~Polygon}, {@link module:ol/geom/MultiLineString~MultiLineString} or
|
||||||
* {@link ol.geom.MultiPolygon}.
|
* {@link module:ol/geom/MultiPolygon~MultiPolygon}.
|
||||||
* @enum {string}
|
* @enum {string}
|
||||||
*/
|
*/
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@@ -28,16 +28,16 @@
|
|||||||
* var white = [255, 255, 255, 1];
|
* var white = [255, 255, 255, 1];
|
||||||
* var blue = [0, 153, 255, 1];
|
* var blue = [0, 153, 255, 1];
|
||||||
* var width = 3;
|
* var width = 3;
|
||||||
* styles[ol.geom.GeometryType.POLYGON] = [
|
* styles[module:ol/geom/GeometryType~GeometryType.POLYGON] = [
|
||||||
* new ol.style.Style({
|
* new ol.style.Style({
|
||||||
* fill: new ol.style.Fill({
|
* fill: new ol.style.Fill({
|
||||||
* color: [255, 255, 255, 0.5]
|
* color: [255, 255, 255, 0.5]
|
||||||
* })
|
* })
|
||||||
* })
|
* })
|
||||||
* ];
|
* ];
|
||||||
* styles[ol.geom.GeometryType.MULTI_POLYGON] =
|
* styles[module:ol/geom/GeometryType~GeometryType.MULTI_POLYGON] =
|
||||||
* styles[ol.geom.GeometryType.POLYGON];
|
* styles[module:ol/geom/GeometryType~GeometryType.POLYGON];
|
||||||
* styles[ol.geom.GeometryType.LINE_STRING] = [
|
* styles[module:ol/geom/GeometryType~GeometryType.LINE_STRING] = [
|
||||||
* new ol.style.Style({
|
* new ol.style.Style({
|
||||||
* stroke: new ol.style.Stroke({
|
* stroke: new ol.style.Stroke({
|
||||||
* color: white,
|
* color: white,
|
||||||
@@ -51,9 +51,9 @@
|
|||||||
* })
|
* })
|
||||||
* })
|
* })
|
||||||
* ];
|
* ];
|
||||||
* styles[ol.geom.GeometryType.MULTI_LINE_STRING] =
|
* styles[module:ol/geom/GeometryType~GeometryType.MULTI_LINE_STRING] =
|
||||||
* styles[ol.geom.GeometryType.LINE_STRING];
|
* styles[module:ol/geom/GeometryType~GeometryType.LINE_STRING];
|
||||||
* styles[ol.geom.GeometryType.POINT] = [
|
* styles[module:ol/geom/GeometryType~GeometryType.POINT] = [
|
||||||
* new ol.style.Style({
|
* new ol.style.Style({
|
||||||
* image: new ol.style.Circle({
|
* image: new ol.style.Circle({
|
||||||
* radius: width * 2,
|
* radius: width * 2,
|
||||||
@@ -68,11 +68,11 @@
|
|||||||
* zIndex: Infinity
|
* zIndex: Infinity
|
||||||
* })
|
* })
|
||||||
* ];
|
* ];
|
||||||
* styles[ol.geom.GeometryType.MULTI_POINT] =
|
* styles[module:ol/geom/GeometryType~GeometryType.MULTI_POINT] =
|
||||||
* styles[ol.geom.GeometryType.POINT];
|
* styles[module:ol/geom/GeometryType~GeometryType.POINT];
|
||||||
* styles[ol.geom.GeometryType.GEOMETRY_COLLECTION] =
|
* styles[module:ol/geom/GeometryType~GeometryType.GEOMETRY_COLLECTION] =
|
||||||
* styles[ol.geom.GeometryType.POLYGON].concat(
|
* styles[module:ol/geom/GeometryType~GeometryType.POLYGON].concat(
|
||||||
* styles[ol.geom.GeometryType.POINT]
|
* styles[module:ol/geom/GeometryType~GeometryType.POINT]
|
||||||
* );
|
* );
|
||||||
*```
|
*```
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -167,8 +167,8 @@ ol.DragBoxEndConditionType;
|
|||||||
* arguments, and returns a geometry. The optional existing geometry is the
|
* arguments, and returns a geometry. The optional existing geometry is the
|
||||||
* geometry that is returned when the function is called without a second
|
* geometry that is returned when the function is called without a second
|
||||||
* argument.
|
* argument.
|
||||||
* @typedef {function(!Array.<module:ol/coordinate~Coordinate>, ol.geom.SimpleGeometry=):
|
* @typedef {function(!Array.<module:ol/coordinate~Coordinate>, module:ol/geom/SimpleGeometry~SimpleGeometry=):
|
||||||
* ol.geom.SimpleGeometry}
|
* module:ol/geom/SimpleGeometry~SimpleGeometry}
|
||||||
*/
|
*/
|
||||||
ol.DrawGeometryFunctionType;
|
ol.DrawGeometryFunctionType;
|
||||||
|
|
||||||
@@ -233,7 +233,7 @@ ol.LRUCacheEntry;
|
|||||||
/**
|
/**
|
||||||
* @typedef {{depth: (Array.<number>|undefined),
|
* @typedef {{depth: (Array.<number>|undefined),
|
||||||
* feature: ol.Feature,
|
* feature: ol.Feature,
|
||||||
* geometry: ol.geom.SimpleGeometry,
|
* geometry: module:ol/geom/SimpleGeometry~SimpleGeometry,
|
||||||
* index: (number),
|
* index: (number),
|
||||||
* segment: Array.<module:ol/extent~Extent>,
|
* segment: Array.<module:ol/extent~Extent>,
|
||||||
* featureSegments: (Array.<ol.ModifySegmentDataType>|undefined)}}
|
* featureSegments: (Array.<ol.ModifySegmentDataType>|undefined)}}
|
||||||
@@ -398,10 +398,10 @@ ol.SourceUrlTileOptions;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* A function that takes an {@link ol.Feature} as argument and returns an
|
* A function that takes an {@link ol.Feature} as argument and returns an
|
||||||
* {@link ol.geom.Geometry} that will be rendered and styled for the feature.
|
* {@link module:ol/geom/Geometry~Geometry} that will be rendered and styled for the feature.
|
||||||
*
|
*
|
||||||
* @typedef {function((ol.Feature|ol.render.Feature)):
|
* @typedef {function((ol.Feature|ol.render.Feature)):
|
||||||
* (ol.geom.Geometry|ol.render.Feature|undefined)}
|
* (module:ol/geom/Geometry~Geometry|ol.render.Feature|undefined)}
|
||||||
*/
|
*/
|
||||||
ol.StyleGeometryFunction;
|
ol.StyleGeometryFunction;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user