Compare commits

...

343 Commits

Author SHA1 Message Date
Andreas Hocevar
7bf014f747 Updates for the 6.13.0 release 2022-02-27 17:35:57 +01:00
Andreas Hocevar
b15318b6bb Merge pull request #13418 from ahocevar/ol-mapbox-style-rich-text
Update ol-mapbox-style for rich text labels support
2022-02-27 16:36:40 +01:00
Andreas Hocevar
49b5ad6eb9 Update ol-mapbox-style for rich text labels support 2022-02-27 16:31:15 +01:00
Andreas Hocevar
8672e7e97c Merge pull request #13417 from ahocevar/geotiff-resolution-tolerance
Increase GeoTIFF resolutions tolerance
2022-02-27 16:05:35 +01:00
Andreas Hocevar
a1aff21661 Merge pull request #13415 from mike-000/graticule
Check for graticule resolution change and fix unrotated size
2022-02-24 18:18:08 +01:00
Andreas Hocevar
7b880b27d1 Increase GeoTIFF resolutions tolerance 2022-02-24 17:47:21 +01:00
mike-000
69f8a824ec Check for resolution change and fix unrotated size
Calculate unrotated width and height from frame size and resolution
Check for changes in resolution as well as extent when rendered extent fits inside frame
2022-02-24 10:53:32 +00:00
Andreas Hocevar
28c1874241 Merge pull request #13410 from ahocevar/rich-text-labels
Rich text labels
2022-02-23 17:42:09 +01:00
Andreas Hocevar
18f06b8b9a Rich text labels 2022-02-23 12:36:56 +01:00
Tim Schaub
96a90fb14e Merge pull request #13402 from openlayers/dependabot/npm_and_yarn/express-4.17.3
Bump express from 4.17.2 to 4.17.3
2022-02-21 19:22:31 -08:00
Tim Schaub
88624b0737 Merge pull request #13401 from openlayers/dependabot/npm_and_yarn/puppeteer-13.3.2
Bump puppeteer from 13.3.1 to 13.3.2
2022-02-21 19:17:08 -08:00
dependabot[bot]
799bf7b92a Bump express from 4.17.2 to 4.17.3
Bumps [express](https://github.com/expressjs/express) from 4.17.2 to 4.17.3.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.17.2...4.17.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-22 03:16:41 +00:00
Tim Schaub
bf175f1fdb Merge pull request #13403 from openlayers/dependabot/npm_and_yarn/mocha-9.2.1
Bump mocha from 9.2.0 to 9.2.1
2022-02-21 19:15:48 -08:00
Tim Schaub
839ec1f411 Merge pull request #13404 from openlayers/dependabot/npm_and_yarn/webpack-5.69.1
Bump webpack from 5.68.0 to 5.69.1
2022-02-21 19:15:18 -08:00
Tim Schaub
ec07cfc2d9 Merge pull request #13406 from openlayers/dependabot/npm_and_yarn/ol-mapbox-style-6.9.0
Bump ol-mapbox-style from 6.8.3 to 6.9.0
2022-02-21 19:14:15 -08:00
Tim Schaub
7be8173206 Merge pull request #13405 from openlayers/dependabot/npm_and_yarn/rollup-2.67.3
Bump rollup from 2.67.1 to 2.67.3
2022-02-21 19:13:26 -08:00
Tim Schaub
31497aa084 Merge pull request #13407 from openlayers/dependabot/npm_and_yarn/babel/core-7.17.5
Bump @babel/core from 7.17.2 to 7.17.5
2022-02-21 19:12:50 -08:00
dependabot[bot]
6866d4fcee Bump @babel/core from 7.17.2 to 7.17.5
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.17.2 to 7.17.5.
- [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.17.5/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>
2022-02-21 10:02:26 +00:00
dependabot[bot]
bae18ca78a Bump ol-mapbox-style from 6.8.3 to 6.9.0
Bumps [ol-mapbox-style](https://github.com/openlayers/ol-mapbox-style) from 6.8.3 to 6.9.0.
- [Release notes](https://github.com/openlayers/ol-mapbox-style/releases)
- [Changelog](https://github.com/openlayers/ol-mapbox-style/blob/main/CHANGELOG.md)
- [Commits](https://github.com/openlayers/ol-mapbox-style/compare/v6.8.3...v6.9.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-21 10:02:08 +00:00
dependabot[bot]
66ec79bb90 Bump rollup from 2.67.1 to 2.67.3
Bumps [rollup](https://github.com/rollup/rollup) from 2.67.1 to 2.67.3.
- [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.67.1...v2.67.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-21 10:01:54 +00:00
dependabot[bot]
b5fe4932bb Bump webpack from 5.68.0 to 5.69.1
Bumps [webpack](https://github.com/webpack/webpack) from 5.68.0 to 5.69.1.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.68.0...v5.69.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-21 10:01:43 +00:00
dependabot[bot]
98eaae7797 Bump mocha from 9.2.0 to 9.2.1
Bumps [mocha](https://github.com/mochajs/mocha) from 9.2.0 to 9.2.1.
- [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.2.0...v9.2.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-21 10:01:29 +00:00
dependabot[bot]
89e355e136 Bump puppeteer from 13.3.1 to 13.3.2
Bumps [puppeteer](https://github.com/puppeteer/puppeteer) from 13.3.1 to 13.3.2.
- [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/v13.3.1...v13.3.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-21 10:01:03 +00:00
Andreas Hocevar
1f8338d3b8 Merge pull request #13398 from yonda-yonda/update_static_image_change_projection
Clear image when source's image is not ready
2022-02-21 08:42:16 +01:00
yonda-yonda
a631e7ba68 clear image when source status is EMPTY. 2022-02-20 00:26:31 +09:00
MoonE
10eb834337 Merge pull request #13393 from MoonE/view-fixes
Fix setting View resolution or center to undefined
2022-02-19 13:55:08 +01:00
Maximilian Krög
5a49410d82 Center should remain valid when resolution is not set 2022-02-18 00:55:34 +01:00
Maximilian Krög
ab786cff73 Test setting resolution to undefined 2022-02-18 00:52:40 +01:00
Maximilian Krög
19c034fd12 Fix setting center to undefined
It only worked when the coordinate warning was shown, but
fromUserCoordinate shouldn't have been called with undefined in
the first place.
2022-02-18 00:06:56 +01:00
MoonE
57e9a4d1a8 Merge pull request #13390 from MoonE/icon-clone
Fix clone of icon loses imgSize when cache is full
2022-02-17 20:04:32 +01:00
Andreas Hocevar
02b40a7036 Merge pull request #13392 from ahocevar/vectortile-clipping
Use same clipping method for vector and image tiles
2022-02-17 19:07:29 +01:00
Andreas Hocevar
b7d022f80e Use same clipping method for vector and image tiles 2022-02-17 18:12:19 +01:00
Andreas Hocevar
004abcc8a6 Merge pull request #13391 from ahocevar/no-clipping
Less clipping of target resolution tiles
2022-02-17 16:19:00 +01:00
Andreas Hocevar
3b4a2d5966 Remove unused clip code 2022-02-17 15:49:21 +01:00
Andreas Hocevar
c9ff07a695 Reduce the number of clip operations 2022-02-17 15:18:23 +01:00
Maximilian Krög
ab5e4f8838 Fix cloning of Icon style when IconImage is not cached 2022-02-17 00:58:35 +01:00
Maximilian Krög
c74d0a8957 Test cloning IconImage without cache 2022-02-17 00:58:35 +01:00
MoonE
f99c43db4d Merge pull request #13385 from MoonE/jsdoc-references-2
Change remaining links to point to class page instead of module
2022-02-15 19:14:00 +01:00
Andreas Hocevar
76ef4f27d7 Merge pull request #13383 from ahocevar/user-projection
User projection API
2022-02-15 09:30:50 +01:00
Andreas Hocevar
4f614bc81f Remove experimental category from geographic examples 2022-02-15 08:50:29 +01:00
Andreas Hocevar
63fc00902f Warn once when suspicious coordinate are used 2022-02-15 08:50:05 +01:00
Maximilian Krög
f236ff0086 Lower case first letter for function parameter 2022-02-14 22:04:26 +01:00
Maximilian Krög
5788ce51a5 Fix one more link to a class page 2022-02-14 21:53:47 +01:00
Maximilian Krög
b29ab8f104 Link to class instead of module pages 2022-02-14 21:53:07 +01:00
Andreas Hocevar
924686ef71 Merge pull request #13381 from openlayers/dependabot/npm_and_yarn/babel/core-7.17.2
Bump @babel/core from 7.17.0 to 7.17.2
2022-02-14 19:22:21 +01:00
Andreas Hocevar
0755fbfd86 Merge pull request #13379 from openlayers/dependabot/npm_and_yarn/karma-6.3.16
Bump karma from 6.3.15 to 6.3.16
2022-02-14 19:21:50 +01:00
Andreas Hocevar
090986d7cc Merge pull request #13377 from openlayers/dependabot/npm_and_yarn/eslint-8.9.0
Bump eslint from 8.8.0 to 8.9.0
2022-02-14 19:19:45 +01:00
Andreas Hocevar
e9b11fde4d Merge pull request #13376 from openlayers/dependabot/npm_and_yarn/puppeteer-13.3.1
Bump puppeteer from 13.1.3 to 13.3.1
2022-02-14 19:19:09 +01:00
Andreas Hocevar
75a3adccce Add useGeographic() and setUserProjection() to the API 2022-02-14 14:09:49 +01:00
Andreas Hocevar
c7d7ca26ff Merge pull request #13382 from seravifer/main
Fix wrong types when using `"skipLibCheck": false`
2022-02-14 13:45:42 +01:00
Sergi Ávila
f9bc546e1e Fix type on GeoJSON 2022-02-14 12:50:06 +01:00
Sergi Ávila
7e1bbd1c6d Fix type on Circle, return null coordinates 2022-02-14 12:49:19 +01:00
Sergi Ávila
087090c07d Fix wrong array generic type 2022-02-14 12:46:18 +01:00
dependabot[bot]
8d01de21fc Bump @babel/core from 7.17.0 to 7.17.2
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.17.0 to 7.17.2.
- [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.17.2/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>
2022-02-14 10:02:25 +00:00
dependabot[bot]
4feda836f5 Bump karma from 6.3.15 to 6.3.16
Bumps [karma](https://github.com/karma-runner/karma) from 6.3.15 to 6.3.16.
- [Release notes](https://github.com/karma-runner/karma/releases)
- [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md)
- [Commits](https://github.com/karma-runner/karma/compare/v6.3.15...v6.3.16)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-14 10:01:49 +00:00
dependabot[bot]
33b62230b5 Bump eslint from 8.8.0 to 8.9.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.8.0 to 8.9.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.8.0...v8.9.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-14 10:01:19 +00:00
dependabot[bot]
8b28ebbb5e Bump puppeteer from 13.1.3 to 13.3.1
Bumps [puppeteer](https://github.com/puppeteer/puppeteer) from 13.1.3 to 13.3.1.
- [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/v13.1.3...v13.3.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-14 10:01:07 +00:00
MoonE
50c144cea2 Merge pull request #13374 from MoonE/jsdoc-references
Fix JsDoc references
2022-02-13 19:05:39 +01:00
Maximilian Krög
300cf6c2bb Replce description for WebGLHelper.DefaultAttrib 2022-02-13 15:53:18 +01:00
Maximilian Krög
b9f9280260 Use code formatting for argument names in jsdoc 2022-02-13 13:39:10 +01:00
Maximilian Krög
a0dd0054a9 Fix jsdoc references 2022-02-13 13:39:06 +01:00
MoonE
1abd9951d2 Merge pull request #13373 from MoonE/vector-source-is-empty
Fix VectorSource isEmpty without spatial index
2022-02-13 13:34:43 +01:00
Maximilian Krög
e2c9f62cc6 Fix VectorSource isEmpty without spatial index 2022-02-13 00:08:24 +01:00
Maximilian Krög
9bfb0c1b9d Test VectorSource isEmtpty without spatial index 2022-02-13 00:06:26 +01:00
Tim Schaub
7668f4f827 Merge pull request #13372 from openlayers/dependabot/npm_and_yarn/follow-redirects-1.14.8
Bump follow-redirects from 1.14.7 to 1.14.8
2022-02-12 12:13:40 -07:00
dependabot[bot]
5508b2dfd3 Bump follow-redirects from 1.14.7 to 1.14.8
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.7 to 1.14.8.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.7...v1.14.8)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-12 18:53:16 +00:00
Andreas Hocevar
0353f25257 Merge pull request #13371 from ahocevar/vectorimage
Document difference between Vector and VectorImage layers
2022-02-12 17:48:17 +01:00
Andreas Hocevar
53239f7b1e Document difference between Vector and VectorImage layers 2022-02-12 12:57:19 +01:00
MoonE
b5fe0f5b86 Merge pull request #12998 from MoonE/fix-cluster-setSource-type
Fix `ol/source/Cluster#setSource` type annotation
2022-02-11 22:38:47 +01:00
Tim Schaub
437b2a0fc2 Merge pull request #13357 from tschaub/preload
Preload tiles for WebGL tile layers
2022-02-10 14:36:31 -07:00
MoonE
c08f54b5d3 Merge pull request #13358 from MoonE/dispatch-events
Avoid event creation when there are no listeners
2022-02-10 20:54:09 +01:00
Tim Schaub
49fc16ef35 Merge pull request #13363 from mike-000/floor-round-ceil
Add floor, round and ceil to style expressions
2022-02-10 11:46:28 -07:00
mike-000
57db9a6a12 Add floor, round and ceil 2022-02-10 15:37:45 +00:00
Tim Schaub
b120f1d147 Merge pull request #13361 from mike-000/RasterSource-WebGL
Support WebGL layers in ol/source/Raster
2022-02-10 08:02:11 -07:00
mike-000
44136af99d test with interpolated WebGL layer 2022-02-10 12:29:36 +00:00
mike-000
bf199bbe38 handle WebGL layers 2022-02-10 11:40:44 +00:00
Maximilian Krög
ac0b8ff4a4 Add hasListener check around dispatchEvent calls 2022-02-09 22:27:42 +01:00
Maximilian Krög
d35d1cc8ad Avoid creating event object when nobody is listening 2022-02-09 22:27:36 +01:00
Tim Schaub
6f005e1f30 Preload tiles for WebGL tile layers 2022-02-09 14:01:14 -07:00
Tim Schaub
96de98bfbb Merge pull request #13301 from EvertEt/strictnullchecks-2
Improve some null types to prepare for strictNullChecks
2022-02-09 04:51:54 -07:00
Andreas Hocevar
2144422397 Merge pull request #13351 from Amirh0sseinHZ/reset-global-alpha-to-initial-after-mutating-it-for-printing
Reset globalAlpha back to its initial after mutating it for drawing layers
2022-02-09 11:03:33 +01:00
Andreas Hocevar
cf0eb2bc1a Merge pull request #13352 from Amirh0sseinHZ/remove-unnecessary-word-from-developing-md
Removing an unnecessary word from DEVELOPING.md
2022-02-09 11:02:18 +01:00
Amir
df7d6c3794 Removing an unnecessary word from the guide 2022-02-09 10:16:20 +02:00
Tim Schaub
2526a04f2a Merge pull request #13338 from tschaub/get-layer-data
Get pixel data
2022-02-08 20:46:18 -07:00
Tim Schaub
093f64c07d Deprecate map.forEachLayerAtPixel() 2022-02-08 18:30:45 -07:00
Amir
1acf62b6e6 Reset globalAlpha back to its initial after mutating it for drawing layers 2022-02-09 01:50:00 +02:00
MoonE
ce3b59b963 Merge pull request #13350 from MoonE/fix-type-annotation-no-comment
Remove warning for `@type` annotation by jsdoc
2022-02-09 00:38:36 +01:00
Maximilian Krög
725729344c Remove warning for @type annotation by jsdoc 2022-02-08 21:38:41 +01:00
Maximilian Krög
9f8f7afaaa Fix ol/source/Cluster#setSource type annotation 2022-02-08 21:11:23 +01:00
Tim Schaub
97a1c196cc Merge pull request #13334 from EvertEt/strictnullchecks-4
Improve some null types for strictNullChecks
2022-02-08 10:32:32 -07:00
Tim Schaub
bd86639351 Keep track of when a layer is unrendered 2022-02-08 10:23:55 -07:00
Tim Schaub
eb4d5e0784 Get pixel data 2022-02-07 18:35:47 -07:00
MoonE
cd45663996 Merge pull request #13336 from MoonE/dispose-webgl
Dispose of webgl contexts
2022-02-07 22:38:36 +01:00
MoonE
27a5103f3f Merge pull request #13337 from MoonE/fix-rendering-test
Fix error when accessing ready property of renderer
2022-02-07 22:38:05 +01:00
Tim Schaub
d9a11195e0 Merge pull request #13269 from mike-000/TileTexture-tilePixelRatio-gutter
Pass tilePixelRatio and gutter to TileTexture
2022-02-07 13:45:22 -07:00
Andreas Hocevar
ec1eec829c Merge pull request #13328 from EvertEt/strictnullchecks-3
Improve some nullable map types
2022-02-07 21:12:08 +01:00
Tim Schaub
67318d3dd1 Merge pull request #13339 from openlayers/dependabot/npm_and_yarn/geotiff-2.0.4
Bump geotiff from 2.0.3 to 2.0.4
2022-02-07 07:19:36 -07:00
Tim Schaub
b921577a00 Merge pull request #13340 from openlayers/dependabot/npm_and_yarn/globby-13.1.1
Bump globby from 13.1.0 to 13.1.1
2022-02-07 07:18:39 -07:00
Tim Schaub
109eb98c11 Merge pull request #13342 from openlayers/dependabot/npm_and_yarn/rollup-2.67.1
Bump rollup from 2.66.1 to 2.67.1
2022-02-07 07:18:09 -07:00
Tim Schaub
c37ff91608 Merge pull request #13343 from openlayers/dependabot/npm_and_yarn/babel/core-7.17.0
Bump @babel/core from 7.16.12 to 7.17.0
2022-02-07 07:17:17 -07:00
Tim Schaub
8ab132a46c Merge pull request #13344 from openlayers/dependabot/npm_and_yarn/karma-6.3.15
Bump karma from 6.3.12 to 6.3.15
2022-02-07 07:16:20 -07:00
Tim Schaub
ce388c6c30 Merge pull request #13345 from openlayers/dependabot/npm_and_yarn/webpack-5.68.0
Bump webpack from 5.67.0 to 5.68.0
2022-02-07 07:15:33 -07:00
Tim Schaub
b935979bcb Merge pull request #13346 from openlayers/dependabot/npm_and_yarn/webpack-dev-server-4.7.4
Bump webpack-dev-server from 4.7.3 to 4.7.4
2022-02-07 07:14:48 -07:00
Tim Schaub
859f3d19b8 Merge pull request #13348 from openlayers/dependabot/npm_and_yarn/sinon-13.0.1
Bump sinon from 13.0.0 to 13.0.1
2022-02-07 07:13:57 -07:00
dependabot[bot]
cf22ae7d4e Bump sinon from 13.0.0 to 13.0.1
Bumps [sinon](https://github.com/sinonjs/sinon) from 13.0.0 to 13.0.1.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/master/docs/changelog.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v13.0.0...v13.0.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-07 10:03:09 +00:00
dependabot[bot]
1dd6d2ebf9 Bump webpack-dev-server from 4.7.3 to 4.7.4
Bumps [webpack-dev-server](https://github.com/webpack/webpack-dev-server) from 4.7.3 to 4.7.4.
- [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.7.3...v4.7.4)

---
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>
2022-02-07 10:02:38 +00:00
dependabot[bot]
74eba20e9d Bump webpack from 5.67.0 to 5.68.0
Bumps [webpack](https://github.com/webpack/webpack) from 5.67.0 to 5.68.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.67.0...v5.68.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-07 10:02:26 +00:00
dependabot[bot]
5dac75b379 Bump karma from 6.3.12 to 6.3.15
Bumps [karma](https://github.com/karma-runner/karma) from 6.3.12 to 6.3.15.
- [Release notes](https://github.com/karma-runner/karma/releases)
- [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md)
- [Commits](https://github.com/karma-runner/karma/compare/v6.3.12...v6.3.15)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-07 10:02:08 +00:00
dependabot[bot]
26917f5856 Bump @babel/core from 7.16.12 to 7.17.0
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.16.12 to 7.17.0.
- [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.17.0/packages/babel-core)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-07 10:01:58 +00:00
dependabot[bot]
98555f641e Bump rollup from 2.66.1 to 2.67.1
Bumps [rollup](https://github.com/rollup/rollup) from 2.66.1 to 2.67.1.
- [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.66.1...v2.67.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-07 10:01:38 +00:00
dependabot[bot]
6ccb66cfdc Bump globby from 13.1.0 to 13.1.1
Bumps [globby](https://github.com/sindresorhus/globby) from 13.1.0 to 13.1.1.
- [Release notes](https://github.com/sindresorhus/globby/releases)
- [Commits](https://github.com/sindresorhus/globby/compare/v13.1.0...v13.1.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-07 10:01:09 +00:00
dependabot[bot]
624a58cfff Bump geotiff from 2.0.3 to 2.0.4
Bumps [geotiff](https://github.com/geotiffjs/geotiff.js) from 2.0.3 to 2.0.4.
- [Release notes](https://github.com/geotiffjs/geotiff.js/releases)
- [Commits](https://github.com/geotiffjs/geotiff.js/compare/v2.0.3...v2.0.4)

---
updated-dependencies:
- dependency-name: geotiff
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-07 10:00:58 +00:00
EvertEt
7b6afcd1e9 Change map variables from undefined to null for consistency 2022-02-07 08:06:46 +01:00
Maximilian Krög
eaa6146156 Fix error when accessing ready property of renderer 2022-02-07 00:26:53 +01:00
Maximilian Krög
700cdad1e2 Add missing dispose calls for webgl renderer tests 2022-02-07 00:17:32 +01:00
Maximilian Krög
a86f0704f3 Fix error when disposing ol/renderer/webgl/TileLayer
- helper may not exist
- tileTextureCache not cleared when canvasCacheKey changes
2022-02-07 00:17:32 +01:00
Maximilian Krög
a10872baa4 No need to update the style when no source is set 2022-02-07 00:17:29 +01:00
Tim Schaub
5fec74c089 Merge pull request #13333 from tschaub/limited-extent
Avoid rendering outside WebGL layer and source extent
2022-02-06 11:47:38 -07:00
EvertEt
25e1d6c5d6 Improve some null types for strictNullChecks 2022-02-06 19:36:30 +01:00
Tim Schaub
adbbc05159 Avoid rendering outside WebGL layer and source extent 2022-02-05 21:02:22 -07:00
Tim Schaub
459cd51ae2 Quote 2022-02-05 20:58:09 -07:00
Tim Schaub
a3a08d1412 Merge pull request #13332 from tschaub/duplicate-imports
Avoid duplicate imports
2022-02-05 15:19:35 -07:00
Tim Schaub
ccc78d731d Allow duplicate imports in the legacy build 2022-02-05 15:01:36 -07:00
Tim Schaub
f10ba5c1e3 Avoid duplicate imports 2022-02-05 11:46:26 -07:00
Andreas Hocevar
cdd1537a41 Merge pull request #13294 from ahocevar/webglpoints-updatestylevariables
Add updateStyleVariables method to WebGLPoints layer
2022-02-05 01:32:47 +01:00
EvertEt
15de4bb5ab Improve some nullable map types
Closes #13326
2022-02-04 17:05:52 +01:00
Andreas Hocevar
770fcc870b Add updateStyleVariables method to WebGLPoints layer 2022-02-03 22:12:05 +01:00
Andreas Hocevar
5cfb634d89 Merge pull request #13323 from ahocevar/pointslayer-ready
Fix rendercomplete for WebGLPoints layer and subclasses
2022-02-03 22:01:24 +01:00
Maximilian Krög
93c08784af Only set renderer to ready when all messages are received 2022-02-02 22:54:16 +01:00
Maximilian Krög
613d083e46 Test points layer ready state 2022-02-02 22:54:16 +01:00
Andreas Hocevar
7c3c1ac354 Fix rendercomplete for WebGLPoints layer and subclasses 2022-02-01 17:13:37 +01:00
EvertEt
e3d3d24f05 Improve some null types to prepare for strictNullChecks 2022-01-31 19:35:25 +01:00
Andreas Hocevar
10b97d3993 Merge pull request #13318 from openlayers/dependabot/npm_and_yarn/rollup-2.66.1
Bump rollup from 2.66.0 to 2.66.1
2022-01-31 13:24:50 +01:00
Andreas Hocevar
858a314000 Merge pull request #13314 from openlayers/dependabot/npm_and_yarn/karma-6.3.12
Bump karma from 6.3.11 to 6.3.12
2022-01-31 13:24:24 +01:00
Andreas Hocevar
0df65d59e2 Merge pull request #13319 from OSHistory/fixZIndexNotation
fix: fix casing for z-index
2022-01-31 13:23:49 +01:00
Andreas Hocevar
7e44b3e515 Merge pull request #13313 from openlayers/dependabot/npm_and_yarn/geotiff-2.0.3
Bump geotiff from 2.0.2 to 2.0.3
2022-01-31 13:23:24 +01:00
dependabot[bot]
57fd13fb1b Bump rollup from 2.66.0 to 2.66.1
Bumps [rollup](https://github.com/rollup/rollup) from 2.66.0 to 2.66.1.
- [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.66.0...v2.66.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-31 12:16:57 +00:00
Andreas Hocevar
5b53368296 Merge pull request #13317 from openlayers/dependabot/npm_and_yarn/puppeteer-13.1.3
Bump puppeteer from 13.1.1 to 13.1.3
2022-01-31 13:16:29 +01:00
Andreas Hocevar
4541746df2 Merge pull request #13316 from openlayers/dependabot/npm_and_yarn/sinon-13.0.0
Bump sinon from 12.0.1 to 13.0.0
2022-01-31 13:16:00 +01:00
Andreas Hocevar
528589b163 Update import 2022-01-31 13:14:59 +01:00
dependabot[bot]
58707a19c7 Bump karma from 6.3.11 to 6.3.12
Bumps [karma](https://github.com/karma-runner/karma) from 6.3.11 to 6.3.12.
- [Release notes](https://github.com/karma-runner/karma/releases)
- [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md)
- [Commits](https://github.com/karma-runner/karma/compare/v6.3.11...v6.3.12)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-31 12:14:29 +00:00
Andreas Hocevar
2d49a2feb8 Merge pull request #13312 from openlayers/dependabot/npm_and_yarn/jsdoc-3.6.10
Bump jsdoc from 3.6.9 to 3.6.10
2022-01-31 13:13:36 +01:00
Andreas Hocevar
6521aa74e1 Merge pull request #13311 from openlayers/dependabot/npm_and_yarn/copy-webpack-plugin-10.2.4
Bump copy-webpack-plugin from 10.2.1 to 10.2.4
2022-01-31 13:12:34 +01:00
Andreas Hocevar
19c8b78ca9 Merge pull request #13310 from openlayers/dependabot/npm_and_yarn/clean-css-cli-5.5.2
Bump clean-css-cli from 5.5.0 to 5.5.2
2022-01-31 13:12:11 +01:00
OSHistory
bce14074ae fix: fix casing for z-index
The CSS-property z-index had some faulty casings. Only occurs in src/ol/ol.css
2022-01-31 13:09:08 +01:00
Andreas Hocevar
a72259257f Merge pull request #13309 from openlayers/dependabot/npm_and_yarn/eslint-8.8.0
Bump eslint from 8.7.0 to 8.8.0
2022-01-31 13:01:54 +01:00
Andreas Hocevar
fead802107 Merge pull request #13305 from openlayers/dependabot/npm_and_yarn/webpack-cli-4.9.2
Bump webpack-cli from 4.9.1 to 4.9.2
2022-01-31 13:01:34 +01:00
Andreas Hocevar
2a45536d0e Merge pull request #13308 from openlayers/dependabot/npm_and_yarn/globby-13.1.0
Bump globby from 13.0.0 to 13.1.0
2022-01-31 13:00:50 +01:00
dependabot[bot]
c93c6424d0 Bump puppeteer from 13.1.1 to 13.1.3
Bumps [puppeteer](https://github.com/puppeteer/puppeteer) from 13.1.1 to 13.1.3.
- [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/v13.1.1...v13.1.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-31 11:59:30 +00:00
Andreas Hocevar
a4900a6d3b Merge pull request #13307 from openlayers/dependabot/npm_and_yarn/marked-4.0.12
Bump marked from 4.0.10 to 4.0.12
2022-01-31 12:58:55 +01:00
dependabot[bot]
c7d11a1711 Bump webpack-cli from 4.9.1 to 4.9.2
Bumps [webpack-cli](https://github.com/webpack/webpack-cli) from 4.9.1 to 4.9.2.
- [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.9.1...webpack-cli@4.9.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-31 11:05:44 +00:00
dependabot[bot]
06e0439cfc Bump sinon from 12.0.1 to 13.0.0
Bumps [sinon](https://github.com/sinonjs/sinon) from 12.0.1 to 13.0.0.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/master/docs/changelog.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v12.0.1...v13.0.0)

---
updated-dependencies:
- dependency-name: sinon
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-31 11:05:26 +00:00
Andreas Hocevar
711f176ea8 Merge pull request #13306 from openlayers/dependabot/npm_and_yarn/typescript-4.6.0-dev.20220131
Use exactly typescript@4.6.0-beta
2022-01-31 12:04:50 +01:00
Andreas Hocevar
14a555ab28 Use exactly typesript@4.6.0-beta 2022-01-31 11:54:48 +01:00
Frédéric Junod
530015516d Merge pull request #13315 from fredj/attribution_css_typo
Fix typo CSS class name for the expanded attributions button
2022-01-31 11:39:13 +01:00
Frederic Junod
a008d5696b Fix typo CSS class name for the expanded attributions button
See #11403
2022-01-31 11:11:14 +01:00
dependabot[bot]
3fac4eab7e Bump geotiff from 2.0.2 to 2.0.3
Bumps [geotiff](https://github.com/geotiffjs/geotiff.js) from 2.0.2 to 2.0.3.
- [Release notes](https://github.com/geotiffjs/geotiff.js/releases)
- [Commits](https://github.com/geotiffjs/geotiff.js/compare/v2.0.2...v2.0.3)

---
updated-dependencies:
- dependency-name: geotiff
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-31 10:03:11 +00:00
dependabot[bot]
f0dfd75b82 Bump jsdoc from 3.6.9 to 3.6.10
Bumps [jsdoc](https://github.com/jsdoc/jsdoc) from 3.6.9 to 3.6.10.
- [Release notes](https://github.com/jsdoc/jsdoc/releases)
- [Changelog](https://github.com/jsdoc/jsdoc/blob/3.6.10/CHANGES.md)
- [Commits](https://github.com/jsdoc/jsdoc/compare/3.6.9...3.6.10)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-31 10:02:59 +00:00
dependabot[bot]
dc17c3750e Bump copy-webpack-plugin from 10.2.1 to 10.2.4
Bumps [copy-webpack-plugin](https://github.com/webpack-contrib/copy-webpack-plugin) from 10.2.1 to 10.2.4.
- [Release notes](https://github.com/webpack-contrib/copy-webpack-plugin/releases)
- [Changelog](https://github.com/webpack-contrib/copy-webpack-plugin/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/copy-webpack-plugin/compare/v10.2.1...v10.2.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-31 10:02:34 +00:00
dependabot[bot]
f101c4d37f Bump clean-css-cli from 5.5.0 to 5.5.2
Bumps [clean-css-cli](https://github.com/clean-css/clean-css-cli) from 5.5.0 to 5.5.2.
- [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.5.0...v5.5.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-31 10:02:24 +00:00
dependabot[bot]
a4f42b2fc8 Bump eslint from 8.7.0 to 8.8.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.7.0 to 8.8.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.7.0...v8.8.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-31 10:02:09 +00:00
dependabot[bot]
00eeefef9f Bump globby from 13.0.0 to 13.1.0
Bumps [globby](https://github.com/sindresorhus/globby) from 13.0.0 to 13.1.0.
- [Release notes](https://github.com/sindresorhus/globby/releases)
- [Commits](https://github.com/sindresorhus/globby/compare/v13.0.0...v13.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-31 10:01:54 +00:00
dependabot[bot]
02c8b1ad58 Bump marked from 4.0.10 to 4.0.12
Bumps [marked](https://github.com/markedjs/marked) from 4.0.10 to 4.0.12.
- [Release notes](https://github.com/markedjs/marked/releases)
- [Changelog](https://github.com/markedjs/marked/blob/master/.releaserc.json)
- [Commits](https://github.com/markedjs/marked/compare/v4.0.10...v4.0.12)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-31 10:01:42 +00:00
dependabot[bot]
d9a21dd497 Bump typescript from 4.6.0-beta to 4.6.0-dev.20220131
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.6.0-beta to 4.6.0-dev.20220131.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-31 10:01:26 +00:00
Andreas Hocevar
12f8bae261 Merge pull request #13299 from ahocevar/tile-types
Improve types for tile layers
2022-01-30 18:43:15 +01:00
Andreas Hocevar
89c8c909dc Merge pull request #13298 from ahocevar/webglpoints-assert-point
Document geometry type
2022-01-30 18:42:44 +01:00
MoonE
b255e85be9 Merge pull request #13297 from MoonE/from-render-feature
Add function to convert RenderFeature to Feature
2022-01-30 13:53:47 +01:00
Andreas Hocevar
c92e1ec9ab Improve types for tile layers 2022-01-30 09:10:29 +01:00
Andreas Hocevar
7819c180af Document point geometry type requirement 2022-01-30 08:22:09 +01:00
Maximilian Krög
f0e768bb9a Remove case of MulitPolygon RenderFeature 2022-01-29 21:51:29 +01:00
Maximilian Krög
856f239280 Add function to convert RenderFeature to Feature 2022-01-29 17:52:07 +01:00
Maximilian Krög
f2d65ba0ab Only set id if it is defined when creating feature 2022-01-29 16:06:01 +01:00
Andreas Hocevar
9e4d943239 Merge pull request #13292 from ahocevar/geotiff-2
Update to geotiff@2
2022-01-28 15:57:40 +01:00
Andreas Hocevar
fd779c1311 Merge pull request #13293 from ahocevar/setstyle-reset-variables
Re-assign style variables on setStyle()
2022-01-28 15:53:34 +01:00
Andreas Hocevar
2c87fcb4f9 Merge pull request #13261 from XiaofengZeng/ToFixAPIDoc
add @api comment on getAllLayers method
2022-01-28 11:44:50 +01:00
Andreas Hocevar
11e12ef94e Re-assign variables on setStyle() 2022-01-28 07:48:21 +01:00
Andreas Hocevar
59600a0d68 Merge pull request #13290 from constantinius/geotiff-source-options
Allowing to pass additional options to the geotiff.js source
2022-01-28 07:44:35 +01:00
Andreas Hocevar
b5c91b8f05 Update to geotiff@2 2022-01-27 22:31:51 +01:00
Fabian Schindler
441cce8dc7 Update src/ol/source/GeoTIFF.js
Co-authored-by: Andreas Hocevar <andreas.hocevar@gmail.com>
2022-01-27 14:45:25 +01:00
Fabian Schindler
aea62119b2 Update src/ol/source/GeoTIFF.js
Co-authored-by: Andreas Hocevar <andreas.hocevar@gmail.com>
2022-01-27 14:44:59 +01:00
Andreas Hocevar
a1454ce18f Merge pull request #13291 from ahocevar/generics
Defaults for generic types
2022-01-27 11:03:50 +01:00
Andreas Hocevar
94cc414ea2 Defaults for the Layer, Source and Feature generics 2022-01-26 22:40:27 +01:00
Andreas Hocevar
2e5c1f2af9 Updates for TypeScript v4.6.0-beta 2022-01-26 22:40:27 +01:00
Fabian Schindler
1b71d39292 Adding typedef to declare all possible options for
geotiff.js sources
2022-01-26 16:46:47 +01:00
Fabian Schindler
f062b15bd5 Allowing to pass additional options to the
geotiff.js source
2022-01-25 21:52:27 +01:00
Andreas Hocevar
deaa0ccc2a Merge pull request #13281 from openlayers/dependabot/npm_and_yarn/globby-13.0.0
Bump globby from 12.2.0 to 13.0.0
2022-01-24 17:51:53 +01:00
Andreas Hocevar
c0bc6efb39 Merge pull request #13278 from openlayers/dependabot/npm_and_yarn/babel/core-7.16.12
Bump @babel/core from 7.16.7 to 7.16.12
2022-01-24 17:51:28 +01:00
Andreas Hocevar
7619dc3342 Merge pull request #13277 from openlayers/dependabot/npm_and_yarn/webpack-5.67.0
Bump webpack from 5.66.0 to 5.67.0
2022-01-24 17:44:53 +01:00
Andreas Hocevar
c329c2bee6 Merge pull request #13280 from openlayers/dependabot/npm_and_yarn/puppeteer-13.1.1
Bump puppeteer from 13.0.1 to 13.1.1
2022-01-24 17:37:27 +01:00
Andreas Hocevar
9cae73ec45 Merge pull request #13279 from openlayers/dependabot/npm_and_yarn/rollup-2.66.0
Bump rollup from 2.64.0 to 2.66.0
2022-01-24 17:37:00 +01:00
dependabot[bot]
e8b7125d86 Bump globby from 12.2.0 to 13.0.0
Bumps [globby](https://github.com/sindresorhus/globby) from 12.2.0 to 13.0.0.
- [Release notes](https://github.com/sindresorhus/globby/releases)
- [Commits](https://github.com/sindresorhus/globby/compare/v12.2.0...v13.0.0)

---
updated-dependencies:
- dependency-name: globby
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-24 16:36:53 +00:00
Andreas Hocevar
01d00aefb6 Merge pull request #13276 from openlayers/dependabot/npm_and_yarn/babel/preset-env-7.16.11
Bump @babel/preset-env from 7.16.8 to 7.16.11
2022-01-24 17:36:33 +01:00
dependabot[bot]
a99a94b479 Bump webpack from 5.66.0 to 5.67.0
Bumps [webpack](https://github.com/webpack/webpack) from 5.66.0 to 5.67.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.66.0...v5.67.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-24 16:36:20 +00:00
Andreas Hocevar
3453ccefe1 Merge pull request #13275 from openlayers/dependabot/npm_and_yarn/copy-webpack-plugin-10.2.1
Bump copy-webpack-plugin from 10.2.0 to 10.2.1
2022-01-24 17:35:51 +01:00
Andreas Hocevar
0a88fe81a1 Merge pull request #13274 from openlayers/dependabot/npm_and_yarn/jsdoc-3.6.9
Bump jsdoc from 3.6.7 to 3.6.9
2022-01-24 17:35:24 +01:00
Andreas Hocevar
ab65622273 Merge pull request #13273 from openlayers/dependabot/npm_and_yarn/ol-mapbox-style-6.8.3
Bump ol-mapbox-style from 6.8.2 to 6.8.3
2022-01-24 17:35:06 +01:00
Andreas Hocevar
40875e00c6 Merge pull request #13272 from openlayers/dependabot/npm_and_yarn/mocha-9.2.0
Bump mocha from 9.1.4 to 9.2.0
2022-01-24 17:34:40 +01:00
dependabot[bot]
6d241deabe Bump puppeteer from 13.0.1 to 13.1.1
Bumps [puppeteer](https://github.com/puppeteer/puppeteer) from 13.0.1 to 13.1.1.
- [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/v13.0.1...v13.1.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-24 10:03:08 +00:00
dependabot[bot]
3504635ecd Bump rollup from 2.64.0 to 2.66.0
Bumps [rollup](https://github.com/rollup/rollup) from 2.64.0 to 2.66.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.64.0...v2.66.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-24 10:02:55 +00:00
dependabot[bot]
984d841d46 Bump @babel/core from 7.16.7 to 7.16.12
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.16.7 to 7.16.12.
- [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.16.12/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>
2022-01-24 10:02:42 +00:00
dependabot[bot]
1cc9a6dbb1 Bump @babel/preset-env from 7.16.8 to 7.16.11
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.16.8 to 7.16.11.
- [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.16.11/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>
2022-01-24 10:02:13 +00:00
dependabot[bot]
9f84814c9b Bump copy-webpack-plugin from 10.2.0 to 10.2.1
Bumps [copy-webpack-plugin](https://github.com/webpack-contrib/copy-webpack-plugin) from 10.2.0 to 10.2.1.
- [Release notes](https://github.com/webpack-contrib/copy-webpack-plugin/releases)
- [Changelog](https://github.com/webpack-contrib/copy-webpack-plugin/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/copy-webpack-plugin/compare/v10.2.0...v10.2.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-24 10:01:55 +00:00
dependabot[bot]
ac55fc91e8 Bump jsdoc from 3.6.7 to 3.6.9
Bumps [jsdoc](https://github.com/jsdoc/jsdoc) from 3.6.7 to 3.6.9.
- [Release notes](https://github.com/jsdoc/jsdoc/releases)
- [Changelog](https://github.com/jsdoc/jsdoc/blob/3.6.9/CHANGES.md)
- [Commits](https://github.com/jsdoc/jsdoc/compare/3.6.7...3.6.9)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-24 10:01:45 +00:00
dependabot[bot]
4be8138d20 Bump ol-mapbox-style from 6.8.2 to 6.8.3
Bumps [ol-mapbox-style](https://github.com/openlayers/ol-mapbox-style) from 6.8.2 to 6.8.3.
- [Release notes](https://github.com/openlayers/ol-mapbox-style/releases)
- [Changelog](https://github.com/openlayers/ol-mapbox-style/blob/main/CHANGELOG.md)
- [Commits](https://github.com/openlayers/ol-mapbox-style/compare/v6.8.2...v6.8.3)

---
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>
2022-01-24 10:01:25 +00:00
dependabot[bot]
6d14957d5c Bump mocha from 9.1.4 to 9.2.0
Bumps [mocha](https://github.com/mochajs/mocha) from 9.1.4 to 9.2.0.
- [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.4...v9.2.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-24 10:01:10 +00:00
MoonE
239a082dbf Merge pull request #13229 from MoonE/apidoc-dyn-navigation-loading
Load api navigation dynamically to reduce needed disk space
2022-01-23 11:21:31 +01:00
Andreas Hocevar
5f02141bca Merge pull request #13271 from mike-000/utfgrid
Remove unneeded `src=""`
2022-01-23 11:11:12 +01:00
mike-000
29da609dab Remove meaningless src="" 2022-01-22 23:08:31 +00:00
Maximilian Krög
14c5e9a7e8 Load api navigation dynamically to reduce needed disk space 2022-01-22 22:29:33 +01:00
mike-000
6a26e6a274 test gutter 2022-01-20 17:51:17 +00:00
mike-000
2a421b9362 test tilePixelRatio 2022-01-20 17:51:05 +00:00
mike-000
7af366586f Pass tilePixelRatio and gutter to TileTexture 2022-01-20 17:50:49 +00:00
Andreas Hocevar
30d27a1d59 Merge pull request #13212 from ahocevar/multisource-webgl
Support multiple sources for WebGL tile layers
2022-01-19 08:43:22 +01:00
XiaofengZeng
705a37935e add @api comment on getAllLayers method 2022-01-19 11:25:17 +08:00
Andreas Hocevar
d46940acc0 Merge pull request #13259 from mike-000/LiteralSymbolStyle-CORS
Add crossOrigin option to LiteralSymbolStyle
2022-01-19 00:21:05 +01:00
mike-000
70ee68c649 Add crossOrigin option
Co-Authored-By: Andreas Hocevar <andreas.hocevar@gmail.com>
2022-01-18 23:14:30 +00:00
Andreas Hocevar
75f66757ef Simplify example, improve documentation. 2022-01-18 20:05:07 +01:00
Tim Schaub
3e216edbe8 Merge pull request #13246 from openlayers/dependabot/npm_and_yarn/eslint-8.7.0
Bump eslint from 8.6.0 to 8.7.0
2022-01-17 05:59:36 -07:00
Tim Schaub
625334de72 Merge pull request #13247 from openlayers/dependabot/npm_and_yarn/mocha-9.1.4
Bump mocha from 9.1.3 to 9.1.4
2022-01-17 05:52:04 -07:00
dependabot[bot]
ff1017531b Bump eslint from 8.6.0 to 8.7.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.6.0 to 8.7.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.6.0...v8.7.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-17 12:51:38 +00:00
Tim Schaub
3ddb037d4a Merge pull request #13248 from openlayers/dependabot/npm_and_yarn/webpack-sources-3.2.3
Bump webpack-sources from 3.2.2 to 3.2.3
2022-01-17 05:51:13 -07:00
Tim Schaub
c4f1c78848 Merge pull request #13249 from openlayers/dependabot/npm_and_yarn/webpack-5.66.0
Bump webpack from 5.65.0 to 5.66.0
2022-01-17 05:50:33 -07:00
Tim Schaub
8e189c0dca Merge pull request #13250 from openlayers/dependabot/npm_and_yarn/globby-12.2.0
Bump globby from 12.0.2 to 12.2.0
2022-01-17 05:49:34 -07:00
Tim Schaub
46c8523875 Merge pull request #13251 from openlayers/dependabot/npm_and_yarn/babel/preset-env-7.16.8
Bump @babel/preset-env from 7.16.7 to 7.16.8
2022-01-17 05:48:34 -07:00
Tim Schaub
7fd01645fd Merge pull request #13252 from openlayers/dependabot/npm_and_yarn/rollup-2.64.0
Bump rollup from 2.63.0 to 2.64.0
2022-01-17 05:47:56 -07:00
Tim Schaub
0dc11324ff Merge pull request #13253 from openlayers/dependabot/npm_and_yarn/karma-6.3.11
Bump karma from 6.3.10 to 6.3.11
2022-01-17 05:47:05 -07:00
dependabot[bot]
76daa66e10 Bump karma from 6.3.10 to 6.3.11
Bumps [karma](https://github.com/karma-runner/karma) from 6.3.10 to 6.3.11.
- [Release notes](https://github.com/karma-runner/karma/releases)
- [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md)
- [Commits](https://github.com/karma-runner/karma/compare/v6.3.10...v6.3.11)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-17 10:02:43 +00:00
dependabot[bot]
2f2c6b4e70 Bump rollup from 2.63.0 to 2.64.0
Bumps [rollup](https://github.com/rollup/rollup) from 2.63.0 to 2.64.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.63.0...v2.64.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-17 10:02:24 +00:00
dependabot[bot]
12cb31087c Bump @babel/preset-env from 7.16.7 to 7.16.8
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.16.7 to 7.16.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.16.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>
2022-01-17 10:02:11 +00:00
dependabot[bot]
dffece49e9 Bump globby from 12.0.2 to 12.2.0
Bumps [globby](https://github.com/sindresorhus/globby) from 12.0.2 to 12.2.0.
- [Release notes](https://github.com/sindresorhus/globby/releases)
- [Commits](https://github.com/sindresorhus/globby/compare/v12.0.2...v12.2.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-17 10:01:52 +00:00
dependabot[bot]
ff588d29c2 Bump webpack from 5.65.0 to 5.66.0
Bumps [webpack](https://github.com/webpack/webpack) from 5.65.0 to 5.66.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.65.0...v5.66.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-17 10:01:42 +00:00
dependabot[bot]
58d0cc6b19 Bump webpack-sources from 3.2.2 to 3.2.3
Bumps [webpack-sources](https://github.com/webpack/webpack-sources) from 3.2.2 to 3.2.3.
- [Release notes](https://github.com/webpack/webpack-sources/releases)
- [Commits](https://github.com/webpack/webpack-sources/compare/v3.2.2...v3.2.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-17 10:01:29 +00:00
dependabot[bot]
d220138953 Bump mocha from 9.1.3 to 9.1.4
Bumps [mocha](https://github.com/mochajs/mocha) from 9.1.3 to 9.1.4.
- [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.3...v9.1.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-17 10:01:15 +00:00
Tim Schaub
af6dce3cf3 Merge pull request #13243 from openlayers/dependabot/npm_and_yarn/marked-4.0.10
Bump marked from 4.0.9 to 4.0.10
2022-01-14 21:12:44 -07:00
dependabot[bot]
feb396631f Bump marked from 4.0.9 to 4.0.10
Bumps [marked](https://github.com/markedjs/marked) from 4.0.9 to 4.0.10.
- [Release notes](https://github.com/markedjs/marked/releases)
- [Changelog](https://github.com/markedjs/marked/blob/master/.releaserc.json)
- [Commits](https://github.com/markedjs/marked/compare/v4.0.9...v4.0.10)

---
updated-dependencies:
- dependency-name: marked
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-15 01:53:33 +00:00
Tim Schaub
b1d7c48313 Merge pull request #13242 from tschaub/avoid-unpkg-redirect
Avoid the redirect from unpkg.com
2022-01-14 14:17:33 -07:00
Tim Schaub
6c03b69d8c Avoid the redirect from unpkg.com 2022-01-14 13:53:23 -07:00
Tim Schaub
4fb679d3fc Merge pull request #13241 from openlayers/release-v6.12.0
Updates for the 6.12.0 release
2022-01-14 13:27:56 -07:00
Tim Schaub
59bf2998ad Develop on 6.12.1-dev 2022-01-14 13:13:32 -07:00
Tim Schaub
b04d542a3a Updates for the 6.12.0 release 2022-01-14 13:04:59 -07:00
Tim Schaub
f43df3c1e2 Merge pull request #13240 from openlayers/audit-fix
Transitive dependency update
2022-01-14 13:00:13 -07:00
Tim Schaub
c96fee5ba2 Transitive dependency update 2022-01-14 12:51:28 -07:00
Andreas Hocevar
0a439b0129 Merge pull request #13236 from mike-000/reset-interpolation-postrender
Re-enable image smoothing after rendering
2022-01-14 18:47:15 +01:00
Andreas Hocevar
ff5b4177c8 Merge pull request #13237 from mike-000/className-with-declutter
Describe use of className with declutter
2022-01-14 18:17:16 +01:00
mike-000
b5196a65a1 Describe use of className with declutter 2022-01-14 12:35:36 +00:00
mike-000
ec2e3f4f23 Set interpolate for use by VectorImage layers 2022-01-14 10:31:18 +00:00
mike-000
1c81f60fec re-enable image smoothing after rendering 2022-01-14 10:31:17 +00:00
Andreas Hocevar
0004b2594d Support multiple sources for layers 2022-01-13 17:42:52 +01:00
Andreas Hocevar
89f632fa7e Merge pull request #13231 from lklepner/development-tips-fix
added run to npm command
2022-01-12 14:35:50 +01:00
Lou Klepner
11329bb776 added run to npm command 2022-01-12 07:45:15 -05:00
Tim Schaub
b98a95d1b4 Merge pull request #13228 from lklepner/development-tips
Document how to link package during development
2022-01-11 16:24:02 -07:00
Tim Schaub
0fbe83edf7 Merge pull request #13227 from tschaub/default-cors-mode
Default CORS mode for WebGL rendered sources
2022-01-11 16:22:03 -07:00
Lou Klepner
2dfef3f125 added linking instructions 2022-01-11 17:33:55 -05:00
Tim Schaub
1a8df049e4 Merge pull request #13226 from tschaub/gl-wrap-x
Support the wrapX option for WebGL rendered tile sources
2022-01-11 14:23:46 -07:00
Tim Schaub
f511209789 Merge pull request #13224 from tschaub/mapbox-style-update
Update ol-mapbox-style
2022-01-11 14:22:54 -07:00
Tim Schaub
e71a8b65e1 Default CORS request mode for tiles used in WebGL rendering 2022-01-11 14:21:48 -07:00
Tim Schaub
647a0d8ece Support the wrapX option for WebGL rendered tile sources 2022-01-11 12:48:49 -07:00
Tim Schaub
71f737b58a Update ol-mapbox-style 2022-01-11 10:01:14 -07:00
Andreas Hocevar
1f761d943f Merge pull request #13219 from ahocevar/modify-delete-no-event
Do not fire modifyend event when nothing was modified
2022-01-11 13:56:08 +01:00
Andreas Hocevar
0816746505 Merge pull request #13221 from M393/vectortile-interpolate
Draw VectorTiles with interpolate in hybrid mode again
2022-01-11 12:56:17 +01:00
Maximilian Kroeg
430f354406 Draw VectorTiles with interpolate in hybrid mode again 2022-01-11 12:49:07 +01:00
Andreas Hocevar
48ce451f53 Do not fire modifyend event when nothing was modified 2022-01-11 12:45:08 +01:00
Andreas Hocevar
2f9a9af809 Merge pull request #13216 from EvertEt/typos
Fix some typos in ModifyInteraction documentation
2022-01-11 11:18:19 +01:00
Andreas Hocevar
bad590d0de Merge pull request #13217 from EvertEt/fix/13213
Fix MVT incorrect feature data handling
2022-01-11 11:16:46 +01:00
EvertEt
6a26ff4204 Fix MVT incorrect feature data handling
Closes #13213
2022-01-11 11:03:24 +01:00
EvertEt
cd840aaf88 Fix some typos in ModifyInteraction documentation 2022-01-11 11:03:04 +01:00
Andreas Hocevar
e98607e344 Merge pull request #13209 from openlayers/dependabot/npm_and_yarn/karma-6.3.10
Bump karma from 6.3.9 to 6.3.10
2022-01-10 13:36:06 +01:00
Andreas Hocevar
7c9822b9e7 Merge pull request #13211 from openlayers/dependabot/npm_and_yarn/shx-0.3.4
Bump shx from 0.3.3 to 0.3.4
2022-01-10 13:29:13 +01:00
dependabot[bot]
ed758f7655 Bump karma from 6.3.9 to 6.3.10
Bumps [karma](https://github.com/karma-runner/karma) from 6.3.9 to 6.3.10.
- [Release notes](https://github.com/karma-runner/karma/releases)
- [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md)
- [Commits](https://github.com/karma-runner/karma/compare/v6.3.9...v6.3.10)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-10 12:29:05 +00:00
Andreas Hocevar
ff60daaa49 Merge pull request #13210 from openlayers/dependabot/npm_and_yarn/rollup/plugin-node-resolve-13.1.3
Bump @rollup/plugin-node-resolve from 13.1.2 to 13.1.3
2022-01-10 13:28:48 +01:00
Andreas Hocevar
f47b332512 Merge pull request #13208 from openlayers/dependabot/npm_and_yarn/rollup-2.63.0
Bump rollup from 2.62.0 to 2.63.0
2022-01-10 13:28:10 +01:00
Andreas Hocevar
1c0b6e2fe8 Merge pull request #13207 from openlayers/dependabot/npm_and_yarn/marked-4.0.9
Bump marked from 4.0.8 to 4.0.9
2022-01-10 13:27:49 +01:00
dependabot[bot]
3d8c98c865 Bump shx from 0.3.3 to 0.3.4
Bumps [shx](https://github.com/shelljs/shx) from 0.3.3 to 0.3.4.
- [Release notes](https://github.com/shelljs/shx/releases)
- [Changelog](https://github.com/shelljs/shx/blob/master/CHANGELOG.md)
- [Commits](https://github.com/shelljs/shx/compare/v0.3.3...v0.3.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-10 10:01:58 +00:00
dependabot[bot]
acb2c2a69d Bump @rollup/plugin-node-resolve from 13.1.2 to 13.1.3
Bumps [@rollup/plugin-node-resolve](https://github.com/rollup/plugins/tree/HEAD/packages/node-resolve) from 13.1.2 to 13.1.3.
- [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.1.3/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>
2022-01-10 10:01:48 +00:00
dependabot[bot]
b717d63b4c Bump rollup from 2.62.0 to 2.63.0
Bumps [rollup](https://github.com/rollup/rollup) from 2.62.0 to 2.63.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.62.0...v2.63.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-10 10:01:17 +00:00
dependabot[bot]
dbba580f82 Bump marked from 4.0.8 to 4.0.9
Bumps [marked](https://github.com/markedjs/marked) from 4.0.8 to 4.0.9.
- [Release notes](https://github.com/markedjs/marked/releases)
- [Changelog](https://github.com/markedjs/marked/blob/master/.releaserc.json)
- [Commits](https://github.com/markedjs/marked/compare/v4.0.8...v4.0.9)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-10 10:00:59 +00:00
Tim Schaub
866c641c87 Merge pull request #13205 from tschaub/new-changelog
Format the changelog so contributors can be highlighted
2022-01-09 07:32:33 -07:00
Tim Schaub
076fc70b6c Format the changelog so contributors can be highlighted 2022-01-08 19:43:00 -07:00
Tim Schaub
a1643783c5 Merge pull request #13204 from openlayers/release-v6.11.0
Updates for the 6.11.0 release
2022-01-08 16:49:39 -07:00
Tim Schaub
28ca752a64 Develop on 6.11.1-dev 2022-01-08 16:34:38 -07:00
Tim Schaub
bd8a454df1 Updates for the 6.11.0 release 2022-01-08 16:17:52 -07:00
Andreas Hocevar
6de9c828ab Merge pull request #13195 from ahocevar/box-selection
Use getFeaturesInExtent
2022-01-08 21:53:16 +01:00
Tim Schaub
f13838470e Merge pull request #13200 from mike-000/sea-level
Use interpolate option in Sea Level example
2022-01-08 08:43:24 -07:00
Tim Schaub
a9210db25c Merge pull request #13201 from mike-000/typo
Fix typo in example description
2022-01-08 08:38:31 -07:00
Tim Schaub
85d5e5dfad Merge pull request #13177 from tschaub/ecoregions
Use ecoregions data
2022-01-08 08:32:46 -07:00
Tim Schaub
0e93a3118c Merge pull request #13198 from tschaub/no-color
Avoid failure if existing target has no background color
2022-01-08 08:31:47 -07:00
mike-000
449cfd15b1 Fix typo 2022-01-08 14:16:29 +00:00
mike-000
07ebc48516 Replace imageSmoothingEnabled with interpolate 2022-01-08 14:08:42 +00:00
Tim Schaub
a963ab7d1d Avoid failure if existing target has no background color 2022-01-07 15:05:31 -07:00
Tim Schaub
39b2de829e Remove countries from examples data 2022-01-07 13:58:31 -07:00
Tim Schaub
38d4a8f13f Update Sphere Mollweide example 2022-01-07 13:55:34 -07:00
Tim Schaub
197dd2e06d Update translate features example 2022-01-07 13:53:01 -07:00
Tim Schaub
4ce7f77749 Update label decluttering example 2022-01-07 13:50:43 -07:00
Tim Schaub
7f0b6b3f7a Update multi-select example 2022-01-07 13:47:08 -07:00
Tim Schaub
a64102f097 Update modify features example 2022-01-07 13:39:46 -07:00
Tim Schaub
22609f7a7d Update geographic editing example 2022-01-07 13:37:05 -07:00
Tim Schaub
35e1d29d6b Update canvas gradient example 2022-01-07 13:14:52 -07:00
Tim Schaub
eed400ca1c Update select on hover example 2022-01-07 13:00:35 -07:00
Tim Schaub
73f54c1e6c Update vector image layer example 2022-01-07 12:51:28 -07:00
Tim Schaub
71af0eee43 Update select features example 2022-01-07 12:45:27 -07:00
Tim Schaub
43e06a7d57 Update MapboxGL layer example 2022-01-07 12:45:27 -07:00
Tim Schaub
73f36adaaf Update hit detection example 2022-01-07 12:45:27 -07:00
Tim Schaub
2d96c92ac8 Update geojson-vt example 2022-01-07 12:45:27 -07:00
Tim Schaub
9024867893 Update extent interaction example 2022-01-07 12:45:27 -07:00
Tim Schaub
9aa3c00879 Update export map example 2022-01-07 12:45:27 -07:00
Tim Schaub
faddbf098b Update box selection example 2022-01-07 12:45:26 -07:00
Tim Schaub
539eae1398 Update vector layer example 2022-01-07 12:45:26 -07:00
Tim Schaub
e0aa161302 Merge pull request #13186 from mike-000/WebGL-getDataAtPixel
Add getDataAtPixel() method for WebGL
2022-01-07 12:05:10 -07:00
mike-000
9c955bc86d Update forEachLayerAtPixel description 2022-01-07 18:25:20 +00:00
Tim Schaub
ad7b95667f Merge pull request #13196 from bradh/contrast_typo_2022-01-07
typo fix for cog-stretch example
2022-01-06 21:22:47 -07:00
Brad
fc535ab4d0 typo fix for cog-stretch example 2022-01-07 13:29:51 +11:00
Andreas Hocevar
c785c2813b Filter for actual geometry intersection 2022-01-06 21:10:26 +01:00
Andreas Hocevar
a2388756f2 Use getFeaturesInExtent 2022-01-06 20:07:34 +01:00
Andreas Hocevar
69c02aa6c8 Merge pull request #13190 from ahocevar/basevector-type
Fix base vector layer template generics
2022-01-05 16:11:58 +01:00
Andreas Hocevar
f6496aa409 Fix base vector layer template generics 2022-01-04 18:04:53 +01:00
Tim Schaub
2893b78302 Merge pull request #13182 from openlayers/dependabot/npm_and_yarn/eslint-8.6.0
Bump eslint from 8.5.0 to 8.6.0
2022-01-03 07:34:36 -07:00
Tim Schaub
9553396c31 Merge pull request #13184 from openlayers/dependabot/npm_and_yarn/rollup/plugin-node-resolve-13.1.2
Bump @rollup/plugin-node-resolve from 13.1.1 to 13.1.2
2022-01-03 07:33:01 -07:00
Tim Schaub
13101e3ab4 Merge pull request #13183 from openlayers/dependabot/npm_and_yarn/babel/core-7.16.7
Bump @babel/core from 7.16.5 to 7.16.7
2022-01-03 07:32:23 -07:00
Tim Schaub
2dd4f71b51 Merge pull request #13185 from openlayers/dependabot/npm_and_yarn/webpack-dev-server-4.7.2
Bump webpack-dev-server from 4.7.1 to 4.7.2
2022-01-03 07:31:49 -07:00
Tim Schaub
9db298987b Merge pull request #13181 from openlayers/dependabot/npm_and_yarn/babel/preset-env-7.16.7
Bump @babel/preset-env from 7.16.5 to 7.16.7
2022-01-03 07:30:27 -07:00
mike-000
766a336650 Add getDataAtPixel() method for WebGL 2022-01-03 13:00:56 +00:00
mike-000
d85be48da2 Test getDataAtPixel() method for WebGL 2022-01-03 13:00:55 +00:00
dependabot[bot]
ae629301e9 Bump webpack-dev-server from 4.7.1 to 4.7.2
Bumps [webpack-dev-server](https://github.com/webpack/webpack-dev-server) from 4.7.1 to 4.7.2.
- [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.7.1...v4.7.2)

---
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>
2022-01-03 10:02:05 +00:00
dependabot[bot]
7639eff49a Bump @rollup/plugin-node-resolve from 13.1.1 to 13.1.2
Bumps [@rollup/plugin-node-resolve](https://github.com/rollup/plugins/tree/HEAD/packages/node-resolve) from 13.1.1 to 13.1.2.
- [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.1.2/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>
2022-01-03 10:01:52 +00:00
dependabot[bot]
654929bae2 Bump @babel/core from 7.16.5 to 7.16.7
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.16.5 to 7.16.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.16.7/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>
2022-01-03 10:01:42 +00:00
dependabot[bot]
7dd45c66ed Bump eslint from 8.5.0 to 8.6.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.5.0 to 8.6.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.5.0...v8.6.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-03 10:01:25 +00:00
dependabot[bot]
1193476442 Bump @babel/preset-env from 7.16.5 to 7.16.7
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.16.5 to 7.16.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.16.7/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>
2022-01-03 10:01:10 +00:00
Andreas Hocevar
83d3bbf0ab Merge pull request #13180 from ahocevar/geotiff-es
Always use ES modules from geotiff.js
2022-01-02 11:02:43 +01:00
Andreas Hocevar
665da47437 Merge pull request #13179 from ahocevar/blob-or-buffer
Use Buffer and data uri when Blob is not available
2022-01-02 11:01:40 +01:00
Andreas Hocevar
00b7bc60ac Use Buffer and data uri when Blob is not available 2022-01-01 22:47:22 +01:00
Andreas Hocevar
93abfe78a3 Always use ES modules from geotiff.js 2022-01-01 22:41:11 +01:00
Tim Schaub
3506176328 Merge pull request #13178 from tschaub/layer-background
Use background property for vector layers
2022-01-01 11:56:29 -07:00
Tim Schaub
275ecca473 Use background property for vector layers 2022-01-01 11:51:06 -07:00
MoonE
9b0878a94a Merge pull request #13175 from MoonE/nodejs-12-compatibility
Allow nodejs 12 to build the examples again
2021-12-31 23:00:24 +01:00
Tim Schaub
c500fdc4ad Merge pull request #13176 from mike-000/datatile-attributions
Add `attributions` and `attributionsCollapsible` options to `ol/source/DataTile`
2021-12-31 09:24:09 -07:00
mike-000
b1b09619bb Add attributions/attributionsCollapsible options 2021-12-31 14:20:33 +00:00
Maximilian Krög
d63a7ae497 Allow nodejs 12 to build the examples again 2021-12-31 11:06:43 +01:00
Andreas Hocevar
bc2969fd78 Merge pull request #13171 from mike-000/4326-scale-bar
Correct scale bar in EPSG:4326
2021-12-30 17:51:18 +01:00
mike-000
37f117b782 Test scalebar text in EPSG:4326 2021-12-29 23:55:50 +00:00
mike-000
c8a7a83e1f correct getScaleForResolution() 2021-12-29 22:43:53 +00:00
mike-000
e8b4011cf4 new example 2021-12-29 22:43:53 +00:00
Tim Schaub
d6d4b878c2 Merge pull request #13168 from openlayers/release-v6.10.0
Release 6.10.0
2021-12-28 15:59:06 -07:00
Tim Schaub
6570416343 Develop on 6.10.1-dev 2021-12-28 15:52:47 -07:00
263 changed files with 6814 additions and 3615 deletions

View File

@@ -101,7 +101,7 @@ jobs:
run: npm run build-package
- name: Generate the Legacy Build
run: npm run build-legacy && npx eslint --fix build/index.js
run: "npm run build-legacy && npx eslint --rule 'import/no-duplicates: off' --fix build/index.js"
rendering:
name: Rendering

View File

@@ -2,7 +2,7 @@
## Setting up development environment
You will obviously start by
You will start by
[forking](https://github.com/openlayers/openlayers/fork) the OpenLayers repository.
### Development dependencies
@@ -26,6 +26,28 @@ To run the examples you first need to start the dev server:
Then, load <http://localhost:8080/> in your browser.
## Linking Package
The `ol` package is published from the `build/ol` folder of the `openlayers` repo.
After you've cloned the `openlayers` repo locally run the `npm build-package` to prepare the build then use the `npm link` command to connect it your project.
Below is an example of how to build and link it to "sample-project"
$ cd openlayers
$ npm run build-package
$ cd build/ol
$ npm link
$ cd /sample-project
$ npm link ol
To remove the link run the following commands
$ cd sample-project
$ npm unlink --no-save ol
$ cd ../openlayers
$ npm unlink
## Running tests
To run the tests once:

View File

@@ -1,5 +1,27 @@
## Upgrade notes
### Next
### v6.13.0
#### New `layer.getData()` method
Raster layers (static images, image tiles, data tiles) have a new `layer.getData(pixel)` method that returns the pixel data at the provided location. The return value depends on the underlying source data type. For example, a GeoTIFF may return a `Float32Array` with one value per band, while a PNG rendered from a tile layer will return a `Uint8ClampedArray` of RGBA values.
If you were previously using the `map.forEachLayerAtPixel()` method, you should use the new `layer.getData()` method instead. The old method returns composite pixel values from multiple layers and is limited to RGBA values. The new method doesn't suffer from these shortcomings and is more performant.
#### Deprecated `map.forEachLayerAtPixel()` method
The `map.forEachLayerAtPixel()` method has been deprecated. It will be removed (or its behavior may change) in the next major release. Please use the `layer.getData()` method instead.
### v6.12.0
No special changes are required when upgrading to the 6.12.0 release.
### v6.11.0
No special changes are required when upgrading to the 6.11.0 release.
### v6.10.0
#### New `interpolate` option for sources

32
changelog/v6.11.0.md Normal file
View File

@@ -0,0 +1,32 @@
# 6.11.0
This release follows up on the 6.10 release with a fix for Mapbox vector layers rendered over other layers. A handful of other fixes and features are included. See below for more detail.
* [#13195](https://github.com/openlayers/openlayers/pull/13195) - Use getFeaturesInExtent ([@ahocevar](https://github.com/ahocevar))
* [#13200](https://github.com/openlayers/openlayers/pull/13200) - Use interpolate option in Sea Level example ([@mike-000](https://github.com/mike-000))
* [#13201](https://github.com/openlayers/openlayers/pull/13201) - Fix typo in example description ([@mike-000](https://github.com/mike-000))
* [#13177](https://github.com/openlayers/openlayers/pull/13177) - Use ecoregions data ([@tschaub](https://github.com/tschaub))
* [#13198](https://github.com/openlayers/openlayers/pull/13198) - Avoid failure if existing target has no background color ([@tschaub](https://github.com/tschaub))
* [#13186](https://github.com/openlayers/openlayers/pull/13186) - Add getDataAtPixel() method for WebGL ([@mike-000](https://github.com/mike-000))
* [#13196](https://github.com/openlayers/openlayers/pull/13196) - typo fix for cog-stretch example ([@bradh](https://github.com/bradh))
* [#13190](https://github.com/openlayers/openlayers/pull/13190) - Fix base vector layer template generics ([@ahocevar](https://github.com/ahocevar))
* [#13180](https://github.com/openlayers/openlayers/pull/13180) - Always use ES modules from geotiff.js ([@ahocevar](https://github.com/ahocevar))
* [#13179](https://github.com/openlayers/openlayers/pull/13179) - Use Buffer and data uri when Blob is not available ([@ahocevar](https://github.com/ahocevar))
* [#13178](https://github.com/openlayers/openlayers/pull/13178) - Use background property for vector layers ([@tschaub](https://github.com/tschaub))
* [#13175](https://github.com/openlayers/openlayers/pull/13175) - Allow nodejs 12 to build the examples again ([@MoonE](https://github.com/MoonE))
* [#13176](https://github.com/openlayers/openlayers/pull/13176) - Add `attributions` and `attributionsCollapsible` options to `ol/source/DataTile` ([@mike-000](https://github.com/mike-000))
* [#13171](https://github.com/openlayers/openlayers/pull/13171) - Correct scale bar in EPSG:4326 ([@mike-000](https://github.com/mike-000))
* [#13168](https://github.com/openlayers/openlayers/pull/13168) - Release 6.10.0 ([@openlayers](https://github.com/openlayers))
<details>
<summary>Dependency Updates</summary>
* [#13182](https://github.com/openlayers/openlayers/pull/13182) - Bump eslint from 8.5.0 to 8.6.0 ([@openlayers](https://github.com/openlayers))
* [#13184](https://github.com/openlayers/openlayers/pull/13184) - Bump @rollup/plugin-node-resolve from 13.1.1 to 13.1.2 ([@openlayers](https://github.com/openlayers))
* [#13183](https://github.com/openlayers/openlayers/pull/13183) - Bump @babel/core from 7.16.5 to 7.16.7 ([@openlayers](https://github.com/openlayers))
* [#13185](https://github.com/openlayers/openlayers/pull/13185) - Bump webpack-dev-server from 4.7.1 to 4.7.2 ([@openlayers](https://github.com/openlayers))
* [#13181](https://github.com/openlayers/openlayers/pull/13181) - Bump @babel/preset-env from 7.16.5 to 7.16.7 ([@openlayers](https://github.com/openlayers))
</details>

30
changelog/v6.12.0.md Normal file
View File

@@ -0,0 +1,30 @@
# 6.12.0
The 6.12 release brings a few small fixes and enhancements. See below for a complete list.
* Transitive dependency update (by @openlayers in https://github.com/openlayers/openlayers/pull/13240)
* Re-enable image smoothing after rendering (by @mike-000 in https://github.com/openlayers/openlayers/pull/13236)
* Describe use of className with declutter (by @mike-000 in https://github.com/openlayers/openlayers/pull/13237)
* added run to npm command (by @lklepner in https://github.com/openlayers/openlayers/pull/13231)
* Document how to link package during development (by @lklepner in https://github.com/openlayers/openlayers/pull/13228)
* Default CORS mode for WebGL rendered sources (by @tschaub in https://github.com/openlayers/openlayers/pull/13227)
* Support the wrapX option for WebGL rendered tile sources (by @tschaub in https://github.com/openlayers/openlayers/pull/13226)
* Update ol-mapbox-style (by @tschaub in https://github.com/openlayers/openlayers/pull/13224)
* Do not fire modifyend event when nothing was modified (by @ahocevar in https://github.com/openlayers/openlayers/pull/13219)
* Draw VectorTiles with interpolate in hybrid mode again (by @M393 in https://github.com/openlayers/openlayers/pull/13221)
* Fix some typos in ModifyInteraction documentation (by @EvertEt in https://github.com/openlayers/openlayers/pull/13216)
* Fix MVT incorrect feature data handling (by @EvertEt in https://github.com/openlayers/openlayers/pull/13217)
* Format the changelog so contributors can be highlighted (by @tschaub in https://github.com/openlayers/openlayers/pull/13205)
<details>
<summary>Dependency Updates</summary>
* Bump karma from 6.3.9 to 6.3.10 (by @openlayers in https://github.com/openlayers/openlayers/pull/13209)
* Bump shx from 0.3.3 to 0.3.4 (by @openlayers in https://github.com/openlayers/openlayers/pull/13211)
* Bump @rollup/plugin-node-resolve from 13.1.2 to 13.1.3 (by @openlayers in https://github.com/openlayers/openlayers/pull/13210)
* Bump rollup from 2.62.0 to 2.63.0 (by @openlayers in https://github.com/openlayers/openlayers/pull/13208)
* Bump marked from 4.0.8 to 4.0.9 (by @openlayers in https://github.com/openlayers/openlayers/pull/13207)
</details>

139
changelog/v6.13.0.md Normal file
View File

@@ -0,0 +1,139 @@
# 6.13.0
## Overview
The 6.13 release brings several exciting new features and improvements:
* A new `layer.getData()` method to get pixel data for a single layer (see details below).
* Support for rich text labels in `ol/style/Text`, to use different font styles and fonts in a single label.
* The `useGeograpic()` and `setUserProjection()` functions in the `ol/proj` module are now part of the official API. These functions make it easier to work with geographic coordinates or local projections.
* Improvements for WebGL Tile and Points layers.
* Performance improvements on `ol/Feature`, to avoid event creation when there are no listeners.
* Update of geotiff.js to v2, to fix some build issues that users reported.
* Improvements to the auto-generated TypeScript types.
## Details
### New `layer.getData()` method
Raster layers (static images, image tiles, data tiles) have a new `layer.getData(pixel)` method that returns the pixel data at the provided location. The return value depends on the underlying source data type. For example, a GeoTIFF may return a `Float32Array` with one value per band, while a PNG rendered from a tile layer will return a `Uint8ClampedArray` of RGBA values.
If you were previously using the `map.forEachLayerAtPixel()` method, you should use the new `layer.getData()` method instead. The old method returns composite pixel values from multiple layers and is limited to RGBA values. The new method doesn't suffer from these shortcomings and is more performant.
### Deprecated `map.forEachLayerAtPixel()` method
The `map.forEachLayerAtPixel()` method has been deprecated. It will be removed (or its behavior may change) in the next major release. Please use the `layer.getData()` method instead.
## List of all changes
See below for a complete list of features and fixes.
* Update ol-mapbox-style for rich text labels support (by @ahocevar in https://github.com/openlayers/openlayers/pull/13418)
* Increase GeoTIFF resolutions tolerance (by @ahocevar in https://github.com/openlayers/openlayers/pull/13417)
* Check for graticule resolution change and fix unrotated size (by @mike-000 in https://github.com/openlayers/openlayers/pull/13415)
* Rich text labels (by @ahocevar in https://github.com/openlayers/openlayers/pull/13410)
* Clear image when source's image is not ready (by @yonda-yonda in https://github.com/openlayers/openlayers/pull/13398)
* Fix setting View resolution or center to undefined (by @MoonE in https://github.com/openlayers/openlayers/pull/13393)
* Fix clone of icon loses imgSize when cache is full (by @MoonE in https://github.com/openlayers/openlayers/pull/13390)
* Use same clipping method for vector and image tiles (by @ahocevar in https://github.com/openlayers/openlayers/pull/13392)
* Less clipping of target resolution tiles (by @ahocevar in https://github.com/openlayers/openlayers/pull/13391)
* Change remaining links to point to class page instead of module (by @MoonE in https://github.com/openlayers/openlayers/pull/13385)
* User projection API (by @ahocevar in https://github.com/openlayers/openlayers/pull/13383)
* Fix wrong types when using `"skipLibCheck": false` (by @seravifer in https://github.com/openlayers/openlayers/pull/13382)
* Fix JsDoc references (by @MoonE in https://github.com/openlayers/openlayers/pull/13374)
* Fix VectorSource isEmpty without spatial index (by @MoonE in https://github.com/openlayers/openlayers/pull/13373)
* Document difference between Vector and VectorImage layers (by @ahocevar in https://github.com/openlayers/openlayers/pull/13371)
* Fix `ol/source/Cluster#setSource` type annotation (by @MoonE in https://github.com/openlayers/openlayers/pull/12998)
* Preload tiles for WebGL tile layers (by @tschaub in https://github.com/openlayers/openlayers/pull/13357)
* Avoid event creation when there are no listeners (by @MoonE in https://github.com/openlayers/openlayers/pull/13358)
* Add floor, round and ceil to style expressions (by @mike-000 in https://github.com/openlayers/openlayers/pull/13363)
* Support WebGL layers in ol/source/Raster (by @mike-000 in https://github.com/openlayers/openlayers/pull/13361)
* Improve some null types to prepare for strictNullChecks (by @EvertEt in https://github.com/openlayers/openlayers/pull/13301)
* Reset globalAlpha back to its initial after mutating it for drawing layers (by @Amirh0sseinHZ in https://github.com/openlayers/openlayers/pull/13351)
* Removing an unnecessary word from DEVELOPING.md (by @Amirh0sseinHZ in https://github.com/openlayers/openlayers/pull/13352)
* Get pixel data (by @tschaub in https://github.com/openlayers/openlayers/pull/13338)
* Remove warning for `@type` annotation by jsdoc (by @MoonE in https://github.com/openlayers/openlayers/pull/13350)
* Improve some null types for strictNullChecks (by @EvertEt in https://github.com/openlayers/openlayers/pull/13334)
* Dispose of webgl contexts (by @MoonE in https://github.com/openlayers/openlayers/pull/13336)
* Fix error when accessing ready property of renderer (by @MoonE in https://github.com/openlayers/openlayers/pull/13337)
* Pass tilePixelRatio and gutter to TileTexture (by @mike-000 in https://github.com/openlayers/openlayers/pull/13269)
* Improve some nullable map types (by @EvertEt in https://github.com/openlayers/openlayers/pull/13328)
* Avoid rendering outside WebGL layer and source extent (by @tschaub in https://github.com/openlayers/openlayers/pull/13333)
* Avoid duplicate imports (by @tschaub in https://github.com/openlayers/openlayers/pull/13332)
* Add updateStyleVariables method to WebGLPoints layer (by @ahocevar in https://github.com/openlayers/openlayers/pull/13294)
* Fix rendercomplete for WebGLPoints layer and subclasses (by @ahocevar in https://github.com/openlayers/openlayers/pull/13323)
* fix: fix casing for z-index (by @OSHistory in https://github.com/openlayers/openlayers/pull/13319)
* Fix typo CSS class name for the expanded attributions button (by @fredj in https://github.com/openlayers/openlayers/pull/13315)
* Improve types for tile layers (by @ahocevar in https://github.com/openlayers/openlayers/pull/13299)
* Document geometry type (by @ahocevar in https://github.com/openlayers/openlayers/pull/13298)
* Add function to convert RenderFeature to Feature (by @MoonE in https://github.com/openlayers/openlayers/pull/13297)
* Update to geotiff@2 (by @ahocevar in https://github.com/openlayers/openlayers/pull/13292)
* Re-assign style variables on setStyle() (by @ahocevar in https://github.com/openlayers/openlayers/pull/13293)
* add @api comment on getAllLayers method (by @XiaofengZeng in https://github.com/openlayers/openlayers/pull/13261)
* Allowing to pass additional options to the geotiff.js source (by @constantinius in https://github.com/openlayers/openlayers/pull/13290)
* Defaults for generic types (by @ahocevar in https://github.com/openlayers/openlayers/pull/13291)
* Load api navigation dynamically to reduce needed disk space (by @MoonE in https://github.com/openlayers/openlayers/pull/13229)
* Remove unneeded `src=""` (by @mike-000 in https://github.com/openlayers/openlayers/pull/13271)
* Support multiple sources for WebGL tile layers (by @ahocevar in https://github.com/openlayers/openlayers/pull/13212)
* Add crossOrigin option to LiteralSymbolStyle (by @mike-000 in https://github.com/openlayers/openlayers/pull/13259)
* Avoid the redirect from unpkg.com (by @tschaub in https://github.com/openlayers/openlayers/pull/13242)
* Updates for the 6.12.0 release (by @openlayers in https://github.com/openlayers/openlayers/pull/13241)
<details>
<summary>Dependency Updates</summary>
* Bump express from 4.17.2 to 4.17.3 (by @openlayers in https://github.com/openlayers/openlayers/pull/13402)
* Bump puppeteer from 13.3.1 to 13.3.2 (by @openlayers in https://github.com/openlayers/openlayers/pull/13401)
* Bump mocha from 9.2.0 to 9.2.1 (by @openlayers in https://github.com/openlayers/openlayers/pull/13403)
* Bump webpack from 5.68.0 to 5.69.1 (by @openlayers in https://github.com/openlayers/openlayers/pull/13404)
* Bump ol-mapbox-style from 6.8.3 to 6.9.0 (by @openlayers in https://github.com/openlayers/openlayers/pull/13406)
* Bump rollup from 2.67.1 to 2.67.3 (by @openlayers in https://github.com/openlayers/openlayers/pull/13405)
* Bump @babel/core from 7.17.2 to 7.17.5 (by @openlayers in https://github.com/openlayers/openlayers/pull/13407)
* Bump @babel/core from 7.17.0 to 7.17.2 (by @openlayers in https://github.com/openlayers/openlayers/pull/13381)
* Bump karma from 6.3.15 to 6.3.16 (by @openlayers in https://github.com/openlayers/openlayers/pull/13379)
* Bump eslint from 8.8.0 to 8.9.0 (by @openlayers in https://github.com/openlayers/openlayers/pull/13377)
* Bump puppeteer from 13.1.3 to 13.3.1 (by @openlayers in https://github.com/openlayers/openlayers/pull/13376)
* Bump follow-redirects from 1.14.7 to 1.14.8 (by @openlayers in https://github.com/openlayers/openlayers/pull/13372)
* Bump geotiff from 2.0.3 to 2.0.4 (by @openlayers in https://github.com/openlayers/openlayers/pull/13339)
* Bump globby from 13.1.0 to 13.1.1 (by @openlayers in https://github.com/openlayers/openlayers/pull/13340)
* Bump rollup from 2.66.1 to 2.67.1 (by @openlayers in https://github.com/openlayers/openlayers/pull/13342)
* Bump @babel/core from 7.16.12 to 7.17.0 (by @openlayers in https://github.com/openlayers/openlayers/pull/13343)
* Bump karma from 6.3.12 to 6.3.15 (by @openlayers in https://github.com/openlayers/openlayers/pull/13344)
* Bump webpack from 5.67.0 to 5.68.0 (by @openlayers in https://github.com/openlayers/openlayers/pull/13345)
* Bump webpack-dev-server from 4.7.3 to 4.7.4 (by @openlayers in https://github.com/openlayers/openlayers/pull/13346)
* Bump sinon from 13.0.0 to 13.0.1 (by @openlayers in https://github.com/openlayers/openlayers/pull/13348)
* Bump rollup from 2.66.0 to 2.66.1 (by @openlayers in https://github.com/openlayers/openlayers/pull/13318)
* Bump karma from 6.3.11 to 6.3.12 (by @openlayers in https://github.com/openlayers/openlayers/pull/13314)
* Bump geotiff from 2.0.2 to 2.0.3 (by @openlayers in https://github.com/openlayers/openlayers/pull/13313)
* Bump puppeteer from 13.1.1 to 13.1.3 (by @openlayers in https://github.com/openlayers/openlayers/pull/13317)
* Bump sinon from 12.0.1 to 13.0.0 (by @openlayers in https://github.com/openlayers/openlayers/pull/13316)
* Bump jsdoc from 3.6.9 to 3.6.10 (by @openlayers in https://github.com/openlayers/openlayers/pull/13312)
* Bump copy-webpack-plugin from 10.2.1 to 10.2.4 (by @openlayers in https://github.com/openlayers/openlayers/pull/13311)
* Bump clean-css-cli from 5.5.0 to 5.5.2 (by @openlayers in https://github.com/openlayers/openlayers/pull/13310)
* Bump eslint from 8.7.0 to 8.8.0 (by @openlayers in https://github.com/openlayers/openlayers/pull/13309)
* Bump webpack-cli from 4.9.1 to 4.9.2 (by @openlayers in https://github.com/openlayers/openlayers/pull/13305)
* Bump globby from 13.0.0 to 13.1.0 (by @openlayers in https://github.com/openlayers/openlayers/pull/13308)
* Bump marked from 4.0.10 to 4.0.12 (by @openlayers in https://github.com/openlayers/openlayers/pull/13307)
* Use exactly typescript@4.6.0-beta (by @openlayers in https://github.com/openlayers/openlayers/pull/13306)
* Bump globby from 12.2.0 to 13.0.0 (by @openlayers in https://github.com/openlayers/openlayers/pull/13281)
* Bump @babel/core from 7.16.7 to 7.16.12 (by @openlayers in https://github.com/openlayers/openlayers/pull/13278)
* Bump webpack from 5.66.0 to 5.67.0 (by @openlayers in https://github.com/openlayers/openlayers/pull/13277)
* Bump puppeteer from 13.0.1 to 13.1.1 (by @openlayers in https://github.com/openlayers/openlayers/pull/13280)
* Bump rollup from 2.64.0 to 2.66.0 (by @openlayers in https://github.com/openlayers/openlayers/pull/13279)
* Bump @babel/preset-env from 7.16.8 to 7.16.11 (by @openlayers in https://github.com/openlayers/openlayers/pull/13276)
* Bump copy-webpack-plugin from 10.2.0 to 10.2.1 (by @openlayers in https://github.com/openlayers/openlayers/pull/13275)
* Bump jsdoc from 3.6.7 to 3.6.9 (by @openlayers in https://github.com/openlayers/openlayers/pull/13274)
* Bump ol-mapbox-style from 6.8.2 to 6.8.3 (by @openlayers in https://github.com/openlayers/openlayers/pull/13273)
* Bump mocha from 9.1.4 to 9.2.0 (by @openlayers in https://github.com/openlayers/openlayers/pull/13272)
* Bump eslint from 8.6.0 to 8.7.0 (by @openlayers in https://github.com/openlayers/openlayers/pull/13246)
* Bump mocha from 9.1.3 to 9.1.4 (by @openlayers in https://github.com/openlayers/openlayers/pull/13247)
* Bump webpack-sources from 3.2.2 to 3.2.3 (by @openlayers in https://github.com/openlayers/openlayers/pull/13248)
* Bump webpack from 5.65.0 to 5.66.0 (by @openlayers in https://github.com/openlayers/openlayers/pull/13249)
* Bump globby from 12.0.2 to 12.2.0 (by @openlayers in https://github.com/openlayers/openlayers/pull/13250)
* Bump @babel/preset-env from 7.16.7 to 7.16.8 (by @openlayers in https://github.com/openlayers/openlayers/pull/13251)
* Bump rollup from 2.63.0 to 2.64.0 (by @openlayers in https://github.com/openlayers/openlayers/pull/13252)
* Bump karma from 6.3.10 to 6.3.11 (by @openlayers in https://github.com/openlayers/openlayers/pull/13253)
* Bump marked from 4.0.9 to 4.0.10 (by @openlayers in https://github.com/openlayers/openlayers/pull/13243)
</details>

View File

@@ -27,6 +27,7 @@
<a href="module-ol_layer_Tile-TileLayer.html">ol/layer/Tile</a><br>
<a href="module-ol_layer_Image-ImageLayer.html">ol/layer/Image</a><br>
<a href="module-ol_layer_Vector-VectorLayer.html">ol/layer/Vector</a><br>
<a href="module-ol_layer_VectorImage-VectorImageLayer.html">ol/layer/VectorImage</a><br>
<a href="module-ol_layer_VectorTile-VectorTileLayer.html">ol/layer/VectorTile</a><br>
<a href="module-ol_layer_WebGLTile-WebGLTileLayer.html">ol/layer/WebGLTile</a>
</div>

View File

@@ -500,6 +500,7 @@ exports.publish = function (taffyData, opts, tutorials) {
// once for all
view.nav = buildNav(members);
attachModuleSymbols(
find({kind: ['class', 'function'], longname: {left: 'module:'}}),
members.modules
@@ -518,7 +519,16 @@ exports.publish = function (taffyData, opts, tutorials) {
// index page displays information from package.json and lists files
const files = find({kind: 'file'});
view.navigationHtml = helper.resolveLinks(view.partial('navigation.tmpl'));
view.navigationItems = view.nav.reduce(function (dict, item) {
dict[item.longname] = item;
return dict;
}, {});
const navigationHtml = helper.resolveLinks(
view.nav.map((item) => view.partial('navigation.tmpl', {item})).join('')
);
const navHtmlPath = path.join(outdir, 'navigation.tmpl.html');
fs.writeFileSync(navHtmlPath, navigationHtml, 'utf8');
generate(
'Index',
[

View File

@@ -62,21 +62,47 @@ $(function () {
$navList.addClass('search-empty');
return 'search-empty';
})();
let initialCurrent = navListNode.querySelector('li.item');
const longname = initialCurrent && initialCurrent.dataset.longname;
let manualToggles = {};
if (initialCurrent) {
manualToggles[longname] = $(initialCurrent);
}
fetch('./navigation.tmpl.html').then(function (response) {
return response.text();
}).then(function (text) {
navListNode.innerHTML = text;
// Show an item related a current documentation automatically
const longname = $('.page-title').data('filename')
.replace(/\.[a-z]+$/, '')
.replace('module-', 'module:')
.replace(/_/g, '/')
.replace(/-/g, '~');
const currentItem = navListNode.querySelector('.item[data-longname="' + longname + '"]');
if (currentItem) {
$navList.prepend(currentItem);
search.$currentItem = $(currentItem);
}
$classItems = undefined;
$members = undefined;
// Search again with full navigation, if user already searched
manualToggles = {};
const lastTerm = search.lastSearchTerm;
search.lastSearchTerm = undefined;
const fa = currentItem.querySelector('.title > .fa');
fa.classList.add('no-transition');
doSearch(lastTerm || '');
// Transfer manual toggle state to newly loaded current node
if (initialCurrent && initialCurrent.classList.contains('toggle-manual')) {
search.manualToggle(search.$currentItem, initialCurrent.classList.contains('toggle-manual-show'));
}
setTimeout(function () {
fa.classList.remove('no-transition');
}, 0);
});
return {
$navList: $navList,
$currentItem: currentItem ? $(currentItem) : undefined,
$currentItem: initialCurrent ? $(initialCurrent) : undefined,
lastSearchTerm: undefined,
lastState: {},
lastClasses: undefined,
@@ -240,7 +266,7 @@ $(function () {
// Toggle when click an item element
search.$navList.on('click', '.toggle', function (e) {
if (event.target.tagName.toLowerCase() === 'a') {
if (e.target.tagName === 'A') {
return;
}
const clsItem = $(this).closest('.item');

View File

@@ -5,6 +5,7 @@
.navbar-brand img {
height: 35px;
width: 35px;
vertical-align: middle;
margin-right: 5px;
display: inline-block;
@@ -71,6 +72,11 @@ li {
.navigation-list {
padding: 0 15px 0 15px;
}
.no-transition,
.no-transition:after,
.no-transition:before {
transition: none!important;
}
@supports (position: sticky) {
.navigation {
position: sticky;
@@ -78,7 +84,7 @@ li {
height: calc(100vh - 54px);
}
.navigation-list {
overflow: auto;
overflow-y: auto;
/* 54px navbar height */
/* 4.25rem + 2px searchbox height */
/* 25px navigation padding */
@@ -94,7 +100,7 @@ li {
position: inherit;
}
.navigation-list {
overflow: auto;
overflow-y: auto;
max-height: 33vh;
height: inherit;
}
@@ -206,6 +212,10 @@ li {
padding-left: 8px;
}
.navigation-list li.loading {
display: block;
height: 101vh;
}
/* search state */
/* show all classes when search is empty */
.navigation-list.search-empty .item {

View File

@@ -29,7 +29,7 @@ var version = obj.packageInfo.version;
gtag('js', new Date());
gtag('config', 'UA-2577926-1', { 'anonymize_ip': true });
</script>
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.0/cookieconsent.min.css" />
<link type="text/css" rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.0/cookieconsent.min.css" />
<script src="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.0/cookieconsent.min.js"></script>
<script>
window.addEventListener("load", function() {
@@ -64,14 +64,14 @@ var version = obj.packageInfo.version;
</script>
<title>OpenLayers v<?js= version ?> API - <?js= title ?></title>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=fetch"></script>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<script src="scripts/jquery.min.js"> </script>
<script src="scripts/bootstrap.bundle.min.js"> </script>
<script src="scripts/prettify/prettify.js"></script>
<script src="scripts/prettify/lang-css.js"></script>
<script src="scripts/jquery.min.js"></script>
<script src="scripts/bootstrap.bundle.min.js"></script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" type="text/css">
<link type="text/css" rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/bootstrap.min.css">
<link type="text/css" rel="stylesheet" href="styles/jaguar.css">
@@ -115,7 +115,27 @@ var version = obj.packageInfo.version;
</nav>
</header>
<div id="wrap" class="row">
<?js= this.navigationHtml ?>
<div class="navigation col-md-4 col-lg-3">
<div class="search-wrapper">
<div class="search">
<input id="search" type="text" autocomplete="off" class="form-control input-sm" placeholder="Search Documentation">
</div>
</div>
<div class="navigation-list-wrapper">
<ul class="navigation-list search-empty"><?js
const item = this.navigationItems[docs[0].longname];
const listItem = item
? this.partial('navigation.tmpl', {
item: item,
classes: ' toggle-manual toggle-manual-show',
})
: '';
?><?js= listItem ?>
<li class="loading">Loading …
</ul>
</div>
</div>
<div class="main col-md-8 col-lg-9">
<h1 class="page-title" data-filename="<?js= filename ?>"><?js= title ?></h1>
<div id="latest-check" class="alert alert-warning alert-dismissible" role="alert" style="display:none">

View File

@@ -42,33 +42,18 @@ function listContent(item, title, listItemPrinter) {
<div class="member-list" data-type="<?js= type ?>">
<span class="subtitle"><?js= title ?></span>
<ul><?js
item[type].forEach(function (v) {
listItemPrinter(v);
}); ?>
item[type].forEach((v) => listItemPrinter(v)); ?>
</ul>
</div><?js
}
}
?>
<div class="navigation col-md-4 col-lg-3">
<div class="search-wrapper">
<div class="search">
<input id="search" type="text" autocomplete="off" class="form-control input-sm" placeholder="Search Documentation">
</div>
</div>
<div class="navigation-list-wrapper">
<ul class="navigation-list search-empty"><?js
this.nav.forEach(function (item) { ?>
<li class="item item-<?js= item.type ?>" data-longname="<?js= item.longname ?>" data-name="<?js= item.prettyname.toLowerCase() ?>">
} ?>
<li class="item item-<?js= item.type ?><?js= obj.classes || '' ?>" data-longname="<?js= item.longname ?>" data-name="<?js= item.prettyname.toLowerCase() ?>">
<span class="title toggle">
<span class="fa <?js= getItemCssClass(item.type) ?> mr-2 mt-1"></span>
<span><?js= self.linkto(item.longname, item.prettyname.replace(/[.~\/]/g, '\u200b$&')) ?></span>
</span><?js
listContent(item, 'Members', printListItem);
listContent(item, 'Typedefs', printListItemWithStability);
listContent(item, 'Methods', printListItemWithStability);
listContent(item, 'Fires', printFiresListItem);
}); ?>
</ul>
</div>
</div>
listContent(item, 'Members', printListItem);
listContent(item, 'Typedefs', printListItemWithStability);
listContent(item, 'Methods', printListItemWithStability);
listContent(item, 'Fires', printFiresListItem);
?>

View File

@@ -1,4 +0,0 @@
.ol-dragbox {
background-color: rgba(255,255,255,0.4);
border-color: rgba(100,150,0,1);
}

View File

@@ -9,4 +9,4 @@ docs: >
tags: "DragBox, feature, selection, box"
---
<div id="map" class="map"></div>
<div id="info">No countries selected</div>
<div>Selected regions: <span id="info">None</span></div>

View File

@@ -1,23 +1,33 @@
import GeoJSON from '../src/ol/format/GeoJSON.js';
import Map from '../src/ol/Map.js';
import VectorLayer from '../src/ol/layer/Vector.js';
import VectorSource from '../src/ol/source/Vector.js';
import View from '../src/ol/View.js';
import {DragBox, Select} from '../src/ol/interaction.js';
import {OSM, Vector as VectorSource} from '../src/ol/source.js';
import {Tile as TileLayer, Vector as VectorLayer} from '../src/ol/layer.js';
import {Fill, Stroke, Style} from '../src/ol/style.js';
import {platformModifierKeyOnly} from '../src/ol/events/condition.js';
const vectorSource = new VectorSource({
url: 'data/geojson/countries.geojson',
url: 'https://openlayers.org/data/vector/ecoregions.json',
format: new GeoJSON(),
});
const style = new Style({
fill: new Fill({
color: '#eeeeee',
}),
});
const map = new Map({
layers: [
new TileLayer({
source: new OSM(),
}),
new VectorLayer({
source: vectorSource,
background: '#1a2b39',
style: function (feature) {
const color = feature.get('COLOR_BIO') || '#eeeeee';
style.getFill().setColor(color);
return style;
},
}),
],
target: 'map',
@@ -28,8 +38,24 @@ const map = new Map({
}),
});
const selectedStyle = new Style({
fill: new Fill({
color: 'rgba(255, 255, 255, 0.6)',
}),
stroke: new Stroke({
color: 'rgba(255, 255, 255, 0.7)',
width: 2,
}),
});
// a normal select interaction to handle click
const select = new Select();
const select = new Select({
style: function (feature) {
const color = feature.get('COLOR_BIO') || '#eeeeee';
selectedStyle.getFill().setColor(color);
return selectedStyle;
},
});
map.addInteraction(select);
const selectedFeatures = select.getFeatures();
@@ -42,6 +68,11 @@ const dragBox = new DragBox({
map.addInteraction(dragBox);
dragBox.on('boxend', function () {
const extent = dragBox.getGeometry().getExtent();
const boxFeatures = vectorSource
.getFeaturesInExtent(extent)
.filter((feature) => feature.getGeometry().intersectsExtent(extent));
// features that intersect the box geometry are added to the
// collection of selected features
@@ -50,11 +81,6 @@ dragBox.on('boxend', function () {
// be added directly to the collection
const rotation = map.getView().getRotation();
const oblique = rotation % (Math.PI / 2) !== 0;
const candidateFeatures = oblique ? [] : selectedFeatures;
const extent = dragBox.getGeometry().getExtent();
vectorSource.forEachFeatureIntersectingExtent(extent, function (feature) {
candidateFeatures.push(feature);
});
// when the view is obliquely rotated the box extent will
// exceed its geometry so both the box and the candidate
@@ -66,13 +92,15 @@ dragBox.on('boxend', function () {
const geometry = dragBox.getGeometry().clone();
geometry.rotate(-rotation, anchor);
const extent = geometry.getExtent();
candidateFeatures.forEach(function (feature) {
boxFeatures.forEach(function (feature) {
const geometry = feature.getGeometry().clone();
geometry.rotate(-rotation, anchor);
if (geometry.intersectsExtent(extent)) {
selectedFeatures.push(feature);
}
});
} else {
selectedFeatures.extend(boxFeatures);
}
});
@@ -85,11 +113,11 @@ const infoBox = document.getElementById('info');
selectedFeatures.on(['add', 'remove'], function () {
const names = selectedFeatures.getArray().map(function (feature) {
return feature.get('name');
return feature.get('ECO_NAME');
});
if (names.length > 0) {
infoBox.innerHTML = names.join(', ');
} else {
infoBox.innerHTML = 'No countries selected';
infoBox.innerHTML = 'None';
}
});

File diff suppressed because one or more lines are too long

View File

@@ -1,13 +1,11 @@
---
layout: example.html
title: Styling feature with CanvasGradient or CanvasPattern
shortdesc: Example showing the countries vector layer styled with patterns and gradients.
shortdesc: Example showing a vector layer styled with a gradient.
docs: >
This example creates a [`CanvasPattern`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasPattern)
and a [`CanvasGradient`](https://developer.mozilla.org/en/docs/Web/API/CanvasGradient). The countries are loaded from
a GeoJSON file. A style function determines for each country whether to use a fill with the
CanvasGradient (rainbow colors) or a CanvasPattern (repeating stacked circles). **Note**: For seamless repeat patterns,
image width and height of the pattern image must be a factor of two (2, 4, 8, ..., 512).
This example creates a [`CanvasGradient`](https://developer.mozilla.org/en/docs/Web/API/CanvasGradient).
The vector data is loaded from a file and features are filled with the gradient.
The same technique can be used with a [`CanvasPattern`](https://developer.mozilla.org/en-US/docs/Web/API/CanvasPattern).
tags: "canvas, gradient, pattern, style"
---
<div id="map" class="map"></div>

View File

@@ -1,4 +1,4 @@
import GeoJSON from '../src/ol/format/GeoJSON.js';
import KML from '../src/ol/format/KML.js';
import Map from '../src/ol/Map.js';
import VectorLayer from '../src/ol/layer/Vector.js';
import VectorSource from '../src/ol/source/Vector.js';
@@ -7,84 +7,42 @@ import {DEVICE_PIXEL_RATIO} from '../src/ol/has.js';
import {Fill, Stroke, Style} from '../src/ol/style.js';
import {fromLonLat} from '../src/ol/proj.js';
const canvas = document.createElement('canvas');
const context = canvas.getContext('2d');
// Gradient and pattern are in canvas pixel space, so we adjust for the
// renderer's pixel ratio
const pixelRatio = DEVICE_PIXEL_RATIO;
// Generate a rainbow gradient
const gradient = (function () {
const grad = context.createLinearGradient(0, 0, 512 * pixelRatio, 0);
grad.addColorStop(0, 'red');
grad.addColorStop(1 / 6, 'orange');
grad.addColorStop(2 / 6, 'yellow');
grad.addColorStop(3 / 6, 'green');
grad.addColorStop(4 / 6, 'aqua');
grad.addColorStop(5 / 6, 'blue');
grad.addColorStop(1, 'purple');
return grad;
})();
const canvas = document.createElement('canvas');
const context = canvas.getContext('2d');
const gradient = context.createLinearGradient(0, 0, 1024 * pixelRatio, 0);
gradient.addColorStop(0, 'red');
gradient.addColorStop(1 / 6, 'orange');
gradient.addColorStop(2 / 6, 'yellow');
gradient.addColorStop(3 / 6, 'green');
gradient.addColorStop(4 / 6, 'aqua');
gradient.addColorStop(5 / 6, 'blue');
gradient.addColorStop(1, 'purple');
// Generate a canvasPattern with two circles on white background
const pattern = (function () {
canvas.width = 8 * pixelRatio;
canvas.height = 8 * pixelRatio;
// white background
context.fillStyle = 'white';
context.fillRect(0, 0, canvas.width, canvas.height);
// outer circle
context.fillStyle = 'rgba(102, 0, 102, 0.5)';
context.beginPath();
context.arc(4 * pixelRatio, 4 * pixelRatio, 3 * pixelRatio, 0, 2 * Math.PI);
context.fill();
// inner circle
context.fillStyle = 'rgb(55, 0, 170)';
context.beginPath();
context.arc(4 * pixelRatio, 4 * pixelRatio, 1.5 * pixelRatio, 0, 2 * Math.PI);
context.fill();
return context.createPattern(canvas, 'repeat');
})();
// Generate style for gradient or pattern fill
const fill = new Fill();
const style = new Style({
fill: fill,
const vectorLayer = new VectorLayer({
background: 'white',
source: new VectorSource({
url: 'data/kml/states.kml',
format: new KML({extractStyles: false}),
}),
style: new Style({
fill: new Fill({color: gradient}),
stroke: new Stroke({
color: '#333',
width: 2,
width: 1,
}),
}),
});
/**
* The styling function for the vector layer, will return an array of styles
* which either contains the aboove gradient or pattern.
*
* @param {import("../src/ol/Feature.js").default} feature The feature to style.
* @return {Style} The style to use for the feature.
*/
const getStackedStyle = function (feature) {
const id = feature.getId();
fill.setColor(id > 'J' ? gradient : pattern);
return style;
};
// Create a vector layer that makes use of the style function above…
const vectorLayer = new VectorLayer({
source: new VectorSource({
url: 'data/geojson/countries.geojson',
format: new GeoJSON(),
}),
style: getStackedStyle,
});
// … finally create a map with that layer.
const map = new Map({
layers: [vectorLayer],
target: 'map',
view: new View({
center: fromLonLat([16, 48]),
zoom: 3,
center: fromLonLat([-100, 38.5]),
zoom: 4,
}),
});

View File

@@ -3,9 +3,12 @@ layout: example.html
title: NDVI from a Sentinel 2 COG
shortdesc: Calculating NDVI and applying a custom color map.
docs: >
The GeoTIFF layer in this example draws from two Sentinel 2 sources: a red band and a near infrared band.
The GeoTIFF layer in this example draws from two Sentinel 2 sources: a red band and a near-infrared band.
The layer style includes a `color` expression that calculates the Normalized Difference Vegetation Index (NDVI)
from values in the two bands. The `interpolate` expression is used to map NDVI values to colors.
The `layer.getData()` method can be used to retrieve pixel values from the GeoTIFF. Move your mouse
or tap on the map to see calculated NDVI values based on the red and near-infrared pixel values.
tags: "cog, ndvi"
---
<div id="map" class="map"></div>
<div>NDVI: <span id="output"></span></div>

View File

@@ -17,20 +17,13 @@ const source = new GeoTIFF({
],
});
const map = new Map({
target: 'map',
layers: [
new TileLayer({
const layer = new TileLayer({
style: {
color: [
'interpolate',
['linear'],
// calculate NDVI, bands come from the sources below
[
'/',
['-', ['band', 2], ['band', 1]],
['+', ['band', 2], ['band', 1]],
],
['/', ['-', ['band', 2], ['band', 1]], ['+', ['band', 2], ['band', 1]]],
// color ramp for NDVI values, ranging from -1 to 1
-0.2,
[191, 191, 191],
@@ -75,7 +68,23 @@ const map = new Map({
],
},
source: source,
}),
],
});
const map = new Map({
target: 'map',
layers: [layer],
view: source.getView(),
});
const output = document.getElementById('output');
function displayPixelValue(event) {
const data = layer.getData(event.pixel);
if (!data) {
return;
}
const red = data[0];
const nir = data[1];
const ndvi = (nir - red) / (nir + red);
output.textContent = ndvi.toFixed(2);
}
map.on(['pointermove', 'click'], displayPixelValue);

View File

@@ -4,9 +4,9 @@ title: GeoTIFF tile pyramid
shortdesc: Rendering a COG tile pyramid as layer group.
docs: >
Data from a Cloud Optimized GeoTIFF (COG) tile pyramid can be rendered as a set of layers. In this
example, a pyramid of 3-band GeoTIFFs is used to render RGB data. For each tile of the pyramid, a
separate layer is created on demand. The lowest resolution layer serves as preview while higher resolutions are
loading.
example, a pyramid of 3-band GeoTIFFs is used to render RGB data. The `ol/source.sourcesFromTileGrid`
helper function creates sources from this pyramid on demand. The GeoTIFFs used by those sources have
a resolution range that matches the range of a single z of the pyramid tile grid.
tags: "cog, tilepyramid, stac"
---
<div id="map" class="map"></div>

View File

@@ -1,16 +1,15 @@
import GeoTIFF from '../src/ol/source/GeoTIFF.js';
import LayerGroup from '../src/ol/layer/Group.js';
import Map from '../src/ol/Map.js';
import TileGrid from '../src/ol/tilegrid/TileGrid.js';
import View from '../src/ol/View.js';
import WebGLTileLayer from '../src/ol/layer/WebGLTile.js';
import {getIntersection} from '../src/ol/extent.js';
import {sourcesFromTileGrid} from '../src/ol/source.js';
// Metadata from https://s2downloads.eox.at/demo/EOxCloudless/2019/rgb/2019_EOxCloudless_rgb.json
// Tile grid of the GeoTIFF pyramid layout
const tileGrid = new TileGrid({
origin: [-180, 90],
extent: [-180, -90, 180, 90],
resolutions: [0.703125, 0.3515625, 0.17578125, 8.7890625e-2, 4.39453125e-2],
tileSizes: [
[512, 256],
@@ -21,30 +20,19 @@ const tileGrid = new TileGrid({
],
});
const pyramid = new LayerGroup();
const layerForUrl = {};
const zs = tileGrid.getResolutions().length;
function useLayer(z, x, y) {
const url = `https://s2downloads.eox.at/demo/EOxCloudless/2019/rgb/${z}/${y}/${x}.tif`;
if (!(url in layerForUrl)) {
pyramid.getLayers().push(
new WebGLTileLayer({
minZoom: z,
maxZoom: z === 0 || z === zs - 1 ? undefined : z + 1,
extent: tileGrid.getTileCoordExtent([z, x, y]),
source: new GeoTIFF({
const pyramid = new WebGLTileLayer({
sources: sourcesFromTileGrid(
tileGrid,
([z, x, y]) =>
new GeoTIFF({
sources: [
{
url: url,
url: `https://s2downloads.eox.at/demo/EOxCloudless/2019/rgb/${z}/${y}/${x}.tif`,
},
],
}),
})
);
layerForUrl[url] = true;
}
}
),
});
const map = new Map({
target: 'map',
@@ -56,16 +44,3 @@ const map = new Map({
showFullExtent: true,
}),
});
// Add overview layer
useLayer(0, 0, 0);
// Add layer for specific extent on demand
map.on('moveend', () => {
const view = map.getView();
tileGrid.forEachTileCoord(
getIntersection([-180, -90, 180, 90], view.calculateExtent()),
tileGrid.getZForResolution(view.getResolution()),
([z, x, y]) => useLayer(z, x, y)
);
});

View File

@@ -1,7 +1,7 @@
---
layout: example.html
title: Band Constrast Stretch
shortdesc: Choosing bands and applying constrast stretch
title: Band Contrast Stretch
shortdesc: Choosing bands and applying contrast stretch
docs: >
This example uses the `layer.updateStyleVariables()` method to update the rendering
of a GeoTIFF based on user selected bands and contrast stretch parameters.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -7,7 +7,6 @@ docs: >
makes it so the map view uses geographic coordinates (even if the view projection is
not geographic).
tags: "geographic"
experimental: true
---
<div id="map" class="map"></div>
<select id="mode">

View File

@@ -1,30 +1,28 @@
import GeoJSON from '../src/ol/format/GeoJSON.js';
import VectorLayer from '../src/ol/layer/Vector.js';
import VectorSource from '../src/ol/source/Vector.js';
import {Draw, Modify, Select, Snap} from '../src/ol/interaction.js';
import {Map, View} from '../src/ol/index.js';
import {OSM, Vector as VectorSource} from '../src/ol/source.js';
import {Tile as TileLayer, Vector as VectorLayer} from '../src/ol/layer.js';
import {useGeographic} from '../src/ol/proj.js';
useGeographic();
const source = new VectorSource({
url: 'data/geojson/countries.geojson',
url: 'https://openlayers.org/data/vector/us-states.json',
format: new GeoJSON(),
});
const map = new Map({
target: 'map',
layers: [
new TileLayer({
source: new OSM(),
}),
new VectorLayer({
background: 'white',
source: source,
}),
],
view: new View({
center: [0, 0],
zoom: 2,
center: [-100, 38.5],
zoom: 4,
}),
});

View File

@@ -1,24 +1,34 @@
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 {Fill, Style} from '../src/ol/style.js';
import {
Heatmap as HeatmapLayer,
Tile as TileLayer,
Vector as VectorLayer,
} from '../src/ol/layer.js';
import {OSM, Vector as VectorSource} from '../src/ol/source.js';
import {asArray} from '../src/ol/color.js';
const style = new Style({
fill: new Fill({
color: '#eeeeee',
}),
});
const map = new Map({
layers: [
new TileLayer({
source: new OSM(),
}),
new VectorLayer({
source: new VectorSource({
url: 'data/geojson/countries.geojson',
url: 'https://openlayers.org/data/vector/ecoregions.json',
format: new GeoJSON(),
}),
opacity: 0.5,
background: 'white',
style: function (feature) {
const color = asArray(feature.get('COLOR_NNH') || '#eeeeee');
color[3] = 0.75;
style.getFill().setColor(color);
return style;
},
}),
new HeatmapLayer({
source: new VectorSource({
@@ -30,7 +40,7 @@ const map = new Map({
},
radius: 15,
blur: 15,
opacity: 0.5,
opacity: 0.75,
}),
],
target: 'map',
@@ -54,6 +64,13 @@ document.getElementById('export-png').addEventListener('click', function () {
const opacity =
canvas.parentNode.style.opacity || canvas.style.opacity;
mapContext.globalAlpha = opacity === '' ? 1 : Number(opacity);
const backgroundColor = canvas.parentNode.style.backgroundColor;
if (backgroundColor) {
mapContext.fillStyle = backgroundColor;
mapContext.fillRect(0, 0, canvas.width, canvas.height);
}
let matrix;
const transform = canvas.style.transform;
if (transform) {
@@ -81,6 +98,7 @@ document.getElementById('export-png').addEventListener('click', function () {
}
}
);
mapContext.globalAlpha = 1;
if (navigator.msSaveBlob) {
// link download attribute does not work on MS browsers
navigator.msSaveBlob(mapCanvas.msToBlob(), 'map.png');

View File

@@ -83,6 +83,7 @@ exportButton.addEventListener(
}
}
);
mapContext.globalAlpha = 1;
const pdf = new jspdf.jsPDF('landscape', undefined, format);
pdf.addImage(
mapCanvas.toDataURL('image/jpeg'),

View File

@@ -1,24 +1,15 @@
import ExtentInteraction from '../src/ol/interaction/Extent.js';
import GeoJSON from '../src/ol/format/GeoJSON.js';
import Map from '../src/ol/Map.js';
import OSM from '../src/ol/source/OSM.js';
import TileLayer from '../src/ol/layer/Tile.js';
import View from '../src/ol/View.js';
import {OSM, Vector as VectorSource} from '../src/ol/source.js';
import {Tile as TileLayer, Vector as VectorLayer} from '../src/ol/layer.js';
import {shiftKeyOnly} from '../src/ol/events/condition.js';
const vectorSource = new VectorSource({
url: 'data/geojson/countries.geojson',
format: new GeoJSON(),
});
const map = new Map({
layers: [
new TileLayer({
source: new OSM(),
}),
new VectorLayer({
source: vectorSource,
}),
],
target: 'map',
view: new View({

View File

@@ -7,7 +7,6 @@ docs: >
makes it so the map view uses geographic coordinates (even if the view projection is
not geographic).
tags: "geographic"
experimental: true
resources:
- https://code.jquery.com/jquery-3.5.1.min.js
- https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css

View File

@@ -1,21 +1,20 @@
import GeoJSON from '../src/ol/format/GeoJSON.js';
import Map from '../src/ol/Map.js';
import OSM from '../src/ol/source/OSM.js';
import Projection from '../src/ol/proj/Projection.js';
import VectorTileLayer from '../src/ol/layer/VectorTile.js';
import VectorTileSource from '../src/ol/source/VectorTile.js';
import View from '../src/ol/View.js';
import {
Tile as TileLayer,
VectorTile as VectorTileLayer,
} from '../src/ol/layer.js';
import {Fill, Style} from '../src/ol/style.js';
// Converts geojson-vt data to GeoJSON
const replacer = function (key, value) {
if (value.geometry) {
if (!value || !value.geometry) {
return value;
}
let type;
const rawType = value.type;
let geometry = value.geometry;
if (rawType === 1) {
type = 'MultiPoint';
if (geometry.length == 1) {
@@ -44,17 +43,25 @@ const replacer = function (key, value) {
},
'properties': value.tags,
};
} else {
return value;
}
};
const map = new Map({
layers: [
new TileLayer({
source: new OSM(),
const style = new Style({
fill: new Fill({
color: '#eeeeee',
}),
],
});
const layer = new VectorTileLayer({
background: '#1a2b39',
style: function (feature) {
const color = feature.get('COLOR') || '#eeeeee';
style.getFill().setColor(color);
return style;
},
});
const map = new Map({
layers: [layer],
target: 'map',
view: new View({
center: [0, 0],
@@ -62,7 +69,7 @@ const map = new Map({
}),
});
const url = 'data/geojson/countries.geojson';
const url = 'https://openlayers.org/data/vector/ecoregions.json';
fetch(url)
.then(function (response) {
return response.json();
@@ -106,8 +113,5 @@ fetch(url)
tile.setFeatures(features);
},
});
const vectorLayer = new VectorTileLayer({
source: vectorSource,
});
map.addLayer(vectorLayer);
layer.setSource(vectorSource);
});

View File

@@ -35,7 +35,7 @@ tags: "fullscreen, geolocation, orientation, mobile"
left: 10px;
}
</style>
<script src="https://unpkg.com/elm-pep"></script>
<script src="https://unpkg.com/elm-pep@1.0.6/dist/elm-pep.js"></script>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=fetch,requestAnimationFrame,Element.prototype.classList,URL"></script>
</head>
<body>

View File

@@ -3,8 +3,8 @@ layout: example.html
title: WMS GetFeatureInfo (Image Layer)
shortdesc: Using an image WMS source with GetFeatureInfo requests
docs: >
This example shows how to trigger WMS GetFeatureInfo requests on click for a WMS image layer. Additionally <code>map.forEachLayerAtPixel</code> is used to change the mouse pointer when hovering a non-transparent pixel on the map.
tags: "getfeatureinfo, forEachLayerAtPixel"
This example shows how to trigger WMS GetFeatureInfo requests on click for a WMS image layer. Additionally `layer.getData(pixel)` is used to change the mouse pointer when hovering a non-transparent pixel on the map.
tags: "getfeatureinfo, getData"
---
<div id="map" class="map"></div>
<div id="info">&nbsp;</div>

View File

@@ -47,9 +47,7 @@ map.on('pointermove', function (evt) {
if (evt.dragging) {
return;
}
const pixel = map.getEventPixel(evt.originalEvent);
const hit = map.forEachLayerAtPixel(pixel, function () {
return true;
});
const data = wmsLayer.getData(evt.pixel);
const hit = data && data[3] > 0; // transparent pixels have zero for data[3]
map.getTargetElement().style.cursor = hit ? 'pointer' : '';
});

View File

@@ -3,8 +3,8 @@ layout: example.html
title: WMS GetFeatureInfo (Tile Layer)
shortdesc: Issuing GetFeatureInfo requests with a WMS tiled source
docs: >
This example shows how to trigger WMS GetFeatureInfo requests on click for a WMS tile layer. Additionally <code>map.forEachLayerAtPixel</code> is used to change the mouse pointer when hovering a non-transparent pixel on the map.
tags: "getfeatureinfo, forEachLayerAtPixel"
This example shows how to trigger WMS GetFeatureInfo requests on click for a WMS tile layer. Additionally `layer.getData(pixel)` is used to change the mouse pointer when hovering a non-transparent pixel on the map.
tags: "getfeatureinfo, getData"
---
<div id="map" class="map"></div>
<div id="info">&nbsp;</div>

View File

@@ -47,9 +47,7 @@ map.on('pointermove', function (evt) {
if (evt.dragging) {
return;
}
const pixel = map.getEventPixel(evt.originalEvent);
const hit = map.forEachLayerAtPixel(pixel, function () {
return true;
});
const data = wmsLayer.getData(evt.pixel);
const hit = data && data[3] > 0; // transparent pixels have zero for data[3]
map.getTargetElement().style.cursor = hit ? 'pointer' : '';
});

View File

@@ -1,12 +1,12 @@
---
layout: example.html
title: Vector Layer Hit Detection
shortdesc: Example of hit detection on a countries vector layer with country information.
shortdesc: Example of hit detection on an ecoregions vector layer with protection status.
docs: >
The countries are loaded from a GeoJSON file. Information about countries is
on hover and click is retrieved using the layer's `getFeatures()` method. For
The ecoregions are loaded from a GeoJSON file. Information about features is
retrieved using the layer's `getFeatures()` method on hover and click. For
vector layers, this function resolves with an array of only the topmost
feature. It uses a very efficient hit detection algorithm, at the cost of
feature. It uses an efficient hit detection algorithm, at the cost of
accuracy. For pixel exact hit detection, when performance is not a concern,
use the map's `getFeaturesAtPixel()` or `forEachFeatureAtPixel()` methods.
tags: "vector, geojson, click, hover, hit detection"

View File

@@ -3,35 +3,23 @@ import Map from '../src/ol/Map.js';
import VectorLayer from '../src/ol/layer/Vector.js';
import VectorSource from '../src/ol/source/Vector.js';
import View from '../src/ol/View.js';
import {Fill, Stroke, Style, Text} from '../src/ol/style.js';
import {Fill, Stroke, Style} from '../src/ol/style.js';
const style = new Style({
fill: new Fill({
color: 'rgba(255, 255, 255, 0.6)',
}),
stroke: new Stroke({
color: '#319FD3',
width: 1,
}),
text: new Text({
font: '12px Calibri,sans-serif',
fill: new Fill({
color: '#000',
}),
stroke: new Stroke({
color: '#fff',
width: 3,
}),
color: '#eeeeee',
}),
});
const vectorLayer = new VectorLayer({
background: '#1a2b39',
source: new VectorSource({
url: 'data/geojson/countries.geojson',
url: 'https://openlayers.org/data/vector/ecoregions.json',
format: new GeoJSON(),
}),
style: function (feature) {
style.getText().setText(feature.get('name'));
const color = feature.get('COLOR_NNH') || '#eeeeee';
style.getFill().setColor(color);
return style;
},
});
@@ -47,31 +35,15 @@ const map = new Map({
const highlightStyle = new Style({
stroke: new Stroke({
color: '#f00',
width: 1,
}),
fill: new Fill({
color: 'rgba(255,0,0,0.1)',
}),
text: new Text({
font: '12px Calibri,sans-serif',
fill: new Fill({
color: '#000',
}),
stroke: new Stroke({
color: '#f00',
width: 3,
}),
color: 'rgba(255, 255, 255, 0.7)',
width: 2,
}),
});
const featureOverlay = new VectorLayer({
source: new VectorSource(),
map: map,
style: function (feature) {
highlightStyle.getText().setText(feature.get('name'));
return highlightStyle;
},
style: highlightStyle,
});
let highlight;
@@ -80,7 +52,7 @@ const displayFeatureInfo = function (pixel) {
const feature = features.length ? features[0] : undefined;
const info = document.getElementById('info');
if (features.length) {
info.innerHTML = feature.getId() + ': ' + feature.get('name');
info.innerHTML = feature.get('ECO_NAME') + ': ' + feature.get('NNH_NAME');
} else {
info.innerHTML = '&nbsp;';
}

View File

@@ -4,33 +4,30 @@ import VectorImageLayer from '../src/ol/layer/VectorImage.js';
import VectorLayer from '../src/ol/layer/Vector.js';
import VectorSource from '../src/ol/source/Vector.js';
import View from '../src/ol/View.js';
import {Fill, Stroke, Style, Text} from '../src/ol/style.js';
import {Fill, Stroke, Style} from '../src/ol/style.js';
const style = new Style({
fill: new Fill({
color: 'rgba(255, 255, 255, 0.6)',
color: '#eeeeee',
}),
stroke: new Stroke({
color: '#319FD3',
width: 1,
}),
text: new Text(),
});
const map = new Map({
layers: [
new VectorImageLayer({
const vectorLayer = new VectorImageLayer({
background: '#1a2b39',
imageRatio: 2,
source: new VectorSource({
url: 'data/geojson/countries.geojson',
url: 'https://openlayers.org/data/vector/ecoregions.json',
format: new GeoJSON(),
}),
style: function (feature) {
style.getText().setText(feature.get('name'));
const color = feature.get('COLOR') || '#eeeeee';
style.getFill().setColor(color);
return style;
},
}),
],
});
const map = new Map({
layers: [vectorLayer],
target: 'map',
view: new View({
center: [0, 0],
@@ -43,27 +40,21 @@ const featureOverlay = new VectorLayer({
map: map,
style: new Style({
stroke: new Stroke({
color: '#f00',
width: 1,
}),
fill: new Fill({
color: 'rgba(255,0,0,0.1)',
color: 'rgba(255, 255, 255, 0.7)',
width: 2,
}),
}),
});
let highlight;
const displayFeatureInfo = function (pixel) {
map
.getLayers()
.item(0)
.getFeatures(pixel)
.then(function (features) {
const feature = features.length > 0 ? features[0] : undefined;
const feature = map.forEachFeatureAtPixel(pixel, function (feature) {
return feature;
});
const info = document.getElementById('info');
if (feature) {
info.innerHTML = feature.getId() + ': ' + feature.get('name');
info.innerHTML = feature.get('ECO_NAME') || '&nbsp;';
} else {
info.innerHTML = '&nbsp;';
}
@@ -77,13 +68,14 @@ const displayFeatureInfo = function (pixel) {
}
highlight = feature;
}
});
};
map.on('pointermove', function (evt) {
if (!evt.dragging) {
displayFeatureInfo(evt.pixel);
if (evt.dragging) {
return;
}
const pixel = map.getEventPixel(evt.originalEvent);
displayFeatureInfo(pixel);
});
map.on('click', function (evt) {

View File

@@ -10,6 +10,5 @@ docs: >
any geometry on each render frame. The `useGeographic` function is used in this example so that
geometries can be in geographic coordinates.
tags: "immediate, geographic"
experimental: true
---
<div id="map" class="map"></div>

View File

@@ -7,7 +7,7 @@ docs: >
The <code>interpolate: false</code> setting is used to disable interpolation of data values during
reprojection and rendering. Elevation data is
calculated from the pixel value returned by <b>forEachLayerAtPixel</b>. For comparison a second map
with interpolation enabled returns inaccuate elevations which are very noticeable close to 3107 meters
with interpolation enabled returns inaccurate elevations which are very noticeable close to 3107 meters
due to how elevation is calculated from the pixel value.
tags: "disable image interpolation, xyz, maptiler, reprojection"
cloak:

View File

@@ -1,11 +1,10 @@
import GeoJSON from '../src/ol/format/GeoJSON.js';
import HeatmapLayer from '../src/ol/layer/Heatmap.js';
import Layer from '../src/ol/layer/Layer.js';
import Map from '../src/ol/Map.js';
import Source from '../src/ol/source/Source.js';
import VectorLayer from '../src/ol/layer/Vector.js';
import VectorSource from '../src/ol/source/Vector.js';
import View from '../src/ol/View.js';
import {Stroke, Style} from '../src/ol/style.js';
import {fromLonLat, toLonLat} from '../src/ol/proj.js';
const center = [-98.8, 37.9];
@@ -34,6 +33,7 @@ const mbLayer = new Layer({
const visible = mbLayer.getVisible();
canvas.style.display = visible ? 'block' : 'none';
canvas.style.position = 'absolute';
const opacity = mbLayer.getOpacity();
canvas.style.opacity = opacity;
@@ -66,19 +66,16 @@ const mbLayer = new Layer({
}),
});
const style = new Style({
stroke: new Stroke({
color: '#319FD3',
width: 2,
}),
});
const vectorLayer = new VectorLayer({
const cities = new HeatmapLayer({
source: new VectorSource({
url: 'data/geojson/countries.geojson',
url: 'data/geojson/world-cities.geojson',
format: new GeoJSON(),
}),
style: style,
weight: function (feature) {
return feature.get('population') / 1e7;
},
radius: 15,
blur: 15,
});
const map = new Map({
@@ -87,5 +84,5 @@ const map = new Map({
center: fromLonLat(center),
zoom: 4,
}),
layers: [mbLayer, vectorLayer],
layers: [mbLayer, cities],
});

View File

@@ -23,7 +23,7 @@ cloak:
height: 100%;
}
</style>
<script src="https://unpkg.com/elm-pep"></script>
<script src="https://unpkg.com/elm-pep@1.0.6/dist/elm-pep.js"></script>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=fetch,requestAnimationFrame,Element.prototype.classList,URL"></script>
</head>
<body>

View File

@@ -1,21 +1,19 @@
import GeoJSON from '../src/ol/format/GeoJSON.js';
import Map from '../src/ol/Map.js';
import VectorLayer from '../src/ol/layer/Vector.js';
import VectorSource from '../src/ol/source/Vector.js';
import View from '../src/ol/View.js';
import {
Modify,
Select,
defaults as defaultInteractions,
} from '../src/ol/interaction.js';
import {OSM, Vector as VectorSource} from '../src/ol/source.js';
import {Tile as TileLayer, Vector as VectorLayer} from '../src/ol/layer.js';
const raster = new TileLayer({
source: new OSM(),
});
import {fromLonLat} from '../src/ol/proj.js';
const vector = new VectorLayer({
background: 'white',
source: new VectorSource({
url: 'data/geojson/countries.geojson',
url: 'https://openlayers.org/data/vector/us-states.json',
format: new GeoJSON(),
wrapX: false,
}),
@@ -31,10 +29,10 @@ const modify = new Modify({
const map = new Map({
interactions: defaultInteractions().extend([select, modify]),
layers: [raster, vector],
layers: [vector],
target: 'map',
view: new View({
center: [0, 0],
zoom: 2,
center: fromLonLat([-100, 38.5]),
zoom: 4,
}),
});

View File

@@ -5,9 +5,12 @@ import View from '../src/ol/View.js';
import Worker from 'worker-loader!./offscreen-canvas.worker.js'; //eslint-disable-line
import stringify from 'json-stringify-safe';
import {FullScreen} from '../src/ol/control.js';
import {compose, create} from '../src/ol/transform.js';
import {
compose,
create,
toString as toTransformString,
} from '../src/ol/transform.js';
import {createXYZ} from '../src/ol/tilegrid.js';
import {toString as toTransformString} from '../src/ol/transform.js';
const worker = new Worker();

View File

@@ -1,12 +1,13 @@
import MVT from '../src/ol/format/MVT.js';
import TileQueue from '../src/ol/TileQueue.js';
import TileQueue, {
getTilePriority as tilePriorityFunction,
} from '../src/ol/TileQueue.js';
import VectorTileLayer from '../src/ol/layer/VectorTile.js';
import VectorTileSource from '../src/ol/source/VectorTile.js';
import stringify from 'json-stringify-safe';
import styleFunction from 'ol-mapbox-style/dist/stylefunction.js';
import {get} from '../src/ol/proj.js';
import {inView} from '../src/ol/layer/Layer.js';
import {getTilePriority as tilePriorityFunction} from '../src/ol/TileQueue.js';
/** @type {any} */
const worker = self;

View File

@@ -0,0 +1,18 @@
---
layout: example.html
title: Projection and Scale
shortdesc: Example of maintaining scale when changing projection.
docs: >
Example of maintaining scale when changing projection.
`getPointResolution()` is used to calculate the resolution for the
new projection which corresponds to that for the old projection.
tags: "projection, scale"
---
<div id="map" class="map"></div>
<div>
<label for="view-projection">View projection</label>
<select id="view-projection">
<option value="EPSG:3857">Spherical Mercator (EPSG:3857)</option>
<option value="EPSG:4326" selected>WGS 84 (EPSG:4326)</option>
</select>
</div>

View File

@@ -0,0 +1,68 @@
import Map from '../src/ol/Map.js';
import OSM from '../src/ol/source/OSM.js';
import TileLayer from '../src/ol/layer/Tile.js';
import View from '../src/ol/View.js';
import {ScaleLine, defaults as defaultControls} from '../src/ol/control.js';
import {
getPointResolution,
get as getProjection,
transform,
} from '../src/ol/proj.js';
const viewProjSelect = document.getElementById('view-projection');
const projection = getProjection(viewProjSelect.value);
const scaleControl = new ScaleLine({
units: 'metric',
bar: true,
steps: 4,
text: true,
minWidth: 140,
});
const map = new Map({
controls: defaultControls().extend([scaleControl]),
layers: [
new TileLayer({
source: new OSM(),
}),
],
target: 'map',
view: new View({
center: transform([0, 52], 'EPSG:4326', projection),
zoom: 6,
projection: projection,
}),
});
function onChangeProjection() {
const currentView = map.getView();
const currentProjection = currentView.getProjection();
const newProjection = getProjection(viewProjSelect.value);
const currentResolution = currentView.getResolution();
const currentCenter = currentView.getCenter();
const currentRotation = currentView.getRotation();
const newCenter = transform(currentCenter, currentProjection, newProjection);
const currentPointResolution = getPointResolution(
currentProjection,
1,
currentCenter,
'm'
);
const newPointResolution = getPointResolution(
newProjection,
1,
newCenter,
'm'
);
const newResolution =
(currentResolution * currentPointResolution) / newPointResolution;
const newView = new View({
center: newCenter,
resolution: newResolution,
rotation: currentRotation,
projection: newProjection,
});
map.setView(newView);
}
viewProjSelect.addEventListener('change', onChangeProjection);

View File

@@ -22,6 +22,7 @@ body {
}
.navbar-brand img {
height: 35px;
width: 35px;;
vertical-align: middle;
margin-right: 5px;
display: inline-block;

View File

@@ -0,0 +1,9 @@
---
layout: example.html
title: Rich Text Labels
shortdesc: Rich text labels.
docs: >
The labels in this map use different fonts to create clear context - an alphabetic sort key prefixing the state name in bold, and the population density in an extra line with a smaller font and italic.
tags: "vector, rich-text, labels"
---
<div id="map" class="map"></div>

View File

@@ -0,0 +1,64 @@
import GeoJSON from '../src/ol/format/GeoJSON.js';
import Map from '../src/ol/Map.js';
import VectorLayer from '../src/ol/layer/Vector.js';
import VectorSource from '../src/ol/source/Vector.js';
import View from '../src/ol/View.js';
import {Fill, Stroke, Style, Text} from '../src/ol/style.js';
const map = new Map({
target: 'map',
view: new View({
center: [0, 0],
zoom: 2,
extent: [-13882269, 2890586, -7456136, 6340207],
showFullExtent: true,
}),
});
const labelStyle = new Style({
text: new Text({
font: '13px Calibri,sans-serif',
fill: new Fill({
color: '#000',
}),
stroke: new Stroke({
color: '#fff',
width: 4,
}),
}),
});
const countryStyle = new Style({
fill: new Fill({
color: 'rgba(255, 255, 255, 0.6)',
}),
stroke: new Stroke({
color: '#319FD3',
width: 1,
}),
});
const style = [countryStyle, labelStyle];
const vectorLayer = new VectorLayer({
background: 'white',
source: new VectorSource({
url: 'https://openlayers.org/data/vector/us-states.json',
format: new GeoJSON(),
}),
style: function (feature) {
labelStyle
.getText()
.setText([
feature.getId(),
'bold 13px Calibri,sans-serif',
` ${feature.get('name')}`,
'',
'\n',
'',
`${feature.get('density')} people/mi²`,
'italic 11px Calibri,sans-serif',
]);
return style;
},
});
map.addLayer(vectorLayer);

View File

@@ -8,11 +8,6 @@ docs: >
<a href="https://blog.mapbox.com/styling-mapbox-terrain-rgb-c75d1cd71471">Mapbox Terrain-RGB tiles</a>
to "flood" areas below the elevation shown on the sea level slider.
</p>
<p>
<code>ol/source/Raster</code> can take either a tile source or layer.
In this case a layer is used to allow disabling at the <code>prerender</code> event
of image smoothing which would change the precise elevation values set in the pixels.
</p>
tags: "raster, pixel operation, flood"
cloak:
- key: get_your_own_D6rA4zTHduk6KOKTXzGB

View File

@@ -26,18 +26,14 @@ 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({
source: new XYZ({
url:
'https://api.maptiler.com/tiles/terrain-rgb/{z}/{x}/{y}.png?key=' + key,
const elevation = new XYZ({
// The RGB values in the source collectively represent elevation.
// Interpolation of individual colors would produce incorrect evelations and is disabled.
url: 'https://api.maptiler.com/tiles/terrain-rgb/{z}/{x}/{y}.png?key=' + key,
tileSize: 512,
maxZoom: 12,
crossOrigin: '',
}),
});
elevation.on('prerender', function (evt) {
evt.context.imageSmoothingEnabled = false;
evt.context.msImageSmoothingEnabled = false;
interpolate: false,
});
const raster = new RasterSource({

View File

@@ -1,25 +1,33 @@
import GeoJSON from '../src/ol/format/GeoJSON.js';
import Map from '../src/ol/Map.js';
import OSM from '../src/ol/source/OSM.js';
import Select from '../src/ol/interaction/Select.js';
import VectorLayer from '../src/ol/layer/Vector.js';
import VectorSource from '../src/ol/source/Vector.js';
import View from '../src/ol/View.js';
import {Tile as TileLayer, Vector as VectorLayer} from '../src/ol/layer.js';
import {Fill, Stroke, Style} from '../src/ol/style.js';
import {altKeyOnly, click, pointerMove} from '../src/ol/events/condition.js';
const raster = new TileLayer({
source: new OSM(),
const style = new Style({
fill: new Fill({
color: '#eeeeee',
}),
});
const vector = new VectorLayer({
source: new VectorSource({
url: 'data/geojson/countries.geojson',
url: 'https://openlayers.org/data/vector/ecoregions.json',
format: new GeoJSON(),
}),
background: 'white',
style: function (feature) {
const color = feature.get('COLOR') || '#eeeeee';
style.getFill().setColor(color);
return style;
},
});
const map = new Map({
layers: [raster, vector],
layers: [vector],
target: 'map',
view: new View({
center: [0, 0],
@@ -29,20 +37,39 @@ const map = new Map({
let select = null; // ref to currently selected interaction
const selected = new Style({
fill: new Fill({
color: '#eeeeee',
}),
stroke: new Stroke({
color: 'rgba(255, 255, 255, 0.7)',
width: 2,
}),
});
function selectStyle(feature) {
const color = feature.get('COLOR') || '#eeeeee';
selected.getFill().setColor(color);
return selected;
}
// select interaction working on "singleclick"
const selectSingleClick = new Select();
const selectSingleClick = new Select({style: selectStyle});
// select interaction working on "click"
const selectClick = new Select({
condition: click,
style: selectStyle,
});
// select interaction working on "pointermove"
const selectPointerMove = new Select({
condition: pointerMove,
style: selectStyle,
});
const selectAltClick = new Select({
style: selectStyle,
condition: function (mapBrowserEvent) {
return click(mapBrowserEvent) && altKeyOnly(mapBrowserEvent);
},

View File

@@ -7,4 +7,4 @@ docs: >
tags: "select, vector"
---
<div id="map" class="map"></div>
<span id="status"></span>
<span id="status">&nbsp;</span>

View File

@@ -1,36 +1,33 @@
import Fill from '../src/ol/style/Fill.js';
import GeoJSON from '../src/ol/format/GeoJSON.js';
import Map from '../src/ol/Map.js';
import OSM from '../src/ol/source/OSM.js';
import Stroke from '../src/ol/style/Stroke.js';
import Style from '../src/ol/style/Style.js';
import VectorLayer from '../src/ol/layer/Vector.js';
import VectorSource from '../src/ol/source/Vector.js';
import View from '../src/ol/View.js';
import {Tile as TileLayer, Vector as VectorLayer} from '../src/ol/layer.js';
const raster = new TileLayer({
source: new OSM(),
});
const highlightStyle = new Style({
const style = new Style({
fill: new Fill({
color: 'rgba(255,255,255,0.7)',
}),
stroke: new Stroke({
color: '#3399CC',
width: 3,
color: '#eeeeee',
}),
});
const vector = new VectorLayer({
source: new VectorSource({
url: 'data/geojson/countries.geojson',
url: 'https://openlayers.org/data/vector/ecoregions.json',
format: new GeoJSON(),
}),
background: 'white',
style: function (feature) {
const color = feature.get('COLOR') || '#eeeeee';
style.getFill().setColor(color);
return style;
},
});
const map = new Map({
layers: [raster, vector],
layers: [vector],
target: 'map',
view: new View({
center: [0, 0],
@@ -38,9 +35,19 @@ const map = new Map({
}),
});
let selected = null;
const selectStyle = new Style({
fill: new Fill({
color: '#eeeeee',
}),
stroke: new Stroke({
color: 'rgba(255, 255, 255, 0.7)',
width: 2,
}),
});
const status = document.getElementById('status');
let selected = null;
map.on('pointermove', function (e) {
if (selected !== null) {
selected.setStyle(undefined);
@@ -49,12 +56,13 @@ map.on('pointermove', function (e) {
map.forEachFeatureAtPixel(e.pixel, function (f) {
selected = f;
f.setStyle(highlightStyle);
selectStyle.getFill().setColor(f.get('COLOR') || '#eeeeee');
f.setStyle(selectStyle);
return true;
});
if (selected) {
status.innerHTML = '&nbsp;Hovering: ' + selected.get('name');
status.innerHTML = selected.get('ECO_NAME');
} else {
status.innerHTML = '&nbsp;';
}

View File

@@ -1,40 +1,37 @@
import Fill from '../src/ol/style/Fill.js';
import GeoJSON from '../src/ol/format/GeoJSON.js';
import Map from '../src/ol/Map.js';
import OSM from '../src/ol/source/OSM.js';
import Stroke from '../src/ol/style/Stroke.js';
import Style from '../src/ol/style/Style.js';
import VectorLayer from '../src/ol/layer/Vector.js';
import VectorSource from '../src/ol/source/Vector.js';
import View from '../src/ol/View.js';
import {Tile as TileLayer, Vector as VectorLayer} from '../src/ol/layer.js';
const raster = new TileLayer({
source: new OSM(),
});
import {fromLonLat} from '../src/ol/proj.js';
const highlightStyle = new Style({
fill: new Fill({
color: 'rgba(255,255,255,0.7)',
color: '#EEE',
}),
stroke: new Stroke({
color: '#3399CC',
width: 3,
width: 2,
}),
});
const vector = new VectorLayer({
background: 'white',
source: new VectorSource({
url: 'data/geojson/countries.geojson',
url: 'https://openlayers.org/data/vector/us-states.json',
format: new GeoJSON(),
}),
});
const map = new Map({
layers: [raster, vector],
layers: [vector],
target: 'map',
view: new View({
center: [0, 0],
zoom: 2,
center: fromLonLat([-100, 38.5]),
zoom: 4,
multiWorld: true,
}),
});

View File

@@ -6,6 +6,7 @@ import VectorLayer from '../src/ol/layer/Vector.js';
import VectorSource from '../src/ol/source/Vector.js';
import View from '../src/ol/View.js';
import proj4 from 'proj4';
import {Fill, Style} from '../src/ol/style.js';
import {register} from '../src/ol/proj/proj4.js';
proj4.defs(
@@ -26,14 +27,25 @@ const sphereMollweideProjection = new Projection({
worldExtent: [-179, -89.99, 179, 89.99],
});
const style = new Style({
fill: new Fill({
color: '#eeeeee',
}),
});
const map = new Map({
keyboardEventTarget: document,
layers: [
new VectorLayer({
source: new VectorSource({
url: 'data/geojson/countries-110m.geojson',
url: 'https://openlayers.org/data/vector/ecoregions.json',
format: new GeoJSON(),
}),
style: function (feature) {
const color = feature.get('COLOR_BIO') || '#eeeeee';
style.getFill().setColor(color);
return style;
},
}),
new Graticule(),
],
@@ -41,6 +53,6 @@ const map = new Map({
view: new View({
center: [0, 0],
projection: sphereMollweideProjection,
zoom: 1,
zoom: 2,
}),
});

View File

@@ -67,7 +67,7 @@
<link rel="stylesheet" href="./resources/prism/prism-1.20.0.css" type="text/css">
<link rel="stylesheet" href="./css/ol.css" type="text/css">
<link rel="stylesheet" href="./resources/layout.css" type="text/css">
<script src="https://unpkg.com/elm-pep"></script>
<script src="https://unpkg.com/elm-pep@1.0.6/dist/elm-pep.js"></script>
<script src="https://cdn.polyfill.io/v3/polyfill.min.js?features=fetch,requestAnimationFrame,Element.prototype.classList,TextDecoder"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/core-js/3.18.3/minified.js"></script>
{{{ extraHead.local }}}
@@ -193,7 +193,7 @@
&lt;meta charset="UTF-8"&gt;
&lt;title&gt;{{ title }}&lt;/title&gt;
&lt;!-- Pointer events polyfill for old browsers, see https://caniuse.com/#feat=pointer --&gt;
&lt;script src="https://unpkg.com/elm-pep"&gt;&lt;/script&gt;
&lt;script src="https://unpkg.com/elm-pep@1.0.6/dist/elm-pep.js"&gt;&lt;/script&gt;
&lt;!-- The lines below are only needed for old environments like Internet Explorer and Android 4.x --&gt;
&lt;script src="https://cdn.polyfill.io/v3/polyfill.min.js?features=fetch,requestAnimationFrame,Element.prototype.classList,TextDecoder"&gt;&lt;/script&gt;
&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/core-js/3.18.3/minified.js"&gt;&lt;/script&gt;{{#if extraHead.remote}}

View File

@@ -1,6 +1,6 @@
import GeoJSON from '../src/ol/format/GeoJSON.js';
import Map from '../src/ol/Map.js';
import OSM from '../src/ol/source/OSM.js';
import VectorLayer from '../src/ol/layer/Vector.js';
import VectorSource from '../src/ol/source/Vector.js';
import View from '../src/ol/View.js';
import {
@@ -8,15 +8,12 @@ import {
Translate,
defaults as defaultInteractions,
} from '../src/ol/interaction.js';
import {Tile as TileLayer, Vector as VectorLayer} from '../src/ol/layer.js';
const raster = new TileLayer({
source: new OSM(),
});
import {fromLonLat} from '../src/ol/proj.js';
const vector = new VectorLayer({
background: 'white',
source: new VectorSource({
url: 'data/geojson/countries.geojson',
url: 'https://openlayers.org/data/vector/us-states.json',
format: new GeoJSON(),
}),
});
@@ -29,10 +26,10 @@ const translate = new Translate({
const map = new Map({
interactions: defaultInteractions().extend([select, translate]),
layers: [raster, vector],
layers: [vector],
target: 'map',
view: new View({
center: [0, 0],
zoom: 2,
center: fromLonLat([-100, 38.5]),
zoom: 4,
}),
});

View File

@@ -15,6 +15,6 @@ cloak:
<!-- Overlay with the country info -->
<div id="country-info">
<div id="country-name">&nbsp;</div>
<img id="country-flag" src="" />
<img id="country-flag" />
</div>
</div>

View File

@@ -2,8 +2,6 @@
layout: example.html
title: Vector Label Decluttering
shortdesc: Label decluttering on polygons.
resources:
- https://cdn.polyfill.io/v2/polyfill.min.js?features=Set"
docs: >
Decluttering is used to avoid overlapping labels. The `overflow: true` setting on the text style makes it so labels that do not fit within the bounds of a polygon are also considered for decluttering.
tags: "vector, decluttering, labels"

View File

@@ -4,12 +4,13 @@ import VectorLayer from '../src/ol/layer/Vector.js';
import VectorSource from '../src/ol/source/Vector.js';
import View from '../src/ol/View.js';
import {Fill, Stroke, Style, Text} from '../src/ol/style.js';
import {fromLonLat} from '../src/ol/proj.js';
const map = new Map({
target: 'map',
view: new View({
center: [0, 0],
zoom: 1,
center: fromLonLat([-100, 38.5]),
zoom: 4,
}),
});
@@ -38,12 +39,14 @@ const countryStyle = new Style({
const style = [countryStyle, labelStyle];
const vectorLayer = new VectorLayer({
background: 'white',
source: new VectorSource({
url: 'data/geojson/countries.geojson',
url: 'https://openlayers.org/data/vector/us-states.json',
format: new GeoJSON(),
}),
style: function (feature) {
labelStyle.getText().setText(feature.get('name'));
const label = feature.get('name').split(' ').join('\n');
labelStyle.getText().setText(label);
return style;
},
declutter: true,

View File

@@ -3,35 +3,23 @@ import Map from '../src/ol/Map.js';
import VectorLayer from '../src/ol/layer/Vector.js';
import VectorSource from '../src/ol/source/Vector.js';
import View from '../src/ol/View.js';
import {Fill, Stroke, Style, Text} from '../src/ol/style.js';
import {Fill, Stroke, Style} from '../src/ol/style.js';
const style = new Style({
fill: new Fill({
color: 'rgba(255, 255, 255, 0.6)',
}),
stroke: new Stroke({
color: '#319FD3',
width: 1,
}),
text: new Text({
font: '12px Calibri,sans-serif',
fill: new Fill({
color: '#000',
}),
stroke: new Stroke({
color: '#fff',
width: 3,
}),
color: '#eeeeee',
}),
});
const vectorLayer = new VectorLayer({
background: '#1a2b39',
source: new VectorSource({
url: 'data/geojson/countries.geojson',
url: 'https://openlayers.org/data/vector/ecoregions.json',
format: new GeoJSON(),
}),
style: function (feature) {
style.getText().setText(feature.get('name'));
const color = feature.get('COLOR') || '#eeeeee';
style.getFill().setColor(color);
return style;
},
});
@@ -45,33 +33,15 @@ const map = new Map({
}),
});
const highlightStyle = new Style({
stroke: new Stroke({
color: '#f00',
width: 1,
}),
fill: new Fill({
color: 'rgba(255,0,0,0.1)',
}),
text: new Text({
font: '12px Calibri,sans-serif',
fill: new Fill({
color: '#000',
}),
stroke: new Stroke({
color: '#f00',
width: 3,
}),
}),
});
const featureOverlay = new VectorLayer({
source: new VectorSource(),
map: map,
style: function (feature) {
highlightStyle.getText().setText(feature.get('name'));
return highlightStyle;
},
style: new Style({
stroke: new Stroke({
color: 'rgba(255, 255, 255, 0.7)',
width: 2,
}),
}),
});
let highlight;
@@ -82,7 +52,7 @@ const displayFeatureInfo = function (pixel) {
const info = document.getElementById('info');
if (feature) {
info.innerHTML = feature.getId() + ': ' + feature.get('name');
info.innerHTML = feature.get('ECO_NAME') || '&nbsp;';
} else {
info.innerHTML = '&nbsp;';
}

View File

@@ -11,6 +11,5 @@ 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

@@ -17,7 +17,6 @@ const imagery = new TileLayer({
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>',
crossOrigin: '',
maxZoom: 20,
}),
});

View File

@@ -33,7 +33,6 @@ const layer = new TileLayer({
'https://api.maptiler.com/tiles/terrain-rgb/{z}/{x}/{y}.png?key=' + key,
tileSize: 512,
maxZoom: 12,
crossOrigin: 'anonymous',
}),
style: {
variables: {
@@ -56,7 +55,6 @@ const map = new Map({
source: new XYZ({
url: 'https://api.maptiler.com/maps/streets/{z}/{x}/{y}.png?key=' + key,
attributions: attributions,
crossOrigin: 'anonymous',
tileSize: 512,
maxZoom: 22,
}),

View File

@@ -50,7 +50,6 @@ const shadedRelief = new TileLayer({
opacity: 0.3,
source: new XYZ({
url: 'https://{a-d}.tiles.mapbox.com/v3/aj.sf-dem/{z}/{x}/{y}.png',
crossOrigin: 'anonymous',
}),
style: {
variables: variables,

View File

@@ -22,7 +22,6 @@ const layer = new TileLayer({
variables: variables,
},
source: new XYZ({
crossOrigin: 'anonymous', // TODO: determine if we can avoid this
attributions: attributions,
url: 'https://api.maptiler.com/tiles/satellite/{z}/{x}/{y}.jpg?key=' + key,
maxZoom: 20,

View File

@@ -329,7 +329,7 @@ export default class ExampleBuilder {
source = this.cloakSource(source, data.cloak);
assets[fileName] = source;
return {
name: sourceConfig.as ?? fileName,
name: sourceConfig.as || fileName,
source: source,
type: ext,
};

3751
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "ol",
"version": "6.10.0",
"version": "6.13.0",
"description": "OpenLayers mapping library",
"keywords": [
"map",
@@ -25,9 +25,9 @@
"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 && 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",
"typecheck": "npx --package=typescript@4.3.5 -y -- tsc --pretty",
"generate-types": "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 && tsc --project config/tsconfig-build.json",
"typecheck": "tsc --pretty",
"apidoc-debug": "shx rm -rf build/apidoc && node --inspect-brk=9229 ./node_modules/jsdoc/jsdoc.js -R config/jsdoc/api/index.md -c config/jsdoc/api/conf.json -P package.json -d build/apidoc",
"apidoc": "shx rm -rf build/apidoc && jsdoc -R config/jsdoc/api/index.md -c config/jsdoc/api/conf.json -P package.json -d build/apidoc"
},
@@ -45,8 +45,8 @@
"url": "https://opencollective.com/openlayers"
},
"dependencies": {
"geotiff": "^1.0.8",
"ol-mapbox-style": "^6.7.0",
"geotiff": "^2.0.2",
"ol-mapbox-style": "^7.0.0",
"pbf": "3.2.1",
"rbush": "^3.0.1"
},
@@ -59,23 +59,24 @@
"@rollup/plugin-node-resolve": "^13.0.0",
"@types/arcgis-rest-api": "^10.4.4",
"@types/geojson": "^7946.0.7",
"@types/offscreencanvas": "^2019.6.4",
"@types/pbf": "^3.0.2",
"@types/topojson-specification": "^1.0.1",
"babel-loader": "^8.2.2",
"chaikin-smooth": "^1.0.4",
"clean-css-cli": "5.5.0",
"clean-css-cli": "5.5.2",
"copy-webpack-plugin": "^10.0.0",
"es-main": "^1.0.2",
"eslint": "^8.0.1",
"eslint-config-openlayers": "^16.0.1",
"eslint-config-openlayers": "^16.1.0",
"expect.js": "0.3.1",
"express": "^4.17.1",
"front-matter": "^4.0.0",
"fs-extra": "^10.0.0",
"globby": "^12.0.0",
"globby": "^13.0.0",
"handlebars": "4.7.7",
"jquery": "3.6.0",
"jsdoc": "3.6.7",
"jsdoc": "3.6.10",
"jsdoc-plugin-typescript": "^2.0.5",
"json-stringify-safe": "^5.0.1",
"karma": "^6.3.8",
@@ -85,19 +86,20 @@
"karma-source-map-support": "^1.4.0",
"karma-webpack": "^5.0.0",
"loglevelnext": "^5.0.5",
"marked": "4.0.8",
"mocha": "9.1.3",
"marked": "4.0.12",
"mocha": "9.2.1",
"pixelmatch": "^5.1.0",
"pngjs": "^6.0.0",
"proj4": "^2.7.5",
"puppeteer": "13.0.1",
"puppeteer": "13.3.2",
"regenerator-runtime": "^0.13.9",
"rollup": "^2.42.3",
"rollup-plugin-terser": "^7.0.2",
"serve-static": "^1.14.0",
"shx": "^0.3.2",
"sinon": "^12.0.1",
"sinon": "^13.0.0",
"threads": "^1.6.5",
"typescript": "4.6.0-beta",
"walk": "^2.3.9",
"webpack": "^5.27.2",
"webpack-cli": "^4.5.0",

View File

@@ -7,7 +7,7 @@
<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>
<script src="https://unpkg.com/elm-pep@1.0.6/dist/elm-pep.js"></script>
<!-- The lines below are 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,TextDecoder"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/core-js/3.18.3/minified.js"></script>

View File

@@ -11,7 +11,7 @@ import {listen, unlistenByKey} from './events.js';
*/
/**
* @typedef {Feature<import("./geom/Geometry.js").default>|import("./render/Feature.js").default} FeatureLike
* @typedef {Feature|import("./render/Feature.js").default} FeatureLike
*/
/***
@@ -36,7 +36,7 @@ import {listen, unlistenByKey} from './events.js';
* Features can be styled individually with `setStyle`; otherwise they use the
* style of their vector layer.
*
* Note that attribute properties are set as {@link module:ol/Object} properties on
* Note that attribute properties are set as {@link module:ol/Object~BaseObject} properties on
* the feature object, so they are observable, and have get/set accessors.
*
* Typically, a feature has a single geometry property. You can set the
@@ -70,7 +70,7 @@ import {listen, unlistenByKey} from './events.js';
* ```
*
* @api
* @template {import("./geom/Geometry.js").default} Geometry
* @template {import("./geom/Geometry.js").default} [Geometry=import("./geom/Geometry.js").default]
*/
class Feature extends BaseObject {
/**

View File

@@ -9,9 +9,9 @@ import {getHeight} from './extent.js';
import {listenOnce, unlistenByKey} from './events.js';
/**
* A function that takes an {@link module:ol/Image~Image} for the image and a
* A function that takes an {@link module:ol/Image~ImageWrapper} for the image and a
* `{string}` for the src as arguments. It is supposed to make it so the
* underlying image {@link module:ol/Image~Image#getImage} is assigned the
* underlying image {@link module:ol/Image~ImageWrapper#getImage} is assigned the
* content specified by the src. If not specified, the default is
*
* function(image, src) {

View File

@@ -30,7 +30,7 @@ import {defaults as defaultInteractions} from './interaction.js';
* target: 'map'
* });
*
* The above snippet creates a map using a {@link module:ol/layer/Tile} to
* The above snippet creates a map using a {@link module:ol/layer/Tile~TileLayer} to
* display {@link module:ol/source/OSM~OSM} OSM data and render it to a DOM
* element with the id `map`.
*
@@ -47,8 +47,8 @@ import {defaults as defaultInteractions} from './interaction.js';
* accessed by `getLayerGroup` and `setLayerGroup`. Layers entered in the
* options are added to this group, and `addLayer` and `removeLayer` change the
* layer collection in the group. `getLayers` is a convenience function for
* `getLayerGroup().getLayers()`. Note that {@link module:ol/layer/Group~Group}
* is a subclass of {@link module:ol/layer/Base}, so layers entered in the
* `getLayerGroup().getLayers()`. Note that {@link module:ol/layer/Group~LayerGroup}
* is a subclass of {@link module:ol/layer/Base~BaseLayer}, so layers entered in the
* options or added with `addLayer` can be groups, which can contain further
* groups, and so on.
*

View File

@@ -59,7 +59,7 @@ class MapBrowserEventHandler extends Target {
/**
* The most recent "down" type event (or null if none have occurred).
* Set on pointerdown.
* @type {PointerEvent}
* @type {PointerEvent|null}
* @private
*/
this.down_ = null;

View File

@@ -50,7 +50,7 @@ export class ObjectEvent extends Event {
* instantiated in apps.
* Most non-trivial classes inherit from this.
*
* This extends {@link module:ol/Observable} with observable
* This extends {@link module:ol/Observable~Observable} with observable
* properties, where each property is observable as well as the object as a
* whole.
*
@@ -172,10 +172,14 @@ class BaseObject extends Observable {
notify(key, oldValue) {
let eventType;
eventType = `change:${key}`;
if (this.hasListener(eventType)) {
this.dispatchEvent(new ObjectEvent(eventType, key, oldValue));
}
eventType = ObjectEventType.PROPERTYCHANGE;
if (this.hasListener(eventType)) {
this.dispatchEvent(new ObjectEvent(eventType, key, oldValue));
}
}
/**
* @param {string} key Key name.

View File

@@ -249,14 +249,14 @@ class Overlay extends BaseObject {
/**
* Get the map associated with this overlay.
* @return {import("./PluggableMap.js").default|undefined} The map that the
* @return {import("./PluggableMap.js").default|null} The map that the
* overlay is part of.
* @observable
* @api
*/
getMap() {
return /** @type {import("./PluggableMap.js").default|undefined} */ (
this.get(Property.MAP)
return /** @type {import("./PluggableMap.js").default|null} */ (
this.get(Property.MAP) || null
);
}
@@ -378,8 +378,8 @@ class Overlay extends BaseObject {
/**
* Set the map to be associated with this overlay.
* @param {import("./PluggableMap.js").default|undefined} map The map that the
* overlay is part of.
* @param {import("./PluggableMap.js").default|null} map The map that the
* overlay is part of. Pass `null` to just remove the overlay from the current map.
* @observable
* @api
*/

View File

@@ -73,7 +73,7 @@ import {removeNode} from './dom.js';
* @typedef {Object} AtPixelOptions
* @property {undefined|function(import("./layer/Layer.js").default<import("./source/Source").default>): boolean} [layerFilter] Layer filter
* function. The filter function will receive one argument, the
* {@link module:ol/layer/Layer layer-candidate} and it should return a boolean value.
* {@link module:ol/layer/Layer~Layer layer-candidate} and it should return a boolean value.
* Only layers which are visible and for which this function returns `true`
* will be tested for features. By default, all visible layers will be tested.
* @property {number} [hitTolerance=0] Hit-detection tolerance in css pixels. Pixels
@@ -610,9 +610,9 @@ class PluggableMap extends BaseObject {
* @param {import("./pixel.js").Pixel} pixel Pixel.
* @param {function(import("./Feature.js").FeatureLike, import("./layer/Layer.js").default<import("./source/Source").default>, import("./geom/SimpleGeometry.js").default): T} callback Feature callback. The callback will be
* called with two arguments. The first argument is one
* {@link module:ol/Feature feature} or
* {@link module:ol/render/Feature render feature} at the pixel, the second is
* the {@link module:ol/layer/Layer layer} of the feature and will be null for
* {@link module:ol/Feature~Feature feature} or
* {@link module:ol/render/Feature~RenderFeature render feature} at the pixel, the second is
* the {@link module:ol/layer/Layer~Layer layer} of the feature and will be null for
* unmanaged layers. To stop detection, callback functions can return a
* truthy value.
* @param {AtPixelOptions} [opt_options] Optional options.
@@ -667,6 +667,7 @@ class PluggableMap extends BaseObject {
/**
* Get all layers from all layer groups.
* @return {Array<import("./layer/Layer.js").default>} Layers.
* @api
*/
getAllLayers() {
const layers = [];
@@ -684,17 +685,23 @@ class PluggableMap extends BaseObject {
}
/**
* Please the `layer.getData()` method for {@link module:ol/layer/Tile~TileLayer#getData tile layers} or
* {@link module:ol/layer/Image~ImageLayer#getData image layers} instead of using this method.
*
* Detect layers that have a color value at a pixel on the viewport, and
* execute a callback with each matching layer. Layers included in the
* detection can be configured through `opt_layerFilter`.
*
* Note: this may give false positives unless the map layers have had different `className`
* properties assigned to them.
* Note: In maps with more than one layer, this method will typically return pixel data
* representing the composed image of all layers visible at the given pixel because layers
* will generally share the same rendering context. To force layers to render separately, and
* to get pixel data representing only one layer at a time, you can assign each layer a unique
* `className` in its constructor.
*
* @param {import("./pixel.js").Pixel} pixel Pixel.
* @param {function(this: S, import("./layer/Layer.js").default, (Uint8ClampedArray|Uint8Array)): T} callback
* Layer callback. This callback will receive two arguments: first is the
* {@link module:ol/layer/Layer layer}, second argument is an array representing
* {@link module:ol/layer/Layer~Layer layer}, second argument is an array representing
* [R, G, B, A] pixel values (0 - 255) and will be `null` for layer types
* that do not currently support this argument. To stop detection, callback
* functions can return a truthy value.
@@ -703,6 +710,7 @@ class PluggableMap extends BaseObject {
* callback execution, or the first truthy callback return value.
* @template S,T
* @api
* @deprecated
*/
forEachLayerAtPixel(pixel, callback, opt_options) {
if (!this.frameState_) {
@@ -939,10 +947,13 @@ class PluggableMap extends BaseObject {
/**
* @return {boolean} Layers have sources that are still loading.
*/
getLoading() {
getLoadingOrNotReady() {
const layerStatesArray = this.getLayerGroup().getLayerStatesArray();
for (let i = 0, ii = layerStatesArray.length; i < ii; ++i) {
const layer = layerStatesArray[i].layer;
if (!layer.getRenderer().ready) {
return true;
}
const source = /** @type {import("./layer/Layer.js").default} */ (
layer
).getSource();
@@ -1557,7 +1568,7 @@ class PluggableMap extends BaseObject {
this.renderComplete_ =
!this.tileQueue_.getTilesLoading() &&
!this.tileQueue_.getCount() &&
!this.getLoading();
!this.getLoadingOrNotReady();
if (!this.postRenderTimeoutHandle_) {
this.postRenderTimeoutHandle_ = setTimeout(() => {

View File

@@ -8,7 +8,7 @@ import {abstract} from './util.js';
import {easeIn} from './easing.js';
/**
* A function that takes an {@link module:ol/Tile} for the tile and a
* A function that takes an {@link module:ol/Tile~Tile} for the tile and a
* `{string}` for the url as arguments. The default is
* ```js
* source.setTileLoadFunction(function(tile, src) {
@@ -45,12 +45,12 @@ import {easeIn} from './easing.js';
*/
/**
* {@link module:ol/source/Tile~Tile} sources use a function of this type to get
* {@link module:ol/source/Tile~TileSource} sources use a function of this type to get
* the url that provides a tile for a given tile coordinate.
*
* This function takes an {@link module:ol/tilecoord~TileCoord} for the tile
* coordinate, a `{number}` representing the pixel ratio and a
* {@link module:ol/proj/Projection} for the projection as arguments
* {@link module:ol/proj/Projection~Projection} for the projection as arguments
* and returns a `{string}` representing the tile URL, or undefined if no tile
* should be requested for the passed tile coordinate.
*

View File

@@ -10,6 +10,7 @@ import {DEFAULT_TILE_SIZE} from './tilegrid/common.js';
import {
METERS_PER_UNIT,
createProjection,
disableCoordinateWarning,
fromUserCoordinate,
fromUserExtent,
getUserProjection,
@@ -20,25 +21,25 @@ import {VOID} from './functions.js';
import {
add as addCoordinate,
equals as coordinatesEqual,
equals,
rotate as rotateCoordinate,
} from './coordinate.js';
import {assert} from './asserts.js';
import {assign} from './obj.js';
import {none as centerNone, createExtent} from './centerconstraint.js';
import {clamp, modulo} from './math.js';
import {createMinMaxResolution} from './resolutionconstraint.js';
import {
createMinMaxResolution,
createSnapToPower,
createSnapToResolutions,
} from './resolutionconstraint.js';
import {
createSnapToN,
createSnapToZero,
disable,
none as rotationNone,
} from './rotationconstraint.js';
import {
createSnapToPower,
createSnapToResolutions,
} from './resolutionconstraint.js';
import {easeOut} from './easing.js';
import {equals} from './coordinate.js';
import {easeOut, inAndOut} from './easing.js';
import {
getCenter,
getForViewAndSize,
@@ -46,7 +47,6 @@ import {
getWidth,
isEmpty,
} from './extent.js';
import {inAndOut} from './easing.js';
import {linearFindNearest} from './array.js';
import {fromExtent as polygonFromExtent} from './geom/Polygon.js';
@@ -242,7 +242,7 @@ const DEFAULT_MIN_ZOOM = 0;
* A View has a `projection`. The projection determines the
* coordinate system of the center, and its units determine the units of the
* resolution (projection units per pixel). The default projection is
* Spherical Mercator (EPSG:3857).
* Web Mercator (EPSG:3857).
*
* ### The view states
*
@@ -407,6 +407,9 @@ class View extends BaseObject {
if (options.extent) {
options.extent = fromUserExtent(options.extent, this.projection_);
}
if (options.projection) {
disableCoordinateWarning();
}
this.applyOptions_(options);
}
@@ -1633,7 +1636,9 @@ class View extends BaseObject {
* @api
*/
setCenter(center) {
this.setCenterInternal(fromUserCoordinate(center, this.getProjection()));
this.setCenterInternal(
center ? fromUserCoordinate(center, this.getProjection()) : center
);
}
/**

View File

@@ -18,14 +18,19 @@ export function createExtent(extent, onlyCenter, smooth) {
return (
/**
* @param {import("./coordinate.js").Coordinate|undefined} center Center.
* @param {number} resolution Resolution.
* @param {number|undefined} resolution Resolution.
* @param {import("./size.js").Size} size Viewport size; unused if `onlyCenter` was specified.
* @param {boolean} [opt_isMoving] True if an interaction or animation is in progress.
* @param {Array<number>} [opt_centerShift] Shift between map center and viewport center.
* @return {import("./coordinate.js").Coordinate|undefined} Center.
*/
function (center, resolution, size, opt_isMoving, opt_centerShift) {
if (center) {
if (!center) {
return undefined;
}
if (!resolution && !onlyCenter) {
return center;
}
const viewWidth = onlyCenter ? 0 : size[0] * resolution;
const viewHeight = onlyCenter ? 0 : size[1] * resolution;
const shiftX = opt_centerShift ? opt_centerShift[0] : 0;
@@ -48,10 +53,10 @@ export function createExtent(extent, onlyCenter, smooth) {
let x = clamp(center[0], minX, maxX);
let y = clamp(center[1], minY, maxY);
const ratio = 30 * resolution;
// during an interaction, allow some overscroll
if (opt_isMoving && smooth) {
if (opt_isMoving && smooth && resolution) {
const ratio = 30 * resolution;
x +=
-ratio * Math.log(1 + Math.max(0, minX - center[0]) / ratio) +
ratio * Math.log(1 + Math.max(0, center[0] - maxX) / ratio);
@@ -61,9 +66,6 @@ export function createExtent(extent, onlyCenter, smooth) {
}
return [x, y];
} else {
return undefined;
}
}
);
}

View File

@@ -110,7 +110,7 @@ class Attribution extends Control {
const collapseClassName =
options.collapseClassName !== undefined
? options.collapseClassName
: className + '-collpase';
: className + '-collapse';
if (typeof collapseLabel === 'string') {
/**

View File

@@ -69,7 +69,7 @@ class Control extends BaseObject {
/**
* @private
* @type {import("../PluggableMap.js").default}
* @type {import("../PluggableMap.js").default|null}
*/
this.map_ = null;
@@ -98,7 +98,7 @@ class Control extends BaseObject {
/**
* Get the map associated with this control.
* @return {import("../PluggableMap.js").default|undefined} Map.
* @return {import("../PluggableMap.js").default|null} Map.
* @api
*/
getMap() {
@@ -107,9 +107,10 @@ class Control extends BaseObject {
/**
* Remove the control from its current map and attach it to the new map.
* Pass `null` to just remove the control from the current 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|null} map Map.
* @api
*/
setMap(map) {
@@ -121,7 +122,7 @@ class Control extends BaseObject {
}
this.listenerKeys.length = 0;
this.map_ = map;
if (this.map_) {
if (map) {
const target = this.target_
? this.target_
: map.getOverlayContainerStopEvent();

View File

@@ -281,9 +281,10 @@ class FullScreen extends Control {
/**
* Remove the control from its current map and attach it to the new map.
* Pass `null` to just remove the control from the current 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|null} map Map.
* @api
*/
setMap(map) {

View File

@@ -212,9 +212,10 @@ class MousePosition extends Control {
/**
* Remove the control from its current map and attach it to the new map.
* Pass `null` to just remove the control from the current 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|null} map Map.
* @api
*/
setMap(map) {

View File

@@ -267,9 +267,10 @@ class OverviewMap extends Control {
/**
* Remove the control from its current map and attach it to the new map.
* Pass `null` to just remove the control from the current 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|null} map Map.
* @api
*/
setMap(map) {

View File

@@ -484,12 +484,12 @@ class ScaleLine extends Control {
const resolution = getPointResolution(
this.viewState_.projection,
this.viewState_.resolution,
this.viewState_.center
this.viewState_.center,
ProjUnits.METERS
);
const dpi = this.dpi_ || DEFAULT_DPI;
const mpu = this.viewState_.projection.getMetersPerUnit();
const inchesPerMeter = 1000 / 25.4;
return parseFloat(resolution.toString()) * mpu * inchesPerMeter * dpi;
return parseFloat(resolution.toString()) * inchesPerMeter * dpi;
}
/**

View File

@@ -161,9 +161,10 @@ class ZoomSlider extends Control {
/**
* Remove the control from its current map and attach it to the new map.
* Pass `null` to just remove the control from the current 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|null} map Map.
* @api
*/
setMap(map) {

View File

@@ -38,7 +38,7 @@ class ZoomToExtent extends Control {
});
/**
* @type {?import("../extent.js").Extent}
* @type {?import("../extent.js").Extent|null}
* @protected
*/
this.extent = options.extent ? options.extent : null;

View File

@@ -91,7 +91,7 @@ const fontRegExMatchIndex = [
* Get the list of font families from a font spec. Note that this doesn't work
* for font families that have commas in them.
* @param {string} fontSpec The CSS font property.
* @return {FontParameters} The font parameters (or null if the input spec is invalid).
* @return {FontParameters|null} The font parameters (or null if the input spec is invalid).
*/
export const getFontParameters = function (fontSpec) {
const match = fontSpec.match(fontRegEx);

View File

@@ -83,7 +83,7 @@ export function replaceNode(newNode, oldNode) {
/**
* @param {Node} node The node to remove.
* @return {Node} The node that was removed or null.
* @return {Node|null} The node that was removed or null.
*/
export function removeNode(node) {
return node && node.parentNode ? node.parentNode.removeChild(node) : null;

View File

@@ -4,7 +4,7 @@
import {clear} from './obj.js';
/**
* Key to use with {@link module:ol/Observable~Observable#unByKey}.
* Key to use with {@link module:ol/Observable.unByKey}.
* @typedef {Object} EventsKey
* @property {ListenerFunction} listener Listener.
* @property {import("./events/Target.js").EventTargetLike} target Target.

View File

@@ -83,15 +83,17 @@ class Target extends Disposable {
* @api
*/
dispatchEvent(event) {
/** @type {import("./Event.js").default|Event} */
const evt = typeof event === 'string' ? new Event(event) : event;
const type = evt.type;
const isString = typeof event === 'string';
const type = isString ? event : event.type;
const listeners = this.listeners_ && this.listeners_[type];
if (!listeners) {
return;
}
const evt = isString ? new Event(event) : /** @type {Event} */ (event);
if (!evt.target) {
evt.target = this.eventTarget_ || this;
}
const listeners = this.listeners_ && this.listeners_[type];
let propagate;
if (listeners) {
const dispatching = this.dispatching_ || (this.dispatching_ = {});
const pendingRemovals =
this.pendingRemovals_ || (this.pendingRemovals_ = {});
@@ -100,6 +102,7 @@ class Target extends Disposable {
pendingRemovals[type] = 0;
}
++dispatching[type];
let propagate;
for (let i = 0, ii = listeners.length; i < ii; ++i) {
if ('handleEvent' in listeners[i]) {
propagate = /** @type {import("../events.js").ListenerObject} */ (
@@ -115,8 +118,7 @@ class Target extends Disposable {
break;
}
}
--dispatching[type];
if (dispatching[type] === 0) {
if (--dispatching[type] === 0) {
let pr = pendingRemovals[type];
delete pendingRemovals[type];
while (pr--) {
@@ -126,7 +128,6 @@ class Target extends Disposable {
}
return propagate;
}
}
/**
* Clean up.

View File

@@ -7,7 +7,7 @@ import {MAC, WEBKIT} from '../has.js';
import {assert} from '../asserts.js';
/**
* A function that takes an {@link module:ol/MapBrowserEvent} and returns a
* A function that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a
* `{boolean}`. If the condition is met, true should be returned.
*
* @typedef {function(this: ?, import("../MapBrowserEvent.js").default): boolean} Condition

View File

@@ -12,16 +12,16 @@ import {VOID} from './functions.js';
let withCredentials = false;
/**
* {@link module:ol/source/Vector} sources use a function of this type to
* {@link module:ol/source/Vector~VectorSource} sources use a function of this type to
* load features.
*
* This function takes up to 5 arguments. These are an {@link module:ol/extent~Extent} representing
* the area to be loaded, a `{number}` representing the resolution (map units per pixel), an
* {@link module:ol/proj/Projection} for the projection, an optional success callback that should get
* {@link module:ol/proj/Projection~Projection} for the projection, an optional success callback that should get
* the loaded features passed as an argument and an optional failure callback with no arguments. If
* the callbacks are not used, the corresponding vector source will not fire `'featuresloadend'` and
* `'featuresloaderror'` events. `this` within the function is bound to the
* {@link module:ol/source/Vector} it's called from.
* {@link module:ol/source/Vector~VectorSource} it's called from.
*
* The function is responsible for loading the features and adding them to the
* source.
@@ -35,12 +35,12 @@ let withCredentials = false;
*/
/**
* {@link module:ol/source/Vector} sources use a function of this type to
* {@link module:ol/source/Vector~VectorSource} sources use a function of this type to
* get the url to load features from.
*
* This function takes an {@link module:ol/extent~Extent} representing the area
* to be loaded, a `{number}` representing the resolution (map units per pixel)
* and an {@link module:ol/proj/Projection} for the projection as
* and an {@link module:ol/proj/Projection~Projection} for the projection as
* arguments and returns a `{string}` representing the URL.
* @typedef {function(import("./extent.js").Extent, number, import("./proj/Projection.js").default): string} FeatureUrlFunction
* @api

View File

@@ -393,7 +393,7 @@ class GML2 extends GMLBase {
}
/**
* @param {Node} node Node.
* @param {Element} node Node.
* @param {import("../geom/LineString.js").default} line LineString geometry.
* @param {Array<*>} objectStack Node stack.
* @private
@@ -455,7 +455,7 @@ class GML2 extends GMLBase {
}
/**
* @param {Node} node Node.
* @param {Element} node Node.
* @param {import("../geom/Polygon.js").default} polygon Polygon geometry.
* @param {Array<*>} objectStack Node stack.
* @private
@@ -467,7 +467,7 @@ class GML2 extends GMLBase {
}
/**
* @param {Node} node Node.
* @param {Element} node Node.
* @param {import("../geom/LinearRing.js").default} ring LinearRing geometry.
* @param {Array<*>} objectStack Node stack.
*/
@@ -546,7 +546,7 @@ class GML2 extends GMLBase {
}
/**
* @param {Node} node Node.
* @param {Element} node Node.
* @param {import("../geom/Point.js").default} point Point geometry.
* @param {Array<*>} objectStack Node stack.
*/

View File

@@ -720,7 +720,7 @@ class GML3 extends GMLBase {
}
/**
* @param {Node} node Node.
* @param {Element} node Node.
* @param {import("../geom/LinearRing.js").default} ring LinearRing geometry.
* @param {Array<*>} objectStack Node stack.
*/
@@ -744,7 +744,7 @@ class GML3 extends GMLBase {
}
/**
* @param {Node} node Node.
* @param {Element} node Node.
* @param {import("../geom/Point.js").default} point Point geometry.
* @param {Array<*>} objectStack Node stack.
*/
@@ -768,7 +768,7 @@ class GML3 extends GMLBase {
}
/**
* @param {Node} node Node.
* @param {Element} node Node.
* @param {Polygon} polygon Polygon geometry.
* @param {Array<*>} objectStack Node stack.
* @private
@@ -780,7 +780,7 @@ class GML3 extends GMLBase {
}
/**
* @param {Node} node Node.
* @param {Element} node Node.
* @param {LineString} line LineString geometry.
* @param {Array<*>} objectStack Node stack.
* @private

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