Compare commits

...

212 Commits

Author SHA1 Message Date
Tim Schaub
f86bad7459 Updates for 6.9.0 2021-10-12 13:47:14 -06:00
Tim Schaub
2e531377e2 Merge pull request #12813 from mike-000/fix-zero-size
Do not replace icon color if image not loaded
2021-10-12 13:33:34 -06:00
Tim Schaub
deb523f6f5 Merge pull request #12870 from ahocevar/legacy-publicpath
Fix publicPath problem in legacy build
2021-10-12 13:30:33 -06:00
Tim Schaub
4718ec500b Merge pull request #12889 from tschaub/updates
Simplified ESLint config
2021-10-12 13:29:08 -06:00
Tim Schaub
5b4c682f2a Merge pull request #12875 from tschaub/raster-loop
Only trigger change event if animating a tile transition
2021-10-12 13:27:53 -06:00
Tim Schaub
9224678627 Simplified ESLint config 2021-10-12 09:03:53 -06:00
Tim Schaub
df7a911687 Merge pull request #12885 from MatthijsBon/master
Fix typeDefs for several Control modules
2021-10-12 08:23:45 -06:00
Matthijs Bon
72cb135aff Update typeDefs for labelActive
Add description that 'span' element can be used and add HTMLElement as type
2021-10-12 11:29:35 +02:00
Tim Schaub
5293efc6e2 Merge pull request #12881 from openlayers/dependabot/npm_and_yarn/webpack-5.58.1
Bump webpack from 5.56.1 to 5.58.1
2021-10-11 08:05:20 -06:00
Matthijs Bon
4cbf04d029 Update typeDefs for Fullscreen Options
Remove line stating that a 'span' is also a valid inactiveClassName value.
2021-10-11 14:48:04 +02:00
dependabot[bot]
bc04e96556 Bump webpack from 5.56.1 to 5.58.1
Bumps [webpack](https://github.com/webpack/webpack) from 5.56.1 to 5.58.1.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.56.1...v5.58.1)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-11 12:44:38 +00:00
Tim Schaub
6a03e1c34f Merge pull request #12882 from openlayers/dependabot/npm_and_yarn/marked-3.0.7
Bump marked from 3.0.4 to 3.0.7
2021-10-11 06:40:27 -06:00
Tim Schaub
f7efb60843 Merge pull request #12878 from openlayers/dependabot/npm_and_yarn/webpack-dev-server-4.3.1
Bump webpack-dev-server from 4.3.0 to 4.3.1
2021-10-11 06:39:23 -06:00
Tim Schaub
9ee1768a1d Merge pull request #12879 from openlayers/dependabot/npm_and_yarn/babel/preset-env-7.15.8
Bump @babel/preset-env from 7.15.6 to 7.15.8
2021-10-11 06:38:51 -06:00
Tim Schaub
4e5a7fba77 Merge pull request #12880 from openlayers/dependabot/npm_and_yarn/babel/eslint-parser-7.15.8
Bump @babel/eslint-parser from 7.15.7 to 7.15.8
2021-10-11 06:38:13 -06:00
Tim Schaub
f26130ee54 Merge pull request #12884 from openlayers/dependabot/npm_and_yarn/babel/core-7.15.8
Bump @babel/core from 7.15.5 to 7.15.8
2021-10-11 06:36:16 -06:00
Tim Schaub
cb6a00e13a Merge pull request #12877 from openlayers/dependabot/npm_and_yarn/webpack-cli-4.9.0
Bump webpack-cli from 4.8.0 to 4.9.0
2021-10-11 06:34:49 -06:00
dependabot[bot]
60c259df02 Bump @babel/core from 7.15.5 to 7.15.8
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.15.5 to 7.15.8.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.15.8/packages/babel-core)

