Compare commits
615 Commits
v6.0.0-bet
...
v6.0.0-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5cc1ff0f45 | ||
|
|
2df5f85018 | ||
|
|
4a0d6ce43c | ||
|
|
187969cbb3 | ||
|
|
8cdfc6e17c | ||
|
|
9cd35d67a9 | ||
|
|
4d2fa476a3 | ||
|
|
f864c05070 | ||
|
|
3557271e5a | ||
|
|
8a49e06ebd | ||
|
|
6783f6adb9 | ||
|
|
5eb27f7704 | ||
|
|
df240fe905 | ||
|
|
300522e3cc | ||
|
|
3ede6e32be | ||
|
|
ce45a10063 | ||
|
|
2438ef167b | ||
|
|
d6dc7a926d | ||
|
|
6e6a2cae06 | ||
|
|
a6ebad008f | ||
|
|
ed5d4aaf6d | ||
|
|
f507efe77d | ||
|
|
83173cd385 | ||
|
|
b6b91abc27 | ||
|
|
05c791efcd | ||
|
|
2342626a57 | ||
|
|
7c0a0a4786 | ||
|
|
a35ca03e07 | ||
|
|
c522454af1 | ||
|
|
ef10834eb3 | ||
|
|
8efad7bcff | ||
|
|
51c8886d60 | ||
|
|
34a8702202 | ||
|
|
1f00da8d83 | ||
|
|
8d793ad6ec | ||
|
|
bd8a7bff16 | ||
|
|
d059689856 | ||
|
|
4ea28333f8 | ||
|
|
edebf35135 | ||
|
|
90b645daa5 | ||
|
|
9eac927b45 | ||
|
|
ec5e8bfa50 | ||
|
|
124e984a6d | ||
|
|
76f44efbb6 | ||
|
|
ddaaf6a860 | ||
|
|
92c16ecdf5 | ||
|
|
635d7a9189 | ||
|
|
fc6ca5eaf3 | ||
|
|
803f960ded | ||
|
|
ef1b672323 | ||
|
|
002dc34455 | ||
|
|
cc8389d588 | ||
|
|
a8e0e4e960 | ||
|
|
9ae7256048 | ||
|
|
e036767746 | ||
|
|
9a49c91fdd | ||
|
|
37ff7f547b | ||
|
|
c97a728531 | ||
|
|
811bff0430 | ||
|
|
2412fe0211 | ||
|
|
32084a7fce | ||
|
|
7817cf31c6 | ||
|
|
2e5aac8dba | ||
|
|
8b08996703 | ||
|
|
1fbbc56f93 | ||
|
|
8f77a300de | ||
|
|
91d49b26b5 | ||
|
|
02ce2f4bec | ||
|
|
d4f98c8e59 | ||
|
|
ab0860a22a | ||
|
|
dd478167a0 | ||
|
|
2df911e0a8 | ||
|
|
e9939ecc38 | ||
|
|
d058439756 | ||
|
|
8c21c9196d | ||
|
|
68b7831daf | ||
|
|
153e06e4d5 | ||
|
|
9bedfb7cb0 | ||
|
|
1bd23a0c32 | ||
|
|
50343afa61 | ||
|
|
a9e1ebccd3 | ||
|
|
9672142c1e | ||
|
|
6123be726a | ||
|
|
05d8517686 | ||
|
|
87d5f4c8bc | ||
|
|
06be00bbd5 | ||
|
|
7fb113c3dc | ||
|
|
98b0c65450 | ||
|
|
698816030e | ||
|
|
03e70bd10e | ||
|
|
e0983cb1c6 | ||
|
|
a366803cdd | ||
|
|
33d007ce01 | ||
|
|
8566cfc227 | ||
|
|
65be907095 | ||
|
|
532b8194b1 | ||
|
|
eb912d95ca | ||
|
|
245ded43d4 | ||
|
|
7c215b2532 | ||
|
|
579d05a0cb | ||
|
|
b42ee8ca0f | ||
|
|
ede864c823 | ||
|
|
a50ef05565 | ||
|
|
93a607d846 | ||
|
|
deb00f20fe | ||
|
|
c4e465dcf9 | ||
|
|
bfea858306 | ||
|
|
c92bf29677 | ||
|
|
6675f9be57 | ||
|
|
1a6d67776b | ||
|
|
889b6a9f43 | ||
|
|
970c1bcb66 | ||
|
|
2db953ceb1 | ||
|
|
051cc68f24 | ||
|
|
40c49a9ce5 | ||
|
|
442fa907ce | ||
|
|
7044e30529 | ||
|
|
7cfe047feb | ||
|
|
796f20385d | ||
|
|
c76aa76743 | ||
|
|
2969c9e8fb | ||
|
|
119c24faa2 | ||
|
|
93711ea806 | ||
|
|
96331c5d95 | ||
|
|
d8f41a9d73 | ||
|
|
311900e441 | ||
|
|
bdb87f06f9 | ||
|
|
ddb7da3733 | ||
|
|
a358521b2b | ||
|
|
4f833501d7 | ||
|
|
ace5c65ee5 | ||
|
|
ae47d3df58 | ||
|
|
4c8effe6fa | ||
|
|
c56ad4363d | ||
|
|
7895b16043 | ||
|
|
a45e704be2 | ||
|
|
d1f1b468b1 | ||
|
|
a55505b36a | ||
|
|
930318ab7a | ||
|
|
5fe9e06535 | ||
|
|
606443bc6d | ||
|
|
ec811bfa1f | ||
|
|
5e8d7f666e | ||
|
|
4f9057f066 | ||
|
|
4ed6413635 | ||
|
|
bb5ebaa1ab | ||
|
|
c9491ed023 | ||
|
|
3db13fa3bb | ||
|
|
7e4e113ac9 | ||
|
|
dc4ce62fab | ||
|
|
6288744d70 | ||
|
|
c0339f167b | ||
|
|
60007d8e3c | ||
|
|
2322131b01 | ||
|
|
39bb6a8ffe | ||
|
|
0631a121c3 | ||
|
|
c860f15f91 | ||
|
|
c10fd7aaab | ||
|
|
7ced251d19 | ||
|
|
637c823fa6 | ||
|
|
2d655143c3 | ||
|
|
fba95ea3f0 | ||
|
|
40393cd9a4 | ||
|
|
10527bd221 | ||
|
|
4c2b11f6d7 | ||
|
|
512a39bafd | ||
|
|
78c09a0ff6 | ||
|
|
6dc00b75e0 | ||
|
|
6b50f1555b | ||
|
|
a6f098f78b | ||
|
|
f77b0941b8 | ||
|
|
6d06f81ca7 | ||
|
|
908ecb39e3 | ||
|
|
6cad19e9d5 | ||
|
|
b0fae46aa6 | ||
|
|
17d26acb2f | ||
|
|
579fadd797 | ||
|
|
9693336d99 | ||
|
|
335648d613 | ||
|
|
dc906f79e1 | ||
|
|
34a8a484c4 | ||
|
|
0d489f2ea9 | ||
|
|
d49e166506 | ||
|
|
a0e6af425e | ||
|
|
e69b15d33e | ||
|
|
ee9a0bcd05 | ||
|
|
442fbb13d2 | ||
|
|
fddc5bcc5b | ||
|
|
c2058af13a | ||
|
|
bb022050ed | ||
|
|
a8e5cb1e12 | ||
|
|
1628ce8729 | ||
|
|
37f96ddcfa | ||
|
|
1fc75fdc68 | ||
|
|
10c4ec0b37 | ||
|
|
2e34dd0faf | ||
|
|
b7b37f9548 | ||
|
|
05f13bb363 | ||
|
|
e307410301 | ||
|
|
5a4541dadb | ||
|
|
56ec6b093e | ||
|
|
61d753c803 | ||
|
|
f312706269 | ||
|
|
f33ad5e025 | ||
|
|
2e31f716ed | ||
|
|
eafb657264 | ||
|
|
0cee259d0b | ||
|
|
be8797f355 | ||
|
|
d652bfc4a7 | ||
|
|
11607caa81 | ||
|
|
41e958ea1f | ||
|
|
39de2451bc | ||
|
|
e11e3c5f6e | ||
|
|
c705775d75 | ||
|
|
9ca75e9d43 | ||
|
|
5d2b7fe4bb | ||
|
|
fb455891ce | ||
|
|
3e2e45ce6d | ||
|
|
75eb62363a | ||
|
|
523097903a | ||
|
|
c6d214b585 | ||
|
|
c9604dbd69 | ||
|
|
df37519858 | ||
|
|
10c6009ffa | ||
|
|
27e520add4 | ||
|
|
3a429d3f6c | ||
|
|
5e36468245 | ||
|
|
a2d83f5358 | ||
|
|
53b9718381 | ||
|
|
2de282ae49 | ||
|
|
217c6ba764 | ||
|
|
039f21274b | ||
|
|
09fdd30876 | ||
|
|
72551ab506 | ||
|
|
811e5f60eb | ||
|
|
b1ea0fec50 | ||
|
|
98ee52c61c | ||
|
|
f76b9bdd07 | ||
|
|
3a1d927c41 | ||
|
|
9224bfab7d | ||
|
|
b5535f3ba5 | ||
|
|
bfe6d29601 | ||
|
|
807525b1db | ||
|
|
8504a49e17 | ||
|
|
83d317d16d | ||
|
|
55b27c70b5 | ||
|
|
1c13893dd1 | ||
|
|
4a1cda715d | ||
|
|
c9d1725f5c | ||
|
|
4bf314f9e6 | ||
|
|
14f580fe30 | ||
|
|
a2e6d4b324 | ||
|
|
dadc240038 | ||
|
|
dd265623e4 | ||
|
|
23137cdab3 | ||
|
|
1d08eb5752 | ||
|
|
78cee60d91 | ||
|
|
1deabaa1c0 | ||
|
|
88b6b18cc0 | ||
|
|
355fb41748 | ||
|
|
7d2249f652 | ||
|
|
5e288ebedf | ||
|
|
80eb8b62ce | ||
|
|
cdb36a3bf2 | ||
|
|
04a28854c9 | ||
|
|
51cf9ee3a1 | ||
|
|
fbc8580539 | ||
|
|
eeec56fa94 | ||
|
|
17d83b9c20 | ||
|
|
2c9f6b496f | ||
|
|
5006bbe13f | ||
|
|
a1026a50bd | ||
|
|
c117ec79f7 | ||
|
|
b37eb29444 | ||
|
|
4df545dfb0 | ||
|
|
70f5822217 | ||
|
|
d49a41def0 | ||
|
|
e4941f60db | ||
|
|
d1fe22a872 | ||
|
|
5756003c88 | ||
|
|
e5e2129a88 | ||
|
|
c5e6728d6d | ||
|
|
d9b3986c95 | ||
|
|
a67f8e3f38 | ||
|
|
7989991da9 | ||
|
|
afa70e5a1e | ||
|
|
ce9ea5cc93 | ||
|
|
5f5cdc9645 | ||
|
|
6370426d52 | ||
|
|
fb7bd2158d | ||
|
|
387b4188f2 | ||
|
|
c922d4eb8f | ||
|
|
9d4eda2318 | ||
|
|
bd235b7b49 | ||
|
|
7daba05548 | ||
|
|
64e67ae351 | ||
|
|
40ea2a8b7e | ||
|
|
4629fe5028 | ||
|
|
ba2c558b72 | ||
|
|
84f1e0c66e | ||
|
|
72e41d3703 | ||
|
|
6775723840 | ||
|
|
d332b6a0f4 | ||
|
|
f68b8d8df9 | ||
|
|
c2cbae95c6 | ||
|
|
b36ad87cb5 | ||
|
|
b7c004f95c | ||
|
|
7bfaa3b6ad | ||
|
|
0cffee6f83 | ||
|
|
3895a59c5e | ||
|
|
a2b39c9c53 | ||
|
|
12154d98b4 | ||
|
|
c25dba415f | ||
|
|
27d943dcc3 | ||
|
|
66b5b5d7e1 | ||
|
|
3cf9b5aa28 | ||
|
|
b77177ed74 | ||
|
|
f61562a51a | ||
|
|
e4a531de8c | ||
|
|
063bc51c59 | ||
|
|
3f3fbe7e4b | ||
|
|
01a6381756 | ||
|
|
0ab7ad741f | ||
|
|
58efe1f850 | ||
|
|
66b41a53b8 | ||
|
|
c00400c500 | ||
|
|
944af1fe80 | ||
|
|
ea55f39298 | ||
|
|
84db84bc23 | ||
|
|
f366eaea52 | ||
|
|
f5ae41f03e | ||
|
|
6b1bce2b9d | ||
|
|
bd57128ca4 | ||
|
|
5012e4987c | ||
|
|
6e3d3d4877 | ||
|
|
d30f6175ce | ||
|
|
0e08d9e0fd | ||
|
|
81f99f1579 | ||
|
|
4973281f3c | ||
|
|
8f3820be22 | ||
|
|
033a18bc1c | ||
|
|
99fb0bf57e | ||
|
|
49a9f21388 | ||
|
|
e4d25400ee | ||
|
|
1e350677fb | ||
|
|
86f304ae02 | ||
|
|
00c09eb281 | ||
|
|
6c8c8a6477 | ||
|
|
1142caf5e8 | ||
|
|
ba6ac43a28 | ||
|
|
12289b8ef9 | ||
|
|
f69c37566e | ||
|
|
6cfd0b70ed | ||
|
|
d95bcc8594 | ||
|
|
d3e6f4c3b2 | ||
|
|
eb21369d86 | ||
|
|
68a29f1ac6 | ||
|
|
6413badada | ||
|
|
d6485b1e94 | ||
|
|
98a5f552b2 | ||
|
|
067260170b | ||
|
|
9850c0134e | ||
|
|
284c1dff83 | ||
|
|
d166c79242 | ||
|
|
e4f377fb46 | ||
|
|
e22af6dbd6 | ||
|
|
0f998b4522 | ||
|
|
2cdfcf8b21 | ||
|
|
b3e770226f | ||
|
|
981328576f | ||
|
|
3b1a415d6b | ||
|
|
fde36b237e | ||
|
|
dde9c59021 | ||
|
|
a12b323907 | ||
|
|
1687f9bb84 | ||
|
|
9a12a668a2 | ||
|
|
b98268ffee | ||
|
|
4d1ae3d483 | ||
|
|
2f6f110fa3 | ||
|
|
93c25d4f82 | ||
|
|
2ac1095c52 | ||
|
|
d5b868f4a6 | ||
|
|
17081fac46 | ||
|
|
4a18b57021 | ||
|
|
58c4c9ebb8 | ||
|
|
a16234faaa | ||
|
|
154265a2d9 | ||
|
|
440ae897a5 | ||
|
|
86fac0937b | ||
|
|
682102d4d6 | ||
|
|
22774b4821 | ||
|
|
046e73e785 | ||
|
|
a71a823676 | ||
|
|
3ba7ecc602 | ||
|
|
887d8e8a90 | ||
|
|
251fc79484 | ||
|
|
fc0ed7b96f | ||
|
|
752b69680e | ||
|
|
756f63e212 | ||
|
|
84a82ea5b2 | ||
|
|
08dd5f58a2 | ||
|
|
04963c83d6 | ||
|
|
711dacf4b7 | ||
|
|
6fbd196132 | ||
|
|
5969ac31ea | ||
|
|
21c51ff784 | ||
|
|
3d10e92218 | ||
|
|
84371fe4be | ||
|
|
1995164219 | ||
|
|
4f128a1ec0 | ||
|
|
f11744da56 | ||
|
|
08434ed3d5 | ||
|
|
2c76d7531b | ||
|
|
bbec7d76d4 | ||
|
|
255c4b34ba | ||
|
|
fd220f9cce | ||
|
|
34d68aadbd | ||
|
|
3bc822e8ef | ||
|
|
7340e865a3 | ||
|
|
5b231fe990 | ||
|
|
9c55256de2 | ||
|
|
491020f027 | ||
|
|
2989c84248 | ||
|
|
db1515a9f3 | ||
|
|
a774b1a278 | ||
|
|
81865f70e4 | ||
|
|
c6db2d07bb | ||
|
|
91215b303e | ||
|
|
319a905ec0 | ||
|
|
9883b7d3d9 | ||
|
|
07e31840eb | ||
|
|
03483b5439 | ||
|
|
9a42ab73d8 | ||
|
|
746f92d597 | ||
|
|
238fbca650 | ||
|
|
3875147812 | ||
|
|
be065cdacc | ||
|
|
187f58c1c3 | ||
|
|
c20bdedcac | ||
|
|
617dd9f031 | ||
|
|
077afac90a | ||
|
|
f091d96b6c | ||
|
|
a30aa78726 | ||
|
|
66f49559ee | ||
|
|
8899c3e3c5 | ||
|
|
10a2b718f5 | ||
|
|
c72f699c90 | ||
|
|
16e132caea | ||
|
|
070c1ec029 | ||
|
|
21c26cabed | ||
|
|
0f73f16cfa | ||
|
|
dfa8506549 | ||
|
|
9860699d5f | ||
|
|
8fb6ed5c6f | ||
|
|
c6a859d1ed | ||
|
|
b955579a9c | ||
|
|
7c1df60d06 | ||
|
|
0583bc0cc8 | ||
|
|
c9de49e56e | ||
|
|
275a22b685 | ||
|
|
7091ed3de6 | ||
|
|
7ebae2ba80 | ||
|
|
9eb9fffc94 | ||
|
|
061965ecb7 | ||
|
|
3a7f9d93f4 | ||
|
|
3940b5ec88 | ||
|
|
a95481a8fe | ||
|
|
77a1628610 | ||
|
|
c08da3c694 | ||
|
|
98994cad61 | ||
|
|
91dda5e5ca | ||
|
|
b63c4188e4 | ||
|
|
10423ddbe4 | ||
|
|
f32e097051 | ||
|
|
1be6050da8 | ||
|
|
62ebe29ead | ||
|
|
ef061dd4c3 | ||
|
|
bff3e88343 | ||
|
|
3d2711d35e | ||
|
|
927a98ac5b | ||
|
|
8983ebdc69 | ||
|
|
681a8f1d9c | ||
|
|
447117be4f | ||
|
|
681c3169c1 | ||
|
|
5665da6518 | ||
|
|
085c60af49 | ||
|
|
2bf217207e | ||
|
|
f5abb45de0 | ||
|
|
fefcc9f0ca | ||
|
|
d2f60a70d1 | ||
|
|
a25ca03040 | ||
|
|
461256767e | ||
|
|
c4279ff665 | ||
|
|
ad5c9ac589 | ||
|
|
458f1d0f64 | ||
|
|
b06c84cef9 | ||
|
|
b33ceaa400 | ||
|
|
7510a19c73 | ||
|
|
ac3a2d960a | ||
|
|
d5f92843a9 | ||
|
|
fc878fd539 | ||
|
|
84bf801b52 | ||
|
|
f555048319 | ||
|
|
72788187c8 | ||
|
|
6759641715 | ||
|
|
e12a0ea0ff | ||
|
|
508d980514 | ||
|
|
c52566a244 | ||
|
|
5803727409 | ||
|
|
1d88528686 | ||
|
|
3a4be21a25 | ||
|
|
16419b3281 | ||
|
|
6d50f43448 | ||
|
|
f1bfccbfe6 | ||
|
|
a56e8719d3 | ||
|
|
85e2ffa63f | ||
|
|
1b91400ebc | ||
|
|
48156af617 | ||
|
|
c510fe268b | ||
|
|
912fb03564 | ||
|
|
3f7c52c29f | ||
|
|
9284ba47a4 | ||
|
|
4a405cc975 | ||
|
|
5857117625 | ||
|
|
75d9ade613 | ||
|
|
58cebcc97f | ||
|
|
3f8da79893 | ||
|
|
5f8450d67d | ||
|
|
d89b909187 | ||
|
|
f79b358c92 | ||
|
|
e4ef5c789c | ||
|
|
d871196e16 | ||
|
|
595b74d04e | ||
|
|
de0f5d44a3 | ||
|
|
1637cffbe9 | ||
|
|
2f28f89c59 | ||
|
|
de7afee96d | ||
|
|
92cb9f1c51 | ||
|
|
7896fa894d | ||
|
|
d6f7533c76 | ||
|
|
4a9d2e689e | ||
|
|
df3d771c53 | ||
|
|
0aa14db88b | ||
|
|
d75caaa3df | ||
|
|
cfc79254d0 | ||
|
|
ac0d67b273 | ||
|
|
17b37a90da | ||
|
|
72d38fa929 | ||
|
|
a051892b92 | ||
|
|
c573d53297 | ||
|
|
b4fc249991 | ||
|
|
c321c90497 | ||
|
|
cb2b57232c | ||
|
|
90c3c1db81 | ||
|
|
11f5a4c5b8 | ||
|
|
0f217392d7 | ||
|
|
b54b7c5989 | ||
|
|
1348d76a33 | ||
|
|
4a13bf2fa9 | ||
|
|
d71fa78ee2 | ||
|
|
c0d4cdbabf | ||
|
|
76aa26e3e9 | ||
|
|
fcf6e81430 | ||
|
|
dfabcc0c66 | ||
|
|
3282c74de6 | ||
|
|
dee36639bd | ||
|
|
5a578c00a7 | ||
|
|
e8243b73b5 | ||
|
|
404b04ae59 | ||
|
|
8a02a6f9f1 | ||
|
|
4a67bd86a8 | ||
|
|
feb1a9f31b | ||
|
|
8a5720e8cb | ||
|
|
9ad2924f00 | ||
|
|
0401aed6e3 | ||
|
|
b2722542fe | ||
|
|
7002053678 | ||
|
|
425cd19922 | ||
|
|
4a7b3cde56 | ||
|
|
9c1c71b8e5 | ||
|
|
6de566d95b | ||
|
|
b31715e86e | ||
|
|
9e89047e6a | ||
|
|
a372ca0569 | ||
|
|
1e06dd979e | ||
|
|
c44e6ebe1d | ||
|
|
c8fab42d75 | ||
|
|
0995f95ef1 | ||
|
|
447266cbe8 | ||
|
|
d25a534dea | ||
|
|
56f37ab347 | ||
|
|
90749cd80f | ||
|
|
f67baa0dc0 | ||
|
|
75c379beeb | ||
|
|
405e206717 | ||
|
|
c2af03f152 | ||
|
|
7835869582 | ||
|
|
78e8f23df5 | ||
|
|
433bccd207 | ||
|
|
ef6d17d817 | ||
|
|
e023c144bb | ||
|
|
b5273babb5 | ||
|
|
49662b019c | ||
|
|
48ad1ffcbf | ||
|
|
cd186ada7f | ||
|
|
a6f65df8c4 | ||
|
|
1c5fd62e43 | ||
|
|
1f379a06a4 | ||
|
|
e52fab636c | ||
|
|
d991dfa54a | ||
|
|
c2c1aa01d3 | ||
|
|
e6c4b2ffd1 | ||
|
|
3c1e3779e2 | ||
|
|
4e1ece16ed | ||
|
|
1cb934dbe3 |
@@ -27,6 +27,10 @@ jobs:
|
|||||||
name: Run Tests
|
name: Run Tests
|
||||||
command: npm test
|
command: npm test
|
||||||
|
|
||||||
|
- store_artifacts:
|
||||||
|
path: coverage/
|
||||||
|
destination: coverage
|
||||||
|
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: rendering/cases/
|
path: rendering/cases/
|
||||||
destination: rendering
|
destination: rendering
|
||||||
@@ -38,3 +42,11 @@ jobs:
|
|||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: build/examples
|
path: build/examples
|
||||||
destination: examples
|
destination: examples
|
||||||
|
|
||||||
|
- run:
|
||||||
|
name: Build API Docs
|
||||||
|
command: npm run apidoc
|
||||||
|
|
||||||
|
- store_artifacts:
|
||||||
|
path: build/apidoc
|
||||||
|
destination: apidoc
|
||||||
|
|||||||
8
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# These are supported funding model platforms
|
||||||
|
|
||||||
|
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||||
|
patreon: # Replace with a single Patreon username
|
||||||
|
open_collective: openlayers
|
||||||
|
ko_fi: # Replace with a single Ko-fi username
|
||||||
|
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||||
|
custom: # Replace with a single custom sponsorship URL
|
||||||
17
.github/stale.yml
vendored
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# Number of days of inactivity before an issue becomes stale
|
||||||
|
daysUntilStale: 60
|
||||||
|
# Number of days of inactivity before a stale issue is closed
|
||||||
|
daysUntilClose: 7
|
||||||
|
# Issues with these labels will never be considered stale
|
||||||
|
exemptLabels:
|
||||||
|
- blocker
|
||||||
|
- regression
|
||||||
|
# Label to use when marking an issue as stale
|
||||||
|
staleLabel: stale
|
||||||
|
# Comment to post when marking an issue as stale. Set to `false` to disable
|
||||||
|
markComment: >
|
||||||
|
This issue has been automatically marked as stale because it has not had
|
||||||
|
recent activity. It will be closed if no further activity occurs. Thank you
|
||||||
|
for your contributions.
|
||||||
|
# Comment to post when closing a stale issue. Set to `false` to disable
|
||||||
|
closeComment: false
|
||||||
39
LICENSE.md
@@ -1,26 +1,25 @@
|
|||||||
Copyright 2005-present OpenLayers Contributors. All rights reserved.
|
BSD 2-Clause License
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification,
|
Copyright 2005-present, OpenLayers Contributors
|
||||||
are permitted provided that the following conditions are met:
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright notice, this
|
1. Redistributions of source code must retain the above copyright notice, this
|
||||||
list of conditions and the following disclaimer.
|
list of conditions and the following disclaimer.
|
||||||
|
|
||||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
this list of conditions and the following disclaimer in the documentation and/or
|
this list of conditions and the following disclaimer in the documentation
|
||||||
other materials provided with the distribution.
|
and/or other materials provided with the distribution.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY OPENLAYERS CONTRIBUTORS ``AS IS'' AND ANY EXPRESS
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
SHALL COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||||
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
The views and conclusions contained in the software and documentation are those
|
|
||||||
of the authors and should not be interpreted as representing official policies,
|
|
||||||
either expressed or implied, of OpenLayers Contributors.
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# OpenLayers
|
# OpenLayers
|
||||||
|
|
||||||
[OpenLayers](https://openlayers.org/) is a high-performance, feature-packed library for creating interactive maps on the web. It can display map tiles, vector data and markers loaded from any source on any web page. OpenLayers has been developed to further the use of geographic information of all kinds. It is completely free, Open Source JavaScript, released under the 2-clause BSD License (also known as the FreeBSD).
|
[OpenLayers](https://openlayers.org/) is a high-performance, feature-packed library for creating interactive maps on the web. It can display map tiles, vector data and markers loaded from any source on any web page. OpenLayers has been developed to further the use of geographic information of all kinds. It is completely free, Open Source JavaScript, released under the [BSD 2-Clause License](https://opensource.org/licenses/BSD-2-Clause).
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,70 @@
|
|||||||
|
|
||||||
#### Backwards incompatible changes
|
#### Backwards incompatible changes
|
||||||
|
|
||||||
|
#### Removal of `TOUCH` constant from `ol/has`
|
||||||
|
|
||||||
|
If you were previously using this constant, you can check if `'ontouchstart'` is defined in `window` instead.
|
||||||
|
|
||||||
|
```js
|
||||||
|
if ('ontouchstart' in window) {
|
||||||
|
// ...
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Removal of `GEOLOCATION` constant from `ol/has`
|
||||||
|
|
||||||
|
If you were previously using this constant, you can check if `'geolocation'` is defined in `navigator` instead.
|
||||||
|
|
||||||
|
```js
|
||||||
|
if ('geolocation' in navigator) {
|
||||||
|
// ...
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Removal of CSS print rules
|
||||||
|
|
||||||
|
The CSS media print rules were removed from the `ol.css` file. To get the previous behavior, use the following CSS:
|
||||||
|
|
||||||
|
```css
|
||||||
|
@media print {
|
||||||
|
.ol-control {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Removal of optional this arguments
|
||||||
|
|
||||||
|
The optional this (i.e. opt_this) arguments were removed from the following methods.
|
||||||
|
Please use closures, the es6 arrow function or the bind method to achieve this effect (Bind is explained here:
|
||||||
|
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind).
|
||||||
|
|
||||||
|
* `forEachCorner` in `ol/extent`
|
||||||
|
* `LRUCache#forEach`
|
||||||
|
* `RBush#forEach` and `RBush#forEachInExtent`
|
||||||
|
|
||||||
|
##### The `setCenter`, `setZoom`, `setResolution` and `setRotation` methods on `ol/View` do not bypass constraints anymore
|
||||||
|
|
||||||
|
Previously, these methods allowed setting values that were inconsistent with the given view constraints.
|
||||||
|
This is no longer the case and all changes to the view state now follow the same logic:
|
||||||
|
target values are provided and constraints are applied on these to determine the actual values to be used.
|
||||||
|
|
||||||
|
##### Removal of the `constrainResolution` option on `View.fit`, `PinchZoom`, `MouseWheelZoom` and `ol/interaction.js`
|
||||||
|
|
||||||
|
The `constrainResolution` option is now only supported by the `View` class. A `View.setConstrainResolution` method was added as well.
|
||||||
|
|
||||||
|
Generally, the responsibility of applying center/rotation/resolutions constraints was moved from interactions and controls to the `View` class.
|
||||||
|
|
||||||
|
##### The view `extent` option now applies to the whole viewport
|
||||||
|
|
||||||
|
Previously, this options only constrained the view *center*. This behaviour can still be obtained by specifying `constrainCenterOnly` in the view options.
|
||||||
|
|
||||||
|
As a side effect, the view `rotate` method is gone and has been replaced with `adjustRotation` which takes a delta as input.
|
||||||
|
|
||||||
|
##### The view is constrained so only one world is visible
|
||||||
|
|
||||||
|
Previously, maps showed multiple worlds at low zoom levels. In addition, it used to be possible to pan off the north or south edge of the world. Now, the view is restricted to show only one world, and you cannot pan off the edge. To get the previous behavior, configure the `ol/View` with `multiWorld: true`.
|
||||||
|
|
||||||
##### Removal of deprecated methods
|
##### Removal of deprecated methods
|
||||||
|
|
||||||
The `inherits` function that was used to inherit the prototype methods from one constructor into another has been removed.
|
The `inherits` function that was used to inherit the prototype methods from one constructor into another has been removed.
|
||||||
@@ -66,6 +130,14 @@ If you were previously using `VectorTile` layers with `renderMode: 'vector'`, yo
|
|||||||
|
|
||||||
If you were previously using `Vector` layers with `renderMode: 'image'`, you have to remove this configuration option. Instead, use the new `ol/layer/VectorImage` layer with your `ol/source/Vector`.
|
If you were previously using `Vector` layers with `renderMode: 'image'`, you have to remove this configuration option. Instead, use the new `ol/layer/VectorImage` layer with your `ol/source/Vector`.
|
||||||
|
|
||||||
|
##### New declutter behavior
|
||||||
|
|
||||||
|
If a map has more than one layer with `declutter` set to true, decluttering now considers all `Vector` and `VectorTile` layers, instead of decluttering each layer separately. Only `VectorImage` layers continue to be decluttered separately. The higher the z-index of a layer, the higher the priority of its decluttered items.
|
||||||
|
|
||||||
|
Within a layer, the declutter order has changed. Previously, styles with a lower `zIndex` were prioritized over those with a higher `zIndex`. Now the opposite order is used.
|
||||||
|
|
||||||
|
On vector layers, even if decluttered images or texts have a lower z-Index than polygons or lines, they will now be rendered on top of the polygons or lines. For vector tile layers, this was the case already in previous releases.
|
||||||
|
|
||||||
##### New `prerender` and `postrender` layer events replace old `precompose`, `render` and `postcompose` events
|
##### New `prerender` and `postrender` layer events replace old `precompose`, `render` and `postcompose` events
|
||||||
|
|
||||||
If you were previously registering for `precompose` and `postcompose` events, you should now register for `prerender` and `postrender` events on layers. Instead of the previous `render` event, you should now listen for `postrender`. Layers are no longer composed to a single Canvas element. Instead, they are added to the map viewport as individual elements.
|
If you were previously registering for `precompose` and `postcompose` events, you should now register for `prerender` and `postrender` events on layers. Instead of the previous `render` event, you should now listen for `postrender`. Layers are no longer composed to a single Canvas element. Instead, they are added to the map viewport as individual elements.
|
||||||
@@ -99,6 +171,58 @@ Due to the constraint above (layers can only be added to a single map), the over
|
|||||||
|
|
||||||
Previously, a graticule was not a layer. Now it is. See the graticule example for details on how to add a graticule layer to your map.
|
Previously, a graticule was not a layer. Now it is. See the graticule example for details on how to add a graticule layer to your map.
|
||||||
|
|
||||||
|
##### `ol/format/Feature` API change
|
||||||
|
|
||||||
|
The `getLastExtent()` method, which was required for custom `tileLoadFunction`s in `ol/source/Vector`, has been removed because it is no longer needed (see below).
|
||||||
|
|
||||||
|
##### `ol/VectorTile` API changes
|
||||||
|
|
||||||
|
* Removal of the `getProjection()` and `setProjection()` methods. These were used in custom `tileLoadFunction`s on `ol/source/VectorTile`, which work differently now (see below).
|
||||||
|
* Removal of the `getExtent()` and `setExtent()` methods. These were used in custom `tileLoadFunction`s on `ol/source/VectorTile`, which work differently now (see below).
|
||||||
|
|
||||||
|
##### Custom tileLoadFunction on a VectorTile source needs changes
|
||||||
|
|
||||||
|
Previously, applications needed to call `setProjection()` and `setExtent()` on the tile in a custom `tileLoadFunction` on `ol/source/VectorTile`. The format's `getLastExtent()` method was used to get the extent. All this is no longer needed. Instead, the `extent` (first argument to the loader function) and `projection` (third argument to the loader function) are simply passed as `extent` and `featureProjection` options to the format's `readFeatures()` method.
|
||||||
|
|
||||||
|
Example for an old `tileLoadFunction`:
|
||||||
|
|
||||||
|
```js
|
||||||
|
function(tile, url) {
|
||||||
|
tile.setLoader(function() {
|
||||||
|
fetch(url).then(function(response) {
|
||||||
|
response.arrayBuffer().then(function(data) {
|
||||||
|
var format = tile.getFormat();
|
||||||
|
tile.setProjection(format.readProjection(data));
|
||||||
|
tile.setFeatures(format.readFeatures(data, {
|
||||||
|
// featureProjection is not required for ol/format/MVT
|
||||||
|
featureProjection: map.getView().getProjection()
|
||||||
|
}));
|
||||||
|
tile.setExtent(format.getLastExtent());
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
This function needs to be changed to:
|
||||||
|
|
||||||
|
```js
|
||||||
|
function(tile, url) {
|
||||||
|
tile.setLoader(function(extent, resolution, projection) {
|
||||||
|
fetch(url).then(function(response) {
|
||||||
|
response.arrayBuffer().then(function(data) {
|
||||||
|
var format = tile.getFormat();
|
||||||
|
tile.setFeatures(format.readFeatures(data, {
|
||||||
|
// extent is only required for ol/format/MVT
|
||||||
|
extent: extent,
|
||||||
|
featureProjection: projection
|
||||||
|
}));
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
##### Drop of support for the experimental WebGL renderer
|
##### Drop of support for the experimental WebGL renderer
|
||||||
|
|
||||||
The WebGL map and layers renderers are gone, replaced by a `WebGLHelper` function that provides a lightweight,
|
The WebGL map and layers renderers are gone, replaced by a `WebGLHelper` function that provides a lightweight,
|
||||||
|
|||||||
@@ -1,43 +1,43 @@
|
|||||||
<table><tr>
|
<table><tr>
|
||||||
<th width="33.3%">Map</th><th width="33.3%">View</th><th width="33.3%">Layers</th>
|
<th width="33.3%">Map</th><th width="33.3%">View</th><th width="33.3%">Layers</th>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td><p>A [map](module-ol_Map-Map.html) is made of [layers](module-ol_layer_Base-BaseLayer.html), a [view](module-ol_View-View.html) to visualize them, [interactions](module-ol_interaction_Interaction-Interaction.html) to modify map content and [controls](module-ol_control_Control-Control.html) with UI components.</p>
|
<td><p>A <a href="module-ol_Map-Map.html">map</a> is made of <a href="module-ol_layer_Base-BaseLayer.html">layers</a>, a <a href="module-ol_View-View.html">view</a> to visualize them, <a href="module-ol_interaction_Interaction-Interaction.html">interactions</a> to modify map content and <a href="module-ol_control_Control-Control.html">controls</a> with UI components.</p>
|
||||||
[Overview](module-ol_Map-Map.html)<br>
|
<a href="module-ol_Map-Map.html">Overview</a><br>
|
||||||
[Creation](module-ol_Map-Map.html#Map)<br>
|
<a href="module-ol_Map-Map.html#Map">Creation</a><br>
|
||||||
[Events](module-ol_MapBrowserEvent-MapBrowserEvent.html)</td>
|
<a href="module-ol_MapBrowserEvent-MapBrowserEvent.html">Events</a></td>
|
||||||
<td><p>The view manages the visual parameters of the map view, like resolution or rotation.</p>
|
<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>
|
<a href="module-ol_View-View.html">View</a> 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>
|
<td><p>Layers are lightweight containers that get their data from <a href="module-ol_source_Source-Source.html">sources</a>.</p>
|
||||||
[ol/layer/Tile](module-ol_layer_Tile-TileLayer.html)<br>
|
<a href="module-ol_layer_Tile-TileLayer.html">ol/layer/Tile</a><br>
|
||||||
[ol/layer/Image](module-ol_layer_Image-ImageLayer.html)<br>
|
<a href="module-ol_layer_Image-ImageLayer.html">ol/layer/Image</a><br>
|
||||||
[ol/layer/Vector](module-ol_layer_Vector-VectorLayer.html)<br>
|
<a href="module-ol_layer_Vector-VectorLayer.html">ol/layer/Vector</a><br>
|
||||||
[ol/layer/VectorTile](module-ol_layer_VectorTile-VectorTileLayer.html)</td>
|
<a href="module-ol_layer_VectorTile-VectorTileLayer.html">ol/layer/VectorTile</a></td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<th>Controls</th><th>Interactions</th><th>Sources and formats</th>
|
<th>Controls</th><th>Interactions</th><th>Sources and formats</th>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td>[Map default controls](module-ol_control_util.html#.defaults)<br>
|
<td><a href="module-ol_control_util.html#.defaults">Map default controls</a><br>
|
||||||
[All controls](module-ol_control_Control-Control.html)
|
<a href="module-ol_control_Control-Control.html">All controls</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
[Map default interactions](module-ol_interaction.html#~defaults)<br>
|
<a href="module-ol_interaction.html#~defaults">Map default interactions</a><br>
|
||||||
Interactions for [vector features](module-ol_Feature-Feature.html)
|
Interactions for <a href="module-ol_Feature-Feature.html">vector features</a>
|
||||||
<ul><li>[ol/interaction/Select](module-ol_interaction_Select-Select.html)</li>
|
<ul><li><a href="module-ol_interaction_Select-Select.html">ol/interaction/Select</a></li>
|
||||||
<li>[ol/interaction/Draw](module-ol_interaction_Draw-Draw.html)</li>
|
<li><a href="module-ol_interaction_Draw-Draw.html">ol/interaction/Draw</a></li>
|
||||||
<li>[ol/interaction/Modify](module-ol_interaction_Modify-Modify.html)</li></ul>
|
<li><a href="module-ol_interaction_Modify-Modify.html">ol/interaction/Modify</a></li></ul>
|
||||||
[All interactions](module-ol_interaction_Interaction-Interaction.html)</td>
|
<a href="module-ol_interaction_Interaction-Interaction.html">All interactions</a></td>
|
||||||
<td>[Tile sources](module-ol_source_Tile-TileSource.html) for [ol/layer/Tile](module-ol_layer_Tile-TileLayer.html)
|
<td><a href="module-ol_source_Tile-TileSource.html">Tile sources</a> for <a href="module-ol_layer_Tile-TileLayer.html">ol/layer/Tile</a>
|
||||||
<br>[Image sources](module-ol_source_Image-ImageSource.html) for [ol/layer/Image](module-ol_layer_Image-ImageLayer.html)
|
<br><a href="module-ol_source_Image-ImageSource.html">Image sources</a> for <a href="module-ol_layer_Image-ImageLayer.html">ol/layer/Image</a>
|
||||||
<br>[Vector sources](module-ol_source_Vector-VectorSource.html) for [ol/layer/Vector](module-ol_layer_Vector-VectorLayer.html)
|
<br><a href="module-ol_source_Vector-VectorSource.html">Vector sources</a> for <a href="module-ol_layer_Vector-VectorLayer.html">ol/layer/Vector</a>
|
||||||
<br>[Vector tile sources](module-ol_source_VectorTile-VectorTile.html) for [ol/layer/VectorTile](module-ol_layer_VectorTile-VectorTileLayer.html)
|
<br><a href="module-ol_source_VectorTile-VectorTile.html">Vector tile sources</a> for <a href="module-ol_layer_VectorTile-VectorTileLayer.html">ol/layer/VectorTile</a>
|
||||||
<br>[Formats](module-ol_format_Feature-FeatureFormat.html) for reading/writing vector data
|
<br><a href="module-ol_format_Feature-FeatureFormat.html">Formats</a> for reading/writing vector data
|
||||||
<br>[ol/format/WMSCapabilities](module-ol_format_WMSCapabilities-WMSCapabilities.html)</td></tr>
|
<br><a href="module-ol_format_WMSCapabilities-WMSCapabilities.html">ol/format/WMSCapabilities</a></td></tr>
|
||||||
<tr><th>Projections</th><th>Observable objects</th><th>Other components</th></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 [ol/proj#transform()](module-ol_proj.html#.transform) and [ol/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 <a href="module-ol_proj.html#.transform">ol/proj#transform()</a> and <a href="module-ol_proj.html#.transformExtent">ol/proj#transformExtent()</a>.</p>
|
||||||
[ol/proj](module-ol_proj.html)</td>
|
<a href="module-ol_proj.html">ol/proj</a></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 <a href="module-ol_Object-BaseObject.html">ol/Object</a>s can be observed by calling the <a href="module-ol_Object-BaseObject.html#on">object.on('propertychange')</a> method. Listeners receive an <a href="module-ol_Object-ObjectEvent.html">ol/Object.ObjectEvent</a> with information on the changed property and old value.</p>
|
||||||
<td>
|
<td>
|
||||||
[ol/Geolocation](module-ol_Geolocation.html)<br>
|
<a href="module-ol_Geolocation.html">ol/Geolocation</a><br>
|
||||||
[ol/Overlay](module-ol_Overlay-Overlay.html)<br></td>
|
<a href="module-ol_Overlay-Overlay.html">ol/Overlay</a><br></td>
|
||||||
</tr></table>
|
</tr></table>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,9 @@ function includeAugments(doclet) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
cls._hideConstructor = true;
|
cls._hideConstructor = true;
|
||||||
delete cls.undocumented;
|
if (!cls.undocumented) {
|
||||||
|
cls._documented = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -150,6 +152,9 @@ exports.handlers = {
|
|||||||
// Remove all other undocumented symbols
|
// Remove all other undocumented symbols
|
||||||
doclet.undocumented = true;
|
doclet.undocumented = true;
|
||||||
}
|
}
|
||||||
|
if (doclet._documented) {
|
||||||
|
delete doclet.undocumented;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,32 +1,29 @@
|
|||||||
const events = {};
|
const events = {};
|
||||||
const classes = {};
|
|
||||||
|
|
||||||
exports.handlers = {
|
exports.handlers = {
|
||||||
|
|
||||||
newDoclet: function(e) {
|
newDoclet: function(e) {
|
||||||
const doclet = e.doclet;
|
const doclet = e.doclet;
|
||||||
let cls;
|
if (doclet.kind !== 'event') {
|
||||||
if (doclet.kind == 'event') {
|
return;
|
||||||
cls = doclet.longname.split('#')[0];
|
|
||||||
if (!(cls in events)) {
|
|
||||||
events[cls] = [];
|
|
||||||
}
|
|
||||||
events[cls].push(doclet.longname);
|
|
||||||
} else if (doclet.kind == 'class' && !(doclet.longname in classes)) {
|
|
||||||
classes[doclet.longname] = doclet;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const cls = doclet.longname.split('#')[0];
|
||||||
|
if (!(cls in events)) {
|
||||||
|
events[cls] = [];
|
||||||
|
}
|
||||||
|
events[cls].push(doclet.longname);
|
||||||
},
|
},
|
||||||
|
|
||||||
parseComplete: function(e) {
|
parseComplete: function(e) {
|
||||||
const doclets = e.doclets;
|
const doclets = e.doclets;
|
||||||
let doclet, i, ii, j, jj, event, fires;
|
for (let i = 0, ii = doclets.length - 1; i < ii; ++i) {
|
||||||
for (i = 0, ii = doclets.length - 1; i < ii; ++i) {
|
const doclet = doclets[i];
|
||||||
doclet = doclets[i];
|
|
||||||
if (doclet.fires) {
|
if (doclet.fires) {
|
||||||
if (doclet.kind == 'class') {
|
if (doclet.kind == 'class') {
|
||||||
fires = [];
|
const fires = [];
|
||||||
for (j = 0, jj = doclet.fires.length; j < jj; ++j) {
|
for (let j = 0, jj = doclet.fires.length; j < jj; ++j) {
|
||||||
event = doclet.fires[j].replace('event:', '');
|
const event = doclet.fires[j].replace('event:', '');
|
||||||
if (events[event]) {
|
if (events[event]) {
|
||||||
fires.push.apply(fires, events[event]);
|
fires.push.apply(fires, events[event]);
|
||||||
} else if (doclet.fires[j] !== 'event:ObjectEvent') {
|
} else if (doclet.fires[j] !== 'event:ObjectEvent') {
|
||||||
|
|||||||
@@ -1,12 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* This is a hack to prevent inheritDoc tags from entirely removing
|
* This is a hack to prevent inheritDoc tags from entirely removing
|
||||||
* documentation of the method that inherits the documentation.
|
* 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) {
|
exports.defineTags = function(dictionary) {
|
||||||
dictionary.defineTag('inheritDoc', {
|
dictionary.defineTag('inheritDoc', {
|
||||||
mustHaveValue: false,
|
mustHaveValue: false,
|
||||||
@@ -92,10 +88,15 @@ exports.handlers = {
|
|||||||
incompleteDoclet.stability = stability;
|
incompleteDoclet.stability = stability;
|
||||||
for (key in candidate) {
|
for (key in candidate) {
|
||||||
if (candidate.hasOwnProperty(key) &&
|
if (candidate.hasOwnProperty(key) &&
|
||||||
keepKeys.indexOf(key) == -1) {
|
keepKeys.indexOf(key) == -1) {
|
||||||
incompleteDoclet[key] = candidate[key];
|
incompleteDoclet[key] = candidate[key];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// We have found a matching parent doc and applied it so we
|
||||||
|
// don't want to ignore this doclet anymore.
|
||||||
|
incompleteDoclet.ignore = false;
|
||||||
|
// We found a match so we can stop break
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -214,55 +214,39 @@ function buildNav(members) {
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function createEntry(type, v) {
|
||||||
|
return {
|
||||||
|
type: type,
|
||||||
|
longname: v.longname,
|
||||||
|
name: v.name,
|
||||||
|
classes: find({
|
||||||
|
kind: 'class',
|
||||||
|
memberof: v.longname
|
||||||
|
}).map(createEntry.bind(this, 'class')),
|
||||||
|
members: find({
|
||||||
|
kind: 'member',
|
||||||
|
memberof: v.longname
|
||||||
|
}),
|
||||||
|
methods: find({
|
||||||
|
kind: 'function',
|
||||||
|
memberof: v.longname
|
||||||
|
}),
|
||||||
|
typedefs: find({
|
||||||
|
kind: 'typedef',
|
||||||
|
memberof: v.longname
|
||||||
|
}),
|
||||||
|
events: find({
|
||||||
|
kind: 'event',
|
||||||
|
memberof: v.longname
|
||||||
|
})
|
||||||
|
};
|
||||||
|
}
|
||||||
_.each(merged, function(v) {
|
_.each(merged, function(v) {
|
||||||
// exclude interfaces from sidebar
|
// exclude interfaces from sidebar
|
||||||
if (v.interface !== true) {
|
if (v.interface !== true) {
|
||||||
if (v.kind == 'module') {
|
if (v.kind == 'module') {
|
||||||
nav.push({
|
nav.push(createEntry('module', v));
|
||||||
type: 'module',
|
|
||||||
longname: v.longname,
|
|
||||||
name: v.name,
|
|
||||||
members: find({
|
|
||||||
kind: 'member',
|
|
||||||
memberof: v.longname
|
|
||||||
}),
|
|
||||||
methods: find({
|
|
||||||
kind: 'function',
|
|
||||||
memberof: v.longname
|
|
||||||
}),
|
|
||||||
typedefs: find({
|
|
||||||
kind: 'typedef',
|
|
||||||
memberof: v.longname
|
|
||||||
}),
|
|
||||||
events: find({
|
|
||||||
kind: 'event',
|
|
||||||
memberof: v.longname
|
|
||||||
})
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (v.kind == 'class') {
|
|
||||||
nav.push({
|
|
||||||
type: 'class',
|
|
||||||
longname: v.longname,
|
|
||||||
name: v.name,
|
|
||||||
members: find({
|
|
||||||
kind: 'member',
|
|
||||||
memberof: v.longname
|
|
||||||
}),
|
|
||||||
methods: find({
|
|
||||||
kind: 'function',
|
|
||||||
memberof: v.longname
|
|
||||||
}),
|
|
||||||
typedefs: find({
|
|
||||||
kind: 'typedef',
|
|
||||||
memberof: v.longname
|
|
||||||
}),
|
|
||||||
fires: v.fires,
|
|
||||||
events: find({
|
|
||||||
kind: 'event',
|
|
||||||
memberof: v.longname
|
|
||||||
})
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -12,13 +12,18 @@ $(function () {
|
|||||||
var $item = $(v);
|
var $item = $(v);
|
||||||
|
|
||||||
if ($item.data('name') && regexp.test($item.data('name'))) {
|
if ($item.data('name') && regexp.test($item.data('name'))) {
|
||||||
|
const container = $item.parent().parent().parent();
|
||||||
|
container.show();
|
||||||
|
container.closest('.itemMembers').show();
|
||||||
|
container.closest('.item').show();
|
||||||
$item.show();
|
$item.show();
|
||||||
$item.closest('.itemMembers').show();
|
$item.closest('.itemMembers').show();
|
||||||
$item.closest('.item').show();
|
$item.closest('.item').show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
$el.find('.item, .itemMembers').show();
|
$el.find('.item, .itemMembers').hide();
|
||||||
|
$('.navigation>ul>li').show();
|
||||||
}
|
}
|
||||||
|
|
||||||
$el.find('.list').scrollTop(0);
|
$el.find('.list').scrollTop(0);
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
<sup class="variation"><?js= doc.variation ?></sup>
|
<sup class="variation"><?js= doc.variation ?></sup>
|
||||||
<?js } ?></h2>
|
<?js } ?></h2>
|
||||||
<br>
|
<br>
|
||||||
<?js if (doc.stability || doc.kind == 'namespace') {
|
<?js if (doc.stability || doc.kind == 'namespace' || doc.kind == 'module') {
|
||||||
var ancestors = doc.ancestors.map(a => a.replace(/>\./g, '>').replace(/\.</g, '<')).join('/');
|
var ancestors = doc.ancestors.map(a => a.replace(/>\./g, '>').replace(/\.</g, '<')).join('/');
|
||||||
var parts = [];
|
var parts = [];
|
||||||
if (ancestors) {
|
if (ancestors) {
|
||||||
@@ -26,7 +26,20 @@
|
|||||||
}
|
}
|
||||||
var importPath = parts.join('/');
|
var importPath = parts.join('/');
|
||||||
?>
|
?>
|
||||||
<pre class="prettyprint source"><code>import <?js= doc.name ?> from '<?js= importPath ?>';</code></pre>
|
<?js
|
||||||
|
var nameParts = doc.name.split('/');
|
||||||
|
var moduleName = nameParts[nameParts.length - 1];
|
||||||
|
if(moduleName) {
|
||||||
|
var firstChar = moduleName.charAt(0);
|
||||||
|
moduleName = firstChar.toUpperCase() + moduleName.slice(1);
|
||||||
|
var isClassModule = firstChar.toUpperCase() === firstChar;
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<?js if (doc.kind == 'module' && !isClassModule && nameParts.length < 3) {?>
|
||||||
|
<pre class="prettyprint source"><code>import * as ol<?js= moduleName ?> from '<?js= doc.name ?>';</code></pre>
|
||||||
|
<?js } else if(doc.kind !== 'module') { ?>
|
||||||
|
<pre class="prettyprint source"><code>import <?js= doc.name ?> from '<?js= importPath ?>';</code></pre>
|
||||||
|
<?js } ?>
|
||||||
<?js } ?>
|
<?js } ?>
|
||||||
<?js if (doc.classdesc) { ?>
|
<?js if (doc.classdesc) { ?>
|
||||||
<div class="class-description"><?js= doc.classdesc ?></div>
|
<div class="class-description"><?js= doc.classdesc ?></div>
|
||||||
@@ -143,6 +156,7 @@
|
|||||||
<h3 class="subsection-title">Methods</h3>
|
<h3 class="subsection-title">Methods</h3>
|
||||||
|
|
||||||
<dl><?js methods.forEach(function(m) { ?>
|
<dl><?js methods.forEach(function(m) { ?>
|
||||||
|
<?js m.parent = doc ?>
|
||||||
<?js= self.partial('method.tmpl', m) ?>
|
<?js= self.partial('method.tmpl', m) ?>
|
||||||
<?js }); ?></dl>
|
<?js }); ?></dl>
|
||||||
<?js } ?>
|
<?js } ?>
|
||||||
|
|||||||
@@ -27,6 +27,10 @@ var self = this;
|
|||||||
</dt>
|
</dt>
|
||||||
<dd class="<?js= (data.stability && data.stability !== 'stable') ? 'unstable' : '' ?>">
|
<dd class="<?js= (data.stability && data.stability !== 'stable') ? 'unstable' : '' ?>">
|
||||||
|
|
||||||
|
<?js if (data.parent && data.parent.kind == 'module' && data.parent.name.split('ol/').length < 3) { ?>
|
||||||
|
<pre class="prettyprint source"><code>import {<?js= data.name ?>} from '<?js= data.parent.name ?>';</code></pre>
|
||||||
|
<?js } ?>
|
||||||
|
|
||||||
<?js if (data.description) { ?>
|
<?js if (data.description) { ?>
|
||||||
<div class="description">
|
<div class="description">
|
||||||
<?js= data.description ?>
|
<?js= data.description ?>
|
||||||
|
|||||||
@@ -10,11 +10,12 @@ function toShortName(name) {
|
|||||||
</div>
|
</div>
|
||||||
<ul class="list">
|
<ul class="list">
|
||||||
<?js
|
<?js
|
||||||
this.nav.forEach(function (item) {
|
let navbuilder;
|
||||||
|
this.nav.forEach(navbuilder = function (item) {
|
||||||
?>
|
?>
|
||||||
<li class="item" data-name="<?js= item.longname ?>">
|
<li class="item" data-name="<?js= item.longname ?>">
|
||||||
<span class="title">
|
<span class="title">
|
||||||
<?js= self.linkto(item.longname, item.longname.replace('module:', '')) ?>
|
<?js= self.linkto(item.longname, item.type === 'module' ? item.longname.replace('module:', '') : item.name) ?>
|
||||||
<?js if (item.type === 'namespace' &&
|
<?js if (item.type === 'namespace' &&
|
||||||
(item.members.length + item.typedefs.length + item.methods.length +
|
(item.members.length + item.typedefs.length + item.methods.length +
|
||||||
item.events.length > 0)) { ?>
|
item.events.length > 0)) { ?>
|
||||||
@@ -22,6 +23,18 @@ function toShortName(name) {
|
|||||||
</span>
|
</span>
|
||||||
<ul class="members itemMembers">
|
<ul class="members itemMembers">
|
||||||
<?js
|
<?js
|
||||||
|
if (item.classes.length) {
|
||||||
|
?>
|
||||||
|
<span class="subtitle">Classes</span>
|
||||||
|
<?js
|
||||||
|
item.classes.forEach(function (v) {
|
||||||
|
navbuilder(v);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</ul>
|
||||||
|
<ul class="members itemMembers">
|
||||||
|
<?js
|
||||||
if (item.members.length) {
|
if (item.members.length) {
|
||||||
?>
|
?>
|
||||||
<span class="subtitle">Members</span>
|
<span class="subtitle">Members</span>
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
|
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
|
||||||
|
|
||||||
/* Module Resolution Options */
|
/* Module Resolution Options */
|
||||||
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
|
"moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
|
||||||
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
|
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
|
||||||
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
|
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
|
||||||
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
|
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
|
||||||
|
|||||||
@@ -220,3 +220,19 @@ Duplicate item added to a unique collection. For example, it may be that you tr
|
|||||||
### 59
|
### 59
|
||||||
|
|
||||||
Invalid command found in the PBF. This indicates that the loaded vector tile may be corrupt.
|
Invalid command found in the PBF. This indicates that the loaded vector tile may be corrupt.
|
||||||
|
|
||||||
|
### 60
|
||||||
|
|
||||||
|
Missing or invalid `size`.
|
||||||
|
|
||||||
|
### 61
|
||||||
|
|
||||||
|
Cannot determine IIIF Image API version from provided image information JSON.
|
||||||
|
|
||||||
|
### 62
|
||||||
|
|
||||||
|
A `WebGLArrayBuffer` must either be of type `ELEMENT_ARRAY_BUFFER` or `ARRAY_BUFFER`.
|
||||||
|
|
||||||
|
### 63
|
||||||
|
|
||||||
|
Support for the `OES_element_index_uint` WebGL extension is mandatory for WebGL layers.
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
"common": false,
|
"common": false,
|
||||||
"createMapboxStreetsV6Style": false,
|
"createMapboxStreetsV6Style": false,
|
||||||
"d3": false,
|
"d3": false,
|
||||||
"domtoimage": false,
|
|
||||||
"geojsonvt": false,
|
"geojsonvt": false,
|
||||||
"GyroNorm": false,
|
"GyroNorm": false,
|
||||||
"jsPDF": false,
|
"jsPDF": false,
|
||||||
|
|||||||
@@ -21,8 +21,6 @@ tags: "center, rotation, openstreetmap"
|
|||||||
<div class="padding-bottom"></div>
|
<div class="padding-bottom"></div>
|
||||||
<div class="center"></div>
|
<div class="center"></div>
|
||||||
</div>
|
</div>
|
||||||
<button id="zoomtoswitzerlandbest">Zoom to Switzerland</button> (best fit),<br/>
|
<button id="zoomtoswitzerland">Zoom to Switzerland</button> (best fit).<br/>
|
||||||
<button id="zoomtoswitzerlandconstrained">Zoom to Switzerland</button> (respect resolution constraint).<br/>
|
|
||||||
<button id="zoomtoswitzerlandnearest">Zoom to Switzerland</button> (nearest),<br/>
|
|
||||||
<button id="zoomtolausanne">Zoom to Lausanne</button> (with min resolution),<br/>
|
<button id="zoomtolausanne">Zoom to Lausanne</button> (with min resolution),<br/>
|
||||||
<button id="centerlausanne">Center on Lausanne</button>
|
<button id="centerlausanne">Center on Lausanne</button>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import {Tile as TileLayer, Vector as VectorLayer} from '../src/ol/layer.js';
|
|||||||
import {OSM, Vector as VectorSource} from '../src/ol/source.js';
|
import {OSM, Vector as VectorSource} from '../src/ol/source.js';
|
||||||
import {Circle as CircleStyle, Fill, Stroke, Style} from '../src/ol/style.js';
|
import {Circle as CircleStyle, Fill, Stroke, Style} from '../src/ol/style.js';
|
||||||
|
|
||||||
|
/** @type {VectorSource<import("../src/ol/geom/SimpleGeometry.js").default>} */
|
||||||
const source = new VectorSource({
|
const source = new VectorSource({
|
||||||
url: 'data/geojson/switzerland.geojson',
|
url: 'data/geojson/switzerland.geojson',
|
||||||
format: new GeoJSON()
|
format: new GeoJSON()
|
||||||
@@ -47,40 +48,25 @@ const map = new Map({
|
|||||||
view: view
|
view: view
|
||||||
});
|
});
|
||||||
|
|
||||||
const zoomtoswitzerlandbest = document.getElementById('zoomtoswitzerlandbest');
|
const zoomtoswitzerland =
|
||||||
zoomtoswitzerlandbest.addEventListener('click', function() {
|
document.getElementById('zoomtoswitzerland');
|
||||||
|
zoomtoswitzerland.addEventListener('click', function() {
|
||||||
const feature = source.getFeatures()[0];
|
const feature = source.getFeatures()[0];
|
||||||
const polygon = /** @type {import("../src/ol/geom/SimpleGeometry.js").default} */ (feature.getGeometry());
|
const polygon = feature.getGeometry();
|
||||||
view.fit(polygon, {padding: [170, 50, 30, 150], constrainResolution: false});
|
|
||||||
}, false);
|
|
||||||
|
|
||||||
const zoomtoswitzerlandconstrained =
|
|
||||||
document.getElementById('zoomtoswitzerlandconstrained');
|
|
||||||
zoomtoswitzerlandconstrained.addEventListener('click', function() {
|
|
||||||
const feature = source.getFeatures()[0];
|
|
||||||
const polygon = /** @type {import("../src/ol/geom/SimpleGeometry.js").default} */ (feature.getGeometry());
|
|
||||||
view.fit(polygon, {padding: [170, 50, 30, 150]});
|
view.fit(polygon, {padding: [170, 50, 30, 150]});
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
const zoomtoswitzerlandnearest =
|
|
||||||
document.getElementById('zoomtoswitzerlandnearest');
|
|
||||||
zoomtoswitzerlandnearest.addEventListener('click', function() {
|
|
||||||
const feature = source.getFeatures()[0];
|
|
||||||
const polygon = /** @type {import("../src/ol/geom/SimpleGeometry.js").default} */ (feature.getGeometry());
|
|
||||||
view.fit(polygon, {padding: [170, 50, 30, 150], nearest: true});
|
|
||||||
}, false);
|
|
||||||
|
|
||||||
const zoomtolausanne = document.getElementById('zoomtolausanne');
|
const zoomtolausanne = document.getElementById('zoomtolausanne');
|
||||||
zoomtolausanne.addEventListener('click', function() {
|
zoomtolausanne.addEventListener('click', function() {
|
||||||
const feature = source.getFeatures()[1];
|
const feature = source.getFeatures()[1];
|
||||||
const point = /** @type {import("../src/ol/geom/SimpleGeometry.js").default} */ (feature.getGeometry());
|
const point = feature.getGeometry();
|
||||||
view.fit(point, {padding: [170, 50, 30, 150], minResolution: 50});
|
view.fit(point, {padding: [170, 50, 30, 150], minResolution: 50});
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
const centerlausanne = document.getElementById('centerlausanne');
|
const centerlausanne = document.getElementById('centerlausanne');
|
||||||
centerlausanne.addEventListener('click', function() {
|
centerlausanne.addEventListener('click', function() {
|
||||||
const feature = source.getFeatures()[1];
|
const feature = source.getFeatures()[1];
|
||||||
const point = /** @type {import("../src/ol/geom/Point.js").default} */ (feature.getGeometry());
|
const point = feature.getGeometry();
|
||||||
const size = map.getSize();
|
const size = map.getSize();
|
||||||
view.centerOn(point.getCoordinates(), size, [570, 500]);
|
view.centerOn(point.getCoordinates(), size, [570, 500]);
|
||||||
}, false);
|
}, false);
|
||||||
|
|||||||
@@ -100,8 +100,7 @@ function xyz2rgb(x) {
|
|||||||
|
|
||||||
const raster = new RasterSource({
|
const raster = new RasterSource({
|
||||||
sources: [new Stamen({
|
sources: [new Stamen({
|
||||||
layer: 'watercolor',
|
layer: 'watercolor'
|
||||||
transition: 0
|
|
||||||
})],
|
})],
|
||||||
operation: function(pixels, data) {
|
operation: function(pixels, data) {
|
||||||
const hcl = rgb2hcl(pixels[0]);
|
const hcl = rgb2hcl(pixels[0]);
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ const map = new Map({
|
|||||||
layers: [
|
layers: [
|
||||||
new TileLayer({
|
new TileLayer({
|
||||||
source: new TileJSON({
|
source: new TileJSON({
|
||||||
url: 'https://api.tiles.mapbox.com/v3/mapbox.geography-class.json?secure'
|
url: 'https://a.tiles.mapbox.com/v3/aj.1x1-degrees.json'
|
||||||
})
|
})
|
||||||
}),
|
}),
|
||||||
new VectorLayer({
|
new VectorLayer({
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ docs: >
|
|||||||
The example loads TopoJSON geometries and uses d3 (<code>d3.geo.path</code>) to render these geometries to a SVG element.
|
The example loads TopoJSON geometries and uses d3 (<code>d3.geo.path</code>) to render these geometries to a SVG element.
|
||||||
tags: "d3"
|
tags: "d3"
|
||||||
resources:
|
resources:
|
||||||
- https://unpkg.com/d3@4.12.0/build/d3.js
|
- https://unpkg.com/d3@5.9.2/dist/d3.js
|
||||||
- https://unpkg.com/topojson@3.0.2/dist/topojson.js
|
- https://unpkg.com/topojson@3.0.2/dist/topojson.js
|
||||||
---
|
---
|
||||||
<div id="map" class="map"></div>
|
<div id="map" class="map"></div>
|
||||||
|
|||||||
4
examples/d3.js
vendored
@@ -2,7 +2,7 @@ import Map from '../src/ol/Map.js';
|
|||||||
import View from '../src/ol/View.js';
|
import View from '../src/ol/View.js';
|
||||||
import {getWidth, getCenter} from '../src/ol/extent.js';
|
import {getWidth, getCenter} from '../src/ol/extent.js';
|
||||||
import {Layer, Tile as TileLayer} from '../src/ol/layer.js';
|
import {Layer, Tile as TileLayer} from '../src/ol/layer.js';
|
||||||
import SourceState from '../src/ol/source/State';
|
import SourceState from '../src/ol/source/State.js';
|
||||||
import {fromLonLat, toLonLat} from '../src/ol/proj.js';
|
import {fromLonLat, toLonLat} from '../src/ol/proj.js';
|
||||||
import Stamen from '../src/ol/source/Stamen.js';
|
import Stamen from '../src/ol/source/Stamen.js';
|
||||||
|
|
||||||
@@ -85,7 +85,7 @@ const map = new Map({
|
|||||||
/**
|
/**
|
||||||
* Load the topojson data and create an ol/layer/Image for that data.
|
* Load the topojson data and create an ol/layer/Image for that data.
|
||||||
*/
|
*/
|
||||||
d3.json('data/topojson/us.json', function(error, us) {
|
d3.json('data/topojson/us.json').then(function(us) {
|
||||||
|
|
||||||
const layer = new CanvasLayer({
|
const layer = new CanvasLayer({
|
||||||
features: topojson.feature(us, us.objects.counties)
|
features: topojson.feature(us, us.objects.counties)
|
||||||
|
|||||||
45717
examples/data/csv/meteorite_landings.csv
Normal file
7
examples/data/square.svg
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
|
||||||
|
<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g>
|
||||||
|
<rect width="20" height="20" style="fill:#fff" />
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 194 B |
@@ -40,6 +40,6 @@ gn.init().then(function() {
|
|||||||
center[0] -= resolution * gamma * 25;
|
center[0] -= resolution * gamma * 25;
|
||||||
center[1] += resolution * beta * 25;
|
center[1] += resolution * beta * 25;
|
||||||
|
|
||||||
view.setCenter(view.constrainCenter(center));
|
view.setCenter(center);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
#map {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
#info {
|
|
||||||
position: absolute;
|
|
||||||
height: 1px;
|
|
||||||
width: 1px;
|
|
||||||
z-index: 100;
|
|
||||||
}
|
|
||||||
.tooltip.in {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
.tooltip.top .tooltip-arrow {
|
|
||||||
border-top-color: white;
|
|
||||||
}
|
|
||||||
.tooltip-inner {
|
|
||||||
border: 2px solid white;
|
|
||||||
}
|
|
||||||
6
examples/export-map.css
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
.overlay {
|
||||||
|
background-color: yellow;
|
||||||
|
border-radius: 6px;
|
||||||
|
padding: 4px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
@@ -3,12 +3,13 @@ layout: example.html
|
|||||||
title: Map Export
|
title: Map Export
|
||||||
shortdesc: Example of exporting a map as a PNG image.
|
shortdesc: Example of exporting a map as a PNG image.
|
||||||
docs: >
|
docs: >
|
||||||
Example of exporting a map as a PNG image. This example use the <a href="https://www.npmjs.com/package/dom-to-image-more">dom-to-image-more</a>
|
Example of exporting a map as a PNG image. This example use the <a href="https://www.npmjs.com/package/html-to-image">html-to-image</a>
|
||||||
library.
|
library.
|
||||||
tags: "export, png, openstreetmap"
|
tags: "export, png, openstreetmap"
|
||||||
resources:
|
|
||||||
- https://unpkg.com/dom-to-image-more@2.7.1/dist/dom-to-image-more.min.js
|
|
||||||
---
|
---
|
||||||
<div id="map" class="map"></div>
|
<div id="map" class="map"></div>
|
||||||
|
<div style="display: none;">
|
||||||
|
<div class="overlay" id="null">Null Island</div>
|
||||||
|
</div>
|
||||||
<a id="export-png" class="btn btn-default"><i class="fa fa-download"></i> Download PNG</a>
|
<a id="export-png" class="btn btn-default"><i class="fa fa-download"></i> Download PNG</a>
|
||||||
<a id="image-download" download="map.png"></a>
|
<a id="image-download" download="map.png"></a>
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
import Map from '../src/ol/Map.js';
|
import Map from '../src/ol/Map.js';
|
||||||
import View from '../src/ol/View.js';
|
import View from '../src/ol/View.js';
|
||||||
|
import Overlay from '../src/ol/Overlay.js';
|
||||||
import GeoJSON from '../src/ol/format/GeoJSON.js';
|
import GeoJSON from '../src/ol/format/GeoJSON.js';
|
||||||
import {Tile as TileLayer, Vector as VectorLayer} from '../src/ol/layer.js';
|
import {Tile as TileLayer, Vector as VectorLayer} from '../src/ol/layer.js';
|
||||||
import {OSM, Vector as VectorSource} from '../src/ol/source.js';
|
import {OSM, Vector as VectorSource} from '../src/ol/source.js';
|
||||||
|
|
||||||
|
import {toPng} from 'html-to-image';
|
||||||
|
|
||||||
const map = new Map({
|
const map = new Map({
|
||||||
layers: [
|
layers: [
|
||||||
new TileLayer({
|
new TileLayer({
|
||||||
@@ -23,9 +26,23 @@ const map = new Map({
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
map.addOverlay(new Overlay({
|
||||||
|
position: [0, 0],
|
||||||
|
element: document.getElementById('null')
|
||||||
|
}));
|
||||||
|
|
||||||
|
|
||||||
|
// export options for html-to-image.
|
||||||
|
// See: https://github.com/bubkoo/html-to-image#options
|
||||||
|
const exportOptions = {
|
||||||
|
filter: function(element) {
|
||||||
|
return element.className ? element.className.indexOf('ol-control') === -1 : true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
document.getElementById('export-png').addEventListener('click', function() {
|
document.getElementById('export-png').addEventListener('click', function() {
|
||||||
map.once('rendercomplete', function() {
|
map.once('rendercomplete', function() {
|
||||||
domtoimage.toPng(map.getViewport().querySelector('.ol-layers'))
|
toPng(map.getTargetElement(), exportOptions)
|
||||||
.then(function(dataURL) {
|
.then(function(dataURL) {
|
||||||
const link = document.getElementById('image-download');
|
const link = document.getElementById('image-download');
|
||||||
link.href = dataURL;
|
link.href = dataURL;
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ docs: >
|
|||||||
tags: "export, pdf, openstreetmap"
|
tags: "export, pdf, openstreetmap"
|
||||||
resources:
|
resources:
|
||||||
- https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.2.61/jspdf.min.js
|
- https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.2.61/jspdf.min.js
|
||||||
- https://unpkg.com/dom-to-image-more@2.7.1/dist/dom-to-image-more.min.js
|
|
||||||
---
|
---
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="span12">
|
<div class="span12">
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import WKT from '../src/ol/format/WKT.js';
|
|||||||
import {Tile as TileLayer, Vector as VectorLayer} from '../src/ol/layer.js';
|
import {Tile as TileLayer, Vector as VectorLayer} from '../src/ol/layer.js';
|
||||||
import {OSM, Vector as VectorSource} from '../src/ol/source.js';
|
import {OSM, Vector as VectorSource} from '../src/ol/source.js';
|
||||||
|
|
||||||
|
import {toJpeg} from 'html-to-image';
|
||||||
|
|
||||||
const raster = new TileLayer({
|
const raster = new TileLayer({
|
||||||
source: new OSM()
|
source: new OSM()
|
||||||
});
|
});
|
||||||
@@ -41,6 +43,15 @@ const dims = {
|
|||||||
a5: [210, 148]
|
a5: [210, 148]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// export options for html-to-image.
|
||||||
|
// See: https://github.com/bubkoo/html-to-image#options
|
||||||
|
const exportOptions = {
|
||||||
|
filter: function(element) {
|
||||||
|
return element.className.indexOf('ol-control') === -1;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const exportButton = document.getElementById('export-pdf');
|
const exportButton = document.getElementById('export-pdf');
|
||||||
|
|
||||||
exportButton.addEventListener('click', function() {
|
exportButton.addEventListener('click', function() {
|
||||||
@@ -57,15 +68,14 @@ exportButton.addEventListener('click', function() {
|
|||||||
const extent = map.getView().calculateExtent(size);
|
const extent = map.getView().calculateExtent(size);
|
||||||
|
|
||||||
map.once('rendercomplete', function() {
|
map.once('rendercomplete', function() {
|
||||||
domtoimage.toJpeg(map.getViewport().querySelector('.ol-layers')).then(function(dataUrl) {
|
toJpeg(map.getTargetElement(), exportOptions).then(function(dataUrl) {
|
||||||
const pdf = new jsPDF('landscape', undefined, format);
|
const pdf = new jsPDF('landscape', undefined, format);
|
||||||
pdf.addImage(dataUrl, 'JPEG', 0, 0, dim[0], dim[1]);
|
pdf.addImage(dataUrl, 'JPEG', 0, 0, dim[0], dim[1]);
|
||||||
pdf.save('map.pdf');
|
pdf.save('map.pdf');
|
||||||
// Reset original map size
|
// Reset original map size
|
||||||
map.setSize(size);
|
map.setSize(size);
|
||||||
map.getView().fit(extent, {
|
map.getView().fit(extent, {
|
||||||
size: size,
|
size: size
|
||||||
constrainResolution: false
|
|
||||||
});
|
});
|
||||||
exportButton.disabled = false;
|
exportButton.disabled = false;
|
||||||
document.body.style.cursor = 'auto';
|
document.body.style.cursor = 'auto';
|
||||||
|
|||||||
9
examples/extent-constrained.html
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
layout: example.html
|
||||||
|
title: Constrained Extent
|
||||||
|
shortdesc: Example of a view with a constrained extent.
|
||||||
|
docs: >
|
||||||
|
This map has a view that is constrained in an extent. This is done using the `extent` view option. Please note that specifying `constrainOnlyCenter: true` would only apply the extent restriction to the view center.
|
||||||
|
tags: "view, extent, constrain, restrict"
|
||||||
|
---
|
||||||
|
<div id="map" class="map"></div>
|
||||||
25
examples/extent-constrained.js
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
import Map from '../src/ol/Map.js';
|
||||||
|
import View from '../src/ol/View.js';
|
||||||
|
import TileLayer from '../src/ol/layer/Tile.js';
|
||||||
|
import OSM from '../src/ol/source/OSM.js';
|
||||||
|
import {defaults as defaultControls} from '../src/ol/control.js';
|
||||||
|
import ZoomSlider from '../src/ol/control/ZoomSlider.js';
|
||||||
|
|
||||||
|
const view = new View({
|
||||||
|
center: [328627.563458, 5921296.662223],
|
||||||
|
zoom: 8,
|
||||||
|
extent: [-572513.341856, 5211017.966314,
|
||||||
|
916327.095083, 6636950.728974]
|
||||||
|
});
|
||||||
|
|
||||||
|
new Map({
|
||||||
|
layers: [
|
||||||
|
new TileLayer({
|
||||||
|
source: new OSM()
|
||||||
|
})
|
||||||
|
],
|
||||||
|
keyboardEventTarget: document,
|
||||||
|
target: 'map',
|
||||||
|
view: view,
|
||||||
|
controls: defaultControls().extend([new ZoomSlider()])
|
||||||
|
});
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
import Map from '../src/ol/Map.js';
|
import Map from '../src/ol/Map.js';
|
||||||
import View from '../src/ol/View.js';
|
import View from '../src/ol/View.js';
|
||||||
import {platformModifierKeyOnly} from '../src/ol/events/condition.js';
|
|
||||||
import GeoJSON from '../src/ol/format/GeoJSON.js';
|
import GeoJSON from '../src/ol/format/GeoJSON.js';
|
||||||
import ExtentInteraction from '../src/ol/interaction/Extent.js';
|
import ExtentInteraction from '../src/ol/interaction/Extent.js';
|
||||||
import {Tile as TileLayer, Vector as VectorLayer} from '../src/ol/layer.js';
|
import {Tile as TileLayer, Vector as VectorLayer} from '../src/ol/layer.js';
|
||||||
@@ -27,9 +26,7 @@ const map = new Map({
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
const extent = new ExtentInteraction({
|
const extent = new ExtentInteraction();
|
||||||
condition: platformModifierKeyOnly
|
|
||||||
});
|
|
||||||
map.addInteraction(extent);
|
map.addInteraction(extent);
|
||||||
extent.setActive(false);
|
extent.setActive(false);
|
||||||
|
|
||||||
|
|||||||
@@ -67,10 +67,10 @@ const routeFeature = new Feature({
|
|||||||
type: 'route',
|
type: 'route',
|
||||||
geometry: route
|
geometry: route
|
||||||
});
|
});
|
||||||
const geoMarker = new Feature({
|
const geoMarker = /** @type Feature<import("../src/ol/geom/Point").default> */(new Feature({
|
||||||
type: 'geoMarker',
|
type: 'geoMarker',
|
||||||
geometry: new Point(routeCoords[0])
|
geometry: new Point(routeCoords[0])
|
||||||
});
|
}));
|
||||||
const startMarker = new Feature({
|
const startMarker = new Feature({
|
||||||
type: 'icon',
|
type: 'icon',
|
||||||
geometry: new Point(routeCoords[0])
|
geometry: new Point(routeCoords[0])
|
||||||
@@ -191,7 +191,7 @@ function stopAnimation(ended) {
|
|||||||
|
|
||||||
// if animation cancelled set the marker at the beginning
|
// if animation cancelled set the marker at the beginning
|
||||||
const coord = ended ? routeCoords[routeLength - 1] : routeCoords[0];
|
const coord = ended ? routeCoords[routeLength - 1] : routeCoords[0];
|
||||||
const geometry = /** @type {import("../src/ol/geom/Point").default} */ (geoMarker.getGeometry());
|
const geometry = geoMarker.getGeometry();
|
||||||
geometry.setCoordinates(coord);
|
geometry.setCoordinates(coord);
|
||||||
//remove listener
|
//remove listener
|
||||||
vectorLayer.un('postrender', moveFeature);
|
vectorLayer.un('postrender', moveFeature);
|
||||||
|
|||||||
25
examples/filter-points-webgl.html
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
---
|
||||||
|
layout: example.html
|
||||||
|
title: Filtering features with WebGL
|
||||||
|
shortdesc: Using WebGL to filter large quantities of features
|
||||||
|
docs: >
|
||||||
|
This example shows how to use `ol/renderer/webgl/PointsLayer` to dynamically filter a large amount
|
||||||
|
of point geometries. The above map is based on a dataset from the NASA containing 45k recorded meteorite
|
||||||
|
landing sites. Each meteorite is marked by a circle on the map (the bigger the circle, the heavier
|
||||||
|
the object). A pulse effect has been added, which is slightly offset by the year of the impact.
|
||||||
|
|
||||||
|
Adjusting the sliders causes the objects outside of the date range to be filtered out of the map. This is done using
|
||||||
|
a custom fragment shader on the layer renderer, and by using the `v_opacity` attribute of the rendered objects
|
||||||
|
to store the year of impact.
|
||||||
|
|
||||||
|
tags: "webgl, icon, sprite, filter, feature"
|
||||||
|
---
|
||||||
|
<div id="map" class="map"></div>
|
||||||
|
<form>
|
||||||
|
<div id="status">Show impacts between <span class="min-year"></span> and <span class="max-year"></span></div>
|
||||||
|
|
||||||
|
<label>Minimum year:</label>
|
||||||
|
<input id="min-year" type="range" min="1850" max="2015" step="1" value="1850"/>
|
||||||
|
<label>Maximum year:</label>
|
||||||
|
<input id="max-year" type="range" min="1850" max="2015" step="1" value="2015"/>
|
||||||
|
</form>
|
||||||
163
examples/filter-points-webgl.js
Normal file
@@ -0,0 +1,163 @@
|
|||||||
|
import Map from '../src/ol/Map.js';
|
||||||
|
import View from '../src/ol/View.js';
|
||||||
|
import TileLayer from '../src/ol/layer/Tile.js';
|
||||||
|
import Feature from '../src/ol/Feature.js';
|
||||||
|
import Point from '../src/ol/geom/Point.js';
|
||||||
|
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||||
|
import {Vector} from '../src/ol/source.js';
|
||||||
|
import {fromLonLat} from '../src/ol/proj.js';
|
||||||
|
import WebGLPointsLayerRenderer from '../src/ol/renderer/webgl/PointsLayer.js';
|
||||||
|
import {clamp, lerp} from '../src/ol/math.js';
|
||||||
|
import Stamen from '../src/ol/source/Stamen.js';
|
||||||
|
|
||||||
|
const vectorSource = new Vector({
|
||||||
|
attributions: 'NASA'
|
||||||
|
});
|
||||||
|
|
||||||
|
const oldColor = [180, 140, 140];
|
||||||
|
const newColor = [255, 80, 80];
|
||||||
|
|
||||||
|
const startTime = Date.now() * 0.001;
|
||||||
|
|
||||||
|
// hanle input values & events
|
||||||
|
const minYearInput = document.getElementById('min-year');
|
||||||
|
const maxYearInput = document.getElementById('max-year');
|
||||||
|
function updateStatusText() {
|
||||||
|
const div = document.getElementById('status');
|
||||||
|
div.querySelector('span.min-year').textContent = minYearInput.value;
|
||||||
|
div.querySelector('span.max-year').textContent = maxYearInput.value;
|
||||||
|
}
|
||||||
|
minYearInput.addEventListener('input', updateStatusText);
|
||||||
|
minYearInput.addEventListener('change', updateStatusText);
|
||||||
|
maxYearInput.addEventListener('input', updateStatusText);
|
||||||
|
maxYearInput.addEventListener('change', updateStatusText);
|
||||||
|
updateStatusText();
|
||||||
|
|
||||||
|
class WebglPointsLayer extends VectorLayer {
|
||||||
|
createRenderer() {
|
||||||
|
return new WebGLPointsLayerRenderer(this, {
|
||||||
|
colorCallback: function(feature, color) {
|
||||||
|
// color is interpolated based on year
|
||||||
|
const ratio = clamp((feature.get('year') - 1800) / (2013 - 1800), 0, 1);
|
||||||
|
|
||||||
|
color[0] = lerp(oldColor[0], newColor[0], ratio) / 255;
|
||||||
|
color[1] = lerp(oldColor[1], newColor[1], ratio) / 255;
|
||||||
|
color[2] = lerp(oldColor[2], newColor[2], ratio) / 255;
|
||||||
|
color[3] = 1;
|
||||||
|
|
||||||
|
return color;
|
||||||
|
},
|
||||||
|
sizeCallback: function(feature) {
|
||||||
|
return 18 * clamp(feature.get('mass') / 200000, 0, 1) + 8;
|
||||||
|
},
|
||||||
|
fragmentShader: [
|
||||||
|
'precision mediump float;',
|
||||||
|
|
||||||
|
'uniform float u_time;',
|
||||||
|
'uniform float u_minYear;',
|
||||||
|
'uniform float u_maxYear;',
|
||||||
|
|
||||||
|
'varying vec2 v_texCoord;',
|
||||||
|
'varying float v_opacity;',
|
||||||
|
'varying vec4 v_color;',
|
||||||
|
|
||||||
|
'void main(void) {',
|
||||||
|
' float impactYear = v_opacity;',
|
||||||
|
|
||||||
|
// filter out pixels if the year is outside of the given range
|
||||||
|
' if (impactYear < u_minYear || v_opacity > u_maxYear) {',
|
||||||
|
' discard;',
|
||||||
|
' }',
|
||||||
|
|
||||||
|
' vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);',
|
||||||
|
' float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;',
|
||||||
|
' float value = 2.0 * (1.0 - sqRadius);',
|
||||||
|
' float alpha = smoothstep(0.0, 1.0, value);',
|
||||||
|
|
||||||
|
' vec3 color = v_color.rgb;',
|
||||||
|
' float period = 8.0;',
|
||||||
|
' color.g *= 2.0 * (1.0 - sqrt(mod(u_time + impactYear * 0.025, period) / period));',
|
||||||
|
|
||||||
|
' gl_FragColor = vec4(color, v_color.a);',
|
||||||
|
' gl_FragColor.a *= alpha;',
|
||||||
|
' gl_FragColor.rgb *= gl_FragColor.a;',
|
||||||
|
'}'
|
||||||
|
].join(' '),
|
||||||
|
opacityCallback: function(feature) {
|
||||||
|
// here the opacity channel of the vertices is used to store the year of impact
|
||||||
|
return feature.get('year');
|
||||||
|
},
|
||||||
|
uniforms: {
|
||||||
|
u_time: function() {
|
||||||
|
return Date.now() * 0.001 - startTime;
|
||||||
|
},
|
||||||
|
u_minYear: function() {
|
||||||
|
return parseInt(minYearInput.value);
|
||||||
|
},
|
||||||
|
u_maxYear: function() {
|
||||||
|
return parseInt(maxYearInput.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function loadData() {
|
||||||
|
const client = new XMLHttpRequest();
|
||||||
|
client.open('GET', 'data/csv/meteorite_landings.csv');
|
||||||
|
client.onload = function() {
|
||||||
|
const csv = client.responseText;
|
||||||
|
const features = [];
|
||||||
|
|
||||||
|
let prevIndex = csv.indexOf('\n') + 1; // scan past the header line
|
||||||
|
|
||||||
|
let curIndex;
|
||||||
|
while ((curIndex = csv.indexOf('\n', prevIndex)) != -1) {
|
||||||
|
const line = csv.substr(prevIndex, curIndex - prevIndex).split(',');
|
||||||
|
prevIndex = curIndex + 1;
|
||||||
|
|
||||||
|
const coords = fromLonLat([parseFloat(line[4]), parseFloat(line[3])]);
|
||||||
|
if (isNaN(coords[0]) || isNaN(coords[1])) {
|
||||||
|
// guard against bad data
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
features.push(new Feature({
|
||||||
|
mass: parseFloat(line[1]) || 0,
|
||||||
|
year: parseInt(line[2]) || 0,
|
||||||
|
geometry: new Point(coords)
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
vectorSource.addFeatures(features);
|
||||||
|
};
|
||||||
|
client.send();
|
||||||
|
}
|
||||||
|
|
||||||
|
loadData();
|
||||||
|
|
||||||
|
const map = new Map({
|
||||||
|
layers: [
|
||||||
|
new TileLayer({
|
||||||
|
source: new Stamen({
|
||||||
|
layer: 'toner'
|
||||||
|
})
|
||||||
|
}),
|
||||||
|
new WebglPointsLayer({
|
||||||
|
source: vectorSource
|
||||||
|
})
|
||||||
|
],
|
||||||
|
target: document.getElementById('map'),
|
||||||
|
view: new View({
|
||||||
|
center: [0, 0],
|
||||||
|
zoom: 2
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
// animate the map
|
||||||
|
function animate() {
|
||||||
|
map.render();
|
||||||
|
window.requestAnimationFrame(animate);
|
||||||
|
}
|
||||||
|
animate();
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
.map:-webkit-full-screen {
|
.map:-webkit-full-screen {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
margin: 0;
|
||||||
}
|
}
|
||||||
.map:-ms-fullscreen {
|
.map:-ms-fullscreen {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
.fullscreen:-webkit-full-screen {
|
.fullscreen:-webkit-full-screen {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
margin: 0;
|
||||||
}
|
}
|
||||||
.fullscreen:-ms-fullscreen {
|
.fullscreen:-ms-fullscreen {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
.map:-webkit-full-screen {
|
.map:-webkit-full-screen {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
margin: 0;
|
||||||
}
|
}
|
||||||
.map:-ms-fullscreen {
|
.map:-ms-fullscreen {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import VectorTileSource from '../src/ol/source/VectorTile.js';
|
|||||||
import {Tile as TileLayer, VectorTile as VectorTileLayer} from '../src/ol/layer.js';
|
import {Tile as TileLayer, VectorTile as VectorTileLayer} from '../src/ol/layer.js';
|
||||||
import Projection from '../src/ol/proj/Projection.js';
|
import Projection from '../src/ol/proj/Projection.js';
|
||||||
|
|
||||||
|
// Converts geojson-vt data to GeoJSON
|
||||||
const replacer = function(key, value) {
|
const replacer = function(key, value) {
|
||||||
if (value.geometry) {
|
if (value.geometry) {
|
||||||
let type;
|
let type;
|
||||||
@@ -46,11 +46,6 @@ const replacer = function(key, value) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const tilePixels = new Projection({
|
|
||||||
code: 'TILE_PIXELS',
|
|
||||||
units: 'tile-pixels'
|
|
||||||
});
|
|
||||||
|
|
||||||
const map = new Map({
|
const map = new Map({
|
||||||
layers: [
|
layers: [
|
||||||
new TileLayer({
|
new TileLayer({
|
||||||
@@ -73,23 +68,22 @@ fetch(url).then(function(response) {
|
|||||||
debug: 1
|
debug: 1
|
||||||
});
|
});
|
||||||
const vectorSource = new VectorTileSource({
|
const vectorSource = new VectorTileSource({
|
||||||
format: new GeoJSON(),
|
format: new GeoJSON({
|
||||||
tileLoadFunction: function(tile) {
|
// Data returned from geojson-vt is in tile pixel units
|
||||||
const format = tile.getFormat();
|
dataProjection: new Projection({
|
||||||
const tileCoord = tile.getTileCoord();
|
code: 'TILE_PIXELS',
|
||||||
|
units: 'tile-pixels',
|
||||||
|
extent: [0, 0, 4096, 4096]
|
||||||
|
})
|
||||||
|
}),
|
||||||
|
tileUrlFunction: function(tileCoord) {
|
||||||
const data = tileIndex.getTile(tileCoord[0], tileCoord[1], tileCoord[2]);
|
const data = tileIndex.getTile(tileCoord[0], tileCoord[1], tileCoord[2]);
|
||||||
|
const geojson = JSON.stringify({
|
||||||
const features = format.readFeatures(
|
type: 'FeatureCollection',
|
||||||
JSON.stringify({
|
features: data ? data.features : []
|
||||||
type: 'FeatureCollection',
|
}, replacer);
|
||||||
features: data ? data.features : []
|
return 'data:application/json;charset=UTF-8,' + geojson;
|
||||||
}, replacer));
|
}
|
||||||
tile.setLoader(function() {
|
|
||||||
tile.setFeatures(features);
|
|
||||||
tile.setProjection(tilePixels);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
url: 'data:' // arbitrary url, we don't use it in the tileLoadFunction
|
|
||||||
});
|
});
|
||||||
const vectorLayer = new VectorTileLayer({
|
const vectorLayer = new VectorTileLayer({
|
||||||
source: vectorSource
|
source: vectorSource
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: Earthquakes Heatmap
|
|||||||
shortdesc: Demonstrates the use of a heatmap layer.
|
shortdesc: Demonstrates the use of a heatmap layer.
|
||||||
docs: >
|
docs: >
|
||||||
This example parses a KML file and renders the features as a <code>ol/layer/Heatmap</code> layer.
|
This example parses a KML file and renders the features as a <code>ol/layer/Heatmap</code> layer.
|
||||||
tags: "heatmap, kml, vector, style"
|
tags: "heatmap, kml, vector, style, webgl"
|
||||||
---
|
---
|
||||||
<div id="map" class="map"></div>
|
<div id="map" class="map"></div>
|
||||||
<form>
|
<form>
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
#map {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
@@ -25,7 +25,7 @@ rome.setStyle(new Style({
|
|||||||
image: new Icon({
|
image: new Icon({
|
||||||
color: '#8959A8',
|
color: '#8959A8',
|
||||||
crossOrigin: 'anonymous',
|
crossOrigin: 'anonymous',
|
||||||
src: 'data/dot.png'
|
src: 'data/square.svg'
|
||||||
})
|
})
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ const vectorLayer = new VectorLayer({
|
|||||||
|
|
||||||
const rasterLayer = new TileLayer({
|
const rasterLayer = new TileLayer({
|
||||||
source: new TileJSON({
|
source: new TileJSON({
|
||||||
url: 'https://api.tiles.mapbox.com/v3/mapbox.geography-class.json?secure',
|
url: 'https://a.tiles.mapbox.com/v3/aj.1x1-degrees.json',
|
||||||
crossOrigin: ''
|
crossOrigin: ''
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -13,5 +13,8 @@ docs: >
|
|||||||
|
|
||||||
The dataset contains around 80k points and can be found here: https://www.kaggle.com/NUFORC/ufo-sightings
|
The dataset contains around 80k points and can be found here: https://www.kaggle.com/NUFORC/ufo-sightings
|
||||||
tags: "webgl, icon, sprite, point, ufo"
|
tags: "webgl, icon, sprite, point, ufo"
|
||||||
|
cloak:
|
||||||
|
- key: pk.eyJ1IjoidHNjaGF1YiIsImEiOiJjaW5zYW5lNHkxMTNmdWttM3JyOHZtMmNtIn0.CDIBD8H-G2Gf-cPkIuWtRg
|
||||||
|
value: Your Mapbox access token from https://mapbox.com/ here
|
||||||
---
|
---
|
||||||
<div id="map" class="map"></div>
|
<div id="map" class="map"></div>
|
||||||
|
|||||||
@@ -1,16 +1,17 @@
|
|||||||
import Map from '../src/ol/Map.js';
|
import Map from '../src/ol/Map.js';
|
||||||
import View from '../src/ol/View.js';
|
import View from '../src/ol/View.js';
|
||||||
import TileLayer from '../src/ol/layer/Tile.js';
|
import TileLayer from '../src/ol/layer/Tile.js';
|
||||||
import TileJSON from '../src/ol/source/TileJSON';
|
import TileJSON from '../src/ol/source/TileJSON.js';
|
||||||
import Feature from '../src/ol/Feature';
|
import Feature from '../src/ol/Feature.js';
|
||||||
import Point from '../src/ol/geom/Point';
|
import Point from '../src/ol/geom/Point.js';
|
||||||
import VectorLayer from '../src/ol/layer/Vector';
|
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||||
import {Vector} from '../src/ol/source';
|
import {Vector} from '../src/ol/source.js';
|
||||||
import {fromLonLat} from '../src/ol/proj';
|
import {fromLonLat} from '../src/ol/proj.js';
|
||||||
import WebGLPointsLayerRenderer from '../src/ol/renderer/webgl/PointsLayer';
|
import WebGLPointsLayerRenderer from '../src/ol/renderer/webgl/PointsLayer.js';
|
||||||
import {lerp} from '../src/ol/math';
|
import {lerp} from '../src/ol/math.js';
|
||||||
|
|
||||||
|
const key = 'pk.eyJ1IjoidHNjaGF1YiIsImEiOiJjaW5zYW5lNHkxMTNmdWttM3JyOHZtMmNtIn0.CDIBD8H-G2Gf-cPkIuWtRg';
|
||||||
|
|
||||||
const features = [];
|
|
||||||
const vectorSource = new Vector({
|
const vectorSource = new Vector({
|
||||||
features: [],
|
features: [],
|
||||||
attributions: 'National UFO Reporting Center'
|
attributions: 'National UFO Reporting Center'
|
||||||
@@ -39,16 +40,17 @@ class WebglPointsLayer extends VectorLayer {
|
|||||||
createRenderer() {
|
createRenderer() {
|
||||||
return new WebGLPointsLayerRenderer(this, {
|
return new WebGLPointsLayerRenderer(this, {
|
||||||
texture: texture,
|
texture: texture,
|
||||||
colorCallback: function(feature, vertex, component) {
|
colorCallback: function(feature, color) {
|
||||||
// component at index 3 is alpha
|
|
||||||
if (component === 3) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// color is interpolated based on year (min is 1910, max is 2013)
|
// color is interpolated based on year (min is 1910, max is 2013)
|
||||||
// please note: most values are between 2000-2013
|
// please note: most values are between 2000-2013
|
||||||
const ratio = (feature.get('year') - 1950) / (2013 - 1950);
|
const ratio = (feature.get('year') - 1950) / (2013 - 1950);
|
||||||
return lerp(oldColor[component], newColor[component], ratio * ratio) / 255;
|
|
||||||
|
color[0] = lerp(oldColor[0], newColor[0], ratio * ratio) / 255;
|
||||||
|
color[1] = lerp(oldColor[1], newColor[1], ratio * ratio) / 255;
|
||||||
|
color[2] = lerp(oldColor[2], newColor[2], ratio * ratio) / 255;
|
||||||
|
color[3] = 1;
|
||||||
|
|
||||||
|
return color;
|
||||||
},
|
},
|
||||||
texCoordCallback: function(feature, component) {
|
texCoordCallback: function(feature, component) {
|
||||||
let coords = shapeTextureCoords[feature.get('shape')];
|
let coords = shapeTextureCoords[feature.get('shape')];
|
||||||
@@ -70,17 +72,14 @@ function loadData() {
|
|||||||
client.open('GET', 'data/csv/ufo_sighting_data.csv');
|
client.open('GET', 'data/csv/ufo_sighting_data.csv');
|
||||||
client.onload = function() {
|
client.onload = function() {
|
||||||
const csv = client.responseText;
|
const csv = client.responseText;
|
||||||
let curIndex;
|
const features = [];
|
||||||
let prevIndex = 0;
|
|
||||||
let line;
|
|
||||||
while ((curIndex = csv.indexOf('\n', prevIndex)) > 0) {
|
|
||||||
line = csv.substr(prevIndex, curIndex - prevIndex).split(',');
|
|
||||||
prevIndex = curIndex + 1;
|
|
||||||
|
|
||||||
// skip header
|
let prevIndex = csv.indexOf('\n') + 1; // scan past the header line
|
||||||
if (prevIndex === 0) {
|
|
||||||
continue;
|
let curIndex;
|
||||||
}
|
while ((curIndex = csv.indexOf('\n', prevIndex)) != -1) {
|
||||||
|
const line = csv.substr(prevIndex, curIndex - prevIndex).split(',');
|
||||||
|
prevIndex = curIndex + 1;
|
||||||
|
|
||||||
const coords = fromLonLat([parseFloat(line[5]), parseFloat(line[4])]);
|
const coords = fromLonLat([parseFloat(line[5]), parseFloat(line[4])]);
|
||||||
|
|
||||||
@@ -108,7 +107,7 @@ new Map({
|
|||||||
layers: [
|
layers: [
|
||||||
new TileLayer({
|
new TileLayer({
|
||||||
source: new TileJSON({
|
source: new TileJSON({
|
||||||
url: 'https://api.tiles.mapbox.com/v3/mapbox.world-dark.json?secure',
|
url: 'https://api.tiles.mapbox.com/v4/mapbox.world-dark.json?access_token=' + key,
|
||||||
crossOrigin: 'anonymous'
|
crossOrigin: 'anonymous'
|
||||||
})
|
})
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
#map {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
@@ -37,7 +37,7 @@ const vectorLayer = new VectorLayer({
|
|||||||
|
|
||||||
const rasterLayer = new TileLayer({
|
const rasterLayer = new TileLayer({
|
||||||
source: new TileJSON({
|
source: new TileJSON({
|
||||||
url: 'https://api.tiles.mapbox.com/v3/mapbox.geography-class.json?secure',
|
url: 'https://a.tiles.mapbox.com/v3/aj.1x1-degrees.json',
|
||||||
crossOrigin: ''
|
crossOrigin: ''
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|||||||
16
examples/iiif.html
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
layout: example.html
|
||||||
|
title: IIIF Image API
|
||||||
|
shortdesc: Example of a IIIF Image API source.
|
||||||
|
docs: >
|
||||||
|
Example of a tile source for an International Image Interoperability Framework (IIIF) Image Service.
|
||||||
|
Try any Image API version 1 or 2 service.
|
||||||
|
tags: "IIIF, IIIF Image API, tile source"
|
||||||
|
---
|
||||||
|
<div id="map" class="map"></div>
|
||||||
|
<div class="controls">
|
||||||
|
<div id="iiif-notification"> </div>
|
||||||
|
Enter <code>info.json</code> URL:
|
||||||
|
<input type="text" id="imageInfoUrl" value="https://iiif.ub.uni-leipzig.de/iiif/j2k/0000/0107/0000010732/00000072.jpx/info.json">
|
||||||
|
<button id="display">Display image</button>
|
||||||
|
</div>
|
||||||
46
examples/iiif.js
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
import Map from '../src/ol/Map.js';
|
||||||
|
import View from '../src/ol/View.js';
|
||||||
|
import TileLayer from '../src/ol/layer/Tile.js';
|
||||||
|
import IIIF from '../src/ol/source/IIIF.js';
|
||||||
|
import IIIFInfo from '../src/ol/format/IIIFInfo.js';
|
||||||
|
|
||||||
|
const layer = new TileLayer(),
|
||||||
|
map = new Map({
|
||||||
|
layers: [layer],
|
||||||
|
target: 'map'
|
||||||
|
}),
|
||||||
|
notifyDiv = document.getElementById('iiif-notification'),
|
||||||
|
urlInput = document.getElementById('imageInfoUrl'),
|
||||||
|
displayButton = document.getElementById('display');
|
||||||
|
|
||||||
|
function refreshMap(imageInfoUrl) {
|
||||||
|
fetch(imageInfoUrl).then(function(response) {
|
||||||
|
response.json().then(function(imageInfo) {
|
||||||
|
const options = new IIIFInfo(imageInfo).getTileSourceOptions();
|
||||||
|
if (options === undefined || options.version === undefined) {
|
||||||
|
notifyDiv.textContent = 'Data seems to be no valid IIIF image information.';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
options.zDirection = -1;
|
||||||
|
const iiifTileSource = new IIIF(options);
|
||||||
|
layer.setSource(iiifTileSource);
|
||||||
|
map.setView(new View({
|
||||||
|
resolutions: iiifTileSource.getTileGrid().getResolutions(),
|
||||||
|
extent: iiifTileSource.getTileGrid().getExtent(),
|
||||||
|
constrainOnlyCenter: true
|
||||||
|
}));
|
||||||
|
map.getView().fit(iiifTileSource.getTileGrid().getExtent());
|
||||||
|
notifyDiv.textContent = '';
|
||||||
|
}).catch(function(body) {
|
||||||
|
notifyDiv.textContent = 'Could not read image info json. ' + body;
|
||||||
|
});
|
||||||
|
}).catch(function() {
|
||||||
|
notifyDiv.textContent = 'Could not read data from URL.';
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
displayButton.addEventListener('click', function() {
|
||||||
|
refreshMap(urlInput.value);
|
||||||
|
});
|
||||||
|
|
||||||
|
refreshMap(urlInput.value);
|
||||||
@@ -11,9 +11,25 @@
|
|||||||
body {
|
body {
|
||||||
padding-top: 70px;
|
padding-top: 70px;
|
||||||
}
|
}
|
||||||
|
img.header-logo {
|
||||||
|
padding-left: 18px;
|
||||||
|
}
|
||||||
input.search-query {
|
input.search-query {
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
|
@media (max-width: 480px) {
|
||||||
|
input.search-query {
|
||||||
|
width: 110px;
|
||||||
|
}
|
||||||
|
#count {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media (max-width: 374px) {
|
||||||
|
input.search-query {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
.example {
|
.example {
|
||||||
display: block;
|
display: block;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
@@ -182,9 +198,9 @@
|
|||||||
<body>
|
<body>
|
||||||
|
|
||||||
<header class="navbar navbar-fixed-top" role="navigation">
|
<header class="navbar navbar-fixed-top" role="navigation">
|
||||||
<div class="container">
|
<div class="container-fluid">
|
||||||
<div class="display-table pull-left">
|
<div class="display-table pull-left">
|
||||||
<a class="navbar-brand" href="./"><img src="./resources/logo-70x70.png"> OpenLayers Examples</a>
|
<a class="navbar-brand" href="./"><img class="header-logo" src="./resources/logo-70x70.png"> OpenLayers</a>
|
||||||
<form class="navbar-form" role="search">
|
<form class="navbar-form" role="search">
|
||||||
<input name="q" type="text" id="keywords" class="search-query" placeholder="Search" autofocus>
|
<input name="q" type="text" id="keywords" class="search-query" placeholder="Search" autofocus>
|
||||||
<span id="count"></span>
|
<span id="count"></span>
|
||||||
|
|||||||
@@ -4,16 +4,11 @@ title: Interaction Options
|
|||||||
shortdesc: Shows interaction options for custom scroll and zoom behavior.
|
shortdesc: Shows interaction options for custom scroll and zoom behavior.
|
||||||
docs: >
|
docs: >
|
||||||
This example uses a custom `ol/interaction/defaults` configuration:
|
This example uses a custom `ol/interaction/defaults` configuration:
|
||||||
|
by default, wheel/trackpad zoom and drag panning is always active, which
|
||||||
* By default, wheel/trackpad zoom and drag panning is always active, which
|
can be unexpected on pages with a lot of scrollable content and an embedded
|
||||||
can be unexpected on pages with a lot of scrollable content and an embedded
|
map. To perform wheel/trackpad zoom and drag-pan actions only when the map
|
||||||
map. To perform wheel/trackpad zoom and drag-pan actions only when the map
|
has the focus, set `onFocusOnly: true` as option. This requires a map div
|
||||||
has the focus, set `onFocusOnly: true` as option. This requires a map div
|
with a `tabindex` attribute set.
|
||||||
with a `tabindex` attribute set.
|
|
||||||
* By default, pinch-zoom and wheel/trackpad zoom interactions can leave the
|
|
||||||
map at fractional zoom levels. If instead you want to constrain
|
|
||||||
wheel/trackpad zooming to integer zoom levels, set
|
|
||||||
`constrainResolution: true`.
|
|
||||||
tags: "trackpad, mousewheel, zoom, scroll, interaction, fractional"
|
tags: "trackpad, mousewheel, zoom, scroll, interaction, fractional"
|
||||||
---
|
---
|
||||||
<div tabindex="1" id="map" class="map"></div>
|
<div tabindex="1" id="map" class="map"></div>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import OSM from '../src/ol/source/OSM.js';
|
|||||||
|
|
||||||
const map = new Map({
|
const map = new Map({
|
||||||
interactions: defaultInteractions({
|
interactions: defaultInteractions({
|
||||||
constrainResolution: true, onFocusOnly: true
|
onFocusOnly: true
|
||||||
}),
|
}),
|
||||||
layers: [
|
layers: [
|
||||||
new TileLayer({
|
new TileLayer({
|
||||||
|
|||||||
@@ -3,12 +3,13 @@ layout: example.html
|
|||||||
title: Mapbox-gl Layer
|
title: Mapbox-gl Layer
|
||||||
shortdesc: Example of a Mapbox-gl-js layer integration.
|
shortdesc: Example of a Mapbox-gl-js layer integration.
|
||||||
docs: >
|
docs: >
|
||||||
Show how to add a mapbox-gl-js layer in an openlayers map. **Note**: Make sure to get your own Mapbox API key when using this example. No map will be visible when the API key has expired.
|
Show how to add a mapbox-gl-js layer in an openlayers map. **Note**: Make sure to get your own API key at https://www.maptiler.com/cloud/ when using this example. No map will be visible when the API key has expired.
|
||||||
tags: "simple, mapbox, vector, tiles"
|
tags: "simple, mapbox, vector, tiles, maptiler"
|
||||||
resources:
|
resources:
|
||||||
- https://unpkg.com/mapbox-gl@0.51.0/dist/mapbox-gl.js
|
- https://unpkg.com/mapbox-gl@0.54.0/dist/mapbox-gl.js
|
||||||
|
- https://unpkg.com/mapbox-gl@0.54.0/dist/mapbox-gl.css
|
||||||
cloak:
|
cloak:
|
||||||
- key: ER67WIiPdCQvhgsUjoWK
|
- key: ER67WIiPdCQvhgsUjoWK
|
||||||
value: Your Mapbox access token from http://mapbox.com/ here
|
value: Get your own API key at https://www.maptiler.com/cloud/
|
||||||
---
|
---
|
||||||
<div id="map" class="map"></div>
|
<div id="map" class="map"></div>
|
||||||
|
|||||||
@@ -1,188 +1,67 @@
|
|||||||
import Map from '../src/ol/Map.js';
|
import Map from '../src/ol/Map.js';
|
||||||
import View from '../src/ol/View.js';
|
import View from '../src/ol/View.js';
|
||||||
import Layer from '../src/ol/layer/Layer';
|
import Layer from '../src/ol/layer/Layer.js';
|
||||||
import {assign} from '../src/ol/obj';
|
import {toLonLat, fromLonLat} from '../src/ol/proj.js';
|
||||||
import {getTransform} from '../src/ol/proj';
|
|
||||||
import SourceState from '../src/ol/source/State';
|
|
||||||
import {Stroke, Style} from '../src/ol/style.js';
|
import {Stroke, Style} from '../src/ol/style.js';
|
||||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||||
import VectorSource from '../src/ol/source/Vector.js';
|
import VectorSource from '../src/ol/source/Vector.js';
|
||||||
import GeoJSON from '../src/ol/format/GeoJSON.js';
|
import GeoJSON from '../src/ol/format/GeoJSON.js';
|
||||||
|
|
||||||
class Mapbox extends Layer {
|
const center = [-98.8, 37.9];
|
||||||
|
const key = 'ER67WIiPdCQvhgsUjoWK';
|
||||||
|
|
||||||
/**
|
const mbMap = new mapboxgl.Map({
|
||||||
* @param {import('./Base.js').Options} options Layer options.
|
style: 'https://api.maptiler.com/maps/bright/style.json?key=' + key,
|
||||||
*/
|
attributionControl: false,
|
||||||
constructor(options) {
|
boxZoom: false,
|
||||||
const baseOptions = assign({}, options);
|
center: center,
|
||||||
super(baseOptions);
|
container: 'map',
|
||||||
|
doubleClickZoom: false,
|
||||||
|
dragPan: false,
|
||||||
|
dragRotate: false,
|
||||||
|
interactive: false,
|
||||||
|
keyboard: false,
|
||||||
|
pitchWithRotate: false,
|
||||||
|
scrollZoom: false,
|
||||||
|
touchZoomRotate: false
|
||||||
|
});
|
||||||
|
|
||||||
this.baseOptions = baseOptions;
|
const mbLayer = new Layer({
|
||||||
|
render: function(frameState) {
|
||||||
|
const canvas = mbMap.getCanvas();
|
||||||
|
const viewState = frameState.viewState;
|
||||||
|
|
||||||
/**
|
const visible = mbLayer.getVisible();
|
||||||
* @private
|
canvas.style.display = visible ? 'block' : 'none';
|
||||||
* @type boolean
|
|
||||||
*/
|
|
||||||
this.loaded = false;
|
|
||||||
|
|
||||||
this.initMap();
|
const opacity = mbLayer.getOpacity();
|
||||||
}
|
canvas.style.opacity = opacity;
|
||||||
|
|
||||||
initMap() {
|
// adjust view parameters in mapbox
|
||||||
const map = this.map_;
|
const rotation = viewState.rotation;
|
||||||
const view = map.getView();
|
|
||||||
const transformToLatLng = getTransform(view.getProjection(), 'EPSG:4326');
|
|
||||||
const center = transformToLatLng(view.getCenter());
|
|
||||||
|
|
||||||
this.centerLastRender = view.getCenter();
|
|
||||||
this.zoomLastRender = view.getZoom();
|
|
||||||
this.centerLastRender = view.getCenter();
|
|
||||||
this.zoomLastRender = view.getZoom();
|
|
||||||
|
|
||||||
const options = assign(this.baseOptions, {
|
|
||||||
attributionControl: false,
|
|
||||||
boxZoom: false,
|
|
||||||
center,
|
|
||||||
container: map.getTargetElement(),
|
|
||||||
doubleClickZoom: false,
|
|
||||||
dragPan: false,
|
|
||||||
dragRotate: false,
|
|
||||||
interactive: false,
|
|
||||||
keyboard: false,
|
|
||||||
pitchWithRotate: false,
|
|
||||||
scrollZoom: false,
|
|
||||||
touchZoomRotate: false,
|
|
||||||
zoom: view.getZoom() - 1
|
|
||||||
});
|
|
||||||
|
|
||||||
this.mbmap = new mapboxgl.Map(options);
|
|
||||||
this.mbmap.on('load', function() {
|
|
||||||
this.mbmap.getCanvas().remove();
|
|
||||||
this.loaded = true;
|
|
||||||
this.map_.render();
|
|
||||||
[
|
|
||||||
'mapboxgl-control-container'
|
|
||||||
].forEach(className => document.getElementsByClassName(className)[0].remove());
|
|
||||||
}.bind(this));
|
|
||||||
|
|
||||||
this.mbmap.on('render', function() {
|
|
||||||
// Reset offset
|
|
||||||
if (this.centerNextRender) {
|
|
||||||
this.centerLastRender = this.centerNextRender;
|
|
||||||
}
|
|
||||||
if (this.zoomNextRender) {
|
|
||||||
this.zoomLastRender = this.zoomNextRender;
|
|
||||||
}
|
|
||||||
this.updateRenderedPosition([0, 0], 1);
|
|
||||||
}.bind(this));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @inheritDoc
|
|
||||||
*/
|
|
||||||
render(frameState) {
|
|
||||||
const map = this.map_;
|
|
||||||
const view = map.getView();
|
|
||||||
const transformToLatLng = getTransform(view.getProjection(), 'EPSG:4326');
|
|
||||||
|
|
||||||
this.centerNextRender = view.getCenter();
|
|
||||||
const lastRender = map.getPixelFromCoordinate(this.centerLastRender);
|
|
||||||
const nextRender = map.getPixelFromCoordinate(this.centerNextRender);
|
|
||||||
const centerOffset = [lastRender[0] - nextRender[0], lastRender[1] - nextRender[1]];
|
|
||||||
this.zoomNextRender = view.getZoom();
|
|
||||||
const zoomOffset = Math.pow(2, this.zoomNextRender - this.zoomLastRender);
|
|
||||||
this.updateRenderedPosition(centerOffset, zoomOffset);
|
|
||||||
|
|
||||||
const rotation = frameState.viewState.rotation;
|
|
||||||
if (rotation) {
|
if (rotation) {
|
||||||
this.mbmap.rotateTo(-rotation * 180 / Math.PI, {
|
mbMap.rotateTo(-rotation * 180 / Math.PI, {
|
||||||
animate: false
|
animate: false
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
mbMap.jumpTo({
|
||||||
// Re-render mbmap
|
center: toLonLat(viewState.center),
|
||||||
const center = transformToLatLng(this.centerNextRender);
|
zoom: viewState.zoom - 1,
|
||||||
const zoom = view.getZoom() - 1;
|
animate: false
|
||||||
this.mbmap.jumpTo({
|
|
||||||
center: center,
|
|
||||||
zoom: zoom
|
|
||||||
});
|
});
|
||||||
return this.mbmap.getCanvas();
|
|
||||||
|
// cancel the scheduled update & trigger synchronous redraw
|
||||||
|
// see https://github.com/mapbox/mapbox-gl-js/issues/7893#issue-408992184
|
||||||
|
// NOTE: THIS MIGHT BREAK WHEN UPDATING MAPBOX
|
||||||
|
if (mbMap._frame) {
|
||||||
|
mbMap._frame.cancel();
|
||||||
|
mbMap._frame = null;
|
||||||
|
}
|
||||||
|
mbMap._render();
|
||||||
|
|
||||||
|
return canvas;
|
||||||
}
|
}
|
||||||
|
});
|
||||||
updateRenderedPosition(centerOffset, zoomOffset) {
|
|
||||||
const style = this.mbmap.getCanvas().style;
|
|
||||||
style.left = Math.round(centerOffset[0]) + 'px';
|
|
||||||
style.top = Math.round(centerOffset[1]) + 'px';
|
|
||||||
style.transform = 'scale(' + zoomOffset + ')';
|
|
||||||
}
|
|
||||||
|
|
||||||
setVisible(visible) {
|
|
||||||
super.setVisible(visible);
|
|
||||||
|
|
||||||
const canvas = this.mbmap.getCanvas();
|
|
||||||
canvas.style.display = visible ? 'block' : 'none';
|
|
||||||
}
|
|
||||||
|
|
||||||
setOpacity(opacity) {
|
|
||||||
super.setOpacity(opacity);
|
|
||||||
const canvas = this.mbmap.getCanvas();
|
|
||||||
canvas.style.opacity = opacity;
|
|
||||||
}
|
|
||||||
|
|
||||||
setZIndex(zindex) {
|
|
||||||
super.setZIndex(zindex);
|
|
||||||
const canvas = this.mbmap.getCanvas();
|
|
||||||
canvas.style.zIndex = zindex;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @inheritDoc
|
|
||||||
*/
|
|
||||||
getSourceState() {
|
|
||||||
return this.loaded ? SourceState.READY : SourceState.UNDEFINED;
|
|
||||||
}
|
|
||||||
|
|
||||||
setMap(map) {
|
|
||||||
this.map_ = map;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
mapboxgl.Map.prototype._setupContainer = function _setupContainer() {
|
|
||||||
const container = this._container;
|
|
||||||
container.classList.add('mapboxgl-map');
|
|
||||||
|
|
||||||
const canvasContainer = this._canvasContainer = container.firstChild;
|
|
||||||
|
|
||||||
this._canvas = document.createElement('canvas');
|
|
||||||
canvasContainer.insertBefore(this._canvas, canvasContainer.firstChild);
|
|
||||||
this._canvas.style.position = 'absolute';
|
|
||||||
this._canvas.addEventListener('webglcontextlost', this._contextLost, false);
|
|
||||||
this._canvas.addEventListener('webglcontextrestored', this._contextRestored, false);
|
|
||||||
this._canvas.setAttribute('tabindex', '0');
|
|
||||||
this._canvas.setAttribute('aria-label', 'Map');
|
|
||||||
this._canvas.className = 'mapboxgl-canvas';
|
|
||||||
|
|
||||||
const dimensions = this._containerDimensions();
|
|
||||||
this._resizeCanvas(dimensions[0], dimensions[1]);
|
|
||||||
|
|
||||||
this._controlContainer = canvasContainer;
|
|
||||||
const controlContainer = this._controlContainer = document.createElement('div');
|
|
||||||
controlContainer.className = 'mapboxgl-control-container';
|
|
||||||
container.appendChild(controlContainer);
|
|
||||||
|
|
||||||
const positions = this._controlPositions = {};
|
|
||||||
['top-left', 'top-right', 'bottom-left', 'bottom-right'].forEach(function(positionName) {
|
|
||||||
const elem = document.createElement('div');
|
|
||||||
elem.className = 'mapboxgl-ctrl-' + positionName;
|
|
||||||
controlContainer.appendChild(elem);
|
|
||||||
positions[positionName] = elem;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const style = new Style({
|
const style = new Style({
|
||||||
stroke: new Stroke({
|
stroke: new Stroke({
|
||||||
@@ -202,17 +81,8 @@ const vectorLayer = new VectorLayer({
|
|||||||
const map = new Map({
|
const map = new Map({
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new View({
|
view: new View({
|
||||||
center: [-10997148, 4569099],
|
center: fromLonLat(center),
|
||||||
zoom: 4
|
zoom: 4
|
||||||
})
|
}),
|
||||||
|
layers: [mbLayer, vectorLayer]
|
||||||
});
|
});
|
||||||
|
|
||||||
const key = 'ER67WIiPdCQvhgsUjoWK';
|
|
||||||
const mbLayer = new Mapbox({
|
|
||||||
map: map,
|
|
||||||
container: map.getTarget(),
|
|
||||||
style: 'https://maps.tilehosting.com/styles/bright/style.json?key=' + key
|
|
||||||
});
|
|
||||||
|
|
||||||
map.addLayer(mbLayer);
|
|
||||||
map.addLayer(vectorLayer);
|
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
layout: example-verbatim.html
|
layout: example-verbatim.html
|
||||||
title: Vector tiles created from a Mapbox Style object
|
title: Vector tiles created from a Mapbox Style object
|
||||||
shortdesc: Example of using ol-mapbox-style with tiles from tilehosting.com.
|
shortdesc: Example of using ol-mapbox-style with tiles from tilehosting.com.
|
||||||
tags: "vector tiles, mapbox style, ol-mapbox-style"
|
tags: "vector tiles, mapbox style, ol-mapbox-style, maptiler"
|
||||||
cloak:
|
cloak:
|
||||||
- key: lirfd6Fegsjkvs0lshxe
|
- key: ER67WIiPdCQvhgsUjoWK
|
||||||
value: Your API key from http://tilehosting.com/ here
|
value: Get your own API key at https://www.maptiler.com/cloud/
|
||||||
---
|
---
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
import apply from 'ol-mapbox-style';
|
import apply from 'ol-mapbox-style';
|
||||||
|
|
||||||
apply('map', 'https://maps.tilehosting.com/styles/topo/style.json?key=ER67WIiPdCQvhgsUjoWK');
|
apply('map', 'https://api.maptiler.com/maps/topo/style.json?key=ER67WIiPdCQvhgsUjoWK');
|
||||||
|
|||||||
@@ -9,6 +9,6 @@ resources:
|
|||||||
- resources/mapbox-streets-v6-style.js
|
- resources/mapbox-streets-v6-style.js
|
||||||
cloak:
|
cloak:
|
||||||
- key: pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2pzbmg0Nmk5MGF5NzQzbzRnbDNoeHJrbiJ9.7_-_gL8ur7ZtEiNwRfCy7Q
|
- key: pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2pzbmg0Nmk5MGF5NzQzbzRnbDNoeHJrbiJ9.7_-_gL8ur7ZtEiNwRfCy7Q
|
||||||
value: Your Mapbox access token from http://mapbox.com/ here
|
value: Your Mapbox access token from https://mapbox.com/ here
|
||||||
---
|
---
|
||||||
<div id="map" class="map"></div>
|
<div id="map" class="map"></div>
|
||||||
|
|||||||
@@ -9,6 +9,6 @@ resources:
|
|||||||
- resources/mapbox-streets-v6-style.js
|
- resources/mapbox-streets-v6-style.js
|
||||||
cloak:
|
cloak:
|
||||||
- key: pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2pzbmg0Nmk5MGF5NzQzbzRnbDNoeHJrbiJ9.7_-_gL8ur7ZtEiNwRfCy7Q
|
- key: pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2pzbmg0Nmk5MGF5NzQzbzRnbDNoeHJrbiJ9.7_-_gL8ur7ZtEiNwRfCy7Q
|
||||||
value: Your Mapbox access token from http://mapbox.com/ here
|
value: Your Mapbox access token from https://mapbox.com/ here
|
||||||
---
|
---
|
||||||
<div id="map" class="map"></div>
|
<div id="map" class="map"></div>
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ import View from '../src/ol/View.js';
|
|||||||
import ImageLayer from '../src/ol/layer/Image.js';
|
import ImageLayer from '../src/ol/layer/Image.js';
|
||||||
import ImageMapGuide from '../src/ol/source/ImageMapGuide.js';
|
import ImageMapGuide from '../src/ol/source/ImageMapGuide.js';
|
||||||
|
|
||||||
const mdf = 'Library://Public/Samples/Sheboygan/Maps/Sheboygan.MapDefinition';
|
const mdf = 'Library://Samples/Sheboygan/Maps/Sheboygan.MapDefinition';
|
||||||
const agentUrl =
|
const agentUrl =
|
||||||
'http://www.buoyshark.com/mapguide/mapagent/mapagent.fcgi?';
|
'http://138.197.230.93:8008/mapguide/mapagent/mapagent.fcgi?';
|
||||||
const bounds = [
|
const bounds = [
|
||||||
-87.865114442365922,
|
-87.865114442365922,
|
||||||
43.665065564837931,
|
43.665065564837931,
|
||||||
@@ -24,8 +24,9 @@ const map = new Map({
|
|||||||
params: {
|
params: {
|
||||||
MAPDEFINITION: mdf,
|
MAPDEFINITION: mdf,
|
||||||
FORMAT: 'PNG',
|
FORMAT: 'PNG',
|
||||||
USERNAME: 'OpenLayers',
|
VERSION: '3.0.0',
|
||||||
PASSWORD: 'OpenLayers'
|
USERNAME: 'OLGuest',
|
||||||
|
PASSWORD: 'olguest'
|
||||||
},
|
},
|
||||||
ratio: 2
|
ratio: 2
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
.tooltip {
|
.ol-tooltip {
|
||||||
position: relative;
|
position: relative;
|
||||||
background: rgba(0, 0, 0, 0.5);
|
background: rgba(0, 0, 0, 0.5);
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
@@ -6,18 +6,19 @@
|
|||||||
padding: 4px 8px;
|
padding: 4px 8px;
|
||||||
opacity: 0.7;
|
opacity: 0.7;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
.tooltip-measure {
|
.ol-tooltip-measure {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
.tooltip-static {
|
.ol-tooltip-static {
|
||||||
background-color: #ffcc33;
|
background-color: #ffcc33;
|
||||||
color: black;
|
color: black;
|
||||||
border: 1px solid white;
|
border: 1px solid white;
|
||||||
}
|
}
|
||||||
.tooltip-measure:before,
|
.ol-tooltip-measure:before,
|
||||||
.tooltip-static:before {
|
.ol-tooltip-static:before {
|
||||||
border-top: 6px solid rgba(0, 0, 0, 0.5);
|
border-top: 6px solid rgba(0, 0, 0, 0.5);
|
||||||
border-right: 6px solid transparent;
|
border-right: 6px solid transparent;
|
||||||
border-left: 6px solid transparent;
|
border-left: 6px solid transparent;
|
||||||
@@ -27,6 +28,6 @@
|
|||||||
margin-left: -7px;
|
margin-left: -7px;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
}
|
}
|
||||||
.tooltip-static:before {
|
.ol-tooltip-static:before {
|
||||||
border-top-color: #ffcc33;
|
border-top-color: #ffcc33;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ function addInteraction() {
|
|||||||
|
|
||||||
draw.on('drawend',
|
draw.on('drawend',
|
||||||
function() {
|
function() {
|
||||||
measureTooltipElement.className = 'tooltip tooltip-static';
|
measureTooltipElement.className = 'ol-tooltip ol-tooltip-static';
|
||||||
measureTooltip.setOffset([0, -7]);
|
measureTooltip.setOffset([0, -7]);
|
||||||
// unset sketch
|
// unset sketch
|
||||||
sketch = null;
|
sketch = null;
|
||||||
@@ -245,7 +245,7 @@ function createHelpTooltip() {
|
|||||||
helpTooltipElement.parentNode.removeChild(helpTooltipElement);
|
helpTooltipElement.parentNode.removeChild(helpTooltipElement);
|
||||||
}
|
}
|
||||||
helpTooltipElement = document.createElement('div');
|
helpTooltipElement = document.createElement('div');
|
||||||
helpTooltipElement.className = 'tooltip hidden';
|
helpTooltipElement.className = 'ol-tooltip hidden';
|
||||||
helpTooltip = new Overlay({
|
helpTooltip = new Overlay({
|
||||||
element: helpTooltipElement,
|
element: helpTooltipElement,
|
||||||
offset: [15, 0],
|
offset: [15, 0],
|
||||||
@@ -263,7 +263,7 @@ function createMeasureTooltip() {
|
|||||||
measureTooltipElement.parentNode.removeChild(measureTooltipElement);
|
measureTooltipElement.parentNode.removeChild(measureTooltipElement);
|
||||||
}
|
}
|
||||||
measureTooltipElement = document.createElement('div');
|
measureTooltipElement = document.createElement('div');
|
||||||
measureTooltipElement.className = 'tooltip tooltip-measure';
|
measureTooltipElement.className = 'ol-tooltip ol-tooltip-measure';
|
||||||
measureTooltip = new Overlay({
|
measureTooltip = new Overlay({
|
||||||
element: measureTooltipElement,
|
element: measureTooltipElement,
|
||||||
offset: [0, -15],
|
offset: [0, -15],
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ shortdesc: Restrict pinch zooming to integer zoom levels.
|
|||||||
docs: >
|
docs: >
|
||||||
By default, the `ol/interaction/PinchZoom` can leave the map at fractional zoom levels.
|
By default, the `ol/interaction/PinchZoom` can leave the map at fractional zoom levels.
|
||||||
If instead you want to constrain pinch zooming to integer zoom levels, set
|
If instead you want to constrain pinch zooming to integer zoom levels, set
|
||||||
<code>constrainResolution: true</code> when constructing the interaction.
|
<code>constrainResolution: true</code> when constructing the view.
|
||||||
tags: "pinch, zoom, interaction"
|
tags: "pinch, zoom, interaction"
|
||||||
---
|
---
|
||||||
<div id="map" class="map"></div>
|
<div id="map" class="map"></div>
|
||||||
|
|||||||
@@ -6,10 +6,8 @@ import OSM from '../src/ol/source/OSM.js';
|
|||||||
|
|
||||||
|
|
||||||
const map = new Map({
|
const map = new Map({
|
||||||
interactions: defaultInteractions({pinchZoom: false}).extend([
|
interactions: defaultInteractions().extend([
|
||||||
new PinchZoom({
|
new PinchZoom()
|
||||||
constrainResolution: true // force zooming to a integer zoom
|
|
||||||
})
|
|
||||||
]),
|
]),
|
||||||
layers: [
|
layers: [
|
||||||
new TileLayer({
|
new TileLayer({
|
||||||
@@ -19,6 +17,7 @@ const map = new Map({
|
|||||||
target: 'map',
|
target: 'map',
|
||||||
view: new View({
|
view: new View({
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
zoom: 2
|
zoom: 2,
|
||||||
|
constrainResolution: true
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ docs: >
|
|||||||
Click on the map to get a popup. The popup is composed of a few basic elements: a container, a close button, and a place for the content. To anchor the popup to the map, an <code>ol/Overlay</code> is created with the popup container. A listener is registered for the map's <code>click</code> event to display the popup, and another listener is set as the <code>click</code> handler for the close button to hide the popup.
|
Click on the map to get a popup. The popup is composed of a few basic elements: a container, a close button, and a place for the content. To anchor the popup to the map, an <code>ol/Overlay</code> is created with the popup container. A listener is registered for the map's <code>click</code> event to display the popup, and another listener is set as the <code>click</code> handler for the close button to hide the popup.
|
||||||
</p>
|
</p>
|
||||||
tags: "overlay, popup"
|
tags: "overlay, popup"
|
||||||
|
cloak:
|
||||||
|
- key: pk.eyJ1IjoidHNjaGF1YiIsImEiOiJjaW5zYW5lNHkxMTNmdWttM3JyOHZtMmNtIn0.CDIBD8H-G2Gf-cPkIuWtRg
|
||||||
|
value: Your Mapbox access token from https://mapbox.com/ here
|
||||||
---
|
---
|
||||||
<div id="map" class="map"></div>
|
<div id="map" class="map"></div>
|
||||||
<div id="popup" class="ol-popup">
|
<div id="popup" class="ol-popup">
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import TileLayer from '../src/ol/layer/Tile.js';
|
|||||||
import {toLonLat} from '../src/ol/proj.js';
|
import {toLonLat} from '../src/ol/proj.js';
|
||||||
import TileJSON from '../src/ol/source/TileJSON.js';
|
import TileJSON from '../src/ol/source/TileJSON.js';
|
||||||
|
|
||||||
|
const key = 'pk.eyJ1IjoidHNjaGF1YiIsImEiOiJjaW5zYW5lNHkxMTNmdWttM3JyOHZtMmNtIn0.CDIBD8H-G2Gf-cPkIuWtRg';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Elements that make up the popup.
|
* Elements that make up the popup.
|
||||||
@@ -45,7 +46,7 @@ const map = new Map({
|
|||||||
layers: [
|
layers: [
|
||||||
new TileLayer({
|
new TileLayer({
|
||||||
source: new TileJSON({
|
source: new TileJSON({
|
||||||
url: 'https://api.tiles.mapbox.com/v3/mapbox.natural-earth-hypso-bathy.json?secure',
|
url: 'https://api.tiles.mapbox.com/v4/mapbox.natural-earth-hypso-bathy.json?access_token=' + key,
|
||||||
crossOrigin: 'anonymous'
|
crossOrigin: 'anonymous'
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -38,6 +38,9 @@
|
|||||||
},
|
},
|
||||||
"package.json": {
|
"package.json": {
|
||||||
content: pkgJson
|
content: pkgJson
|
||||||
|
},
|
||||||
|
'sandbox.config.json': {
|
||||||
|
content: '{"template": "parcel"}'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ docs: >
|
|||||||
tags: "raster, pixel operation, flood"
|
tags: "raster, pixel operation, flood"
|
||||||
cloak:
|
cloak:
|
||||||
- key: pk.eyJ1IjoidHNjaGF1YiIsImEiOiJjaW5zYW5lNHkxMTNmdWttM3JyOHZtMmNtIn0.CDIBD8H-G2Gf-cPkIuWtRg
|
- key: pk.eyJ1IjoidHNjaGF1YiIsImEiOiJjaW5zYW5lNHkxMTNmdWttM3JyOHZtMmNtIn0.CDIBD8H-G2Gf-cPkIuWtRg
|
||||||
value: Your Mapbox access token from http://mapbox.com/ here
|
value: Your Mapbox access token from https://mapbox.com/ here
|
||||||
---
|
---
|
||||||
<div id="map" class="map"></div>
|
<div id="map" class="map"></div>
|
||||||
<label>
|
<label>
|
||||||
|
|||||||
@@ -24,8 +24,7 @@ function flood(pixels, data) {
|
|||||||
const key = 'pk.eyJ1IjoidHNjaGF1YiIsImEiOiJjaW5zYW5lNHkxMTNmdWttM3JyOHZtMmNtIn0.CDIBD8H-G2Gf-cPkIuWtRg';
|
const key = 'pk.eyJ1IjoidHNjaGF1YiIsImEiOiJjaW5zYW5lNHkxMTNmdWttM3JyOHZtMmNtIn0.CDIBD8H-G2Gf-cPkIuWtRg';
|
||||||
const elevation = new XYZ({
|
const elevation = new XYZ({
|
||||||
url: 'https://api.mapbox.com/v4/mapbox.terrain-rgb/{z}/{x}/{y}.pngraw?access_token=' + key,
|
url: 'https://api.mapbox.com/v4/mapbox.terrain-rgb/{z}/{x}/{y}.pngraw?access_token=' + key,
|
||||||
crossOrigin: 'anonymous',
|
crossOrigin: 'anonymous'
|
||||||
transition: 0
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const raster = new RasterSource({
|
const raster = new RasterSource({
|
||||||
|
|||||||
@@ -100,8 +100,7 @@ function shade(inputs, data) {
|
|||||||
|
|
||||||
const elevation = new XYZ({
|
const elevation = new XYZ({
|
||||||
url: 'https://{a-d}.tiles.mapbox.com/v3/aj.sf-dem/{z}/{x}/{y}.png',
|
url: 'https://{a-d}.tiles.mapbox.com/v3/aj.sf-dem/{z}/{x}/{y}.png',
|
||||||
crossOrigin: 'anonymous',
|
crossOrigin: 'anonymous'
|
||||||
transition: 0
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const raster = new Raster({
|
const raster = new Raster({
|
||||||
|
|||||||
@@ -78,7 +78,7 @@
|
|||||||
<header class="navbar" role="navigation">
|
<header class="navbar" role="navigation">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="display-table pull-left" id="navbar-logo-container">
|
<div class="display-table pull-left" id="navbar-logo-container">
|
||||||
<a class="navbar-brand" href="./"><img src="./resources/logo-70x70.png"> OpenLayers Examples</a>
|
<a class="navbar-brand" href="./"><img src="./resources/logo-70x70.png"> OpenLayers</a>
|
||||||
</div>
|
</div>
|
||||||
<!-- menu items that get hidden below 768px width -->
|
<!-- menu items that get hidden below 768px width -->
|
||||||
<nav class='collapse navbar-collapse navbar-responsive-collapse'>
|
<nav class='collapse navbar-collapse navbar-responsive-collapse'>
|
||||||
@@ -122,14 +122,18 @@
|
|||||||
<a class="copy-button" id="copy-html-button" data-clipboard-target="#example-html-source"><i class="fa fa-clipboard"></i> Copy</a>
|
<a class="copy-button" id="copy-html-button" data-clipboard-target="#example-html-source"><i class="fa fa-clipboard"></i> Copy</a>
|
||||||
</div>
|
</div>
|
||||||
<pre><legend>index.html</legend><code id="example-html-source" class="language-markup"><!DOCTYPE html>
|
<pre><legend>index.html</legend><code id="example-html-source" class="language-markup"><!DOCTYPE html>
|
||||||
<html>
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>{{ title }}</title>
|
<title>{{ title }}</title>
|
||||||
<!-- The line below is only needed for old environments like Internet Explorer and Android 4.x -->
|
<!-- The line below is only needed for old environments like Internet Explorer and Android 4.x -->
|
||||||
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList,URL"></script>{{#if extraHead.remote}}
|
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList,URL"></script>{{#if extraHead.remote}}
|
||||||
{{ indent extraHead.remote spaces=4 }}{{/if}}{{#if css.source}}
|
{{ indent extraHead.remote spaces=4 }}{{/if}}
|
||||||
<style>
|
<style>
|
||||||
{{ indent css.source spaces=6 }} </style>{{/if}}
|
.map {
|
||||||
|
width: 100%;
|
||||||
|
height:400px;
|
||||||
|
}
|
||||||
|
{{#if css.source}}{{ indent css.source spaces=6 }}{{/if}} </style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
{{ indent contents spaces=4 }} <script src="index.js"></script>
|
{{ indent contents spaces=4 }} <script src="index.js"></script>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ const map = new Map({
|
|||||||
layers: [
|
layers: [
|
||||||
new TileLayer({
|
new TileLayer({
|
||||||
source: new TileJSON({
|
source: new TileJSON({
|
||||||
url: 'https://api.tiles.mapbox.com/v3/mapbox.geography-class.json?secure',
|
url: 'https://a.tiles.mapbox.com/v3/aj.1x1-degrees.json',
|
||||||
crossOrigin: 'anonymous'
|
crossOrigin: 'anonymous'
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ title: UTFGrid
|
|||||||
shortdesc: This example shows how to read data from a UTFGrid source.
|
shortdesc: This example shows how to read data from a UTFGrid source.
|
||||||
docs: >
|
docs: >
|
||||||
<p>Point to a country to see its name and flag.</p>
|
<p>Point to a country to see its name and flag.</p>
|
||||||
Tiles made with [TileMill](http://tilemill.com). Hosting on MapBox.com or with open-source [TileServer](https://github.com/klokantech/tileserver-php/).
|
Tiles made with <a href="http://tilemill.com">TileMill</a>. Hosting on <a href="mapbox.com">mapbox.com</a> or with open-source <a href="https://github.com/klokantech/tileserver-php/">TileServer</a>.
|
||||||
tags: "utfgrid, tilejson"
|
tags: "utfgrid, tilejson"
|
||||||
cloak:
|
cloak:
|
||||||
- key: pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2pzbmg0Nmk5MGF5NzQzbzRnbDNoeHJrbiJ9.7_-_gL8ur7ZtEiNwRfCy7Q
|
- key: pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2pzbmg0Nmk5MGF5NzQzbzRnbDNoeHJrbiJ9.7_-_gL8ur7ZtEiNwRfCy7Q
|
||||||
value: Your Mapbox access token from http://mapbox.com/ here
|
value: Your Mapbox access token from https://mapbox.com/ here
|
||||||
---
|
---
|
||||||
<div id="map" class="map"></div>
|
<div id="map" class="map"></div>
|
||||||
<div style="display: none;">
|
<div style="display: none;">
|
||||||
|
|||||||
@@ -103,6 +103,9 @@ tags: "geojson, vector, openstreetmap, label"
|
|||||||
<label>Size: </label>
|
<label>Size: </label>
|
||||||
<input type="text" value="12px" id="points-size" />
|
<input type="text" value="12px" id="points-size" />
|
||||||
<br />
|
<br />
|
||||||
|
<label>Line height: </label>
|
||||||
|
<input type="text" value="1" id="points-height" />
|
||||||
|
<br />
|
||||||
<label>Offset X:</label>
|
<label>Offset X:</label>
|
||||||
<input type="text" value="0" id="points-offset-x" />
|
<input type="text" value="0" id="points-offset-x" />
|
||||||
<br />
|
<br />
|
||||||
@@ -212,6 +215,9 @@ tags: "geojson, vector, openstreetmap, label"
|
|||||||
<label>Size: </label>
|
<label>Size: </label>
|
||||||
<input type="text" value="12px" id="lines-size" />
|
<input type="text" value="12px" id="lines-size" />
|
||||||
<br />
|
<br />
|
||||||
|
<label>Line height: </label>
|
||||||
|
<input type="text" value="1.2" id="lines-height" />
|
||||||
|
<br />
|
||||||
<label>Offset X:</label>
|
<label>Offset X:</label>
|
||||||
<input type="text" value="0" id="lines-offset-x" />
|
<input type="text" value="0" id="lines-offset-x" />
|
||||||
<br />
|
<br />
|
||||||
@@ -321,6 +327,9 @@ tags: "geojson, vector, openstreetmap, label"
|
|||||||
<label>Size: </label>
|
<label>Size: </label>
|
||||||
<input type="text" value="10px" id="polygons-size" />
|
<input type="text" value="10px" id="polygons-size" />
|
||||||
<br />
|
<br />
|
||||||
|
<label>Line height: </label>
|
||||||
|
<input type="text" value="1" id="polygons-height" />
|
||||||
|
<br />
|
||||||
<label>Offset X:</label>
|
<label>Offset X:</label>
|
||||||
<input type="text" value="0" id="polygons-offset-x" />
|
<input type="text" value="0" id="polygons-offset-x" />
|
||||||
<br />
|
<br />
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ const myDom = {
|
|||||||
font: document.getElementById('points-font'),
|
font: document.getElementById('points-font'),
|
||||||
weight: document.getElementById('points-weight'),
|
weight: document.getElementById('points-weight'),
|
||||||
size: document.getElementById('points-size'),
|
size: document.getElementById('points-size'),
|
||||||
|
height: document.getElementById('points-height'),
|
||||||
offsetX: document.getElementById('points-offset-x'),
|
offsetX: document.getElementById('points-offset-x'),
|
||||||
offsetY: document.getElementById('points-offset-y'),
|
offsetY: document.getElementById('points-offset-y'),
|
||||||
color: document.getElementById('points-color'),
|
color: document.getElementById('points-color'),
|
||||||
@@ -34,6 +35,7 @@ const myDom = {
|
|||||||
maxangle: document.getElementById('lines-maxangle'),
|
maxangle: document.getElementById('lines-maxangle'),
|
||||||
overflow: document.getElementById('lines-overflow'),
|
overflow: document.getElementById('lines-overflow'),
|
||||||
size: document.getElementById('lines-size'),
|
size: document.getElementById('lines-size'),
|
||||||
|
height: document.getElementById('lines-height'),
|
||||||
offsetX: document.getElementById('lines-offset-x'),
|
offsetX: document.getElementById('lines-offset-x'),
|
||||||
offsetY: document.getElementById('lines-offset-y'),
|
offsetY: document.getElementById('lines-offset-y'),
|
||||||
color: document.getElementById('lines-color'),
|
color: document.getElementById('lines-color'),
|
||||||
@@ -52,6 +54,7 @@ const myDom = {
|
|||||||
maxangle: document.getElementById('polygons-maxangle'),
|
maxangle: document.getElementById('polygons-maxangle'),
|
||||||
overflow: document.getElementById('polygons-overflow'),
|
overflow: document.getElementById('polygons-overflow'),
|
||||||
size: document.getElementById('polygons-size'),
|
size: document.getElementById('polygons-size'),
|
||||||
|
height: document.getElementById('polygons-height'),
|
||||||
offsetX: document.getElementById('polygons-offset-x'),
|
offsetX: document.getElementById('polygons-offset-x'),
|
||||||
offsetY: document.getElementById('polygons-offset-y'),
|
offsetY: document.getElementById('polygons-offset-y'),
|
||||||
color: document.getElementById('polygons-color'),
|
color: document.getElementById('polygons-color'),
|
||||||
@@ -84,6 +87,7 @@ const createTextStyle = function(feature, resolution, dom) {
|
|||||||
const align = dom.align.value;
|
const align = dom.align.value;
|
||||||
const baseline = dom.baseline.value;
|
const baseline = dom.baseline.value;
|
||||||
const size = dom.size.value;
|
const size = dom.size.value;
|
||||||
|
const height = dom.height.value;
|
||||||
const offsetX = parseInt(dom.offsetX.value, 10);
|
const offsetX = parseInt(dom.offsetX.value, 10);
|
||||||
const offsetY = parseInt(dom.offsetY.value, 10);
|
const offsetY = parseInt(dom.offsetY.value, 10);
|
||||||
const weight = dom.weight.value;
|
const weight = dom.weight.value;
|
||||||
@@ -98,7 +102,7 @@ const createTextStyle = function(feature, resolution, dom) {
|
|||||||
document.getElementsByTagName('head')[0].appendChild(openSans);
|
document.getElementsByTagName('head')[0].appendChild(openSans);
|
||||||
openSansAdded = true;
|
openSansAdded = true;
|
||||||
}
|
}
|
||||||
const font = weight + ' ' + size + ' ' + dom.font.value;
|
const font = weight + ' ' + size + '/' + height + ' ' + dom.font.value;
|
||||||
const fillColor = dom.color.value;
|
const fillColor = dom.color.value;
|
||||||
const outlineColor = dom.outline.value;
|
const outlineColor = dom.outline.value;
|
||||||
const outlineWidth = parseInt(dom.outlineWidth.value, 10);
|
const outlineWidth = parseInt(dom.outlineWidth.value, 10);
|
||||||
|
|||||||
@@ -19,16 +19,25 @@ module.exports = {
|
|||||||
context: src,
|
context: src,
|
||||||
target: 'web',
|
target: 'web',
|
||||||
entry: entry,
|
entry: entry,
|
||||||
|
stats: 'minimal',
|
||||||
module: {
|
module: {
|
||||||
rules: [{
|
rules: [{
|
||||||
|
test: /\.js$/,
|
||||||
use: {
|
use: {
|
||||||
loader: 'buble-loader'
|
loader: 'buble-loader'
|
||||||
},
|
},
|
||||||
test: /\.js$/,
|
|
||||||
include: [
|
include: [
|
||||||
path.join(__dirname, '..', '..', 'src'),
|
path.join(__dirname, '..', '..', 'src'),
|
||||||
path.join(__dirname, '..')
|
path.join(__dirname, '..')
|
||||||
]
|
]
|
||||||
|
}, {
|
||||||
|
test: /\.js$/,
|
||||||
|
use: {
|
||||||
|
loader: path.join(__dirname, './worker-loader.js')
|
||||||
|
},
|
||||||
|
include: [
|
||||||
|
path.join(__dirname, '../../src/ol/worker')
|
||||||
|
]
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
optimization: {
|
optimization: {
|
||||||
|
|||||||
17
examples/webpack/worker-loader.js
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
const build = require('../../tasks/serialize-workers').build;
|
||||||
|
|
||||||
|
function loader() {
|
||||||
|
const callback = this.async();
|
||||||
|
const minify = this.mode === 'production';
|
||||||
|
|
||||||
|
build(this.resource, {minify})
|
||||||
|
.then(chunk => {
|
||||||
|
for (const filePath in chunk.modules) {
|
||||||
|
this.addDependency(filePath);
|
||||||
|
}
|
||||||
|
callback(null, chunk.code);
|
||||||
|
})
|
||||||
|
.catch(callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = loader;
|
||||||
@@ -46,7 +46,7 @@ function updateInfo() {
|
|||||||
|
|
||||||
function setTime() {
|
function setTime() {
|
||||||
startDate.setMinutes(startDate.getMinutes() + 15);
|
startDate.setMinutes(startDate.getMinutes() + 15);
|
||||||
if (startDate > Date.now()) {
|
if (startDate > new Date()) {
|
||||||
startDate = threeHoursAgo();
|
startDate = threeHoursAgo();
|
||||||
}
|
}
|
||||||
layers[1].getSource().updateParams({'TIME': startDate.toISOString()});
|
layers[1].getSource().updateParams({'TIME': startDate.toISOString()});
|
||||||
|
|||||||
10
examples/worker.html
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
layout: example.html
|
||||||
|
title: Worker
|
||||||
|
shortdesc: This example should be deleted.
|
||||||
|
docs: >
|
||||||
|
When you move the map, a message is sent to a worker. In response, the woker sends a
|
||||||
|
message back with the version identifier.
|
||||||
|
tags: "worker"
|
||||||
|
---
|
||||||
|
<div id="map" class="map"></div>
|
||||||
35
examples/worker.js
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
/* eslint-disable no-console */
|
||||||
|
|
||||||
|
import Map from '../src/ol/Map.js';
|
||||||
|
import View from '../src/ol/View.js';
|
||||||
|
import TileLayer from '../src/ol/layer/Tile.js';
|
||||||
|
import OSM from '../src/ol/source/OSM.js';
|
||||||
|
import {create as createVersionWorker} from '../src/ol/worker/version.js';
|
||||||
|
|
||||||
|
|
||||||
|
const map = new Map({
|
||||||
|
layers: [
|
||||||
|
new TileLayer({
|
||||||
|
source: new OSM()
|
||||||
|
})
|
||||||
|
],
|
||||||
|
target: 'map',
|
||||||
|
view: new View({
|
||||||
|
center: [0, 0],
|
||||||
|
zoom: 2
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
const worker = createVersionWorker();
|
||||||
|
worker.addEventListener('error', function(error) {
|
||||||
|
console.error('worker error', error);
|
||||||
|
});
|
||||||
|
|
||||||
|
worker.addEventListener('message', function(event) {
|
||||||
|
console.log('message from worker:', event.data);
|
||||||
|
});
|
||||||
|
|
||||||
|
map.on('moveend', function(event) {
|
||||||
|
const state = event.frameState.viewState;
|
||||||
|
worker.postMessage({zoom: state.zoom, center: state.center});
|
||||||
|
});
|
||||||
@@ -11,5 +11,6 @@ tags: "zoomify, deep zoom, IIP, pixel, projection"
|
|||||||
<select id="zoomifyProtocol">
|
<select id="zoomifyProtocol">
|
||||||
<option value="zoomify">Zoomify</option>
|
<option value="zoomify">Zoomify</option>
|
||||||
<option value="iip">IIP</option>
|
<option value="iip">IIP</option>
|
||||||
|
<option value="zoomifyretina">Zoomify Retina</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ const iipUrl = 'http://vips.vtech.fr/cgi-bin/iipsrv.fcgi?FIF=' + '/mnt/MD1/AD00/
|
|||||||
|
|
||||||
const layer = new TileLayer({
|
const layer = new TileLayer({
|
||||||
source: new Zoomify({
|
source: new Zoomify({
|
||||||
|
tileSize: 256,
|
||||||
|
tilePixelRatio: 1,
|
||||||
url: zoomifyUrl,
|
url: zoomifyUrl,
|
||||||
size: [imgWidth, imgHeight],
|
size: [imgWidth, imgHeight],
|
||||||
crossOrigin: 'anonymous'
|
crossOrigin: 'anonymous'
|
||||||
@@ -20,12 +22,15 @@ const layer = new TileLayer({
|
|||||||
|
|
||||||
const extent = [0, -imgHeight, imgWidth, 0];
|
const extent = [0, -imgHeight, imgWidth, 0];
|
||||||
|
|
||||||
|
const resolutions = layer.getSource().getTileGrid().getResolutions();
|
||||||
|
|
||||||
const map = new Map({
|
const map = new Map({
|
||||||
layers: [layer],
|
layers: [layer],
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new View({
|
view: new View({
|
||||||
// adjust zoom levels to those provided by the source
|
// adjust zoom levels to those provided by the source
|
||||||
resolutions: layer.getSource().getTileGrid().getResolutions(),
|
minResolution: resolutions[resolutions.length - 1],
|
||||||
|
maxResolution: resolutions[0],
|
||||||
// constrain the center: center cannot be set outside this extent
|
// constrain the center: center cannot be set outside this extent
|
||||||
extent: extent
|
extent: extent
|
||||||
})
|
})
|
||||||
@@ -36,17 +41,73 @@ const control = document.getElementById('zoomifyProtocol');
|
|||||||
control.addEventListener('change', function(event) {
|
control.addEventListener('change', function(event) {
|
||||||
const value = event.currentTarget.value;
|
const value = event.currentTarget.value;
|
||||||
if (value === 'iip') {
|
if (value === 'iip') {
|
||||||
layer.setSource(new Zoomify({
|
const extent = [0, -imgHeight, imgWidth, 0];
|
||||||
url: iipUrl,
|
layer.setSource(
|
||||||
size: [imgWidth, imgHeight],
|
new Zoomify({
|
||||||
crossOrigin: 'anonymous'
|
tileSize: 256,
|
||||||
}));
|
tilePixelRatio: 1,
|
||||||
|
url: iipUrl,
|
||||||
|
size: [imgWidth, imgHeight],
|
||||||
|
crossOrigin: 'anonymous'
|
||||||
|
})
|
||||||
|
);
|
||||||
|
const resolutions = layer.getSource().getTileGrid().getResolutions();
|
||||||
|
map.setView(
|
||||||
|
new View({
|
||||||
|
// adjust zoom levels to those provided by the source
|
||||||
|
minResolution: resolutions[resolutions.length - 1],
|
||||||
|
maxResolution: resolutions[0],
|
||||||
|
// constrain the center: center cannot be set outside this extent
|
||||||
|
extent: extent
|
||||||
|
})
|
||||||
|
);
|
||||||
|
map.getView().fit(extent);
|
||||||
} else if (value === 'zoomify') {
|
} else if (value === 'zoomify') {
|
||||||
layer.setSource(new Zoomify({
|
const extent = [0, -imgHeight, imgWidth, 0];
|
||||||
url: zoomifyUrl,
|
layer.setSource(
|
||||||
size: [imgWidth, imgHeight],
|
new Zoomify({
|
||||||
crossOrigin: 'anonymous'
|
tileSize: 256,
|
||||||
}));
|
tilePixelRatio: 1,
|
||||||
|
url: zoomifyUrl,
|
||||||
|
size: [imgWidth, imgHeight],
|
||||||
|
crossOrigin: 'anonymous'
|
||||||
|
})
|
||||||
|
);
|
||||||
|
const resolutions = layer.getSource().getTileGrid().getResolutions();
|
||||||
|
map.setView(
|
||||||
|
new View({
|
||||||
|
// adjust zoom levels to those provided by the source
|
||||||
|
minResolution: resolutions[resolutions.length - 1],
|
||||||
|
maxResolution: resolutions[0],
|
||||||
|
// constrain the center: center cannot be set outside this extent
|
||||||
|
extent: extent
|
||||||
|
})
|
||||||
|
);
|
||||||
|
map.getView().fit(extent);
|
||||||
|
} else if (value === 'zoomifyretina') {
|
||||||
|
const pixelRatio = 4;
|
||||||
|
// Be careful! Image extent will be modified by pixel ratio
|
||||||
|
const extent = [0, -imgHeight / pixelRatio, imgWidth / pixelRatio, 0];
|
||||||
|
layer.setSource(
|
||||||
|
new Zoomify({
|
||||||
|
tileSize: 256 / pixelRatio,
|
||||||
|
tilePixelRatio: pixelRatio,
|
||||||
|
url: zoomifyUrl,
|
||||||
|
size: [imgWidth / pixelRatio, imgHeight / pixelRatio],
|
||||||
|
crossOrigin: 'anonymous'
|
||||||
|
})
|
||||||
|
);
|
||||||
|
const resolutions = layer.getSource().getTileGrid().getResolutions();
|
||||||
|
map.setView(
|
||||||
|
new View({
|
||||||
|
// adjust zoom levels to those provided by the source
|
||||||
|
minResolution: resolutions[resolutions.length - 1] / pixelRatio,
|
||||||
|
maxResolution: resolutions[0],
|
||||||
|
// constrain the center: center cannot be set outside this extent
|
||||||
|
extent: extent
|
||||||
|
})
|
||||||
|
);
|
||||||
|
map.getView().fit(extent);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
90
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ol",
|
"name": "ol",
|
||||||
"version": "6.0.0-beta.2",
|
"version": "6.0.0-beta.10",
|
||||||
"description": "OpenLayers mapping library",
|
"description": "OpenLayers mapping library",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"map",
|
"map",
|
||||||
@@ -22,9 +22,9 @@
|
|||||||
"build-index": "npm run build-package && node tasks/generate-index",
|
"build-index": "npm run build-package && node tasks/generate-index",
|
||||||
"build-legacy": "shx 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",
|
"build-legacy": "shx 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": "shx cp src/ol/ol.css build/ol/ol.css",
|
"copy-css": "shx cp src/ol/ol.css build/ol/ol.css",
|
||||||
"transpile": "shx rm -rf build/ol && shx mkdir -p build/ol && shx cp -rf src/ol build/ol/src && tsc --project config/tsconfig-build.json",
|
"transpile": "shx rm -rf build/ol && shx mkdir -p build/ol && shx cp -rf src/ol build/ol/src && node tasks/serialize-workers && tsc --project config/tsconfig-build.json",
|
||||||
"typecheck": "tsc --pretty",
|
"typecheck": "tsc --pretty",
|
||||||
"apidoc": "jsdoc config/jsdoc/api/index.md -c config/jsdoc/api/conf.json -P package.json -d build/apidoc"
|
"apidoc": "jsdoc -R config/jsdoc/api/index.md -c config/jsdoc/api/conf.json -P package.json -d build/apidoc"
|
||||||
},
|
},
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -36,62 +36,72 @@
|
|||||||
"url": "https://github.com/openlayers/openlayers/issues"
|
"url": "https://github.com/openlayers/openlayers/issues"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"pbf": "3.1.0",
|
"pbf": "3.2.0",
|
||||||
"pixelworks": "1.1.0",
|
"pixelworks": "1.1.0",
|
||||||
"rbush": "2.0.2"
|
"rbush": "^3.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@openlayers/eslint-plugin": "^4.0.0-beta.1",
|
"@babel/core": "^7.4.0",
|
||||||
|
"@babel/preset-env": "^7.4.4",
|
||||||
|
"@openlayers/eslint-plugin": "^4.0.0-beta.2",
|
||||||
"@types/arcgis-rest-api": "^10.4.4",
|
"@types/arcgis-rest-api": "^10.4.4",
|
||||||
"@types/geojson": "^7946.0.6",
|
"@types/geojson": "^7946.0.7",
|
||||||
"@types/pbf": "^3.0.1",
|
"@types/pbf": "^3.0.1",
|
||||||
"@types/rbush": "^2.0.2",
|
|
||||||
"@types/topojson-specification": "^1.0.1",
|
"@types/topojson-specification": "^1.0.1",
|
||||||
"buble": "^0.19.6",
|
"babel-loader": "^8.0.5",
|
||||||
|
"buble": "^0.19.7",
|
||||||
"buble-loader": "^0.5.1",
|
"buble-loader": "^0.5.1",
|
||||||
"chaikin-smooth": "^1.0.4",
|
"chaikin-smooth": "^1.0.4",
|
||||||
"clean-css-cli": "4.2.1",
|
"clean-css-cli": "4.3.0",
|
||||||
"copy-webpack-plugin": "^5.0.0",
|
"copy-webpack-plugin": "^5.0.3",
|
||||||
"coveralls": "3.0.3",
|
"coveralls": "3.0.4",
|
||||||
"eslint": "^5.13.0",
|
"eslint": "^6.0.0",
|
||||||
"eslint-config-openlayers": "^11.0.0",
|
"eslint-config-openlayers": "^12.0.0",
|
||||||
"expect.js": "0.3.1",
|
"expect.js": "0.3.1",
|
||||||
"front-matter": "^3.0.1",
|
"front-matter": "^3.0.2",
|
||||||
"fs-extra": "^7.0.1",
|
"fs-extra": "^8.0.0",
|
||||||
"glob": "^7.1.2",
|
"glob": "^7.1.4",
|
||||||
"globby": "^8.0.1",
|
"globby": "^9.2.0",
|
||||||
"handlebars": "4.1.0",
|
"handlebars": "4.1.2",
|
||||||
|
"html-to-image": "^0.1.0",
|
||||||
"istanbul": "0.4.5",
|
"istanbul": "0.4.5",
|
||||||
"jquery": "3.3.1",
|
"istanbul-instrumenter-loader": "^3.0.1",
|
||||||
"jsdoc": "3.5.5",
|
"jquery": "3.4.1",
|
||||||
"jsdoc-plugin-typescript": "^1.0.7",
|
"jsdoc": "3.6.2",
|
||||||
"karma": "^4.0.0",
|
"jsdoc-plugin-typescript": "^2.0.1",
|
||||||
|
"karma": "^4.1.0",
|
||||||
"karma-chrome-launcher": "2.2.0",
|
"karma-chrome-launcher": "2.2.0",
|
||||||
"karma-coverage": "^1.1.2",
|
"karma-coverage": "^1.1.2",
|
||||||
|
"karma-coverage-istanbul-reporter": "^2.0.5",
|
||||||
"karma-firefox-launcher": "^1.1.0",
|
"karma-firefox-launcher": "^1.1.0",
|
||||||
"karma-mocha": "1.3.0",
|
"karma-mocha": "1.3.0",
|
||||||
"karma-sourcemap-loader": "^0.3.7",
|
"karma-sourcemap-loader": "^0.3.7",
|
||||||
"karma-webpack": "^4.0.0-rc.2",
|
"karma-webpack": "^4.0.0-rc.2",
|
||||||
"loglevelnext": "^3.0.0",
|
"loglevelnext": "^3.0.1",
|
||||||
"marked": "0.6.1",
|
"marked": "0.6.2",
|
||||||
"mocha": "6.0.2",
|
"mocha": "6.1.4",
|
||||||
"ol-mapbox-style": "^4.0.0",
|
"ol-mapbox-style": "^5.0.0-beta.2",
|
||||||
"pixelmatch": "^4.0.2",
|
"pixelmatch": "^5.0.0",
|
||||||
"pngjs": "^3.3.3",
|
"pngjs": "^3.4.0",
|
||||||
"proj4": "2.5.0",
|
"proj4": "2.5.0",
|
||||||
"puppeteer": "^1.12.2",
|
"puppeteer": "~1.18.0",
|
||||||
"serve-static": "^1.13.2",
|
"rollup": "^1.12.0",
|
||||||
|
"rollup-plugin-babel": "^4.3.2",
|
||||||
|
"rollup-plugin-commonjs": "^10.0.0",
|
||||||
|
"rollup-plugin-node-resolve": "^5.0.0",
|
||||||
|
"rollup-plugin-terser": "^5.0.0",
|
||||||
|
"serve-static": "^1.14.0",
|
||||||
"shx": "^0.3.2",
|
"shx": "^0.3.2",
|
||||||
"sinon": "^7.2.3",
|
"sinon": "^7.3.2",
|
||||||
"terser-webpack-plugin": "^1.2.2",
|
"terser-webpack-plugin": "^1.2.3",
|
||||||
"typescript": "^3.2.2",
|
"typescript": "^3.4.5",
|
||||||
"url-polyfill": "^1.1.3",
|
"url-polyfill": "^1.1.5",
|
||||||
"walk": "^2.3.9",
|
"walk": "^2.3.9",
|
||||||
"webpack": "4.29.6",
|
"webpack": "4.35.0",
|
||||||
"webpack-cli": "^3.2.3",
|
"webpack-cli": "^3.3.2",
|
||||||
"webpack-dev-middleware": "^3.5.2",
|
"webpack-dev-middleware": "^3.6.2",
|
||||||
"webpack-dev-server": "^3.1.14",
|
"webpack-dev-server": "^3.3.1",
|
||||||
"yargs": "^13.2.0"
|
"yargs": "^13.2.2"
|
||||||
},
|
},
|
||||||
"eslintConfig": {
|
"eslintConfig": {
|
||||||
"extends": "openlayers",
|
"extends": "openlayers",
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 108 KiB After Width: | Height: | Size: 108 KiB |
@@ -1,10 +1,10 @@
|
|||||||
import Map from '../../../src/ol/Map.js';
|
import Map from '../../../src/ol/Map.js';
|
||||||
import View from '../../../src/ol/View.js';
|
import View from '../../../src/ol/View.js';
|
||||||
import TileLayer from '../../../src/ol/layer/Tile.js';
|
import TileLayer from '../../../src/ol/layer/Tile.js';
|
||||||
import XYZ from '../../../src/ol/source/XYZ';
|
import XYZ from '../../../src/ol/source/XYZ.js';
|
||||||
import {Heatmap as HeatmapLayer} from '../../../src/ol/layer';
|
import {Heatmap as HeatmapLayer} from '../../../src/ol/layer.js';
|
||||||
import VectorSource from '../../../src/ol/source/Vector';
|
import VectorSource from '../../../src/ol/source/Vector.js';
|
||||||
import KML from '../../../src/ol/format/KML';
|
import KML from '../../../src/ol/format/KML.js';
|
||||||
|
|
||||||
const vector = new HeatmapLayer({
|
const vector = new HeatmapLayer({
|
||||||
source: new VectorSource({
|
source: new VectorSource({
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 121 KiB After Width: | Height: | Size: 121 KiB |
|
Before Width: | Height: | Size: 119 KiB After Width: | Height: | Size: 119 KiB |
BIN
rendering/cases/layer-clipping/expected.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
61
rendering/cases/layer-clipping/main.js
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
import Map from '../../../src/ol/Map.js';
|
||||||
|
import View from '../../../src/ol/View.js';
|
||||||
|
import XYZ from '../../../src/ol/source/XYZ.js';
|
||||||
|
import TileLayer from '../../../src/ol/layer/Tile.js';
|
||||||
|
import MultiPolygon from '../../../src/ol/geom/MultiPolygon.js';
|
||||||
|
import Style from '../../../src/ol/style/Style.js';
|
||||||
|
import Stroke from '../../../src/ol/style/Stroke.js';
|
||||||
|
import {getVectorContext} from '../../../src/ol/render.js';
|
||||||
|
|
||||||
|
const source = new XYZ({
|
||||||
|
url: '/data/tiles/osm/{z}/{x}/{y}.png',
|
||||||
|
transition: 0
|
||||||
|
});
|
||||||
|
|
||||||
|
const layer = new TileLayer({
|
||||||
|
source: source
|
||||||
|
});
|
||||||
|
|
||||||
|
const geometry = new MultiPolygon([
|
||||||
|
[[[-80, -40], [-40, 0], [-80, 40], [-120, 0], [-80, -40]]],
|
||||||
|
[[[80, -40], [120, 0], [80, 40], [40, 0], [80, -40]]]
|
||||||
|
]).transform('EPSG:4326', 'EPSG:3857');
|
||||||
|
|
||||||
|
const style = new Style({
|
||||||
|
stroke: new Stroke({
|
||||||
|
width: 2,
|
||||||
|
color: 'blue'
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
layer.on('prerender', function(event) {
|
||||||
|
const context = event.context;
|
||||||
|
context.save();
|
||||||
|
|
||||||
|
const vectorContext = getVectorContext(event);
|
||||||
|
vectorContext.setStyle(style);
|
||||||
|
vectorContext.drawGeometry(geometry);
|
||||||
|
|
||||||
|
context.clip();
|
||||||
|
});
|
||||||
|
|
||||||
|
layer.on('postrender', function(event) {
|
||||||
|
const context = event.context;
|
||||||
|
context.restore();
|
||||||
|
|
||||||
|
const vectorContext = getVectorContext(event);
|
||||||
|
vectorContext.setStyle(style);
|
||||||
|
vectorContext.drawGeometry(geometry);
|
||||||
|
});
|
||||||
|
|
||||||
|
new Map({
|
||||||
|
pixelRatio: 1,
|
||||||
|
target: 'map',
|
||||||
|
layers: [layer],
|
||||||
|
view: new View({
|
||||||
|
center: [0, 0],
|
||||||
|
zoom: 0
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
render();
|
||||||
BIN
rendering/cases/layer-group/expected.png
Normal file
|
After Width: | Height: | Size: 49 KiB |
30
rendering/cases/layer-group/main.js
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
import Map from '../../../src/ol/Map.js';
|
||||||
|
import View from '../../../src/ol/View.js';
|
||||||
|
import {Group as LayerGroup, Tile as TileLayer} from '../../../src/ol/layer.js';
|
||||||
|
import XYZ from '../../../src/ol/source/XYZ.js';
|
||||||
|
|
||||||
|
new Map({
|
||||||
|
target: 'map',
|
||||||
|
view: new View({
|
||||||
|
center: [0, 0],
|
||||||
|
zoom: 3
|
||||||
|
}),
|
||||||
|
layers: new LayerGroup({
|
||||||
|
opacity: 0.75,
|
||||||
|
layers: [
|
||||||
|
new TileLayer({
|
||||||
|
opacity: 0.25,
|
||||||
|
source: new XYZ({
|
||||||
|
url: '/data/tiles/satellite/{z}/{x}/{y}.jpg'
|
||||||
|
})
|
||||||
|
}),
|
||||||
|
new TileLayer({
|
||||||
|
source: new XYZ({
|
||||||
|
url: '/data/tiles/stamen-labels/{z}/{x}/{y}.png'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
]
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
render();
|
||||||
BIN
rendering/cases/layer-image/expected.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
28
rendering/cases/layer-image/main.js
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
import Map from '../../../src/ol/Map.js';
|
||||||
|
import View from '../../../src/ol/View.js';
|
||||||
|
import Static from '../../../src/ol/source/ImageStatic.js';
|
||||||
|
import {
|
||||||
|
get as getProjection,
|
||||||
|
transform,
|
||||||
|
transformExtent
|
||||||
|
} from '../../../src/ol/proj.js';
|
||||||
|
import ImageLayer from '../../../src/ol/layer/Image.js';
|
||||||
|
const center = transform([-122.416667, 37.783333], 'EPSG:4326', 'EPSG:3857');
|
||||||
|
|
||||||
|
new Map({
|
||||||
|
pixelRatio: 1,
|
||||||
|
target: 'map',
|
||||||
|
layers: [new ImageLayer({
|
||||||
|
source: new Static({
|
||||||
|
url: '/data/tiles/osm/5/5/12.png',
|
||||||
|
imageExtent: transformExtent([-123, 37, -122, 38], 'EPSG:4326', 'EPSG:3857'),
|
||||||
|
projection: getProjection('EPSG:3857')
|
||||||
|
})
|
||||||
|
})],
|
||||||
|
view: new View({
|
||||||
|
center,
|
||||||
|
zoom: 8
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
render();
|
||||||
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 7.0 KiB |
@@ -5,9 +5,9 @@
|
|||||||
import Map from '../../../src/ol/Map.js';
|
import Map from '../../../src/ol/Map.js';
|
||||||
import View from '../../../src/ol/View.js';
|
import View from '../../../src/ol/View.js';
|
||||||
import TileLayer from '../../../src/ol/layer/Tile.js';
|
import TileLayer from '../../../src/ol/layer/Tile.js';
|
||||||
import {fromLonLat} from '../../../src/ol/proj';
|
import {fromLonLat} from '../../../src/ol/proj.js';
|
||||||
import {transformExtent} from '../../../src/ol/proj.js';
|
import {transformExtent} from '../../../src/ol/proj.js';
|
||||||
import XYZ from '../../../src/ol/source/XYZ';
|
import XYZ from '../../../src/ol/source/XYZ.js';
|
||||||
|
|
||||||
const center = fromLonLat([7, 50]);
|
const center = fromLonLat([7, 50]);
|
||||||
const extent = transformExtent([2, 47, 10, 53], 'EPSG:4326', 'EPSG:3857');
|
const extent = transformExtent([2, 47, 10, 53], 'EPSG:4326', 'EPSG:3857');
|
||||||
|
|||||||
BIN
rendering/cases/layer-tile-none-square/expected.png
Normal file
|
After Width: | Height: | Size: 8.0 KiB |
30
rendering/cases/layer-tile-none-square/main.js
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
import Map from '../../../src/ol/Map.js';
|
||||||
|
import View from '../../../src/ol/View.js';
|
||||||
|
import TileLayer from '../../../src/ol/layer/Tile.js';
|
||||||
|
import XYZ from '../../../src/ol/source/XYZ.js';
|
||||||
|
import {createXYZ} from '../../../src/ol/tilegrid.js';
|
||||||
|
|
||||||
|
const center = [-10997148, 4569099];
|
||||||
|
|
||||||
|
const layer = new TileLayer({
|
||||||
|
source: new XYZ({
|
||||||
|
url: '/data/tiles/512x256/{z}/{x}/{y}.png',
|
||||||
|
tileGrid: createXYZ({
|
||||||
|
tileSize: [512, 256]
|
||||||
|
}),
|
||||||
|
transition: 0
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
const map = new Map({
|
||||||
|
target: 'map',
|
||||||
|
pixelRatio: 1,
|
||||||
|
view: new View({
|
||||||
|
center: center,
|
||||||
|
zoom: 5
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
map.addLayer(layer);
|
||||||
|
|
||||||
|
render();
|
||||||
BIN
rendering/cases/layer-tile-opacity/expected.png
Normal file
|
After Width: | Height: | Size: 70 KiB |