Compare commits
146 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
badc350746 | ||
|
|
50293200d7 | ||
|
|
b2b3d6b05c | ||
|
|
34fefe3103 | ||
|
|
27dadef8ef | ||
|
|
f456c56ddd | ||
|
|
bdb80d3368 | ||
|
|
b039e17015 | ||
|
|
bd9635f6ef | ||
|
|
a0e72c7d42 | ||
|
|
bb77fbe703 | ||
|
|
0c47890bdd | ||
|
|
2d974c6f1f | ||
|
|
d95b2bc2ae | ||
|
|
0ada02f12a | ||
|
|
786bb608b9 | ||
|
|
2342ec90aa | ||
|
|
7a05b671d8 | ||
|
|
ea9517ffd5 | ||
|
|
d84c64b3e7 | ||
|
|
017d2e4802 | ||
|
|
3b36477fc3 | ||
|
|
1baa8be269 | ||
|
|
158b54156a | ||
|
|
5752bd0028 | ||
|
|
3f98094d9d | ||
|
|
b56a7c0fa3 | ||
|
|
b7aa6c6513 | ||
|
|
1605741a92 | ||
|
|
a18da7d55a | ||
|
|
68cf960028 | ||
|
|
94c6afd65d | ||
|
|
321166849b | ||
|
|
26cc0a3ded | ||
|
|
fffcf4415c | ||
|
|
07cb678271 | ||
|
|
315cfa1033 | ||
|
|
38349d8c37 | ||
|
|
adce78e19e | ||
|
|
eb0fcdb588 | ||
|
|
161c5b0105 | ||
|
|
8ab1589f9a | ||
|
|
95533e2425 | ||
|
|
a94dff2c06 | ||
|
|
fc75fc691b | ||
|
|
b9aceb23ac | ||
|
|
f382ddf230 | ||
|
|
dbdaa73cf2 | ||
|
|
f3cd1d8dfd | ||
|
|
e5944682df | ||
|
|
147a86c867 | ||
|
|
2d08811485 | ||
|
|
fc19e3e12e | ||
|
|
a5fc8bdd25 | ||
|
|
7f8b2d2e1f | ||
|
|
80a00fce47 | ||
|
|
ee8ed5193c | ||
|
|
cc7d825a13 | ||
|
|
fd4e0f14cc | ||
|
|
85e1f11adb | ||
|
|
47c4e1a165 | ||
|
|
0bff75a067 | ||
|
|
ab81deb242 | ||
|
|
654073cd3d | ||
|
|
a354e842ab | ||
|
|
1eeea2aa4d | ||
|
|
2f92e48e93 | ||
|
|
c5b42c49d5 | ||
|
|
03d47e49ed | ||
|
|
abbfb5c653 | ||
|
|
a78c163a4f | ||
|
|
a4178d05ef | ||
|
|
dbf9048d8f | ||
|
|
824ad48488 | ||
|
|
8cd9eabe68 | ||
|
|
a50a4efeca | ||
|
|
d49be1393e | ||
|
|
a991bb21d6 | ||
|
|
df848d6673 | ||
|
|
68ce6de0ca | ||
|
|
141fe5fe49 | ||
|
|
57baa15cc3 | ||
|
|
64138bb94f | ||
|
|
62188502e9 | ||
|
|
fe86d2e7f7 | ||
|
|
69ae9d7180 | ||
|
|
adc83ba484 | ||
|
|
4012280ad4 | ||
|
|
e48c85a689 | ||
|
|
c74faaa7ca | ||
|
|
236b6832fb | ||
|
|
93b92d3990 | ||
|
|
a36ab978e7 | ||
|
|
55fb62c551 | ||
|
|
c74b9c1d55 | ||
|
|
a56ca57ac6 | ||
|
|
1aadd51c57 | ||
|
|
a1391a2083 | ||
|
|
5adf0be4a3 | ||
|
|
4c71ddb3c7 | ||
|
|
efe15402cc | ||
|
|
b3586bed8d | ||
|
|
1e332f52d6 | ||
|
|
c0f44f6d9d | ||
|
|
efe0dd7fbf | ||
|
|
219629458b | ||
|
|
b13feb0046 | ||
|
|
df293d8a2e | ||
|
|
6cfa2b22a7 | ||
|
|
8346bb7454 | ||
|
|
40486a0ecc | ||
|
|
d8efa569d9 | ||
|
|
adfb3dd229 | ||
|
|
3c0be4e611 | ||
|
|
2eb07aa081 | ||
|
|
affbf59b77 | ||
|
|
d12ef20b12 | ||
|
|
5a6502572f | ||
|
|
d7adf0b4f3 | ||
|
|
f7551623e7 | ||
|
|
6f22f1b7ac | ||
|
|
6cdfbe3116 | ||
|
|
704845e37a | ||
|
|
fd9219f035 | ||
|
|
f3786f9cff | ||
|
|
436633b990 | ||
|
|
a89ae25134 | ||
|
|
2769953204 | ||
|
|
14ead39440 | ||
|
|
39261af940 | ||
|
|
9ec623380a | ||
|
|
28104527b0 | ||
|
|
b50bc1febf | ||
|
|
c046c2a1ba | ||
|
|
bbe0a66d07 | ||
|
|
d8b290966b | ||
|
|
0edb39c8ab | ||
|
|
f0ffb48633 | ||
|
|
171195a836 | ||
|
|
45cf296ed4 | ||
|
|
b377bbac59 | ||
|
|
2767ddfdc7 | ||
|
|
cd85e30d08 | ||
|
|
139fcd7bae | ||
|
|
2a04415264 | ||
|
|
515eca797f |
@@ -30,7 +30,7 @@ To run the examples you first need to start the dev server:
|
|||||||
|
|
||||||
$ npm run serve-examples
|
$ npm run serve-examples
|
||||||
|
|
||||||
Then, load <http://localhost:5000/> in your browser.
|
Then, load <http://localhost:8080/> in your browser.
|
||||||
|
|
||||||
## Running tests
|
## Running tests
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ See the following examples for more detail on bundling OpenLayers with your appl
|
|||||||
* Using [Rollup](https://github.com/openlayers/ol-rollup)
|
* Using [Rollup](https://github.com/openlayers/ol-rollup)
|
||||||
* Using [Webpack](https://github.com/openlayers/ol-webpack)
|
* Using [Webpack](https://github.com/openlayers/ol-webpack)
|
||||||
* Using [Parcel](https://github.com/openlayers/ol-parcel)
|
* Using [Parcel](https://github.com/openlayers/ol-parcel)
|
||||||
|
* Using [Browserify](https://github.com/openlayers/ol-browserify)
|
||||||
|
|
||||||
## Supported Browsers
|
## Supported Browsers
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,17 @@
|
|||||||
## Upgrade notes
|
## Upgrade notes
|
||||||
|
|
||||||
|
### Next version
|
||||||
|
|
||||||
|
### v5.2.0
|
||||||
|
|
||||||
|
#### Removal of the `snapToPixel` option for `ol/style/Image` subclasses
|
||||||
|
|
||||||
|
The `snapToPixel` option has been removed, and the `getSnapToPixel` and `setSnapToPixel` methods are deprecated.
|
||||||
|
|
||||||
|
The renderer now snaps to integer pixels when no interaction or animation is running to get crisp rendering. During interaction or animation, it does not snap to integer pixels to avoid jitter.
|
||||||
|
|
||||||
|
When rendering with the Immediate API, symbols will no longer be snapped to integer pixels. To get crisp images, set `context.imageSmoothingEnabled = false` before rendering with the Immediate API, and `context.imageSmoothingEnabled = true` afterwards.
|
||||||
|
|
||||||
### v5.1.0
|
### v5.1.0
|
||||||
|
|
||||||
#### Geometry constructor and `setCoordinates` no longer accept `null` coordinates
|
#### Geometry constructor and `setCoordinates` no longer accept `null` coordinates
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
# 5.1.1
|
# 5.1.1
|
||||||
|
|
||||||
The 5.1.1 release is a patch to include the readme in the package. See the [5.1.0 notes](https://github.com/openlayers/openlayers/releases/tag/v5.0.3) for detail on the 5.1 release.
|
The 5.1.1 release is a patch to include the readme in the package. See the [5.1.0 notes](https://github.com/openlayers/openlayers/releases/tag/v5.1.0) for detail on the 5.1 release.
|
||||||
|
|||||||
5
changelog/v5.1.2.md
Normal file
5
changelog/v5.1.2.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
# 5.1.2
|
||||||
|
|
||||||
|
The 5.1.2 release is a patch to fix the API docs. See the [5.1.0 notes](https://github.com/openlayers/openlayers/releases/tag/v5.1.0) for detail on the 5.1 release.
|
||||||
|
|
||||||
|
* [#8413](https://github.com/openlayers/openlayers/pull/8413) - Remove extra curly in type ([@tschaub](https://github.com/tschaub))
|
||||||
6
changelog/v5.1.3.md
Normal file
6
changelog/v5.1.3.md
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
# 5.1.3
|
||||||
|
|
||||||
|
The 5.1.3 release is a patch to fix the API docs and the legacy full build. See the [5.1.0 notes](https://github.com/openlayers/openlayers/releases/tag/v5.1.0) for detail on the 5.1 release.
|
||||||
|
|
||||||
|
* [#8417](https://github.com/openlayers/openlayers/pull/8417) - Minor doc updates ([@tschaub](https://github.com/tschaub))
|
||||||
|
* [#8418](https://github.com/openlayers/openlayers/pull/8418) - Set api annotation on classdesc, not constructor ([@ahocevar](https://github.com/ahocevar))
|
||||||
86
changelog/v5.2.0.md
Normal file
86
changelog/v5.2.0.md
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
# v5.1.0
|
||||||
|
|
||||||
|
The 5.2 release adds a few new features a handful of fixes, including regressions that were reported after the 5.1 release. You should be able to upgrade without any additional work. See the one note below regarding `snapToPixel` on `ol/style/Image` and subclasses.
|
||||||
|
|
||||||
|
We're still working toward type checking with TypeScript. Until that is complete, we apologize for some flwas in the online API documentation. We're excited about the improved experience for application developers when the effort is finished, and will highlight some of the benefit in upcoming releases.
|
||||||
|
|
||||||
|
### Upgrade Notes
|
||||||
|
|
||||||
|
#### Removal of the `snapToPixel` option for `ol/style/Image` subclasses
|
||||||
|
|
||||||
|
The `snapToPixel` option has been removed, and the `getSnapToPixel` and `setSnapToPixel` methods are deprecated.
|
||||||
|
|
||||||
|
The renderer now snaps to integer pixels when no interaction or animation is running to get crisp rendering. During interaction or animation, it does not snap to integer pixels to avoid jitter.
|
||||||
|
|
||||||
|
When rendering with the Immediate API, symbols will no longer be snapped to integer pixels. To get crisp images, set `context.imageSmoothingEnabled = false` before rendering with the Immediate API, and `context.imageSmoothingEnabled = true` afterwards.
|
||||||
|
|
||||||
|
### New Features and Fixes
|
||||||
|
|
||||||
|
* [#8511](https://github.com/openlayers/openlayers/pull/8511) - Update IGN API key ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#8547](https://github.com/openlayers/openlayers/pull/8547) - Fix port number in developing doc ([@pgiraud](https://github.com/pgiraud))
|
||||||
|
* [#8546](https://github.com/openlayers/openlayers/pull/8546) - Update projection FAQ for v5 ([@ahocevar](https://github.com/ahocevar))
|
||||||
|
* [#8481](https://github.com/openlayers/openlayers/pull/8481) - Expose some internal functions ([@gberaudo](https://github.com/gberaudo))
|
||||||
|
* [#8510](https://github.com/openlayers/openlayers/pull/8510) - Fix WMTS URLs with dimensions ([@gberaudo](https://github.com/gberaudo))
|
||||||
|
* [#8524](https://github.com/openlayers/openlayers/pull/8524) - Fix compatiblity with XHTML content type ([@NeoRaider](https://github.com/NeoRaider))
|
||||||
|
* [#8532](https://github.com/openlayers/openlayers/pull/8532) - Add 'rendercomplete' event ([@ahocevar](https://github.com/ahocevar))
|
||||||
|
* [#8529](https://github.com/openlayers/openlayers/pull/8529) - Update link to base class in docs ([@TDesjardins](https://github.com/TDesjardins))
|
||||||
|
* [#8528](https://github.com/openlayers/openlayers/pull/8528) - Update link to base class in docs ([@TDesjardins](https://github.com/TDesjardins))
|
||||||
|
* [#8525](https://github.com/openlayers/openlayers/pull/8525) - Re-export Projection from ol/proj for convenience ([@tschaub](https://github.com/tschaub))
|
||||||
|
* [#8499](https://github.com/openlayers/openlayers/pull/8499) - Round center in viewState to pixels ([@ahocevar](https://github.com/ahocevar))
|
||||||
|
* [#8520](https://github.com/openlayers/openlayers/pull/8520) - Remove redundant if block ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#8515](https://github.com/openlayers/openlayers/pull/8515) - More convenient select and sketch layer management ([@ahocevar](https://github.com/ahocevar))
|
||||||
|
* [#8503](https://github.com/openlayers/openlayers/pull/8503) - Avoid block scope issues in transpiled code ([@ahocevar](https://github.com/ahocevar))
|
||||||
|
* [#8490](https://github.com/openlayers/openlayers/pull/8490) - WMTS getCapabilities readCoodinates more than one whitespace delimiter ([@MarquesDeAzevedo](https://github.com/MarquesDeAzevedo))
|
||||||
|
* [#8489](https://github.com/openlayers/openlayers/pull/8489) - Use .prototype. only where necessary ([@ahocevar](https://github.com/ahocevar))
|
||||||
|
* [#8478](https://github.com/openlayers/openlayers/pull/8478) - Check font availability with multiple font weights ([@ahocevar](https://github.com/ahocevar))
|
||||||
|
* [#8483](https://github.com/openlayers/openlayers/pull/8483) - Don't create Polygon with null coordinates ([@fredj](https://github.com/fredj))
|
||||||
|
* [#8471](https://github.com/openlayers/openlayers/pull/8471) - Add getUrl and getImageExtent to ImageStatic API ([@samuel-girard](https://github.com/samuel-girard))
|
||||||
|
* [#8470](https://github.com/openlayers/openlayers/pull/8470) - Update Tile loading API docs ([@scroach](https://github.com/scroach))
|
||||||
|
* [#8477](https://github.com/openlayers/openlayers/pull/8477) - Expose original getGutter ([@gberaudo](https://github.com/gberaudo))
|
||||||
|
* [#8466](https://github.com/openlayers/openlayers/pull/8466) - Add onFocusOnly option to interaction defaults ([@ahocevar](https://github.com/ahocevar))
|
||||||
|
* [#8465](https://github.com/openlayers/openlayers/pull/8465) - Do not prevent default on pointermove ([@ahocevar](https://github.com/ahocevar))
|
||||||
|
* [#8461](https://github.com/openlayers/openlayers/pull/8461) - Fix double backtick typo ([@lionralfs](https://github.com/lionralfs))
|
||||||
|
* [#8452](https://github.com/openlayers/openlayers/pull/8452) - Remove extra translate function in Geometry, add missing api tag ([@fredj](https://github.com/fredj))
|
||||||
|
* [#8451](https://github.com/openlayers/openlayers/pull/8451) - Remove unimplemented functions ([@fredj](https://github.com/fredj))
|
||||||
|
* [#8450](https://github.com/openlayers/openlayers/pull/8450) - Mark properties of ReadOptions and WriteOptions as optional ([@fredj](https://github.com/fredj))
|
||||||
|
* [#8443](https://github.com/openlayers/openlayers/pull/8443) - Explicit void ([@tschaub](https://github.com/tschaub))
|
||||||
|
* [#8437](https://github.com/openlayers/openlayers/pull/8437) - Avoid shadowing EventTarget ([@tschaub](https://github.com/tschaub))
|
||||||
|
* [#8439](https://github.com/openlayers/openlayers/pull/8439) - Fewer dots in types ([@tschaub](https://github.com/tschaub))
|
||||||
|
* [#8441](https://github.com/openlayers/openlayers/pull/8441) - Fix loaded script for the example-verbatim examples ([@fredj](https://github.com/fredj))
|
||||||
|
* [#8435](https://github.com/openlayers/openlayers/pull/8435) - Call setCoordinates on the point instance ([@fredj](https://github.com/fredj))
|
||||||
|
* [#8428](https://github.com/openlayers/openlayers/pull/8428) - Type name on same line as type ([@tschaub](https://github.com/tschaub))
|
||||||
|
* [#8422](https://github.com/openlayers/openlayers/pull/8422) - Improve JSDoc such that `ng build --prod` with angular/cli 6.0.8 succeeds again ([@jkoelewijn](https://github.com/jkoelewijn))
|
||||||
|
* [#8396](https://github.com/openlayers/openlayers/pull/8396) - Fix ol.interaction.Draw~createRegularPolygon ([@iamplex](https://github.com/iamplex))
|
||||||
|
* [#8420](https://github.com/openlayers/openlayers/pull/8420) - Keep function names when building examples ([@ahocevar](https://github.com/ahocevar))
|
||||||
|
* [#8419](https://github.com/openlayers/openlayers/pull/8419) - Release v5.1.3 ([@tschaub](https://github.com/tschaub))
|
||||||
|
* [#8417](https://github.com/openlayers/openlayers/pull/8417) - Minor doc updates ([@tschaub](https://github.com/tschaub))
|
||||||
|
* [#8418](https://github.com/openlayers/openlayers/pull/8418) - Set api annotation on classdesc, not constructor ([@ahocevar](https://github.com/ahocevar))
|
||||||
|
* [#8414](https://github.com/openlayers/openlayers/pull/8414) - Updates for 5.1.2 ([@tschaub](https://github.com/tschaub))
|
||||||
|
* [#8413](https://github.com/openlayers/openlayers/pull/8413) - Remove extra curly in type ([@tschaub](https://github.com/tschaub))
|
||||||
|
* [#8412](https://github.com/openlayers/openlayers/pull/8412) - Changes for 5.1.1. ([@tschaub](https://github.com/tschaub))
|
||||||
|
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Dependency Updates</summary>
|
||||||
|
|
||||||
|
* [#8543](https://github.com/openlayers/openlayers/pull/8543) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#8541](https://github.com/openlayers/openlayers/pull/8541) - Update proj4 to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#8542](https://github.com/openlayers/openlayers/pull/8542) - Update rollup-plugin-commonjs to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#8533](https://github.com/openlayers/openlayers/pull/8533) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#8530](https://github.com/openlayers/openlayers/pull/8530) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#8522](https://github.com/openlayers/openlayers/pull/8522) - Update marked to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#8505](https://github.com/openlayers/openlayers/pull/8505) - Update karma to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#8501](https://github.com/openlayers/openlayers/pull/8501) - Update rollup-plugin-commonjs to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#8495](https://github.com/openlayers/openlayers/pull/8495) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#8493](https://github.com/openlayers/openlayers/pull/8493) - Update clean-css-cli to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#8491](https://github.com/openlayers/openlayers/pull/8491) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#8486](https://github.com/openlayers/openlayers/pull/8486) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#8476](https://github.com/openlayers/openlayers/pull/8476) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#8475](https://github.com/openlayers/openlayers/pull/8475) - Update clean-css-cli to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#8469](https://github.com/openlayers/openlayers/pull/8469) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#8453](https://github.com/openlayers/openlayers/pull/8453) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#8447](https://github.com/openlayers/openlayers/pull/8447) - Update rollup-plugin-commonjs to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
* [#8426](https://github.com/openlayers/openlayers/pull/8426) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||||
|
|
||||||
|
|
||||||
|
</details>
|
||||||
@@ -168,9 +168,9 @@ function generateSourceFiles(sourceFiles) {
|
|||||||
* for display purposes. This function mutates the original arrays.
|
* for display purposes. This function mutates the original arrays.
|
||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
* @param {Array.<module:jsdoc/doclet.Doclet>} doclets - The array of classes and functions to
|
* @param {Array<module:jsdoc/doclet.Doclet>} doclets - The array of classes and functions to
|
||||||
* check.
|
* check.
|
||||||
* @param {Array.<module:jsdoc/doclet.Doclet>} modules - The array of module doclets to search.
|
* @param {Array<module:jsdoc/doclet.Doclet>} modules - The array of module doclets to search.
|
||||||
*/
|
*/
|
||||||
function attachModuleSymbols(doclets, modules) {
|
function attachModuleSymbols(doclets, modules) {
|
||||||
const symbols = {};
|
const symbols = {};
|
||||||
|
|||||||
@@ -4,6 +4,13 @@ var version = obj.packageInfo.version;
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
|
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-2577926-1"></script>
|
||||||
|
<script>
|
||||||
|
window.dataLayer = window.dataLayer || [];
|
||||||
|
function gtag(){dataLayer.push(arguments);}
|
||||||
|
gtag('js', new Date());
|
||||||
|
gtag('config', 'UA-2577926-1');
|
||||||
|
</script>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>OpenLayers v<?js= version ?> API - <?js= title ?></title>
|
<title>OpenLayers v<?js= version ?> API - <?js= title ?></title>
|
||||||
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=fetch"></script>
|
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=fetch"></script>
|
||||||
|
|||||||
17
doc/faq.md
17
doc/faq.md
@@ -65,20 +65,19 @@ var map = new ol.Map({
|
|||||||
```
|
```
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
// To use other projections, you have to register the projection in OpenLayers:
|
// To use other projections, you have to register the projection in OpenLayers.
|
||||||
|
// This can easily be done with [https://proj4js.org](proj4)
|
||||||
//
|
//
|
||||||
// By default OpenLayers does not know about the EPSG:21781 (Swiss) projection.
|
// By default OpenLayers does not know about the EPSG:21781 (Swiss) projection.
|
||||||
// So we create a projection instance for EPSG:21781 and pass it to
|
// So we create a projection instance for EPSG:21781 and pass it to
|
||||||
// ol.proj.addProjection to make it available to the library for lookup by its
|
// ol.proj.addProjection to make it available to the library for lookup by its
|
||||||
// code.
|
// code.
|
||||||
var swissProjection = new ol.proj.Projection({
|
proj4.defs('EPSG:21781',
|
||||||
code: 'EPSG:21781',
|
'+proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 +k_0=1 ' +
|
||||||
// The extent is used to determine zoom level 0. Recommended values for a
|
'+x_0=600000 +y_0=200000 +ellps=bessel ' +
|
||||||
// projection's validity extent can be found at https://epsg.io/.
|
'+towgs84=660.077,13.551,369.344,2.484,1.783,2.939,5.66 +units=m +no_defs');
|
||||||
extent: [485869.5728, 76443.1884, 837076.5648, 299941.7864],
|
ol.proj.proj4.register(proj4);
|
||||||
units: 'm'
|
var swissProjection = ol.proj.get('EPSG:21781');
|
||||||
});
|
|
||||||
ol.proj.addProjection(swissProjection);
|
|
||||||
|
|
||||||
// we can now use the projection:
|
// we can now use the projection:
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ The `layers: [ ... ]` array is used to define the list of layers available in th
|
|||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
Layers in OpenLayers are defined with a type (Image, Tile or Vector) which contains a source. The source is the protocol used to get the map tiles. You can consult the list of [available layer sources here](/en/{{ latest }}/apidoc/ol.source.html)
|
Layers in OpenLayers are defined with a type (Image, Tile or Vector) which contains a source. The source is the protocol used to get the map tiles.
|
||||||
|
|
||||||
The next part of the `Map` object is the `View`. The view allows to specify the center, resolution, and rotation of the map. The simplest way to define a view is to define a center point and a zoom level. Note that zoom level 0 is zoomed out.
|
The next part of the `Map` object is the `View`. The view allows to specify the center, resolution, and rotation of the map. The simplest way to define a view is to define a center point and a zoom level. Note that zoom level 0 is zoomed out.
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ const map = new Map({
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
You will also need an `ìndex.html` file that will use your bundle. Here is a simple example:
|
You will also need an `index.html` file that will use your bundle. Here is a simple example:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|||||||
@@ -6,27 +6,34 @@ layout: doc.hbs
|
|||||||
# Basic Concepts
|
# Basic Concepts
|
||||||
|
|
||||||
## Map
|
## Map
|
||||||
The core component of OpenLayers is the map (`Map`). It is rendered to a `target` container (e.g. a `div` element on the web page that contains the map). All map properties can either be configured at construction time, or by using setter methods, e.g. `setTarget()`.
|
|
||||||
|
The core component of OpenLayers is the map (`ol/Map`). It is rendered to a `target` container (e.g. a `div` element on the web page that contains the map). All map properties can either be configured at construction time, or by using setter methods, e.g. `setTarget()`.
|
||||||
|
|
||||||
|
The markup below could be used to create a `<div>` that contains your map.
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<div id="map" style="width: 100%, height: 400px"></div>
|
<div id="map" style="width: 100%, height: 400px"></div>
|
||||||
<script>
|
```
|
||||||
import Map from 'ol/Map';
|
|
||||||
|
|
||||||
var map = new Map({target: 'map'});
|
The script below constructs a map that is rendered in the `<div>` above, using the `map` id of the element as a selector.
|
||||||
</script>
|
|
||||||
|
```js
|
||||||
|
import Map from 'ol/Map';
|
||||||
|
|
||||||
|
var map = new Map({target: 'map'});
|
||||||
```
|
```
|
||||||
|
|
||||||
## View
|
## View
|
||||||
`Map` is not responsible for things like center, zoom level and projection of the map. Instead, these are properties of a `View` instance.
|
|
||||||
|
The map is not responsible for things like center, zoom level and projection of the map. Instead, these are properties of a `ol/View` instance.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import View from 'ol/View';
|
import View from 'ol/View';
|
||||||
|
|
||||||
map.setView(new View({
|
map.setView(new View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
zoom: 2
|
zoom: 2
|
||||||
}));
|
}));
|
||||||
```
|
```
|
||||||
|
|
||||||
A `View` also has a `projection`. The projection determines the coordinate system of the `center` and the units for map resolution calculations. If not specified (like in the above snippet), the default projection is Spherical Mercator (EPSG:3857), with meters as map units.
|
A `View` also has a `projection`. The projection determines the coordinate system of the `center` and the units for map resolution calculations. If not specified (like in the above snippet), the default projection is Spherical Mercator (EPSG:3857), with meters as map units.
|
||||||
@@ -35,54 +42,49 @@ The `zoom` option is a convenient way to specify the map resolution. The availab
|
|||||||
|
|
||||||
|
|
||||||
## Source
|
## Source
|
||||||
To get remote data for a layer, OpenLayers uses `source/Source` subclasses. These are available for free and commercial map tile services like OpenStreetMap or Bing, for OGC sources like WMS or WMTS, and for vector data in formats like GeoJSON or KML.
|
|
||||||
|
To get remote data for a layer, OpenLayers uses `ol/source/Source` subclasses. These are available for free and commercial map tile services like OpenStreetMap or Bing, for OGC sources like WMS or WMTS, and for vector data in formats like GeoJSON or KML.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import OSM from 'ol/source/OSM';
|
import OSM from 'ol/source/OSM';
|
||||||
|
|
||||||
var osmSource = OSM();
|
var osmSource = OSM();
|
||||||
```
|
```
|
||||||
|
|
||||||
## Layer
|
## Layer
|
||||||
A layer is a visual representation of data from a `source`. OpenLayers has four basic types of layers: `layer/Tile`, `layer/Image`, `layer/Vector` and `layer/VectorTile`.
|
|
||||||
|
|
||||||
`layer/Tile` is for layer sources that provide pre-rendered, tiled images in grids that are organized by zoom levels for specific resolutions.
|
A layer is a visual representation of data from a `source`. OpenLayers has four basic types of layers:
|
||||||
|
|
||||||
`layer/Image` is for server rendered images that are available for arbitrary extents and resolutions.
|
* `ol/layer/Tile` - Renders sources that provide tiled images in grids that are organized by zoom levels for specific resolutions.
|
||||||
|
* `ol/layer/Image` - Renders sources that provide map images at arbitrary extents and resolutions.
|
||||||
`layer/Vector` is for vector data that is rendered client-side.
|
* `ol/layer/Vector` - Renders vector data client-side.
|
||||||
|
* `ol/layer/VectorTile` - Renders data that is provided as vector tiles.
|
||||||
`layer/VectorTile` is for tiled vector data that is rendered client-side.
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import TileLayer from 'ol/layer/Tile';
|
import TileLayer from 'ol/layer/Tile';
|
||||||
|
|
||||||
var osmLayer = new TileLayer({source: osmSource});
|
var osmLayer = new TileLayer({source: osmSource});
|
||||||
map.addLayer(osmLayer);
|
map.addLayer(osmLayer);
|
||||||
```
|
```
|
||||||
|
|
||||||
## Putting it all together
|
## Putting it all together
|
||||||
|
|
||||||
|
The above snippets can be combined into a single script that renders a map with a single tile layer:
|
||||||
|
|
||||||
The above snippets can be conflated to a self contained map configuration with view and layers:
|
```js
|
||||||
|
import Map from 'ol/Map';
|
||||||
|
import View from 'ol/View';
|
||||||
|
import OSM from 'ol/source/OSM';
|
||||||
|
import TileLayer from 'ol/source/Tile';
|
||||||
|
|
||||||
```xml
|
new Map({
|
||||||
<div id="map" style="width: 100%, height: 400px"></div>
|
|
||||||
<script>
|
|
||||||
import Map from 'ol/Map';
|
|
||||||
import View from 'ol/View';
|
|
||||||
import OSM from 'ol/source/OSM';
|
|
||||||
import TileLayer from 'ol/source/Tile';
|
|
||||||
|
|
||||||
new Map({
|
|
||||||
layers: [
|
layers: [
|
||||||
new TileLayer({source: new ol.source.OSM()})
|
new TileLayer({source: new OSM()})
|
||||||
],
|
],
|
||||||
view: new View({
|
view: new View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
zoom: 2
|
zoom: 2
|
||||||
}),
|
}),
|
||||||
target: 'map'
|
target: 'map'
|
||||||
});
|
});
|
||||||
</script>
|
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ The view in any Proj4js supported coordinate reference system is possible and pr
|
|||||||
# Usage
|
# Usage
|
||||||
The API usage is very simple. Just specify proper projection (e.g. using [EPSG](https://epsg.io) code) on `ol/View`:
|
The API usage is very simple. Just specify proper projection (e.g. using [EPSG](https://epsg.io) code) on `ol/View`:
|
||||||
```js
|
```js
|
||||||
import {Map, View} from `ol`;
|
import {Map, View} from 'ol';
|
||||||
import TileLayer from `ol/layer/Tile`;
|
import TileLayer from 'ol/layer/Tile';
|
||||||
import TileWMS from `ol/source/TileWMS`;
|
import TileWMS from 'ol/source/TileWMS';
|
||||||
|
|
||||||
var map = new Map({
|
var map = new Map({
|
||||||
target: 'map',
|
target: 'map',
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ const twoPi = 2 * Math.PI;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert an RGB pixel into an HCL pixel.
|
* Convert an RGB pixel into an HCL pixel.
|
||||||
* @param {Array.<number>} pixel A pixel in RGB space.
|
* @param {Array<number>} pixel A pixel in RGB space.
|
||||||
* @return {Array.<number>} A pixel in HCL space.
|
* @return {Array<number>} A pixel in HCL space.
|
||||||
*/
|
*/
|
||||||
function rgb2hcl(pixel) {
|
function rgb2hcl(pixel) {
|
||||||
const red = rgb2xyz(pixel[0]);
|
const red = rgb2xyz(pixel[0]);
|
||||||
@@ -55,8 +55,8 @@ function rgb2hcl(pixel) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert an HCL pixel into an RGB pixel.
|
* Convert an HCL pixel into an RGB pixel.
|
||||||
* @param {Array.<number>} pixel A pixel in HCL space.
|
* @param {Array<number>} pixel A pixel in HCL space.
|
||||||
* @return {Array.<number>} A pixel in RGB space.
|
* @return {Array<number>} A pixel in RGB space.
|
||||||
*/
|
*/
|
||||||
function hcl2rgb(pixel) {
|
function hcl2rgb(pixel) {
|
||||||
const h = pixel[0];
|
const h = pixel[0];
|
||||||
|
|||||||
@@ -40,9 +40,6 @@ function addInteraction() {
|
|||||||
} else if (value === 'Star') {
|
} else if (value === 'Star') {
|
||||||
value = 'Circle';
|
value = 'Circle';
|
||||||
geometryFunction = function(coordinates, geometry) {
|
geometryFunction = function(coordinates, geometry) {
|
||||||
if (!geometry) {
|
|
||||||
geometry = new Polygon(null);
|
|
||||||
}
|
|
||||||
const center = coordinates[0];
|
const center = coordinates[0];
|
||||||
const last = coordinates[1];
|
const last = coordinates[1];
|
||||||
const dx = center[0] - last[0];
|
const dx = center[0] - last[0];
|
||||||
@@ -59,7 +56,11 @@ function addInteraction() {
|
|||||||
newCoordinates.push([center[0] + offsetX, center[1] + offsetY]);
|
newCoordinates.push([center[0] + offsetX, center[1] + offsetY]);
|
||||||
}
|
}
|
||||||
newCoordinates.push(newCoordinates[0].slice());
|
newCoordinates.push(newCoordinates[0].slice());
|
||||||
|
if (!geometry) {
|
||||||
|
geometry = new Polygon([newCoordinates]);
|
||||||
|
} else {
|
||||||
geometry.setCoordinates([newCoordinates]);
|
geometry.setCoordinates([newCoordinates]);
|
||||||
|
}
|
||||||
return geometry;
|
return geometry;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ const map = new Map({
|
|||||||
const imageStyle = new Style({
|
const imageStyle = new Style({
|
||||||
image: new CircleStyle({
|
image: new CircleStyle({
|
||||||
radius: 5,
|
radius: 5,
|
||||||
snapToPixel: false,
|
|
||||||
fill: new Fill({color: 'yellow'}),
|
fill: new Fill({color: 'yellow'}),
|
||||||
stroke: new Stroke({color: 'red', width: 1})
|
stroke: new Stroke({color: 'red', width: 1})
|
||||||
})
|
})
|
||||||
@@ -31,7 +30,6 @@ const imageStyle = new Style({
|
|||||||
const headInnerImageStyle = new Style({
|
const headInnerImageStyle = new Style({
|
||||||
image: new CircleStyle({
|
image: new CircleStyle({
|
||||||
radius: 2,
|
radius: 2,
|
||||||
snapToPixel: false,
|
|
||||||
fill: new Fill({color: 'blue'})
|
fill: new Fill({color: 'blue'})
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
@@ -39,7 +37,6 @@ const headInnerImageStyle = new Style({
|
|||||||
const headOuterImageStyle = new Style({
|
const headOuterImageStyle = new Style({
|
||||||
image: new CircleStyle({
|
image: new CircleStyle({
|
||||||
radius: 5,
|
radius: 5,
|
||||||
snapToPixel: false,
|
|
||||||
fill: new Fill({color: 'black'})
|
fill: new Fill({color: 'black'})
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ const map = new Map({
|
|||||||
});
|
});
|
||||||
|
|
||||||
document.getElementById('export-png').addEventListener('click', function() {
|
document.getElementById('export-png').addEventListener('click', function() {
|
||||||
map.once('postcompose', function(event) {
|
map.once('rendercomplete', function(event) {
|
||||||
const canvas = event.context.canvas;
|
const canvas = event.context.canvas;
|
||||||
if (navigator.msSaveBlob) {
|
if (navigator.msSaveBlob) {
|
||||||
navigator.msSaveBlob(canvas.msToBlob(), 'map.png');
|
navigator.msSaveBlob(canvas.msToBlob(), 'map.png');
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import View from '../src/ol/View.js';
|
|||||||
import {defaults as defaultControls} from '../src/ol/control.js';
|
import {defaults as defaultControls} from '../src/ol/control.js';
|
||||||
import WKT from '../src/ol/format/WKT.js';
|
import WKT from '../src/ol/format/WKT.js';
|
||||||
import {Tile as TileLayer, Vector as VectorLayer} from '../src/ol/layer.js';
|
import {Tile as TileLayer, Vector as VectorLayer} from '../src/ol/layer.js';
|
||||||
import {unByKey} from '../src/ol/Observable.js';
|
|
||||||
import {OSM, Vector as VectorSource} from '../src/ol/source.js';
|
import {OSM, Vector as VectorSource} from '../src/ol/source.js';
|
||||||
|
|
||||||
const raster = new TileLayer({
|
const raster = new TileLayer({
|
||||||
@@ -48,9 +47,6 @@ const dims = {
|
|||||||
a5: [210, 148]
|
a5: [210, 148]
|
||||||
};
|
};
|
||||||
|
|
||||||
let loading = 0;
|
|
||||||
let loaded = 0;
|
|
||||||
|
|
||||||
const exportButton = document.getElementById('export-pdf');
|
const exportButton = document.getElementById('export-pdf');
|
||||||
|
|
||||||
exportButton.addEventListener('click', function() {
|
exportButton.addEventListener('click', function() {
|
||||||
@@ -66,57 +62,22 @@ exportButton.addEventListener('click', function() {
|
|||||||
const size = /** @type {module:ol/size~Size} */ (map.getSize());
|
const size = /** @type {module:ol/size~Size} */ (map.getSize());
|
||||||
const extent = map.getView().calculateExtent(size);
|
const extent = map.getView().calculateExtent(size);
|
||||||
|
|
||||||
const source = raster.getSource();
|
map.once('rendercomplete', function(event) {
|
||||||
|
const canvas = event.context.canvas;
|
||||||
const tileLoadStart = function() {
|
|
||||||
++loading;
|
|
||||||
};
|
|
||||||
|
|
||||||
let timer;
|
|
||||||
let keys = [];
|
|
||||||
|
|
||||||
function tileLoadEndFactory(canvas) {
|
|
||||||
return () => {
|
|
||||||
++loaded;
|
|
||||||
if (timer) {
|
|
||||||
clearTimeout(timer);
|
|
||||||
timer = null;
|
|
||||||
}
|
|
||||||
if (loading === loaded) {
|
|
||||||
timer = window.setTimeout(() => {
|
|
||||||
loading = 0;
|
|
||||||
loaded = 0;
|
|
||||||
const data = canvas.toDataURL('image/jpeg');
|
const data = canvas.toDataURL('image/jpeg');
|
||||||
const pdf = new jsPDF('landscape', undefined, format);
|
const pdf = new jsPDF('landscape', undefined, format);
|
||||||
pdf.addImage(data, 'JPEG', 0, 0, dim[0], dim[1]);
|
pdf.addImage(data, 'JPEG', 0, 0, dim[0], dim[1]);
|
||||||
pdf.save('map.pdf');
|
pdf.save('map.pdf');
|
||||||
keys.forEach(unByKey);
|
// Reset original map size
|
||||||
keys = [];
|
|
||||||
map.setSize(size);
|
map.setSize(size);
|
||||||
map.getView().fit(extent, {size});
|
map.getView().fit(extent, {size});
|
||||||
map.renderSync();
|
|
||||||
exportButton.disabled = false;
|
exportButton.disabled = false;
|
||||||
document.body.style.cursor = 'auto';
|
document.body.style.cursor = 'auto';
|
||||||
}, 500);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
map.once('postcompose', function(event) {
|
|
||||||
const canvas = event.context.canvas;
|
|
||||||
const tileLoadEnd = tileLoadEndFactory(canvas);
|
|
||||||
keys = [
|
|
||||||
source.on('tileloadstart', tileLoadStart),
|
|
||||||
source.on('tileloadend', tileLoadEnd),
|
|
||||||
source.on('tileloaderror', tileLoadEnd)
|
|
||||||
];
|
|
||||||
tileLoadEnd();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Set print size
|
||||||
const printSize = [width, height];
|
const printSize = [width, height];
|
||||||
map.setSize(printSize);
|
map.setSize(printSize);
|
||||||
map.getView().fit(extent, {size: printSize});
|
map.getView().fit(extent, {size: printSize});
|
||||||
loaded = -1;
|
|
||||||
map.renderSync();
|
|
||||||
|
|
||||||
}, false);
|
}, false);
|
||||||
|
|||||||
@@ -65,7 +65,6 @@ function flash(feature) {
|
|||||||
const style = new Style({
|
const style = new Style({
|
||||||
image: new CircleStyle({
|
image: new CircleStyle({
|
||||||
radius: radius,
|
radius: radius,
|
||||||
snapToPixel: false,
|
|
||||||
stroke: new Stroke({
|
stroke: new Stroke({
|
||||||
color: 'rgba(255, 0, 0, ' + opacity + ')',
|
color: 'rgba(255, 0, 0, ' + opacity + ')',
|
||||||
width: 0.25 + opacity
|
width: 0.25 + opacity
|
||||||
|
|||||||
@@ -94,7 +94,6 @@ const styles = {
|
|||||||
'geoMarker': new Style({
|
'geoMarker': new Style({
|
||||||
image: new CircleStyle({
|
image: new CircleStyle({
|
||||||
radius: 7,
|
radius: 7,
|
||||||
snapToPixel: false,
|
|
||||||
fill: new Fill({color: 'black'}),
|
fill: new Fill({color: 'black'}),
|
||||||
stroke: new Stroke({
|
stroke: new Stroke({
|
||||||
color: 'white', width: 2
|
color: 'white', width: 2
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ tags: "fullscreen, geolocation, orientation, mobile"
|
|||||||
<button id="geolocate">Geolocate Me!</button>
|
<button id="geolocate">Geolocate Me!</button>
|
||||||
<button id="simulate">Simulate</button>
|
<button id="simulate">Simulate</button>
|
||||||
</div>
|
</div>
|
||||||
<script src="./resources/common.js" type="text/javascript"></script>
|
<script src="common.js"></script>
|
||||||
<script src="loader.js?id=geolocation-orientation" type="text/javascript"></script>
|
<script src="geolocation-orientation.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ imagery.on('postcompose', function(event) {
|
|||||||
* Apply a convolution kernel to canvas. This works for any size kernel, but
|
* Apply a convolution kernel to canvas. This works for any size kernel, but
|
||||||
* performance starts degrading above 3 x 3.
|
* performance starts degrading above 3 x 3.
|
||||||
* @param {CanvasRenderingContext2D} context Canvas 2d context.
|
* @param {CanvasRenderingContext2D} context Canvas 2d context.
|
||||||
* @param {Array.<number>} kernel Kernel.
|
* @param {Array<number>} kernel Kernel.
|
||||||
*/
|
*/
|
||||||
function convolve(context, kernel) {
|
function convolve(context, kernel) {
|
||||||
const canvas = context.canvas;
|
const canvas = context.canvas;
|
||||||
|
|||||||
19
examples/interaction-options.html
Normal file
19
examples/interaction-options.html
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
---
|
||||||
|
layout: example.html
|
||||||
|
title: Interaction Options
|
||||||
|
shortdesc: Shows interaction options for custom scroll and zoom behavior.
|
||||||
|
docs: >
|
||||||
|
This example uses a custom `ol/interaction/defaults` configuration:
|
||||||
|
|
||||||
|
* By default, wheel/trackpad zoom and drag panning is always active, which
|
||||||
|
can be unexpected on pages with a lot of scrollable content and an embedded
|
||||||
|
map. To perform wheel/trackpad zoom and drag-pan actions only when the map
|
||||||
|
has the focus, set `onFocusOnly: true` as option. This requires a map div
|
||||||
|
with a `tabindex` attribute set.
|
||||||
|
* By default, pinch-zoom and wheel/trackpad zoom interactions can leave the
|
||||||
|
map at fractional zoom levels. If instead you want to constrain
|
||||||
|
wheel/trackpad zooming to integer zoom levels, set
|
||||||
|
`constrainResolution: true`.
|
||||||
|
tags: "trackpad, mousewheel, zoom, scroll, interaction, fractional"
|
||||||
|
---
|
||||||
|
<div tabindex="1" id="map" class="map"></div>
|
||||||
22
examples/interaction-options.js
Normal file
22
examples/interaction-options.js
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import Map from '../src/ol/Map.js';
|
||||||
|
import View from '../src/ol/View.js';
|
||||||
|
import {defaults as defaultInteractions} from '../src/ol/interaction.js';
|
||||||
|
import TileLayer from '../src/ol/layer/Tile.js';
|
||||||
|
import OSM from '../src/ol/source/OSM.js';
|
||||||
|
|
||||||
|
|
||||||
|
const map = new Map({
|
||||||
|
interactions: defaultInteractions({
|
||||||
|
constrainResolution: true, onFocusOnly: true
|
||||||
|
}),
|
||||||
|
layers: [
|
||||||
|
new TileLayer({
|
||||||
|
source: new OSM()
|
||||||
|
})
|
||||||
|
],
|
||||||
|
target: 'map',
|
||||||
|
view: new View({
|
||||||
|
center: [0, 0],
|
||||||
|
zoom: 2
|
||||||
|
})
|
||||||
|
});
|
||||||
@@ -25,8 +25,7 @@ cloak:
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="map" class="map"></div>
|
<div id="map" class="map"></div>
|
||||||
<script src="https://code.jquery.com/jquery-2.2.3.min.js" type="text/javascript"></script>
|
<script src="common.js"></script>
|
||||||
<script src="./resources/common.js" type="text/javascript"></script>
|
<script src="mobile-full-screen.js"></script>
|
||||||
<script src="loader.js?id=mobile-full-screen" type="text/javascript"></script>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
---
|
|
||||||
layout: example.html
|
|
||||||
title: Mousewheel/Trackpad Zoom
|
|
||||||
shortdesc: Shows advanced wheel/trackpad zoom options.
|
|
||||||
docs: >
|
|
||||||
This example uses a custom `ol/interaction/MouseWheelZoom` configuration:
|
|
||||||
|
|
||||||
* By default, wheel/trackpad zoom is always active, which can be unexpected
|
|
||||||
on pages with a lot of scrollable content and an embedded map. To perform
|
|
||||||
wheel/trackpad zoom actions only when the map has the focus, set
|
|
||||||
`condition: focus` as constructor option. This requires
|
|
||||||
a map div with a `tabindex` attribute set.
|
|
||||||
* By default, the interaction can leave the map at fractional zoom levels. If
|
|
||||||
instead you want to constrain wheel/trackpad zooming to integer zoom
|
|
||||||
levels, set `constrainResolution: true`.
|
|
||||||
tags: "trackpad, mousewheel, zoom, scroll, interaction"
|
|
||||||
---
|
|
||||||
<div tabindex="1" id="map" class="map"></div>
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
import Map from '../src/ol/Map.js';
|
|
||||||
import View from '../src/ol/View.js';
|
|
||||||
import {defaults as defaultInteractions, MouseWheelZoom} from '../src/ol/interaction.js';
|
|
||||||
import {focus} from '../src/ol/events/condition.js';
|
|
||||||
import TileLayer from '../src/ol/layer/Tile.js';
|
|
||||||
import OSM from '../src/ol/source/OSM.js';
|
|
||||||
|
|
||||||
|
|
||||||
const map = new Map({
|
|
||||||
interactions: defaultInteractions({mouseWheelZoom: false}).extend([
|
|
||||||
new MouseWheelZoom({
|
|
||||||
constrainResolution: true, // force zooming to a integer zoom
|
|
||||||
condition: focus // only wheel/trackpad zoom when the map has the focus
|
|
||||||
})
|
|
||||||
]),
|
|
||||||
layers: [
|
|
||||||
new TileLayer({
|
|
||||||
source: new OSM()
|
|
||||||
})
|
|
||||||
],
|
|
||||||
target: 'map',
|
|
||||||
view: new View({
|
|
||||||
center: [0, 0],
|
|
||||||
zoom: 2
|
|
||||||
})
|
|
||||||
});
|
|
||||||
@@ -12,7 +12,7 @@ const bins = 10;
|
|||||||
/**
|
/**
|
||||||
* Calculate the Vegetation Greenness Index (VGI) from an input pixel. This
|
* Calculate the Vegetation Greenness Index (VGI) from an input pixel. This
|
||||||
* is a rough estimate assuming that pixel values correspond to reflectance.
|
* is a rough estimate assuming that pixel values correspond to reflectance.
|
||||||
* @param {Array.<number>} pixel An array of [R, G, B, A] values.
|
* @param {Array<number>} pixel An array of [R, G, B, A] values.
|
||||||
* @return {number} The VGI value for the given pixel.
|
* @return {number} The VGI value for the given pixel.
|
||||||
*/
|
*/
|
||||||
function vgi(pixel) {
|
function vgi(pixel) {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import {OSM, Raster, XYZ} from '../src/ol/source.js';
|
|||||||
/**
|
/**
|
||||||
* Generates a shaded relief image given elevation data. Uses a 3x3
|
* Generates a shaded relief image given elevation data. Uses a 3x3
|
||||||
* neighborhood for determining slope and aspect.
|
* neighborhood for determining slope and aspect.
|
||||||
* @param {Array.<ImageData>} inputs Array of input images.
|
* @param {Array<ImageData>} inputs Array of input images.
|
||||||
* @param {Object} data Data added in the "beforeoperations" event.
|
* @param {Object} data Data added in the "beforeoperations" event.
|
||||||
* @return {ImageData} Output image.
|
* @return {ImageData} Output image.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
layout: example.html
|
layout: example.html
|
||||||
title: Street Labels
|
title: Street Labels
|
||||||
shortdesc: Render street names with a custom render.
|
shortdesc: Render street names.
|
||||||
docs: >
|
docs: >
|
||||||
Example showing the use of a text style with `placement: 'line'` to render text along a path.
|
Example showing the use of a text style with `placement: 'line'` to render text along a path.
|
||||||
tags: "vector, label, streets"
|
tags: "vector, label, streets"
|
||||||
|
|||||||
@@ -1,6 +1,13 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en-US">
|
<html lang="en-US">
|
||||||
<head>
|
<head>
|
||||||
|
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-2577926-1"></script>
|
||||||
|
<script>
|
||||||
|
window.dataLayer = window.dataLayer || [];
|
||||||
|
function gtag(){dataLayer.push(arguments);}
|
||||||
|
gtag('js', new Date());
|
||||||
|
gtag('config', 'UA-2577926-1');
|
||||||
|
</script>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
|
||||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
|
||||||
const CopyPlugin = require('copy-webpack-plugin');
|
const CopyPlugin = require('copy-webpack-plugin');
|
||||||
const ExampleBuilder = require('./example-builder');
|
const ExampleBuilder = require('./example-builder');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
@@ -31,6 +32,16 @@ module.exports = {
|
|||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
optimization: {
|
optimization: {
|
||||||
|
minimizer: [
|
||||||
|
new UglifyJsPlugin({
|
||||||
|
sourceMap: true,
|
||||||
|
uglifyOptions: {
|
||||||
|
mangle: {
|
||||||
|
keep_fnames: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
],
|
||||||
runtimeChunk: {
|
runtimeChunk: {
|
||||||
name: 'common'
|
name: 'common'
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ handlebars.registerHelper('indent', (text, options) => {
|
|||||||
* Create an inverted index of keywords from examples. Property names are
|
* Create an inverted index of keywords from examples. Property names are
|
||||||
* lowercased words. Property values are objects mapping example index to word
|
* lowercased words. Property values are objects mapping example index to word
|
||||||
* count.
|
* count.
|
||||||
* @param {Array.<Object>} exampleData Array of example data objects.
|
* @param {Array<Object>} exampleData Array of example data objects.
|
||||||
* @return {Object} Word index.
|
* @return {Object} Word index.
|
||||||
*/
|
*/
|
||||||
function createWordIndex(exampleData) {
|
function createWordIndex(exampleData) {
|
||||||
|
|||||||
@@ -37,12 +37,11 @@ const tileGrid = new WMTSTileGrid({
|
|||||||
matrixIds: matrixIds
|
matrixIds: matrixIds
|
||||||
});
|
});
|
||||||
|
|
||||||
// API key valid for 'openlayers.org' and 'localhost'.
|
// For more information about the IGN API key see
|
||||||
// Expiration date is 06/29/2018.
|
// https://geoservices.ign.fr/blog/2017/06/28/geoportail_sans_compte.html
|
||||||
const key = '2mqbg0z6cx7ube8gsou10nrt';
|
|
||||||
|
|
||||||
const ign_source = new WMTS({
|
const ign_source = new WMTS({
|
||||||
url: 'https://wxs.ign.fr/' + key + '/wmts',
|
url: 'https://wxs.ign.fr/pratique/geoportail/wmts',
|
||||||
layer: 'GEOGRAPHICALGRIDSYSTEMS.MAPS',
|
layer: 'GEOGRAPHICALGRIDSYSTEMS.MAPS',
|
||||||
matrixSet: 'PM',
|
matrixSet: 'PM',
|
||||||
format: 'image/jpeg',
|
format: 'image/jpeg',
|
||||||
|
|||||||
16
package.json
16
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ol",
|
"name": "ol",
|
||||||
"version": "5.1.1",
|
"version": "5.2.0",
|
||||||
"description": "OpenLayers mapping library",
|
"description": "OpenLayers mapping library",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"map",
|
"map",
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
"buble": "^0.19.3",
|
"buble": "^0.19.3",
|
||||||
"buble-loader": "^0.5.1",
|
"buble-loader": "^0.5.1",
|
||||||
"chaikin-smooth": "^1.0.4",
|
"chaikin-smooth": "^1.0.4",
|
||||||
"clean-css-cli": "4.1.11",
|
"clean-css-cli": "4.2.1",
|
||||||
"copy-webpack-plugin": "^4.4.1",
|
"copy-webpack-plugin": "^4.4.1",
|
||||||
"coveralls": "3.0.1",
|
"coveralls": "3.0.1",
|
||||||
"eslint": "5.0.1",
|
"eslint": "5.0.1",
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
"istanbul": "0.4.5",
|
"istanbul": "0.4.5",
|
||||||
"jquery": "3.3.1",
|
"jquery": "3.3.1",
|
||||||
"jsdoc": "3.5.5",
|
"jsdoc": "3.5.5",
|
||||||
"karma": "^2.0.0",
|
"karma": "^3.0.0",
|
||||||
"karma-chrome-launcher": "2.2.0",
|
"karma-chrome-launcher": "2.2.0",
|
||||||
"karma-coverage": "^1.1.1",
|
"karma-coverage": "^1.1.1",
|
||||||
"karma-firefox-launcher": "^1.1.0",
|
"karma-firefox-launcher": "^1.1.0",
|
||||||
@@ -62,14 +62,14 @@
|
|||||||
"karma-sauce-launcher": "1.2.0",
|
"karma-sauce-launcher": "1.2.0",
|
||||||
"karma-sourcemap-loader": "^0.3.7",
|
"karma-sourcemap-loader": "^0.3.7",
|
||||||
"karma-webpack": "4.0.0-beta.0",
|
"karma-webpack": "4.0.0-beta.0",
|
||||||
"marked": "0.4.0",
|
"marked": "0.5.0",
|
||||||
"mocha": "5.2.0",
|
"mocha": "5.2.0",
|
||||||
"mustache": "^2.3.0",
|
"mustache": "^2.3.0",
|
||||||
"pixelmatch": "^4.0.2",
|
"pixelmatch": "^4.0.2",
|
||||||
"proj4": "2.4.4",
|
"proj4": "2.5.0",
|
||||||
"rollup": "0.63.4",
|
"rollup": "0.65.0",
|
||||||
"rollup-plugin-buble": "0.19.2",
|
"rollup-plugin-buble": "0.19.2",
|
||||||
"rollup-plugin-commonjs": "9.1.3",
|
"rollup-plugin-commonjs": "9.1.6",
|
||||||
"rollup-plugin-node-resolve": "3.3.0",
|
"rollup-plugin-node-resolve": "3.3.0",
|
||||||
"rollup-plugin-sourcemaps": "0.4.2",
|
"rollup-plugin-sourcemaps": "0.4.2",
|
||||||
"rollup-plugin-uglify": "4.0.0",
|
"rollup-plugin-uglify": "4.0.0",
|
||||||
@@ -77,7 +77,7 @@
|
|||||||
"uglifyjs-webpack-plugin": "^1.2.5",
|
"uglifyjs-webpack-plugin": "^1.2.5",
|
||||||
"url-polyfill": "^1.0.13",
|
"url-polyfill": "^1.0.13",
|
||||||
"walk": "^2.3.9",
|
"walk": "^2.3.9",
|
||||||
"webpack": "4.16.1",
|
"webpack": "4.17.1",
|
||||||
"webpack-cli": "^3.0.8",
|
"webpack-cli": "^3.0.8",
|
||||||
"webpack-dev-server": "^3.1.4"
|
"webpack-dev-server": "^3.1.4"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ export class CollectionEvent extends Event {
|
|||||||
class Collection extends BaseObject {
|
class Collection extends BaseObject {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array.<T>=} opt_array Array.
|
* @param {Array<T>=} opt_array Array.
|
||||||
* @param {module:ol/Collection~Options=} opt_options Collection options.
|
* @param {module:ol/Collection~Options=} opt_options Collection options.
|
||||||
*/
|
*/
|
||||||
constructor(opt_array, opt_options) {
|
constructor(opt_array, opt_options) {
|
||||||
@@ -79,7 +79,7 @@ class Collection extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {!Array.<T>}
|
* @type {!Array<T>}
|
||||||
*/
|
*/
|
||||||
this.array_ = opt_array ? opt_array : [];
|
this.array_ = opt_array ? opt_array : [];
|
||||||
|
|
||||||
@@ -106,8 +106,8 @@ class Collection extends BaseObject {
|
|||||||
/**
|
/**
|
||||||
* Add elements to the collection. This pushes each item in the provided array
|
* Add elements to the collection. This pushes each item in the provided array
|
||||||
* to the end of the collection.
|
* to the end of the collection.
|
||||||
* @param {!Array.<T>} arr Array.
|
* @param {!Array<T>} arr Array.
|
||||||
* @return {module:ol/Collection.<T>} This collection.
|
* @return {module:ol/Collection<T>} This collection.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
extend(arr) {
|
extend(arr) {
|
||||||
@@ -119,7 +119,7 @@ class Collection extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Iterate over each element, calling the provided callback.
|
* Iterate over each element, calling the provided callback.
|
||||||
* @param {function(T, number, Array.<T>): *} f The function to call
|
* @param {function(T, number, Array<T>): *} f The function to call
|
||||||
* for every element. This function takes 3 arguments (the element, the
|
* for every element. This function takes 3 arguments (the element, the
|
||||||
* index and the array). The return value is ignored.
|
* index and the array). The return value is ignored.
|
||||||
* @api
|
* @api
|
||||||
@@ -136,7 +136,7 @@ class Collection extends BaseObject {
|
|||||||
* is mutated, no events will be dispatched by the collection, and the
|
* is mutated, no events will be dispatched by the collection, and the
|
||||||
* collection's "length" property won't be in sync with the actual length
|
* collection's "length" property won't be in sync with the actual length
|
||||||
* of the array.
|
* of the array.
|
||||||
* @return {!Array.<T>} Array.
|
* @return {!Array<T>} Array.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getArray() {
|
getArray() {
|
||||||
|
|||||||
@@ -1,12 +1,22 @@
|
|||||||
/**
|
/**
|
||||||
* @module ol/Disposable
|
* @module ol/Disposable
|
||||||
*/
|
*/
|
||||||
import {UNDEFINED} from './functions.js';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @classdesc
|
||||||
* Objects that need to clean up after themselves.
|
* Objects that need to clean up after themselves.
|
||||||
*/
|
*/
|
||||||
class Disposable {
|
class Disposable {
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
/**
|
||||||
|
* The object has already been disposed.
|
||||||
|
* @type {boolean}
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
this.disposed_ = false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clean up.
|
* Clean up.
|
||||||
*/
|
*/
|
||||||
@@ -16,18 +26,12 @@ class Disposable {
|
|||||||
this.disposeInternal();
|
this.disposeInternal();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The object has already been disposed.
|
|
||||||
* @type {boolean}
|
|
||||||
* @private
|
|
||||||
*/
|
|
||||||
Disposable.prototype.disposed_ = false;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Extension point for disposable objects.
|
* Extension point for disposable objects.
|
||||||
* @protected
|
* @protected
|
||||||
*/
|
*/
|
||||||
Disposable.prototype.disposeInternal = UNDEFINED;
|
disposeInternal() {}
|
||||||
|
}
|
||||||
|
|
||||||
export default Disposable;
|
export default Disposable;
|
||||||
|
|||||||
@@ -53,9 +53,8 @@ import Style from './style/Style.js';
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
class Feature extends BaseObject {
|
class Feature extends BaseObject {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/geom/Geometry|Object.<string, *>=} opt_geometryOrProperties
|
* @param {module:ol/geom/Geometry|Object<string, *>=} opt_geometryOrProperties
|
||||||
* You may pass a Geometry object directly, or an object literal containing
|
* You may pass a Geometry object directly, or an object literal containing
|
||||||
* properties. If you pass an object literal, you may include a Geometry
|
* properties. If you pass an object literal, you may include a Geometry
|
||||||
* associated with a `geometry` key.
|
* associated with a `geometry` key.
|
||||||
@@ -79,7 +78,7 @@ class Feature extends BaseObject {
|
|||||||
/**
|
/**
|
||||||
* User provided style.
|
* User provided style.
|
||||||
* @private
|
* @private
|
||||||
* @type {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction}
|
* @type {module:ol/style/Style|Array<module:ol/style/Style>|module:ol/style/Style~StyleFunction}
|
||||||
*/
|
*/
|
||||||
this.style_ = null;
|
this.style_ = null;
|
||||||
|
|
||||||
@@ -105,7 +104,7 @@ class Feature extends BaseObject {
|
|||||||
const geometry = opt_geometryOrProperties;
|
const geometry = opt_geometryOrProperties;
|
||||||
this.setGeometry(geometry);
|
this.setGeometry(geometry);
|
||||||
} else {
|
} else {
|
||||||
/** @type {Object.<string, *>} */
|
/** @type {Object<string, *>} */
|
||||||
const properties = opt_geometryOrProperties;
|
const properties = opt_geometryOrProperties;
|
||||||
this.setProperties(properties);
|
this.setProperties(properties);
|
||||||
}
|
}
|
||||||
@@ -171,7 +170,7 @@ class Feature extends BaseObject {
|
|||||||
/**
|
/**
|
||||||
* Get the feature's style. Will return what was provided to the
|
* Get the feature's style. Will return what was provided to the
|
||||||
* {@link module:ol/Feature~Feature#setStyle} method.
|
* {@link module:ol/Feature~Feature#setStyle} method.
|
||||||
* @return {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction} The feature style.
|
* @return {module:ol/style/Style|Array<module:ol/style/Style>|module:ol/style/Style~StyleFunction} The feature style.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getStyle() {
|
getStyle() {
|
||||||
@@ -226,7 +225,7 @@ class Feature extends BaseObject {
|
|||||||
* Set the style for the feature. This can be a single style object, an array
|
* Set the style for the feature. This can be a single style object, an array
|
||||||
* of styles, or a function that takes a resolution and returns an array of
|
* of styles, or a function that takes a resolution and returns an array of
|
||||||
* styles. If it is `null` the feature has no style (a `null` style).
|
* styles. If it is `null` the feature has no style (a `null` style).
|
||||||
* @param {module:ol/style/Style|Array.<module:ol/style/Style>|module:ol/style/Style~StyleFunction} style Style for this feature.
|
* @param {module:ol/style/Style|Array<module:ol/style/Style>|module:ol/style/Style~StyleFunction} style Style for this feature.
|
||||||
* @api
|
* @api
|
||||||
* @fires module:ol/events/Event~Event#event:change
|
* @fires module:ol/events/Event~Event#event:change
|
||||||
*/
|
*/
|
||||||
@@ -274,7 +273,7 @@ class Feature extends BaseObject {
|
|||||||
* Convert the provided object into a feature style function. Functions passed
|
* Convert the provided object into a feature style function. Functions passed
|
||||||
* through unchanged. Arrays of module:ol/style/Style or single style objects wrapped
|
* through unchanged. Arrays of module:ol/style/Style or single style objects wrapped
|
||||||
* in a new feature style function.
|
* in a new feature style function.
|
||||||
* @param {module:ol/style/Style~StyleFunction|!Array.<module:ol/style/Style>|!module:ol/style/Style} obj
|
* @param {module:ol/style/Style~StyleFunction|!Array<module:ol/style/Style>|!module:ol/style/Style} obj
|
||||||
* A feature style function, a single style, or an array of styles.
|
* A feature style function, a single style, or an array of styles.
|
||||||
* @return {module:ol/style/Style~StyleFunction} A style function.
|
* @return {module:ol/style/Style~StyleFunction} A style function.
|
||||||
*/
|
*/
|
||||||
@@ -283,7 +282,7 @@ export function createStyleFunction(obj) {
|
|||||||
return obj;
|
return obj;
|
||||||
} else {
|
} else {
|
||||||
/**
|
/**
|
||||||
* @type {Array.<module:ol/style/Style>}
|
* @type {Array<module:ol/style/Style>}
|
||||||
*/
|
*/
|
||||||
let styles;
|
let styles;
|
||||||
if (Array.isArray(obj)) {
|
if (Array.isArray(obj)) {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ const DEFAULT_STROKE_STYLE = new Stroke({
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO can be configurable
|
* TODO can be configurable
|
||||||
* @type {Array.<number>}
|
* @type {Array<number>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
const INTERVALS = [
|
const INTERVALS = [
|
||||||
@@ -200,13 +200,13 @@ class Graticule {
|
|||||||
this.maxLines_ = options.maxLines !== undefined ? options.maxLines : 100;
|
this.maxLines_ = options.maxLines !== undefined ? options.maxLines : 100;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Array.<module:ol/geom/LineString>}
|
* @type {Array<module:ol/geom/LineString>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.meridians_ = [];
|
this.meridians_ = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Array.<module:ol/geom/LineString>}
|
* @type {Array<module:ol/geom/LineString>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.parallels_ = [];
|
this.parallels_ = [];
|
||||||
@@ -236,13 +236,13 @@ class Graticule {
|
|||||||
this.projectionCenterLonLat_ = null;
|
this.projectionCenterLonLat_ = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Array.<module:ol/Graticule~GraticuleLabelDataType>}
|
* @type {Array<module:ol/Graticule~GraticuleLabelDataType>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.meridiansLabels_ = null;
|
this.meridiansLabels_ = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Array.<module:ol/Graticule~GraticuleLabelDataType>}
|
* @type {Array<module:ol/Graticule~GraticuleLabelDataType>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.parallelsLabels_ = null;
|
this.parallelsLabels_ = null;
|
||||||
@@ -364,7 +364,7 @@ class Graticule {
|
|||||||
const coordinate = [flatCoordinates[0], lat];
|
const coordinate = [flatCoordinates[0], lat];
|
||||||
let point;
|
let point;
|
||||||
if (index in this.meridiansLabels_) {
|
if (index in this.meridiansLabels_) {
|
||||||
point = this.meridiansLabels_[index];
|
point = this.meridiansLabels_[index].geom;
|
||||||
point.setCoordinates(coordinate);
|
point.setCoordinates(coordinate);
|
||||||
} else {
|
} else {
|
||||||
point = new Point(coordinate);
|
point = new Point(coordinate);
|
||||||
@@ -414,7 +414,7 @@ class Graticule {
|
|||||||
const coordinate = [lon, flatCoordinates[1]];
|
const coordinate = [lon, flatCoordinates[1]];
|
||||||
let point;
|
let point;
|
||||||
if (index in this.parallelsLabels_) {
|
if (index in this.parallelsLabels_) {
|
||||||
point = this.parallelsLabels_[index];
|
point = this.parallelsLabels_[index].geom;
|
||||||
point.setCoordinates(coordinate);
|
point.setCoordinates(coordinate);
|
||||||
} else {
|
} else {
|
||||||
point = new Point(coordinate);
|
point = new Point(coordinate);
|
||||||
@@ -526,9 +526,9 @@ class Graticule {
|
|||||||
const centerLat = this.projectionCenterLonLat_[1];
|
const centerLat = this.projectionCenterLonLat_[1];
|
||||||
let interval = -1;
|
let interval = -1;
|
||||||
const target = Math.pow(this.targetSize_ * resolution, 2);
|
const target = Math.pow(this.targetSize_ * resolution, 2);
|
||||||
/** @type {Array.<number>} **/
|
/** @type {Array<number>} **/
|
||||||
const p1 = [];
|
const p1 = [];
|
||||||
/** @type {Array.<number>} **/
|
/** @type {Array<number>} **/
|
||||||
const p2 = [];
|
const p2 = [];
|
||||||
for (let i = 0, ii = INTERVALS.length; i < ii; ++i) {
|
for (let i = 0, ii = INTERVALS.length; i < ii; ++i) {
|
||||||
const delta = INTERVALS[i] / 2;
|
const delta = INTERVALS[i] / 2;
|
||||||
@@ -579,7 +579,7 @@ class Graticule {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the list of meridians. Meridians are lines of equal longitude.
|
* Get the list of meridians. Meridians are lines of equal longitude.
|
||||||
* @return {Array.<module:ol/geom/LineString>} The meridians.
|
* @return {Array<module:ol/geom/LineString>} The meridians.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getMeridians() {
|
getMeridians() {
|
||||||
@@ -609,7 +609,7 @@ class Graticule {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the list of parallels. Parallels are lines of equal latitude.
|
* Get the list of parallels. Parallels are lines of equal latitude.
|
||||||
* @return {Array.<module:ol/geom/LineString>} The parallels.
|
* @return {Array<module:ol/geom/LineString>} The parallels.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getParallels() {
|
getParallels() {
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ class ImageWrapper extends ImageBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array.<module:ol/events~EventsKey>}
|
* @type {Array<module:ol/events~EventsKey>}
|
||||||
*/
|
*/
|
||||||
this.imageListenerKeys_ = null;
|
this.imageListenerKeys_ = null;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* @module ol/ImageBase
|
* @module ol/ImageBase
|
||||||
*/
|
*/
|
||||||
import EventTarget from './events/EventTarget.js';
|
import EventTarget from './events/Target.js';
|
||||||
import EventType from './events/EventType.js';
|
import EventType from './events/EventType.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ class ImageTile extends Tile {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array.<module:ol/events~EventsKey>}
|
* @type {Array<module:ol/events~EventsKey>}
|
||||||
*/
|
*/
|
||||||
this.imageListenerKeys_ = null;
|
this.imageListenerKeys_ = null;
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class Kinetic {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array.<number>}
|
* @type {Array<number>}
|
||||||
*/
|
*/
|
||||||
this.points_ = [];
|
this.points_ = [];
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import MapEvent from './MapEvent.js';
|
|||||||
/**
|
/**
|
||||||
* @classdesc
|
* @classdesc
|
||||||
* Events emitted as map browser events are instances of this type.
|
* Events emitted as map browser events are instances of this type.
|
||||||
* See {@link module:ol/Map~Map} for which events trigger a map browser event.
|
* See {@link module:ol/PluggableMap~PluggableMap} for which events trigger a map browser event.
|
||||||
*/
|
*/
|
||||||
class MapBrowserEvent extends MapEvent {
|
class MapBrowserEvent extends MapEvent {
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {DEVICE_PIXEL_RATIO} from './has.js';
|
|||||||
import MapBrowserEventType from './MapBrowserEventType.js';
|
import MapBrowserEventType from './MapBrowserEventType.js';
|
||||||
import MapBrowserPointerEvent from './MapBrowserPointerEvent.js';
|
import MapBrowserPointerEvent from './MapBrowserPointerEvent.js';
|
||||||
import {listen, unlistenByKey} from './events.js';
|
import {listen, unlistenByKey} from './events.js';
|
||||||
import EventTarget from './events/EventTarget.js';
|
import EventTarget from './events/Target.js';
|
||||||
import PointerEventType from './pointer/EventType.js';
|
import PointerEventType from './pointer/EventType.js';
|
||||||
import PointerEventHandler from './pointer/PointerEventHandler.js';
|
import PointerEventHandler from './pointer/PointerEventHandler.js';
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ class MapBrowserEventHandler extends EventTarget {
|
|||||||
this.dragging_ = false;
|
this.dragging_ = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {!Array.<module:ol/events~EventsKey>}
|
* @type {!Array<module:ol/events~EventsKey>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.dragListenerKeys_ = [];
|
this.dragListenerKeys_ = [];
|
||||||
@@ -68,7 +68,7 @@ class MapBrowserEventHandler extends EventTarget {
|
|||||||
this.activePointers_ = 0;
|
this.activePointers_ = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {!Object.<number, boolean>}
|
* @type {!Object<number, boolean>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.trackedTouches_ = {};
|
this.trackedTouches_ = {};
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import Event from './events/Event.js';
|
|||||||
/**
|
/**
|
||||||
* @classdesc
|
* @classdesc
|
||||||
* Events emitted as map events are instances of this type.
|
* Events emitted as map events are instances of this type.
|
||||||
* See {@link module:ol/Map~Map} for which events trigger a map event.
|
* See {@link module:ol/PluggableMap~PluggableMap} for which events trigger a map event.
|
||||||
*/
|
*/
|
||||||
class MapEvent extends Event {
|
class MapEvent extends Event {
|
||||||
|
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ class ObjectEvent extends Event {
|
|||||||
class BaseObject extends Observable {
|
class BaseObject extends Observable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Object.<string, *>=} opt_values An object with key-value pairs.
|
* @param {Object<string, *>=} opt_values An object with key-value pairs.
|
||||||
*/
|
*/
|
||||||
constructor(opt_values) {
|
constructor(opt_values) {
|
||||||
super();
|
super();
|
||||||
@@ -101,7 +101,7 @@ class BaseObject extends Observable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {!Object.<string, *>}
|
* @type {!Object<string, *>}
|
||||||
*/
|
*/
|
||||||
this.values_ = {};
|
this.values_ = {};
|
||||||
|
|
||||||
@@ -126,7 +126,7 @@ class BaseObject extends Observable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a list of object property names.
|
* Get a list of object property names.
|
||||||
* @return {Array.<string>} List of property names.
|
* @return {Array<string>} List of property names.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getKeys() {
|
getKeys() {
|
||||||
@@ -135,7 +135,7 @@ class BaseObject extends Observable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get an object of all property names and values.
|
* Get an object of all property names and values.
|
||||||
* @return {Object.<string, *>} Object.
|
* @return {Object<string, *>} Object.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getProperties() {
|
getProperties() {
|
||||||
@@ -176,7 +176,7 @@ class BaseObject extends Observable {
|
|||||||
/**
|
/**
|
||||||
* Sets a collection of key-value pairs. Note that this changes any existing
|
* Sets a collection of key-value pairs. Note that this changes any existing
|
||||||
* properties and adds new ones (it does not remove any existing properties).
|
* properties and adds new ones (it does not remove any existing properties).
|
||||||
* @param {Object.<string, *>} values Values.
|
* @param {Object<string, *>} values Values.
|
||||||
* @param {boolean=} opt_silent Update without triggering an event.
|
* @param {boolean=} opt_silent Update without triggering an event.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -205,7 +205,7 @@ class BaseObject extends Observable {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object.<string, string>}
|
* @type {Object<string, string>}
|
||||||
*/
|
*/
|
||||||
const changeEventTypeCache = {};
|
const changeEventTypeCache = {};
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @module ol/Observable
|
* @module ol/Observable
|
||||||
*/
|
*/
|
||||||
import {listen, unlistenByKey, unlisten, listenOnce} from './events.js';
|
import {listen, unlistenByKey, unlisten, listenOnce} from './events.js';
|
||||||
import EventTarget from './events/EventTarget.js';
|
import EventTarget from './events/Target.js';
|
||||||
import EventType from './events/EventType.js';
|
import EventType from './events/EventType.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -50,9 +50,9 @@ class Observable extends EventTarget {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Listen for a certain type of event.
|
* Listen for a certain type of event.
|
||||||
* @param {string|Array.<string>} type The event type or array of event types.
|
* @param {string|Array<string>} type The event type or array of event types.
|
||||||
* @param {function(?): ?} listener The listener function.
|
* @param {function(?): ?} listener The listener function.
|
||||||
* @return {module:ol/events~EventsKey|Array.<module:ol/events~EventsKey>} Unique key for the listener. If
|
* @return {module:ol/events~EventsKey|Array<module:ol/events~EventsKey>} Unique key for the listener. If
|
||||||
* called with an array of event types as the first argument, the return
|
* called with an array of event types as the first argument, the return
|
||||||
* will be an array of keys.
|
* will be an array of keys.
|
||||||
* @api
|
* @api
|
||||||
@@ -72,9 +72,9 @@ class Observable extends EventTarget {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Listen once for a certain type of event.
|
* Listen once for a certain type of event.
|
||||||
* @param {string|Array.<string>} type The event type or array of event types.
|
* @param {string|Array<string>} type The event type or array of event types.
|
||||||
* @param {function(?): ?} listener The listener function.
|
* @param {function(?): ?} listener The listener function.
|
||||||
* @return {module:ol/events~EventsKey|Array.<module:ol/events~EventsKey>} Unique key for the listener. If
|
* @return {module:ol/events~EventsKey|Array<module:ol/events~EventsKey>} Unique key for the listener. If
|
||||||
* called with an array of event types as the first argument, the return
|
* called with an array of event types as the first argument, the return
|
||||||
* will be an array of keys.
|
* will be an array of keys.
|
||||||
* @api
|
* @api
|
||||||
@@ -94,7 +94,7 @@ class Observable extends EventTarget {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Unlisten for a certain type of event.
|
* Unlisten for a certain type of event.
|
||||||
* @param {string|Array.<string>} type The event type or array of event types.
|
* @param {string|Array<string>} type The event type or array of event types.
|
||||||
* @param {function(?): ?} listener The listener function.
|
* @param {function(?): ?} listener The listener function.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -113,7 +113,7 @@ class Observable extends EventTarget {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes an event listener using the key returned by `on()` or `once()`.
|
* Removes an event listener using the key returned by `on()` or `once()`.
|
||||||
* @param {module:ol/events~EventsKey|Array.<module:ol/events~EventsKey>} key The key returned by `on()`
|
* @param {module:ol/events~EventsKey|Array<module:ol/events~EventsKey>} key The key returned by `on()`
|
||||||
* or `once()` (or an array of keys).
|
* or `once()` (or an array of keys).
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import {containsExtent} from './extent.js';
|
|||||||
* @property {number|string} [id] Set the overlay id. The overlay id can be used
|
* @property {number|string} [id] Set the overlay id. The overlay id can be used
|
||||||
* with the {@link module:ol/Map~Map#getOverlayById} method.
|
* with the {@link module:ol/Map~Map#getOverlayById} method.
|
||||||
* @property {HTMLElement} [element] The overlay element.
|
* @property {HTMLElement} [element] The overlay element.
|
||||||
* @property {Array.<number>} [offset=[0, 0]] Offsets in pixels used when positioning
|
* @property {Array<number>} [offset=[0, 0]] Offsets in pixels used when positioning
|
||||||
* the overlay. The first element in the
|
* the overlay. The first element in the
|
||||||
* array is the horizontal offset. A positive value shifts the overlay right.
|
* array is the horizontal offset. A positive value shifts the overlay right.
|
||||||
* The second element in the array is the vertical offset. A positive value
|
* The second element in the array is the vertical offset. A positive value
|
||||||
@@ -132,7 +132,7 @@ class Overlay extends BaseObject {
|
|||||||
* @protected
|
* @protected
|
||||||
* @type {HTMLElement}
|
* @type {HTMLElement}
|
||||||
*/
|
*/
|
||||||
this.element = document.createElement('DIV');
|
this.element = document.createElement('div');
|
||||||
this.element.className = options.className !== undefined ?
|
this.element.className = options.className !== undefined ?
|
||||||
options.className : 'ol-overlay-container ' + CLASS_SELECTABLE;
|
options.className : 'ol-overlay-container ' + CLASS_SELECTABLE;
|
||||||
this.element.style.position = 'absolute';
|
this.element.style.position = 'absolute';
|
||||||
@@ -248,12 +248,12 @@ class Overlay extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the offset of this overlay.
|
* Get the offset of this overlay.
|
||||||
* @return {Array.<number>} The offset.
|
* @return {Array<number>} The offset.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getOffset() {
|
getOffset() {
|
||||||
return /** @type {Array.<number>} */ (this.get(Property.OFFSET));
|
return /** @type {Array<number>} */ (this.get(Property.OFFSET));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -371,7 +371,7 @@ class Overlay extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the offset for this overlay.
|
* Set the offset for this overlay.
|
||||||
* @param {Array.<number>} offset Offset.
|
* @param {Array<number>} offset Offset.
|
||||||
* @observable
|
* @observable
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import MapBrowserEventType from './MapBrowserEventType.js';
|
|||||||
import MapEvent from './MapEvent.js';
|
import MapEvent from './MapEvent.js';
|
||||||
import MapEventType from './MapEventType.js';
|
import MapEventType from './MapEventType.js';
|
||||||
import MapProperty from './MapProperty.js';
|
import MapProperty from './MapProperty.js';
|
||||||
|
import RenderEventType from './render/EventType.js';
|
||||||
import BaseObject, {getChangeEventType} from './Object.js';
|
import BaseObject, {getChangeEventType} from './Object.js';
|
||||||
import ObjectEventType from './ObjectEventType.js';
|
import ObjectEventType from './ObjectEventType.js';
|
||||||
import TileQueue from './TileQueue.js';
|
import TileQueue from './TileQueue.js';
|
||||||
@@ -41,16 +42,16 @@ import {create as createTransform, apply as applyTransform} from './transform.js
|
|||||||
* @property {null|module:ol/extent~Extent} extent
|
* @property {null|module:ol/extent~Extent} extent
|
||||||
* @property {module:ol/coordinate~Coordinate} focus
|
* @property {module:ol/coordinate~Coordinate} focus
|
||||||
* @property {number} index
|
* @property {number} index
|
||||||
* @property {Object.<number, module:ol/layer/Layer~State>} layerStates
|
* @property {Object<number, module:ol/layer/Layer~State>} layerStates
|
||||||
* @property {Array.<module:ol/layer/Layer~State>} layerStatesArray
|
* @property {Array<module:ol/layer/Layer~State>} layerStatesArray
|
||||||
* @property {module:ol/transform~Transform} pixelToCoordinateTransform
|
* @property {module:ol/transform~Transform} pixelToCoordinateTransform
|
||||||
* @property {Array.<module:ol/PluggableMap~PostRenderFunction>} postRenderFunctions
|
* @property {Array<module:ol/PluggableMap~PostRenderFunction>} postRenderFunctions
|
||||||
* @property {module:ol/size~Size} size
|
* @property {module:ol/size~Size} size
|
||||||
* @property {!Object.<string, boolean>} skippedFeatureUids
|
* @property {!Object<string, boolean>} skippedFeatureUids
|
||||||
* @property {module:ol/TileQueue} tileQueue
|
* @property {module:ol/TileQueue} tileQueue
|
||||||
* @property {Object.<string, Object.<string, module:ol/TileRange>>} usedTiles
|
* @property {Object<string, Object<string, module:ol/TileRange>>} usedTiles
|
||||||
* @property {Array.<number>} viewHints
|
* @property {Array<number>} viewHints
|
||||||
* @property {!Object.<string, Object.<string, boolean>>} wantedTiles
|
* @property {!Object<string, Object<string, boolean>>} wantedTiles
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -61,7 +62,7 @@ import {create as createTransform, apply as applyTransform} from './transform.js
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} AtPixelOptions
|
* @typedef {Object} AtPixelOptions
|
||||||
* @property {((function(module:ol/layer/Layer): boolean)|undefined)} layerFilter Layer filter
|
* @property {undefined|function(module:ol/layer/Layer): boolean} layerFilter Layer filter
|
||||||
* function. The filter function will receive one argument, the
|
* function. The filter function will receive one argument, the
|
||||||
* {@link module:ol/layer/Layer layer-candidate} and it should return a boolean value.
|
* {@link module:ol/layer/Layer layer-candidate} and it should return a boolean value.
|
||||||
* Only layers which are visible and for which this function returns `true`
|
* Only layers which are visible and for which this function returns `true`
|
||||||
@@ -74,23 +75,23 @@ import {create as createTransform, apply as applyTransform} from './transform.js
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} MapOptionsInternal
|
* @typedef {Object} MapOptionsInternal
|
||||||
* @property {module:ol/Collection.<module:ol/control/Control>} [controls]
|
* @property {module:ol/Collection<module:ol/control/Control>} [controls]
|
||||||
* @property {module:ol/Collection.<module:ol/interaction/Interaction>} [interactions]
|
* @property {module:ol/Collection<module:ol/interaction/Interaction>} [interactions]
|
||||||
* @property {HTMLElement|Document} keyboardEventTarget
|
* @property {HTMLElement|Document} keyboardEventTarget
|
||||||
* @property {module:ol/Collection.<module:ol/Overlay>} overlays
|
* @property {module:ol/Collection<module:ol/Overlay>} overlays
|
||||||
* @property {Object.<string, *>} values
|
* @property {Object<string, *>} values
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Object literal with config options for the map.
|
* Object literal with config options for the map.
|
||||||
* @typedef {Object} MapOptions
|
* @typedef {Object} MapOptions
|
||||||
* @property {module:ol/Collection.<module:ol/control/Control>|Array.<module:ol/control/Control>} [controls]
|
* @property {module:ol/Collection<module:ol/control/Control>|Array<module:ol/control/Control>} [controls]
|
||||||
* Controls initially added to the map. If not specified,
|
* Controls initially added to the map. If not specified,
|
||||||
* {@link module:ol/control/util~defaults} is used.
|
* {@link module:ol/control/util~defaults} is used.
|
||||||
* @property {number} [pixelRatio=window.devicePixelRatio] The ratio between
|
* @property {number} [pixelRatio=window.devicePixelRatio] The ratio between
|
||||||
* physical pixels and device-independent pixels (dips) on the device.
|
* physical pixels and device-independent pixels (dips) on the device.
|
||||||
* @property {module:ol/Collection.<module:ol/interaction/Interaction>|Array.<module:ol/interaction/Interaction>} [interactions]
|
* @property {module:ol/Collection<module:ol/interaction/Interaction>|Array<module:ol/interaction/Interaction>} [interactions]
|
||||||
* Interactions that are initially added to the map. If not specified,
|
* Interactions that are initially added to the map. If not specified,
|
||||||
* {@link module:ol/interaction~defaults} is used.
|
* {@link module:ol/interaction~defaults} is used.
|
||||||
* @property {HTMLElement|Document|string} [keyboardEventTarget] The element to
|
* @property {HTMLElement|Document|string} [keyboardEventTarget] The element to
|
||||||
@@ -101,7 +102,7 @@ import {create as createTransform, apply as applyTransform} from './transform.js
|
|||||||
* map target (i.e. the user-provided div for the map). If this is not
|
* map target (i.e. the user-provided div for the map). If this is not
|
||||||
* `document`, the target element needs to be focused for key events to be
|
* `document`, the target element needs to be focused for key events to be
|
||||||
* emitted, requiring that the target element has a `tabindex` attribute.
|
* emitted, requiring that the target element has a `tabindex` attribute.
|
||||||
* @property {Array.<module:ol/layer/Base>|module:ol/Collection.<module:ol/layer/Base>} [layers]
|
* @property {Array<module:ol/layer/Base>|module:ol/Collection<module:ol/layer/Base>} [layers]
|
||||||
* Layers. If this is not defined, a map with no layers will be rendered. Note
|
* Layers. If this is not defined, a map with no layers will be rendered. Note
|
||||||
* that layers are rendered in the order supplied, so if you want, for example,
|
* that layers are rendered in the order supplied, so if you want, for example,
|
||||||
* a vector layer to appear on top of a tile layer, it must come after the tile
|
* a vector layer to appear on top of a tile layer, it must come after the tile
|
||||||
@@ -118,7 +119,7 @@ import {create as createTransform, apply as applyTransform} from './transform.js
|
|||||||
* @property {number} [moveTolerance=1] The minimum distance in pixels the
|
* @property {number} [moveTolerance=1] The minimum distance in pixels the
|
||||||
* cursor must move to be detected as a map move event instead of a click.
|
* cursor must move to be detected as a map move event instead of a click.
|
||||||
* Increasing this value can make it easier to click on the map.
|
* Increasing this value can make it easier to click on the map.
|
||||||
* @property {module:ol/Collection.<module:ol/Overlay>|Array.<module:ol/Overlay>} [overlays]
|
* @property {module:ol/Collection<module:ol/Overlay>|Array<module:ol/Overlay>} [overlays]
|
||||||
* Overlays initially added to the map. By default, no overlays are added.
|
* Overlays initially added to the map. By default, no overlays are added.
|
||||||
* @property {HTMLElement|string} [target] The container for the map, either the
|
* @property {HTMLElement|string} [target] The container for the map, either the
|
||||||
* element itself or the `id` of the element. If not specified at construction
|
* element itself or the `id` of the element. If not specified at construction
|
||||||
@@ -135,6 +136,7 @@ import {create as createTransform, apply as applyTransform} from './transform.js
|
|||||||
* @fires module:ol/MapEvent~MapEvent
|
* @fires module:ol/MapEvent~MapEvent
|
||||||
* @fires module:ol/render/Event~RenderEvent#postcompose
|
* @fires module:ol/render/Event~RenderEvent#postcompose
|
||||||
* @fires module:ol/render/Event~RenderEvent#precompose
|
* @fires module:ol/render/Event~RenderEvent#precompose
|
||||||
|
* @fires module:ol/render/Event~RenderEvent#rendercomplete
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
class PluggableMap extends BaseObject {
|
class PluggableMap extends BaseObject {
|
||||||
@@ -236,7 +238,7 @@ class PluggableMap extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array.<module:ol/events~EventsKey>}
|
* @type {Array<module:ol/events~EventsKey>}
|
||||||
*/
|
*/
|
||||||
this.layerGroupPropertyListenerKeys_ = null;
|
this.layerGroupPropertyListenerKeys_ = null;
|
||||||
|
|
||||||
@@ -244,7 +246,7 @@ class PluggableMap extends BaseObject {
|
|||||||
* @private
|
* @private
|
||||||
* @type {!HTMLElement}
|
* @type {!HTMLElement}
|
||||||
*/
|
*/
|
||||||
this.viewport_ = document.createElement('DIV');
|
this.viewport_ = document.createElement('div');
|
||||||
this.viewport_.className = 'ol-viewport' + (TOUCH ? ' ol-touch' : '');
|
this.viewport_.className = 'ol-viewport' + (TOUCH ? ' ol-touch' : '');
|
||||||
this.viewport_.style.position = 'relative';
|
this.viewport_.style.position = 'relative';
|
||||||
this.viewport_.style.overflow = 'hidden';
|
this.viewport_.style.overflow = 'hidden';
|
||||||
@@ -258,7 +260,7 @@ class PluggableMap extends BaseObject {
|
|||||||
* @private
|
* @private
|
||||||
* @type {!HTMLElement}
|
* @type {!HTMLElement}
|
||||||
*/
|
*/
|
||||||
this.overlayContainer_ = document.createElement('DIV');
|
this.overlayContainer_ = document.createElement('div');
|
||||||
this.overlayContainer_.className = 'ol-overlaycontainer';
|
this.overlayContainer_.className = 'ol-overlaycontainer';
|
||||||
this.viewport_.appendChild(this.overlayContainer_);
|
this.viewport_.appendChild(this.overlayContainer_);
|
||||||
|
|
||||||
@@ -266,7 +268,7 @@ class PluggableMap extends BaseObject {
|
|||||||
* @private
|
* @private
|
||||||
* @type {!HTMLElement}
|
* @type {!HTMLElement}
|
||||||
*/
|
*/
|
||||||
this.overlayContainerStopEvent_ = document.createElement('DIV');
|
this.overlayContainerStopEvent_ = document.createElement('div');
|
||||||
this.overlayContainerStopEvent_.className = 'ol-overlaycontainer-stopevent';
|
this.overlayContainerStopEvent_.className = 'ol-overlaycontainer-stopevent';
|
||||||
const overlayEvents = [
|
const overlayEvents = [
|
||||||
EventType.CLICK,
|
EventType.CLICK,
|
||||||
@@ -301,7 +303,7 @@ class PluggableMap extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array.<module:ol/events~EventsKey>}
|
* @type {Array<module:ol/events~EventsKey>}
|
||||||
*/
|
*/
|
||||||
this.keyHandlerKeys_ = null;
|
this.keyHandlerKeys_ = null;
|
||||||
|
|
||||||
@@ -310,19 +312,19 @@ class PluggableMap extends BaseObject {
|
|||||||
listen(this.viewport_, EventType.MOUSEWHEEL, this.handleBrowserEvent, this);
|
listen(this.viewport_, EventType.MOUSEWHEEL, this.handleBrowserEvent, this);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {module:ol/Collection.<module:ol/control/Control>}
|
* @type {module:ol/Collection<module:ol/control/Control>}
|
||||||
* @protected
|
* @protected
|
||||||
*/
|
*/
|
||||||
this.controls = optionsInternal.controls || new Collection();
|
this.controls = optionsInternal.controls || new Collection();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {module:ol/Collection.<module:ol/interaction/Interaction>}
|
* @type {module:ol/Collection<module:ol/interaction/Interaction>}
|
||||||
* @protected
|
* @protected
|
||||||
*/
|
*/
|
||||||
this.interactions = optionsInternal.interactions || new Collection();
|
this.interactions = optionsInternal.interactions || new Collection();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {module:ol/Collection.<module:ol/Overlay>}
|
* @type {module:ol/Collection<module:ol/Overlay>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.overlays_ = optionsInternal.overlays;
|
this.overlays_ = optionsInternal.overlays;
|
||||||
@@ -330,7 +332,7 @@ class PluggableMap extends BaseObject {
|
|||||||
/**
|
/**
|
||||||
* A lookup of overlays by id.
|
* A lookup of overlays by id.
|
||||||
* @private
|
* @private
|
||||||
* @type {Object.<string, module:ol/Overlay>}
|
* @type {Object<string, module:ol/Overlay>}
|
||||||
*/
|
*/
|
||||||
this.overlayIdIndex_ = {};
|
this.overlayIdIndex_ = {};
|
||||||
|
|
||||||
@@ -354,7 +356,7 @@ class PluggableMap extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {!Array.<module:ol/PluggableMap~PostRenderFunction>}
|
* @type {!Array<module:ol/PluggableMap~PostRenderFunction>}
|
||||||
*/
|
*/
|
||||||
this.postRenderFunctions_ = [];
|
this.postRenderFunctions_ = [];
|
||||||
|
|
||||||
@@ -368,7 +370,7 @@ class PluggableMap extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Uids of features to skip at rendering time.
|
* Uids of features to skip at rendering time.
|
||||||
* @type {Object.<string, boolean>}
|
* @type {Object<string, boolean>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.skippedFeatureUids_ = {};
|
this.skippedFeatureUids_ = {};
|
||||||
@@ -577,7 +579,7 @@ class PluggableMap extends BaseObject {
|
|||||||
* Get all features that intersect a pixel on the viewport.
|
* Get all features that intersect a pixel on the viewport.
|
||||||
* @param {module:ol/pixel~Pixel} pixel Pixel.
|
* @param {module:ol/pixel~Pixel} pixel Pixel.
|
||||||
* @param {module:ol/PluggableMap~AtPixelOptions=} opt_options Optional options.
|
* @param {module:ol/PluggableMap~AtPixelOptions=} opt_options Optional options.
|
||||||
* @return {Array.<module:ol/Feature|module:ol/render/Feature>} The detected features or
|
* @return {Array<module:ol/Feature|module:ol/render/Feature>} The detected features or
|
||||||
* `null` if none were found.
|
* `null` if none were found.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -716,7 +718,7 @@ class PluggableMap extends BaseObject {
|
|||||||
/**
|
/**
|
||||||
* Get the map controls. Modifying this collection changes the controls
|
* Get the map controls. Modifying this collection changes the controls
|
||||||
* associated with the map.
|
* associated with the map.
|
||||||
* @return {module:ol/Collection.<module:ol/control/Control>} Controls.
|
* @return {module:ol/Collection<module:ol/control/Control>} Controls.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getControls() {
|
getControls() {
|
||||||
@@ -726,7 +728,7 @@ class PluggableMap extends BaseObject {
|
|||||||
/**
|
/**
|
||||||
* Get the map overlays. Modifying this collection changes the overlays
|
* Get the map overlays. Modifying this collection changes the overlays
|
||||||
* associated with the map.
|
* associated with the map.
|
||||||
* @return {module:ol/Collection.<module:ol/Overlay>} Overlays.
|
* @return {module:ol/Collection<module:ol/Overlay>} Overlays.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getOverlays() {
|
getOverlays() {
|
||||||
@@ -751,7 +753,7 @@ class PluggableMap extends BaseObject {
|
|||||||
* associated with the map.
|
* associated with the map.
|
||||||
*
|
*
|
||||||
* Interactions are used for e.g. pan, zoom and rotate.
|
* Interactions are used for e.g. pan, zoom and rotate.
|
||||||
* @return {module:ol/Collection.<module:ol/interaction/Interaction>} Interactions.
|
* @return {module:ol/Collection<module:ol/interaction/Interaction>} Interactions.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getInteractions() {
|
getInteractions() {
|
||||||
@@ -772,7 +774,7 @@ class PluggableMap extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the collection of layers associated with this map.
|
* Get the collection of layers associated with this map.
|
||||||
* @return {!module:ol/Collection.<module:ol/layer/Base>} Layers.
|
* @return {!module:ol/Collection<module:ol/layer/Base>} Layers.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getLayers() {
|
getLayers() {
|
||||||
@@ -961,6 +963,10 @@ class PluggableMap extends BaseObject {
|
|||||||
tileQueue.loadMoreTiles(maxTotalLoading, maxNewLoads);
|
tileQueue.loadMoreTiles(maxTotalLoading, maxNewLoads);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (frameState && this.hasListener(MapEventType.RENDERCOMPLETE) && !frameState.animate &&
|
||||||
|
!this.tileQueue_.getTilesLoading() && !getLoading(this.getLayers().getArray())) {
|
||||||
|
this.renderer_.dispatchRenderEvent(RenderEventType.RENDERCOMPLETE, frameState);
|
||||||
|
}
|
||||||
|
|
||||||
const postRenderFunctions = this.postRenderFunctions_;
|
const postRenderFunctions = this.postRenderFunctions_;
|
||||||
for (let i = 0, ii = postRenderFunctions.length; i < ii; ++i) {
|
for (let i = 0, ii = postRenderFunctions.length; i < ii; ++i) {
|
||||||
@@ -1179,19 +1185,12 @@ class PluggableMap extends BaseObject {
|
|||||||
for (let i = 0, ii = layerStatesArray.length; i < ii; ++i) {
|
for (let i = 0, ii = layerStatesArray.length; i < ii; ++i) {
|
||||||
layerStates[getUid(layerStatesArray[i].layer)] = layerStatesArray[i];
|
layerStates[getUid(layerStatesArray[i].layer)] = layerStatesArray[i];
|
||||||
}
|
}
|
||||||
viewState = view.getState();
|
viewState = view.getState(this.pixelRatio_);
|
||||||
let focus = this.focus_;
|
|
||||||
if (!focus) {
|
|
||||||
focus = viewState.center;
|
|
||||||
const pixelResolution = viewState.resolution / this.pixelRatio_;
|
|
||||||
focus[0] = Math.round(focus[0] / pixelResolution) * pixelResolution;
|
|
||||||
focus[1] = Math.round(focus[1] / pixelResolution) * pixelResolution;
|
|
||||||
}
|
|
||||||
frameState = /** @type {module:ol/PluggableMap~FrameState} */ ({
|
frameState = /** @type {module:ol/PluggableMap~FrameState} */ ({
|
||||||
animate: false,
|
animate: false,
|
||||||
coordinateToPixelTransform: this.coordinateToPixelTransform_,
|
coordinateToPixelTransform: this.coordinateToPixelTransform_,
|
||||||
extent: extent,
|
extent: extent,
|
||||||
focus: focus,
|
focus: this.focus_ ? this.focus_ : viewState.center,
|
||||||
index: this.frameIndex_++,
|
index: this.frameIndex_++,
|
||||||
layerStates: layerStates,
|
layerStates: layerStates,
|
||||||
layerStatesArray: layerStatesArray,
|
layerStatesArray: layerStatesArray,
|
||||||
@@ -1356,7 +1355,7 @@ function createOptionsInternal(options) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object.<string, *>}
|
* @type {Object<string, *>}
|
||||||
*/
|
*/
|
||||||
const values = {};
|
const values = {};
|
||||||
|
|
||||||
@@ -1414,3 +1413,21 @@ function createOptionsInternal(options) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
export default PluggableMap;
|
export default PluggableMap;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {Array<module:ol/layer/Base>} layers Layers.
|
||||||
|
* @return {boolean} Layers have sources that are still loading.
|
||||||
|
*/
|
||||||
|
function getLoading(layers) {
|
||||||
|
for (let i = 0, ii = layers.length; i < ii; ++i) {
|
||||||
|
const layer = layers[i];
|
||||||
|
if (layer instanceof LayerGroup) {
|
||||||
|
return getLoading(layer.getLayers().getArray());
|
||||||
|
}
|
||||||
|
const source = layers[i].getSource();
|
||||||
|
if (source && source.loading) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,13 +3,42 @@
|
|||||||
*/
|
*/
|
||||||
import TileState from './TileState.js';
|
import TileState from './TileState.js';
|
||||||
import {easeIn} from './easing.js';
|
import {easeIn} from './easing.js';
|
||||||
import EventTarget from './events/EventTarget.js';
|
import EventTarget from './events/Target.js';
|
||||||
import EventType from './events/EventType.js';
|
import EventType from './events/EventType.js';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A function that takes an {@link module:ol/Tile} for the tile and a
|
* A function that takes an {@link module:ol/Tile} for the tile and a
|
||||||
* `{string}` for the url as arguments.
|
* `{string}` for the url as arguments. The default is
|
||||||
|
* ```js
|
||||||
|
* source.setTileLoadFunction(function(tile, src) {
|
||||||
|
* tile.getImage().src = src;
|
||||||
|
* });
|
||||||
|
* ```
|
||||||
|
* For more fine grained control, the load function can use fetch or XMLHttpRequest and involve
|
||||||
|
* error handling:
|
||||||
|
*
|
||||||
|
* ```js
|
||||||
|
* import TileState from 'ol/TileState';
|
||||||
|
*
|
||||||
|
* source.setTileLoadFunction(function(tile, src) {
|
||||||
|
* var xhr = new XMLHttpRequest();
|
||||||
|
* xhr.responseType = 'blob';
|
||||||
|
* xhr.addEventListener('loadend', function (evt) {
|
||||||
|
* var data = this.response;
|
||||||
|
* if (data !== undefined) {
|
||||||
|
* tile.getImage().src = URL.createObjectURL(data);
|
||||||
|
* } else {
|
||||||
|
* tile.setState(TileState.ERROR);
|
||||||
|
* }
|
||||||
|
* });
|
||||||
|
* xhr.addEventListener('error', function () {
|
||||||
|
* tile.setState(TileState.ERROR);
|
||||||
|
* });
|
||||||
|
* xhr.open('GET', src);
|
||||||
|
* xhr.send();
|
||||||
|
* });
|
||||||
|
* ```
|
||||||
*
|
*
|
||||||
* @typedef {function(module:ol/Tile, string)} LoadFunction
|
* @typedef {function(module:ol/Tile, string)} LoadFunction
|
||||||
* @api
|
* @api
|
||||||
@@ -93,7 +122,7 @@ class Tile extends EventTarget {
|
|||||||
/**
|
/**
|
||||||
* Lookup of start times for rendering transitions. If the start time is
|
* Lookup of start times for rendering transitions. If the start time is
|
||||||
* equal to -1, the transition is complete.
|
* equal to -1, the transition is complete.
|
||||||
* @type {Object.<number, number>}
|
* @type {Object<number, number>}
|
||||||
*/
|
*/
|
||||||
this.transitionStarts_ = {};
|
this.transitionStarts_ = {};
|
||||||
|
|
||||||
@@ -192,7 +221,12 @@ class Tile extends EventTarget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Sets the state of this tile. If you write your own {@link module:ol/Tile~LoadFunction tileLoadFunction} ,
|
||||||
|
* it is important to set the state correctly to {@link module:ol/TileState~ERROR}
|
||||||
|
* when the tile cannot be loaded. Otherwise the tile cannot be removed from
|
||||||
|
* the tile queue and will block other requests.
|
||||||
* @param {module:ol/TileState} state State.
|
* @param {module:ol/TileState} state State.
|
||||||
|
* @api
|
||||||
*/
|
*/
|
||||||
setState(state) {
|
setState(state) {
|
||||||
this.state = state;
|
this.state = state;
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class TileCache extends LRUCache {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {!Object.<string, module:ol/TileRange>} usedTiles Used tiles.
|
* @param {!Object<string, module:ol/TileRange>} usedTiles Used tiles.
|
||||||
*/
|
*/
|
||||||
expireCache(usedTiles) {
|
expireCache(usedTiles) {
|
||||||
while (this.canExpireCache()) {
|
while (this.canExpireCache()) {
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ class TileQueue extends PriorityQueue {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {!Object.<string,boolean>}
|
* @type {!Object<string,boolean>}
|
||||||
*/
|
*/
|
||||||
this.tilesLoadingKeys_ = {};
|
this.tilesLoadingKeys_ = {};
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,11 @@ export default {
|
|||||||
IDLE: 0,
|
IDLE: 0,
|
||||||
LOADING: 1,
|
LOADING: 1,
|
||||||
LOADED: 2,
|
LOADED: 2,
|
||||||
|
/**
|
||||||
|
* Indicates that tile loading failed
|
||||||
|
* @type {number}
|
||||||
|
* @api
|
||||||
|
*/
|
||||||
ERROR: 3,
|
ERROR: 3,
|
||||||
EMPTY: 4,
|
EMPTY: 4,
|
||||||
ABORT: 5
|
ABORT: 5
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import {listen, unlistenByKey} from './events.js';
|
|||||||
import {getHeight, getIntersection, getWidth} from './extent.js';
|
import {getHeight, getIntersection, getWidth} from './extent.js';
|
||||||
import EventType from './events/EventType.js';
|
import EventType from './events/EventType.js';
|
||||||
import {loadFeaturesXhr} from './featureloader.js';
|
import {loadFeaturesXhr} from './featureloader.js';
|
||||||
import {UNDEFINED} from './functions.js';
|
import {VOID} from './functions.js';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -33,7 +33,7 @@ class VectorImageTile extends Tile {
|
|||||||
* @param {module:ol/Tile~UrlFunction} tileUrlFunction Tile url function.
|
* @param {module:ol/Tile~UrlFunction} tileUrlFunction Tile url function.
|
||||||
* @param {module:ol/tilegrid/TileGrid} sourceTileGrid Tile grid of the source.
|
* @param {module:ol/tilegrid/TileGrid} sourceTileGrid Tile grid of the source.
|
||||||
* @param {module:ol/tilegrid/TileGrid} tileGrid Tile grid of the renderer.
|
* @param {module:ol/tilegrid/TileGrid} tileGrid Tile grid of the renderer.
|
||||||
* @param {Object.<string, module:ol/VectorTile>} sourceTiles Source tiles.
|
* @param {Object<string, module:ol/VectorTile>} sourceTiles Source tiles.
|
||||||
* @param {number} pixelRatio Pixel ratio.
|
* @param {number} pixelRatio Pixel ratio.
|
||||||
* @param {module:ol/proj/Projection} projection Projection.
|
* @param {module:ol/proj/Projection} projection Projection.
|
||||||
* @param {function(new: module:ol/VectorTile, module:ol/tilecoord~TileCoord, module:ol/TileState, string,
|
* @param {function(new: module:ol/VectorTile, module:ol/tilecoord~TileCoord, module:ol/TileState, string,
|
||||||
@@ -51,7 +51,7 @@ class VectorImageTile extends Tile {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {!Object.<string, CanvasRenderingContext2D>}
|
* @type {!Object<string, CanvasRenderingContext2D>}
|
||||||
*/
|
*/
|
||||||
this.context_ = {};
|
this.context_ = {};
|
||||||
|
|
||||||
@@ -63,19 +63,19 @@ class VectorImageTile extends Tile {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {!Object.<string, module:ol/VectorImageTile~ReplayState>}
|
* @type {!Object<string, module:ol/VectorImageTile~ReplayState>}
|
||||||
*/
|
*/
|
||||||
this.replayState_ = {};
|
this.replayState_ = {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Object.<string, module:ol/VectorTile>}
|
* @type {Object<string, module:ol/VectorTile>}
|
||||||
*/
|
*/
|
||||||
this.sourceTiles_ = sourceTiles;
|
this.sourceTiles_ = sourceTiles;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Keys of source tiles used by this tile. Use with {@link #getTile}.
|
* Keys of source tiles used by this tile. Use with {@link #getTile}.
|
||||||
* @type {Array.<string>}
|
* @type {Array<string>}
|
||||||
*/
|
*/
|
||||||
this.tileKeys = [];
|
this.tileKeys = [];
|
||||||
|
|
||||||
@@ -95,12 +95,12 @@ class VectorImageTile extends Tile {
|
|||||||
this.wrappedTileCoord = urlTileCoord;
|
this.wrappedTileCoord = urlTileCoord;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Array.<module:ol/events~EventsKey>}
|
* @type {Array<module:ol/events~EventsKey>}
|
||||||
*/
|
*/
|
||||||
this.loadListenerKeys_ = [];
|
this.loadListenerKeys_ = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Array.<module:ol/events~EventsKey>}
|
* @type {Array<module:ol/events~EventsKey>}
|
||||||
*/
|
*/
|
||||||
this.sourceTileListenerKeys_ = [];
|
this.sourceTileListenerKeys_ = [];
|
||||||
|
|
||||||
@@ -148,7 +148,7 @@ class VectorImageTile extends Tile {
|
|||||||
const tile = new VectorImageTile(tileCoord, state, sourceRevision,
|
const tile = new VectorImageTile(tileCoord, state, sourceRevision,
|
||||||
format, tileLoadFunction, urlTileCoord, tileUrlFunction,
|
format, tileLoadFunction, urlTileCoord, tileUrlFunction,
|
||||||
sourceTileGrid, tileGrid, sourceTiles, pixelRatio, projection,
|
sourceTileGrid, tileGrid, sourceTiles, pixelRatio, projection,
|
||||||
tileClass, UNDEFINED, --zoom);
|
tileClass, VOID, --zoom);
|
||||||
if (tile.state == TileState.LOADED) {
|
if (tile.state == TileState.LOADED) {
|
||||||
this.interimTile = tile;
|
this.interimTile = tile;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ class VectorTile extends Tile {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array.<module:ol/Feature>}
|
* @type {Array<module:ol/Feature>}
|
||||||
*/
|
*/
|
||||||
this.features_ = null;
|
this.features_ = null;
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ class VectorTile extends Tile {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Object.<string, module:ol/render/ReplayGroup>}
|
* @type {Object<string, module:ol/render/ReplayGroup>}
|
||||||
*/
|
*/
|
||||||
this.replayGroups_ = {};
|
this.replayGroups_ = {};
|
||||||
|
|
||||||
@@ -120,7 +120,7 @@ class VectorTile extends Tile {
|
|||||||
/**
|
/**
|
||||||
* Get the features for this tile. Geometries will be in the projection returned
|
* Get the features for this tile. Geometries will be in the projection returned
|
||||||
* by {@link module:ol/VectorTile~VectorTile#getProjection}.
|
* by {@link module:ol/VectorTile~VectorTile#getProjection}.
|
||||||
* @return {Array.<module:ol/Feature|module:ol/render/Feature>} Features.
|
* @return {Array<module:ol/Feature|module:ol/render/Feature>} Features.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getFeatures() {
|
getFeatures() {
|
||||||
@@ -166,7 +166,7 @@ class VectorTile extends Tile {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Handler for successful tile load.
|
* Handler for successful tile load.
|
||||||
* @param {Array.<module:ol/Feature>} features The loaded features.
|
* @param {Array<module:ol/Feature>} features The loaded features.
|
||||||
* @param {module:ol/proj/Projection} dataProjection Data projection.
|
* @param {module:ol/proj/Projection} dataProjection Data projection.
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {module:ol/extent~Extent} extent Extent.
|
||||||
*/
|
*/
|
||||||
@@ -202,7 +202,7 @@ class VectorTile extends Tile {
|
|||||||
/**
|
/**
|
||||||
* Function for use in an {@link module:ol/source/VectorTile~VectorTile}'s `tileLoadFunction`.
|
* Function for use in an {@link module:ol/source/VectorTile~VectorTile}'s `tileLoadFunction`.
|
||||||
* Sets the features for the tile.
|
* Sets the features for the tile.
|
||||||
* @param {Array.<module:ol/Feature>} features Features.
|
* @param {Array<module:ol/Feature>} features Features.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
setFeatures(features) {
|
setFeatures(features) {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
import {DEFAULT_TILE_SIZE} from './tilegrid/common.js';
|
import {DEFAULT_TILE_SIZE} from './tilegrid/common.js';
|
||||||
import {getUid} from './util.js';
|
import {getUid} from './util.js';
|
||||||
import {UNDEFINED} from './functions.js';
|
import {VOID} from './functions.js';
|
||||||
import {createExtent, none as centerNone} from './centerconstraint.js';
|
import {createExtent, none as centerNone} from './centerconstraint.js';
|
||||||
import BaseObject from './Object.js';
|
import BaseObject from './Object.js';
|
||||||
import {createSnapToResolutions, createSnapToPower} from './resolutionconstraint.js';
|
import {createSnapToResolutions, createSnapToPower} from './resolutionconstraint.js';
|
||||||
@@ -56,7 +56,7 @@ import Units from './proj/Units.js';
|
|||||||
* @property {module:ol/size~Size} [size] The size in pixels of the box to fit
|
* @property {module:ol/size~Size} [size] The size in pixels of the box to fit
|
||||||
* the extent into. Default is the current size of the first map in the DOM that
|
* the extent into. Default is the current size of the first map in the DOM that
|
||||||
* uses this view, or `[100, 100]` if no such map is found.
|
* uses this view, or `[100, 100]` if no such map is found.
|
||||||
* @property {!Array.<number>} [padding=[0, 0, 0, 0]] Padding (in pixels) to be
|
* @property {!Array<number>} [padding=[0, 0, 0, 0]] Padding (in pixels) to be
|
||||||
* cleared inside the view. Values in the array are top, right, bottom and left
|
* cleared inside the view. Values in the array are top, right, bottom and left
|
||||||
* padding.
|
* padding.
|
||||||
* @property {boolean} [constrainResolution=true] Constrain the resolution.
|
* @property {boolean} [constrainResolution=true] Constrain the resolution.
|
||||||
@@ -121,7 +121,7 @@ import Units from './proj/Units.js';
|
|||||||
* alternative to setting this is to set `zoom`. Layer sources will not be
|
* alternative to setting this is to set `zoom`. Layer sources will not be
|
||||||
* fetched if neither this nor `zoom` are defined, but they can be set later
|
* fetched if neither this nor `zoom` are defined, but they can be set later
|
||||||
* with {@link #setZoom} or {@link #setResolution}.
|
* with {@link #setZoom} or {@link #setResolution}.
|
||||||
* @property {Array.<number>} [resolutions] Resolutions to determine the
|
* @property {Array<number>} [resolutions] Resolutions to determine the
|
||||||
* resolution constraint. If set the `maxResolution`, `minResolution`,
|
* resolution constraint. If set the `maxResolution`, `minResolution`,
|
||||||
* `minZoom`, `maxZoom`, and `zoomFactor` options are ignored.
|
* `minZoom`, `maxZoom`, and `zoomFactor` options are ignored.
|
||||||
* @property {number} [rotation=0] The initial rotation for the view in radians
|
* @property {number} [rotation=0] The initial rotation for the view in radians
|
||||||
@@ -238,13 +238,13 @@ class View extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array.<number>}
|
* @type {Array<number>}
|
||||||
*/
|
*/
|
||||||
this.hints_ = [0, 0];
|
this.hints_ = [0, 0];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array.<Array.<module:ol/View~Animation>>}
|
* @type {Array<Array<module:ol/View~Animation>>}
|
||||||
*/
|
*/
|
||||||
this.animations_ = [];
|
this.animations_ = [];
|
||||||
|
|
||||||
@@ -273,7 +273,7 @@ class View extends BaseObject {
|
|||||||
applyOptions_(options) {
|
applyOptions_(options) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object.<string, *>}
|
* @type {Object<string, *>}
|
||||||
*/
|
*/
|
||||||
const properties = {};
|
const properties = {};
|
||||||
properties[ViewProperty.CENTER] = options.center !== undefined ?
|
properties[ViewProperty.CENTER] = options.center !== undefined ?
|
||||||
@@ -301,7 +301,7 @@ class View extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array.<number>|undefined}
|
* @type {Array<number>|undefined}
|
||||||
*/
|
*/
|
||||||
this.resolutions_ = options.resolutions;
|
this.resolutions_ = options.resolutions;
|
||||||
|
|
||||||
@@ -428,9 +428,7 @@ class View extends BaseObject {
|
|||||||
this.setRotation(state.rotation);
|
this.setRotation(state.rotation);
|
||||||
}
|
}
|
||||||
if (callback) {
|
if (callback) {
|
||||||
setTimeout(function() {
|
animationCallback(callback, true);
|
||||||
callback(true);
|
|
||||||
}, 0);
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -517,7 +515,7 @@ class View extends BaseObject {
|
|||||||
for (let i = 0, ii = this.animations_.length; i < ii; ++i) {
|
for (let i = 0, ii = this.animations_.length; i < ii; ++i) {
|
||||||
const series = this.animations_[i];
|
const series = this.animations_[i];
|
||||||
if (series[0].callback) {
|
if (series[0].callback) {
|
||||||
series[0].callback(false);
|
animationCallback(series[0].callback, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.animations_.length = 0;
|
this.animations_.length = 0;
|
||||||
@@ -592,9 +590,7 @@ class View extends BaseObject {
|
|||||||
this.setHint(ViewHint.ANIMATING, -1);
|
this.setHint(ViewHint.ANIMATING, -1);
|
||||||
const callback = series[0].callback;
|
const callback = series[0].callback;
|
||||||
if (callback) {
|
if (callback) {
|
||||||
setTimeout(function() {
|
animationCallback(callback, true);
|
||||||
callback(true);
|
|
||||||
}, 0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -710,8 +706,8 @@ class View extends BaseObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array.<number>=} opt_hints Destination array.
|
* @param {Array<number>=} opt_hints Destination array.
|
||||||
* @return {Array.<number>} Hint.
|
* @return {Array<number>} Hint.
|
||||||
*/
|
*/
|
||||||
getHints(opt_hints) {
|
getHints(opt_hints) {
|
||||||
if (opt_hints !== undefined) {
|
if (opt_hints !== undefined) {
|
||||||
@@ -821,7 +817,7 @@ class View extends BaseObject {
|
|||||||
/**
|
/**
|
||||||
* Get the resolutions for the view. This returns the array of resolutions
|
* Get the resolutions for the view. This returns the array of resolutions
|
||||||
* passed to the constructor of the View, or undefined if none were given.
|
* passed to the constructor of the View, or undefined if none were given.
|
||||||
* @return {Array.<number>|undefined} The resolutions of the view.
|
* @return {Array<number>|undefined} The resolutions of the view.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
getResolutions() {
|
getResolutions() {
|
||||||
@@ -898,16 +894,21 @@ class View extends BaseObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @param {number} pixelRatio Pixel ratio for center rounding.
|
||||||
* @return {module:ol/View~State} View state.
|
* @return {module:ol/View~State} View state.
|
||||||
*/
|
*/
|
||||||
getState() {
|
getState(pixelRatio) {
|
||||||
const center = /** @type {module:ol/coordinate~Coordinate} */ (this.getCenter());
|
const center = /** @type {module:ol/coordinate~Coordinate} */ (this.getCenter());
|
||||||
const projection = this.getProjection();
|
const projection = this.getProjection();
|
||||||
const resolution = /** @type {number} */ (this.getResolution());
|
const resolution = /** @type {number} */ (this.getResolution());
|
||||||
|
const pixelResolution = resolution / pixelRatio;
|
||||||
const rotation = this.getRotation();
|
const rotation = this.getRotation();
|
||||||
return (
|
return (
|
||||||
/** @type {module:ol/View~State} */ ({
|
/** @type {module:ol/View~State} */ ({
|
||||||
center: center.slice(),
|
center: [
|
||||||
|
Math.round(center[0] / pixelResolution) * pixelResolution,
|
||||||
|
Math.round(center[1] / pixelResolution) * pixelResolution
|
||||||
|
],
|
||||||
projection: projection !== undefined ? projection : null,
|
projection: projection !== undefined ? projection : null,
|
||||||
resolution: resolution,
|
resolution: resolution,
|
||||||
rotation: rotation,
|
rotation: rotation,
|
||||||
@@ -1057,7 +1058,7 @@ class View extends BaseObject {
|
|||||||
const centerX = centerRotX * cosAngle - centerRotY * sinAngle;
|
const centerX = centerRotX * cosAngle - centerRotY * sinAngle;
|
||||||
const centerY = centerRotY * cosAngle + centerRotX * sinAngle;
|
const centerY = centerRotY * cosAngle + centerRotX * sinAngle;
|
||||||
const center = [centerX, centerY];
|
const center = [centerX, centerY];
|
||||||
const callback = options.callback ? options.callback : UNDEFINED;
|
const callback = options.callback ? options.callback : VOID;
|
||||||
|
|
||||||
if (options.duration !== undefined) {
|
if (options.duration !== undefined) {
|
||||||
this.animate({
|
this.animate({
|
||||||
@@ -1069,7 +1070,7 @@ class View extends BaseObject {
|
|||||||
} else {
|
} else {
|
||||||
this.setResolution(resolution);
|
this.setResolution(resolution);
|
||||||
this.setCenter(center);
|
this.setCenter(center);
|
||||||
setTimeout(callback.bind(undefined, true), 0);
|
animationCallback(callback, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1181,6 +1182,17 @@ class View extends BaseObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {Function} callback Callback.
|
||||||
|
* @param {*} returnValue Return value.
|
||||||
|
*/
|
||||||
|
function animationCallback(callback, returnValue) {
|
||||||
|
setTimeout(function() {
|
||||||
|
callback(returnValue);
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/View~ViewOptions} options View options.
|
* @param {module:ol/View~ViewOptions} options View options.
|
||||||
* @return {module:ol/centerconstraint~Type} The constraint.
|
* @return {module:ol/centerconstraint~Type} The constraint.
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
* Performs a binary search on the provided sorted list and returns the index of the item if found. If it can't be found it'll return -1.
|
* Performs a binary search on the provided sorted list and returns the index of the item if found. If it can't be found it'll return -1.
|
||||||
* https://github.com/darkskyapp/binary-search
|
* https://github.com/darkskyapp/binary-search
|
||||||
*
|
*
|
||||||
* @param {Array.<*>} haystack Items to search through.
|
* @param {Array<*>} haystack Items to search through.
|
||||||
* @param {*} needle The item to look for.
|
* @param {*} needle The item to look for.
|
||||||
* @param {Function=} opt_comparator Comparator function.
|
* @param {Function=} opt_comparator Comparator function.
|
||||||
* @return {number} The index of the item if found, -1 if not.
|
* @return {number} The index of the item if found, -1 if not.
|
||||||
@@ -53,7 +53,7 @@ export function numberSafeCompareFunction(a, b) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the array contains the given object.
|
* Whether the array contains the given object.
|
||||||
* @param {Array.<*>} arr The array to test for the presence of the element.
|
* @param {Array<*>} arr The array to test for the presence of the element.
|
||||||
* @param {*} obj The object for which to test.
|
* @param {*} obj The object for which to test.
|
||||||
* @return {boolean} The object is in the array.
|
* @return {boolean} The object is in the array.
|
||||||
*/
|
*/
|
||||||
@@ -63,7 +63,7 @@ export function includes(arr, obj) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array.<number>} arr Array.
|
* @param {Array<number>} arr Array.
|
||||||
* @param {number} target Target.
|
* @param {number} target Target.
|
||||||
* @param {number} direction 0 means return the nearest, > 0
|
* @param {number} direction 0 means return the nearest, > 0
|
||||||
* means return the largest nearest, < 0 means return the
|
* means return the largest nearest, < 0 means return the
|
||||||
@@ -109,7 +109,7 @@ export function linearFindNearest(arr, target, direction) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array.<*>} arr Array.
|
* @param {Array<*>} arr Array.
|
||||||
* @param {number} begin Begin index.
|
* @param {number} begin Begin index.
|
||||||
* @param {number} end End index.
|
* @param {number} end End index.
|
||||||
*/
|
*/
|
||||||
@@ -125,8 +125,8 @@ export function reverseSubArray(arr, begin, end) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array.<VALUE>} arr The array to modify.
|
* @param {Array<VALUE>} arr The array to modify.
|
||||||
* @param {!Array.<VALUE>|VALUE} data The elements or arrays of elements to add to arr.
|
* @param {!Array<VALUE>|VALUE} data The elements or arrays of elements to add to arr.
|
||||||
* @template VALUE
|
* @template VALUE
|
||||||
*/
|
*/
|
||||||
export function extend(arr, data) {
|
export function extend(arr, data) {
|
||||||
@@ -139,7 +139,7 @@ export function extend(arr, data) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array.<VALUE>} arr The array to modify.
|
* @param {Array<VALUE>} arr The array to modify.
|
||||||
* @param {VALUE} obj The element to remove.
|
* @param {VALUE} obj The element to remove.
|
||||||
* @template VALUE
|
* @template VALUE
|
||||||
* @return {boolean} If the element was removed.
|
* @return {boolean} If the element was removed.
|
||||||
@@ -155,7 +155,7 @@ export function remove(arr, obj) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array.<VALUE>} arr The array to search in.
|
* @param {Array<VALUE>} arr The array to search in.
|
||||||
* @param {function(VALUE, number, ?) : boolean} func The function to compare.
|
* @param {function(VALUE, number, ?) : boolean} func The function to compare.
|
||||||
* @template VALUE
|
* @template VALUE
|
||||||
* @return {VALUE|null} The element found or null.
|
* @return {VALUE|null} The element found or null.
|
||||||
@@ -194,8 +194,11 @@ export function equals(arr1, arr2) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array.<*>} arr The array to sort (modifies original).
|
* Sort the passed array such that the relative order of equal elements is preverved.
|
||||||
* @param {Function} compareFnc Comparison function.
|
* See https://en.wikipedia.org/wiki/Sorting_algorithm#Stability for details.
|
||||||
|
* @param {Array<*>} arr The array to sort (modifies original).
|
||||||
|
* @param {!function(*, *): number} compareFnc Comparison function.
|
||||||
|
* @api
|
||||||
*/
|
*/
|
||||||
export function stableSort(arr, compareFnc) {
|
export function stableSort(arr, compareFnc) {
|
||||||
const length = arr.length;
|
const length = arr.length;
|
||||||
@@ -214,7 +217,7 @@ export function stableSort(arr, compareFnc) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array.<*>} arr The array to search in.
|
* @param {Array<*>} arr The array to search in.
|
||||||
* @param {Function} func Comparison function.
|
* @param {Function} func Comparison function.
|
||||||
* @return {number} Return index.
|
* @return {number} Return index.
|
||||||
*/
|
*/
|
||||||
@@ -229,7 +232,7 @@ export function findIndex(arr, func) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array.<*>} arr The array to test.
|
* @param {Array<*>} arr The array to test.
|
||||||
* @param {Function=} opt_func Comparison function.
|
* @param {Function=} opt_func Comparison function.
|
||||||
* @param {boolean=} opt_strict Strictly sorted (default false).
|
* @param {boolean=} opt_strict Strictly sorted (default false).
|
||||||
* @return {boolean} Return index.
|
* @return {boolean} Return index.
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {clamp} from './math.js';
|
|||||||
* red, green, and blue should be integers in the range 0..255 inclusive.
|
* red, green, and blue should be integers in the range 0..255 inclusive.
|
||||||
* alpha should be a float in the range 0..1 inclusive. If no alpha value is
|
* alpha should be a float in the range 0..1 inclusive. If no alpha value is
|
||||||
* given then `1` will be used.
|
* given then `1` will be used.
|
||||||
* @typedef {Array.<number>} Color
|
* @typedef {Array<number>} Color
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@ export const fromString = (
|
|||||||
const MAX_CACHE_SIZE = 1024;
|
const MAX_CACHE_SIZE = 1024;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object.<string, module:ol/color~Color>}
|
* @type {Object<string, module:ol/color~Color>}
|
||||||
*/
|
*/
|
||||||
const cache = {};
|
const cache = {};
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ class Attribution extends Control {
|
|||||||
* @private
|
* @private
|
||||||
* @type {HTMLElement}
|
* @type {HTMLElement}
|
||||||
*/
|
*/
|
||||||
this.ulElement_ = document.createElement('UL');
|
this.ulElement_ = document.createElement('ul');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
@@ -131,7 +131,7 @@ class Attribution extends Control {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* A list of currently rendered resolutions.
|
* A list of currently rendered resolutions.
|
||||||
* @type {Array.<string>}
|
* @type {Array<string>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.renderedAttributions_ = [];
|
this.renderedAttributions_ = [];
|
||||||
@@ -147,19 +147,19 @@ class Attribution extends Control {
|
|||||||
/**
|
/**
|
||||||
* Get a list of visible attributions.
|
* Get a list of visible attributions.
|
||||||
* @param {module:ol/PluggableMap~FrameState} frameState Frame state.
|
* @param {module:ol/PluggableMap~FrameState} frameState Frame state.
|
||||||
* @return {Array.<string>} Attributions.
|
* @return {Array<string>} Attributions.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
getSourceAttributions_(frameState) {
|
getSourceAttributions_(frameState) {
|
||||||
/**
|
/**
|
||||||
* Used to determine if an attribution already exists.
|
* Used to determine if an attribution already exists.
|
||||||
* @type {!Object.<string, boolean>}
|
* @type {!Object<string, boolean>}
|
||||||
*/
|
*/
|
||||||
const lookup = {};
|
const lookup = {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A list of visible attributions.
|
* A list of visible attributions.
|
||||||
* @type {Array.<string>}
|
* @type {Array<string>}
|
||||||
*/
|
*/
|
||||||
const visibleAttributions = [];
|
const visibleAttributions = [];
|
||||||
|
|
||||||
@@ -232,7 +232,7 @@ class Attribution extends Control {
|
|||||||
|
|
||||||
// append the attributions
|
// append the attributions
|
||||||
for (let i = 0, ii = attributions.length; i < ii; ++i) {
|
for (let i = 0, ii = attributions.length; i < ii; ++i) {
|
||||||
const element = document.createElement('LI');
|
const element = document.createElement('li');
|
||||||
element.innerHTML = attributions[i];
|
element.innerHTML = attributions[i];
|
||||||
this.ulElement_.appendChild(element);
|
this.ulElement_.appendChild(element);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* @module ol/control/Control
|
* @module ol/control/Control
|
||||||
*/
|
*/
|
||||||
import {UNDEFINED} from '../functions.js';
|
import {VOID} from '../functions.js';
|
||||||
import MapEventType from '../MapEventType.js';
|
import MapEventType from '../MapEventType.js';
|
||||||
import BaseObject from '../Object.js';
|
import BaseObject from '../Object.js';
|
||||||
import {removeNode} from '../dom.js';
|
import {removeNode} from '../dom.js';
|
||||||
@@ -74,14 +74,14 @@ class Control extends BaseObject {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @protected
|
* @protected
|
||||||
* @type {!Array.<module:ol/events~EventsKey>}
|
* @type {!Array<module:ol/events~EventsKey>}
|
||||||
*/
|
*/
|
||||||
this.listenerKeys = [];
|
this.listenerKeys = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {function(module:ol/MapEvent)}
|
* @type {function(module:ol/MapEvent)}
|
||||||
*/
|
*/
|
||||||
this.render = options.render ? options.render : UNDEFINED;
|
this.render = options.render ? options.render : VOID;
|
||||||
|
|
||||||
if (options.target) {
|
if (options.target) {
|
||||||
this.setTarget(options.target);
|
this.setTarget(options.target);
|
||||||
@@ -126,7 +126,7 @@ class Control extends BaseObject {
|
|||||||
const target = this.target_ ?
|
const target = this.target_ ?
|
||||||
this.target_ : map.getOverlayContainerStopEvent();
|
this.target_ : map.getOverlayContainerStopEvent();
|
||||||
target.appendChild(this.element);
|
target.appendChild(this.element);
|
||||||
if (this.render !== UNDEFINED) {
|
if (this.render !== VOID) {
|
||||||
this.listenerKeys.push(listen(map,
|
this.listenerKeys.push(listen(map,
|
||||||
MapEventType.POSTRENDER, this.render, this));
|
MapEventType.POSTRENDER, this.render, this));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,9 +29,9 @@ const COORDINATE_FORMAT = 'coordinateFormat';
|
|||||||
* callback.
|
* callback.
|
||||||
* @property {Element|string} [target] Specify a target if you want the
|
* @property {Element|string} [target] Specify a target if you want the
|
||||||
* control to be rendered outside of the map's viewport.
|
* control to be rendered outside of the map's viewport.
|
||||||
* @property {string} [undefinedHTML=' '] Markup to show when coordinates are not
|
* @property {string} [undefinedHTML=' '] Markup to show when coordinates are not
|
||||||
* available (e.g. when the pointer leaves the map viewport). By default, the last position
|
* available (e.g. when the pointer leaves the map viewport). By default, the last position
|
||||||
* will be replaced with `' '` when the pointer leaves the viewport. To
|
* will be replaced with `' '` (` `) when the pointer leaves the viewport. To
|
||||||
* retain the last rendered position, set this option to something falsey (like an empty
|
* retain the last rendered position, set this option to something falsey (like an empty
|
||||||
* string `''`).
|
* string `''`).
|
||||||
*/
|
*/
|
||||||
@@ -55,7 +55,7 @@ class MousePosition extends Control {
|
|||||||
|
|
||||||
const options = opt_options ? opt_options : {};
|
const options = opt_options ? opt_options : {};
|
||||||
|
|
||||||
const element = document.createElement('DIV');
|
const element = document.createElement('div');
|
||||||
element.className = options.className !== undefined ? options.className : 'ol-mouse-position';
|
element.className = options.className !== undefined ? options.className : 'ol-mouse-position';
|
||||||
|
|
||||||
super({
|
super({
|
||||||
@@ -79,7 +79,7 @@ class MousePosition extends Control {
|
|||||||
* @private
|
* @private
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
this.undefinedHTML_ = 'undefinedHTML' in options ? options.undefinedHTML : ' ';
|
this.undefinedHTML_ = 'undefinedHTML' in options ? options.undefinedHTML : ' ';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ const MIN_RATIO = 0.1;
|
|||||||
* @property {boolean} [collapsible=true] Whether the control can be collapsed or not.
|
* @property {boolean} [collapsible=true] Whether the control can be collapsed or not.
|
||||||
* @property {string|HTMLElement} [label='»'] Text label to use for the collapsed
|
* @property {string|HTMLElement} [label='»'] Text label to use for the collapsed
|
||||||
* overviewmap button. Instead of text, also an element (e.g. a `span` element) can be used.
|
* overviewmap button. Instead of text, also an element (e.g. a `span` element) can be used.
|
||||||
* @property {Array.<module:ol/layer/Layer>|module:ol/Collection.<module:ol/layer/Layer>} [layers]
|
* @property {Array<module:ol/layer/Layer>|module:ol/Collection<module:ol/layer/Layer>} [layers]
|
||||||
* Layers for the overview map. If not set, then all main map layers are used
|
* Layers for the overview map. If not set, then all main map layers are used
|
||||||
* instead.
|
* instead.
|
||||||
* @property {function(module:ol/MapEvent)} [render] Function called when the control
|
* @property {function(module:ol/MapEvent)} [render] Function called when the control
|
||||||
@@ -140,7 +140,7 @@ class OverviewMap extends Control {
|
|||||||
* @type {HTMLElement}
|
* @type {HTMLElement}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.ovmapDiv_ = document.createElement('DIV');
|
this.ovmapDiv_ = document.createElement('div');
|
||||||
this.ovmapDiv_.className = 'ol-overviewmap-map';
|
this.ovmapDiv_.className = 'ol-overviewmap-map';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -164,7 +164,7 @@ class OverviewMap extends Control {
|
|||||||
}).bind(this));
|
}).bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
const box = document.createElement('DIV');
|
const box = document.createElement('div');
|
||||||
box.className = 'ol-overviewmap-box';
|
box.className = 'ol-overviewmap-box';
|
||||||
box.style.boxSizing = 'border-box';
|
box.style.boxSizing = 'border-box';
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export const Units = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Array.<number>}
|
* @type {Array<number>}
|
||||||
*/
|
*/
|
||||||
const LEADING_DIGITS = [1, 2, 5];
|
const LEADING_DIGITS = [1, 2, 5];
|
||||||
|
|
||||||
@@ -72,7 +72,7 @@ class ScaleLine extends Control {
|
|||||||
const className = options.className !== undefined ? options.className : 'ol-scale-line';
|
const className = options.className !== undefined ? options.className : 'ol-scale-line';
|
||||||
|
|
||||||
super({
|
super({
|
||||||
element: document.createElement('DIV'),
|
element: document.createElement('div'),
|
||||||
render: options.render || render,
|
render: options.render || render,
|
||||||
target: options.target
|
target: options.target
|
||||||
});
|
});
|
||||||
@@ -81,7 +81,7 @@ class ScaleLine extends Control {
|
|||||||
* @private
|
* @private
|
||||||
* @type {HTMLElement}
|
* @type {HTMLElement}
|
||||||
*/
|
*/
|
||||||
this.innerElement_ = document.createElement('DIV');
|
this.innerElement_ = document.createElement('div');
|
||||||
this.innerElement_.className = className + '-inner';
|
this.innerElement_.className = className + '-inner';
|
||||||
|
|
||||||
this.element.className = className + ' ' + CLASS_UNSELECTABLE;
|
this.element.className = className + ' ' + CLASS_UNSELECTABLE;
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ import Zoom from './Zoom.js';
|
|||||||
*
|
*
|
||||||
* @param {module:ol/control/util~DefaultsOptions=} opt_options
|
* @param {module:ol/control/util~DefaultsOptions=} opt_options
|
||||||
* Defaults options.
|
* Defaults options.
|
||||||
* @return {module:ol/Collection.<module:ol/control/Control>}
|
* @return {module:ol/Collection<module:ol/control/Control>}
|
||||||
* Controls.
|
* Controls.
|
||||||
* @function module:ol/control.defaults
|
* @function module:ol/control.defaults
|
||||||
* @api
|
* @api
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import {padNumber} from './string.js';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* An array of numbers representing an xy coordinate. Example: `[16, 48]`.
|
* An array of numbers representing an xy coordinate. Example: `[16, 48]`.
|
||||||
* @typedef {Array.<number>} Coordinate
|
* @typedef {Array<number>} Coordinate
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -82,7 +82,7 @@ export function closestOnCircle(coordinate, circle) {
|
|||||||
* is outside the segment.
|
* is outside the segment.
|
||||||
*
|
*
|
||||||
* @param {module:ol/coordinate~Coordinate} coordinate The coordinate.
|
* @param {module:ol/coordinate~Coordinate} coordinate The coordinate.
|
||||||
* @param {Array.<module:ol/coordinate~Coordinate>} segment The two coordinates
|
* @param {Array<module:ol/coordinate~Coordinate>} segment The two coordinates
|
||||||
* of the segment.
|
* of the segment.
|
||||||
* @return {module:ol/coordinate~Coordinate} The foot of the perpendicular of
|
* @return {module:ol/coordinate~Coordinate} The foot of the perpendicular of
|
||||||
* the coordinate to the segment.
|
* the coordinate to the segment.
|
||||||
@@ -328,7 +328,7 @@ export function distance(coord1, coord2) {
|
|||||||
* Calculate the squared distance from a coordinate to a line segment.
|
* Calculate the squared distance from a coordinate to a line segment.
|
||||||
*
|
*
|
||||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate of the point.
|
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate of the point.
|
||||||
* @param {Array.<module:ol/coordinate~Coordinate>} segment Line segment (2
|
* @param {Array<module:ol/coordinate~Coordinate>} segment Line segment (2
|
||||||
* coordinates).
|
* coordinates).
|
||||||
* @return {number} Squared distance from the point to the line segment.
|
* @return {number} Squared distance from the point to the line segment.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ export const CLASS_COLLAPSED = 'ol-collapsed';
|
|||||||
* Get the list of font families from a font spec. Note that this doesn't work
|
* Get the list of font families from a font spec. Note that this doesn't work
|
||||||
* for font families that have commas in them.
|
* for font families that have commas in them.
|
||||||
* @param {string} The CSS font property.
|
* @param {string} The CSS font property.
|
||||||
* @return {Object.<string>} The font families (or null if the input spec is invalid).
|
* @return {Object<string>} The font families (or null if the input spec is invalid).
|
||||||
*/
|
*/
|
||||||
export const getFontFamilies = (function() {
|
export const getFontFamilies = (function() {
|
||||||
let style;
|
let style;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* @return {CanvasRenderingContext2D} The context.
|
* @return {CanvasRenderingContext2D} The context.
|
||||||
*/
|
*/
|
||||||
export function createCanvasContext2D(opt_width, opt_height) {
|
export function createCanvasContext2D(opt_width, opt_height) {
|
||||||
const canvas = /** @type {HTMLCanvasElement} */ (document.createElement('CANVAS'));
|
const canvas = /** @type {HTMLCanvasElement} */ (document.createElement('canvas'));
|
||||||
if (opt_width) {
|
if (opt_width) {
|
||||||
canvas.width = opt_width;
|
canvas.width = opt_width;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import {clear} from './obj.js';
|
|||||||
* @property {boolean} callOnce
|
* @property {boolean} callOnce
|
||||||
* @property {number} [deleteIndex]
|
* @property {number} [deleteIndex]
|
||||||
* @property {module:ol/events~ListenerFunction} listener
|
* @property {module:ol/events~ListenerFunction} listener
|
||||||
* @property {EventTarget|module:ol/events/EventTarget} target
|
* @property {module:ol/events/Target~EventTargetLike} target
|
||||||
* @property {string} type
|
* @property {string} type
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -73,9 +73,9 @@ export function findListener(listeners, listener, opt_this, opt_setDeleteIndex)
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/events/EventTarget~EventTargetLike} target Target.
|
* @param {module:ol/events/Target~EventTargetLike} target Target.
|
||||||
* @param {string} type Type.
|
* @param {string} type Type.
|
||||||
* @return {Array.<module:ol/events~EventsKey>|undefined} Listeners.
|
* @return {Array<module:ol/events~EventsKey>|undefined} Listeners.
|
||||||
*/
|
*/
|
||||||
export function getListeners(target, type) {
|
export function getListeners(target, type) {
|
||||||
const listenerMap = target.ol_lm;
|
const listenerMap = target.ol_lm;
|
||||||
@@ -86,8 +86,8 @@ export function getListeners(target, type) {
|
|||||||
/**
|
/**
|
||||||
* Get the lookup of listeners. If one does not exist on the target, it is
|
* Get the lookup of listeners. If one does not exist on the target, it is
|
||||||
* created.
|
* created.
|
||||||
* @param {module:ol/events/EventTarget~EventTargetLike} target Target.
|
* @param {module:ol/events/Target~EventTargetLike} target Target.
|
||||||
* @return {!Object.<string, Array.<module:ol/events~EventsKey>>} Map of
|
* @return {!Object<string, Array<module:ol/events~EventsKey>>} Map of
|
||||||
* listeners by event type.
|
* listeners by event type.
|
||||||
*/
|
*/
|
||||||
function getListenerMap(target) {
|
function getListenerMap(target) {
|
||||||
@@ -103,7 +103,7 @@ function getListenerMap(target) {
|
|||||||
* Clean up all listener objects of the given type. All properties on the
|
* Clean up all listener objects of the given type. All properties on the
|
||||||
* listener objects will be removed, and if no listeners remain in the listener
|
* listener objects will be removed, and if no listeners remain in the listener
|
||||||
* map, it will be removed from the target.
|
* map, it will be removed from the target.
|
||||||
* @param {module:ol/events/EventTarget~EventTargetLike} target Target.
|
* @param {module:ol/events/Target~EventTargetLike} target Target.
|
||||||
* @param {string} type Type.
|
* @param {string} type Type.
|
||||||
*/
|
*/
|
||||||
function removeListeners(target, type) {
|
function removeListeners(target, type) {
|
||||||
@@ -132,7 +132,7 @@ function removeListeners(target, type) {
|
|||||||
* This function efficiently binds a `listener` to a `this` object, and returns
|
* This function efficiently binds a `listener` to a `this` object, and returns
|
||||||
* a key for use with {@link module:ol/events~unlistenByKey}.
|
* a key for use with {@link module:ol/events~unlistenByKey}.
|
||||||
*
|
*
|
||||||
* @param {module:ol/events/EventTarget~EventTargetLike} target Event target.
|
* @param {module:ol/events/Target~EventTargetLike} target Event target.
|
||||||
* @param {string} type Event type.
|
* @param {string} type Event type.
|
||||||
* @param {module:ol/events~ListenerFunction} listener Listener.
|
* @param {module:ol/events~ListenerFunction} listener Listener.
|
||||||
* @param {Object=} opt_this Object referenced by the `this` keyword in the
|
* @param {Object=} opt_this Object referenced by the `this` keyword in the
|
||||||
@@ -181,7 +181,7 @@ export function listen(target, type, listener, opt_this, opt_once) {
|
|||||||
* function, the self-unregistering listener will be turned into a permanent
|
* function, the self-unregistering listener will be turned into a permanent
|
||||||
* listener.
|
* listener.
|
||||||
*
|
*
|
||||||
* @param {module:ol/events/EventTarget~EventTargetLike} target Event target.
|
* @param {module:ol/events/Target~EventTargetLike} target Event target.
|
||||||
* @param {string} type Event type.
|
* @param {string} type Event type.
|
||||||
* @param {module:ol/events~ListenerFunction} listener Listener.
|
* @param {module:ol/events~ListenerFunction} listener Listener.
|
||||||
* @param {Object=} opt_this Object referenced by the `this` keyword in the
|
* @param {Object=} opt_this Object referenced by the `this` keyword in the
|
||||||
@@ -200,7 +200,7 @@ export function listenOnce(target, type, listener, opt_this) {
|
|||||||
* To return a listener, this function needs to be called with the exact same
|
* To return a listener, this function needs to be called with the exact same
|
||||||
* arguments that were used for a previous {@link module:ol/events~listen} call.
|
* arguments that were used for a previous {@link module:ol/events~listen} call.
|
||||||
*
|
*
|
||||||
* @param {module:ol/events/EventTarget~EventTargetLike} target Event target.
|
* @param {module:ol/events/Target~EventTargetLike} target Event target.
|
||||||
* @param {string} type Event type.
|
* @param {string} type Event type.
|
||||||
* @param {module:ol/events~ListenerFunction} listener Listener.
|
* @param {module:ol/events~ListenerFunction} listener Listener.
|
||||||
* @param {Object=} opt_this Object referenced by the `this` keyword in the
|
* @param {Object=} opt_this Object referenced by the `this` keyword in the
|
||||||
@@ -248,7 +248,7 @@ export function unlistenByKey(key) {
|
|||||||
* Unregisters all event listeners on an event target. Inspired by
|
* Unregisters all event listeners on an event target. Inspired by
|
||||||
* https://google.github.io/closure-library/api/source/closure/goog/events/events.js.src.html
|
* https://google.github.io/closure-library/api/source/closure/goog/events/events.js.src.html
|
||||||
*
|
*
|
||||||
* @param {module:ol/events/EventTarget~EventTargetLike} target Target.
|
* @param {module:ol/events/Target~EventTargetLike} target Target.
|
||||||
*/
|
*/
|
||||||
export function unlistenAll(target) {
|
export function unlistenAll(target) {
|
||||||
const listenerMap = getListenerMap(target);
|
const listenerMap = getListenerMap(target);
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
* This implementation only provides `type` and `target` properties, and
|
* This implementation only provides `type` and `target` properties, and
|
||||||
* `stopPropagation` and `preventDefault` methods. It is meant as base class
|
* `stopPropagation` and `preventDefault` methods. It is meant as base class
|
||||||
* for higher level events defined in the library, and works with
|
* for higher level events defined in the library, and works with
|
||||||
* {@link module:ol/events/EventTarget~EventTarget}.
|
* {@link module:ol/events/Target~Target}.
|
||||||
*/
|
*/
|
||||||
class Event {
|
class Event {
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
/**
|
/**
|
||||||
* @module ol/events/EventTarget
|
* @module ol/events/Target
|
||||||
*/
|
*/
|
||||||
import Disposable from '../Disposable.js';
|
import Disposable from '../Disposable.js';
|
||||||
import {unlistenAll} from '../events.js';
|
import {unlistenAll} from '../events.js';
|
||||||
import {UNDEFINED} from '../functions.js';
|
import {VOID} from '../functions.js';
|
||||||
import Event from '../events/Event.js';
|
import Event from '../events/Event.js';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {EventTarget|module:ol/events/EventTarget} EventTargetLike
|
* @typedef {EventTarget|module:ol/events/Target} EventTargetLike
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -27,26 +27,26 @@ import Event from '../events/Event.js';
|
|||||||
* more listeners after this one will be called. Same as when the listener
|
* more listeners after this one will be called. Same as when the listener
|
||||||
* returns false.
|
* returns false.
|
||||||
*/
|
*/
|
||||||
class EventTarget extends Disposable {
|
class Target extends Disposable {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
||||||
super();
|
super();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {!Object.<string, number>}
|
* @type {!Object<string, number>}
|
||||||
*/
|
*/
|
||||||
this.pendingRemovals_ = {};
|
this.pendingRemovals_ = {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {!Object.<string, number>}
|
* @type {!Object<string, number>}
|
||||||
*/
|
*/
|
||||||
this.dispatching_ = {};
|
this.dispatching_ = {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {!Object.<string, Array.<module:ol/events~ListenerFunction>>}
|
* @type {!Object<string, Array<module:ol/events~ListenerFunction>>}
|
||||||
*/
|
*/
|
||||||
this.listeners_ = {};
|
this.listeners_ = {};
|
||||||
|
|
||||||
@@ -72,7 +72,7 @@ class EventTarget extends Disposable {
|
|||||||
* Object with a `type` property.
|
* Object with a `type` property.
|
||||||
*
|
*
|
||||||
* @param {{type: string,
|
* @param {{type: string,
|
||||||
* target: (EventTarget|module:ol/events/EventTarget|undefined)}|
|
* target: (module:ol/events/Target~EventTargetLike|undefined)}|
|
||||||
* module:ol/events/Event|string} event Event object.
|
* module:ol/events/Event|string} event Event object.
|
||||||
* @return {boolean|undefined} `false` if anyone called preventDefault on the
|
* @return {boolean|undefined} `false` if anyone called preventDefault on the
|
||||||
* event object or if any of the listeners returned false.
|
* event object or if any of the listeners returned false.
|
||||||
@@ -102,7 +102,7 @@ class EventTarget extends Disposable {
|
|||||||
let pendingRemovals = this.pendingRemovals_[type];
|
let pendingRemovals = this.pendingRemovals_[type];
|
||||||
delete this.pendingRemovals_[type];
|
delete this.pendingRemovals_[type];
|
||||||
while (pendingRemovals--) {
|
while (pendingRemovals--) {
|
||||||
this.removeEventListener(type, UNDEFINED);
|
this.removeEventListener(type, VOID);
|
||||||
}
|
}
|
||||||
delete this.dispatching_[type];
|
delete this.dispatching_[type];
|
||||||
}
|
}
|
||||||
@@ -122,7 +122,7 @@ class EventTarget extends Disposable {
|
|||||||
* order that they will be called in.
|
* order that they will be called in.
|
||||||
*
|
*
|
||||||
* @param {string} type Type.
|
* @param {string} type Type.
|
||||||
* @return {Array.<module:ol/events~ListenerFunction>} Listeners.
|
* @return {Array<module:ol/events~ListenerFunction>} Listeners.
|
||||||
*/
|
*/
|
||||||
getListeners(type) {
|
getListeners(type) {
|
||||||
return this.listeners_[type];
|
return this.listeners_[type];
|
||||||
@@ -130,7 +130,7 @@ class EventTarget extends Disposable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string=} opt_type Type. If not provided,
|
* @param {string=} opt_type Type. If not provided,
|
||||||
* `true` will be returned if this EventTarget has any listeners.
|
* `true` will be returned if this event target has any listeners.
|
||||||
* @return {boolean} Has listeners.
|
* @return {boolean} Has listeners.
|
||||||
*/
|
*/
|
||||||
hasListener(opt_type) {
|
hasListener(opt_type) {
|
||||||
@@ -149,7 +149,7 @@ class EventTarget extends Disposable {
|
|||||||
const index = listeners.indexOf(listener);
|
const index = listeners.indexOf(listener);
|
||||||
if (type in this.pendingRemovals_) {
|
if (type in this.pendingRemovals_) {
|
||||||
// make listener a no-op, and remove later in #dispatchEvent()
|
// make listener a no-op, and remove later in #dispatchEvent()
|
||||||
listeners[index] = UNDEFINED;
|
listeners[index] = VOID;
|
||||||
++this.pendingRemovals_[type];
|
++this.pendingRemovals_[type];
|
||||||
} else {
|
} else {
|
||||||
listeners.splice(index, 1);
|
listeners.splice(index, 1);
|
||||||
@@ -162,4 +162,4 @@ class EventTarget extends Disposable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export default EventTarget;
|
export default Target;
|
||||||
@@ -8,14 +8,14 @@ import Relationship from './extent/Relationship.js';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* An array of numbers representing an extent: `[minx, miny, maxx, maxy]`.
|
* An array of numbers representing an extent: `[minx, miny, maxx, maxy]`.
|
||||||
* @typedef {Array.<number>} Extent
|
* @typedef {Array<number>} Extent
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build an extent that includes all given coordinates.
|
* Build an extent that includes all given coordinates.
|
||||||
*
|
*
|
||||||
* @param {Array.<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
* @param {Array<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
||||||
* @return {module:ol/extent~Extent} Bounding extent.
|
* @return {module:ol/extent~Extent} Bounding extent.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
@@ -29,8 +29,8 @@ export function boundingExtent(coordinates) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array.<number>} xs Xs.
|
* @param {Array<number>} xs Xs.
|
||||||
* @param {Array.<number>} ys Ys.
|
* @param {Array<number>} ys Ys.
|
||||||
* @param {module:ol/extent~Extent=} opt_extent Destination extent.
|
* @param {module:ol/extent~Extent=} opt_extent Destination extent.
|
||||||
* @private
|
* @private
|
||||||
* @return {module:ol/extent~Extent} Extent.
|
* @return {module:ol/extent~Extent} Extent.
|
||||||
@@ -249,7 +249,7 @@ export function createOrUpdateFromCoordinate(coordinate, opt_extent) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array.<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
* @param {Array<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
||||||
* @param {module:ol/extent~Extent=} opt_extent Extent.
|
* @param {module:ol/extent~Extent=} opt_extent Extent.
|
||||||
* @return {module:ol/extent~Extent} Extent.
|
* @return {module:ol/extent~Extent} Extent.
|
||||||
*/
|
*/
|
||||||
@@ -260,7 +260,7 @@ export function createOrUpdateFromCoordinates(coordinates, opt_extent) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||||
* @param {number} offset Offset.
|
* @param {number} offset Offset.
|
||||||
* @param {number} end End.
|
* @param {number} end End.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
@@ -273,7 +273,7 @@ export function createOrUpdateFromFlatCoordinates(flatCoordinates, offset, end,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} rings Rings.
|
* @param {Array<Array<module:ol/coordinate~Coordinate>>} rings Rings.
|
||||||
* @param {module:ol/extent~Extent=} opt_extent Extent.
|
* @param {module:ol/extent~Extent=} opt_extent Extent.
|
||||||
* @return {module:ol/extent~Extent} Extent.
|
* @return {module:ol/extent~Extent} Extent.
|
||||||
*/
|
*/
|
||||||
@@ -342,7 +342,7 @@ export function extendCoordinate(extent, coordinate) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {module:ol/extent~Extent} extent Extent.
|
||||||
* @param {Array.<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
* @param {Array<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
||||||
* @return {module:ol/extent~Extent} Extent.
|
* @return {module:ol/extent~Extent} Extent.
|
||||||
*/
|
*/
|
||||||
export function extendCoordinates(extent, coordinates) {
|
export function extendCoordinates(extent, coordinates) {
|
||||||
@@ -355,7 +355,7 @@ export function extendCoordinates(extent, coordinates) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {module:ol/extent~Extent} extent Extent.
|
||||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||||
* @param {number} offset Offset.
|
* @param {number} offset Offset.
|
||||||
* @param {number} end End.
|
* @param {number} end End.
|
||||||
* @param {number} stride Stride.
|
* @param {number} stride Stride.
|
||||||
@@ -371,7 +371,7 @@ export function extendFlatCoordinates(extent, flatCoordinates, offset, end, stri
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {module:ol/extent~Extent} extent Extent.
|
||||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} rings Rings.
|
* @param {Array<Array<module:ol/coordinate~Coordinate>>} rings Rings.
|
||||||
* @return {module:ol/extent~Extent} Extent.
|
* @return {module:ol/extent~Extent} Extent.
|
||||||
*/
|
*/
|
||||||
export function extendRings(extent, rings) {
|
export function extendRings(extent, rings) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* @module ol/featureloader
|
* @module ol/featureloader
|
||||||
*/
|
*/
|
||||||
import {UNDEFINED} from './functions.js';
|
import {VOID} from './functions.js';
|
||||||
import FormatType from './format/FormatType.js';
|
import FormatType from './format/FormatType.js';
|
||||||
|
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ import FormatType from './format/FormatType.js';
|
|||||||
/**
|
/**
|
||||||
* @param {string|module:ol/featureloader~FeatureUrlFunction} url Feature URL service.
|
* @param {string|module:ol/featureloader~FeatureUrlFunction} url Feature URL service.
|
||||||
* @param {module:ol/format/Feature} format Feature format.
|
* @param {module:ol/format/Feature} format Feature format.
|
||||||
* @param {function(this:module:ol/VectorTile, Array.<module:ol/Feature>, module:ol/proj/Projection, module:ol/extent~Extent)|function(this:module:ol/source/Vector, Array.<module:ol/Feature>)} success
|
* @param {function(this:module:ol/VectorTile, Array<module:ol/Feature>, module:ol/proj/Projection, module:ol/extent~Extent)|function(this:module:ol/source/Vector, Array<module:ol/Feature>)} success
|
||||||
* Function called with the loaded features and optionally with the data
|
* Function called with the loaded features and optionally with the data
|
||||||
* projection. Called with the vector tile or source as `this`.
|
* projection. Called with the vector tile or source as `this`.
|
||||||
* @param {function(this:module:ol/VectorTile)|function(this:module:ol/source/Vector)} failure
|
* @param {function(this:module:ol/VectorTile)|function(this:module:ol/source/Vector)} failure
|
||||||
@@ -118,12 +118,12 @@ export function loadFeaturesXhr(url, format, success, failure) {
|
|||||||
export function xhr(url, format) {
|
export function xhr(url, format) {
|
||||||
return loadFeaturesXhr(url, format,
|
return loadFeaturesXhr(url, format,
|
||||||
/**
|
/**
|
||||||
* @param {Array.<module:ol/Feature>} features The loaded features.
|
* @param {Array<module:ol/Feature>} features The loaded features.
|
||||||
* @param {module:ol/proj/Projection} dataProjection Data
|
* @param {module:ol/proj/Projection} dataProjection Data
|
||||||
* projection.
|
* projection.
|
||||||
* @this {module:ol/source/Vector}
|
* @this {module:ol/source/Vector}
|
||||||
*/
|
*/
|
||||||
function(features, dataProjection) {
|
function(features, dataProjection) {
|
||||||
this.addFeatures(features);
|
this.addFeatures(features);
|
||||||
}, /* FIXME handle error */ UNDEFINED);
|
}, /* FIXME handle error */ VOID);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import {get as getProjection} from '../proj.js';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<module:ol/geom/GeometryType, function(EsriJSONGeometry): module:ol/geom/Geometry>}
|
* @type {Object<module:ol/geom/GeometryType, function(EsriJSONGeometry): module:ol/geom/Geometry>}
|
||||||
*/
|
*/
|
||||||
const GEOMETRY_READERS = {};
|
const GEOMETRY_READERS = {};
|
||||||
GEOMETRY_READERS[GeometryType.POINT] = readPointGeometry;
|
GEOMETRY_READERS[GeometryType.POINT] = readPointGeometry;
|
||||||
@@ -36,7 +36,7 @@ GEOMETRY_READERS[GeometryType.MULTI_POLYGON] = readMultiPolygonGeometry;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, function(module:ol/geom/Geometry, module:ol/format/Feature~WriteOptions=): (EsriJSONGeometry)>}
|
* @type {Object<string, function(module:ol/geom/Geometry, module:ol/format/Feature~WriteOptions=): (EsriJSONGeometry)>}
|
||||||
*/
|
*/
|
||||||
const GEOMETRY_WRITERS = {};
|
const GEOMETRY_WRITERS = {};
|
||||||
GEOMETRY_WRITERS[GeometryType.POINT] = writePointGeometry;
|
GEOMETRY_WRITERS[GeometryType.POINT] = writePointGeometry;
|
||||||
@@ -108,7 +108,7 @@ class EsriJSON extends JSONFeature {
|
|||||||
const options = opt_options ? opt_options : {};
|
const options = opt_options ? opt_options : {};
|
||||||
if (esriJSONObject.features) {
|
if (esriJSONObject.features) {
|
||||||
const esriJSONFeatureCollection = /** @type {EsriJSONFeatureCollection} */ (object);
|
const esriJSONFeatureCollection = /** @type {EsriJSONFeatureCollection} */ (object);
|
||||||
/** @type {Array.<module:ol/Feature>} */
|
/** @type {Array<module:ol/Feature>} */
|
||||||
const features = [];
|
const features = [];
|
||||||
const esriJSONFeatures = esriJSONFeatureCollection.features;
|
const esriJSONFeatures = esriJSONFeatureCollection.features;
|
||||||
options.idField = object.objectIdFieldName;
|
options.idField = object.objectIdFieldName;
|
||||||
@@ -188,7 +188,7 @@ class EsriJSON extends JSONFeature {
|
|||||||
/**
|
/**
|
||||||
* Encode an array of features as a EsriJSON object.
|
* Encode an array of features as a EsriJSON object.
|
||||||
*
|
*
|
||||||
* @param {Array.<module:ol/Feature>} features Features.
|
* @param {Array<module:ol/Feature>} features Features.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||||
* @return {Object} EsriJSON Object.
|
* @return {Object} EsriJSON Object.
|
||||||
* @override
|
* @override
|
||||||
@@ -252,9 +252,9 @@ function readGeometry(object, opt_options) {
|
|||||||
* Checks if any polygons in this array contain any other polygons in this
|
* Checks if any polygons in this array contain any other polygons in this
|
||||||
* array. It is used for checking for holes.
|
* array. It is used for checking for holes.
|
||||||
* Logic inspired by: https://github.com/Esri/terraformer-arcgis-parser
|
* Logic inspired by: https://github.com/Esri/terraformer-arcgis-parser
|
||||||
* @param {Array.<!Array.<!Array.<number>>>} rings Rings.
|
* @param {Array<!Array<!Array<number>>>} rings Rings.
|
||||||
* @param {module:ol/geom/GeometryLayout} layout Geometry layout.
|
* @param {module:ol/geom/GeometryLayout} layout Geometry layout.
|
||||||
* @return {Array.<!Array.<!Array.<number>>>} Transformed rings.
|
* @return {Array<!Array<!Array<number>>>} Transformed rings.
|
||||||
*/
|
*/
|
||||||
function convertRings(rings, layout) {
|
function convertRings(rings, layout) {
|
||||||
const flatRing = [];
|
const flatRing = [];
|
||||||
@@ -376,7 +376,7 @@ function readMultiPointGeometry(object) {
|
|||||||
function readMultiPolygonGeometry(object) {
|
function readMultiPolygonGeometry(object) {
|
||||||
const layout = getGeometryLayout(object);
|
const layout = getGeometryLayout(object);
|
||||||
return new MultiPolygon(
|
return new MultiPolygon(
|
||||||
/** @type {Array.<Array.<Array.<Array.<number>>>>} */(object.rings),
|
/** @type {Array<Array<Array<Array<number>>>>} */(object.rings),
|
||||||
layout);
|
layout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,14 +8,14 @@ import {get as getProjection, equivalent as equivalentProjection, transformExten
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} ReadOptions
|
* @typedef {Object} ReadOptions
|
||||||
* @property {module:ol/proj~ProjectionLike} dataProjection Projection of the data we are reading.
|
* @property {module:ol/proj~ProjectionLike} [dataProjection] Projection of the data we are reading.
|
||||||
* If not provided, the projection will be derived from the data (where possible) or
|
* If not provided, the projection will be derived from the data (where possible) or
|
||||||
* the `dataProjection` of the format is assigned (where set). If the projection
|
* the `dataProjection` of the format is assigned (where set). If the projection
|
||||||
* can not be derived from the data and if no `dataProjection` is set for a format,
|
* can not be derived from the data and if no `dataProjection` is set for a format,
|
||||||
* the features will not be reprojected.
|
* the features will not be reprojected.
|
||||||
* @property {module:ol/extent~Extent} extent Tile extent of the tile being read. This is only used and
|
* @property {module:ol/extent~Extent} [extent] Tile extent of the tile being read. This is only used and
|
||||||
* required for {@link module:ol/format/MVT}.
|
* required for {@link module:ol/format/MVT}.
|
||||||
* @property {module:ol/proj~ProjectionLike} featureProjection Projection of the feature geometries
|
* @property {module:ol/proj~ProjectionLike} [featureProjection] Projection of the feature geometries
|
||||||
* created by the format reader. If not provided, features will be returned in the
|
* created by the format reader. If not provided, features will be returned in the
|
||||||
* `dataProjection`.
|
* `dataProjection`.
|
||||||
*/
|
*/
|
||||||
@@ -23,11 +23,11 @@ import {get as getProjection, equivalent as equivalentProjection, transformExten
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} WriteOptions
|
* @typedef {Object} WriteOptions
|
||||||
* @property {module:ol/proj~ProjectionLike} dataProjection Projection of the data we are writing.
|
* @property {module:ol/proj~ProjectionLike} [dataProjection] Projection of the data we are writing.
|
||||||
* If not provided, the `dataProjection` of the format is assigned (where set).
|
* If not provided, the `dataProjection` of the format is assigned (where set).
|
||||||
* If no `dataProjection` is set for a format, the features will be returned
|
* If no `dataProjection` is set for a format, the features will be returned
|
||||||
* in the `featureProjection`.
|
* in the `featureProjection`.
|
||||||
* @property {module:ol/proj~ProjectionLike} featureProjection Projection of the feature geometries
|
* @property {module:ol/proj~ProjectionLike} [featureProjection] Projection of the feature geometries
|
||||||
* that will be serialized by the format writer. If not provided, geometries are assumed
|
* that will be serialized by the format writer. If not provided, geometries are assumed
|
||||||
* to be in the `dataProjection` if that is set; in other words, they are not transformed.
|
* to be in the `dataProjection` if that is set; in other words, they are not transformed.
|
||||||
* @property {boolean} [rightHanded] When writing geometries, follow the right-hand
|
* @property {boolean} [rightHanded] When writing geometries, follow the right-hand
|
||||||
@@ -141,7 +141,7 @@ class FeatureFormat {
|
|||||||
* @abstract
|
* @abstract
|
||||||
* @param {Document|Node|ArrayBuffer|Object|string} source Source.
|
* @param {Document|Node|ArrayBuffer|Object|string} source Source.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||||
* @return {Array.<module:ol/Feature>} Features.
|
* @return {Array<module:ol/Feature>} Features.
|
||||||
*/
|
*/
|
||||||
readFeatures(source, opt_options) {}
|
readFeatures(source, opt_options) {}
|
||||||
|
|
||||||
@@ -178,7 +178,7 @@ class FeatureFormat {
|
|||||||
* Encode an array of features in this format.
|
* Encode an array of features in this format.
|
||||||
*
|
*
|
||||||
* @abstract
|
* @abstract
|
||||||
* @param {Array.<module:ol/Feature>} features Features.
|
* @param {Array<module:ol/Feature>} features Features.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||||
* @return {string} Result.
|
* @return {string} Result.
|
||||||
*/
|
*/
|
||||||
@@ -200,7 +200,7 @@ export default FeatureFormat;
|
|||||||
/**
|
/**
|
||||||
* @param {module:ol/geom/Geometry|module:ol/extent~Extent} geometry Geometry.
|
* @param {module:ol/geom/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|undefined} opt_options
|
||||||
* Options.
|
* Options.
|
||||||
* @return {module:ol/geom/Geometry|module:ol/extent~Extent} Transformed geometry.
|
* @return {module:ol/geom/Geometry|module:ol/extent~Extent} Transformed geometry.
|
||||||
*/
|
*/
|
||||||
@@ -234,8 +234,8 @@ export function transformWithOptions(geometry, write, opt_options) {
|
|||||||
const power = Math.pow(10, opt_options.decimals);
|
const power = Math.pow(10, opt_options.decimals);
|
||||||
// if decimals option on write, round each coordinate appropriately
|
// if decimals option on write, round each coordinate appropriately
|
||||||
/**
|
/**
|
||||||
* @param {Array.<number>} coordinates Coordinates.
|
* @param {Array<number>} coordinates Coordinates.
|
||||||
* @return {Array.<number>} Transformed coordinates.
|
* @return {Array<number>} Transformed coordinates.
|
||||||
*/
|
*/
|
||||||
const transform = function(coordinates) {
|
const transform = function(coordinates) {
|
||||||
for (let i = 0, ii = coordinates.length; i < ii; ++i) {
|
for (let i = 0, ii = coordinates.length; i < ii; ++i) {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ const GML = GML3;
|
|||||||
* Encode an array of features in GML 3.1.1 Simple Features.
|
* Encode an array of features in GML 3.1.1 Simple Features.
|
||||||
*
|
*
|
||||||
* @function
|
* @function
|
||||||
* @param {Array.<module:ol/Feature>} features Features.
|
* @param {Array<module:ol/Feature>} features Features.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
||||||
* @return {string} Result.
|
* @return {string} Result.
|
||||||
* @api
|
* @api
|
||||||
@@ -32,7 +32,7 @@ GML.prototype.writeFeatures;
|
|||||||
* Encode an array of features in the GML 3.1.1 format as an XML node.
|
* Encode an array of features in the GML 3.1.1 format as an XML node.
|
||||||
*
|
*
|
||||||
* @function
|
* @function
|
||||||
* @param {Array.<module:ol/Feature>} features Features.
|
* @param {Array<module:ol/Feature>} features Features.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
||||||
* @return {Node} Node.
|
* @return {Node} Node.
|
||||||
* @api
|
* @api
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ const schemaLocation = GMLNS + ' http://schemas.opengis.net/gml/2.1.2/feature.xs
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, string>}
|
* @type {Object<string, string>}
|
||||||
*/
|
*/
|
||||||
const MULTIGEOMETRY_TO_MEMBER_NODENAME = {
|
const MULTIGEOMETRY_TO_MEMBER_NODENAME = {
|
||||||
'MultiLineString': 'lineStringMember',
|
'MultiLineString': 'lineStringMember',
|
||||||
@@ -63,9 +63,9 @@ class GML2 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {Array.<number>|undefined} Flat coordinates.
|
* @return {Array<number>|undefined} Flat coordinates.
|
||||||
*/
|
*/
|
||||||
readFlatCoordinates_(node, objectStack) {
|
readFlatCoordinates_(node, objectStack) {
|
||||||
const s = getAllTextContent(node, false).replace(/^\s*|\s*$/g, '');
|
const s = getAllTextContent(node, false).replace(/^\s*|\s*$/g, '');
|
||||||
@@ -96,12 +96,12 @@ class GML2 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {module:ol/extent~Extent|undefined} Envelope.
|
* @return {module:ol/extent~Extent|undefined} Envelope.
|
||||||
*/
|
*/
|
||||||
readBox_(node, objectStack) {
|
readBox_(node, objectStack) {
|
||||||
/** @type {Array.<number>} */
|
/** @type {Array<number>} */
|
||||||
const flatCoordinates = pushParseAndPop([null],
|
const flatCoordinates = pushParseAndPop([null],
|
||||||
this.BOX_PARSERS_, node, objectStack, this);
|
this.BOX_PARSERS_, node, objectStack, this);
|
||||||
return createOrUpdate(flatCoordinates[1][0],
|
return createOrUpdate(flatCoordinates[1][0],
|
||||||
@@ -111,15 +111,15 @@ class GML2 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
innerBoundaryIsParser_(node, objectStack) {
|
innerBoundaryIsParser_(node, objectStack) {
|
||||||
/** @type {Array.<number>|undefined} */
|
/** @type {Array<number>|undefined} */
|
||||||
const flatLinearRing = pushParseAndPop(undefined,
|
const flatLinearRing = pushParseAndPop(undefined,
|
||||||
this.RING_PARSERS, node, objectStack, this);
|
this.RING_PARSERS, node, objectStack, this);
|
||||||
if (flatLinearRing) {
|
if (flatLinearRing) {
|
||||||
const flatLinearRings = /** @type {Array.<Array.<number>>} */
|
const flatLinearRings = /** @type {Array<Array<number>>} */
|
||||||
(objectStack[objectStack.length - 1]);
|
(objectStack[objectStack.length - 1]);
|
||||||
flatLinearRings.push(flatLinearRing);
|
flatLinearRings.push(flatLinearRing);
|
||||||
}
|
}
|
||||||
@@ -127,15 +127,15 @@ class GML2 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
outerBoundaryIsParser_(node, objectStack) {
|
outerBoundaryIsParser_(node, objectStack) {
|
||||||
/** @type {Array.<number>|undefined} */
|
/** @type {Array<number>|undefined} */
|
||||||
const flatLinearRing = pushParseAndPop(undefined,
|
const flatLinearRing = pushParseAndPop(undefined,
|
||||||
this.RING_PARSERS, node, objectStack, this);
|
this.RING_PARSERS, node, objectStack, this);
|
||||||
if (flatLinearRing) {
|
if (flatLinearRing) {
|
||||||
const flatLinearRings = /** @type {Array.<Array.<number>>} */
|
const flatLinearRings = /** @type {Array<Array<number>>} */
|
||||||
(objectStack[objectStack.length - 1]);
|
(objectStack[objectStack.length - 1]);
|
||||||
flatLinearRings[0] = flatLinearRing;
|
flatLinearRings[0] = flatLinearRing;
|
||||||
}
|
}
|
||||||
@@ -144,7 +144,7 @@ class GML2 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @param {*} value Value.
|
* @param {*} value Value.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @param {string=} opt_nodeName Node name.
|
* @param {string=} opt_nodeName Node name.
|
||||||
* @return {Node|undefined} Node.
|
* @return {Node|undefined} Node.
|
||||||
* @private
|
* @private
|
||||||
@@ -174,7 +174,7 @@ class GML2 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/Feature} feature Feature.
|
* @param {module:ol/Feature} feature Feature.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
writeFeatureElement(node, feature, objectStack) {
|
writeFeatureElement(node, feature, objectStack) {
|
||||||
const fid = feature.getId();
|
const fid = feature.getId();
|
||||||
@@ -220,7 +220,7 @@ class GML2 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/LineString} geometry LineString geometry.
|
* @param {module:ol/geom/LineString} geometry LineString geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeCurveOrLineString_(node, geometry, objectStack) {
|
writeCurveOrLineString_(node, geometry, objectStack) {
|
||||||
@@ -245,7 +245,7 @@ class GML2 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/LineString} line LineString geometry.
|
* @param {module:ol/geom/LineString} line LineString geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeLineStringOrCurveMember_(node, line, objectStack) {
|
writeLineStringOrCurveMember_(node, line, objectStack) {
|
||||||
@@ -259,7 +259,7 @@ class GML2 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/MultiLineString} geometry MultiLineString geometry.
|
* @param {module:ol/geom/MultiLineString} geometry MultiLineString geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeMultiCurveOrLineString_(node, geometry, objectStack) {
|
writeMultiCurveOrLineString_(node, geometry, objectStack) {
|
||||||
@@ -280,7 +280,7 @@ class GML2 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/Geometry|module:ol/extent~Extent} geometry Geometry.
|
* @param {module:ol/geom/Geometry|module:ol/extent~Extent} geometry Geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
writeGeometryElement(node, geometry, objectStack) {
|
writeGeometryElement(node, geometry, objectStack) {
|
||||||
const context = /** @type {module:ol/format/Feature~WriteOptions} */ (objectStack[objectStack.length - 1]);
|
const context = /** @type {module:ol/format/Feature~WriteOptions} */ (objectStack[objectStack.length - 1]);
|
||||||
@@ -320,7 +320,7 @@ class GML2 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/LineString|module:ol/geom/LinearRing} value Geometry.
|
* @param {module:ol/geom/LineString|module:ol/geom/LinearRing} value Geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeCoordinates_(node, value, objectStack) {
|
writeCoordinates_(node, value, objectStack) {
|
||||||
@@ -341,7 +341,7 @@ class GML2 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/LineString} line LineString geometry.
|
* @param {module:ol/geom/LineString} line LineString geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeCurveSegments_(node, line, objectStack) {
|
writeCurveSegments_(node, line, objectStack) {
|
||||||
@@ -353,7 +353,7 @@ class GML2 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/Polygon} geometry Polygon geometry.
|
* @param {module:ol/geom/Polygon} geometry Polygon geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeSurfaceOrPolygon_(node, geometry, objectStack) {
|
writeSurfaceOrPolygon_(node, geometry, objectStack) {
|
||||||
@@ -380,7 +380,7 @@ class GML2 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {*} value Value.
|
* @param {*} value Value.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @param {string=} opt_nodeName Node name.
|
* @param {string=} opt_nodeName Node name.
|
||||||
* @return {Node} Node.
|
* @return {Node} Node.
|
||||||
* @private
|
* @private
|
||||||
@@ -399,7 +399,7 @@ class GML2 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/Polygon} polygon Polygon geometry.
|
* @param {module:ol/geom/Polygon} polygon Polygon geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeSurfacePatches_(node, polygon, objectStack) {
|
writeSurfacePatches_(node, polygon, objectStack) {
|
||||||
@@ -411,7 +411,7 @@ class GML2 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/LinearRing} ring LinearRing geometry.
|
* @param {module:ol/geom/LinearRing} ring LinearRing geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeRing_(node, ring, objectStack) {
|
writeRing_(node, ring, objectStack) {
|
||||||
@@ -421,7 +421,7 @@ class GML2 extends GMLBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array.<number>} point Point geometry.
|
* @param {Array<number>} point Point geometry.
|
||||||
* @param {string=} opt_srsName Optional srsName
|
* @param {string=} opt_srsName Optional srsName
|
||||||
* @param {boolean=} opt_hasZ whether the geometry has a Z coordinate (is 3D) or not.
|
* @param {boolean=} opt_hasZ whether the geometry has a Z coordinate (is 3D) or not.
|
||||||
* @return {string} The coords string.
|
* @return {string} The coords string.
|
||||||
@@ -447,7 +447,7 @@ class GML2 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/Point} geometry Point geometry.
|
* @param {module:ol/geom/Point} geometry Point geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writePoint_(node, geometry, objectStack) {
|
writePoint_(node, geometry, objectStack) {
|
||||||
@@ -467,7 +467,7 @@ class GML2 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/MultiPoint} geometry MultiPoint geometry.
|
* @param {module:ol/geom/MultiPoint} geometry MultiPoint geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeMultiPoint_(node, geometry, objectStack) {
|
writeMultiPoint_(node, geometry, objectStack) {
|
||||||
@@ -487,7 +487,7 @@ class GML2 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/Point} point Point geometry.
|
* @param {module:ol/geom/Point} point Point geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writePointMember_(node, point, objectStack) {
|
writePointMember_(node, point, objectStack) {
|
||||||
@@ -499,7 +499,7 @@ class GML2 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/LinearRing} geometry LinearRing geometry.
|
* @param {module:ol/geom/LinearRing} geometry LinearRing geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeLinearRing_(node, geometry, objectStack) {
|
writeLinearRing_(node, geometry, objectStack) {
|
||||||
@@ -516,7 +516,7 @@ class GML2 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/MultiPolygon} geometry MultiPolygon geometry.
|
* @param {module:ol/geom/MultiPolygon} geometry MultiPolygon geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeMultiSurfaceOrPolygon_(node, geometry, objectStack) {
|
writeMultiSurfaceOrPolygon_(node, geometry, objectStack) {
|
||||||
@@ -537,7 +537,7 @@ class GML2 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/Polygon} polygon Polygon geometry.
|
* @param {module:ol/geom/Polygon} polygon Polygon geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeSurfaceOrPolygonMember_(node, polygon, objectStack) {
|
writeSurfaceOrPolygonMember_(node, polygon, objectStack) {
|
||||||
@@ -552,7 +552,7 @@ class GML2 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {module:ol/extent~Extent} extent Extent.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeEnvelope(node, extent, objectStack) {
|
writeEnvelope(node, extent, objectStack) {
|
||||||
@@ -573,7 +573,7 @@ class GML2 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @param {*} value Value.
|
* @param {*} value Value.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @param {string=} opt_nodeName Node name.
|
* @param {string=} opt_nodeName Node name.
|
||||||
* @return {Node|undefined} Node.
|
* @return {Node|undefined} Node.
|
||||||
* @private
|
* @private
|
||||||
@@ -587,7 +587,7 @@ class GML2 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML2.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
|
GML2.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
|
||||||
@@ -598,7 +598,7 @@ GML2.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML2.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
|
GML2.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
|
||||||
@@ -610,7 +610,7 @@ GML2.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML2.prototype.BOX_PARSERS_ = {
|
GML2.prototype.BOX_PARSERS_ = {
|
||||||
@@ -622,7 +622,7 @@ GML2.prototype.BOX_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML2.prototype.GEOMETRY_PARSERS_ = {
|
GML2.prototype.GEOMETRY_PARSERS_ = {
|
||||||
@@ -645,7 +645,7 @@ GML2.prototype.GEOMETRY_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML2.prototype.GEOMETRY_SERIALIZERS_ = {
|
GML2.prototype.GEOMETRY_SERIALIZERS_ = {
|
||||||
@@ -677,7 +677,7 @@ GML2.prototype.GEOMETRY_SERIALIZERS_ = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML2.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
|
GML2.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
|
||||||
@@ -690,7 +690,7 @@ GML2.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML2.prototype.RING_SERIALIZERS_ = {
|
GML2.prototype.RING_SERIALIZERS_ = {
|
||||||
@@ -701,7 +701,7 @@ GML2.prototype.RING_SERIALIZERS_ = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML2.prototype.POINTMEMBER_SERIALIZERS_ = {
|
GML2.prototype.POINTMEMBER_SERIALIZERS_ = {
|
||||||
@@ -713,7 +713,7 @@ GML2.prototype.POINTMEMBER_SERIALIZERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML2.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
|
GML2.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
|
||||||
@@ -726,7 +726,7 @@ GML2.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML2.prototype.ENVELOPE_SERIALIZERS_ = {
|
GML2.prototype.ENVELOPE_SERIALIZERS_ = {
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ const schemaLocation = GMLNS +
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, string>}
|
* @type {Object<string, string>}
|
||||||
*/
|
*/
|
||||||
const MULTIGEOMETRY_TO_MEMBER_NODENAME = {
|
const MULTIGEOMETRY_TO_MEMBER_NODENAME = {
|
||||||
'MultiLineString': 'lineStringMember',
|
'MultiLineString': 'lineStringMember',
|
||||||
@@ -103,12 +103,12 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {module:ol/geom/MultiLineString|undefined} MultiLineString.
|
* @return {module:ol/geom/MultiLineString|undefined} MultiLineString.
|
||||||
*/
|
*/
|
||||||
readMultiCurve_(node, objectStack) {
|
readMultiCurve_(node, objectStack) {
|
||||||
/** @type {Array.<module:ol/geom/LineString>} */
|
/** @type {Array<module:ol/geom/LineString>} */
|
||||||
const lineStrings = pushParseAndPop([],
|
const lineStrings = pushParseAndPop([],
|
||||||
this.MULTICURVE_PARSERS_, node, objectStack, this);
|
this.MULTICURVE_PARSERS_, node, objectStack, this);
|
||||||
if (lineStrings) {
|
if (lineStrings) {
|
||||||
@@ -121,12 +121,12 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {module:ol/geom/MultiPolygon|undefined} MultiPolygon.
|
* @return {module:ol/geom/MultiPolygon|undefined} MultiPolygon.
|
||||||
*/
|
*/
|
||||||
readMultiSurface_(node, objectStack) {
|
readMultiSurface_(node, objectStack) {
|
||||||
/** @type {Array.<module:ol/geom/Polygon>} */
|
/** @type {Array<module:ol/geom/Polygon>} */
|
||||||
const polygons = pushParseAndPop([],
|
const polygons = pushParseAndPop([],
|
||||||
this.MULTISURFACE_PARSERS_, node, objectStack, this);
|
this.MULTISURFACE_PARSERS_, node, objectStack, this);
|
||||||
if (polygons) {
|
if (polygons) {
|
||||||
@@ -136,7 +136,7 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
curveMemberParser_(node, objectStack) {
|
curveMemberParser_(node, objectStack) {
|
||||||
@@ -145,7 +145,7 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
surfaceMemberParser_(node, objectStack) {
|
surfaceMemberParser_(node, objectStack) {
|
||||||
@@ -155,9 +155,9 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {Array.<(Array.<number>)>|undefined} flat coordinates.
|
* @return {Array<(Array<number>)>|undefined} flat coordinates.
|
||||||
*/
|
*/
|
||||||
readPatch_(node, objectStack) {
|
readPatch_(node, objectStack) {
|
||||||
return pushParseAndPop([null],
|
return pushParseAndPop([null],
|
||||||
@@ -166,9 +166,9 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {Array.<number>|undefined} flat coordinates.
|
* @return {Array<number>|undefined} flat coordinates.
|
||||||
*/
|
*/
|
||||||
readSegment_(node, objectStack) {
|
readSegment_(node, objectStack) {
|
||||||
return pushParseAndPop([null],
|
return pushParseAndPop([null],
|
||||||
@@ -177,9 +177,9 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {Array.<(Array.<number>)>|undefined} flat coordinates.
|
* @return {Array<(Array<number>)>|undefined} flat coordinates.
|
||||||
*/
|
*/
|
||||||
readPolygonPatch_(node, objectStack) {
|
readPolygonPatch_(node, objectStack) {
|
||||||
return pushParseAndPop([null],
|
return pushParseAndPop([null],
|
||||||
@@ -188,9 +188,9 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {Array.<number>|undefined} flat coordinates.
|
* @return {Array<number>|undefined} flat coordinates.
|
||||||
*/
|
*/
|
||||||
readLineStringSegment_(node, objectStack) {
|
readLineStringSegment_(node, objectStack) {
|
||||||
return pushParseAndPop([null],
|
return pushParseAndPop([null],
|
||||||
@@ -200,15 +200,15 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
interiorParser_(node, objectStack) {
|
interiorParser_(node, objectStack) {
|
||||||
/** @type {Array.<number>|undefined} */
|
/** @type {Array<number>|undefined} */
|
||||||
const flatLinearRing = pushParseAndPop(undefined,
|
const flatLinearRing = pushParseAndPop(undefined,
|
||||||
this.RING_PARSERS, node, objectStack, this);
|
this.RING_PARSERS, node, objectStack, this);
|
||||||
if (flatLinearRing) {
|
if (flatLinearRing) {
|
||||||
const flatLinearRings = /** @type {Array.<Array.<number>>} */
|
const flatLinearRings = /** @type {Array<Array<number>>} */
|
||||||
(objectStack[objectStack.length - 1]);
|
(objectStack[objectStack.length - 1]);
|
||||||
flatLinearRings.push(flatLinearRing);
|
flatLinearRings.push(flatLinearRing);
|
||||||
}
|
}
|
||||||
@@ -216,15 +216,15 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
exteriorParser_(node, objectStack) {
|
exteriorParser_(node, objectStack) {
|
||||||
/** @type {Array.<number>|undefined} */
|
/** @type {Array<number>|undefined} */
|
||||||
const flatLinearRing = pushParseAndPop(undefined,
|
const flatLinearRing = pushParseAndPop(undefined,
|
||||||
this.RING_PARSERS, node, objectStack, this);
|
this.RING_PARSERS, node, objectStack, this);
|
||||||
if (flatLinearRing) {
|
if (flatLinearRing) {
|
||||||
const flatLinearRings = /** @type {Array.<Array.<number>>} */
|
const flatLinearRings = /** @type {Array<Array<number>>} */
|
||||||
(objectStack[objectStack.length - 1]);
|
(objectStack[objectStack.length - 1]);
|
||||||
flatLinearRings[0] = flatLinearRing;
|
flatLinearRings[0] = flatLinearRing;
|
||||||
}
|
}
|
||||||
@@ -232,12 +232,12 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {module:ol/geom/Polygon|undefined} Polygon.
|
* @return {module:ol/geom/Polygon|undefined} Polygon.
|
||||||
*/
|
*/
|
||||||
readSurface_(node, objectStack) {
|
readSurface_(node, objectStack) {
|
||||||
/** @type {Array.<Array.<number>>} */
|
/** @type {Array<Array<number>>} */
|
||||||
const flatLinearRings = pushParseAndPop([null],
|
const flatLinearRings = pushParseAndPop([null],
|
||||||
this.SURFACE_PARSERS_, node, objectStack, this);
|
this.SURFACE_PARSERS_, node, objectStack, this);
|
||||||
if (flatLinearRings && flatLinearRings[0]) {
|
if (flatLinearRings && flatLinearRings[0]) {
|
||||||
@@ -256,12 +256,12 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {module:ol/geom/LineString|undefined} LineString.
|
* @return {module:ol/geom/LineString|undefined} LineString.
|
||||||
*/
|
*/
|
||||||
readCurve_(node, objectStack) {
|
readCurve_(node, objectStack) {
|
||||||
/** @type {Array.<number>} */
|
/** @type {Array<number>} */
|
||||||
const flatCoordinates = pushParseAndPop([null],
|
const flatCoordinates = pushParseAndPop([null],
|
||||||
this.CURVE_PARSERS_, node, objectStack, this);
|
this.CURVE_PARSERS_, node, objectStack, this);
|
||||||
if (flatCoordinates) {
|
if (flatCoordinates) {
|
||||||
@@ -274,12 +274,12 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {module:ol/extent~Extent|undefined} Envelope.
|
* @return {module:ol/extent~Extent|undefined} Envelope.
|
||||||
*/
|
*/
|
||||||
readEnvelope_(node, objectStack) {
|
readEnvelope_(node, objectStack) {
|
||||||
/** @type {Array.<number>} */
|
/** @type {Array<number>} */
|
||||||
const flatCoordinates = pushParseAndPop([null],
|
const flatCoordinates = pushParseAndPop([null],
|
||||||
this.ENVELOPE_PARSERS_, node, objectStack, this);
|
this.ENVELOPE_PARSERS_, node, objectStack, this);
|
||||||
return createOrUpdate(flatCoordinates[1][0],
|
return createOrUpdate(flatCoordinates[1][0],
|
||||||
@@ -289,14 +289,14 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {Array.<number>|undefined} Flat coordinates.
|
* @return {Array<number>|undefined} Flat coordinates.
|
||||||
*/
|
*/
|
||||||
readFlatPos_(node, objectStack) {
|
readFlatPos_(node, objectStack) {
|
||||||
let s = getAllTextContent(node, false);
|
let s = getAllTextContent(node, false);
|
||||||
const re = /^\s*([+\-]?\d*\.?\d+(?:[eE][+\-]?\d+)?)\s*/;
|
const re = /^\s*([+\-]?\d*\.?\d+(?:[eE][+\-]?\d+)?)\s*/;
|
||||||
/** @type {Array.<number>} */
|
/** @type {Array<number>} */
|
||||||
const flatCoordinates = [];
|
const flatCoordinates = [];
|
||||||
let m;
|
let m;
|
||||||
while ((m = re.exec(s))) {
|
while ((m = re.exec(s))) {
|
||||||
@@ -334,9 +334,9 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {Array.<number>|undefined} Flat coordinates.
|
* @return {Array<number>|undefined} Flat coordinates.
|
||||||
*/
|
*/
|
||||||
readFlatPosList_(node, objectStack) {
|
readFlatPosList_(node, objectStack) {
|
||||||
const s = getAllTextContent(node, false).replace(/^\s*|\s*$/g, '');
|
const s = getAllTextContent(node, false).replace(/^\s*|\s*$/g, '');
|
||||||
@@ -381,7 +381,7 @@ class GML3 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/Point} value Point geometry.
|
* @param {module:ol/geom/Point} value Point geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writePos_(node, value, objectStack) {
|
writePos_(node, value, objectStack) {
|
||||||
@@ -411,7 +411,7 @@ class GML3 extends GMLBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array.<number>} point Point geometry.
|
* @param {Array<number>} point Point geometry.
|
||||||
* @param {string=} opt_srsName Optional srsName
|
* @param {string=} opt_srsName Optional srsName
|
||||||
* @param {boolean=} opt_hasZ whether the geometry has a Z coordinate (is 3D) or not.
|
* @param {boolean=} opt_hasZ whether the geometry has a Z coordinate (is 3D) or not.
|
||||||
* @return {string} The coords string.
|
* @return {string} The coords string.
|
||||||
@@ -437,7 +437,7 @@ class GML3 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/LineString|module:ol/geom/LinearRing} value Geometry.
|
* @param {module:ol/geom/LineString|module:ol/geom/LinearRing} value Geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writePosList_(node, value, objectStack) {
|
writePosList_(node, value, objectStack) {
|
||||||
@@ -461,7 +461,7 @@ class GML3 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/Point} geometry Point geometry.
|
* @param {module:ol/geom/Point} geometry Point geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writePoint_(node, geometry, objectStack) {
|
writePoint_(node, geometry, objectStack) {
|
||||||
@@ -478,7 +478,7 @@ class GML3 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/extent~Extent} extent Extent.
|
* @param {module:ol/extent~Extent} extent Extent.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
writeEnvelope(node, extent, objectStack) {
|
writeEnvelope(node, extent, objectStack) {
|
||||||
const context = objectStack[objectStack.length - 1];
|
const context = objectStack[objectStack.length - 1];
|
||||||
@@ -498,7 +498,7 @@ class GML3 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/LinearRing} geometry LinearRing geometry.
|
* @param {module:ol/geom/LinearRing} geometry LinearRing geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeLinearRing_(node, geometry, objectStack) {
|
writeLinearRing_(node, geometry, objectStack) {
|
||||||
@@ -514,7 +514,7 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {*} value Value.
|
* @param {*} value Value.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @param {string=} opt_nodeName Node name.
|
* @param {string=} opt_nodeName Node name.
|
||||||
* @return {Node} Node.
|
* @return {Node} Node.
|
||||||
* @private
|
* @private
|
||||||
@@ -533,7 +533,7 @@ class GML3 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/Polygon} geometry Polygon geometry.
|
* @param {module:ol/geom/Polygon} geometry Polygon geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeSurfaceOrPolygon_(node, geometry, objectStack) {
|
writeSurfaceOrPolygon_(node, geometry, objectStack) {
|
||||||
@@ -561,7 +561,7 @@ class GML3 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/LineString} geometry LineString geometry.
|
* @param {module:ol/geom/LineString} geometry LineString geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeCurveOrLineString_(node, geometry, objectStack) {
|
writeCurveOrLineString_(node, geometry, objectStack) {
|
||||||
@@ -586,7 +586,7 @@ class GML3 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/MultiPolygon} geometry MultiPolygon geometry.
|
* @param {module:ol/geom/MultiPolygon} geometry MultiPolygon geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeMultiSurfaceOrPolygon_(node, geometry, objectStack) {
|
writeMultiSurfaceOrPolygon_(node, geometry, objectStack) {
|
||||||
@@ -607,7 +607,7 @@ class GML3 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/MultiPoint} geometry MultiPoint geometry.
|
* @param {module:ol/geom/MultiPoint} geometry MultiPoint geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeMultiPoint_(node, geometry, objectStack) {
|
writeMultiPoint_(node, geometry, objectStack) {
|
||||||
@@ -627,7 +627,7 @@ class GML3 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/MultiLineString} geometry MultiLineString geometry.
|
* @param {module:ol/geom/MultiLineString} geometry MultiLineString geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeMultiCurveOrLineString_(node, geometry, objectStack) {
|
writeMultiCurveOrLineString_(node, geometry, objectStack) {
|
||||||
@@ -648,7 +648,7 @@ class GML3 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/LinearRing} ring LinearRing geometry.
|
* @param {module:ol/geom/LinearRing} ring LinearRing geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeRing_(node, ring, objectStack) {
|
writeRing_(node, ring, objectStack) {
|
||||||
@@ -660,7 +660,7 @@ class GML3 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/Polygon} polygon Polygon geometry.
|
* @param {module:ol/geom/Polygon} polygon Polygon geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeSurfaceOrPolygonMember_(node, polygon, objectStack) {
|
writeSurfaceOrPolygonMember_(node, polygon, objectStack) {
|
||||||
@@ -675,7 +675,7 @@ class GML3 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/Point} point Point geometry.
|
* @param {module:ol/geom/Point} point Point geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writePointMember_(node, point, objectStack) {
|
writePointMember_(node, point, objectStack) {
|
||||||
@@ -687,7 +687,7 @@ class GML3 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/LineString} line LineString geometry.
|
* @param {module:ol/geom/LineString} line LineString geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeLineStringOrCurveMember_(node, line, objectStack) {
|
writeLineStringOrCurveMember_(node, line, objectStack) {
|
||||||
@@ -701,7 +701,7 @@ class GML3 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/Polygon} polygon Polygon geometry.
|
* @param {module:ol/geom/Polygon} polygon Polygon geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeSurfacePatches_(node, polygon, objectStack) {
|
writeSurfacePatches_(node, polygon, objectStack) {
|
||||||
@@ -713,7 +713,7 @@ class GML3 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/LineString} line LineString geometry.
|
* @param {module:ol/geom/LineString} line LineString geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeCurveSegments_(node, line, objectStack) {
|
writeCurveSegments_(node, line, objectStack) {
|
||||||
@@ -726,7 +726,7 @@ class GML3 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/Geometry|module:ol/extent~Extent} geometry Geometry.
|
* @param {module:ol/geom/Geometry|module:ol/extent~Extent} geometry Geometry.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
writeGeometryElement(node, geometry, objectStack) {
|
writeGeometryElement(node, geometry, objectStack) {
|
||||||
const context = /** @type {module:ol/format/Feature~WriteOptions} */ (objectStack[objectStack.length - 1]);
|
const context = /** @type {module:ol/format/Feature~WriteOptions} */ (objectStack[objectStack.length - 1]);
|
||||||
@@ -752,7 +752,7 @@ class GML3 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/Feature} feature Feature.
|
* @param {module:ol/Feature} feature Feature.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
writeFeatureElement(node, feature, objectStack) {
|
writeFeatureElement(node, feature, objectStack) {
|
||||||
const fid = feature.getId();
|
const fid = feature.getId();
|
||||||
@@ -797,8 +797,8 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<module:ol/Feature>} features Features.
|
* @param {Array<module:ol/Feature>} features Features.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
writeFeatureMembers_(node, features, objectStack) {
|
writeFeatureMembers_(node, features, objectStack) {
|
||||||
@@ -821,7 +821,7 @@ class GML3 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @param {*} value Value.
|
* @param {*} value Value.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @param {string=} opt_nodeName Node name.
|
* @param {string=} opt_nodeName Node name.
|
||||||
* @return {Node|undefined} Node.
|
* @return {Node|undefined} Node.
|
||||||
* @private
|
* @private
|
||||||
@@ -835,7 +835,7 @@ class GML3 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @param {*} value Value.
|
* @param {*} value Value.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @param {string=} opt_nodeName Node name.
|
* @param {string=} opt_nodeName Node name.
|
||||||
* @return {Node|undefined} Node.
|
* @return {Node|undefined} Node.
|
||||||
* @private
|
* @private
|
||||||
@@ -890,7 +890,7 @@ class GML3 extends GMLBase {
|
|||||||
/**
|
/**
|
||||||
* Encode an array of features in the GML 3.1.1 format as an XML node.
|
* Encode an array of features in the GML 3.1.1 format as an XML node.
|
||||||
*
|
*
|
||||||
* @param {Array.<module:ol/Feature>} features Features.
|
* @param {Array<module:ol/Feature>} features Features.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
||||||
* @return {Node} Node.
|
* @return {Node} Node.
|
||||||
* @override
|
* @override
|
||||||
@@ -920,7 +920,7 @@ class GML3 extends GMLBase {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML3.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
|
GML3.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
|
||||||
@@ -933,7 +933,7 @@ GML3.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML3.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
|
GML3.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
|
||||||
@@ -946,7 +946,7 @@ GML3.prototype.FLAT_LINEAR_RINGS_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML3.prototype.GEOMETRY_PARSERS_ = {
|
GML3.prototype.GEOMETRY_PARSERS_ = {
|
||||||
@@ -976,7 +976,7 @@ GML3.prototype.GEOMETRY_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML3.prototype.MULTICURVE_PARSERS_ = {
|
GML3.prototype.MULTICURVE_PARSERS_ = {
|
||||||
@@ -991,7 +991,7 @@ GML3.prototype.MULTICURVE_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML3.prototype.MULTISURFACE_PARSERS_ = {
|
GML3.prototype.MULTISURFACE_PARSERS_ = {
|
||||||
@@ -1006,7 +1006,7 @@ GML3.prototype.MULTISURFACE_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML3.prototype.CURVEMEMBER_PARSERS_ = {
|
GML3.prototype.CURVEMEMBER_PARSERS_ = {
|
||||||
@@ -1020,7 +1020,7 @@ GML3.prototype.CURVEMEMBER_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML3.prototype.SURFACEMEMBER_PARSERS_ = {
|
GML3.prototype.SURFACEMEMBER_PARSERS_ = {
|
||||||
@@ -1033,7 +1033,7 @@ GML3.prototype.SURFACEMEMBER_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML3.prototype.SURFACE_PARSERS_ = {
|
GML3.prototype.SURFACE_PARSERS_ = {
|
||||||
@@ -1045,7 +1045,7 @@ GML3.prototype.SURFACE_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML3.prototype.CURVE_PARSERS_ = {
|
GML3.prototype.CURVE_PARSERS_ = {
|
||||||
@@ -1057,7 +1057,7 @@ GML3.prototype.CURVE_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML3.prototype.ENVELOPE_PARSERS_ = {
|
GML3.prototype.ENVELOPE_PARSERS_ = {
|
||||||
@@ -1072,7 +1072,7 @@ GML3.prototype.ENVELOPE_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML3.prototype.PATCHES_PARSERS_ = {
|
GML3.prototype.PATCHES_PARSERS_ = {
|
||||||
@@ -1085,7 +1085,7 @@ GML3.prototype.PATCHES_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML3.prototype.SEGMENTS_PARSERS_ = {
|
GML3.prototype.SEGMENTS_PARSERS_ = {
|
||||||
@@ -1100,7 +1100,7 @@ GML3.prototype.SEGMENTS_PARSERS_ = {
|
|||||||
* Encode an array of features in GML 3.1.1 Simple Features.
|
* Encode an array of features in GML 3.1.1 Simple Features.
|
||||||
*
|
*
|
||||||
* @function
|
* @function
|
||||||
* @param {Array.<module:ol/Feature>} features Features.
|
* @param {Array<module:ol/Feature>} features Features.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
||||||
* @return {string} Result.
|
* @return {string} Result.
|
||||||
* @api
|
* @api
|
||||||
@@ -1109,7 +1109,7 @@ GML3.prototype.writeFeatures;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML3.prototype.RING_SERIALIZERS_ = {
|
GML3.prototype.RING_SERIALIZERS_ = {
|
||||||
@@ -1121,7 +1121,7 @@ GML3.prototype.RING_SERIALIZERS_ = {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML3.prototype.ENVELOPE_SERIALIZERS_ = {
|
GML3.prototype.ENVELOPE_SERIALIZERS_ = {
|
||||||
@@ -1133,7 +1133,7 @@ GML3.prototype.ENVELOPE_SERIALIZERS_ = {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML3.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
|
GML3.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
|
||||||
@@ -1147,7 +1147,7 @@ GML3.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_ = {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML3.prototype.POINTMEMBER_SERIALIZERS_ = {
|
GML3.prototype.POINTMEMBER_SERIALIZERS_ = {
|
||||||
@@ -1159,7 +1159,7 @@ GML3.prototype.POINTMEMBER_SERIALIZERS_ = {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML3.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
|
GML3.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
|
||||||
@@ -1173,7 +1173,7 @@ GML3.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_ = {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GML3.prototype.GEOMETRY_SERIALIZERS_ = {
|
GML3.prototype.GEOMETRY_SERIALIZERS_ = {
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ const ONLY_WHITESPACE_RE = /^[\s\xa0]*$/;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} Options
|
* @typedef {Object} Options
|
||||||
* @property {Object.<string, string>|string} [featureNS] Feature
|
* @property {Object<string, string>|string} [featureNS] Feature
|
||||||
* namespace. If not defined will be derived from GML. If multiple
|
* namespace. If not defined will be derived from GML. If multiple
|
||||||
* feature types have been configured which come from different feature
|
* feature types have been configured which come from different feature
|
||||||
* namespaces, this will be an object with the keys being the prefixes used
|
* namespaces, this will be an object with the keys being the prefixes used
|
||||||
@@ -52,7 +52,7 @@ const ONLY_WHITESPACE_RE = /^[\s\xa0]*$/;
|
|||||||
* feature namespaces themselves. So for instance there might be a featureType
|
* feature namespaces themselves. So for instance there might be a featureType
|
||||||
* item `topp:states` in the `featureType` array and then there will be a key
|
* item `topp:states` in the `featureType` array and then there will be a key
|
||||||
* `topp` in the featureNS object with value `http://www.openplans.org/topp`.
|
* `topp` in the featureNS object with value `http://www.openplans.org/topp`.
|
||||||
* @property {Array.<string>|string} [featureType] Feature type(s) to parse.
|
* @property {Array<string>|string} [featureType] Feature type(s) to parse.
|
||||||
* If multiple feature types need to be configured
|
* If multiple feature types need to be configured
|
||||||
* which come from different feature namespaces, `featureNS` will be an object
|
* which come from different feature namespaces, `featureNS` will be an object
|
||||||
* with the keys being the prefixes used in the entries of featureType array.
|
* with the keys being the prefixes used in the entries of featureType array.
|
||||||
@@ -96,13 +96,13 @@ class GMLBase extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @protected
|
* @protected
|
||||||
* @type {Array.<string>|string|undefined}
|
* @type {Array<string>|string|undefined}
|
||||||
*/
|
*/
|
||||||
this.featureType = options.featureType;
|
this.featureType = options.featureType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @protected
|
* @protected
|
||||||
* @type {Object.<string, string>|string|undefined}
|
* @type {Object<string, string>|string|undefined}
|
||||||
*/
|
*/
|
||||||
this.featureNS = options.featureNS;
|
this.featureNS = options.featureNS;
|
||||||
|
|
||||||
@@ -119,7 +119,7 @@ class GMLBase extends XMLFeature {
|
|||||||
this.schemaLocation = '';
|
this.schemaLocation = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object.<string, Object.<string, Object>>}
|
* @type {Object<string, Object<string, Object>>}
|
||||||
*/
|
*/
|
||||||
this.FEATURE_COLLECTION_PARSERS = {};
|
this.FEATURE_COLLECTION_PARSERS = {};
|
||||||
this.FEATURE_COLLECTION_PARSERS[GMLNS] = {
|
this.FEATURE_COLLECTION_PARSERS[GMLNS] = {
|
||||||
@@ -131,8 +131,8 @@ class GMLBase extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Array.<module:ol/Feature> | undefined} Features.
|
* @return {Array<module:ol/Feature> | undefined} Features.
|
||||||
*/
|
*/
|
||||||
readFeaturesInternal(node, objectStack) {
|
readFeaturesInternal(node, objectStack) {
|
||||||
const localName = node.localName;
|
const localName = node.localName;
|
||||||
@@ -219,7 +219,7 @@ class GMLBase extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/geom/Geometry|undefined} Geometry.
|
* @return {module:ol/geom/Geometry|undefined} Geometry.
|
||||||
*/
|
*/
|
||||||
readGeometryElement(node, objectStack) {
|
readGeometryElement(node, objectStack) {
|
||||||
@@ -239,7 +239,7 @@ class GMLBase extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/Feature} Feature.
|
* @return {module:ol/Feature} Feature.
|
||||||
*/
|
*/
|
||||||
readFeatureElement(node, objectStack) {
|
readFeatureElement(node, objectStack) {
|
||||||
@@ -280,7 +280,7 @@ class GMLBase extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/geom/Point|undefined} Point.
|
* @return {module:ol/geom/Point|undefined} Point.
|
||||||
*/
|
*/
|
||||||
readPoint(node, objectStack) {
|
readPoint(node, objectStack) {
|
||||||
@@ -292,11 +292,11 @@ class GMLBase extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/geom/MultiPoint|undefined} MultiPoint.
|
* @return {module:ol/geom/MultiPoint|undefined} MultiPoint.
|
||||||
*/
|
*/
|
||||||
readMultiPoint(node, objectStack) {
|
readMultiPoint(node, objectStack) {
|
||||||
/** @type {Array.<Array.<number>>} */
|
/** @type {Array<Array<number>>} */
|
||||||
const coordinates = pushParseAndPop([],
|
const coordinates = pushParseAndPop([],
|
||||||
this.MULTIPOINT_PARSERS_, node, objectStack, this);
|
this.MULTIPOINT_PARSERS_, node, objectStack, this);
|
||||||
if (coordinates) {
|
if (coordinates) {
|
||||||
@@ -308,11 +308,11 @@ class GMLBase extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/geom/MultiLineString|undefined} MultiLineString.
|
* @return {module:ol/geom/MultiLineString|undefined} MultiLineString.
|
||||||
*/
|
*/
|
||||||
readMultiLineString(node, objectStack) {
|
readMultiLineString(node, objectStack) {
|
||||||
/** @type {Array.<module:ol/geom/LineString>} */
|
/** @type {Array<module:ol/geom/LineString>} */
|
||||||
const lineStrings = pushParseAndPop([],
|
const lineStrings = pushParseAndPop([],
|
||||||
this.MULTILINESTRING_PARSERS_, node, objectStack, this);
|
this.MULTILINESTRING_PARSERS_, node, objectStack, this);
|
||||||
if (lineStrings) {
|
if (lineStrings) {
|
||||||
@@ -322,11 +322,11 @@ class GMLBase extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/geom/MultiPolygon|undefined} MultiPolygon.
|
* @return {module:ol/geom/MultiPolygon|undefined} MultiPolygon.
|
||||||
*/
|
*/
|
||||||
readMultiPolygon(node, objectStack) {
|
readMultiPolygon(node, objectStack) {
|
||||||
/** @type {Array.<module:ol/geom/Polygon>} */
|
/** @type {Array<module:ol/geom/Polygon>} */
|
||||||
const polygons = pushParseAndPop([], this.MULTIPOLYGON_PARSERS_, node, objectStack, this);
|
const polygons = pushParseAndPop([], this.MULTIPOLYGON_PARSERS_, node, objectStack, this);
|
||||||
if (polygons) {
|
if (polygons) {
|
||||||
return new MultiPolygon(polygons);
|
return new MultiPolygon(polygons);
|
||||||
@@ -335,7 +335,7 @@ class GMLBase extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
pointMemberParser_(node, objectStack) {
|
pointMemberParser_(node, objectStack) {
|
||||||
@@ -344,7 +344,7 @@ class GMLBase extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
lineStringMemberParser_(node, objectStack) {
|
lineStringMemberParser_(node, objectStack) {
|
||||||
@@ -353,7 +353,7 @@ class GMLBase extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
polygonMemberParser_(node, objectStack) {
|
polygonMemberParser_(node, objectStack) {
|
||||||
@@ -362,7 +362,7 @@ class GMLBase extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/geom/LineString|undefined} LineString.
|
* @return {module:ol/geom/LineString|undefined} LineString.
|
||||||
*/
|
*/
|
||||||
readLineString(node, objectStack) {
|
readLineString(node, objectStack) {
|
||||||
@@ -377,9 +377,9 @@ class GMLBase extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {Array.<number>|undefined} LinearRing flat coordinates.
|
* @return {Array<number>|undefined} LinearRing flat coordinates.
|
||||||
*/
|
*/
|
||||||
readFlatLinearRing_(node, objectStack) {
|
readFlatLinearRing_(node, objectStack) {
|
||||||
const ring = pushParseAndPop(null,
|
const ring = pushParseAndPop(null,
|
||||||
@@ -394,7 +394,7 @@ class GMLBase extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/geom/LinearRing|undefined} LinearRing.
|
* @return {module:ol/geom/LinearRing|undefined} LinearRing.
|
||||||
*/
|
*/
|
||||||
readLinearRing(node, objectStack) {
|
readLinearRing(node, objectStack) {
|
||||||
@@ -406,11 +406,11 @@ class GMLBase extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/geom/Polygon|undefined} Polygon.
|
* @return {module:ol/geom/Polygon|undefined} Polygon.
|
||||||
*/
|
*/
|
||||||
readPolygon(node, objectStack) {
|
readPolygon(node, objectStack) {
|
||||||
/** @type {Array.<Array.<number>>} */
|
/** @type {Array<Array<number>>} */
|
||||||
const flatLinearRings = pushParseAndPop([null],
|
const flatLinearRings = pushParseAndPop([null],
|
||||||
this.FLAT_LINEAR_RINGS_PARSERS_, node, objectStack, this);
|
this.FLAT_LINEAR_RINGS_PARSERS_, node, objectStack, this);
|
||||||
if (flatLinearRings && flatLinearRings[0]) {
|
if (flatLinearRings && flatLinearRings[0]) {
|
||||||
@@ -429,9 +429,9 @@ class GMLBase extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @private
|
* @private
|
||||||
* @return {Array.<number>} Flat coordinates.
|
* @return {Array<number>} Flat coordinates.
|
||||||
*/
|
*/
|
||||||
readFlatCoordinatesFromNode_(node, objectStack) {
|
readFlatCoordinatesFromNode_(node, objectStack) {
|
||||||
return pushParseAndPop(null, this.GEOMETRY_FLAT_COORDINATES_PARSERS_, node, objectStack, this);
|
return pushParseAndPop(null, this.GEOMETRY_FLAT_COORDINATES_PARSERS_, node, objectStack, this);
|
||||||
@@ -471,7 +471,7 @@ class GMLBase extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GMLBase.prototype.MULTIPOINT_PARSERS_ = {
|
GMLBase.prototype.MULTIPOINT_PARSERS_ = {
|
||||||
@@ -484,7 +484,7 @@ GMLBase.prototype.MULTIPOINT_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GMLBase.prototype.MULTILINESTRING_PARSERS_ = {
|
GMLBase.prototype.MULTILINESTRING_PARSERS_ = {
|
||||||
@@ -497,7 +497,7 @@ GMLBase.prototype.MULTILINESTRING_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GMLBase.prototype.MULTIPOLYGON_PARSERS_ = {
|
GMLBase.prototype.MULTIPOLYGON_PARSERS_ = {
|
||||||
@@ -510,7 +510,7 @@ GMLBase.prototype.MULTIPOLYGON_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GMLBase.prototype.POINTMEMBER_PARSERS_ = {
|
GMLBase.prototype.POINTMEMBER_PARSERS_ = {
|
||||||
@@ -522,7 +522,7 @@ GMLBase.prototype.POINTMEMBER_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GMLBase.prototype.LINESTRINGMEMBER_PARSERS_ = {
|
GMLBase.prototype.LINESTRINGMEMBER_PARSERS_ = {
|
||||||
@@ -534,7 +534,7 @@ GMLBase.prototype.LINESTRINGMEMBER_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
GMLBase.prototype.POLYGONMEMBER_PARSERS_ = {
|
GMLBase.prototype.POLYGONMEMBER_PARSERS_ = {
|
||||||
@@ -546,7 +546,7 @@ GMLBase.prototype.POLYGONMEMBER_PARSERS_ = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
* @protected
|
* @protected
|
||||||
*/
|
*/
|
||||||
GMLBase.prototype.RING_PARSERS = {
|
GMLBase.prototype.RING_PARSERS = {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import {createElementNS, makeArrayPusher, makeArraySerializer, makeChildAppender
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Array.<null|string>}
|
* @type {Array<null|string>}
|
||||||
*/
|
*/
|
||||||
const NAMESPACE_URIS = [
|
const NAMESPACE_URIS = [
|
||||||
null,
|
null,
|
||||||
@@ -38,7 +38,7 @@ const SCHEMA_LOCATION = 'http://www.topografix.com/GPX/1/1 ' +
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, function(Node, Array.<*>): (module:ol/Feature|undefined)>}
|
* @type {Object<string, function(Node, Array<*>): (module:ol/Feature|undefined)>}
|
||||||
*/
|
*/
|
||||||
const FEATURE_READER = {
|
const FEATURE_READER = {
|
||||||
'rte': readRte,
|
'rte': readRte,
|
||||||
@@ -49,7 +49,7 @@ const FEATURE_READER = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const GPX_PARSERS = makeStructureNS(
|
const GPX_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -61,7 +61,7 @@ const GPX_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const LINK_PARSERS = makeStructureNS(
|
const LINK_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -72,7 +72,7 @@ const LINK_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||||
*/
|
*/
|
||||||
const GPX_SERIALIZERS = makeStructureNS(
|
const GPX_SERIALIZERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -138,7 +138,7 @@ class GPX extends XMLFeature {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array.<module:ol/Feature>} features List of features.
|
* @param {Array<module:ol/Feature>} features List of features.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
handleReadExtensions_(features) {
|
handleReadExtensions_(features) {
|
||||||
@@ -182,7 +182,7 @@ class GPX extends XMLFeature {
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
if (node.localName == 'gpx') {
|
if (node.localName == 'gpx') {
|
||||||
/** @type {Array.<module:ol/Feature>} */
|
/** @type {Array<module:ol/Feature>} */
|
||||||
const features = pushParseAndPop([], GPX_PARSERS,
|
const features = pushParseAndPop([], GPX_PARSERS,
|
||||||
node, [this.getReadOptions(node, opt_options)]);
|
node, [this.getReadOptions(node, opt_options)]);
|
||||||
if (features) {
|
if (features) {
|
||||||
@@ -200,7 +200,7 @@ class GPX extends XMLFeature {
|
|||||||
* LineString geometries are output as routes (`<rte>`), and MultiLineString
|
* LineString geometries are output as routes (`<rte>`), and MultiLineString
|
||||||
* as tracks (`<trk>`).
|
* as tracks (`<trk>`).
|
||||||
*
|
*
|
||||||
* @param {Array.<module:ol/Feature>} features Features.
|
* @param {Array<module:ol/Feature>} features Features.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
||||||
* @return {Node} Node.
|
* @return {Node} Node.
|
||||||
* @override
|
* @override
|
||||||
@@ -225,7 +225,7 @@ class GPX extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const RTE_PARSERS = makeStructureNS(
|
const RTE_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -243,7 +243,7 @@ const RTE_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const RTEPT_PARSERS = makeStructureNS(
|
const RTEPT_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -254,7 +254,7 @@ const RTEPT_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const TRK_PARSERS = makeStructureNS(
|
const TRK_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -272,7 +272,7 @@ const TRK_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const TRKSEG_PARSERS = makeStructureNS(
|
const TRKSEG_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -282,7 +282,7 @@ const TRKSEG_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const TRKPT_PARSERS = makeStructureNS(
|
const TRKPT_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -293,7 +293,7 @@ const TRKPT_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const WPT_PARSERS = makeStructureNS(
|
const WPT_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -321,14 +321,14 @@ const WPT_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Array.<string>}
|
* @type {Array<string>}
|
||||||
*/
|
*/
|
||||||
const LINK_SEQUENCE = ['text', 'type'];
|
const LINK_SEQUENCE = ['text', 'type'];
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||||
*/
|
*/
|
||||||
const LINK_SERIALIZERS = makeStructureNS(
|
const LINK_SERIALIZERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -339,7 +339,7 @@ const LINK_SERIALIZERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Array.<string>>}
|
* @type {Object<string, Array<string>>}
|
||||||
*/
|
*/
|
||||||
const RTE_SEQUENCE = makeStructureNS(
|
const RTE_SEQUENCE = makeStructureNS(
|
||||||
NAMESPACE_URIS, [
|
NAMESPACE_URIS, [
|
||||||
@@ -349,7 +349,7 @@ const RTE_SEQUENCE = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||||
*/
|
*/
|
||||||
const RTE_SERIALIZERS = makeStructureNS(
|
const RTE_SERIALIZERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -366,7 +366,7 @@ const RTE_SERIALIZERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Array.<string>>}
|
* @type {Object<string, Array<string>>}
|
||||||
*/
|
*/
|
||||||
const RTEPT_TYPE_SEQUENCE = makeStructureNS(
|
const RTEPT_TYPE_SEQUENCE = makeStructureNS(
|
||||||
NAMESPACE_URIS, [
|
NAMESPACE_URIS, [
|
||||||
@@ -376,7 +376,7 @@ const RTEPT_TYPE_SEQUENCE = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Array.<string>>}
|
* @type {Object<string, Array<string>>}
|
||||||
*/
|
*/
|
||||||
const TRK_SEQUENCE = makeStructureNS(
|
const TRK_SEQUENCE = makeStructureNS(
|
||||||
NAMESPACE_URIS, [
|
NAMESPACE_URIS, [
|
||||||
@@ -386,7 +386,7 @@ const TRK_SEQUENCE = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||||
*/
|
*/
|
||||||
const TRK_SERIALIZERS = makeStructureNS(
|
const TRK_SERIALIZERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -403,14 +403,14 @@ const TRK_SERIALIZERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {function(*, Array.<*>, string=): (Node|undefined)}
|
* @type {function(*, Array<*>, string=): (Node|undefined)}
|
||||||
*/
|
*/
|
||||||
const TRKSEG_NODE_FACTORY = makeSimpleNodeFactory('trkpt');
|
const TRKSEG_NODE_FACTORY = makeSimpleNodeFactory('trkpt');
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||||
*/
|
*/
|
||||||
const TRKSEG_SERIALIZERS = makeStructureNS(
|
const TRKSEG_SERIALIZERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -420,7 +420,7 @@ const TRKSEG_SERIALIZERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Array.<string>>}
|
* @type {Object<string, Array<string>>}
|
||||||
*/
|
*/
|
||||||
const WPT_TYPE_SEQUENCE = makeStructureNS(
|
const WPT_TYPE_SEQUENCE = makeStructureNS(
|
||||||
NAMESPACE_URIS, [
|
NAMESPACE_URIS, [
|
||||||
@@ -432,7 +432,7 @@ const WPT_TYPE_SEQUENCE = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||||
*/
|
*/
|
||||||
const WPT_TYPE_SERIALIZERS = makeStructureNS(
|
const WPT_TYPE_SERIALIZERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -459,7 +459,7 @@ const WPT_TYPE_SERIALIZERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, string>}
|
* @type {Object<string, string>}
|
||||||
*/
|
*/
|
||||||
const GEOMETRY_TYPE_TO_NODENAME = {
|
const GEOMETRY_TYPE_TO_NODENAME = {
|
||||||
'Point': 'wpt',
|
'Point': 'wpt',
|
||||||
@@ -470,7 +470,7 @@ const GEOMETRY_TYPE_TO_NODENAME = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {*} value Value.
|
* @param {*} value Value.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @param {string=} opt_nodeName Node name.
|
* @param {string=} opt_nodeName Node name.
|
||||||
* @return {Node|undefined} Node.
|
* @return {Node|undefined} Node.
|
||||||
*/
|
*/
|
||||||
@@ -487,11 +487,11 @@ function GPX_NODE_FACTORY(value, objectStack, opt_nodeName) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||||
* @param {module:ol/format/GPX~LayoutOptions} layoutOptions Layout options.
|
* @param {module:ol/format/GPX~LayoutOptions} layoutOptions Layout options.
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {!Object} values Values.
|
* @param {!Object} values Values.
|
||||||
* @return {Array.<number>} Flat coordinates.
|
* @return {Array<number>} Flat coordinates.
|
||||||
*/
|
*/
|
||||||
function appendCoordinate(flatCoordinates, layoutOptions, node, values) {
|
function appendCoordinate(flatCoordinates, layoutOptions, node, values) {
|
||||||
flatCoordinates.push(
|
flatCoordinates.push(
|
||||||
@@ -520,8 +520,8 @@ function appendCoordinate(flatCoordinates, layoutOptions, node, values) {
|
|||||||
* and ends arrays by shrinking them accordingly (removing unused zero entries).
|
* and ends arrays by shrinking them accordingly (removing unused zero entries).
|
||||||
*
|
*
|
||||||
* @param {module:ol/format/GPX~LayoutOptions} layoutOptions Layout options.
|
* @param {module:ol/format/GPX~LayoutOptions} layoutOptions Layout options.
|
||||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||||
* @param {Array.<number>=} ends Ends.
|
* @param {Array<number>=} ends Ends.
|
||||||
* @return {module:ol/geom/GeometryLayout} Layout.
|
* @return {module:ol/geom/GeometryLayout} Layout.
|
||||||
*/
|
*/
|
||||||
function applyLayoutOptions(layoutOptions, flatCoordinates, ends) {
|
function applyLayoutOptions(layoutOptions, flatCoordinates, ends) {
|
||||||
@@ -561,7 +561,7 @@ function applyLayoutOptions(layoutOptions, flatCoordinates, ends) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function parseLink(node, objectStack) {
|
function parseLink(node, objectStack) {
|
||||||
const values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
const values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||||
@@ -575,7 +575,7 @@ function parseLink(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function parseExtensions(node, objectStack) {
|
function parseExtensions(node, objectStack) {
|
||||||
const values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
const values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||||
@@ -585,13 +585,13 @@ function parseExtensions(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function parseRtePt(node, objectStack) {
|
function parseRtePt(node, objectStack) {
|
||||||
const values = pushParseAndPop({}, RTEPT_PARSERS, node, objectStack);
|
const values = pushParseAndPop({}, RTEPT_PARSERS, node, objectStack);
|
||||||
if (values) {
|
if (values) {
|
||||||
const rteValues = /** @type {!Object} */ (objectStack[objectStack.length - 1]);
|
const rteValues = /** @type {!Object} */ (objectStack[objectStack.length - 1]);
|
||||||
const flatCoordinates = /** @type {Array.<number>} */ (rteValues['flatCoordinates']);
|
const flatCoordinates = /** @type {Array<number>} */ (rteValues['flatCoordinates']);
|
||||||
const layoutOptions = /** @type {module:ol/format/GPX~LayoutOptions} */ (rteValues['layoutOptions']);
|
const layoutOptions = /** @type {module:ol/format/GPX~LayoutOptions} */ (rteValues['layoutOptions']);
|
||||||
appendCoordinate(flatCoordinates, layoutOptions, node, values);
|
appendCoordinate(flatCoordinates, layoutOptions, node, values);
|
||||||
}
|
}
|
||||||
@@ -600,13 +600,13 @@ function parseRtePt(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function parseTrkPt(node, objectStack) {
|
function parseTrkPt(node, objectStack) {
|
||||||
const values = pushParseAndPop({}, TRKPT_PARSERS, node, objectStack);
|
const values = pushParseAndPop({}, TRKPT_PARSERS, node, objectStack);
|
||||||
if (values) {
|
if (values) {
|
||||||
const trkValues = /** @type {!Object} */ (objectStack[objectStack.length - 1]);
|
const trkValues = /** @type {!Object} */ (objectStack[objectStack.length - 1]);
|
||||||
const flatCoordinates = /** @type {Array.<number>} */ (trkValues['flatCoordinates']);
|
const flatCoordinates = /** @type {Array<number>} */ (trkValues['flatCoordinates']);
|
||||||
const layoutOptions = /** @type {module:ol/format/GPX~LayoutOptions} */ (trkValues['layoutOptions']);
|
const layoutOptions = /** @type {module:ol/format/GPX~LayoutOptions} */ (trkValues['layoutOptions']);
|
||||||
appendCoordinate(flatCoordinates, layoutOptions, node, values);
|
appendCoordinate(flatCoordinates, layoutOptions, node, values);
|
||||||
}
|
}
|
||||||
@@ -615,21 +615,21 @@ function parseTrkPt(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function parseTrkSeg(node, objectStack) {
|
function parseTrkSeg(node, objectStack) {
|
||||||
const values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
const values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||||
parseNode(TRKSEG_PARSERS, node, objectStack);
|
parseNode(TRKSEG_PARSERS, node, objectStack);
|
||||||
const flatCoordinates = /** @type {Array.<number>} */
|
const flatCoordinates = /** @type {Array<number>} */
|
||||||
(values['flatCoordinates']);
|
(values['flatCoordinates']);
|
||||||
const ends = /** @type {Array.<number>} */ (values['ends']);
|
const ends = /** @type {Array<number>} */ (values['ends']);
|
||||||
ends.push(flatCoordinates.length);
|
ends.push(flatCoordinates.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/Feature|undefined} Track.
|
* @return {module:ol/Feature|undefined} Track.
|
||||||
*/
|
*/
|
||||||
function readRte(node, objectStack) {
|
function readRte(node, objectStack) {
|
||||||
@@ -641,7 +641,7 @@ function readRte(node, objectStack) {
|
|||||||
if (!values) {
|
if (!values) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
const flatCoordinates = /** @type {Array.<number>} */
|
const flatCoordinates = /** @type {Array<number>} */
|
||||||
(values['flatCoordinates']);
|
(values['flatCoordinates']);
|
||||||
delete values['flatCoordinates'];
|
delete values['flatCoordinates'];
|
||||||
const layoutOptions = /** @type {module:ol/format/GPX~LayoutOptions} */ (values['layoutOptions']);
|
const layoutOptions = /** @type {module:ol/format/GPX~LayoutOptions} */ (values['layoutOptions']);
|
||||||
@@ -657,7 +657,7 @@ function readRte(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/Feature|undefined} Track.
|
* @return {module:ol/Feature|undefined} Track.
|
||||||
*/
|
*/
|
||||||
function readTrk(node, objectStack) {
|
function readTrk(node, objectStack) {
|
||||||
@@ -670,10 +670,10 @@ function readTrk(node, objectStack) {
|
|||||||
if (!values) {
|
if (!values) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
const flatCoordinates = /** @type {Array.<number>} */
|
const flatCoordinates = /** @type {Array<number>} */
|
||||||
(values['flatCoordinates']);
|
(values['flatCoordinates']);
|
||||||
delete values['flatCoordinates'];
|
delete values['flatCoordinates'];
|
||||||
const ends = /** @type {Array.<number>} */ (values['ends']);
|
const ends = /** @type {Array<number>} */ (values['ends']);
|
||||||
delete values['ends'];
|
delete values['ends'];
|
||||||
const layoutOptions = /** @type {module:ol/format/GPX~LayoutOptions} */ (values['layoutOptions']);
|
const layoutOptions = /** @type {module:ol/format/GPX~LayoutOptions} */ (values['layoutOptions']);
|
||||||
delete values['layoutOptions'];
|
delete values['layoutOptions'];
|
||||||
@@ -688,7 +688,7 @@ function readTrk(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/Feature|undefined} Waypoint.
|
* @return {module:ol/Feature|undefined} Waypoint.
|
||||||
*/
|
*/
|
||||||
function readWpt(node, objectStack) {
|
function readWpt(node, objectStack) {
|
||||||
@@ -711,7 +711,7 @@ function readWpt(node, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {string} value Value for the link's `href` attribute.
|
* @param {string} value Value for the link's `href` attribute.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeLink(node, value, objectStack) {
|
function writeLink(node, value, objectStack) {
|
||||||
node.setAttribute('href', value);
|
node.setAttribute('href', value);
|
||||||
@@ -730,7 +730,7 @@ function writeLink(node, value, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function writeWptType(node, coordinate, objectStack) {
|
function writeWptType(node, coordinate, objectStack) {
|
||||||
const context = objectStack[objectStack.length - 1];
|
const context = objectStack[objectStack.length - 1];
|
||||||
@@ -774,7 +774,7 @@ function writeWptType(node, coordinate, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/Feature} feature Feature.
|
* @param {module:ol/Feature} feature Feature.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function writeRte(node, feature, objectStack) {
|
function writeRte(node, feature, objectStack) {
|
||||||
const options = /** @type {module:ol/format/Feature~WriteOptions} */ (objectStack[0]);
|
const options = /** @type {module:ol/format/Feature~WriteOptions} */ (objectStack[0]);
|
||||||
@@ -798,7 +798,7 @@ function writeRte(node, feature, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/Feature} feature Feature.
|
* @param {module:ol/Feature} feature Feature.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function writeTrk(node, feature, objectStack) {
|
function writeTrk(node, feature, objectStack) {
|
||||||
const options = /** @type {module:ol/format/Feature~WriteOptions} */ (objectStack[0]);
|
const options = /** @type {module:ol/format/Feature~WriteOptions} */ (objectStack[0]);
|
||||||
@@ -823,7 +823,7 @@ function writeTrk(node, feature, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/geom/LineString} lineString LineString.
|
* @param {module:ol/geom/LineString} lineString LineString.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function writeTrkSeg(node, lineString, objectStack) {
|
function writeTrkSeg(node, lineString, objectStack) {
|
||||||
/** @type {module:ol/xml~NodeStackItem} */
|
/** @type {module:ol/xml~NodeStackItem} */
|
||||||
@@ -838,7 +838,7 @@ function writeTrkSeg(node, lineString, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/Feature} feature Feature.
|
* @param {module:ol/Feature} feature Feature.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function writeWpt(node, feature, objectStack) {
|
function writeWpt(node, feature, objectStack) {
|
||||||
const options = /** @type {module:ol/format/Feature~WriteOptions} */ (objectStack[0]);
|
const options = /** @type {module:ol/format/Feature~WriteOptions} */ (objectStack[0]);
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ class GeoJSON extends JSONFeature {
|
|||||||
*/
|
*/
|
||||||
readFeaturesFromObject(object, opt_options) {
|
readFeaturesFromObject(object, opt_options) {
|
||||||
const geoJSONObject = /** @type {GeoJSONObject} */ (object);
|
const geoJSONObject = /** @type {GeoJSONObject} */ (object);
|
||||||
/** @type {Array.<module:ol/Feature>} */
|
/** @type {Array<module:ol/Feature>} */
|
||||||
let features = null;
|
let features = null;
|
||||||
if (geoJSONObject.type === 'FeatureCollection') {
|
if (geoJSONObject.type === 'FeatureCollection') {
|
||||||
const geoJSONFeatureCollection = /** @type {GeoJSONFeatureCollection} */ (object);
|
const geoJSONFeatureCollection = /** @type {GeoJSONFeatureCollection} */ (object);
|
||||||
@@ -196,7 +196,7 @@ class GeoJSON extends JSONFeature {
|
|||||||
/**
|
/**
|
||||||
* Encode an array of features as a GeoJSON object.
|
* Encode an array of features as a GeoJSON object.
|
||||||
*
|
*
|
||||||
* @param {Array.<module:ol/Feature>} features Features.
|
* @param {Array<module:ol/Feature>} features Features.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||||
* @return {GeoJSONFeatureCollection} GeoJSON Object.
|
* @return {GeoJSONFeatureCollection} GeoJSON Object.
|
||||||
* @override
|
* @override
|
||||||
@@ -231,7 +231,7 @@ class GeoJSON extends JSONFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, function(GeoJSONObject): module:ol/geom/Geometry>}
|
* @type {Object<string, function(GeoJSONObject): module:ol/geom/Geometry>}
|
||||||
*/
|
*/
|
||||||
const GEOMETRY_READERS = {
|
const GEOMETRY_READERS = {
|
||||||
'Point': readPointGeometry,
|
'Point': readPointGeometry,
|
||||||
@@ -246,7 +246,7 @@ const GEOMETRY_READERS = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, function(module:ol/geom/Geometry, module:ol/format/Feature~WriteOptions=): (GeoJSONGeometry|GeoJSONGeometryCollection)>}
|
* @type {Object<string, function(module:ol/geom/Geometry, module:ol/format/Feature~WriteOptions=): (GeoJSONGeometry|GeoJSONGeometryCollection)>}
|
||||||
*/
|
*/
|
||||||
const GEOMETRY_WRITERS = {
|
const GEOMETRY_WRITERS = {
|
||||||
'Point': writePointGeometry,
|
'Point': writePointGeometry,
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ class IGC extends TextFeature {
|
|||||||
readFeatureFromText(text, opt_options) {
|
readFeatureFromText(text, opt_options) {
|
||||||
const altitudeMode = this.altitudeMode_;
|
const altitudeMode = this.altitudeMode_;
|
||||||
const lines = text.split(NEWLINE_RE);
|
const lines = text.split(NEWLINE_RE);
|
||||||
/** @type {Object.<string, string>} */
|
/** @type {Object<string, string>} */
|
||||||
const properties = {};
|
const properties = {};
|
||||||
const flatCoordinates = [];
|
const flatCoordinates = [];
|
||||||
let year = 2000;
|
let year = 2000;
|
||||||
@@ -175,29 +175,6 @@ class IGC extends TextFeature {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Not implemented.
|
|
||||||
* @inheritDoc
|
|
||||||
*/
|
|
||||||
writeFeatureText(feature, opt_options) {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Not implemented.
|
|
||||||
* @inheritDoc
|
|
||||||
*/
|
|
||||||
writeFeaturesText(features, opt_options) {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Not implemented.
|
|
||||||
* @inheritDoc
|
|
||||||
*/
|
|
||||||
writeGeometryText(geometry, opt_options) {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Not implemented.
|
|
||||||
* @inheritDoc
|
|
||||||
*/
|
|
||||||
readGeometryFromText(text, opt_options) {}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default IGC;
|
export default IGC;
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class JSONFeature extends FeatureFormat {
|
|||||||
*
|
*
|
||||||
* @param {ArrayBuffer|Document|Node|Object|string} source Source.
|
* @param {ArrayBuffer|Document|Node|Object|string} source Source.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||||
* @return {Array.<module:ol/Feature>} Features.
|
* @return {Array<module:ol/Feature>} Features.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
readFeatures(source, opt_options) {
|
readFeatures(source, opt_options) {
|
||||||
@@ -66,7 +66,7 @@ class JSONFeature extends FeatureFormat {
|
|||||||
* @param {Object} object Object.
|
* @param {Object} object Object.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||||
* @protected
|
* @protected
|
||||||
* @return {Array.<module:ol/Feature>} Features.
|
* @return {Array<module:ol/Feature>} Features.
|
||||||
*/
|
*/
|
||||||
readFeaturesFromObject(object, opt_options) {}
|
readFeaturesFromObject(object, opt_options) {}
|
||||||
|
|
||||||
@@ -134,7 +134,7 @@ class JSONFeature extends FeatureFormat {
|
|||||||
/**
|
/**
|
||||||
* Encode an array of features as string.
|
* Encode an array of features as string.
|
||||||
*
|
*
|
||||||
* @param {Array.<module:ol/Feature>} features Features.
|
* @param {Array<module:ol/Feature>} features Features.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||||
* @return {string} Encoded features.
|
* @return {string} Encoded features.
|
||||||
* @api
|
* @api
|
||||||
@@ -145,7 +145,7 @@ class JSONFeature extends FeatureFormat {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @abstract
|
* @abstract
|
||||||
* @param {Array.<module:ol/Feature>} features Features.
|
* @param {Array<module:ol/Feature>} features Features.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||||
* @return {Object} Object.
|
* @return {Object} Object.
|
||||||
*/
|
*/
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -23,7 +23,7 @@ import RenderFeature from '../render/Feature.js';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} Options
|
* @typedef {Object} Options
|
||||||
* @property {function((module:ol/geom/Geometry|Object.<string,*>)=)|function(module:ol/geom/GeometryType,Array.<number>,(Array.<number>|Array.<Array.<number>>),Object.<string,*>,number)} [featureClass]
|
* @property {function((module:ol/geom/Geometry|Object<string,*>)=)|function(module:ol/geom/GeometryType,Array<number>,(Array<number>|Array<Array<number>>),Object<string,*>,number)} [featureClass]
|
||||||
* Class for features returned by {@link module:ol/format/MVT#readFeatures}. Set to
|
* Class for features returned by {@link module:ol/format/MVT#readFeatures}. Set to
|
||||||
* {@link module:ol/Feature~Feature} to get full editing and geometry support at the cost of
|
* {@link module:ol/Feature~Feature} to get full editing and geometry support at the cost of
|
||||||
* decreased rendering performance. The default is {@link module:ol/render/Feature~RenderFeature},
|
* decreased rendering performance. The default is {@link module:ol/render/Feature~RenderFeature},
|
||||||
@@ -32,7 +32,7 @@ import RenderFeature from '../render/Feature.js';
|
|||||||
* features.
|
* features.
|
||||||
* @property {string} [layerName='layer'] Name of the feature attribute that
|
* @property {string} [layerName='layer'] Name of the feature attribute that
|
||||||
* holds the layer name.
|
* holds the layer name.
|
||||||
* @property {Array.<string>} [layers] Layers to read features from. If not
|
* @property {Array<string>} [layers] Layers to read features from. If not
|
||||||
* provided, features will be read from all layers.
|
* provided, features will be read from all layers.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -64,9 +64,9 @@ class MVT extends FeatureFormat {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {function((module:ol/geom/Geometry|Object.<string,*>)=)|
|
* @type {function((module:ol/geom/Geometry|Object<string,*>)=)|
|
||||||
* function(module:ol/geom/GeometryType,Array.<number>,
|
* function(module:ol/geom/GeometryType,Array<number>,
|
||||||
* (Array.<number>|Array.<Array.<number>>),Object.<string,*>,number)}
|
* (Array<number>|Array<Array<number>>),Object<string,*>,number)}
|
||||||
*/
|
*/
|
||||||
this.featureClass_ = options.featureClass ?
|
this.featureClass_ = options.featureClass ?
|
||||||
options.featureClass : RenderFeature;
|
options.featureClass : RenderFeature;
|
||||||
@@ -85,7 +85,7 @@ class MVT extends FeatureFormat {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array.<string>}
|
* @type {Array<string>}
|
||||||
*/
|
*/
|
||||||
this.layers_ = options.layers ? options.layers : null;
|
this.layers_ = options.layers ? options.layers : null;
|
||||||
|
|
||||||
@@ -103,8 +103,8 @@ class MVT extends FeatureFormat {
|
|||||||
* @suppress {missingProperties}
|
* @suppress {missingProperties}
|
||||||
* @param {Object} pbf PBF.
|
* @param {Object} pbf PBF.
|
||||||
* @param {Object} feature Raw feature.
|
* @param {Object} feature Raw feature.
|
||||||
* @param {Array.<number>} flatCoordinates Array to store flat coordinates in.
|
* @param {Array<number>} flatCoordinates Array to store flat coordinates in.
|
||||||
* @param {Array.<number>} ends Array to store ends in.
|
* @param {Array<number>} ends Array to store ends in.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
readRawGeometry_(pbf, feature, flatCoordinates, ends) {
|
readRawGeometry_(pbf, feature, flatCoordinates, ends) {
|
||||||
@@ -252,7 +252,7 @@ class MVT extends FeatureFormat {
|
|||||||
|
|
||||||
const pbf = new PBF(/** @type {ArrayBuffer} */ (source));
|
const pbf = new PBF(/** @type {ArrayBuffer} */ (source));
|
||||||
const pbfLayers = pbf.readFields(layersPBFReader, {});
|
const pbfLayers = pbf.readFields(layersPBFReader, {});
|
||||||
/** @type {Array.<module:ol/Feature|module:ol/render/Feature>} */
|
/** @type {Array<module:ol/Feature|module:ol/render/Feature>} */
|
||||||
const features = [];
|
const features = [];
|
||||||
for (const name in pbfLayers) {
|
for (const name in pbfLayers) {
|
||||||
if (layers && layers.indexOf(name) == -1) {
|
if (layers && layers.indexOf(name) == -1) {
|
||||||
@@ -280,42 +280,13 @@ class MVT extends FeatureFormat {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the layers that features will be read from.
|
* Sets the layers that features will be read from.
|
||||||
* @param {Array.<string>} layers Layers.
|
* @param {Array<string>} layers Layers.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
setLayers(layers) {
|
setLayers(layers) {
|
||||||
this.layers_ = layers;
|
this.layers_ = layers;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Not implemented.
|
|
||||||
* @override
|
|
||||||
*/
|
|
||||||
readFeature() {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Not implemented.
|
|
||||||
* @override
|
|
||||||
*/
|
|
||||||
readGeometry() {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Not implemented.
|
|
||||||
* @override
|
|
||||||
*/
|
|
||||||
writeFeature() {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Not implemented.
|
|
||||||
* @override
|
|
||||||
*/
|
|
||||||
writeGeometry() {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Not implemented.
|
|
||||||
* @override
|
|
||||||
*/
|
|
||||||
writeFeatures() {}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -17,14 +17,14 @@ import {pushParseAndPop, makeStructureNS} from '../xml.js';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Array.<null>}
|
* @type {Array<null>}
|
||||||
*/
|
*/
|
||||||
const NAMESPACE_URIS = [null];
|
const NAMESPACE_URIS = [null];
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const WAY_PARSERS = makeStructureNS(
|
const WAY_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -35,7 +35,7 @@ const WAY_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const PARSERS = makeStructureNS(
|
const PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -75,7 +75,7 @@ class OSMXML extends XMLFeature {
|
|||||||
// parse nodes in ways
|
// parse nodes in ways
|
||||||
for (let j = 0; j < state.ways.length; j++) {
|
for (let j = 0; j < state.ways.length; j++) {
|
||||||
const values = /** @type {Object} */ (state.ways[j]);
|
const values = /** @type {Object} */ (state.ways[j]);
|
||||||
/** @type {Array.<number>} */
|
/** @type {Array<number>} */
|
||||||
const flatCoordinates = [];
|
const flatCoordinates = [];
|
||||||
for (let i = 0, ii = values.ndrefs.length; i < ii; i++) {
|
for (let i = 0, ii = values.ndrefs.length; i < ii; i++) {
|
||||||
const point = state.nodes[values.ndrefs[i]];
|
const point = state.nodes[values.ndrefs[i]];
|
||||||
@@ -101,29 +101,12 @@ class OSMXML extends XMLFeature {
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Not implemented.
|
|
||||||
* @inheritDoc
|
|
||||||
*/
|
|
||||||
writeFeatureNode(feature, opt_options) {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Not implemented.
|
|
||||||
* @inheritDoc
|
|
||||||
*/
|
|
||||||
writeFeaturesNode(features, opt_options) {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Not implemented.
|
|
||||||
* @inheritDoc
|
|
||||||
*/
|
|
||||||
writeGeometryNode(geometry, opt_options) {}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const NODE_PARSERS = makeStructureNS(
|
const NODE_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -133,7 +116,7 @@ const NODE_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function readNode(node, objectStack) {
|
function readNode(node, objectStack) {
|
||||||
const options = /** @type {module:ol/format/Feature~ReadOptions} */ (objectStack[0]);
|
const options = /** @type {module:ol/format/Feature~ReadOptions} */ (objectStack[0]);
|
||||||
@@ -162,7 +145,7 @@ function readNode(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function readWay(node, objectStack) {
|
function readWay(node, objectStack) {
|
||||||
const id = node.getAttribute('id');
|
const id = node.getAttribute('id');
|
||||||
@@ -178,7 +161,7 @@ function readWay(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function readNd(node, objectStack) {
|
function readNd(node, objectStack) {
|
||||||
const values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
const values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||||
@@ -188,7 +171,7 @@ function readNd(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function readTag(node, objectStack) {
|
function readTag(node, objectStack) {
|
||||||
const values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
const values = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||||
|
|||||||
@@ -9,14 +9,14 @@ import {makeObjectPropertyPusher, makeObjectPropertySetter, makeStructureNS, pus
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Array.<null|string>}
|
* @type {Array<null|string>}
|
||||||
*/
|
*/
|
||||||
const NAMESPACE_URIS = [null, 'http://www.opengis.net/ows/1.1'];
|
const NAMESPACE_URIS = [null, 'http://www.opengis.net/ows/1.1'];
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const PARSERS = makeStructureNS(
|
const PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -56,7 +56,7 @@ class OWS extends XML {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const ADDRESS_PARSERS = makeStructureNS(
|
const ADDRESS_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -71,7 +71,7 @@ const ADDRESS_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const ALLOWED_VALUES_PARSERS = makeStructureNS(
|
const ALLOWED_VALUES_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -81,7 +81,7 @@ const ALLOWED_VALUES_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const CONSTRAINT_PARSERS = makeStructureNS(
|
const CONSTRAINT_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -91,7 +91,7 @@ const CONSTRAINT_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const CONTACT_INFO_PARSERS = makeStructureNS(
|
const CONTACT_INFO_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -102,7 +102,7 @@ const CONTACT_INFO_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const DCP_PARSERS = makeStructureNS(
|
const DCP_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -112,7 +112,7 @@ const DCP_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const HTTP_PARSERS = makeStructureNS(
|
const HTTP_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -123,7 +123,7 @@ const HTTP_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const OPERATION_PARSERS = makeStructureNS(
|
const OPERATION_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -133,7 +133,7 @@ const OPERATION_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const OPERATIONS_METADATA_PARSERS = makeStructureNS(
|
const OPERATIONS_METADATA_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -143,7 +143,7 @@ const OPERATIONS_METADATA_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const PHONE_PARSERS = makeStructureNS(
|
const PHONE_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -154,7 +154,7 @@ const PHONE_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const REQUEST_METHOD_PARSERS = makeStructureNS(
|
const REQUEST_METHOD_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -164,7 +164,7 @@ const REQUEST_METHOD_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const SERVICE_CONTACT_PARSERS =
|
const SERVICE_CONTACT_PARSERS =
|
||||||
makeStructureNS(
|
makeStructureNS(
|
||||||
@@ -177,7 +177,7 @@ const SERVICE_CONTACT_PARSERS =
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const SERVICE_IDENTIFICATION_PARSERS =
|
const SERVICE_IDENTIFICATION_PARSERS =
|
||||||
makeStructureNS(
|
makeStructureNS(
|
||||||
@@ -193,7 +193,7 @@ const SERVICE_IDENTIFICATION_PARSERS =
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const SERVICE_PROVIDER_PARSERS =
|
const SERVICE_PROVIDER_PARSERS =
|
||||||
makeStructureNS(
|
makeStructureNS(
|
||||||
@@ -206,7 +206,7 @@ const SERVICE_PROVIDER_PARSERS =
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} The address.
|
* @return {Object|undefined} The address.
|
||||||
*/
|
*/
|
||||||
function readAddress(node, objectStack) {
|
function readAddress(node, objectStack) {
|
||||||
@@ -217,7 +217,7 @@ function readAddress(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} The values.
|
* @return {Object|undefined} The values.
|
||||||
*/
|
*/
|
||||||
function readAllowedValues(node, objectStack) {
|
function readAllowedValues(node, objectStack) {
|
||||||
@@ -228,7 +228,7 @@ function readAllowedValues(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} The constraint.
|
* @return {Object|undefined} The constraint.
|
||||||
*/
|
*/
|
||||||
function readConstraint(node, objectStack) {
|
function readConstraint(node, objectStack) {
|
||||||
@@ -244,7 +244,7 @@ function readConstraint(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} The contact info.
|
* @return {Object|undefined} The contact info.
|
||||||
*/
|
*/
|
||||||
function readContactInfo(node, objectStack) {
|
function readContactInfo(node, objectStack) {
|
||||||
@@ -255,7 +255,7 @@ function readContactInfo(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} The DCP.
|
* @return {Object|undefined} The DCP.
|
||||||
*/
|
*/
|
||||||
function readDcp(node, objectStack) {
|
function readDcp(node, objectStack) {
|
||||||
@@ -266,7 +266,7 @@ function readDcp(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} The GET object.
|
* @return {Object|undefined} The GET object.
|
||||||
*/
|
*/
|
||||||
function readGet(node, objectStack) {
|
function readGet(node, objectStack) {
|
||||||
@@ -281,7 +281,7 @@ function readGet(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} The HTTP object.
|
* @return {Object|undefined} The HTTP object.
|
||||||
*/
|
*/
|
||||||
function readHttp(node, objectStack) {
|
function readHttp(node, objectStack) {
|
||||||
@@ -291,7 +291,7 @@ function readHttp(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} The operation.
|
* @return {Object|undefined} The operation.
|
||||||
*/
|
*/
|
||||||
function readOperation(node, objectStack) {
|
function readOperation(node, objectStack) {
|
||||||
@@ -309,7 +309,7 @@ function readOperation(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} The operations metadata.
|
* @return {Object|undefined} The operations metadata.
|
||||||
*/
|
*/
|
||||||
function readOperationsMetadata(node, objectStack) {
|
function readOperationsMetadata(node, objectStack) {
|
||||||
@@ -321,7 +321,7 @@ function readOperationsMetadata(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} The phone.
|
* @return {Object|undefined} The phone.
|
||||||
*/
|
*/
|
||||||
function readPhone(node, objectStack) {
|
function readPhone(node, objectStack) {
|
||||||
@@ -332,7 +332,7 @@ function readPhone(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} The service identification.
|
* @return {Object|undefined} The service identification.
|
||||||
*/
|
*/
|
||||||
function readServiceIdentification(node, objectStack) {
|
function readServiceIdentification(node, objectStack) {
|
||||||
@@ -344,7 +344,7 @@ function readServiceIdentification(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} The service contact.
|
* @return {Object|undefined} The service contact.
|
||||||
*/
|
*/
|
||||||
function readServiceContact(node, objectStack) {
|
function readServiceContact(node, objectStack) {
|
||||||
@@ -356,7 +356,7 @@ function readServiceContact(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} The service provider.
|
* @return {Object|undefined} The service provider.
|
||||||
*/
|
*/
|
||||||
function readServiceProvider(node, objectStack) {
|
function readServiceProvider(node, objectStack) {
|
||||||
@@ -368,7 +368,7 @@ function readServiceProvider(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {string|undefined} The value.
|
* @return {string|undefined} The value.
|
||||||
*/
|
*/
|
||||||
function readValue(node, objectStack) {
|
function readValue(node, objectStack) {
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ class Polyline extends TextFeature {
|
|||||||
*
|
*
|
||||||
* Attention: This function will modify the passed array!
|
* Attention: This function will modify the passed array!
|
||||||
*
|
*
|
||||||
* @param {Array.<number>} numbers A list of n-dimensional points.
|
* @param {Array<number>} numbers A list of n-dimensional points.
|
||||||
* @param {number} stride The number of dimension of the points in the list.
|
* @param {number} stride The number of dimension of the points in the list.
|
||||||
* @param {number=} opt_factor The factor by which the numbers will be
|
* @param {number=} opt_factor The factor by which the numbers will be
|
||||||
* multiplied. The remaining decimal places will get rounded away.
|
* multiplied. The remaining decimal places will get rounded away.
|
||||||
@@ -177,14 +177,14 @@ export function encodeDeltas(numbers, stride, opt_factor) {
|
|||||||
* encoded string.
|
* encoded string.
|
||||||
* @param {number=} opt_factor The factor by which the resulting numbers will
|
* @param {number=} opt_factor The factor by which the resulting numbers will
|
||||||
* be divided. Default is `1e5`.
|
* be divided. Default is `1e5`.
|
||||||
* @return {Array.<number>} A list of n-dimensional points.
|
* @return {Array<number>} A list of n-dimensional points.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function decodeDeltas(encoded, stride, opt_factor) {
|
export function decodeDeltas(encoded, stride, opt_factor) {
|
||||||
const factor = opt_factor ? opt_factor : 1e5;
|
const factor = opt_factor ? opt_factor : 1e5;
|
||||||
let d;
|
let d;
|
||||||
|
|
||||||
/** @type {Array.<number>} */
|
/** @type {Array<number>} */
|
||||||
const lastNumbers = new Array(stride);
|
const lastNumbers = new Array(stride);
|
||||||
for (d = 0; d < stride; ++d) {
|
for (d = 0; d < stride; ++d) {
|
||||||
lastNumbers[d] = 0;
|
lastNumbers[d] = 0;
|
||||||
@@ -209,7 +209,7 @@ export function decodeDeltas(encoded, stride, opt_factor) {
|
|||||||
*
|
*
|
||||||
* Attention: This function will modify the passed array!
|
* Attention: This function will modify the passed array!
|
||||||
*
|
*
|
||||||
* @param {Array.<number>} numbers A list of floating point numbers.
|
* @param {Array<number>} numbers A list of floating point numbers.
|
||||||
* @param {number=} opt_factor The factor by which the numbers will be
|
* @param {number=} opt_factor The factor by which the numbers will be
|
||||||
* multiplied. The remaining decimal places will get rounded away.
|
* multiplied. The remaining decimal places will get rounded away.
|
||||||
* Default is `1e5`.
|
* Default is `1e5`.
|
||||||
@@ -232,7 +232,7 @@ export function encodeFloats(numbers, opt_factor) {
|
|||||||
* @param {string} encoded An encoded string.
|
* @param {string} encoded An encoded string.
|
||||||
* @param {number=} opt_factor The factor by which the result will be divided.
|
* @param {number=} opt_factor The factor by which the result will be divided.
|
||||||
* Default is `1e5`.
|
* Default is `1e5`.
|
||||||
* @return {Array.<number>} A list of floating point numbers.
|
* @return {Array<number>} A list of floating point numbers.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
export function decodeFloats(encoded, opt_factor) {
|
export function decodeFloats(encoded, opt_factor) {
|
||||||
@@ -250,7 +250,7 @@ export function decodeFloats(encoded, opt_factor) {
|
|||||||
*
|
*
|
||||||
* Attention: This function will modify the passed array!
|
* Attention: This function will modify the passed array!
|
||||||
*
|
*
|
||||||
* @param {Array.<number>} numbers A list of signed integers.
|
* @param {Array<number>} numbers A list of signed integers.
|
||||||
* @return {string} The encoded string.
|
* @return {string} The encoded string.
|
||||||
*/
|
*/
|
||||||
export function encodeSignedIntegers(numbers) {
|
export function encodeSignedIntegers(numbers) {
|
||||||
@@ -266,7 +266,7 @@ export function encodeSignedIntegers(numbers) {
|
|||||||
* Decode a list of signed integers from an encoded string
|
* Decode a list of signed integers from an encoded string
|
||||||
*
|
*
|
||||||
* @param {string} encoded An encoded string.
|
* @param {string} encoded An encoded string.
|
||||||
* @return {Array.<number>} A list of signed integers.
|
* @return {Array<number>} A list of signed integers.
|
||||||
*/
|
*/
|
||||||
export function decodeSignedIntegers(encoded) {
|
export function decodeSignedIntegers(encoded) {
|
||||||
const numbers = decodeUnsignedIntegers(encoded);
|
const numbers = decodeUnsignedIntegers(encoded);
|
||||||
@@ -281,7 +281,7 @@ export function decodeSignedIntegers(encoded) {
|
|||||||
/**
|
/**
|
||||||
* Encode a list of unsigned integers and return an encoded string
|
* Encode a list of unsigned integers and return an encoded string
|
||||||
*
|
*
|
||||||
* @param {Array.<number>} numbers A list of unsigned integers.
|
* @param {Array<number>} numbers A list of unsigned integers.
|
||||||
* @return {string} The encoded string.
|
* @return {string} The encoded string.
|
||||||
*/
|
*/
|
||||||
export function encodeUnsignedIntegers(numbers) {
|
export function encodeUnsignedIntegers(numbers) {
|
||||||
@@ -297,7 +297,7 @@ export function encodeUnsignedIntegers(numbers) {
|
|||||||
* Decode a list of unsigned integers from an encoded string
|
* Decode a list of unsigned integers from an encoded string
|
||||||
*
|
*
|
||||||
* @param {string} encoded An encoded string.
|
* @param {string} encoded An encoded string.
|
||||||
* @return {Array.<number>} A list of unsigned integers.
|
* @return {Array<number>} A list of unsigned integers.
|
||||||
*/
|
*/
|
||||||
export function decodeUnsignedIntegers(encoded) {
|
export function decodeUnsignedIntegers(encoded) {
|
||||||
const numbers = [];
|
const numbers = [];
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ class TextFeature extends FeatureFormat {
|
|||||||
*
|
*
|
||||||
* @param {Document|Node|Object|string} source Source.
|
* @param {Document|Node|Object|string} source Source.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||||
* @return {Array.<module:ol/Feature>} Features.
|
* @return {Array<module:ol/Feature>} Features.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
readFeatures(source, opt_options) {
|
readFeatures(source, opt_options) {
|
||||||
@@ -62,7 +62,7 @@ class TextFeature extends FeatureFormat {
|
|||||||
* @param {string} text Text.
|
* @param {string} text Text.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||||
* @protected
|
* @protected
|
||||||
* @return {Array.<module:ol/Feature>} Features.
|
* @return {Array<module:ol/Feature>} Features.
|
||||||
*/
|
*/
|
||||||
readFeaturesFromText(text, opt_options) {}
|
readFeaturesFromText(text, opt_options) {}
|
||||||
|
|
||||||
@@ -133,7 +133,7 @@ class TextFeature extends FeatureFormat {
|
|||||||
/**
|
/**
|
||||||
* Encode an array of features as string.
|
* Encode an array of features as string.
|
||||||
*
|
*
|
||||||
* @param {Array.<module:ol/Feature>} features Features.
|
* @param {Array<module:ol/Feature>} features Features.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||||
* @return {string} Encoded features.
|
* @return {string} Encoded features.
|
||||||
* @api
|
* @api
|
||||||
@@ -144,7 +144,7 @@ class TextFeature extends FeatureFormat {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @abstract
|
* @abstract
|
||||||
* @param {Array.<module:ol/Feature>} features Features.
|
* @param {Array<module:ol/Feature>} features Features.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||||
* @protected
|
* @protected
|
||||||
* @return {string} Text.
|
* @return {string} Text.
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ import {get as getProjection} from '../proj.js';
|
|||||||
* ```
|
* ```
|
||||||
* will result in features that have a property `'layer'` set to `'example'`.
|
* will result in features that have a property `'layer'` set to `'example'`.
|
||||||
* When not set, no property will be added to features.
|
* When not set, no property will be added to features.
|
||||||
* @property {Array.<string>} [layers] Names of the TopoJSON topology's
|
* @property {Array<string>} [layers] Names of the TopoJSON topology's
|
||||||
* `objects`'s children to read features from. If not provided, features will
|
* `objects`'s children to read features from. If not provided, features will
|
||||||
* be read from all children.
|
* be read from all children.
|
||||||
*/
|
*/
|
||||||
@@ -62,7 +62,7 @@ class TopoJSON extends JSONFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array.<string>}
|
* @type {Array<string>}
|
||||||
*/
|
*/
|
||||||
this.layers_ = options.layers ? options.layers : null;
|
this.layers_ = options.layers ? options.layers : null;
|
||||||
|
|
||||||
@@ -91,7 +91,7 @@ class TopoJSON extends JSONFeature {
|
|||||||
if (transform) {
|
if (transform) {
|
||||||
transformArcs(arcs, scale, translate);
|
transformArcs(arcs, scale, translate);
|
||||||
}
|
}
|
||||||
/** @type {Array.<module:ol/Feature>} */
|
/** @type {Array<module:ol/Feature>} */
|
||||||
const features = [];
|
const features = [];
|
||||||
const topoJSONFeatures = topoJSONTopology.objects;
|
const topoJSONFeatures = topoJSONTopology.objects;
|
||||||
const property = this.layerName_;
|
const property = this.layerName_;
|
||||||
@@ -123,41 +123,12 @@ class TopoJSON extends JSONFeature {
|
|||||||
return this.dataProjection;
|
return this.dataProjection;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Not implemented.
|
|
||||||
* @inheritDoc
|
|
||||||
*/
|
|
||||||
writeFeatureObject(feature, opt_options) {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Not implemented.
|
|
||||||
* @inheritDoc
|
|
||||||
*/
|
|
||||||
writeFeaturesObject(features, opt_options) {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Not implemented.
|
|
||||||
* @inheritDoc
|
|
||||||
*/
|
|
||||||
writeGeometryObject(geometry, opt_options) {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Not implemented.
|
|
||||||
* @override
|
|
||||||
*/
|
|
||||||
readGeometryFromObject() {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Not implemented.
|
|
||||||
* @override
|
|
||||||
*/
|
|
||||||
readFeatureFromObject() {}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, function(TopoJSONGeometry, Array, ...Array): module:ol/geom/Geometry>}
|
* @type {Object<string, function(TopoJSONGeometry, Array, ...Array): module:ol/geom/Geometry>}
|
||||||
*/
|
*/
|
||||||
const GEOMETRY_READERS = {
|
const GEOMETRY_READERS = {
|
||||||
'Point': readPointGeometry,
|
'Point': readPointGeometry,
|
||||||
@@ -171,14 +142,14 @@ const GEOMETRY_READERS = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Concatenate arcs into a coordinate array.
|
* Concatenate arcs into a coordinate array.
|
||||||
* @param {Array.<number>} indices Indices of arcs to concatenate. Negative
|
* @param {Array<number>} indices Indices of arcs to concatenate. Negative
|
||||||
* values indicate arcs need to be reversed.
|
* values indicate arcs need to be reversed.
|
||||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs (already
|
* @param {Array<Array<module:ol/coordinate~Coordinate>>} arcs Array of arcs (already
|
||||||
* transformed).
|
* transformed).
|
||||||
* @return {Array.<module:ol/coordinate~Coordinate>} Coordinates array.
|
* @return {Array<module:ol/coordinate~Coordinate>} Coordinates array.
|
||||||
*/
|
*/
|
||||||
function concatenateArcs(indices, arcs) {
|
function concatenateArcs(indices, arcs) {
|
||||||
/** @type {Array.<module:ol/coordinate~Coordinate>} */
|
/** @type {Array<module:ol/coordinate~Coordinate>} */
|
||||||
const coordinates = [];
|
const coordinates = [];
|
||||||
let index, arc;
|
let index, arc;
|
||||||
for (let i = 0, ii = indices.length; i < ii; ++i) {
|
for (let i = 0, ii = indices.length; i < ii; ++i) {
|
||||||
@@ -208,8 +179,8 @@ function concatenateArcs(indices, arcs) {
|
|||||||
* Create a point from a TopoJSON geometry object.
|
* Create a point from a TopoJSON geometry object.
|
||||||
*
|
*
|
||||||
* @param {TopoJSONGeometry} object TopoJSON object.
|
* @param {TopoJSONGeometry} object TopoJSON object.
|
||||||
* @param {Array.<number>} scale Scale for each dimension.
|
* @param {Array<number>} scale Scale for each dimension.
|
||||||
* @param {Array.<number>} translate Translation for each dimension.
|
* @param {Array<number>} translate Translation for each dimension.
|
||||||
* @return {module:ol/geom/Point} Geometry.
|
* @return {module:ol/geom/Point} Geometry.
|
||||||
*/
|
*/
|
||||||
function readPointGeometry(object, scale, translate) {
|
function readPointGeometry(object, scale, translate) {
|
||||||
@@ -225,8 +196,8 @@ function readPointGeometry(object, scale, translate) {
|
|||||||
* Create a multi-point from a TopoJSON geometry object.
|
* Create a multi-point from a TopoJSON geometry object.
|
||||||
*
|
*
|
||||||
* @param {TopoJSONGeometry} object TopoJSON object.
|
* @param {TopoJSONGeometry} object TopoJSON object.
|
||||||
* @param {Array.<number>} scale Scale for each dimension.
|
* @param {Array<number>} scale Scale for each dimension.
|
||||||
* @param {Array.<number>} translate Translation for each dimension.
|
* @param {Array<number>} translate Translation for each dimension.
|
||||||
* @return {module:ol/geom/MultiPoint} Geometry.
|
* @return {module:ol/geom/MultiPoint} Geometry.
|
||||||
*/
|
*/
|
||||||
function readMultiPointGeometry(object, scale, translate) {
|
function readMultiPointGeometry(object, scale, translate) {
|
||||||
@@ -244,7 +215,7 @@ function readMultiPointGeometry(object, scale, translate) {
|
|||||||
* Create a linestring from a TopoJSON geometry object.
|
* Create a linestring from a TopoJSON geometry object.
|
||||||
*
|
*
|
||||||
* @param {TopoJSONGeometry} object TopoJSON object.
|
* @param {TopoJSONGeometry} object TopoJSON object.
|
||||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
* @param {Array<Array<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||||
* @return {module:ol/geom/LineString} Geometry.
|
* @return {module:ol/geom/LineString} Geometry.
|
||||||
*/
|
*/
|
||||||
function readLineStringGeometry(object, arcs) {
|
function readLineStringGeometry(object, arcs) {
|
||||||
@@ -257,7 +228,7 @@ function readLineStringGeometry(object, arcs) {
|
|||||||
* Create a multi-linestring from a TopoJSON geometry object.
|
* Create a multi-linestring from a TopoJSON geometry object.
|
||||||
*
|
*
|
||||||
* @param {TopoJSONGeometry} object TopoJSON object.
|
* @param {TopoJSONGeometry} object TopoJSON object.
|
||||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
* @param {Array<Array<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||||
* @return {module:ol/geom/MultiLineString} Geometry.
|
* @return {module:ol/geom/MultiLineString} Geometry.
|
||||||
*/
|
*/
|
||||||
function readMultiLineStringGeometry(object, arcs) {
|
function readMultiLineStringGeometry(object, arcs) {
|
||||||
@@ -273,7 +244,7 @@ function readMultiLineStringGeometry(object, arcs) {
|
|||||||
* Create a polygon from a TopoJSON geometry object.
|
* Create a polygon from a TopoJSON geometry object.
|
||||||
*
|
*
|
||||||
* @param {TopoJSONGeometry} object TopoJSON object.
|
* @param {TopoJSONGeometry} object TopoJSON object.
|
||||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
* @param {Array<Array<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||||
* @return {module:ol/geom/Polygon} Geometry.
|
* @return {module:ol/geom/Polygon} Geometry.
|
||||||
*/
|
*/
|
||||||
function readPolygonGeometry(object, arcs) {
|
function readPolygonGeometry(object, arcs) {
|
||||||
@@ -289,7 +260,7 @@ function readPolygonGeometry(object, arcs) {
|
|||||||
* Create a multi-polygon from a TopoJSON geometry object.
|
* Create a multi-polygon from a TopoJSON geometry object.
|
||||||
*
|
*
|
||||||
* @param {TopoJSONGeometry} object TopoJSON object.
|
* @param {TopoJSONGeometry} object TopoJSON object.
|
||||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
* @param {Array<Array<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||||
* @return {module:ol/geom/MultiPolygon} Geometry.
|
* @return {module:ol/geom/MultiPolygon} Geometry.
|
||||||
*/
|
*/
|
||||||
function readMultiPolygonGeometry(object, arcs) {
|
function readMultiPolygonGeometry(object, arcs) {
|
||||||
@@ -313,14 +284,14 @@ function readMultiPolygonGeometry(object, arcs) {
|
|||||||
*
|
*
|
||||||
* @param {TopoJSONGeometryCollection} collection TopoJSON Geometry
|
* @param {TopoJSONGeometryCollection} collection TopoJSON Geometry
|
||||||
* object.
|
* object.
|
||||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
* @param {Array<Array<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||||
* @param {Array.<number>} scale Scale for each dimension.
|
* @param {Array<number>} scale Scale for each dimension.
|
||||||
* @param {Array.<number>} translate Translation for each dimension.
|
* @param {Array<number>} translate Translation for each dimension.
|
||||||
* @param {string|undefined} property Property to set the `GeometryCollection`'s parent
|
* @param {string|undefined} property Property to set the `GeometryCollection`'s parent
|
||||||
* object to.
|
* object to.
|
||||||
* @param {string} name Name of the `Topology`'s child object.
|
* @param {string} name Name of the `Topology`'s child object.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||||
* @return {Array.<module:ol/Feature>} Array of features.
|
* @return {Array<module:ol/Feature>} Array of features.
|
||||||
*/
|
*/
|
||||||
function readFeaturesFromGeometryCollection(collection, arcs, scale, translate, property, name, opt_options) {
|
function readFeaturesFromGeometryCollection(collection, arcs, scale, translate, property, name, opt_options) {
|
||||||
const geometries = collection.geometries;
|
const geometries = collection.geometries;
|
||||||
@@ -337,9 +308,9 @@ function readFeaturesFromGeometryCollection(collection, arcs, scale, translate,
|
|||||||
* Create a feature from a TopoJSON geometry object.
|
* Create a feature from a TopoJSON geometry object.
|
||||||
*
|
*
|
||||||
* @param {TopoJSONGeometry} object TopoJSON geometry object.
|
* @param {TopoJSONGeometry} object TopoJSON geometry object.
|
||||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
* @param {Array<Array<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||||
* @param {Array.<number>} scale Scale for each dimension.
|
* @param {Array<number>} scale Scale for each dimension.
|
||||||
* @param {Array.<number>} translate Translation for each dimension.
|
* @param {Array<number>} translate Translation for each dimension.
|
||||||
* @param {string|undefined} property Property to set the `GeometryCollection`'s parent
|
* @param {string|undefined} property Property to set the `GeometryCollection`'s parent
|
||||||
* object to.
|
* object to.
|
||||||
* @param {string} name Name of the `Topology`'s child object.
|
* @param {string} name Name of the `Topology`'s child object.
|
||||||
@@ -379,9 +350,9 @@ function readFeatureFromGeometry(object, arcs, scale, translate, property, name,
|
|||||||
* Apply a linear transform to array of arcs. The provided array of arcs is
|
* Apply a linear transform to array of arcs. The provided array of arcs is
|
||||||
* modified in place.
|
* modified in place.
|
||||||
*
|
*
|
||||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
* @param {Array<Array<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||||
* @param {Array.<number>} scale Scale for each dimension.
|
* @param {Array<number>} scale Scale for each dimension.
|
||||||
* @param {Array.<number>} translate Translation for each dimension.
|
* @param {Array<number>} translate Translation for each dimension.
|
||||||
*/
|
*/
|
||||||
function transformArcs(arcs, scale, translate) {
|
function transformArcs(arcs, scale, translate) {
|
||||||
for (let i = 0, ii = arcs.length; i < ii; ++i) {
|
for (let i = 0, ii = arcs.length; i < ii; ++i) {
|
||||||
@@ -393,9 +364,9 @@ function transformArcs(arcs, scale, translate) {
|
|||||||
/**
|
/**
|
||||||
* Apply a linear transform to an arc. The provided arc is modified in place.
|
* Apply a linear transform to an arc. The provided arc is modified in place.
|
||||||
*
|
*
|
||||||
* @param {Array.<module:ol/coordinate~Coordinate>} arc Arc.
|
* @param {Array<module:ol/coordinate~Coordinate>} arc Arc.
|
||||||
* @param {Array.<number>} scale Scale for each dimension.
|
* @param {Array<number>} scale Scale for each dimension.
|
||||||
* @param {Array.<number>} translate Translation for each dimension.
|
* @param {Array<number>} translate Translation for each dimension.
|
||||||
*/
|
*/
|
||||||
function transformArc(arc, scale, translate) {
|
function transformArc(arc, scale, translate) {
|
||||||
let x = 0;
|
let x = 0;
|
||||||
@@ -416,8 +387,8 @@ function transformArc(arc, scale, translate) {
|
|||||||
* place.
|
* place.
|
||||||
*
|
*
|
||||||
* @param {module:ol/coordinate~Coordinate} vertex Vertex.
|
* @param {module:ol/coordinate~Coordinate} vertex Vertex.
|
||||||
* @param {Array.<number>} scale Scale for each dimension.
|
* @param {Array<number>} scale Scale for each dimension.
|
||||||
* @param {Array.<number>} translate Translation for each dimension.
|
* @param {Array<number>} translate Translation for each dimension.
|
||||||
*/
|
*/
|
||||||
function transformVertex(vertex, scale, translate) {
|
function transformVertex(vertex, scale, translate) {
|
||||||
vertex[0] = vertex[0] * scale[0] + translate[0];
|
vertex[0] = vertex[0] * scale[0] + translate[0];
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import {createElementNS, isDocument, isNode, makeArrayPusher, makeChildAppender,
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const FEATURE_COLLECTION_PARSERS = {
|
const FEATURE_COLLECTION_PARSERS = {
|
||||||
'http://www.opengis.net/gml': {
|
'http://www.opengis.net/gml': {
|
||||||
@@ -30,7 +30,7 @@ const FEATURE_COLLECTION_PARSERS = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const TRANSACTION_SUMMARY_PARSERS = {
|
const TRANSACTION_SUMMARY_PARSERS = {
|
||||||
'http://www.opengis.net/wfs': {
|
'http://www.opengis.net/wfs': {
|
||||||
@@ -43,7 +43,7 @@ const TRANSACTION_SUMMARY_PARSERS = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const TRANSACTION_RESPONSE_PARSERS = {
|
const TRANSACTION_RESPONSE_PARSERS = {
|
||||||
'http://www.opengis.net/wfs': {
|
'http://www.opengis.net/wfs': {
|
||||||
@@ -56,7 +56,7 @@ const TRANSACTION_RESPONSE_PARSERS = {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||||
*/
|
*/
|
||||||
const QUERY_SERIALIZERS = {
|
const QUERY_SERIALIZERS = {
|
||||||
'http://www.opengis.net/wfs': {
|
'http://www.opengis.net/wfs': {
|
||||||
@@ -66,7 +66,7 @@ const QUERY_SERIALIZERS = {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||||
*/
|
*/
|
||||||
const TRANSACTION_SERIALIZERS = {
|
const TRANSACTION_SERIALIZERS = {
|
||||||
'http://www.opengis.net/wfs': {
|
'http://www.opengis.net/wfs': {
|
||||||
@@ -81,8 +81,8 @@ const TRANSACTION_SERIALIZERS = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} Options
|
* @typedef {Object} Options
|
||||||
* @property {Object.<string, string>|string} [featureNS] The namespace URI used for features.
|
* @property {Object<string, string>|string} [featureNS] The namespace URI used for features.
|
||||||
* @property {Array.<string>|string} [featureType] The feature type to parse. Only used for read operations.
|
* @property {Array<string>|string} [featureType] The feature type to parse. Only used for read operations.
|
||||||
* @property {module:ol/format/GMLBase} [gmlFormat] The GML format to use to parse the response. Default is `ol/format/GML3`.
|
* @property {module:ol/format/GMLBase} [gmlFormat] The GML format to use to parse the response. Default is `ol/format/GML3`.
|
||||||
* @property {string} [schemaLocation] Optional schemaLocation to use for serialization, this will override the default.
|
* @property {string} [schemaLocation] Optional schemaLocation to use for serialization, this will override the default.
|
||||||
*/
|
*/
|
||||||
@@ -92,14 +92,14 @@ const TRANSACTION_SERIALIZERS = {
|
|||||||
* @typedef {Object} WriteGetFeatureOptions
|
* @typedef {Object} WriteGetFeatureOptions
|
||||||
* @property {string} featureNS The namespace URI used for features.
|
* @property {string} featureNS The namespace URI used for features.
|
||||||
* @property {string} featurePrefix The prefix for the feature namespace.
|
* @property {string} featurePrefix The prefix for the feature namespace.
|
||||||
* @property {Array.<string>} featureTypes The feature type names.
|
* @property {Array<string>} featureTypes The feature type names.
|
||||||
* @property {string} [srsName] SRS name. No srsName attribute will be set on
|
* @property {string} [srsName] SRS name. No srsName attribute will be set on
|
||||||
* geometries when this is not provided.
|
* geometries when this is not provided.
|
||||||
* @property {string} [handle] Handle.
|
* @property {string} [handle] Handle.
|
||||||
* @property {string} [outputFormat] Output format.
|
* @property {string} [outputFormat] Output format.
|
||||||
* @property {number} [maxFeatures] Maximum number of features to fetch.
|
* @property {number} [maxFeatures] Maximum number of features to fetch.
|
||||||
* @property {string} [geometryName] Geometry name to use in a BBOX filter.
|
* @property {string} [geometryName] Geometry name to use in a BBOX filter.
|
||||||
* @property {Array.<string>} [propertyNames] Optional list of property names to serialize.
|
* @property {Array<string>} [propertyNames] Optional list of property names to serialize.
|
||||||
* @property {number} [startIndex] Start index to use for WFS paging. This is a
|
* @property {number} [startIndex] Start index to use for WFS paging. This is a
|
||||||
* WFS 2.0 feature backported to WFS 1.1.0 by some Web Feature Services.
|
* WFS 2.0 feature backported to WFS 1.1.0 by some Web Feature Services.
|
||||||
* @property {number} [count] Number of features to retrieve when paging. This is a
|
* @property {number} [count] Number of features to retrieve when paging. This is a
|
||||||
@@ -123,7 +123,7 @@ const TRANSACTION_SERIALIZERS = {
|
|||||||
* @property {string} [handle] Handle.
|
* @property {string} [handle] Handle.
|
||||||
* @property {boolean} [hasZ] Must be set to true if the transaction is for
|
* @property {boolean} [hasZ] Must be set to true if the transaction is for
|
||||||
* a 3D layer. This will allow the Z coordinate to be included in the transaction.
|
* a 3D layer. This will allow the Z coordinate to be included in the transaction.
|
||||||
* @property {Array.<Object>} nativeElements Native elements. Currently not supported.
|
* @property {Array<Object>} nativeElements Native elements. Currently not supported.
|
||||||
* @property {module:ol/format/GMLBase~Options} [gmlOptions] GML options for the WFS transaction writer.
|
* @property {module:ol/format/GMLBase~Options} [gmlOptions] GML options for the WFS transaction writer.
|
||||||
* @property {string} [version='1.1.0'] WFS version to use for the transaction. Can be either `1.0.0` or `1.1.0`.
|
* @property {string} [version='1.1.0'] WFS version to use for the transaction. Can be either `1.0.0` or `1.1.0`.
|
||||||
*/
|
*/
|
||||||
@@ -143,7 +143,7 @@ const TRANSACTION_SERIALIZERS = {
|
|||||||
* @property {number} totalDeleted
|
* @property {number} totalDeleted
|
||||||
* @property {number} totalInserted
|
* @property {number} totalInserted
|
||||||
* @property {number} totalUpdated
|
* @property {number} totalUpdated
|
||||||
* @property {Array.<string>} insertIds
|
* @property {Array<string>} insertIds
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -178,7 +178,7 @@ const FESNS = 'http://www.opengis.net/fes';
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object.<string, string>}
|
* @type {Object<string, string>}
|
||||||
*/
|
*/
|
||||||
const SCHEMA_LOCATIONS = {
|
const SCHEMA_LOCATIONS = {
|
||||||
'1.1.0': 'http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd',
|
'1.1.0': 'http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd',
|
||||||
@@ -214,13 +214,13 @@ class WFS extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array.<string>|string|undefined}
|
* @type {Array<string>|string|undefined}
|
||||||
*/
|
*/
|
||||||
this.featureType_ = options.featureType;
|
this.featureType_ = options.featureType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Object.<string, string>|string|undefined}
|
* @type {Object<string, string>|string|undefined}
|
||||||
*/
|
*/
|
||||||
this.featureNS_ = options.featureNS;
|
this.featureNS_ = options.featureNS;
|
||||||
|
|
||||||
@@ -240,14 +240,14 @@ class WFS extends XMLFeature {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {Array.<string>|string|undefined} featureType
|
* @return {Array<string>|string|undefined} featureType
|
||||||
*/
|
*/
|
||||||
getFeatureType() {
|
getFeatureType() {
|
||||||
return this.featureType_;
|
return this.featureType_;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array.<string>|string|undefined} featureType Feature type(s) to parse.
|
* @param {Array<string>|string|undefined} featureType Feature type(s) to parse.
|
||||||
*/
|
*/
|
||||||
setFeatureType(featureType) {
|
setFeatureType(featureType) {
|
||||||
this.featureType_ = featureType;
|
this.featureType_ = featureType;
|
||||||
@@ -429,16 +429,16 @@ class WFS extends XMLFeature {
|
|||||||
};
|
};
|
||||||
assert(Array.isArray(options.featureTypes),
|
assert(Array.isArray(options.featureTypes),
|
||||||
11); // `options.featureTypes` should be an Array
|
11); // `options.featureTypes` should be an Array
|
||||||
writeGetFeature(node, /** @type {!Array.<string>} */ (options.featureTypes), [context]);
|
writeGetFeature(node, /** @type {!Array<string>} */ (options.featureTypes), [context]);
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Encode format as WFS `Transaction` and return the Node.
|
* Encode format as WFS `Transaction` and return the Node.
|
||||||
*
|
*
|
||||||
* @param {Array.<module:ol/Feature>} inserts The features to insert.
|
* @param {Array<module:ol/Feature>} inserts The features to insert.
|
||||||
* @param {Array.<module:ol/Feature>} updates The features to update.
|
* @param {Array<module:ol/Feature>} updates The features to update.
|
||||||
* @param {Array.<module:ol/Feature>} deletes The features to delete.
|
* @param {Array<module:ol/Feature>} deletes The features to delete.
|
||||||
* @param {module:ol/format/WFS~WriteTransactionOptions} options Write options.
|
* @param {module:ol/format/WFS~WriteTransactionOptions} options Write options.
|
||||||
* @return {Node} Result.
|
* @return {Node} Result.
|
||||||
* @api
|
* @api
|
||||||
@@ -538,7 +538,7 @@ class WFS extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Transaction Summary.
|
* @return {Object|undefined} Transaction Summary.
|
||||||
*/
|
*/
|
||||||
function readTransactionSummary(node, objectStack) {
|
function readTransactionSummary(node, objectStack) {
|
||||||
@@ -549,7 +549,7 @@ function readTransactionSummary(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const OGC_FID_PARSERS = {
|
const OGC_FID_PARSERS = {
|
||||||
'http://www.opengis.net/ogc': {
|
'http://www.opengis.net/ogc': {
|
||||||
@@ -562,7 +562,7 @@ const OGC_FID_PARSERS = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
*/
|
*/
|
||||||
function fidParser(node, objectStack) {
|
function fidParser(node, objectStack) {
|
||||||
parseNode(OGC_FID_PARSERS, node, objectStack);
|
parseNode(OGC_FID_PARSERS, node, objectStack);
|
||||||
@@ -571,7 +571,7 @@ function fidParser(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const INSERT_RESULTS_PARSERS = {
|
const INSERT_RESULTS_PARSERS = {
|
||||||
'http://www.opengis.net/wfs': {
|
'http://www.opengis.net/wfs': {
|
||||||
@@ -582,8 +582,8 @@ const INSERT_RESULTS_PARSERS = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Array.<string>|undefined} Insert results.
|
* @return {Array<string>|undefined} Insert results.
|
||||||
*/
|
*/
|
||||||
function readInsertResults(node, objectStack) {
|
function readInsertResults(node, objectStack) {
|
||||||
return pushParseAndPop(
|
return pushParseAndPop(
|
||||||
@@ -594,7 +594,7 @@ function readInsertResults(node, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/Feature} feature Feature.
|
* @param {module:ol/Feature} feature Feature.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeFeature(node, feature, objectStack) {
|
function writeFeature(node, feature, objectStack) {
|
||||||
const context = objectStack[objectStack.length - 1];
|
const context = objectStack[objectStack.length - 1];
|
||||||
@@ -614,7 +614,7 @@ function writeFeature(node, feature, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {number|string} fid Feature identifier.
|
* @param {number|string} fid Feature identifier.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeOgcFidFilter(node, fid, objectStack) {
|
function writeOgcFidFilter(node, fid, objectStack) {
|
||||||
const filter = createElementNS(OGCNS, 'Filter');
|
const filter = createElementNS(OGCNS, 'Filter');
|
||||||
@@ -645,7 +645,7 @@ function getTypeName(featurePrefix, featureType) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/Feature} feature Feature.
|
* @param {module:ol/Feature} feature Feature.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeDelete(node, feature, objectStack) {
|
function writeDelete(node, feature, objectStack) {
|
||||||
const context = objectStack[objectStack.length - 1];
|
const context = objectStack[objectStack.length - 1];
|
||||||
@@ -666,7 +666,7 @@ function writeDelete(node, feature, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/Feature} feature Feature.
|
* @param {module:ol/Feature} feature Feature.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeUpdate(node, feature, objectStack) {
|
function writeUpdate(node, feature, objectStack) {
|
||||||
const context = objectStack[objectStack.length - 1];
|
const context = objectStack[objectStack.length - 1];
|
||||||
@@ -706,7 +706,7 @@ function writeUpdate(node, feature, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Object} pair Property name and value.
|
* @param {Object} pair Property name and value.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeProperty(node, pair, objectStack) {
|
function writeProperty(node, pair, objectStack) {
|
||||||
const name = createElementNS(WFSNS, 'Name');
|
const name = createElementNS(WFSNS, 'Name');
|
||||||
@@ -734,9 +734,8 @@ function writeProperty(node, pair, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {{vendorId: string, safeToIgnore: boolean, value: string}}
|
* @param {{vendorId: string, safeToIgnore: boolean, value: string}} nativeElement The native element.
|
||||||
* nativeElement The native element.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
|
||||||
*/
|
*/
|
||||||
function writeNative(node, nativeElement, objectStack) {
|
function writeNative(node, nativeElement, objectStack) {
|
||||||
if (nativeElement.vendorId) {
|
if (nativeElement.vendorId) {
|
||||||
@@ -752,7 +751,7 @@ function writeNative(node, nativeElement, objectStack) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Serializer>>}
|
* @type {Object<string, Object<string, module:ol/xml~Serializer>>}
|
||||||
*/
|
*/
|
||||||
const GETFEATURE_SERIALIZERS = {
|
const GETFEATURE_SERIALIZERS = {
|
||||||
'http://www.opengis.net/wfs': {
|
'http://www.opengis.net/wfs': {
|
||||||
@@ -783,7 +782,7 @@ const GETFEATURE_SERIALIZERS = {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {string} featureType Feature type.
|
* @param {string} featureType Feature type.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeQuery(node, featureType, objectStack) {
|
function writeQuery(node, featureType, objectStack) {
|
||||||
const context = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
const context = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||||
@@ -823,7 +822,7 @@ function writeQuery(node, featureType, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/format/filter/Filter} filter Filter.
|
* @param {module:ol/format/filter/Filter} filter Filter.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeFilterCondition(node, filter, objectStack) {
|
function writeFilterCondition(node, filter, objectStack) {
|
||||||
/** @type {module:ol/xml~NodeStackItem} */
|
/** @type {module:ol/xml~NodeStackItem} */
|
||||||
@@ -838,7 +837,7 @@ function writeFilterCondition(node, filter, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/format/filter/Bbox} filter Filter.
|
* @param {module:ol/format/filter/Bbox} filter Filter.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeBboxFilter(node, filter, objectStack) {
|
function writeBboxFilter(node, filter, objectStack) {
|
||||||
const context = objectStack[objectStack.length - 1];
|
const context = objectStack[objectStack.length - 1];
|
||||||
@@ -852,7 +851,7 @@ function writeBboxFilter(node, filter, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/format/filter/Contains} filter Filter.
|
* @param {module:ol/format/filter/Contains} filter Filter.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeContainsFilter(node, filter, objectStack) {
|
function writeContainsFilter(node, filter, objectStack) {
|
||||||
const context = objectStack[objectStack.length - 1];
|
const context = objectStack[objectStack.length - 1];
|
||||||
@@ -866,7 +865,7 @@ function writeContainsFilter(node, filter, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/format/filter/Intersects} filter Filter.
|
* @param {module:ol/format/filter/Intersects} filter Filter.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeIntersectsFilter(node, filter, objectStack) {
|
function writeIntersectsFilter(node, filter, objectStack) {
|
||||||
const context = objectStack[objectStack.length - 1];
|
const context = objectStack[objectStack.length - 1];
|
||||||
@@ -880,7 +879,7 @@ function writeIntersectsFilter(node, filter, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/format/filter/Within} filter Filter.
|
* @param {module:ol/format/filter/Within} filter Filter.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeWithinFilter(node, filter, objectStack) {
|
function writeWithinFilter(node, filter, objectStack) {
|
||||||
const context = objectStack[objectStack.length - 1];
|
const context = objectStack[objectStack.length - 1];
|
||||||
@@ -894,7 +893,7 @@ function writeWithinFilter(node, filter, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/format/filter/During} filter Filter.
|
* @param {module:ol/format/filter/During} filter Filter.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeDuringFilter(node, filter, objectStack) {
|
function writeDuringFilter(node, filter, objectStack) {
|
||||||
|
|
||||||
@@ -919,7 +918,7 @@ function writeDuringFilter(node, filter, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/format/filter/LogicalNary} filter Filter.
|
* @param {module:ol/format/filter/LogicalNary} filter Filter.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeLogicalFilter(node, filter, objectStack) {
|
function writeLogicalFilter(node, filter, objectStack) {
|
||||||
/** @type {module:ol/xml~NodeStackItem} */
|
/** @type {module:ol/xml~NodeStackItem} */
|
||||||
@@ -938,7 +937,7 @@ function writeLogicalFilter(node, filter, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/format/filter/Not} filter Filter.
|
* @param {module:ol/format/filter/Not} filter Filter.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeNotFilter(node, filter, objectStack) {
|
function writeNotFilter(node, filter, objectStack) {
|
||||||
/** @type {module:ol/xml~NodeStackItem} */
|
/** @type {module:ol/xml~NodeStackItem} */
|
||||||
@@ -954,7 +953,7 @@ function writeNotFilter(node, filter, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/format/filter/ComparisonBinary} filter Filter.
|
* @param {module:ol/format/filter/ComparisonBinary} filter Filter.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeComparisonFilter(node, filter, objectStack) {
|
function writeComparisonFilter(node, filter, objectStack) {
|
||||||
if (filter.matchCase !== undefined) {
|
if (filter.matchCase !== undefined) {
|
||||||
@@ -968,7 +967,7 @@ function writeComparisonFilter(node, filter, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/format/filter/IsNull} filter Filter.
|
* @param {module:ol/format/filter/IsNull} filter Filter.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeIsNullFilter(node, filter, objectStack) {
|
function writeIsNullFilter(node, filter, objectStack) {
|
||||||
writeOgcPropertyName(node, filter.propertyName);
|
writeOgcPropertyName(node, filter.propertyName);
|
||||||
@@ -978,7 +977,7 @@ function writeIsNullFilter(node, filter, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/format/filter/IsBetween} filter Filter.
|
* @param {module:ol/format/filter/IsBetween} filter Filter.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeIsBetweenFilter(node, filter, objectStack) {
|
function writeIsBetweenFilter(node, filter, objectStack) {
|
||||||
writeOgcPropertyName(node, filter.propertyName);
|
writeOgcPropertyName(node, filter.propertyName);
|
||||||
@@ -996,7 +995,7 @@ function writeIsBetweenFilter(node, filter, objectStack) {
|
|||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/format/filter/IsLike} filter Filter.
|
* @param {module:ol/format/filter/IsLike} filter Filter.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeIsLikeFilter(node, filter, objectStack) {
|
function writeIsLikeFilter(node, filter, objectStack) {
|
||||||
node.setAttribute('wildCard', filter.wildCard);
|
node.setAttribute('wildCard', filter.wildCard);
|
||||||
@@ -1070,8 +1069,8 @@ export function writeFilter(filter) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<string>} featureTypes Feature types.
|
* @param {Array<string>} featureTypes Feature types.
|
||||||
* @param {Array.<*>} objectStack Node stack.
|
* @param {Array<*>} objectStack Node stack.
|
||||||
*/
|
*/
|
||||||
function writeGetFeature(node, featureTypes, objectStack) {
|
function writeGetFeature(node, featureTypes, objectStack) {
|
||||||
const context = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
const context = /** @type {Object} */ (objectStack[objectStack.length - 1]);
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ const TokenType = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, string>}
|
* @type {Object<string, string>}
|
||||||
*/
|
*/
|
||||||
const WKTGeometryType = {};
|
const WKTGeometryType = {};
|
||||||
for (const type in GeometryType) {
|
for (const type in GeometryType) {
|
||||||
@@ -321,7 +321,7 @@ class Parser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {!Array.<module:ol/geom/Geometry>} A collection of geometries.
|
* @return {!Array<module:ol/geom/Geometry>} A collection of geometries.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
parseGeometryCollectionText_() {
|
parseGeometryCollectionText_() {
|
||||||
@@ -340,7 +340,7 @@ class Parser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {Array.<number>} All values in a point.
|
* @return {Array<number>} All values in a point.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
parsePointText_() {
|
parsePointText_() {
|
||||||
@@ -356,7 +356,7 @@ class Parser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {!Array.<!Array.<number>>} All points in a linestring.
|
* @return {!Array<!Array<number>>} All points in a linestring.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
parseLineStringText_() {
|
parseLineStringText_() {
|
||||||
@@ -372,7 +372,7 @@ class Parser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {!Array.<!Array.<number>>} All points in a polygon.
|
* @return {!Array<!Array<number>>} All points in a polygon.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
parsePolygonText_() {
|
parsePolygonText_() {
|
||||||
@@ -388,7 +388,7 @@ class Parser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {!Array.<!Array.<number>>} All points in a multipoint.
|
* @return {!Array<!Array<number>>} All points in a multipoint.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
parseMultiPointText_() {
|
parseMultiPointText_() {
|
||||||
@@ -409,7 +409,7 @@ class Parser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {!Array.<!Array.<number>>} All linestring points
|
* @return {!Array<!Array<number>>} All linestring points
|
||||||
* in a multilinestring.
|
* in a multilinestring.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
@@ -426,7 +426,7 @@ class Parser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {!Array.<!Array.<number>>} All polygon points in a multipolygon.
|
* @return {!Array<!Array<number>>} All polygon points in a multipolygon.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
parseMultiPolygonText_() {
|
parseMultiPolygonText_() {
|
||||||
@@ -442,7 +442,7 @@ class Parser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {!Array.<number>} A point.
|
* @return {!Array<number>} A point.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
parsePoint_() {
|
parsePoint_() {
|
||||||
@@ -463,7 +463,7 @@ class Parser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {!Array.<!Array.<number>>} An array of points.
|
* @return {!Array<!Array<number>>} An array of points.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
parsePointList_() {
|
parsePointList_() {
|
||||||
@@ -475,7 +475,7 @@ class Parser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {!Array.<!Array.<number>>} An array of points.
|
* @return {!Array<!Array<number>>} An array of points.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
parsePointTextList_() {
|
parsePointTextList_() {
|
||||||
@@ -487,7 +487,7 @@ class Parser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {!Array.<!Array.<number>>} An array of points.
|
* @return {!Array<!Array<number>>} An array of points.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
parseLineStringTextList_() {
|
parseLineStringTextList_() {
|
||||||
@@ -499,7 +499,7 @@ class Parser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {!Array.<!Array.<number>>} An array of points.
|
* @return {!Array<!Array<number>>} An array of points.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
parsePolygonTextList_() {
|
parsePolygonTextList_() {
|
||||||
@@ -838,7 +838,7 @@ function encodeGeometryLayout(geom) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, function(module:ol/geom/Geometry): string>}
|
* @type {Object<string, function(module:ol/geom/Geometry): string>}
|
||||||
*/
|
*/
|
||||||
const GeometryEncoder = {
|
const GeometryEncoder = {
|
||||||
'Point': encodePointGeometry,
|
'Point': encodePointGeometry,
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {makeArrayPusher, makeObjectPropertyPusher, makeObjectPropertySetter,
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Array.<null|string>}
|
* @type {Array<null|string>}
|
||||||
*/
|
*/
|
||||||
const NAMESPACE_URIS = [
|
const NAMESPACE_URIS = [
|
||||||
null,
|
null,
|
||||||
@@ -20,7 +20,7 @@ const NAMESPACE_URIS = [
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const PARSERS = makeStructureNS(
|
const PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -31,7 +31,7 @@ const PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const CAPABILITY_PARSERS = makeStructureNS(
|
const CAPABILITY_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -84,7 +84,7 @@ class WMSCapabilities extends XML {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const SERVICE_PARSERS = makeStructureNS(
|
const SERVICE_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -104,7 +104,7 @@ const SERVICE_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const CONTACT_INFORMATION_PARSERS = makeStructureNS(
|
const CONTACT_INFORMATION_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -119,7 +119,7 @@ const CONTACT_INFORMATION_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const CONTACT_PERSON_PARSERS = makeStructureNS(
|
const CONTACT_PERSON_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -130,7 +130,7 @@ const CONTACT_PERSON_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const CONTACT_ADDRESS_PARSERS = makeStructureNS(
|
const CONTACT_ADDRESS_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -145,7 +145,7 @@ const CONTACT_ADDRESS_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const EXCEPTION_PARSERS = makeStructureNS(
|
const EXCEPTION_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -155,7 +155,7 @@ const EXCEPTION_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const LAYER_PARSERS = makeStructureNS(
|
const LAYER_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -182,7 +182,7 @@ const LAYER_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const ATTRIBUTION_PARSERS = makeStructureNS(
|
const ATTRIBUTION_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -194,7 +194,7 @@ const ATTRIBUTION_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const EX_GEOGRAPHIC_BOUNDING_BOX_PARSERS =
|
const EX_GEOGRAPHIC_BOUNDING_BOX_PARSERS =
|
||||||
makeStructureNS(NAMESPACE_URIS, {
|
makeStructureNS(NAMESPACE_URIS, {
|
||||||
@@ -207,7 +207,7 @@ const EX_GEOGRAPHIC_BOUNDING_BOX_PARSERS =
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const REQUEST_PARSERS = makeStructureNS(
|
const REQUEST_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -219,7 +219,7 @@ const REQUEST_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const OPERATIONTYPE_PARSERS = makeStructureNS(
|
const OPERATIONTYPE_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -230,7 +230,7 @@ const OPERATIONTYPE_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const DCPTYPE_PARSERS = makeStructureNS(
|
const DCPTYPE_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -240,7 +240,7 @@ const DCPTYPE_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const HTTP_PARSERS = makeStructureNS(
|
const HTTP_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -251,7 +251,7 @@ const HTTP_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const STYLE_PARSERS = makeStructureNS(
|
const STYLE_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -266,7 +266,7 @@ const STYLE_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const FORMAT_ONLINERESOURCE_PARSERS =
|
const FORMAT_ONLINERESOURCE_PARSERS =
|
||||||
makeStructureNS(NAMESPACE_URIS, {
|
makeStructureNS(NAMESPACE_URIS, {
|
||||||
@@ -277,7 +277,7 @@ const FORMAT_ONLINERESOURCE_PARSERS =
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const KEYWORDLIST_PARSERS = makeStructureNS(
|
const KEYWORDLIST_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -287,7 +287,7 @@ const KEYWORDLIST_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Attribution object.
|
* @return {Object|undefined} Attribution object.
|
||||||
*/
|
*/
|
||||||
function readAttribution(node, objectStack) {
|
function readAttribution(node, objectStack) {
|
||||||
@@ -297,7 +297,7 @@ function readAttribution(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object} Bounding box object.
|
* @return {Object} Bounding box object.
|
||||||
*/
|
*/
|
||||||
function readBoundingBox(node, objectStack) {
|
function readBoundingBox(node, objectStack) {
|
||||||
@@ -323,7 +323,7 @@ function readBoundingBox(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {module:ol/extent~Extent|undefined} Bounding box object.
|
* @return {module:ol/extent~Extent|undefined} Bounding box object.
|
||||||
*/
|
*/
|
||||||
function readEXGeographicBoundingBox(node, objectStack) {
|
function readEXGeographicBoundingBox(node, objectStack) {
|
||||||
@@ -355,7 +355,7 @@ function readEXGeographicBoundingBox(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Capability object.
|
* @return {Object|undefined} Capability object.
|
||||||
*/
|
*/
|
||||||
function readCapability(node, objectStack) {
|
function readCapability(node, objectStack) {
|
||||||
@@ -365,7 +365,7 @@ function readCapability(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Service object.
|
* @return {Object|undefined} Service object.
|
||||||
*/
|
*/
|
||||||
function readService(node, objectStack) {
|
function readService(node, objectStack) {
|
||||||
@@ -375,7 +375,7 @@ function readService(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Contact information object.
|
* @return {Object|undefined} Contact information object.
|
||||||
*/
|
*/
|
||||||
function readContactInformation(node, objectStack) {
|
function readContactInformation(node, objectStack) {
|
||||||
@@ -385,7 +385,7 @@ function readContactInformation(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Contact person object.
|
* @return {Object|undefined} Contact person object.
|
||||||
*/
|
*/
|
||||||
function readContactPersonPrimary(node, objectStack) {
|
function readContactPersonPrimary(node, objectStack) {
|
||||||
@@ -395,7 +395,7 @@ function readContactPersonPrimary(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Contact address object.
|
* @return {Object|undefined} Contact address object.
|
||||||
*/
|
*/
|
||||||
function readContactAddress(node, objectStack) {
|
function readContactAddress(node, objectStack) {
|
||||||
@@ -405,8 +405,8 @@ function readContactAddress(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Array.<string>|undefined} Format array.
|
* @return {Array<string>|undefined} Format array.
|
||||||
*/
|
*/
|
||||||
function readException(node, objectStack) {
|
function readException(node, objectStack) {
|
||||||
return pushParseAndPop([], EXCEPTION_PARSERS, node, objectStack);
|
return pushParseAndPop([], EXCEPTION_PARSERS, node, objectStack);
|
||||||
@@ -415,7 +415,7 @@ function readException(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Layer object.
|
* @return {Object|undefined} Layer object.
|
||||||
*/
|
*/
|
||||||
function readCapabilityLayer(node, objectStack) {
|
function readCapabilityLayer(node, objectStack) {
|
||||||
@@ -425,11 +425,11 @@ function readCapabilityLayer(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Layer object.
|
* @return {Object|undefined} Layer object.
|
||||||
*/
|
*/
|
||||||
function readLayer(node, objectStack) {
|
function readLayer(node, objectStack) {
|
||||||
const parentLayerObject = /** @type {!Object.<string,*>} */ (objectStack[objectStack.length - 1]);
|
const parentLayerObject = /** @type {!Object<string,*>} */ (objectStack[objectStack.length - 1]);
|
||||||
|
|
||||||
const layerObject = pushParseAndPop({}, LAYER_PARSERS, node, objectStack);
|
const layerObject = pushParseAndPop({}, LAYER_PARSERS, node, objectStack);
|
||||||
|
|
||||||
@@ -497,7 +497,7 @@ function readLayer(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object} Dimension object.
|
* @return {Object} Dimension object.
|
||||||
*/
|
*/
|
||||||
function readDimension(node, objectStack) {
|
function readDimension(node, objectStack) {
|
||||||
@@ -517,7 +517,7 @@ function readDimension(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Online resource object.
|
* @return {Object|undefined} Online resource object.
|
||||||
*/
|
*/
|
||||||
function readFormatOnlineresource(node, objectStack) {
|
function readFormatOnlineresource(node, objectStack) {
|
||||||
@@ -527,7 +527,7 @@ function readFormatOnlineresource(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Request object.
|
* @return {Object|undefined} Request object.
|
||||||
*/
|
*/
|
||||||
function readRequest(node, objectStack) {
|
function readRequest(node, objectStack) {
|
||||||
@@ -537,7 +537,7 @@ function readRequest(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} DCP type object.
|
* @return {Object|undefined} DCP type object.
|
||||||
*/
|
*/
|
||||||
function readDCPType(node, objectStack) {
|
function readDCPType(node, objectStack) {
|
||||||
@@ -547,7 +547,7 @@ function readDCPType(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} HTTP object.
|
* @return {Object|undefined} HTTP object.
|
||||||
*/
|
*/
|
||||||
function readHTTP(node, objectStack) {
|
function readHTTP(node, objectStack) {
|
||||||
@@ -557,7 +557,7 @@ function readHTTP(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Operation type object.
|
* @return {Object|undefined} Operation type object.
|
||||||
*/
|
*/
|
||||||
function readOperationType(node, objectStack) {
|
function readOperationType(node, objectStack) {
|
||||||
@@ -567,7 +567,7 @@ function readOperationType(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Online resource object.
|
* @return {Object|undefined} Online resource object.
|
||||||
*/
|
*/
|
||||||
function readSizedFormatOnlineresource(node, objectStack) {
|
function readSizedFormatOnlineresource(node, objectStack) {
|
||||||
@@ -586,7 +586,7 @@ function readSizedFormatOnlineresource(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Authority URL object.
|
* @return {Object|undefined} Authority URL object.
|
||||||
*/
|
*/
|
||||||
function readAuthorityURL(node, objectStack) {
|
function readAuthorityURL(node, objectStack) {
|
||||||
@@ -601,7 +601,7 @@ function readAuthorityURL(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Metadata URL object.
|
* @return {Object|undefined} Metadata URL object.
|
||||||
*/
|
*/
|
||||||
function readMetadataURL(node, objectStack) {
|
function readMetadataURL(node, objectStack) {
|
||||||
@@ -616,7 +616,7 @@ function readMetadataURL(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Style object.
|
* @return {Object|undefined} Style object.
|
||||||
*/
|
*/
|
||||||
function readStyle(node, objectStack) {
|
function readStyle(node, objectStack) {
|
||||||
@@ -626,8 +626,8 @@ function readStyle(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Array.<string>|undefined} Keyword list.
|
* @return {Array<string>|undefined} Keyword list.
|
||||||
*/
|
*/
|
||||||
function readKeywordList(node, objectStack) {
|
function readKeywordList(node, objectStack) {
|
||||||
return pushParseAndPop([], KEYWORDLIST_PARSERS, node, objectStack);
|
return pushParseAndPop([], KEYWORDLIST_PARSERS, node, objectStack);
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {makeArrayPusher, makeStructureNS, pushParseAndPop} from '../xml.js';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} Options
|
* @typedef {Object} Options
|
||||||
* @property {Array.<string>} [layers] If set, only features of the given layers will be returned by the format when read.
|
* @property {Array<string>} [layers] If set, only features of the given layers will be returned by the format when read.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -61,20 +61,20 @@ class WMSGetFeatureInfo extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {Array.<string>}
|
* @type {Array<string>}
|
||||||
*/
|
*/
|
||||||
this.layers_ = options.layers ? options.layers : null;
|
this.layers_ = options.layers ? options.layers : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {Array.<string>} layers
|
* @return {Array<string>} layers
|
||||||
*/
|
*/
|
||||||
getLayers() {
|
getLayers() {
|
||||||
return this.layers_;
|
return this.layers_;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array.<string>} layers Layers to parse.
|
* @param {Array<string>} layers Layers to parse.
|
||||||
*/
|
*/
|
||||||
setLayers(layers) {
|
setLayers(layers) {
|
||||||
this.layers_ = layers;
|
this.layers_ = layers;
|
||||||
@@ -82,14 +82,14 @@ class WMSGetFeatureInfo extends XMLFeature {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Array.<module:ol/Feature>} Features.
|
* @return {Array<module:ol/Feature>} Features.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
readFeatures_(node, objectStack) {
|
readFeatures_(node, objectStack) {
|
||||||
node.setAttribute('namespaceURI', this.featureNS_);
|
node.setAttribute('namespaceURI', this.featureNS_);
|
||||||
const localName = node.localName;
|
const localName = node.localName;
|
||||||
/** @type {Array.<module:ol/Feature>} */
|
/** @type {Array<module:ol/Feature>} */
|
||||||
let features = [];
|
let features = [];
|
||||||
if (node.childNodes.length === 0) {
|
if (node.childNodes.length === 0) {
|
||||||
return features;
|
return features;
|
||||||
@@ -150,23 +150,6 @@ class WMSGetFeatureInfo extends XMLFeature {
|
|||||||
return this.readFeatures_(node, [options]);
|
return this.readFeatures_(node, [options]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Not implemented.
|
|
||||||
* @inheritDoc
|
|
||||||
*/
|
|
||||||
writeFeatureNode(feature, opt_options) {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Not implemented.
|
|
||||||
* @inheritDoc
|
|
||||||
*/
|
|
||||||
writeFeaturesNode(features, opt_options) {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Not implemented.
|
|
||||||
* @inheritDoc
|
|
||||||
*/
|
|
||||||
writeGeometryNode(geometry, opt_options) {}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import {pushParseAndPop, makeStructureNS,
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Array.<null|string>}
|
* @type {Array<null|string>}
|
||||||
*/
|
*/
|
||||||
const NAMESPACE_URIS = [
|
const NAMESPACE_URIS = [
|
||||||
null,
|
null,
|
||||||
@@ -22,7 +22,7 @@ const NAMESPACE_URIS = [
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Array.<null|string>}
|
* @type {Array<null|string>}
|
||||||
*/
|
*/
|
||||||
const OWS_NAMESPACE_URIS = [
|
const OWS_NAMESPACE_URIS = [
|
||||||
null,
|
null,
|
||||||
@@ -32,7 +32,7 @@ const OWS_NAMESPACE_URIS = [
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const PARSERS = makeStructureNS(
|
const PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -87,7 +87,7 @@ class WMTSCapabilities extends XML {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const CONTENTS_PARSERS = makeStructureNS(
|
const CONTENTS_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -98,7 +98,7 @@ const CONTENTS_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const LAYER_PARSERS = makeStructureNS(
|
const LAYER_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -117,7 +117,7 @@ const LAYER_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const STYLE_PARSERS = makeStructureNS(
|
const STYLE_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -130,7 +130,7 @@ const STYLE_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const TMS_LINKS_PARSERS = makeStructureNS(
|
const TMS_LINKS_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -140,7 +140,7 @@ const TMS_LINKS_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const TMS_LIMITS_LIST_PARSERS = makeStructureNS(
|
const TMS_LIMITS_LIST_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -150,7 +150,7 @@ const TMS_LIMITS_LIST_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const TMS_LIMITS_PARSERS = makeStructureNS(
|
const TMS_LIMITS_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -164,7 +164,7 @@ const TMS_LIMITS_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const DIMENSION_PARSERS = makeStructureNS(
|
const DIMENSION_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -177,7 +177,7 @@ const DIMENSION_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const WGS84_BBOX_READERS = makeStructureNS(
|
const WGS84_BBOX_READERS = makeStructureNS(
|
||||||
OWS_NAMESPACE_URIS, {
|
OWS_NAMESPACE_URIS, {
|
||||||
@@ -188,7 +188,7 @@ const WGS84_BBOX_READERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const TMS_PARSERS = makeStructureNS(
|
const TMS_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -202,7 +202,7 @@ const TMS_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @const
|
* @const
|
||||||
* @type {Object.<string, Object.<string, module:ol/xml~Parser>>}
|
* @type {Object<string, Object<string, module:ol/xml~Parser>>}
|
||||||
*/
|
*/
|
||||||
const TM_PARSERS = makeStructureNS(
|
const TM_PARSERS = makeStructureNS(
|
||||||
NAMESPACE_URIS, {
|
NAMESPACE_URIS, {
|
||||||
@@ -219,7 +219,7 @@ const TM_PARSERS = makeStructureNS(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Attribution object.
|
* @return {Object|undefined} Attribution object.
|
||||||
*/
|
*/
|
||||||
function readContents(node, objectStack) {
|
function readContents(node, objectStack) {
|
||||||
@@ -229,7 +229,7 @@ function readContents(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Layers object.
|
* @return {Object|undefined} Layers object.
|
||||||
*/
|
*/
|
||||||
function readLayer(node, objectStack) {
|
function readLayer(node, objectStack) {
|
||||||
@@ -239,7 +239,7 @@ function readLayer(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Tile Matrix Set object.
|
* @return {Object|undefined} Tile Matrix Set object.
|
||||||
*/
|
*/
|
||||||
function readTileMatrixSet(node, objectStack) {
|
function readTileMatrixSet(node, objectStack) {
|
||||||
@@ -249,7 +249,7 @@ function readTileMatrixSet(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Style object.
|
* @return {Object|undefined} Style object.
|
||||||
*/
|
*/
|
||||||
function readStyle(node, objectStack) {
|
function readStyle(node, objectStack) {
|
||||||
@@ -266,7 +266,7 @@ function readStyle(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Tile Matrix Set Link object.
|
* @return {Object|undefined} Tile Matrix Set Link object.
|
||||||
*/
|
*/
|
||||||
function readTileMatrixSetLink(node, objectStack) {
|
function readTileMatrixSetLink(node, objectStack) {
|
||||||
@@ -276,7 +276,7 @@ function readTileMatrixSetLink(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Dimension object.
|
* @return {Object|undefined} Dimension object.
|
||||||
*/
|
*/
|
||||||
function readDimensions(node, objectStack) {
|
function readDimensions(node, objectStack) {
|
||||||
@@ -286,7 +286,7 @@ function readDimensions(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Resource URL object.
|
* @return {Object|undefined} Resource URL object.
|
||||||
*/
|
*/
|
||||||
function readResourceUrl(node, objectStack) {
|
function readResourceUrl(node, objectStack) {
|
||||||
@@ -309,7 +309,7 @@ function readResourceUrl(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} WGS84 BBox object.
|
* @return {Object|undefined} WGS84 BBox object.
|
||||||
*/
|
*/
|
||||||
function readWgs84BoundingBox(node, objectStack) {
|
function readWgs84BoundingBox(node, objectStack) {
|
||||||
@@ -323,7 +323,7 @@ function readWgs84BoundingBox(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Legend object.
|
* @return {Object|undefined} Legend object.
|
||||||
*/
|
*/
|
||||||
function readLegendUrl(node, objectStack) {
|
function readLegendUrl(node, objectStack) {
|
||||||
@@ -336,11 +336,11 @@ function readLegendUrl(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} Coordinates object.
|
* @return {Object|undefined} Coordinates object.
|
||||||
*/
|
*/
|
||||||
function readCoordinates(node, objectStack) {
|
function readCoordinates(node, objectStack) {
|
||||||
const coordinates = readString(node).split(' ');
|
const coordinates = readString(node).split(/\s+/);
|
||||||
if (!coordinates || coordinates.length != 2) {
|
if (!coordinates || coordinates.length != 2) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
@@ -355,7 +355,7 @@ function readCoordinates(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} TileMatrix object.
|
* @return {Object|undefined} TileMatrix object.
|
||||||
*/
|
*/
|
||||||
function readTileMatrix(node, objectStack) {
|
function readTileMatrix(node, objectStack) {
|
||||||
@@ -365,7 +365,7 @@ function readTileMatrix(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} TileMatrixSetLimits Object.
|
* @return {Object|undefined} TileMatrixSetLimits Object.
|
||||||
*/
|
*/
|
||||||
function readTileMatrixLimitsList(node, objectStack) {
|
function readTileMatrixLimitsList(node, objectStack) {
|
||||||
@@ -375,7 +375,7 @@ function readTileMatrixLimitsList(node, objectStack) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {Array.<*>} objectStack Object stack.
|
* @param {Array<*>} objectStack Object stack.
|
||||||
* @return {Object|undefined} TileMatrixLimits Array.
|
* @return {Object|undefined} TileMatrixLimits Array.
|
||||||
*/
|
*/
|
||||||
function readTileMatrixLimits(node, objectStack) {
|
function readTileMatrixLimits(node, objectStack) {
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ class XMLFeature extends FeatureFormat {
|
|||||||
* @function
|
* @function
|
||||||
* @param {Document|Node|Object|string} source Source.
|
* @param {Document|Node|Object|string} source Source.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Options.
|
* @param {module:ol/format/Feature~ReadOptions=} opt_options Options.
|
||||||
* @return {Array.<module:ol/Feature>} Features.
|
* @return {Array<module:ol/Feature>} Features.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
readFeatures(source, opt_options) {
|
readFeatures(source, opt_options) {
|
||||||
@@ -103,10 +103,10 @@ class XMLFeature extends FeatureFormat {
|
|||||||
* @param {Document} doc Document.
|
* @param {Document} doc Document.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Options.
|
* @param {module:ol/format/Feature~ReadOptions=} opt_options Options.
|
||||||
* @protected
|
* @protected
|
||||||
* @return {Array.<module:ol/Feature>} Features.
|
* @return {Array<module:ol/Feature>} Features.
|
||||||
*/
|
*/
|
||||||
readFeaturesFromDocument(doc, opt_options) {
|
readFeaturesFromDocument(doc, opt_options) {
|
||||||
/** @type {Array.<module:ol/Feature>} */
|
/** @type {Array<module:ol/Feature>} */
|
||||||
const features = [];
|
const features = [];
|
||||||
for (let n = doc.firstChild; n; n = n.nextSibling) {
|
for (let n = doc.firstChild; n; n = n.nextSibling) {
|
||||||
if (n.nodeType == Node.ELEMENT_NODE) {
|
if (n.nodeType == Node.ELEMENT_NODE) {
|
||||||
@@ -121,7 +121,7 @@ class XMLFeature extends FeatureFormat {
|
|||||||
* @param {Node} node Node.
|
* @param {Node} node Node.
|
||||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Options.
|
* @param {module:ol/format/Feature~ReadOptions=} opt_options Options.
|
||||||
* @protected
|
* @protected
|
||||||
* @return {Array.<module:ol/Feature>} Features.
|
* @return {Array<module:ol/Feature>} Features.
|
||||||
*/
|
*/
|
||||||
readFeaturesFromNode(node, opt_options) {}
|
readFeaturesFromNode(node, opt_options) {}
|
||||||
|
|
||||||
@@ -221,7 +221,7 @@ class XMLFeature extends FeatureFormat {
|
|||||||
/**
|
/**
|
||||||
* Encode an array of features as string.
|
* Encode an array of features as string.
|
||||||
*
|
*
|
||||||
* @param {Array.<module:ol/Feature>} features Features.
|
* @param {Array<module:ol/Feature>} features Features.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||||
* @return {string} Result.
|
* @return {string} Result.
|
||||||
* @api
|
* @api
|
||||||
@@ -232,7 +232,7 @@ class XMLFeature extends FeatureFormat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array.<module:ol/Feature>} features Features.
|
* @param {Array<module:ol/Feature>} features Features.
|
||||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
* @param {module:ol/format/Feature~WriteOptions=} opt_options Options.
|
||||||
* @return {Node} Node.
|
* @return {Node} Node.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import Spatial from '../filter/Spatial.js';
|
|||||||
* @classdesc
|
* @classdesc
|
||||||
* Represents a `<Contains>` operator to test whether a geometry-valued property
|
* Represents a `<Contains>` operator to test whether a geometry-valued property
|
||||||
* contains a given geometry.
|
* contains a given geometry.
|
||||||
|
* @api
|
||||||
*/
|
*/
|
||||||
class Contains extends Spatial {
|
class Contains extends Spatial {
|
||||||
|
|
||||||
@@ -15,7 +16,6 @@ class Contains extends Spatial {
|
|||||||
* @param {!module:ol/geom/Geometry} geometry Geometry.
|
* @param {!module:ol/geom/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.
|
||||||
* @api
|
|
||||||
*/
|
*/
|
||||||
constructor(geometryName, geometry, opt_srsName) {
|
constructor(geometryName, geometry, opt_srsName) {
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import Comparison from '../filter/Comparison.js';
|
|||||||
/**
|
/**
|
||||||
* @classdesc
|
* @classdesc
|
||||||
* Represents a `<During>` comparison operator.
|
* Represents a `<During>` comparison operator.
|
||||||
|
* @api
|
||||||
*/
|
*/
|
||||||
class During extends Comparison {
|
class During extends Comparison {
|
||||||
|
|
||||||
@@ -13,7 +14,6 @@ class During extends Comparison {
|
|||||||
* @param {!string} propertyName Name of the context property to compare.
|
* @param {!string} propertyName Name of the context property to compare.
|
||||||
* @param {!string} begin The begin date in ISO-8601 format.
|
* @param {!string} begin The begin date in ISO-8601 format.
|
||||||
* @param {!string} end The end date in ISO-8601 format.
|
* @param {!string} end The end date in ISO-8601 format.
|
||||||
* @api
|
|
||||||
*/
|
*/
|
||||||
constructor(propertyName, begin, end) {
|
constructor(propertyName, begin, end) {
|
||||||
super('During', propertyName);
|
super('During', propertyName);
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import ComparisonBinary from '../filter/ComparisonBinary.js';
|
|||||||
/**
|
/**
|
||||||
* @classdesc
|
* @classdesc
|
||||||
* Represents a `<PropertyIsEqualTo>` comparison operator.
|
* Represents a `<PropertyIsEqualTo>` comparison operator.
|
||||||
|
* @api
|
||||||
*/
|
*/
|
||||||
class EqualTo extends ComparisonBinary {
|
class EqualTo extends ComparisonBinary {
|
||||||
|
|
||||||
@@ -13,7 +14,6 @@ class EqualTo extends ComparisonBinary {
|
|||||||
* @param {!string} propertyName Name of the context property to compare.
|
* @param {!string} propertyName Name of the context property to compare.
|
||||||
* @param {!(string|number)} expression The value to compare.
|
* @param {!(string|number)} expression The value to compare.
|
||||||
* @param {boolean=} opt_matchCase Case-sensitive?
|
* @param {boolean=} opt_matchCase Case-sensitive?
|
||||||
* @api
|
|
||||||
*/
|
*/
|
||||||
constructor(propertyName, expression, opt_matchCase) {
|
constructor(propertyName, expression, opt_matchCase) {
|
||||||
super('PropertyIsEqualTo', propertyName, expression, opt_matchCase);
|
super('PropertyIsEqualTo', propertyName, expression, opt_matchCase);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user