Compare commits
505 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
272a3c6b11 | ||
|
|
54db71917d | ||
|
|
546b995c3b | ||
|
|
6eea18938d | ||
|
|
242fe21f33 | ||
|
|
c92ac87bf5 | ||
|
|
bb9e13a3e5 | ||
|
|
d1b1444744 | ||
|
|
8992ed68f9 | ||
|
|
84ffdfb5f3 | ||
|
|
60a9abbf8f | ||
|
|
cb63b398d3 | ||
|
|
ce89a82e6a | ||
|
|
1c269d6e0b | ||
|
|
83b8fe4b33 | ||
|
|
346cd562ee | ||
|
|
ba88081eba | ||
|
|
2a3b21cfd9 | ||
|
|
785954f722 | ||
|
|
b8b3dcc066 | ||
|
|
76c4c2f85c | ||
|
|
65bbee4c8b | ||
|
|
10b56a4543 | ||
|
|
42a094d730 | ||
|
|
680ce960e1 | ||
|
|
77959efcff | ||
|
|
dc988cba60 | ||
|
|
5f747cbf1b | ||
|
|
2b025e2266 | ||
|
|
71ac0b18a9 | ||
|
|
3cf4dbfcc6 | ||
|
|
1732ed5a04 | ||
|
|
59c95dbe90 | ||
|
|
711afac80f | ||
|
|
43def3194f | ||
|
|
caf11a71f2 | ||
|
|
53c2be0c7a | ||
|
|
caaf8cb86f | ||
|
|
219dacb232 | ||
|
|
9ab201642c | ||
|
|
6d608c361a | ||
|
|
6a797e84ff | ||
|
|
c12b41f8c6 | ||
|
|
aaad5b4977 | ||
|
|
c2e756da05 | ||
|
|
467e13fa2d | ||
|
|
e0a46dd178 | ||
|
|
aeb3e5b271 | ||
|
|
f34cb17ffa | ||
|
|
5dfa82c27e | ||
|
|
e55cca1e7d | ||
|
|
d197864f5a | ||
|
|
4d5d428a96 | ||
|
|
0091bfa106 | ||
|
|
765d2cdc9f | ||
|
|
1de22f77dc | ||
|
|
f2b4555e1f | ||
|
|
3f69066d79 | ||
|
|
1a00e20b1b | ||
|
|
c90b8c2a12 | ||
|
|
6f57a272d0 | ||
|
|
1cdd040c96 | ||
|
|
1df9189d7f | ||
|
|
071a02556e | ||
|
|
f8c0d284de | ||
|
|
b50749e1ea | ||
|
|
e239eb338f | ||
|
|
1674620943 | ||
|
|
6ceb03f86b | ||
|
|
ba20c6333b | ||
|
|
2adac0b3e7 | ||
|
|
0a530725c6 | ||
|
|
391e38a973 | ||
|
|
7f1728f8d4 | ||
|
|
d3fdda6efc | ||
|
|
1ed51d02e3 | ||
|
|
8f12177593 | ||
|
|
f82619d6d0 | ||
|
|
453a723005 | ||
|
|
e8da3929d5 | ||
|
|
1f1951f3cc | ||
|
|
208f125158 | ||
|
|
df632dbaa9 | ||
|
|
b11daa8344 | ||
|
|
0130ce71ba | ||
|
|
3a42a0859c | ||
|
|
0593c352af | ||
|
|
724d141d3a | ||
|
|
deb6c093a8 | ||
|
|
0b21d1a6fc | ||
|
|
d1395d005c | ||
|
|
cd2f0f60d6 | ||
|
|
f58603bddf | ||
|
|
1740f02737 | ||
|
|
0cd3e39fe8 | ||
|
|
d5c895aa8b | ||
|
|
9810250fb4 | ||
|
|
8a2f74fbe8 | ||
|
|
0801b9e0be | ||
|
|
fc8ba24d3f | ||
|
|
e0a018fa1e | ||
|
|
3746ba99cf | ||
|
|
d294b87358 | ||
|
|
29b21da608 | ||
|
|
0787aa3439 | ||
|
|
41fea9905a | ||
|
|
7cd7a4d111 | ||
|
|
a06ad4940c | ||
|
|
6ff7747d98 | ||
|
|
e4816faadf | ||
|
|
f0c164802f | ||
|
|
ae409f40d5 | ||
|
|
7e142080a1 | ||
|
|
1a0f398f1f | ||
|
|
648ee4f4a4 | ||
|
|
3d72490241 | ||
|
|
df4ef724b6 | ||
|
|
d2d041e54a | ||
|
|
94fd57f690 | ||
|
|
939aa565b5 | ||
|
|
1035ba7bf2 | ||
|
|
041836c645 | ||
|
|
a85099a36b | ||
|
|
cddfc11125 | ||
|
|
d387702644 | ||
|
|
49a4bf4248 | ||
|
|
1e90ffacec | ||
|
|
43ca764293 | ||
|
|
fb11aad1d1 | ||
|
|
f7adeac774 | ||
|
|
076d6425cb | ||
|
|
2809784247 | ||
|
|
ee9c9bcefb | ||
|
|
e37039d85e | ||
|
|
9362e33be9 | ||
|
|
aea9479c12 | ||
|
|
6b24760299 | ||
|
|
594a921598 | ||
|
|
2005c82dd2 | ||
|
|
6252404d5b | ||
|
|
316b4a1bb7 | ||
|
|
7ec19645e9 | ||
|
|
b43e5929f2 | ||
|
|
f8585962b4 | ||
|
|
43b9f70077 | ||
|
|
6e7558e954 | ||
|
|
2768884044 | ||
|
|
af4e5ca7cf | ||
|
|
9285b283c0 | ||
|
|
9163558511 | ||
|
|
80753eb909 | ||
|
|
3e860d2c61 | ||
|
|
3ce80fbfb1 | ||
|
|
8aebed1cd6 | ||
|
|
90395c2355 | ||
|
|
50f90cdf61 | ||
|
|
04f2174052 | ||
|
|
0f15d38ae7 | ||
|
|
667f9a58f3 | ||
|
|
2f4d31c8f4 | ||
|
|
ad3f248825 | ||
|
|
c2c8cdab29 | ||
|
|
e828231449 | ||
|
|
dded939a07 | ||
|
|
945f686f8a | ||
|
|
2c6e80a601 | ||
|
|
da41515944 | ||
|
|
15c9fe7867 | ||
|
|
6d1cc3ba88 | ||
|
|
db15bb0942 | ||
|
|
94da8dd0e2 | ||
|
|
02b2be5b40 | ||
|
|
7672fe3b16 | ||
|
|
04c2359d49 | ||
|
|
f15ac14d2a | ||
|
|
177190403f | ||
|
|
12786e4352 | ||
|
|
d308288eed | ||
|
|
d6aced3e43 | ||
|
|
720993431c | ||
|
|
69dfbb9e54 | ||
|
|
23473a8346 | ||
|
|
414f6e0384 | ||
|
|
96e99e481e | ||
|
|
f5e8e3e009 | ||
|
|
61dedbbe6d | ||
|
|
f3f138b9bc | ||
|
|
b8addb4c24 | ||
|
|
8be23b799d | ||
|
|
84dda90bfc | ||
|
|
a92c992e1a | ||
|
|
c0903e6fc1 | ||
|
|
8d9fe7f688 | ||
|
|
144c2f9f15 | ||
|
|
4a066670c2 | ||
|
|
3781a6881d | ||
|
|
9d4821aafc | ||
|
|
38aa620afa | ||
|
|
ddae414ddc | ||
|
|
d3a82b0586 | ||
|
|
83763a73d9 | ||
|
|
07349de59b | ||
|
|
909869b8b9 | ||
|
|
942a0976be | ||
|
|
3397796ff2 | ||
|
|
9586c7cbc7 | ||
|
|
18570841d8 | ||
|
|
bafb9e4a8c | ||
|
|
4cb5dc695b | ||
|
|
4ca75e2aab | ||
|
|
56f623337b | ||
|
|
3f79edba67 | ||
|
|
2799f0c824 | ||
|
|
cbd6aabea2 | ||
|
|
5c737b21ae | ||
|
|
0f9485a806 | ||
|
|
bb544114ee | ||
|
|
c7813bbf45 | ||
|
|
e30293d07f | ||
|
|
b26d81fd7e | ||
|
|
d3e34f95c9 | ||
|
|
16faf064de | ||
|
|
be4afde507 | ||
|
|
2b8cee3e44 | ||
|
|
682fe47914 | ||
|
|
b1309578b4 | ||
|
|
ecaec7bbfa | ||
|
|
b4fced865d | ||
|
|
9b12b30100 | ||
|
|
9ac00667b4 | ||
|
|
452d5454cb | ||
|
|
4aff3d0631 | ||
|
|
2f151a7832 | ||
|
|
25cf54193a | ||
|
|
ae87cad7ef | ||
|
|
b6846d6b3d | ||
|
|
d62dd67942 | ||
|
|
2517b838b6 | ||
|
|
9fc8475586 | ||
|
|
023ad3c531 | ||
|
|
26f1cba808 | ||
|
|
76dda0c422 | ||
|
|
31ac0eb406 | ||
|
|
c5a9d5b0bc | ||
|
|
7dbe38358a | ||
|
|
accdc79c05 | ||
|
|
7056eb8536 | ||
|
|
88cde255f8 | ||
|
|
47b68ed96d | ||
|
|
d6b99a5a25 | ||
|
|
a2c7eb80fd | ||
|
|
6f1f85b729 | ||
|
|
2034e3f63b | ||
|
|
8b26e53067 | ||
|
|
40ee806c27 | ||
|
|
831505c425 | ||
|
|
b49f2448c7 | ||
|
|
513e11d263 | ||
|
|
01923ddbb2 | ||
|
|
313b00b8f3 | ||
|
|
5abcaebabc | ||
|
|
a685e85c10 | ||
|
|
9cbe9926b4 | ||
|
|
efea43d008 | ||
|
|
0bbbd33bb1 | ||
|
|
4da372d515 | ||
|
|
7d5a81d40f | ||
|
|
f8b0eb9648 | ||
|
|
df7c89baeb | ||
|
|
497aef7309 | ||
|
|
73a48eb3d4 | ||
|
|
63f583e148 | ||
|
|
54fa2bdc94 | ||
|
|
8c69380ef6 | ||
|
|
fa7a92b565 | ||
|
|
3d9b1af105 | ||
|
|
f58cd03f3b | ||
|
|
2e41302fc3 | ||
|
|
6ce56329dd | ||
|
|
368fb2c6e8 | ||
|
|
280741f8d1 | ||
|
|
d4d45001f6 | ||
|
|
f8d3c8e140 | ||
|
|
1ee0c50c8a | ||
|
|
2752541ff1 | ||
|
|
39951a792d | ||
|
|
2d68f1506c | ||
|
|
05c0b77a52 | ||
|
|
5bfd82a9bf | ||
|
|
4fbd7f2acd | ||
|
|
60c5d016a6 | ||
|
|
7eee6ba07a | ||
|
|
d8ee6acefa | ||
|
|
a4212abbb2 | ||
|
|
2f51785968 | ||
|
|
ca9ac8e950 | ||
|
|
80399f09df | ||
|
|
047f7ecf04 | ||
|
|
277ecca881 | ||
|
|
9cf7c71df8 | ||
|
|
55b300082a | ||
|
|
922e3824fb | ||
|
|
3b747f4d2d | ||
|
|
ce3988cfbb | ||
|
|
8f6f4de433 | ||
|
|
d37e04e8f3 | ||
|
|
a6223abdce | ||
|
|
e9baa2cfc4 | ||
|
|
3ba789eae6 | ||
|
|
02d5d21d0d | ||
|
|
be12573883 | ||
|
|
8cfb4e9384 | ||
|
|
d9698dcb06 | ||
|
|
708557afef | ||
|
|
9c5227850f | ||
|
|
49ee4bbd1c | ||
|
|
75947a6759 | ||
|
|
7d1b90c7d2 | ||
|
|
557e2c9029 | ||
|
|
3b208864bc | ||
|
|
32dea69f5e | ||
|
|
7d36b893d3 | ||
|
|
5ee1fd50fa | ||
|
|
681941b537 | ||
|
|
7c5ff5422d | ||
|
|
c9068526e7 | ||
|
|
9fd4807920 | ||
|
|
16bd9a5450 | ||
|
|
ada7e404b1 | ||
|
|
1c10bbf94c | ||
|
|
1da2db83da | ||
|
|
10c8371b38 | ||
|
|
5c5fc3f892 | ||
|
|
82cfa54584 | ||
|
|
69c6db0bc7 | ||
|
|
9b447ef3ed | ||
|
|
821a08ea79 | ||
|
|
a31453b55f | ||
|
|
5b43b9f151 | ||
|
|
bf6ecd7667 | ||
|
|
725687c987 | ||
|
|
fca3bed6dc | ||
|
|
fd0d6ff6f6 | ||
|
|
aa39a8a508 | ||
|
|
c472910aae | ||
|
|
7ff974be2c | ||
|
|
c414bd5923 | ||
|
|
57bd015972 | ||
|
|
abeb6490e0 | ||
|
|
85407a45f2 | ||
|
|
399e2587bb | ||
|
|
edfbb35c03 | ||
|
|
016436ae18 | ||
|
|
34323c0618 | ||
|
|
0ac94c93ff | ||
|
|
7525c57688 | ||
|
|
a4aaab5e32 | ||
|
|
e873949b31 | ||
|
|
adfc174af3 | ||
|
|
d44ba929ab | ||
|
|
20125ae96c | ||
|
|
0994362bfe | ||
|
|
45f2324a4e | ||
|
|
9c6e14b050 | ||
|
|
8b83371272 | ||
|
|
25ade66017 | ||
|
|
f3fb88905e | ||
|
|
e740e7577a | ||
|
|
d062904cc1 | ||
|
|
cd169ede0d | ||
|
|
bd655b325d | ||
|
|
7f32ba4216 | ||
|
|
109f16f717 | ||
|
|
b3127f86be | ||
|
|
e25d053ba6 | ||
|
|
3029a07c1a | ||
|
|
978b039ddc | ||
|
|
65066a0505 | ||
|
|
43bc3020a1 | ||
|
|
5f63575106 | ||
|
|
9c52e0d6d9 | ||
|
|
77dbf2fdb0 | ||
|
|
ad399246a3 | ||
|
|
23be1ac56d | ||
|
|
600d156d01 | ||
|
|
40227db7be | ||
|
|
54cdaddf3a | ||
|
|
5a62d403c0 | ||
|
|
eade74384a | ||
|
|
31c392b63c | ||
|
|
7cb85fa975 | ||
|
|
f8396d8f35 | ||
|
|
4d26ab751d | ||
|
|
f819ed137b | ||
|
|
91d31b57ec | ||
|
|
1fbefcab64 | ||
|
|
b2bcbcbc04 | ||
|
|
960b433a2c | ||
|
|
d777a6319b | ||
|
|
5910e4d207 | ||
|
|
340a446b51 | ||
|
|
124fccf127 | ||
|
|
74417a05d0 | ||
|
|
3ffd7683d5 | ||
|
|
457cbc9d9b | ||
|
|
7912c5d711 | ||
|
|
7d77d05a57 | ||
|
|
028caa4664 | ||
|
|
90403421af | ||
|
|
fe0ac80ba4 | ||
|
|
ba53b5e8aa | ||
|
|
abc3279752 | ||
|
|
84c689d456 | ||
|
|
693d1b24c6 | ||
|
|
cdaca7b0ff | ||
|
|
3ccfc2ea61 | ||
|
|
b351eaef29 | ||
|
|
14eb3fde14 | ||
|
|
f29e6ac397 | ||
|
|
79674363e6 | ||
|
|
0ce7402d61 | ||
|
|
00474dc038 | ||
|
|
8d054a404a | ||
|
|
143bf731b6 | ||
|
|
d4bbbcb690 | ||
|
|
f9f2f981f1 | ||
|
|
8b45011cd5 | ||
|
|
39c31e62a3 | ||
|
|
5b00231d7a | ||
|
|
3c52757f3f | ||
|
|
e6e9801a74 | ||
|
|
b5e2b9fe6f | ||
|
|
83e252bed9 | ||
|
|
b0b248d8e6 | ||
|
|
0364beb312 | ||
|
|
fc5aafe9fe | ||
|
|
968d8d6698 | ||
|
|
3c500e0b4b | ||
|
|
81bab31efb | ||
|
|
058f81c0fa | ||
|
|
6b851d812d | ||
|
|
ef4936de4a | ||
|
|
b6746d3432 | ||
|
|
3c05e09189 | ||
|
|
9b2dc88151 | ||
|
|
5e7afbb393 | ||
|
|
f6e6878909 | ||
|
|
e49c691a22 | ||
|
|
bd0f3556b6 | ||
|
|
82675d0bee | ||
|
|
895bfcea8e | ||
|
|
a6861f5f49 | ||
|
|
e32b3b5957 | ||
|
|
e3f13051f6 | ||
|
|
c8747d87a4 | ||
|
|
225e02244e | ||
|
|
ea616e7751 | ||
|
|
ba698258c0 | ||
|
|
1f50a2b3e6 | ||
|
|
9b64ea4969 | ||
|
|
52b30ead65 | ||
|
|
203cb12501 | ||
|
|
60e907fb48 | ||
|
|
71328530fe | ||
|
|
a5f5c06af3 | ||
|
|
f825a08bcf | ||
|
|
ccfacc5ee6 | ||
|
|
f2aaaa19e1 | ||
|
|
5ac94426e1 | ||
|
|
e3b21b9994 | ||
|
|
f34d024b22 | ||
|
|
f515b84322 | ||
|
|
d6e8ecea5e | ||
|
|
c691e7ca7a | ||
|
|
37221edbf0 | ||
|
|
ae14df9dca | ||
|
|
281873f22a | ||
|
|
8510169c69 | ||
|
|
e2c0d59332 | ||
|
|
99245b47f7 | ||
|
|
eee7b0126b | ||
|
|
404c1bda0a | ||
|
|
8fdc4cc9fc | ||
|
|
ad1dec58ec | ||
|
|
42b8340ea1 | ||
|
|
595009726f | ||
|
|
4025ddc364 | ||
|
|
5b8b470568 | ||
|
|
3c02bd15fb | ||
|
|
5fdac622ef | ||
|
|
25c1754052 | ||
|
|
a30f8859aa | ||
|
|
5435379e70 | ||
|
|
9eeacc585f | ||
|
|
20a347b0c9 | ||
|
|
6b851720d9 | ||
|
|
d12537b975 | ||
|
|
ee3ebbff76 | ||
|
|
411bc8ac61 | ||
|
|
bb4f887545 | ||
|
|
db04052b7a | ||
|
|
9daa556da1 | ||
|
|
c29fdaf714 | ||
|
|
2d79baf54d | ||
|
|
8e9e0ae848 |
36
.circleci/config.yml
Normal file
36
.circleci/config.yml
Normal file
@@ -0,0 +1,36 @@
|
||||
version: 2
|
||||
jobs:
|
||||
build:
|
||||
docker:
|
||||
- image: circleci/node:10-browsers
|
||||
|
||||
working_directory: ~/repo
|
||||
|
||||
steps:
|
||||
- checkout
|
||||
|
||||
- restore_cache:
|
||||
keys:
|
||||
- v1-dependencies-{{ checksum "package.json" }}
|
||||
- v1-dependencies-
|
||||
|
||||
- run:
|
||||
name: Install Dependencies
|
||||
command: npm install
|
||||
|
||||
- save_cache:
|
||||
paths:
|
||||
- node_modules
|
||||
key: v1-dependencies-{{ checksum "package.json" }}
|
||||
|
||||
- run:
|
||||
name: Run Tests
|
||||
command: npm test
|
||||
|
||||
- run:
|
||||
name: Build Examples
|
||||
command: npm run build-examples
|
||||
|
||||
- store_artifacts:
|
||||
path: build/examples
|
||||
destination: examples
|
||||
17
.travis.yml
17
.travis.yml
@@ -1,17 +0,0 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- '8'
|
||||
cache:
|
||||
directories:
|
||||
- node_modules
|
||||
after_success:
|
||||
- cat coverage/lcov.info | coveralls
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
addons:
|
||||
hosts:
|
||||
- travis.dev
|
||||
jwt:
|
||||
# This is the encrypted SAUCE_ACCESS_KEY
|
||||
secure: bb2Ibzu9RLe6ZlIG7JVcuH7IoLMxa/i3LTM7t8mbsPjVOGs5ycyJ7M9MbvqB/F2EzbeV4XB2c9ufI4TkaLYceY5kdWjfZVN8iasr+GFqKMv1uR4i6bpu8KmHJ+blxwfY1QOQ/cGwEx+fbeycMtpTc3Y3GyXaPlCQLhbZvesMg88=
|
||||
@@ -2,6 +2,18 @@
|
||||
|
||||
### Next version
|
||||
|
||||
### v5.3.0
|
||||
|
||||
#### The `getUid` function returns string
|
||||
|
||||
The `getUid` function from the `ol/util` module now returns a string instead of a number.
|
||||
|
||||
#### Attributions are not collapsible for `ol/source/OSM`
|
||||
|
||||
When a map contains a layer from a `ol/source/OSM` source, the `ol/control/Attribution` control will be shown with the `collapsible: false` behavior.
|
||||
|
||||
To get the previous behavior, configure the `ol/control/Attribution` control with `collapsible: true`.
|
||||
|
||||
### v5.2.0
|
||||
|
||||
#### Removal of the `snapToPixel` option for `ol/style/Image` subclasses
|
||||
@@ -16,7 +28,7 @@ When rendering with the Immediate API, symbols will no longer be snapped to inte
|
||||
|
||||
#### Geometry constructor and `setCoordinates` no longer accept `null` coordinates
|
||||
|
||||
Geometries (`ol/geom/*`) now need to be constructed with valid coordinates (center for `ol/geom/Circle`) as first constructor argument. The same applies to the `setCoordinates()` (`setCenter() for `ol/geom/Circle`) method.
|
||||
Geometries (`ol/geom/*`) now need to be constructed with valid coordinates (center for `ol/geom/Circle`) as first constructor argument. The same applies to the `setCoordinates()` (`setCenter()` for `ol/geom/Circle`) method.
|
||||
|
||||
### v5.0.0
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# v5.1.0
|
||||
# v5.2.0
|
||||
|
||||
The 5.2 release adds a few new features a handful of fixes, including regressions that were reported after the 5.1 release. You should be able to upgrade without any additional work. See the one note below regarding `snapToPixel` on `ol/style/Image` and subclasses.
|
||||
|
||||
|
||||
217
changelog/v5.3.0.md
Normal file
217
changelog/v5.3.0.md
Normal file
@@ -0,0 +1,217 @@
|
||||
# v5.3.0
|
||||
|
||||
We're continuing to work toward more complete type checking with TypeScript – based on JSDoc annotations in the source. The 5.3 release includes a number of bug fixes related to the type checking effort. In addition the release comes with a handful of new features and improved API reference docs.
|
||||
|
||||
### Upgrade Notes
|
||||
|
||||
#### The `getUid` function returns string
|
||||
|
||||
The `getUid` function from the `ol/util` module now returns a string instead of a number.
|
||||
|
||||
#### Attributions are not collapsible for `ol/source/OSM`
|
||||
|
||||
When a map contains a layer from a `ol/source/OSM` source, the `ol/control/Attribution` control will be shown with the `collapsible: false` behavior.
|
||||
|
||||
To get the previous behavior, configure the `ol/control/Attribution` control with `collapsible: true`.
|
||||
|
||||
### New Features and Fixes
|
||||
|
||||
* [#8642](https://github.com/openlayers/openlayers/pull/8642) - Fixes for optional key passing, issue #8067 for tile sources ([@dimin](https://github.com/dimin))
|
||||
* [#8885](https://github.com/openlayers/openlayers/pull/8885) - Move GeolocationProperty into Geolocation ([@fredj](https://github.com/fredj))
|
||||
* [#8881](https://github.com/openlayers/openlayers/pull/8881) - Remove custom styles in drag-and-drop examples ([@fredj](https://github.com/fredj))
|
||||
* [#8877](https://github.com/openlayers/openlayers/pull/8877) - Create context in vector tile layer constructor ([@tschaub](https://github.com/tschaub))
|
||||
* [#8883](https://github.com/openlayers/openlayers/pull/8883) - New test runner ([@tschaub](https://github.com/tschaub))
|
||||
* [#8882](https://github.com/openlayers/openlayers/pull/8882) - Import simplification ([@fredj](https://github.com/fredj))
|
||||
* [#8858](https://github.com/openlayers/openlayers/pull/8858) - Add condition for viewParams and TypeScript related option ([@webgeodatavore](https://github.com/webgeodatavore))
|
||||
* [#8879](https://github.com/openlayers/openlayers/pull/8879) - Build with CircleCI ([@openlayers](https://github.com/openlayers))
|
||||
* [#8878](https://github.com/openlayers/openlayers/pull/8878) - Avoid logging 404 warnings ([@tschaub](https://github.com/tschaub))
|
||||
* [#8876](https://github.com/openlayers/openlayers/pull/8876) - Remove RenderType enum from vector tile layer ([@tschaub](https://github.com/tschaub))
|
||||
* [#8874](https://github.com/openlayers/openlayers/pull/8874) - Remove unnecessary type casts in canvas layer renderer ([@tschaub](https://github.com/tschaub))
|
||||
* [#8869](https://github.com/openlayers/openlayers/pull/8869) - Fix more types for TypeScript ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8868](https://github.com/openlayers/openlayers/pull/8868) - Throw when calling abstract methods; fix abstract return types ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8862](https://github.com/openlayers/openlayers/pull/8862) - Legacy build and apidoc improvements ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8867](https://github.com/openlayers/openlayers/pull/8867) - Fix example builder ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8852](https://github.com/openlayers/openlayers/pull/8852) - Improve link handling in API docs ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8853](https://github.com/openlayers/openlayers/pull/8853) - Make rendercomplete work with vector sources without loader ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8851](https://github.com/openlayers/openlayers/pull/8851) - Use typescript types for RBush ([@fredj](https://github.com/fredj))
|
||||
* [#8850](https://github.com/openlayers/openlayers/pull/8850) - Remove old TODO in ol/Graticule ([@fredj](https://github.com/fredj))
|
||||
* [#8847](https://github.com/openlayers/openlayers/pull/8847) - Fix API docs ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8845](https://github.com/openlayers/openlayers/pull/8845) - Remove RenderType enum from vector layer ([@tschaub](https://github.com/tschaub))
|
||||
* [#8843](https://github.com/openlayers/openlayers/pull/8843) - Fix ts typing for fullscreen button ([@tonio](https://github.com/tonio))
|
||||
* [#8841](https://github.com/openlayers/openlayers/pull/8841) - Use super.method instead of prototype.method.call ([@fredj](https://github.com/fredj))
|
||||
* [#8842](https://github.com/openlayers/openlayers/pull/8842) - Change target type from Element to HTMLElement ([@fredj](https://github.com/fredj))
|
||||
* [#8840](https://github.com/openlayers/openlayers/pull/8840) - Remove unneeded code in VectorTile renderer ([@elemoine](https://github.com/elemoine))
|
||||
* [#8844](https://github.com/openlayers/openlayers/pull/8844) - Set crossOrigin to anonymous in mapbox-streets-v6-style ([@elemoine](https://github.com/elemoine))
|
||||
* [#8776](https://github.com/openlayers/openlayers/pull/8776) - Use setTimeout without the window namespace ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8837](https://github.com/openlayers/openlayers/pull/8837) - Re-export MousePosition from ol/control ([@fredj](https://github.com/fredj))
|
||||
* [#8832](https://github.com/openlayers/openlayers/pull/8832) - Remove source foreachfeatureatcoordinate from ol/renderer/webgl/ImageLayer ([@fredj](https://github.com/fredj))
|
||||
* [#8833](https://github.com/openlayers/openlayers/pull/8833) - Fix wrong filename in type annotation ([@fredj](https://github.com/fredj))
|
||||
* [#8827](https://github.com/openlayers/openlayers/pull/8827) - Removed unused forEachFeatureAtCoordinate from ol/source/Source ([@schmidtk](https://github.com/schmidtk))
|
||||
* [#8830](https://github.com/openlayers/openlayers/pull/8830) - Type annotation fixes in ol/control/ ([@fredj](https://github.com/fredj))
|
||||
* [#8829](https://github.com/openlayers/openlayers/pull/8829) - Change getUid return type from number to string ([@fredj](https://github.com/fredj))
|
||||
* [#8825](https://github.com/openlayers/openlayers/pull/8825) - Fix TypeScript errors ([@schmidtk](https://github.com/schmidtk))
|
||||
* [#8828](https://github.com/openlayers/openlayers/pull/8828) - Re-export VectorTile from ol/source ([@elemoine](https://github.com/elemoine))
|
||||
* [#8806](https://github.com/openlayers/openlayers/pull/8806) - Preserve button class name list in full screen control on toggle ([@notnotse](https://github.com/notnotse))
|
||||
* [#8817](https://github.com/openlayers/openlayers/pull/8817) - Clarify format option for ol/source/WMTS ([@romanzoller](https://github.com/romanzoller))
|
||||
* [#8824](https://github.com/openlayers/openlayers/pull/8824) - Fix TypeScript errors in ol/format/GML ([@schmidtk](https://github.com/schmidtk))
|
||||
* [#8820](https://github.com/openlayers/openlayers/pull/8820) - Polygon intersectsExtent failure - Issue #8795 ([@hmdavidjunior](https://github.com/hmdavidjunior))
|
||||
* [#8519](https://github.com/openlayers/openlayers/pull/8519) - GML Format Improvements #8516 #8517 #8518 ([@NielsCharlier](https://github.com/NielsCharlier))
|
||||
* [#8711](https://github.com/openlayers/openlayers/pull/8711) - Fix TypeScript errors in ol/format/GML ([@schmidtk](https://github.com/schmidtk))
|
||||
* [#8818](https://github.com/openlayers/openlayers/pull/8818) - Fix the way zoom comes from ([@cs09g](https://github.com/cs09g))
|
||||
* [#8804](https://github.com/openlayers/openlayers/pull/8804) - Add possibility to disable collapsible attributions from Source ([@notnotse](https://github.com/notnotse))
|
||||
* [#8787](https://github.com/openlayers/openlayers/pull/8787) - Replace instanceof checks with other logic ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8808](https://github.com/openlayers/openlayers/pull/8808) - Fix format and version properties in ol/source/WMTS Options typedef ([@fredj](https://github.com/fredj))
|
||||
* [#8812](https://github.com/openlayers/openlayers/pull/8812) - Update snap.js ([@rosedo](https://github.com/rosedo))
|
||||
* [#8809](https://github.com/openlayers/openlayers/pull/8809) - Configurable interval options ([@notnotse](https://github.com/notnotse))
|
||||
* [#8798](https://github.com/openlayers/openlayers/pull/8798) - Use unpkg.com instead of rawgit.com ([@fredj](https://github.com/fredj))
|
||||
* [#8805](https://github.com/openlayers/openlayers/pull/8805) - Do not draw image with width or height < 0.5 ([@notnotse](https://github.com/notnotse))
|
||||
* [#8803](https://github.com/openlayers/openlayers/pull/8803) - Handle zoom slider position with floating point numbers ([@notnotse](https://github.com/notnotse))
|
||||
* [#8789](https://github.com/openlayers/openlayers/pull/8789) - Spelling and indentation fixes ([@fredj](https://github.com/fredj))
|
||||
* [#8782](https://github.com/openlayers/openlayers/pull/8782) - Fix getSimplifiedGeometry definition ([@wallw-bits](https://github.com/wallw-bits))
|
||||
* [#8783](https://github.com/openlayers/openlayers/pull/8783) - Fix missing method declaration ([@wallw-bits](https://github.com/wallw-bits))
|
||||
* [#8781](https://github.com/openlayers/openlayers/pull/8781) - Fix type check errors ([@schmidtk](https://github.com/schmidtk))
|
||||
* [#8779](https://github.com/openlayers/openlayers/pull/8779) - Fix additional type check errors ([@schmidtk](https://github.com/schmidtk))
|
||||
* [#8753](https://github.com/openlayers/openlayers/pull/8753) - Fix type check in ol/PluggableMap.js ([@wallw-bits](https://github.com/wallw-bits))
|
||||
* [#8762](https://github.com/openlayers/openlayers/pull/8762) - Fix type errors from interaction event handlers ([@schmidtk](https://github.com/schmidtk))
|
||||
* [#8763](https://github.com/openlayers/openlayers/pull/8763) - Fix type check for ol/events ([@wallw-bits](https://github.com/wallw-bits))
|
||||
* [#8774](https://github.com/openlayers/openlayers/pull/8774) - Fix type check errors in ol/renderer/webgl ([@schmidtk](https://github.com/schmidtk))
|
||||
* [#8768](https://github.com/openlayers/openlayers/pull/8768) - Fix type check errors in ol/interaction/Select ([@schmidtk](https://github.com/schmidtk))
|
||||
* [#8764](https://github.com/openlayers/openlayers/pull/8764) - Fix TypeScript errors in ol/interaction/Draw ([@schmidtk](https://github.com/schmidtk))
|
||||
* [#8767](https://github.com/openlayers/openlayers/pull/8767) - Fix type check errors in ol/interaction/Modify ([@schmidtk](https://github.com/schmidtk))
|
||||
* [#8773](https://github.com/openlayers/openlayers/pull/8773) - Fix type check errors in ol/renderer/canvas ([@schmidtk](https://github.com/schmidtk))
|
||||
* [#8769](https://github.com/openlayers/openlayers/pull/8769) - Fix type check errors in ol/render/canvas ([@schmidtk](https://github.com/schmidtk))
|
||||
* [#8770](https://github.com/openlayers/openlayers/pull/8770) - Fix type check errors in ol/render/webgl ([@schmidtk](https://github.com/schmidtk))
|
||||
* [#8765](https://github.com/openlayers/openlayers/pull/8765) - Simplify logic for fixed tile url functions ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8766](https://github.com/openlayers/openlayers/pull/8766) - Use FeatureLike typedef ([@fredj](https://github.com/fredj))
|
||||
* [#8739](https://github.com/openlayers/openlayers/pull/8739) - Fix TypeScript errors in ol/format/WMSGetFeatureInfo ([@schmidtk](https://github.com/schmidtk))
|
||||
* [#8666](https://github.com/openlayers/openlayers/pull/8666) - Fix condition TypeScript errors ([@schmidtk](https://github.com/schmidtk))
|
||||
* [#8757](https://github.com/openlayers/openlayers/pull/8757) - Use typeof to simplify JSDoc class types ([@schmidtk](https://github.com/schmidtk))
|
||||
* [#8759](https://github.com/openlayers/openlayers/pull/8759) - Use es6 class inheritance in examples ([@fredj](https://github.com/fredj))
|
||||
* [#8761](https://github.com/openlayers/openlayers/pull/8761) - Allow returning RenderFeature in ol/format/Feature ([@schmidtk](https://github.com/schmidtk))
|
||||
* [#8758](https://github.com/openlayers/openlayers/pull/8758) - Fix TS error and prevent extra string conversion ([@schmidtk](https://github.com/schmidtk))
|
||||
* [#8736](https://github.com/openlayers/openlayers/pull/8736) - Typescript misc fixes ([@fredj](https://github.com/fredj))
|
||||
* [#8741](https://github.com/openlayers/openlayers/pull/8741) - Fix TypeScript errors in ol/geom/* ([@schmidtk](https://github.com/schmidtk))
|
||||
* [#8707](https://github.com/openlayers/openlayers/pull/8707) - Fix TypeScript errors in ol/format/Feature ([@schmidtk](https://github.com/schmidtk))
|
||||
* [#8754](https://github.com/openlayers/openlayers/pull/8754) - Fix type check in ol/math ([@wallw-bits](https://github.com/wallw-bits))
|
||||
* [#8747](https://github.com/openlayers/openlayers/pull/8747) - Update doc/faq.md ([@fredj](https://github.com/fredj))
|
||||
* [#8744](https://github.com/openlayers/openlayers/pull/8744) - Fix type checks in VectorTileSource ([@wallw-bits](https://github.com/wallw-bits))
|
||||
* [#8740](https://github.com/openlayers/openlayers/pull/8740) - Increase linestring textalign test tolerance to be Firefox compliant. ([@benVigie](https://github.com/benVigie))
|
||||
* [#8738](https://github.com/openlayers/openlayers/pull/8738) - Cast to parent type to fix TS errors ([@schmidtk](https://github.com/schmidtk))
|
||||
* [#8737](https://github.com/openlayers/openlayers/pull/8737) - Flag optional param to fix TS error ([@schmidtk](https://github.com/schmidtk))
|
||||
* [#8742](https://github.com/openlayers/openlayers/pull/8742) - Fix type checks in Vector source ([@wallw-bits](https://github.com/wallw-bits))
|
||||
* [#8743](https://github.com/openlayers/openlayers/pull/8743) - Fix type check in Raster source ([@wallw-bits](https://github.com/wallw-bits))
|
||||
* [#8733](https://github.com/openlayers/openlayers/pull/8733) - Fix TypeScript errors in ol/format/WFS ([@schmidtk](https://github.com/schmidtk))
|
||||
* [#8735](https://github.com/openlayers/openlayers/pull/8735) - Fix TypeScript errors in ol/format/WKT ([@schmidtk](https://github.com/schmidtk))
|
||||
* [#8730](https://github.com/openlayers/openlayers/pull/8730) - Fix TypeScript errors in ol/format/KML ([@schmidtk](https://github.com/schmidtk))
|
||||
* [#8732](https://github.com/openlayers/openlayers/pull/8732) - Fix type check in ol/source/Tile ([@wallw-bits](https://github.com/wallw-bits))
|
||||
* [#8731](https://github.com/openlayers/openlayers/pull/8731) - Dispatch a GeolocationError in Geolocation ([@fredj](https://github.com/fredj))
|
||||
* [#8729](https://github.com/openlayers/openlayers/pull/8729) - Move functions out of the PointerEvent class ([@fredj](https://github.com/fredj))
|
||||
* [#8724](https://github.com/openlayers/openlayers/pull/8724) - Typescript misc fixes ([@fredj](https://github.com/fredj))
|
||||
* [#8717](https://github.com/openlayers/openlayers/pull/8717) - Fix type checks in TileArcGISRest ([@fredj](https://github.com/fredj))
|
||||
* [#8718](https://github.com/openlayers/openlayers/pull/8718) - Fix TypeScript errors in ol/format/GPX ([@schmidtk](https://github.com/schmidtk))
|
||||
* [#8706](https://github.com/openlayers/openlayers/pull/8706) - Use EsriJSON types from @types/arcgis-rest-api ([@schmidtk](https://github.com/schmidtk))
|
||||
* [#8709](https://github.com/openlayers/openlayers/pull/8709) - Fix TypeScript errors in ol/format/GeoJSON ([@schmidtk](https://github.com/schmidtk))
|
||||
* [#8708](https://github.com/openlayers/openlayers/pull/8708) - Fix type checks in ImageCanvas source ([@wallw-bits](https://github.com/wallw-bits))
|
||||
* [#8710](https://github.com/openlayers/openlayers/pull/8710) - Fix type checks in ImageArcGISRest ([@wallw-bits](https://github.com/wallw-bits))
|
||||
* [#8698](https://github.com/openlayers/openlayers/pull/8698) - Fix zoom slider events ([@intouch-smartwater](https://github.com/intouch-smartwater))
|
||||
* [#8697](https://github.com/openlayers/openlayers/pull/8697) - Remove unused properties from Cluster and Image options ([@fredj](https://github.com/fredj))
|
||||
* [#8688](https://github.com/openlayers/openlayers/pull/8688) - Fix PointerEventHandler event type ([@fredj](https://github.com/fredj))
|
||||
* [#8686](https://github.com/openlayers/openlayers/pull/8686) - Remove extra imports in jsdoc ([@fredj](https://github.com/fredj))
|
||||
* [#8681](https://github.com/openlayers/openlayers/pull/8681) - Check the type of the source before using it ([@wallw-bits](https://github.com/wallw-bits))
|
||||
* [#8691](https://github.com/openlayers/openlayers/pull/8691) - Fix assertion error documentation URL ([@romanzoller](https://github.com/romanzoller))
|
||||
* [#8692](https://github.com/openlayers/openlayers/pull/8692) - Type check fixes for Cluster source ([@wallw-bits](https://github.com/wallw-bits))
|
||||
* [#8677](https://github.com/openlayers/openlayers/pull/8677) - Type check fixes for VectorSource ([@wallw-bits](https://github.com/wallw-bits))
|
||||
* [#8684](https://github.com/openlayers/openlayers/pull/8684) - Define BingMapsImageryMetadataResponse type ([@wallw-bits](https://github.com/wallw-bits))
|
||||
* [#8690](https://github.com/openlayers/openlayers/pull/8690) - Fix type checks in CartoDB ([@wallw-bits](https://github.com/wallw-bits))
|
||||
* [#8693](https://github.com/openlayers/openlayers/pull/8693) - Fix type check errors for Image source ([@wallw-bits](https://github.com/wallw-bits))
|
||||
* [#8672](https://github.com/openlayers/openlayers/pull/8672) - Fix source type in Raster source ([@fredj](https://github.com/fredj))
|
||||
* [#8665](https://github.com/openlayers/openlayers/pull/8665) - Fix type check errors in RBush ([@wallw-bits](https://github.com/wallw-bits))
|
||||
* [#8680](https://github.com/openlayers/openlayers/pull/8680) - TypeScript fixes for ol/events ([@schmidtk](https://github.com/schmidtk))
|
||||
* [#8678](https://github.com/openlayers/openlayers/pull/8678) - Ensure image is Image or Video before settings src ([@wallw-bits](https://github.com/wallw-bits))
|
||||
* [#8676](https://github.com/openlayers/openlayers/pull/8676) - Cast tileGrid to WMTSTileGrid for type check ([@wallw-bits](https://github.com/wallw-bits))
|
||||
* [#8679](https://github.com/openlayers/openlayers/pull/8679) - Type check fixes in Triangulation ([@wallw-bits](https://github.com/wallw-bits))
|
||||
* [#8657](https://github.com/openlayers/openlayers/pull/8657) - Typescript fixes ([@fgravin](https://github.com/fgravin))
|
||||
* [#8671](https://github.com/openlayers/openlayers/pull/8671) - Fix typescript in FeatureLoader ([@fgravin](https://github.com/fgravin))
|
||||
* [#8675](https://github.com/openlayers/openlayers/pull/8675) - Get width as number from number|Size ([@wallw-bits](https://github.com/wallw-bits))
|
||||
* [#8654](https://github.com/openlayers/openlayers/pull/8654) - Remove extra imports in jsdoc ([@fredj](https://github.com/fredj))
|
||||
* [#8655](https://github.com/openlayers/openlayers/pull/8655) - Remove webkit specific properties from Touch ([@fredj](https://github.com/fredj))
|
||||
* [#8663](https://github.com/openlayers/openlayers/pull/8663) - Add vendor-specific TS declarations for the Fullscreen API. ([@schmidtk](https://github.com/schmidtk))
|
||||
* [#8658](https://github.com/openlayers/openlayers/pull/8658) - Don't define functions in the prototype ([@fredj](https://github.com/fredj))
|
||||
* [#8662](https://github.com/openlayers/openlayers/pull/8662) - Explicitly define type of 'this' ([@wallw-bits](https://github.com/wallw-bits))
|
||||
* [#8664](https://github.com/openlayers/openlayers/pull/8664) - Add native Event to ListenerFunction signature. ([@schmidtk](https://github.com/schmidtk))
|
||||
* [#8668](https://github.com/openlayers/openlayers/pull/8668) - Add missing 'module' annotation ([@fredj](https://github.com/fredj))
|
||||
* [#8643](https://github.com/openlayers/openlayers/pull/8643) - Fix style TypeScript errors ([@schmidtk](https://github.com/schmidtk))
|
||||
* [#8638](https://github.com/openlayers/openlayers/pull/8638) - Fix event type in hasListener check ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8618](https://github.com/openlayers/openlayers/pull/8618) - Use TopoJSON types from @types/topojson ([@fredj](https://github.com/fredj))
|
||||
* [#8619](https://github.com/openlayers/openlayers/pull/8619) - Remove wrong Geometry type in KML format ([@fredj](https://github.com/fredj))
|
||||
* [#8627](https://github.com/openlayers/openlayers/pull/8627) - Fix several type imports ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8629](https://github.com/openlayers/openlayers/pull/8629) - Enable circle primitive in draw-shapes example ([@megawac](https://github.com/megawac))
|
||||
* [#8626](https://github.com/openlayers/openlayers/pull/8626) - Better type annotations / type casts ([@marcjansen](https://github.com/marcjansen))
|
||||
* [#8622](https://github.com/openlayers/openlayers/pull/8622) - Remove unused method ([@tschaub](https://github.com/tschaub))
|
||||
* [#8615](https://github.com/openlayers/openlayers/pull/8615) - Use GeoJSON types from @types/geojson ([@tschaub](https://github.com/tschaub))
|
||||
* [#8609](https://github.com/openlayers/openlayers/pull/8609) - Remove extra imports in jsdoc ([@fredj](https://github.com/fredj))
|
||||
* [#8613](https://github.com/openlayers/openlayers/pull/8613) - Lazily detect tainted canvas ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8610](https://github.com/openlayers/openlayers/pull/8610) - Sensible touch behavior of the MousePosition control ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8602](https://github.com/openlayers/openlayers/pull/8602) - Add missing map property in ol/layer/Layer constructor options ([@fredj](https://github.com/fredj))
|
||||
* [#8607](https://github.com/openlayers/openlayers/pull/8607) - Listener return is boolean or void ([@tschaub](https://github.com/tschaub))
|
||||
* [#8595](https://github.com/openlayers/openlayers/pull/8595) - Optional arguments and typedef properties ([@tschaub](https://github.com/tschaub))
|
||||
* [#8594](https://github.com/openlayers/openlayers/pull/8594) - Remove extra imports in jsdoc ([@fredj](https://github.com/fredj))
|
||||
* [#8596](https://github.com/openlayers/openlayers/pull/8596) - Add types for the UTFGrid and TileJSON JSON responses ([@tschaub](https://github.com/tschaub))
|
||||
* [#8591](https://github.com/openlayers/openlayers/pull/8591) - Add missing properties in TextState typedef ([@fredj](https://github.com/fredj))
|
||||
* [#8590](https://github.com/openlayers/openlayers/pull/8590) - Don't import ourselves ([@fredj](https://github.com/fredj))
|
||||
* [#8586](https://github.com/openlayers/openlayers/pull/8586) - Cast 'originalEvent' in interactions ([@fredj](https://github.com/fredj))
|
||||
* [#8588](https://github.com/openlayers/openlayers/pull/8588) - Rework createXYZ ([@tschaub](https://github.com/tschaub))
|
||||
* [#8587](https://github.com/openlayers/openlayers/pull/8587) - Add a statement to trigger TypeScript checking ([@tschaub](https://github.com/tschaub))
|
||||
* [#8345](https://github.com/openlayers/openlayers/pull/8345) - TypeScript (1/n) ([@tschaub](https://github.com/tschaub))
|
||||
* [#8579](https://github.com/openlayers/openlayers/pull/8579) - Better type annotation ([@marcjansen](https://github.com/marcjansen))
|
||||
* [#8580](https://github.com/openlayers/openlayers/pull/8580) - Cast POINTER_ID before comparison ([@marcjansen](https://github.com/marcjansen))
|
||||
* [#8574](https://github.com/openlayers/openlayers/pull/8574) - Rename Extent to ExtentInteraction ([@fredj](https://github.com/fredj))
|
||||
* [#8577](https://github.com/openlayers/openlayers/pull/8577) - Remove geojson.js extern inclusion in tasks/generate-info ([@fredj](https://github.com/fredj))
|
||||
* [#8573](https://github.com/openlayers/openlayers/pull/8573) - Fix freehand polygon drawing ([@fredj](https://github.com/fredj))
|
||||
* [#8572](https://github.com/openlayers/openlayers/pull/8572) - typescript misc fixes ([@fredj](https://github.com/fredj))
|
||||
* [#8569](https://github.com/openlayers/openlayers/pull/8569) - Make proj~get simpler and faster ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8567](https://github.com/openlayers/openlayers/pull/8567) - Use 'Element' type instead of 'Node' ([@fredj](https://github.com/fredj))
|
||||
* [#8558](https://github.com/openlayers/openlayers/pull/8558) - Fix default zIndex value and documentation for layer options ([@fredj](https://github.com/fredj))
|
||||
* [#8555](https://github.com/openlayers/openlayers/pull/8555) - Do not minify examples that inject code into workers ([@ahocevar](https://github.com/ahocevar))
|
||||
* [#8557](https://github.com/openlayers/openlayers/pull/8557) - Fix typo in release notes ([@ahocevar](https://github.com/ahocevar))
|
||||
|
||||
|
||||
<details>
|
||||
<summary>Dependency Updates</summary>
|
||||
|
||||
* [#8884](https://github.com/openlayers/openlayers/pull/8884) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8880](https://github.com/openlayers/openlayers/pull/8880) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8872](https://github.com/openlayers/openlayers/pull/8872) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8860](https://github.com/openlayers/openlayers/pull/8860) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8855](https://github.com/openlayers/openlayers/pull/8855) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8838](https://github.com/openlayers/openlayers/pull/8838) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8834](https://github.com/openlayers/openlayers/pull/8834) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8799](https://github.com/openlayers/openlayers/pull/8799) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8796](https://github.com/openlayers/openlayers/pull/8796) - Update rollup-plugin-commonjs to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8793](https://github.com/openlayers/openlayers/pull/8793) - Update rollup-plugin-buble to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8794](https://github.com/openlayers/openlayers/pull/8794) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8788](https://github.com/openlayers/openlayers/pull/8788) - Update front-matter to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8785](https://github.com/openlayers/openlayers/pull/8785) - chore(package): update rollup to version 0.66.4 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8719](https://github.com/openlayers/openlayers/pull/8719) - Update marked to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8714](https://github.com/openlayers/openlayers/pull/8714) - chore(package): update webpack to version 4.20.2 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8703](https://github.com/openlayers/openlayers/pull/8703) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8646](https://github.com/openlayers/openlayers/pull/8646) - Update mustache to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8645](https://github.com/openlayers/openlayers/pull/8645) - Update rollup-plugin-uglify to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8685](https://github.com/openlayers/openlayers/pull/8685) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8683](https://github.com/openlayers/openlayers/pull/8683) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8656](https://github.com/openlayers/openlayers/pull/8656) - chore(package): update rollup-plugin-commonjs to version 9.1.8 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8667](https://github.com/openlayers/openlayers/pull/8667) - chore(package): update uglifyjs-webpack-plugin to version 2.0.1 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8661](https://github.com/openlayers/openlayers/pull/8661) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8644](https://github.com/openlayers/openlayers/pull/8644) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8631](https://github.com/openlayers/openlayers/pull/8631) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8630](https://github.com/openlayers/openlayers/pull/8630) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8617](https://github.com/openlayers/openlayers/pull/8617) - chore(package): update webpack to version 4.18.0 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8589](https://github.com/openlayers/openlayers/pull/8589) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8581](https://github.com/openlayers/openlayers/pull/8581) - Update rollup-plugin-node-resolve to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8585](https://github.com/openlayers/openlayers/pull/8585) - Update rollup to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8578](https://github.com/openlayers/openlayers/pull/8578) - Update webpack to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8563](https://github.com/openlayers/openlayers/pull/8563) - Update rollup-plugin-uglify to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
* [#8561](https://github.com/openlayers/openlayers/pull/8561) - Update rollup-plugin-uglify to the latest version 🚀 ([@openlayers](https://github.com/openlayers))
|
||||
|
||||
|
||||
</details>
|
||||
6
changelog/v5.3.1.md
Normal file
6
changelog/v5.3.1.md
Normal file
@@ -0,0 +1,6 @@
|
||||
# 5.3.1
|
||||
|
||||
The 5.3.1 release is a patch that addresses an issue when using `angular-cli` to build an OpenLayers-based application.
|
||||
|
||||
* [#9253](https://github.com/openlayers/openlayers/pull/9253) - Add proj.js to the sideEffects list ([@romanzoller](https://github.com/romanzoller))
|
||||
|
||||
6
changelog/v5.3.2.md
Normal file
6
changelog/v5.3.2.md
Normal file
@@ -0,0 +1,6 @@
|
||||
# 5.3.2
|
||||
|
||||
The 5.3.2 release is a patch that addresses a tile source issue with old tile data when the source revision changed.
|
||||
|
||||
* [#9422](https://github.com/openlayers/openlayers/pull/9422) - Clear context when source revision changed (v5.3.x fix) ([@elemoine](https://github.com/elemoine))
|
||||
|
||||
7
changelog/v5.3.3.md
Normal file
7
changelog/v5.3.3.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# 5.3.2
|
||||
|
||||
The 5.3.3 release is a patch that addresses a scope issue with event listeners in minified builds.
|
||||
|
||||
* [#9603](https://github.com/openlayers/openlayers/pull/9603) - Use global scope for addEventListener ([@bartvde](https://github.com/bartvde))
|
||||
|
||||
|
||||
@@ -7,22 +7,23 @@
|
||||
"allowUnknownTags": true
|
||||
},
|
||||
"source": {
|
||||
"includePattern": ".+\\.js(doc)?$",
|
||||
"includePattern": ".+\\.js$",
|
||||
"excludePattern": "(^|\\/|\\\\)_",
|
||||
"include": [
|
||||
"src/ol"
|
||||
]
|
||||
},
|
||||
"plugins": [
|
||||
"plugins/markdown",
|
||||
"config/jsdoc/api/plugins/normalize-exports",
|
||||
"config/jsdoc/api/plugins/markdown",
|
||||
"jsdoc-plugin-typescript",
|
||||
"config/jsdoc/api/plugins/inline-options",
|
||||
"config/jsdoc/api/plugins/inheritdoc",
|
||||
"config/jsdoc/api/plugins/events",
|
||||
"config/jsdoc/api/plugins/observable",
|
||||
"config/jsdoc/api/plugins/api"
|
||||
],
|
||||
"markdown": {
|
||||
"parser": "gfm"
|
||||
"typescript": {
|
||||
"moduleRoot": "src"
|
||||
},
|
||||
"templates": {
|
||||
"cleverLinks": true,
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
<td><p>The view manages the visual parameters of the map view, like resolution or rotation.</p>
|
||||
[View](module-ol_View-View.html) with center, projection, resolution and rotation</td>
|
||||
<td><p>Layers are lightweight containers that get their data from [sources](module-ol_source_Source-Source.html).</p>
|
||||
[layer/Tile](module-ol_layer_Tile-TileLayer.html)<br>
|
||||
[layer/Image](module-ol_layer_Image-ImageLayer.html)<br>
|
||||
[layer/Vector](module-ol_layer_Vector-VectorLayer.html)<br>
|
||||
[layer/VectorTile](module-ol_layer_VectorTile-VectorTileLayer.html)</td>
|
||||
[ol/layer/Tile](module-ol_layer_Tile-TileLayer.html)<br>
|
||||
[ol/layer/Image](module-ol_layer_Image-ImageLayer.html)<br>
|
||||
[ol/layer/Vector](module-ol_layer_Vector-VectorLayer.html)<br>
|
||||
[ol/layer/VectorTile](module-ol_layer_VectorTile-VectorTileLayer.html)</td>
|
||||
</tr><tr>
|
||||
<th>Controls</th><th>Interactions</th><th>Sources and formats</th>
|
||||
</tr><tr>
|
||||
@@ -21,20 +21,20 @@
|
||||
<td>
|
||||
[Map default interactions](module-ol_interaction.html#~defaults)<br>
|
||||
Interactions for [vector features](module-ol_Feature-Feature.html)
|
||||
<ul><li>[interaction/Select](module-ol_interaction_Select-Select.html)</li>
|
||||
<li>[interaction/Draw](module-ol_interaction_Draw-Draw.html)</li>
|
||||
<li>[interaction/Modify](module-ol_interaction_Modify-Modify.html)</li></ul>
|
||||
<ul><li>[ol/interaction/Select](module-ol_interaction_Select-Select.html)</li>
|
||||
<li>[ol/interaction/Draw](module-ol_interaction_Draw-Draw.html)</li>
|
||||
<li>[ol/interaction/Modify](module-ol_interaction_Modify-Modify.html)</li></ul>
|
||||
[All interactions](module-ol_interaction_Interaction-Interaction.html)</td>
|
||||
<td>[Tile sources](module-ol_source_Tile-TileSource.html) for [layer/Tile](module-ol_layer_Tile-TileLayer.html)
|
||||
<br>[Image sources](module-ol_source_Image-ImageSource.html) for [layer/Image](module-ol_layer_Image-ImageLayer.html)
|
||||
<br>[Vector sources](module-ol_source_Vector-VectorSource.html) for [layer/Vector](module-ol_layer_Vector-VectorLayer.html)
|
||||
<br>[Vector tile sources](module-ol_source_VectorTile-VectorTile.html) for [layer/VectorTile](module-ol_layer_VectorTile-VectorTileLayer.html)
|
||||
<td>[Tile sources](module-ol_source_Tile-TileSource.html) for [ol/layer/Tile](module-ol_layer_Tile-TileLayer.html)
|
||||
<br>[Image sources](module-ol_source_Image-ImageSource.html) for [ol/layer/Image](module-ol_layer_Image-ImageLayer.html)
|
||||
<br>[Vector sources](module-ol_source_Vector-VectorSource.html) for [ol/layer/Vector](module-ol_layer_Vector-VectorLayer.html)
|
||||
<br>[Vector tile sources](module-ol_source_VectorTile-VectorTile.html) for [ol/layer/VectorTile](module-ol_layer_VectorTile-VectorTileLayer.html)
|
||||
<br>[Formats](module-ol_format_Feature-FeatureFormat.html) for reading/writing vector data
|
||||
<br>[format/WMSCapabilities](module-ol_format_WMSCapabilities-WMSCapabilities.html)</td></tr>
|
||||
<br>[ol/format/WMSCapabilities](module-ol_format_WMSCapabilities-WMSCapabilities.html)</td></tr>
|
||||
<tr><th>Projections</th><th>Observable objects</th><th>Other components</th></tr>
|
||||
<tr><td><p>All coordinates and extents need to be provided in view projection (default: EPSG:3857). To transform, use [proj.transform()](module-ol_proj.html#.transform) and [proj.transformExtent()](module-ol_proj.html#.transformExtent).</p>
|
||||
<tr><td><p>All coordinates and extents need to be provided in view projection (default: EPSG:3857). To transform, use [ol/proj#transform()](module-ol_proj.html#.transform) and [ol/proj#transformExtent()](module-ol_proj.html#.transformExtent).</p>
|
||||
[ol/proj](module-ol_proj.html)</td>
|
||||
<td><p>Changes to all [ol/Object](module-ol_Object-BaseObject.html)s can be observed by calling the [object.on('propertychange')](module-ol_Object-BaseObject.html#on) method. Listeners receive an [ol/Object~ObjectEvent](module-ol_Object-ObjectEvent.html) with information on the changed property and old value.</p>
|
||||
<td><p>Changes to all [ol/Object](module-ol_Object-BaseObject.html)s can be observed by calling the [object.on('propertychange')](module-ol_Object-BaseObject.html#on) method. Listeners receive an [ol/Object.ObjectEvent](module-ol_Object-ObjectEvent.html) with information on the changed property and old value.</p>
|
||||
<td>
|
||||
[ol/Geolocation](module-ol_Geolocation.html)<br>
|
||||
[ol/Overlay](module-ol_Overlay-Overlay.html)<br></td>
|
||||
|
||||
@@ -95,17 +95,20 @@ exports.handlers = {
|
||||
newDoclet: function(e) {
|
||||
const doclet = e.doclet;
|
||||
if (doclet.stability) {
|
||||
modules[doclet.longname.split('~').shift()] = true;
|
||||
modules[doclet.longname.split(/[~\.]/).shift()] = true;
|
||||
api.push(doclet);
|
||||
}
|
||||
// Mark explicity defined namespaces - needed in parseComplete to keep
|
||||
// namespaces that we need as containers for api items.
|
||||
if (/.*\.jsdoc$/.test(doclet.meta.filename) && doclet.kind == 'namespace') {
|
||||
doclet.namespace_ = true;
|
||||
}
|
||||
if (doclet.kind == 'class') {
|
||||
modules[doclet.longname.split('~').shift()] = true;
|
||||
classes[doclet.longname] = doclet;
|
||||
modules[doclet.longname.split(/[~\.]/).shift()] = true;
|
||||
if (!(doclet.longname in classes)) {
|
||||
classes[doclet.longname] = doclet;
|
||||
} else if ('augments' in doclet) {
|
||||
classes[doclet.longname].augments = doclet.augments;
|
||||
}
|
||||
}
|
||||
if (doclet.name === doclet.longname && !doclet.memberof) {
|
||||
// Make sure anonymous default exports are documented
|
||||
doclet.setMemberof(doclet.longname);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -113,7 +116,7 @@ exports.handlers = {
|
||||
const doclets = e.doclets;
|
||||
for (let i = doclets.length - 1; i >= 0; --i) {
|
||||
const doclet = doclets[i];
|
||||
if (doclet.stability || doclet.namespace_) {
|
||||
if (doclet.stability) {
|
||||
if (doclet.kind == 'class') {
|
||||
includeAugments(doclet);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ exports.handlers = {
|
||||
events[cls] = [];
|
||||
}
|
||||
events[cls].push(doclet.longname);
|
||||
} else if (doclet.kind == 'class') {
|
||||
} else if (doclet.kind == 'class' && !(doclet.longname in classes)) {
|
||||
classes[doclet.longname] = doclet;
|
||||
}
|
||||
},
|
||||
@@ -29,7 +29,7 @@ exports.handlers = {
|
||||
event = doclet.fires[j].replace('event:', '');
|
||||
if (events[event]) {
|
||||
fires.push.apply(fires, events[event]);
|
||||
} else {
|
||||
} else if (doclet.fires[j] !== 'event:ObjectEvent') {
|
||||
fires.push(doclet.fires[j]);
|
||||
}
|
||||
}
|
||||
@@ -40,4 +40,3 @@ exports.handlers = {
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
109
config/jsdoc/api/plugins/inheritdoc.js
Executable file
109
config/jsdoc/api/plugins/inheritdoc.js
Executable file
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* This is a hack to prevent inheritDoc tags from entirely removing
|
||||
* documentation of the method that inherits the documentation.
|
||||
*
|
||||
* TODO: Remove this hack when https://github.com/jsdoc3/jsdoc/issues/53
|
||||
* is addressed.
|
||||
*/
|
||||
|
||||
|
||||
exports.defineTags = function(dictionary) {
|
||||
dictionary.defineTag('inheritDoc', {
|
||||
mustHaveValue: false,
|
||||
canHaveType: false,
|
||||
canHaveName: false,
|
||||
onTagged: function(doclet, tag) {
|
||||
doclet.inheritdoc = true;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
const lookup = {};
|
||||
const incompleteByClass = {};
|
||||
const keepKeys = ['comment', 'meta', 'name', 'memberof', 'longname', 'augment',
|
||||
'stability'];
|
||||
|
||||
exports.handlers = {
|
||||
|
||||
newDoclet: function(e) {
|
||||
const doclet = e.doclet;
|
||||
let incompletes;
|
||||
if (!(doclet.longname in lookup)) {
|
||||
lookup[doclet.longname] = [];
|
||||
}
|
||||
lookup[doclet.longname].push(doclet);
|
||||
if (doclet.inheritdoc) {
|
||||
if (!(doclet.memberof in incompleteByClass)) {
|
||||
incompleteByClass[doclet.memberof] = [];
|
||||
}
|
||||
incompletes = incompleteByClass[doclet.memberof];
|
||||
if (incompletes.indexOf(doclet.name) == -1) {
|
||||
incompletes.push(doclet.name);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
parseComplete: function(e) {
|
||||
let ancestors, candidate, candidates, doclet, i, j, k, l, key;
|
||||
let incompleteDoclet, stability, incomplete, incompletes;
|
||||
const doclets = e.doclets;
|
||||
for (i = doclets.length - 1; i >= 0; --i) {
|
||||
doclet = doclets[i];
|
||||
if (doclet.augments) {
|
||||
ancestors = [].concat(doclet.augments);
|
||||
}
|
||||
incompletes = incompleteByClass[doclet.longname];
|
||||
if (ancestors && incompletes) {
|
||||
// collect ancestors from the whole hierarchy
|
||||
for (j = 0; j < ancestors.length; ++j) {
|
||||
candidates = lookup[ancestors[j]];
|
||||
if (candidates) {
|
||||
for (k = candidates.length - 1; k >= 0; --k) {
|
||||
candidate = candidates[k];
|
||||
if (candidate.augments) {
|
||||
ancestors = ancestors.concat(candidate.augments);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// walk through all inheritDoc members
|
||||
for (j = incompletes.length - 1; j >= 0; --j) {
|
||||
incomplete = incompletes[j];
|
||||
candidates = lookup[doclet.longname + '#' + incomplete];
|
||||
if (candidates) {
|
||||
// get the incomplete doclet that needs to be augmented
|
||||
for (k = candidates.length - 1; k >= 0; --k) {
|
||||
incompleteDoclet = candidates[k];
|
||||
if (incompleteDoclet.inheritdoc) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// find the documented ancestor
|
||||
for (k = ancestors.length - 1; k >= 0; --k) {
|
||||
candidates = lookup[ancestors[k] + '#' + incomplete];
|
||||
if (candidates) {
|
||||
for (l = candidates.length - 1; l >= 0; --l) {
|
||||
candidate = candidates[l];
|
||||
if (candidate && !candidate.inheritdoc) {
|
||||
stability = candidate.stability || incompleteDoclet.stability;
|
||||
if (stability) {
|
||||
incompleteDoclet.stability = stability;
|
||||
for (key in candidate) {
|
||||
if (candidate.hasOwnProperty(key) &&
|
||||
keepKeys.indexOf(key) == -1) {
|
||||
incompleteDoclet[key] = candidate[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
111
config/jsdoc/api/plugins/markdown.js
Normal file
111
config/jsdoc/api/plugins/markdown.js
Normal file
@@ -0,0 +1,111 @@
|
||||
/**
|
||||
* Modified from JSDoc's plugins/markdown and lib/jsdoc/util/markdown modules
|
||||
* (see https://github.com/jsdoc3/jsdoc/), which are licensed under the Apache 2
|
||||
* license (see http://www.apache.org/licenses/LICENSE-2.0).
|
||||
*
|
||||
* This version does not protect http(s) urls from being turned into links, and
|
||||
* works around an issue with `~` characters in module paths by escaping them.
|
||||
*/
|
||||
|
||||
const marked = require('marked');
|
||||
const format = require('util').format;
|
||||
|
||||
const tags = [
|
||||
'author',
|
||||
'classdesc',
|
||||
'description',
|
||||
'exceptions',
|
||||
'params',
|
||||
'properties',
|
||||
'returns',
|
||||
'see',
|
||||
'summary'
|
||||
];
|
||||
|
||||
const hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
|
||||
const markedRenderer = new marked.Renderer();
|
||||
|
||||
// Allow prettyprint to work on inline code samples
|
||||
markedRenderer.code = function(code, language) {
|
||||
const langClass = language ? ' lang-' + language : '';
|
||||
|
||||
return format('<pre class="prettyprint source%s"><code>%s</code></pre>',
|
||||
langClass, escapeCode(code));
|
||||
};
|
||||
|
||||
function escapeCode(source) {
|
||||
return source.replace(/</g, '<')
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, ''');
|
||||
}
|
||||
|
||||
function escapeUnderscoresAndTildes(source) {
|
||||
return source.replace(/\{@[^}\r\n]+\}/g, function(wholeMatch) {
|
||||
return wholeMatch
|
||||
.replace(/(^|[^\\])_/g, '$1\\_')
|
||||
.replace('~', '˜');
|
||||
});
|
||||
}
|
||||
|
||||
function unencodeQuotesAndTildes(source) {
|
||||
return source.replace(/\{@[^}\r\n]+\}/g, function(wholeMatch) {
|
||||
return wholeMatch
|
||||
.replace(/"/g, '"')
|
||||
.replace(/˜/g, '~');
|
||||
});
|
||||
}
|
||||
|
||||
function parse(source) {
|
||||
let result;
|
||||
|
||||
source = escapeUnderscoresAndTildes(source);
|
||||
|
||||
result = marked(source, {renderer: markedRenderer})
|
||||
.replace(/\s+$/, '')
|
||||
.replace(/'/g, '\'');
|
||||
|
||||
result = unencodeQuotesAndTildes(result);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function shouldProcessString(tagName, text) {
|
||||
let shouldProcess = true;
|
||||
|
||||
// we only want to process `@author` and `@see` tags that contain Markdown links
|
||||
if ((tagName === 'author' || tagName === 'see') && text.indexOf('[') === -1) {
|
||||
shouldProcess = false;
|
||||
}
|
||||
|
||||
return shouldProcess;
|
||||
}
|
||||
|
||||
function process(doclet) {
|
||||
tags.forEach(function(tag) {
|
||||
if (!hasOwnProp.call(doclet, tag)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (typeof doclet[tag] === 'string' && shouldProcessString(tag, doclet[tag])) {
|
||||
doclet[tag] = parse(doclet[tag]);
|
||||
} else if (Array.isArray(doclet[tag])) {
|
||||
doclet[tag].forEach(function(value, index, original) {
|
||||
const inner = {};
|
||||
|
||||
inner[tag] = value;
|
||||
process(inner);
|
||||
original[index] = inner[tag];
|
||||
});
|
||||
} else if (doclet[tag]) {
|
||||
process(doclet[tag]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
exports.handlers = {
|
||||
newDoclet: function(e) {
|
||||
process(e.doclet);
|
||||
}
|
||||
};
|
||||
@@ -1,106 +0,0 @@
|
||||
/**
|
||||
* @filedesc
|
||||
* Expands module path type to point to default export when no name is given
|
||||
*/
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
let moduleRoot;
|
||||
|
||||
function addDefaultExportPath(obj) {
|
||||
if (!Array.isArray(obj)) {
|
||||
obj = obj.names;
|
||||
}
|
||||
obj.forEach((name, index) => {
|
||||
const matches = name.match(/module\:([^>|),\.<]|)+/g);
|
||||
if (matches) {
|
||||
matches.forEach(module => {
|
||||
if (!/[~\.]/.test(module)) {
|
||||
const checkFile = path.resolve(moduleRoot, module.replace(/^module\:/, ''));
|
||||
const file = fs.readFileSync(require.resolve(checkFile), 'utf-8');
|
||||
const lines = file.split('\n');
|
||||
let hasDefaultExport = false;
|
||||
for (let i = 0, ii = lines.length; i < ii; ++i) {
|
||||
hasDefaultExport = hasDefaultExport || /^export default [^\{]/.test(lines[i]);
|
||||
const match = lines[i].match(/^export default ([A-Za-z_$][A-Za-z0-9_$]+);$/);
|
||||
if (match) {
|
||||
// Use variable name if default export is assigned to a variable.
|
||||
obj[index] = name = name.replace(module, `${module}~${match[1]}`);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (hasDefaultExport) {
|
||||
// Duplicate last part if default export is not assigned to a variable.
|
||||
obj[index] = name = name.replace(module, `${module}~${module.split('/').pop()}`);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function replaceLinks(comment) {
|
||||
const matches = comment.match(/\{@link [^\} #]+}/g);
|
||||
if (matches) {
|
||||
const modules = matches.map(m => {
|
||||
const mm = m.match(/(module:[^\}]+)}$/);
|
||||
if (mm) {
|
||||
return mm[1];
|
||||
}
|
||||
}).filter(m => !!m);
|
||||
const newModules = modules.concat();
|
||||
addDefaultExportPath(newModules);
|
||||
modules.forEach((module, i) => {
|
||||
comment = comment.replace(module, newModules[i]);
|
||||
});
|
||||
}
|
||||
return comment;
|
||||
}
|
||||
|
||||
exports.handlers = {
|
||||
|
||||
/**
|
||||
* Adds default export to module path types without name
|
||||
* @param {Object} e Event object.
|
||||
*/
|
||||
newDoclet: function(e) {
|
||||
const doclet = e.doclet;
|
||||
if (doclet.kind == 'module') {
|
||||
const levelsUp = doclet.longname.replace(/^module\:/, '').split('/');
|
||||
if (doclet.meta.filename != 'index.js') {
|
||||
levelsUp.pop();
|
||||
}
|
||||
const pathArgs = [doclet.meta.path].concat(levelsUp.map(() => '../'));
|
||||
moduleRoot = path.resolve.apply(null, pathArgs);
|
||||
} else {
|
||||
if (doclet.description) {
|
||||
doclet.description = replaceLinks(doclet.description);
|
||||
}
|
||||
if (doclet.classdesc) {
|
||||
doclet.classdesc = replaceLinks(doclet.classdesc);
|
||||
}
|
||||
|
||||
const module = doclet.longname.split('#').shift();
|
||||
if (module.indexOf('module:') == 0 && module.indexOf('.') !== -1) {
|
||||
doclet.longname = doclet.longname.replace(module, module.replace('.', '~'));
|
||||
}
|
||||
if (doclet.augments) {
|
||||
addDefaultExportPath(doclet.augments);
|
||||
}
|
||||
if (doclet.params) {
|
||||
doclet.params.forEach(p => addDefaultExportPath(p.type));
|
||||
}
|
||||
if (doclet.returns) {
|
||||
doclet.returns.forEach(r => addDefaultExportPath(r.type));
|
||||
}
|
||||
if (doclet.properties) {
|
||||
doclet.properties.forEach(p => addDefaultExportPath(p.type));
|
||||
}
|
||||
if (doclet.type) {
|
||||
addDefaultExportPath(doclet.type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
@@ -5,7 +5,7 @@ exports.handlers = {
|
||||
|
||||
newDoclet: function(e) {
|
||||
const doclet = e.doclet;
|
||||
if (doclet.kind == 'class') {
|
||||
if (doclet.kind == 'class' && !(doclet.longname in classes)) {
|
||||
classes[doclet.longname] = doclet;
|
||||
}
|
||||
},
|
||||
@@ -47,7 +47,7 @@ exports.handlers = {
|
||||
if (!cls.fires) {
|
||||
cls.fires = [];
|
||||
}
|
||||
event = 'module:ol/Object~ObjectEvent#event:change:' + name;
|
||||
event = 'module:ol/Object.ObjectEvent#event:change:' + name;
|
||||
if (cls.fires.indexOf(event) == -1) {
|
||||
cls.fires.push(event);
|
||||
}
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
/*
|
||||
* Changes @enum annotations into @typedef.
|
||||
*/
|
||||
|
||||
// types that are undefined or typedefs containing undefined
|
||||
let undefinedLikes = null;
|
||||
|
||||
/**
|
||||
* Changes the description of the param if it is required.
|
||||
* @param {Object} doclet The doclet.
|
||||
* @returns {Object} The modified doclet.
|
||||
*/
|
||||
function markRequiredIfNeeded(doclet) {
|
||||
const memberof = doclet.memberof;
|
||||
if (!memberof) {
|
||||
return doclet;
|
||||
}
|
||||
|
||||
const types = doclet.type.names;
|
||||
let isRequiredParam = true;
|
||||
|
||||
// iterate over all types that are like-undefined (see above for explanation)
|
||||
for (let idx = undefinedLikes.length - 1; idx >= 0; idx--) {
|
||||
const undefinedLike = undefinedLikes[idx];
|
||||
// … if the current types contains a type that is undefined-like,
|
||||
// it is not required.
|
||||
if (types.indexOf(undefinedLike) != -1) {
|
||||
isRequiredParam = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (isRequiredParam) {
|
||||
const reqSnippet = '<span class="required-option">Required.</span></p>';
|
||||
const endsWithP = /<\/p>$/i;
|
||||
let description = doclet.description;
|
||||
if (description && endsWithP.test(description)) {
|
||||
description = description.replace(endsWithP, ' ' + reqSnippet);
|
||||
} else if (doclet.description === undefined) {
|
||||
description = '<p>' + reqSnippet;
|
||||
}
|
||||
doclet.description = description;
|
||||
}
|
||||
return doclet;
|
||||
}
|
||||
|
||||
/**
|
||||
* Iterates over all doclets and finds the names of types that contain
|
||||
* undefined. Stores the names in the global variable undefinedLikes, so
|
||||
* that e.g. markRequiredIfNeeded can use these.
|
||||
* @param {Array} doclets The doclets.
|
||||
*/
|
||||
function findTypesLikeUndefined(doclets) {
|
||||
undefinedLikes = ['undefined']; // include type 'undefined' explicitly
|
||||
for (let i = doclets.length - 1; i >= 0; --i) {
|
||||
const doclet = doclets[i];
|
||||
if (doclet.kind === 'typedef') {
|
||||
const types = doclet.type.names;
|
||||
if (types.indexOf('undefined') !== -1) {
|
||||
// the typedef contains 'undefined', so it self is undefinedLike.
|
||||
undefinedLikes.push(doclet.longname);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
exports.handlers = {
|
||||
|
||||
newDoclet: function(e) {
|
||||
const doclet = e.doclet;
|
||||
if (doclet.isEnum) {
|
||||
// We never export enums, so we document them like typedefs
|
||||
doclet.kind = 'typedef';
|
||||
delete doclet.isEnum;
|
||||
}
|
||||
},
|
||||
|
||||
parseComplete: function(e) {
|
||||
const doclets = e.doclets;
|
||||
findTypesLikeUndefined(doclets);
|
||||
for (let i = doclets.length - 1; i >= 0; --i) {
|
||||
markRequiredIfNeeded(doclets[i]);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
@@ -30,7 +30,11 @@ $(function () {
|
||||
});
|
||||
|
||||
// Show an item related a current documentation automatically
|
||||
var filename = $('.page-title').data('filename').replace(/\.[a-z]+$/, '');
|
||||
var filename = $('.page-title').data('filename')
|
||||
.replace(/\.[a-z]+$/, '')
|
||||
.replace('module-', 'module:')
|
||||
.replace(/_/g, '/')
|
||||
.replace(/-/g, '~');
|
||||
var $currentItem = $('.navigation .item[data-name*="' + filename + '"]:eq(0)');
|
||||
|
||||
if ($currentItem.length) {
|
||||
@@ -97,7 +101,8 @@ $(function () {
|
||||
var anchors = $('.anchor');
|
||||
var _onHashChange = function () {
|
||||
var activeHash = window.document.location.hash
|
||||
.replace(/\./g, '\\.'); // Escape dot in element id
|
||||
.replace(/\./g, '\\.') // Escape dot in element id
|
||||
.replace(/\~/g, '\\~'); // Escape tilde in element id
|
||||
|
||||
anchors.removeClass('highlighted');
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ if (data.type && data.type.names) {
|
||||
<div class="anchor" id="<?js= id ?>">
|
||||
</div>
|
||||
<h4 class="name">
|
||||
<?js= data.attribs + (data.scope === 'static' ? longname : name) + typeSignature ?>
|
||||
<?js= data.attribs + (data.scope === 'static' ? longname : name.indexOf('module:') === 0 ? name.split('/').pop() : name) + typeSignature ?>
|
||||
<?js= this.partial('stability.tmpl', data) ?>
|
||||
</h4>
|
||||
</div>
|
||||
@@ -28,9 +28,9 @@ if (data.type && data.type.names) {
|
||||
<?js= data.description ?>
|
||||
</div>
|
||||
<?js } ?>
|
||||
|
||||
|
||||
<?js= this.partial('details.tmpl', data) ?>
|
||||
|
||||
|
||||
<?js if (data.examples && examples.length) { ?>
|
||||
<h5>Example<?js= examples.length > 1? 's':'' ?></h5>
|
||||
<?js= this.partial('examples.tmpl', examples) ?>
|
||||
|
||||
@@ -77,7 +77,7 @@ var self = this;
|
||||
(<?js= self.linkto(eventClass.longname) ?>)
|
||||
<?js } ?>
|
||||
<?js } ?>
|
||||
<?js= self.partial('stability.tmpl', eventDoclet || (data.stability ? data : {stability: 'experimental'})) ?>
|
||||
<?js= self.partial('stability.tmpl', eventDoclet || (data.stability ? data : {})) ?>
|
||||
<?js if (description) { ?> -
|
||||
<?js= description ?>
|
||||
<?js } ?>
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
<?js
|
||||
var self = this;
|
||||
function toShortName(name) {
|
||||
return name.indexOf('module:') === 0 ? name.split('/').pop() : name;
|
||||
}
|
||||
?>
|
||||
<div class="navigation">
|
||||
<div class="search">
|
||||
@@ -25,7 +28,7 @@ var self = this;
|
||||
<?js
|
||||
item.members.forEach(function (v) {
|
||||
?>
|
||||
<li data-name="<?js= v.longname ?>"><?js= self.linkto(v.longname, v.name) ?></li>
|
||||
<li data-name="<?js= v.longname ?>"><?js= self.linkto(v.longname, toShortName(v.name)) ?></li>
|
||||
<?js
|
||||
});
|
||||
}
|
||||
@@ -40,7 +43,7 @@ var self = this;
|
||||
item.typedefs.forEach(function (v) {
|
||||
?>
|
||||
<li data-name="<?js= v.longname ?>" class="<?js= (v.stability && v.stability !== 'stable') ? 'unstable' : ''?>">
|
||||
<?js= self.linkto(v.longname, v.name) ?>
|
||||
<?js= self.linkto(v.longname, toShortName(v.name)) ?>
|
||||
</li>
|
||||
<?js
|
||||
});
|
||||
@@ -57,7 +60,7 @@ var self = this;
|
||||
item.methods.forEach(function (v) {
|
||||
?>
|
||||
<li data-name="<?js= v.longname ?>" class="<?js= (v.stability && v.stability !== 'stable') ? 'unstable' : ''?>">
|
||||
<?js= self.linkto(v.longname, v.name) ?>
|
||||
<?js= self.linkto(v.longname, toShortName(v.name)) ?>
|
||||
</li>
|
||||
<?js
|
||||
});
|
||||
@@ -74,7 +77,7 @@ var self = this;
|
||||
v = self.find({longname: v})[0] || {longname: v, name: v.split(/#?event:/)[1]};
|
||||
?>
|
||||
<li data-name="<?js= v.longname ?>" class="<?js= (v.stability && v.stability != 'stable') ? 'unstable' : '' ?>">
|
||||
<?js= self.linkto(v.longname, v.name) ?>
|
||||
<?js= self.linkto(v.longname, toShortName(v.name)) ?>
|
||||
</li>
|
||||
<?js
|
||||
});
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<th>Name</th>
|
||||
<th>Type</th>
|
||||
<th>Settable</th>
|
||||
<th><a href="module-ol_Object-ObjectEvent.html">ol/Object~ObjectEvent</a> type</th>
|
||||
<th><a href="module-ol_Object-ObjectEvent.html">ol/Object.ObjectEvent</a> type</th>
|
||||
<th class="last">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -10,8 +10,12 @@
|
||||
"includePattern": "\\.js$"
|
||||
},
|
||||
"plugins": [
|
||||
"jsdoc-plugin-typescript",
|
||||
"config/jsdoc/info/api-plugin",
|
||||
"config/jsdoc/info/define-plugin",
|
||||
"config/jsdoc/info/virtual-plugin"
|
||||
]
|
||||
],
|
||||
"typescript": {
|
||||
"moduleRoot": "src"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
// Rollup configuration for the full build
|
||||
|
||||
import noderesolve from 'rollup-plugin-node-resolve';
|
||||
import commonjs from 'rollup-plugin-commonjs';
|
||||
import {uglify} from 'rollup-plugin-uglify';
|
||||
import buble from 'rollup-plugin-buble';
|
||||
import sourcemaps from 'rollup-plugin-sourcemaps';
|
||||
|
||||
export default {
|
||||
input: 'build/index.js',
|
||||
output: [
|
||||
{file: 'build/ol.js', format: 'iife', sourcemap: true}
|
||||
],
|
||||
plugins: [
|
||||
noderesolve(),
|
||||
commonjs(),
|
||||
buble(),
|
||||
uglify(),
|
||||
sourcemaps()
|
||||
]
|
||||
};
|
||||
13
config/webpack-config-legacy-build.js
Normal file
13
config/webpack-config-legacy-build.js
Normal file
@@ -0,0 +1,13 @@
|
||||
const path = require('path');
|
||||
module.exports = {
|
||||
entry: './build/index.js',
|
||||
devtool: 'source-map',
|
||||
mode: 'production',
|
||||
output: {
|
||||
path: path.resolve('./build/legacy'),
|
||||
filename: 'ol.js',
|
||||
library: 'ol',
|
||||
libraryTarget: 'umd',
|
||||
libraryExport: 'default'
|
||||
}
|
||||
};
|
||||
132
doc/faq.md
132
doc/faq.md
@@ -54,9 +54,12 @@ The projection of your map can be set through the `view`-property. Here are some
|
||||
examples:
|
||||
|
||||
```javascript
|
||||
import Map from 'ol/Map';
|
||||
import View from 'ol/View';
|
||||
|
||||
// OpenLayers comes with support for the World Geodetic System 1984, EPSG:4326:
|
||||
var map = new ol.Map({
|
||||
view: new ol.View({
|
||||
const map = new Map({
|
||||
view: new View({
|
||||
projection: 'EPSG:4326'
|
||||
// other view properties like map center etc.
|
||||
})
|
||||
@@ -65,23 +68,29 @@ var map = new ol.Map({
|
||||
```
|
||||
|
||||
```javascript
|
||||
import Map from 'ol/Map';
|
||||
import View from 'ol/View';
|
||||
import proj4 from 'proj4';
|
||||
import {register} from 'ol/proj/proj4';
|
||||
import {get as getProjection} from 'ol/proj';
|
||||
|
||||
// To use other projections, you have to register the projection in OpenLayers.
|
||||
// This can easily be done with [https://proj4js.org](proj4)
|
||||
//
|
||||
// By default OpenLayers does not know about the EPSG:21781 (Swiss) projection.
|
||||
// So we create a projection instance for EPSG:21781 and pass it to
|
||||
// ol.proj.addProjection to make it available to the library for lookup by its
|
||||
// register to make it available to the library for lookup by its
|
||||
// code.
|
||||
proj4.defs('EPSG:21781',
|
||||
'+proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 +k_0=1 ' +
|
||||
'+x_0=600000 +y_0=200000 +ellps=bessel ' +
|
||||
'+towgs84=660.077,13.551,369.344,2.484,1.783,2.939,5.66 +units=m +no_defs');
|
||||
ol.proj.proj4.register(proj4);
|
||||
var swissProjection = ol.proj.get('EPSG:21781');
|
||||
register(proj4);
|
||||
const swissProjection = getProjection('EPSG:21781');
|
||||
|
||||
// we can now use the projection:
|
||||
var map = new ol.Map({
|
||||
view: new ol.View({
|
||||
const map = new Map({
|
||||
view: new View({
|
||||
projection: swissProjection
|
||||
// other view properties like map center etc.
|
||||
})
|
||||
@@ -104,15 +113,20 @@ coordinates for the center have to be provided in that projection. Chances are
|
||||
that your map looks like this:
|
||||
|
||||
```javascript
|
||||
var washingtonLonLat = [-77.036667, 38.895];
|
||||
var map = new ol.Map({
|
||||
import Map from 'ol/Map';
|
||||
import View from 'ol/View';
|
||||
import TileLayer from 'ol/layer/Tile';
|
||||
import OSM from 'ol/source/OSM';
|
||||
|
||||
const washingtonLonLat = [-77.036667, 38.895];
|
||||
const map = new Map({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.OSM()
|
||||
new TileLayer({
|
||||
source: new OSM()
|
||||
})
|
||||
],
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
view: new View({
|
||||
center: washingtonLonLat,
|
||||
zoom: 12
|
||||
})
|
||||
@@ -128,31 +142,38 @@ The solution is easy: Provide the coordinates projected into Web Mercator.
|
||||
OpenLayers has some helpful utility methods to assist you:
|
||||
|
||||
```javascript
|
||||
var washingtonLonLat = [-77.036667, 38.895];
|
||||
var washingtonWebMercator = ol.proj.fromLonLat(washingtonLonLat);
|
||||
import Map from 'ol/Map';
|
||||
import View from 'ol/View';
|
||||
import TileLayer from 'ol/layer/Tile';
|
||||
import OSM from 'ol/source/OSM';
|
||||
import {fromLonLat} from 'ol/proj';
|
||||
|
||||
var map = new ol.Map({
|
||||
const washingtonLonLat = [-77.036667, 38.895];
|
||||
const washingtonWebMercator = fromLonLat(washingtonLonLat);
|
||||
|
||||
const map = new Map({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.OSM()
|
||||
new TileLayer({
|
||||
source: new OSM()
|
||||
})
|
||||
],
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
view: new View({
|
||||
center: washingtonWebMercator,
|
||||
zoom: 8
|
||||
})
|
||||
});
|
||||
```
|
||||
|
||||
The method `ol.proj.fromLonLat()` is available from version 3.5 onwards.
|
||||
The method `fromLonLat()` is available from version 3.5 onwards.
|
||||
|
||||
If you told OpenLayers about a custom projection (see above), you can use the
|
||||
following method to transform a coordinate from WGS84 to your projection:
|
||||
|
||||
```javascript
|
||||
import {transform} from 'ol/proj';
|
||||
// assuming that OpenLayers knows about EPSG:21781, see above
|
||||
var swissCoord = ol.proj.transform([8.23, 46.86], 'EPSG:4326', 'EPSG:21781');
|
||||
const swissCoord = transform([8.23, 46.86], 'EPSG:4326', 'EPSG:21781');
|
||||
```
|
||||
|
||||
|
||||
@@ -189,18 +210,24 @@ So the next step would be to put the decimal coordinates into an array and use
|
||||
it as center:
|
||||
|
||||
```javascript
|
||||
var schladming = [47.394167, 13.689167]; // caution partner, read on...
|
||||
// since we are using OSM, we have to transform the coordinates...
|
||||
var schladmingWebMercator = ol.proj.fromLonLat(schladming);
|
||||
import Map from 'ol/Map';
|
||||
import View from 'ol/View';
|
||||
import TileLayer from 'ol/layer/Tile';
|
||||
import OSM from 'ol/source/OSM';
|
||||
import {fromLonLat} from 'ol/proj';
|
||||
|
||||
var map = new ol.Map({
|
||||
const schladming = [47.394167, 13.689167]; // caution partner, read on...
|
||||
// since we are using OSM, we have to transform the coordinates...
|
||||
const schladmingWebMercator = fromLonLat(schladming);
|
||||
|
||||
const map = new Map({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.OSM()
|
||||
new TileLayer({
|
||||
source: new OSM()
|
||||
})
|
||||
],
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
view: new View({
|
||||
center: schladmingWebMercator,
|
||||
zoom: 9
|
||||
})
|
||||
@@ -219,18 +246,24 @@ e.g. try to change the map center.
|
||||
Ok, then let's flip the coordinates:
|
||||
|
||||
```javascript
|
||||
var schladming = [13.689167, 47.394167]; // longitude first, then latitude
|
||||
// since we are using OSM, we have to transform the coordinates...
|
||||
var schladmingWebMercator = ol.proj.fromLonLat(schladming);
|
||||
import Map from 'ol/Map';
|
||||
import View from 'ol/View';
|
||||
import TileLayer from 'ol/layer/Tile';
|
||||
import OSM from 'ol/source/OSM';
|
||||
import {fromLonLat} from 'ol/proj';
|
||||
|
||||
var map = new ol.Map({
|
||||
const schladming = [13.689167, 47.394167]; // longitude first, then latitude
|
||||
// since we are using OSM, we have to transform the coordinates...
|
||||
const schladmingWebMercator = fromLonLat(schladming);
|
||||
|
||||
const map = new Map({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.OSM()
|
||||
new TileLayer({
|
||||
source: new OSM()
|
||||
})
|
||||
],
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
view: new View({
|
||||
center: schladmingWebMercator,
|
||||
zoom: 9
|
||||
})
|
||||
@@ -244,7 +277,7 @@ first, and then the latitude. This behaviour is the same as we had in OpenLayers
|
||||
2, and it actually makes sense because of the natural axis order in WGS84.
|
||||
|
||||
If you cannot remember the correct order, just have a look at the method name
|
||||
we used: `ol.proj.fromLonLat`; even there we hint that we expect longitude
|
||||
we used: `fromLonLat`; even there we hint that we expect longitude
|
||||
first, and then latitude.
|
||||
|
||||
|
||||
@@ -254,8 +287,11 @@ Suppose you want to load a KML file and display the contained features on the
|
||||
map. Code like the following could be used:
|
||||
|
||||
```javascript
|
||||
var vector = new ol.layer.Vector({
|
||||
source: new ol.source.KML({
|
||||
import VectorLayer from 'ol/layer/Vector';
|
||||
import KMLSource from 'ol/source/KML';
|
||||
|
||||
const vector = new VectorLayer({
|
||||
source: new KMLSource({
|
||||
projection: 'EPSG:3857',
|
||||
url: 'data/kml/2012-02-10.kml'
|
||||
})
|
||||
@@ -266,13 +302,16 @@ You may ask yourself how many features are in that KML, and try something like
|
||||
the following:
|
||||
|
||||
```javascript
|
||||
var vector = new ol.layer.Vector({
|
||||
source: new ol.source.KML({
|
||||
import VectorLayer from 'ol/layer/Vector';
|
||||
import KMLSource from 'ol/source/KML';
|
||||
|
||||
const vector = new VectorLayer({
|
||||
source: new KMLSource({
|
||||
projection: 'EPSG:3857',
|
||||
url: 'data/kml/2012-02-10.kml'
|
||||
})
|
||||
});
|
||||
var numFeatures = vector.getSource().getFeatures().length;
|
||||
const numFeatures = vector.getSource().getFeatures().length;
|
||||
console.log("Count right after construction: " + numFeatures);
|
||||
```
|
||||
|
||||
@@ -284,9 +323,9 @@ been populated with features), you should use an event listener function on the
|
||||
|
||||
```javascript
|
||||
vector.getSource().on('change', function(evt){
|
||||
var source = evt.target;
|
||||
const source = evt.target;
|
||||
if (source.getState() === 'ready') {
|
||||
var numFeatures = source.getFeatures().length;
|
||||
const numFeatures = source.getFeatures().length;
|
||||
console.log("Count after change: " + numFeatures);
|
||||
}
|
||||
});
|
||||
@@ -315,16 +354,17 @@ map.renderSync();
|
||||
|
||||
## Why are my features not found?
|
||||
|
||||
You are using `ol.Map#forEachFeatureAtPixel` or `ol.Map#hasFeatureAtPixel`, but
|
||||
You are using `Map#forEachFeatureAtPixel` or `Map#hasFeatureAtPixel`, but
|
||||
it sometimes does not work for large icons or labels? The *hit detection* only
|
||||
checks features that are within a certain distance of the given position. For large
|
||||
icons, the actual geometry of a feature might be too far away and is not considered.
|
||||
|
||||
In this case, set the `renderBuffer` property of `ol.layer.Vector` (the default
|
||||
value is 100px):
|
||||
In this case, set the `renderBuffer` property of `VectorLayer` (the default value is 100px):
|
||||
|
||||
```javascript
|
||||
var vectorLayer = new ol.layer.Vector({
|
||||
import VectorLayer from 'ol/layer/Vector';
|
||||
|
||||
const vectorLayer = new VectorLayer({
|
||||
...
|
||||
renderBuffer: 200
|
||||
});
|
||||
|
||||
@@ -17,7 +17,7 @@ OpenLayers is available as [`ol` npm package](https://npmjs.com/package/ol), whi
|
||||
|
||||
## Renderers and Browser Support
|
||||
|
||||
By default, OpenLayers uses a performance optimized Canvas renderer. An experimental WebGL renderer (without text rendering support) is also avaialble.
|
||||
By default, OpenLayers uses a performance optimized Canvas renderer. An experimental WebGL renderer (without text rendering support) is also available.
|
||||
|
||||
OpenLayers runs on all modern browsers that support [HTML5](https://html.spec.whatwg.org/multipage/) and [ECMAScript 5](http://www.ecma-international.org/ecma-262/5.1/). This includes Chrome, Firefox, Safari and Edge. For older browsers and platforms like Internet Explorer (down to version 9) and Android 4.x, [polyfills](http://polyfill.io), the application bundle needs to be transpiled (e.g. using [Babel](https://babeljs.io)) and bundled with polyfills for `requestAnimationFrame`, `Element.prototype.classList` and `URL`.
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import {defaults as defaultControls} from '../src/ol/control.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import OSM from '../src/ol/source/OSM.js';
|
||||
|
||||
@@ -12,11 +11,6 @@ const map = new Map({
|
||||
})
|
||||
],
|
||||
target: 'map',
|
||||
controls: defaultControls({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
}
|
||||
}),
|
||||
view: new View({
|
||||
center: [0, 0],
|
||||
zoom: 2
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import {defaults as defaultControls} from '../src/ol/control.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import {fromLonLat} from '../src/ol/proj.js';
|
||||
import {OSM, TileDebug} from '../src/ol/source.js';
|
||||
@@ -20,11 +19,6 @@ const map = new Map({
|
||||
})
|
||||
],
|
||||
target: 'map',
|
||||
controls: defaultControls({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
}
|
||||
}),
|
||||
view: new View({
|
||||
center: fromLonLat([-0.1275, 51.507222]),
|
||||
zoom: 10
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import {defaults as defaultControls} from '../src/ol/control.js';
|
||||
import GeoJSON from '../src/ol/format/GeoJSON.js';
|
||||
import {Tile as TileLayer, Vector as VectorLayer} from '../src/ol/layer.js';
|
||||
import {OSM, Vector as VectorSource} from '../src/ol/source.js';
|
||||
@@ -45,11 +44,6 @@ const map = new Map({
|
||||
vectorLayer
|
||||
],
|
||||
target: 'map',
|
||||
controls: defaultControls({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
}
|
||||
}),
|
||||
view: view
|
||||
});
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import {inherits} from '../src/ol/util.js';
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import {defaults as defaultControls, Control} from '../src/ol/control.js';
|
||||
@@ -6,13 +5,6 @@ import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import OSM from '../src/ol/source/OSM.js';
|
||||
|
||||
|
||||
/**
|
||||
* Define a namespace for the application.
|
||||
*/
|
||||
window.app = {};
|
||||
const app = window.app;
|
||||
|
||||
|
||||
//
|
||||
// Define rotate to north control.
|
||||
//
|
||||
@@ -23,32 +15,31 @@ const app = window.app;
|
||||
* @extends {module:ol/control/Control~Control}
|
||||
* @param {Object=} opt_options Control options.
|
||||
*/
|
||||
app.RotateNorthControl = function(opt_options) {
|
||||
class RotateNorthControl extends Control {
|
||||
|
||||
const options = opt_options || {};
|
||||
constructor(opt_options) {
|
||||
const options = opt_options || {};
|
||||
|
||||
const button = document.createElement('button');
|
||||
button.innerHTML = 'N';
|
||||
const button = document.createElement('button');
|
||||
button.innerHTML = 'N';
|
||||
|
||||
const this_ = this;
|
||||
const handleRotateNorth = function() {
|
||||
this_.getMap().getView().setRotation(0);
|
||||
};
|
||||
const element = document.createElement('div');
|
||||
element.className = 'rotate-north ol-unselectable ol-control';
|
||||
element.appendChild(button);
|
||||
|
||||
button.addEventListener('click', handleRotateNorth, false);
|
||||
button.addEventListener('touchstart', handleRotateNorth, false);
|
||||
super({
|
||||
element: element,
|
||||
target: options.target
|
||||
});
|
||||
|
||||
const element = document.createElement('div');
|
||||
element.className = 'rotate-north ol-unselectable ol-control';
|
||||
element.appendChild(button);
|
||||
button.addEventListener('click', this.handleRotateNorth.bind(this), false);
|
||||
}
|
||||
|
||||
Control.call(this, {
|
||||
element: element,
|
||||
target: options.target
|
||||
});
|
||||
handleRotateNorth() {
|
||||
this.getMap().getView().setRotation(0);
|
||||
}
|
||||
|
||||
};
|
||||
inherits(app.RotateNorthControl, Control);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
@@ -57,12 +48,8 @@ inherits(app.RotateNorthControl, Control);
|
||||
|
||||
|
||||
const map = new Map({
|
||||
controls: defaultControls({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
}
|
||||
}).extend([
|
||||
new app.RotateNorthControl()
|
||||
controls: defaultControls().extend([
|
||||
new RotateNorthControl()
|
||||
]),
|
||||
layers: [
|
||||
new TileLayer({
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import {inherits} from '../src/ol/util.js';
|
||||
import Feature from '../src/ol/Feature.js';
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
@@ -9,58 +8,51 @@ import {TileJSON, Vector as VectorSource} from '../src/ol/source.js';
|
||||
import {Fill, Icon, Stroke, Style} from '../src/ol/style.js';
|
||||
|
||||
|
||||
/**
|
||||
* Define a namespace for the application.
|
||||
*/
|
||||
const app = {};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {module:ol/interaction/Pointer}
|
||||
*/
|
||||
app.Drag = function() {
|
||||
class Drag extends PointerInteraction {
|
||||
constructor() {
|
||||
super({
|
||||
handleDownEvent: handleDownEvent,
|
||||
handleDragEvent: handleDragEvent,
|
||||
handleMoveEvent: handleMoveEvent,
|
||||
handleUpEvent: handleUpEvent
|
||||
});
|
||||
|
||||
PointerInteraction.call(this, {
|
||||
handleDownEvent: app.Drag.prototype.handleDownEvent,
|
||||
handleDragEvent: app.Drag.prototype.handleDragEvent,
|
||||
handleMoveEvent: app.Drag.prototype.handleMoveEvent,
|
||||
handleUpEvent: app.Drag.prototype.handleUpEvent
|
||||
});
|
||||
/**
|
||||
* @type {module:ol/pixel~Pixel}
|
||||
* @private
|
||||
*/
|
||||
this.coordinate_ = null;
|
||||
|
||||
/**
|
||||
* @type {module:ol/pixel~Pixel}
|
||||
* @private
|
||||
*/
|
||||
this.coordinate_ = null;
|
||||
/**
|
||||
* @type {string|undefined}
|
||||
* @private
|
||||
*/
|
||||
this.cursor_ = 'pointer';
|
||||
|
||||
/**
|
||||
* @type {string|undefined}
|
||||
* @private
|
||||
*/
|
||||
this.cursor_ = 'pointer';
|
||||
/**
|
||||
* @type {module:ol/Feature~Feature}
|
||||
* @private
|
||||
*/
|
||||
this.feature_ = null;
|
||||
|
||||
/**
|
||||
* @type {module:ol/Feature~Feature}
|
||||
* @private
|
||||
*/
|
||||
this.feature_ = null;
|
||||
|
||||
/**
|
||||
* @type {string|undefined}
|
||||
* @private
|
||||
*/
|
||||
this.previousCursor_ = undefined;
|
||||
|
||||
};
|
||||
inherits(app.Drag, PointerInteraction);
|
||||
/**
|
||||
* @type {string|undefined}
|
||||
* @private
|
||||
*/
|
||||
this.previousCursor_ = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/MapBrowserEvent~MapBrowserEvent} evt Map browser event.
|
||||
* @return {boolean} `true` to start the drag sequence.
|
||||
*/
|
||||
app.Drag.prototype.handleDownEvent = function(evt) {
|
||||
function handleDownEvent(evt) {
|
||||
const map = evt.map;
|
||||
|
||||
const feature = map.forEachFeatureAtPixel(evt.pixel,
|
||||
@@ -74,13 +66,13 @@ app.Drag.prototype.handleDownEvent = function(evt) {
|
||||
}
|
||||
|
||||
return !!feature;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/MapBrowserEvent~MapBrowserEvent} evt Map browser event.
|
||||
*/
|
||||
app.Drag.prototype.handleDragEvent = function(evt) {
|
||||
function handleDragEvent(evt) {
|
||||
const deltaX = evt.coordinate[0] - this.coordinate_[0];
|
||||
const deltaY = evt.coordinate[1] - this.coordinate_[1];
|
||||
|
||||
@@ -89,13 +81,13 @@ app.Drag.prototype.handleDragEvent = function(evt) {
|
||||
|
||||
this.coordinate_[0] = evt.coordinate[0];
|
||||
this.coordinate_[1] = evt.coordinate[1];
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/MapBrowserEvent~MapBrowserEvent} evt Event.
|
||||
*/
|
||||
app.Drag.prototype.handleMoveEvent = function(evt) {
|
||||
function handleMoveEvent(evt) {
|
||||
if (this.cursor_) {
|
||||
const map = evt.map;
|
||||
const feature = map.forEachFeatureAtPixel(evt.pixel,
|
||||
@@ -113,17 +105,17 @@ app.Drag.prototype.handleMoveEvent = function(evt) {
|
||||
this.previousCursor_ = undefined;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return {boolean} `false` to stop the drag sequence.
|
||||
*/
|
||||
app.Drag.prototype.handleUpEvent = function() {
|
||||
function handleUpEvent() {
|
||||
this.coordinate_ = null;
|
||||
this.feature_ = null;
|
||||
return false;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
const pointFeature = new Feature(new Point([0, 0]));
|
||||
@@ -137,7 +129,7 @@ const polygonFeature = new Feature(
|
||||
|
||||
|
||||
const map = new Map({
|
||||
interactions: defaultInteractions().extend([new app.Drag()]),
|
||||
interactions: defaultInteractions().extend([new Drag()]),
|
||||
layers: [
|
||||
new TileLayer({
|
||||
source: new TileJSON({
|
||||
|
||||
@@ -8,7 +8,7 @@ docs: >
|
||||
normalize the events from the browser.
|
||||
tags: "device, orientation, gyronorm"
|
||||
resources:
|
||||
- https://cdn.rawgit.com/dorukeker/gyronorm.js/v2.0.6/dist/gyronorm.complete.min.js
|
||||
- https://unpkg.com/gyronorm@2.0.6/dist/gyronorm.complete.min.js
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
<p>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import {defaults as defaultControls} from '../src/ol/control.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import {toRadians} from '../src/ol/math.js';
|
||||
import OSM from '../src/ol/source/OSM.js';
|
||||
@@ -16,11 +15,6 @@ const map = new Map({
|
||||
})
|
||||
],
|
||||
target: 'map',
|
||||
controls: defaultControls({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
}
|
||||
}),
|
||||
view: view
|
||||
});
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ layout: example.html
|
||||
title: Drag-and-Drop Image Vector
|
||||
shortdesc: Example of using the drag-and-drop interaction with image vector rendering.
|
||||
docs: >
|
||||
Example of using the drag-and-drop interaction with an `ol/layer/Vector` with `renderMode: 'image'``. Drag and drop GPX, GeoJSON, IGC, KML, or TopoJSON files on to the map. Each file is rendered to an image on the client.
|
||||
Example of using the drag-and-drop interaction with an `ol/layer/Vector` with `renderMode: 'image'`. Drag and drop GPX, GeoJSON, IGC, KML, or TopoJSON files on to the map. Each file is rendered to an image on the client.
|
||||
tags: "drag-and-drop-image-vector, gpx, geojson, igc, kml, topojson, vector, image"
|
||||
cloak:
|
||||
- key: As1HiMj1PvLPlqc_gtM7AqZfBL8ZL3VrjaS3zIb22Uvb9WKhuJObROC-qUpa81U5
|
||||
|
||||
@@ -4,74 +4,6 @@ import {GPX, GeoJSON, IGC, KML, TopoJSON} from '../src/ol/format.js';
|
||||
import {defaults as defaultInteractions, DragAndDrop} from '../src/ol/interaction.js';
|
||||
import {Vector as VectorLayer, Tile as TileLayer} from '../src/ol/layer.js';
|
||||
import {BingMaps, Vector as VectorSource} from '../src/ol/source.js';
|
||||
import {Circle as CircleStyle, Fill, Stroke, Style} from '../src/ol/style.js';
|
||||
|
||||
|
||||
const defaultStyle = {
|
||||
'Point': new Style({
|
||||
image: new CircleStyle({
|
||||
fill: new Fill({
|
||||
color: 'rgba(255,255,0,0.5)'
|
||||
}),
|
||||
radius: 5,
|
||||
stroke: new Stroke({
|
||||
color: '#ff0',
|
||||
width: 1
|
||||
})
|
||||
})
|
||||
}),
|
||||
'LineString': new Style({
|
||||
stroke: new Stroke({
|
||||
color: '#f00',
|
||||
width: 3
|
||||
})
|
||||
}),
|
||||
'Polygon': new Style({
|
||||
fill: new Fill({
|
||||
color: 'rgba(0,255,255,0.5)'
|
||||
}),
|
||||
stroke: new Stroke({
|
||||
color: '#0ff',
|
||||
width: 1
|
||||
})
|
||||
}),
|
||||
'MultiPoint': new Style({
|
||||
image: new CircleStyle({
|
||||
fill: new Fill({
|
||||
color: 'rgba(255,0,255,0.5)'
|
||||
}),
|
||||
radius: 5,
|
||||
stroke: new Stroke({
|
||||
color: '#f0f',
|
||||
width: 1
|
||||
})
|
||||
})
|
||||
}),
|
||||
'MultiLineString': new Style({
|
||||
stroke: new Stroke({
|
||||
color: '#0f0',
|
||||
width: 3
|
||||
})
|
||||
}),
|
||||
'MultiPolygon': new Style({
|
||||
fill: new Fill({
|
||||
color: 'rgba(0,0,255,0.5)'
|
||||
}),
|
||||
stroke: new Stroke({
|
||||
color: '#00f',
|
||||
width: 1
|
||||
})
|
||||
})
|
||||
};
|
||||
|
||||
const styleFunction = function(feature, resolution) {
|
||||
const featureStyleFunction = feature.getStyleFunction();
|
||||
if (featureStyleFunction) {
|
||||
return featureStyleFunction.call(feature, resolution);
|
||||
} else {
|
||||
return defaultStyle[feature.getGeometry().getType()];
|
||||
}
|
||||
};
|
||||
|
||||
const dragAndDropInteraction = new DragAndDrop({
|
||||
formatConstructors: [
|
||||
@@ -106,8 +38,7 @@ dragAndDropInteraction.on('addfeatures', function(event) {
|
||||
});
|
||||
map.addLayer(new VectorLayer({
|
||||
renderMode: 'image',
|
||||
source: vectorSource,
|
||||
style: styleFunction
|
||||
source: vectorSource
|
||||
}));
|
||||
map.getView().fit(vectorSource.getExtent());
|
||||
});
|
||||
|
||||
@@ -4,74 +4,6 @@ import {GPX, GeoJSON, IGC, KML, TopoJSON} from '../src/ol/format.js';
|
||||
import {defaults as defaultInteractions, DragAndDrop} from '../src/ol/interaction.js';
|
||||
import {Tile as TileLayer, Vector as VectorLayer} from '../src/ol/layer.js';
|
||||
import {BingMaps, Vector as VectorSource} from '../src/ol/source.js';
|
||||
import {Circle as CircleStyle, Fill, Stroke, Style} from '../src/ol/style.js';
|
||||
|
||||
|
||||
const defaultStyle = {
|
||||
'Point': new Style({
|
||||
image: new CircleStyle({
|
||||
fill: new Fill({
|
||||
color: 'rgba(255,255,0,0.5)'
|
||||
}),
|
||||
radius: 5,
|
||||
stroke: new Stroke({
|
||||
color: '#ff0',
|
||||
width: 1
|
||||
})
|
||||
})
|
||||
}),
|
||||
'LineString': new Style({
|
||||
stroke: new Stroke({
|
||||
color: '#f00',
|
||||
width: 3
|
||||
})
|
||||
}),
|
||||
'Polygon': new Style({
|
||||
fill: new Fill({
|
||||
color: 'rgba(0,255,255,0.5)'
|
||||
}),
|
||||
stroke: new Stroke({
|
||||
color: '#0ff',
|
||||
width: 1
|
||||
})
|
||||
}),
|
||||
'MultiPoint': new Style({
|
||||
image: new CircleStyle({
|
||||
fill: new Fill({
|
||||
color: 'rgba(255,0,255,0.5)'
|
||||
}),
|
||||
radius: 5,
|
||||
stroke: new Stroke({
|
||||
color: '#f0f',
|
||||
width: 1
|
||||
})
|
||||
})
|
||||
}),
|
||||
'MultiLineString': new Style({
|
||||
stroke: new Stroke({
|
||||
color: '#0f0',
|
||||
width: 3
|
||||
})
|
||||
}),
|
||||
'MultiPolygon': new Style({
|
||||
fill: new Fill({
|
||||
color: 'rgba(0,0,255,0.5)'
|
||||
}),
|
||||
stroke: new Stroke({
|
||||
color: '#00f',
|
||||
width: 1
|
||||
})
|
||||
})
|
||||
};
|
||||
|
||||
const styleFunction = function(feature, resolution) {
|
||||
const featureStyleFunction = feature.getStyleFunction();
|
||||
if (featureStyleFunction) {
|
||||
return featureStyleFunction.call(feature, resolution);
|
||||
} else {
|
||||
return defaultStyle[feature.getGeometry().getType()];
|
||||
}
|
||||
};
|
||||
|
||||
const dragAndDropInteraction = new DragAndDrop({
|
||||
formatConstructors: [
|
||||
@@ -105,8 +37,7 @@ dragAndDropInteraction.on('addfeatures', function(event) {
|
||||
features: event.features
|
||||
});
|
||||
map.addLayer(new VectorLayer({
|
||||
source: vectorSource,
|
||||
style: styleFunction
|
||||
source: vectorSource
|
||||
}));
|
||||
map.getView().fit(vectorSource.getExtent());
|
||||
});
|
||||
|
||||
@@ -17,6 +17,7 @@ tags: "draw, edit, freehand, vector"
|
||||
<form class="form-inline">
|
||||
<label>Shape type </label>
|
||||
<select id="type">
|
||||
<option value="Circle">Circle</option>
|
||||
<option value="Square">Square</option>
|
||||
<option value="Box">Box</option>
|
||||
<option value="Star">Star</option>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import {defaults as defaultControls} from '../src/ol/control.js';
|
||||
import GeoJSON from '../src/ol/format/GeoJSON.js';
|
||||
import {Tile as TileLayer, Vector as VectorLayer} from '../src/ol/layer.js';
|
||||
import {OSM, Vector as VectorSource} from '../src/ol/source.js';
|
||||
@@ -18,11 +17,6 @@ const map = new Map({
|
||||
})
|
||||
],
|
||||
target: 'map',
|
||||
controls: defaultControls({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
}
|
||||
}),
|
||||
view: new View({
|
||||
center: [0, 0],
|
||||
zoom: 2
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import {defaults as defaultControls} from '../src/ol/control.js';
|
||||
import WKT from '../src/ol/format/WKT.js';
|
||||
import {Tile as TileLayer, Vector as VectorLayer} from '../src/ol/layer.js';
|
||||
import {OSM, Vector as VectorSource} from '../src/ol/source.js';
|
||||
@@ -26,11 +25,6 @@ const vector = new VectorLayer({
|
||||
const map = new Map({
|
||||
layers: [raster, vector],
|
||||
target: 'map',
|
||||
controls: defaultControls({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
}
|
||||
}),
|
||||
view: new View({
|
||||
center: [0, 0],
|
||||
zoom: 2
|
||||
|
||||
@@ -2,7 +2,6 @@ import Feature from '../src/ol/Feature.js';
|
||||
import Map from '../src/ol/Map.js';
|
||||
import {unByKey} from '../src/ol/Observable.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import {defaults as defaultControls} from '../src/ol/control.js';
|
||||
import {easeOut} from '../src/ol/easing.js';
|
||||
import Point from '../src/ol/geom/Point.js';
|
||||
import {Tile as TileLayer, Vector as VectorLayer} from '../src/ol/layer.js';
|
||||
@@ -19,11 +18,6 @@ const map = new Map({
|
||||
})
|
||||
})
|
||||
],
|
||||
controls: defaultControls({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
}
|
||||
}),
|
||||
target: 'map',
|
||||
view: new View({
|
||||
center: [0, 0],
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import Feature from '../src/ol/Feature.js';
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import {defaults as defaultControls} from '../src/ol/control.js';
|
||||
import GeoJSON from '../src/ol/format/GeoJSON.js';
|
||||
import Circle from '../src/ol/geom/Circle.js';
|
||||
import {Tile as TileLayer, Vector as VectorLayer} from '../src/ol/layer.js';
|
||||
@@ -174,11 +173,6 @@ const map = new Map({
|
||||
vectorLayer
|
||||
],
|
||||
target: 'map',
|
||||
controls: defaultControls({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
}
|
||||
}),
|
||||
view: new View({
|
||||
center: [0, 0],
|
||||
zoom: 2
|
||||
|
||||
@@ -2,7 +2,6 @@ import Geolocation from '../src/ol/Geolocation.js';
|
||||
import Map from '../src/ol/Map.js';
|
||||
import Overlay from '../src/ol/Overlay.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import {defaults as defaultControls} from '../src/ol/control.js';
|
||||
import LineString from '../src/ol/geom/LineString.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import {fromLonLat} from '../src/ol/proj.js';
|
||||
@@ -22,11 +21,6 @@ const map = new Map({
|
||||
})
|
||||
],
|
||||
target: 'map',
|
||||
controls: defaultControls({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
}
|
||||
}),
|
||||
view: view
|
||||
});
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ import Feature from '../src/ol/Feature.js';
|
||||
import Geolocation from '../src/ol/Geolocation.js';
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import {defaults as defaultControls} from '../src/ol/control.js';
|
||||
import Point from '../src/ol/geom/Point.js';
|
||||
import {Tile as TileLayer, Vector as VectorLayer} from '../src/ol/layer.js';
|
||||
import {OSM, Vector as VectorSource} from '../src/ol/source.js';
|
||||
@@ -20,11 +19,6 @@ const map = new Map({
|
||||
})
|
||||
],
|
||||
target: 'map',
|
||||
controls: defaultControls({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
}
|
||||
}),
|
||||
view: view
|
||||
});
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import Feature from '../src/ol/Feature.js';
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import {defaults as defaultControls} from '../src/ol/control.js';
|
||||
import IGC from '../src/ol/format/IGC.js';
|
||||
import {LineString, Point} from '../src/ol/geom.js';
|
||||
import {Tile as TileLayer, Vector as VectorLayer} from '../src/ol/layer.js';
|
||||
@@ -93,11 +92,6 @@ const map = new Map({
|
||||
})
|
||||
],
|
||||
target: 'map',
|
||||
controls: defaultControls({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
}
|
||||
}),
|
||||
view: new View({
|
||||
center: [703365.7089403362, 5714629.865071137],
|
||||
zoom: 9
|
||||
|
||||
@@ -7,6 +7,6 @@ docs: >
|
||||
with OpenLayers.
|
||||
tags: "vector, jsts, buffer"
|
||||
resources:
|
||||
- https://cdn.rawgit.com/bjornharrtell/jsts/gh-pages/1.6.0/jsts.min.js
|
||||
- https://unpkg.com/jsts@2.0.2/dist/jsts.min.js
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import Map from '../src/ol/WebGLMap.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import {defaults as defaultControls} from '../src/ol/control.js';
|
||||
import {WEBGL} from '../src/ol/has.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import OSM from '../src/ol/source/OSM.js';
|
||||
@@ -20,11 +19,6 @@ if (!WEBGL) {
|
||||
const map = new Map({
|
||||
layers: [osm],
|
||||
target: 'map',
|
||||
controls: defaultControls({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
}
|
||||
}),
|
||||
view: new View({
|
||||
center: [0, 0],
|
||||
zoom: 2
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import {defaults as defaultControls} from '../src/ol/control.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import OSM from '../src/ol/source/OSM.js';
|
||||
|
||||
@@ -11,11 +10,6 @@ const osm = new TileLayer({
|
||||
const map = new Map({
|
||||
layers: [osm],
|
||||
target: 'map',
|
||||
controls: defaultControls({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
}
|
||||
}),
|
||||
view: new View({
|
||||
center: [0, 0],
|
||||
zoom: 2
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import {defaults as defaultControls} from '../src/ol/control.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import BingMaps from '../src/ol/source/BingMaps.js';
|
||||
import OSM from '../src/ol/source/OSM.js';
|
||||
@@ -18,11 +17,6 @@ const bing = new TileLayer({
|
||||
const map = new Map({
|
||||
layers: [osm, bing],
|
||||
target: 'map',
|
||||
controls: defaultControls({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
}
|
||||
}),
|
||||
view: new View({
|
||||
center: [0, 0],
|
||||
zoom: 2
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import {defaults as defaultControls} from '../src/ol/control.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import OSM, {ATTRIBUTION} from '../src/ol/source/OSM.js';
|
||||
|
||||
@@ -34,11 +33,6 @@ const map = new Map({
|
||||
openSeaMapLayer
|
||||
],
|
||||
target: 'map',
|
||||
controls: defaultControls({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
}
|
||||
}),
|
||||
view: new View({
|
||||
maxZoom: 18,
|
||||
center: [-244780.24508882355, 5986452.183179816],
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import {defaults as defaultControls} from '../src/ol/control.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import OSM from '../src/ol/source/OSM.js';
|
||||
import TileJSON from '../src/ol/source/TileJSON.js';
|
||||
@@ -26,11 +25,6 @@ const map = new Map({
|
||||
})
|
||||
],
|
||||
target: 'map',
|
||||
controls: defaultControls({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
}
|
||||
}),
|
||||
view: new View({
|
||||
center: [653600, 5723680],
|
||||
zoom: 5
|
||||
|
||||
@@ -17,11 +17,7 @@ const mousePositionControl = new MousePosition({
|
||||
});
|
||||
|
||||
const map = new Map({
|
||||
controls: defaultControls({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
}
|
||||
}).extend([mousePositionControl]),
|
||||
controls: defaultControls().extend([mousePositionControl]),
|
||||
layers: [
|
||||
new TileLayer({
|
||||
source: new OSM()
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import {defaults as defaultControls} from '../src/ol/control.js';
|
||||
import {getBottomLeft, getTopRight} from '../src/ol/extent.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import {toLonLat} from '../src/ol/proj.js';
|
||||
@@ -14,11 +13,6 @@ const map = new Map({
|
||||
})
|
||||
],
|
||||
target: 'map',
|
||||
controls: defaultControls({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
}
|
||||
}),
|
||||
view: new View({
|
||||
center: [0, 0],
|
||||
zoom: 2
|
||||
|
||||
@@ -6,11 +6,7 @@ import OSM from '../src/ol/source/OSM.js';
|
||||
|
||||
|
||||
const map = new Map({
|
||||
controls: defaultControls({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
}
|
||||
}).extend([
|
||||
controls: defaultControls().extend([
|
||||
new ZoomToExtent({
|
||||
extent: [
|
||||
813079.7791264898, 5929220.284081122,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import {defaults as defaultControls} from '../src/ol/control.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import OSM from '../src/ol/source/OSM.js';
|
||||
|
||||
@@ -29,11 +28,6 @@ const map = new Map({
|
||||
source: new OSM()
|
||||
})
|
||||
],
|
||||
controls: defaultControls({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
}
|
||||
}),
|
||||
target: 'map',
|
||||
view: new View({
|
||||
center: center,
|
||||
|
||||
@@ -15,8 +15,9 @@ function createMapboxStreetsV6Style(Style, Fill, Stroke, Icon, Text) {
|
||||
var icon = iconCache[iconName];
|
||||
if (!icon) {
|
||||
icon = new Style({image: new Icon({
|
||||
src: 'https://cdn.rawgit.com/mapbox/maki/master/icons/' + iconName + '-15.svg',
|
||||
imgSize: [15, 15]
|
||||
src: 'https://unpkg.com/@mapbox/maki@4.0.0/icons/' + iconName + '-15.svg',
|
||||
imgSize: [15, 15],
|
||||
crossOrigin: 'anonymous'
|
||||
})});
|
||||
iconCache[iconName] = icon;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import {defaults as defaultControls} from '../src/ol/control.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import OSM from '../src/ol/source/OSM.js';
|
||||
|
||||
@@ -12,11 +11,6 @@ const map = new Map({
|
||||
})
|
||||
],
|
||||
target: 'map',
|
||||
controls: defaultControls({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
}
|
||||
}),
|
||||
view: new View({
|
||||
center: [14200000, 4130000],
|
||||
rotation: Math.PI / 6,
|
||||
|
||||
@@ -8,11 +8,7 @@ import OSM from '../src/ol/source/OSM.js';
|
||||
const scaleLineControl = new ScaleLine();
|
||||
|
||||
const map = new Map({
|
||||
controls: defaultControls({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
}
|
||||
}).extend([
|
||||
controls: defaultControls().extend([
|
||||
scaleLineControl
|
||||
]),
|
||||
layers: [
|
||||
|
||||
@@ -53,7 +53,9 @@ const ExampleModify = {
|
||||
const selectedFeatures = this.select.getFeatures();
|
||||
|
||||
this.select.on('change:active', function() {
|
||||
selectedFeatures.forEach(selectedFeatures.remove, selectedFeatures);
|
||||
selectedFeatures.forEach(function(each) {
|
||||
selectedFeatures.remove(each);
|
||||
});
|
||||
});
|
||||
},
|
||||
setActive: function(active) {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import {defaults as defaultControls} from '../src/ol/control.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import OSM from '../src/ol/source/OSM.js';
|
||||
|
||||
@@ -11,11 +10,6 @@ const map = new Map({
|
||||
source: new OSM()
|
||||
})
|
||||
],
|
||||
controls: defaultControls({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
}
|
||||
}),
|
||||
view: new View({
|
||||
center: [0, 0],
|
||||
zoom: 2
|
||||
|
||||
@@ -7,7 +7,7 @@ docs: >
|
||||
with OpenLayers, enabling creating and editing topological geometry. Standard interaction draws edges, snapping to existing edges. Delete an edge by drawing a new edge crossing the one to delete.
|
||||
tags: "draw, edit, vector, topology, topolis"
|
||||
resources:
|
||||
- https://cdn.rawgit.com/bjornharrtell/topolis/releases/0.1.1/topolis.min.js
|
||||
- https://unpkg.com/topolis@0.2.5/dist/topolis.js
|
||||
- https://code.jquery.com/jquery-3.1.1.min.js
|
||||
- https://cdnjs.cloudflare.com/ajax/libs/toastr.js/2.1.3/toastr.min.js
|
||||
- https://cdnjs.cloudflare.com/ajax/libs/toastr.js/2.1.3/toastr.min.css
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import {defaults as defaultControls} from '../src/ol/control.js';
|
||||
import OSMXML from '../src/ol/format/OSMXML.js';
|
||||
import {Tile as TileLayer, Vector as VectorLayer} from '../src/ol/layer.js';
|
||||
import {bbox as bboxStrategy} from '../src/ol/loadingstrategy.js';
|
||||
@@ -121,11 +120,6 @@ const raster = new TileLayer({
|
||||
map = new Map({
|
||||
layers: [raster, vector],
|
||||
target: document.getElementById('map'),
|
||||
controls: defaultControls({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
}
|
||||
}),
|
||||
view: new View({
|
||||
center: [739218, 5906096],
|
||||
maxZoom: 19,
|
||||
|
||||
@@ -35,11 +35,8 @@ module.exports = {
|
||||
minimizer: [
|
||||
new UglifyJsPlugin({
|
||||
sourceMap: true,
|
||||
uglifyOptions: {
|
||||
mangle: {
|
||||
keep_fnames: true
|
||||
}
|
||||
}
|
||||
// Do not minify examples that inject code into workers
|
||||
exclude: [/(color-manipulation|region-growing|raster)\.js/]
|
||||
})
|
||||
],
|
||||
runtimeChunk: {
|
||||
|
||||
@@ -77,7 +77,7 @@ function getJsSource(chunk, jsName) {
|
||||
return jsSource;
|
||||
}
|
||||
}
|
||||
if (module.identifier.endsWith(jsName)) {
|
||||
if (module.identifier.endsWith(jsName) && module.source) {
|
||||
return module.source;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import {defaults as defaultControls} from '../src/ol/control.js';
|
||||
import {getWidth} from '../src/ol/extent.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import {fromLonLat, get as getProjection} from '../src/ol/proj.js';
|
||||
@@ -10,11 +9,6 @@ import WMTSTileGrid from '../src/ol/tilegrid/WMTS.js';
|
||||
|
||||
const map = new Map({
|
||||
target: 'map',
|
||||
controls: defaultControls({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
}
|
||||
}),
|
||||
view: new View({
|
||||
zoom: 5,
|
||||
center: fromLonLat([5, 45])
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import Map from '../src/ol/Map.js';
|
||||
import View from '../src/ol/View.js';
|
||||
import {defaults as defaultControls} from '../src/ol/control.js';
|
||||
import {getWidth, getTopLeft} from '../src/ol/extent.js';
|
||||
import TileLayer from '../src/ol/layer/Tile.js';
|
||||
import {get as getProjection} from '../src/ol/proj.js';
|
||||
@@ -48,11 +47,6 @@ const map = new Map({
|
||||
})
|
||||
],
|
||||
target: 'map',
|
||||
controls: defaultControls({
|
||||
attributionOptions: {
|
||||
collapsible: false
|
||||
}
|
||||
}),
|
||||
view: new View({
|
||||
center: [-11158582, 4813697],
|
||||
zoom: 4
|
||||
|
||||
55
package.json
55
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ol",
|
||||
"version": "5.2.0",
|
||||
"version": "5.3.3",
|
||||
"description": "OpenLayers mapping library",
|
||||
"keywords": [
|
||||
"map",
|
||||
@@ -12,15 +12,16 @@
|
||||
"scripts": {
|
||||
"lint": "eslint tasks test src/ol examples config",
|
||||
"pretest": "npm run lint",
|
||||
"test": "npm run karma -- --single-run",
|
||||
"test": "npm run karma -- --single-run --log-level error",
|
||||
"karma": "karma start test/karma.config.js",
|
||||
"serve-examples": "webpack-dev-server --config examples/webpack/config.js --mode development --watch",
|
||||
"build-examples": "webpack --config examples/webpack/config.js --mode production",
|
||||
"build-package": "npm run transpile && npm run copy-css && node tasks/prepare-package && cp README.md build/ol",
|
||||
"build-index": "npm run build-package && node tasks/generate-index",
|
||||
"build-legacy": "rm -rf build && npm run build-index && rollup --config config/rollup.js && cleancss --source-map src/ol/ol.css -o build/ol.css",
|
||||
"build-legacy": "rm -rf build && npm run build-index && webpack --config config/webpack-config-legacy-build.js && cleancss --source-map src/ol/ol.css -o build/legacy/ol.css",
|
||||
"copy-css": "cp src/ol/ol.css build/ol/ol.css",
|
||||
"transpile": "rm -rf build/ol && mkdir -p build && buble --input src/ol --output build/ol --no modules --sourcemap",
|
||||
"typecheck": "tsc --pretty",
|
||||
"apidoc": "jsdoc config/jsdoc/api/index.md -c config/jsdoc/api/conf.json -P package.json -d build/apidoc"
|
||||
},
|
||||
"main": "index.js",
|
||||
@@ -38,53 +39,67 @@
|
||||
"rbush": "2.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@openlayers/eslint-plugin": "^4.0.0-beta.1",
|
||||
"@types/arcgis-rest-api": "^10.4.3",
|
||||
"@types/geojson": "^7946.0.4",
|
||||
"@types/rbush": "^2.0.2",
|
||||
"@types/topojson-specification": "^1.0.0",
|
||||
"buble": "^0.19.3",
|
||||
"buble-loader": "^0.5.1",
|
||||
"chaikin-smooth": "^1.0.4",
|
||||
"clean-css-cli": "4.2.1",
|
||||
"copy-webpack-plugin": "^4.4.1",
|
||||
"coveralls": "3.0.1",
|
||||
"eslint": "5.0.1",
|
||||
"eslint": "^5.8.0",
|
||||
"eslint-config-openlayers": "^11.0.0",
|
||||
"expect.js": "0.3.1",
|
||||
"front-matter": "^2.1.2",
|
||||
"front-matter": "^3.0.0",
|
||||
"fs-extra": "^7.0.0",
|
||||
"glob": "^7.1.2",
|
||||
"handlebars": "4.0.11",
|
||||
"istanbul": "0.4.5",
|
||||
"jquery": "3.3.1",
|
||||
"jsdoc": "3.5.5",
|
||||
"karma": "^3.0.0",
|
||||
"jsdoc-plugin-typescript": "^1.0.2",
|
||||
"karma": "^3.1.1",
|
||||
"karma-chrome-launcher": "2.2.0",
|
||||
"karma-coverage": "^1.1.1",
|
||||
"karma-coverage": "^1.1.2",
|
||||
"karma-firefox-launcher": "^1.1.0",
|
||||
"karma-mocha": "1.3.0",
|
||||
"karma-sauce-launcher": "1.2.0",
|
||||
"karma-sourcemap-loader": "^0.3.7",
|
||||
"karma-webpack": "4.0.0-beta.0",
|
||||
"marked": "0.5.0",
|
||||
"karma-webpack": "^4.0.0-rc.2",
|
||||
"marked": "0.5.1",
|
||||
"mocha": "5.2.0",
|
||||
"mustache": "^2.3.0",
|
||||
"mustache": "^3.0.0",
|
||||
"pixelmatch": "^4.0.2",
|
||||
"proj4": "2.5.0",
|
||||
"rollup": "0.65.0",
|
||||
"rollup-plugin-buble": "0.19.2",
|
||||
"rollup-plugin-commonjs": "9.1.6",
|
||||
"rollup-plugin-node-resolve": "3.3.0",
|
||||
"rollup-plugin-sourcemaps": "0.4.2",
|
||||
"rollup-plugin-uglify": "4.0.0",
|
||||
"rollup": "0.66.6",
|
||||
"sinon": "^6.0.0",
|
||||
"uglifyjs-webpack-plugin": "^1.2.5",
|
||||
"typescript": "^3.1.0-dev.20180905",
|
||||
"uglifyjs-webpack-plugin": "^2.0.1",
|
||||
"url-polyfill": "^1.0.13",
|
||||
"walk": "^2.3.9",
|
||||
"webpack": "4.17.1",
|
||||
"webpack": "4.25.1",
|
||||
"webpack-cli": "^3.0.8",
|
||||
"webpack-dev-server": "^3.1.4"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": "openlayers"
|
||||
"extends": "openlayers",
|
||||
"plugins": [
|
||||
"@openlayers"
|
||||
],
|
||||
"rules": {
|
||||
"valid-jsdoc": "off",
|
||||
"@openlayers/valid-tsdoc": [
|
||||
"error",
|
||||
{
|
||||
"requireReturn": false
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"sideEffects": [
|
||||
"proj.js",
|
||||
"ol.css"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ class AssertionError extends Error {
|
||||
* @param {number} code Error code.
|
||||
*/
|
||||
constructor(code) {
|
||||
const path = VERSION.split('-')[0];
|
||||
const path = VERSION === 'latest' ? VERSION : 'v' + VERSION.split('-')[0];
|
||||
const message = 'Assertion failed. See https://openlayers.org/en/' + path +
|
||||
'/doc/errors/#' + code + ' for details.';
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ const Property = {
|
||||
export class CollectionEvent extends Event {
|
||||
|
||||
/**
|
||||
* @param {module:ol/CollectionEventType} type Type.
|
||||
* @param {CollectionEventType} type Type.
|
||||
* @param {*=} opt_element Element.
|
||||
*/
|
||||
constructor(type, opt_element) {
|
||||
@@ -56,6 +56,8 @@ export class CollectionEvent extends Event {
|
||||
* Collection; they trigger events on the appropriate object, not on the
|
||||
* Collection as a whole.
|
||||
*
|
||||
* @fires CollectionEvent
|
||||
*
|
||||
* @template T
|
||||
* @api
|
||||
*/
|
||||
@@ -63,7 +65,7 @@ class Collection extends BaseObject {
|
||||
|
||||
/**
|
||||
* @param {Array<T>=} opt_array Array.
|
||||
* @param {module:ol/Collection~Options=} opt_options Collection options.
|
||||
* @param {Options=} opt_options Collection options.
|
||||
*/
|
||||
constructor(opt_array, opt_options) {
|
||||
|
||||
@@ -107,7 +109,7 @@ class Collection extends BaseObject {
|
||||
* Add elements to the collection. This pushes each item in the provided array
|
||||
* to the end of the collection.
|
||||
* @param {!Array<T>} arr Array.
|
||||
* @return {module:ol/Collection<T>} This collection.
|
||||
* @return {Collection<T>} This collection.
|
||||
* @api
|
||||
*/
|
||||
extend(arr) {
|
||||
@@ -160,7 +162,7 @@ class Collection extends BaseObject {
|
||||
* @api
|
||||
*/
|
||||
getLength() {
|
||||
return /** @type {number} */ (this.get(Property.LENGTH));
|
||||
return this.get(Property.LENGTH);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
export default {
|
||||
/**
|
||||
* Triggered when an item is added to the collection.
|
||||
* @event module:ol/Collection~CollectionEvent#add
|
||||
* @event module:ol/Collection.CollectionEvent#add
|
||||
* @api
|
||||
*/
|
||||
ADD: 'add',
|
||||
/**
|
||||
* Triggered when an item is removed from the collection.
|
||||
* @event module:ol/Collection~CollectionEvent#remove
|
||||
* @event module:ol/Collection.CollectionEvent#remove
|
||||
* @api
|
||||
*/
|
||||
REMOVE: 'remove'
|
||||
|
||||
@@ -5,8 +5,14 @@ import {assert} from './asserts.js';
|
||||
import {listen, unlisten, unlistenByKey} from './events.js';
|
||||
import EventType from './events/EventType.js';
|
||||
import BaseObject, {getChangeEventType} from './Object.js';
|
||||
import Geometry from './geom/Geometry.js';
|
||||
import Style from './style/Style.js';
|
||||
|
||||
/**
|
||||
* @typedef {typeof Feature|typeof import("./render/Feature.js").default} FeatureClass
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {Feature|import("./render/Feature.js").default} FeatureLike
|
||||
*/
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
@@ -54,7 +60,7 @@ import Style from './style/Style.js';
|
||||
*/
|
||||
class Feature extends BaseObject {
|
||||
/**
|
||||
* @param {module:ol/geom/Geometry|Object<string, *>=} opt_geometryOrProperties
|
||||
* @param {import("./geom/Geometry.js").default|Object<string, *>=} opt_geometryOrProperties
|
||||
* You may pass a Geometry object directly, or an object literal containing
|
||||
* properties. If you pass an object literal, you may include a Geometry
|
||||
* associated with a `geometry` key.
|
||||
@@ -78,19 +84,19 @@ class Feature extends BaseObject {
|
||||
/**
|
||||
* User provided style.
|
||||
* @private
|
||||
* @type {module:ol/style/Style|Array<module:ol/style/Style>|module:ol/style/Style~StyleFunction}
|
||||
* @type {import("./style/Style.js").StyleLike}
|
||||
*/
|
||||
this.style_ = null;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/style/Style~StyleFunction|undefined}
|
||||
* @type {import("./style/Style.js").StyleFunction|undefined}
|
||||
*/
|
||||
this.styleFunction_ = undefined;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {?module:ol/events~EventsKey}
|
||||
* @type {?import("./events.js").EventsKey}
|
||||
*/
|
||||
this.geometryChangeKey_ = null;
|
||||
|
||||
@@ -98,10 +104,9 @@ class Feature extends BaseObject {
|
||||
this, getChangeEventType(this.geometryName_),
|
||||
this.handleGeometryChanged_, this);
|
||||
|
||||
if (opt_geometryOrProperties !== undefined) {
|
||||
if (opt_geometryOrProperties instanceof Geometry ||
|
||||
!opt_geometryOrProperties) {
|
||||
const geometry = opt_geometryOrProperties;
|
||||
if (opt_geometryOrProperties) {
|
||||
if (typeof /** @type {?} */ (opt_geometryOrProperties).getSimplifiedGeometry === 'function') {
|
||||
const geometry = /** @type {import("./geom/Geometry.js").default} */ (opt_geometryOrProperties);
|
||||
this.setGeometry(geometry);
|
||||
} else {
|
||||
/** @type {Object<string, *>} */
|
||||
@@ -114,7 +119,7 @@ class Feature extends BaseObject {
|
||||
/**
|
||||
* Clone this feature. If the original feature has a geometry it
|
||||
* is also cloned. The feature id is not set in the clone.
|
||||
* @return {module:ol/Feature} The clone.
|
||||
* @return {Feature} The clone.
|
||||
* @api
|
||||
*/
|
||||
clone() {
|
||||
@@ -135,13 +140,13 @@ class Feature extends BaseObject {
|
||||
* Get the feature's default geometry. A feature may have any number of named
|
||||
* geometries. The "default" geometry (the one that is rendered by default) is
|
||||
* set when calling {@link module:ol/Feature~Feature#setGeometry}.
|
||||
* @return {module:ol/geom/Geometry|undefined} The default geometry for the feature.
|
||||
* @return {import("./geom/Geometry.js").default|undefined} The default geometry for the feature.
|
||||
* @api
|
||||
* @observable
|
||||
*/
|
||||
getGeometry() {
|
||||
return (
|
||||
/** @type {module:ol/geom/Geometry|undefined} */ (this.get(this.geometryName_))
|
||||
/** @type {import("./geom/Geometry.js").default|undefined} */ (this.get(this.geometryName_))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -170,7 +175,7 @@ class Feature extends BaseObject {
|
||||
/**
|
||||
* Get the feature's style. Will return what was provided to the
|
||||
* {@link module:ol/Feature~Feature#setStyle} method.
|
||||
* @return {module:ol/style/Style|Array<module:ol/style/Style>|module:ol/style/Style~StyleFunction} The feature style.
|
||||
* @return {import("./style/Style.js").StyleLike} The feature style.
|
||||
* @api
|
||||
*/
|
||||
getStyle() {
|
||||
@@ -179,7 +184,7 @@ class Feature extends BaseObject {
|
||||
|
||||
/**
|
||||
* Get the feature's style function.
|
||||
* @return {module:ol/style/Style~StyleFunction|undefined} Return a function
|
||||
* @return {import("./style/Style.js").StyleFunction|undefined} Return a function
|
||||
* representing the current style of this feature.
|
||||
* @api
|
||||
*/
|
||||
@@ -213,7 +218,7 @@ class Feature extends BaseObject {
|
||||
/**
|
||||
* Set the default geometry for the feature. This will update the property
|
||||
* with the name returned by {@link module:ol/Feature~Feature#getGeometryName}.
|
||||
* @param {module:ol/geom/Geometry|undefined} geometry The new geometry.
|
||||
* @param {import("./geom/Geometry.js").default|undefined} geometry The new geometry.
|
||||
* @api
|
||||
* @observable
|
||||
*/
|
||||
@@ -225,7 +230,7 @@ class Feature extends BaseObject {
|
||||
* Set the style for the feature. This can be a single style object, an array
|
||||
* of styles, or a function that takes a resolution and returns an array of
|
||||
* styles. If it is `null` the feature has no style (a `null` style).
|
||||
* @param {module:ol/style/Style|Array<module:ol/style/Style>|module:ol/style/Style~StyleFunction} style Style for this feature.
|
||||
* @param {import("./style/Style.js").StyleLike} style Style for this feature.
|
||||
* @api
|
||||
* @fires module:ol/events/Event~Event#event:change
|
||||
*/
|
||||
@@ -271,26 +276,27 @@ class Feature extends BaseObject {
|
||||
|
||||
/**
|
||||
* Convert the provided object into a feature style function. Functions passed
|
||||
* through unchanged. Arrays of module:ol/style/Style or single style objects wrapped
|
||||
* through unchanged. Arrays of Style or single style objects wrapped
|
||||
* in a new feature style function.
|
||||
* @param {module:ol/style/Style~StyleFunction|!Array<module:ol/style/Style>|!module:ol/style/Style} obj
|
||||
* @param {!import("./style/Style.js").StyleFunction|!Array<import("./style/Style.js").default>|!import("./style/Style.js").default} obj
|
||||
* A feature style function, a single style, or an array of styles.
|
||||
* @return {module:ol/style/Style~StyleFunction} A style function.
|
||||
* @return {import("./style/Style.js").StyleFunction} A style function.
|
||||
*/
|
||||
export function createStyleFunction(obj) {
|
||||
if (typeof obj === 'function') {
|
||||
return obj;
|
||||
} else {
|
||||
/**
|
||||
* @type {Array<module:ol/style/Style>}
|
||||
* @type {Array<import("./style/Style.js").default>}
|
||||
*/
|
||||
let styles;
|
||||
if (Array.isArray(obj)) {
|
||||
styles = obj;
|
||||
} else {
|
||||
assert(obj instanceof Style,
|
||||
41); // Expected an `module:ol/style/Style~Style` or an array of `module:ol/style/Style~Style`
|
||||
styles = [obj];
|
||||
assert(typeof /** @type {?} */ (obj).getZIndex === 'function',
|
||||
41); // Expected an `import("./style/Style.js").Style` or an array of `import("./style/Style.js").Style`
|
||||
const style = /** @type {import("./style/Style.js").default} */ (obj);
|
||||
styles = [style];
|
||||
}
|
||||
return function() {
|
||||
return styles;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/**
|
||||
* @module ol/Geolocation
|
||||
*/
|
||||
import GeolocationProperty from './GeolocationProperty.js';
|
||||
import BaseObject, {getChangeEventType} from './Object.js';
|
||||
import {listen} from './events.js';
|
||||
import Event from './events/Event.js';
|
||||
import EventType from './events/EventType.js';
|
||||
import {circular as circularPolygon} from './geom/Polygon.js';
|
||||
import {GEOLOCATION} from './has.js';
|
||||
@@ -11,13 +11,54 @@ import {toRadians} from './math.js';
|
||||
import {get as getProjection, getTransformFromProjections, identityTransform} from './proj.js';
|
||||
|
||||
|
||||
/**
|
||||
* @enum {string}
|
||||
*/
|
||||
const Property = {
|
||||
ACCURACY: 'accuracy',
|
||||
ACCURACY_GEOMETRY: 'accuracyGeometry',
|
||||
ALTITUDE: 'altitude',
|
||||
ALTITUDE_ACCURACY: 'altitudeAccuracy',
|
||||
HEADING: 'heading',
|
||||
POSITION: 'position',
|
||||
PROJECTION: 'projection',
|
||||
SPEED: 'speed',
|
||||
TRACKING: 'tracking',
|
||||
TRACKING_OPTIONS: 'trackingOptions'
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* Events emitted on Geolocation error.
|
||||
*/
|
||||
class GeolocationError extends Event {
|
||||
/**
|
||||
* @param {PositionError} error error object.
|
||||
*/
|
||||
constructor(error) {
|
||||
super(EventType.ERROR);
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
*/
|
||||
this.code = error.code;
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
this.message = error.message;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {Object} Options
|
||||
* @property {boolean} [tracking=false] Start Tracking right after
|
||||
* instantiation.
|
||||
* @property {PositionOptions} [trackingOptions] Tracking options.
|
||||
* See http://www.w3.org/TR/geolocation-API/#position_options_interface.
|
||||
* @property {module:ol/proj~ProjectionLike} [projection] The projection the position
|
||||
* @property {import("./proj.js").ProjectionLike} [projection] The projection the position
|
||||
* is reported in.
|
||||
*/
|
||||
|
||||
@@ -48,7 +89,7 @@ import {get as getProjection, getTransformFromProjections, identityTransform} fr
|
||||
class Geolocation extends BaseObject {
|
||||
|
||||
/**
|
||||
* @param {module:ol/Geolocation~Options=} opt_options Options.
|
||||
* @param {Options=} opt_options Options.
|
||||
*/
|
||||
constructor(opt_options) {
|
||||
|
||||
@@ -59,13 +100,13 @@ class Geolocation extends BaseObject {
|
||||
/**
|
||||
* The unprojected (EPSG:4326) device position.
|
||||
* @private
|
||||
* @type {module:ol/coordinate~Coordinate}
|
||||
* @type {import("./coordinate.js").Coordinate}
|
||||
*/
|
||||
this.position_ = null;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/proj~TransformFunction}
|
||||
* @type {import("./proj.js").TransformFunction}
|
||||
*/
|
||||
this.transform_ = identityTransform;
|
||||
|
||||
@@ -76,10 +117,10 @@ class Geolocation extends BaseObject {
|
||||
this.watchId_ = undefined;
|
||||
|
||||
listen(
|
||||
this, getChangeEventType(GeolocationProperty.PROJECTION),
|
||||
this, getChangeEventType(Property.PROJECTION),
|
||||
this.handleProjectionChanged_, this);
|
||||
listen(
|
||||
this, getChangeEventType(GeolocationProperty.TRACKING),
|
||||
this, getChangeEventType(Property.TRACKING),
|
||||
this.handleTrackingChanged_, this);
|
||||
|
||||
if (options.projection !== undefined) {
|
||||
@@ -110,7 +151,7 @@ class Geolocation extends BaseObject {
|
||||
this.transform_ = getTransformFromProjections(
|
||||
getProjection('EPSG:4326'), projection);
|
||||
if (this.position_) {
|
||||
this.set(GeolocationProperty.POSITION, this.transform_(this.position_));
|
||||
this.set(Property.POSITION, this.transform_(this.position_));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -139,13 +180,13 @@ class Geolocation extends BaseObject {
|
||||
*/
|
||||
positionChange_(position) {
|
||||
const coords = position.coords;
|
||||
this.set(GeolocationProperty.ACCURACY, coords.accuracy);
|
||||
this.set(GeolocationProperty.ALTITUDE,
|
||||
this.set(Property.ACCURACY, coords.accuracy);
|
||||
this.set(Property.ALTITUDE,
|
||||
coords.altitude === null ? undefined : coords.altitude);
|
||||
this.set(GeolocationProperty.ALTITUDE_ACCURACY,
|
||||
this.set(Property.ALTITUDE_ACCURACY,
|
||||
coords.altitudeAccuracy === null ?
|
||||
undefined : coords.altitudeAccuracy);
|
||||
this.set(GeolocationProperty.HEADING, coords.heading === null ?
|
||||
this.set(Property.HEADING, coords.heading === null ?
|
||||
undefined : toRadians(coords.heading));
|
||||
if (!this.position_) {
|
||||
this.position_ = [coords.longitude, coords.latitude];
|
||||
@@ -154,12 +195,12 @@ class Geolocation extends BaseObject {
|
||||
this.position_[1] = coords.latitude;
|
||||
}
|
||||
const projectedPosition = this.transform_(this.position_);
|
||||
this.set(GeolocationProperty.POSITION, projectedPosition);
|
||||
this.set(GeolocationProperty.SPEED,
|
||||
this.set(Property.POSITION, projectedPosition);
|
||||
this.set(Property.SPEED,
|
||||
coords.speed === null ? undefined : coords.speed);
|
||||
const geometry = circularPolygon(this.position_, coords.accuracy);
|
||||
geometry.applyTransform(this.transform_);
|
||||
this.set(GeolocationProperty.ACCURACY_GEOMETRY, geometry);
|
||||
this.set(Property.ACCURACY_GEOMETRY, geometry);
|
||||
this.changed();
|
||||
}
|
||||
|
||||
@@ -174,9 +215,8 @@ class Geolocation extends BaseObject {
|
||||
* @param {PositionError} error error object.
|
||||
*/
|
||||
positionError_(error) {
|
||||
error.type = EventType.ERROR;
|
||||
this.setTracking(false);
|
||||
this.dispatchEvent(/** @type {{type: string, target: undefined}} */ (error));
|
||||
this.dispatchEvent(new GeolocationError(error));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -187,18 +227,18 @@ class Geolocation extends BaseObject {
|
||||
* @api
|
||||
*/
|
||||
getAccuracy() {
|
||||
return /** @type {number|undefined} */ (this.get(GeolocationProperty.ACCURACY));
|
||||
return /** @type {number|undefined} */ (this.get(Property.ACCURACY));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a geometry of the position accuracy.
|
||||
* @return {?module:ol/geom/Polygon} A geometry of the position accuracy.
|
||||
* @return {?import("./geom/Polygon.js").default} A geometry of the position accuracy.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
getAccuracyGeometry() {
|
||||
return (
|
||||
/** @type {?module:ol/geom/Polygon} */ (this.get(GeolocationProperty.ACCURACY_GEOMETRY) || null)
|
||||
/** @type {?import("./geom/Polygon.js").default} */ (this.get(Property.ACCURACY_GEOMETRY) || null)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -210,7 +250,7 @@ class Geolocation extends BaseObject {
|
||||
* @api
|
||||
*/
|
||||
getAltitude() {
|
||||
return /** @type {number|undefined} */ (this.get(GeolocationProperty.ALTITUDE));
|
||||
return /** @type {number|undefined} */ (this.get(Property.ALTITUDE));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -221,7 +261,7 @@ class Geolocation extends BaseObject {
|
||||
* @api
|
||||
*/
|
||||
getAltitudeAccuracy() {
|
||||
return /** @type {number|undefined} */ (this.get(GeolocationProperty.ALTITUDE_ACCURACY));
|
||||
return /** @type {number|undefined} */ (this.get(Property.ALTITUDE_ACCURACY));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -233,32 +273,32 @@ class Geolocation extends BaseObject {
|
||||
* @api
|
||||
*/
|
||||
getHeading() {
|
||||
return /** @type {number|undefined} */ (this.get(GeolocationProperty.HEADING));
|
||||
return /** @type {number|undefined} */ (this.get(Property.HEADING));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the position of the device.
|
||||
* @return {module:ol/coordinate~Coordinate|undefined} The current position of the device reported
|
||||
* @return {import("./coordinate.js").Coordinate|undefined} The current position of the device reported
|
||||
* in the current projection.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
getPosition() {
|
||||
return (
|
||||
/** @type {module:ol/coordinate~Coordinate|undefined} */ (this.get(GeolocationProperty.POSITION))
|
||||
/** @type {import("./coordinate.js").Coordinate|undefined} */ (this.get(Property.POSITION))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the projection associated with the position.
|
||||
* @return {module:ol/proj/Projection|undefined} The projection the position is
|
||||
* @return {import("./proj/Projection.js").default|undefined} The projection the position is
|
||||
* reported in.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
getProjection() {
|
||||
return (
|
||||
/** @type {module:ol/proj/Projection|undefined} */ (this.get(GeolocationProperty.PROJECTION))
|
||||
/** @type {import("./proj/Projection.js").default|undefined} */ (this.get(Property.PROJECTION))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -270,7 +310,7 @@ class Geolocation extends BaseObject {
|
||||
* @api
|
||||
*/
|
||||
getSpeed() {
|
||||
return /** @type {number|undefined} */ (this.get(GeolocationProperty.SPEED));
|
||||
return /** @type {number|undefined} */ (this.get(Property.SPEED));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -280,7 +320,7 @@ class Geolocation extends BaseObject {
|
||||
* @api
|
||||
*/
|
||||
getTracking() {
|
||||
return /** @type {boolean} */ (this.get(GeolocationProperty.TRACKING));
|
||||
return /** @type {boolean} */ (this.get(Property.TRACKING));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -293,18 +333,18 @@ class Geolocation extends BaseObject {
|
||||
* @api
|
||||
*/
|
||||
getTrackingOptions() {
|
||||
return /** @type {PositionOptions|undefined} */ (this.get(GeolocationProperty.TRACKING_OPTIONS));
|
||||
return /** @type {PositionOptions|undefined} */ (this.get(Property.TRACKING_OPTIONS));
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the projection to use for transforming the coordinates.
|
||||
* @param {module:ol/proj~ProjectionLike} projection The projection the position is
|
||||
* @param {import("./proj.js").ProjectionLike} projection The projection the position is
|
||||
* reported in.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
setProjection(projection) {
|
||||
this.set(GeolocationProperty.PROJECTION, getProjection(projection));
|
||||
this.set(Property.PROJECTION, getProjection(projection));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -314,7 +354,7 @@ class Geolocation extends BaseObject {
|
||||
* @api
|
||||
*/
|
||||
setTracking(tracking) {
|
||||
this.set(GeolocationProperty.TRACKING, tracking);
|
||||
this.set(Property.TRACKING, tracking);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -327,7 +367,7 @@ class Geolocation extends BaseObject {
|
||||
* @api
|
||||
*/
|
||||
setTrackingOptions(options) {
|
||||
this.set(GeolocationProperty.TRACKING_OPTIONS, options);
|
||||
this.set(Property.TRACKING_OPTIONS, options);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
/**
|
||||
* @module ol/GeolocationProperty
|
||||
*/
|
||||
|
||||
/**
|
||||
* @enum {string}
|
||||
*/
|
||||
export default {
|
||||
ACCURACY: 'accuracy',
|
||||
ACCURACY_GEOMETRY: 'accuracyGeometry',
|
||||
ALTITUDE: 'altitude',
|
||||
ALTITUDE_ACCURACY: 'altitudeAccuracy',
|
||||
HEADING: 'heading',
|
||||
POSITION: 'position',
|
||||
PROJECTION: 'projection',
|
||||
SPEED: 'speed',
|
||||
TRACKING: 'tracking',
|
||||
TRACKING_OPTIONS: 'trackingOptions'
|
||||
};
|
||||
@@ -17,7 +17,7 @@ import Text from './style/Text.js';
|
||||
|
||||
|
||||
/**
|
||||
* @type {module:ol/style/Stroke}
|
||||
* @type {Stroke}
|
||||
* @private
|
||||
* @const
|
||||
*/
|
||||
@@ -26,7 +26,6 @@ const DEFAULT_STROKE_STYLE = new Stroke({
|
||||
});
|
||||
|
||||
/**
|
||||
* TODO can be configurable
|
||||
* @type {Array<number>}
|
||||
* @private
|
||||
*/
|
||||
@@ -36,13 +35,13 @@ const INTERVALS = [
|
||||
|
||||
/**
|
||||
* @typedef {Object} GraticuleLabelDataType
|
||||
* @property {module:ol/geom/Point} geom
|
||||
* @property {Point} geom
|
||||
* @property {string} text
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {Object} Options
|
||||
* @property {module:ol/PluggableMap} [map] Reference to an
|
||||
* @property {import("./PluggableMap.js").default} [map] Reference to an
|
||||
* {@link module:ol/Map~Map} object.
|
||||
* @property {number} [maxLines=100] The maximum number of meridians and
|
||||
* parallels from the center of the map. The default value of 100 means that at
|
||||
@@ -50,7 +49,7 @@ const INTERVALS = [
|
||||
* appropriate for conformal projections like Spherical Mercator. If you
|
||||
* increase the value, more lines will be drawn and the drawing performance will
|
||||
* decrease.
|
||||
* @property {module:ol/style/Stroke} [strokeStyle='rgba(0,0,0,0.2)'] The
|
||||
* @property {Stroke} [strokeStyle='rgba(0,0,0,0.2)'] The
|
||||
* stroke style to use for drawing the graticule. If not provided, a not fully
|
||||
* opaque black will be used.
|
||||
* @property {number} [targetSize=100] The target size of the graticule cells,
|
||||
@@ -71,7 +70,7 @@ const INTERVALS = [
|
||||
* @property {number} [latLabelPosition=1] Latitude label position in fractions
|
||||
* (0..1) of view extent. 0 means at the left of the viewport, 1 means at the
|
||||
* right.
|
||||
* @property {module:ol/style/Text} [lonLabelStyle] Longitude label text
|
||||
* @property {Text} [lonLabelStyle] Longitude label text
|
||||
* style. If not provided, the following style will be used:
|
||||
* ```js
|
||||
* new Text({
|
||||
@@ -89,7 +88,7 @@ const INTERVALS = [
|
||||
* Note that the default's `textBaseline` configuration will not work well for
|
||||
* `lonLabelPosition` configurations that position labels close to the top of
|
||||
* the viewport.
|
||||
* @property {module:ol/style/Text} [latLabelStyle] Latitude label text style.
|
||||
* @property {Text} [latLabelStyle] Latitude label text style.
|
||||
* If not provided, the following style will be used:
|
||||
* ```js
|
||||
* new Text({
|
||||
@@ -107,6 +106,11 @@ const INTERVALS = [
|
||||
* Note that the default's `textAlign` configuration will not work well for
|
||||
* `latLabelPosition` configurations that position labels close to the left of
|
||||
* the viewport.
|
||||
* @property {Array<number>} [intervals=[90, 45, 30, 20, 10, 5, 2, 1, 0.5, 0.2, 0.1, 0.05, 0.01, 0.005, 0.002, 0.001]]
|
||||
* Intervals (in degrees) for the graticule. Example to limit graticules to 30 and 10 degrees intervals:
|
||||
* ```js
|
||||
* [30, 10]
|
||||
* ```
|
||||
*/
|
||||
|
||||
|
||||
@@ -117,25 +121,25 @@ const INTERVALS = [
|
||||
class Graticule {
|
||||
|
||||
/**
|
||||
* @param {module:ol/Graticule~Options=} opt_options Options.
|
||||
* @param {Options=} opt_options Options.
|
||||
*/
|
||||
constructor(opt_options) {
|
||||
const options = opt_options || {};
|
||||
|
||||
/**
|
||||
* @type {module:ol/PluggableMap}
|
||||
* @type {import("./PluggableMap.js").default}
|
||||
* @private
|
||||
*/
|
||||
this.map_ = null;
|
||||
|
||||
/**
|
||||
* @type {?module:ol/events~EventsKey}
|
||||
* @type {?import("./events.js").EventsKey}
|
||||
* @private
|
||||
*/
|
||||
this.postcomposeListenerKey_ = null;
|
||||
|
||||
/**
|
||||
* @type {module:ol/proj/Projection}
|
||||
* @type {import("./proj/Projection.js").default}
|
||||
*/
|
||||
this.projection_ = null;
|
||||
|
||||
@@ -200,49 +204,49 @@ class Graticule {
|
||||
this.maxLines_ = options.maxLines !== undefined ? options.maxLines : 100;
|
||||
|
||||
/**
|
||||
* @type {Array<module:ol/geom/LineString>}
|
||||
* @type {Array<LineString>}
|
||||
* @private
|
||||
*/
|
||||
this.meridians_ = [];
|
||||
|
||||
/**
|
||||
* @type {Array<module:ol/geom/LineString>}
|
||||
* @type {Array<LineString>}
|
||||
* @private
|
||||
*/
|
||||
this.parallels_ = [];
|
||||
|
||||
/**
|
||||
* @type {module:ol/style/Stroke}
|
||||
* @type {Stroke}
|
||||
* @private
|
||||
*/
|
||||
this.strokeStyle_ = options.strokeStyle !== undefined ? options.strokeStyle : DEFAULT_STROKE_STYLE;
|
||||
|
||||
/**
|
||||
* @type {module:ol/proj~TransformFunction|undefined}
|
||||
* @type {import("./proj.js").TransformFunction|undefined}
|
||||
* @private
|
||||
*/
|
||||
this.fromLonLatTransform_ = undefined;
|
||||
|
||||
/**
|
||||
* @type {module:ol/proj~TransformFunction|undefined}
|
||||
* @type {import("./proj.js").TransformFunction|undefined}
|
||||
* @private
|
||||
*/
|
||||
this.toLonLatTransform_ = undefined;
|
||||
|
||||
/**
|
||||
* @type {module:ol/coordinate~Coordinate}
|
||||
* @type {import("./coordinate.js").Coordinate}
|
||||
* @private
|
||||
*/
|
||||
this.projectionCenterLonLat_ = null;
|
||||
|
||||
/**
|
||||
* @type {Array<module:ol/Graticule~GraticuleLabelDataType>}
|
||||
* @type {Array<GraticuleLabelDataType>}
|
||||
* @private
|
||||
*/
|
||||
this.meridiansLabels_ = null;
|
||||
|
||||
/**
|
||||
* @type {Array<module:ol/Graticule~GraticuleLabelDataType>}
|
||||
* @type {Array<GraticuleLabelDataType>}
|
||||
* @private
|
||||
*/
|
||||
this.parallelsLabels_ = null;
|
||||
@@ -282,7 +286,7 @@ class Graticule {
|
||||
options.latLabelPosition;
|
||||
|
||||
/**
|
||||
* @type {module:ol/style/Text}
|
||||
* @type {Text}
|
||||
* @private
|
||||
*/
|
||||
this.lonLabelStyle_ = options.lonLabelStyle !== undefined ? options.lonLabelStyle :
|
||||
@@ -299,7 +303,7 @@ class Graticule {
|
||||
});
|
||||
|
||||
/**
|
||||
* @type {module:ol/style/Text}
|
||||
* @type {Text}
|
||||
* @private
|
||||
*/
|
||||
this.latLabelStyle_ = options.latLabelStyle !== undefined ? options.latLabelStyle :
|
||||
@@ -319,6 +323,12 @@ class Graticule {
|
||||
this.parallelsLabels_ = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {Array<number>}
|
||||
* @private
|
||||
*/
|
||||
this.intervals_ = options.intervals !== undefined ? options.intervals : INTERVALS;
|
||||
|
||||
this.setMap(options.map !== undefined ? options.map : null);
|
||||
}
|
||||
|
||||
@@ -327,7 +337,7 @@ class Graticule {
|
||||
* @param {number} minLat Minimal latitude.
|
||||
* @param {number} maxLat Maximal latitude.
|
||||
* @param {number} squaredTolerance Squared tolerance.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {import("./extent.js").Extent} extent Extent.
|
||||
* @param {number} index Index.
|
||||
* @return {number} Index.
|
||||
* @private
|
||||
@@ -348,10 +358,10 @@ class Graticule {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/LineString} lineString Meridian
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {LineString} lineString Meridian
|
||||
* @param {import("./extent.js").Extent} extent Extent.
|
||||
* @param {number} index Index.
|
||||
* @return {module:ol/geom/Point} Meridian point.
|
||||
* @return {Point} Meridian point.
|
||||
* @private
|
||||
*/
|
||||
getMeridianPoint_(lineString, extent, index) {
|
||||
@@ -377,7 +387,7 @@ class Graticule {
|
||||
* @param {number} minLon Minimal longitude.
|
||||
* @param {number} maxLon Maximal longitude.
|
||||
* @param {number} squaredTolerance Squared tolerance.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {import("./extent.js").Extent} extent Extent.
|
||||
* @param {number} index Index.
|
||||
* @return {number} Index.
|
||||
* @private
|
||||
@@ -398,10 +408,10 @@ class Graticule {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/LineString} lineString Parallels.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {LineString} lineString Parallels.
|
||||
* @param {import("./extent.js").Extent} extent Extent.
|
||||
* @param {number} index Index.
|
||||
* @return {module:ol/geom/Point} Parallel point.
|
||||
* @return {Point} Parallel point.
|
||||
* @private
|
||||
*/
|
||||
getParallelPoint_(lineString, extent, index) {
|
||||
@@ -423,8 +433,8 @@ class Graticule {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {module:ol/coordinate~Coordinate} center Center.
|
||||
* @param {import("./extent.js").Extent} extent Extent.
|
||||
* @param {import("./coordinate.js").Coordinate} center Center.
|
||||
* @param {number} resolution Resolution.
|
||||
* @param {number} squaredTolerance Squared tolerance.
|
||||
* @private
|
||||
@@ -530,8 +540,8 @@ class Graticule {
|
||||
const p1 = [];
|
||||
/** @type {Array<number>} **/
|
||||
const p2 = [];
|
||||
for (let i = 0, ii = INTERVALS.length; i < ii; ++i) {
|
||||
const delta = INTERVALS[i] / 2;
|
||||
for (let i = 0, ii = this.intervals_.length; i < ii; ++i) {
|
||||
const delta = this.intervals_[i] / 2;
|
||||
p1[0] = centerLon - delta;
|
||||
p1[1] = centerLat - delta;
|
||||
p2[0] = centerLon + delta;
|
||||
@@ -542,14 +552,14 @@ class Graticule {
|
||||
if (dist <= target) {
|
||||
break;
|
||||
}
|
||||
interval = INTERVALS[i];
|
||||
interval = this.intervals_[i];
|
||||
}
|
||||
return interval;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the map associated with this graticule.
|
||||
* @return {module:ol/PluggableMap} The map.
|
||||
* @return {import("./PluggableMap.js").default} The map.
|
||||
* @api
|
||||
*/
|
||||
getMap() {
|
||||
@@ -561,7 +571,7 @@ class Graticule {
|
||||
* @param {number} minLat Minimal latitude.
|
||||
* @param {number} maxLat Maximal latitude.
|
||||
* @param {number} squaredTolerance Squared tolerance.
|
||||
* @return {module:ol/geom/LineString} The meridian line string.
|
||||
* @return {LineString} The meridian line string.
|
||||
* @param {number} index Index.
|
||||
* @private
|
||||
*/
|
||||
@@ -579,7 +589,7 @@ class Graticule {
|
||||
|
||||
/**
|
||||
* Get the list of meridians. Meridians are lines of equal longitude.
|
||||
* @return {Array<module:ol/geom/LineString>} The meridians.
|
||||
* @return {Array<LineString>} The meridians.
|
||||
* @api
|
||||
*/
|
||||
getMeridians() {
|
||||
@@ -591,7 +601,7 @@ class Graticule {
|
||||
* @param {number} minLon Minimal longitude.
|
||||
* @param {number} maxLon Maximal longitude.
|
||||
* @param {number} squaredTolerance Squared tolerance.
|
||||
* @return {module:ol/geom/LineString} The parallel line string.
|
||||
* @return {LineString} The parallel line string.
|
||||
* @param {number} index Index.
|
||||
* @private
|
||||
*/
|
||||
@@ -609,7 +619,7 @@ class Graticule {
|
||||
|
||||
/**
|
||||
* Get the list of parallels. Parallels are lines of equal latitude.
|
||||
* @return {Array<module:ol/geom/LineString>} The parallels.
|
||||
* @return {Array<LineString>} The parallels.
|
||||
* @api
|
||||
*/
|
||||
getParallels() {
|
||||
@@ -617,7 +627,7 @@ class Graticule {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/render/Event} e Event.
|
||||
* @param {import("./render/Event.js").default} e Event.
|
||||
* @private
|
||||
*/
|
||||
handlePostCompose_(e) {
|
||||
@@ -672,7 +682,7 @@ class Graticule {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/proj/Projection} projection Projection.
|
||||
* @param {import("./proj/Projection.js").default} projection Projection.
|
||||
* @private
|
||||
*/
|
||||
updateProjectionInfo_(projection) {
|
||||
@@ -703,7 +713,7 @@ class Graticule {
|
||||
/**
|
||||
* Set the map for this graticule. The graticule will be rendered on the
|
||||
* provided map.
|
||||
* @param {module:ol/PluggableMap} map Map.
|
||||
* @param {import("./PluggableMap.js").default} map Map.
|
||||
* @api
|
||||
*/
|
||||
setMap(map) {
|
||||
|
||||
@@ -22,7 +22,7 @@ import {getHeight} from './extent.js';
|
||||
* post requests or - in general - through XHR requests, where the src of the
|
||||
* image element would be set to a data URI when the content is loaded.
|
||||
*
|
||||
* @typedef {function(module:ol/Image, string)} LoadFunction
|
||||
* @typedef {function(ImageWrapper, string)} LoadFunction
|
||||
* @api
|
||||
*/
|
||||
|
||||
@@ -30,12 +30,12 @@ import {getHeight} from './extent.js';
|
||||
class ImageWrapper extends ImageBase {
|
||||
|
||||
/**
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {import("./extent.js").Extent} extent Extent.
|
||||
* @param {number|undefined} resolution Resolution.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {string} src Image source URI.
|
||||
* @param {?string} crossOrigin Cross origin.
|
||||
* @param {module:ol/Image~LoadFunction} imageLoadFunction Image load function.
|
||||
* @param {LoadFunction} imageLoadFunction Image load function.
|
||||
*/
|
||||
constructor(extent, resolution, pixelRatio, src, crossOrigin, imageLoadFunction) {
|
||||
|
||||
@@ -58,19 +58,19 @@ class ImageWrapper extends ImageBase {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array<module:ol/events~EventsKey>}
|
||||
* @type {Array<import("./events.js").EventsKey>}
|
||||
*/
|
||||
this.imageListenerKeys_ = null;
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {module:ol/ImageState}
|
||||
* @type {ImageState}
|
||||
*/
|
||||
this.state = ImageState.IDLE;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/Image~LoadFunction}
|
||||
* @type {LoadFunction}
|
||||
*/
|
||||
this.imageLoadFunction_ = imageLoadFunction;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/**
|
||||
* @module ol/ImageBase
|
||||
*/
|
||||
import {abstract} from './util.js';
|
||||
import EventTarget from './events/Target.js';
|
||||
import EventType from './events/EventType.js';
|
||||
|
||||
@@ -10,10 +11,10 @@ import EventType from './events/EventType.js';
|
||||
class ImageBase extends EventTarget {
|
||||
|
||||
/**
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {import("./extent.js").Extent} extent Extent.
|
||||
* @param {number|undefined} resolution Resolution.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {module:ol/ImageState} state State.
|
||||
* @param {import("./ImageState.js").default} state State.
|
||||
*/
|
||||
constructor(extent, resolution, pixelRatio, state) {
|
||||
|
||||
@@ -21,7 +22,7 @@ class ImageBase extends EventTarget {
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {module:ol/extent~Extent}
|
||||
* @type {import("./extent.js").Extent}
|
||||
*/
|
||||
this.extent = extent;
|
||||
|
||||
@@ -39,7 +40,7 @@ class ImageBase extends EventTarget {
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {module:ol/ImageState}
|
||||
* @type {import("./ImageState.js").default}
|
||||
*/
|
||||
this.state = state;
|
||||
|
||||
@@ -53,7 +54,7 @@ class ImageBase extends EventTarget {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {module:ol/extent~Extent} Extent.
|
||||
* @return {import("./extent.js").Extent} Extent.
|
||||
*/
|
||||
getExtent() {
|
||||
return this.extent;
|
||||
@@ -63,7 +64,9 @@ class ImageBase extends EventTarget {
|
||||
* @abstract
|
||||
* @return {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} Image.
|
||||
*/
|
||||
getImage() {}
|
||||
getImage() {
|
||||
return abstract();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {number} PixelRatio.
|
||||
@@ -80,7 +83,7 @@ class ImageBase extends EventTarget {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {module:ol/ImageState} State.
|
||||
* @return {import("./ImageState.js").default} State.
|
||||
*/
|
||||
getState() {
|
||||
return this.state;
|
||||
@@ -90,7 +93,9 @@ class ImageBase extends EventTarget {
|
||||
* Load not yet loaded URI.
|
||||
* @abstract
|
||||
*/
|
||||
load() {}
|
||||
load() {
|
||||
abstract();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -11,18 +11,18 @@ import ImageState from './ImageState.js';
|
||||
* If any error occurs during drawing, the "done" callback should be called with
|
||||
* that error.
|
||||
*
|
||||
* @typedef {function(function(Error))} Loader
|
||||
* @typedef {function(function(Error=))} Loader
|
||||
*/
|
||||
|
||||
|
||||
class ImageCanvas extends ImageBase {
|
||||
|
||||
/**
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {import("./extent.js").Extent} extent Extent.
|
||||
* @param {number} resolution Resolution.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {HTMLCanvasElement} canvas Canvas.
|
||||
* @param {module:ol/ImageCanvas~Loader=} opt_loader Optional loader function to
|
||||
* @param {Loader=} opt_loader Optional loader function to
|
||||
* support asynchronous canvas drawing.
|
||||
*/
|
||||
constructor(extent, resolution, pixelRatio, canvas, opt_loader) {
|
||||
@@ -33,7 +33,7 @@ class ImageCanvas extends ImageBase {
|
||||
|
||||
/**
|
||||
* Optional canvas loader function.
|
||||
* @type {?module:ol/ImageCanvas~Loader}
|
||||
* @type {?Loader}
|
||||
* @private
|
||||
*/
|
||||
this.loader_ = opt_loader !== undefined ? opt_loader : null;
|
||||
@@ -62,7 +62,7 @@ class ImageCanvas extends ImageBase {
|
||||
|
||||
/**
|
||||
* Handle async drawing complete.
|
||||
* @param {Error} err Any error during drawing.
|
||||
* @param {Error=} err Any error during drawing.
|
||||
* @private
|
||||
*/
|
||||
handleLoad_(err) {
|
||||
|
||||
@@ -7,21 +7,16 @@ import {createCanvasContext2D} from './dom.js';
|
||||
import {listenOnce, unlistenByKey} from './events.js';
|
||||
import EventType from './events/EventType.js';
|
||||
|
||||
/**
|
||||
* @typedef {function(new: module:ol/ImageTile, module:ol/tilecoord~TileCoord,
|
||||
* module:ol/TileState, string, ?string, module:ol/Tile~LoadFunction)} TileClass
|
||||
* @api
|
||||
*/
|
||||
|
||||
class ImageTile extends Tile {
|
||||
|
||||
/**
|
||||
* @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate.
|
||||
* @param {module:ol/TileState} state State.
|
||||
* @param {import("./tilecoord.js").TileCoord} tileCoord Tile coordinate.
|
||||
* @param {TileState} state State.
|
||||
* @param {string} src Image source URI.
|
||||
* @param {?string} crossOrigin Cross origin.
|
||||
* @param {module:ol/Tile~LoadFunction} tileLoadFunction Tile load function.
|
||||
* @param {module:ol/Tile~Options=} opt_options Tile options.
|
||||
* @param {import("./Tile.js").LoadFunction} tileLoadFunction Tile load function.
|
||||
* @param {import("./Tile.js").Options=} opt_options Tile options.
|
||||
*/
|
||||
constructor(tileCoord, state, src, crossOrigin, tileLoadFunction, opt_options) {
|
||||
|
||||
@@ -52,13 +47,13 @@ class ImageTile extends Tile {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array<module:ol/events~EventsKey>}
|
||||
* @type {Array<import("./events.js").EventsKey>}
|
||||
*/
|
||||
this.imageListenerKeys_ = null;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/Tile~LoadFunction}
|
||||
* @type {import("./Tile.js").LoadFunction}
|
||||
*/
|
||||
this.tileLoadFunction_ = tileLoadFunction;
|
||||
|
||||
@@ -114,7 +109,8 @@ class ImageTile extends Tile {
|
||||
* @private
|
||||
*/
|
||||
handleImageLoad_() {
|
||||
if (this.image_.naturalWidth && this.image_.naturalHeight) {
|
||||
const image = /** @type {HTMLImageElement} */ (this.image_);
|
||||
if (image.naturalWidth && image.naturalHeight) {
|
||||
this.state = TileState.LOADED;
|
||||
} else {
|
||||
this.state = TileState.EMPTY;
|
||||
|
||||
@@ -56,8 +56,8 @@ import CanvasVectorTileLayerRenderer from './renderer/canvas/VectorTileLayer.js'
|
||||
* options or added with `addLayer` can be groups, which can contain further
|
||||
* groups, and so on.
|
||||
*
|
||||
* @fires module:ol/MapBrowserEvent~MapBrowserEvent
|
||||
* @fires module:ol/MapEvent~MapEvent
|
||||
* @fires import("./MapBrowserEvent.js").MapBrowserEvent
|
||||
* @fires import("./MapEvent.js").MapEvent
|
||||
* @fires module:ol/render/Event~RenderEvent#postcompose
|
||||
* @fires module:ol/render/Event~RenderEvent#precompose
|
||||
* @api
|
||||
@@ -65,7 +65,7 @@ import CanvasVectorTileLayerRenderer from './renderer/canvas/VectorTileLayer.js'
|
||||
class Map extends PluggableMap {
|
||||
|
||||
/**
|
||||
* @param {module:ol/PluggableMap~MapOptions} options Map options.
|
||||
* @param {import("./PluggableMap.js").MapOptions} options Map options.
|
||||
*/
|
||||
constructor(options) {
|
||||
options = assign({}, options);
|
||||
|
||||
@@ -12,10 +12,10 @@ class MapBrowserEvent extends MapEvent {
|
||||
|
||||
/**
|
||||
* @param {string} type Event type.
|
||||
* @param {module:ol/PluggableMap} map Map.
|
||||
* @param {import("./PluggableMap.js").default} map Map.
|
||||
* @param {Event} browserEvent Browser event.
|
||||
* @param {boolean=} opt_dragging Is the map currently being dragged?
|
||||
* @param {?module:ol/PluggableMap~FrameState=} opt_frameState Frame state.
|
||||
* @param {?import("./PluggableMap.js").FrameState=} opt_frameState Frame state.
|
||||
*/
|
||||
constructor(type, map, browserEvent, opt_dragging, opt_frameState) {
|
||||
|
||||
@@ -31,14 +31,14 @@ class MapBrowserEvent extends MapEvent {
|
||||
|
||||
/**
|
||||
* The map pixel relative to the viewport corresponding to the original browser event.
|
||||
* @type {module:ol/pixel~Pixel}
|
||||
* @type {import("./pixel.js").Pixel}
|
||||
* @api
|
||||
*/
|
||||
this.pixel = map.getEventPixel(browserEvent);
|
||||
|
||||
/**
|
||||
* The coordinate in view projection corresponding to the original browser event.
|
||||
* @type {module:ol/coordinate~Coordinate}
|
||||
* @type {import("./coordinate.js").Coordinate}
|
||||
* @api
|
||||
*/
|
||||
this.coordinate = map.getCoordinateFromPixel(this.pixel);
|
||||
|
||||
@@ -12,7 +12,7 @@ import PointerEventHandler from './pointer/PointerEventHandler.js';
|
||||
class MapBrowserEventHandler extends EventTarget {
|
||||
|
||||
/**
|
||||
* @param {module:ol/PluggableMap} map The map with the viewport to listen to events on.
|
||||
* @param {import("./PluggableMap.js").default} map The map with the viewport to listen to events on.
|
||||
* @param {number=} moveTolerance The minimal distance the pointer must travel to trigger a move.
|
||||
*/
|
||||
constructor(map, moveTolerance) {
|
||||
@@ -21,16 +21,16 @@ class MapBrowserEventHandler extends EventTarget {
|
||||
|
||||
/**
|
||||
* This is the element that we will listen to the real events on.
|
||||
* @type {module:ol/PluggableMap}
|
||||
* @type {import("./PluggableMap.js").default}
|
||||
* @private
|
||||
*/
|
||||
this.map_ = map;
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
* @type {any}
|
||||
* @private
|
||||
*/
|
||||
this.clickTimeoutId_ = 0;
|
||||
this.clickTimeoutId_;
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
@@ -39,7 +39,7 @@ class MapBrowserEventHandler extends EventTarget {
|
||||
this.dragging_ = false;
|
||||
|
||||
/**
|
||||
* @type {!Array<module:ol/events~EventsKey>}
|
||||
* @type {!Array<import("./events.js").EventsKey>}
|
||||
* @private
|
||||
*/
|
||||
this.dragListenerKeys_ = [];
|
||||
@@ -54,7 +54,7 @@ class MapBrowserEventHandler extends EventTarget {
|
||||
/**
|
||||
* The most recent "down" type event (or null if none have occurred).
|
||||
* Set on pointerdown.
|
||||
* @type {module:ol/pointer/PointerEvent}
|
||||
* @type {import("./pointer/PointerEvent.js").default}
|
||||
* @private
|
||||
*/
|
||||
this.down_ = null;
|
||||
@@ -77,7 +77,7 @@ class MapBrowserEventHandler extends EventTarget {
|
||||
* Event handler which generates pointer events for
|
||||
* the viewport element.
|
||||
*
|
||||
* @type {module:ol/pointer/PointerEventHandler}
|
||||
* @type {PointerEventHandler}
|
||||
* @private
|
||||
*/
|
||||
this.pointerEventHandler_ = new PointerEventHandler(element);
|
||||
@@ -86,13 +86,13 @@ class MapBrowserEventHandler extends EventTarget {
|
||||
* Event handler which generates pointer events for
|
||||
* the document (used when dragging).
|
||||
*
|
||||
* @type {module:ol/pointer/PointerEventHandler}
|
||||
* @type {PointerEventHandler}
|
||||
* @private
|
||||
*/
|
||||
this.documentPointerEventHandler_ = null;
|
||||
|
||||
/**
|
||||
* @type {?module:ol/events~EventsKey}
|
||||
* @type {?import("./events.js").EventsKey}
|
||||
* @private
|
||||
*/
|
||||
this.pointerdownListenerKey_ = listen(this.pointerEventHandler_,
|
||||
@@ -100,7 +100,7 @@ class MapBrowserEventHandler extends EventTarget {
|
||||
this.handlePointerDown_, this);
|
||||
|
||||
/**
|
||||
* @type {?module:ol/events~EventsKey}
|
||||
* @type {?import("./events.js").EventsKey}
|
||||
* @private
|
||||
*/
|
||||
this.relayedListenerKey_ = listen(this.pointerEventHandler_,
|
||||
@@ -110,7 +110,7 @@ class MapBrowserEventHandler extends EventTarget {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/pointer/PointerEvent} pointerEvent Pointer
|
||||
* @param {import("./pointer/PointerEvent.js").default} pointerEvent Pointer
|
||||
* event.
|
||||
* @private
|
||||
*/
|
||||
@@ -118,17 +118,17 @@ class MapBrowserEventHandler extends EventTarget {
|
||||
let newEvent = new MapBrowserPointerEvent(
|
||||
MapBrowserEventType.CLICK, this.map_, pointerEvent);
|
||||
this.dispatchEvent(newEvent);
|
||||
if (this.clickTimeoutId_ !== 0) {
|
||||
if (this.clickTimeoutId_ !== undefined) {
|
||||
// double-click
|
||||
clearTimeout(this.clickTimeoutId_);
|
||||
this.clickTimeoutId_ = 0;
|
||||
this.clickTimeoutId_ = undefined;
|
||||
newEvent = new MapBrowserPointerEvent(
|
||||
MapBrowserEventType.DBLCLICK, this.map_, pointerEvent);
|
||||
this.dispatchEvent(newEvent);
|
||||
} else {
|
||||
// click
|
||||
this.clickTimeoutId_ = setTimeout(function() {
|
||||
this.clickTimeoutId_ = 0;
|
||||
this.clickTimeoutId_ = undefined;
|
||||
const newEvent = new MapBrowserPointerEvent(
|
||||
MapBrowserEventType.SINGLECLICK, this.map_, pointerEvent);
|
||||
this.dispatchEvent(newEvent);
|
||||
@@ -139,7 +139,7 @@ class MapBrowserEventHandler extends EventTarget {
|
||||
/**
|
||||
* Keeps track on how many pointers are currently active.
|
||||
*
|
||||
* @param {module:ol/pointer/PointerEvent} pointerEvent Pointer
|
||||
* @param {import("./pointer/PointerEvent.js").default} pointerEvent Pointer
|
||||
* event.
|
||||
* @private
|
||||
*/
|
||||
@@ -156,7 +156,7 @@ class MapBrowserEventHandler extends EventTarget {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/pointer/PointerEvent} pointerEvent Pointer
|
||||
* @param {import("./pointer/PointerEvent.js").default} pointerEvent Pointer
|
||||
* event.
|
||||
* @private
|
||||
*/
|
||||
@@ -187,7 +187,7 @@ class MapBrowserEventHandler extends EventTarget {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/pointer/PointerEvent} pointerEvent Pointer
|
||||
* @param {import("./pointer/PointerEvent.js").default} pointerEvent Pointer
|
||||
* event.
|
||||
* @return {boolean} If the left mouse button was pressed.
|
||||
* @private
|
||||
@@ -197,7 +197,7 @@ class MapBrowserEventHandler extends EventTarget {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/pointer/PointerEvent} pointerEvent Pointer
|
||||
* @param {import("./pointer/PointerEvent.js").default} pointerEvent Pointer
|
||||
* event.
|
||||
* @private
|
||||
*/
|
||||
@@ -245,7 +245,7 @@ class MapBrowserEventHandler extends EventTarget {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/pointer/PointerEvent} pointerEvent Pointer
|
||||
* @param {import("./pointer/PointerEvent.js").default} pointerEvent Pointer
|
||||
* event.
|
||||
* @private
|
||||
*/
|
||||
@@ -271,7 +271,7 @@ class MapBrowserEventHandler extends EventTarget {
|
||||
/**
|
||||
* Wrap and relay a pointer event. Note that this requires that the type
|
||||
* string for the MapBrowserPointerEvent matches the PointerEvent type.
|
||||
* @param {module:ol/pointer/PointerEvent} pointerEvent Pointer
|
||||
* @param {import("./pointer/PointerEvent.js").default} pointerEvent Pointer
|
||||
* event.
|
||||
* @private
|
||||
*/
|
||||
@@ -282,7 +282,7 @@ class MapBrowserEventHandler extends EventTarget {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/pointer/PointerEvent} pointerEvent Pointer
|
||||
* @param {import("./pointer/PointerEvent.js").default} pointerEvent Pointer
|
||||
* event.
|
||||
* @return {boolean} Is moving.
|
||||
* @private
|
||||
|
||||
@@ -7,10 +7,10 @@ class MapBrowserPointerEvent extends MapBrowserEvent {
|
||||
|
||||
/**
|
||||
* @param {string} type Event type.
|
||||
* @param {module:ol/PluggableMap} map Map.
|
||||
* @param {module:ol/pointer/PointerEvent} pointerEvent Pointer event.
|
||||
* @param {import("./PluggableMap.js").default} map Map.
|
||||
* @param {import("./pointer/PointerEvent.js").default} pointerEvent Pointer event.
|
||||
* @param {boolean=} opt_dragging Is the map currently being dragged?
|
||||
* @param {?module:ol/PluggableMap~FrameState=} opt_frameState Frame state.
|
||||
* @param {?import("./PluggableMap.js").FrameState=} opt_frameState Frame state.
|
||||
*/
|
||||
constructor(type, map, pointerEvent, opt_dragging, opt_frameState) {
|
||||
|
||||
@@ -18,7 +18,7 @@ class MapBrowserPointerEvent extends MapBrowserEvent {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {module:ol/pointer/PointerEvent}
|
||||
* @type {import("./pointer/PointerEvent.js").default}
|
||||
*/
|
||||
this.pointerEvent = pointerEvent;
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@ class MapEvent extends Event {
|
||||
|
||||
/**
|
||||
* @param {string} type Event type.
|
||||
* @param {module:ol/PluggableMap} map Map.
|
||||
* @param {?module:ol/PluggableMap~FrameState=} opt_frameState Frame state.
|
||||
* @param {import("./PluggableMap.js").default} map Map.
|
||||
* @param {?import("./PluggableMap.js").FrameState=} opt_frameState Frame state.
|
||||
*/
|
||||
constructor(type, map, opt_frameState) {
|
||||
|
||||
@@ -21,14 +21,14 @@ class MapEvent extends Event {
|
||||
|
||||
/**
|
||||
* The map where the event occurred.
|
||||
* @type {module:ol/PluggableMap}
|
||||
* @type {import("./PluggableMap.js").default}
|
||||
* @api
|
||||
*/
|
||||
this.map = map;
|
||||
|
||||
/**
|
||||
* The frame state at the time of the event.
|
||||
* @type {?module:ol/PluggableMap~FrameState}
|
||||
* @type {?import("./PluggableMap.js").FrameState}
|
||||
* @api
|
||||
*/
|
||||
this.frameState = opt_frameState !== undefined ? opt_frameState : null;
|
||||
|
||||
@@ -11,8 +11,8 @@ import {assign} from './obj.js';
|
||||
/**
|
||||
* @classdesc
|
||||
* Events emitted by {@link module:ol/Object~BaseObject} instances are instances of this type.
|
||||
*/
|
||||
class ObjectEvent extends Event {
|
||||
*/
|
||||
export class ObjectEvent extends Event {
|
||||
|
||||
/**
|
||||
* @param {string} type The event type.
|
||||
@@ -82,7 +82,7 @@ class ObjectEvent extends Event {
|
||||
* Properties can be deleted by using the unset method. E.g.
|
||||
* object.unset('foo').
|
||||
*
|
||||
* @fires module:ol/Object~ObjectEvent
|
||||
* @fires ObjectEvent
|
||||
* @api
|
||||
*/
|
||||
class BaseObject extends Observable {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
export default {
|
||||
/**
|
||||
* Triggered when a property is changed.
|
||||
* @event module:ol/Object~ObjectEvent#propertychange
|
||||
* @event module:ol/Object.ObjectEvent#propertychange
|
||||
* @api
|
||||
*/
|
||||
PROPERTYCHANGE: 'propertychange'
|
||||
|
||||
@@ -13,7 +13,7 @@ import EventType from './events/EventType.js';
|
||||
* and unregistration. A generic `change` event is always available through
|
||||
* {@link module:ol/Observable~Observable#changed}.
|
||||
*
|
||||
* @fires module:ol/events/Event~Event
|
||||
* @fires import("./events/Event.js").Event
|
||||
* @api
|
||||
*/
|
||||
class Observable extends EventTarget {
|
||||
@@ -52,7 +52,7 @@ class Observable extends EventTarget {
|
||||
* Listen for a certain type of event.
|
||||
* @param {string|Array<string>} type The event type or array of event types.
|
||||
* @param {function(?): ?} listener The listener function.
|
||||
* @return {module:ol/events~EventsKey|Array<module:ol/events~EventsKey>} Unique key for the listener. If
|
||||
* @return {import("./events.js").EventsKey|Array<import("./events.js").EventsKey>} Unique key for the listener. If
|
||||
* called with an array of event types as the first argument, the return
|
||||
* will be an array of keys.
|
||||
* @api
|
||||
@@ -74,7 +74,7 @@ class Observable extends EventTarget {
|
||||
* Listen once for a certain type of event.
|
||||
* @param {string|Array<string>} type The event type or array of event types.
|
||||
* @param {function(?): ?} listener The listener function.
|
||||
* @return {module:ol/events~EventsKey|Array<module:ol/events~EventsKey>} Unique key for the listener. If
|
||||
* @return {import("./events.js").EventsKey|Array<import("./events.js").EventsKey>} Unique key for the listener. If
|
||||
* called with an array of event types as the first argument, the return
|
||||
* will be an array of keys.
|
||||
* @api
|
||||
@@ -113,7 +113,7 @@ class Observable extends EventTarget {
|
||||
|
||||
/**
|
||||
* Removes an event listener using the key returned by `on()` or `once()`.
|
||||
* @param {module:ol/events~EventsKey|Array<module:ol/events~EventsKey>} key The key returned by `on()`
|
||||
* @param {import("./events.js").EventsKey|Array<import("./events.js").EventsKey>} key The key returned by `on()`
|
||||
* or `once()` (or an array of keys).
|
||||
* @api
|
||||
*/
|
||||
@@ -123,7 +123,7 @@ export function unByKey(key) {
|
||||
unlistenByKey(key[i]);
|
||||
}
|
||||
} else {
|
||||
unlistenByKey(/** @type {module:ol/events~EventsKey} */ (key));
|
||||
unlistenByKey(/** @type {import("./events.js").EventsKey} */ (key));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,9 +20,9 @@ import {containsExtent} from './extent.js';
|
||||
* array is the horizontal offset. A positive value shifts the overlay right.
|
||||
* The second element in the array is the vertical offset. A positive value
|
||||
* shifts the overlay down.
|
||||
* @property {module:ol/coordinate~Coordinate} [position] The overlay position
|
||||
* @property {import("./coordinate.js").Coordinate} [position] The overlay position
|
||||
* in map projection.
|
||||
* @property {module:ol/OverlayPositioning} [positioning='top-left'] Defines how
|
||||
* @property {OverlayPositioning} [positioning='top-left'] Defines how
|
||||
* the overlay is actually positioned with respect to its `position` property.
|
||||
* Possible values are `'bottom-left'`, `'bottom-center'`, `'bottom-right'`,
|
||||
* `'center-left'`, `'center-center'`, `'center-right'`, `'top-left'`,
|
||||
@@ -40,7 +40,7 @@ import {containsExtent} from './extent.js';
|
||||
* @property {boolean} [autoPan=false] If set to `true` the map is panned when
|
||||
* calling `setPosition`, so that the overlay is entirely visible in the current
|
||||
* viewport.
|
||||
* @property {module:ol/Overlay~PanOptions} [autoPanAnimation] The
|
||||
* @property {PanOptions} [autoPanAnimation] The
|
||||
* animation options used to pan the overlay into view. This animation is only
|
||||
* used when `autoPan` is enabled. A `duration` and `easing` may be provided to
|
||||
* customize the animation.
|
||||
@@ -97,7 +97,7 @@ const Property = {
|
||||
class Overlay extends BaseObject {
|
||||
|
||||
/**
|
||||
* @param {module:ol/Overlay~Options} options Overlay options.
|
||||
* @param {Options} options Overlay options.
|
||||
*/
|
||||
constructor(options) {
|
||||
|
||||
@@ -105,7 +105,7 @@ class Overlay extends BaseObject {
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {module:ol/Overlay~Options}
|
||||
* @type {Options}
|
||||
*/
|
||||
this.options = options;
|
||||
|
||||
@@ -145,9 +145,9 @@ class Overlay extends BaseObject {
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {module:ol/Overlay~PanOptions}
|
||||
* @type {PanOptions}
|
||||
*/
|
||||
this.autoPanAnimation = options.autoPanAnimation || /** @type {module:ol/Overlay~PanOptions} */ ({});
|
||||
this.autoPanAnimation = options.autoPanAnimation || /** @type {PanOptions} */ ({});
|
||||
|
||||
/**
|
||||
* @protected
|
||||
@@ -174,7 +174,7 @@ class Overlay extends BaseObject {
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {?module:ol/events~EventsKey}
|
||||
* @type {?import("./events.js").EventsKey}
|
||||
*/
|
||||
this.mapPostrenderListenerKey = null;
|
||||
|
||||
@@ -205,7 +205,7 @@ class Overlay extends BaseObject {
|
||||
this.setOffset(options.offset !== undefined ? options.offset : [0, 0]);
|
||||
|
||||
this.setPositioning(options.positioning !== undefined ?
|
||||
/** @type {module:ol/OverlayPositioning} */ (options.positioning) :
|
||||
/** @type {OverlayPositioning} */ (options.positioning) :
|
||||
OverlayPositioning.TOP_LEFT);
|
||||
|
||||
if (options.position !== undefined) {
|
||||
@@ -235,14 +235,14 @@ class Overlay extends BaseObject {
|
||||
|
||||
/**
|
||||
* Get the map associated with this overlay.
|
||||
* @return {module:ol/PluggableMap|undefined} The map that the
|
||||
* @return {import("./PluggableMap.js").default|undefined} The map that the
|
||||
* overlay is part of.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
getMap() {
|
||||
return (
|
||||
/** @type {module:ol/PluggableMap|undefined} */ (this.get(Property.MAP))
|
||||
/** @type {import("./PluggableMap.js").default|undefined} */ (this.get(Property.MAP))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -258,27 +258,27 @@ class Overlay extends BaseObject {
|
||||
|
||||
/**
|
||||
* Get the current position of this overlay.
|
||||
* @return {module:ol/coordinate~Coordinate|undefined} The spatial point that the overlay is
|
||||
* @return {import("./coordinate.js").Coordinate|undefined} The spatial point that the overlay is
|
||||
* anchored at.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
getPosition() {
|
||||
return (
|
||||
/** @type {module:ol/coordinate~Coordinate|undefined} */ (this.get(Property.POSITION))
|
||||
/** @type {import("./coordinate.js").Coordinate|undefined} */ (this.get(Property.POSITION))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current positioning of this overlay.
|
||||
* @return {module:ol/OverlayPositioning} How the overlay is positioned
|
||||
* @return {OverlayPositioning} How the overlay is positioned
|
||||
* relative to its point on the map.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
getPositioning() {
|
||||
return (
|
||||
/** @type {module:ol/OverlayPositioning} */ (this.get(Property.POSITIONING))
|
||||
/** @type {OverlayPositioning} */ (this.get(Property.POSITIONING))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -360,7 +360,7 @@ class Overlay extends BaseObject {
|
||||
|
||||
/**
|
||||
* Set the map to be associated with this overlay.
|
||||
* @param {module:ol/PluggableMap|undefined} map The map that the
|
||||
* @param {import("./PluggableMap.js").default|undefined} map The map that the
|
||||
* overlay is part of.
|
||||
* @observable
|
||||
* @api
|
||||
@@ -382,7 +382,7 @@ class Overlay extends BaseObject {
|
||||
/**
|
||||
* Set the position for this overlay. If the position is `undefined` the
|
||||
* overlay is hidden.
|
||||
* @param {module:ol/coordinate~Coordinate|undefined} position The spatial point that the overlay
|
||||
* @param {import("./coordinate.js").Coordinate|undefined} position The spatial point that the overlay
|
||||
* is anchored at.
|
||||
* @observable
|
||||
* @api
|
||||
@@ -432,7 +432,7 @@ class Overlay extends BaseObject {
|
||||
}
|
||||
|
||||
if (delta[0] !== 0 || delta[1] !== 0) {
|
||||
const center = /** @type {module:ol/coordinate~Coordinate} */ (map.getView().getCenter());
|
||||
const center = /** @type {import("./coordinate.js").Coordinate} */ (map.getView().getCenter());
|
||||
const centerPx = map.getPixelFromCoordinate(center);
|
||||
const newCenterPx = [
|
||||
centerPx[0] + delta[0],
|
||||
@@ -451,8 +451,8 @@ class Overlay extends BaseObject {
|
||||
/**
|
||||
* Get the extent of an element relative to the document
|
||||
* @param {HTMLElement|undefined} element The element.
|
||||
* @param {module:ol/size~Size|undefined} size The size of the element.
|
||||
* @return {module:ol/extent~Extent} The extent.
|
||||
* @param {import("./size.js").Size|undefined} size The size of the element.
|
||||
* @return {import("./extent.js").Extent} The extent.
|
||||
* @protected
|
||||
*/
|
||||
getRect(element, size) {
|
||||
@@ -469,7 +469,7 @@ class Overlay extends BaseObject {
|
||||
|
||||
/**
|
||||
* Set the positioning for this overlay.
|
||||
* @param {module:ol/OverlayPositioning} positioning how the overlay is
|
||||
* @param {OverlayPositioning} positioning how the overlay is
|
||||
* positioned relative to its point on the map.
|
||||
* @observable
|
||||
* @api
|
||||
@@ -508,8 +508,8 @@ class Overlay extends BaseObject {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/pixel~Pixel} pixel The pixel location.
|
||||
* @param {module:ol/size~Size|undefined} mapSize The map size.
|
||||
* @param {import("./pixel.js").Pixel} pixel The pixel location.
|
||||
* @param {import("./size.js").Size|undefined} mapSize The map size.
|
||||
* @protected
|
||||
*/
|
||||
updateRenderedPosition(pixel, mapSize) {
|
||||
@@ -574,7 +574,7 @@ class Overlay extends BaseObject {
|
||||
|
||||
/**
|
||||
* returns the options this Overlay has been created with
|
||||
* @return {module:ol/Overlay~Options} overlay options
|
||||
* @return {Options} overlay options
|
||||
*/
|
||||
getOptions() {
|
||||
return this.options;
|
||||
|
||||
@@ -36,33 +36,33 @@ import {create as createTransform, apply as applyTransform} from './transform.js
|
||||
* @typedef {Object} FrameState
|
||||
* @property {number} pixelRatio The pixel ratio of the frame.
|
||||
* @property {number} time The time when rendering of the frame was requested.
|
||||
* @property {module:ol/View~State} viewState The state of the current view.
|
||||
* @property {import("./View.js").State} viewState The state of the current view.
|
||||
* @property {boolean} animate
|
||||
* @property {module:ol/transform~Transform} coordinateToPixelTransform
|
||||
* @property {null|module:ol/extent~Extent} extent
|
||||
* @property {module:ol/coordinate~Coordinate} focus
|
||||
* @property {import("./transform.js").Transform} coordinateToPixelTransform
|
||||
* @property {null|import("./extent.js").Extent} extent
|
||||
* @property {import("./coordinate.js").Coordinate} focus
|
||||
* @property {number} index
|
||||
* @property {Object<number, module:ol/layer/Layer~State>} layerStates
|
||||
* @property {Array<module:ol/layer/Layer~State>} layerStatesArray
|
||||
* @property {module:ol/transform~Transform} pixelToCoordinateTransform
|
||||
* @property {Array<module:ol/PluggableMap~PostRenderFunction>} postRenderFunctions
|
||||
* @property {module:ol/size~Size} size
|
||||
* @property {Object<string, import("./layer/Layer.js").State>} layerStates
|
||||
* @property {Array<import("./layer/Layer.js").State>} layerStatesArray
|
||||
* @property {import("./transform.js").Transform} pixelToCoordinateTransform
|
||||
* @property {Array<PostRenderFunction>} postRenderFunctions
|
||||
* @property {import("./size.js").Size} size
|
||||
* @property {!Object<string, boolean>} skippedFeatureUids
|
||||
* @property {module:ol/TileQueue} tileQueue
|
||||
* @property {Object<string, Object<string, module:ol/TileRange>>} usedTiles
|
||||
* @property {TileQueue} tileQueue
|
||||
* @property {Object<string, Object<string, import("./TileRange.js").default>>} usedTiles
|
||||
* @property {Array<number>} viewHints
|
||||
* @property {!Object<string, Object<string, boolean>>} wantedTiles
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {function(module:ol/PluggableMap, ?module:ol/PluggableMap~FrameState): boolean} PostRenderFunction
|
||||
* @typedef {function(PluggableMap, ?FrameState): boolean} PostRenderFunction
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {Object} AtPixelOptions
|
||||
* @property {undefined|function(module:ol/layer/Layer): boolean} layerFilter Layer filter
|
||||
* @property {undefined|function(import("./layer/Layer.js").default): boolean} layerFilter Layer filter
|
||||
* function. The filter function will receive one argument, the
|
||||
* {@link module:ol/layer/Layer layer-candidate} and it should return a boolean value.
|
||||
* Only layers which are visible and for which this function returns `true`
|
||||
@@ -75,10 +75,10 @@ import {create as createTransform, apply as applyTransform} from './transform.js
|
||||
|
||||
/**
|
||||
* @typedef {Object} MapOptionsInternal
|
||||
* @property {module:ol/Collection<module:ol/control/Control>} [controls]
|
||||
* @property {module:ol/Collection<module:ol/interaction/Interaction>} [interactions]
|
||||
* @property {Collection<import("./control/Control.js").default>} [controls]
|
||||
* @property {Collection<import("./interaction/Interaction.js").default>} [interactions]
|
||||
* @property {HTMLElement|Document} keyboardEventTarget
|
||||
* @property {module:ol/Collection<module:ol/Overlay>} overlays
|
||||
* @property {Collection<import("./Overlay.js").default>} overlays
|
||||
* @property {Object<string, *>} values
|
||||
*/
|
||||
|
||||
@@ -86,12 +86,12 @@ import {create as createTransform, apply as applyTransform} from './transform.js
|
||||
/**
|
||||
* Object literal with config options for the map.
|
||||
* @typedef {Object} MapOptions
|
||||
* @property {module:ol/Collection<module:ol/control/Control>|Array<module:ol/control/Control>} [controls]
|
||||
* @property {Collection<import("./control/Control.js").default>|Array<import("./control/Control.js").default>} [controls]
|
||||
* Controls initially added to the map. If not specified,
|
||||
* {@link module:ol/control/util~defaults} is used.
|
||||
* {@link module:ol/control~defaults} is used.
|
||||
* @property {number} [pixelRatio=window.devicePixelRatio] The ratio between
|
||||
* physical pixels and device-independent pixels (dips) on the device.
|
||||
* @property {module:ol/Collection<module:ol/interaction/Interaction>|Array<module:ol/interaction/Interaction>} [interactions]
|
||||
* @property {Collection<import("./interaction/Interaction.js").default>|Array<import("./interaction/Interaction.js").default>} [interactions]
|
||||
* Interactions that are initially added to the map. If not specified,
|
||||
* {@link module:ol/interaction~defaults} is used.
|
||||
* @property {HTMLElement|Document|string} [keyboardEventTarget] The element to
|
||||
@@ -102,7 +102,7 @@ import {create as createTransform, apply as applyTransform} from './transform.js
|
||||
* map target (i.e. the user-provided div for the map). If this is not
|
||||
* `document`, the target element needs to be focused for key events to be
|
||||
* emitted, requiring that the target element has a `tabindex` attribute.
|
||||
* @property {Array<module:ol/layer/Base>|module:ol/Collection<module:ol/layer/Base>} [layers]
|
||||
* @property {Array<import("./layer/Base.js").default>|Collection<import("./layer/Base.js").default>|LayerGroup} [layers]
|
||||
* Layers. If this is not defined, a map with no layers will be rendered. Note
|
||||
* that layers are rendered in the order supplied, so if you want, for example,
|
||||
* a vector layer to appear on top of a tile layer, it must come after the tile
|
||||
@@ -119,21 +119,21 @@ import {create as createTransform, apply as applyTransform} from './transform.js
|
||||
* @property {number} [moveTolerance=1] The minimum distance in pixels the
|
||||
* cursor must move to be detected as a map move event instead of a click.
|
||||
* Increasing this value can make it easier to click on the map.
|
||||
* @property {module:ol/Collection<module:ol/Overlay>|Array<module:ol/Overlay>} [overlays]
|
||||
* @property {Collection<import("./Overlay.js").default>|Array<import("./Overlay.js").default>} [overlays]
|
||||
* Overlays initially added to the map. By default, no overlays are added.
|
||||
* @property {HTMLElement|string} [target] The container for the map, either the
|
||||
* element itself or the `id` of the element. If not specified at construction
|
||||
* time, {@link module:ol/Map~Map#setTarget} must be called for the map to be
|
||||
* rendered.
|
||||
* @property {module:ol/View} [view] The map's view. No layer sources will be
|
||||
* @property {View} [view] The map's view. No layer sources will be
|
||||
* fetched unless this is specified at construction time or through
|
||||
* {@link module:ol/Map~Map#setView}.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @fires module:ol/MapBrowserEvent~MapBrowserEvent
|
||||
* @fires module:ol/MapEvent~MapEvent
|
||||
* @fires import("./MapBrowserEvent.js").MapBrowserEvent
|
||||
* @fires import("./MapEvent.js").MapEvent
|
||||
* @fires module:ol/render/Event~RenderEvent#postcompose
|
||||
* @fires module:ol/render/Event~RenderEvent#precompose
|
||||
* @fires module:ol/render/Event~RenderEvent#rendercomplete
|
||||
@@ -142,7 +142,7 @@ import {create as createTransform, apply as applyTransform} from './transform.js
|
||||
class PluggableMap extends BaseObject {
|
||||
|
||||
/**
|
||||
* @param {module:ol/PluggableMap~MapOptions} options Map options.
|
||||
* @param {MapOptions} options Map options.
|
||||
*/
|
||||
constructor(options) {
|
||||
|
||||
@@ -195,13 +195,13 @@ class PluggableMap extends BaseObject {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/transform~Transform}
|
||||
* @type {import("./transform.js").Transform}
|
||||
*/
|
||||
this.coordinateToPixelTransform_ = createTransform();
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/transform~Transform}
|
||||
* @type {import("./transform.js").Transform}
|
||||
*/
|
||||
this.pixelToCoordinateTransform_ = createTransform();
|
||||
|
||||
@@ -213,32 +213,32 @@ class PluggableMap extends BaseObject {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {?module:ol/PluggableMap~FrameState}
|
||||
* @type {?FrameState}
|
||||
*/
|
||||
this.frameState_ = null;
|
||||
|
||||
/**
|
||||
* The extent at the previous 'moveend' event.
|
||||
* @private
|
||||
* @type {module:ol/extent~Extent}
|
||||
* @type {import("./extent.js").Extent}
|
||||
*/
|
||||
this.previousExtent_ = null;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {?module:ol/events~EventsKey}
|
||||
* @type {?import("./events.js").EventsKey}
|
||||
*/
|
||||
this.viewPropertyListenerKey_ = null;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {?module:ol/events~EventsKey}
|
||||
* @type {?import("./events.js").EventsKey}
|
||||
*/
|
||||
this.viewChangeListenerKey_ = null;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array<module:ol/events~EventsKey>}
|
||||
* @type {Array<import("./events.js").EventsKey>}
|
||||
*/
|
||||
this.layerGroupPropertyListenerKeys_ = null;
|
||||
|
||||
@@ -287,7 +287,7 @@ class PluggableMap extends BaseObject {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/MapBrowserEventHandler}
|
||||
* @type {MapBrowserEventHandler}
|
||||
*/
|
||||
this.mapBrowserEventHandler_ = new MapBrowserEventHandler(this, options.moveTolerance);
|
||||
for (const key in MapBrowserEventType) {
|
||||
@@ -303,7 +303,7 @@ class PluggableMap extends BaseObject {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array<module:ol/events~EventsKey>}
|
||||
* @type {Array<import("./events.js").EventsKey>}
|
||||
*/
|
||||
this.keyHandlerKeys_ = null;
|
||||
|
||||
@@ -312,19 +312,19 @@ class PluggableMap extends BaseObject {
|
||||
listen(this.viewport_, EventType.MOUSEWHEEL, this.handleBrowserEvent, this);
|
||||
|
||||
/**
|
||||
* @type {module:ol/Collection<module:ol/control/Control>}
|
||||
* @type {Collection<import("./control/Control.js").default>}
|
||||
* @protected
|
||||
*/
|
||||
this.controls = optionsInternal.controls || new Collection();
|
||||
|
||||
/**
|
||||
* @type {module:ol/Collection<module:ol/interaction/Interaction>}
|
||||
* @type {Collection<import("./interaction/Interaction.js").default>}
|
||||
* @protected
|
||||
*/
|
||||
this.interactions = optionsInternal.interactions || new Collection();
|
||||
|
||||
/**
|
||||
* @type {module:ol/Collection<module:ol/Overlay>}
|
||||
* @type {Collection<import("./Overlay.js").default>}
|
||||
* @private
|
||||
*/
|
||||
this.overlays_ = optionsInternal.overlays;
|
||||
@@ -332,12 +332,12 @@ class PluggableMap extends BaseObject {
|
||||
/**
|
||||
* A lookup of overlays by id.
|
||||
* @private
|
||||
* @type {Object<string, module:ol/Overlay>}
|
||||
* @type {Object<string, import("./Overlay.js").default>}
|
||||
*/
|
||||
this.overlayIdIndex_ = {};
|
||||
|
||||
/**
|
||||
* @type {module:ol/renderer/Map}
|
||||
* @type {import("./renderer/Map.js").default}
|
||||
* @private
|
||||
*/
|
||||
this.renderer_ = this.createRenderer();
|
||||
@@ -350,19 +350,19 @@ class PluggableMap extends BaseObject {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/coordinate~Coordinate}
|
||||
* @type {import("./coordinate.js").Coordinate}
|
||||
*/
|
||||
this.focus_ = null;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {!Array<module:ol/PluggableMap~PostRenderFunction>}
|
||||
* @type {!Array<PostRenderFunction>}
|
||||
*/
|
||||
this.postRenderFunctions_ = [];
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/TileQueue}
|
||||
* @type {TileQueue}
|
||||
*/
|
||||
this.tileQueue_ = new TileQueue(
|
||||
this.getTilePriority.bind(this),
|
||||
@@ -391,8 +391,8 @@ class PluggableMap extends BaseObject {
|
||||
|
||||
this.controls.forEach(
|
||||
/**
|
||||
* @param {module:ol/control/Control} control Control.
|
||||
* @this {module:ol/PluggableMap}
|
||||
* @param {import("./control/Control.js").default} control Control.
|
||||
* @this {PluggableMap}
|
||||
*/
|
||||
(function(control) {
|
||||
control.setMap(this);
|
||||
@@ -400,7 +400,7 @@ class PluggableMap extends BaseObject {
|
||||
|
||||
listen(this.controls, CollectionEventType.ADD,
|
||||
/**
|
||||
* @param {module:ol/Collection~CollectionEvent} event CollectionEvent.
|
||||
* @param {import("./Collection.js").CollectionEvent} event CollectionEvent.
|
||||
*/
|
||||
function(event) {
|
||||
event.element.setMap(this);
|
||||
@@ -408,7 +408,7 @@ class PluggableMap extends BaseObject {
|
||||
|
||||
listen(this.controls, CollectionEventType.REMOVE,
|
||||
/**
|
||||
* @param {module:ol/Collection~CollectionEvent} event CollectionEvent.
|
||||
* @param {import("./Collection.js").CollectionEvent} event CollectionEvent.
|
||||
*/
|
||||
function(event) {
|
||||
event.element.setMap(null);
|
||||
@@ -416,8 +416,8 @@ class PluggableMap extends BaseObject {
|
||||
|
||||
this.interactions.forEach(
|
||||
/**
|
||||
* @param {module:ol/interaction/Interaction} interaction Interaction.
|
||||
* @this {module:ol/PluggableMap}
|
||||
* @param {import("./interaction/Interaction.js").default} interaction Interaction.
|
||||
* @this {PluggableMap}
|
||||
*/
|
||||
(function(interaction) {
|
||||
interaction.setMap(this);
|
||||
@@ -425,7 +425,7 @@ class PluggableMap extends BaseObject {
|
||||
|
||||
listen(this.interactions, CollectionEventType.ADD,
|
||||
/**
|
||||
* @param {module:ol/Collection~CollectionEvent} event CollectionEvent.
|
||||
* @param {import("./Collection.js").CollectionEvent} event CollectionEvent.
|
||||
*/
|
||||
function(event) {
|
||||
event.element.setMap(this);
|
||||
@@ -433,7 +433,7 @@ class PluggableMap extends BaseObject {
|
||||
|
||||
listen(this.interactions, CollectionEventType.REMOVE,
|
||||
/**
|
||||
* @param {module:ol/Collection~CollectionEvent} event CollectionEvent.
|
||||
* @param {import("./Collection.js").CollectionEvent} event CollectionEvent.
|
||||
*/
|
||||
function(event) {
|
||||
event.element.setMap(null);
|
||||
@@ -443,18 +443,18 @@ class PluggableMap extends BaseObject {
|
||||
|
||||
listen(this.overlays_, CollectionEventType.ADD,
|
||||
/**
|
||||
* @param {module:ol/Collection~CollectionEvent} event CollectionEvent.
|
||||
* @param {import("./Collection.js").CollectionEvent} event CollectionEvent.
|
||||
*/
|
||||
function(event) {
|
||||
this.addOverlayInternal_(/** @type {module:ol/Overlay} */ (event.element));
|
||||
this.addOverlayInternal_(/** @type {import("./Overlay.js").default} */ (event.element));
|
||||
}, this);
|
||||
|
||||
listen(this.overlays_, CollectionEventType.REMOVE,
|
||||
/**
|
||||
* @param {module:ol/Collection~CollectionEvent} event CollectionEvent.
|
||||
* @param {import("./Collection.js").CollectionEvent} event CollectionEvent.
|
||||
*/
|
||||
function(event) {
|
||||
const overlay = /** @type {module:ol/Overlay} */ (event.element);
|
||||
const overlay = /** @type {import("./Overlay.js").default} */ (event.element);
|
||||
const id = overlay.getId();
|
||||
if (id !== undefined) {
|
||||
delete this.overlayIdIndex_[id.toString()];
|
||||
@@ -464,13 +464,17 @@ class PluggableMap extends BaseObject {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @return {import("./renderer/Map.js").default} The map renderer
|
||||
*/
|
||||
createRenderer() {
|
||||
throw new Error('Use a map type that has a createRenderer method');
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the given control to the map.
|
||||
* @param {module:ol/control/Control} control Control.
|
||||
* @param {import("./control/Control.js").default} control Control.
|
||||
* @api
|
||||
*/
|
||||
addControl(control) {
|
||||
@@ -479,7 +483,7 @@ class PluggableMap extends BaseObject {
|
||||
|
||||
/**
|
||||
* Add the given interaction to the map.
|
||||
* @param {module:ol/interaction/Interaction} interaction Interaction to add.
|
||||
* @param {import("./interaction/Interaction.js").default} interaction Interaction to add.
|
||||
* @api
|
||||
*/
|
||||
addInteraction(interaction) {
|
||||
@@ -490,7 +494,7 @@ class PluggableMap extends BaseObject {
|
||||
* Adds the given layer to the top of this map. If you want to add a layer
|
||||
* elsewhere in the stack, use `getLayers()` and the methods available on
|
||||
* {@link module:ol/Collection~Collection}.
|
||||
* @param {module:ol/layer/Base} layer Layer.
|
||||
* @param {import("./layer/Base.js").default} layer Layer.
|
||||
* @api
|
||||
*/
|
||||
addLayer(layer) {
|
||||
@@ -500,7 +504,7 @@ class PluggableMap extends BaseObject {
|
||||
|
||||
/**
|
||||
* Add the given overlay to the map.
|
||||
* @param {module:ol/Overlay} overlay Overlay.
|
||||
* @param {import("./Overlay.js").default} overlay Overlay.
|
||||
* @api
|
||||
*/
|
||||
addOverlay(overlay) {
|
||||
@@ -509,7 +513,7 @@ class PluggableMap extends BaseObject {
|
||||
|
||||
/**
|
||||
* This deals with map's overlay collection changes.
|
||||
* @param {module:ol/Overlay} overlay Overlay.
|
||||
* @param {import("./Overlay.js").default} overlay Overlay.
|
||||
* @private
|
||||
*/
|
||||
addOverlayInternal_(overlay) {
|
||||
@@ -545,16 +549,16 @@ class PluggableMap extends BaseObject {
|
||||
* Detect features that intersect a pixel on the viewport, and execute a
|
||||
* callback with each intersecting feature. Layers included in the detection can
|
||||
* be configured through the `layerFilter` option in `opt_options`.
|
||||
* @param {module:ol/pixel~Pixel} pixel Pixel.
|
||||
* @param {function(this: S, (module:ol/Feature|module:ol/render/Feature),
|
||||
* module:ol/layer/Layer): T} callback Feature callback. The callback will be
|
||||
* @param {import("./pixel.js").Pixel} pixel Pixel.
|
||||
* @param {function(this: S, import("./Feature.js").FeatureLike,
|
||||
* import("./layer/Layer.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
|
||||
* unmanaged layers. To stop detection, callback functions can return a
|
||||
* truthy value.
|
||||
* @param {module:ol/PluggableMap~AtPixelOptions=} opt_options Optional options.
|
||||
* @param {AtPixelOptions=} opt_options Optional options.
|
||||
* @return {T|undefined} Callback result, i.e. the return value of last
|
||||
* callback execution, or the first truthy callback return value.
|
||||
* @template S,T
|
||||
@@ -565,7 +569,8 @@ class PluggableMap extends BaseObject {
|
||||
return;
|
||||
}
|
||||
const coordinate = this.getCoordinateFromPixel(pixel);
|
||||
opt_options = opt_options !== undefined ? opt_options : {};
|
||||
opt_options = opt_options !== undefined ? opt_options :
|
||||
/** @type {AtPixelOptions} */ ({});
|
||||
const hitTolerance = opt_options.hitTolerance !== undefined ?
|
||||
opt_options.hitTolerance * this.frameState_.pixelRatio : 0;
|
||||
const layerFilter = opt_options.layerFilter !== undefined ?
|
||||
@@ -577,9 +582,9 @@ class PluggableMap extends BaseObject {
|
||||
|
||||
/**
|
||||
* Get all features that intersect a pixel on the viewport.
|
||||
* @param {module:ol/pixel~Pixel} pixel Pixel.
|
||||
* @param {module:ol/PluggableMap~AtPixelOptions=} opt_options Optional options.
|
||||
* @return {Array<module:ol/Feature|module:ol/render/Feature>} The detected features or
|
||||
* @param {import("./pixel.js").Pixel} pixel Pixel.
|
||||
* @param {AtPixelOptions=} opt_options Optional options.
|
||||
* @return {Array<import("./Feature.js").FeatureLike>} The detected features or
|
||||
* `null` if none were found.
|
||||
* @api
|
||||
*/
|
||||
@@ -598,14 +603,14 @@ class PluggableMap extends BaseObject {
|
||||
* 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`.
|
||||
* @param {module:ol/pixel~Pixel} pixel Pixel.
|
||||
* @param {function(this: S, module:ol/layer/Layer, (Uint8ClampedArray|Uint8Array)): T} callback
|
||||
* @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
|
||||
* [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.
|
||||
* @param {module:ol/PluggableMap~AtPixelOptions=} opt_options Configuration options.
|
||||
* @param {AtPixelOptions=} opt_options Configuration options.
|
||||
* @return {T|undefined} Callback result, i.e. the return value of last
|
||||
* callback execution, or the first truthy callback return value.
|
||||
* @template S,T
|
||||
@@ -615,7 +620,7 @@ class PluggableMap extends BaseObject {
|
||||
if (!this.frameState_) {
|
||||
return;
|
||||
}
|
||||
const options = opt_options || {};
|
||||
const options = opt_options || /** @type {AtPixelOptions} */ ({});
|
||||
const hitTolerance = options.hitTolerance !== undefined ?
|
||||
opt_options.hitTolerance * this.frameState_.pixelRatio : 0;
|
||||
const layerFilter = options.layerFilter || TRUE;
|
||||
@@ -626,8 +631,8 @@ class PluggableMap extends BaseObject {
|
||||
/**
|
||||
* Detect if features intersect a pixel on the viewport. Layers included in the
|
||||
* detection can be configured through `opt_layerFilter`.
|
||||
* @param {module:ol/pixel~Pixel} pixel Pixel.
|
||||
* @param {module:ol/PluggableMap~AtPixelOptions=} opt_options Optional options.
|
||||
* @param {import("./pixel.js").Pixel} pixel Pixel.
|
||||
* @param {AtPixelOptions=} opt_options Optional options.
|
||||
* @return {boolean} Is there a feature at the given pixel?
|
||||
* @template U
|
||||
* @api
|
||||
@@ -637,7 +642,8 @@ class PluggableMap extends BaseObject {
|
||||
return false;
|
||||
}
|
||||
const coordinate = this.getCoordinateFromPixel(pixel);
|
||||
opt_options = opt_options !== undefined ? opt_options : {};
|
||||
opt_options = opt_options !== undefined ? opt_options :
|
||||
/** @type {AtPixelOptions} */ ({});
|
||||
const layerFilter = opt_options.layerFilter !== undefined ? opt_options.layerFilter : TRUE;
|
||||
const hitTolerance = opt_options.hitTolerance !== undefined ?
|
||||
opt_options.hitTolerance * this.frameState_.pixelRatio : 0;
|
||||
@@ -648,7 +654,7 @@ class PluggableMap extends BaseObject {
|
||||
/**
|
||||
* Returns the coordinate in view projection for a browser event.
|
||||
* @param {Event} event Event.
|
||||
* @return {module:ol/coordinate~Coordinate} Coordinate.
|
||||
* @return {import("./coordinate.js").Coordinate} Coordinate.
|
||||
* @api
|
||||
*/
|
||||
getEventCoordinate(event) {
|
||||
@@ -657,13 +663,16 @@ class PluggableMap extends BaseObject {
|
||||
|
||||
/**
|
||||
* Returns the map pixel position for a browser event relative to the viewport.
|
||||
* @param {Event} event Event.
|
||||
* @return {module:ol/pixel~Pixel} Pixel.
|
||||
* @param {Event|TouchEvent} event Event.
|
||||
* @return {import("./pixel.js").Pixel} Pixel.
|
||||
* @api
|
||||
*/
|
||||
getEventPixel(event) {
|
||||
const viewportPosition = this.viewport_.getBoundingClientRect();
|
||||
const eventPosition = event.changedTouches ? event.changedTouches[0] : event;
|
||||
const eventPosition = 'changedTouches' in event ?
|
||||
/** @type {TouchEvent} */ (event).changedTouches[0] :
|
||||
/** @type {MouseEvent} */ (event);
|
||||
|
||||
return [
|
||||
eventPosition.clientX - viewportPosition.left,
|
||||
eventPosition.clientY - viewportPosition.top
|
||||
@@ -702,8 +711,8 @@ class PluggableMap extends BaseObject {
|
||||
/**
|
||||
* Get the coordinate for a given pixel. This returns a coordinate in the
|
||||
* map view projection.
|
||||
* @param {module:ol/pixel~Pixel} pixel Pixel position in the map viewport.
|
||||
* @return {module:ol/coordinate~Coordinate} The coordinate for the pixel position.
|
||||
* @param {import("./pixel.js").Pixel} pixel Pixel position in the map viewport.
|
||||
* @return {import("./coordinate.js").Coordinate} The coordinate for the pixel position.
|
||||
* @api
|
||||
*/
|
||||
getCoordinateFromPixel(pixel) {
|
||||
@@ -718,7 +727,7 @@ class PluggableMap extends BaseObject {
|
||||
/**
|
||||
* Get the map controls. Modifying this collection changes the controls
|
||||
* associated with the map.
|
||||
* @return {module:ol/Collection<module:ol/control/Control>} Controls.
|
||||
* @return {Collection<import("./control/Control.js").default>} Controls.
|
||||
* @api
|
||||
*/
|
||||
getControls() {
|
||||
@@ -728,7 +737,7 @@ class PluggableMap extends BaseObject {
|
||||
/**
|
||||
* Get the map overlays. Modifying this collection changes the overlays
|
||||
* associated with the map.
|
||||
* @return {module:ol/Collection<module:ol/Overlay>} Overlays.
|
||||
* @return {Collection<import("./Overlay.js").default>} Overlays.
|
||||
* @api
|
||||
*/
|
||||
getOverlays() {
|
||||
@@ -740,7 +749,7 @@ class PluggableMap extends BaseObject {
|
||||
* Note that the index treats string and numeric identifiers as the same. So
|
||||
* `map.getOverlayById(2)` will return an overlay with id `'2'` or `2`.
|
||||
* @param {string|number} id Overlay identifier.
|
||||
* @return {module:ol/Overlay} Overlay.
|
||||
* @return {import("./Overlay.js").default} Overlay.
|
||||
* @api
|
||||
*/
|
||||
getOverlayById(id) {
|
||||
@@ -753,7 +762,7 @@ class PluggableMap extends BaseObject {
|
||||
* associated with the map.
|
||||
*
|
||||
* Interactions are used for e.g. pan, zoom and rotate.
|
||||
* @return {module:ol/Collection<module:ol/interaction/Interaction>} Interactions.
|
||||
* @return {Collection<import("./interaction/Interaction.js").default>} Interactions.
|
||||
* @api
|
||||
*/
|
||||
getInteractions() {
|
||||
@@ -762,19 +771,19 @@ class PluggableMap extends BaseObject {
|
||||
|
||||
/**
|
||||
* Get the layergroup associated with this map.
|
||||
* @return {module:ol/layer/Group} A layer group containing the layers in this map.
|
||||
* @return {LayerGroup} A layer group containing the layers in this map.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
getLayerGroup() {
|
||||
return (
|
||||
/** @type {module:ol/layer/Group} */ (this.get(MapProperty.LAYERGROUP))
|
||||
/** @type {LayerGroup} */ (this.get(MapProperty.LAYERGROUP))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the collection of layers associated with this map.
|
||||
* @return {!module:ol/Collection<module:ol/layer/Base>} Layers.
|
||||
* @return {!Collection<import("./layer/Base.js").default>} Layers.
|
||||
* @api
|
||||
*/
|
||||
getLayers() {
|
||||
@@ -785,8 +794,8 @@ class PluggableMap extends BaseObject {
|
||||
/**
|
||||
* Get the pixel for a coordinate. This takes a coordinate in the map view
|
||||
* projection and returns the corresponding pixel.
|
||||
* @param {module:ol/coordinate~Coordinate} coordinate A map coordinate.
|
||||
* @return {module:ol/pixel~Pixel} A pixel position in the map viewport.
|
||||
* @param {import("./coordinate.js").Coordinate} coordinate A map coordinate.
|
||||
* @return {import("./pixel.js").Pixel} A pixel position in the map viewport.
|
||||
* @api
|
||||
*/
|
||||
getPixelFromCoordinate(coordinate) {
|
||||
@@ -800,7 +809,7 @@ class PluggableMap extends BaseObject {
|
||||
|
||||
/**
|
||||
* Get the map renderer.
|
||||
* @return {module:ol/renderer/Map} Renderer
|
||||
* @return {import("./renderer/Map.js").default} Renderer
|
||||
*/
|
||||
getRenderer() {
|
||||
return this.renderer_;
|
||||
@@ -808,26 +817,26 @@ class PluggableMap extends BaseObject {
|
||||
|
||||
/**
|
||||
* Get the size of this map.
|
||||
* @return {module:ol/size~Size|undefined} The size in pixels of the map in the DOM.
|
||||
* @return {import("./size.js").Size|undefined} The size in pixels of the map in the DOM.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
getSize() {
|
||||
return (
|
||||
/** @type {module:ol/size~Size|undefined} */ (this.get(MapProperty.SIZE))
|
||||
/** @type {import("./size.js").Size|undefined} */ (this.get(MapProperty.SIZE))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the view associated with this map. A view manages properties such as
|
||||
* center and resolution.
|
||||
* @return {module:ol/View} The view that controls this map.
|
||||
* @return {View} The view that controls this map.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
getView() {
|
||||
return (
|
||||
/** @type {module:ol/View} */ (this.get(MapProperty.VIEW))
|
||||
/** @type {View} */ (this.get(MapProperty.VIEW))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -863,9 +872,9 @@ class PluggableMap extends BaseObject {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/Tile} tile Tile.
|
||||
* @param {import("./Tile.js").default} tile Tile.
|
||||
* @param {string} tileSourceKey Tile source key.
|
||||
* @param {module:ol/coordinate~Coordinate} tileCenter Tile center.
|
||||
* @param {import("./coordinate.js").Coordinate} tileCenter Tile center.
|
||||
* @param {number} tileResolution Tile resolution.
|
||||
* @return {number} Tile priority.
|
||||
*/
|
||||
@@ -902,7 +911,7 @@ class PluggableMap extends BaseObject {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent The event to handle.
|
||||
* @param {MapBrowserEvent} mapBrowserEvent The event to handle.
|
||||
*/
|
||||
handleMapBrowserEvent(mapBrowserEvent) {
|
||||
if (!this.frameState_) {
|
||||
@@ -963,7 +972,7 @@ class PluggableMap extends BaseObject {
|
||||
tileQueue.loadMoreTiles(maxTotalLoading, maxNewLoads);
|
||||
}
|
||||
}
|
||||
if (frameState && this.hasListener(MapEventType.RENDERCOMPLETE) && !frameState.animate &&
|
||||
if (frameState && this.hasListener(RenderEventType.RENDERCOMPLETE) && !frameState.animate &&
|
||||
!this.tileQueue_.getTilesLoading() && !getLoading(this.getLayers().getArray())) {
|
||||
this.renderer_.dispatchRenderEvent(RenderEventType.RENDERCOMPLETE, frameState);
|
||||
}
|
||||
@@ -1022,7 +1031,7 @@ class PluggableMap extends BaseObject {
|
||||
|
||||
if (!this.handleResize_) {
|
||||
this.handleResize_ = this.updateSize.bind(this);
|
||||
addEventListener(EventType.RESIZE, this.handleResize_, false);
|
||||
window.addEventListener(EventType.RESIZE, this.handleResize_, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1122,8 +1131,8 @@ class PluggableMap extends BaseObject {
|
||||
|
||||
/**
|
||||
* Remove the given control from the map.
|
||||
* @param {module:ol/control/Control} control Control.
|
||||
* @return {module:ol/control/Control|undefined} The removed control (or undefined
|
||||
* @param {import("./control/Control.js").default} control Control.
|
||||
* @return {import("./control/Control.js").default|undefined} The removed control (or undefined
|
||||
* if the control was not found).
|
||||
* @api
|
||||
*/
|
||||
@@ -1133,8 +1142,8 @@ class PluggableMap extends BaseObject {
|
||||
|
||||
/**
|
||||
* Remove the given interaction from the map.
|
||||
* @param {module:ol/interaction/Interaction} interaction Interaction to remove.
|
||||
* @return {module:ol/interaction/Interaction|undefined} The removed interaction (or
|
||||
* @param {import("./interaction/Interaction.js").default} interaction Interaction to remove.
|
||||
* @return {import("./interaction/Interaction.js").default|undefined} The removed interaction (or
|
||||
* undefined if the interaction was not found).
|
||||
* @api
|
||||
*/
|
||||
@@ -1144,8 +1153,8 @@ class PluggableMap extends BaseObject {
|
||||
|
||||
/**
|
||||
* Removes the given layer from the map.
|
||||
* @param {module:ol/layer/Base} layer Layer.
|
||||
* @return {module:ol/layer/Base|undefined} The removed layer (or undefined if the
|
||||
* @param {import("./layer/Base.js").default} layer Layer.
|
||||
* @return {import("./layer/Base.js").default|undefined} The removed layer (or undefined if the
|
||||
* layer was not found).
|
||||
* @api
|
||||
*/
|
||||
@@ -1156,8 +1165,8 @@ class PluggableMap extends BaseObject {
|
||||
|
||||
/**
|
||||
* Remove the given overlay from the map.
|
||||
* @param {module:ol/Overlay} overlay Overlay.
|
||||
* @return {module:ol/Overlay|undefined} The removed overlay (or undefined
|
||||
* @param {import("./Overlay.js").default} overlay Overlay.
|
||||
* @return {import("./Overlay.js").default|undefined} The removed overlay (or undefined
|
||||
* if the overlay was not found).
|
||||
* @api
|
||||
*/
|
||||
@@ -1176,7 +1185,7 @@ class PluggableMap extends BaseObject {
|
||||
const view = this.getView();
|
||||
const extent = createEmpty();
|
||||
const previousFrameState = this.frameState_;
|
||||
/** @type {?module:ol/PluggableMap~FrameState} */
|
||||
/** @type {?FrameState} */
|
||||
let frameState = null;
|
||||
if (size !== undefined && hasArea(size) && view && view.isDef()) {
|
||||
const viewHints = view.getHints(this.frameState_ ? this.frameState_.viewHints : undefined);
|
||||
@@ -1186,7 +1195,7 @@ class PluggableMap extends BaseObject {
|
||||
layerStates[getUid(layerStatesArray[i].layer)] = layerStatesArray[i];
|
||||
}
|
||||
viewState = view.getState(this.pixelRatio_);
|
||||
frameState = /** @type {module:ol/PluggableMap~FrameState} */ ({
|
||||
frameState = /** @type {FrameState} */ ({
|
||||
animate: false,
|
||||
coordinateToPixelTransform: this.coordinateToPixelTransform_,
|
||||
extent: extent,
|
||||
@@ -1252,7 +1261,7 @@ class PluggableMap extends BaseObject {
|
||||
|
||||
/**
|
||||
* Sets the layergroup of this map.
|
||||
* @param {module:ol/layer/Group} layerGroup A layer group containing the layers in this map.
|
||||
* @param {LayerGroup} layerGroup A layer group containing the layers in this map.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
@@ -1262,7 +1271,7 @@ class PluggableMap extends BaseObject {
|
||||
|
||||
/**
|
||||
* Set the size of this map.
|
||||
* @param {module:ol/size~Size|undefined} size The size in pixels of the map in the DOM.
|
||||
* @param {import("./size.js").Size|undefined} size The size in pixels of the map in the DOM.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
@@ -1283,7 +1292,7 @@ class PluggableMap extends BaseObject {
|
||||
|
||||
/**
|
||||
* Set the view for this map.
|
||||
* @param {module:ol/View} view The view that controls this map.
|
||||
* @param {View} view The view that controls this map.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
@@ -1292,11 +1301,10 @@ class PluggableMap extends BaseObject {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {import("./Feature.js").default} feature Feature.
|
||||
*/
|
||||
skipFeature(feature) {
|
||||
const featureUid = getUid(feature).toString();
|
||||
this.skippedFeatureUids_[featureUid] = true;
|
||||
this.skippedFeatureUids_[getUid(feature)] = true;
|
||||
this.render();
|
||||
}
|
||||
|
||||
@@ -1328,11 +1336,10 @@ class PluggableMap extends BaseObject {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {import("./Feature.js").default} feature Feature.
|
||||
*/
|
||||
unskipFeature(feature) {
|
||||
const featureUid = getUid(feature).toString();
|
||||
delete this.skippedFeatureUids_[featureUid];
|
||||
delete this.skippedFeatureUids_[getUid(feature)];
|
||||
this.render();
|
||||
}
|
||||
}
|
||||
@@ -1340,7 +1347,7 @@ class PluggableMap extends BaseObject {
|
||||
|
||||
/**
|
||||
* @param {MapOptions} options Map options.
|
||||
* @return {module:ol/PluggableMap~MapOptionsInternal} Internal map options.
|
||||
* @return {MapOptionsInternal} Internal map options.
|
||||
*/
|
||||
function createOptionsInternal(options) {
|
||||
|
||||
@@ -1359,8 +1366,8 @@ function createOptionsInternal(options) {
|
||||
*/
|
||||
const values = {};
|
||||
|
||||
const layerGroup = (options.layers instanceof LayerGroup) ?
|
||||
options.layers : new LayerGroup({layers: options.layers});
|
||||
const layerGroup = options.layers && typeof /** @type {?} */ (options.layers).getLayers === 'function' ?
|
||||
/** @type {LayerGroup} */ (options.layers) : new LayerGroup({layers: /** @type {Collection} */ (options.layers)});
|
||||
values[MapProperty.LAYERGROUP] = layerGroup;
|
||||
|
||||
values[MapProperty.TARGET] = options.target;
|
||||
@@ -1373,9 +1380,9 @@ function createOptionsInternal(options) {
|
||||
if (Array.isArray(options.controls)) {
|
||||
controls = new Collection(options.controls.slice());
|
||||
} else {
|
||||
assert(options.controls instanceof Collection,
|
||||
47); // Expected `controls` to be an array or an `module:ol/Collection~Collection`
|
||||
controls = options.controls;
|
||||
assert(typeof /** @type {?} */ (options.controls).getArray === 'function',
|
||||
47); // Expected `controls` to be an array or an `import("./Collection.js").Collection`
|
||||
controls = /** @type {Collection} */ (options.controls);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1384,9 +1391,9 @@ function createOptionsInternal(options) {
|
||||
if (Array.isArray(options.interactions)) {
|
||||
interactions = new Collection(options.interactions.slice());
|
||||
} else {
|
||||
assert(options.interactions instanceof Collection,
|
||||
48); // Expected `interactions` to be an array or an `module:ol/Collection~Collection`
|
||||
interactions = options.interactions;
|
||||
assert(typeof /** @type {?} */ (options.interactions).getArray === 'function',
|
||||
48); // Expected `interactions` to be an array or an `import("./Collection.js").Collection`
|
||||
interactions = /** @type {Collection} */ (options.interactions);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1395,8 +1402,8 @@ function createOptionsInternal(options) {
|
||||
if (Array.isArray(options.overlays)) {
|
||||
overlays = new Collection(options.overlays.slice());
|
||||
} else {
|
||||
assert(options.overlays instanceof Collection,
|
||||
49); // Expected `overlays` to be an array or an `module:ol/Collection~Collection`
|
||||
assert(typeof /** @type {?} */ (options.overlays).getArray === 'function',
|
||||
49); // Expected `overlays` to be an array or an `import("./Collection.js").Collection`
|
||||
overlays = options.overlays;
|
||||
}
|
||||
} else {
|
||||
@@ -1415,18 +1422,20 @@ function createOptionsInternal(options) {
|
||||
export default PluggableMap;
|
||||
|
||||
/**
|
||||
* @param {Array<module:ol/layer/Base>} layers Layers.
|
||||
* @param {Array<import("./layer/Base.js").default>} layers Layers.
|
||||
* @return {boolean} Layers have sources that are still loading.
|
||||
*/
|
||||
function getLoading(layers) {
|
||||
for (let i = 0, ii = layers.length; i < ii; ++i) {
|
||||
const layer = layers[i];
|
||||
if (layer instanceof LayerGroup) {
|
||||
return getLoading(layer.getLayers().getArray());
|
||||
}
|
||||
const source = layers[i].getSource();
|
||||
if (source && source.loading) {
|
||||
return true;
|
||||
if (typeof /** @type {?} */ (layer).getLayers === 'function') {
|
||||
return getLoading(/** @type {LayerGroup} */ (layer).getLayers().getArray());
|
||||
} else {
|
||||
const source = /** @type {import("./layer/Layer.js").default} */ (
|
||||
layer).getSource();
|
||||
if (source && source.loading) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -40,7 +40,7 @@ import EventType from './events/EventType.js';
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @typedef {function(module:ol/Tile, string)} LoadFunction
|
||||
* @typedef {function(Tile, string)} LoadFunction
|
||||
* @api
|
||||
*/
|
||||
|
||||
@@ -54,8 +54,8 @@ import EventType from './events/EventType.js';
|
||||
* and returns a `{string}` representing the tile URL, or undefined if no tile
|
||||
* should be requested for the passed tile coordinate.
|
||||
*
|
||||
* @typedef {function(module:ol/tilecoord~TileCoord, number,
|
||||
* module:ol/proj/Projection): (string|undefined)} UrlFunction
|
||||
* @typedef {function(import("./tilecoord.js").TileCoord, number,
|
||||
* import("./proj/Projection.js").default): (string|undefined)} UrlFunction
|
||||
* @api
|
||||
*/
|
||||
|
||||
@@ -77,9 +77,9 @@ import EventType from './events/EventType.js';
|
||||
class Tile extends EventTarget {
|
||||
|
||||
/**
|
||||
* @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate.
|
||||
* @param {module:ol/TileState} state State.
|
||||
* @param {module:ol/Tile~Options=} opt_options Tile options.
|
||||
* @param {import("./tilecoord.js").TileCoord} tileCoord Tile coordinate.
|
||||
* @param {TileState} state State.
|
||||
* @param {Options=} opt_options Tile options.
|
||||
*/
|
||||
constructor(tileCoord, state, opt_options) {
|
||||
super();
|
||||
@@ -87,13 +87,13 @@ class Tile extends EventTarget {
|
||||
const options = opt_options ? opt_options : {};
|
||||
|
||||
/**
|
||||
* @type {module:ol/tilecoord~TileCoord}
|
||||
* @type {import("./tilecoord.js").TileCoord}
|
||||
*/
|
||||
this.tileCoord = tileCoord;
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {module:ol/TileState}
|
||||
* @type {TileState}
|
||||
*/
|
||||
this.state = state;
|
||||
|
||||
@@ -101,7 +101,7 @@ class Tile extends EventTarget {
|
||||
* An "interim" tile for this tile. The interim tile may be used while this
|
||||
* one is loading, for "smooth" transitions when changing params/dimensions
|
||||
* on the source.
|
||||
* @type {module:ol/Tile}
|
||||
* @type {Tile}
|
||||
*/
|
||||
this.interimTile = null;
|
||||
|
||||
@@ -122,7 +122,7 @@ class Tile extends EventTarget {
|
||||
/**
|
||||
* Lookup of start times for rendering transitions. If the start time is
|
||||
* equal to -1, the transition is complete.
|
||||
* @type {Object<number, number>}
|
||||
* @type {Object<string, number>}
|
||||
*/
|
||||
this.transitionStarts_ = {};
|
||||
|
||||
@@ -146,7 +146,7 @@ class Tile extends EventTarget {
|
||||
* Get the interim tile most suitable for rendering using the chain of interim
|
||||
* tiles. This corresponds to the most recent tile that has been loaded, if no
|
||||
* such tile exists, the original tile is returned.
|
||||
* @return {!module:ol/Tile} Best tile for rendering.
|
||||
* @return {!Tile} Best tile for rendering.
|
||||
*/
|
||||
getInterimTile() {
|
||||
if (!this.interimTile) {
|
||||
@@ -180,7 +180,7 @@ class Tile extends EventTarget {
|
||||
}
|
||||
|
||||
let tile = this.interimTile;
|
||||
let prev = this;
|
||||
let prev = /** @type {Tile} */ (this);
|
||||
|
||||
do {
|
||||
if (tile.getState() == TileState.LOADED) {
|
||||
@@ -206,7 +206,7 @@ class Tile extends EventTarget {
|
||||
|
||||
/**
|
||||
* Get the tile coordinate for this tile.
|
||||
* @return {module:ol/tilecoord~TileCoord} The tile coordinate.
|
||||
* @return {import("./tilecoord.js").TileCoord} The tile coordinate.
|
||||
* @api
|
||||
*/
|
||||
getTileCoord() {
|
||||
@@ -214,7 +214,7 @@ class Tile extends EventTarget {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {module:ol/TileState} State.
|
||||
* @return {TileState} State.
|
||||
*/
|
||||
getState() {
|
||||
return this.state;
|
||||
@@ -225,7 +225,7 @@ class Tile extends EventTarget {
|
||||
* it is important to set the state correctly to {@link module:ol/TileState~ERROR}
|
||||
* when the tile cannot be loaded. Otherwise the tile cannot be removed from
|
||||
* the tile queue and will block other requests.
|
||||
* @param {module:ol/TileState} state State.
|
||||
* @param {TileState} state State.
|
||||
* @api
|
||||
*/
|
||||
setState(state) {
|
||||
@@ -244,7 +244,7 @@ class Tile extends EventTarget {
|
||||
|
||||
/**
|
||||
* Get the alpha value for rendering.
|
||||
* @param {number} id An id for the renderer.
|
||||
* @param {string} id An id for the renderer.
|
||||
* @param {number} time The render frame time.
|
||||
* @return {number} A number between 0 and 1.
|
||||
*/
|
||||
@@ -272,7 +272,7 @@ class Tile extends EventTarget {
|
||||
* Determine if a tile is in an alpha transition. A tile is considered in
|
||||
* transition if tile.getAlpha() has not yet been called or has been called
|
||||
* and returned 1.
|
||||
* @param {number} id An id for the renderer.
|
||||
* @param {string} id An id for the renderer.
|
||||
* @return {boolean} The tile is in transition.
|
||||
*/
|
||||
inTransition(id) {
|
||||
@@ -284,7 +284,7 @@ class Tile extends EventTarget {
|
||||
|
||||
/**
|
||||
* Mark a transition as complete.
|
||||
* @param {number} id An id for the renderer.
|
||||
* @param {string} id An id for the renderer.
|
||||
*/
|
||||
endTransition(id) {
|
||||
if (this.transition_) {
|
||||
|
||||
@@ -16,7 +16,7 @@ class TileCache extends LRUCache {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {!Object<string, module:ol/TileRange>} usedTiles Used tiles.
|
||||
* @param {!Object<string, import("./TileRange.js").default>} usedTiles Used tiles.
|
||||
*/
|
||||
expireCache(usedTiles) {
|
||||
while (this.canExpireCache()) {
|
||||
|
||||
@@ -8,14 +8,14 @@ import PriorityQueue from './structs/PriorityQueue.js';
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {function(module:ol/Tile, string, module:ol/coordinate~Coordinate, number): number} PriorityFunction
|
||||
* @typedef {function(import("./Tile.js").default, string, import("./coordinate.js").Coordinate, number): number} PriorityFunction
|
||||
*/
|
||||
|
||||
|
||||
class TileQueue extends PriorityQueue {
|
||||
|
||||
/**
|
||||
* @param {module:ol/TileQueue~PriorityFunction} tilePriorityFunction Tile priority function.
|
||||
* @param {PriorityFunction} tilePriorityFunction Tile priority function.
|
||||
* @param {function(): ?} tileChangeCallback Function called on each tile change event.
|
||||
*/
|
||||
constructor(tilePriorityFunction, tileChangeCallback) {
|
||||
@@ -33,7 +33,7 @@ class TileQueue extends PriorityQueue {
|
||||
* @return {string} Key.
|
||||
*/
|
||||
function(element) {
|
||||
return (/** @type {module:ol/Tile} */ (element[0]).getKey());
|
||||
return (/** @type {import("./Tile.js").default} */ (element[0]).getKey());
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -76,11 +76,11 @@ class TileQueue extends PriorityQueue {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/events/Event} event Event.
|
||||
* @param {import("./events/Event.js").default} event Event.
|
||||
* @protected
|
||||
*/
|
||||
handleTileChange(event) {
|
||||
const tile = /** @type {module:ol/Tile} */ (event.target);
|
||||
const tile = /** @type {import("./Tile.js").default} */ (event.target);
|
||||
const state = tile.getState();
|
||||
if (state === TileState.LOADED || state === TileState.ERROR ||
|
||||
state === TileState.EMPTY || state === TileState.ABORT) {
|
||||
@@ -104,7 +104,7 @@ class TileQueue extends PriorityQueue {
|
||||
let state, tile, tileKey;
|
||||
while (this.tilesLoading_ < maxTotalLoading && newLoads < maxNewLoads &&
|
||||
this.getCount() > 0) {
|
||||
tile = /** @type {module:ol/Tile} */ (this.dequeue()[0]);
|
||||
tile = /** @type {import("./Tile.js").default} */ (this.dequeue()[0]);
|
||||
tileKey = tile.getKey();
|
||||
state = tile.getState();
|
||||
if (state === TileState.ABORT) {
|
||||
|
||||
@@ -39,7 +39,7 @@ class TileRange {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate.
|
||||
* @param {import("./tilecoord.js").TileCoord} tileCoord Tile coordinate.
|
||||
* @return {boolean} Contains tile coordinate.
|
||||
*/
|
||||
contains(tileCoord) {
|
||||
@@ -47,7 +47,7 @@ class TileRange {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/TileRange} tileRange Tile range.
|
||||
* @param {TileRange} tileRange Tile range.
|
||||
* @return {boolean} Contains.
|
||||
*/
|
||||
containsTileRange(tileRange) {
|
||||
@@ -65,7 +65,7 @@ class TileRange {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/TileRange} tileRange Tile range.
|
||||
* @param {TileRange} tileRange Tile range.
|
||||
* @return {boolean} Equals.
|
||||
*/
|
||||
equals(tileRange) {
|
||||
@@ -74,7 +74,7 @@ class TileRange {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/TileRange} tileRange Tile range.
|
||||
* @param {TileRange} tileRange Tile range.
|
||||
*/
|
||||
extend(tileRange) {
|
||||
if (tileRange.minX < this.minX) {
|
||||
@@ -92,30 +92,30 @@ class TileRange {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {number} Height.
|
||||
*/
|
||||
* @return {number} Height.
|
||||
*/
|
||||
getHeight() {
|
||||
return this.maxY - this.minY + 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {module:ol/size~Size} Size.
|
||||
*/
|
||||
* @return {import("./size.js").Size} Size.
|
||||
*/
|
||||
getSize() {
|
||||
return [this.getWidth(), this.getHeight()];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {number} Width.
|
||||
*/
|
||||
* @return {number} Width.
|
||||
*/
|
||||
getWidth() {
|
||||
return this.maxX - this.minX + 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/TileRange} tileRange Tile range.
|
||||
* @return {boolean} Intersects.
|
||||
*/
|
||||
* @param {TileRange} tileRange Tile range.
|
||||
* @return {boolean} Intersects.
|
||||
*/
|
||||
intersects(tileRange) {
|
||||
return this.minX <= tileRange.maxX &&
|
||||
this.maxX >= tileRange.minX &&
|
||||
@@ -130,8 +130,8 @@ class TileRange {
|
||||
* @param {number} maxX Maximum X.
|
||||
* @param {number} minY Minimum Y.
|
||||
* @param {number} maxY Maximum Y.
|
||||
* @param {module:ol/TileRange=} tileRange TileRange.
|
||||
* @return {module:ol/TileRange} Tile range.
|
||||
* @param {TileRange=} tileRange TileRange.
|
||||
* @return {TileRange} Tile range.
|
||||
*/
|
||||
export function createOrUpdate(minX, maxX, minY, maxY, tileRange) {
|
||||
if (tileRange !== undefined) {
|
||||
|
||||
@@ -12,7 +12,6 @@ export default {
|
||||
/**
|
||||
* Indicates that tile loading failed
|
||||
* @type {number}
|
||||
* @api
|
||||
*/
|
||||
ERROR: 3,
|
||||
EMPTY: 4,
|
||||
|
||||
@@ -15,7 +15,7 @@ import {VOID} from './functions.js';
|
||||
/**
|
||||
* @typedef {Object} ReplayState
|
||||
* @property {boolean} dirty
|
||||
* @property {null|module:ol/render~OrderFunction} renderedRenderOrder
|
||||
* @property {null|import("./render.js").OrderFunction} renderedRenderOrder
|
||||
* @property {number} renderedTileRevision
|
||||
* @property {number} renderedRevision
|
||||
*/
|
||||
@@ -24,22 +24,21 @@ import {VOID} from './functions.js';
|
||||
class VectorImageTile extends Tile {
|
||||
|
||||
/**
|
||||
* @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate.
|
||||
* @param {module:ol/TileState} state State.
|
||||
* @param {import("./tilecoord.js").TileCoord} tileCoord Tile coordinate.
|
||||
* @param {TileState} state State.
|
||||
* @param {number} sourceRevision Source revision.
|
||||
* @param {module:ol/format/Feature} format Feature format.
|
||||
* @param {module:ol/Tile~LoadFunction} tileLoadFunction Tile load function.
|
||||
* @param {module:ol/tilecoord~TileCoord} urlTileCoord Wrapped tile coordinate for source urls.
|
||||
* @param {module:ol/Tile~UrlFunction} tileUrlFunction Tile url function.
|
||||
* @param {module:ol/tilegrid/TileGrid} sourceTileGrid Tile grid of the source.
|
||||
* @param {module:ol/tilegrid/TileGrid} tileGrid Tile grid of the renderer.
|
||||
* @param {Object<string, module:ol/VectorTile>} sourceTiles Source tiles.
|
||||
* @param {import("./format/Feature.js").default} format Feature format.
|
||||
* @param {import("./Tile.js").LoadFunction} tileLoadFunction Tile load function.
|
||||
* @param {import("./tilecoord.js").TileCoord} urlTileCoord Wrapped tile coordinate for source urls.
|
||||
* @param {import("./Tile.js").UrlFunction} tileUrlFunction Tile url function.
|
||||
* @param {import("./tilegrid/TileGrid.js").default} sourceTileGrid Tile grid of the source.
|
||||
* @param {import("./tilegrid/TileGrid.js").default} tileGrid Tile grid of the renderer.
|
||||
* @param {Object<string, import("./VectorTile.js").default>} sourceTiles Source tiles.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {module:ol/proj/Projection} projection Projection.
|
||||
* @param {function(new: module:ol/VectorTile, module:ol/tilecoord~TileCoord, module:ol/TileState, string,
|
||||
* module:ol/format/Feature, module:ol/Tile~LoadFunction)} tileClass Class to
|
||||
* @param {import("./proj/Projection.js").default} projection Projection.
|
||||
* @param {typeof import("./VectorTile.js").default} tileClass Class to
|
||||
* instantiate for source tiles.
|
||||
* @param {function(this: module:ol/source/VectorTile, module:ol/events/Event)} handleTileChange
|
||||
* @param {function(this: import("./source/VectorTile.js").default, import("./events/Event.js").default)} handleTileChange
|
||||
* Function to call when a source tile's state changes.
|
||||
* @param {number} zoom Integer zoom to render the tile for.
|
||||
*/
|
||||
@@ -57,19 +56,19 @@ class VectorImageTile extends Tile {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/featureloader~FeatureLoader}
|
||||
* @type {import("./featureloader.js").FeatureLoader}
|
||||
*/
|
||||
this.loader_;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {!Object<string, module:ol/VectorImageTile~ReplayState>}
|
||||
* @type {!Object<string, ReplayState>}
|
||||
*/
|
||||
this.replayState_ = {};
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Object<string, module:ol/VectorTile>}
|
||||
* @type {Object<string, import("./VectorTile.js").default>}
|
||||
*/
|
||||
this.sourceTiles_ = sourceTiles;
|
||||
|
||||
@@ -80,7 +79,7 @@ class VectorImageTile extends Tile {
|
||||
this.tileKeys = [];
|
||||
|
||||
/**
|
||||
* @type {module:ol/extent~Extent}
|
||||
* @type {import("./extent.js").Extent}
|
||||
*/
|
||||
this.extent = null;
|
||||
|
||||
@@ -90,17 +89,17 @@ class VectorImageTile extends Tile {
|
||||
this.sourceRevision_ = sourceRevision;
|
||||
|
||||
/**
|
||||
* @type {module:ol/tilecoord~TileCoord}
|
||||
* @type {import("./tilecoord.js").TileCoord}
|
||||
*/
|
||||
this.wrappedTileCoord = urlTileCoord;
|
||||
|
||||
/**
|
||||
* @type {Array<module:ol/events~EventsKey>}
|
||||
* @type {Array<import("./events.js").EventsKey>}
|
||||
*/
|
||||
this.loadListenerKeys_ = [];
|
||||
|
||||
/**
|
||||
* @type {Array<module:ol/events~EventsKey>}
|
||||
* @type {Array<import("./events.js").EventsKey>}
|
||||
*/
|
||||
this.sourceTileListenerKeys_ = [];
|
||||
|
||||
@@ -188,11 +187,11 @@ class VectorImageTile extends Tile {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/layer/Layer} layer Layer.
|
||||
* @param {import("./layer/Layer.js").default} layer Layer.
|
||||
* @return {CanvasRenderingContext2D} The rendering context.
|
||||
*/
|
||||
getContext(layer) {
|
||||
const key = getUid(layer).toString();
|
||||
const key = getUid(layer);
|
||||
if (!(key in this.context_)) {
|
||||
this.context_[key] = createCanvasContext2D();
|
||||
}
|
||||
@@ -201,7 +200,7 @@ class VectorImageTile extends Tile {
|
||||
|
||||
/**
|
||||
* Get the Canvas for this tile.
|
||||
* @param {module:ol/layer/Layer} layer Layer.
|
||||
* @param {import("./layer/Layer.js").default} layer Layer.
|
||||
* @return {HTMLCanvasElement} Canvas.
|
||||
*/
|
||||
getImage(layer) {
|
||||
@@ -210,11 +209,11 @@ class VectorImageTile extends Tile {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/layer/Layer} layer Layer.
|
||||
* @return {module:ol/VectorImageTile~ReplayState} The replay state.
|
||||
* @param {import("./layer/Layer.js").default} layer Layer.
|
||||
* @return {ReplayState} The replay state.
|
||||
*/
|
||||
getReplayState(layer) {
|
||||
const key = getUid(layer).toString();
|
||||
const key = getUid(layer);
|
||||
if (!(key in this.replayState_)) {
|
||||
this.replayState_[key] = {
|
||||
dirty: false,
|
||||
@@ -235,7 +234,7 @@ class VectorImageTile extends Tile {
|
||||
|
||||
/**
|
||||
* @param {string} tileKey Key (tileCoord) of the source tile.
|
||||
* @return {module:ol/VectorTile} Source tile.
|
||||
* @return {import("./VectorTile.js").default} Source tile.
|
||||
*/
|
||||
getTile(tileKey) {
|
||||
return this.sourceTiles_[tileKey];
|
||||
@@ -319,7 +318,7 @@ export default VectorImageTile;
|
||||
|
||||
/**
|
||||
* Sets the loader for a tile.
|
||||
* @param {module:ol/VectorTile} tile Vector tile.
|
||||
* @param {import("./VectorTile.js").default} tile Vector tile.
|
||||
* @param {string} url URL.
|
||||
*/
|
||||
export function defaultLoadFunction(tile, url) {
|
||||
|
||||
@@ -7,26 +7,20 @@ import TileState from './TileState.js';
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {module:ol/extent~Extent}
|
||||
* @type {import("./extent.js").Extent}
|
||||
*/
|
||||
const DEFAULT_EXTENT = [0, 0, 4096, 4096];
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {function(new: module:ol/VectorTile, module:ol/tilecoord~TileCoord,
|
||||
* module:ol/TileState, string, ?string, module:ol/Tile~LoadFunction)} TileClass
|
||||
* @api
|
||||
*/
|
||||
|
||||
class VectorTile extends Tile {
|
||||
|
||||
/**
|
||||
* @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate.
|
||||
* @param {module:ol/TileState} state State.
|
||||
* @param {import("./tilecoord.js").TileCoord} tileCoord Tile coordinate.
|
||||
* @param {TileState} state State.
|
||||
* @param {string} src Data source url.
|
||||
* @param {module:ol/format/Feature} format Feature format.
|
||||
* @param {module:ol/Tile~LoadFunction} tileLoadFunction Tile load function.
|
||||
* @param {module:ol/Tile~Options=} opt_options Tile options.
|
||||
* @param {import("./format/Feature.js").default} format Feature format.
|
||||
* @param {import("./Tile.js").LoadFunction} tileLoadFunction Tile load function.
|
||||
* @param {import("./Tile.js").Options=} opt_options Tile options.
|
||||
*/
|
||||
constructor(tileCoord, state, src, format, tileLoadFunction, opt_options) {
|
||||
|
||||
@@ -39,44 +33,44 @@ class VectorTile extends Tile {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/extent~Extent}
|
||||
* @type {import("./extent.js").Extent}
|
||||
*/
|
||||
this.extent_ = null;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/format/Feature}
|
||||
* @type {import("./format/Feature.js").default}
|
||||
*/
|
||||
this.format_ = format;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array<module:ol/Feature>}
|
||||
* @type {Array<import("./Feature.js").default>}
|
||||
*/
|
||||
this.features_ = null;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/featureloader~FeatureLoader}
|
||||
* @type {import("./featureloader.js").FeatureLoader}
|
||||
*/
|
||||
this.loader_;
|
||||
|
||||
/**
|
||||
* Data projection
|
||||
* @private
|
||||
* @type {module:ol/proj/Projection}
|
||||
* @type {import("./proj/Projection.js").default}
|
||||
*/
|
||||
this.projection_ = null;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Object<string, module:ol/render/ReplayGroup>}
|
||||
* @type {Object<string, import("./render/ReplayGroup.js").default>}
|
||||
*/
|
||||
this.replayGroups_ = {};
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/Tile~LoadFunction}
|
||||
* @type {import("./Tile.js").LoadFunction}
|
||||
*/
|
||||
this.tileLoadFunction_ = tileLoadFunction;
|
||||
|
||||
@@ -101,7 +95,7 @@ class VectorTile extends Tile {
|
||||
|
||||
/**
|
||||
* Gets the extent of the vector tile.
|
||||
* @return {module:ol/extent~Extent} The extent.
|
||||
* @return {import("./extent.js").Extent} The extent.
|
||||
* @api
|
||||
*/
|
||||
getExtent() {
|
||||
@@ -110,7 +104,7 @@ class VectorTile extends Tile {
|
||||
|
||||
/**
|
||||
* Get the feature format assigned for reading this tile's features.
|
||||
* @return {module:ol/format/Feature} Feature format.
|
||||
* @return {import("./format/Feature.js").default} Feature format.
|
||||
* @api
|
||||
*/
|
||||
getFormat() {
|
||||
@@ -120,7 +114,7 @@ class VectorTile extends Tile {
|
||||
/**
|
||||
* Get the features for this tile. Geometries will be in the projection returned
|
||||
* by {@link module:ol/VectorTile~VectorTile#getProjection}.
|
||||
* @return {Array<module:ol/Feature|module:ol/render/Feature>} Features.
|
||||
* @return {Array<import("./Feature.js").FeatureLike>} Features.
|
||||
* @api
|
||||
*/
|
||||
getFeatures() {
|
||||
@@ -137,7 +131,7 @@ class VectorTile extends Tile {
|
||||
/**
|
||||
* Get the feature projection of features returned by
|
||||
* {@link module:ol/VectorTile~VectorTile#getFeatures}.
|
||||
* @return {module:ol/proj/Projection} Feature projection.
|
||||
* @return {import("./proj/Projection.js").default} Feature projection.
|
||||
* @api
|
||||
*/
|
||||
getProjection() {
|
||||
@@ -145,9 +139,9 @@ class VectorTile extends Tile {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/layer/Layer} layer Layer.
|
||||
* @param {import("./layer/Layer.js").default} layer Layer.
|
||||
* @param {string} key Key.
|
||||
* @return {module:ol/render/ReplayGroup} Replay group.
|
||||
* @return {import("./render/ReplayGroup.js").default} Replay group.
|
||||
*/
|
||||
getReplayGroup(layer, key) {
|
||||
return this.replayGroups_[getUid(layer) + ',' + key];
|
||||
@@ -166,9 +160,9 @@ class VectorTile extends Tile {
|
||||
|
||||
/**
|
||||
* Handler for successful tile load.
|
||||
* @param {Array<module:ol/Feature>} features The loaded features.
|
||||
* @param {module:ol/proj/Projection} dataProjection Data projection.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {Array<import("./Feature.js").default>} features The loaded features.
|
||||
* @param {import("./proj/Projection.js").default} dataProjection Data projection.
|
||||
* @param {import("./extent.js").Extent} extent Extent.
|
||||
*/
|
||||
onLoad(features, dataProjection, extent) {
|
||||
this.setProjection(dataProjection);
|
||||
@@ -192,7 +186,7 @@ class VectorTile extends Tile {
|
||||
* sources using {@link module:ol/format/MVT~MVT} as feature format, the
|
||||
* {@link module:ol/format/MVT~MVT#getLastExtent} method will return the correct
|
||||
* extent. The default is `[0, 0, 4096, 4096]`.
|
||||
* @param {module:ol/extent~Extent} extent The extent.
|
||||
* @param {import("./extent.js").Extent} extent The extent.
|
||||
* @api
|
||||
*/
|
||||
setExtent(extent) {
|
||||
@@ -202,7 +196,7 @@ class VectorTile extends Tile {
|
||||
/**
|
||||
* Function for use in an {@link module:ol/source/VectorTile~VectorTile}'s `tileLoadFunction`.
|
||||
* Sets the features for the tile.
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @param {Array<import("./Feature.js").default>} features Features.
|
||||
* @api
|
||||
*/
|
||||
setFeatures(features) {
|
||||
@@ -214,7 +208,7 @@ class VectorTile extends Tile {
|
||||
* Function for use in an {@link module:ol/source/VectorTile~VectorTile}'s `tileLoadFunction`.
|
||||
* Sets the projection of the features that were added with
|
||||
* {@link module:ol/VectorTile~VectorTile#setFeatures}.
|
||||
* @param {module:ol/proj/Projection} projection Feature projection.
|
||||
* @param {import("./proj/Projection.js").default} projection Feature projection.
|
||||
* @api
|
||||
*/
|
||||
setProjection(projection) {
|
||||
@@ -222,9 +216,9 @@ class VectorTile extends Tile {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/layer/Layer} layer Layer.
|
||||
* @param {import("./layer/Layer.js").default} layer Layer.
|
||||
* @param {string} key Key.
|
||||
* @param {module:ol/render/ReplayGroup} replayGroup Replay group.
|
||||
* @param {import("./render/ReplayGroup.js").default} replayGroup Replay group.
|
||||
*/
|
||||
setReplayGroup(layer, key, replayGroup) {
|
||||
this.replayGroups_[getUid(layer) + ',' + key] = replayGroup;
|
||||
@@ -232,7 +226,7 @@ class VectorTile extends Tile {
|
||||
|
||||
/**
|
||||
* Set the feature loader for reading this tile's features.
|
||||
* @param {module:ol/featureloader~FeatureLoader} loader Feature loader.
|
||||
* @param {import("./featureloader.js").FeatureLoader} loader Feature loader.
|
||||
* @api
|
||||
*/
|
||||
setLoader(loader) {
|
||||
|
||||
133
src/ol/View.js
133
src/ol/View.js
@@ -17,7 +17,6 @@ import {inAndOut} from './easing.js';
|
||||
import {getForViewAndSize, getCenter, getHeight, getWidth, isEmpty} from './extent.js';
|
||||
import GeometryType from './geom/GeometryType.js';
|
||||
import {fromExtent as polygonFromExtent} from './geom/Polygon.js';
|
||||
import SimpleGeometry from './geom/SimpleGeometry.js';
|
||||
import {clamp, modulo} from './math.js';
|
||||
import {assign} from './obj.js';
|
||||
import {createProjection, METERS_PER_UNIT} from './proj.js';
|
||||
@@ -28,13 +27,13 @@ import Units from './proj/Units.js';
|
||||
* An animation configuration
|
||||
*
|
||||
* @typedef {Object} Animation
|
||||
* @property {module:ol/coordinate~Coordinate} [sourceCenter]
|
||||
* @property {module:ol/coordinate~Coordinate} [targetCenter]
|
||||
* @property {import("./coordinate.js").Coordinate} [sourceCenter]
|
||||
* @property {import("./coordinate.js").Coordinate} [targetCenter]
|
||||
* @property {number} [sourceResolution]
|
||||
* @property {number} [targetResolution]
|
||||
* @property {number} [sourceRotation]
|
||||
* @property {number} [targetRotation]
|
||||
* @property {module:ol/coordinate~Coordinate} [anchor]
|
||||
* @property {import("./coordinate.js").Coordinate} [anchor]
|
||||
* @property {number} start
|
||||
* @property {number} duration
|
||||
* @property {boolean} complete
|
||||
@@ -45,15 +44,15 @@ import Units from './proj/Units.js';
|
||||
|
||||
/**
|
||||
* @typedef {Object} Constraints
|
||||
* @property {module:ol/centerconstraint~Type} center
|
||||
* @property {module:ol/resolutionconstraint~Type} resolution
|
||||
* @property {module:ol/rotationconstraint~Type} rotation
|
||||
* @property {import("./centerconstraint.js").Type} center
|
||||
* @property {import("./resolutionconstraint.js").Type} resolution
|
||||
* @property {import("./rotationconstraint.js").Type} rotation
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {Object} FitOptions
|
||||
* @property {module:ol/size~Size} [size] The size in pixels of the box to fit
|
||||
* @property {import("./size.js").Size} [size] The size in pixels of the box to fit
|
||||
* the extent into. Default is the current size of the first map in the DOM that
|
||||
* uses this view, or `[100, 100]` if no such map is found.
|
||||
* @property {!Array<number>} [padding=[0, 0, 0, 0]] Padding (in pixels) to be
|
||||
@@ -80,7 +79,7 @@ import Units from './proj/Units.js';
|
||||
|
||||
/**
|
||||
* @typedef {Object} ViewOptions
|
||||
* @property {module:ol/coordinate~Coordinate} [center] The initial center for
|
||||
* @property {import("./coordinate.js").Coordinate} [center] The initial center for
|
||||
* the view. The coordinate system for the center is specified with the
|
||||
* `projection` option. Layer sources will not be fetched if this is not set,
|
||||
* but the center can be set later with {@link #setCenter}.
|
||||
@@ -92,7 +91,7 @@ import Units from './proj/Units.js';
|
||||
* If `false`, a rotation constraint that always sets the rotation to zero is
|
||||
* used. The `constrainRotation` option has no effect if `enableRotation` is
|
||||
* `false`.
|
||||
* @property {module:ol/extent~Extent} [extent] The extent that constrains the
|
||||
* @property {import("./extent.js").Extent} [extent] The extent that constrains the
|
||||
* center, in other words, center cannot be set outside this extent.
|
||||
* @property {number} [maxResolution] The maximum resolution used to determine
|
||||
* the resolution constraint. It is used together with `minResolution` (or
|
||||
@@ -114,7 +113,7 @@ import Units from './proj/Units.js';
|
||||
* resolution constraint. It is used together with `maxZoom` (or
|
||||
* `minResolution`) and `zoomFactor`. Note that if `maxResolution` is also
|
||||
* provided, it is given precedence over `minZoom`.
|
||||
* @property {module:ol/proj~ProjectionLike} [projection='EPSG:3857'] The
|
||||
* @property {import("./proj.js").ProjectionLike} [projection='EPSG:3857'] The
|
||||
* projection. The default is Spherical Mercator.
|
||||
* @property {number} [resolution] The initial resolution for the view. The
|
||||
* units are `projection` units per pixel (e.g. meters per pixel). An
|
||||
@@ -136,15 +135,15 @@ import Units from './proj/Units.js';
|
||||
|
||||
/**
|
||||
* @typedef {Object} AnimationOptions
|
||||
* @property {module:ol/coordinate~Coordinate|undefined} center The center of the view at the end of
|
||||
* @property {import("./coordinate.js").Coordinate} [center] The center of the view at the end of
|
||||
* the animation.
|
||||
* @property {number|undefined} zoom The zoom level of the view at the end of the
|
||||
* @property {number} [zoom] The zoom level of the view at the end of the
|
||||
* animation. This takes precedence over `resolution`.
|
||||
* @property {number|undefined} resolution The resolution of the view at the end
|
||||
* @property {number} [resolution] The resolution of the view at the end
|
||||
* of the animation. If `zoom` is also provided, this option will be ignored.
|
||||
* @property {number|undefined} rotation The rotation of the view at the end of
|
||||
* @property {number} [rotation] The rotation of the view at the end of
|
||||
* the animation.
|
||||
* @property {module:ol/coordinate~Coordinate|undefined} anchor Optional anchor to remained fixed
|
||||
* @property {import("./coordinate.js").Coordinate} [anchor] Optional anchor to remained fixed
|
||||
* during a rotation or resolution animation.
|
||||
* @property {number} [duration=1000] The duration of the animation in milliseconds.
|
||||
* @property {function(number):number} [easing] The easing function used
|
||||
@@ -157,8 +156,8 @@ import Units from './proj/Units.js';
|
||||
|
||||
/**
|
||||
* @typedef {Object} State
|
||||
* @property {module:ol/coordinate~Coordinate} center
|
||||
* @property {module:ol/proj/Projection} projection
|
||||
* @property {import("./coordinate.js").Coordinate} center
|
||||
* @property {import("./proj/Projection.js").default} projection
|
||||
* @property {number} resolution
|
||||
* @property {number} rotation
|
||||
* @property {number} zoom
|
||||
@@ -229,7 +228,7 @@ const DEFAULT_MIN_ZOOM = 0;
|
||||
class View extends BaseObject {
|
||||
|
||||
/**
|
||||
* @param {module:ol/View~ViewOptions=} opt_options View options.
|
||||
* @param {ViewOptions=} opt_options View options.
|
||||
*/
|
||||
constructor(opt_options) {
|
||||
super();
|
||||
@@ -244,7 +243,7 @@ class View extends BaseObject {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array<Array<module:ol/View~Animation>>}
|
||||
* @type {Array<Array<Animation>>}
|
||||
*/
|
||||
this.animations_ = [];
|
||||
|
||||
@@ -259,7 +258,7 @@ class View extends BaseObject {
|
||||
/**
|
||||
* @private
|
||||
* @const
|
||||
* @type {module:ol/proj/Projection}
|
||||
* @type {import("./proj/Projection.js").default}
|
||||
*/
|
||||
this.projection_ = createProjection(options.projection, 'EPSG:3857');
|
||||
|
||||
@@ -268,7 +267,7 @@ class View extends BaseObject {
|
||||
|
||||
/**
|
||||
* Set up the view with the given options.
|
||||
* @param {module:ol/View~ViewOptions} options View options.
|
||||
* @param {ViewOptions} options View options.
|
||||
*/
|
||||
applyOptions_(options) {
|
||||
|
||||
@@ -317,7 +316,7 @@ class View extends BaseObject {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/View~Constraints}
|
||||
* @type {Constraints}
|
||||
*/
|
||||
this.constraints_ = {
|
||||
center: centerConstraint,
|
||||
@@ -342,7 +341,7 @@ class View extends BaseObject {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/View~ViewOptions}
|
||||
* @type {ViewOptions}
|
||||
*/
|
||||
this.options_ = options;
|
||||
|
||||
@@ -353,8 +352,8 @@ class View extends BaseObject {
|
||||
* current resolution (or zoom), center, and rotation are applied to any stored
|
||||
* options. The provided options can be used to apply new min/max zoom or
|
||||
* resolution limits.
|
||||
* @param {module:ol/View~ViewOptions} newOptions New options to be applied.
|
||||
* @return {module:ol/View~ViewOptions} New options updated with the current view state.
|
||||
* @param {ViewOptions} newOptions New options to be applied.
|
||||
* @return {ViewOptions} New options updated with the current view state.
|
||||
*/
|
||||
getUpdatedOptions_(newOptions) {
|
||||
const options = assign({}, this.options_);
|
||||
@@ -400,7 +399,7 @@ class View extends BaseObject {
|
||||
* calling `view.setCenter()`, `view.setResolution()`, or `view.setRotation()`
|
||||
* (or another method that calls one of these).
|
||||
*
|
||||
* @param {...(module:ol/View~AnimationOptions|function(boolean))} var_args Animation
|
||||
* @param {...(AnimationOptions|function(boolean))} var_args Animation
|
||||
* options. Multiple animations can be run in series by passing multiple
|
||||
* options objects. To run multiple animations in parallel, call the method
|
||||
* multiple times. An optional callback can be provided as a final
|
||||
@@ -438,9 +437,9 @@ class View extends BaseObject {
|
||||
let rotation = this.getRotation();
|
||||
const series = [];
|
||||
for (let i = 0; i < animationCount; ++i) {
|
||||
const options = /** @type {module:ol/View~AnimationOptions} */ (arguments[i]);
|
||||
const options = /** @type {AnimationOptions} */ (arguments[i]);
|
||||
|
||||
const animation = /** @type {module:ol/View~Animation} */ ({
|
||||
const animation = /** @type {Animation} */ ({
|
||||
start: start,
|
||||
complete: false,
|
||||
anchor: options.anchor,
|
||||
@@ -603,8 +602,8 @@ class View extends BaseObject {
|
||||
|
||||
/**
|
||||
* @param {number} rotation Target rotation.
|
||||
* @param {module:ol/coordinate~Coordinate} anchor Rotation anchor.
|
||||
* @return {module:ol/coordinate~Coordinate|undefined} Center for rotation and anchor.
|
||||
* @param {import("./coordinate.js").Coordinate} anchor Rotation anchor.
|
||||
* @return {import("./coordinate.js").Coordinate|undefined} Center for rotation and anchor.
|
||||
*/
|
||||
calculateCenterRotate(rotation, anchor) {
|
||||
let center;
|
||||
@@ -619,8 +618,8 @@ class View extends BaseObject {
|
||||
|
||||
/**
|
||||
* @param {number} resolution Target resolution.
|
||||
* @param {module:ol/coordinate~Coordinate} anchor Zoom anchor.
|
||||
* @return {module:ol/coordinate~Coordinate|undefined} Center for resolution and anchor.
|
||||
* @param {import("./coordinate.js").Coordinate} anchor Zoom anchor.
|
||||
* @return {import("./coordinate.js").Coordinate|undefined} Center for resolution and anchor.
|
||||
*/
|
||||
calculateCenterZoom(resolution, anchor) {
|
||||
let center;
|
||||
@@ -636,7 +635,7 @@ class View extends BaseObject {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @return {module:ol/size~Size} Viewport size or `[100, 100]` when no viewport is found.
|
||||
* @return {import("./size.js").Size} Viewport size or `[100, 100]` when no viewport is found.
|
||||
*/
|
||||
getSizeFromViewport_() {
|
||||
const size = [100, 100];
|
||||
@@ -652,8 +651,8 @@ class View extends BaseObject {
|
||||
|
||||
/**
|
||||
* Get the constrained center of this view.
|
||||
* @param {module:ol/coordinate~Coordinate|undefined} center Center.
|
||||
* @return {module:ol/coordinate~Coordinate|undefined} Constrained center.
|
||||
* @param {import("./coordinate.js").Coordinate|undefined} center Center.
|
||||
* @return {import("./coordinate.js").Coordinate|undefined} Constrained center.
|
||||
* @api
|
||||
*/
|
||||
constrainCenter(center) {
|
||||
@@ -688,18 +687,18 @@ class View extends BaseObject {
|
||||
|
||||
/**
|
||||
* Get the view center.
|
||||
* @return {module:ol/coordinate~Coordinate|undefined} The center of the view.
|
||||
* @return {import("./coordinate.js").Coordinate|undefined} The center of the view.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
getCenter() {
|
||||
return (
|
||||
/** @type {module:ol/coordinate~Coordinate|undefined} */ (this.get(ViewProperty.CENTER))
|
||||
/** @type {import("./coordinate.js").Coordinate|undefined} */ (this.get(ViewProperty.CENTER))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {module:ol/View~Constraints} Constraints.
|
||||
* @return {Constraints} Constraints.
|
||||
*/
|
||||
getConstraints() {
|
||||
return this.constraints_;
|
||||
@@ -724,14 +723,14 @@ class View extends BaseObject {
|
||||
* The size is the pixel dimensions of the box into which the calculated extent
|
||||
* should fit. In most cases you want to get the extent of the entire map,
|
||||
* that is `map.getSize()`.
|
||||
* @param {module:ol/size~Size=} opt_size Box pixel size. If not provided, the size of the
|
||||
* @param {import("./size.js").Size=} opt_size Box pixel size. If not provided, the size of the
|
||||
* first map that uses this view will be used.
|
||||
* @return {module:ol/extent~Extent} Extent.
|
||||
* @return {import("./extent.js").Extent} Extent.
|
||||
* @api
|
||||
*/
|
||||
calculateExtent(opt_size) {
|
||||
const size = opt_size || this.getSizeFromViewport_();
|
||||
const center = /** @type {!module:ol/coordinate~Coordinate} */ (this.getCenter());
|
||||
const center = /** @type {!import("./coordinate.js").Coordinate} */ (this.getCenter());
|
||||
assert(center, 1); // The view center is not defined
|
||||
const resolution = /** @type {!number} */ (this.getResolution());
|
||||
assert(resolution !== undefined, 2); // The view resolution is not defined
|
||||
@@ -797,7 +796,7 @@ class View extends BaseObject {
|
||||
|
||||
/**
|
||||
* Get the view projection.
|
||||
* @return {module:ol/proj/Projection} The projection of the view.
|
||||
* @return {import("./proj/Projection.js").default} The projection of the view.
|
||||
* @api
|
||||
*/
|
||||
getProjection() {
|
||||
@@ -826,8 +825,8 @@ class View extends BaseObject {
|
||||
|
||||
/**
|
||||
* Get the resolution for a provided extent (in map units) and size (in pixels).
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {module:ol/size~Size=} opt_size Box pixel size.
|
||||
* @param {import("./extent.js").Extent} extent Extent.
|
||||
* @param {import("./size.js").Size=} opt_size Box pixel size.
|
||||
* @return {number} The resolution at which the provided extent will render at
|
||||
* the given size.
|
||||
* @api
|
||||
@@ -895,16 +894,16 @@ class View extends BaseObject {
|
||||
|
||||
/**
|
||||
* @param {number} pixelRatio Pixel ratio for center rounding.
|
||||
* @return {module:ol/View~State} View state.
|
||||
* @return {State} View state.
|
||||
*/
|
||||
getState(pixelRatio) {
|
||||
const center = /** @type {module:ol/coordinate~Coordinate} */ (this.getCenter());
|
||||
const center = /** @type {import("./coordinate.js").Coordinate} */ (this.getCenter());
|
||||
const projection = this.getProjection();
|
||||
const resolution = /** @type {number} */ (this.getResolution());
|
||||
const pixelResolution = resolution / pixelRatio;
|
||||
const rotation = this.getRotation();
|
||||
return (
|
||||
/** @type {module:ol/View~State} */ ({
|
||||
/** @type {State} */ ({
|
||||
center: [
|
||||
Math.round(center[0] / pixelResolution) * pixelResolution,
|
||||
Math.round(center[1] / pixelResolution) * pixelResolution
|
||||
@@ -974,9 +973,9 @@ class View extends BaseObject {
|
||||
* The size is pixel dimensions of the box to fit the extent into.
|
||||
* In most cases you will want to use the map size, that is `map.getSize()`.
|
||||
* Takes care of the map angle.
|
||||
* @param {module:ol/geom/SimpleGeometry|module:ol/extent~Extent} geometryOrExtent The geometry or
|
||||
* @param {import("./geom/SimpleGeometry.js").default|import("./extent.js").Extent} geometryOrExtent The geometry or
|
||||
* extent to fit the view to.
|
||||
* @param {module:ol/View~FitOptions=} opt_options Options.
|
||||
* @param {FitOptions=} opt_options Options.
|
||||
* @api
|
||||
*/
|
||||
fit(geometryOrExtent, opt_options) {
|
||||
@@ -985,11 +984,11 @@ class View extends BaseObject {
|
||||
if (!size) {
|
||||
size = this.getSizeFromViewport_();
|
||||
}
|
||||
/** @type {module:ol/geom/SimpleGeometry} */
|
||||
/** @type {import("./geom/SimpleGeometry.js").default} */
|
||||
let geometry;
|
||||
if (!(geometryOrExtent instanceof SimpleGeometry)) {
|
||||
assert(Array.isArray(geometryOrExtent),
|
||||
24); // Invalid extent or geometry provided as `geometry`
|
||||
assert(Array.isArray(geometryOrExtent) || typeof /** @type {?} */ (geometryOrExtent).getSimplifiedGeometry === 'function',
|
||||
24); // Invalid extent or geometry provided as `geometry`
|
||||
if (Array.isArray(geometryOrExtent)) {
|
||||
assert(!isEmpty(geometryOrExtent),
|
||||
25); // Cannot fit empty extent provided as `geometry`
|
||||
geometry = polygonFromExtent(geometryOrExtent);
|
||||
@@ -1076,9 +1075,9 @@ class View extends BaseObject {
|
||||
|
||||
/**
|
||||
* Center on coordinate and view position.
|
||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
||||
* @param {module:ol/size~Size} size Box pixel size.
|
||||
* @param {module:ol/pixel~Pixel} position Position on the view to center on.
|
||||
* @param {import("./coordinate.js").Coordinate} coordinate Coordinate.
|
||||
* @param {import("./size.js").Size} size Box pixel size.
|
||||
* @param {import("./pixel.js").Pixel} position Position on the view to center on.
|
||||
* @api
|
||||
*/
|
||||
centerOn(coordinate, size, position) {
|
||||
@@ -1110,7 +1109,7 @@ class View extends BaseObject {
|
||||
/**
|
||||
* Rotate the view around a given coordinate.
|
||||
* @param {number} rotation New rotation value for the view.
|
||||
* @param {module:ol/coordinate~Coordinate=} opt_anchor The rotation center.
|
||||
* @param {import("./coordinate.js").Coordinate=} opt_anchor The rotation center.
|
||||
* @api
|
||||
*/
|
||||
rotate(rotation, opt_anchor) {
|
||||
@@ -1123,7 +1122,7 @@ class View extends BaseObject {
|
||||
|
||||
/**
|
||||
* Set the center of the current view.
|
||||
* @param {module:ol/coordinate~Coordinate|undefined} center The center of the view.
|
||||
* @param {import("./coordinate.js").Coordinate|undefined} center The center of the view.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
@@ -1135,7 +1134,7 @@ class View extends BaseObject {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/ViewHint} hint Hint.
|
||||
* @param {ViewHint} hint Hint.
|
||||
* @param {number} delta Delta.
|
||||
* @return {number} New value.
|
||||
*/
|
||||
@@ -1194,8 +1193,8 @@ function animationCallback(callback, returnValue) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/View~ViewOptions} options View options.
|
||||
* @return {module:ol/centerconstraint~Type} The constraint.
|
||||
* @param {ViewOptions} options View options.
|
||||
* @return {import("./centerconstraint.js").Type} The constraint.
|
||||
*/
|
||||
export function createCenterConstraint(options) {
|
||||
if (options.extent !== undefined) {
|
||||
@@ -1207,8 +1206,8 @@ export function createCenterConstraint(options) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/View~ViewOptions} options View options.
|
||||
* @return {{constraint: module:ol/resolutionconstraint~Type, maxResolution: number,
|
||||
* @param {ViewOptions} options View options.
|
||||
* @return {{constraint: import("./resolutionconstraint.js").Type, maxResolution: number,
|
||||
* minResolution: number, minZoom: number, zoomFactor: number}} The constraint.
|
||||
*/
|
||||
export function createResolutionConstraint(options) {
|
||||
@@ -1289,8 +1288,8 @@ export function createResolutionConstraint(options) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/View~ViewOptions} options View options.
|
||||
* @return {module:ol/rotationconstraint~Type} Rotation constraint.
|
||||
* @param {ViewOptions} options View options.
|
||||
* @return {import("./rotationconstraint.js").Type} Rotation constraint.
|
||||
*/
|
||||
export function createRotationConstraint(options) {
|
||||
const enableRotation = options.enableRotation !== undefined ?
|
||||
@@ -1314,7 +1313,7 @@ export function createRotationConstraint(options) {
|
||||
|
||||
/**
|
||||
* Determine if an animation involves no view change.
|
||||
* @param {module:ol/View~Animation} animation The animation.
|
||||
* @param {Animation} animation The animation.
|
||||
* @return {boolean} The animation involves no view change.
|
||||
*/
|
||||
export function isNoopAnimation(animation) {
|
||||
|
||||
@@ -56,8 +56,8 @@ import WebGLVectorLayerRenderer from './renderer/webgl/VectorLayer.js';
|
||||
* {@link module:ol/layer/Base}, so layers entered in the options or added
|
||||
* with `addLayer` can be groups, which can contain further groups, and so on.
|
||||
*
|
||||
* @fires module:ol/MapBrowserEvent~MapBrowserEvent
|
||||
* @fires module:ol/MapEvent~MapEvent
|
||||
* @fires import("./MapBrowserEvent.js").MapBrowserEvent
|
||||
* @fires import("./MapEvent.js").MapEvent
|
||||
* @fires module:ol/render/Event~RenderEvent#postcompose
|
||||
* @fires module:ol/render/Event~RenderEvent#precompose
|
||||
* @api
|
||||
@@ -65,7 +65,7 @@ import WebGLVectorLayerRenderer from './renderer/webgl/VectorLayer.js';
|
||||
class WebGLMap extends PluggableMap {
|
||||
|
||||
/**
|
||||
* @param {module:ol/PluggableMap~MapOptions} options Map options.
|
||||
* @param {import("./PluggableMap.js").MapOptions} options Map options.
|
||||
*/
|
||||
constructor(options) {
|
||||
options = assign({}, options);
|
||||
|
||||
@@ -5,19 +5,19 @@ import {clamp} from './math.js';
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {function((module:ol/coordinate~Coordinate|undefined)): (module:ol/coordinate~Coordinate|undefined)} Type
|
||||
* @typedef {function((import("./coordinate.js").Coordinate|undefined)): (import("./coordinate.js").Coordinate|undefined)} Type
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @return {module:ol/centerconstraint~Type} The constraint.
|
||||
* @param {import("./extent.js").Extent} extent Extent.
|
||||
* @return {Type} The constraint.
|
||||
*/
|
||||
export function createExtent(extent) {
|
||||
return (
|
||||
/**
|
||||
* @param {module:ol/coordinate~Coordinate=} center Center.
|
||||
* @return {module:ol/coordinate~Coordinate|undefined} Center.
|
||||
* @param {import("./coordinate.js").Coordinate=} center Center.
|
||||
* @return {import("./coordinate.js").Coordinate|undefined} Center.
|
||||
*/
|
||||
function(center) {
|
||||
if (center) {
|
||||
@@ -34,8 +34,8 @@ export function createExtent(extent) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/coordinate~Coordinate=} center Center.
|
||||
* @return {module:ol/coordinate~Coordinate|undefined} Center.
|
||||
* @param {import("./coordinate.js").Coordinate=} center Center.
|
||||
* @return {import("./coordinate.js").Coordinate|undefined} Center.
|
||||
*/
|
||||
export function none(center) {
|
||||
return center;
|
||||
|
||||
@@ -35,7 +35,7 @@ const NAMED_COLOR_RE_ = /^([a-z]*)$/i;
|
||||
|
||||
/**
|
||||
* Return the color as an rgba string.
|
||||
* @param {module:ol/color~Color|string} color Color.
|
||||
* @param {Color|string} color Color.
|
||||
* @return {string} Rgba string.
|
||||
* @api
|
||||
*/
|
||||
@@ -68,7 +68,7 @@ function fromNamed(color) {
|
||||
|
||||
/**
|
||||
* @param {string} s String.
|
||||
* @return {module:ol/color~Color} Color.
|
||||
* @return {Color} Color.
|
||||
*/
|
||||
export const fromString = (
|
||||
function() {
|
||||
@@ -84,7 +84,7 @@ export const fromString = (
|
||||
const MAX_CACHE_SIZE = 1024;
|
||||
|
||||
/**
|
||||
* @type {Object<string, module:ol/color~Color>}
|
||||
* @type {Object<string, Color>}
|
||||
*/
|
||||
const cache = {};
|
||||
|
||||
@@ -96,7 +96,7 @@ export const fromString = (
|
||||
return (
|
||||
/**
|
||||
* @param {string} s String.
|
||||
* @return {module:ol/color~Color} Color.
|
||||
* @return {Color} Color.
|
||||
*/
|
||||
function(s) {
|
||||
let color;
|
||||
@@ -125,22 +125,22 @@ export const fromString = (
|
||||
/**
|
||||
* Return the color as an array. This function maintains a cache of calculated
|
||||
* arrays which means the result should not be modified.
|
||||
* @param {module:ol/color~Color|string} color Color.
|
||||
* @return {module:ol/color~Color} Color.
|
||||
* @param {Color|string} color Color.
|
||||
* @return {Color} Color.
|
||||
* @api
|
||||
*/
|
||||
export function asArray(color) {
|
||||
if (Array.isArray(color)) {
|
||||
return color;
|
||||
} else {
|
||||
return fromString(/** @type {string} */ (color));
|
||||
return fromString(color);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} s String.
|
||||
* @private
|
||||
* @return {module:ol/color~Color} Color.
|
||||
* @return {Color} Color.
|
||||
*/
|
||||
function fromStringInternal_(s) {
|
||||
let r, g, b, a, color;
|
||||
@@ -185,16 +185,14 @@ function fromStringInternal_(s) {
|
||||
} else {
|
||||
assert(false, 14); // Invalid color
|
||||
}
|
||||
return (
|
||||
/** @type {module:ol/color~Color} */ (color)
|
||||
);
|
||||
return color;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* TODO this function is only used in the test, we probably shouldn't export it
|
||||
* @param {module:ol/color~Color} color Color.
|
||||
* @return {module:ol/color~Color} Clamped color.
|
||||
* @param {Color} color Color.
|
||||
* @return {Color} Clamped color.
|
||||
*/
|
||||
export function normalize(color) {
|
||||
color[0] = clamp((color[0] + 0.5) | 0, 0, 255);
|
||||
@@ -206,7 +204,7 @@ export function normalize(color) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/color~Color} color Color.
|
||||
* @param {Color} color Color.
|
||||
* @return {string} String.
|
||||
*/
|
||||
export function toString(color) {
|
||||
|
||||
@@ -18,27 +18,14 @@ import {toString} from './color.js';
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/color~Color|module:ol/colorlike~ColorLike} color Color.
|
||||
* @return {module:ol/colorlike~ColorLike} The color as an {@link ol/colorlike~ColorLike}.
|
||||
* @param {import("./color.js").Color|ColorLike} color Color.
|
||||
* @return {ColorLike} The color as an {@link ol/colorlike~ColorLike}.
|
||||
* @api
|
||||
*/
|
||||
export function asColorLike(color) {
|
||||
if (isColorLike(color)) {
|
||||
return /** @type {string|CanvasPattern|CanvasGradient} */ (color);
|
||||
if (Array.isArray(color)) {
|
||||
return toString(color);
|
||||
} else {
|
||||
return toString(/** @type {module:ol/color~Color} */ (color));
|
||||
return color;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param {?} color The value that is potentially an {@link ol/colorlike~ColorLike}.
|
||||
* @return {boolean} The color is an {@link ol/colorlike~ColorLike}.
|
||||
*/
|
||||
export function isColorLike(color) {
|
||||
return (
|
||||
typeof color === 'string' ||
|
||||
color instanceof CanvasPattern ||
|
||||
color instanceof CanvasGradient
|
||||
);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user