Compare commits
646 Commits
r3.0.0-alp
...
v3.0.0-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
79750c662c | ||
|
|
394dfa297a | ||
|
|
c4dba8e828 | ||
|
|
9e274a61db | ||
|
|
5c98a47581 | ||
|
|
a9b0e6239b | ||
|
|
860735d7e4 | ||
|
|
b80022036f | ||
|
|
d1c0665926 | ||
|
|
ac6d8f2df1 | ||
|
|
3adc46ae4a | ||
|
|
ef929e9a72 | ||
|
|
3e8abadf95 | ||
|
|
a25eff9283 | ||
|
|
f07294698a | ||
|
|
5ab7803402 | ||
|
|
aec0c0d9af | ||
|
|
2f2ee22831 | ||
|
|
3b7db642f1 | ||
|
|
2610e9e0c3 | ||
|
|
4def0c6a84 | ||
|
|
b2c336c29e | ||
|
|
3546a15f39 | ||
|
|
29165ddc1f | ||
|
|
d061994842 | ||
|
|
88f938ea47 | ||
|
|
c7b5bd0b6d | ||
|
|
6276e633de | ||
|
|
5d04d74c92 | ||
|
|
6c2e5f6eca | ||
|
|
bd81e6c9a9 | ||
|
|
56e352b7aa | ||
|
|
8a0809c673 | ||
|
|
fd28d56c45 | ||
|
|
abaa220314 | ||
|
|
f24c9a807f | ||
|
|
aa44547565 | ||
|
|
6a39d11222 | ||
|
|
a8d9dad552 | ||
|
|
f3336532dd | ||
|
|
265c5f1a11 | ||
|
|
387f60f1e5 | ||
|
|
8ccc997ecd | ||
|
|
5c15c18f1a | ||
|
|
d1e9dd964b | ||
|
|
690ed1ed8e | ||
|
|
97556f234f | ||
|
|
fa484cca8c | ||
|
|
cf4799e87c | ||
|
|
ea66ddf3a4 | ||
|
|
66e1b01c2d | ||
|
|
ac4b031353 | ||
|
|
e97b2d35d4 | ||
|
|
9a8269f780 | ||
|
|
346fe30a1b | ||
|
|
9e0b560cf6 | ||
|
|
4666f64673 | ||
|
|
58693be9e6 | ||
|
|
9906497cb8 | ||
|
|
8a97535d93 | ||
|
|
62a7505d2b | ||
|
|
6d40b170d6 | ||
|
|
886e38a69b | ||
|
|
e30d0fefb0 | ||
|
|
42f7288d73 | ||
|
|
0e4c5d10c5 | ||
|
|
293ccfda8a | ||
|
|
004898e462 | ||
|
|
8ea6a50f03 | ||
|
|
9397720c8e | ||
|
|
f3d5a5c37b | ||
|
|
6896e920f9 | ||
|
|
0085623eee | ||
|
|
9deffc9d87 | ||
|
|
67f2e57635 | ||
|
|
b8a7c5ee9e | ||
|
|
578e83d80a | ||
|
|
fef6f5c0a5 | ||
|
|
98ba6b63a4 | ||
|
|
764aacb568 | ||
|
|
c0486f6f65 | ||
|
|
7de0e79c62 | ||
|
|
ddc8fbcff7 | ||
|
|
aa5214d3a1 | ||
|
|
b81a4e875b | ||
|
|
f863ee9e37 | ||
|
|
4abdac2abf | ||
|
|
4990c797d1 | ||
|
|
832be21c0f | ||
|
|
70c66d4cf1 | ||
|
|
f54a54a432 | ||
|
|
7caaed4218 | ||
|
|
8b25e2a63e | ||
|
|
97d614285e | ||
|
|
e1bafd2f6e | ||
|
|
9a2dac7182 | ||
|
|
b524de417b | ||
|
|
9a29c0e22d | ||
|
|
3b20cc7b53 | ||
|
|
b192335e56 | ||
|
|
591f022e9a | ||
|
|
13c84b0523 | ||
|
|
589c6f8a0b | ||
|
|
210b489a6c | ||
|
|
a2c70dba85 | ||
|
|
54738e29eb | ||
|
|
bbe4417be5 | ||
|
|
f1f319d6ad | ||
|
|
13b55b04a8 | ||
|
|
009172951c | ||
|
|
ecd82297a0 | ||
|
|
e806f51b3d | ||
|
|
de0e8aeced | ||
|
|
e84e0e1233 | ||
|
|
1a7e99f67e | ||
|
|
e575df6df0 | ||
|
|
3faa035de3 | ||
|
|
e6b395e2ee | ||
|
|
511e5ad5e8 | ||
|
|
75cb19d7e1 | ||
|
|
a670b7979c | ||
|
|
65863614bb | ||
|
|
0eb4cd6dd4 | ||
|
|
7d00159bff | ||
|
|
5d18da4035 | ||
|
|
3ea6041714 | ||
|
|
9226472380 | ||
|
|
208d86b5bf | ||
|
|
6955499534 | ||
|
|
60bf396e25 | ||
|
|
dbccb8b231 | ||
|
|
fcf00dea8b | ||
|
|
3dc2b69615 | ||
|
|
377da9349e | ||
|
|
75fffd1f47 | ||
|
|
3a91aa3d36 | ||
|
|
3ab50facc7 | ||
|
|
28ee9bcd9b | ||
|
|
d7eee91195 | ||
|
|
26b46d248b | ||
|
|
8301b01395 | ||
|
|
2ce1c29c4d | ||
|
|
d8ae3c161c | ||
|
|
99f2d0e3d5 | ||
|
|
60623e3061 | ||
|
|
ba3f97d50a | ||
|
|
daddc61dc6 | ||
|
|
d1782dc4bb | ||
|
|
c029e8770c | ||
|
|
364e31fdb1 | ||
|
|
78a3ac46dd | ||
|
|
7db1b4b337 | ||
|
|
b2da95de4b | ||
|
|
d0216c80cd | ||
|
|
4542c689e8 | ||
|
|
ae6ecb7103 | ||
|
|
1ef4c379b2 | ||
|
|
4ef6254c13 | ||
|
|
184c2e52d5 | ||
|
|
d57b4844d1 | ||
|
|
a21ee997ba | ||
|
|
1ee2da76af | ||
|
|
cf37566606 | ||
|
|
843334627e | ||
|
|
8d7d1412c9 | ||
|
|
0df6cebff9 | ||
|
|
a6fb72c240 | ||
|
|
32d35386ba | ||
|
|
4d71d2b1e8 | ||
|
|
919e2d39f1 | ||
|
|
d9a2c66909 | ||
|
|
c845d85a31 | ||
|
|
643e4592c5 | ||
|
|
adf8422391 | ||
|
|
398c527e1a | ||
|
|
ba7e0e7da3 | ||
|
|
25aa1688e5 | ||
|
|
2e4ffb3591 | ||
|
|
b4c2cd0eb2 | ||
|
|
ea653ceec8 | ||
|
|
f1bce39fa9 | ||
|
|
d34a63944b | ||
|
|
48b2ece5a1 | ||
|
|
762fed6f8d | ||
|
|
8a7e13a50c | ||
|
|
b92f5efbe8 | ||
|
|
14d550de0f | ||
|
|
31cc1f5541 | ||
|
|
0823ee4ad3 | ||
|
|
e16de02cb2 | ||
|
|
8663a5027b | ||
|
|
00bdeb6bcf | ||
|
|
cd0186dde5 | ||
|
|
4f27dd35d8 | ||
|
|
9fb4514b4e | ||
|
|
c82aeb586f | ||
|
|
bcb4813615 | ||
|
|
d1659b8e69 | ||
|
|
23505799b6 | ||
|
|
8f8f94e697 | ||
|
|
8f6f5e42c6 | ||
|
|
0235caa1e0 | ||
|
|
bf1d804a5e | ||
|
|
7ffd2bcaa1 | ||
|
|
71a396a189 | ||
|
|
7d5a84ce8a | ||
|
|
5967f96047 | ||
|
|
fc2975f346 | ||
|
|
e428b66ab4 | ||
|
|
4117a5df2d | ||
|
|
f56e01104b | ||
|
|
03e2f1a903 | ||
|
|
20916c75bb | ||
|
|
cf7b40268b | ||
|
|
0efe92ab4c | ||
|
|
f123f5e57b | ||
|
|
77c7d02873 | ||
|
|
0b82cb8050 | ||
|
|
4bae5e755a | ||
|
|
5861f6a148 | ||
|
|
69872c99d2 | ||
|
|
02a285665b | ||
|
|
e01344f0da | ||
|
|
3036ee01ad | ||
|
|
1e308e34f9 | ||
|
|
30acfc20c3 | ||
|
|
13a937fad7 | ||
|
|
cc11efa420 | ||
|
|
a177cf159b | ||
|
|
aa823e2b28 | ||
|
|
393566155d | ||
|
|
48bf1702d4 | ||
|
|
169e66835d | ||
|
|
91b6258f13 | ||
|
|
dbfa1726d5 | ||
|
|
bebe39102c | ||
|
|
6617969d36 | ||
|
|
50ed564bf6 | ||
|
|
a0ca05d18e | ||
|
|
74158e52be | ||
|
|
f9ba90f4ca | ||
|
|
15609f36ad | ||
|
|
2ac3d4d2cd | ||
|
|
8b7a0a060c | ||
|
|
716b7b0cec | ||
|
|
7d510310ed | ||
|
|
36ea408ed2 | ||
|
|
fa1601f04f | ||
|
|
8ca3f13bd2 | ||
|
|
cd11ebbc8a | ||
|
|
ae314916cf | ||
|
|
69107621bf | ||
|
|
fe1f10e797 | ||
|
|
9c28d0c112 | ||
|
|
25b99d5997 | ||
|
|
a34f5d110c | ||
|
|
bd4f2bf1cb | ||
|
|
94942e636c | ||
|
|
3bce782943 | ||
|
|
8e2b065ece | ||
|
|
dc76b81780 | ||
|
|
aafd7e91cc | ||
|
|
83a9724270 | ||
|
|
53223be376 | ||
|
|
e83e0e1374 | ||
|
|
fa48fc1905 | ||
|
|
f994c4f8a1 | ||
|
|
77f6b4ff59 | ||
|
|
2b5e0c2c31 | ||
|
|
85509e1a40 | ||
|
|
e826e83530 | ||
|
|
d68f411e82 | ||
|
|
4483725185 | ||
|
|
6a66e749f6 | ||
|
|
39b4da5ca2 | ||
|
|
09d9f28fe1 | ||
|
|
7b3a95288e | ||
|
|
12839f6f50 | ||
|
|
19f8ba75bc | ||
|
|
52c58721e1 | ||
|
|
7e25ecb3dc | ||
|
|
dd4b2e3e88 | ||
|
|
3885815c1d | ||
|
|
6b61e9d84b | ||
|
|
1c72a4d078 | ||
|
|
7af4cbb75e | ||
|
|
fdc70f3c30 | ||
|
|
34f6ba4ee8 | ||
|
|
e2a1c13439 | ||
|
|
109ef38d69 | ||
|
|
96ef1ed3bd | ||
|
|
8844310bf4 | ||
|
|
3e1de0b1ad | ||
|
|
6d9d5ecb4b | ||
|
|
96dfe5656d | ||
|
|
b17feb4580 | ||
|
|
d8bc769758 | ||
|
|
cbf7f91cfb | ||
|
|
4679ba77c4 | ||
|
|
b479909e25 | ||
|
|
33f4d1e0ee | ||
|
|
58fe110419 | ||
|
|
7165d414c7 | ||
|
|
6f98a75fb8 | ||
|
|
bfa1fbc2cd | ||
|
|
8c4c83b207 | ||
|
|
729039ba04 | ||
|
|
38ab64c3c3 | ||
|
|
818894bb56 | ||
|
|
9dfbfab648 | ||
|
|
29317c3316 | ||
|
|
643eb5c4cc | ||
|
|
9dae49dc18 | ||
|
|
83720975f8 | ||
|
|
e2c4fec253 | ||
|
|
2a4aef0b58 | ||
|
|
6bb23cdda5 | ||
|
|
1ee12e696e | ||
|
|
ff30a89a49 | ||
|
|
2f5742bc1b | ||
|
|
8a180e63b2 | ||
|
|
43c67ba09f | ||
|
|
95cf0e1264 | ||
|
|
0c1f2328f9 | ||
|
|
2394b39f6f | ||
|
|
0fbf07fef1 | ||
|
|
526dbebadc | ||
|
|
c47634b2ee | ||
|
|
89bdd3bc2c | ||
|
|
bb93a86528 | ||
|
|
e5b095bfdf | ||
|
|
100b85a7b0 | ||
|
|
c6e61e2d23 | ||
|
|
a417b75c1f | ||
|
|
d5c0fdd557 | ||
|
|
0391a028c5 | ||
|
|
56c228d009 | ||
|
|
3a50a754aa | ||
|
|
4f2d37b6a3 | ||
|
|
89052079b7 | ||
|
|
14b69d15f1 | ||
|
|
760694582e | ||
|
|
f05629b3c3 | ||
|
|
fdd79a385a | ||
|
|
d7e277d0f5 | ||
|
|
414f4828d6 | ||
|
|
0c54cbd9cc | ||
|
|
3d22ec4ca8 | ||
|
|
b06526781c | ||
|
|
6be1ab80d2 | ||
|
|
19a00bbe27 | ||
|
|
871388d2c0 | ||
|
|
e2526621d1 | ||
|
|
561581cf8b | ||
|
|
a86ea051bf | ||
|
|
0c091e868c | ||
|
|
7298cbd119 | ||
|
|
b0e0d18883 | ||
|
|
ba1e985d2f | ||
|
|
a83f298db1 | ||
|
|
0361609631 | ||
|
|
03580bcfec | ||
|
|
b4df86a17e | ||
|
|
7cac81857d | ||
|
|
c34e582f1a | ||
|
|
0f34bbc161 | ||
|
|
7f66376315 | ||
|
|
e93383c859 | ||
|
|
dd37d0e736 | ||
|
|
9ef439ba23 | ||
|
|
fb27d44840 | ||
|
|
3deeaa21c7 | ||
|
|
d091cfd508 | ||
|
|
377f031860 | ||
|
|
010eda74df | ||
|
|
ecf953a125 | ||
|
|
c608e15943 | ||
|
|
dc5b209f7f | ||
|
|
9306704c1d | ||
|
|
ab2c4387b8 | ||
|
|
01ab16d7d6 | ||
|
|
e9aa316007 | ||
|
|
6b625e368b | ||
|
|
efeb00e4a5 | ||
|
|
6baf5d0b18 | ||
|
|
9c824584b3 | ||
|
|
700bb64d2d | ||
|
|
d1e879e03f | ||
|
|
9895f879f9 | ||
|
|
9f2c351057 | ||
|
|
b9f2f7bcb4 | ||
|
|
0c555e6e7d | ||
|
|
6b6639f620 | ||
|
|
f273be6597 | ||
|
|
e8ddecc8b1 | ||
|
|
ecba1d78c2 | ||
|
|
0a3e46b88d | ||
|
|
eaf447759f | ||
|
|
7e2bd66417 | ||
|
|
379c11e1ce | ||
|
|
9755240cac | ||
|
|
8190178fc9 | ||
|
|
6ddef67cd9 | ||
|
|
3c993168c4 | ||
|
|
43953c8efa | ||
|
|
3b615fa312 | ||
|
|
637bbeb2a7 | ||
|
|
9a994eab47 | ||
|
|
0170c426ee | ||
|
|
788ac5f41d | ||
|
|
9e8d559c1b | ||
|
|
554a725d1a | ||
|
|
9e43719ffb | ||
|
|
d0f793b7a0 | ||
|
|
d6d15db6e8 | ||
|
|
f67d3dc165 | ||
|
|
29a2d2a9f7 | ||
|
|
169e986b28 | ||
|
|
3d2d45e01f | ||
|
|
3f6b9c9434 | ||
|
|
41fe103fa4 | ||
|
|
6576a49178 | ||
|
|
77adbdfa7a | ||
|
|
a37f114e4b | ||
|
|
8d09be7134 | ||
|
|
0ec1f33304 | ||
|
|
6a276a408d | ||
|
|
0f9e269057 | ||
|
|
94c4d420a6 | ||
|
|
7ccc45b276 | ||
|
|
9b90129b24 | ||
|
|
183b51a1c0 | ||
|
|
dd72408a88 | ||
|
|
4e053c4c0a | ||
|
|
af1cd64018 | ||
|
|
966034e4f7 | ||
|
|
bad401bc17 | ||
|
|
6078fe7b02 | ||
|
|
a5991aee03 | ||
|
|
a670e225cd | ||
|
|
d5d0262b4c | ||
|
|
c36ceab2a0 | ||
|
|
dc54128c77 | ||
|
|
36bcd26305 | ||
|
|
90fb37c220 | ||
|
|
b06a6d1aef | ||
|
|
a12d41b1bc | ||
|
|
c793b18c44 | ||
|
|
4afe025c75 | ||
|
|
c3a920774b | ||
|
|
ab7d446e25 | ||
|
|
db658e491f | ||
|
|
89daf91c0b | ||
|
|
6c8ec8ed95 | ||
|
|
2d95488906 | ||
|
|
824c950824 | ||
|
|
e23cbbac13 | ||
|
|
362ace01da | ||
|
|
7b95509970 | ||
|
|
88da6da3a7 | ||
|
|
8b435059f7 | ||
|
|
46ea218d0f | ||
|
|
a13d4bdded | ||
|
|
54bf8c2d2a | ||
|
|
3ecb5b89ff | ||
|
|
e4c36378ac | ||
|
|
d84477c1c0 | ||
|
|
1100cc67da | ||
|
|
f3b63d9c2c | ||
|
|
1aa695580b | ||
|
|
31c8644716 | ||
|
|
1d15d840ac | ||
|
|
097ce52060 | ||
|
|
f731d5632c | ||
|
|
dddea56c2c | ||
|
|
2dd6321c74 | ||
|
|
afee1ab975 | ||
|
|
a3ec0d776c | ||
|
|
09c27f430d | ||
|
|
8792973c08 | ||
|
|
29954d2ff9 | ||
|
|
deb88a5a6d | ||
|
|
1948233d1f | ||
|
|
5673feb48f | ||
|
|
f1e01511b9 | ||
|
|
2f37816608 | ||
|
|
bfff0197d7 | ||
|
|
c1746f2549 | ||
|
|
254f325f29 | ||
|
|
1f588821b4 | ||
|
|
9fdcfedd96 | ||
|
|
05c950156a | ||
|
|
c2cc1af2ac | ||
|
|
5d0b4563a8 | ||
|
|
993e76e3a1 | ||
|
|
f210d6d0e1 | ||
|
|
1cedea6606 | ||
|
|
2a1ece194d | ||
|
|
759e6ff925 | ||
|
|
c764d76aee | ||
|
|
cc29ea912b | ||
|
|
9578da0cfb | ||
|
|
0aed05a413 | ||
|
|
3ebbdbb48f | ||
|
|
b66f4aef07 | ||
|
|
8d997f17ec | ||
|
|
17fefda8fd | ||
|
|
2f4f508d1a | ||
|
|
6f3fa14c53 | ||
|
|
023d3faf3c | ||
|
|
e32da90f5a | ||
|
|
56e8b1cfb4 | ||
|
|
109ec71877 | ||
|
|
a4ceb41938 | ||
|
|
33dd188f9b | ||
|
|
7b31ec26ea | ||
|
|
0168c2e46f | ||
|
|
b0c1ef04a1 | ||
|
|
55697dea28 | ||
|
|
82a158bdd2 | ||
|
|
da2fd4f80f | ||
|
|
58949ed856 | ||
|
|
e732b744b7 | ||
|
|
5acff857e7 | ||
|
|
b839cea4de | ||
|
|
4dd148a731 | ||
|
|
f333acc183 | ||
|
|
5307e5ea3f | ||
|
|
53765ebd0f | ||
|
|
b2e25c8f6b | ||
|
|
3061fc6941 | ||
|
|
d36a085449 | ||
|
|
e1a5599f6a | ||
|
|
3023c5b9e6 | ||
|
|
b206442418 | ||
|
|
f677eb8c50 | ||
|
|
a0fd3eec19 | ||
|
|
5b707d4275 | ||
|
|
e53deb62be | ||
|
|
6580ece2bb | ||
|
|
38172c4f20 | ||
|
|
70be904979 | ||
|
|
d30efdaa71 | ||
|
|
e13075f6ff | ||
|
|
73f77115e1 | ||
|
|
68d943d98d | ||
|
|
45c0e27c36 | ||
|
|
f533f6b654 | ||
|
|
d43581719b | ||
|
|
88ccf64379 | ||
|
|
ccdbd5aae5 | ||
|
|
ce56ac90a8 | ||
|
|
639000a603 | ||
|
|
6cc8104ad3 | ||
|
|
cec83abc3e | ||
|
|
5afd564986 | ||
|
|
46d16ba0ca | ||
|
|
0467222e46 | ||
|
|
1208dab3e9 | ||
|
|
272bfceaf8 | ||
|
|
b6319c9a68 | ||
|
|
368194f293 | ||
|
|
0fc60e9957 | ||
|
|
369d692a90 | ||
|
|
875edc540e | ||
|
|
2d08b5ff2c | ||
|
|
ca9f9b7563 | ||
|
|
b43625820e | ||
|
|
11ef2cb7d1 | ||
|
|
58d3314f7a | ||
|
|
65ec948cb0 | ||
|
|
781caff9e5 | ||
|
|
d04c6f4c01 | ||
|
|
ac67c10acd | ||
|
|
c3bed305c7 | ||
|
|
a9fcc5ff15 | ||
|
|
4e1012823f | ||
|
|
fecda5b094 | ||
|
|
a965d9ee9f | ||
|
|
3d7316906b | ||
|
|
892088ffac | ||
|
|
9095032014 | ||
|
|
f325046a95 | ||
|
|
2565e00e1d | ||
|
|
fef6359f75 | ||
|
|
2121a7dc9e | ||
|
|
907476f566 | ||
|
|
74f446948f | ||
|
|
d15f68d651 | ||
|
|
86001fd331 | ||
|
|
ad42496948 | ||
|
|
bebac2011b | ||
|
|
63c4feb6db | ||
|
|
66a167b4ed | ||
|
|
8b93c5a0a0 | ||
|
|
4a098aaee3 | ||
|
|
0e87922389 | ||
|
|
8844465188 | ||
|
|
2e08ccce03 | ||
|
|
a0d058b2fa | ||
|
|
e17d6aef70 | ||
|
|
711261171b | ||
|
|
42d02e064e | ||
|
|
9b039d76ea | ||
|
|
b2fc570328 | ||
|
|
c51265502d | ||
|
|
757ccf148b | ||
|
|
3e4d39b228 | ||
|
|
d7e838274e | ||
|
|
2cc5c7a776 | ||
|
|
daa03b5ef7 | ||
|
|
42abdb308a | ||
|
|
17f0d01e9f | ||
|
|
f72784dc38 | ||
|
|
31fd41ab14 | ||
|
|
44a9c181aa | ||
|
|
ccf6aa10ac | ||
|
|
a10d142752 | ||
|
|
c299bfa1cb | ||
|
|
499319fb99 | ||
|
|
461d85dfc3 | ||
|
|
087b4d04a6 | ||
|
|
3af5e530ca | ||
|
|
d9f554e10d | ||
|
|
d482b66af3 | ||
|
|
7efff5c3cf | ||
|
|
d0e198df93 | ||
|
|
e6efa741d2 | ||
|
|
552853a3b8 | ||
|
|
0cf4024194 | ||
|
|
ab40ab6208 | ||
|
|
a071c3521c | ||
|
|
6ae4b28db8 | ||
|
|
e1f8863bd2 | ||
|
|
1c3369a3f6 | ||
|
|
f2ce4db85a | ||
|
|
949edb694e | ||
|
|
7ebacba720 | ||
|
|
12338783cc | ||
|
|
82c791f9f5 | ||
|
|
e1a2c72587 | ||
|
|
dc246cd45b | ||
|
|
04bab7e436 | ||
|
|
6fc4aa68b6 | ||
|
|
99ba5a0da8 | ||
|
|
e292d8fa12 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -3,3 +3,4 @@
|
||||
/examples/*.html.png
|
||||
/examples/example-list.js
|
||||
/examples/example-list.xml
|
||||
/node_modules/
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
before_install:
|
||||
- "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 https://code.google.com/p/glsl-unit/ build/glsl-unit"
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
[](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
|
||||
http://openlayers.github.io/ol3/master/examples/. If you want to contribute
|
||||
to OpenLayers 3 please read the [CONTRIBUTING](CONTRIBUTING.md) page.
|
||||
Check out the [hosted examples](http://ol3js.org/en/master/examples/) or poke around the evolving [API docs](http://ol3js.org/en/master/apidoc/).
|
||||
|
||||
Please see our guide on [contributing](CONTRIBUTING.md) if you're interested in getting involved.
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
{
|
||||
"opts": {
|
||||
"recurse": true,
|
||||
"template": "doc/template",
|
||||
"tutorials": "doc/tutorials"
|
||||
"template": "apidoc/template"
|
||||
},
|
||||
"tags": {
|
||||
"allowUnknownTags": true
|
||||
@@ -13,8 +12,8 @@
|
||||
},
|
||||
"plugins": [
|
||||
"plugins/markdown",
|
||||
"doc/plugins/inheritdoc",
|
||||
"doc/plugins/exports"
|
||||
"apidoc/plugins/inheritdoc",
|
||||
"apidoc/plugins/exports"
|
||||
],
|
||||
"markdown": {
|
||||
"parser": "gfm"
|
||||
@@ -1,12 +1,14 @@
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
Projections
|
||||
-----------
|
||||
A {@link ol.Projection} defines which point on earth is represented by a pair of coordinates. Coordinates within OpenLayers can be used in various projections where some common projections are always supported, others can be used via Proj4js.
|
||||
A {@link ol.proj.Projection} defines which point on earth is represented by a pair of coordinates.
|
||||
Coordinates within OpenLayers can be used in various projections where some common projections are always supported,
|
||||
others can be used via [Proj4js](http://trac.osgeo.org/proj4js/).
|
||||
|
||||
Maps and Layers
|
||||
---------------
|
||||
@@ -14,4 +16,5 @@ A map in OpenLayers is essentially a staple of layers that is viewed from the to
|
||||
|
||||
Contributing
|
||||
------------
|
||||
See CONTRIBUTING.md for instructions on building and tesing OpenLayers. The file does also describe how to commit your changes to OpenLayers.
|
||||
See [CONTRIBUTING.md](https://github.com/openlayers/ol3/blob/master/CONTRIBUTING.md) for instructions
|
||||
on building and testing OpenLayers. The file does also describes how to commit your changes to OpenLayers.
|
||||
@@ -21,13 +21,7 @@
|
||||
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||
<div class="navbar-inner">
|
||||
<div class="container">
|
||||
<a class="brand" href="./">OpenLayers 3 API Documentation - <?js= title ?></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>
|
||||
<a class="brand" href="/"><img src="../resources/logo.png"> OpenLayers 3</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -47,6 +41,5 @@ allowtransparency="true" frameborder="0" scrolling="0" height="20" width="90"></
|
||||
</footer>
|
||||
|
||||
<script> prettyPrint(); </script>
|
||||
<script src="../resources/social-links.js" type="text/javascript"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,7 +1,5 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
from collections import defaultdict
|
||||
from itertools import ifilter
|
||||
from operator import attrgetter
|
||||
from optparse import OptionParser
|
||||
import re
|
||||
@@ -92,7 +90,7 @@ class Class(Exportable):
|
||||
lines.append(' */\n')
|
||||
lines.append('%s = function(options) {\n' % (self.export_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')
|
||||
# FIXME: we modify the user's options object
|
||||
lines.append(''.join(
|
||||
@@ -103,12 +101,8 @@ class Class(Exportable):
|
||||
{'o': o, 'base': b.name, 'ctor': k.export_name(),
|
||||
'extern': ol.extern_name()} \
|
||||
for o, ol, k, b in self.nested_options()))
|
||||
lines.append(' arg = {')
|
||||
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(' } else {\n')
|
||||
lines.append(' arg = /** @type {%s} */ (options);\n' % (self.object_literal.name,))
|
||||
lines.append(' }\n')
|
||||
lines.extend('\n'.join(' arg.%s = options.%s;' % (key, key) for key in sorted(self.object_literal.prop_types.keys())))
|
||||
lines.append('\n }\n')
|
||||
lines.append(' goog.base(this, arg);\n')
|
||||
lines.append('};\n')
|
||||
lines.append('goog.inherits(\n')
|
||||
@@ -124,11 +118,84 @@ class Class(Exportable):
|
||||
return '%sExport' % self.name
|
||||
|
||||
|
||||
class Function(Exportable):
|
||||
|
||||
def __init__(self, name, object_literal, return_type, objects):
|
||||
Exportable.__init__(self, name)
|
||||
self.object_literal = object_literal
|
||||
self.return_type = return_type
|
||||
self.objects = objects
|
||||
|
||||
__repr__ = simplerepr
|
||||
|
||||
def property_object_literal(self, object_literal, prop):
|
||||
prop_object_literal = None
|
||||
types = object_literal.prop_types[prop].split('|')
|
||||
for t in types:
|
||||
if t in self.objects:
|
||||
o = self.objects[t]
|
||||
if isinstance(o, ObjectLiteral):
|
||||
if prop_object_literal:
|
||||
raise RuntimeError('Multiple "literal" types found for '
|
||||
'option %s.%s: %s, %s.' %
|
||||
(object_literal.name, prop,
|
||||
prop_object_literal.name, o.name))
|
||||
prop_object_literal = o
|
||||
return prop_object_literal
|
||||
|
||||
def recursive_export(self, lines, prop, object_literal, local_var=None, depth=1):
|
||||
indent = ' ' * depth
|
||||
if not local_var:
|
||||
local_var = prop.split('.')[-1]
|
||||
lines.append('%s/** @type {%s} */\n' % (indent, object_literal.name))
|
||||
lines.append('%svar %s =\n' % (indent, local_var))
|
||||
lines.append('%s /** @type {%s} */\n' % (indent, object_literal.name))
|
||||
lines.append('%s (%s);\n' % (indent, prop))
|
||||
lines.append('%sif (goog.isDefAndNotNull(%s)) {\n' % (indent, prop))
|
||||
for key in sorted(object_literal.prop_types.keys()):
|
||||
prop_object_literal = self.property_object_literal(object_literal, key)
|
||||
if prop_object_literal:
|
||||
lv = self.recursive_export(lines, '%s.%s' % (prop, key),
|
||||
prop_object_literal, depth=depth + 1)
|
||||
lines.append('%s %s.%s =\n%s %s;\n' %
|
||||
(indent, local_var, key, indent, lv))
|
||||
else:
|
||||
lines.append('%s %s.%s =\n%s %s.%s;\n' %
|
||||
(indent, local_var, key, indent, prop, key))
|
||||
lines.append('%s}\n' % (indent,))
|
||||
return local_var
|
||||
|
||||
def export(self):
|
||||
lines = []
|
||||
local_var = 'arg'
|
||||
lines.append('\n\n')
|
||||
lines.append('/**\n')
|
||||
lines.append(' * @param {%s} options Options.\n' % (self.object_literal.extern_name(),))
|
||||
if self.return_type:
|
||||
lines.append(' * @return {%s} Return value.\n' % (self.return_type,))
|
||||
lines.append(' */\n')
|
||||
lines.append('%s = function(options) {\n' % (self.export_name(),))
|
||||
self.recursive_export(lines, 'options', self.object_literal,
|
||||
local_var=local_var)
|
||||
if self.return_type:
|
||||
lines.append(' return %s(%s);\n' % (self.name, local_var))
|
||||
else:
|
||||
lines.append(' %s(arg);\n' % (self.name,))
|
||||
lines.append('};\n')
|
||||
lines.append('goog.exportSymbol(\n')
|
||||
lines.append(' \'%s\',\n' % (self.name,))
|
||||
lines.append(' %s);\n' % (self.export_name(),))
|
||||
return ''.join(lines)
|
||||
|
||||
def export_name(self):
|
||||
return '%sExport' % self.name
|
||||
|
||||
class ObjectLiteral(Exportable):
|
||||
|
||||
def __init__(self, name):
|
||||
def __init__(self, name, objects):
|
||||
Exportable.__init__(self, name)
|
||||
self.prop_types = {}
|
||||
self.objects = objects
|
||||
|
||||
__repr__ = simplerepr
|
||||
|
||||
@@ -142,7 +209,12 @@ class ObjectLiteral(Exportable):
|
||||
for prop in sorted(self.prop_types.keys()):
|
||||
lines.append('\n\n')
|
||||
lines.append('/**\n')
|
||||
lines.append(' * @type {%s}\n' % (self.prop_types[prop],))
|
||||
prop_types = self.prop_types[prop].split('|')
|
||||
for i, t in enumerate(prop_types):
|
||||
if t in self.objects and isinstance(self.objects[t], ObjectLiteral):
|
||||
prop_types[i] = self.objects[t].extern_name()
|
||||
prop_types = '|'.join(prop_types)
|
||||
lines.append(' * @type {%s}\n' % (prop_types,))
|
||||
lines.append(' */\n')
|
||||
lines.append('%s.prototype.%s;\n' % (self.extern_name(), prop))
|
||||
return ''.join(lines)
|
||||
@@ -225,10 +297,10 @@ def main(argv):
|
||||
name = m.group('name')
|
||||
if name in objects:
|
||||
raise RuntimeError(line) # Name already defined
|
||||
object_literal = ObjectLiteral(name)
|
||||
object_literal = ObjectLiteral(name, objects)
|
||||
objects[name] = object_literal
|
||||
continue
|
||||
m = re.match(r'\*\s*@property\s*{(?P<type>.*)}\s*(?P<prop>\S+)', line)
|
||||
m = re.match(r'\*\s*@property\s*{(?P<type>.*?)}\s*(?P<prop>\S+)', line)
|
||||
if m:
|
||||
assert object_literal is not None
|
||||
prop = m.group('prop')
|
||||
@@ -266,6 +338,23 @@ def main(argv):
|
||||
objects[name] = symbol
|
||||
symbol.props.add(prop)
|
||||
continue
|
||||
m = re.match(r'@exportFunction\s+(?P<name>\S+)(?:\s+(?P<object_literal_name>\S+))?(?:\s+(?P<return_type>\S+))?\Z', line)
|
||||
if m:
|
||||
name = m.group('name')
|
||||
if name in objects:
|
||||
raise RuntimeError(line) # Name already defined
|
||||
object_literal_name = m.group('object_literal_name')
|
||||
if object_literal_name not in objects:
|
||||
raise RuntimeError(line)
|
||||
object_literal = objects[object_literal_name]
|
||||
if not isinstance(object_literal, ObjectLiteral):
|
||||
raise RuntimeError(line)
|
||||
return_type = m.group('return_type')
|
||||
function = Function(name, object_literal, return_type, objects)
|
||||
objects[name] = function
|
||||
# The require should only be for the namespace, not the function
|
||||
requires.add('.'.join(name.split('.')[0:-1]))
|
||||
continue
|
||||
m = re.match(r'@exportSymbol\s+(?P<name>\S+)(?:\s+(?P<export_as>\S+))?\Z', line)
|
||||
if m:
|
||||
name = m.group('name')
|
||||
|
||||
141
build.py
141
build.py
@@ -5,7 +5,7 @@ import gzip
|
||||
import json
|
||||
import os
|
||||
import os.path
|
||||
import re
|
||||
import regex as re
|
||||
import shutil
|
||||
import sys
|
||||
|
||||
@@ -72,7 +72,10 @@ if sys.platform == 'win32':
|
||||
else:
|
||||
variables.GIT = 'git'
|
||||
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.JSDOC = 'jsdoc'
|
||||
variables.NODE = 'node'
|
||||
@@ -142,8 +145,8 @@ SRC = [path
|
||||
if path.endswith('.js')
|
||||
if path not in SHADER_SRC]
|
||||
|
||||
PLOVR_JAR = 'build/plovr-eba786b34df9.jar'
|
||||
PLOVR_JAR_MD5 = '20eac8ccc4578676511cf7ccbfc65100'
|
||||
PLOVR_JAR = 'build/plovr-81ed862.jar'
|
||||
PLOVR_JAR_MD5 = '1c752daaf11ad6220b298e7d2ee2b87d'
|
||||
|
||||
PROJ4JS = 'build/proj4js/lib/proj4js-combined.js'
|
||||
PROJ4JS_ZIP = 'build/proj4js-1.1.0.zip'
|
||||
@@ -164,7 +167,7 @@ virtual('default', 'build')
|
||||
|
||||
|
||||
virtual('integration-test', 'lint', 'build', 'build-all',
|
||||
'test', 'build-examples', 'check-examples', 'doc')
|
||||
'test', 'build-examples', 'check-examples', 'apidoc')
|
||||
|
||||
|
||||
virtual('build', 'build/ol.css', 'build/ol.js',
|
||||
@@ -309,10 +312,11 @@ def examples_star_json(name, match):
|
||||
'../externs/bingmaps.js',
|
||||
'../externs/bootstrap.js',
|
||||
'../externs/geojson.js',
|
||||
'../externs/topojson.js',
|
||||
'../externs/oli.js',
|
||||
'../externs/proj4js.js',
|
||||
'../externs/tilejson.js',
|
||||
'../externs/w3c_device_sensor_event.js',
|
||||
'../externs/closure-compiler.js',
|
||||
],
|
||||
})
|
||||
with open(t.name, 'w') as f:
|
||||
@@ -456,17 +460,23 @@ def build_check_requires_timestamp(t):
|
||||
self.children = {}
|
||||
|
||||
def _build_re(self, key):
|
||||
if len(self.children) == 1:
|
||||
if key == '*':
|
||||
assert len(self.children) == 0
|
||||
# We want to match `.doIt` but not `.SomeClass` or `.more.stuff`
|
||||
return '(?=\\.[a-z]\\w*\\b(?!\\.))'
|
||||
elif len(self.children) == 1:
|
||||
child_key, child = next(self.children.iteritems())
|
||||
child_re = '\\.' + child._build_re(child_key)
|
||||
child_re = child._build_re(child_key)
|
||||
if child_key != '*':
|
||||
child_re = '\\.' + child_re
|
||||
if self.present:
|
||||
return key + '(' + child_re + ')?'
|
||||
else:
|
||||
return key + child_re
|
||||
elif self.children:
|
||||
children_re = '(?:\\.(?:' + '|'.join(
|
||||
self.children[k]._build_re(k)
|
||||
for k in sorted(self.children.keys())) + '))'
|
||||
children_re = '(?:' + '|'.join(
|
||||
('\\.' if k != '*' else '') + self.children[k]._build_re(k)
|
||||
for k in sorted(self.children.keys())) + ')'
|
||||
if self.present:
|
||||
return key + children_re + '?'
|
||||
else:
|
||||
@@ -484,7 +494,14 @@ def build_check_requires_timestamp(t):
|
||||
if component not in node.children:
|
||||
node.children[component] = Node()
|
||||
node = node.children[component]
|
||||
node.present = True
|
||||
if component[0].islower():
|
||||
# We've arrived at a namespace provide like `ol.foo`.
|
||||
# In this case, we want to match uses like `ol.foo.doIt()` but
|
||||
# not match things like `new ol.foo.SomeClass()`.
|
||||
# For this purpose, we use the special wildcard key for the child.
|
||||
node.children['*'] = Node()
|
||||
else:
|
||||
node.present = True
|
||||
provide_res = [child.build_re(key)
|
||||
for key, child in root.children.iteritems()]
|
||||
missing_count = 0
|
||||
@@ -574,29 +591,15 @@ def plovr_jar(t):
|
||||
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('apidoc', 'build/jsdoc-%(BRANCH)s-timestamp' % vars(variables))
|
||||
|
||||
|
||||
@target('build/jsdoc-%(BRANCH)s-timestamp' % vars(variables), 'host-resources',
|
||||
'build/src/external/src/exports.js', 'build/src/external/src/types.js',
|
||||
SRC, SHADER_SRC, ifind('doc/template'))
|
||||
SRC, SHADER_SRC, ifind('apidoc/template'))
|
||||
def jsdoc_BRANCH_timestamp(t):
|
||||
t.run('%(JSDOC)s', '-c', 'doc/conf.json', 'src', 'doc/index.md',
|
||||
'-d', 'build/gh-pages/%(BRANCH)s/apidoc')
|
||||
t.run('%(JSDOC)s', '-c', 'apidoc/conf.json', 'src', 'apidoc/index.md',
|
||||
'-d', 'build/hosted/%(BRANCH)s/apidoc')
|
||||
t.touch()
|
||||
|
||||
|
||||
@@ -634,15 +637,15 @@ def split_example_file(example, dst_dir):
|
||||
|
||||
@target('host-resources', phony=True)
|
||||
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.cp_r('resources', resources_dir)
|
||||
|
||||
|
||||
@target('host-examples', 'build', 'host-resources', 'examples', phony=True)
|
||||
def host_examples(t):
|
||||
examples_dir = 'build/gh-pages/%(BRANCH)s/examples'
|
||||
build_dir = 'build/gh-pages/%(BRANCH)s/build'
|
||||
examples_dir = 'build/hosted/%(BRANCH)s/examples'
|
||||
build_dir = 'build/hosted/%(BRANCH)s/build'
|
||||
t.rm_rf(examples_dir)
|
||||
t.makedirs(examples_dir)
|
||||
t.rm_rf(build_dir)
|
||||
@@ -657,30 +660,27 @@ def host_examples(t):
|
||||
t.cp('examples/index.html', 'examples/example-list.js',
|
||||
'examples/example-list.xml', 'examples/Jugl.js',
|
||||
'examples/jquery.min.js', examples_dir)
|
||||
t.rm_rf('build/gh-pages/%(BRANCH)s/closure-library')
|
||||
t.makedirs('build/gh-pages/%(BRANCH)s/closure-library')
|
||||
with t.chdir('build/gh-pages/%(BRANCH)s/closure-library'):
|
||||
t.rm_rf('build/hosted/%(BRANCH)s/closure-library')
|
||||
t.makedirs('build/hosted/%(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, 'third_party')
|
||||
t.rm_rf('build/gh-pages/%(BRANCH)s/ol')
|
||||
t.makedirs('build/gh-pages/%(BRANCH)s/ol')
|
||||
t.cp_r('src/ol', 'build/gh-pages/%(BRANCH)s/ol/ol')
|
||||
t.rm_rf('build/hosted/%(BRANCH)s/ol')
|
||||
t.makedirs('build/hosted/%(BRANCH)s/ol')
|
||||
t.cp_r('src/ol', 'build/hosted/%(BRANCH)s/ol/ol')
|
||||
t.run('%(PYTHON)s', 'bin/closure/depswriter.py',
|
||||
'--root_with_prefix', 'src ../../../ol',
|
||||
'--root', 'build/gh-pages/%(BRANCH)s/closure-library/closure/goog',
|
||||
'--root_with_prefix', 'build/gh-pages/%(BRANCH)s/closure-library/'
|
||||
'--root', 'build/hosted/%(BRANCH)s/closure-library/closure/goog',
|
||||
'--root_with_prefix', 'build/hosted/%(BRANCH)s/closure-library/'
|
||||
'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)
|
||||
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 = \
|
||||
[e + '?mode=raw' for e in examples] + \
|
||||
[e + '?mode=whitespace' for e in examples] + \
|
||||
[e + '?mode=simple' for e in examples] + \
|
||||
examples
|
||||
[e + '?mode=advanced' for e in examples]
|
||||
for example in all_examples:
|
||||
t.run('%(PHANTOMJS)s', 'bin/check-example.js', example)
|
||||
|
||||
@@ -707,7 +707,7 @@ virtual('test-deps', INTERNAL_SRC, PROJ4JS, 'build/test/requireall.js')
|
||||
|
||||
@target('test', 'test-deps', phony=True)
|
||||
def test(t):
|
||||
t.run('%(PHANTOMJS)s', 'test/mocha-phantomjs.coffee', 'test/ol.html')
|
||||
t.run('%(PHANTOMJS)s', 'test/mocha-phantomjs.js', 'test/ol.html')
|
||||
|
||||
|
||||
@target('fixme', phony=True)
|
||||
@@ -755,5 +755,50 @@ def check_dependencies(t):
|
||||
print 'For certain targets all above programs need to be present.'
|
||||
|
||||
|
||||
@target('help')
|
||||
def display_help(t):
|
||||
print '''
|
||||
build.py - The OpenLayers 3 build script.
|
||||
|
||||
Usage:
|
||||
./build.py [options] [target] (on Unix-based machines)
|
||||
<python-executable.exe> build.py [options] [target] (on Windows machines)
|
||||
|
||||
There is one option:
|
||||
-c - Cleans up the repository from previous builds.
|
||||
|
||||
The most common targets are:
|
||||
serve - Serves files through plovr, usually on port 9810.
|
||||
lint - Runs gjslint on all sourcefiles to enforce specific syntax.
|
||||
build - Builds singlefile versions of OpenLayers JavaScript and
|
||||
CSS. This is also the default build target which runs when
|
||||
no target is specified.
|
||||
test - Runs the testsuite and displays the results.
|
||||
check - Runs the lint-target, builds some OpenLayers files, and
|
||||
then runs test. Many developers call this target often
|
||||
while working on the code.
|
||||
help - Shows this help.
|
||||
|
||||
Other less frequently used targets are:
|
||||
apidoc - Builds the API-Documentation using JSDoc3.
|
||||
integration-test - Builds all examples in various modes and usually tales a
|
||||
long time to finish. This target calls the following
|
||||
targets: lint, build, build-all, test, build-examples,
|
||||
check-examples and apidoc.
|
||||
reallyclean - Remove untracked files from the repository.
|
||||
checkdeps - Checks whether all required development software is
|
||||
installed on your machine.
|
||||
fixme - Will print a list of parts of the code that are marked
|
||||
with either TODO or FIXME.
|
||||
todo - is an alias for the fixme-target
|
||||
plovr - Fetches the required plovr.jar. Usually called by other
|
||||
targets that depend on plovr.
|
||||
|
||||
If no target is given, the build-target will be executed.
|
||||
|
||||
The above list is not complete, please see the sourceode for not-mentioned and
|
||||
only seldomly called targets.
|
||||
'''
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
@@ -42,10 +42,11 @@
|
||||
"//json.js",
|
||||
"../externs/bingmaps.js",
|
||||
"../externs/geojson.js",
|
||||
"../externs/topojson.js",
|
||||
"../externs/oli.js",
|
||||
"../externs/proj4js.js",
|
||||
"../externs/tilejson.js",
|
||||
"../externs/w3c_device_sensor_event.js"
|
||||
"../externs/closure-compiler.js"
|
||||
],
|
||||
|
||||
"level": "VERBOSE",
|
||||
@@ -99,7 +100,8 @@
|
||||
"goog.debug.logRecordSerializer",
|
||||
"goog.debug.makeWhitespaceVisible",
|
||||
"goog.debug.normalizeErrorObject",
|
||||
"goog.debug.reflect"
|
||||
"goog.debug.reflect",
|
||||
"goog.log"
|
||||
]
|
||||
|
||||
}
|
||||
|
||||
@@ -7,10 +7,11 @@
|
||||
"../build/src/external/externs/types.js",
|
||||
"../externs/bingmaps.js",
|
||||
"../externs/geojson.js",
|
||||
"../externs/topojson.js",
|
||||
"../externs/oli.js",
|
||||
"../externs/proj4js.js",
|
||||
"../externs/tilejson.js",
|
||||
"../externs/w3c_device_sensor_event.js"
|
||||
"../externs/closure-compiler.js"
|
||||
],
|
||||
|
||||
"inherits": "base.json",
|
||||
|
||||
@@ -16,10 +16,11 @@
|
||||
"//json.js",
|
||||
"../externs/bingmaps.js",
|
||||
"../externs/geojson.js",
|
||||
"../externs/topojson.js",
|
||||
"../externs/oli.js",
|
||||
"../externs/proj4js.js",
|
||||
"../externs/tilejson.js",
|
||||
"../externs/w3c_device_sensor_event.js"
|
||||
"../externs/closure-compiler.js"
|
||||
],
|
||||
|
||||
"inherits": "ol.json",
|
||||
|
||||
@@ -17,10 +17,11 @@
|
||||
"//json.js",
|
||||
"../externs/bingmaps.js",
|
||||
"../externs/geojson.js",
|
||||
"../externs/topojson.js",
|
||||
"../externs/oli.js",
|
||||
"../externs/proj4js.js",
|
||||
"../externs/tilejson.js",
|
||||
"../externs/w3c_device_sensor_event.js"
|
||||
"../externs/closure-compiler.js"
|
||||
],
|
||||
|
||||
"inherits": "ol.json",
|
||||
|
||||
@@ -17,10 +17,11 @@
|
||||
"../build/src/external/externs/types.js",
|
||||
"../externs/bingmaps.js",
|
||||
"../externs/geojson.js",
|
||||
"../externs/topojson.js",
|
||||
"../externs/oli.js",
|
||||
"../externs/proj4js.js",
|
||||
"../externs/tilejson.js",
|
||||
"../externs/w3c_device_sensor_event.js"
|
||||
"../externs/closure-compiler.js"
|
||||
],
|
||||
|
||||
"inherits": "base.json",
|
||||
|
||||
40
css/ol.css
40
css/ol.css
@@ -202,3 +202,43 @@ a.ol-full-screen-true:after {
|
||||
height: 20px;
|
||||
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";
|
||||
}
|
||||
|
||||
12
doc/index.hbs
Normal file
12
doc/index.hbs
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
title: Documentation
|
||||
layout: doc.hbs
|
||||
---
|
||||
|
||||
# Documentation
|
||||
|
||||
If you're eager to get your first OpenLayers 3 map on a page, dive into the [quick start](quickstart.html).
|
||||
|
||||
For a more in-depth overview of OpenLayers 3 core concepts, check out the [tutorials](tutorials/).
|
||||
|
||||
Find additional reference material in the [API docs](../apidoc).
|
||||
132
doc/quickstart.hbs
Normal file
132
doc/quickstart.hbs
Normal file
@@ -0,0 +1,132 @@
|
||||
---
|
||||
title: Quick Start
|
||||
layout: doc.hbs
|
||||
---
|
||||
|
||||
# Quick Start
|
||||
|
||||
## Put a map on a page
|
||||
|
||||
Below you'll find a complete working example. Create a new file, copy in the contents below, and open in a browser:
|
||||
|
||||
```xml
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<link rel="stylesheet" href="http://ol3js.org/en/{{ latest }}/build/ol.css" type="text/css">
|
||||
<style>
|
||||
.map {
|
||||
height: 400px;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
<script src="http://ol3js.org/en/{{ latest }}/build/ol.js" type="text/javascript"></script>
|
||||
<title>OpenLayers 3 example</title>
|
||||
</head>
|
||||
<body>
|
||||
<h2>My Map</h2>
|
||||
<div id="map" class="map"></div>
|
||||
<script type="text/javascript">
|
||||
var map = new ol.Map({
|
||||
target: 'map',
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.MapQuestOpenAerial()
|
||||
})
|
||||
],
|
||||
view: new ol.View2D({
|
||||
center: ol.proj.transform([37.41, 8.82], 'EPSG:4326', 'EPSG:3857'),
|
||||
zoom: 4
|
||||
})
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
## Understanding what is going on
|
||||
|
||||
To include a map a web page you will need 3 things:
|
||||
|
||||
1. Include OpenLayers
|
||||
2. `<div>` map container
|
||||
3. JavaScript to create a simple map
|
||||
|
||||
### Include OpenLayers
|
||||
|
||||
```xml
|
||||
<script src="http://ol3js.org/en/{{ latest }}/build/ol.js" type="text/javascript"></script>
|
||||
```
|
||||
|
||||
The first part is to include the JavaScript library. For the purpose of this tutorial, here we simply point to the ol3js.org website to get the whole library. In a production environment, we would build a custom version of the library including only the module needed for our application.
|
||||
|
||||
|
||||
### `<div>` to contain the map
|
||||
|
||||
```xml
|
||||
<div id="map" class="map"></div>
|
||||
```
|
||||
|
||||
The map in the application is contained in a [`<div>` HTML element](http://en.wikipedia.org/wiki/Span_and_div). Through this `<div>` the map properties like width, height and border can be controlled through CSS. Here's the CSS element used to make the map 400 pixels high and as wide as the browser window.
|
||||
|
||||
```xml
|
||||
<style>
|
||||
.map {
|
||||
height: 400px; width: 100%;
|
||||
}
|
||||
</style>
|
||||
```
|
||||
|
||||
### JavaScript to create a simple map
|
||||
|
||||
```js
|
||||
var map = new ol.Map({
|
||||
target: 'map',
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.MapQuestOpenAerial()
|
||||
})
|
||||
],
|
||||
view: new ol.View2D({
|
||||
center: ol.proj.transform([37.41, 8.82], 'EPSG:4326', 'EPSG:3857'),
|
||||
zoom: 4
|
||||
})
|
||||
});
|
||||
```
|
||||
|
||||
With this JavaScript code, a map object is created with a MapQuest Open Aerial layer zoomed on the African East coast. Let's break this down:
|
||||
|
||||
The following line creates an OpenLayers `Map` object. Just by itself, this does nothing since there's no layers or interaction attached to it.
|
||||
|
||||
```js
|
||||
var map = new ol.Map({ ... });
|
||||
```
|
||||
|
||||
To attach the map object to the `<div>`, the map object takes a `target` into arguments. The value is the `id` of the `<div>`:
|
||||
|
||||
```js
|
||||
target: 'map'
|
||||
```
|
||||
|
||||
The `layers: [ ... ]` array is used to define the list of layers available in the map. The first and only layer right now is a tiled layer:
|
||||
|
||||
```js
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.MapQuestOpenAerial()
|
||||
})
|
||||
]
|
||||
```
|
||||
|
||||
Layers in OpenLayers 3 are defined with a type (Image, Tile or Vector) which contains a source. The source is the protocol used to get the map tiles. You can consult the list of [available layer sources here](/en/{{ latest }}/apidoc/ol.source.html)
|
||||
|
||||
The next part of the `Map` object is the `View`. The view allow to specify the center, resolution, and rotation of the map. Right now, only `View2D` is supported, but other views should be available at some point. The simplest way to define a view is to define a center point and a zoom level. Note that zoom level 0 is zoomed out.
|
||||
|
||||
```js
|
||||
view: new ol.View2D({
|
||||
center: ol.proj.transform([37.41, 8.82], 'EPSG:4326', 'EPSG:3857'),
|
||||
zoom: 4
|
||||
})
|
||||
```
|
||||
|
||||
You will notice that the `center` specified is in lat/lon coordinates (EPSG:4326). Since the only layer we use is in Spherical Mercator projection (EPSG:3857), we can reproject them on the fly to be able to zoom the map on the right coordinates.
|
||||
73
doc/tutorials/concepts.hbs
Normal file
73
doc/tutorials/concepts.hbs
Normal file
@@ -0,0 +1,73 @@
|
||||
---
|
||||
title: Basic Concepts
|
||||
layout: doc.hbs
|
||||
---
|
||||
|
||||
# Basic Concepts
|
||||
|
||||
## Map
|
||||
The core component of OpenLayers 3 is the map (`ol.Map`). It is rendered to a `target` container (e.g. a `div` element on the web page that contains the map). All map properties can either be configured at construction time, or by using setter methods, e.g. `setTarget()`.
|
||||
|
||||
```xml
|
||||
<div id="map" style="width: 100%, height: 400px"></div>
|
||||
<script>
|
||||
var map = new ol.Map({target: 'map'});
|
||||
</script>
|
||||
```
|
||||
|
||||
## View
|
||||
`ol.Map` is not responsible for things like center, zoom level and projection of the map. Instead, these are properties of an `ol.View` instance - typically an `ol.View2D` for 2D maps. The reason for this abstraction is the idea of instantly switching e.g. between a 2D and a tilted 3D view, without the need to maintain two copies of the `layers`.
|
||||
|
||||
```js
|
||||
map.setView(new ol.View2D({
|
||||
center: [0, 0],
|
||||
zoom: 2
|
||||
}));
|
||||
```
|
||||
|
||||
An `ol.View2D` also has a `projection`. The projection determines the coordinate system of the `center` and the units for map resolution calculations. If not specified (like in the above snippet), the default projection is Spherical Mercator (EPSG:3857), with meters as map units.
|
||||
|
||||
The `zoom` option is a convenient way to specify the map resolution. The available zoom levels are determined by `maxZoom` (default: 28), `zoomFactor` (default: 2) and `maxResolution` (default is calculated in such a way that the projection's validity extent fits in a 256x256 pixel tile). Starting at zoom level 0 with a resolution of `maxResolution` units per pixel, subsequent zoom levels are calculated by dividing the previous zoom level's resolution by `zoomFactor`, until zoom level `maxZoom` is reached.
|
||||
|
||||
|
||||
## Source
|
||||
To get remote data for a layer, OpenLayers 3 uses `ol.source.Source` subclasses. These are available for free and commercial map tile services like OpenStreetMap or Bing, for OGC sources like WMS or WMTS, and for vector data in formats like GeoJSON or KML.
|
||||
|
||||
```js
|
||||
var osmSource = new ol.source.OSM();
|
||||
```
|
||||
|
||||
## Layer
|
||||
A layer is a visual representation of data from a `source`. OpenLayers 3 has three basic types of layers: `ol.layer.Tile`, `ol.layer.Image` and `ol.layer.Vector`.
|
||||
|
||||
`ol.layer.Tile` is for layer sources that provide pre-rendered, tiled images in grids that are organized by zoom levels for specific resolutions.
|
||||
|
||||
`ol.layer.Image` is for server rendered images that are available for arbitrary extents and resolutions.
|
||||
|
||||
`ol.layer.Vector` is for vector data that is rendered client-side.
|
||||
|
||||
```js
|
||||
var osmLayer = new ol.layer.Tile({source: osmSource});
|
||||
map.addLayer(osmLayer);
|
||||
```
|
||||
|
||||
## Putting it all together
|
||||
|
||||
|
||||
The above snippets can be conflated to a self contained map configuration with view and layers:
|
||||
|
||||
```xml
|
||||
<div id="map" style="width: 100%, height: 400px"></div>
|
||||
<script>
|
||||
new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.Tile({source: new ol.source.OSM()})
|
||||
],
|
||||
view: new ol.View2D({
|
||||
center: [0, 0],
|
||||
zoom: 2
|
||||
}),
|
||||
target: 'map'
|
||||
});
|
||||
</script>
|
||||
```
|
||||
8
doc/tutorials/index.hbs
Normal file
8
doc/tutorials/index.hbs
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
title: Tutorials
|
||||
layout: doc.hbs
|
||||
---
|
||||
|
||||
# Tutorials
|
||||
|
||||
We'll be putting together a more comprehensive set of tutorials here. For now, you can take a look at the [basic concepts](concepts.html) tutorial. Stay tuned for more!
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"title": "OpenLayers 3 Architecture"
|
||||
}
|
||||
@@ -1,274 +0,0 @@
|
||||
CLASS HIERARCHY
|
||||
===============
|
||||
|
||||
```
|
||||
goog.math.Coordinate // Simple 2D point
|
||||
|
|
||||
+- TileCoord
|
||||
|
||||
goog.math.Box
|
||||
|
|
||||
+- Extent // The extent of a single object in two dimensions, projection not stored
|
||||
|
|
||||
+- TileBounds // A range of tiles in two dimensions, integer coordinates, z not stored
|
||||
|
||||
|
||||
Projection
|
||||
|
||||
|
||||
goog.events.EventTarget
|
||||
|
|
||||
+- MVCObject
|
||||
| |
|
||||
| +- Camera
|
||||
| |
|
||||
| +- Control
|
||||
| | |
|
||||
| | +- ?
|
||||
| |
|
||||
| +- Layer
|
||||
| | |
|
||||
| | +- TileLayer
|
||||
| | | |
|
||||
| | | +- TMSTileLayer
|
||||
| | | |
|
||||
| | | +- WMTSTileLayer
|
||||
| | | |
|
||||
| | | +- XYZTileLayer / OSMTileLayer
|
||||
| | |
|
||||
| | +- VectorLayer
|
||||
| | |
|
||||
| | +- ImageLayer
|
||||
| |
|
||||
| +- LayerRenderer
|
||||
| |
|
||||
| +- LayerRendererOptions
|
||||
| |
|
||||
| +- Map
|
||||
| |
|
||||
| +- MapRenderer
|
||||
| | |
|
||||
| | +- HTMLMapRenderer
|
||||
| | |
|
||||
| | +- WebGLMapRenderer
|
||||
| |
|
||||
| +- MVCArray
|
||||
| | |
|
||||
| | +- ControlArray
|
||||
| | |
|
||||
| | +- LayerViewArray
|
||||
|
|
||||
| +- TileQueue
|
||||
|
|
||||
+- Tile
|
||||
```
|
||||
|
||||
|
||||
Layer renderer hierarchy
|
||||
------------------------
|
||||
|
||||
```
|
||||
goog.events.EventTarget
|
||||
|
|
||||
+- MVCObject
|
||||
|
|
||||
+- LayerRenderer
|
||||
|
|
||||
+- SingleTileLayerRenderer
|
||||
| |
|
||||
| +- HTMLSingleTileLayerRenderer
|
||||
| |
|
||||
| +- WebGLSingleTileLayerRenderer
|
||||
|
|
||||
+- TileLayerRenderer
|
||||
| |
|
||||
| +- HTMLTileLayerRenderer
|
||||
| |
|
||||
| +- WebGLTileLayerRenderer
|
||||
|
|
||||
+- VectorLayerRenderer
|
||||
| |
|
||||
| +- HTMLVectorLayerRenderer
|
||||
| | |
|
||||
| | +- SVGHTMLVectorLayerRenderer
|
||||
| | |
|
||||
| | +- Canvas2DHTMLVectorLayerRenderer
|
||||
| | |
|
||||
| | +- VMLHTMLVectorLayerRenderer
|
||||
| |
|
||||
| +- WebGLVectorLayerRenderer
|
||||
```
|
||||
|
||||
|
||||
OBJECT PROPERTIES AND METHODS
|
||||
=============================
|
||||
|
||||
Notation:
|
||||
|
||||
- `property type` property with type, trailing ? indicates unsure, getters and setters are assumed to exist.
|
||||
- `f(args) -> type` function taking args returning type.
|
||||
- `f(args) -> type = something` f is a trivial wrapper around something.
|
||||
- `fires 'x'` fires events of type 'x'.
|
||||
|
||||
Principles:
|
||||
|
||||
- All non-trivial objects inherit from `MVCObject`.
|
||||
- All non-trivial collections are either `MVCArrays` or a child class thereof.
|
||||
- Resolutions are `Array.<number>`, infinitely scalable resources (e.g. vectore layers) have resolutions == null.
|
||||
|
||||
```
|
||||
MVCObject
|
||||
as Google Maps MVCObject
|
||||
freeze()
|
||||
unfreeze()
|
||||
|
||||
TileCoord
|
||||
clone() -> TileCoord
|
||||
getHash() -> number
|
||||
|
||||
TileBounds
|
||||
forEachTileCoord(z, function(tileCoord))
|
||||
|
||||
Tile
|
||||
tileCoord TileCoord
|
||||
url string
|
||||
state UNLOADED | LOADING | LOADED
|
||||
fires 'loaded' // when loaded
|
||||
fires 'aborted' // when loading is aborted
|
||||
|
||||
Camera
|
||||
position goog.math.Coordinate
|
||||
resolution number
|
||||
rotation number
|
||||
|
||||
Layer
|
||||
projections Array.<Projection>
|
||||
extent Extent
|
||||
getResolutions() -> Array.<number>|null
|
||||
fires 'change' // when data changes
|
||||
|
||||
LayerArray
|
||||
getResolutions() -> Array.<number>|null
|
||||
getMaxResolution() = this.getResolutions()[0] | null
|
||||
|
||||
LayerRendererOptions
|
||||
layer Layer
|
||||
visible boolean
|
||||
opacity number
|
||||
brightness number
|
||||
color number
|
||||
hue number
|
||||
saturation number
|
||||
|
||||
Map
|
||||
projection Projection
|
||||
renderer Renderer
|
||||
layers LayerArray
|
||||
addLayer(layer) = layers.push(layer)
|
||||
getExtent() -> Extent
|
||||
getMaxResolution() = layers.getMaxResolution()
|
||||
|
||||
TileGrid
|
||||
resolutions Array.<number>
|
||||
extent ol.Extent
|
||||
xEast boolean
|
||||
ySouth boolean
|
||||
origin(s) Coord|Array.<Coord>
|
||||
tileSize goog.math.Size
|
||||
forEachTileCoordChild(tileCoord, function(z, TileBounds))
|
||||
forEachTileCoordParent(tileCoord, function(z, TileBounds))
|
||||
getExtentTileBounds(z, extent) -> TileBounds
|
||||
getTileCoord(coordinate) -> TileCoord
|
||||
getTileCoordCenter(tileCoord) -> goog.math.Coordinate
|
||||
getTileCoordExtent(tileCoord) -> ol.Extent
|
||||
getTileCoordResolution(tileCoord) -> number
|
||||
getZForResolution(resolution) -> number
|
||||
|
||||
TileLayer
|
||||
tileGrid TileGrid
|
||||
tileUrl function(tileCoord) -> string
|
||||
getTileCoordUrl(tileCoord) -> string = this.tileUrl(tileCoord)
|
||||
|
||||
TileQueue
|
||||
camera Camera // or maybe MVCArray.<Camera> ?
|
||||
getTileCoordPriority(tileCoord) -> number // private
|
||||
enqueueTile(Tile)
|
||||
|
||||
VectorLayer
|
||||
forEachFeature(resolution, extent, projection, function(Feature))
|
||||
|
||||
Renderer
|
||||
target HTMLDivElement
|
||||
map Map
|
||||
camera Camera
|
||||
getCapabilities() -> Array.<string> // maybe ?
|
||||
```
|
||||
|
||||
Questions:
|
||||
|
||||
- Store tile layer extent in TileLayer or in TileGrid? (not clear)
|
||||
|
||||
Two concepts: tile coordinate system range and and available data extent.
|
||||
TileGrid extent is range (or validity extent) of the tile coordinate system.
|
||||
TileLayer extent is the available data extent. A particular TileGrid may range
|
||||
from 0,0 to 10,10. My cache may conform to that grid but I may only have tiles
|
||||
ranging from 2,2 to 8,8. When you need to wrap multiple worlds, you pay
|
||||
attention to the TileGrid extent. When you need to decide whether or not to
|
||||
bother requesting a tile, you pay attention to the TileLayer extent.
|
||||
|
||||
- Who determines "best" resolution? (static function?)
|
||||
|
||||
|
||||
Todo: if tile layer extent stored in TileLayer rather than TileGrid then extent
|
||||
will occasionally need to be passed to TileGrid functions for cropping.
|
||||
|
||||
DESIGN ASSERTIONS
|
||||
=================
|
||||
|
||||
Map
|
||||
|
||||
- A map has a renderer (the map renderer).
|
||||
- A map has a camera.
|
||||
- Multiple maps can share the same camera.
|
||||
- A map has a layer list.
|
||||
|
||||
Layer
|
||||
|
||||
- A layer can have multiple projections (the supported projections).
|
||||
- A layer advertizes the projections it supports.
|
||||
- A layer returns no data if asked data for an unsupported projection.
|
||||
|
||||
LayerRendererOptions
|
||||
|
||||
- A layer renderer options object stores view-related states for a layer.
|
||||
- Options include visibility, opacity, saturation, hue, etc.
|
||||
- A layer renderer options object has a layer.
|
||||
- Multiple layer renderer options can share the same layer.
|
||||
- In other words a layer can be viewed in different manners.
|
||||
|
||||
Renderer
|
||||
|
||||
- The map renderer responds to events.
|
||||
- The map renderer receives events from the camera.
|
||||
- The map renderer creates layer renderers.
|
||||
|
||||
Control
|
||||
|
||||
- A control may listen to map events.
|
||||
- A control may listen to camera events.
|
||||
- A map navigation control acts on the camera.
|
||||
|
||||
MVC
|
||||
|
||||
- Types can be described in MVC terms.
|
||||
- Models don't know what rendering means.
|
||||
- Maps are models.
|
||||
- Layers are models.
|
||||
- Layer views are models (sorry!).
|
||||
- Cameras are models.
|
||||
- Layer lists are collections.
|
||||
- Renderers are views.
|
||||
- Controls are views or controllers or both.
|
||||
- An attribution control is a view.
|
||||
- A map navigation control is a controller.
|
||||
- A zoom slider control is both a view and a controller.
|
||||
60
examples/accessible.html
Normal file
60
examples/accessible.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>Accessibility example</title>
|
||||
<style>
|
||||
a.accesskey {
|
||||
color: #FFFFFF;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||
<div class="navbar-inner">
|
||||
<div class="container">
|
||||
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<a class="accesskey" onclick="document.getElementById('map').focus(); return false;" accesskey="1" href="">Go to map</a>
|
||||
<div id="map" class="map" tabindex="0"></div>
|
||||
<a class="zoom" accesskey="i" href="javascript: void map.getView().setZoom(map.getView().getZoom() + 1);">Zoom in</a>
|
||||
<a class="zoom" accesskey="o" href="javascript: void map.getView().setZoom(map.getView().getZoom() - 1);">Zoom out</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row-fluid">
|
||||
|
||||
<div class="span12">
|
||||
<h4 id="title">Accessibility example</h4>
|
||||
<p id="shortdesc">Example of an accessible map.</p>
|
||||
<div id="docs">
|
||||
<p>This page's <code>map</code> element has its <code>tabindex</code> attribute set to <code>"0"</code>. That makes is focusable. To focus the map element you can either navigate to it using the "tab" key, or use the <a href="http://en.wikipedia.org/wiki/Access_key">Access Key</a> "1" (alt+1 or ctrl+alt+1) which provides a direct access. When the <code>map</code> element is focused the + and - keys can be used to zoom in and out, and the arrow keys can be used to pan.</p>
|
||||
<p>When clicked the "Zoom in" and "Zoom out" links below the map zoom the map in and out, respectively. You can navigate to the links using the "tab" key, and press the "enter" key to trigger the zooming action. The Access Keys "i" and "o" can also be used, as a direct access to the actions of "Zoom in" and "Zoom out" links.</p>
|
||||
<p>See the source of the page to see how this done.</p>
|
||||
</div>
|
||||
<div id="tags">accessibility, tabindex</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="loader.js?id=accessible" type="text/javascript"></script>
|
||||
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
20
examples/accessible.js
Normal file
20
examples/accessible.js
Normal file
@@ -0,0 +1,20 @@
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.RendererHints');
|
||||
goog.require('ol.View2D');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.source.OSM');
|
||||
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
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 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">
|
||||
@@ -14,13 +15,7 @@
|
||||
<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>
|
||||
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -48,7 +43,7 @@
|
||||
|
||||
<div class="row-fluid">
|
||||
|
||||
<div class="span4">
|
||||
<div class="span12">
|
||||
<h4 id="title">Animation example</h4>
|
||||
<p id="shortdesc">Demonstrates animated pan, zoom, and rotation.</p>
|
||||
<div id="docs">
|
||||
@@ -62,7 +57,7 @@
|
||||
</div>
|
||||
|
||||
<script src="loader.js?id=animation" type="text/javascript"></script>
|
||||
<script src="../resources/social-links.js" type="text/javascript"></script>
|
||||
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,7 +3,7 @@ goog.require('ol.RendererHints');
|
||||
goog.require('ol.View2D');
|
||||
goog.require('ol.animation');
|
||||
goog.require('ol.easing');
|
||||
goog.require('ol.layer.TileLayer');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.source.OSM');
|
||||
|
||||
@@ -23,7 +23,7 @@ var view = new ol.View2D({
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.TileLayer({
|
||||
new ol.layer.Tile({
|
||||
preload: 4,
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
@@ -39,7 +39,7 @@ rotateLeft.addEventListener('click', function() {
|
||||
duration: 2000,
|
||||
rotation: -4 * Math.PI
|
||||
});
|
||||
map.addPreRenderFunction(rotateLeft);
|
||||
map.beforeRender(rotateLeft);
|
||||
}, false);
|
||||
var rotateRight = document.getElementById('rotate-right');
|
||||
rotateRight.addEventListener('click', function() {
|
||||
@@ -47,7 +47,7 @@ rotateRight.addEventListener('click', function() {
|
||||
duration: 2000,
|
||||
rotation: 4 * Math.PI
|
||||
});
|
||||
map.addPreRenderFunction(rotateRight);
|
||||
map.beforeRender(rotateRight);
|
||||
}, false);
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ panToLondon.addEventListener('click', function() {
|
||||
duration: 2000,
|
||||
source: view.getCenter()
|
||||
});
|
||||
map.addPreRenderFunction(pan);
|
||||
map.beforeRender(pan);
|
||||
view.setCenter(london);
|
||||
}, false);
|
||||
|
||||
@@ -68,7 +68,7 @@ elasticToMoscow.addEventListener('click', function() {
|
||||
easing: ol.easing.elastic,
|
||||
source: view.getCenter()
|
||||
});
|
||||
map.addPreRenderFunction(pan);
|
||||
map.beforeRender(pan);
|
||||
view.setCenter(moscow);
|
||||
}, false);
|
||||
|
||||
@@ -79,7 +79,7 @@ bounceToIstanbul.addEventListener('click', function() {
|
||||
easing: ol.easing.bounce,
|
||||
source: view.getCenter()
|
||||
});
|
||||
map.addPreRenderFunction(pan);
|
||||
map.beforeRender(pan);
|
||||
view.setCenter(istanbul);
|
||||
}, false);
|
||||
|
||||
@@ -97,7 +97,7 @@ spinToRome.addEventListener('click', function() {
|
||||
rotation: 2 * Math.PI,
|
||||
start: start
|
||||
});
|
||||
map.addPreRenderFunctions([pan, rotate]);
|
||||
map.beforeRender(pan, rotate);
|
||||
view.setCenter(rome);
|
||||
}, false);
|
||||
|
||||
@@ -115,7 +115,7 @@ flyToBern.addEventListener('click', function() {
|
||||
resolution: 4 * view.getResolution(),
|
||||
start: start
|
||||
});
|
||||
map.addPreRenderFunctions([pan, bounce]);
|
||||
map.beforeRender(pan, bounce);
|
||||
view.setCenter(bern);
|
||||
}, false);
|
||||
|
||||
@@ -138,6 +138,6 @@ spiralToMadrid.addEventListener('click', function() {
|
||||
rotation: -4 * Math.PI,
|
||||
start: start
|
||||
});
|
||||
map.addPreRenderFunctions([pan, bounce, rotate]);
|
||||
map.beforeRender(pan, bounce, rotate);
|
||||
view.setCenter(madrid);
|
||||
}, false);
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<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">
|
||||
@@ -14,13 +15,7 @@
|
||||
<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>
|
||||
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -40,6 +35,11 @@
|
||||
<p id="shortdesc">Demonstrates two-way binding of HTML input elements to OpenLayers objects.</p>
|
||||
<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>
|
||||
<div id="no-webgl" class="alert alert-warning" style="display: none">
|
||||
<h4>Warning!</h4>
|
||||
A browser that supports <a href="http://get.webgl.org/">WebGL</a> is required to change the
|
||||
<strong>hue</strong>, <strong>saturation</strong>, <strong>contrast</strong> and <strong>brightness</strong>.
|
||||
</div>
|
||||
</div>
|
||||
<div id="tags">input, bind, openstreetmap</div>
|
||||
</div>
|
||||
@@ -54,13 +54,13 @@
|
||||
<label>opacity</label>
|
||||
<input id="opacity" type="range" min="0" max="1" step="0.01"/>
|
||||
<label>hue</label>
|
||||
<input id="hue" type="range" min="-3.141592653589793" max="3.141592653589793" step="0.01"/>
|
||||
<input id="hue" class="webgl" type="range" min="-3.141592653589793" max="3.141592653589793" step="0.01"/>
|
||||
<label>saturation</label>
|
||||
<input id="saturation" type="range" min="0" max="5" step="0.01"/>
|
||||
<input id="saturation" class="webgl" type="range" min="0" max="5" step="0.01"/>
|
||||
<label>contrast</label>
|
||||
<input id="contrast" type="range" min="0" max="2" step="0.01"/>
|
||||
<input id="contrast" class="webgl" type="range" min="0" max="2" step="0.01"/>
|
||||
<label>brightness</label>
|
||||
<input id="brightness" type="range" min="-1" max="1" step="0.01"/>
|
||||
<input id="brightness" class="webgl" type="range" min="-1" max="1" step="0.01"/>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
@@ -82,7 +82,7 @@
|
||||
</div>
|
||||
|
||||
<script src="loader.js?id=bind-input" type="text/javascript"></script>
|
||||
<script src="../resources/social-links.js" type="text/javascript"></script>
|
||||
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -2,10 +2,24 @@ 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.layer.Tile');
|
||||
goog.require('ol.source.OSM');
|
||||
goog.require('ol.webgl');
|
||||
|
||||
var layer = new ol.layer.TileLayer({
|
||||
|
||||
if (!ol.webgl.SUPPORTED) {
|
||||
var inputs = document.getElementsByClassName('webgl');
|
||||
for (var i = 0, len = inputs.length; i < len; i++) {
|
||||
inputs[i].disabled = true;
|
||||
}
|
||||
var info = document.getElementById('no-webgl');
|
||||
/**
|
||||
* display warning message
|
||||
*/
|
||||
info.style.display = '';
|
||||
}
|
||||
|
||||
var layer = new ol.layer.Tile({
|
||||
source: new ol.source.OSM()
|
||||
});
|
||||
var map = new ol.Map({
|
||||
@@ -22,23 +36,23 @@ var visible = new ol.dom.Input(document.getElementById('visible'));
|
||||
visible.bindTo('checked', layer, 'visible');
|
||||
|
||||
var opacity = new ol.dom.Input(document.getElementById('opacity'));
|
||||
opacity.bindTo('value', layer, 'opacity');
|
||||
opacity.bindTo('valueAsNumber', layer, 'opacity');
|
||||
|
||||
var hue = new ol.dom.Input(document.getElementById('hue'));
|
||||
hue.bindTo('value', layer, 'hue');
|
||||
hue.bindTo('valueAsNumber', layer, 'hue');
|
||||
|
||||
var saturation = new ol.dom.Input(document.getElementById('saturation'));
|
||||
saturation.bindTo('value', layer, 'saturation');
|
||||
saturation.bindTo('valueAsNumber', layer, 'saturation');
|
||||
|
||||
var contrast = new ol.dom.Input(document.getElementById('contrast'));
|
||||
contrast.bindTo('value', layer, 'contrast');
|
||||
contrast.bindTo('valueAsNumber', layer, 'contrast');
|
||||
|
||||
var brightness = new ol.dom.Input(document.getElementById('brightness'));
|
||||
brightness.bindTo('value', layer, 'brightness');
|
||||
brightness.bindTo('valueAsNumber', layer, 'brightness');
|
||||
|
||||
|
||||
var rotation = new ol.dom.Input(document.getElementById('rotation'));
|
||||
rotation.bindTo('value', map.getView(), 'rotation');
|
||||
rotation.bindTo('valueAsNumber', map.getView(), 'rotation');
|
||||
|
||||
var resolution = new ol.dom.Input(document.getElementById('resolution'));
|
||||
resolution.bindTo('value', map.getView(), 'resolution');
|
||||
resolution.bindTo('valueAsNumber', map.getView(), 'resolution');
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<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">
|
||||
@@ -14,13 +15,7 @@
|
||||
<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>
|
||||
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -41,7 +36,7 @@
|
||||
|
||||
<div class="row-fluid">
|
||||
|
||||
<div class="span4">
|
||||
<div class="span12">
|
||||
<h4 id="title">Bing Maps example</h4>
|
||||
<p id="shortdesc">Example of a Bing Maps layer.</p>
|
||||
<div id="docs">
|
||||
@@ -56,7 +51,7 @@
|
||||
|
||||
<script src="jquery.min.js" type="text/javascript"></script>
|
||||
<script src="loader.js?id=bing-maps" type="text/javascript"></script>
|
||||
<script src="../resources/social-links.js" type="text/javascript"></script>
|
||||
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.RendererHints');
|
||||
goog.require('ol.View2D');
|
||||
goog.require('ol.layer.TileLayer');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.source.BingMaps');
|
||||
|
||||
@@ -9,11 +9,11 @@ goog.require('ol.source.BingMaps');
|
||||
var styles = ['Road', 'Aerial', 'AerialWithLabels'];
|
||||
var layers = [];
|
||||
for (var i = 0; i < styles.length; ++i) {
|
||||
layers.push(new ol.layer.TileLayer({
|
||||
layers.push(new ol.layer.Tile({
|
||||
visible: false,
|
||||
preload: Infinity,
|
||||
source: new ol.source.BingMaps({
|
||||
key: 'AlQLZ0-5yk301_ESrmNLma3LYxEKNSg7w-e_knuRfyYFtld-UFvXVs38NOulku3Q',
|
||||
key: 'Ar33pRUvQOdESG8m_T15MUmNz__E1twPo42bFx9jvdDePhX0PNgAcEm44OVTS7tt',
|
||||
style: styles[i]
|
||||
})
|
||||
}));
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<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">
|
||||
@@ -22,13 +23,7 @@
|
||||
<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>
|
||||
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -38,6 +33,11 @@
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
|
||||
<div id="no-webgl" class="alert alert-error" style="display: none">
|
||||
This example requires a browser that supports <a href="http://get.webgl.org/">WebGL</a>.
|
||||
</div>
|
||||
|
||||
<div class="btn-group">
|
||||
<button id="increase-brightness"><i class="icon-plus"></i></button>
|
||||
<button id="reset-brightness">Brightness</button>
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
<div class="row-fluid">
|
||||
|
||||
<div class="span4">
|
||||
<div class="span12">
|
||||
<h4 id="title">Brightness/contrast example</h4>
|
||||
<p id="shortdesc">Example of brightness/contrast control on the client (WebGL only).</p>
|
||||
<div id="docs">
|
||||
@@ -67,7 +67,7 @@
|
||||
</div>
|
||||
|
||||
<script src="loader.js?id=brightness-contrast" type="text/javascript"></script>
|
||||
<script src="../resources/social-links.js" type="text/javascript"></script>
|
||||
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,65 +1,76 @@
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.RendererHint');
|
||||
goog.require('ol.View2D');
|
||||
goog.require('ol.layer.TileLayer');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.source.MapQuestOpenAerial');
|
||||
goog.require('ol.webgl');
|
||||
|
||||
|
||||
var layer = new ol.layer.TileLayer({
|
||||
source: new ol.source.MapQuestOpenAerial()
|
||||
});
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [layer],
|
||||
renderer: ol.RendererHint.WEBGL,
|
||||
target: 'map',
|
||||
view: new ol.View2D({
|
||||
center: [0, 0],
|
||||
zoom: 2
|
||||
})
|
||||
});
|
||||
|
||||
var increaseBrightness = document.getElementById('increase-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() {
|
||||
layer.setBrightness(0);
|
||||
setResetBrightnessButtonHTML();
|
||||
}, false);
|
||||
decreaseBrightness.addEventListener('click', function() {
|
||||
layer.setBrightness(Math.max(layer.getBrightness() - 0.125, -1));
|
||||
setResetBrightnessButtonHTML();
|
||||
}, false);
|
||||
|
||||
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() {
|
||||
layer.setContrast(layer.getContrast() + 0.125);
|
||||
if (!ol.webgl.SUPPORTED) {
|
||||
var info = document.getElementById('no-webgl');
|
||||
/**
|
||||
* display error message
|
||||
*/
|
||||
info.style.display = '';
|
||||
} else {
|
||||
var layer = new ol.layer.Tile({
|
||||
source: new ol.source.MapQuestOpenAerial()
|
||||
});
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [layer],
|
||||
renderer: ol.RendererHint.WEBGL,
|
||||
target: 'map',
|
||||
view: new ol.View2D({
|
||||
center: [0, 0],
|
||||
zoom: 2
|
||||
})
|
||||
});
|
||||
|
||||
var increaseBrightness = document.getElementById('increase-brightness');
|
||||
var resetBrightness = document.getElementById('reset-brightness');
|
||||
var decreaseBrightness = document.getElementById('decrease-brightness');
|
||||
|
||||
setResetBrightnessButtonHTML();
|
||||
|
||||
increaseBrightness.addEventListener('click', function() {
|
||||
layer.setBrightness(Math.min(layer.getBrightness() + 0.125, 1));
|
||||
setResetBrightnessButtonHTML();
|
||||
}, false);
|
||||
resetBrightness.addEventListener('click', function() {
|
||||
layer.setBrightness(0);
|
||||
setResetBrightnessButtonHTML();
|
||||
}, false);
|
||||
decreaseBrightness.addEventListener('click', function() {
|
||||
layer.setBrightness(Math.max(layer.getBrightness() - 0.125, -1));
|
||||
setResetBrightnessButtonHTML();
|
||||
}, false);
|
||||
|
||||
var increaseContrast = document.getElementById('increase-contrast');
|
||||
var resetContrast = document.getElementById('reset-contrast');
|
||||
var decreaseContrast = document.getElementById('decrease-contrast');
|
||||
|
||||
setResetContrastButtonHTML();
|
||||
}, false);
|
||||
resetContrast.addEventListener('click', function() {
|
||||
layer.setContrast(1);
|
||||
setResetContrastButtonHTML();
|
||||
}, false);
|
||||
decreaseContrast.addEventListener('click', function() {
|
||||
layer.setContrast(Math.max(layer.getContrast() - 0.125, 0));
|
||||
setResetContrastButtonHTML();
|
||||
}, false);
|
||||
|
||||
increaseContrast.addEventListener('click', function() {
|
||||
layer.setContrast(layer.getContrast() + 0.125);
|
||||
setResetContrastButtonHTML();
|
||||
}, false);
|
||||
resetContrast.addEventListener('click', function() {
|
||||
layer.setContrast(1);
|
||||
setResetContrastButtonHTML();
|
||||
}, false);
|
||||
decreaseContrast.addEventListener('click', function() {
|
||||
layer.setContrast(Math.max(layer.getContrast() - 0.125, 0));
|
||||
setResetContrastButtonHTML();
|
||||
}, false);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<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">
|
||||
@@ -14,13 +15,7 @@
|
||||
<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>
|
||||
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -35,7 +30,7 @@
|
||||
|
||||
<div class="row-fluid">
|
||||
|
||||
<div class="span4">
|
||||
<div class="span12">
|
||||
<h4 id="title">Canvas tiles example</h4>
|
||||
<p id="shortdesc">Renders tiles with coordinates for debugging.</p>
|
||||
<div id="docs">
|
||||
@@ -50,7 +45,7 @@
|
||||
</div>
|
||||
|
||||
<script src="loader.js?id=canvas-tiles" type="text/javascript"></script>
|
||||
<script src="../resources/social-links.js" type="text/javascript"></script>
|
||||
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.RendererHints');
|
||||
goog.require('ol.View2D');
|
||||
goog.require('ol.layer.TileLayer');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.source.DebugTileSource');
|
||||
goog.require('ol.source.OSM');
|
||||
goog.require('ol.source.TileDebug');
|
||||
goog.require('ol.tilegrid.XYZ');
|
||||
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.TileLayer({
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.OSM()
|
||||
}),
|
||||
new ol.layer.TileLayer({
|
||||
source: new ol.source.DebugTileSource({
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.TileDebug({
|
||||
projection: 'EPSG:3857',
|
||||
tileGrid: new ol.tilegrid.XYZ({
|
||||
maxZoom: 22
|
||||
|
||||
@@ -4,11 +4,12 @@
|
||||
<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">
|
||||
.zoom-extent {
|
||||
.rotate-north {
|
||||
position: absolute;
|
||||
top: 65px;
|
||||
left: 8px;
|
||||
@@ -16,30 +17,32 @@
|
||||
border-radius: 4px;
|
||||
padding: 2px;
|
||||
}
|
||||
.zoom-extent a {
|
||||
.ol-touch .rotate-north {
|
||||
top: 80px;
|
||||
}
|
||||
.rotate-north a {
|
||||
display: block;
|
||||
margin: 1px;
|
||||
padding: 0;
|
||||
color: white;
|
||||
font-size: 18px;
|
||||
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;
|
||||
line-height: 19px;
|
||||
background: rgba(0,60,136,0.5);
|
||||
}
|
||||
.zoom-extent a:hover {
|
||||
.ol-touch .rotate-north a {
|
||||
font-size: 20px;
|
||||
height: 30px;
|
||||
width: 30px;
|
||||
line-height: 26px;
|
||||
}
|
||||
.rotate-north a:hover {
|
||||
background: rgba(0,60,136,0.7);
|
||||
}
|
||||
.zoom-to {
|
||||
border-radius: 2px 2px 0 0;
|
||||
}
|
||||
.zoom-to:before {
|
||||
content: "E";
|
||||
}
|
||||
</style>
|
||||
<title>ol3 custom controls example</title>
|
||||
</head>
|
||||
@@ -48,13 +51,7 @@
|
||||
<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>
|
||||
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -68,15 +65,14 @@
|
||||
</div>
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="span4">
|
||||
<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 "zoom to extent" button.
|
||||
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.
|
||||
Per default, the zoom extent control use the map projection extent.
|
||||
</p>
|
||||
</div>
|
||||
<div id="tags">
|
||||
@@ -87,7 +83,7 @@
|
||||
</div>
|
||||
|
||||
<script src="loader.js?id=custom-controls" type="text/javascript"></script>
|
||||
<script src="../resources/social-links.js" type="text/javascript"></script>
|
||||
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
|
||||
|
||||
</body>
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ goog.require('ol');
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.RendererHints');
|
||||
goog.require('ol.View2D');
|
||||
goog.require('ol.control');
|
||||
goog.require('ol.control.Control');
|
||||
goog.require('ol.control.defaults');
|
||||
goog.require('ol.layer.TileLayer');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.source.OSM');
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ var app = window.app;
|
||||
|
||||
|
||||
//
|
||||
// Define zoom extent control.
|
||||
// Define rotate to north control.
|
||||
//
|
||||
|
||||
|
||||
@@ -26,77 +26,48 @@ var app = window.app;
|
||||
* @extends {ol.control.Control}
|
||||
* @param {Object=} opt_options Control options.
|
||||
*/
|
||||
app.ZoomExtentControl = function(opt_options) {
|
||||
app.RotateNorthControl = function(opt_options) {
|
||||
|
||||
var options = opt_options || {};
|
||||
this.extent_ = options.extent;
|
||||
|
||||
var anchor = document.createElement('a');
|
||||
anchor.href = '#zoom-to';
|
||||
anchor.className = 'zoom-to';
|
||||
anchor.href = '#rotate-north';
|
||||
anchor.innerHTML = 'N';
|
||||
|
||||
var this_ = this;
|
||||
var handleZoomTo = function(e) {
|
||||
this_.handleZoomTo(e);
|
||||
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', handleZoomTo, false);
|
||||
anchor.addEventListener('touchstart', handleZoomTo, false);
|
||||
anchor.addEventListener('click', handleRotateNorth, false);
|
||||
anchor.addEventListener('touchstart', handleRotateNorth, false);
|
||||
|
||||
var element = document.createElement('div');
|
||||
element.className = 'zoom-extent ol-unselectable';
|
||||
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.ZoomExtentControl, ol.control.Control);
|
||||
|
||||
|
||||
/**
|
||||
* @param {Event} e Browser event.
|
||||
*/
|
||||
app.ZoomExtentControl.prototype.handleZoomTo = function(e) {
|
||||
// prevent #zoomTo anchor from getting appended to the url
|
||||
e.preventDefault();
|
||||
|
||||
var map = this.getMap();
|
||||
var view = map.getView();
|
||||
view.fitExtent(this.extent_, map.getSize());
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Overload setMap to use the view projection's validity extent
|
||||
* if no extent was passed to the constructor.
|
||||
* @param {ol.Map} map Map.
|
||||
*/
|
||||
app.ZoomExtentControl.prototype.setMap = function(map) {
|
||||
ol.control.Control.prototype.setMap.call(this, map);
|
||||
if (map && !this.extent_) {
|
||||
this.extent_ = map.getView().getProjection().getExtent();
|
||||
}
|
||||
};
|
||||
ol.inherits(app.RotateNorthControl, ol.control.Control);
|
||||
|
||||
|
||||
//
|
||||
// Create map, giving it a zoom extent control.
|
||||
// Create map, giving it a rotate to north control.
|
||||
//
|
||||
|
||||
|
||||
var map = new ol.Map({
|
||||
controls: ol.control.defaults({}, [
|
||||
new app.ZoomExtentControl({
|
||||
extent: [813079.7791264898, 848966.9639063801,
|
||||
5929220.284081122, 5936863.986909639]
|
||||
})
|
||||
controls: ol.control.defaults().extend([
|
||||
new app.RotateNorthControl()
|
||||
]),
|
||||
layers: [
|
||||
new ol.layer.TileLayer({
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
],
|
||||
@@ -104,6 +75,7 @@ var map = new ol.Map({
|
||||
target: 'map',
|
||||
view: new ol.View2D({
|
||||
center: [0, 0],
|
||||
zoom: 2
|
||||
zoom: 2,
|
||||
rotation: 1
|
||||
})
|
||||
});
|
||||
|
||||
BIN
examples/data/icon.png
Normal file
BIN
examples/data/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
10758
examples/data/kml/2012_Earthquakes_Mag5.kml
Normal file
10758
examples/data/kml/2012_Earthquakes_Mag5.kml
Normal file
File diff suppressed because it is too large
Load Diff
1
examples/data/topojson/world-110m.json
Normal file
1
examples/data/topojson/world-110m.json
Normal file
File diff suppressed because one or more lines are too long
@@ -4,6 +4,7 @@
|
||||
<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">
|
||||
@@ -14,13 +15,7 @@
|
||||
<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>
|
||||
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -35,7 +30,7 @@
|
||||
|
||||
<div class="row-fluid">
|
||||
|
||||
<div class="span4">
|
||||
<div class="span12">
|
||||
<h4 id="title">Device orientation example</h4>
|
||||
<label class="checkbox" for="track">
|
||||
<input id="track" type="checkbox"/>track changes
|
||||
@@ -56,7 +51,7 @@
|
||||
</div>
|
||||
|
||||
<script src="loader.js?id=device-orientation" type="text/javascript"></script>
|
||||
<script src="../resources/social-links.js" type="text/javascript"></script>
|
||||
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,12 +3,12 @@ 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.layer.Tile');
|
||||
goog.require('ol.source.OSM');
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.TileLayer({
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
],
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<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">
|
||||
@@ -14,13 +15,7 @@
|
||||
<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>
|
||||
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -35,7 +30,7 @@
|
||||
|
||||
<div class="row-fluid">
|
||||
|
||||
<div class="span4">
|
||||
<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">
|
||||
@@ -50,7 +45,7 @@
|
||||
</div>
|
||||
|
||||
<script src="loader.js?id=drag-rotate-and-zoom" type="text/javascript"></script>
|
||||
<script src="../resources/social-links.js" type="text/javascript"></script>
|
||||
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.RendererHints');
|
||||
goog.require('ol.View2D');
|
||||
goog.require('ol.interaction');
|
||||
goog.require('ol.interaction.DragRotateAndZoom');
|
||||
goog.require('ol.interaction.defaults');
|
||||
goog.require('ol.layer.TileLayer');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.source.MapQuestOpenAerial');
|
||||
|
||||
|
||||
var map = new ol.Map({
|
||||
interactions: ol.interaction.defaults({}, [
|
||||
interactions: ol.interaction.defaults().extend([
|
||||
new ol.interaction.DragRotateAndZoom()
|
||||
]),
|
||||
layers: [
|
||||
new ol.layer.TileLayer({
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.MapQuestOpenAerial()
|
||||
})
|
||||
],
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<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">
|
||||
@@ -14,13 +15,7 @@
|
||||
<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>
|
||||
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -35,7 +30,7 @@
|
||||
|
||||
<div class="row-fluid">
|
||||
|
||||
<div class="span4">
|
||||
<div class="span12">
|
||||
<h4 id="title">EPSG:4326 example</h4>
|
||||
<p id="shortdesc">Example of a map in EPSG:4326.</p>
|
||||
<div id="docs">
|
||||
@@ -49,7 +44,7 @@
|
||||
</div>
|
||||
|
||||
<script src="loader.js?id=epsg-4326" type="text/javascript"></script>
|
||||
<script src="../resources/social-links.js" type="text/javascript"></script>
|
||||
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.RendererHint');
|
||||
goog.require('ol.View2D');
|
||||
goog.require('ol.control');
|
||||
goog.require('ol.control.ScaleLine');
|
||||
goog.require('ol.control.ScaleLineUnits');
|
||||
goog.require('ol.control.defaults');
|
||||
goog.require('ol.layer.TileLayer');
|
||||
goog.require('ol.source.TiledWMS');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.source.TileWMS');
|
||||
|
||||
|
||||
var layers = [
|
||||
new ol.layer.TileLayer({
|
||||
source: new ol.source.TiledWMS({
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.TileWMS({
|
||||
url: 'http://vmap0.tiles.osgeo.org/wms/vmap0',
|
||||
params: {
|
||||
'VERSION': '1.1.1',
|
||||
@@ -22,7 +22,7 @@ var layers = [
|
||||
];
|
||||
|
||||
var map = new ol.Map({
|
||||
controls: ol.control.defaults({}, [
|
||||
controls: ol.control.defaults().extend([
|
||||
new ol.control.ScaleLine({
|
||||
units: ol.control.ScaleLineUnits.DEGREES
|
||||
})
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<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">
|
||||
@@ -14,13 +15,7 @@
|
||||
<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>
|
||||
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -30,6 +25,10 @@
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
<div id="no-download" class="alert alert-error" style="display: none">
|
||||
This example requires a browser that supports the
|
||||
<a href="http://caniuse.com/#feat=download">link download</a> attribute.
|
||||
</div>
|
||||
<a id="export-jpeg" class="btn" download="map.jpeg"><i class="icon-download"></i> Export JPEG</a>
|
||||
<a id="export-png" class="btn" download="map.png"><i class="icon-download"></i> Export PNG</a>
|
||||
</div>
|
||||
@@ -37,7 +36,7 @@
|
||||
|
||||
<div class="row-fluid">
|
||||
|
||||
<div class="span4">
|
||||
<div class="span12">
|
||||
<h4 id="title">Export map example</h4>
|
||||
<p id="shortdesc">Example of exporting a map as a JPEG or PNG image.</p>
|
||||
<div id="docs">
|
||||
@@ -51,7 +50,7 @@
|
||||
</div>
|
||||
|
||||
<script src="loader.js?id=export-map" type="text/javascript"></script>
|
||||
<script src="../resources/social-links.js" type="text/javascript"></script>
|
||||
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.RendererHint');
|
||||
goog.require('ol.View2D');
|
||||
goog.require('ol.layer.TileLayer');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.source.OSM');
|
||||
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.TileLayer({
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
],
|
||||
@@ -20,11 +20,20 @@ var map = new ol.Map({
|
||||
});
|
||||
|
||||
var exportJPEGElement = document.getElementById('export-jpeg');
|
||||
exportJPEGElement.addEventListener('click', function(e) {
|
||||
e.target.href = map.getRenderer().getCanvas().toDataURL('image/jpeg');
|
||||
}, false);
|
||||
|
||||
var exportPNGElement = document.getElementById('export-png');
|
||||
exportPNGElement.addEventListener('click', function(e) {
|
||||
e.target.href = map.getRenderer().getCanvas().toDataURL('image/png');
|
||||
}, false);
|
||||
|
||||
if ('download' in exportJPEGElement && 'download' in exportPNGElement) {
|
||||
exportJPEGElement.addEventListener('click', function(e) {
|
||||
e.target.href = map.getRenderer().getCanvas().toDataURL('image/jpeg');
|
||||
}, false);
|
||||
|
||||
exportPNGElement.addEventListener('click', function(e) {
|
||||
e.target.href = map.getRenderer().getCanvas().toDataURL('image/png');
|
||||
}, false);
|
||||
} else {
|
||||
var info = document.getElementById('no-download');
|
||||
/**
|
||||
* display error message
|
||||
*/
|
||||
info.style.display = '';
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<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">
|
||||
@@ -25,13 +26,7 @@
|
||||
<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>
|
||||
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -46,7 +41,7 @@
|
||||
|
||||
<div class="row-fluid">
|
||||
|
||||
<div class="span4">
|
||||
<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">
|
||||
@@ -62,7 +57,7 @@
|
||||
</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>
|
||||
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.RendererHint');
|
||||
goog.require('ol.View2D');
|
||||
goog.require('ol.control');
|
||||
goog.require('ol.control.FullScreen');
|
||||
goog.require('ol.control.defaults');
|
||||
goog.require('ol.interaction');
|
||||
goog.require('ol.interaction.DragRotateAndZoom');
|
||||
goog.require('ol.interaction.defaults');
|
||||
goog.require('ol.layer.TileLayer');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.source.BingMaps');
|
||||
|
||||
|
||||
var map = new ol.Map({
|
||||
controls: ol.control.defaults({}, [
|
||||
controls: ol.control.defaults().extend([
|
||||
new ol.control.FullScreen()
|
||||
]),
|
||||
interactions: ol.interaction.defaults({}, [
|
||||
interactions: ol.interaction.defaults().extend([
|
||||
new ol.interaction.DragRotateAndZoom()
|
||||
]),
|
||||
layers: [
|
||||
new ol.layer.TileLayer({
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.BingMaps({
|
||||
key: 'AlQLZ0-5yk301_ESrmNLma3LYxEKNSg7w-e_knuRfyYFtld-UFvXVs38NOulku3Q',
|
||||
key: 'Ar33pRUvQOdESG8m_T15MUmNz__E1twPo42bFx9jvdDePhX0PNgAcEm44OVTS7tt',
|
||||
style: 'Aerial'
|
||||
})
|
||||
})
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<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">
|
||||
@@ -25,13 +26,7 @@
|
||||
<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>
|
||||
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -46,7 +41,7 @@
|
||||
|
||||
<div class="row-fluid">
|
||||
|
||||
<div class="span4">
|
||||
<div class="span12">
|
||||
<h4 id="title">Full screen control example</h4>
|
||||
<p id="shortdesc">Example of a full screen control.</p>
|
||||
<div id="docs">
|
||||
@@ -62,7 +57,7 @@
|
||||
</div>
|
||||
|
||||
<script src="loader.js?id=full-screen" type="text/javascript"></script>
|
||||
<script src="../resources/social-links.js" type="text/javascript"></script>
|
||||
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.RendererHints');
|
||||
goog.require('ol.View2D');
|
||||
goog.require('ol.control');
|
||||
goog.require('ol.control.FullScreen');
|
||||
goog.require('ol.control.defaults');
|
||||
goog.require('ol.layer.TileLayer');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.source.BingMaps');
|
||||
|
||||
|
||||
@@ -13,13 +13,13 @@ var view = new ol.View2D({
|
||||
});
|
||||
|
||||
var map = new ol.Map({
|
||||
controls: ol.control.defaults({}, [
|
||||
controls: ol.control.defaults().extend([
|
||||
new ol.control.FullScreen()
|
||||
]),
|
||||
layers: [
|
||||
new ol.layer.TileLayer({
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.BingMaps({
|
||||
key: 'AlQLZ0-5yk301_ESrmNLma3LYxEKNSg7w-e_knuRfyYFtld-UFvXVs38NOulku3Q',
|
||||
key: 'Ar33pRUvQOdESG8m_T15MUmNz__E1twPo42bFx9jvdDePhX0PNgAcEm44OVTS7tt',
|
||||
style: 'Aerial'
|
||||
})
|
||||
})
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<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">
|
||||
@@ -23,13 +24,7 @@
|
||||
<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>
|
||||
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -44,13 +39,21 @@
|
||||
|
||||
<div class="row-fluid">
|
||||
|
||||
<div class="span4">
|
||||
<div class="span8">
|
||||
<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>
|
||||
<div id="docs">
|
||||
<p>See the <a href="geolocation.js" target="_blank">geolocation.js source</a> to see how this is done.</p>
|
||||
</div>
|
||||
<button id="locate"><i class="icon-screenshot"></i> locate</button>
|
||||
<div id="tags">geolocation, openstreetmap</div>
|
||||
</div>
|
||||
<div class="span4 pull-right">
|
||||
@@ -62,7 +65,7 @@
|
||||
<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=geolocation" type="text/javascript"></script>
|
||||
<script src="../resources/social-links.js" type="text/javascript"></script>
|
||||
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,13 +3,14 @@ goog.require('ol.Map');
|
||||
goog.require('ol.Overlay');
|
||||
goog.require('ol.RendererHints');
|
||||
goog.require('ol.View2D');
|
||||
goog.require('ol.layer.TileLayer');
|
||||
goog.require('ol.dom.Input');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.source.OSM');
|
||||
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.TileLayer({
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.OSM()
|
||||
})
|
||||
],
|
||||
@@ -24,10 +25,21 @@ var map = new ol.Map({
|
||||
var geolocation = new ol.Geolocation();
|
||||
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({
|
||||
map: map,
|
||||
element: /** @type {Element} */ ($('<i/>').addClass('icon-flag').get(0))
|
||||
});
|
||||
map.addOverlay(marker);
|
||||
// bind the marker position to the device location.
|
||||
marker.bindTo('position', geolocation);
|
||||
|
||||
@@ -41,8 +53,3 @@ geolocation.on('error', function(error) {
|
||||
info.innerHTML = error.message;
|
||||
info.style.display = '';
|
||||
});
|
||||
|
||||
|
||||
$('#locate').click(function() {
|
||||
geolocation.setTracking(true);
|
||||
});
|
||||
|
||||
55
examples/getfeatureinfo.html
Normal file
55
examples/getfeatureinfo.html
Normal file
@@ -0,0 +1,55 @@
|
||||
<!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>Get feature info example</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||
<div class="navbar-inner">
|
||||
<div class="container">
|
||||
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
|
||||
</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">GetFeatureInfo example</h4>
|
||||
<p id="shortdesc">Example of a WMS layer and a vector layer, both configured to provide feature information on click.</p>
|
||||
<div id="docs">
|
||||
<p>See the <a href="getfeatureinfo.js" target="_blank">getfeatureinfo.js source</a> to see how this is done.</p>
|
||||
</div>
|
||||
<div id="tags">getfeatureinfo</div>
|
||||
</div>
|
||||
<div class="span4 offset4">
|
||||
<div id="info" class="alert alert-success">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="loader.js?id=getfeatureinfo" type="text/javascript"></script>
|
||||
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
56
examples/getfeatureinfo.js
Normal file
56
examples/getfeatureinfo.js
Normal file
@@ -0,0 +1,56 @@
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.RendererHint');
|
||||
goog.require('ol.View2D');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.layer.Vector');
|
||||
goog.require('ol.parser.GeoJSON');
|
||||
goog.require('ol.source.TileWMS');
|
||||
goog.require('ol.source.Vector');
|
||||
goog.require('ol.style.Stroke');
|
||||
goog.require('ol.style.Style');
|
||||
|
||||
|
||||
var wms = new ol.layer.Tile({
|
||||
source: new ol.source.TileWMS({
|
||||
url: 'http://demo.opengeo.org/geoserver/wms',
|
||||
params: {'LAYERS': 'ne:ne'}
|
||||
})
|
||||
});
|
||||
|
||||
var vector = new ol.layer.Vector({
|
||||
source: new ol.source.Vector({
|
||||
parser: new ol.parser.GeoJSON(),
|
||||
url: 'data/countries.geojson'
|
||||
}),
|
||||
style: new ol.style.Style({
|
||||
symbolizers: [
|
||||
new ol.style.Stroke({
|
||||
color: '#33cc66',
|
||||
width: 2
|
||||
})
|
||||
]
|
||||
}),
|
||||
transformFeatureInfo: function(features) {
|
||||
return features.length > 0 ?
|
||||
features[0].getId() + ': ' + features[0].get('name') : ' ';
|
||||
}
|
||||
});
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [wms, vector],
|
||||
renderer: ol.RendererHint.CANVAS,
|
||||
target: 'map',
|
||||
view: new ol.View2D({
|
||||
center: [0, 0],
|
||||
zoom: 1
|
||||
})
|
||||
});
|
||||
|
||||
map.on('click', function(evt) {
|
||||
map.getFeatureInfo({
|
||||
pixel: evt.getPixel(),
|
||||
success: function(featureInfoByLayer) {
|
||||
document.getElementById('info').innerHTML = featureInfoByLayer.join('');
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -4,6 +4,7 @@
|
||||
<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">
|
||||
@@ -14,13 +15,7 @@
|
||||
<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>
|
||||
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -35,7 +30,7 @@
|
||||
|
||||
<div class="row-fluid">
|
||||
|
||||
<div class="span4">
|
||||
<div class="span12">
|
||||
<h4 id="title">GML example</h4>
|
||||
<p id="shortdesc">Example of using the GML parser.</p>
|
||||
<div id="docs">
|
||||
@@ -49,7 +44,7 @@
|
||||
</div>
|
||||
|
||||
<script src="loader.js?id=gml" type="text/javascript"></script>
|
||||
<script src="../resources/social-links.js" type="text/javascript"></script>
|
||||
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,33 +1,35 @@
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.RendererHint');
|
||||
goog.require('ol.View2D');
|
||||
goog.require('ol.layer.TileLayer');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.layer.Vector');
|
||||
goog.require('ol.parser.ogc.GML_v3');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.source.MapQuestOpenAerial');
|
||||
goog.require('ol.source.Vector');
|
||||
goog.require('ol.style.Polygon');
|
||||
goog.require('ol.style.Rule');
|
||||
goog.require('ol.style.Fill');
|
||||
goog.require('ol.style.Stroke');
|
||||
goog.require('ol.style.Style');
|
||||
|
||||
var raster = new ol.layer.TileLayer({
|
||||
var raster = new ol.layer.Tile({
|
||||
source: new ol.source.MapQuestOpenAerial()
|
||||
});
|
||||
|
||||
var vector = new ol.layer.Vector({
|
||||
source: new ol.source.Vector({
|
||||
projection: ol.proj.get('EPSG:4326')
|
||||
parser: new ol.parser.ogc.GML_v3(),
|
||||
url: 'data/gml/topp-states-wfs.xml'
|
||||
}),
|
||||
style: new ol.style.Style({rules: [
|
||||
new ol.style.Rule({
|
||||
symbolizers: [
|
||||
new ol.style.Polygon({
|
||||
strokeColor: '#bada55'
|
||||
})
|
||||
]
|
||||
})
|
||||
]})
|
||||
style: new ol.style.Style({
|
||||
symbolizers: [
|
||||
new ol.style.Fill({
|
||||
color: '#ffffff',
|
||||
opacity: 0.25
|
||||
}),
|
||||
new ol.style.Stroke({
|
||||
color: '#6666ff'
|
||||
})
|
||||
]
|
||||
})
|
||||
});
|
||||
|
||||
var map = new ol.Map({
|
||||
@@ -35,26 +37,7 @@ var map = new ol.Map({
|
||||
renderer: ol.RendererHint.CANVAS,
|
||||
target: 'map',
|
||||
view: new ol.View2D({
|
||||
center: [-10997171.194994785, 5206335.565590534],
|
||||
center: [-10997171, 4658434],
|
||||
zoom: 4
|
||||
})
|
||||
});
|
||||
|
||||
var gml = new ol.parser.ogc.GML_v3({axisOrientation: 'neu'});
|
||||
|
||||
var url = 'data/gml/topp-states-wfs.xml';
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', url, true);
|
||||
|
||||
|
||||
/**
|
||||
* 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, gml, projection);
|
||||
}
|
||||
};
|
||||
xhr.send();
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<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">
|
||||
@@ -14,13 +15,7 @@
|
||||
<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>
|
||||
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -43,7 +38,7 @@
|
||||
</div>
|
||||
<div id="tags">GPX</div>
|
||||
</div>
|
||||
<div class="span4 pull-right">
|
||||
<div class="span4 offset4">
|
||||
<div id="info" class="alert alert-success">
|
||||
|
||||
</div>
|
||||
@@ -53,7 +48,7 @@
|
||||
</div>
|
||||
|
||||
<script src="loader.js?id=gpx" type="text/javascript"></script>
|
||||
<script src="../resources/social-links.js" type="text/javascript"></script>
|
||||
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,28 +1,21 @@
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.RendererHint');
|
||||
goog.require('ol.View2D');
|
||||
goog.require('ol.layer.TileLayer');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.layer.Vector');
|
||||
goog.require('ol.parser.GPX');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.source.OSM');
|
||||
goog.require('ol.source.Vector');
|
||||
|
||||
var raster = new ol.layer.TileLayer({
|
||||
var raster = new ol.layer.Tile({
|
||||
source: new ol.source.OSM()
|
||||
});
|
||||
|
||||
var vector = new ol.layer.Vector({
|
||||
source: new ol.source.Vector({
|
||||
projection: ol.proj.get('EPSG:4326')
|
||||
}),
|
||||
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(', ');
|
||||
}
|
||||
parser: new ol.parser.GPX(),
|
||||
url: 'data/gpx/yahoo.xml'
|
||||
})
|
||||
});
|
||||
|
||||
var map = new ol.Map({
|
||||
@@ -36,30 +29,16 @@ var map = new ol.Map({
|
||||
});
|
||||
|
||||
map.on(['click', 'mousemove'], function(evt) {
|
||||
map.getFeatureInfo({
|
||||
map.getFeatures({
|
||||
pixel: evt.getPixel(),
|
||||
layers: [vector],
|
||||
success: function(featureInfo) {
|
||||
document.getElementById('info').innerHTML = featureInfo[0] || ' ';
|
||||
success: function(featuresByLayer) {
|
||||
var features = featuresByLayer[0];
|
||||
var info = [];
|
||||
for (var i = 0, ii = features.length; i < ii; ++i) {
|
||||
info.push(features[i].get('name') + ': ' + features[i].get('type'));
|
||||
}
|
||||
document.getElementById('info').innerHTML = info.join(', ') || ' ';
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
var gpx = new ol.parser.GPX();
|
||||
|
||||
var url = 'data/gpx/yahoo.xml';
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', url, true);
|
||||
|
||||
|
||||
/**
|
||||
* 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, gpx, projection);
|
||||
}
|
||||
};
|
||||
xhr.send();
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<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">
|
||||
@@ -22,13 +23,7 @@
|
||||
<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>
|
||||
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -38,6 +33,11 @@
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map"></div>
|
||||
|
||||
<div id="no-webgl" class="alert alert-error" style="display: none">
|
||||
This example requires a browser that supports <a href="http://get.webgl.org/">WebGL</a>.
|
||||
</div>
|
||||
|
||||
<div class="btn-group">
|
||||
<button id="increase-hue"><i class="icon-plus"></i></button>
|
||||
<button id="reset-hue">Hue</button>
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
<div class="row-fluid">
|
||||
|
||||
<div class="span4">
|
||||
<div class="span12">
|
||||
<h4 id="title">Hue/saturation example</h4>
|
||||
<p id="shortdesc">Example of hue/saturation control on the client (WebGL only).</p>
|
||||
<div id="docs">
|
||||
@@ -67,7 +67,7 @@
|
||||
</div>
|
||||
|
||||
<script src="loader.js?id=hue-saturation" type="text/javascript"></script>
|
||||
<script src="../resources/social-links.js" type="text/javascript"></script>
|
||||
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,69 +1,80 @@
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.RendererHint');
|
||||
goog.require('ol.View2D');
|
||||
goog.require('ol.layer.TileLayer');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.source.BingMaps');
|
||||
goog.require('ol.webgl');
|
||||
|
||||
|
||||
var layer = new ol.layer.TileLayer({
|
||||
source: new ol.source.BingMaps({
|
||||
key: 'AlQLZ0-5yk301_ESrmNLma3LYxEKNSg7w-e_knuRfyYFtld-UFvXVs38NOulku3Q',
|
||||
style: 'Aerial'
|
||||
})
|
||||
});
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [layer],
|
||||
renderer: ol.RendererHint.WEBGL,
|
||||
target: 'map',
|
||||
view: new ol.View2D({
|
||||
center: ol.proj.transform([-9.375, 51.483333], 'EPSG:4326', 'EPSG:3857'),
|
||||
zoom: 15
|
||||
})
|
||||
});
|
||||
|
||||
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() {
|
||||
layer.setHue(layer.getHue() + 0.25);
|
||||
setResetHueButtonHTML();
|
||||
}, false);
|
||||
resetHue.addEventListener('click', function() {
|
||||
layer.setHue(0);
|
||||
setResetHueButtonHTML();
|
||||
}, false);
|
||||
decreaseHue.addEventListener('click', function() {
|
||||
layer.setHue(layer.getHue() - 0.25);
|
||||
setResetHueButtonHTML();
|
||||
}, false);
|
||||
|
||||
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() {
|
||||
layer.setSaturation(layer.getSaturation() + 0.25);
|
||||
if (!ol.webgl.SUPPORTED) {
|
||||
var info = document.getElementById('no-webgl');
|
||||
/**
|
||||
* display error message
|
||||
*/
|
||||
info.style.display = '';
|
||||
} else {
|
||||
var layer = new ol.layer.Tile({
|
||||
source: new ol.source.BingMaps({
|
||||
key: 'Ar33pRUvQOdESG8m_T15MUmNz__E1twPo42bFx9jvdDePhX0PNgAcEm44OVTS7tt',
|
||||
style: 'Aerial'
|
||||
})
|
||||
});
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [layer],
|
||||
renderer: ol.RendererHint.WEBGL,
|
||||
target: 'map',
|
||||
view: new ol.View2D({
|
||||
center: ol.proj.transform([-9.375, 51.483333], 'EPSG:4326', 'EPSG:3857'),
|
||||
zoom: 15
|
||||
})
|
||||
});
|
||||
|
||||
var increaseHue = document.getElementById('increase-hue');
|
||||
var resetHue = document.getElementById('reset-hue');
|
||||
var decreaseHue = document.getElementById('decrease-hue');
|
||||
|
||||
setResetHueButtonHTML();
|
||||
|
||||
increaseHue.addEventListener('click', function() {
|
||||
layer.setHue(layer.getHue() + 0.25);
|
||||
setResetHueButtonHTML();
|
||||
}, false);
|
||||
resetHue.addEventListener('click', function() {
|
||||
layer.setHue(0);
|
||||
setResetHueButtonHTML();
|
||||
}, false);
|
||||
decreaseHue.addEventListener('click', function() {
|
||||
layer.setHue(layer.getHue() - 0.25);
|
||||
setResetHueButtonHTML();
|
||||
}, false);
|
||||
|
||||
var increaseSaturation = document.getElementById('increase-saturation');
|
||||
var resetSaturation = document.getElementById('reset-saturation');
|
||||
var decreaseSaturation = document.getElementById('decrease-saturation');
|
||||
|
||||
setResetSaturationButtonHTML();
|
||||
}, false);
|
||||
resetSaturation.addEventListener('click', function() {
|
||||
layer.setSaturation(1);
|
||||
setResetSaturationButtonHTML();
|
||||
}, false);
|
||||
decreaseSaturation.addEventListener('click', function() {
|
||||
layer.setSaturation(Math.max(layer.getSaturation() - 0.25, 0));
|
||||
setResetSaturationButtonHTML();
|
||||
}, false);
|
||||
|
||||
increaseSaturation.addEventListener('click', function() {
|
||||
layer.setSaturation(layer.getSaturation() + 0.25);
|
||||
setResetSaturationButtonHTML();
|
||||
}, false);
|
||||
resetSaturation.addEventListener('click', function() {
|
||||
layer.setSaturation(1);
|
||||
setResetSaturationButtonHTML();
|
||||
}, false);
|
||||
decreaseSaturation.addEventListener('click', function() {
|
||||
layer.setSaturation(Math.max(layer.getSaturation() - 0.25, 0));
|
||||
setResetSaturationButtonHTML();
|
||||
}, false);
|
||||
}
|
||||
|
||||
62
examples/icon.html
Normal file
62
examples/icon.html
Normal file
@@ -0,0 +1,62 @@
|
||||
<!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>Vector Icon Example</title>
|
||||
<style>
|
||||
#map {
|
||||
position: relative;
|
||||
}
|
||||
#popup {
|
||||
padding-bottom: 45px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||
<div class="navbar-inner">
|
||||
<div class="container">
|
||||
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div id="map" class="map">
|
||||
<div id="popup"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row-fluid">
|
||||
|
||||
<div class="span12">
|
||||
<h4 id="title">Icon example</h4>
|
||||
<p id="shortdesc">Example using an icon to symbolize a point.</p>
|
||||
<div id="docs">
|
||||
<p>See the <a href="icon.js" target="_blank">icon.js source</a> to see how this is done.</p>
|
||||
</div>
|
||||
<div id="tags">vector, style, icon, marker, popup</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=icon" type="text/javascript"></script>
|
||||
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
92
examples/icon.js
Normal file
92
examples/icon.js
Normal file
@@ -0,0 +1,92 @@
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.Overlay');
|
||||
goog.require('ol.RendererHint');
|
||||
goog.require('ol.View2D');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.layer.Vector');
|
||||
goog.require('ol.parser.GeoJSON');
|
||||
goog.require('ol.source.TileJSON');
|
||||
goog.require('ol.source.Vector');
|
||||
goog.require('ol.style.Icon');
|
||||
goog.require('ol.style.Style');
|
||||
|
||||
|
||||
var raster = new ol.layer.Tile({
|
||||
source: new ol.source.TileJSON({
|
||||
url: 'http://api.tiles.mapbox.com/v3/mapbox.geography-class.jsonp'
|
||||
})
|
||||
});
|
||||
|
||||
var data = {
|
||||
type: 'FeatureCollection',
|
||||
features: [{
|
||||
type: 'Feature',
|
||||
properties: {
|
||||
name: 'Null Island',
|
||||
population: 4000,
|
||||
rainfall: 500
|
||||
},
|
||||
geometry: {
|
||||
type: 'Point',
|
||||
coordinates: [0, 0]
|
||||
}
|
||||
}]
|
||||
};
|
||||
|
||||
var style = new ol.style.Style({
|
||||
symbolizers: [
|
||||
new ol.style.Icon({
|
||||
url: 'data/icon.png',
|
||||
yOffset: -22
|
||||
})
|
||||
]
|
||||
});
|
||||
|
||||
var vector = new ol.layer.Vector({
|
||||
source: new ol.source.Vector({
|
||||
parser: new ol.parser.GeoJSON(),
|
||||
data: data
|
||||
}),
|
||||
style: style
|
||||
});
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [raster, vector],
|
||||
renderer: ol.RendererHint.CANVAS,
|
||||
target: 'map',
|
||||
view: new ol.View2D({
|
||||
center: [0, 0],
|
||||
zoom: 3
|
||||
})
|
||||
});
|
||||
|
||||
var element = document.getElementById('popup');
|
||||
|
||||
var popup = new ol.Overlay({
|
||||
element: element
|
||||
});
|
||||
map.addOverlay(popup);
|
||||
|
||||
|
||||
map.on('click', function(evt) {
|
||||
map.getFeatures({
|
||||
pixel: evt.getPixel(),
|
||||
layers: [vector],
|
||||
success: function(layerFeatures) {
|
||||
var feature = layerFeatures[0][0];
|
||||
if (feature) {
|
||||
var geometry = feature.getGeometry();
|
||||
var coord = geometry.getCoordinates();
|
||||
popup.setPosition(coord);
|
||||
$(element).popover({
|
||||
'placement': 'top',
|
||||
'html': true,
|
||||
'content': feature.get('name')
|
||||
});
|
||||
$(element).popover('show');
|
||||
} else {
|
||||
$(element).popover('destroy');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -4,6 +4,7 @@
|
||||
<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">
|
||||
@@ -19,6 +20,9 @@
|
||||
.example:hover {
|
||||
background-color: #ddd;
|
||||
}
|
||||
.navbar-search.pull-left {
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 8px;
|
||||
@@ -174,17 +178,11 @@
|
||||
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||
<div class="navbar-inner">
|
||||
<div class="container">
|
||||
<a class="brand" href="./">OpenLayers 3 Examples</a>
|
||||
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
|
||||
<form class="navbar-search pull-left">
|
||||
<input name="q" type="text" id="keywords" class="search-query" placeholder="Search">
|
||||
<span id="count"></span>
|
||||
</form>
|
||||
<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>
|
||||
@@ -208,8 +206,5 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="../resources/social-links.js" type="text/javascript"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
75
examples/kml-earthquakes.html
Normal file
75
examples/kml-earthquakes.html
Normal file
@@ -0,0 +1,75 @@
|
||||
<!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>Earthquakes in KML</title>
|
||||
<style>
|
||||
#map {
|
||||
position: relative;
|
||||
}
|
||||
#info {
|
||||
position: absolute;
|
||||
height: 1px;
|
||||
width: 1px;
|
||||
z-index: 100;
|
||||
}
|
||||
.tooltip.in {
|
||||
opacity: 1;
|
||||
filter: alpha(opacity=100);
|
||||
}
|
||||
.tooltip.top .tooltip-arrow {
|
||||
border-top-color: white;
|
||||
}
|
||||
.tooltip-inner {
|
||||
border: 2px solid white;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||
<div class="navbar-inner">
|
||||
<div class="container">
|
||||
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
|
||||
</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">Earthquakes in KML</h4>
|
||||
<p id="shortdesc">Demonstrates the use of a Shape symbolizer to render earthquake locations.</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 renders earthquake locations with a size relative to their magnitude. The style uses a <code>ol.style.Shape</code> symbolizer where the <code>size</code> comes from the <code>magnitude</code> attribute on the features.
|
||||
</p>
|
||||
<p>See the <a href="kml-earthquakes.js" target="_blank">kml-earthquakes.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-earthquakes" type="text/javascript"></script>
|
||||
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
83
examples/kml-earthquakes.js
Normal file
83
examples/kml-earthquakes.js
Normal file
@@ -0,0 +1,83 @@
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.RendererHint');
|
||||
goog.require('ol.View2D');
|
||||
goog.require('ol.expr');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.layer.Vector');
|
||||
goog.require('ol.parser.KML');
|
||||
goog.require('ol.source.Stamen');
|
||||
goog.require('ol.source.Vector');
|
||||
goog.require('ol.style.Fill');
|
||||
goog.require('ol.style.Shape');
|
||||
goog.require('ol.style.Stroke');
|
||||
goog.require('ol.style.Style');
|
||||
|
||||
|
||||
|
||||
var style = new ol.style.Style({
|
||||
symbolizers: [
|
||||
new ol.style.Shape({
|
||||
size: ol.expr.parse('5 + 20 * (magnitude - 5)'),
|
||||
fill: new ol.style.Fill({
|
||||
color: '#ff9900',
|
||||
opacity: 0.4
|
||||
}),
|
||||
stroke: new ol.style.Stroke({
|
||||
color: '#ffcc00',
|
||||
opacity: 0.2
|
||||
})
|
||||
})
|
||||
]
|
||||
});
|
||||
|
||||
var vector = new ol.layer.Vector({
|
||||
source: new ol.source.Vector({
|
||||
parser: new ol.parser.KML({dimension: 2}),
|
||||
url: 'data/kml/2012_Earthquakes_Mag5.kml'
|
||||
}),
|
||||
style: style
|
||||
});
|
||||
|
||||
var raster = new ol.layer.Tile({
|
||||
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 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">
|
||||
@@ -25,13 +26,7 @@
|
||||
<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>
|
||||
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -46,7 +41,7 @@
|
||||
|
||||
<div class="row-fluid">
|
||||
|
||||
<div class="span4">
|
||||
<div class="span12">
|
||||
<h4 id="title">Timezones in KML</h4>
|
||||
<p id="shortdesc">Demonstrates rendering timezones from KML.</p>
|
||||
<div id="docs">
|
||||
@@ -62,7 +57,7 @@
|
||||
<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>
|
||||
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -2,14 +2,13 @@ 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.Tile');
|
||||
goog.require('ol.layer.Vector');
|
||||
goog.require('ol.parser.KML');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.source.Stamen');
|
||||
goog.require('ol.source.Vector');
|
||||
goog.require('ol.style.Polygon');
|
||||
goog.require('ol.style.Rule');
|
||||
goog.require('ol.style.Fill');
|
||||
goog.require('ol.style.Stroke');
|
||||
goog.require('ol.style.Style');
|
||||
|
||||
|
||||
@@ -41,26 +40,27 @@ ol.expr.register('getOpacity', function() {
|
||||
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 style = new ol.style.Style({
|
||||
symbolizers: [
|
||||
new ol.style.Fill({
|
||||
color: '#ffff33',
|
||||
opacity: ol.expr.parse('getOpacity()')
|
||||
}),
|
||||
new ol.style.Stroke({
|
||||
color: '#ffffff'
|
||||
})
|
||||
]
|
||||
});
|
||||
|
||||
var vector = new ol.layer.Vector({
|
||||
source: new ol.source.Vector({
|
||||
projection: ol.proj.get('EPSG:4326')
|
||||
parser: new ol.parser.KML({dimension: 2}),
|
||||
url: 'data/kml/timezones.kml'
|
||||
}),
|
||||
style: style
|
||||
});
|
||||
|
||||
var raster = new ol.layer.TileLayer({
|
||||
var raster = new ol.layer.Tile({
|
||||
source: new ol.source.Stamen({
|
||||
layer: 'toner'
|
||||
})
|
||||
@@ -103,21 +103,3 @@ map.on(['click', 'mousemove'], function(evt) {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
var kml = new ol.parser.KML({dimension: 2});
|
||||
|
||||
var url = 'data/kml/timezones.kml';
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', url, true);
|
||||
|
||||
|
||||
/**
|
||||
* onload handler for the XHR request.
|
||||
*/
|
||||
xhr.onload = function() {
|
||||
if (xhr.status == 200) {
|
||||
var projection = map.getView().getProjection();
|
||||
vector.parseFeatures(xhr.responseText, kml, projection);
|
||||
}
|
||||
};
|
||||
xhr.send();
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<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">
|
||||
@@ -14,13 +15,7 @@
|
||||
<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>
|
||||
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -43,7 +38,7 @@
|
||||
</div>
|
||||
<div id="tags">KML</div>
|
||||
</div>
|
||||
<div class="span4 pull-right">
|
||||
<div class="span4 offset4">
|
||||
<div id="info" class="alert alert-success">
|
||||
|
||||
</div>
|
||||
@@ -54,7 +49,7 @@
|
||||
</div>
|
||||
|
||||
<script src="loader.js?id=kml" type="text/javascript"></script>
|
||||
<script src="../resources/social-links.js" type="text/javascript"></script>
|
||||
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.RendererHint');
|
||||
goog.require('ol.View2D');
|
||||
goog.require('ol.layer.TileLayer');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.layer.Vector');
|
||||
goog.require('ol.parser.KML');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.source.TiledWMS');
|
||||
goog.require('ol.source.TileWMS');
|
||||
goog.require('ol.source.Vector');
|
||||
|
||||
var raster = new ol.layer.TileLayer({
|
||||
source: new ol.source.TiledWMS({
|
||||
var raster = new ol.layer.Tile({
|
||||
source: new ol.source.TileWMS({
|
||||
url: 'http://vmap0.tiles.osgeo.org/wms/vmap0',
|
||||
crossOrigin: null,
|
||||
params: {
|
||||
@@ -20,19 +19,13 @@ var raster = new ol.layer.TileLayer({
|
||||
})
|
||||
});
|
||||
|
||||
var epsg4326 = ol.proj.get('EPSG:4326');
|
||||
|
||||
var vector = new ol.layer.Vector({
|
||||
source: new ol.source.Vector({
|
||||
projection: epsg4326
|
||||
}),
|
||||
transformFeatureInfo: function(features) {
|
||||
var info = [];
|
||||
for (var i = 0, ii = features.length; i < ii; ++i) {
|
||||
info.push(features[i].get('name'));
|
||||
}
|
||||
return info.join(', ');
|
||||
}
|
||||
parser: new ol.parser.KML({
|
||||
maxDepth: 1, dimension: 2, extractStyles: true, extractAttributes: true
|
||||
}),
|
||||
url: 'data/kml/lines.kml'
|
||||
})
|
||||
});
|
||||
|
||||
var map = new ol.Map({
|
||||
@@ -40,37 +33,23 @@ var map = new ol.Map({
|
||||
renderer: ol.RendererHint.CANVAS,
|
||||
target: 'map',
|
||||
view: new ol.View2D({
|
||||
projection: epsg4326,
|
||||
projection: 'EPSG:4326',
|
||||
center: [-112.169, 36.099],
|
||||
zoom: 11
|
||||
})
|
||||
});
|
||||
|
||||
var kml = new ol.parser.KML({
|
||||
maxDepth: 1, dimension: 2, extractStyles: true, extractAttributes: true});
|
||||
|
||||
map.on(['click', 'mousemove'], function(evt) {
|
||||
map.getFeatureInfo({
|
||||
map.getFeatures({
|
||||
pixel: evt.getPixel(),
|
||||
layers: [vector],
|
||||
success: function(featureInfo) {
|
||||
document.getElementById('info').innerHTML = featureInfo[0] || ' ';
|
||||
success: function(featuresByLayer) {
|
||||
var features = featuresByLayer[0];
|
||||
var info = [];
|
||||
for (var i = 0, ii = features.length; i < ii; ++i) {
|
||||
info.push(features[i].get('name'));
|
||||
}
|
||||
document.getElementById('info').innerHTML = info.join(', ') || ' ';
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
var url = 'data/kml/lines.kml';
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', url, true);
|
||||
|
||||
|
||||
/**
|
||||
* 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
|
||||
vector.parseFeatures(xhr.responseText, kml, epsg4326);
|
||||
}
|
||||
};
|
||||
xhr.send();
|
||||
|
||||
125
examples/layer-group.html
Normal file
125
examples/layer-group.html
Normal file
@@ -0,0 +1,125 @@
|
||||
<!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="../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>
|
||||
#layertree li > span {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
<title>Layer group example</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||
<div class="navbar-inner">
|
||||
<div class="container">
|
||||
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="span6">
|
||||
<div id="map" class="map"></div>
|
||||
|
||||
<h4 id="title">Layer group example</h4>
|
||||
<p id="shortdesc">Example of a map with layer group.</p>
|
||||
<div id="docs">
|
||||
<p>See the <a href="layer-group.js" target="_blank">layer-group.js source</a> to see how this is done.</p>
|
||||
</div>
|
||||
<div id="tags">tilejson, input, bind, group, layergroup</div>
|
||||
</div>
|
||||
|
||||
<div id="layertree" class="span6">
|
||||
<h5>Click on layer nodes below to change their properties.</h5>
|
||||
<ul>
|
||||
<li><span>OpenAerial layer</span>
|
||||
<fieldset id="layer0">
|
||||
<label class="checkbox" for="visible0">
|
||||
<input id="visible0" class="visible" type="checkbox"/>visibility
|
||||
</label>
|
||||
<label>opacity</label>
|
||||
<input class="opacity" type="range" min="0" max="1" step="0.01"/>
|
||||
<label>hue</label>
|
||||
<input class="hue" type="range" min="-3.141592653589793" max="3.141592653589793" step="0.01"/>
|
||||
<label>saturation</label>
|
||||
<input class="saturation" type="range" min="0" max="5" step="0.01"/>
|
||||
<label>contrast</label>
|
||||
<input class="contrast" type="range" min="0" max="2" step="0.01"/>
|
||||
<label>brightness</label>
|
||||
<input class="brightness" type="range" min="-1" max="1" step="0.01"/>
|
||||
</fieldset>
|
||||
</li>
|
||||
<li><span>Layer group</span>
|
||||
<fieldset id="layer1">
|
||||
<label class="checkbox" for="visible1">
|
||||
<input id="visible1" class="visible" type="checkbox"/>visibility
|
||||
</label>
|
||||
<label>opacity</label>
|
||||
<input class="opacity" type="range" min="0" max="1" step="0.01"/>
|
||||
<label>hue</label>
|
||||
<input class="hue" type="range" min="-3.141592653589793" max="3.141592653589793" step="0.01"/>
|
||||
<label>saturation</label>
|
||||
<input class="saturation" type="range" min="0" max="5" step="0.01"/>
|
||||
<label>contrast</label>
|
||||
<input class="contrast" type="range" min="0" max="2" step="0.01"/>
|
||||
<label>brightness</label>
|
||||
<input class="brightness" type="range" min="-1" max="1" step="0.01"/>
|
||||
</fieldset>
|
||||
<ul>
|
||||
<li><span>Food insecurity layer</span>
|
||||
<fieldset id="layer10">
|
||||
<label class="checkbox" for="visible10">
|
||||
<input id="visible10" class="visible" type="checkbox"/>visibility
|
||||
</label>
|
||||
<label>opacity</label>
|
||||
<input class="opacity" type="range" min="0" max="1" step="0.01"/>
|
||||
<label>hue</label>
|
||||
<input class="hue" type="range" min="-3.141592653589793" max="3.141592653589793" step="0.01"/>
|
||||
<label>saturation</label>
|
||||
<input class="saturation" type="range" min="0" max="5" step="0.01"/>
|
||||
<label>contrast</label>
|
||||
<input class="contrast" type="range" min="0" max="2" step="0.01"/>
|
||||
<label>brightness</label>
|
||||
<input class="brightness" type="range" min="-1" max="1" step="0.01"/>
|
||||
</fieldset>
|
||||
</li>
|
||||
<li><span>World borders layer</span>
|
||||
<fieldset id="layer11">
|
||||
<label class="checkbox" for="visible11">
|
||||
<input id="visible11" class="visible" type="checkbox"/>visibility
|
||||
</label>
|
||||
<label>opacity</label>
|
||||
<input class="opacity" type="range" min="0" max="1" step="0.01"/>
|
||||
<label>hue</label>
|
||||
<input class="hue" type="range" min="-3.141592653589793" max="3.141592653589793" step="0.01"/>
|
||||
<label>saturation</label>
|
||||
<input class="saturation" type="range" min="0" max="5" step="0.01"/>
|
||||
<label>contrast</label>
|
||||
<input class="contrast" type="range" min="0" max="2" step="0.01"/>
|
||||
<label>brightness</label>
|
||||
<input class="brightness" type="range" min="-1" max="1" step="0.01"/>
|
||||
</fieldset>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="jquery.min.js" type="text/javascript"></script>
|
||||
<script src="loader.js?id=layer-group" type="text/javascript"></script>
|
||||
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
63
examples/layer-group.js
Normal file
63
examples/layer-group.js
Normal file
@@ -0,0 +1,63 @@
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.RendererHints');
|
||||
goog.require('ol.View2D');
|
||||
goog.require('ol.dom.Input');
|
||||
goog.require('ol.layer.Group');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.source.MapQuestOpenAerial');
|
||||
goog.require('ol.source.TileJSON');
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.MapQuestOpenAerial()
|
||||
}), new ol.layer.Group({
|
||||
layers: [
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.TileJSON({
|
||||
url: 'http://api.tiles.mapbox.com/v3/' +
|
||||
'mapbox.20110804-hoa-foodinsecurity-3month.jsonp',
|
||||
crossOrigin: 'anonymous'
|
||||
})
|
||||
}),
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.TileJSON({
|
||||
url: 'http://api.tiles.mapbox.com/v3/' +
|
||||
'mapbox.world-borders-light.jsonp',
|
||||
crossOrigin: 'anonymous'
|
||||
})
|
||||
})
|
||||
]
|
||||
})
|
||||
],
|
||||
renderers: ol.RendererHints.createFromQueryData(),
|
||||
target: 'map',
|
||||
view: new ol.View2D({
|
||||
center: ol.proj.transform([37.40570, 8.81566], 'EPSG:4326', 'EPSG:3857'),
|
||||
zoom: 4
|
||||
})
|
||||
});
|
||||
|
||||
function bindInputs(layerid, layer) {
|
||||
new ol.dom.Input($(layerid + ' .visible')[0])
|
||||
.bindTo('checked', layer, 'visible');
|
||||
$.each(['opacity', 'hue', 'saturation', 'contrast', 'brightness'],
|
||||
function(i, v) {
|
||||
new ol.dom.Input($(layerid + ' .' + v)[0])
|
||||
.bindTo('valueAsNumber', layer, v);
|
||||
}
|
||||
);
|
||||
}
|
||||
map.getLayers().forEach(function(layer, i) {
|
||||
bindInputs('#layer' + i, layer);
|
||||
if (layer instanceof ol.layer.Group) {
|
||||
layer.getLayers().forEach(function(sublayer, j) {
|
||||
bindInputs('#layer' + i + j, sublayer);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$('#layertree li > span').click(function() {
|
||||
$(this).siblings('fieldset').toggle();
|
||||
}).siblings('fieldset').hide();
|
||||
@@ -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
|
||||
* parameters:
|
||||
*
|
||||
* * hostname - the current hostname (window.location.hostname)
|
||||
* * port - 9810
|
||||
* * mode - ADVANCED
|
||||
* * mode - RAW
|
||||
* * id - id param in loader.js query string; defaults to 'ol' if not set
|
||||
*
|
||||
* Usage:
|
||||
@@ -20,7 +20,7 @@
|
||||
var params = {
|
||||
hostname: window.location.hostname,
|
||||
port: '9810',
|
||||
mode: 'ADVANCED',
|
||||
mode: 'RAW',
|
||||
id: 'ol'
|
||||
};
|
||||
if (window.location.protocol === 'file:' && !params.hostname) {
|
||||
@@ -59,8 +59,6 @@
|
||||
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('&');
|
||||
document.write('<script type="text/javascript" src="' + url + '"></script>');
|
||||
}());
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<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">
|
||||
@@ -14,13 +15,7 @@
|
||||
<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>
|
||||
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -35,7 +30,7 @@
|
||||
|
||||
<div class="row-fluid">
|
||||
|
||||
<div class="span4">
|
||||
<div class="span12">
|
||||
<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>
|
||||
<div id="docs">
|
||||
@@ -49,7 +44,7 @@
|
||||
</div>
|
||||
|
||||
<script src="loader.js?id=localized-openstreetmap" type="text/javascript"></script>
|
||||
<script src="../resources/social-links.js" type="text/javascript"></script>
|
||||
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -2,18 +2,19 @@ goog.require('ol.Attribution');
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.RendererHints');
|
||||
goog.require('ol.View2D');
|
||||
goog.require('ol.layer.TileLayer');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.source.OSM');
|
||||
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.TileLayer({
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.OSM({
|
||||
attributions: [
|
||||
new ol.Attribution(
|
||||
'All maps © ' +
|
||||
'<a href="http://www.opencyclemap.org/">OpenCycleMap</a>'),
|
||||
new ol.Attribution({
|
||||
html: 'All maps © ' +
|
||||
'<a href="http://www.opencyclemap.org/">OpenCycleMap</a>'
|
||||
}),
|
||||
ol.source.OSM.DATA_ATTRIBUTION
|
||||
],
|
||||
url: 'http://{a-c}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png'
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<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">
|
||||
@@ -14,13 +15,7 @@
|
||||
<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>
|
||||
<a class="brand" href="./"><img src="../resources/logo.png"> OpenLayers 3 Examples</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -35,7 +30,7 @@
|
||||
|
||||
<div class="row-fluid">
|
||||
|
||||
<div class="span4">
|
||||
<div class="span12">
|
||||
<h4 id="title">MapQuest example</h4>
|
||||
<p id="shortdesc">Example of a MapQuest map.</p>
|
||||
<div id="docs">
|
||||
@@ -49,7 +44,7 @@
|
||||
</div>
|
||||
|
||||
<script src="loader.js?id=mapquest" type="text/javascript"></script>
|
||||
<script src="../resources/social-links.js" type="text/javascript"></script>
|
||||
<script src="../resources/example-behaviour.js" type="text/javascript"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.RendererHints');
|
||||
goog.require('ol.View2D');
|
||||
goog.require('ol.layer.TileLayer');
|
||||
goog.require('ol.layer.Tile');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.source.MapQuestOSM');
|
||||
|
||||
|
||||
var map = new ol.Map({
|
||||
layers: [
|
||||
new ol.layer.TileLayer({
|
||||
new ol.layer.Tile({
|
||||
source: new ol.source.MapQuestOSM()
|
||||
})
|
||||
],
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user