Compare commits
756 Commits
r3.0.0-alp
...
r3.0.0-alp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d30efdaa71 | ||
|
|
e13075f6ff | ||
|
|
73f77115e1 | ||
|
|
68d943d98d | ||
|
|
45c0e27c36 | ||
|
|
f533f6b654 | ||
|
|
d43581719b | ||
|
|
88ccf64379 | ||
|
|
ccdbd5aae5 | ||
|
|
ce56ac90a8 | ||
|
|
639000a603 | ||
|
|
6cc8104ad3 | ||
|
|
cec83abc3e | ||
|
|
5afd564986 | ||
|
|
46d16ba0ca | ||
|
|
0467222e46 | ||
|
|
1208dab3e9 | ||
|
|
272bfceaf8 | ||
|
|
b6319c9a68 | ||
|
|
368194f293 | ||
|
|
0fc60e9957 | ||
|
|
2d08b5ff2c | ||
|
|
ca9f9b7563 | ||
|
|
b43625820e | ||
|
|
58d3314f7a | ||
|
|
65ec948cb0 | ||
|
|
781caff9e5 | ||
|
|
d04c6f4c01 | ||
|
|
ac67c10acd | ||
|
|
c3bed305c7 | ||
|
|
a9fcc5ff15 | ||
|
|
4e1012823f | ||
|
|
fecda5b094 | ||
|
|
a965d9ee9f | ||
|
|
3d7316906b | ||
|
|
892088ffac | ||
|
|
9095032014 | ||
|
|
f325046a95 | ||
|
|
2565e00e1d | ||
|
|
fef6359f75 | ||
|
|
2121a7dc9e | ||
|
|
907476f566 | ||
|
|
74f446948f | ||
|
|
d15f68d651 | ||
|
|
86001fd331 | ||
|
|
ad42496948 | ||
|
|
63c4feb6db | ||
|
|
66a167b4ed | ||
|
|
8b93c5a0a0 | ||
|
|
4a098aaee3 | ||
|
|
0e87922389 | ||
|
|
8844465188 | ||
|
|
2e08ccce03 | ||
|
|
a0d058b2fa | ||
|
|
e17d6aef70 | ||
|
|
711261171b | ||
|
|
42d02e064e | ||
|
|
9b039d76ea | ||
|
|
b2fc570328 | ||
|
|
c51265502d | ||
|
|
757ccf148b | ||
|
|
3e4d39b228 | ||
|
|
d7e838274e | ||
|
|
2cc5c7a776 | ||
|
|
daa03b5ef7 | ||
|
|
42abdb308a | ||
|
|
17f0d01e9f | ||
|
|
f72784dc38 | ||
|
|
44a9c181aa | ||
|
|
ccf6aa10ac | ||
|
|
a10d142752 | ||
|
|
461d85dfc3 | ||
|
|
087b4d04a6 | ||
|
|
3af5e530ca | ||
|
|
d9f554e10d | ||
|
|
d482b66af3 | ||
|
|
7efff5c3cf | ||
|
|
d0e198df93 | ||
|
|
e6efa741d2 | ||
|
|
552853a3b8 | ||
|
|
0cf4024194 | ||
|
|
a071c3521c | ||
|
|
6ae4b28db8 | ||
|
|
e1f8863bd2 | ||
|
|
1c3369a3f6 | ||
|
|
f2ce4db85a | ||
|
|
949edb694e | ||
|
|
7ebacba720 | ||
|
|
12338783cc | ||
|
|
82c791f9f5 | ||
|
|
e29d0aa52c | ||
|
|
5d5a248344 | ||
|
|
09a50ad442 | ||
|
|
1d6e428e8f | ||
|
|
e1a2c72587 | ||
|
|
dc246cd45b | ||
|
|
04bab7e436 | ||
|
|
cd14753495 | ||
|
|
445f85b3e2 | ||
|
|
a2bc986785 | ||
|
|
2974c74f1a | ||
|
|
943bad6e17 | ||
|
|
a19cb9ca64 | ||
|
|
e6e98a6ca2 | ||
|
|
aab5c8472c | ||
|
|
b7412552a5 | ||
|
|
fa4d2d485d | ||
|
|
6fc4aa68b6 | ||
|
|
07d790260c | ||
|
|
d6f442bbee | ||
|
|
f360dd86a0 | ||
|
|
dc9d7e857a | ||
|
|
e84c484677 | ||
|
|
79e0c81301 | ||
|
|
ec4110ee54 | ||
|
|
8565201c74 | ||
|
|
b555c52013 | ||
|
|
a4e8e529c4 | ||
|
|
d96ea1cb97 | ||
|
|
a7ca22dde0 | ||
|
|
71153d26d1 | ||
|
|
42aa94de21 | ||
|
|
30d947521d | ||
|
|
f06208920f | ||
|
|
16e23a33fb | ||
|
|
0958674765 | ||
|
|
e0a3f8ca07 | ||
|
|
3800676e97 | ||
|
|
87dda95b18 | ||
|
|
ae7b342ee9 | ||
|
|
020d528e73 | ||
|
|
4ccff4e8b6 | ||
|
|
3dc8c4bc7b | ||
|
|
72532b7dd6 | ||
|
|
34acea5366 | ||
|
|
4e5ef05e5e | ||
|
|
1eaf82ead5 | ||
|
|
70fef73869 | ||
|
|
c81057780a | ||
|
|
1f23a245e4 | ||
|
|
2577d3f7d6 | ||
|
|
9928730bd3 | ||
|
|
233595ac75 | ||
|
|
8e8b26805f | ||
|
|
cab983f826 | ||
|
|
c7da7e4c2e | ||
|
|
b04a36ede7 | ||
|
|
a663d8fcae | ||
|
|
38b784d672 | ||
|
|
d70a9eba01 | ||
|
|
bd5d9d572e | ||
|
|
5e309e244b | ||
|
|
53abedaada | ||
|
|
72d32ec71a | ||
|
|
f0567f5053 | ||
|
|
36d10bef11 | ||
|
|
62eb0dd72b | ||
|
|
bb1b0cba95 | ||
|
|
c05fb8c61b | ||
|
|
2528581642 | ||
|
|
4a617871da | ||
|
|
3de330eb99 | ||
|
|
6d6ec357e1 | ||
|
|
582a52849c | ||
|
|
be636d7f46 | ||
|
|
6458f98996 | ||
|
|
2fd8f4cb00 | ||
|
|
973606e67a | ||
|
|
d5e133b7d8 | ||
|
|
3a3f9bc20b | ||
|
|
9d5424236c | ||
|
|
7c2550fefa | ||
|
|
2492515e8f | ||
|
|
e6f03c8f22 | ||
|
|
26a7d907a2 | ||
|
|
a0bd736948 | ||
|
|
803b3a3f7d | ||
|
|
40b12410f0 | ||
|
|
379ac82688 | ||
|
|
38c8927ae2 | ||
|
|
6d0badcf2a | ||
|
|
d920d8e578 | ||
|
|
13d0b8b084 | ||
|
|
3643ea164f | ||
|
|
ce67aa2617 | ||
|
|
737d669e4a | ||
|
|
7a1e69e288 | ||
|
|
cb9725bdfb | ||
|
|
29b77a2dac | ||
|
|
fbb028e15e | ||
|
|
2f7e74ab35 | ||
|
|
f050546fe2 | ||
|
|
153df45f95 | ||
|
|
b2ff793ea1 | ||
|
|
c4867bafec | ||
|
|
7800e9b0cc | ||
|
|
052b973b39 | ||
|
|
20b66fc447 | ||
|
|
0abcbb9854 | ||
|
|
ed2e21dffa | ||
|
|
1f68522837 | ||
|
|
a87ebfe97b | ||
|
|
d7e0d043f3 | ||
|
|
063b461ffd | ||
|
|
9edc9ebcc5 | ||
|
|
f272350e00 | ||
|
|
5baa38b82c | ||
|
|
957b6db3d7 | ||
|
|
50f94911b1 | ||
|
|
4d62cea700 | ||
|
|
0844df8cc2 | ||
|
|
a748665646 | ||
|
|
040c80a5ad | ||
|
|
193cf4de50 | ||
|
|
81b344715a | ||
|
|
a5343161bf | ||
|
|
84a9fb40ef | ||
|
|
88fd0fda64 | ||
|
|
48130670ca | ||
|
|
ca3e1f0843 | ||
|
|
40b10c13dc | ||
|
|
23e54e4543 | ||
|
|
38893eaf8c | ||
|
|
cd13e700ac | ||
|
|
fab12b10c1 | ||
|
|
f462adbe53 | ||
|
|
e5d6ccd6ba | ||
|
|
99ba5a0da8 | ||
|
|
e292d8fa12 | ||
|
|
a427719a22 | ||
|
|
a14b21d80c | ||
|
|
d1eec80324 | ||
|
|
bb915cbf3d | ||
|
|
129e4d5704 | ||
|
|
5a95d606f8 | ||
|
|
388967d00c | ||
|
|
20527ab1f1 | ||
|
|
a9f01a4390 | ||
|
|
d10eff97a2 | ||
|
|
3f169b1751 | ||
|
|
f697450523 | ||
|
|
a405279f34 | ||
|
|
b30dcdd35a | ||
|
|
d6be28a7bb | ||
|
|
7a620de1bf | ||
|
|
be33fd58b3 | ||
|
|
54378f394a | ||
|
|
7bf24eb918 | ||
|
|
5cc3e189eb | ||
|
|
af0764b1ca | ||
|
|
27c23f676b | ||
|
|
1c5f466e61 | ||
|
|
61fcbd560e | ||
|
|
f20e6002cc | ||
|
|
89c23b5560 | ||
|
|
aa62764d90 | ||
|
|
0aacf197bf | ||
|
|
3afd8b4242 | ||
|
|
1826b7a9be | ||
|
|
3fc4fc3eb8 | ||
|
|
8fe0027d98 | ||
|
|
2a7b9381bc | ||
|
|
23f09937bc | ||
|
|
04344ed184 | ||
|
|
9cac8a92df | ||
|
|
c4ce85c847 | ||
|
|
f83fe424fb | ||
|
|
91a8703852 | ||
|
|
b7a1ada94d | ||
|
|
4217c5e47a | ||
|
|
22adf354e2 | ||
|
|
b0dde2ecb4 | ||
|
|
10f03a360c | ||
|
|
d250f4449c | ||
|
|
ba87c2e5ab | ||
|
|
f316b79bcd | ||
|
|
be86b83b67 | ||
|
|
9d63217778 | ||
|
|
b85520f504 | ||
|
|
11cfcda37c | ||
|
|
61f89bab6e | ||
|
|
9e3ca1c13c | ||
|
|
cb9f4972df | ||
|
|
7353e05a90 | ||
|
|
c17424deec | ||
|
|
cbf0402471 | ||
|
|
aa1a71ed96 | ||
|
|
79980bc7be | ||
|
|
56c2b85fce | ||
|
|
2ee0805075 | ||
|
|
6adedacaf8 | ||
|
|
bf9b0b4dd2 | ||
|
|
81a167ef01 | ||
|
|
517b4b27d7 | ||
|
|
fd5f4f3dd8 | ||
|
|
bed44dd82c | ||
|
|
2bd87313cd | ||
|
|
f99fd26386 | ||
|
|
916dde0045 | ||
|
|
4392feef1b | ||
|
|
153fea538a | ||
|
|
c54d81258a | ||
|
|
11cbbab901 | ||
|
|
b71bf9607c | ||
|
|
7b9ac53ace | ||
|
|
be0149e478 | ||
|
|
24953e5f0e | ||
|
|
29b5af9c87 | ||
|
|
caefacac35 | ||
|
|
37b369e0d7 | ||
|
|
cbf88de606 | ||
|
|
941432af75 | ||
|
|
826556775c | ||
|
|
0968e2b00b | ||
|
|
c02e2530f1 | ||
|
|
6b904573a0 | ||
|
|
950b53f6dc | ||
|
|
d552d27a35 | ||
|
|
0237675711 | ||
|
|
ba8684b585 | ||
|
|
b08a086a11 | ||
|
|
489879eb0d | ||
|
|
e0dd15567c | ||
|
|
1e9ccab806 | ||
|
|
9751bde8d1 | ||
|
|
3fab93fc4a | ||
|
|
1de3ffe57e | ||
|
|
bb980abe8c | ||
|
|
9726be64c6 | ||
|
|
f7fd1cf2b0 | ||
|
|
ea02626c28 | ||
|
|
8dc97790bc | ||
|
|
55b3cbaf17 | ||
|
|
9647567704 | ||
|
|
e56a791d41 | ||
|
|
e7d6bae0ad | ||
|
|
a631c50979 | ||
|
|
2964cc922c | ||
|
|
bbb95e15fa | ||
|
|
fc79a0ef3b | ||
|
|
e8ab4f9f0c | ||
|
|
526c38a698 | ||
|
|
489459f313 | ||
|
|
4d4a654a8e | ||
|
|
79f99485c1 | ||
|
|
ea8c970d6e | ||
|
|
9b00967df0 | ||
|
|
b66b0be8b4 | ||
|
|
15e5242611 | ||
|
|
c431cc7f63 | ||
|
|
448e300a03 | ||
|
|
7cd5266d39 | ||
|
|
f83fedb9e1 | ||
|
|
3a6c7cf204 | ||
|
|
77d22c4038 | ||
|
|
34becd6871 | ||
|
|
d05bb872f3 | ||
|
|
85ca39cf0c | ||
|
|
a858664035 | ||
|
|
286438ae0e | ||
|
|
ece2a4b64c | ||
|
|
fd62963ad2 | ||
|
|
4f0e09c00e | ||
|
|
461d2a1ba8 | ||
|
|
57e36f4eda | ||
|
|
5850dff254 | ||
|
|
45572931a1 | ||
|
|
e260255ce8 | ||
|
|
38c0e24bcd | ||
|
|
3225a07f6f | ||
|
|
db2f805ed9 | ||
|
|
42f15f000b | ||
|
|
f61edacb5c | ||
|
|
674468268e | ||
|
|
f55fed9bc3 | ||
|
|
2484cf2c55 | ||
|
|
8f86288614 | ||
|
|
1690cb9cae | ||
|
|
4cc5441579 | ||
|
|
e4b5ec8f0b | ||
|
|
bed8c44859 | ||
|
|
ac48fae0af | ||
|
|
93ba55d357 | ||
|
|
d51cdc0e48 | ||
|
|
7fd2e1ffca | ||
|
|
bcf7707b01 | ||
|
|
07694c52b0 | ||
|
|
a1a7e21f92 | ||
|
|
5560829695 | ||
|
|
b746116a20 | ||
|
|
4d5149a35f | ||
|
|
56ac30de91 | ||
|
|
1d7ca27e61 | ||
|
|
a2316e6e14 | ||
|
|
be081fd44e | ||
|
|
93fd685ca7 | ||
|
|
84b1886666 | ||
|
|
075f4aadc7 | ||
|
|
e9adc06bee | ||
|
|
984002a7ec | ||
|
|
46553c719c | ||
|
|
5e5d8e5b17 | ||
|
|
7e20ea160c | ||
|
|
3d0f7f3b70 | ||
|
|
317281b37b | ||
|
|
795ea69982 | ||
|
|
11672db967 | ||
|
|
c0cfc7872e | ||
|
|
e744a1b6e9 | ||
|
|
975e180b26 | ||
|
|
7046ebe261 | ||
|
|
f4d54ace1d | ||
|
|
8b539cd4cc | ||
|
|
20982bba31 | ||
|
|
f64e35e8bb | ||
|
|
268c18988b | ||
|
|
42b6ed5d2a | ||
|
|
b021bfd70f | ||
|
|
6900c90bc5 | ||
|
|
1c77fb2357 | ||
|
|
c28f64efde | ||
|
|
82d2fa373a | ||
|
|
9968a5feda | ||
|
|
0f3c151058 | ||
|
|
b921bece0e | ||
|
|
81bffb464f | ||
|
|
e2fa562326 | ||
|
|
dab8c8dcd0 | ||
|
|
836700669f | ||
|
|
a162b6fab3 | ||
|
|
f0baf2efc2 | ||
|
|
18b1789512 | ||
|
|
d80ded31ee | ||
|
|
aaa4fec141 | ||
|
|
a871f29e75 | ||
|
|
ea1ee73392 | ||
|
|
32c663cf2c | ||
|
|
3cdb9f130b | ||
|
|
476e35c276 | ||
|
|
7f22455eed | ||
|
|
439a8a5330 | ||
|
|
fa970f1ae2 | ||
|
|
3ee533a9b0 | ||
|
|
e63423eafe | ||
|
|
392d529168 | ||
|
|
5a3ac559be | ||
|
|
111b127bf7 | ||
|
|
9881411090 | ||
|
|
6e80a35960 | ||
|
|
d8232bb484 | ||
|
|
f8ef902af4 | ||
|
|
a452915d8a | ||
|
|
8c0f1f979a | ||
|
|
d1beaff8e4 | ||
|
|
4b0c43fb8b | ||
|
|
93b067b6bc | ||
|
|
10e3a16f40 | ||
|
|
513115ea3b | ||
|
|
597405c288 | ||
|
|
2d765a6cf9 | ||
|
|
2991c4ab57 | ||
|
|
fc12370765 | ||
|
|
7ba4045e59 | ||
|
|
cf605f2d52 | ||
|
|
0f0ea7e63f | ||
|
|
969b47c78c | ||
|
|
db34b37716 | ||
|
|
3a83f1b861 | ||
|
|
dc922b4ffa | ||
|
|
783e6d33d5 | ||
|
|
32d669ccc8 | ||
|
|
485245fbfd | ||
|
|
a2927a0dd9 | ||
|
|
77e60f8417 | ||
|
|
7d544e0868 | ||
|
|
0f4a5c09af | ||
|
|
97d48277b5 | ||
|
|
2b410cf2d0 | ||
|
|
9dd4dc3730 | ||
|
|
bf510b570a | ||
|
|
958ee7af51 | ||
|
|
2ff2e85fbb | ||
|
|
79e4ee2717 | ||
|
|
dc4ca15430 | ||
|
|
38752f4700 | ||
|
|
02ba8a86e6 | ||
|
|
ecea771801 | ||
|
|
b3ad00da13 | ||
|
|
0aa4fe258e | ||
|
|
921aa28b42 | ||
|
|
3e3b5ab02d | ||
|
|
585887b04e | ||
|
|
9342ebdc98 | ||
|
|
5d7cdd2646 | ||
|
|
22c4508c27 | ||
|
|
e50c314c33 | ||
|
|
bb16820ab0 | ||
|
|
bf8c12d9f7 | ||
|
|
3e6cdf8901 | ||
|
|
cde4ef435c | ||
|
|
1929403cda | ||
|
|
c245794e56 | ||
|
|
7ed51f97aa | ||
|
|
8084e20e64 | ||
|
|
7a800068ed | ||
|
|
824397e6ba | ||
|
|
2d5c0df7cd | ||
|
|
b7f0f9ba86 | ||
|
|
4e7ffc2711 | ||
|
|
037e44e084 | ||
|
|
32ea32521d | ||
|
|
e8ed1674ea | ||
|
|
2ad3ee6f99 | ||
|
|
5ad4734c24 | ||
|
|
124b195d3e | ||
|
|
42cc4d7683 | ||
|
|
4c144c3d5c | ||
|
|
87b3a3274d | ||
|
|
72fce33956 | ||
|
|
3a4fc2a99a | ||
|
|
88352092ee | ||
|
|
c845682ecb | ||
|
|
4e51888651 | ||
|
|
9685c87bc9 | ||
|
|
7a71f107cb | ||
|
|
2944b31c69 | ||
|
|
41fb355804 | ||
|
|
410f35bb44 | ||
|
|
917e78a096 | ||
|
|
d71c690794 | ||
|
|
c34d637de1 | ||
|
|
c9299f3b8d | ||
|
|
ca332a3fef | ||
|
|
4b7f3e85c2 | ||
|
|
f47ac87f12 | ||
|
|
17e779177b | ||
|
|
31930290cf | ||
|
|
a96031f435 | ||
|
|
53b85c99ae | ||
|
|
7b256c3ec6 | ||
|
|
fa1eb354f2 | ||
|
|
1d709cc6ac | ||
|
|
8779b90f7c | ||
|
|
c69e5c1dba | ||
|
|
0b09148fb5 | ||
|
|
9286d63133 | ||
|
|
b4598aa5d9 | ||
|
|
96c3a86314 | ||
|
|
97510ba0be | ||
|
|
2ad5dea737 | ||
|
|
14e073fb5a | ||
|
|
b698b1736f | ||
|
|
9c59116dd1 | ||
|
|
ab9fc9cc71 | ||
|
|
b7e2a9b40e | ||
|
|
09feaedd00 | ||
|
|
f31a4f8549 | ||
|
|
525d5c5337 | ||
|
|
f08814250e | ||
|
|
8c396e5afb | ||
|
|
019fc86ac5 | ||
|
|
c105a98443 | ||
|
|
666a010e3b | ||
|
|
aa3cc0cec4 | ||
|
|
3fc0f2b47d | ||
|
|
f219393149 | ||
|
|
10b690b5f9 | ||
|
|
865404a0d3 | ||
|
|
fdfe057efe | ||
|
|
331a5260c9 | ||
|
|
b070b572d0 | ||
|
|
70fc6879db | ||
|
|
a9b5f003e5 | ||
|
|
c1ddc55a12 | ||
|
|
ffe9105891 | ||
|
|
1ab9de8b2c | ||
|
|
0541053fa9 | ||
|
|
0e69af847e | ||
|
|
6e1f049456 | ||
|
|
65f891a30d | ||
|
|
fe9fee1609 | ||
|
|
bd9d723315 | ||
|
|
2690410cbe | ||
|
|
070c286c54 | ||
|
|
539529af59 | ||
|
|
d2979fc4ff | ||
|
|
f0df0d7bf2 | ||
|
|
984121e095 | ||
|
|
efccede678 | ||
|
|
fcc079a5f2 | ||
|
|
c012afdbae | ||
|
|
59a4155651 | ||
|
|
2d83003b64 | ||
|
|
c3348d1734 | ||
|
|
8fb8a718c3 | ||
|
|
6366bd05b3 | ||
|
|
00777de581 | ||
|
|
d2c81db06a | ||
|
|
58c8b07ab5 | ||
|
|
cc1b70c74b | ||
|
|
a0340faa63 | ||
|
|
7ed672752d | ||
|
|
daa975d01f | ||
|
|
66d95316f1 | ||
|
|
09d245c54b | ||
|
|
7a8d29f5e0 | ||
|
|
28fcbbf1fe | ||
|
|
1281d9987a | ||
|
|
aa5a571ab1 | ||
|
|
a723b4e215 | ||
|
|
6976fd96e3 | ||
|
|
1ff8df8936 | ||
|
|
37ef03c956 | ||
|
|
2447f09128 | ||
|
|
14da0cfd11 | ||
|
|
ca7081bde3 | ||
|
|
390cc17161 | ||
|
|
b666fc49b7 | ||
|
|
cfa29b0022 | ||
|
|
5bfef2805d | ||
|
|
65a2aef4ed | ||
|
|
ef915e1cd0 | ||
|
|
01d06d0a2e | ||
|
|
b3e5ac2717 | ||
|
|
3643908427 | ||
|
|
e8109919e9 | ||
|
|
09fe09e42b | ||
|
|
fa2582a2f1 | ||
|
|
c576b2a34e | ||
|
|
d8a4b19b54 | ||
|
|
e7eb07197e | ||
|
|
4828835292 | ||
|
|
a1af290d18 | ||
|
|
4094ace04b | ||
|
|
cec47dbfc3 | ||
|
|
6b74dcf75b | ||
|
|
9defa59d2d | ||
|
|
bd0512fea7 | ||
|
|
2b48f03e0f | ||
|
|
51905b54a2 | ||
|
|
43f313cb18 | ||
|
|
db1ab50938 | ||
|
|
1a72e59c54 | ||
|
|
ed5433d290 | ||
|
|
bedfa5e2d3 | ||
|
|
5842d771fe | ||
|
|
4da61e8ae9 | ||
|
|
9e8d20aee4 | ||
|
|
2dff59a4d4 | ||
|
|
a36b4a0466 | ||
|
|
3b9699fbc8 | ||
|
|
48d4554317 | ||
|
|
cc33727fad | ||
|
|
d1b2e4e483 | ||
|
|
808de79d16 | ||
|
|
76a9f80545 | ||
|
|
75ac8a4847 | ||
|
|
8d29bf3c20 | ||
|
|
d90f292c71 | ||
|
|
003ac5536e | ||
|
|
ef17d4f3b8 | ||
|
|
eb9f6c027b | ||
|
|
f2836ea111 | ||
|
|
a4d8e1c4d8 | ||
|
|
baf8cc49a1 | ||
|
|
a85363ac03 | ||
|
|
c78602ba7a | ||
|
|
d3d0d1e007 | ||
|
|
6751c2640d | ||
|
|
b2987d3054 | ||
|
|
b5076091fa | ||
|
|
29e69d3833 | ||
|
|
11efafffd8 | ||
|
|
e9a5eff753 | ||
|
|
29137b5ad1 | ||
|
|
e3bec11d2e | ||
|
|
8e8804caf1 | ||
|
|
2dfe36b588 | ||
|
|
7547b50bd8 | ||
|
|
f681a99ce0 | ||
|
|
334b2276cf | ||
|
|
8515e30ad8 | ||
|
|
c16b941909 | ||
|
|
0421ad71e8 | ||
|
|
e686eff886 | ||
|
|
6c369ae907 | ||
|
|
71e06761f0 | ||
|
|
3c541045bb | ||
|
|
744f72355b | ||
|
|
c2e1623529 | ||
|
|
d8357ae932 | ||
|
|
abbbe3d41b | ||
|
|
feb6c4c2d7 | ||
|
|
d45a63ee5c | ||
|
|
bc3dc0fd74 | ||
|
|
4c42f4e1ba | ||
|
|
ee2e448220 | ||
|
|
8264343e54 | ||
|
|
fe1475105a | ||
|
|
9d901d26b2 | ||
|
|
a5519c2645 | ||
|
|
4f1b7c70b8 | ||
|
|
e6f354ce7c | ||
|
|
ddb295cc77 | ||
|
|
be7228f78e | ||
|
|
945d2f6f5d | ||
|
|
ac557d4eca | ||
|
|
b2cc0c9bd8 | ||
|
|
c48b9c5118 | ||
|
|
ac489c6938 | ||
|
|
fb0f1fb209 | ||
|
|
879d9758c0 | ||
|
|
72a83b99b7 | ||
|
|
68440e7e0f | ||
|
|
e9b0e2b0e8 | ||
|
|
332fd250b4 | ||
|
|
f047e5f6bd | ||
|
|
7979726327 | ||
|
|
d964bbc605 | ||
|
|
f5611d6cd6 | ||
|
|
388e530420 | ||
|
|
fe5c8a97d4 | ||
|
|
37d3f7b4c1 | ||
|
|
72767f5d17 | ||
|
|
965776160f | ||
|
|
a642868cfa | ||
|
|
f81658f542 | ||
|
|
953f9c2e7a | ||
|
|
01168e805a | ||
|
|
a413f3046a | ||
|
|
1d4eaf6824 | ||
|
|
305089d84f | ||
|
|
10d1be695d | ||
|
|
465e24cf4e | ||
|
|
aff9f5dbf9 | ||
|
|
583564e484 | ||
|
|
559e85bc76 | ||
|
|
9708fb4ea6 | ||
|
|
10354cf607 | ||
|
|
f0c812482f | ||
|
|
e868954d9c | ||
|
|
c2ff8347d9 | ||
|
|
e50253e316 | ||
|
|
9773314803 | ||
|
|
7d21bd8133 | ||
|
|
ca8647c808 | ||
|
|
b4f7259c7f | ||
|
|
16f70ba1a0 | ||
|
|
0da8b0ae7f | ||
|
|
1ad7765f2f | ||
|
|
7d610bde7b | ||
|
|
b24c46dd19 | ||
|
|
43cfc2a4cd | ||
|
|
d291d23092 | ||
|
|
85a95a0036 | ||
|
|
f274cc99f6 |
@@ -1,5 +1,6 @@
|
|||||||
before_install:
|
before_install:
|
||||||
- "sudo pip install http://closure-linter.googlecode.com/files/closure_linter-latest.tar.gz"
|
- "sudo pip install http://closure-linter.googlecode.com/files/closure_linter-latest.tar.gz"
|
||||||
|
- "sudo pip install regex"
|
||||||
- "git clone --depth=50 https://github.com/jsdoc3/jsdoc build/jsdoc"
|
- "git clone --depth=50 https://github.com/jsdoc3/jsdoc build/jsdoc"
|
||||||
- "git clone https://code.google.com/p/glsl-unit/ build/glsl-unit"
|
- "git clone https://code.google.com/p/glsl-unit/ build/glsl-unit"
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
[](http://travis-ci.org/#!/openlayers/ol3)
|
[](http://travis-ci.org/#!/openlayers/ol3)
|
||||||
|
|
||||||
Welcome to OpenLayers 3!
|
Welcome to [OpenLayers 3](http://ol3js.org/)!
|
||||||
|
|
||||||
To see OpenLayers 3 in action you can look at the live examples on
|
Check out the [hosted examples](http://ol3js.org/en/master/examples/) or poke around the evolving [API docs](http://ol3js.org/en/master/apidoc/).
|
||||||
http://openlayers.github.io/ol3/master/examples/. If you want to contribute
|
|
||||||
to OpenLayers 3 please read the [CONTRIBUTING](CONTRIBUTING.md) page.
|
Please see our guide on [contributing](CONTRIBUTING.md) if you're interested in getting involved.
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ class Class(Exportable):
|
|||||||
lines.append(' */\n')
|
lines.append(' */\n')
|
||||||
lines.append('%s = function(options) {\n' % (self.export_name(),))
|
lines.append('%s = function(options) {\n' % (self.export_name(),))
|
||||||
lines.append(' /** @type {%s} */\n' % (self.object_literal.name,))
|
lines.append(' /** @type {%s} */\n' % (self.object_literal.name,))
|
||||||
lines.append(' var arg;\n');
|
lines.append(' var arg = /** @type {%s} */ (options);\n' % (self.object_literal.name,));
|
||||||
lines.append(' if (goog.isDefAndNotNull(options)) {\n')
|
lines.append(' if (goog.isDefAndNotNull(options)) {\n')
|
||||||
# FIXME: we modify the user's options object
|
# FIXME: we modify the user's options object
|
||||||
lines.append(''.join(
|
lines.append(''.join(
|
||||||
@@ -103,15 +103,13 @@ class Class(Exportable):
|
|||||||
{'o': o, 'base': b.name, 'ctor': k.export_name(),
|
{'o': o, 'base': b.name, 'ctor': k.export_name(),
|
||||||
'extern': ol.extern_name()} \
|
'extern': ol.extern_name()} \
|
||||||
for o, ol, k, b in self.nested_options()))
|
for o, ol, k, b in self.nested_options()))
|
||||||
lines.append(' arg = {')
|
lines.extend('\n'.join(' arg.%s = options.%s;' % (key, key) for key in sorted(self.object_literal.prop_types.keys())))
|
||||||
lines.extend(','.join('\n %s: options.%s' % (key, key) for key in sorted(self.object_literal.prop_types.keys())))
|
lines.append('\n }\n')
|
||||||
lines.append('\n };\n')
|
|
||||||
lines.append(' } else {\n')
|
|
||||||
lines.append(' arg = /** @type {%s} */ (options);\n' % (self.object_literal.name,))
|
|
||||||
lines.append(' }\n')
|
|
||||||
lines.append(' goog.base(this, arg);\n')
|
lines.append(' goog.base(this, arg);\n')
|
||||||
lines.append('};\n')
|
lines.append('};\n')
|
||||||
lines.append('goog.inherits(%sExport, %s);\n' % (self.name, self.name))
|
lines.append('goog.inherits(\n')
|
||||||
|
lines.append(' %sExport,\n' % (self.name,));
|
||||||
|
lines.append(' %s);\n' % (self.name,));
|
||||||
lines.append('goog.exportSymbol(\n')
|
lines.append('goog.exportSymbol(\n')
|
||||||
lines.append(' \'%s\',\n' % (self.name,))
|
lines.append(' \'%s\',\n' % (self.name,))
|
||||||
lines.append(' %s);\n' % (self.export_name(),))
|
lines.append(' %s);\n' % (self.export_name(),))
|
||||||
@@ -276,7 +274,7 @@ def main(argv):
|
|||||||
components = m.group('name').split('.')
|
components = m.group('name').split('.')
|
||||||
if re.match(r'[A-Z]', components[-1]):
|
if re.match(r'[A-Z]', components[-1]):
|
||||||
requires.add(name)
|
requires.add(name)
|
||||||
elif len(components) > 2:
|
elif len(components) > 1:
|
||||||
requires.add('.'.join(components[:-1]))
|
requires.add('.'.join(components[:-1]))
|
||||||
continue
|
continue
|
||||||
raise RuntimeError(line)
|
raise RuntimeError(line)
|
||||||
|
|||||||
@@ -65,12 +65,19 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CLOSURE_NO_DEPS has an effect in "raw" and "whitespace" modes only (i.e.
|
||||||
|
// when COMPILED is false). In "raw" mode we use our own deps file
|
||||||
|
// (ol-deps.js), so we set CLOSURE_NO_DEPS to true to prevent Google
|
||||||
|
// Library's base.js script to load deps.js. In "whitespace" mode
|
||||||
|
// no deps file is needed at all, yet base.js will attempt to load deps.js
|
||||||
|
// if CLOSURE_NO_DEPS is not set to true.
|
||||||
|
window.CLOSURE_NO_DEPS = true;
|
||||||
|
|
||||||
var scriptId = encodeURIComponent(scriptParams.id);
|
var scriptId = encodeURIComponent(scriptParams.id);
|
||||||
document.write('<link rel="stylesheet" href="../build/ol.css" type="text/css">');
|
document.write('<link rel="stylesheet" href="../build/ol.css" type="text/css">');
|
||||||
if (mode != 'raw') {
|
if (mode != 'raw') {
|
||||||
document.write('<scr' + 'ipt type="text/javascript" src="../build/' + oljs + '"></scr' + 'ipt>');
|
document.write('<scr' + 'ipt type="text/javascript" src="../build/' + oljs + '"></scr' + 'ipt>');
|
||||||
} else {
|
} else {
|
||||||
window.CLOSURE_NO_DEPS = true; // we've got our own deps file
|
|
||||||
document.write('<scr' + 'ipt type="text/javascript" src="../closure-library/closure/goog/base.js"></scr' + 'ipt>');
|
document.write('<scr' + 'ipt type="text/javascript" src="../closure-library/closure/goog/base.js"></scr' + 'ipt>');
|
||||||
document.write('<scr' + 'ipt type="text/javascript" src="../build/ol-deps.js"></scr' + 'ipt>');
|
document.write('<scr' + 'ipt type="text/javascript" src="../build/ol-deps.js"></scr' + 'ipt>');
|
||||||
document.write('<scr' + 'ipt type="text/javascript" src="' + scriptId + '-require.js"></scr' + 'ipt>');
|
document.write('<scr' + 'ipt type="text/javascript" src="' + scriptId + '-require.js"></scr' + 'ipt>');
|
||||||
|
|||||||
101
build.py
101
build.py
@@ -5,7 +5,7 @@ import gzip
|
|||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import os.path
|
import os.path
|
||||||
import re
|
import regex as re
|
||||||
import shutil
|
import shutil
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
@@ -72,7 +72,10 @@ if sys.platform == 'win32':
|
|||||||
else:
|
else:
|
||||||
variables.GIT = 'git'
|
variables.GIT = 'git'
|
||||||
variables.GJSLINT = 'gjslint'
|
variables.GJSLINT = 'gjslint'
|
||||||
variables.JAVA = 'java'
|
if sys.platform == 'darwin':
|
||||||
|
variables.JAVA = '/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java'
|
||||||
|
else:
|
||||||
|
variables.JAVA = 'java'
|
||||||
variables.JAR = 'jar'
|
variables.JAR = 'jar'
|
||||||
variables.JSDOC = 'jsdoc'
|
variables.JSDOC = 'jsdoc'
|
||||||
variables.NODE = 'node'
|
variables.NODE = 'node'
|
||||||
@@ -142,8 +145,8 @@ SRC = [path
|
|||||||
if path.endswith('.js')
|
if path.endswith('.js')
|
||||||
if path not in SHADER_SRC]
|
if path not in SHADER_SRC]
|
||||||
|
|
||||||
PLOVR_JAR = 'build/plovr-eba786b34df9.jar'
|
PLOVR_JAR = 'build/plovr-2013-rc3.jar'
|
||||||
PLOVR_JAR_MD5 = '20eac8ccc4578676511cf7ccbfc65100'
|
PLOVR_JAR_MD5 = '8690b431a7c257b8849ae7d0fa979537'
|
||||||
|
|
||||||
PROJ4JS = 'build/proj4js/lib/proj4js-combined.js'
|
PROJ4JS = 'build/proj4js/lib/proj4js-combined.js'
|
||||||
PROJ4JS_ZIP = 'build/proj4js-1.1.0.zip'
|
PROJ4JS_ZIP = 'build/proj4js-1.1.0.zip'
|
||||||
@@ -309,6 +312,7 @@ def examples_star_json(name, match):
|
|||||||
'../externs/bingmaps.js',
|
'../externs/bingmaps.js',
|
||||||
'../externs/bootstrap.js',
|
'../externs/bootstrap.js',
|
||||||
'../externs/geojson.js',
|
'../externs/geojson.js',
|
||||||
|
'../externs/oli.js',
|
||||||
'../externs/proj4js.js',
|
'../externs/proj4js.js',
|
||||||
'../externs/tilejson.js',
|
'../externs/tilejson.js',
|
||||||
],
|
],
|
||||||
@@ -332,8 +336,7 @@ def examples_star_combined_js(name, match):
|
|||||||
return Target(name, action=action, dependencies=dependencies)
|
return Target(name, action=action, dependencies=dependencies)
|
||||||
|
|
||||||
|
|
||||||
@target('serve', PLOVR_JAR, INTERNAL_SRC, 'build/test/requireall.js',
|
@target('serve', PLOVR_JAR, 'test-deps', 'examples')
|
||||||
'examples')
|
|
||||||
def serve(t):
|
def serve(t):
|
||||||
t.run('%(JAVA)s', '-jar', PLOVR_JAR, 'serve', 'buildcfg/ol.json',
|
t.run('%(JAVA)s', '-jar', PLOVR_JAR, 'serve', 'buildcfg/ol.json',
|
||||||
'buildcfg/ol-all.json', EXAMPLES_JSON, 'buildcfg/test.json')
|
'buildcfg/ol-all.json', EXAMPLES_JSON, 'buildcfg/test.json')
|
||||||
@@ -345,19 +348,35 @@ def serve_precommit(t):
|
|||||||
'buildcfg/ol-all.json', 'buildcfg/test.json')
|
'buildcfg/ol-all.json', 'buildcfg/test.json')
|
||||||
|
|
||||||
|
|
||||||
virtual('lint', 'build/lint-timestamp', 'build/check-requires-timestamp',
|
virtual('lint', 'build/lint-timestamp', 'build/lint-generated-timestamp',
|
||||||
'build/check-whitespace-timestamp')
|
'build/check-requires-timestamp', 'build/check-whitespace-timestamp')
|
||||||
|
|
||||||
|
|
||||||
@target('build/lint-timestamp', SRC, INTERNAL_SRC, EXTERNAL_SRC, EXAMPLES_SRC,
|
@target('build/lint-timestamp', SRC, EXAMPLES_SRC, SPEC, precious=True)
|
||||||
SPEC, precious=True)
|
|
||||||
def build_lint_src_timestamp(t):
|
def build_lint_src_timestamp(t):
|
||||||
|
t.run('%(GJSLINT)s',
|
||||||
|
'--jslint_error=all',
|
||||||
|
'--strict',
|
||||||
|
t.newer(t.dependencies))
|
||||||
|
t.touch()
|
||||||
|
|
||||||
|
|
||||||
|
@target('build/lint-generated-timestamp', INTERNAL_SRC, EXTERNAL_SRC,
|
||||||
|
precious=True)
|
||||||
|
def build_lint_generated_timestamp(t):
|
||||||
limited_doc_files = [
|
limited_doc_files = [
|
||||||
path
|
path
|
||||||
for path in ifind('externs', 'build/src/external/externs')
|
for path in ifind('externs', 'build/src/external/externs')
|
||||||
if path.endswith('.js')]
|
if path.endswith('.js')]
|
||||||
t.run('%(GJSLINT)s', '--strict', '--limited_doc_files=%s' %
|
t.run('%(GJSLINT)s',
|
||||||
(','.join(limited_doc_files),), t.newer(t.dependencies))
|
'--jslint_error=all',
|
||||||
|
# ignore error for max line length (for these auto-generated sources)
|
||||||
|
'--disable=110',
|
||||||
|
# for a complete list of error codes to allow, see
|
||||||
|
# http://closure-linter.googlecode.com/svn/trunk/closure_linter/errors.py
|
||||||
|
'--limited_doc_files=%s' % (','.join(limited_doc_files),),
|
||||||
|
'--strict',
|
||||||
|
t.newer(t.dependencies))
|
||||||
t.touch()
|
t.touch()
|
||||||
|
|
||||||
|
|
||||||
@@ -477,6 +496,7 @@ def build_check_requires_timestamp(t):
|
|||||||
provides = set()
|
provides = set()
|
||||||
requires = set()
|
requires = set()
|
||||||
uses = set()
|
uses = set()
|
||||||
|
uses_linenos = {}
|
||||||
for lineno, line in _strip_comments(open(filename)):
|
for lineno, line in _strip_comments(open(filename)):
|
||||||
m = re.match(r'goog.provide\(\'(.*)\'\);', line)
|
m = re.match(r'goog.provide\(\'(.*)\'\);', line)
|
||||||
if m:
|
if m:
|
||||||
@@ -491,6 +511,7 @@ def build_check_requires_timestamp(t):
|
|||||||
m = provide_re.search(line)
|
m = provide_re.search(line)
|
||||||
if m:
|
if m:
|
||||||
uses.add(m.group())
|
uses.add(m.group())
|
||||||
|
uses_linenos[m.group()] = lineno
|
||||||
line = line[:m.start()] + line[m.end():]
|
line = line[:m.start()] + line[m.end():]
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
@@ -504,9 +525,10 @@ def build_check_requires_timestamp(t):
|
|||||||
uses.discard('ol.renderer.%s.Map' % (m.group(1),))
|
uses.discard('ol.renderer.%s.Map' % (m.group(1),))
|
||||||
missing_requires = uses - requires - provides
|
missing_requires = uses - requires - provides
|
||||||
if missing_requires:
|
if missing_requires:
|
||||||
t.info('%s: missing goog.requires: %s', filename, ', '.join(
|
for missing_require in sorted(missing_requires):
|
||||||
sorted(missing_requires)))
|
t.info("%s:%d missing goog.require('%s')" %
|
||||||
missing_count += len(missing_requires)
|
(filename, uses_linenos[missing_require], missing_require))
|
||||||
|
missing_count += 1
|
||||||
if unused_count or missing_count:
|
if unused_count or missing_count:
|
||||||
t.error('%d unused goog.requires, %d missing goog.requires' %
|
t.error('%d unused goog.requires, %d missing goog.requires' %
|
||||||
(unused_count, missing_count))
|
(unused_count, missing_count))
|
||||||
@@ -549,25 +571,11 @@ virtual('plovr', PLOVR_JAR)
|
|||||||
@target(PLOVR_JAR, clean=False)
|
@target(PLOVR_JAR, clean=False)
|
||||||
def plovr_jar(t):
|
def plovr_jar(t):
|
||||||
t.info('downloading %r', t.name)
|
t.info('downloading %r', t.name)
|
||||||
t.download('https://plovr.googlecode.com/files/' +
|
t.download('http://plovr.com/' +
|
||||||
os.path.basename(PLOVR_JAR), md5=PLOVR_JAR_MD5)
|
os.path.basename(PLOVR_JAR), md5=PLOVR_JAR_MD5)
|
||||||
t.info('downloaded %r', t.name)
|
t.info('downloaded %r', t.name)
|
||||||
|
|
||||||
|
|
||||||
@target('gh-pages', 'host-examples', 'doc', phony=True)
|
|
||||||
def gh_pages(t):
|
|
||||||
with t.tempdir() as tempdir:
|
|
||||||
t.run('%(GIT)s', 'clone', '--branch', 'gh-pages',
|
|
||||||
'git@github.com:openlayers/ol3.git', tempdir)
|
|
||||||
with t.chdir(tempdir):
|
|
||||||
t.rm_rf('%(BRANCH)s')
|
|
||||||
t.cp_r('build/gh-pages/%(BRANCH)s', tempdir + '/%(BRANCH)s')
|
|
||||||
with t.chdir(tempdir):
|
|
||||||
t.run('%(GIT)s', 'add', '--all', '%(BRANCH)s')
|
|
||||||
t.run('%(GIT)s', 'commit', '--message', 'Updated')
|
|
||||||
t.run('%(GIT)s', 'push', 'origin', 'gh-pages')
|
|
||||||
|
|
||||||
|
|
||||||
virtual('doc', 'build/jsdoc-%(BRANCH)s-timestamp' % vars(variables))
|
virtual('doc', 'build/jsdoc-%(BRANCH)s-timestamp' % vars(variables))
|
||||||
|
|
||||||
|
|
||||||
@@ -576,7 +584,7 @@ virtual('doc', 'build/jsdoc-%(BRANCH)s-timestamp' % vars(variables))
|
|||||||
SRC, SHADER_SRC, ifind('doc/template'))
|
SRC, SHADER_SRC, ifind('doc/template'))
|
||||||
def jsdoc_BRANCH_timestamp(t):
|
def jsdoc_BRANCH_timestamp(t):
|
||||||
t.run('%(JSDOC)s', '-c', 'doc/conf.json', 'src', 'doc/index.md',
|
t.run('%(JSDOC)s', '-c', 'doc/conf.json', 'src', 'doc/index.md',
|
||||||
'-d', 'build/gh-pages/%(BRANCH)s/apidoc')
|
'-d', 'build/hosted/%(BRANCH)s/apidoc')
|
||||||
t.touch()
|
t.touch()
|
||||||
|
|
||||||
|
|
||||||
@@ -614,15 +622,15 @@ def split_example_file(example, dst_dir):
|
|||||||
|
|
||||||
@target('host-resources', phony=True)
|
@target('host-resources', phony=True)
|
||||||
def host_resources(t):
|
def host_resources(t):
|
||||||
resources_dir = 'build/gh-pages/%(BRANCH)s/resources'
|
resources_dir = 'build/hosted/%(BRANCH)s/resources'
|
||||||
t.rm_rf(resources_dir)
|
t.rm_rf(resources_dir)
|
||||||
t.cp_r('resources', resources_dir)
|
t.cp_r('resources', resources_dir)
|
||||||
|
|
||||||
|
|
||||||
@target('host-examples', 'build', 'host-resources', 'examples', phony=True)
|
@target('host-examples', 'build', 'host-resources', 'examples', phony=True)
|
||||||
def host_examples(t):
|
def host_examples(t):
|
||||||
examples_dir = 'build/gh-pages/%(BRANCH)s/examples'
|
examples_dir = 'build/hosted/%(BRANCH)s/examples'
|
||||||
build_dir = 'build/gh-pages/%(BRANCH)s/build'
|
build_dir = 'build/hosted/%(BRANCH)s/build'
|
||||||
t.rm_rf(examples_dir)
|
t.rm_rf(examples_dir)
|
||||||
t.makedirs(examples_dir)
|
t.makedirs(examples_dir)
|
||||||
t.rm_rf(build_dir)
|
t.rm_rf(build_dir)
|
||||||
@@ -637,25 +645,25 @@ def host_examples(t):
|
|||||||
t.cp('examples/index.html', 'examples/example-list.js',
|
t.cp('examples/index.html', 'examples/example-list.js',
|
||||||
'examples/example-list.xml', 'examples/Jugl.js',
|
'examples/example-list.xml', 'examples/Jugl.js',
|
||||||
'examples/jquery.min.js', examples_dir)
|
'examples/jquery.min.js', examples_dir)
|
||||||
t.rm_rf('build/gh-pages/%(BRANCH)s/closure-library')
|
t.rm_rf('build/hosted/%(BRANCH)s/closure-library')
|
||||||
t.makedirs('build/gh-pages/%(BRANCH)s/closure-library')
|
t.makedirs('build/hosted/%(BRANCH)s/closure-library')
|
||||||
with t.chdir('build/gh-pages/%(BRANCH)s/closure-library'):
|
with t.chdir('build/hosted/%(BRANCH)s/closure-library'):
|
||||||
t.run('%(JAR)s', 'xf', '../../../../' + PLOVR_JAR, 'closure')
|
t.run('%(JAR)s', 'xf', '../../../../' + PLOVR_JAR, 'closure')
|
||||||
t.run('%(JAR)s', 'xf', '../../../../' + PLOVR_JAR, 'third_party')
|
t.run('%(JAR)s', 'xf', '../../../../' + PLOVR_JAR, 'third_party')
|
||||||
t.rm_rf('build/gh-pages/%(BRANCH)s/ol')
|
t.rm_rf('build/hosted/%(BRANCH)s/ol')
|
||||||
t.makedirs('build/gh-pages/%(BRANCH)s/ol')
|
t.makedirs('build/hosted/%(BRANCH)s/ol')
|
||||||
t.cp_r('src/ol', 'build/gh-pages/%(BRANCH)s/ol/ol')
|
t.cp_r('src/ol', 'build/hosted/%(BRANCH)s/ol/ol')
|
||||||
t.run('%(PYTHON)s', 'bin/closure/depswriter.py',
|
t.run('%(PYTHON)s', 'bin/closure/depswriter.py',
|
||||||
'--root_with_prefix', 'src ../../../ol',
|
'--root_with_prefix', 'src ../../../ol',
|
||||||
'--root', 'build/gh-pages/%(BRANCH)s/closure-library/closure/goog',
|
'--root', 'build/hosted/%(BRANCH)s/closure-library/closure/goog',
|
||||||
'--root_with_prefix', 'build/gh-pages/%(BRANCH)s/closure-library/'
|
'--root_with_prefix', 'build/hosted/%(BRANCH)s/closure-library/'
|
||||||
'third_party ../../third_party',
|
'third_party ../../third_party',
|
||||||
'--output_file', 'build/gh-pages/%(BRANCH)s/build/ol-deps.js')
|
'--output_file', 'build/hosted/%(BRANCH)s/build/ol-deps.js')
|
||||||
|
|
||||||
|
|
||||||
@target('check-examples', 'host-examples', phony=True)
|
@target('check-examples', 'host-examples', phony=True)
|
||||||
def check_examples(t):
|
def check_examples(t):
|
||||||
examples = ['build/gh-pages/%(BRANCH)s/' + e for e in EXAMPLES]
|
examples = ['build/hosted/%(BRANCH)s/' + e for e in EXAMPLES]
|
||||||
all_examples = \
|
all_examples = \
|
||||||
[e + '?mode=raw' for e in examples] + \
|
[e + '?mode=raw' for e in examples] + \
|
||||||
[e + '?mode=whitespace' for e in examples] + \
|
[e + '?mode=whitespace' for e in examples] + \
|
||||||
@@ -682,7 +690,10 @@ def proj4js_zip(t):
|
|||||||
t.info('downloaded %r', t.name)
|
t.info('downloaded %r', t.name)
|
||||||
|
|
||||||
|
|
||||||
@target('test', INTERNAL_SRC, PROJ4JS, 'build/test/requireall.js', phony=True)
|
virtual('test-deps', INTERNAL_SRC, PROJ4JS, 'build/test/requireall.js')
|
||||||
|
|
||||||
|
|
||||||
|
@target('test', 'test-deps', phony=True)
|
||||||
def test(t):
|
def test(t):
|
||||||
t.run('%(PHANTOMJS)s', 'test/mocha-phantomjs.coffee', 'test/ol.html')
|
t.run('%(PHANTOMJS)s', 'test/mocha-phantomjs.coffee', 'test/ol.html')
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,7 @@
|
|||||||
"//json.js",
|
"//json.js",
|
||||||
"../externs/bingmaps.js",
|
"../externs/bingmaps.js",
|
||||||
"../externs/geojson.js",
|
"../externs/geojson.js",
|
||||||
|
"../externs/oli.js",
|
||||||
"../externs/proj4js.js",
|
"../externs/proj4js.js",
|
||||||
"../externs/tilejson.js"
|
"../externs/tilejson.js"
|
||||||
],
|
],
|
||||||
@@ -50,11 +51,55 @@
|
|||||||
|
|
||||||
"mode": "ADVANCED",
|
"mode": "ADVANCED",
|
||||||
|
|
||||||
|
"name-suffixes-to-strip": [
|
||||||
|
"logger",
|
||||||
|
"logger_"
|
||||||
|
],
|
||||||
|
|
||||||
"paths": [
|
"paths": [
|
||||||
"../build/src/internal/src",
|
"../build/src/internal/src",
|
||||||
"../src"
|
"../src"
|
||||||
],
|
],
|
||||||
|
|
||||||
"treat-warnings-as-errors": false
|
"treat-warnings-as-errors": false,
|
||||||
|
|
||||||
|
"type-prefixes-to-strip": [
|
||||||
|
"goog.asserts",
|
||||||
|
"goog.debug.Console",
|
||||||
|
"goog.debug.DebugWindow",
|
||||||
|
"goog.debug.DevCss",
|
||||||
|
"goog.debug.DivConsole",
|
||||||
|
"goog.debug.EntryPointMonitor",
|
||||||
|
"goog.debug.ErrorHandler",
|
||||||
|
"goog.debug.ErrorReporter",
|
||||||
|
"goog.debug.FancyWindow",
|
||||||
|
"goog.debug.Formatter",
|
||||||
|
"goog.debug.FpsDisplay",
|
||||||
|
"goog.debug.GcDiagnostics",
|
||||||
|
"goog.debug.HtmlFormatter",
|
||||||
|
"goog.debug.LogBuffer",
|
||||||
|
"goog.debug.LogManager",
|
||||||
|
"goog.debug.LogRecord",
|
||||||
|
"goog.debug.Logger",
|
||||||
|
"goog.debug.RelativeTimeProvider",
|
||||||
|
"goog.debug.TextFormatter",
|
||||||
|
"goog.debug.Trace",
|
||||||
|
"goog.debug.catchErrors",
|
||||||
|
"goog.debug.deepExpose",
|
||||||
|
"goog.debug.enhanceError",
|
||||||
|
"goog.debug.entryPointRegistry",
|
||||||
|
"goog.debug.errorHandlerWeakDep",
|
||||||
|
"goog.debug.expose",
|
||||||
|
"goog.debug.exposeArray",
|
||||||
|
"goog.debug.exposeException",
|
||||||
|
"goog.debug.getFunctionName",
|
||||||
|
"goog.debug.getStacktrace",
|
||||||
|
"goog.debug.getStacktraceSimple",
|
||||||
|
"goog.debug.logRecordSerializer",
|
||||||
|
"goog.debug.makeWhitespaceVisible",
|
||||||
|
"goog.debug.normalizeErrorObject",
|
||||||
|
"goog.debug.reflect",
|
||||||
|
"goog.log"
|
||||||
|
]
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
"../build/src/external/externs/types.js",
|
"../build/src/external/externs/types.js",
|
||||||
"../externs/bingmaps.js",
|
"../externs/bingmaps.js",
|
||||||
"../externs/geojson.js",
|
"../externs/geojson.js",
|
||||||
|
"../externs/oli.js",
|
||||||
"../externs/proj4js.js",
|
"../externs/proj4js.js",
|
||||||
"../externs/tilejson.js"
|
"../externs/tilejson.js"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
"//json.js",
|
"//json.js",
|
||||||
"../externs/bingmaps.js",
|
"../externs/bingmaps.js",
|
||||||
"../externs/geojson.js",
|
"../externs/geojson.js",
|
||||||
|
"../externs/oli.js",
|
||||||
"../externs/proj4js.js",
|
"../externs/proj4js.js",
|
||||||
"../externs/tilejson.js"
|
"../externs/tilejson.js"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
"//json.js",
|
"//json.js",
|
||||||
"../externs/bingmaps.js",
|
"../externs/bingmaps.js",
|
||||||
"../externs/geojson.js",
|
"../externs/geojson.js",
|
||||||
|
"../externs/oli.js",
|
||||||
"../externs/proj4js.js",
|
"../externs/proj4js.js",
|
||||||
"../externs/tilejson.js"
|
"../externs/tilejson.js"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
"../build/src/external/externs/types.js",
|
"../build/src/external/externs/types.js",
|
||||||
"../externs/bingmaps.js",
|
"../externs/bingmaps.js",
|
||||||
"../externs/geojson.js",
|
"../externs/geojson.js",
|
||||||
|
"../externs/oli.js",
|
||||||
"../externs/proj4js.js",
|
"../externs/proj4js.js",
|
||||||
"../externs/tilejson.js"
|
"../externs/tilejson.js"
|
||||||
],
|
],
|
||||||
|
|||||||
57
css/ol.css
57
css/ol.css
@@ -1,21 +1,27 @@
|
|||||||
.ol-attribution {
|
.ol-attribution {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
font-size: 10px;
|
|
||||||
text-align: right;
|
text-align: right;
|
||||||
color: #eeeeee;
|
color: #eeeeee;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
background: rgba(0,60,136,0.3);
|
background: rgba(0,60,136,0.3);
|
||||||
font-family: 'Lucida Grande',Verdana,Geneva,Lucida,Arial,Helvetica,sans-serif;
|
font-family: 'Lucida Grande',Verdana,Geneva,Lucida,Arial,Helvetica,sans-serif;
|
||||||
padding: 2px 4px;
|
padding: 6px;
|
||||||
}
|
}
|
||||||
.ol-attribution a {
|
.ol-attribution a {
|
||||||
color: white;
|
color: white;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
.ol-attribution ul {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
font-size: 10px;
|
||||||
|
line-height: 12px;
|
||||||
|
}
|
||||||
.ol-attribution li {
|
.ol-attribution li {
|
||||||
display: inline;
|
display: inline;
|
||||||
list-style: none;
|
list-style: none;
|
||||||
|
line-height: inherit;
|
||||||
}
|
}
|
||||||
.ol-attribution li:not(:last-child):after {
|
.ol-attribution li:not(:last-child):after {
|
||||||
content: "\2003";
|
content: "\2003";
|
||||||
@@ -81,6 +87,13 @@ a.ol-full-screen-true:after {
|
|||||||
display: inline;
|
display: inline;
|
||||||
list-style: none;
|
list-style: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ol-mouse-position {
|
||||||
|
top: 8px;
|
||||||
|
right: 8px;
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
.ol-scale-line {
|
.ol-scale-line {
|
||||||
background: rgba(0,60,136,0.3);
|
background: rgba(0,60,136,0.3);
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
@@ -189,3 +202,43 @@ a.ol-full-screen-true:after {
|
|||||||
height: 20px;
|
height: 20px;
|
||||||
width: 24px;
|
width: 24px;
|
||||||
}
|
}
|
||||||
|
.ol-zoom-extent {
|
||||||
|
position: absolute;
|
||||||
|
background: rgba(255,255,255,0.4);
|
||||||
|
border-radius: 4px;
|
||||||
|
left: 8px;
|
||||||
|
padding: 2px;
|
||||||
|
top: 65px;
|
||||||
|
}
|
||||||
|
@media print {
|
||||||
|
.ol-zoom-extent {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.ol-zoom-extent a {
|
||||||
|
display: block;
|
||||||
|
margin: 1px;
|
||||||
|
padding: 0;
|
||||||
|
color: white;
|
||||||
|
font-size: 16px;
|
||||||
|
font-family: 'Lucida Grande',Verdana,Geneva,Lucida,Arial,Helvetica,sans-serif;
|
||||||
|
font-weight: bold;
|
||||||
|
text-decoration: none;
|
||||||
|
text-align: center;
|
||||||
|
height: 22px;
|
||||||
|
width: 22px;
|
||||||
|
background-color: rgba(0, 60, 136, 0.5);
|
||||||
|
border-radius: 2px;
|
||||||
|
}
|
||||||
|
.ol-touch .ol-zoom-extent a {
|
||||||
|
font-size: 20px;
|
||||||
|
height: 30px;
|
||||||
|
width: 30px;
|
||||||
|
line-height: 26px;
|
||||||
|
}
|
||||||
|
.ol-zoom-extent a:hover {
|
||||||
|
background-color: rgba(0, 60, 136, 0.7);
|
||||||
|
}
|
||||||
|
.ol-zoom-extent a:after {
|
||||||
|
content: "E";
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
Finding your way round
|
Finding your way around
|
||||||
----------------------
|
-----------------------
|
||||||
See the class list to the right and especially take a look at {@link ol.Map} and {@link ol.layer.Layer} because those are the central objects.
|
See the class list to the right and especially take a look at {@link ol.Map} and {@link ol.layer.Layer} because those are the central objects.
|
||||||
|
|
||||||
In general every use of OpenLayers starts by initializing a map, then adding the required layers. Controls and interactions can be added to change the behavior of the map.
|
In general every use of OpenLayers starts by initializing a map, then adding the required layers. Controls and interactions can be added to change the behavior of the map.
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
@@ -30,22 +31,27 @@
|
|||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="span12">
|
<div class="span12">
|
||||||
<div id="map" class="map"></div>
|
<div id="map" class="map"></div>
|
||||||
<button id="rotate-left"><i class="icon-arrow-left"></i></button>
|
|
||||||
<button>Rotate</button>
|
|
||||||
<button id="rotate-right"><i class="icon-arrow-right"></i></button>
|
|
||||||
</div>
|
</div>
|
||||||
<button id="pan-to-london">Pan to London</button>
|
</div>
|
||||||
<button id="elastic-to-moscow">Elastic to Moscow</button>
|
|
||||||
<button id="bounce-to-istanbul">Bounce to Istanbul</button>
|
<div class="row-fluid">
|
||||||
<button id="spin-to-rome">Spin to Rome</button>
|
<div class="span12">
|
||||||
<button id="fly-to-bern">Fly to Bern</button>
|
<button id="rotate-left"><i class="icon-arrow-left"></i></button>
|
||||||
|
<button id="rotate-right"><i class="icon-arrow-right"></i></button>
|
||||||
|
<button id="pan-to-london">Pan to London</button>
|
||||||
|
<button id="elastic-to-moscow">Elastic to Moscow</button>
|
||||||
|
<button id="bounce-to-istanbul">Bounce to Istanbul</button>
|
||||||
|
<button id="spin-to-rome">Spin to Rome</button>
|
||||||
|
<button id="fly-to-bern">Fly to Bern</button>
|
||||||
|
<button id="spiral-to-madrid">Spiral to Madrid</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
|
|
||||||
<div class="span4">
|
<div class="span12">
|
||||||
<h4 id="title">Animation example</h4>
|
<h4 id="title">Animation example</h4>
|
||||||
<p id="shortdesc">Example animations.</p>
|
<p id="shortdesc">Demonstrates animated pan, zoom, and rotation.</p>
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
<p>See the <a href="animation.js" target="_blank">animation.js source</a> to see how this is done.</p>
|
<p>See the <a href="animation.js" target="_blank">animation.js source</a> to see how this is done.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,20 +4,16 @@ goog.require('ol.View2D');
|
|||||||
goog.require('ol.animation');
|
goog.require('ol.animation');
|
||||||
goog.require('ol.easing');
|
goog.require('ol.easing');
|
||||||
goog.require('ol.layer.TileLayer');
|
goog.require('ol.layer.TileLayer');
|
||||||
goog.require('ol.projection');
|
goog.require('ol.proj');
|
||||||
goog.require('ol.source.OSM');
|
goog.require('ol.source.OSM');
|
||||||
|
|
||||||
|
|
||||||
var london = ol.projection.transform(
|
var london = ol.proj.transform([-0.12755, 51.507222], 'EPSG:4326', 'EPSG:3857');
|
||||||
[-0.12755, 51.507222], 'EPSG:4326', 'EPSG:3857');
|
var moscow = ol.proj.transform([37.6178, 55.7517], 'EPSG:4326', 'EPSG:3857');
|
||||||
var moscow = ol.projection.transform(
|
var istanbul = ol.proj.transform([28.9744, 41.0128], 'EPSG:4326', 'EPSG:3857');
|
||||||
[37.6178, 55.7517], 'EPSG:4326', 'EPSG:3857');
|
var rome = ol.proj.transform([12.5, 41.9], 'EPSG:4326', 'EPSG:3857');
|
||||||
var istanbul = ol.projection.transform(
|
var bern = ol.proj.transform([7.4458, 46.95], 'EPSG:4326', 'EPSG:3857');
|
||||||
[28.9744, 41.0128], 'EPSG:4326', 'EPSG:3857');
|
var madrid = ol.proj.transform([-3.683333, 40.4], 'EPSG:4326', 'EPSG:3857');
|
||||||
var rome = ol.projection.transform(
|
|
||||||
[12.5, 41.9], 'EPSG:4326', 'EPSG:3857');
|
|
||||||
var bern = ol.projection.transform(
|
|
||||||
[7.4458, 46.95], 'EPSG:4326', 'EPSG:3857');
|
|
||||||
|
|
||||||
var view = new ol.View2D({
|
var view = new ol.View2D({
|
||||||
// the view's initial state
|
// the view's initial state
|
||||||
@@ -37,7 +33,6 @@ var map = new ol.Map({
|
|||||||
view: view
|
view: view
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
var rotateLeft = document.getElementById('rotate-left');
|
var rotateLeft = document.getElementById('rotate-left');
|
||||||
rotateLeft.addEventListener('click', function() {
|
rotateLeft.addEventListener('click', function() {
|
||||||
var rotateLeft = ol.animation.rotate({
|
var rotateLeft = ol.animation.rotate({
|
||||||
@@ -123,3 +118,26 @@ flyToBern.addEventListener('click', function() {
|
|||||||
map.addPreRenderFunctions([pan, bounce]);
|
map.addPreRenderFunctions([pan, bounce]);
|
||||||
view.setCenter(bern);
|
view.setCenter(bern);
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
|
var spiralToMadrid = document.getElementById('spiral-to-madrid');
|
||||||
|
spiralToMadrid.addEventListener('click', function() {
|
||||||
|
var duration = 2000;
|
||||||
|
var start = +new Date();
|
||||||
|
var pan = ol.animation.pan({
|
||||||
|
duration: duration,
|
||||||
|
source: view.getCenter(),
|
||||||
|
start: start
|
||||||
|
});
|
||||||
|
var bounce = ol.animation.bounce({
|
||||||
|
duration: duration,
|
||||||
|
resolution: 2 * view.getResolution(),
|
||||||
|
start: start
|
||||||
|
});
|
||||||
|
var rotate = ol.animation.rotate({
|
||||||
|
duration: duration,
|
||||||
|
rotation: -4 * Math.PI,
|
||||||
|
start: start
|
||||||
|
});
|
||||||
|
map.addPreRenderFunctions([pan, bounce, rotate]);
|
||||||
|
view.setCenter(madrid);
|
||||||
|
}, false);
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
@@ -37,7 +38,7 @@
|
|||||||
|
|
||||||
<div class="span4">
|
<div class="span4">
|
||||||
<h4 id="title">Bind HTML input example</h4>
|
<h4 id="title">Bind HTML input example</h4>
|
||||||
<p id="shortdesc">Bind an HTML input to an ol object.</p>
|
<p id="shortdesc">Demonstrates two-way binding of HTML input elements to OpenLayers objects.</p>
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
<p>See the <a href="bind-input.js" target="_blank">bind-input.js source</a> to see how this is done.</p>
|
<p>See the <a href="bind-input.js" target="_blank">bind-input.js source</a> to see how this is done.</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -71,7 +72,8 @@
|
|||||||
<legend>View</legend>
|
<legend>View</legend>
|
||||||
<label>rotation</label>
|
<label>rotation</label>
|
||||||
<input id="rotation" type="range" min="-3.141592653589793" max="3.141592653589793" step="0.01"/>
|
<input id="rotation" type="range" min="-3.141592653589793" max="3.141592653589793" step="0.01"/>
|
||||||
</fieldset>
|
<label>resolution</label>
|
||||||
|
<input id="resolution" type="number" min="0" step="250"/>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -39,3 +39,6 @@ brightness.bindTo('value', layer, 'brightness');
|
|||||||
|
|
||||||
var rotation = new ol.dom.Input(document.getElementById('rotation'));
|
var rotation = new ol.dom.Input(document.getElementById('rotation'));
|
||||||
rotation.bindTo('value', map.getView(), 'rotation');
|
rotation.bindTo('value', map.getView(), 'rotation');
|
||||||
|
|
||||||
|
var resolution = new ol.dom.Input(document.getElementById('resolution'));
|
||||||
|
resolution.bindTo('value', map.getView(), 'resolution');
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
@@ -41,7 +42,7 @@
|
|||||||
|
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
|
|
||||||
<div class="span4">
|
<div class="span12">
|
||||||
<h4 id="title">Bing Maps example</h4>
|
<h4 id="title">Bing Maps example</h4>
|
||||||
<p id="shortdesc">Example of a Bing Maps layer.</p>
|
<p id="shortdesc">Example of a Bing Maps layer.</p>
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ goog.require('ol.Map');
|
|||||||
goog.require('ol.RendererHints');
|
goog.require('ol.RendererHints');
|
||||||
goog.require('ol.View2D');
|
goog.require('ol.View2D');
|
||||||
goog.require('ol.layer.TileLayer');
|
goog.require('ol.layer.TileLayer');
|
||||||
goog.require('ol.projection');
|
goog.require('ol.proj');
|
||||||
goog.require('ol.source.BingMaps');
|
goog.require('ol.source.BingMaps');
|
||||||
|
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@ for (var i = 0; i < styles.length; ++i) {
|
|||||||
visible: false,
|
visible: false,
|
||||||
preload: Infinity,
|
preload: Infinity,
|
||||||
source: new ol.source.BingMaps({
|
source: new ol.source.BingMaps({
|
||||||
key: 'AlQLZ0-5yk301_ESrmNLma3LYxEKNSg7w-e_knuRfyYFtld-UFvXVs38NOulku3Q',
|
key: 'Ar33pRUvQOdESG8m_T15MUmNz__E1twPo42bFx9jvdDePhX0PNgAcEm44OVTS7tt',
|
||||||
style: styles[i]
|
style: styles[i]
|
||||||
})
|
})
|
||||||
}));
|
}));
|
||||||
@@ -23,7 +23,7 @@ var map = new ol.Map({
|
|||||||
renderers: ol.RendererHints.createFromQueryData(),
|
renderers: ol.RendererHints.createFromQueryData(),
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View2D({
|
view: new ol.View2D({
|
||||||
center: ol.projection.transform([-123.1, 49.25], 'EPSG:4326', 'EPSG:3857'),
|
center: ol.proj.transform([-123.1, 49.25], 'EPSG:4326', 'EPSG:3857'),
|
||||||
zoom: 8
|
zoom: 8
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4,10 +4,19 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
<title>Brightness/contrast example</title>
|
<title>Brightness/contrast example</title>
|
||||||
|
<style>
|
||||||
|
#reset-brightness {
|
||||||
|
min-width: 138px;
|
||||||
|
}
|
||||||
|
#reset-contrast {
|
||||||
|
min-width: 120px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
@@ -45,7 +54,7 @@
|
|||||||
|
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
|
|
||||||
<div class="span4">
|
<div class="span12">
|
||||||
<h4 id="title">Brightness/contrast example</h4>
|
<h4 id="title">Brightness/contrast example</h4>
|
||||||
<p id="shortdesc">Example of brightness/contrast control on the client (WebGL only).</p>
|
<p id="shortdesc">Example of brightness/contrast control on the client (WebGL only).</p>
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
|
|||||||
@@ -20,27 +20,46 @@ var map = new ol.Map({
|
|||||||
});
|
});
|
||||||
|
|
||||||
var increaseBrightness = document.getElementById('increase-brightness');
|
var increaseBrightness = document.getElementById('increase-brightness');
|
||||||
increaseBrightness.addEventListener('click', function() {
|
|
||||||
layer.setBrightness(layer.getBrightness() + 0.125);
|
|
||||||
}, false);
|
|
||||||
var resetBrightness = document.getElementById('reset-brightness');
|
var resetBrightness = document.getElementById('reset-brightness');
|
||||||
|
var decreaseBrightness = document.getElementById('decrease-brightness');
|
||||||
|
|
||||||
|
function setResetBrightnessButtonHTML() {
|
||||||
|
resetBrightness.innerHTML = 'Brightness (' +
|
||||||
|
layer.getBrightness().toFixed(3) + ')';
|
||||||
|
}
|
||||||
|
setResetBrightnessButtonHTML();
|
||||||
|
|
||||||
|
increaseBrightness.addEventListener('click', function() {
|
||||||
|
layer.setBrightness(Math.min(layer.getBrightness() + 0.125, 1));
|
||||||
|
setResetBrightnessButtonHTML();
|
||||||
|
}, false);
|
||||||
resetBrightness.addEventListener('click', function() {
|
resetBrightness.addEventListener('click', function() {
|
||||||
layer.setBrightness(0);
|
layer.setBrightness(0);
|
||||||
|
setResetBrightnessButtonHTML();
|
||||||
}, false);
|
}, false);
|
||||||
var decreaseBrightness = document.getElementById('decrease-brightness');
|
|
||||||
decreaseBrightness.addEventListener('click', function() {
|
decreaseBrightness.addEventListener('click', function() {
|
||||||
layer.setBrightness(layer.getBrightness() - 0.125);
|
layer.setBrightness(Math.max(layer.getBrightness() - 0.125, -1));
|
||||||
|
setResetBrightnessButtonHTML();
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
var increaseContrast = document.getElementById('increase-contrast');
|
var increaseContrast = document.getElementById('increase-contrast');
|
||||||
|
var resetContrast = document.getElementById('reset-contrast');
|
||||||
|
var decreaseContrast = document.getElementById('decrease-contrast');
|
||||||
|
|
||||||
|
function setResetContrastButtonHTML() {
|
||||||
|
resetContrast.innerHTML = 'Contrast (' + layer.getContrast().toFixed(3) + ')';
|
||||||
|
}
|
||||||
|
setResetContrastButtonHTML();
|
||||||
|
|
||||||
increaseContrast.addEventListener('click', function() {
|
increaseContrast.addEventListener('click', function() {
|
||||||
layer.setContrast(layer.getContrast() + 0.125);
|
layer.setContrast(layer.getContrast() + 0.125);
|
||||||
|
setResetContrastButtonHTML();
|
||||||
}, false);
|
}, false);
|
||||||
var resetContrast = document.getElementById('reset-contrast');
|
|
||||||
resetContrast.addEventListener('click', function() {
|
resetContrast.addEventListener('click', function() {
|
||||||
layer.setContrast(1);
|
layer.setContrast(1);
|
||||||
|
setResetContrastButtonHTML();
|
||||||
}, false);
|
}, false);
|
||||||
var decreaseContrast = document.getElementById('decrease-contrast');
|
|
||||||
decreaseContrast.addEventListener('click', function() {
|
decreaseContrast.addEventListener('click', function() {
|
||||||
layer.setContrast(layer.getContrast() - 0.125);
|
layer.setContrast(Math.max(layer.getContrast() - 0.125, 0));
|
||||||
|
setResetContrastButtonHTML();
|
||||||
}, false);
|
}, false);
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
@@ -35,10 +36,11 @@
|
|||||||
|
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
|
|
||||||
<div class="span4">
|
<div class="span12">
|
||||||
<h4 id="title">Canvas tiles example</h4>
|
<h4 id="title">Canvas tiles example</h4>
|
||||||
<p id="shortdesc">The black grid tiles are generated on the client with an HTML5 canvas. Note that the tile coordinates are ol3 normalized tile coordinates (origin bottom left), not OSM tile coordinates (origin top left).</p>
|
<p id="shortdesc">Renders tiles with coordinates for debugging.</p>
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
|
<p>The black grid tiles are generated on the client with an HTML5 canvas. Note that the tile coordinates are ol3 normalized tile coordinates (origin bottom left), not OSM tile coordinates (origin top left).</p>
|
||||||
<p>See the <a href="canvas-tiles.js" target="_blank">canvas-tiles.js source</a> to see how this is done.</p>
|
<p>See the <a href="canvas-tiles.js" target="_blank">canvas-tiles.js source</a> to see how this is done.</p>
|
||||||
</div>
|
</div>
|
||||||
<div id="tags">layers, openstreetmap, canvas</div>
|
<div id="tags">layers, openstreetmap, canvas</div>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ goog.require('ol.Map');
|
|||||||
goog.require('ol.RendererHints');
|
goog.require('ol.RendererHints');
|
||||||
goog.require('ol.View2D');
|
goog.require('ol.View2D');
|
||||||
goog.require('ol.layer.TileLayer');
|
goog.require('ol.layer.TileLayer');
|
||||||
goog.require('ol.projection');
|
goog.require('ol.proj');
|
||||||
goog.require('ol.source.DebugTileSource');
|
goog.require('ol.source.DebugTileSource');
|
||||||
goog.require('ol.source.OSM');
|
goog.require('ol.source.OSM');
|
||||||
goog.require('ol.tilegrid.XYZ');
|
goog.require('ol.tilegrid.XYZ');
|
||||||
@@ -25,7 +25,7 @@ var map = new ol.Map({
|
|||||||
renderers: ol.RendererHints.createFromQueryData(),
|
renderers: ol.RendererHints.createFromQueryData(),
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View2D({
|
view: new ol.View2D({
|
||||||
center: ol.projection.transform(
|
center: ol.proj.transform(
|
||||||
[-0.1275, 51.507222], 'EPSG:4326', 'EPSG:3857'),
|
[-0.1275, 51.507222], 'EPSG:4326', 'EPSG:3857'),
|
||||||
zoom: 10
|
zoom: 10
|
||||||
})
|
})
|
||||||
|
|||||||
87
examples/custom-controls.html
Normal file
87
examples/custom-controls.html
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
|
<style type="text/css">
|
||||||
|
.rotate-north {
|
||||||
|
position: absolute;
|
||||||
|
top: 65px;
|
||||||
|
left: 8px;
|
||||||
|
background: rgba(255,255,255,0.4);
|
||||||
|
border-radius: 4px;
|
||||||
|
padding: 2px;
|
||||||
|
}
|
||||||
|
.rotate-north a {
|
||||||
|
display: block;
|
||||||
|
color: white;
|
||||||
|
font-size: 16px;
|
||||||
|
font-family: 'Lucida Grande',Verdana,Geneva,Lucida,Arial,Helvetica,sans-serif;
|
||||||
|
font-weight: bold;
|
||||||
|
margin: 1px;
|
||||||
|
text-decoration: none;
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 2px;
|
||||||
|
height: 22px;
|
||||||
|
width: 22px;
|
||||||
|
background: rgba(0,60,136,0.5);
|
||||||
|
}
|
||||||
|
.rotate-north a:hover {
|
||||||
|
background: rgba(0,60,136,0.7);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<title>ol3 custom controls example</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||||
|
<div class="navbar-inner">
|
||||||
|
<div class="container">
|
||||||
|
<a class="brand" href="./">OpenLayers 3 Examples</a>
|
||||||
|
<ul class="nav pull-right">
|
||||||
|
<li><iframe class="github-watch-button" src="http://ghbtns.com/github-btn.html?user=openlayers&repo=ol3&type=watch&count=true"
|
||||||
|
allowtransparency="true" frameborder="0" scrolling="0" height="20" width="90"></iframe></li>
|
||||||
|
<li><a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-hashtags="openlayers"> </a></li>
|
||||||
|
<li><div class="g-plusone-wrapper"><div class="g-plusone" data-size="medium" data-annotation="none"></div></div></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="container-fluid">
|
||||||
|
|
||||||
|
<div class="row-fluid">
|
||||||
|
<div class="span12">
|
||||||
|
<div id="map" class="map"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row-fluid">
|
||||||
|
<div class="span12">
|
||||||
|
<h4 id="title">Custom controls</h4>
|
||||||
|
<p id="shortdesc">This example shows how to create custom controls.</p>
|
||||||
|
<div id="docs">
|
||||||
|
<p>
|
||||||
|
This example creates a "rotate to north" button.
|
||||||
|
See the <a href="custom-controls.js" target="_blank">custom-controls.js
|
||||||
|
source</a> to see how this is done.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div id="tags">
|
||||||
|
custom, control
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="loader.js?id=custom-controls" type="text/javascript"></script>
|
||||||
|
<script src="../resources/social-links.js" type="text/javascript"></script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
82
examples/custom-controls.js
Normal file
82
examples/custom-controls.js
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
goog.require('ol');
|
||||||
|
goog.require('ol.Map');
|
||||||
|
goog.require('ol.RendererHints');
|
||||||
|
goog.require('ol.View2D');
|
||||||
|
goog.require('ol.control.Control');
|
||||||
|
goog.require('ol.control.defaults');
|
||||||
|
goog.require('ol.layer.TileLayer');
|
||||||
|
goog.require('ol.source.OSM');
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define a namespace for the application.
|
||||||
|
*/
|
||||||
|
window.app = {};
|
||||||
|
var app = window.app;
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// Define rotate to north control.
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @constructor
|
||||||
|
* @extends {ol.control.Control}
|
||||||
|
* @param {Object=} opt_options Control options.
|
||||||
|
*/
|
||||||
|
app.RotateNorthControl = function(opt_options) {
|
||||||
|
|
||||||
|
var options = opt_options || {};
|
||||||
|
|
||||||
|
var anchor = document.createElement('a');
|
||||||
|
anchor.href = '#rotate-north';
|
||||||
|
anchor.innerHTML = 'N';
|
||||||
|
|
||||||
|
var this_ = this;
|
||||||
|
var handleRotateNorth = function(e) {
|
||||||
|
// prevent #rotate-north anchor from getting appended to the url
|
||||||
|
e.preventDefault();
|
||||||
|
this_.getMap().getView().getView2D().setRotation(0);
|
||||||
|
};
|
||||||
|
|
||||||
|
anchor.addEventListener('click', handleRotateNorth, false);
|
||||||
|
anchor.addEventListener('touchstart', handleRotateNorth, false);
|
||||||
|
|
||||||
|
var element = document.createElement('div');
|
||||||
|
element.className = 'rotate-north ol-unselectable';
|
||||||
|
element.appendChild(anchor);
|
||||||
|
|
||||||
|
ol.control.Control.call(this, {
|
||||||
|
element: element,
|
||||||
|
map: options.map,
|
||||||
|
target: options.target
|
||||||
|
});
|
||||||
|
|
||||||
|
};
|
||||||
|
ol.inherits(app.RotateNorthControl, ol.control.Control);
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// Create map, giving it a rotate to north control.
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
var map = new ol.Map({
|
||||||
|
controls: ol.control.defaults({}, [
|
||||||
|
new app.RotateNorthControl()
|
||||||
|
]),
|
||||||
|
layers: [
|
||||||
|
new ol.layer.TileLayer({
|
||||||
|
source: new ol.source.OSM()
|
||||||
|
})
|
||||||
|
],
|
||||||
|
renderers: ol.RendererHints.createFromQueryData(),
|
||||||
|
target: 'map',
|
||||||
|
view: new ol.View2D({
|
||||||
|
center: [0, 0],
|
||||||
|
zoom: 2,
|
||||||
|
rotation: 1
|
||||||
|
})
|
||||||
|
});
|
||||||
1
examples/data/IGNWMTSCapabilities.xml
Normal file
1
examples/data/IGNWMTSCapabilities.xml
Normal file
File diff suppressed because one or more lines are too long
2
examples/data/gml/topp-states-wfs.xml
Normal file
2
examples/data/gml/topp-states-wfs.xml
Normal file
File diff suppressed because one or more lines are too long
1073
examples/data/gpx/yahoo.xml
Normal file
1073
examples/data/gpx/yahoo.xml
Normal file
File diff suppressed because it is too large
Load Diff
1608
examples/data/kml/timezones.kml
Normal file
1608
examples/data/kml/timezones.kml
Normal file
File diff suppressed because one or more lines are too long
63
examples/device-orientation.html
Normal file
63
examples/device-orientation.html
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
|
<title>Device-Orientation example</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||||
|
<div class="navbar-inner">
|
||||||
|
<div class="container">
|
||||||
|
<a class="brand" href="./">OpenLayers 3 Examples</a>
|
||||||
|
<ul class="nav pull-right">
|
||||||
|
<li><iframe class="github-watch-button" src="http://ghbtns.com/github-btn.html?user=openlayers&repo=ol3&type=watch&count=true"
|
||||||
|
allowtransparency="true" frameborder="0" scrolling="0" height="20" width="90"></iframe></li>
|
||||||
|
<li><a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-hashtags="openlayers"> </a></li>
|
||||||
|
<li><div class="g-plusone-wrapper"><div class="g-plusone" data-size="medium" data-annotation="none"></div></div></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="container-fluid">
|
||||||
|
|
||||||
|
<div class="row-fluid">
|
||||||
|
<div class="span12">
|
||||||
|
<div id="map" class="map"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row-fluid">
|
||||||
|
|
||||||
|
<div class="span12">
|
||||||
|
<h4 id="title">Device orientation example</h4>
|
||||||
|
<label class="checkbox" for="track">
|
||||||
|
<input id="track" type="checkbox"/>track changes
|
||||||
|
</label>
|
||||||
|
<p>α : <code id="alpha"></code></p>
|
||||||
|
<p>β : <code id="beta"></code></p>
|
||||||
|
<p>γ : <code id="gamma"></code></p>
|
||||||
|
<p>heading : <code id="heading"></code></p>
|
||||||
|
<p id="shortdesc">Listen to DeviceOrientation events</p>
|
||||||
|
<div id="docs">
|
||||||
|
<p>See the <a href="device-orientation.js" target="_blank">device-orientation.js source</a> to see how this is done.</p>
|
||||||
|
</div>
|
||||||
|
<div id="tags">orientation, openstreetmap</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="loader.js?id=device-orientation" type="text/javascript"></script>
|
||||||
|
<script src="../resources/social-links.js" type="text/javascript"></script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
46
examples/device-orientation.js
Normal file
46
examples/device-orientation.js
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
goog.require('ol.DeviceOrientation');
|
||||||
|
goog.require('ol.Map');
|
||||||
|
goog.require('ol.RendererHints');
|
||||||
|
goog.require('ol.View2D');
|
||||||
|
goog.require('ol.dom.Input');
|
||||||
|
goog.require('ol.layer.TileLayer');
|
||||||
|
goog.require('ol.source.OSM');
|
||||||
|
|
||||||
|
var map = new ol.Map({
|
||||||
|
layers: [
|
||||||
|
new ol.layer.TileLayer({
|
||||||
|
source: new ol.source.OSM()
|
||||||
|
})
|
||||||
|
],
|
||||||
|
renderers: ol.RendererHints.createFromQueryData(),
|
||||||
|
target: 'map',
|
||||||
|
view: new ol.View2D({
|
||||||
|
center: [0, 0],
|
||||||
|
zoom: 2
|
||||||
|
})
|
||||||
|
});
|
||||||
|
var view = map.getView();
|
||||||
|
|
||||||
|
var deviceOrientation = new ol.DeviceOrientation();
|
||||||
|
var track = new ol.dom.Input(document.getElementById('track'));
|
||||||
|
track.bindTo('checked', deviceOrientation, 'tracking');
|
||||||
|
|
||||||
|
deviceOrientation.on('change', function(event) {
|
||||||
|
document.getElementById('alpha').innerHTML = event.target.getAlpha();
|
||||||
|
document.getElementById('beta').innerHTML = event.target.getBeta();
|
||||||
|
document.getElementById('gamma').innerHTML = event.target.getGamma();
|
||||||
|
document.getElementById('heading').innerHTML = event.target.getHeading();
|
||||||
|
});
|
||||||
|
|
||||||
|
// tilt the map
|
||||||
|
deviceOrientation.on(['change:beta', 'change:gamma'], function(event) {
|
||||||
|
var center = view.getCenter();
|
||||||
|
var resolution = view.getResolution();
|
||||||
|
var beta = event.target.getBeta() || 0;
|
||||||
|
var gamma = event.target.getGamma() || 0;
|
||||||
|
|
||||||
|
center[0] -= resolution * gamma * 25;
|
||||||
|
center[1] += resolution * beta * 25;
|
||||||
|
|
||||||
|
view.setCenter(center);
|
||||||
|
});
|
||||||
57
examples/drag-rotate-and-zoom.html
Normal file
57
examples/drag-rotate-and-zoom.html
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
|
<title>Drag rotate and zoom example</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||||
|
<div class="navbar-inner">
|
||||||
|
<div class="container">
|
||||||
|
<a class="brand" href="./">OpenLayers 3 Examples</a>
|
||||||
|
<ul class="nav pull-right">
|
||||||
|
<li><iframe class="github-watch-button" src="http://ghbtns.com/github-btn.html?user=openlayers&repo=ol3&type=watch&count=true"
|
||||||
|
allowtransparency="true" frameborder="0" scrolling="0" height="20" width="90"></iframe></li>
|
||||||
|
<li><a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-hashtags="openlayers"> </a></li>
|
||||||
|
<li><div class="g-plusone-wrapper"><div class="g-plusone" data-size="medium" data-annotation="none"></div></div></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="container-fluid">
|
||||||
|
|
||||||
|
<div class="row-fluid">
|
||||||
|
<div class="span12">
|
||||||
|
<div id="map" class="map"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row-fluid">
|
||||||
|
|
||||||
|
<div class="span12">
|
||||||
|
<h4 id="title">Drag rotate and zoom example</h4>
|
||||||
|
<p id="shortdesc">A single interaction to drag, rotate, and zoom.</p>
|
||||||
|
<div id="docs">
|
||||||
|
<p><code>Shift</code> + Drag to rotate and zoom the map around its center.</p>
|
||||||
|
<p>See the <a href="drag-rotate-and-zoom.js" target="_blank">drag-rotate-and-zoom.js source</a> to see how this is done.</p>
|
||||||
|
</div>
|
||||||
|
<div id="tags">drag, rotate, zoom, interaction</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="loader.js?id=drag-rotate-and-zoom" type="text/javascript"></script>
|
||||||
|
<script src="../resources/social-links.js" type="text/javascript"></script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
25
examples/drag-rotate-and-zoom.js
Normal file
25
examples/drag-rotate-and-zoom.js
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
goog.require('ol.Map');
|
||||||
|
goog.require('ol.RendererHints');
|
||||||
|
goog.require('ol.View2D');
|
||||||
|
goog.require('ol.interaction.DragRotateAndZoom');
|
||||||
|
goog.require('ol.interaction.defaults');
|
||||||
|
goog.require('ol.layer.TileLayer');
|
||||||
|
goog.require('ol.source.MapQuestOpenAerial');
|
||||||
|
|
||||||
|
|
||||||
|
var map = new ol.Map({
|
||||||
|
interactions: ol.interaction.defaults({}, [
|
||||||
|
new ol.interaction.DragRotateAndZoom()
|
||||||
|
]),
|
||||||
|
layers: [
|
||||||
|
new ol.layer.TileLayer({
|
||||||
|
source: new ol.source.MapQuestOpenAerial()
|
||||||
|
})
|
||||||
|
],
|
||||||
|
renderers: ol.RendererHints.createFromQueryData(),
|
||||||
|
target: 'map',
|
||||||
|
view: new ol.View2D({
|
||||||
|
center: [0, 0],
|
||||||
|
zoom: 2
|
||||||
|
})
|
||||||
|
});
|
||||||
@@ -4,6 +4,7 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
@@ -35,7 +36,7 @@
|
|||||||
|
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
|
|
||||||
<div class="span4">
|
<div class="span12">
|
||||||
<h4 id="title">EPSG:4326 example</h4>
|
<h4 id="title">EPSG:4326 example</h4>
|
||||||
<p id="shortdesc">Example of a map in EPSG:4326.</p>
|
<p id="shortdesc">Example of a map in EPSG:4326.</p>
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
@@ -37,7 +38,7 @@
|
|||||||
|
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
|
|
||||||
<div class="span4">
|
<div class="span12">
|
||||||
<h4 id="title">Export map example</h4>
|
<h4 id="title">Export map example</h4>
|
||||||
<p id="shortdesc">Example of exporting a map as a JPEG or PNG image.</p>
|
<p id="shortdesc">Example of exporting a map as a JPEG or PNG image.</p>
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
|
|||||||
69
examples/full-screen-drag-rotate-and-zoom.html
Normal file
69
examples/full-screen-drag-rotate-and-zoom.html
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
|
<style>
|
||||||
|
.map:-moz-full-screen {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.map:-webkit-full-screen {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.map:full-screen {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<title>Full screen drag rotate and zoom example</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||||
|
<div class="navbar-inner">
|
||||||
|
<div class="container">
|
||||||
|
<a class="brand" href="./">OpenLayers 3 Examples</a>
|
||||||
|
<ul class="nav pull-right">
|
||||||
|
<li><iframe class="github-watch-button" src="http://ghbtns.com/github-btn.html?user=openlayers&repo=ol3&type=watch&count=true"
|
||||||
|
allowtransparency="true" frameborder="0" scrolling="0" height="20" width="90"></iframe></li>
|
||||||
|
<li><a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-hashtags="openlayers"> </a></li>
|
||||||
|
<li><div class="g-plusone-wrapper"><div class="g-plusone" data-size="medium" data-annotation="none"></div></div></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="container-fluid">
|
||||||
|
|
||||||
|
<div class="row-fluid">
|
||||||
|
<div class="span12">
|
||||||
|
<div id="map" class="map"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row-fluid">
|
||||||
|
|
||||||
|
<div class="span12">
|
||||||
|
<h4 id="title">Full screen drag rotate and zoom example</h4>
|
||||||
|
<p id="shortdesc">Example of drag rotate and zoom control with full screen effect.</p>
|
||||||
|
<div id="docs">
|
||||||
|
<p>Hold down <code>Shift</code> + drag to rotate and zoom. Click the button in the top right corner to go full screen. Then do the <code>Shift</code> + drag thing again.</p>
|
||||||
|
<p>If there is no button on the map, your browser does not support the <a href="http://caniuse.com/#feat=fullscreen">Full Screen API</a>.</p>
|
||||||
|
<p>See the <a href="full-screen-drag-rotate-and-zoom.js" target="_blank">full-screen-drag-rotate-and-zoom.js source</a> to see how this is done.</p>
|
||||||
|
</div>
|
||||||
|
<div id="tags">full-screen, drag, rotate, zoom, bing, bing-maps</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="loader.js?id=full-screen-drag-rotate-and-zoom" type="text/javascript"></script>
|
||||||
|
<script src="../resources/social-links.js" type="text/javascript"></script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
35
examples/full-screen-drag-rotate-and-zoom.js
Normal file
35
examples/full-screen-drag-rotate-and-zoom.js
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
goog.require('ol.Map');
|
||||||
|
goog.require('ol.RendererHint');
|
||||||
|
goog.require('ol.View2D');
|
||||||
|
goog.require('ol.control.FullScreen');
|
||||||
|
goog.require('ol.control.defaults');
|
||||||
|
goog.require('ol.interaction.DragRotateAndZoom');
|
||||||
|
goog.require('ol.interaction.defaults');
|
||||||
|
goog.require('ol.layer.TileLayer');
|
||||||
|
goog.require('ol.source.BingMaps');
|
||||||
|
|
||||||
|
|
||||||
|
var map = new ol.Map({
|
||||||
|
controls: ol.control.defaults({}, [
|
||||||
|
new ol.control.FullScreen()
|
||||||
|
]),
|
||||||
|
interactions: ol.interaction.defaults({}, [
|
||||||
|
new ol.interaction.DragRotateAndZoom()
|
||||||
|
]),
|
||||||
|
layers: [
|
||||||
|
new ol.layer.TileLayer({
|
||||||
|
source: new ol.source.BingMaps({
|
||||||
|
key: 'Ar33pRUvQOdESG8m_T15MUmNz__E1twPo42bFx9jvdDePhX0PNgAcEm44OVTS7tt',
|
||||||
|
style: 'Aerial'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
],
|
||||||
|
// Use the canvas renderer because it's currently the fastest
|
||||||
|
renderer: ol.RendererHint.CANVAS,
|
||||||
|
target: 'map',
|
||||||
|
view: new ol.View2D({
|
||||||
|
center: [-33519607, 5616436],
|
||||||
|
rotation: -Math.PI / 8,
|
||||||
|
zoom: 8
|
||||||
|
})
|
||||||
|
});
|
||||||
@@ -4,6 +4,7 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
@@ -46,11 +47,12 @@
|
|||||||
|
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
|
|
||||||
<div class="span4">
|
<div class="span12">
|
||||||
<h4 id="title">Full screen control example</h4>
|
<h4 id="title">Full screen control example</h4>
|
||||||
<p id="shortdesc">Example of a full screen control. Click the control in the top right corner to go full screen. Click it again to exit full screen.</p>
|
<p id="shortdesc">Example of a full screen control.</p>
|
||||||
<p>If there is no button on the map, your browser does not support the <a href="http://caniuse.com/#feat=fullscreen">Full Screen API</a>.</p>
|
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
|
<p>Click the control in the top right corner to go full screen. Click it again to exit full screen.</p>
|
||||||
|
<p>If there is no button on the map, your browser does not support the <a href="http://caniuse.com/#feat=fullscreen">Full Screen API</a>.</p>
|
||||||
<p>See the <a href="full-screen.js" target="_blank">full-screen.js source</a> to see how this is done.</p>
|
<p>See the <a href="full-screen.js" target="_blank">full-screen.js source</a> to see how this is done.</p>
|
||||||
</div>
|
</div>
|
||||||
<div id="tags">full-screen, bing, bing-maps</div>
|
<div id="tags">full-screen, bing, bing-maps</div>
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ var map = new ol.Map({
|
|||||||
layers: [
|
layers: [
|
||||||
new ol.layer.TileLayer({
|
new ol.layer.TileLayer({
|
||||||
source: new ol.source.BingMaps({
|
source: new ol.source.BingMaps({
|
||||||
key: 'AlQLZ0-5yk301_ESrmNLma3LYxEKNSg7w-e_knuRfyYFtld-UFvXVs38NOulku3Q',
|
key: 'Ar33pRUvQOdESG8m_T15MUmNz__E1twPo42bFx9jvdDePhX0PNgAcEm44OVTS7tt',
|
||||||
style: 'Aerial'
|
style: 'Aerial'
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
@@ -12,6 +13,9 @@
|
|||||||
font-size: 22px;
|
font-size: 22px;
|
||||||
text-shadow: 2px 2px 3px #013;
|
text-shadow: 2px 2px 3px #013;
|
||||||
}
|
}
|
||||||
|
.tooltip-inner {
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<title>Geolocation example</title>
|
<title>Geolocation example</title>
|
||||||
</head>
|
</head>
|
||||||
@@ -41,17 +45,26 @@
|
|||||||
|
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
|
|
||||||
<div class="span4">
|
<div class="span12">
|
||||||
<h4 id="title">Geolocation example</h4>
|
<h4 id="title">Geolocation example</h4>
|
||||||
|
<label class="checkbox" for="track">
|
||||||
|
<input id="track" type="checkbox"/>track position
|
||||||
|
</label>
|
||||||
|
<p>position accuracy : <code id="accuracy"></code></p>
|
||||||
|
<p>altitude : <code id="altitude"></code></p>
|
||||||
|
<p>altitude accuracy : <code id="altitudeAccuracy"></code></p>
|
||||||
|
<p>heading : <code id="heading"></code></p>
|
||||||
|
<p>speed : <code id="speed"></code></p>
|
||||||
|
|
||||||
<p id="shortdesc">Example of a geolocation map.</p>
|
<p id="shortdesc">Example of a geolocation map.</p>
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
<p>See the <a href="geolocation.js" target="_blank">geolocation.js source</a> to see how this is done.</p>
|
<p>See the <a href="geolocation.js" target="_blank">geolocation.js source</a> to see how this is done.</p>
|
||||||
</div>
|
</div>
|
||||||
<button id="locate"><i class="icon-screenshot"></i> locate</button>
|
|
||||||
<div id="tags">geolocation, openstreetmap</div>
|
<div id="tags">geolocation, openstreetmap</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="span4 pull-right">
|
||||||
</div>
|
<div id="info" class="alert alert-error" style="display: none;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ goog.require('ol.Map');
|
|||||||
goog.require('ol.Overlay');
|
goog.require('ol.Overlay');
|
||||||
goog.require('ol.RendererHints');
|
goog.require('ol.RendererHints');
|
||||||
goog.require('ol.View2D');
|
goog.require('ol.View2D');
|
||||||
|
goog.require('ol.dom.Input');
|
||||||
goog.require('ol.layer.TileLayer');
|
goog.require('ol.layer.TileLayer');
|
||||||
goog.require('ol.source.OSM');
|
goog.require('ol.source.OSM');
|
||||||
|
|
||||||
@@ -24,6 +25,17 @@ var map = new ol.Map({
|
|||||||
var geolocation = new ol.Geolocation();
|
var geolocation = new ol.Geolocation();
|
||||||
geolocation.bindTo('projection', map.getView());
|
geolocation.bindTo('projection', map.getView());
|
||||||
|
|
||||||
|
var track = new ol.dom.Input(document.getElementById('track'));
|
||||||
|
track.bindTo('checked', geolocation, 'tracking');
|
||||||
|
|
||||||
|
geolocation.on('change', function() {
|
||||||
|
$('#accuracy').text(geolocation.getAccuracy() + ' [m]');
|
||||||
|
$('#altitude').text(geolocation.getAltitude() + ' [m]');
|
||||||
|
$('#altitudeAccuracy').text(geolocation.getAltitudeAccuracy() + ' [m]');
|
||||||
|
$('#heading').text(geolocation.getHeading() + ' [rad]');
|
||||||
|
$('#speed').text(geolocation.getSpeed() + ' [m/s]');
|
||||||
|
});
|
||||||
|
|
||||||
var marker = new ol.Overlay({
|
var marker = new ol.Overlay({
|
||||||
map: map,
|
map: map,
|
||||||
element: /** @type {Element} */ ($('<i/>').addClass('icon-flag').get(0))
|
element: /** @type {Element} */ ($('<i/>').addClass('icon-flag').get(0))
|
||||||
@@ -31,12 +43,13 @@ var marker = new ol.Overlay({
|
|||||||
// bind the marker position to the device location.
|
// bind the marker position to the device location.
|
||||||
marker.bindTo('position', geolocation);
|
marker.bindTo('position', geolocation);
|
||||||
|
|
||||||
geolocation.addEventListener('accuracy_changed', function() {
|
geolocation.on('change:accuracy', function() {
|
||||||
$(marker.getElement()).tooltip({
|
$(marker.getElement()).tooltip({
|
||||||
title: this.getAccuracy() + 'm from this point'
|
title: this.getAccuracy() + 'm from this point'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
geolocation.on('error', function(error) {
|
||||||
$('#locate').click(function() {
|
var info = document.getElementById('info');
|
||||||
geolocation.setTracking(true);
|
info.innerHTML = error.message;
|
||||||
|
info.style.display = '';
|
||||||
});
|
});
|
||||||
|
|||||||
56
examples/gml.html
Normal file
56
examples/gml.html
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
|
<title>GML example</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||||
|
<div class="navbar-inner">
|
||||||
|
<div class="container">
|
||||||
|
<a class="brand" href="./">OpenLayers 3 Examples</a>
|
||||||
|
<ul class="nav pull-right">
|
||||||
|
<li><iframe class="github-watch-button" src="http://ghbtns.com/github-btn.html?user=openlayers&repo=ol3&type=watch&count=true"
|
||||||
|
allowtransparency="true" frameborder="0" scrolling="0" height="20" width="90"></iframe></li>
|
||||||
|
<li><a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-hashtags="openlayers"> </a></li>
|
||||||
|
<li><div class="g-plusone-wrapper"><div class="g-plusone" data-size="medium" data-annotation="none"></div></div></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="container-fluid">
|
||||||
|
|
||||||
|
<div class="row-fluid">
|
||||||
|
<div class="span12">
|
||||||
|
<div id="map" class="map"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row-fluid">
|
||||||
|
|
||||||
|
<div class="span12">
|
||||||
|
<h4 id="title">GML example</h4>
|
||||||
|
<p id="shortdesc">Example of using the GML parser.</p>
|
||||||
|
<div id="docs">
|
||||||
|
<p>See the <a href="gml.js" target="_blank">gml.js source</a> to see how this is done.</p>
|
||||||
|
</div>
|
||||||
|
<div id="tags">GML</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="loader.js?id=gml" type="text/javascript"></script>
|
||||||
|
<script src="../resources/social-links.js" type="text/javascript"></script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
41
examples/gml.js
Normal file
41
examples/gml.js
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
goog.require('ol.Map');
|
||||||
|
goog.require('ol.RendererHint');
|
||||||
|
goog.require('ol.View2D');
|
||||||
|
goog.require('ol.layer.TileLayer');
|
||||||
|
goog.require('ol.layer.Vector');
|
||||||
|
goog.require('ol.parser.ogc.GML_v3');
|
||||||
|
goog.require('ol.source.MapQuestOpenAerial');
|
||||||
|
goog.require('ol.source.Vector');
|
||||||
|
goog.require('ol.style.Polygon');
|
||||||
|
goog.require('ol.style.Rule');
|
||||||
|
goog.require('ol.style.Style');
|
||||||
|
|
||||||
|
var raster = new ol.layer.TileLayer({
|
||||||
|
source: new ol.source.MapQuestOpenAerial()
|
||||||
|
});
|
||||||
|
|
||||||
|
var vector = new ol.layer.Vector({
|
||||||
|
source: new ol.source.Vector({
|
||||||
|
parser: new ol.parser.ogc.GML_v3({axisOrientation: 'neu'}),
|
||||||
|
url: 'data/gml/topp-states-wfs.xml'
|
||||||
|
}),
|
||||||
|
style: new ol.style.Style({rules: [
|
||||||
|
new ol.style.Rule({
|
||||||
|
symbolizers: [
|
||||||
|
new ol.style.Polygon({
|
||||||
|
strokeColor: '#bada55'
|
||||||
|
})
|
||||||
|
]
|
||||||
|
})
|
||||||
|
]})
|
||||||
|
});
|
||||||
|
|
||||||
|
var map = new ol.Map({
|
||||||
|
layers: [raster, vector],
|
||||||
|
renderer: ol.RendererHint.CANVAS,
|
||||||
|
target: 'map',
|
||||||
|
view: new ol.View2D({
|
||||||
|
center: [-10997171.194994785, 5206335.565590534],
|
||||||
|
zoom: 4
|
||||||
|
})
|
||||||
|
});
|
||||||
60
examples/gpx.html
Normal file
60
examples/gpx.html
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
|
<title>GPX example</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||||
|
<div class="navbar-inner">
|
||||||
|
<div class="container">
|
||||||
|
<a class="brand" href="./">OpenLayers 3 Examples</a>
|
||||||
|
<ul class="nav pull-right">
|
||||||
|
<li><iframe class="github-watch-button" src="http://ghbtns.com/github-btn.html?user=openlayers&repo=ol3&type=watch&count=true"
|
||||||
|
allowtransparency="true" frameborder="0" scrolling="0" height="20" width="90"></iframe></li>
|
||||||
|
<li><a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-hashtags="openlayers"> </a></li>
|
||||||
|
<li><div class="g-plusone-wrapper"><div class="g-plusone" data-size="medium" data-annotation="none"></div></div></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="container-fluid">
|
||||||
|
|
||||||
|
<div class="row-fluid">
|
||||||
|
<div class="span12">
|
||||||
|
<div id="map" class="map"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row-fluid">
|
||||||
|
|
||||||
|
<div class="span4">
|
||||||
|
<h4 id="title">GPX example</h4>
|
||||||
|
<p id="shortdesc">Example of using the GPX parser.</p>
|
||||||
|
<div id="docs">
|
||||||
|
<p>See the <a href="gpx.js" target="_blank">gpx.js source</a> to see how this is done.</p>
|
||||||
|
</div>
|
||||||
|
<div id="tags">GPX</div>
|
||||||
|
</div>
|
||||||
|
<div class="span4 offset4">
|
||||||
|
<div id="info" class="alert alert-success">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="loader.js?id=gpx" type="text/javascript"></script>
|
||||||
|
<script src="../resources/social-links.js" type="text/javascript"></script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
46
examples/gpx.js
Normal file
46
examples/gpx.js
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
goog.require('ol.Map');
|
||||||
|
goog.require('ol.RendererHint');
|
||||||
|
goog.require('ol.View2D');
|
||||||
|
goog.require('ol.layer.TileLayer');
|
||||||
|
goog.require('ol.layer.Vector');
|
||||||
|
goog.require('ol.parser.GPX');
|
||||||
|
goog.require('ol.source.OSM');
|
||||||
|
goog.require('ol.source.Vector');
|
||||||
|
|
||||||
|
var raster = new ol.layer.TileLayer({
|
||||||
|
source: new ol.source.OSM()
|
||||||
|
});
|
||||||
|
|
||||||
|
var vector = new ol.layer.Vector({
|
||||||
|
source: new ol.source.Vector({
|
||||||
|
parser: new ol.parser.GPX(),
|
||||||
|
url: 'data/gpx/yahoo.xml'
|
||||||
|
}),
|
||||||
|
transformFeatureInfo: function(features) {
|
||||||
|
var info = [];
|
||||||
|
for (var i = 0, ii = features.length; i < ii; ++i) {
|
||||||
|
info.push(features[i].get('name') + ': ' + features[i].get('type'));
|
||||||
|
}
|
||||||
|
return info.join(', ');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var map = new ol.Map({
|
||||||
|
layers: [raster, vector],
|
||||||
|
renderer: ol.RendererHint.CANVAS,
|
||||||
|
target: 'map',
|
||||||
|
view: new ol.View2D({
|
||||||
|
center: [-7916461.9312699, 5226343.9091441],
|
||||||
|
zoom: 11
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
map.on(['click', 'mousemove'], function(evt) {
|
||||||
|
map.getFeatureInfo({
|
||||||
|
pixel: evt.getPixel(),
|
||||||
|
layers: [vector],
|
||||||
|
success: function(featureInfo) {
|
||||||
|
document.getElementById('info').innerHTML = featureInfo[0] || ' ';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -4,10 +4,19 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
<title>Hue/saturation example</title>
|
<title>Hue/saturation example</title>
|
||||||
|
<style>
|
||||||
|
#reset-hue {
|
||||||
|
min-width: 90px;
|
||||||
|
}
|
||||||
|
#reset-saturation {
|
||||||
|
min-width: 124px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
@@ -45,7 +54,7 @@
|
|||||||
|
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
|
|
||||||
<div class="span4">
|
<div class="span12">
|
||||||
<h4 id="title">Hue/saturation example</h4>
|
<h4 id="title">Hue/saturation example</h4>
|
||||||
<p id="shortdesc">Example of hue/saturation control on the client (WebGL only).</p>
|
<p id="shortdesc">Example of hue/saturation control on the client (WebGL only).</p>
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
|
|||||||
@@ -2,13 +2,13 @@ goog.require('ol.Map');
|
|||||||
goog.require('ol.RendererHint');
|
goog.require('ol.RendererHint');
|
||||||
goog.require('ol.View2D');
|
goog.require('ol.View2D');
|
||||||
goog.require('ol.layer.TileLayer');
|
goog.require('ol.layer.TileLayer');
|
||||||
goog.require('ol.projection');
|
goog.require('ol.proj');
|
||||||
goog.require('ol.source.BingMaps');
|
goog.require('ol.source.BingMaps');
|
||||||
|
|
||||||
|
|
||||||
var layer = new ol.layer.TileLayer({
|
var layer = new ol.layer.TileLayer({
|
||||||
source: new ol.source.BingMaps({
|
source: new ol.source.BingMaps({
|
||||||
key: 'AlQLZ0-5yk301_ESrmNLma3LYxEKNSg7w-e_knuRfyYFtld-UFvXVs38NOulku3Q',
|
key: 'Ar33pRUvQOdESG8m_T15MUmNz__E1twPo42bFx9jvdDePhX0PNgAcEm44OVTS7tt',
|
||||||
style: 'Aerial'
|
style: 'Aerial'
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
@@ -18,34 +18,52 @@ var map = new ol.Map({
|
|||||||
renderer: ol.RendererHint.WEBGL,
|
renderer: ol.RendererHint.WEBGL,
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View2D({
|
view: new ol.View2D({
|
||||||
center: ol.projection.transform(
|
center: ol.proj.transform([-9.375, 51.483333], 'EPSG:4326', 'EPSG:3857'),
|
||||||
[-9.375, 51.483333], 'EPSG:4326', 'EPSG:3857'),
|
|
||||||
zoom: 15
|
zoom: 15
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
var increaseHue = document.getElementById('increase-hue');
|
var increaseHue = document.getElementById('increase-hue');
|
||||||
|
var resetHue = document.getElementById('reset-hue');
|
||||||
|
var decreaseHue = document.getElementById('decrease-hue');
|
||||||
|
|
||||||
|
function setResetHueButtonHTML() {
|
||||||
|
resetHue.innerHTML = 'Hue (' + layer.getHue().toFixed(2) + ')';
|
||||||
|
}
|
||||||
|
setResetHueButtonHTML();
|
||||||
|
|
||||||
increaseHue.addEventListener('click', function() {
|
increaseHue.addEventListener('click', function() {
|
||||||
layer.setHue(layer.getHue() + 0.25);
|
layer.setHue(layer.getHue() + 0.25);
|
||||||
|
setResetHueButtonHTML();
|
||||||
}, false);
|
}, false);
|
||||||
var resetHue = document.getElementById('reset-hue');
|
|
||||||
resetHue.addEventListener('click', function() {
|
resetHue.addEventListener('click', function() {
|
||||||
layer.setHue(0);
|
layer.setHue(0);
|
||||||
|
setResetHueButtonHTML();
|
||||||
}, false);
|
}, false);
|
||||||
var decreaseHue = document.getElementById('decrease-hue');
|
|
||||||
decreaseHue.addEventListener('click', function() {
|
decreaseHue.addEventListener('click', function() {
|
||||||
layer.setHue(layer.getHue() - 0.25);
|
layer.setHue(layer.getHue() - 0.25);
|
||||||
|
setResetHueButtonHTML();
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
var increaseSaturation = document.getElementById('increase-saturation');
|
var increaseSaturation = document.getElementById('increase-saturation');
|
||||||
|
var resetSaturation = document.getElementById('reset-saturation');
|
||||||
|
var decreaseSaturation = document.getElementById('decrease-saturation');
|
||||||
|
|
||||||
|
function setResetSaturationButtonHTML() {
|
||||||
|
resetSaturation.innerHTML = 'Saturation (' +
|
||||||
|
layer.getSaturation().toFixed(2) + ')';
|
||||||
|
}
|
||||||
|
setResetSaturationButtonHTML();
|
||||||
|
|
||||||
increaseSaturation.addEventListener('click', function() {
|
increaseSaturation.addEventListener('click', function() {
|
||||||
layer.setSaturation(layer.getSaturation() + 0.25);
|
layer.setSaturation(layer.getSaturation() + 0.25);
|
||||||
|
setResetSaturationButtonHTML();
|
||||||
}, false);
|
}, false);
|
||||||
var resetSaturation = document.getElementById('reset-saturation');
|
|
||||||
resetSaturation.addEventListener('click', function() {
|
resetSaturation.addEventListener('click', function() {
|
||||||
layer.setSaturation(1);
|
layer.setSaturation(1);
|
||||||
|
setResetSaturationButtonHTML();
|
||||||
}, false);
|
}, false);
|
||||||
var decreaseSaturation = document.getElementById('decrease-saturation');
|
|
||||||
decreaseSaturation.addEventListener('click', function() {
|
decreaseSaturation.addEventListener('click', function() {
|
||||||
layer.setSaturation(layer.getSaturation() - 0.25);
|
layer.setSaturation(Math.max(layer.getSaturation() - 0.25, 0));
|
||||||
|
setResetSaturationButtonHTML();
|
||||||
}, false);
|
}, false);
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
|
|||||||
69
examples/kml-timezones.html
Normal file
69
examples/kml-timezones.html
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
|
<title>Timezones in KML</title>
|
||||||
|
<style>
|
||||||
|
#map {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
#info {
|
||||||
|
position: absolute;
|
||||||
|
height: 1px;
|
||||||
|
width: 1px;
|
||||||
|
z-index: 100;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||||
|
<div class="navbar-inner">
|
||||||
|
<div class="container">
|
||||||
|
<a class="brand" href="./">OpenLayers 3 Examples</a>
|
||||||
|
<ul class="nav pull-right">
|
||||||
|
<li><iframe class="github-watch-button" src="http://ghbtns.com/github-btn.html?user=openlayers&repo=ol3&type=watch&count=true"
|
||||||
|
allowtransparency="true" frameborder="0" scrolling="0" height="20" width="90"></iframe></li>
|
||||||
|
<li><a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-hashtags="openlayers"> </a></li>
|
||||||
|
<li><div class="g-plusone-wrapper"><div class="g-plusone" data-size="medium" data-annotation="none"></div></div></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="container-fluid">
|
||||||
|
|
||||||
|
<div class="row-fluid">
|
||||||
|
<div class="span12">
|
||||||
|
<div id="map" class="map"><div id="info"></div></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row-fluid">
|
||||||
|
|
||||||
|
<div class="span12">
|
||||||
|
<h4 id="title">Timezones in KML</h4>
|
||||||
|
<p id="shortdesc">Demonstrates rendering timezones from KML.</p>
|
||||||
|
<div id="docs">
|
||||||
|
<p>This example parses a KML file and renders the features as a vector layer. The layer is given a <code>ol.style.Style</code> that fills timezones yellow with an opacity calculated based on the current offset to local noon.</p>
|
||||||
|
<p>See the <a href="kml-timezones.js" target="_blank">kml-timezones.js source</a> to see how this is done.</p>
|
||||||
|
</div>
|
||||||
|
<div id="tags">KML, vector, style</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="jquery.min.js" type="text/javascript"></script>
|
||||||
|
<script src="../resources/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
|
||||||
|
<script src="loader.js?id=kml-timezones" type="text/javascript"></script>
|
||||||
|
<script src="../resources/social-links.js" type="text/javascript"></script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
105
examples/kml-timezones.js
Normal file
105
examples/kml-timezones.js
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
goog.require('ol.Map');
|
||||||
|
goog.require('ol.RendererHint');
|
||||||
|
goog.require('ol.View2D');
|
||||||
|
goog.require('ol.expr');
|
||||||
|
goog.require('ol.layer.TileLayer');
|
||||||
|
goog.require('ol.layer.Vector');
|
||||||
|
goog.require('ol.parser.KML');
|
||||||
|
goog.require('ol.source.Stamen');
|
||||||
|
goog.require('ol.source.Vector');
|
||||||
|
goog.require('ol.style.Polygon');
|
||||||
|
goog.require('ol.style.Rule');
|
||||||
|
goog.require('ol.style.Style');
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register a function to be used in a symbolizer. Here we want the opacity
|
||||||
|
* of polygons to be based on the offset from local noon. For example, a
|
||||||
|
* timezone where it is currently noon would have an opacity of 0.75. And a
|
||||||
|
* timezone where it is currently midnight would have an opacity of 0. This
|
||||||
|
* doesn't account for daylight savings, so don't use it to plan your vacation.
|
||||||
|
*/
|
||||||
|
ol.expr.register('getOpacity', function() {
|
||||||
|
var feature = this;
|
||||||
|
var offset = 0;
|
||||||
|
var name = feature.get('name'); // e.g. GMT -08:30
|
||||||
|
var match = name.match(/([-+]\d{2}):(\d{2})$/);
|
||||||
|
if (match) {
|
||||||
|
var hours = parseInt(match[1], 10);
|
||||||
|
var minutes = parseInt(match[2], 10);
|
||||||
|
offset = 60 * hours + minutes;
|
||||||
|
}
|
||||||
|
var date = new Date();
|
||||||
|
var local = new Date(date.getTime() +
|
||||||
|
(date.getTimezoneOffset() + offset) * 60000);
|
||||||
|
// offset from local noon (in hours)
|
||||||
|
var delta = Math.abs(12 - local.getHours() + (local.getMinutes() / 60));
|
||||||
|
if (delta > 12) {
|
||||||
|
delta = 24 - delta;
|
||||||
|
}
|
||||||
|
return 0.75 * (1 - delta / 12);
|
||||||
|
});
|
||||||
|
|
||||||
|
var style = new ol.style.Style({rules: [
|
||||||
|
new ol.style.Rule({
|
||||||
|
symbolizers: [
|
||||||
|
new ol.style.Polygon({
|
||||||
|
fillColor: '#ffff33',
|
||||||
|
strokeColor: '#ffffff',
|
||||||
|
opacity: ol.expr.parse('getOpacity()')
|
||||||
|
})
|
||||||
|
]
|
||||||
|
})
|
||||||
|
]});
|
||||||
|
|
||||||
|
var vector = new ol.layer.Vector({
|
||||||
|
source: new ol.source.Vector({
|
||||||
|
parser: new ol.parser.KML({dimension: 2}),
|
||||||
|
url: 'data/kml/timezones.kml'
|
||||||
|
}),
|
||||||
|
style: style
|
||||||
|
});
|
||||||
|
|
||||||
|
var raster = new ol.layer.TileLayer({
|
||||||
|
source: new ol.source.Stamen({
|
||||||
|
layer: 'toner'
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
var map = new ol.Map({
|
||||||
|
layers: [raster, vector],
|
||||||
|
renderer: ol.RendererHint.CANVAS,
|
||||||
|
target: 'map',
|
||||||
|
view: new ol.View2D({
|
||||||
|
center: [0, 0],
|
||||||
|
zoom: 2
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
var info = $('#info');
|
||||||
|
info.tooltip({
|
||||||
|
animation: false,
|
||||||
|
trigger: 'manual'
|
||||||
|
});
|
||||||
|
map.on(['click', 'mousemove'], function(evt) {
|
||||||
|
var pixel = evt.getPixel();
|
||||||
|
info.css({
|
||||||
|
left: pixel[0] + 'px',
|
||||||
|
top: (pixel[1] - 15) + 'px'
|
||||||
|
});
|
||||||
|
map.getFeatures({
|
||||||
|
pixel: pixel,
|
||||||
|
layers: [vector],
|
||||||
|
success: function(layerFeatures) {
|
||||||
|
var feature = layerFeatures[0][0];
|
||||||
|
if (feature) {
|
||||||
|
info.tooltip('hide')
|
||||||
|
.attr('data-original-title', feature.get('name'))
|
||||||
|
.tooltip('fixTitle')
|
||||||
|
.tooltip('show');
|
||||||
|
} else {
|
||||||
|
info.tooltip('hide');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -4,6 +4,7 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
@@ -43,12 +44,16 @@
|
|||||||
</div>
|
</div>
|
||||||
<div id="tags">KML</div>
|
<div id="tags">KML</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="span4 offset4">
|
||||||
|
<div id="info" class="alert alert-success">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="jquery.min.js" type="text/javascript"></script>
|
|
||||||
<script src="loader.js?id=kml" type="text/javascript"></script>
|
<script src="loader.js?id=kml" type="text/javascript"></script>
|
||||||
<script src="../resources/social-links.js" type="text/javascript"></script>
|
<script src="../resources/social-links.js" type="text/javascript"></script>
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
goog.require('ol.Collection');
|
|
||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
goog.require('ol.RendererHint');
|
goog.require('ol.RendererHint');
|
||||||
goog.require('ol.View2D');
|
goog.require('ol.View2D');
|
||||||
goog.require('ol.layer.TileLayer');
|
goog.require('ol.layer.TileLayer');
|
||||||
goog.require('ol.layer.Vector');
|
goog.require('ol.layer.Vector');
|
||||||
goog.require('ol.parser.KML');
|
goog.require('ol.parser.KML');
|
||||||
goog.require('ol.projection');
|
|
||||||
goog.require('ol.source.TiledWMS');
|
goog.require('ol.source.TiledWMS');
|
||||||
goog.require('ol.source.Vector');
|
goog.require('ol.source.Vector');
|
||||||
|
|
||||||
@@ -21,30 +19,39 @@ var raster = new ol.layer.TileLayer({
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
var epsg4326 = ol.projection.get('EPSG:4326');
|
|
||||||
|
|
||||||
var vector = new ol.layer.Vector({
|
var vector = new ol.layer.Vector({
|
||||||
source: new ol.source.Vector({
|
source: new ol.source.Vector({
|
||||||
projection: epsg4326
|
parser: new ol.parser.KML({
|
||||||
})
|
maxDepth: 1, dimension: 2, extractStyles: true, extractAttributes: true
|
||||||
|
}),
|
||||||
|
url: 'data/kml/lines.kml'
|
||||||
|
}),
|
||||||
|
transformFeatureInfo: function(features) {
|
||||||
|
var info = [];
|
||||||
|
for (var i = 0, ii = features.length; i < ii; ++i) {
|
||||||
|
info.push(features[i].get('name'));
|
||||||
|
}
|
||||||
|
return info.join(', ');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
layers: new ol.Collection([raster, vector]),
|
layers: [raster, vector],
|
||||||
renderer: ol.RendererHint.CANVAS,
|
renderer: ol.RendererHint.CANVAS,
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View2D({
|
view: new ol.View2D({
|
||||||
projection: epsg4326,
|
projection: 'EPSG:4326',
|
||||||
center: [-112.169, 36.099],
|
center: [-112.169, 36.099],
|
||||||
zoom: 11
|
zoom: 11
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
var kml = new ol.parser.KML({
|
map.on(['click', 'mousemove'], function(evt) {
|
||||||
maxDepth: 1, dimension: 2, extractStyles: true, extractAttributes: true});
|
map.getFeatureInfo({
|
||||||
|
pixel: evt.getPixel(),
|
||||||
$.ajax({
|
layers: [vector],
|
||||||
url: 'data/kml/lines.kml'
|
success: function(featureInfo) {
|
||||||
}).done(function(data) {
|
document.getElementById('info').innerHTML = featureInfo[0] || ' ';
|
||||||
vector.parseFeatures(data, kml, epsg4326);
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loader to add the plovr generated script and ol.css to the document.
|
* Loader to add the plovr generated script to the document.
|
||||||
*
|
*
|
||||||
* The following default values may be overridden with query string
|
* The following default values may be overridden with query string
|
||||||
* parameters:
|
* parameters:
|
||||||
*
|
*
|
||||||
* * hostname - the current hostname (window.location.hostname)
|
* * hostname - the current hostname (window.location.hostname)
|
||||||
* * port - 9810
|
* * port - 9810
|
||||||
* * mode - ADVANCED
|
* * mode - RAW
|
||||||
* * id - id param in loader.js query string; defaults to 'ol' if not set
|
* * id - id param in loader.js query string; defaults to 'ol' if not set
|
||||||
*
|
*
|
||||||
* Usage:
|
* Usage:
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
var params = {
|
var params = {
|
||||||
hostname: window.location.hostname,
|
hostname: window.location.hostname,
|
||||||
port: '9810',
|
port: '9810',
|
||||||
mode: 'ADVANCED',
|
mode: 'RAW',
|
||||||
id: 'ol'
|
id: 'ol'
|
||||||
};
|
};
|
||||||
if (window.location.protocol === 'file:' && !params.hostname) {
|
if (window.location.protocol === 'file:' && !params.hostname) {
|
||||||
@@ -59,8 +59,6 @@
|
|||||||
pairs.push(encodeURIComponent(key) + '=' + encodeURIComponent(params[key]));
|
pairs.push(encodeURIComponent(key) + '=' + encodeURIComponent(params[key]));
|
||||||
}
|
}
|
||||||
|
|
||||||
document.write('<link rel="stylesheet" href="../css/ol.css" ' +
|
|
||||||
'type="text/css">');
|
|
||||||
var url = 'http://' + host + '/compile?' + pairs.join('&');
|
var url = 'http://' + host + '/compile?' + pairs.join('&');
|
||||||
document.write('<script type="text/javascript" src="' + url + '"></script>');
|
document.write('<script type="text/javascript" src="' + url + '"></script>');
|
||||||
}());
|
}());
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
@@ -35,7 +36,7 @@
|
|||||||
|
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
|
|
||||||
<div class="span4">
|
<div class="span12">
|
||||||
<h4 id="title">Localized OpenStreetMap example</h4>
|
<h4 id="title">Localized OpenStreetMap example</h4>
|
||||||
<p id="shortdesc">Example of a localized OpenStreetMap map with a custom tile server and a custom attribution.</p>
|
<p id="shortdesc">Example of a localized OpenStreetMap map with a custom tile server and a custom attribution.</p>
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
@@ -35,7 +36,7 @@
|
|||||||
|
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
|
|
||||||
<div class="span4">
|
<div class="span12">
|
||||||
<h4 id="title">MapQuest example</h4>
|
<h4 id="title">MapQuest example</h4>
|
||||||
<p id="shortdesc">Example of a MapQuest map.</p>
|
<p id="shortdesc">Example of a MapQuest map.</p>
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ goog.require('ol.Map');
|
|||||||
goog.require('ol.RendererHints');
|
goog.require('ol.RendererHints');
|
||||||
goog.require('ol.View2D');
|
goog.require('ol.View2D');
|
||||||
goog.require('ol.layer.TileLayer');
|
goog.require('ol.layer.TileLayer');
|
||||||
goog.require('ol.projection');
|
goog.require('ol.proj');
|
||||||
goog.require('ol.source.MapQuestOSM');
|
goog.require('ol.source.MapQuestOSM');
|
||||||
|
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@ var map = new ol.Map({
|
|||||||
renderers: ol.RendererHints.createFromQueryData(),
|
renderers: ol.RendererHints.createFromQueryData(),
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View2D({
|
view: new ol.View2D({
|
||||||
center: ol.projection.transform(
|
center: ol.proj.transform(
|
||||||
[139.6917, 35.689506], 'EPSG:4326', 'EPSG:3857'),
|
[139.6917, 35.689506], 'EPSG:4326', 'EPSG:3857'),
|
||||||
zoom: 9
|
zoom: 9
|
||||||
})
|
})
|
||||||
|
|||||||
28
examples/mobile-full-screen.html
Normal file
28
examples/mobile-full-screen.html
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
|
<title>Mobile full screen example</title>
|
||||||
|
<style type="text/css">
|
||||||
|
html, body, .map {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="map" class="map"></div>
|
||||||
|
<script src="loader.js?id=mobile-full-screen" type="text/javascript"></script>
|
||||||
|
|
||||||
|
<div style="display: none;">
|
||||||
|
<div id="title">Mobile full screen example</div>
|
||||||
|
<div id="shortdesc">Example of a full screen map.</div>
|
||||||
|
<div id="tags">fullscreen, bing, geolocation, mobile</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
35
examples/mobile-full-screen.js
Normal file
35
examples/mobile-full-screen.js
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
goog.require('ol.Geolocation');
|
||||||
|
goog.require('ol.Map');
|
||||||
|
goog.require('ol.RendererHints');
|
||||||
|
goog.require('ol.View2D');
|
||||||
|
goog.require('ol.layer.TileLayer');
|
||||||
|
goog.require('ol.source.BingMaps');
|
||||||
|
|
||||||
|
|
||||||
|
var view = new ol.View2D({
|
||||||
|
center: [0, 0],
|
||||||
|
zoom: 2
|
||||||
|
});
|
||||||
|
|
||||||
|
var map = new ol.Map({
|
||||||
|
layers: [
|
||||||
|
new ol.layer.TileLayer({
|
||||||
|
source: new ol.source.BingMaps({
|
||||||
|
key: 'Ar33pRUvQOdESG8m_T15MUmNz__E1twPo42bFx9jvdDePhX0PNgAcEm44OVTS7tt',
|
||||||
|
style: 'Road'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
],
|
||||||
|
renderers: ol.RendererHints.createFromQueryData(),
|
||||||
|
target: 'map',
|
||||||
|
view: view
|
||||||
|
});
|
||||||
|
|
||||||
|
var geolocation = new ol.Geolocation({
|
||||||
|
tracking: true
|
||||||
|
});
|
||||||
|
geolocation.bindTo('projection', view);
|
||||||
|
geolocation.once('change:position', function() {
|
||||||
|
view.setCenter(geolocation.getPosition());
|
||||||
|
view.setResolution(2.388657133911758);
|
||||||
|
});
|
||||||
@@ -4,6 +4,7 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
@@ -30,21 +31,28 @@
|
|||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="span12">
|
<div class="span12">
|
||||||
<div id="map" class="map"></div>
|
<div id="map" class="map"></div>
|
||||||
<small id="mouse-position"></small>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
|
<div class="span6">
|
||||||
<div class="span4">
|
|
||||||
<h4 id="title">Mouse position example</h4>
|
<h4 id="title">Mouse position example</h4>
|
||||||
<p id="shortdesc">Example of a mouse position control, outside the map.</p>
|
<p id="shortdesc">Example of a mouse position control, outside the map.</p>
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
<p>See the <a href="mouse-position.js" target="_blank">mouse-position.js source</a> to see how this is done.</p>
|
<p>See the <a href="mouse-position.js" target="_blank">mouse-position.js source</a> to see how this is done.</p>
|
||||||
</div>
|
</div>
|
||||||
<div id="tags">mouse-position, openstreetmap</div>
|
<div id="tags">mouse-position, openstreetmap</div>
|
||||||
|
<form>
|
||||||
|
<label>Projection </label>
|
||||||
|
<select id="projection">
|
||||||
|
<option value="EPSG:4326">EPSG:4326</option>
|
||||||
|
<option value="EPSG:3857">EPSG:3857</option>
|
||||||
|
</select>
|
||||||
|
<label>Precision </label>
|
||||||
|
<input id="precision" type="number" min="0" max="12" value="4"/>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="span6" id="mouse-position"> </div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,19 +4,23 @@ goog.require('ol.View2D');
|
|||||||
goog.require('ol.control.MousePosition');
|
goog.require('ol.control.MousePosition');
|
||||||
goog.require('ol.control.defaults');
|
goog.require('ol.control.defaults');
|
||||||
goog.require('ol.coordinate');
|
goog.require('ol.coordinate');
|
||||||
|
goog.require('ol.dom.Input');
|
||||||
goog.require('ol.layer.TileLayer');
|
goog.require('ol.layer.TileLayer');
|
||||||
|
goog.require('ol.proj');
|
||||||
goog.require('ol.source.OSM');
|
goog.require('ol.source.OSM');
|
||||||
|
|
||||||
|
var mousePositionControl = new ol.control.MousePosition({
|
||||||
|
coordinateFormat: ol.coordinate.createStringXY(4),
|
||||||
|
projection: 'EPSG:4326',
|
||||||
|
// comment the following two lines to have the mouse position
|
||||||
|
// be placed within the map.
|
||||||
|
className: 'custom-mouse-position',
|
||||||
|
target: document.getElementById('mouse-position'),
|
||||||
|
undefinedHTML: ' '
|
||||||
|
});
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
controls: ol.control.defaults({}, [
|
controls: ol.control.defaults({}, [mousePositionControl]),
|
||||||
new ol.control.MousePosition({
|
|
||||||
coordinateFormat: ol.coordinate.toStringHDMS,
|
|
||||||
projection: 'EPSG:4326',
|
|
||||||
target: document.getElementById('mouse-position'),
|
|
||||||
undefinedHTML: ' '
|
|
||||||
})
|
|
||||||
]),
|
|
||||||
layers: [
|
layers: [
|
||||||
new ol.layer.TileLayer({
|
new ol.layer.TileLayer({
|
||||||
source: new ol.source.OSM()
|
source: new ol.source.OSM()
|
||||||
@@ -29,3 +33,14 @@ var map = new ol.Map({
|
|||||||
zoom: 2
|
zoom: 2
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var projectionSelect = new ol.dom.Input(document.getElementById('projection'));
|
||||||
|
projectionSelect.on('change:value', function() {
|
||||||
|
mousePositionControl.setProjection(ol.proj.get(projectionSelect.getValue()));
|
||||||
|
});
|
||||||
|
|
||||||
|
var precisionInput = new ol.dom.Input(document.getElementById('precision'));
|
||||||
|
precisionInput.on('change:value', function() {
|
||||||
|
var format = ol.coordinate.createStringXY(precisionInput.getValue());
|
||||||
|
mousePositionControl.setCoordinateFormat(format);
|
||||||
|
});
|
||||||
|
|||||||
61
examples/navigation-controls.html
Normal file
61
examples/navigation-controls.html
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
|
<title>Navigation controls example</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||||
|
<div class="navbar-inner">
|
||||||
|
<div class="container">
|
||||||
|
<a class="brand" href="./">OpenLayers 3 Examples</a>
|
||||||
|
<ul class="nav pull-right">
|
||||||
|
<li><iframe class="github-watch-button" src="http://ghbtns.com/github-btn.html?user=openlayers&repo=ol3&type=watch&count=true"
|
||||||
|
allowtransparency="true" frameborder="0" scrolling="0" height="20" width="90"></iframe></li>
|
||||||
|
<li><a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-hashtags="openlayers"> </a></li>
|
||||||
|
<li><div class="g-plusone-wrapper"><div class="g-plusone" data-size="medium" data-annotation="none"></div></div></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="container-fluid">
|
||||||
|
|
||||||
|
<div class="row-fluid">
|
||||||
|
<div class="span12">
|
||||||
|
<div id="map" class="map"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row-fluid">
|
||||||
|
|
||||||
|
<div class="span12">
|
||||||
|
<h4 id="title">Navigation controls example</h4>
|
||||||
|
<p id="shortdesc">Shows how to add navigation controls.</p>
|
||||||
|
The following navigation controls are added to the map:
|
||||||
|
<ul>
|
||||||
|
<li><code>ol.control.Zoom</code> (added by default)</li>
|
||||||
|
<li><code>ol.control.ZoomToExtent</code></li>
|
||||||
|
</ul>
|
||||||
|
<div id="docs">
|
||||||
|
<p>See the <a href="navigation-controls.js" target="_blank">navigation-controls.js source</a> to see how this is done.</p>
|
||||||
|
</div>
|
||||||
|
<div id="tags">control, navigation, extent</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="loader.js?id=navigation-controls" type="text/javascript"></script>
|
||||||
|
<script src="../resources/social-links.js" type="text/javascript"></script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
32
examples/navigation-controls.js
Normal file
32
examples/navigation-controls.js
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
goog.require('ol.Map');
|
||||||
|
goog.require('ol.RendererHints');
|
||||||
|
goog.require('ol.View2D');
|
||||||
|
goog.require('ol.control.ZoomToExtent');
|
||||||
|
goog.require('ol.control.defaults');
|
||||||
|
goog.require('ol.layer.TileLayer');
|
||||||
|
goog.require('ol.source.OSM');
|
||||||
|
|
||||||
|
|
||||||
|
var map = new ol.Map({
|
||||||
|
controls: ol.control.defaults({}, [
|
||||||
|
new ol.control.ZoomToExtent({
|
||||||
|
extent: [
|
||||||
|
813079.7791264898,
|
||||||
|
848966.9639063801,
|
||||||
|
5929220.284081122,
|
||||||
|
5936863.986909639
|
||||||
|
]
|
||||||
|
})
|
||||||
|
]),
|
||||||
|
layers: [
|
||||||
|
new ol.layer.TileLayer({
|
||||||
|
source: new ol.source.OSM()
|
||||||
|
})
|
||||||
|
],
|
||||||
|
renderers: ol.RendererHints.createFromQueryData(),
|
||||||
|
target: 'map',
|
||||||
|
view: new ol.View2D({
|
||||||
|
center: [0, 0],
|
||||||
|
zoom: 2
|
||||||
|
})
|
||||||
|
});
|
||||||
@@ -4,6 +4,7 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
@@ -47,11 +48,12 @@
|
|||||||
|
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
|
|
||||||
<div class="span4">
|
<div class="span12">
|
||||||
<h4 id="title">Overlay example</h4>
|
<h4 id="title">Overlay example</h4>
|
||||||
<p id="shortdesc">Demonstrates overlays. The popups are created using
|
<p id="shortdesc">Demonstrates overlays.</p>
|
||||||
<a href="http://twitter.github.com/bootstrap/javascript.html#popovers">Popovers</a> from Bootstrap.</p>
|
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
|
<p>The popups are created using
|
||||||
|
<a href="http://twitter.github.com/bootstrap/javascript.html#popovers">Popovers</a> from Bootstrap.</p>
|
||||||
<p>See the <a href="overlay.js" target="_blank">overlay.js source</a> to see how this is done.</p>
|
<p>See the <a href="overlay.js" target="_blank">overlay.js source</a> to see how this is done.</p>
|
||||||
</div>
|
</div>
|
||||||
<div id="tags">overlay, popup, bootstrap, popover, mapquest, openaerial</div>
|
<div id="tags">overlay, popup, bootstrap, popover, mapquest, openaerial</div>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ goog.require('ol.RendererHints');
|
|||||||
goog.require('ol.View2D');
|
goog.require('ol.View2D');
|
||||||
goog.require('ol.coordinate');
|
goog.require('ol.coordinate');
|
||||||
goog.require('ol.layer.TileLayer');
|
goog.require('ol.layer.TileLayer');
|
||||||
goog.require('ol.projection');
|
goog.require('ol.proj');
|
||||||
goog.require('ol.source.MapQuestOpenAerial');
|
goog.require('ol.source.MapQuestOpenAerial');
|
||||||
|
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ var map = new ol.Map({
|
|||||||
// Vienna label
|
// Vienna label
|
||||||
var vienna = new ol.Overlay({
|
var vienna = new ol.Overlay({
|
||||||
map: map,
|
map: map,
|
||||||
position: ol.projection.transform(
|
position: ol.proj.transform(
|
||||||
[16.3725, 48.208889], 'EPSG:4326', 'EPSG:3857'),
|
[16.3725, 48.208889], 'EPSG:4326', 'EPSG:3857'),
|
||||||
element: document.getElementById('vienna')
|
element: document.getElementById('vienna')
|
||||||
});
|
});
|
||||||
@@ -38,7 +38,7 @@ var popup = new ol.Overlay({
|
|||||||
map.on('click', function(evt) {
|
map.on('click', function(evt) {
|
||||||
var element = popup.getElement();
|
var element = popup.getElement();
|
||||||
var coordinate = evt.getCoordinate();
|
var coordinate = evt.getCoordinate();
|
||||||
var hdms = ol.coordinate.toStringHDMS(ol.projection.transform(
|
var hdms = ol.coordinate.toStringHDMS(ol.proj.transform(
|
||||||
coordinate, 'EPSG:3857', 'EPSG:4326'));
|
coordinate, 'EPSG:3857', 'EPSG:4326'));
|
||||||
|
|
||||||
$(element).popover('destroy');
|
$(element).popover('destroy');
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
@@ -38,10 +39,11 @@
|
|||||||
|
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
|
|
||||||
<div class="span4">
|
<div class="span12">
|
||||||
<h4 id="title">Preload example</h4>
|
<h4 id="title">Preload example</h4>
|
||||||
<p id="shortdesc">Example of tile preloading. Low resolution tiles for the map are preloaded, the map on the right does not use any preloading. Try zooming out and panning to see the difference.</p>
|
<p id="shortdesc">Example of tile preloading.</p>
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
|
<p>The map on the left preloads low resolution tiles. The map on the right does not use any preloading. Try zooming out and panning to see the difference.</p>
|
||||||
<p>See the <a href="preload.js" target="_blank">preload.js source</a> to see how this is done.</p>
|
<p>See the <a href="preload.js" target="_blank">preload.js source</a> to see how this is done.</p>
|
||||||
</div>
|
</div>
|
||||||
<div id="tags">preload, bing</div>
|
<div id="tags">preload, bing</div>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ var map1 = new ol.Map({
|
|||||||
new ol.layer.TileLayer({
|
new ol.layer.TileLayer({
|
||||||
preload: Infinity,
|
preload: Infinity,
|
||||||
source: new ol.source.BingMaps({
|
source: new ol.source.BingMaps({
|
||||||
key: 'AlQLZ0-5yk301_ESrmNLma3LYxEKNSg7w-e_knuRfyYFtld-UFvXVs38NOulku3Q',
|
key: 'Ar33pRUvQOdESG8m_T15MUmNz__E1twPo42bFx9jvdDePhX0PNgAcEm44OVTS7tt',
|
||||||
style: 'Aerial'
|
style: 'Aerial'
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
@@ -35,10 +36,11 @@
|
|||||||
|
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
|
|
||||||
<div class="span4">
|
<div class="span12">
|
||||||
<h4 id="title">Rotation example</h4>
|
<h4 id="title">Rotation example</h4>
|
||||||
<p id="shortdesc">Example of a rotated map. Use <code>Alt</code>+<code>Shift</code>+drag to rotate the map.</p>
|
<p id="shortdesc">Example of a rotated map.</p>
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
|
<p>Use <code>Alt</code>+<code>Shift</code>+drag to rotate the map.</p>
|
||||||
<p>See the <a href="rotation.js" target="_blank">rotation.js source</a> to see how this is done.</p>
|
<p>See the <a href="rotation.js" target="_blank">rotation.js source</a> to see how this is done.</p>
|
||||||
</div>
|
</div>
|
||||||
<div id="tags">rotation, openstreetmap</div>
|
<div id="tags">rotation, openstreetmap</div>
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
@@ -30,12 +31,17 @@
|
|||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="span12">
|
<div class="span12">
|
||||||
<div id="map" class="map"></div>
|
<div id="map" class="map"></div>
|
||||||
|
<select id="units">
|
||||||
|
<option value="degrees">degrees</option>
|
||||||
|
<option value="imperial">imperial</option>
|
||||||
|
<option value="metric">metric</option>
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
|
|
||||||
<div class="span4">
|
<div class="span12">
|
||||||
<h4 id="title">Scale line example</h4>
|
<h4 id="title">Scale line example</h4>
|
||||||
<p id="shortdesc">Example of a scale line.</p>
|
<p id="shortdesc">Example of a scale line.</p>
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
|
|||||||
@@ -2,17 +2,17 @@ goog.require('ol.Map');
|
|||||||
goog.require('ol.RendererHints');
|
goog.require('ol.RendererHints');
|
||||||
goog.require('ol.View2D');
|
goog.require('ol.View2D');
|
||||||
goog.require('ol.control.ScaleLine');
|
goog.require('ol.control.ScaleLine');
|
||||||
goog.require('ol.control.ScaleLineUnits');
|
|
||||||
goog.require('ol.control.defaults');
|
goog.require('ol.control.defaults');
|
||||||
|
goog.require('ol.dom.Input');
|
||||||
goog.require('ol.layer.TileLayer');
|
goog.require('ol.layer.TileLayer');
|
||||||
goog.require('ol.source.OSM');
|
goog.require('ol.source.OSM');
|
||||||
|
|
||||||
|
|
||||||
|
var scaleLineControl = new ol.control.ScaleLine();
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
controls: ol.control.defaults({}, [
|
controls: ol.control.defaults({}, [
|
||||||
new ol.control.ScaleLine({
|
scaleLineControl
|
||||||
units: ol.control.ScaleLineUnits.IMPERIAL
|
|
||||||
})
|
|
||||||
]),
|
]),
|
||||||
layers: [
|
layers: [
|
||||||
new ol.layer.TileLayer({
|
new ol.layer.TileLayer({
|
||||||
@@ -26,3 +26,7 @@ var map = new ol.Map({
|
|||||||
zoom: 2
|
zoom: 2
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
var unitsSelect = new ol.dom.Input(document.getElementById('units'));
|
||||||
|
unitsSelect.bindTo('value', scaleLineControl, 'units');
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
@@ -35,7 +36,7 @@
|
|||||||
|
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
|
|
||||||
<div class="span4">
|
<div class="span12">
|
||||||
<h4 id="title">Semi-transparent layer example</h4>
|
<h4 id="title">Semi-transparent layer example</h4>
|
||||||
<p id="shortdesc">Example of a map with a semi-transparent layer.</p>
|
<p id="shortdesc">Example of a map with a semi-transparent layer.</p>
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ goog.require('ol.Map');
|
|||||||
goog.require('ol.RendererHints');
|
goog.require('ol.RendererHints');
|
||||||
goog.require('ol.View2D');
|
goog.require('ol.View2D');
|
||||||
goog.require('ol.layer.TileLayer');
|
goog.require('ol.layer.TileLayer');
|
||||||
goog.require('ol.projection');
|
goog.require('ol.proj');
|
||||||
goog.require('ol.source.MapQuestOpenAerial');
|
goog.require('ol.source.MapQuestOpenAerial');
|
||||||
goog.require('ol.source.TileJSON');
|
goog.require('ol.source.TileJSON');
|
||||||
|
|
||||||
@@ -22,8 +22,7 @@ var map = new ol.Map({
|
|||||||
renderers: ol.RendererHints.createFromQueryData(),
|
renderers: ol.RendererHints.createFromQueryData(),
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View2D({
|
view: new ol.View2D({
|
||||||
center: ol.projection.transform(
|
center: ol.proj.transform([-77.93255, 37.9555], 'EPSG:4326', 'EPSG:3857'),
|
||||||
[-77.93255, 37.9555], 'EPSG:4326', 'EPSG:3857'),
|
|
||||||
zoom: 5
|
zoom: 5
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
@@ -44,7 +45,7 @@
|
|||||||
|
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
|
|
||||||
<div class="span4">
|
<div class="span12">
|
||||||
<h4 id="title">Side-by-side example</h4>
|
<h4 id="title">Side-by-side example</h4>
|
||||||
<p id="shortdesc">The three maps, one WebGL, one Canvas, one DOM, share the same center, resolution, rotation and layers.</p>
|
<p id="shortdesc">The three maps, one WebGL, one Canvas, one DOM, share the same center, resolution, rotation and layers.</p>
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
@@ -35,7 +36,7 @@
|
|||||||
|
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
|
|
||||||
<div class="span4">
|
<div class="span12">
|
||||||
<h4 id="title">Simple example</h4>
|
<h4 id="title">Simple example</h4>
|
||||||
<p id="shortdesc">Example of a simple map.</p>
|
<p id="shortdesc">Example of a simple map.</p>
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
@@ -35,7 +36,7 @@
|
|||||||
|
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
|
|
||||||
<div class="span4">
|
<div class="span12">
|
||||||
<h4 id="title">Stamen example</h4>
|
<h4 id="title">Stamen example</h4>
|
||||||
<p id="shortdesc">Example of a Stamen tile source. Two layers are composed: the watercolor base layer with the terrain labels.</p>
|
<p id="shortdesc">Example of a Stamen tile source. Two layers are composed: the watercolor base layer with the terrain labels.</p>
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ goog.require('ol.Map');
|
|||||||
goog.require('ol.RendererHints');
|
goog.require('ol.RendererHints');
|
||||||
goog.require('ol.View2D');
|
goog.require('ol.View2D');
|
||||||
goog.require('ol.layer.TileLayer');
|
goog.require('ol.layer.TileLayer');
|
||||||
goog.require('ol.projection');
|
goog.require('ol.proj');
|
||||||
goog.require('ol.source.Stamen');
|
goog.require('ol.source.Stamen');
|
||||||
|
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@ var map = new ol.Map({
|
|||||||
renderers: ol.RendererHints.createFromQueryData(),
|
renderers: ol.RendererHints.createFromQueryData(),
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View2D({
|
view: new ol.View2D({
|
||||||
center: ol.projection.transform(
|
center: ol.proj.transform(
|
||||||
[-122.416667, 37.783333], 'EPSG:4326', 'EPSG:3857'),
|
[-122.416667, 37.783333], 'EPSG:4326', 'EPSG:3857'),
|
||||||
zoom: 12
|
zoom: 12
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
@@ -35,7 +36,7 @@
|
|||||||
|
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
|
|
||||||
<div class="span4">
|
<div class="span12">
|
||||||
<h4 id="title">Style with rules example</h4>
|
<h4 id="title">Style with rules example</h4>
|
||||||
<p id="shortdesc">Draws features with rule based styles.</p>
|
<p id="shortdesc">Draws features with rule based styles.</p>
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
|
|||||||
@@ -1,36 +1,32 @@
|
|||||||
goog.require('ol.Collection');
|
|
||||||
goog.require('ol.Expression');
|
|
||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
goog.require('ol.RendererHint');
|
goog.require('ol.RendererHint');
|
||||||
goog.require('ol.View2D');
|
goog.require('ol.View2D');
|
||||||
goog.require('ol.control.defaults');
|
goog.require('ol.control.defaults');
|
||||||
goog.require('ol.filter.Filter');
|
goog.require('ol.expr');
|
||||||
goog.require('ol.layer.Vector');
|
goog.require('ol.layer.Vector');
|
||||||
goog.require('ol.parser.GeoJSON');
|
goog.require('ol.parser.GeoJSON');
|
||||||
goog.require('ol.projection');
|
goog.require('ol.proj');
|
||||||
goog.require('ol.source.Vector');
|
goog.require('ol.source.Vector');
|
||||||
goog.require('ol.style.Line');
|
goog.require('ol.style.Line');
|
||||||
goog.require('ol.style.Rule');
|
goog.require('ol.style.Rule');
|
||||||
|
goog.require('ol.style.Shape');
|
||||||
goog.require('ol.style.Style');
|
goog.require('ol.style.Style');
|
||||||
|
goog.require('ol.style.Text');
|
||||||
|
|
||||||
|
|
||||||
var style = new ol.style.Style({rules: [
|
var style = new ol.style.Style({rules: [
|
||||||
new ol.style.Rule({
|
new ol.style.Rule({
|
||||||
filter: new ol.filter.Filter(function(feature) {
|
filter: 'where == "outer"',
|
||||||
return feature.get('where') == 'outer';
|
|
||||||
}),
|
|
||||||
symbolizers: [
|
symbolizers: [
|
||||||
new ol.style.Line({
|
new ol.style.Line({
|
||||||
strokeColor: new ol.Expression('color'),
|
strokeColor: ol.expr.parse('color'),
|
||||||
strokeWidth: 4,
|
strokeWidth: 4,
|
||||||
opacity: 1
|
opacity: 1
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
}),
|
}),
|
||||||
new ol.style.Rule({
|
new ol.style.Rule({
|
||||||
filter: new ol.filter.Filter(function(feature) {
|
filter: 'where == "inner"',
|
||||||
return feature.get('where') == 'inner';
|
|
||||||
}),
|
|
||||||
symbolizers: [
|
symbolizers: [
|
||||||
new ol.style.Line({
|
new ol.style.Line({
|
||||||
strokeColor: '#013',
|
strokeColor: '#013',
|
||||||
@@ -38,87 +34,137 @@ var style = new ol.style.Style({rules: [
|
|||||||
opacity: 1
|
opacity: 1
|
||||||
}),
|
}),
|
||||||
new ol.style.Line({
|
new ol.style.Line({
|
||||||
strokeColor: new ol.Expression('color'),
|
strokeColor: ol.expr.parse('color'),
|
||||||
strokeWidth: 2,
|
strokeWidth: 2,
|
||||||
opacity: 1
|
opacity: 1
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
|
}),
|
||||||
|
new ol.style.Rule({
|
||||||
|
filter: 'geometryType("point")',
|
||||||
|
symbolizers: [
|
||||||
|
new ol.style.Shape({
|
||||||
|
size: 40,
|
||||||
|
fillColor: '#013'
|
||||||
|
}),
|
||||||
|
new ol.style.Text({
|
||||||
|
color: '#bada55',
|
||||||
|
text: ol.expr.parse('label'),
|
||||||
|
fontFamily: 'Calibri,sans-serif',
|
||||||
|
fontSize: 14
|
||||||
|
})
|
||||||
|
]
|
||||||
})
|
})
|
||||||
]});
|
]});
|
||||||
|
|
||||||
var vector = new ol.layer.Vector({
|
var vector = new ol.layer.Vector({
|
||||||
style: style,
|
style: style,
|
||||||
source: new ol.source.Vector({
|
source: new ol.source.Vector({
|
||||||
projection: ol.projection.get('EPSG:3857')
|
data: {
|
||||||
|
'type': 'FeatureCollection',
|
||||||
|
'features': [{
|
||||||
|
'type': 'Feature',
|
||||||
|
'properties': {
|
||||||
|
'color': '#BADA55',
|
||||||
|
'where': 'inner'
|
||||||
|
},
|
||||||
|
'geometry': {
|
||||||
|
'type': 'LineString',
|
||||||
|
'coordinates': [[-10000000, -10000000], [10000000, 10000000]]
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
'type': 'Feature',
|
||||||
|
'properties': {
|
||||||
|
'color': '#BADA55',
|
||||||
|
'where': 'inner'
|
||||||
|
},
|
||||||
|
'geometry': {
|
||||||
|
'type': 'LineString',
|
||||||
|
'coordinates': [[-10000000, 10000000], [10000000, -10000000]]
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
'type': 'Feature',
|
||||||
|
'properties': {
|
||||||
|
'color': '#013',
|
||||||
|
'where': 'outer'
|
||||||
|
},
|
||||||
|
'geometry': {
|
||||||
|
'type': 'LineString',
|
||||||
|
'coordinates': [[-10000000, -10000000], [-10000000, 10000000]]
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
'type': 'Feature',
|
||||||
|
'properties': {
|
||||||
|
'color': '#013',
|
||||||
|
'where': 'outer'
|
||||||
|
},
|
||||||
|
'geometry': {
|
||||||
|
'type': 'LineString',
|
||||||
|
'coordinates': [[-10000000, 10000000], [10000000, 10000000]]
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
'type': 'Feature',
|
||||||
|
'properties': {
|
||||||
|
'color': '#013',
|
||||||
|
'where': 'outer'
|
||||||
|
},
|
||||||
|
'geometry': {
|
||||||
|
'type': 'LineString',
|
||||||
|
'coordinates': [[10000000, 10000000], [10000000, -10000000]]
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
'type': 'Feature',
|
||||||
|
'properties': {
|
||||||
|
'color': '#013',
|
||||||
|
'where': 'outer'
|
||||||
|
},
|
||||||
|
'geometry': {
|
||||||
|
'type': 'LineString',
|
||||||
|
'coordinates': [[10000000, -10000000], [-10000000, -10000000]]
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
'type': 'Feature',
|
||||||
|
'properties': {
|
||||||
|
'label': 'South'
|
||||||
|
},
|
||||||
|
'geometry': {
|
||||||
|
'type': 'Point',
|
||||||
|
'coordinates': [0, -6000000]
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
'type': 'Feature',
|
||||||
|
'properties': {
|
||||||
|
'label': 'West'
|
||||||
|
},
|
||||||
|
'geometry': {
|
||||||
|
'type': 'Point',
|
||||||
|
'coordinates': [-6000000, 0]
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
'type': 'Feature',
|
||||||
|
'properties': {
|
||||||
|
'label': 'North'
|
||||||
|
},
|
||||||
|
'geometry': {
|
||||||
|
'type': 'Point',
|
||||||
|
'coordinates': [0, 6000000]
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
'type': 'Feature',
|
||||||
|
'properties': {
|
||||||
|
'label': 'East'
|
||||||
|
},
|
||||||
|
'geometry': {
|
||||||
|
'type': 'Point',
|
||||||
|
'coordinates': [6000000, 0]
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
parser: new ol.parser.GeoJSON(),
|
||||||
|
projection: ol.proj.get('EPSG:3857')
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
vector.parseFeatures({
|
|
||||||
'type': 'FeatureCollection',
|
|
||||||
'features': [{
|
|
||||||
'type': 'Feature',
|
|
||||||
'properties': {
|
|
||||||
'color': '#BADA55',
|
|
||||||
'where': 'inner'
|
|
||||||
},
|
|
||||||
'geometry': {
|
|
||||||
'type': 'LineString',
|
|
||||||
'coordinates': [[-10000000, -10000000], [10000000, 10000000]]
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
'type': 'Feature',
|
|
||||||
'properties': {
|
|
||||||
'color': '#BADA55',
|
|
||||||
'where': 'inner'
|
|
||||||
},
|
|
||||||
'geometry': {
|
|
||||||
'type': 'LineString',
|
|
||||||
'coordinates': [[-10000000, 10000000], [10000000, -10000000]]
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
'type': 'Feature',
|
|
||||||
'properties': {
|
|
||||||
'color': '#013',
|
|
||||||
'where': 'outer'
|
|
||||||
},
|
|
||||||
'geometry': {
|
|
||||||
'type': 'LineString',
|
|
||||||
'coordinates': [[-10000000, -10000000], [-10000000, 10000000]]
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
'type': 'Feature',
|
|
||||||
'properties': {
|
|
||||||
'color': '#013',
|
|
||||||
'where': 'outer'
|
|
||||||
},
|
|
||||||
'geometry': {
|
|
||||||
'type': 'LineString',
|
|
||||||
'coordinates': [[-10000000, 10000000], [10000000, 10000000]]
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
'type': 'Feature',
|
|
||||||
'properties': {
|
|
||||||
'color': '#013',
|
|
||||||
'where': 'outer'
|
|
||||||
},
|
|
||||||
'geometry': {
|
|
||||||
'type': 'LineString',
|
|
||||||
'coordinates': [[10000000, 10000000], [10000000, -10000000]]
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
'type': 'Feature',
|
|
||||||
'properties': {
|
|
||||||
'color': '#013',
|
|
||||||
'where': 'outer'
|
|
||||||
},
|
|
||||||
'geometry': {
|
|
||||||
'type': 'LineString',
|
|
||||||
'coordinates': [[10000000, -10000000], [-10000000, -10000000]]
|
|
||||||
}
|
|
||||||
}]
|
|
||||||
}, new ol.parser.GeoJSON(), ol.projection.get('EPSG:3857'));
|
|
||||||
|
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
layers: [vector],
|
layers: [vector],
|
||||||
controls: ol.control.defaults({
|
controls: ol.control.defaults({
|
||||||
|
|||||||
66
examples/teleport.html
Normal file
66
examples/teleport.html
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
|
<title>Teleport example</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||||
|
<div class="navbar-inner">
|
||||||
|
<div class="container">
|
||||||
|
<a class="brand" href="./">OpenLayers 3 Examples</a>
|
||||||
|
<ul class="nav pull-right">
|
||||||
|
<li><iframe class="github-watch-button" src="http://ghbtns.com/github-btn.html?user=openlayers&repo=ol3&type=watch&count=true"
|
||||||
|
allowtransparency="true" frameborder="0" scrolling="0" height="20" width="90"></iframe></li>
|
||||||
|
<li><a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-hashtags="openlayers"> </a></li>
|
||||||
|
<li><div class="g-plusone-wrapper"><div class="g-plusone" data-size="medium" data-annotation="none"></div></div></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="container-fluid">
|
||||||
|
|
||||||
|
<div class="row-fluid">
|
||||||
|
<div class="span8">
|
||||||
|
<div id="map1" class="map"></div>
|
||||||
|
</div>
|
||||||
|
<div class="span4">
|
||||||
|
<div id="map2" class="map"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row-fluid">
|
||||||
|
<div class="span12">
|
||||||
|
<a id="teleport" href="#" class="btn">Teleport</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row-fluid">
|
||||||
|
|
||||||
|
<div class="span12">
|
||||||
|
<h4 id="title">Teleport example</h4>
|
||||||
|
<p id="shortdesc">Example of moving a map from one target to another.</p>
|
||||||
|
<div id="docs">
|
||||||
|
<p>Click on the Teleport button below the map to move the map from one target to another.</p>
|
||||||
|
<p>See the <a href="teleport.js" target="_blank">teleport.js source</a> to see how this is done.</p>
|
||||||
|
</div>
|
||||||
|
<div id="tags">teleport, openstreetmap</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="loader.js?id=teleport" type="text/javascript"></script>
|
||||||
|
<script src="../resources/social-links.js" type="text/javascript"></script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
28
examples/teleport.js
Normal file
28
examples/teleport.js
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
goog.require('ol.Map');
|
||||||
|
goog.require('ol.RendererHints');
|
||||||
|
goog.require('ol.View2D');
|
||||||
|
goog.require('ol.layer.TileLayer');
|
||||||
|
goog.require('ol.source.OSM');
|
||||||
|
|
||||||
|
|
||||||
|
var map = new ol.Map({
|
||||||
|
layers: [
|
||||||
|
new ol.layer.TileLayer({
|
||||||
|
source: new ol.source.OSM()
|
||||||
|
})
|
||||||
|
],
|
||||||
|
renderers: ol.RendererHints.createFromQueryData(),
|
||||||
|
view: new ol.View2D({
|
||||||
|
center: [0, 0],
|
||||||
|
zoom: 2
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
map.setTarget('map1');
|
||||||
|
|
||||||
|
var teleportButton = document.getElementById('teleport');
|
||||||
|
|
||||||
|
teleportButton.addEventListener('click', function() {
|
||||||
|
var target = map.getTarget().id === 'map1' ? 'map2' : 'map1';
|
||||||
|
map.setTarget(target);
|
||||||
|
}, false);
|
||||||
56
examples/ten-thousand-points.html
Normal file
56
examples/ten-thousand-points.html
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
|
<title>Ten thousand points example</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||||
|
<div class="navbar-inner">
|
||||||
|
<div class="container">
|
||||||
|
<a class="brand" href="example-list.html">OpenLayers 3 Examples</a>
|
||||||
|
<ul class="nav pull-right">
|
||||||
|
<li><iframe class="github-watch-button" src="http://ghbtns.com/github-btn.html?user=openlayers&repo=ol3&type=watch&count=true"
|
||||||
|
allowtransparency="true" frameborder="0" scrolling="0" height="20" width="90"></iframe></li>
|
||||||
|
<li><a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-hashtags="openlayers"> </a></li>
|
||||||
|
<li><div class="g-plusone-wrapper"><div class="g-plusone" data-size="medium" data-annotation="none"></div></div></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="container-fluid">
|
||||||
|
|
||||||
|
<div class="row-fluid">
|
||||||
|
<div class="span12">
|
||||||
|
<div id="map" class="map"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row-fluid">
|
||||||
|
|
||||||
|
<div class="span12">
|
||||||
|
<h4 id="title">Ten thousand points example</h4>
|
||||||
|
<p id="shortdesc">Example of a map with ten thousand points.</p>
|
||||||
|
<div id="docs">
|
||||||
|
<p>See the <a href="ten-thousand-points.js" target="_blank">ten-thousand-points.js source</a> to see how this is done.</p>
|
||||||
|
</div>
|
||||||
|
<div id="tags">points, vector, openstreetmap</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="loader.js?id=ten-thousand-points" type="text/javascript"></script>
|
||||||
|
<script src="../resources/social-links.js" type="text/javascript"></script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
68
examples/ten-thousand-points.js
Normal file
68
examples/ten-thousand-points.js
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
goog.require('ol.Map');
|
||||||
|
goog.require('ol.RendererHint');
|
||||||
|
goog.require('ol.View2D');
|
||||||
|
goog.require('ol.control.MousePosition');
|
||||||
|
goog.require('ol.control.defaults');
|
||||||
|
goog.require('ol.geom2.LineStringCollection');
|
||||||
|
goog.require('ol.geom2.PointCollection');
|
||||||
|
goog.require('ol.layer.TileLayer');
|
||||||
|
goog.require('ol.layer.VectorLayer2');
|
||||||
|
goog.require('ol.source.OSM');
|
||||||
|
goog.require('ol.source.VectorSource2');
|
||||||
|
|
||||||
|
|
||||||
|
// WARNING
|
||||||
|
// This example is an experimental testbed for WebGL vector work. The function
|
||||||
|
// calls used here are internal and low-level and are not representative of the
|
||||||
|
// final API.
|
||||||
|
|
||||||
|
|
||||||
|
var pointCollection = ol.geom2.PointCollection.createEmpty(101 * 101);
|
||||||
|
var i, j, x, y;
|
||||||
|
for (i = 0; i < 101; ++i) {
|
||||||
|
for (j = 0; j < 101; ++j) {
|
||||||
|
x = 20000000 * (i - 50) / 50;
|
||||||
|
y = 20000000 * (j - 50) / 50;
|
||||||
|
pointCollection.add([x, y]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var k = 1000000;
|
||||||
|
var lineStringCollection = ol.geom2.LineStringCollection.pack([
|
||||||
|
[[-20 * k, -20 * k], [20 * k, 20 * k]],
|
||||||
|
[[-20 * k, 20 * k], [20 * k, -20 * k]],
|
||||||
|
[[0 * k, 15 * k],
|
||||||
|
[10 * k, 5 * k],
|
||||||
|
[5 * k, 5 * k],
|
||||||
|
[5 * k, -15 * k],
|
||||||
|
[-5 * k, -15 * k],
|
||||||
|
[-5 * k, 5 * k],
|
||||||
|
[-10 * k, 5 * k],
|
||||||
|
[0 * k, 15 * k]]
|
||||||
|
]);
|
||||||
|
|
||||||
|
var map = new ol.Map({
|
||||||
|
controls: ol.control.defaults({}, [
|
||||||
|
new ol.control.MousePosition({
|
||||||
|
undefinedHTML: ' '
|
||||||
|
})
|
||||||
|
]),
|
||||||
|
layers: [
|
||||||
|
new ol.layer.TileLayer({
|
||||||
|
source: new ol.source.OSM()
|
||||||
|
}),
|
||||||
|
new ol.layer.VectorLayer2({
|
||||||
|
source: new ol.source.VectorSource2({
|
||||||
|
lineStringCollections: [lineStringCollection],
|
||||||
|
projection: 'EPSG:3857',
|
||||||
|
pointCollections: [pointCollection]
|
||||||
|
})
|
||||||
|
})
|
||||||
|
],
|
||||||
|
renderer: ol.RendererHint.WEBGL,
|
||||||
|
target: 'map',
|
||||||
|
view: new ol.View2D({
|
||||||
|
center: [0, 0],
|
||||||
|
zoom: 0
|
||||||
|
})
|
||||||
|
});
|
||||||
@@ -4,6 +4,7 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
@@ -35,7 +36,7 @@
|
|||||||
|
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
|
|
||||||
<div class="span4">
|
<div class="span12">
|
||||||
<h4 id="title">TileJSON example</h4>
|
<h4 id="title">TileJSON example</h4>
|
||||||
<p id="shortdesc">Example of a TileJSON layer.</p>
|
<p id="shortdesc">Example of a TileJSON layer.</p>
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
@@ -37,12 +38,17 @@
|
|||||||
|
|
||||||
<div class="span4">
|
<div class="span4">
|
||||||
<h4 id="title">Vector layer example</h4>
|
<h4 id="title">Vector layer example</h4>
|
||||||
<p id="shortdesc">Example of a vector layer.</p>
|
<p id="shortdesc">Example of a countries vector layer with country information on hover and country labels at higher zoom levels.</p>
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
<p>See the <a href="vector-layer.js" target="_blank">vector-layer.js source</a> to see how this is done.</p>
|
<p>See the <a href="vector-layer.js" target="_blank">vector-layer.js source</a> to see how this is done.</p>
|
||||||
</div>
|
</div>
|
||||||
<div id="tags">vector, geojson, style</div>
|
<div id="tags">vector, geojson, style</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="span4 offset4">
|
||||||
|
<div id="info" class="alert alert-success">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,25 +1,31 @@
|
|||||||
goog.require('ol.Collection');
|
|
||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
goog.require('ol.RendererHint');
|
goog.require('ol.RendererHint');
|
||||||
goog.require('ol.View2D');
|
goog.require('ol.View2D');
|
||||||
|
goog.require('ol.expr');
|
||||||
goog.require('ol.layer.TileLayer');
|
goog.require('ol.layer.TileLayer');
|
||||||
goog.require('ol.layer.Vector');
|
goog.require('ol.layer.Vector');
|
||||||
goog.require('ol.parser.GeoJSON');
|
goog.require('ol.parser.GeoJSON');
|
||||||
goog.require('ol.projection');
|
|
||||||
goog.require('ol.source.MapQuestOpenAerial');
|
goog.require('ol.source.MapQuestOpenAerial');
|
||||||
goog.require('ol.source.Vector');
|
goog.require('ol.source.Vector');
|
||||||
goog.require('ol.style.Polygon');
|
goog.require('ol.style.Polygon');
|
||||||
goog.require('ol.style.Rule');
|
goog.require('ol.style.Rule');
|
||||||
goog.require('ol.style.Style');
|
goog.require('ol.style.Style');
|
||||||
|
goog.require('ol.style.Text');
|
||||||
|
|
||||||
|
|
||||||
var raster = new ol.layer.TileLayer({
|
var raster = new ol.layer.TileLayer({
|
||||||
source: new ol.source.MapQuestOpenAerial()
|
source: new ol.source.MapQuestOpenAerial()
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// TODO: discuss scale dependent rules
|
||||||
|
ol.expr.register('resolution', function() {
|
||||||
|
return map.getView().getView2D().getResolution();
|
||||||
|
});
|
||||||
|
|
||||||
var vector = new ol.layer.Vector({
|
var vector = new ol.layer.Vector({
|
||||||
source: new ol.source.Vector({
|
source: new ol.source.Vector({
|
||||||
projection: ol.projection.get('EPSG:4326')
|
parser: new ol.parser.GeoJSON(),
|
||||||
|
url: 'data/countries.geojson'
|
||||||
}),
|
}),
|
||||||
style: new ol.style.Style({rules: [
|
style: new ol.style.Style({rules: [
|
||||||
new ol.style.Rule({
|
new ol.style.Rule({
|
||||||
@@ -28,12 +34,27 @@ var vector = new ol.layer.Vector({
|
|||||||
strokeColor: '#bada55'
|
strokeColor: '#bada55'
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
|
}),
|
||||||
|
new ol.style.Rule({
|
||||||
|
filter: 'resolution() < 5000',
|
||||||
|
symbolizers: [
|
||||||
|
new ol.style.Text({
|
||||||
|
color: '#bada55',
|
||||||
|
text: ol.expr.parse('name'),
|
||||||
|
fontFamily: 'Calibri,sans-serif',
|
||||||
|
fontSize: 12
|
||||||
|
})
|
||||||
|
]
|
||||||
})
|
})
|
||||||
]})
|
]}),
|
||||||
|
transformFeatureInfo: function(features) {
|
||||||
|
return features.length > 0 ?
|
||||||
|
features[0].getFeatureId() + ': ' + features[0].get('name') : ' ';
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var map = new ol.Map({
|
var map = new ol.Map({
|
||||||
layers: new ol.Collection([raster, vector]),
|
layers: [raster, vector],
|
||||||
renderer: ol.RendererHint.CANVAS,
|
renderer: ol.RendererHint.CANVAS,
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View2D({
|
view: new ol.View2D({
|
||||||
@@ -42,21 +63,12 @@ var map = new ol.Map({
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
map.on(['click', 'mousemove'], function(evt) {
|
||||||
var geojson = new ol.parser.GeoJSON();
|
map.getFeatureInfo({
|
||||||
var url = 'data/countries.json';
|
pixel: evt.getPixel(),
|
||||||
var xhr = new XMLHttpRequest();
|
layers: [vector],
|
||||||
xhr.open('GET', url, true);
|
success: function(featureInfo) {
|
||||||
|
document.getElementById('info').innerHTML = featureInfo[0];
|
||||||
|
}
|
||||||
/**
|
});
|
||||||
* onload handler for the XHR request.
|
});
|
||||||
*/
|
|
||||||
xhr.onload = function() {
|
|
||||||
if (xhr.status == 200) {
|
|
||||||
// this is silly to have to tell the layer the destination projection
|
|
||||||
var projection = map.getView().getProjection();
|
|
||||||
vector.parseFeatures(xhr.responseText, geojson, projection);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
xhr.send();
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
|
|||||||
@@ -4,10 +4,11 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
<title>Tiled WMS with custom projection example</title>
|
<title>Tiled WMS with Proj4js projection example</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
@@ -35,13 +36,13 @@
|
|||||||
|
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
|
|
||||||
<div class="span4">
|
<div class="span12">
|
||||||
<h4 id="title">Tiled WMS with custom projection example</h4>
|
<h4 id="title">Tiled WMS with Proj4js projection example</h4>
|
||||||
<p id="shortdesc">Example of two tiled WMS layers (Pixelmap 1:1'000'000 and national parks) using the projection EPSG:21781.</p>
|
<p id="shortdesc">Example of two tiled WMS layers (Pixelmap 1:1'000'000 and national parks) using the projection EPSG:21781.</p>
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
<p>See the <a href="wms-custom-proj.js" target="_blank">wms-custom-proj.js source</a> to see how this is done.</p>
|
<p>See the <a href="wms-custom-proj.js" target="_blank">wms-custom-proj.js source</a> to see how this is done.</p>
|
||||||
</div>
|
</div>
|
||||||
<div id="tags">wms, tile, tilelayer, projection</div>
|
<div id="tags">wms, tile, tilelayer, proj4js, projection</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
goog.require('ol.Attribution');
|
goog.require('ol.Attribution');
|
||||||
goog.require('ol.Extent');
|
|
||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
goog.require('ol.RendererHints');
|
goog.require('ol.RendererHints');
|
||||||
goog.require('ol.View2D');
|
goog.require('ol.View2D');
|
||||||
@@ -7,16 +6,16 @@ goog.require('ol.control.ScaleLine');
|
|||||||
goog.require('ol.control.ScaleLineUnits');
|
goog.require('ol.control.ScaleLineUnits');
|
||||||
goog.require('ol.control.defaults');
|
goog.require('ol.control.defaults');
|
||||||
goog.require('ol.layer.TileLayer');
|
goog.require('ol.layer.TileLayer');
|
||||||
goog.require('ol.projection');
|
goog.require('ol.proj');
|
||||||
goog.require('ol.source.TiledWMS');
|
goog.require('ol.source.TiledWMS');
|
||||||
|
|
||||||
|
|
||||||
var projection = ol.projection.configureProj4jsProjection({
|
var projection = ol.proj.configureProj4jsProjection({
|
||||||
code: 'EPSG:21781',
|
code: 'EPSG:21781',
|
||||||
extent: new ol.Extent(485869.5728, 76443.1884, 837076.5648, 299941.7864)
|
extent: [485869.5728, 837076.5648, 76443.1884, 299941.7864]
|
||||||
});
|
});
|
||||||
|
|
||||||
var extent = new ol.Extent(420000, 30000, 900000, 350000);
|
var extent = [420000, 900000, 30000, 350000];
|
||||||
var layers = [
|
var layers = [
|
||||||
new ol.layer.TileLayer({
|
new ol.layer.TileLayer({
|
||||||
source: new ol.source.TiledWMS({
|
source: new ol.source.TiledWMS({
|
||||||
|
|||||||
56
examples/wms-no-proj.html
Normal file
56
examples/wms-no-proj.html
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
|
<title>WMS without client projection example</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||||
|
<div class="navbar-inner">
|
||||||
|
<div class="container">
|
||||||
|
<a class="brand" href="./">OpenLayers 3 Examples</a>
|
||||||
|
<ul class="nav pull-right">
|
||||||
|
<li><iframe class="github-watch-button" src="http://ghbtns.com/github-btn.html?user=openlayers&repo=ol3&type=watch&count=true"
|
||||||
|
allowtransparency="true" frameborder="0" scrolling="0" height="20" width="90"></iframe></li>
|
||||||
|
<li><a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-hashtags="openlayers"> </a></li>
|
||||||
|
<li><div class="g-plusone-wrapper"><div class="g-plusone" data-size="medium" data-annotation="none"></div></div></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="container-fluid">
|
||||||
|
|
||||||
|
<div class="row-fluid">
|
||||||
|
<div class="span12">
|
||||||
|
<div id="map" class="map"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row-fluid">
|
||||||
|
|
||||||
|
<div class="span12">
|
||||||
|
<h4 id="title">WMS without client projection example</h4>
|
||||||
|
<p id="shortdesc">Example of two WMS layers using the projection EPSG:21781, which is unknown to the client.</p>
|
||||||
|
<div id="docs">
|
||||||
|
<p>See the <a href="wms-no-proj.js" target="_blank">wms-no-proj.js source</a> to see how this is done.</p>
|
||||||
|
</div>
|
||||||
|
<div id="tags">wms, projection</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="loader.js?id=wms-no-proj" type="text/javascript"></script>
|
||||||
|
<script src="../resources/social-links.js" type="text/javascript"></script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
58
examples/wms-no-proj.js
Normal file
58
examples/wms-no-proj.js
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
goog.require('ol.Attribution');
|
||||||
|
goog.require('ol.Map');
|
||||||
|
goog.require('ol.Projection');
|
||||||
|
goog.require('ol.ProjectionUnits');
|
||||||
|
goog.require('ol.RendererHints');
|
||||||
|
goog.require('ol.View2D');
|
||||||
|
goog.require('ol.layer.ImageLayer');
|
||||||
|
goog.require('ol.layer.TileLayer');
|
||||||
|
goog.require('ol.source.SingleImageWMS');
|
||||||
|
goog.require('ol.source.TiledWMS');
|
||||||
|
|
||||||
|
|
||||||
|
var layers = [
|
||||||
|
new ol.layer.TileLayer({
|
||||||
|
source: new ol.source.TiledWMS({
|
||||||
|
attributions: [new ol.Attribution(
|
||||||
|
'© ' +
|
||||||
|
'<a href="http://www.geo.admin.ch/internet/geoportal/en/home.html">' +
|
||||||
|
'Pixelmap 1:1000000 / geo.admin.ch</a>')],
|
||||||
|
crossOrigin: 'anonymous',
|
||||||
|
params: {
|
||||||
|
'LAYERS': 'ch.swisstopo.pixelkarte-farbe-pk1000.noscale',
|
||||||
|
'FORMAT': 'image/jpeg'
|
||||||
|
},
|
||||||
|
url: 'http://wms.geo.admin.ch/'
|
||||||
|
})
|
||||||
|
}),
|
||||||
|
new ol.layer.ImageLayer({
|
||||||
|
source: new ol.source.SingleImageWMS({
|
||||||
|
attributions: [new ol.Attribution(
|
||||||
|
'© ' +
|
||||||
|
'<a href="http://www.geo.admin.ch/internet/geoportal/en/home.html">' +
|
||||||
|
'National parks / geo.admin.ch</a>')],
|
||||||
|
crossOrigin: 'anonymous',
|
||||||
|
params: {'LAYERS': 'ch.bafu.schutzgebiete-paerke_nationaler_bedeutung'},
|
||||||
|
url: 'http://wms.geo.admin.ch/'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
// A minimal projection object is configured with only the SRS code and the map
|
||||||
|
// units. No client side coordinate transforms are possible with such a
|
||||||
|
// projection object.
|
||||||
|
var projection = new ol.Projection({
|
||||||
|
code: 'EPSG:21781',
|
||||||
|
units: ol.ProjectionUnits.METERS
|
||||||
|
});
|
||||||
|
|
||||||
|
var map = new ol.Map({
|
||||||
|
layers: layers,
|
||||||
|
renderers: ol.RendererHints.createFromQueryData(),
|
||||||
|
target: 'map',
|
||||||
|
view: new ol.View2D({
|
||||||
|
center: [660000, 190000],
|
||||||
|
projection: projection,
|
||||||
|
zoom: 9
|
||||||
|
})
|
||||||
|
});
|
||||||
@@ -4,6 +4,7 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
@@ -35,10 +36,11 @@
|
|||||||
|
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
|
|
||||||
<div class="span4">
|
<div class="span12">
|
||||||
<h4 id="title">Single image WMS with custom projection example</h4>
|
<h4 id="title">Single image WMS with custom projection example</h4>
|
||||||
<p id="shortdesc">Example of two single image WMS layers (Pixelmap 1:1'000'000 and national parks) using the projection EPSG:21781.</p>
|
<p id="shortdesc">Example of two single image WMS layers.</p>
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
|
<p>Pixelmap 1:1'000'000 with National Parks overlay using the projection EPSG:21781.</p>
|
||||||
<p>See the <a href="wms-single-image-custom-proj.js" target="_blank">wms-single-image-custom-proj.js source</a> to see how this is done.</p>
|
<p>See the <a href="wms-single-image-custom-proj.js" target="_blank">wms-single-image-custom-proj.js source</a> to see how this is done.</p>
|
||||||
</div>
|
</div>
|
||||||
<div id="tags">wms, single image, projection</div>
|
<div id="tags">wms, single image, projection</div>
|
||||||
|
|||||||
@@ -1,19 +1,18 @@
|
|||||||
goog.require('ol.Attribution');
|
goog.require('ol.Attribution');
|
||||||
goog.require('ol.Extent');
|
|
||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
goog.require('ol.RendererHints');
|
goog.require('ol.RendererHints');
|
||||||
goog.require('ol.View2D');
|
goog.require('ol.View2D');
|
||||||
goog.require('ol.layer.ImageLayer');
|
goog.require('ol.layer.ImageLayer');
|
||||||
goog.require('ol.projection');
|
goog.require('ol.proj');
|
||||||
goog.require('ol.source.SingleImageWMS');
|
goog.require('ol.source.SingleImageWMS');
|
||||||
|
|
||||||
|
|
||||||
var projection = ol.projection.configureProj4jsProjection({
|
var projection = ol.proj.configureProj4jsProjection({
|
||||||
code: 'EPSG:21781',
|
code: 'EPSG:21781',
|
||||||
extent: new ol.Extent(485869.5728, 76443.1884, 837076.5648, 299941.7864)
|
extent: [485869.5728, 837076.5648, 76443.1884, 299941.7864]
|
||||||
});
|
});
|
||||||
|
|
||||||
var extent = new ol.Extent(420000, 30000, 900000, 350000);
|
var extent = [420000, 900000, 30000, 350000];
|
||||||
var layers = [
|
var layers = [
|
||||||
new ol.layer.ImageLayer({
|
new ol.layer.ImageLayer({
|
||||||
source: new ol.source.SingleImageWMS({
|
source: new ol.source.SingleImageWMS({
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
@@ -35,7 +36,7 @@
|
|||||||
|
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
|
|
||||||
<div class="span4">
|
<div class="span12">
|
||||||
<h4 id="title">Single image WMS example</h4>
|
<h4 id="title">Single image WMS example</h4>
|
||||||
<p id="shortdesc">Example of a single image WMS layer.</p>
|
<p id="shortdesc">Example of a single image WMS layer.</p>
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
goog.require('ol.Extent');
|
|
||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
goog.require('ol.RendererHint');
|
goog.require('ol.RendererHint');
|
||||||
goog.require('ol.View2D');
|
goog.require('ol.View2D');
|
||||||
@@ -16,7 +15,7 @@ var layers = [
|
|||||||
source: new ol.source.SingleImageWMS({
|
source: new ol.source.SingleImageWMS({
|
||||||
url: 'http://demo.opengeo.org/geoserver/wms',
|
url: 'http://demo.opengeo.org/geoserver/wms',
|
||||||
params: {'LAYERS': 'topp:states'},
|
params: {'LAYERS': 'topp:states'},
|
||||||
extent: new ol.Extent(-13884991, 2870341, -7455066, 6338219)
|
extent: [-13884991, -7455066, 2870341, 6338219]
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
@@ -35,7 +36,7 @@
|
|||||||
|
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
|
|
||||||
<div class="span4">
|
<div class="span12">
|
||||||
<h4 id="title">Tiled WMS example</h4>
|
<h4 id="title">Tiled WMS example</h4>
|
||||||
<p id="shortdesc">Example of a tiled WMS layer.</p>
|
<p id="shortdesc">Example of a tiled WMS layer.</p>
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
goog.require('ol.Extent');
|
|
||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
goog.require('ol.RendererHint');
|
goog.require('ol.RendererHint');
|
||||||
goog.require('ol.View2D');
|
goog.require('ol.View2D');
|
||||||
@@ -15,7 +14,7 @@ var layers = [
|
|||||||
source: new ol.source.TiledWMS({
|
source: new ol.source.TiledWMS({
|
||||||
url: 'http://demo.opengeo.org/geoserver/wms',
|
url: 'http://demo.opengeo.org/geoserver/wms',
|
||||||
params: {'LAYERS': 'topp:states', 'TILED': true},
|
params: {'LAYERS': 'topp:states', 'TILED': true},
|
||||||
extent: new ol.Extent(-13884991, 2870341, -7455066, 6338219)
|
extent: [-13884991, -7455066, 2870341, 6338219]
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
goog.require('ol.parser.ogc.WMTSCapabilities');
|
goog.require('ol.parser.ogc.WMTSCapabilities');
|
||||||
goog.require('ol.projection.addCommonProjections');
|
goog.require('ol.proj.addCommonProjections');
|
||||||
|
|
||||||
ol.projection.addCommonProjections();
|
ol.proj.addCommonProjections();
|
||||||
Proj4js.defs['EPSG:31256'] = '+proj=tmerc +lat_0=0 ' +
|
Proj4js.defs['EPSG:31256'] = '+proj=tmerc +lat_0=0 ' +
|
||||||
'+lon_0=16.33333333333333 +k=1 +x_0=0 +y_0=-5000000 +ellps=bessel ' +
|
'+lon_0=16.33333333333333 +k=1 +x_0=0 +y_0=-5000000 +ellps=bessel ' +
|
||||||
'+towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 ' +
|
'+towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 ' +
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
@@ -35,7 +36,7 @@
|
|||||||
|
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
|
|
||||||
<div class="span4">
|
<div class="span12">
|
||||||
<h4 id="title">WMTS from capabilities example</h4>
|
<h4 id="title">WMTS from capabilities example</h4>
|
||||||
<p id="shortdesc">Example of a WMTS source built from a WMTS getCapabilities response.</p>
|
<p id="shortdesc">Example of a WMTS source built from a WMTS getCapabilities response.</p>
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
|
|||||||
65
examples/wmts-ign.html
Normal file
65
examples/wmts-ign.html
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
||||||
|
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
|
||||||
|
<link rel="stylesheet" href="../css/ol.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap.min.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/layout.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="../resources/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
|
||||||
|
<title>IGN WMTS example</title>
|
||||||
|
<style>
|
||||||
|
.ol-logo ul li {
|
||||||
|
margin-right: 3px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||||
|
<div class="navbar-inner">
|
||||||
|
<div class="container">
|
||||||
|
<a class="brand" href="./">OpenLayers 3 Examples</a>
|
||||||
|
<ul class="nav pull-right">
|
||||||
|
<li><iframe class="github-watch-button" src="http://ghbtns.com/github-btn.html?user=openlayers&repo=ol3&type=watch&count=true"
|
||||||
|
allowtransparency="true" frameborder="0" scrolling="0" height="20" width="90"></iframe></li>
|
||||||
|
<li><a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-hashtags="openlayers"> </a></li>
|
||||||
|
<li><div class="g-plusone-wrapper"><div class="g-plusone" data-size="medium" data-annotation="none"></div></div></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="container-fluid">
|
||||||
|
|
||||||
|
<div class="row-fluid">
|
||||||
|
<div class="span12">
|
||||||
|
<div id="map" class="map"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row-fluid">
|
||||||
|
|
||||||
|
<div class="span12">
|
||||||
|
<h4 id="title">IGN WMTS example</h4>
|
||||||
|
<p id="shortdesc">Demonstrates displaying IGN (France) WMTS layers.</p>
|
||||||
|
<div id="docs">
|
||||||
|
<p>In this example two IGN WMTS layers are displayed: <em>Ortho imagery and Cadastral parcels.</em>.
|
||||||
|
For more information on IGN's WMTS service see the
|
||||||
|
<a href="http://professionnels.ign.fr/api-sig">IGN Géoportail API web page</a> (french).</p>
|
||||||
|
<p>See the <a href="wmts-ign.js" target="_blank">wmts-ign.js source</a> to see how this is done.</p>
|
||||||
|
</div>
|
||||||
|
<div id="tags">french, ign, geoportail, wmts</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="http://cdnjs.cloudflare.com/ajax/libs/proj4js/1.1.0/proj4js-compressed.js" type="text/javascript"></script>
|
||||||
|
<script src="loader.js?id=wmts-ign" type="text/javascript"></script>
|
||||||
|
<script src="../resources/social-links.js" type="text/javascript"></script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
83
examples/wmts-ign.js
Normal file
83
examples/wmts-ign.js
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
goog.require('ol.Attribution');
|
||||||
|
goog.require('ol.Map');
|
||||||
|
goog.require('ol.RendererHint');
|
||||||
|
goog.require('ol.View2D');
|
||||||
|
goog.require('ol.layer.TileLayer');
|
||||||
|
goog.require('ol.parser.ogc.WMTSCapabilities');
|
||||||
|
goog.require('ol.source.WMTS');
|
||||||
|
|
||||||
|
|
||||||
|
// The WMTS Capabilities document includes IGNF:WGS84G as a supported
|
||||||
|
// CRS. We include the Proj4js definition of that projection to prevent
|
||||||
|
// Proj4js from requesting that definition from spatialreference.org.
|
||||||
|
|
||||||
|
Proj4js.defs['IGNF:WGS84G'] = '+title=World Geodetic System 1984 ' +
|
||||||
|
'+proj=longlat +towgs84=0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,' +
|
||||||
|
'0.000000 +a=6378137.0000 +rf=298.2572221010000 +units=m +no_defs <>';
|
||||||
|
|
||||||
|
// API key valid for "localhost" and "ol3js.org". Expiration date
|
||||||
|
// is 21/06/2014.
|
||||||
|
var key = 'crrypaoz7j1ifbalcobnumb0';
|
||||||
|
|
||||||
|
var map = new ol.Map({
|
||||||
|
renderer: ol.RendererHint.CANVAS,
|
||||||
|
target: 'map'
|
||||||
|
});
|
||||||
|
|
||||||
|
var xhr = new XMLHttpRequest();
|
||||||
|
|
||||||
|
// data/IGNWMTSCapabilities.xml downloaded from
|
||||||
|
// http://wxs.ign.fr/cle/geoportail/wmts?SERVICE=WMTS&REQUEST=GetCapabilities
|
||||||
|
// Stored locally because of the Same Origin Policy.
|
||||||
|
xhr.open('GET', 'data/IGNWMTSCapabilities.xml', true);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* onload handler for the XHR request.
|
||||||
|
*/
|
||||||
|
xhr.onload = function() {
|
||||||
|
if (xhr.status == 200) {
|
||||||
|
var parser = new ol.parser.ogc.WMTSCapabilities();
|
||||||
|
var capabilities = parser.read(xhr.responseXML);
|
||||||
|
|
||||||
|
var wmtsUrl = 'http://wxs.ign.fr/' + key + '/geoportail/wmts';
|
||||||
|
|
||||||
|
var layerIdentifiers = [
|
||||||
|
'ORTHOIMAGERY.ORTHOPHOTOS',
|
||||||
|
'CADASTRALPARCELS.PARCELS'
|
||||||
|
];
|
||||||
|
var layerLogos = [
|
||||||
|
'http://gpp3-wxs.ign.fr/static/logos/PLANETOBSERVER/PLANETOBSERVER.gif',
|
||||||
|
'http://gpp3-wxs.ign.fr/static/logos/IGN/IGN.gif'
|
||||||
|
];
|
||||||
|
|
||||||
|
var attribution = new ol.Attribution(
|
||||||
|
'<a href="http://www.geoportail.fr/" target="_blank">' +
|
||||||
|
'<img src="http://api.ign.fr/geoportail/api/js/latest/' +
|
||||||
|
'theme/geoportal/img/logo_gp.gif"></a>');
|
||||||
|
|
||||||
|
var sourceOptions;
|
||||||
|
var source;
|
||||||
|
var layer;
|
||||||
|
var i;
|
||||||
|
|
||||||
|
for (i = 0; i < layerIdentifiers.length; ++i) {
|
||||||
|
sourceOptions = ol.source.WMTS.optionsFromCapabilities(
|
||||||
|
capabilities, layerIdentifiers[i]);
|
||||||
|
// we need to set the URL because it must include the key.
|
||||||
|
sourceOptions.urls = [wmtsUrl];
|
||||||
|
sourceOptions.attributions = [attribution];
|
||||||
|
sourceOptions.logo = layerLogos[i];
|
||||||
|
source = new ol.source.WMTS(sourceOptions);
|
||||||
|
layer = new ol.layer.TileLayer({source: source});
|
||||||
|
map.addLayer(layer);
|
||||||
|
}
|
||||||
|
|
||||||
|
var view = new ol.View2D();
|
||||||
|
view.fitExtent([257596.65942095537, 262082.55751844167,
|
||||||
|
6250898.984085131, 6251854.446938695], map.getSize());
|
||||||
|
map.setView(view);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
xhr.send();
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user