---
updated-dependencies:
- dependency-name: "@babel/core"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-11 10:03:15 +00:00
dependabot[bot]
aa110486a1 Bump marked from 3.0.4 to 3.0.7
Bumps [marked](https://github.com/markedjs/marked) from 3.0.4 to 3.0.7.
- [Release notes](https://github.com/markedjs/marked/releases)
- [Changelog](https://github.com/markedjs/marked/blob/master/release.config.js)
- [Commits](https://github.com/markedjs/marked/compare/v3.0.4...v3.0.7)

---
updated-dependencies:
- dependency-name: marked
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-11 10:02:29 +00:00
dependabot[bot]
33bffbcdad Bump @babel/eslint-parser from 7.15.7 to 7.15.8
Bumps [@babel/eslint-parser](https://github.com/babel/babel/tree/HEAD/eslint/babel-eslint-parser) from 7.15.7 to 7.15.8.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.15.8/eslint/babel-eslint-parser)

---
updated-dependencies:
- dependency-name: "@babel/eslint-parser"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-11 10:01:54 +00:00
dependabot[bot]
c4e10a34c8 Bump @babel/preset-env from 7.15.6 to 7.15.8
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.15.6 to 7.15.8.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.15.8/packages/babel-preset-env)

---
updated-dependencies:
- dependency-name: "@babel/preset-env"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-11 10:01:41 +00:00
dependabot[bot]
c1be8cf618 Bump webpack-dev-server from 4.3.0 to 4.3.1
Bumps [webpack-dev-server](https://github.com/webpack/webpack-dev-server) from 4.3.0 to 4.3.1.
- [Release notes](https://github.com/webpack/webpack-dev-server/releases)
- [Changelog](https://github.com/webpack/webpack-dev-server/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-dev-server/compare/v4.3.0...v4.3.1)

---
updated-dependencies:
- dependency-name: webpack-dev-server
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-11 10:01:22 +00:00
dependabot[bot]
1872b56355 Bump webpack-cli from 4.8.0 to 4.9.0
Bumps [webpack-cli](https://github.com/webpack/webpack-cli) from 4.8.0 to 4.9.0.
- [Release notes](https://github.com/webpack/webpack-cli/releases)
- [Changelog](https://github.com/webpack/webpack-cli/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-cli/compare/webpack-cli@4.8.0...webpack-cli@4.9.0)

---
updated-dependencies:
- dependency-name: webpack-cli
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-11 10:01:10 +00:00
Matthijs Bon
6bc8d0cd96 Fix typeDef for label
Allow string, Text and HTMLElement, instead of only string and HTMLElement
2021-10-11 10:11:44 +02:00
Matthijs Bon
d4bc7d3f39 Update typeDefs for Attribution and Control
For consistency with docs, update type for labels to {string|HTMLElement}
2021-10-11 10:05:47 +02:00
Tim Schaub
60790fea18 Only trigger change event if animating a tile transition 2021-10-10 13:03:09 -06:00
Andreas Hocevar
77ca0c2de5 Fix publicPath problem in legacy build 2021-10-08 11:11:00 +02:00
Andreas Hocevar
c0009d5985 Merge pull request #12861 from ahocevar/geotiff
Update geotiff to 1.0.8; allow version range
2021-10-06 19:32:25 +02:00
Tim Schaub
c85a6016c4 Merge pull request #12865 from tschaub/doc-update
Add a note about installing git before using create-ol-app
2021-10-06 10:45:55 -06:00
Tim Schaub
d5a27dae4f Add a note about installing git before using create-ol-app 2021-10-06 09:01:20 -06:00
Andreas Hocevar
0186ca74f1 Update geotiff to 1.0.8; allow version range 2021-10-06 13:23:47 +02:00
Andreas Hocevar
9834f683b9 Merge pull request #12854 from openlayers/dependabot/npm_and_yarn/webpack-5.56.1
Bump webpack from 5.54.0 to 5.56.1
2021-10-04 13:04:02 +02:00
dependabot[bot]
4f5e59d7f0 Bump webpack from 5.54.0 to 5.56.1
Bumps [webpack](https://github.com/webpack/webpack) from 5.54.0 to 5.56.1.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.54.0...v5.56.1)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-04 10:58:17 +00:00
Andreas Hocevar
940011fb56 Merge pull request #12857 from openlayers/dependabot/npm_and_yarn/webpack-dev-server-4.3.0
Bump webpack-dev-server from 4.2.1 to 4.3.0
2021-10-04 12:57:29 +02:00
Andreas Hocevar
974fdebafa Merge pull request #12856 from openlayers/dependabot/npm_and_yarn/rollup/plugin-commonjs-21.0.0
Bump @rollup/plugin-commonjs from 20.0.0 to 21.0.0
2021-10-04 12:55:43 +02:00
Andreas Hocevar
fb0550ea5c Merge pull request #12855 from openlayers/dependabot/npm_and_yarn/rollup-2.58.0
Bump rollup from 2.57.0 to 2.58.0
2021-10-04 12:55:10 +02:00
Andreas Hocevar
b55f8e8f40 Merge pull request #12853 from openlayers/dependabot/npm_and_yarn/clean-css-cli-5.4.1
Bump clean-css-cli from 5.3.3 to 5.4.1
2021-10-04 12:52:38 +02:00
dependabot[bot]
d8d4f21437 Bump webpack-dev-server from 4.2.1 to 4.3.0
Bumps [webpack-dev-server](https://github.com/webpack/webpack-dev-server) from 4.2.1 to 4.3.0.
- [Release notes](https://github.com/webpack/webpack-dev-server/releases)
- [Changelog](https://github.com/webpack/webpack-dev-server/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-dev-server/compare/v4.2.1...v4.3.0)

---
updated-dependencies:
- dependency-name: webpack-dev-server
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-04 10:02:17 +00:00
dependabot[bot]
7c556951c8 Bump @rollup/plugin-commonjs from 20.0.0 to 21.0.0
Bumps [@rollup/plugin-commonjs](https://github.com/rollup/plugins/tree/HEAD/packages/commonjs) from 20.0.0 to 21.0.0.
- [Release notes](https://github.com/rollup/plugins/releases)
- [Changelog](https://github.com/rollup/plugins/blob/master/packages/commonjs/CHANGELOG.md)
- [Commits](https://github.com/rollup/plugins/commits/commonjs-v21.0.0/packages/commonjs)

---
updated-dependencies:
- dependency-name: "@rollup/plugin-commonjs"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-04 10:01:58 +00:00
dependabot[bot]
b15de51344 Bump rollup from 2.57.0 to 2.58.0
Bumps [rollup](https://github.com/rollup/rollup) from 2.57.0 to 2.58.0.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v2.57.0...v2.58.0)

---
updated-dependencies:
- dependency-name: rollup
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-04 10:01:43 +00:00
dependabot[bot]
4822589e26 Bump clean-css-cli from 5.3.3 to 5.4.1
Bumps [clean-css-cli](https://github.com/clean-css/clean-css-cli) from 5.3.3 to 5.4.1.
- [Release notes](https://github.com/clean-css/clean-css-cli/releases)
- [Changelog](https://github.com/clean-css/clean-css-cli/blob/master/History.md)
- [Commits](https://github.com/clean-css/clean-css-cli/compare/v5.3.3...v5.4.1)

---
updated-dependencies:
- dependency-name: clean-css-cli
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-04 10:01:07 +00:00
Tim Schaub
00e880f534 Merge pull request #12847 from tschaub/geotiff-types
Add more definitions for GeoTIFF types
2021-10-03 13:51:10 -06:00
MoonE
f4c2cbdb9b Merge pull request #12850 from MoonE/view-not-def-animation-fix
Fix issues with animate on View without center or resolution
2021-10-03 19:57:26 +02:00
Maximilian Krög
1be2c459c4 Fix end state for animation on view with invalid state 2021-10-03 00:22:18 +02:00
Maximilian Krög
84729e985f Add test for animation on view with invalid state 2021-10-03 00:19:05 +02:00
Tim Schaub
6506efab0c Add more definitions for GeoTIFF types 2021-10-01 17:06:13 -06:00
Tim Schaub
243b21a2e1 Merge pull request #12846 from tschaub/extract-fill-values
Use nodata values in the GeoTIFF headers for fill value
2021-10-01 13:54:07 -06:00
Tim Schaub
9d709cb3d9 Additional documentation on the nodata property 2021-10-01 13:48:35 -06:00
Tim Schaub
ba444117bb Use nodata values in the GeoTIFF headers for fill value 2021-10-01 11:47:27 -06:00
Tim Schaub
78a4efab8c Merge pull request #12837 from mike-000/getDataAtPixel
forEachLayerAtPixel return null for unsupported layer types
2021-09-30 04:13:36 -06:00
mike-000
54871b6c52 return null for unsupported layer types 2021-09-30 10:32:48 +01:00
Tim Schaub
709139c657 Merge pull request #12836 from tschaub/denormalized
Support a normalize option on the GeoTIFF source
2021-09-29 15:57:27 -06:00
MoonE
9e37182649 Merge pull request #12646 from ashchurova/fix-8136-hit-detection-custom-renderer
Support for hit detection in styles with custom rendering
2021-09-29 20:22:57 +02:00
Tim Schaub
d7b0191c78 Support a normalize option on the GeoTIFF source 2021-09-29 10:25:22 -06:00
MoonE
5f118b0244 Merge pull request #12831 from MoonE/fix-emptied-vectorimage
Fix rendering VectorImage with no features in view extent
2021-09-28 23:28:00 +02:00
Andreas Hocevar
e74d15659f Merge pull request #12830 from ejn/bugfix/overviewmap-layers-type
bugfix: Fix type of `layers` option in `OverviewMap`
2021-09-28 11:43:09 +02:00
Maximilian Krög
1942f3f91b Fix rendering VectorImage with no features in view extent 2021-09-27 23:04:58 +02:00
Maximilian Krög
2d3d6cae31 Test VectorImage rendering view extent with no features 2021-09-27 23:04:55 +02:00
Tim Schaub
f2f5a51455 Merge pull request #12822 from openlayers/dependabot/npm_and_yarn/glob-7.2.0
Bump glob from 7.1.7 to 7.2.0
2021-09-27 11:09:29 -06:00
Tim Schaub
1c4bcd7ceb Merge pull request #12824 from openlayers/dependabot/npm_and_yarn/rollup-2.57.0
Bump rollup from 2.56.3 to 2.57.0
2021-09-27 11:09:05 -06:00
Tim Schaub
fd178c71e6 Merge pull request #12818 from openlayers/dependabot/npm_and_yarn/threads-1.7.0
Bump threads from 1.6.5 to 1.7.0
2021-09-27 10:47:17 -06:00
dependabot[bot]
aee95cf690 Bump rollup from 2.56.3 to 2.57.0
Bumps [rollup](https://github.com/rollup/rollup) from 2.56.3 to 2.57.0.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v2.56.3...v2.57.0)

---
updated-dependencies:
- dependency-name: rollup
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-27 16:44:18 +00:00
Tim Schaub
a32dc03a78 Merge pull request #12821 from openlayers/dependabot/npm_and_yarn/rollup/plugin-node-resolve-13.0.5
Bump @rollup/plugin-node-resolve from 13.0.4 to 13.0.5
2021-09-27 10:43:25 -06:00
Tim Schaub
17b8e80f0a Merge pull request #12823 from openlayers/dependabot/npm_and_yarn/walk-2.3.15
Bump walk from 2.3.14 to 2.3.15
2021-09-27 10:42:58 -06:00
Tim Schaub
b3c417d1c2 Merge pull request #12819 from openlayers/dependabot/npm_and_yarn/webpack-dev-middleware-5.2.1
Bump webpack-dev-middleware from 5.1.0 to 5.2.1
2021-09-27 10:42:02 -06:00
Tim Schaub
06884c1f35 Merge pull request #12820 from openlayers/dependabot/npm_and_yarn/mocha-9.1.2
Bump mocha from 9.1.1 to 9.1.2
2021-09-27 10:41:26 -06:00
Tim Schaub
13da248cbf Merge pull request #12817 from openlayers/dependabot/npm_and_yarn/yargs-17.2.1
Bump yargs from 17.1.1 to 17.2.1
2021-09-27 10:40:45 -06:00
dependabot[bot]
2274598ea3 Bump glob from 7.1.7 to 7.2.0
Bumps [glob](https://github.com/isaacs/node-glob) from 7.1.7 to 7.2.0.
- [Release notes](https://github.com/isaacs/node-glob/releases)
- [Changelog](https://github.com/isaacs/node-glob/blob/master/changelog.md)
- [Commits](https://github.com/isaacs/node-glob/compare/v7.1.7...v7.2.0)

---
updated-dependencies:
- dependency-name: glob
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-27 16:38:52 +00:00
Tim Schaub
c5a4e842a3 Merge pull request #12825 from openlayers/dependabot/npm_and_yarn/webpack-5.54.0
Bump webpack from 5.53.0 to 5.54.0
2021-09-27 10:37:56 -06:00
Tim Schaub
b929e02f78 Merge pull request #12826 from openlayers/dependabot/npm_and_yarn/puppeteer-10.4.0
Bump puppeteer from 10.2.0 to 10.4.0
2021-09-27 10:36:59 -06:00
Edward Nash
a4186fae3c bugfix: Fix type of layers option in OverviewMap
* The foundation Layer class is BaseLayer and not Layer
2021-09-27 13:33:24 +02:00
Tim Schaub
bfb6c0ffb5 Merge pull request #12815 from tschaub/typo
Spelling correction
2021-09-27 05:18:09 -06:00
dependabot[bot]
9d167413e7 Bump puppeteer from 10.2.0 to 10.4.0
Bumps [puppeteer](https://github.com/puppeteer/puppeteer) from 10.2.0 to 10.4.0.
- [Release notes](https://github.com/puppeteer/puppeteer/releases)
- [Changelog](https://github.com/puppeteer/puppeteer/blob/main/CHANGELOG.md)
- [Commits](https://github.com/puppeteer/puppeteer/compare/v10.2.0...v10.4.0)

---
updated-dependencies:
- dependency-name: puppeteer
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-27 10:03:07 +00:00
dependabot[bot]
bec5e9676a Bump webpack from 5.53.0 to 5.54.0
Bumps [webpack](https://github.com/webpack/webpack) from 5.53.0 to 5.54.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.53.0...v5.54.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-27 10:02:51 +00:00
dependabot[bot]
676f538642 Bump walk from 2.3.14 to 2.3.15
Bumps [walk](https://github.com/coolaj86/node-walk) from 2.3.14 to 2.3.15.
- [Release notes](https://github.com/coolaj86/node-walk/releases)
- [Commits](https://github.com/coolaj86/node-walk/commits)

---
updated-dependencies:
- dependency-name: walk
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-27 10:02:16 +00:00
dependabot[bot]
c81a486615 Bump @rollup/plugin-node-resolve from 13.0.4 to 13.0.5
Bumps [@rollup/plugin-node-resolve](https://github.com/rollup/plugins/tree/HEAD/packages/node-resolve) from 13.0.4 to 13.0.5.
- [Release notes](https://github.com/rollup/plugins/releases)
- [Changelog](https://github.com/rollup/plugins/blob/master/packages/node-resolve/CHANGELOG.md)
- [Commits](https://github.com/rollup/plugins/commits/node-resolve-v13.0.5/packages/node-resolve)

---
updated-dependencies:
- dependency-name: "@rollup/plugin-node-resolve"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-27 10:01:52 +00:00
dependabot[bot]
722769695d Bump mocha from 9.1.1 to 9.1.2
Bumps [mocha](https://github.com/mochajs/mocha) from 9.1.1 to 9.1.2.
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v9.1.1...v9.1.2)

---
updated-dependencies:
- dependency-name: mocha
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-27 10:01:41 +00:00
dependabot[bot]
9511063f7e Bump webpack-dev-middleware from 5.1.0 to 5.2.1
Bumps [webpack-dev-middleware](https://github.com/webpack/webpack-dev-middleware) from 5.1.0 to 5.2.1.
- [Release notes](https://github.com/webpack/webpack-dev-middleware/releases)
- [Changelog](https://github.com/webpack/webpack-dev-middleware/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-dev-middleware/compare/v5.1.0...v5.2.1)

---
updated-dependencies:
- dependency-name: webpack-dev-middleware
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-27 10:01:18 +00:00
dependabot[bot]
d755fbc507 Bump threads from 1.6.5 to 1.7.0
Bumps [threads](https://github.com/andywer/threads.js) from 1.6.5 to 1.7.0.
- [Release notes](https://github.com/andywer/threads.js/releases)
- [Changelog](https://github.com/andywer/threads.js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/andywer/threads.js/compare/v1.6.5...v1.7.0)

---
updated-dependencies:
- dependency-name: threads
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-27 10:01:06 +00:00
dependabot[bot]
f7aba759c2 Bump yargs from 17.1.1 to 17.2.1
Bumps [yargs](https://github.com/yargs/yargs) from 17.1.1 to 17.2.1.
- [Release notes](https://github.com/yargs/yargs/releases)
- [Changelog](https://github.com/yargs/yargs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/yargs/yargs/compare/v17.1.1...v17.2.1)

---
updated-dependencies:
- dependency-name: yargs
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-27 10:00:49 +00:00
Tim Schaub
79cfeb9a07 Spelling correction 2021-09-26 20:11:40 -06:00
mike-000
564d4f867f Do not replace color if image not loaded 2021-09-25 13:24:39 +01:00
Andreas Hocevar
d66f2f4091 Merge pull request #12812 from openlayers/release-v6.8.1
Release v6.8.1
2021-09-25 09:15:50 +00:00
Andreas Hocevar
481dc9792c Fix typo 2021-09-25 09:06:15 +00:00
Andreas Hocevar
5c61d5b06c Develop on 6.8.2-dev 2021-09-25 09:05:12 +00:00
Andreas Hocevar
b068a339f5 Update package version to 6.8.1 2021-09-25 09:02:23 +00:00
Andreas Hocevar
7ac93be8dd Changelog for v6.8.1 2021-09-25 09:01:39 +00:00
Tim Schaub
7a6b9f8a33 Merge pull request #12811 from tschaub/inheritance
Controls inherit font size from parent
2021-09-25 08:20:30 +00:00
Tim Schaub
ef5d00cb9a Controls inherit font size from parent 2021-09-25 06:31:36 +00:00
Tim Schaub
2a0a71107e Merge pull request #12810 from openlayers/release-v6.8.0
Release v6.8.0
2021-09-24 20:07:58 +00:00
Tim Schaub
6b1232b922 Back to development 2021-09-24 19:54:37 +00:00
Tim Schaub
a2d6bd3d85 Updates for 6.8 2021-09-24 19:51:28 +00:00
Tim Schaub
264f155fe3 Merge pull request #12785 from mike-000/Promise.allSettled
Promise.allSettled polyfill and other browser compatibilty
2021-09-24 19:32:53 +00:00
Tim Schaub
0b1d0c9b6e Merge pull request #12807 from tschaub/style-tweaks
Updated styles
2021-09-24 14:12:56 +00:00
Tim Schaub
f5169aafd3 Merge pull request #12806 from tschaub/simpler-sea-level
Update to the WebGL sea level example
2021-09-24 13:50:19 +00:00
Tim Schaub
3db0bf1c6d Update to the WebGL sea level example 2021-09-24 13:41:19 +00:00
Tim Schaub
f5052149d1 Updated styles 2021-09-24 13:40:54 +00:00
Tim Schaub
01bd84d1fc Merge pull request #12808 from tschaub/rendering-tests
Update expectations for vector tile icon label rendering
2021-09-24 13:40:35 +00:00
Tim Schaub
a5e236fe0c Update expectations for vector tile icon label rendering 2021-09-24 13:24:14 +00:00
Andreas Hocevar
2e222083de Merge pull request #12804 from ahocevar/vectortiles-simpler-faster
Make vector tiles rendering simpler and a bit faster
2021-09-23 20:38:17 +00:00
Tim Schaub
b03b6b2e87 Merge pull request #12802 from tschaub/enqueue-next
Enqueue tiles at the next step in the animation
2021-09-23 20:37:38 +00:00
Andreas Hocevar
9aa890217c Render images only when we have frame budget left 2021-09-23 20:11:26 +00:00
Andreas Hocevar
74a628ac85 Remove unused tile image render queue 2021-09-23 19:47:10 +00:00
Tim Schaub
4dc66ef8e3 Enqueue tiles at the next resolution in the animation 2021-09-23 17:28:39 +00:00
Andreas Hocevar
1bd0d8187f Merge pull request #12801 from ahocevar/latest-ol-mapbox-style
Update ol-mapbox-style to latest version without ol peer dependency
2021-09-23 16:35:34 +00:00
Andreas Hocevar
6d427050ce Merge pull request #12792 from ahocevar/no-render-work-when-no-features
Do not do any canvas work when there are no features to render
2021-09-23 16:34:47 +00:00
Andreas Hocevar
03f8bf47e1 Update ol-mapbox-style to latest version without ol peer dependency 2021-09-23 14:41:57 +00:00
Andreas Hocevar
3a2c33f827 Merge pull request #12797 from ahocevar/dependency-updates
Update geotiff
2021-09-23 14:28:55 +00:00
Andreas Hocevar
276d6cb914 Update related dependencies 2021-09-23 13:35:11 +00:00
Tim Schaub
2435321133 Merge pull request #12799 from tschaub/dispose-webgl-points
All layers now call dispose on the renderer
2021-09-23 13:26:22 +00:00
Andreas Hocevar
c934f08866 Update geotiff 2021-09-23 13:24:58 +00:00
Tim Schaub
f357495574 All layers now call dispose on the renderer 2021-09-23 13:14:22 +00:00
Tim Schaub
0db6a021c2 Merge pull request #12798 from tschaub/dispose-webgl-tilelayer
More cleanup in the WebGL tile layer's dispose method
2021-09-23 12:34:23 +00:00
Tim Schaub
a332842540 More cleanup in the WebGL tile layer's dispose method 2021-09-23 12:00:00 +00:00
Tim Schaub
2ebbee2340 Merge pull request #12795 from mike-000/wmts
New tile source for the WMTS example
2021-09-22 23:51:50 +00:00
mike-000
1776f13f4c Update the tile source 2021-09-22 16:25:17 +01:00
Tim Schaub
81bdd513df Merge pull request #12793 from tschaub/set-layers
Add a method to set the map layers
2021-09-22 03:17:37 -05:00
Tim Schaub
a63735a649 Add a method to set the map layers 2021-09-21 13:34:35 +00:00
Andreas Hocevar
46b21c2588 Do not do any canvas work when there are no features to render 2021-09-21 11:21:01 +00:00
Andreas Hocevar
b50f4ce107 Merge pull request #12789 from ahocevar/mapbox-vector-layer-tilejson
Handle TileJSON urls in Mapbox Style document
2021-09-21 11:08:51 +00:00
Tim Schaub
0505d5d379 Merge pull request #12790 from tschaub/view-promise
Allow maps to be configured with a promise for view props
2021-09-21 05:35:14 -05:00
Tim Schaub
d5813deb08 Allow maps to be configured with a promise for view props 2021-09-21 10:25:29 +00:00
Andreas Hocevar
8585d4382b Handle TileJSON urls in Mapbox Style document 2021-09-20 23:37:53 +00:00
Tim Schaub
79a54e33bb Merge pull request #12784 from openlayers/dependabot/npm_and_yarn/webpack-dev-server-4.2.1
Bump webpack-dev-server from 4.2.0 to 4.2.1
2021-09-20 12:48:55 -05:00
Tim Schaub
0a2404089e Merge pull request #12783 from openlayers/dependabot/npm_and_yarn/marked-3.0.4
Bump marked from 3.0.3 to 3.0.4
2021-09-20 12:48:27 -05:00
Tim Schaub
c3cdba3d00 Merge pull request #12782 from openlayers/dependabot/npm_and_yarn/webpack-sources-3.2.1
Bump webpack-sources from 3.2.0 to 3.2.1
2021-09-20 12:48:01 -05:00
Tim Schaub
67034faa60 Merge pull request #12781 from openlayers/dependabot/npm_and_yarn/webpack-5.53.0
Bump webpack from 5.52.1 to 5.53.0
2021-09-20 12:47:30 -05:00
Tim Schaub
878721468e Merge pull request #12780 from openlayers/dependabot/npm_and_yarn/babel/eslint-parser-7.15.7
Bump @babel/eslint-parser from 7.15.4 to 7.15.7
2021-09-20 12:46:59 -05:00
mike-000
ff6aee0d45 Additional requirements for ol/source/GeoTIFF 2021-09-20 12:25:18 +01:00
mike-000
8be8660b91 Fix range slider for better browser support 2021-09-20 11:39:21 +01:00
mike-000
3b108ef058 add NumpyLoader 2021-09-20 11:25:21 +01:00
mike-000
208e2cb022 Polyfill for Promise.allSettled 2021-09-20 11:21:21 +01:00
mike-000
b4275f887e Polyfill for Promise.allSettled 2021-09-20 11:17:59 +01:00
dependabot[bot]
7478705871 Bump webpack-dev-server from 4.2.0 to 4.2.1
Bumps [webpack-dev-server](https://github.com/webpack/webpack-dev-server) from 4.2.0 to 4.2.1.
- [Release notes](https://github.com/webpack/webpack-dev-server/releases)
- [Changelog](https://github.com/webpack/webpack-dev-server/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-dev-server/compare/v4.2.0...v4.2.1)

---
updated-dependencies:
- dependency-name: webpack-dev-server
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-20 10:02:11 +00:00
dependabot[bot]
5dffb0e94e Bump marked from 3.0.3 to 3.0.4
Bumps [marked](https://github.com/markedjs/marked) from 3.0.3 to 3.0.4.
- [Release notes](https://github.com/markedjs/marked/releases)
- [Changelog](https://github.com/markedjs/marked/blob/master/release.config.js)
- [Commits](https://github.com/markedjs/marked/compare/v3.0.3...v3.0.4)

---
updated-dependencies:
- dependency-name: marked
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-20 10:01:57 +00:00
dependabot[bot]
1d4c40b05e Bump webpack-sources from 3.2.0 to 3.2.1
Bumps [webpack-sources](https://github.com/webpack/webpack-sources) from 3.2.0 to 3.2.1.
- [Release notes](https://github.com/webpack/webpack-sources/releases)
- [Commits](https://github.com/webpack/webpack-sources/compare/v3.2.0...v3.2.1)

---
updated-dependencies:
- dependency-name: webpack-sources
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-20 10:01:21 +00:00
dependabot[bot]
e40c029f9f Bump webpack from 5.52.1 to 5.53.0
Bumps [webpack](https://github.com/webpack/webpack) from 5.52.1 to 5.53.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.52.1...v5.53.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-20 10:01:11 +00:00
dependabot[bot]
1344ee83a3 Bump @babel/eslint-parser from 7.15.4 to 7.15.7
Bumps [@babel/eslint-parser](https://github.com/babel/babel/tree/HEAD/eslint/babel-eslint-parser) from 7.15.4 to 7.15.7.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.15.7/eslint/babel-eslint-parser)

---
updated-dependencies:
- dependency-name: "@babel/eslint-parser"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-20 10:00:56 +00:00
Andreas Hocevar
b2f1d081ed Merge pull request #12777 from ahocevar/fix-offscreen-canvas
Fix offscreen-canvas example
2021-09-18 22:47:26 +02:00
Andreas Hocevar
b7e3695cac Merge pull request #12778 from ahocevar/vectortile-remove-extra-work
Do not render vector tiles unless they are being used
2021-09-18 22:46:41 +02:00
Tim Schaub
391af5a466 Merge pull request #12773 from tschaub/lazy-gl-extensions
Enable WebGL extensions when required
2021-09-18 07:26:26 -06:00
MoonE
964b1af72a Merge pull request #12774 from MoonE/fix-text-declutter
Fix text decluttering when segment length is zero
2021-09-18 11:09:15 +02:00
Andreas Hocevar
610fd69120 Do not render vector tiles unless they are being used 2021-09-18 11:02:55 +02:00
Andreas Hocevar
35b3262e0b Fix offscreen-canvas example 2021-09-18 10:30:34 +02:00
Andreas Hocevar
e5193ffa6e Use a more restrictive Mapbox token 2021-09-18 09:28:25 +02:00
Maximilian Krög
4be657a28f Fix text decluttering when segment length is zero 2021-09-17 23:09:56 +02:00
Tim Schaub
367d77d1dc Merge pull request #12770 from tschaub/avoid-clamped
Use Uint8Array instead of Uint8ClampedArray for increased browser compatibility
2021-09-17 14:29:59 -06:00
Tim Schaub
da256e6c00 Enable WebGL extensions when required 2021-09-17 14:14:12 -06:00
Andreas Hocevar
0d06f7b493 Merge pull request #12759 from jumpinjackie/fix/control-typings
#12758: Allow undefined to be passed to control setMap(). Also fix type of getMap()
2021-09-17 08:07:39 +02:00
Tim Schaub
836aa4900e Use Uint8Array instead of Uint8ClampedArray for browser compatibility 2021-09-16 15:10:35 -06:00
Andreas Hocevar
c57c898381 Merge pull request #12760 from ahocevar/opacity
Fix opacity handling for tile and vector layers
2021-09-16 19:49:47 +02:00
Tim Schaub
a1eb2481ba Merge pull request #12764 from webwitcher/imageinformationresponse-fix
Fix ImageInformationResponse typedef
2021-09-16 10:16:32 -06:00
Tim Schaub
87aa801939 Merge pull request #12769 from tschaub/fix-anchor
Remove extra closing anchor tag
2021-09-16 10:08:09 -06:00
Tim Schaub
0fb5237de2 Remove extra closing anchor tag 2021-09-16 09:59:22 -06:00
Tim Schaub
506b176ef2 Merge pull request #12761 from theduckylittle/datatile-float-textures
Add Float Textures for GL Rendering / DataTiles
2021-09-16 09:56:29 -06:00
Tim Schaub
0783a8211f Adjustments to NumpyTiles example 2021-09-16 09:44:43 -06:00
Martin Hauck
c86841dae0 Update src/ol/format/IIIFInfo.js
Co-authored-by: Simon Seyock <8100558+simonseyock@users.noreply.github.com>
2021-09-16 17:15:11 +02:00
Duck
3fc8217254 Add example featuring numpytiles 2021-09-16 07:09:31 -07:00
Martin Hauck
e955eeff21 Fix ImageInformationResponse typedef
`TileInfo` should be an array to conform to https://iiif.io/api/image
2021-09-16 11:41:33 +02:00
Andreas Hocevar
2f5e6906b9 Fix opacity handling for tile and vector layers 2021-09-16 08:49:32 +02:00
Duck
05615df1a3 Allow TileTexture to select float or int based textures. 2021-09-15 15:10:55 -07:00
Duck
f2472b7801 Allow DataTile source to include more than four bands. 2021-09-15 15:10:26 -07:00
Duck
17394cc8be Ensure the texture is loaded into the correct index.
The previous code would try to load subsequent textures into the 0th slot.
2021-09-15 15:10:08 -07:00
Duck
5afd25150f Add additional extension requirements for floating point textures. 2021-09-15 09:35:23 -07:00
mike-000
cb6995d71a Various fixes for browser compatibility issues (#12740)
* Replace Math.log2 with ol/math.log2
* TypedArray.from() browser compatibility fallback
* listen for input and change events for range
2021-09-15 08:45:12 -06:00
Tim Schaub
f9454ba8e3 Merge pull request #12741 from mike-000/GMLBase
Minimal documentation for GMLBase
2021-09-15 08:42:08 -06:00
Tim Schaub
77e457a676 Merge pull request #12750 from openlayers/dependabot/npm_and_yarn/webpack-dev-server-4.2.0
Bump webpack-dev-server from 4.1.0 to 4.2.0
2021-09-15 08:38:20 -06:00
Jackie Ng
67d885d6ef #12758: Allow undefined to be passed to control setMap(). Consequently the return type of getMap() now can also be undefined as well. 2021-09-16 00:05:53 +10:00
Anna Shchurova
2b5ea17d79 Moved layer declaration in the sample 2021-09-15 08:20:00 -04:00
Anna Shchurova
3ec1ed6bf0 Changed based on review comments 2021-09-13 19:22:27 -04:00
Anna Shchurova
d2a2234eec Added sample for custom hit renderer 2021-09-13 16:42:48 -04:00
Andreas Hocevar
0efdef9b40 Merge pull request #12749 from openlayers/dependabot/npm_and_yarn/marked-3.0.3
Bump marked from 3.0.2 to 3.0.3
2021-09-13 17:49:23 +02:00
Andreas Hocevar
860546800f Merge pull request #12748 from openlayers/dependabot/npm_and_yarn/ol-mapbox-style-6.4.2
Bump ol-mapbox-style from 6.4.1 to 6.4.2
2021-09-13 17:48:56 +02:00
Andreas Hocevar
cccdaf7546 Merge pull request #12747 from openlayers/dependabot/npm_and_yarn/terser-webpack-plugin-5.2.4
Bump terser-webpack-plugin from 5.2.3 to 5.2.4
2021-09-13 17:48:24 +02:00
Andreas Hocevar
ee8fe615f2 Merge pull request #12746 from openlayers/dependabot/npm_and_yarn/babel/preset-env-7.15.6
Bump @babel/preset-env from 7.15.4 to 7.15.6
2021-09-13 17:47:55 +02:00
Andreas Hocevar
d4f77349e7 Merge pull request #12745 from openlayers/dependabot/npm_and_yarn/webpack-5.52.1
Bump webpack from 5.52.0 to 5.52.1
2021-09-13 17:47:18 +02:00
Andreas Hocevar
2523929c4f Merge pull request #12744 from openlayers/dependabot/npm_and_yarn/webpack-dev-middleware-5.1.0
Bump webpack-dev-middleware from 5.0.0 to 5.1.0
2021-09-13 17:46:41 +02:00
Andreas Hocevar
11ea89468a Merge pull request #12743 from mike-000/patch-3
Remove docs reference to unmanaged layer and Select
2021-09-13 17:45:45 +02:00
dependabot[bot]
ee7b877b9f Bump webpack-dev-server from 4.1.0 to 4.2.0
Bumps [webpack-dev-server](https://github.com/webpack/webpack-dev-server) from 4.1.0 to 4.2.0.
- [Release notes](https://github.com/webpack/webpack-dev-server/releases)
- [Changelog](https://github.com/webpack/webpack-dev-server/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-dev-server/compare/v4.1.0...v4.2.0)

---
updated-dependencies:
- dependency-name: webpack-dev-server
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-13 10:02:15 +00:00
dependabot[bot]
bac66e6cbc Bump marked from 3.0.2 to 3.0.3
Bumps [marked](https://github.com/markedjs/marked) from 3.0.2 to 3.0.3.
- [Release notes](https://github.com/markedjs/marked/releases)
- [Changelog](https://github.com/markedjs/marked/blob/master/release.config.js)
- [Commits](https://github.com/markedjs/marked/compare/v3.0.2...v3.0.3)

---
updated-dependencies:
- dependency-name: marked
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-13 10:02:03 +00:00
dependabot[bot]
08e1f2e8ef Bump ol-mapbox-style from 6.4.1 to 6.4.2
Bumps [ol-mapbox-style](https://github.com/openlayers/ol-mapbox-style) from 6.4.1 to 6.4.2.
- [Release notes](https://github.com/openlayers/ol-mapbox-style/releases)
- [Changelog](https://github.com/openlayers/ol-mapbox-style/blob/master/CHANGELOG.md)
- [Commits](https://github.com/openlayers/ol-mapbox-style/compare/v6.4.1...v6.4.2)

---
updated-dependencies:
- dependency-name: ol-mapbox-style
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-13 10:01:47 +00:00
dependabot[bot]
24948708e4 Bump terser-webpack-plugin from 5.2.3 to 5.2.4
Bumps [terser-webpack-plugin](https://github.com/webpack-contrib/terser-webpack-plugin) from 5.2.3 to 5.2.4.
- [Release notes](https://github.com/webpack-contrib/terser-webpack-plugin/releases)
- [Changelog](https://github.com/webpack-contrib/terser-webpack-plugin/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/terser-webpack-plugin/compare/v5.2.3...v5.2.4)

---
updated-dependencies:
- dependency-name: terser-webpack-plugin
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-13 10:01:35 +00:00
dependabot[bot]
5eee0277d2 Bump @babel/preset-env from 7.15.4 to 7.15.6
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.15.4 to 7.15.6.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.15.6/packages/babel-preset-env)

---
updated-dependencies:
- dependency-name: "@babel/preset-env"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-13 10:01:18 +00:00
dependabot[bot]
4c278a801f Bump webpack from 5.52.0 to 5.52.1
Bumps [webpack](https://github.com/webpack/webpack) from 5.52.0 to 5.52.1.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.52.0...v5.52.1)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-13 10:01:04 +00:00
dependabot[bot]
5ed413ee3c Bump webpack-dev-middleware from 5.0.0 to 5.1.0
Bumps [webpack-dev-middleware](https://github.com/webpack/webpack-dev-middleware) from 5.0.0 to 5.1.0.
- [Release notes](https://github.com/webpack/webpack-dev-middleware/releases)
- [Changelog](https://github.com/webpack/webpack-dev-middleware/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-dev-middleware/compare/v5.0.0...v5.1.0)

---
updated-dependencies:
- dependency-name: webpack-dev-middleware
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-13 10:00:50 +00:00
mike-000
5d937b8c5b Remove docs reference to unmanaged layer 2021-09-13 10:27:16 +01:00
mike-000
a5ed3ce853 Change Select to Draw to describe unmanaged layers 2021-09-13 10:20:30 +01:00
mike-000
7b725cfdf0 add @api 2021-09-12 16:20:22 +01:00
Andreas Hocevar
c5fafbd6c2 Merge pull request #12734 from ahocevar/still-ie11-why-oh-why
Continue supporting IE11 in examples and legacy build
2021-09-11 17:23:03 +02:00
Andreas Hocevar
6085964b61 Merge pull request #12739 from mike-000/patch-2
Change canvas style from initial to unset
2021-09-10 21:50:28 +02:00
mike-000
e0c15c28dc Change canvas style from initial to unset 2021-09-10 20:18:20 +01:00
Andreas Hocevar
c128051802 Add polyfills to legacy build preview 2021-09-10 18:32:26 +02:00
Andreas Hocevar
0f2ec4d9c5 Add legacy build test map to site/index.html 2021-09-10 18:15:09 +02:00
Andreas Hocevar
ccb9ff6f37 Configure builds so they actually work 2021-09-10 18:15:08 +02:00
Andreas Hocevar
f0b3ce635a Merge pull request #12731 from ahocevar/user-resolution
Handle resolution and tile loadingstrategy with user projection
2021-09-10 17:52:48 +02:00
Tim Schaub
bb20ca3c23 Merge pull request #12736 from simonseyock/onsignature-return
OnSignatures return more specific type
2021-09-10 08:33:47 -06:00
Andreas Hocevar
b4d93141ec Do not mangle properties for built examples 2021-09-10 16:28:42 +02:00
Simon Seyock
ce4f6ccb0d OnSignatures return more specific type 2021-09-10 16:11:38 +02:00
Andreas Hocevar
fa8aa81840 Continue supporting IE11 in examples and legacy buld 2021-09-10 13:40:25 +02:00
Andreas Hocevar
26fd8a8f59 Better distinguish new example from existing one 2021-09-10 13:15:17 +02:00
Andreas Hocevar
87bcfdeaa4 Merge pull request #12732 from mike-000/patch-1
Add <meta charset="utf-8"> to Quick Start
2021-09-10 13:10:24 +02:00
mike-000
5cf5b7aeb1 Add <meta charset="utf-8"> to Quick Start 2021-09-10 10:14:05 +01:00
Andreas Hocevar
50e89080a4 Use view projection tile grid in tile loadingstrategy 2021-09-10 02:01:47 +02:00
Andreas Hocevar
c9593b0cf6 Adjust resolution for user extent 2021-09-10 02:01:46 +02:00
Tim Schaub
22a0a209ac Merge pull request #12728 from openlayers/release-v6.7.0
Release v6.7.0
2021-09-09 11:44:08 -06:00
Tim Schaub
eddf8df139 Develop on 6.7.1-dev 2021-09-09 11:35:21 -06:00
Anna Shchurova
a281b7c1aa Added unit tests for hit detection 2021-09-08 17:05:00 -04:00
Anna Shchurova
eafcbb3ec0 Fixed lint 2021-08-23 13:42:56 -04:00
Anna Shchurova
820c123335 Added 'default' section and fixed more linting errors 2021-08-23 13:02:26 -04:00
Anna Shchurova
711ae69bb5 Fixed linting errors 2021-08-20 21:55:05 -04:00
Anna Shchurova
ba65896cef Fixed case for POINT 2021-08-20 15:50:04 -04:00
Anna Shchurova
aa58a358ea Added new 'hitDEtectionRenderer' property to ol.style.Style and used it in custom drawing 2021-08-20 15:10:59 -04:00
149 changed files with 3243 additions and 2782 deletions

View File

@@ -102,6 +102,8 @@ For older browsers and platforms (Internet Explorer, Android 4.x, iOS v12 and ol
* [`Number.isInteger`](https://caniuse.com/isInteger): Available from [polyfill.io](https://polyfill.io/).
* [Pointer events](https://caniuse.com/pointer): Use [elm-pep](https://npmjs.com/package/elm-pep) (lightweight) or [pepjs](https://npmjs.com/package/pepjs) (for really, really old browsers).
[`ol/source/GeoTIFF`](https://openlayers.org/en/latest/apidoc/module-ol_source_GeoTIFF-GeoTIFFSource.html) requires a browser that supports [ECMAScript 6](https://262.ecma-international.org/6.0/). Additionally a polyfill for [`Promise.allSettled`](https://caniuse.com/mdn-javascript_builtins_promise_allsettled) may be needed.
## Documentation
Check out the [hosted examples](https://openlayers.org/en/latest/examples/), the [workshop](https://openlayers.org/workshop/) or the [API documentation](https://openlayers.org/en/latest/apidoc/).

View File

@@ -1,5 +1,13 @@
## Upgrade notes
### v6.9.0
There should be nothing special required when upgrading from v6.8 to v6.9.
### v6.8.0
There should be nothing special required when upgrading from v6.7 to v6.8.
### v6.7.0
There should be nothing special required when upgrading from v6.6 to v6.7.

60
changelog/v6.8.0.md Normal file
View File

@@ -0,0 +1,60 @@
# 6.8.0
The 6.8 release builds on the momentum of 6.7 with some great new enhancements. Data tiles now handle 32-bit data in addition to 8-bit. Views properties can now be provided that sources that fetch view-related data. Vector tile rendering got some performance enhancements. Find detail on these features and a number of fixes in the list of changes below.
## List of all changes
* [#12785](https://github.com/openlayers/openlayers/pull/12785) - Promise.allSettled polyfill and other browser compatibilty ([@mike-000](https://github.com/mike-000))
* [#12807](https://github.com/openlayers/openlayers/pull/12807) - Updated styles ([@tschaub](https://github.com/tschaub))
* [#12806](https://github.com/openlayers/openlayers/pull/12806) - Update to the WebGL sea level example ([@tschaub](https://github.com/tschaub))
* [#12808](https://github.com/openlayers/openlayers/pull/12808) - Update expectations for vector tile icon label rendering ([@tschaub](https://github.com/tschaub))
* [#12804](https://github.com/openlayers/openlayers/pull/12804) - Make vector tiles rendering simpler and a bit faster ([@ahocevar](https://github.com/ahocevar))
* [#12802](https://github.com/openlayers/openlayers/pull/12802) - Enqueue tiles at the next step in the animation ([@tschaub](https://github.com/tschaub))
* [#12801](https://github.com/openlayers/openlayers/pull/12801) - Update ol-mapbox-style to latest version without ol peer dependency ([@ahocevar](https://github.com/ahocevar))
* [#12792](https://github.com/openlayers/openlayers/pull/12792) - Do not do any canvas work when there are no features to render ([@ahocevar](https://github.com/ahocevar))
* [#12797](https://github.com/openlayers/openlayers/pull/12797) - Update geotiff ([@ahocevar](https://github.com/ahocevar))
* [#12799](https://github.com/openlayers/openlayers/pull/12799) - All layers now call dispose on the renderer ([@tschaub](https://github.com/tschaub))
* [#12798](https://github.com/openlayers/openlayers/pull/12798) - More cleanup in the WebGL tile layer's dispose method ([@tschaub](https://github.com/tschaub))
* [#12795](https://github.com/openlayers/openlayers/pull/12795) - New tile source for the WMTS example ([@mike-000](https://github.com/mike-000))
* [#12793](https://github.com/openlayers/openlayers/pull/12793) - Add a method to set the map layers ([@tschaub](https://github.com/tschaub))
* [#12789](https://github.com/openlayers/openlayers/pull/12789) - Handle TileJSON urls in Mapbox Style document ([@ahocevar](https://github.com/ahocevar))
* [#12790](https://github.com/openlayers/openlayers/pull/12790) - Allow maps to be configured with a promise for view props ([@tschaub](https://github.com/tschaub))
* [#12777](https://github.com/openlayers/openlayers/pull/12777) - Fix offscreen-canvas example ([@ahocevar](https://github.com/ahocevar))
* [#12778](https://github.com/openlayers/openlayers/pull/12778) - Do not render vector tiles unless they are being used ([@ahocevar](https://github.com/ahocevar))
* [#12773](https://github.com/openlayers/openlayers/pull/12773) - Enable WebGL extensions when required ([@tschaub](https://github.com/tschaub))
* [#12774](https://github.com/openlayers/openlayers/pull/12774) - Fix text decluttering when segment length is zero ([@MoonE](https://github.com/MoonE))
* [#12770](https://github.com/openlayers/openlayers/pull/12770) - Use Uint8Array instead of Uint8ClampedArray for increased browser compatibility ([@tschaub](https://github.com/tschaub))
* [#12759](https://github.com/openlayers/openlayers/pull/12759) - #12758: Allow undefined to be passed to control setMap(). Also fix type of getMap() ([@jumpinjackie](https://github.com/jumpinjackie))
* [#12760](https://github.com/openlayers/openlayers/pull/12760) - Fix opacity handling for tile and vector layers ([@ahocevar](https://github.com/ahocevar))
* [#12764](https://github.com/openlayers/openlayers/pull/12764) - Fix ImageInformationResponse typedef ([@webwitcher](https://github.com/webwitcher))
* [#12769](https://github.com/openlayers/openlayers/pull/12769) - Remove extra closing anchor tag ([@tschaub](https://github.com/tschaub))
* [#12761](https://github.com/openlayers/openlayers/pull/12761) - Add Float Textures for GL Rendering / DataTiles ([@theduckylittle](https://github.com/theduckylittle))
* [#12740](https://github.com/openlayers/openlayers/pull/12740) - Various fixes for browser compatibility issues ([mike-000](https://github.com/search?q=mike-000&type=Users))
* [#12741](https://github.com/openlayers/openlayers/pull/12741) - Minimal documentation for GMLBase ([@mike-000](https://github.com/mike-000))
* [#12743](https://github.com/openlayers/openlayers/pull/12743) - Remove docs reference to unmanaged layer and Select ([@mike-000](https://github.com/mike-000))
* [#12734](https://github.com/openlayers/openlayers/pull/12734) - Continue supporting IE11 in examples and legacy build ([@ahocevar](https://github.com/ahocevar))
* [#12739](https://github.com/openlayers/openlayers/pull/12739) - Change canvas style from initial to unset ([@mike-000](https://github.com/mike-000))
* [#12731](https://github.com/openlayers/openlayers/pull/12731) - Handle resolution and tile loadingstrategy with user projection ([@ahocevar](https://github.com/ahocevar))
* [#12736](https://github.com/openlayers/openlayers/pull/12736) - OnSignatures return more specific type ([@simonseyock](https://github.com/simonseyock))
* [#12732](https://github.com/openlayers/openlayers/pull/12732) - Add <meta charset="utf-8"> to Quick Start ([@mike-000](https://github.com/mike-000))
* [#12728](https://github.com/openlayers/openlayers/pull/12728) - Release v6.7.0 ([@openlayers](https://github.com/openlayers))
<details>
<summary>Dependency Updates</summary>
* [#12784](https://github.com/openlayers/openlayers/pull/12784) - Bump webpack-dev-server from 4.2.0 to 4.2.1 ([@openlayers](https://github.com/openlayers))
* [#12783](https://github.com/openlayers/openlayers/pull/12783) - Bump marked from 3.0.3 to 3.0.4 ([@openlayers](https://github.com/openlayers))
* [#12782](https://github.com/openlayers/openlayers/pull/12782) - Bump webpack-sources from 3.2.0 to 3.2.1 ([@openlayers](https://github.com/openlayers))
* [#12781](https://github.com/openlayers/openlayers/pull/12781) - Bump webpack from 5.52.1 to 5.53.0 ([@openlayers](https://github.com/openlayers))
* [#12780](https://github.com/openlayers/openlayers/pull/12780) - Bump @babel/eslint-parser from 7.15.4 to 7.15.7 ([@openlayers](https://github.com/openlayers))
* [#12750](https://github.com/openlayers/openlayers/pull/12750) - Bump webpack-dev-server from 4.1.0 to 4.2.0 ([@openlayers](https://github.com/openlayers))
* [#12749](https://github.com/openlayers/openlayers/pull/12749) - Bump marked from 3.0.2 to 3.0.3 ([@openlayers](https://github.com/openlayers))
* [#12748](https://github.com/openlayers/openlayers/pull/12748) - Bump ol-mapbox-style from 6.4.1 to 6.4.2 ([@openlayers](https://github.com/openlayers))
* [#12747](https://github.com/openlayers/openlayers/pull/12747) - Bump terser-webpack-plugin from 5.2.3 to 5.2.4 ([@openlayers](https://github.com/openlayers))
* [#12746](https://github.com/openlayers/openlayers/pull/12746) - Bump @babel/preset-env from 7.15.4 to 7.15.6 ([@openlayers](https://github.com/openlayers))
* [#12745](https://github.com/openlayers/openlayers/pull/12745) - Bump webpack from 5.52.0 to 5.52.1 ([@openlayers](https://github.com/openlayers))
* [#12744](https://github.com/openlayers/openlayers/pull/12744) - Bump webpack-dev-middleware from 5.0.0 to 5.1.0 ([@openlayers](https://github.com/openlayers))
</details>

5
changelog/v6.8.1.md Normal file
View File

@@ -0,0 +1,5 @@
# 6.8.1
This is a patch release which updates `ol.css` to restore a legible control button size in applications that do not have a css `font-size` set for `button` elements.
* [#12811](https://github.com/openlayers/openlayers/pull/12811) - Controls inherit font size from parent ([@tschaub](https://github.com/tschaub))

51
changelog/v6.9.0.md Normal file
View File

@@ -0,0 +1,51 @@
# 6.9.0
The 6.9 release brings a few new features and a number of fixes. GeoTIFF sources now have a `normalize` option. Set `normalize: false` if you want your style expressions to work with raw floating point values instead of normalized values from 0 to 1. The GeoTIFF source also now uses nodata values from the source imagery  so in most cases you don't need to specify this yourself. For people configuring vector layers with styles that use custom rendering, you can now get hit detection on the rendered result. See details on these features and other included fixes below.
* [#12813](https://github.com/openlayers/openlayers/pull/12813) - Do not replace icon color if image not loaded ([@mike-000](https://github.com/mike-000))
* [#12870](https://github.com/openlayers/openlayers/pull/12870) - Fix publicPath problem in legacy build ([@ahocevar](https://github.com/ahocevar))
* [#12889](https://github.com/openlayers/openlayers/pull/12889) - Simplified ESLint config ([@tschaub](https://github.com/tschaub))
* [#12875](https://github.com/openlayers/openlayers/pull/12875) - Only trigger change event if animating a tile transition ([@tschaub](https://github.com/tschaub))
* [#12885](https://github.com/openlayers/openlayers/pull/12885) - Fix typeDefs for several Control modules ([@MatthijsBon](https://github.com/MatthijsBon))
* [#12861](https://github.com/openlayers/openlayers/pull/12861) - Update geotiff to 1.0.8; allow version range ([@ahocevar](https://github.com/ahocevar))
* [#12865](https://github.com/openlayers/openlayers/pull/12865) - Add a note about installing git before using create-ol-app ([@tschaub](https://github.com/tschaub))
* [#12847](https://github.com/openlayers/openlayers/pull/12847) - Add more definitions for GeoTIFF types ([@tschaub](https://github.com/tschaub))
* [#12850](https://github.com/openlayers/openlayers/pull/12850) - Fix issues with animate on View without center or resolution ([@MoonE](https://github.com/MoonE))
* [#12846](https://github.com/openlayers/openlayers/pull/12846) - Use nodata values in the GeoTIFF headers for fill value ([@tschaub](https://github.com/tschaub))
* [#12837](https://github.com/openlayers/openlayers/pull/12837) - forEachLayerAtPixel return null for unsupported layer types ([@mike-000](https://github.com/mike-000))
* [#12836](https://github.com/openlayers/openlayers/pull/12836) - Support a normalize option on the GeoTIFF source ([@tschaub](https://github.com/tschaub))
* [#12646](https://github.com/openlayers/openlayers/pull/12646) - Support for hit detection in styles with custom rendering ([@ashchurova](https://github.com/ashchurova))
* [#12831](https://github.com/openlayers/openlayers/pull/12831) - Fix rendering VectorImage with no features in view extent ([@MoonE](https://github.com/MoonE))
* [#12830](https://github.com/openlayers/openlayers/pull/12830) - bugfix: Fix type of `layers` option in `OverviewMap` ([@ejn](https://github.com/ejn))
* [#12815](https://github.com/openlayers/openlayers/pull/12815) - Spelling correction ([@tschaub](https://github.com/tschaub))
* [#12812](https://github.com/openlayers/openlayers/pull/12812) - Release v6.8.1 ([@openlayers](https://github.com/openlayers))
<details>
<summary>Dependency Updates</summary>
* [#12881](https://github.com/openlayers/openlayers/pull/12881) - Bump webpack from 5.56.1 to 5.58.1 ([@openlayers](https://github.com/openlayers))
* [#12882](https://github.com/openlayers/openlayers/pull/12882) - Bump marked from 3.0.4 to 3.0.7 ([@openlayers](https://github.com/openlayers))
* [#12878](https://github.com/openlayers/openlayers/pull/12878) - Bump webpack-dev-server from 4.3.0 to 4.3.1 ([@openlayers](https://github.com/openlayers))
* [#12879](https://github.com/openlayers/openlayers/pull/12879) - Bump @babel/preset-env from 7.15.6 to 7.15.8 ([@openlayers](https://github.com/openlayers))
* [#12880](https://github.com/openlayers/openlayers/pull/12880) - Bump @babel/eslint-parser from 7.15.7 to 7.15.8 ([@openlayers](https://github.com/openlayers))
* [#12884](https://github.com/openlayers/openlayers/pull/12884) - Bump @babel/core from 7.15.5 to 7.15.8 ([@openlayers](https://github.com/openlayers))
* [#12877](https://github.com/openlayers/openlayers/pull/12877) - Bump webpack-cli from 4.8.0 to 4.9.0 ([@openlayers](https://github.com/openlayers))
* [#12854](https://github.com/openlayers/openlayers/pull/12854) - Bump webpack from 5.54.0 to 5.56.1 ([@openlayers](https://github.com/openlayers))
* [#12857](https://github.com/openlayers/openlayers/pull/12857) - Bump webpack-dev-server from 4.2.1 to 4.3.0 ([@openlayers](https://github.com/openlayers))
* [#12856](https://github.com/openlayers/openlayers/pull/12856) - Bump @rollup/plugin-commonjs from 20.0.0 to 21.0.0 ([@openlayers](https://github.com/openlayers))
* [#12855](https://github.com/openlayers/openlayers/pull/12855) - Bump rollup from 2.57.0 to 2.58.0 ([@openlayers](https://github.com/openlayers))
* [#12853](https://github.com/openlayers/openlayers/pull/12853) - Bump clean-css-cli from 5.3.3 to 5.4.1 ([@openlayers](https://github.com/openlayers))
* [#12822](https://github.com/openlayers/openlayers/pull/12822) - Bump glob from 7.1.7 to 7.2.0 ([@openlayers](https://github.com/openlayers))
* [#12824](https://github.com/openlayers/openlayers/pull/12824) - Bump rollup from 2.56.3 to 2.57.0 ([@openlayers](https://github.com/openlayers))
* [#12818](https://github.com/openlayers/openlayers/pull/12818) - Bump threads from 1.6.5 to 1.7.0 ([@openlayers](https://github.com/openlayers))
* [#12821](https://github.com/openlayers/openlayers/pull/12821) - Bump @rollup/plugin-node-resolve from 13.0.4 to 13.0.5 ([@openlayers](https://github.com/openlayers))
* [#12823](https://github.com/openlayers/openlayers/pull/12823) - Bump walk from 2.3.14 to 2.3.15 ([@openlayers](https://github.com/openlayers))
* [#12819](https://github.com/openlayers/openlayers/pull/12819) - Bump webpack-dev-middleware from 5.1.0 to 5.2.1 ([@openlayers](https://github.com/openlayers))
* [#12820](https://github.com/openlayers/openlayers/pull/12820) - Bump mocha from 9.1.1 to 9.1.2 ([@openlayers](https://github.com/openlayers))
* [#12817](https://github.com/openlayers/openlayers/pull/12817) - Bump yargs from 17.1.1 to 17.2.1 ([@openlayers](https://github.com/openlayers))
* [#12825](https://github.com/openlayers/openlayers/pull/12825) - Bump webpack from 5.53.0 to 5.54.0 ([@openlayers](https://github.com/openlayers))
* [#12826](https://github.com/openlayers/openlayers/pull/12826) - Bump puppeteer from 10.2.0 to 10.4.0 ([@openlayers](https://github.com/openlayers))
</details>

View File

@@ -1,33 +1,28 @@
import TerserPlugin from 'terser-webpack-plugin';
import path, {dirname} from 'path';
import {fileURLToPath} from 'url';
const baseDir = dirname(fileURLToPath(import.meta.url));
import path from 'path';
export default {
entry: './build/index.js',
entry: ['regenerator-runtime/runtime', './build/index.js'],
devtool: 'source-map',
mode: 'production',
target: ['web', 'es5'],
module: {
rules: [
{
test: /^((?!es2015-)[\s\S])*\.js$/,
test: /\.m?js$/,
use: {
loader: 'buble-loader',
loader: 'babel-loader',
options: {
transforms: {dangerousForOf: true},
presets: [
[
'@babel/preset-env',
{
targets: 'last 2 versions, not dead',
},
],
],
},
},
include: [
path.join(
baseDir,
'..',
'node_modules',
'@mapbox',
'mapbox-gl-style-spec'
),
],
},
],
},
@@ -53,6 +48,7 @@ export default {
},
output: {
path: path.resolve('./build/legacy'),
publicPath: '',
filename: 'ol.js',
library: 'ol',
libraryTarget: 'umd',

View File

@@ -233,10 +233,6 @@ Cannot determine IIIF Image API version from provided image information JSON.
A `WebGLArrayBuffer` must either be of type `ELEMENT_ARRAY_BUFFER` or `ARRAY_BUFFER`.
### 63
Support for the `OES_element_index_uint` WebGL extension is mandatory for WebGL layers.
### 64
Layer opacity must be a number.

View File

@@ -18,6 +18,7 @@ Below you'll find a complete working example. Create a new file, copy in the co
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/{{ latest }}/css/ol.css" type="text/css">
<style>
.map {

View File

@@ -15,6 +15,8 @@ Create a new empty directory for your project and navigate to it by running `mkd
npx create-ol-app
*You will need to have `git` installed for the above command to work. If you receive an error, make that [Git is installed](https://github.com/git-guides/install-git) on your system.*
This will install the `ol` package, set up a development environment with additional dependencies, and give you an `index.html` and `main.js` starting point for your application. By default, [Parcel](https://parceljs.org) will be used as a module loader and bundler. See the [`create-ol-app`](https://github.com/openlayers/create-ol-app) documentation for details on using another bundler.
To start the development server

View File

@@ -13,6 +13,7 @@
"jsts": false,
"JSZip": false,
"mapboxgl": false,
"NumpyLoader": false,
"saveAs": false,
"toastr": false,
"topojson": false,

View File

@@ -77,13 +77,17 @@ const map = new Map({
}),
});
distanceInput.addEventListener('input', function () {
const distanceHandler = function () {
clusterSource.setDistance(parseInt(distanceInput.value, 10));
});
};
distanceInput.addEventListener('input', distanceHandler);
distanceInput.addEventListener('change', distanceHandler);
minDistanceInput.addEventListener('input', function () {
const minDistanceHandler = function () {
clusterSource.setMinDistance(parseInt(minDistanceInput.value, 10));
});
};
minDistanceInput.addEventListener('input', minDistanceHandler);
minDistanceInput.addEventListener('change', minDistanceHandler);
map.on('click', (e) => {
clusters.getFeatures(e.pixel).then((clickedFeatures) => {

View File

@@ -1,7 +1,6 @@
import GeoTIFF from '../src/ol/source/GeoTIFF.js';
import Map from '../src/ol/Map.js';
import TileLayer from '../src/ol/layer/WebGLTile.js';
import View from '../src/ol/View.js';
const source = new GeoTIFF({
sources: [
@@ -57,9 +56,5 @@ const map = new Map({
source,
}),
],
view: new View({
center: [1900000, 6100000],
zoom: 13,
minZoom: 10,
}),
view: source.getView(),
});

View File

@@ -1,16 +1,21 @@
import GeoTIFF from '../src/ol/source/GeoTIFF.js';
import Map from '../src/ol/Map.js';
import TileLayer from '../src/ol/layer/WebGLTile.js';
import View from '../src/ol/View.js';
import proj4 from 'proj4';
import {getCenter} from '../src/ol/extent.js';
import {register} from '../src/ol/proj/proj4.js';
proj4.defs('EPSG:32636', '+proj=utm +zone=36 +datum=WGS84 +units=m +no_defs');
register(proj4);
// metadata from https://s3.us-west-2.amazonaws.com/sentinel-cogs/sentinel-s2-l2a-cogs/2020/S2A_36QWD_20200701_0_L2A/S2A_36QWD_20200701_0_L2A.json
const sourceExtent = [499980, 1790220, 609780, 1900020];
const source = new GeoTIFF({
sources: [
{
// visible red, band 1 in the style expression above
url: 'https://sentinel-cogs.s3.us-west-2.amazonaws.com/sentinel-s2-l2a-cogs/2020/S2A_36QWD_20200701_0_L2A/B04.tif',
max: 10000,
},
{
// near infrared, band 2 in the style expression above
url: 'https://sentinel-cogs.s3.us-west-2.amazonaws.com/sentinel-s2-l2a-cogs/2020/S2A_36QWD_20200701_0_L2A/B08.tif',
max: 10000,
},
],
});
const map = new Map({
target: 'map',
@@ -69,27 +74,8 @@ const map = new Map({
[0, 69, 0],
],
},
source: new GeoTIFF({
sources: [
{
// visible red, band 1 in the style expression above
url: 'https://sentinel-cogs.s3.us-west-2.amazonaws.com/sentinel-s2-l2a-cogs/2020/S2A_36QWD_20200701_0_L2A/B04.tif',
max: 10000,
},
{
// near infrared, band 2 in the style expression above
url: 'https://sentinel-cogs.s3.us-west-2.amazonaws.com/sentinel-s2-l2a-cogs/2020/S2A_36QWD_20200701_0_L2A/B08.tif',
max: 10000,
},
],
}),
extent: sourceExtent,
source: source,
}),
],
view: new View({
projection: 'EPSG:32636',
center: getCenter(sourceExtent),
extent: sourceExtent,
zoom: 9,
}),
view: source.getView(),
});

View File

@@ -1,62 +1,49 @@
import GeoTIFF from '../src/ol/source/GeoTIFF.js';
import Map from '../src/ol/Map.js';
import TileLayer from '../src/ol/layer/WebGLTile.js';
import View from '../src/ol/View.js';
import proj4 from 'proj4';
import {getCenter} from '../src/ol/extent.js';
import {register} from '../src/ol/proj/proj4.js';
proj4.defs('EPSG:32645', '+proj=utm +zone=45 +datum=WGS84 +units=m +no_defs');
register(proj4);
const sourceExtent = [382200, 2279370, 610530, 2512500];
const base =
'https://landsat-pds.s3.amazonaws.com/c1/L8/139/045/LC08_L1TP_139045_20170304_20170316_01_T1/LC08_L1TP_139045_20170304_20170316_01_T1';
// scale values in this range to 0 - 1
const min = 10000;
const max = 15000;
const base =
'https://landsat-pds.s3.amazonaws.com/c1/L8/139/045/LC08_L1TP_139045_20170304_20170316_01_T1/LC08_L1TP_139045_20170304_20170316_01_T1';
const source = new GeoTIFF({
sources: [
{
url: `${base}_B6.TIF`,
overviews: [`${base}_B6.TIF.ovr`],
min: min,
max: max,
nodata: 0,
},
{
url: `${base}_B5.TIF`,
overviews: [`${base}_B5.TIF.ovr`],
min: min,
max: max,
nodata: 0,
},
{
url: `${base}_B3.TIF`,
overviews: [`${base}_B3.TIF.ovr`],
min: min,
max: max,
nodata: 0,
},
],
});
const map = new Map({
target: 'map',
layers: [
new TileLayer({
extent: sourceExtent,
style: {
saturation: -0.3,
},
source: new GeoTIFF({
sources: [
{
url: `${base}_B6.TIF`,
overviews: [`${base}_B6.TIF.ovr`],
min: min,
max: max,
nodata: 0,
},
{
url: `${base}_B5.TIF`,
overviews: [`${base}_B5.TIF.ovr`],
min: min,
max: max,
nodata: 0,
},
{
url: `${base}_B3.TIF`,
overviews: [`${base}_B3.TIF.ovr`],
min: min,
max: max,
nodata: 0,
},
],
}),
source: source,
}),
],
view: new View({
projection: 'EPSG:32645',
center: getCenter(sourceExtent),
extent: sourceExtent,
zoom: 8,
}),
view: source.getView(),
});

View File

@@ -1,35 +1,21 @@
import GeoTIFF from '../src/ol/source/GeoTIFF.js';
import Map from '../src/ol/Map.js';
import TileLayer from '../src/ol/layer/WebGLTile.js';
import View from '../src/ol/View.js';
import proj4 from 'proj4';
import {getCenter} from '../src/ol/extent.js';
import {register} from '../src/ol/proj/proj4.js';
proj4.defs('EPSG:32636', '+proj=utm +zone=36 +datum=WGS84 +units=m +no_defs');
register(proj4);
// metadata from https://s3.us-west-2.amazonaws.com/sentinel-cogs/sentinel-s2-l2a-cogs/2020/S2A_36QWD_20200701_0_L2A/S2A_36QWD_20200701_0_L2A.json
const sourceExtent = [499980, 1790220, 609780, 1900020];
const source = new GeoTIFF({
sources: [
{
url: 'https://sentinel-cogs.s3.us-west-2.amazonaws.com/sentinel-s2-l2a-cogs/2020/S2A_36QWD_20200701_0_L2A/TCI.tif',
},
],
});
const map = new Map({
target: 'map',
layers: [
new TileLayer({
source: new GeoTIFF({
sources: [
{
url: 'https://sentinel-cogs.s3.us-west-2.amazonaws.com/sentinel-s2-l2a-cogs/2020/S2A_36QWD_20200701_0_L2A/TCI.tif',
},
],
}),
extent: sourceExtent,
source: source,
}),
],
view: new View({
projection: 'EPSG:32636',
center: getCenter(sourceExtent),
extent: sourceExtent,
zoom: 9,
}),
view: source.getView(),
});

View File

@@ -166,10 +166,12 @@ const controlIds = ['hue', 'chroma', 'lightness'];
controlIds.forEach(function (id) {
const control = document.getElementById(id);
const output = document.getElementById(id + 'Out');
control.addEventListener('input', function () {
const listener = function () {
output.innerText = control.value;
raster.changed();
});
};
control.addEventListener('input', listener);
control.addEventListener('change', listener);
output.innerText = control.value;
controls[id] = control;
});

View File

@@ -0,0 +1,12 @@
---
layout: example.html
title: Custom Hit Detection Render
shortdesc: Example of a custom hit detection renderer.
docs: >
This example demonstrates the use of 'ol/style/Style' hitDetectionRender option function in
detecting if pointer is over a particular feature.
Move pointer over the label for Columbus Circle feature and see that only label is used in
hit detection.
tags: "circle, feature, vector, render, custom, hitDetectionRenderer"
---
<div id="map" class="map"></div>

View File

@@ -0,0 +1,103 @@
import Feature from '../src/ol/Feature.js';
import Map from '../src/ol/Map.js';
import View from '../src/ol/View.js';
import {Circle} from '../src/ol/geom.js';
import {OSM, Vector as VectorSource} from '../src/ol/source.js';
import {Style} from '../src/ol/style.js';
import {Tile as TileLayer, Vector as VectorLayer} from '../src/ol/layer.js';
import {fromLonLat} from '../src/ol/proj.js';
const columbusCircleCoords = fromLonLat([-73.98189, 40.76805]);
const labelTextStroke = 'rgba(120, 120, 120, 1)';
const labelText = 'Columbus Circle';
let pointerOverFeature = null;
const renderLabelText = (ctx, x, y, stroke) => {
ctx.fillStyle = 'rgba(255,0,0,1)';
ctx.strokeStyle = stroke;
ctx.lineWidth = 1;
ctx.textAlign = 'center';
ctx.textBaseline = 'middle';
ctx.font = `bold 30px verdana`;
ctx.filter = 'drop-shadow(7px 7px 2px #e81)';
ctx.fillText(labelText, x, y);
ctx.strokeText(labelText, x, y);
};
const circleFeature = new Feature({
geometry: new Circle(columbusCircleCoords, 50),
});
circleFeature.set('label-color', labelTextStroke);
circleFeature.setStyle(
new Style({
renderer(coordinates, state) {
const [[x, y], [x1, y1]] = coordinates;
const ctx = state.context;
const dx = x1 - x;
const dy = y1 - y;
const radius = Math.sqrt(dx * dx + dy * dy);
const innerRadius = 0;
const outerRadius = radius * 1.4;
const gradient = ctx.createRadialGradient(
x,
y,
innerRadius,
x,
y,
outerRadius
);
gradient.addColorStop(0, 'rgba(255,0,0,0)');
gradient.addColorStop(0.6, 'rgba(255,0,0,0.2)');
gradient.addColorStop(1, 'rgba(255,0,0,0.8)');
ctx.beginPath();
ctx.arc(x, y, radius, 0, 2 * Math.PI, true);
ctx.fillStyle = gradient;
ctx.fill();
ctx.strokeStyle = 'rgba(255,0,0,1)';
ctx.stroke();
renderLabelText(ctx, x, y, circleFeature.get('label-color'));
},
hitDetectionRenderer(coordinates, state) {
const [x, y] = coordinates[0];
const ctx = state.context;
renderLabelText(ctx, x, y, circleFeature.get('label-color'));
},
})
);
const map = new Map({
layers: [
new TileLayer({
source: new OSM(),
visible: true,
}),
new VectorLayer({
source: new VectorSource({
features: [circleFeature],
}),
}),
],
target: 'map',
view: new View({
center: columbusCircleCoords,
zoom: 19,
}),
});
map.on('pointermove', (evt) => {
const featureOver = map.forEachFeatureAtPixel(evt.pixel, (feature) => {
feature.set('label-color', 'rgba(255,255,255,1)');
return feature;
});
if (pointerOverFeature && pointerOverFeature != featureOver) {
pointerOverFeature.set('label-color', labelTextStroke);
}
pointerOverFeature = featureOver;
});

View File

@@ -7,7 +7,7 @@ docs: >
Note that the built in interaction `ol/interaction/Translate` might be a better option for moving features.
tags: "drag, feature, vector, editing, custom, interaction"
cloak:
- key: pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2pzbmg0Nmk5MGF5NzQzbzRnbDNoeHJrbiJ9.7_-_gL8ur7ZtEiNwRfCy7Q
- key: pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2t0cGdwMHVnMGdlbzMxbDhwazBic2xrNSJ9.WbcTL9uj8JPAsnT9mgb7oQ
value: Your Mapbox access token from https://mapbox.com/ here
---
<div id="map" class="map"></div>

View File

@@ -131,7 +131,7 @@ const polygonFeature = new Feature(
);
const key =
'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2pzbmg0Nmk5MGF5NzQzbzRnbDNoeHJrbiJ9.7_-_gL8ur7ZtEiNwRfCy7Q';
'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2t0cGdwMHVnMGdlbzMxbDhwazBic2xrNSJ9.WbcTL9uj8JPAsnT9mgb7oQ';
const map = new Map({
interactions: defaultInteractions().extend([new Drag()]),

View File

@@ -31,7 +31,8 @@ const map = new Map({
context.fillText(`y: ${y}`, half, half + lineHeight);
context.strokeRect(0, 0, size, size);
const data = context.getImageData(0, 0, size, size).data;
return Promise.resolve(data);
// converting to Uint8Array for increased browser compatibility
return Promise.resolve(new Uint8Array(data.buffer));
},
// disable opacity transition to avoid overlapping labels during tile loading
transition: 0,

View File

@@ -56,10 +56,12 @@ imagery.on('prerender', function (evt) {
const control = document.getElementById('opacity');
const output = document.getElementById('output');
control.addEventListener('input', function () {
const listener = function () {
output.innerText = control.value;
imagery.setOpacity(control.value / 100);
});
};
control.addEventListener('input', listener);
control.addEventListener('change', listener);
output.innerText = control.value;
imagery.setOpacity(control.value / 100);

View File

@@ -179,8 +179,9 @@ const featureOverlay = new VectorLayer({
}),
});
document.getElementById('time').addEventListener('input', function () {
const value = parseInt(this.value, 10) / 100;
const control = document.getElementById('time');
const listener = function () {
const value = parseInt(control.value, 10) / 100;
const m = time.start + time.duration * value;
vectorSource.forEachFeature(function (feature) {
const geometry =
@@ -198,4 +199,6 @@ document.getElementById('time').addEventListener('input', function () {
}
});
map.render();
});
};
control.addEventListener('input', listener);
control.addEventListener('change', listener);

View File

@@ -8,7 +8,7 @@ docs: >
to limit rendering based on an extent (approximate country bounds).
tags: "extent, tilejson"
cloak:
- key: pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2pzbmg0Nmk5MGF5NzQzbzRnbDNoeHJrbiJ9.7_-_gL8ur7ZtEiNwRfCy7Q
- key: pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2t0cGdwMHVnMGdlbzMxbDhwazBic2xrNSJ9.WbcTL9uj8JPAsnT9mgb7oQ
value: Your Mapbox access token from https://mapbox.com/ here
---
<div id="map" class="map"></div>

View File

@@ -16,7 +16,7 @@ const extents = {
};
const key =
'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2pzbmg0Nmk5MGF5NzQzbzRnbDNoeHJrbiJ9.7_-_gL8ur7ZtEiNwRfCy7Q';
'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2t0cGdwMHVnMGdlbzMxbDhwazBic2xrNSJ9.WbcTL9uj8JPAsnT9mgb7oQ';
const base = new TileLayer({
source: new TileJSON({

View File

@@ -8,7 +8,7 @@ tags: "tilejson, input, bind, group, layergroup"
resources:
- https://code.jquery.com/jquery-3.5.1.min.js
cloak:
- key: pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2pzbmg0Nmk5MGF5NzQzbzRnbDNoeHJrbiJ9.7_-_gL8ur7ZtEiNwRfCy7Q
- key: pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2t0cGdwMHVnMGdlbzMxbDhwazBic2xrNSJ9.WbcTL9uj8JPAsnT9mgb7oQ
value: Your Mapbox access token from https://mapbox.com/ here
---
<div id="map" class="map"></div>

View File

@@ -6,7 +6,7 @@ import {Group as LayerGroup, Tile as TileLayer} from '../src/ol/layer.js';
import {fromLonLat} from '../src/ol/proj.js';
const key =
'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2pzbmg0Nmk5MGF5NzQzbzRnbDNoeHJrbiJ9.7_-_gL8ur7ZtEiNwRfCy7Q';
'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2t0cGdwMHVnMGdlbzMxbDhwazBic2xrNSJ9.WbcTL9uj8JPAsnT9mgb7oQ';
const map = new Map({
layers: [
@@ -49,7 +49,7 @@ function bindInputs(layerid, layer) {
visibilityInput.prop('checked', layer.getVisible());
const opacityInput = $(layerid + ' input.opacity');
opacityInput.on('input', function () {
opacityInput.on('input change', function () {
layer.setOpacity(parseFloat(this.value));
});
opacityInput.val(String(layer.getOpacity()));

View File

@@ -57,10 +57,8 @@ aerial.on('postrender', function (event) {
ctx.restore();
});
swipe.addEventListener(
'input',
function () {
map.render();
},
false
);
const listener = function () {
map.render();
};
swipe.addEventListener('input', listener);
swipe.addEventListener('change', listener);

View File

@@ -9,7 +9,7 @@ docs: >
layers (provided they all share the same source).
tags: "mapbox, studio, vector, tiles"
cloak:
- key: pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2pzbmg0Nmk5MGF5NzQzbzRnbDNoeHJrbiJ9.7_-_gL8ur7ZtEiNwRfCy7Q
- key: pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2t0cGdwMHVnMGdlbzMxbDhwazBic2xrNSJ9.WbcTL9uj8JPAsnT9mgb7oQ
value: Your Mapbox access token from https://mapbox.com/ here
---
<div id="map" class="map"></div>

View File

@@ -8,7 +8,7 @@ const map = new Map({
new MapboxVector({
styleUrl: 'mapbox://styles/mapbox/bright-v9',
accessToken:
'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2pzbmg0Nmk5MGF5NzQzbzRnbDNoeHJrbiJ9.7_-_gL8ur7ZtEiNwRfCy7Q',
'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2t0cGdwMHVnMGdlbzMxbDhwazBic2xrNSJ9.WbcTL9uj8JPAsnT9mgb7oQ',
}),
],
view: new View({

View File

@@ -8,7 +8,7 @@ tags: "mapbox, vector, tiles, mobile, grid"
resources:
- resources/mapbox-streets-v6-style.js
cloak:
- key: pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2pzbmg0Nmk5MGF5NzQzbzRnbDNoeHJrbiJ9.7_-_gL8ur7ZtEiNwRfCy7Q
- key: pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2t0cGdwMHVnMGdlbzMxbDhwazBic2xrNSJ9.WbcTL9uj8JPAsnT9mgb7oQ
value: Your Mapbox access token from https://mapbox.com/ here
---
<div id="map" class="map"></div>

View File

@@ -8,7 +8,7 @@ import {Fill, Icon, Stroke, Style, Text} from '../src/ol/style.js';
import {get as getProjection} from '../src/ol/proj.js';
const key =
'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2pzbmg0Nmk5MGF5NzQzbzRnbDNoeHJrbiJ9.7_-_gL8ur7ZtEiNwRfCy7Q';
'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2t0cGdwMHVnMGdlbzMxbDhwazBic2xrNSJ9.WbcTL9uj8JPAsnT9mgb7oQ';
// Calculation of resolutions that match zoom levels 1, 3, 5, 7, 9, 11, 13, 15.
const resolutions = [];

View File

@@ -8,7 +8,7 @@ tags: "simple, mapbox, vector, tiles"
resources:
- resources/mapbox-streets-v6-style.js
cloak:
- key: pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2pzbmg0Nmk5MGF5NzQzbzRnbDNoeHJrbiJ9.7_-_gL8ur7ZtEiNwRfCy7Q
- key: pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2t0cGdwMHVnMGdlbzMxbDhwazBic2xrNSJ9.WbcTL9uj8JPAsnT9mgb7oQ
value: Your Mapbox access token from https://mapbox.com/ here
---
<div id="map" class="map"></div>

View File

@@ -6,7 +6,7 @@ import View from '../src/ol/View.js';
import {Fill, Icon, Stroke, Style, Text} from '../src/ol/style.js';
const key =
'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2pzbmg0Nmk5MGF5NzQzbzRnbDNoeHJrbiJ9.7_-_gL8ur7ZtEiNwRfCy7Q';
'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2t0cGdwMHVnMGdlbzMxbDhwazBic2xrNSJ9.WbcTL9uj8JPAsnT9mgb7oQ';
const map = new Map({
layers: [

View File

@@ -8,7 +8,7 @@ docs: >
<p>The rendering of the layers are here controlled using minResolution and maxResolution options.</p>
tags: "minResolution, maxResolution, resolution"
cloak:
- key: pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2pzbmg0Nmk5MGF5NzQzbzRnbDNoeHJrbiJ9.7_-_gL8ur7ZtEiNwRfCy7Q
- key: pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2t0cGdwMHVnMGdlbzMxbDhwazBic2xrNSJ9.WbcTL9uj8JPAsnT9mgb7oQ
value: Your Mapbox access token from https://mapbox.com/ here
---
<div id="map" class="map"></div>

View File

@@ -5,7 +5,7 @@ import TileLayer from '../src/ol/layer/Tile.js';
import View from '../src/ol/View.js';
const key =
'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2pzbmg0Nmk5MGF5NzQzbzRnbDNoeHJrbiJ9.7_-_gL8ur7ZtEiNwRfCy7Q';
'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2t0cGdwMHVnMGdlbzMxbDhwazBic2xrNSJ9.WbcTL9uj8JPAsnT9mgb7oQ';
/**
* Create the map.

3
examples/numpytile.css Normal file
View File

@@ -0,0 +1,3 @@
input[type="range"] {
vertical-align: text-bottom;
}

22
examples/numpytile.html Normal file
View File

@@ -0,0 +1,22 @@
---
layout: example.html
title: Rendering 16-bit NumpyTiles
shortdesc: Renders a multi-byte depth source image directly using WebGL.
docs: >
This example uses a <code>ol/source/DataTile</code> source to load multi-byte raster data in the
<a href="https://github.com/planetlabs/numpytiles-spec/">NumpyTile</a> format.
The source is rendered with a <code>ol/layer/WebGLTile</code> layer. Adjusting the sliders above
performs a contrast stretch by adjusting the style variables set on the layer.
tags: "numpytiles, webgl"
resources:
- https://unpkg.com/@planet/ol-numpytiles@2.0.2/umd/NumpyLoader.js
---
<div id="map" class="map"></div>
<div>
<h5>Contrast stretch</h5>
<ul>
<li>Min <input type="range" min="1000" max="10000" id="input-min"/> <span id="output-min"></span></li>
<li>Max <input type="range" min="10000" max="50000" id="input-max"/> <span id="output-max"></span></li>
</ul>
</div>

109
examples/numpytile.js Normal file
View File

@@ -0,0 +1,109 @@
import DataTileSource from '../src/ol/source/DataTile.js';
import Map from '../src/ol/Map.js';
import TileLayer from '../src/ol/layer/WebGLTile.js';
import View from '../src/ol/View.js';
import {fromLonLat} from '../src/ol/proj.js';
// 16-bit COG
// Which will be served as NumpyTiles.
const COG =
'https://storage.googleapis.com/open-cogs/stac-examples/20201211_223832_CS2_analytic.tif';
function numpyTileLoader(z, x, y) {
const url = `https://api.cogeo.xyz/cog/tiles/WebMercatorQuad/${z}/${x}/${y}@1x?format=npy&url=${encodeURIComponent(
COG
)}`;
return fetch(url)
.then((r) => r.arrayBuffer())
.then((buffer) => NumpyLoader.fromArrayBuffer(buffer))
.then((numpyData) => {
// flatten the numpy data
const dataTile = new Float32Array(256 * 256 * 5);
const bandSize = 256 * 256;
for (let x = 0; x < 256; x++) {
for (let y = 0; y < 256; y++) {
const px = x + y * 256;
dataTile[px * 5 + 0] = numpyData.data[y * 256 + x];
dataTile[px * 5 + 1] = numpyData.data[bandSize + y * 256 + x];
dataTile[px * 5 + 2] = numpyData.data[bandSize * 2 + y * 256 + x];
dataTile[px * 5 + 3] = numpyData.data[bandSize * 3 + y * 256 + x];
dataTile[px * 5 + 4] =
numpyData.data[bandSize * 4 + y * 256 + x] > 0 ? 1.0 : 0;
}
}
return dataTile;
});
}
const interpolateBand = (bandIdx) => [
'interpolate',
['linear'],
['band', bandIdx],
['var', 'bMin'],
0,
['var', 'bMax'],
1,
];
const initialMin = 3000;
const initialMax = 18000;
const numpyLayer = new TileLayer({
style: {
color: [
'array',
interpolateBand(3),
interpolateBand(2),
interpolateBand(1),
['band', 5],
],
variables: {
'bMin': initialMin,
'bMax': initialMax,
},
},
source: new DataTileSource({
loader: numpyTileLoader,
bandCount: 5,
}),
});
const map = new Map({
target: 'map',
layers: [numpyLayer],
view: new View({
center: fromLonLat([172.933, 1.3567]),
zoom: 15,
}),
});
const inputMin = document.getElementById('input-min');
const inputMax = document.getElementById('input-max');
const outputMin = document.getElementById('output-min');
const outputMax = document.getElementById('output-max');
const handleMin = (evt) => {
numpyLayer.updateStyleVariables({
'bMin': parseFloat(evt.target.value),
'bMax': parseFloat(inputMax.value),
});
outputMin.innerText = evt.target.value;
};
inputMin.addEventListener('input', handleMin);
inputMin.addEventListener('change', handleMin);
const handleMax = (evt) => {
numpyLayer.updateStyleVariables({
'bMin': parseFloat(inputMin.value),
'bMax': parseFloat(evt.target.value),
});
outputMax.innerText = evt.target.value;
};
inputMax.addEventListener('input', handleMax);
inputMax.addEventListener('change', handleMax);
inputMin.value = initialMin;
inputMax.value = initialMax;
outputMin.innerText = initialMin;
outputMax.innerText = initialMax;

View File

@@ -88,6 +88,9 @@ function loadStyles() {
this.context = context;
this.container = {
firstElementChild: canvas,
style: {
opacity: layer.getOpacity(),
},
};
rendererTransform = transform;
};

View File

@@ -137,7 +137,9 @@ function updateControlValue() {
}
updateControlValue();
thresholdControl.addEventListener('input', function () {
const listener = function () {
updateControlValue();
raster.changed();
});
};
thresholdControl.addEventListener('input', listener);
thresholdControl.addEventListener('change', listener);

View File

@@ -0,0 +1,21 @@
if (typeof Promise !== 'undefined' && !Promise.allSettled && Array.from) {
Promise.allSettled =
function (promises) {
return Promise.all(
Array.from(
promises,
function (p) {
return p.then (
function (value) {
return {status: 'fulfilled', value: value};
}
).catch(
function (reason) {
return {status: 'rejected', reason: reason};
}
);
}
)
)
};
}

View File

@@ -122,13 +122,15 @@ ol.inline>li {
background: url(map-background.jpg) repeat;
margin-bottom: 10px;
}
.ol-control {
line-height: normal;
}
.ol-attribution.ol-logo-only,
.ol-attribution.ol-uncollapsible {
max-width: calc(100% - 3em);
}
.ol-attribution ul {
font-size: 14px;
}
.iframe-info iframe {
width: 100%;
}

View File

@@ -5,7 +5,7 @@ shortdesc: Updating a tile source by changing the URL.
docs: >
You can call <code>source.setUrl()</code> to update the URL for a tile source. Note that when you change the URL for a tile source, existing tiles will not be replaced until new tiles are loaded. If you are interested instead in clearing currently rendered tiles, you can call the <code>source.refresh()</code> method. Alternatively, you can use two separate sources if you want to remove rendered tiles and start over loading new tiles.
cloak:
- key: pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2pzbmg0Nmk5MGF5NzQzbzRnbDNoeHJrbiJ9.7_-_gL8ur7ZtEiNwRfCy7Q
- key: pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2t0cGdwMHVnMGdlbzMxbDhwazBic2xrNSJ9.WbcTL9uj8JPAsnT9mgb7oQ
value: Your Mapbox access token from https://mapbox.com/ here
---
<div id="map" class="map"></div>

View File

@@ -4,7 +4,7 @@ import View from '../src/ol/View.js';
import XYZ from '../src/ol/source/XYZ.js';
const key =
'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2pzbmg0Nmk5MGF5NzQzbzRnbDNoeHJrbiJ9.7_-_gL8ur7ZtEiNwRfCy7Q';
'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2t0cGdwMHVnMGdlbzMxbDhwazBic2xrNSJ9.WbcTL9uj8JPAsnT9mgb7oQ';
const baseUrl = 'https://{a-c}.tiles.mapbox.com/v4';
const urls = [
baseUrl + '/mapbox.blue-marble-topo-jan/{z}/{x}/{y}.png?access_token=' + key,

View File

@@ -67,10 +67,12 @@ const map = new Map({
const control = document.getElementById('level');
const output = document.getElementById('output');
control.addEventListener('input', function () {
const listener = function () {
output.innerText = control.value;
raster.changed();
});
};
control.addEventListener('input', listener);
control.addEventListener('change', listener);
output.innerText = control.value;
raster.on('beforeoperations', function (event) {

View File

@@ -6,7 +6,7 @@ docs: >
This example will display a tiled MaxBox layer semi-transparently over an OSM background. The OSM layer is changed to black and white by using a CSS filter.
tags: "transparent, osm, tilejson, css"
cloak:
- key: pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2pzbmg0Nmk5MGF5NzQzbzRnbDNoeHJrbiJ9.7_-_gL8ur7ZtEiNwRfCy7Q
- key: pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2t0cGdwMHVnMGdlbzMxbDhwazBic2xrNSJ9.WbcTL9uj8JPAsnT9mgb7oQ
value: Your Mapbox access token from https://mapbox.com/ here
---
<div id="map" class="map"></div>

View File

@@ -6,7 +6,7 @@ import View from '../src/ol/View.js';
import {fromLonLat} from '../src/ol/proj.js';
const key =
'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2pzbmg0Nmk5MGF5NzQzbzRnbDNoeHJrbiJ9.7_-_gL8ur7ZtEiNwRfCy7Q';
'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2t0cGdwMHVnMGdlbzMxbDhwazBic2xrNSJ9.WbcTL9uj8JPAsnT9mgb7oQ';
const map = new Map({
layers: [

View File

@@ -159,10 +159,12 @@ const controls = {};
controlIds.forEach(function (id) {
const control = document.getElementById(id);
const output = document.getElementById(id + 'Out');
control.addEventListener('input', function () {
const listener = function () {
output.innerText = control.value;
raster.changed();
});
};
control.addEventListener('input', listener);
control.addEventListener('change', listener);
output.innerText = control.value;
controls[id] = control;
});

View File

@@ -69,6 +69,7 @@
<link rel="stylesheet" href="./resources/layout.css" type="text/css">
<script src="https://unpkg.com/elm-pep"></script>
<script src="https://cdn.polyfill.io/v3/polyfill.min.js?features=fetch,requestAnimationFrame,Element.prototype.classList,URL,TextDecoder,Number.isInteger"></script>
<script src="./resources/Promise.allSettled.js"></script>
{{{ extraHead.local }}}
{{{ css.tag }}}
<title>{{ title }}</title>

View File

@@ -10,7 +10,7 @@ docs: >
renders a tile loading progress bar at the bottom of the map.</p>
tags: "tile, events, loading"
cloak:
- key: pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2pzbmg0Nmk5MGF5NzQzbzRnbDNoeHJrbiJ9.7_-_gL8ur7ZtEiNwRfCy7Q
- key: pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2t0cGdwMHVnMGdlbzMxbDhwazBic2xrNSJ9.WbcTL9uj8JPAsnT9mgb7oQ
value: Your Mapbox access token from https://mapbox.com/ here
---
<div class="wrapper">

View File

@@ -7,7 +7,7 @@ docs: >
Tiles made with <a href="https://tilemill-project.github.io/tilemill/">TileMill</a>. Hosting on <a href="https://www.mapbox.com/">mapbox.com</a> or with open-source <a href="https://github.com/maptiler/tileserver-php">TileServer</a>.
tags: "utfgrid, tilejson"
cloak:
- key: pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2pzbmg0Nmk5MGF5NzQzbzRnbDNoeHJrbiJ9.7_-_gL8ur7ZtEiNwRfCy7Q
- key: pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2t0cGdwMHVnMGdlbzMxbDhwazBic2xrNSJ9.WbcTL9uj8JPAsnT9mgb7oQ
value: Your Mapbox access token from https://mapbox.com/ here
---
<div id="map" class="map"></div>

View File

@@ -6,7 +6,7 @@ import UTFGrid from '../src/ol/source/UTFGrid.js';
import View from '../src/ol/View.js';
const key =
'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2pzbmg0Nmk5MGF5NzQzbzRnbDNoeHJrbiJ9.7_-_gL8ur7ZtEiNwRfCy7Q';
'pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2t0cGdwMHVnMGdlbzMxbDhwazBic2xrNSJ9.WbcTL9uj8JPAsnT9mgb7oQ';
const mapLayer = new TileLayer({
source: new TileJSON({

View File

@@ -0,0 +1,16 @@
---
layout: example.html
title: WFS with geographic coordinates
shortdesc: Example of using WFS with a Tile strategy.
docs: >
This example loads new features from GeoServer WFS with a tile based loading strategy.
Calling the <code>useGeographic</code> function in the <code>'ol/proj'</code> module
makes it so the map view uses geographic coordinates (even if the view projection is
not geographic).
tags: "geographic, vector, WFS, tile, strategy, loading, server, maptiler"
cloak:
- key: get_your_own_D6rA4zTHduk6KOKTXzGB
value: Get your own API key at https://www.maptiler.com/cloud/
experimental: true
---
<div id="map" class="map"></div>

View File

@@ -0,0 +1,60 @@
import GeoJSON from '../src/ol/format/GeoJSON.js';
import Map from '../src/ol/Map.js';
import VectorSource from '../src/ol/source/Vector.js';
import View from '../src/ol/View.js';
import XYZ from '../src/ol/source/XYZ.js';
import {Stroke, Style} from '../src/ol/style.js';
import {Tile as TileLayer, Vector as VectorLayer} from '../src/ol/layer.js';
import {createXYZ} from '../src/ol/tilegrid.js';
import {tile} from '../src/ol/loadingstrategy.js';
import {useGeographic} from '../src/ol/proj.js';
useGeographic();
const vectorSource = new VectorSource({
format: new GeoJSON(),
url: function (extent) {
return (
'https://ahocevar.com/geoserver/wfs?service=WFS&' +
'version=1.1.0&request=GetFeature&typename=osm:water_areas&' +
'outputFormat=application/json&srsname=EPSG:4326&' +
'bbox=' +
extent.join(',') +
',EPSG:4326'
);
},
strategy: tile(createXYZ({tileSize: 512})),
});
const vector = new VectorLayer({
source: vectorSource,
style: new Style({
stroke: new Stroke({
color: 'rgba(0, 0, 255, 1.0)',
width: 2,
}),
}),
});
const key = 'get_your_own_D6rA4zTHduk6KOKTXzGB';
const attributions =
'<a href="https://www.maptiler.com/copyright/" target="_blank">&copy; MapTiler</a> ' +
'<a href="https://www.openstreetmap.org/copyright" target="_blank">&copy; OpenStreetMap contributors</a>';
const raster = new TileLayer({
source: new XYZ({
attributions: attributions,
url: 'https://api.maptiler.com/tiles/satellite/{z}/{x}/{y}.jpg?key=' + key,
maxZoom: 20,
}),
});
const map = new Map({
layers: [raster, vector],
target: document.getElementById('map'),
view: new View({
center: [-80.0298, 43.4578],
maxZoom: 19,
zoom: 12,
}),
});

View File

@@ -11,7 +11,7 @@ docs: >
values ranging from 0 to 1. The <code>band</code> operator is used to select normalized values
from a single band.
</p><p>
After converting the normalized RGB values to elevation, the <code>interpolate</code> expression
After converting the normalized RGB values to elevation, the <code>case</code> expression
is used to pick colors to apply at a given elevation. Instead of using constant
numeric values as the stops in the colors array, the <code>var</code> operator allows you to
use a value that can be modified by your application. When the user drags the

View File

@@ -9,7 +9,24 @@ const attributions =
'<a href="https://www.maptiler.com/copyright/" target="_blank">&copy; MapTiler</a> ' +
'<a href="https://www.openstreetmap.org/copyright" target="_blank">&copy; OpenStreetMap contributors</a>';
const elevation = new TileLayer({
// band math operates on normalized values from 0-1
// so we scale by 255 to align with the elevation formula
// from https://cloud.maptiler.com/tiles/terrain-rgb/
const elevation = [
'+',
-10000,
[
'*',
0.1 * 255,
[
'+',
['*', 256 * 256, ['band', 1]],
['+', ['*', 256, ['band', 2]], ['band', 3]],
],
],
];
const layer = new TileLayer({
opacity: 0.6,
source: new XYZ({
url:
@@ -23,28 +40,10 @@ const elevation = new TileLayer({
level: 0,
},
color: [
'interpolate',
['linear'],
// band math operates on normalized values from 0-1
// so we scale by 255 to align with the elevation formula
// from https://cloud.maptiler.com/tiles/terrain-rgb/
[
'+',
-10000,
[
'*',
0.1 * 255,
[
'+',
['*', 256 * 256, ['band', 1]],
['+', ['*', 256, ['band', 2]], ['band', 3]],
],
],
],
// use the `level` style variable as a stop in the color ramp
['var', 'level'],
'case',
// use the `level` style variable to determine the color
['<=', elevation, ['var', 'level']],
[139, 212, 255, 1],
['+', 0.01, ['var', 'level']],
[139, 212, 255, 0],
],
},
@@ -61,7 +60,7 @@ const map = new Map({
tileSize: 512,
}),
}),
elevation,
layer,
],
view: new View({
center: fromLonLat([-122.3267, 37.8377]),
@@ -71,10 +70,12 @@ const map = new Map({
const control = document.getElementById('level');
const output = document.getElementById('output');
control.addEventListener('input', function () {
const listener = function () {
output.innerText = control.value;
elevation.updateStyleVariables({level: parseFloat(control.value)});
});
layer.updateStyleVariables({level: parseFloat(control.value)});
};
control.addEventListener('input', listener);
control.addEventListener('change', listener);
output.innerText = control.value;
const locations = document.getElementsByClassName('location');

View File

@@ -67,10 +67,12 @@ controlIds.forEach(function (id) {
variables[id] = Number(control.value);
}
updateValues();
control.addEventListener('input', () => {
const listener = function () {
updateValues();
shadedRelief.updateStyleVariables(variables);
});
};
control.addEventListener('input', listener);
control.addEventListener('change', listener);
});
const map = new Map({

View File

@@ -38,18 +38,20 @@ const map = new Map({
}),
});
for (const name in variables) {
let variable;
for (variable in variables) {
const name = variable;
const element = document.getElementById(name);
const value = variables[name];
element.value = value.toString();
document.getElementById(`${name}-value`).innerText = `(${value})`;
element.addEventListener('input', function (event) {
document.getElementById(name + '-value').innerText = value.toFixed(2);
const listener = function (event) {
const value = parseFloat(event.target.value);
document.getElementById(`${name}-value`).innerText = `(${value})`;
document.getElementById(name + '-value').innerText = value.toFixed(2);
const updates = {};
updates[name] = value;
layer.updateStyleVariables(updates);
});
};
element.addEventListener('input', listener);
element.addEventListener('change', listener);
}

View File

@@ -1,9 +0,0 @@
{
"env": {
"node": true,
"es6": true
},
"parserOptions": {
"ecmaVersion": 2017
}
}

View File

@@ -18,7 +18,7 @@ export default {
.filter((name) => /^(?!index).*\.html$/.test(name))
.map((name) => name.replace(/\.html$/, ''))
.forEach((example) => {
entry[example] = `./${example}.js`;
entry[example] = ['regenerator-runtime/runtime', `./${example}.js`];
});
return entry;
},
@@ -28,25 +28,13 @@ export default {
{
test: /^((?!es2015-)[\s\S])*\.js$/,
use: {
loader: 'buble-loader',
loader: 'babel-loader',
options: {
transforms: {
dangerousForOf: true,
},
presets: [
['@babel/preset-env', {targets: 'last 2 versions, not dead'}],
],
},
},
include: [
path.join(baseDir, '..', '..', 'src'),
path.join(baseDir, '..'),
path.join(
baseDir,
'..',
'..',
'node_modules',
'@mapbox',
'mapbox-gl-style-spec'
),
],
},
{
test: /\.js$/,
@@ -63,10 +51,6 @@ export default {
// Do not minify examples that inject code into workers
exclude: [/(color-manipulation|region-growing|raster)\.js/],
extractComments: false,
terserOptions: {
// Mangle private members convention with underscore suffix
mangle: {properties: {regex: /_$/}},
},
}),
],
runtimeChunk: {

View File

@@ -1,5 +1,6 @@
import assert from 'assert';
import frontMatter from 'front-matter';
import fs from 'fs';
import fse from 'fs-extra';
import handlebars from 'handlebars';
import marked from 'marked';
@@ -17,6 +18,11 @@ const isTemplateJs =
/\/(jquery(-\d+\.\d+\.\d+)?|(bootstrap(\.bundle)?))(\.min)?\.js(\?.*)?$/;
const isTemplateCss = /\/bootstrap(\.min)?\.css(\?.*)?$/;
const exampleDirContents = fs
.readdirSync(path.join(baseDir, '..'))
.filter((name) => /^(?!index).*\.html$/.test(name))
.map((name) => name.replace(/\.html$/, ''));
let cachedPackageInfo = null;
async function getPackageInfo() {
if (cachedPackageInfo) {
@@ -188,7 +194,7 @@ export default class ExampleBuilder {
}
const name = filename.replace(/\.js$/, '');
if (name === 'index' || name === this.common) {
if (!exampleDirContents.includes(name)) {
continue;
}

View File

@@ -61,13 +61,11 @@ const map = new Map({
],
});
const updateSourceDimension = function (source, sliderVal) {
source.updateDimensions({'threshold': sliderVal});
document.getElementById('theinfo').innerHTML = sliderVal + ' meters';
const slider = document.getElementById('slider');
const updateSourceDimension = function () {
wmtsSource.updateDimensions({'threshold': slider.value});
document.getElementById('theinfo').innerHTML = slider.value + ' meters';
};
updateSourceDimension(wmtsSource, 10);
document.getElementById('slider').addEventListener('input', function () {
updateSourceDimension(wmtsSource, this.value);
});
slider.addEventListener('input', updateSourceDimension);
slider.addEventListener('change', updateSourceDimension);
updateSourceDimension();

View File

@@ -10,9 +10,9 @@ import {getTopLeft, getWidth} from '../src/ol/extent.js';
const projection = getProjection('EPSG:3857');
const projectionExtent = projection.getExtent();
const size = getWidth(projectionExtent) / 256;
const resolutions = new Array(14);
const matrixIds = new Array(14);
for (let z = 0; z < 14; ++z) {
const resolutions = new Array(19);
const matrixIds = new Array(19);
for (let z = 0; z < 19; ++z) {
// generate resolutions and matrixIds arrays for this WMTS
resolutions[z] = size / Math.pow(2, z);
matrixIds[z] = z;
@@ -22,19 +22,16 @@ const map = new Map({
layers: [
new TileLayer({
source: new OSM(),
opacity: 0.7,
}),
new TileLayer({
opacity: 0.7,
source: new WMTS({
attributions:
'Tiles © <a href="https://services.arcgisonline.com/arcgis/rest/' +
'services/Demographics/USA_Population_Density/MapServer/">ArcGIS</a>',
url:
'https://services.arcgisonline.com/arcgis/rest/' +
'services/Demographics/USA_Population_Density/MapServer/WMTS/',
layer: '0',
matrixSet: 'EPSG:3857',
'Tiles © <a href="https://mrdata.usgs.gov/geology/state/"' +
' target="_blank">USGS</a>',
url: 'https://mrdata.usgs.gov/mapcache/wmts',
layer: 'sgmc2',
matrixSet: 'GoogleMapsCompatible',
format: 'image/png',
projection: projection,
tileGrid: new WMTSTileGrid({

3023
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "ol",
"version": "6.7.0",
"version": "6.9.0",
"description": "OpenLayers mapping library",
"keywords": [
"map",
@@ -23,7 +23,7 @@
"build-package": "npm run transpile && npm run copy-css && npm run generate-types && node tasks/prepare-package.js",
"build-index": "shx rm -f build/index.js && npm run build-package && node tasks/generate-index.js",
"build-legacy": "shx rm -rf build/legacy && npm run build-index && webpack --config config/webpack-config-legacy-build.mjs && cleancss --source-map src/ol/ol.css -o build/legacy/ol.css",
"build-site": "shx rm -rf build/site && npm run build-examples && npm run apidoc && shx mkdir -p build/site && shx cp site/index.html build/site/ && shx mv build/apidoc build/examples build/site/",
"build-site": "shx rm -rf build/site && npm run build-examples && npm run apidoc && npm run build-legacy && shx mkdir -p build/site && shx cp site/index.html build/site/ && shx mv build/apidoc build/examples build/legacy build/site/",
"copy-css": "shx cp src/ol/ol.css build/ol/ol.css",
"generate-types": "npx --package=typescript@3.8.3 -y -- tsc --project config/tsconfig-build.json --declaration --declarationMap --emitDeclarationOnly --outdir build/ol",
"transpile": "shx rm -rf build/ol && shx mkdir -p build/ol && shx cp -rf src/ol build/ol/src && node tasks/serialize-workers.cjs && npx --package=typescript@4.3.5 -y -- tsc --project config/tsconfig-build.json",
@@ -45,34 +45,31 @@
"url": "https://opencollective.com/openlayers"
},
"dependencies": {
"geotiff": "^1.0.5",
"ol-mapbox-style": "^6.4.1",
"geotiff": "^1.0.8",
"ol-mapbox-style": "^6.5.1",
"pbf": "3.2.1",
"rbush": "^3.0.1"
},
"devDependencies": {
"@babel/core": "^7.6.4",
"@babel/eslint-parser": "^7.13.14",
"@babel/preset-env": "^7.4.4",
"@openlayers/eslint-plugin": "^4.0.0",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^20.0.0",
"@rollup/plugin-commonjs": "^21.0.0",
"@rollup/plugin-node-resolve": "^13.0.0",
"@types/arcgis-rest-api": "^10.4.4",
"@types/geojson": "^7946.0.7",
"@types/pbf": "^3.0.2",
"@types/topojson-specification": "^1.0.1",
"babel-loader": "^8.2.2",
"buble": "^0.20.0",
"buble-loader": "^0.5.1",
"chaikin-smooth": "^1.0.4",
"clean-css-cli": "5.3.3",
"clean-css-cli": "5.4.1",
"copy-webpack-plugin": "^9.0.0",
"coverage-istanbul-loader": "^3.0.5",
"coveralls": "3.1.1",
"es-main": "^1.0.2",
"eslint": "^7.2.0",
"eslint-config-openlayers": "^15.0.0",
"eslint": "^7.32.0",
"eslint-config-openlayers": "^16.0.1",
"expect.js": "0.3.1",
"express": "^4.17.1",
"front-matter": "^4.0.0",
@@ -93,12 +90,12 @@
"karma-sourcemap-loader": "^0.3.8",
"karma-webpack": "^5.0.0",
"loglevelnext": "^5.0.5",
"marked": "3.0.2",
"mocha": "9.1.1",
"marked": "3.0.7",
"mocha": "9.1.2",
"pixelmatch": "^5.1.0",
"pngjs": "^6.0.0",
"proj4": "^2.7.5",
"puppeteer": "10.2.0",
"puppeteer": "10.4.0",
"regenerator-runtime": "^0.13.9",
"rollup": "^2.42.3",
"rollup-plugin-terser": "^7.0.2",
@@ -106,6 +103,7 @@
"shx": "^0.3.2",
"sinon": "^11.1.1",
"terser-webpack-plugin": "^5.1.1",
"threads": "^1.6.5",
"url-polyfill": "^1.1.5",
"walk": "^2.3.9",
"webpack": "^5.27.2",
@@ -118,10 +116,6 @@
},
"eslintConfig": {
"extends": "openlayers",
"parser": "@babel/eslint-parser",
"parserOptions": {
"requireConfigFile": false
},
"plugins": [
"@openlayers"
],

View File

@@ -4,11 +4,32 @@
<title>OpenLayers</title>
<link href='https://fonts.googleapis.com/css?family=Quattrocento+Sans:400,400italic,700' rel='stylesheet' type='text/css'>
<link href='https://openlayers.org/assets/theme/site.css' rel='stylesheet' type='text/css'>
<link href="./legacy/ol.css" rel='stylesheet' type='text/css'>
<!-- Pointer events polyfill for old browsers, see https://caniuse.com/#feat=pointer -->
<script src="https://unpkg.com/elm-pep"></script>
<!-- The line below is only needed for old environments like Internet Explorer and Android 4.x -->
<script src="https://cdn.polyfill.io/v3/polyfill.min.js?features=fetch,requestAnimationFrame,Element.prototype.classList,URL,TextDecoder,Number.isInteger"></script>
</head>
<body>
<ul>
<li><a href="./apidoc/">API Docs</a></li>
<li><a href="./examples/">Examples</a></li>
</ul>
<div id="map" style="width:400px;height:400px;"></div>
<script src="./legacy/ol.js"></script>
<script>
new ol.Map({
target: 'map',
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
})
],
view: new ol.View({
center: [0, 0],
zoom: 0
})
})
</script>
</body>
</html>

View File

@@ -81,12 +81,12 @@ class Collection extends BaseObject {
super();
/***
* @type {CollectionOnSignature<import("./Observable.js").OnReturn>}
* @type {CollectionOnSignature<import("./events").EventsKey>}
*/
this.on;
/***
* @type {CollectionOnSignature<import("./Observable.js").OnReturn>}
* @type {CollectionOnSignature<import("./events").EventsKey>}
*/
this.once;

View File

@@ -5,8 +5,9 @@ import Tile from './Tile.js';
import TileState from './TileState.js';
/**
* Data that can be used with a DataTile.
* @typedef {Uint8Array|Uint8ClampedArray|DataView} Data
* Data that can be used with a DataTile. For increased browser compatibility, use
* Uint8Array instead of Uint8ClampedArray where possible.
* @typedef {Uint8Array|Uint8ClampedArray|Float32Array|DataView} Data
*/
/**

View File

@@ -83,12 +83,12 @@ class Feature extends BaseObject {
super();
/***
* @type {FeatureOnSignature<import("./Observable.js").OnReturn>}
* @type {FeatureOnSignature<import("./events").EventsKey>}
*/
this.on;
/***
* @type {FeatureOnSignature<import("./Observable.js").OnReturn>}
* @type {FeatureOnSignature<import("./events").EventsKey>}
*/
this.once;

View File

@@ -107,12 +107,12 @@ class Geolocation extends BaseObject {
super();
/***
* @type {GeolocationOnSignature<import("./Observable.js").OnReturn>}
* @type {GeolocationOnSignature<import("./events").EventsKey>}
*/
this.on;
/***
* @type {GeolocationOnSignature<import("./Observable.js").OnReturn>}
* @type {GeolocationOnSignature<import("./events").EventsKey>}
*/
this.once;

View File

@@ -95,12 +95,12 @@ class BaseObject extends Observable {
super();
/***
* @type {ObjectOnSignature<import("./Observable.js").OnReturn>}
* @type {ObjectOnSignature<import("./events").EventsKey>}
*/
this.on;
/***
* @type {ObjectOnSignature<import("./Observable.js").OnReturn>}
* @type {ObjectOnSignature<import("./events").EventsKey>}
*/
this.once;

View File

@@ -9,23 +9,24 @@ import {listen, listenOnce, unlistenByKey} from './events.js';
* @template {string} Type
* @template {Event|import("./events/Event.js").default} EventClass
* @template Return
* @typedef {(type: Type|Type[], listener: (event: EventClass) => ?) => Return} OnSignature
* @typedef {(type: Type, listener: (event: EventClass) => ?) => Return} OnSignature
*/
/***
* @template {string} Type
* @template Return
* @typedef {(type: Type[], listener: (event: Event|import("./events/Event").default) => ?) => Return} CombinedOnSignature
*/
/***
* @typedef {import("./events").EventsKey|Array<import("./events").EventsKey>} OnReturn
* @typedef {(type: Type[], listener: (event: Event|import("./events/Event").default) => ?) => Return extends void ? void : Return[]} CombinedOnSignature
*/
/**
* @typedef {'change'|'error'} EventTypes
*/
/***
* @template Return
* @typedef {OnSignature<EventTypes, import("./events/Event.js").default, Return> & CombinedOnSignature<EventTypes, Return>} ObservableOnSignature
*/
/**
* @classdesc
* Abstract base class; normally only used for creating subclasses and not
@@ -41,20 +42,17 @@ class Observable extends EventTarget {
constructor() {
super();
/***
* @type {OnSignature<EventTypes, import("./events/Event.js").default, OnReturn>}
*/
this.on = this.onInternal;
this.on =
/** @type {ObservableOnSignature<import("./events").EventsKey>} */ (
this.onInternal
);
/***
* @type {OnSignature<EventTypes, import("./events/Event.js").default, OnReturn>}
*/
this.once = this.onceInternal;
this.once =
/** @type {ObservableOnSignature<import("./events").EventsKey>} */ (
this.onceInternal
);
/***
* @type {OnSignature<EventTypes, import("./events/Event.js").default, void>}
*/
this.un = this.unInternal;
this.un = /** @type {ObservableOnSignature<void>} */ (this.unInternal);
/**
* @private
@@ -84,7 +82,7 @@ class Observable extends EventTarget {
/**
* @param {string|Array<string>} type Type.
* @param {function(?): ?} listener Listener.
* @param {function((Event|import("./events/Event").default)): ?} listener Listener.
* @return {import("./events.js").EventsKey|Array<import("./events.js").EventsKey>} Event key.
* @protected
*/
@@ -103,7 +101,7 @@ class Observable extends EventTarget {
/**
* @param {string|Array<string>} type Type.
* @param {function(?): ?} listener Listener.
* @param {function((Event|import("./events/Event").default)): ?} listener Listener.
* @return {import("./events.js").EventsKey|Array<import("./events.js").EventsKey>} Event key.
* @protected
*/
@@ -125,7 +123,7 @@ class Observable extends EventTarget {
/**
* Unlisten for a certain type of event.
* @param {string|Array<string>} type Type.
* @param {function(?): ?} listener Listener.
* @param {function((Event|import("./events/Event").default)): ?} listener Listener.
* @protected
*/
unInternal(type, listener) {

View File

@@ -123,12 +123,12 @@ class Overlay extends BaseObject {
super();
/***
* @type {OverlayOnSignature<import("./Observable").OnReturn>}
* @type {OverlayOnSignature<import("./events").EventsKey>}
*/
this.on;
/***
* @type {OverlayOnSignature<import("./Observable").OnReturn>}
* @type {OverlayOnSignature<import("./events").EventsKey>}
*/
this.once;

View File

@@ -48,6 +48,7 @@ import {removeNode} from './dom.js';
* @property {import("./transform.js").Transform} coordinateToPixelTransform CoordinateToPixelTransform.
* @property {import("rbush").default} declutterTree DeclutterTree.
* @property {null|import("./extent.js").Extent} extent Extent.
* @property {import("./extent.js").Extent} [nextExtent] Next extent during an animation series.
* @property {number} index Index.
* @property {Array<import("./layer/Layer.js").State>} layerStatesArray LayerStatesArray.
* @property {number} layerIndex LayerIndex.
@@ -137,7 +138,7 @@ import {removeNode} from './dom.js';
* element itself or the `id` of the element. If not specified at construction
* time, {@link module:ol/Map~Map#setTarget} must be called for the map to be
* rendered. If passed by element, the container can be in a secondary document.
* @property {View} [view] The map's view. No layer sources will be
* @property {View|Promise<import("./View.js").ViewOptions>} [view] The map's view. No layer sources will be
* fetched unless this is specified at construction time or through
* {@link module:ol/Map~Map#setView}.
*/
@@ -158,12 +159,12 @@ class PluggableMap extends BaseObject {
super();
/***
* @type {PluggableMapOnSignature<import("./Observable.js").OnReturn>}
* @type {PluggableMapOnSignature<import("./events").EventsKey>}
*/
this.on;
/***
* @type {PluggableMapOnSignature<import("./Observable.js").OnReturn>}
* @type {PluggableMapOnSignature<import("./events").EventsKey>}
*/
this.once;
@@ -388,6 +389,13 @@ class PluggableMap extends BaseObject {
// is "defined" already.
this.setProperties(optionsInternal.values);
const map = this;
if (options.view && !(options.view instanceof View)) {
options.view.then(function (viewOptions) {
map.setView(new View(viewOptions));
});
}
this.controls.addEventListener(
CollectionEventType.ADD,
/**
@@ -840,6 +848,23 @@ class PluggableMap extends BaseObject {
return /** @type {LayerGroup} */ (this.get(MapProperty.LAYERGROUP));
}
/**
* Clear any existing layers and add layers to the map.
* @param {Array<import("./layer/Base.js").default>|Collection<import("./layer/Base.js").default>} layers The layers to be added to the map.
* @api
*/
setLayers(layers) {
const group = this.getLayerGroup();
if (layers instanceof Collection) {
group.setLayers(layers);
return;
}
const collection = group.getLayers();
collection.clear();
collection.extend(layers);
}
/**
* Get the collection of layers associated with this map.
* @return {!Collection<import("./layer/Base.js").default>} Layers.
@@ -1412,6 +1437,18 @@ class PluggableMap extends BaseObject {
viewHints: viewHints,
wantedTiles: {},
};
if (viewState.nextCenter && viewState.nextResolution) {
const rotation = isNaN(viewState.nextRotation)
? viewState.rotation
: viewState.nextRotation;
frameState.nextExtent = getForViewAndSize(
viewState.nextCenter,
viewState.nextResolution,
rotation,
size
);
}
}
this.frameState_ = frameState;
@@ -1496,12 +1533,24 @@ class PluggableMap extends BaseObject {
/**
* Set the view for this map.
* @param {View} view The view that controls this map.
* @param {View|Promise<import("./View.js").ViewOptions>} view The view that controls this map.
* It is also possible to pass a promise that resolves to options for constructing a view. This
* alternative allows view properties to be resolved by sources or other components that load
* view-related metadata.
* @observable
* @api
*/
setView(view) {
this.set(MapProperty.VIEW, view);
if (!view || view instanceof View) {
this.set(MapProperty.VIEW, view);
return;
}
this.set(MapProperty.VIEW, new View());
const map = this;
view.then(function (viewOptions) {
map.setView(new View(viewOptions));
});
}
/**
@@ -1600,7 +1649,7 @@ function createOptionsInternal(options) {
values[MapProperty.TARGET] = options.target;
values[MapProperty.VIEW] =
options.view !== undefined ? options.view : new View();
options.view instanceof View ? options.view : new View();
let controls;
if (options.controls !== undefined) {

View File

@@ -208,6 +208,9 @@ import {fromExtent as polygonFromExtent} from './geom/Polygon.js';
* @property {import("./coordinate.js").Coordinate} center Center.
* @property {import("./proj/Projection.js").default} projection Projection.
* @property {number} resolution Resolution.
* @property {import("./coordinate.js").Coordinate} [nextCenter] The next center during an animation series.
* @property {number} [nextResolution] The next resolution during an animation series.
* @property {number} [nextRotation] The next rotation during an animation series.
* @property {number} rotation Rotation.
* @property {number} zoom Zoom.
*/
@@ -309,12 +312,12 @@ class View extends BaseObject {
super();
/***
* @type {ViewOnSignature<import("./Observable.js").OnReturn>}
* @type {ViewOnSignature<import("./events").EventsKey>}
*/
this.on;
/***
* @type {ViewOnSignature<import("./Observable.js").OnReturn>}
* @type {ViewOnSignature<import("./events").EventsKey>}
*/
this.once;
@@ -374,6 +377,24 @@ class View extends BaseObject {
*/
this.targetRotation_;
/**
* @private
* @type {import("./coordinate.js").Coordinate}
*/
this.nextCenter_ = null;
/**
* @private
* @type {number}
*/
this.nextResolution_;
/**
* @private
* @type {number}
*/
this.nextRotation_;
/**
* @private
* @type {import("./coordinate.js").Coordinate|undefined}
@@ -600,29 +621,36 @@ class View extends BaseObject {
callback = arguments[animationCount - 1];
--animationCount;
}
if (!this.isDef()) {
let i = 0;
for (; i < animationCount && !this.isDef(); ++i) {
// if view properties are not yet set, shortcut to the final state
const state = arguments[animationCount - 1];
const state = arguments[i];
if (state.center) {
this.setCenterInternal(state.center);
}
if (state.zoom !== undefined) {
this.setZoom(state.zoom);
} else if (state.resolution) {
this.setResolution(state.resolution);
}
if (state.rotation !== undefined) {
this.setRotation(state.rotation);
}
}
if (i === animationCount) {
if (callback) {
animationCallback(callback, true);
}
return;
}
let start = Date.now();
let center = this.targetCenter_.slice();
let resolution = this.targetResolution_;
let rotation = this.targetRotation_;
const series = [];
for (let i = 0; i < animationCount; ++i) {
for (; i < animationCount; ++i) {
const options = /** @type {AnimationOptions} */ (arguments[i]);
const animation = {
@@ -714,6 +742,9 @@ class View extends BaseObject {
}
this.animations_.length = 0;
this.cancelAnchor_ = anchor;
this.nextCenter_ = null;
this.nextResolution_ = NaN;
this.nextRotation_ = NaN;
}
/**
@@ -752,6 +783,7 @@ class View extends BaseObject {
const y0 = animation.sourceCenter[1];
const x1 = animation.targetCenter[0];
const y1 = animation.targetCenter[1];
this.nextCenter_ = animation.targetCenter;
const x = x0 + progress * (x1 - x0);
const y = y0 + progress * (y1 - y0);
this.targetCenter_ = [x, y];
@@ -776,6 +808,7 @@ class View extends BaseObject {
animation.anchor
);
}
this.nextResolution_ = animation.targetResolution;
this.targetResolution_ = resolution;
this.applyTargetState_(true);
}
@@ -800,6 +833,7 @@ class View extends BaseObject {
animation.anchor
);
}
this.nextRotation_ = animation.targetRotation;
this.targetRotation_ = rotation;
}
this.applyTargetState_(true);
@@ -811,6 +845,9 @@ class View extends BaseObject {
if (seriesComplete) {
this.animations_[i] = null;
this.setHint(ViewHint.ANIMATING, -1);
this.nextCenter_ = null;
this.nextResolution_ = NaN;
this.nextRotation_ = NaN;
const callback = series[0].callback;
if (callback) {
animationCallback(callback, true);
@@ -1191,7 +1228,7 @@ class View extends BaseObject {
*/
getState() {
const projection = this.getProjection();
const resolution = /** @type {number} */ (this.getResolution());
const resolution = this.getResolution();
const rotation = this.getRotation();
let center = /** @type {import("./coordinate.js").Coordinate} */ (
this.getCenterInternal()
@@ -1211,6 +1248,9 @@ class View extends BaseObject {
center: center.slice(0),
projection: projection !== undefined ? projection : null,
resolution: resolution,
nextCenter: this.nextCenter_,
nextResolution: this.nextResolution_,
nextRotation: this.nextRotation_,
rotation: rotation,
zoom: this.getZoom(),
};

View File

@@ -20,12 +20,12 @@ import {removeChildren, replaceNode} from '../dom.js';
* @property {boolean} [collapsed=true] Specify if attributions should
* be collapsed at startup.
* @property {string} [tipLabel='Attributions'] Text label to use for the button tip.
* @property {string} [label='i'] Text label to use for the
* @property {string|HTMLElement} [label='i'] Text label to use for the
* collapsed attributions button.
* Instead of text, also an element (e.g. a `span` element) can be used.
* @property {string} [expandClassName=className + '-expand'] CSS class name for the
* collapsed attributions button.
* @property {string|HTMLElement} [collapseLabel='»'] Text label to use
* @property {string|HTMLElement} [collapseLabel=''] Text label to use
* for the expanded attributions button.
* Instead of text, also an element (e.g. a `span` element) can be used.
* @property {string} [collapseClassName=className + '-collapse'] CSS class name for the
@@ -105,7 +105,7 @@ class Attribution extends Control {
: className + '-expand';
const collapseLabel =
options.collapseLabel !== undefined ? options.collapseLabel : '\u00BB';
options.collapseLabel !== undefined ? options.collapseLabel : '\u203A';
const collapseClassName =
options.collapseClassName !== undefined

View File

@@ -98,7 +98,7 @@ class Control extends BaseObject {
/**
* Get the map associated with this control.
* @return {import("../PluggableMap.js").default} Map.
* @return {import("../PluggableMap.js").default|undefined} Map.
* @api
*/
getMap() {
@@ -109,7 +109,7 @@ class Control extends BaseObject {
* Remove the control from its current map and attach it to the new map.
* Subclasses may set up event handlers to get notified about changes to
* the map here.
* @param {import("../PluggableMap.js").default} map Map.
* @param {import("../PluggableMap.js").default} [map] Map.
* @api
*/
setMap(map) {

View File

@@ -44,15 +44,15 @@ const FullScreenEventType = {
/**
* @typedef {Object} Options
* @property {string} [className='ol-full-screen'] CSS class name.
* @property {string|Text} [label='\u2922'] Text label to use for the button.
* @property {string|Text|HTMLElement} [label='\u2922'] Text label to use for the button.
* Instead of text, also an element (e.g. a `span` element) can be used.
* @property {string|Text} [labelActive='\u00d7'] Text label to use for the
* @property {string|Text|HTMLElement} [labelActive='\u00d7'] Text label to use for the
* button when full-screen is active.
* Instead of text, also an element (e.g. a `span` element) can be used.
* @property {string} [activeClassName=className + '-true'] CSS class name for the button
* when full-screen is active.
* @property {string} [inactiveClassName=className + '-false'] CSS class name for the button
* when full-screen is inactive.
* Instead of text, also an element (e.g. a `span` element) can be used.
* @property {string} [tipLabel='Toggle full-screen'] Text label to use for the button tip.
* @property {boolean} [keys=false] Full keyboard access.
* @property {HTMLElement|string} [target] Specify a target if you want the
@@ -90,12 +90,12 @@ class FullScreen extends Control {
});
/***
* @type {FullScreenOnSignature<import("../Observable.js").OnReturn>}
* @type {FullScreenOnSignature<import("../events").EventsKey>}
*/
this.on;
/***
* @type {FullScreenOnSignature<import("../Observable.js").OnReturn>}
* @type {FullScreenOnSignature<import("../events").EventsKey>}
*/
this.once;
@@ -133,7 +133,7 @@ class FullScreen extends Control {
/**
* @private
* @type {Text}
* @type {Text|HTMLElement}
*/
this.labelNode_ =
typeof label === 'string' ? document.createTextNode(label) : label;
@@ -143,7 +143,7 @@ class FullScreen extends Control {
/**
* @private
* @type {Text}
* @type {Text|HTMLElement}
*/
this.labelActiveNode_ =
typeof labelActive === 'string'

View File

@@ -80,12 +80,12 @@ class MousePosition extends Control {
});
/***
* @type {MousePositionOnSignature<import("../Observable.js").OnReturn>}
* @type {MousePositionOnSignature<import("../events").EventsKey>}
*/
this.on;
/***
* @type {MousePositionOnSignature<import("../Observable.js").OnReturn>}
* @type {MousePositionOnSignature<import("../events").EventsKey>}
*/
this.once;

View File

@@ -48,12 +48,12 @@ class ControlledMap extends PluggableMap {
* @typedef {Object} Options
* @property {string} [className='ol-overviewmap'] CSS class name.
* @property {boolean} [collapsed=true] Whether the control should start collapsed or not (expanded).
* @property {string|HTMLElement} [collapseLabel='«'] Text label to use for the
* @property {string|HTMLElement} [collapseLabel=''] Text label to use for the
* expanded overviewmap button. Instead of text, also an element (e.g. a `span` element) can be used.
* @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.
* @property {Array<import("../layer/Layer.js").default>|import("../Collection.js").default<import("../layer/Layer.js").default>} [layers]
* @property {Array<import("../layer/Base.js").default>|import("../Collection.js").default<import("../layer/Base.js").default>} [layers]
* Layers for the overview map.
* @property {function(import("../MapEvent.js").default):void} [render] Function called when the control
* should be re-rendered. This is called in a `requestAnimationFrame` callback.
@@ -127,7 +127,7 @@ class OverviewMap extends Control {
options.tipLabel !== undefined ? options.tipLabel : 'Overview map';
const collapseLabel =
options.collapseLabel !== undefined ? options.collapseLabel : '\u00AB';
options.collapseLabel !== undefined ? options.collapseLabel : '\u2039';
if (typeof collapseLabel === 'string') {
/**
@@ -140,7 +140,7 @@ class OverviewMap extends Control {
this.collapseLabel_ = collapseLabel;
}
const label = options.label !== undefined ? options.label : '\u00BB';
const label = options.label !== undefined ? options.label : '\u203A';
if (typeof label === 'string') {
/**

View File

@@ -100,12 +100,12 @@ class ScaleLine extends Control {
});
/***
* @type {ScaleLineOnSignature<import("../Observable.js").OnReturn>}
* @type {ScaleLineOnSignature<import("../events").EventsKey>}
*/
this.on;
/***
* @type {ScaleLineOnSignature<import("../Observable.js").OnReturn>}
* @type {ScaleLineOnSignature<import("../events").EventsKey>}
*/
this.once;

View File

@@ -14,7 +14,7 @@ import {easeOut} from '../easing.js';
* @property {string} [zoomOutClassName=className + '-out'] CSS class name for the zoom-out button.
* @property {string|HTMLElement} [zoomInLabel='+'] Text label to use for the zoom-in
* button. Instead of text, also an element (e.g. a `span` element) can be used.
* @property {string|HTMLElement} [zoomOutLabel='-'] Text label to use for the zoom-out button.
* @property {string|HTMLElement} [zoomOutLabel=''] Text label to use for the zoom-out button.
* Instead of text, also an element (e.g. a `span` element) can be used.
* @property {string} [zoomInTipLabel='Zoom in'] Text label to use for the button tip.
* @property {string} [zoomOutTipLabel='Zoom out'] Text label to use for the button tip.
@@ -61,7 +61,7 @@ class Zoom extends Control {
const zoomInLabel =
options.zoomInLabel !== undefined ? options.zoomInLabel : '+';
const zoomOutLabel =
options.zoomOutLabel !== undefined ? options.zoomOutLabel : '\u2212';
options.zoomOutLabel !== undefined ? options.zoomOutLabel : '\u2013';
const zoomInTipLabel =
options.zoomInTipLabel !== undefined ? options.zoomInTipLabel : 'Zoom in';

View File

@@ -114,3 +114,11 @@ export const getFontParameters = function (fontSpec) {
style.families = style.family.split(/,\s?/);
return style;
};
/**
* @param {number} opacity Opacity (0..1).
* @return {string} CSS opacity.
*/
export function cssOpacity(opacity) {
return opacity === 1 ? '' : String(Math.round(opacity * 100) / 100);
}

View File

@@ -27,7 +27,7 @@ export function createCanvasContext2D(
canvas = new OffscreenCanvas(opt_width || 300, opt_height || 300);
} else {
canvas = document.createElement('canvas');
canvas.style.all = 'initial';
canvas.style.all = 'unset';
}
if (opt_width) {
canvas.width = opt_width;

View File

@@ -90,6 +90,7 @@ const ONLY_WHITESPACE_RE = /^[\s\xa0]*$/;
* is shared with versioned format classes GML2 and GML3.
*
* @abstract
* @api
*/
class GMLBase extends XMLFeature {
/**

View File

@@ -40,7 +40,7 @@ import {includes} from '../array.js';
*/
/**
* @typedef {Object<string,string|number|Array<number|string|IiifProfile>|Object<string, number>|TileInfo>}
* @typedef {Object<string,string|number|Array<number|string|IiifProfile|Object<string, number>|TileInfo>>}
* ImageInformationResponse
*/

View File

@@ -54,7 +54,8 @@ export function drawTextOnPath(
advance();
} while (offset < end - stride && segmentM + segmentLength < startM);
let interpolate = (startM - segmentM) / segmentLength;
let interpolate =
segmentLength === 0 ? 0 : (startM - segmentM) / segmentLength;
const beginX = lerp(x1, x2, interpolate);
const beginY = lerp(y1, y2, interpolate);
@@ -64,7 +65,7 @@ export function drawTextOnPath(
while (offset < end - stride && segmentM + segmentLength < endM) {
advance();
}
interpolate = (endM - segmentM) / segmentLength;
interpolate = segmentLength === 0 ? 0 : (endM - segmentM) / segmentLength;
const endX = lerp(x1, x2, interpolate);
const endY = lerp(y1, y2, interpolate);
@@ -88,11 +89,12 @@ export function drawTextOnPath(
x2 = flatCoordinates[offset];
y2 = flatCoordinates[offset + 1];
let previousAngle;
// All on the same segment
if (singleSegment) {
advance();
let previousAngle = Math.atan2(y2 - y1, x2 - x1);
previousAngle = Math.atan2(y2 - y1, x2 - x1);
if (reverse) {
previousAngle += previousAngle > 0 ? -PI : PI;
}
@@ -102,7 +104,6 @@ export function drawTextOnPath(
return result;
}
let previousAngle;
for (let i = 0, ii = text.length; i < ii; ) {
advance();
let angle = Math.atan2(y2 - y1, x2 - x1);
@@ -137,7 +138,10 @@ export function drawTextOnPath(
const chars = reverse
? text.substring(ii - iStart, ii - i)
: text.substring(iStart, i);
interpolate = (startM + charLength / 2 - segmentM) / segmentLength;
interpolate =
segmentLength === 0
? 0
: (startM + charLength / 2 - segmentM) / segmentLength;
const x = lerp(x1, x2, interpolate);
const y = lerp(y1, y2, interpolate);
result.push([x, y, charLength / 2, angle, chars]);

View File

@@ -89,7 +89,7 @@ export class DragAndDropEvent extends Event {
* Handles input of vector data by drag and drop.
*
* Note that the DragAndDrop interaction uses the TextDecoder() constructor if the supplied
* combinnation of formats read both text string and ArrayBuffer sources. Older browsers such
* combination of formats read both text string and ArrayBuffer sources. Older browsers such
* as IE which do not support this will need a TextDecoder polyfill to be loaded before use.
*
* @api
@@ -108,12 +108,12 @@ class DragAndDrop extends Interaction {
});
/***
* @type {DragAndDropOnSignature<import("../Observable").OnReturn>}
* @type {DragAndDropOnSignature<import("../events").EventsKey>}
*/
this.on;
/***
* @type {DragAndDropOnSignature<import("../Observable").OnReturn>}
* @type {DragAndDropOnSignature<import("../events").EventsKey>}
*/
this.once;

View File

@@ -123,12 +123,12 @@ class DragBox extends PointerInteraction {
super();
/***
* @type {DragBoxOnSignature<import("../Observable").OnReturn>}
* @type {DragBoxOnSignature<import("../events").EventsKey>}
*/
this.on;
/***
* @type {DragBoxOnSignature<import("../Observable").OnReturn>}
* @type {DragBoxOnSignature<import("../events").EventsKey>}
*/
this.once;

View File

@@ -204,12 +204,12 @@ class Draw extends PointerInteraction {
super(pointerOptions);
/***
* @type {DrawOnSignature<import("../Observable").OnReturn>}
* @type {DrawOnSignature<import("../events").EventsKey>}
*/
this.on;
/***
* @type {DrawOnSignature<import("../Observable").OnReturn>}
* @type {DrawOnSignature<import("../events").EventsKey>}
*/
this.once;

View File

@@ -103,12 +103,12 @@ class Extent extends PointerInteraction {
super(/** @type {import("./Pointer.js").Options} */ (options));
/***
* @type {ExtentOnSignature<import("../Observable.js").OnReturn>}
* @type {ExtentOnSignature<import("../events").EventsKey>}
*/
this.on;
/***
* @type {ExtentOnSignature<import("../Observable.js").OnReturn>}
* @type {ExtentOnSignature<import("../events").EventsKey>}
*/
this.once;

View File

@@ -46,12 +46,12 @@ class Interaction extends BaseObject {
super();
/***
* @type {InteractionOnSignature<import("../Observable.js").OnReturn>}
* @type {InteractionOnSignature<import("../events").EventsKey>}
*/
this.on;
/***
* @type {InteractionOnSignature<import("../Observable.js").OnReturn>}
* @type {InteractionOnSignature<import("../events").EventsKey>}
*/
this.once;

View File

@@ -203,12 +203,12 @@ class Modify extends PointerInteraction {
super(/** @type {import("./Pointer.js").Options} */ (options));
/***
* @type {ModifyOnSignature<import("../Observable.js").OnReturn>}
* @type {ModifyOnSignature<import("../events").EventsKey>}
*/
this.on;
/***
* @type {ModifyOnSignature<import("../Observable.js").OnReturn>}
* @type {ModifyOnSignature<import("../events").EventsKey>}
*/
this.once;

View File

@@ -154,8 +154,6 @@ const originalFeatureStyles = {};
* `toggle`, `add`/`remove`, and `multi` options; a `layers` filter; and a
* further feature filter using the `filter` option.
*
* Selected features are added to an internal unmanaged layer.
*
* @fires SelectEvent
* @api
*/
@@ -167,12 +165,12 @@ class Select extends Interaction {
super();
/***
* @type {SelectOnSignature<import("../Observable.js").OnReturn>}
* @type {SelectOnSignature<import("../events").EventsKey>}
*/
this.on;
/***
* @type {SelectOnSignature<import("../Observable.js").OnReturn>}
* @type {SelectOnSignature<import("../events").EventsKey>}
*/
this.once;

View File

@@ -140,12 +140,12 @@ class Translate extends PointerInteraction {
super(/** @type {import("./Pointer.js").Options} */ (options));
/***
* @type {TranslateOnSignature<import("../Observable.js").OnReturn>}
* @type {TranslateOnSignature<import("../events").EventsKey>}
*/
this.on;
/***
* @type {TranslateOnSignature<import("../Observable.js").OnReturn>}
* @type {TranslateOnSignature<import("../events").EventsKey>}
*/
this.once;

View File

@@ -60,12 +60,12 @@ class BaseLayer extends BaseObject {
super();
/***
* @type {BaseLayerOnSignature<import("../Observable.js").OnReturn>}
* @type {BaseLayerOnSignature<import("../events").EventsKey>}
*/
this.on;
/***
* @type {BaseLayerOnSignature<import("../Observable.js").OnReturn>}
* @type {BaseLayerOnSignature<import("../events").EventsKey>}
*/
this.once;

View File

@@ -72,12 +72,12 @@ class BaseTileLayer extends Layer {
super(baseOptions);
/***
* @type {BaseTileLayerOnSignature<import("../Observable.js").OnReturn>}
* @type {BaseTileLayerOnSignature<import("../events").EventsKey>}
*/
this.on;
/***
* @type {BaseTileLayerOnSignature<import("../Observable.js").OnReturn>}
* @type {BaseTileLayerOnSignature<import("../events").EventsKey>}
*/
this.once;

View File

@@ -73,12 +73,12 @@ class LayerGroup extends BaseLayer {
super(baseOptions);
/***
* @type {GroupOnSignature<import("../Observable.js").OnReturn>}
* @type {GroupOnSignature<import("../events").EventsKey>}
*/
this.on;
/***
* @type {GroupOnSignature<import("../Observable.js").OnReturn>}
* @type {GroupOnSignature<import("../events").EventsKey>}
*/
this.once;

View File

@@ -79,7 +79,7 @@ import {listen, unlistenByKey} from '../events.js';
* displayed, irrespective of the source of that data.
*
* Layers are usually added to a map with {@link import("../PluggableMap.js").default#addLayer map.addLayer()}. Components
* like {@link module:ol/interaction/Select~Select} use unmanaged layers
* like {@link module:ol/interaction/Draw~Draw} use unmanaged layers
* internally. These unmanaged layers are associated with the map using
* {@link module:ol/layer/Layer~Layer#setMap} instead.
*
@@ -107,12 +107,12 @@ class Layer extends BaseLayer {
super(baseOptions);
/***
* @type {LayerOnSignature<import("../Observable.js").OnReturn>}
* @type {LayerOnSignature<import("../events").EventsKey>}
*/
this.on;
/***
* @type {LayerOnSignature<import("../Observable.js").OnReturn>}
* @type {LayerOnSignature<import("../events").EventsKey>}
*/
this.once;
@@ -348,6 +348,11 @@ class Layer extends BaseLayer {
* Clean up.
*/
disposeInternal() {
if (this.renderer_) {
this.renderer_.dispose();
delete this.renderer_;
}
this.setSource(null);
super.disposeInternal();
}

Some files were not shown because too many files have changed in this diff Show More