Compare commits
1026 Commits
release-2.
...
release-2.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c8d4105d23 | ||
|
|
d60d1e5789 | ||
|
|
afaee6880d | ||
|
|
cc69b73dcf | ||
|
|
fe0ffbf56e | ||
|
|
f4f72d5eeb | ||
|
|
1c21d9cc15 | ||
|
|
4d52d4aeb5 | ||
|
|
1e94821042 | ||
|
|
8cccbfb189 | ||
|
|
1cf69634cf | ||
|
|
c2b7e8b327 | ||
|
|
fe0620dc7f | ||
|
|
8778b746b3 | ||
|
|
a5ea8d7fcf | ||
|
|
b103d3b428 | ||
|
|
8562582dd2 | ||
|
|
cd5ae45273 | ||
|
|
d1b00824fc | ||
|
|
4399ebcb04 | ||
|
|
0bb804c9e7 | ||
|
|
572d78fb4d | ||
|
|
1d948fc914 | ||
|
|
449b85966e | ||
|
|
1223ea339d | ||
|
|
d0f8fa3ecf | ||
|
|
e9a349e4f1 | ||
|
|
8b4592e71a | ||
|
|
7c5afe1acf | ||
|
|
c0ccf6a8f0 | ||
|
|
80482acdad | ||
|
|
90535134d4 | ||
|
|
989464cd93 | ||
|
|
1aabcde0a6 | ||
|
|
70bfba3011 | ||
|
|
54655c7fca | ||
|
|
779c97f43e | ||
|
|
48efd43250 | ||
|
|
142546c6d5 | ||
|
|
9d6ce21109 | ||
|
|
f3c0348567 | ||
|
|
ec4d3a48d7 | ||
|
|
5ecc54a689 | ||
|
|
7beb33f99e | ||
|
|
96fc2d71e3 | ||
|
|
5ed18a9708 | ||
|
|
5a3c06aa7e | ||
|
|
27ccd3cbaa | ||
|
|
43a8821ce6 | ||
|
|
6af9f5f3d3 | ||
|
|
2782fa47c8 | ||
|
|
11977f57a3 | ||
|
|
9f53506754 | ||
|
|
acc497bf3c | ||
|
|
3ef69b967d | ||
|
|
11a187ffaf | ||
|
|
e0f0744500 | ||
|
|
872502311f | ||
|
|
d63055f28c | ||
|
|
60a966714d | ||
|
|
415265db40 | ||
|
|
2613ccb504 | ||
|
|
7cb99834e3 | ||
|
|
2e88ca6905 | ||
|
|
7cb38f69d5 | ||
|
|
aa2345693a | ||
|
|
444d9a06ae | ||
|
|
1bdfb492d5 | ||
|
|
76efa60888 | ||
|
|
87d8b6003d | ||
|
|
f4725c48ce | ||
|
|
6fb10d6e0a | ||
|
|
44a2b50455 | ||
|
|
010035e047 | ||
|
|
ae8a04c601 | ||
|
|
111821e86d | ||
|
|
9cdc991b8c | ||
|
|
80a6185947 | ||
|
|
92ac9680d8 | ||
|
|
f22937b2ae | ||
|
|
5deb2c6280 | ||
|
|
e5dc583d52 | ||
|
|
e1dea2d8e1 | ||
|
|
62cb6d62f6 | ||
|
|
7ff0247b00 | ||
|
|
d3f32c4dea | ||
|
|
f0ef4728d8 | ||
|
|
aaabdbc803 | ||
|
|
93e800a9bd | ||
|
|
27233df5c7 | ||
|
|
f562b2a02c | ||
|
|
9f6b803afa | ||
|
|
c62ffb29b8 | ||
|
|
bc5054399c | ||
|
|
434178ef49 | ||
|
|
30a4069e8a | ||
|
|
fe172ccf6e | ||
|
|
c23b09d72a | ||
|
|
246d2d99d3 | ||
|
|
316c1888d2 | ||
|
|
e6dafa5d01 | ||
|
|
7f18a7b3df | ||
|
|
63ea10a916 | ||
|
|
6b79391b5e | ||
|
|
847584bbbd | ||
|
|
cae4df3ce7 | ||
|
|
29976ba98a | ||
|
|
04d3c6ce53 | ||
|
|
467bf66163 | ||
|
|
b3ce8d556a | ||
|
|
afd0388f87 | ||
|
|
d65f604b25 | ||
|
|
03735b74ab | ||
|
|
9a06ec47f6 | ||
|
|
17e972de3d | ||
|
|
410a88c674 | ||
|
|
b0bc72fa7f | ||
|
|
6fca6aef60 | ||
|
|
15800c01ad | ||
|
|
bed011514f | ||
|
|
d2a32d5421 | ||
|
|
7002ec49e7 | ||
|
|
3dea8dacb4 | ||
|
|
5b98769234 | ||
|
|
05227d32d0 | ||
|
|
e1e11ab9c6 | ||
|
|
a1bf41a4de | ||
|
|
7c10331a92 | ||
|
|
7c4df5186f | ||
|
|
461c5c4328 | ||
|
|
8e555dee56 | ||
|
|
f1a79135b4 | ||
|
|
22db2a9f61 | ||
|
|
007368fce5 | ||
|
|
2f85ca99bf | ||
|
|
419cb272c7 | ||
|
|
efdba65e0a | ||
|
|
fdb954100e | ||
|
|
a2896beafd | ||
|
|
0cf9833362 | ||
|
|
891cd35f60 | ||
|
|
399c8ff643 | ||
|
|
1ac16835f2 | ||
|
|
30c82bad45 | ||
|
|
d32ab41292 | ||
|
|
ba0ba64c74 | ||
|
|
e9eefc7a33 | ||
|
|
4d7eaf4939 | ||
|
|
e9b65691c4 | ||
|
|
4b163e0482 | ||
|
|
18b0c5fc7d | ||
|
|
d0249643b3 | ||
|
|
465498b83a | ||
|
|
73c5dbd8dc | ||
|
|
f46ed44131 | ||
|
|
982302ff03 | ||
|
|
97c793281f | ||
|
|
14bc72bcac | ||
|
|
09d1b9e8ca | ||
|
|
47d60a6ab8 | ||
|
|
7936f0345f | ||
|
|
661df3593d | ||
|
|
2a5e113126 | ||
|
|
d417ba7c25 | ||
|
|
716d85594c | ||
|
|
6c5ffb6930 | ||
|
|
0dc531794d | ||
|
|
5bfc4db4fb | ||
|
|
39a5aed5a6 | ||
|
|
a34e627b75 | ||
|
|
c5dbaf7cab | ||
|
|
d141ed60da | ||
|
|
70ea8f6588 | ||
|
|
a8d7d246e5 | ||
|
|
14a3afb6cf | ||
|
|
9f7a0ed448 | ||
|
|
cbc705bdf7 | ||
|
|
23355abb42 | ||
|
|
84e36dd573 | ||
|
|
47e7c300a8 | ||
|
|
378a0e97b5 | ||
|
|
69061d3f3d | ||
|
|
c7a4045e88 | ||
|
|
364d371f10 | ||
|
|
dea7438850 | ||
|
|
4dd76e0c74 | ||
|
|
17930432c7 | ||
|
|
40f9296372 | ||
|
|
c179c8493b | ||
|
|
da62be0137 | ||
|
|
549c97063b | ||
|
|
5bb5530fd7 | ||
|
|
459e38c2d6 | ||
|
|
36fd417095 | ||
|
|
32d7e02ec0 | ||
|
|
c742c14a52 | ||
|
|
3bc16555a0 | ||
|
|
0f9010cfb8 | ||
|
|
d7f013ddbd | ||
|
|
86c425774a | ||
|
|
e23c18a09c | ||
|
|
2a7547c36c | ||
|
|
fde7c5cc76 | ||
|
|
2cd14dfbfd | ||
|
|
e6c264286a | ||
|
|
3107751fb7 | ||
|
|
158185e9a2 | ||
|
|
58e33601ba | ||
|
|
aa6c5b8a35 | ||
|
|
b54faf222c | ||
|
|
774e983631 | ||
|
|
9b7e35d1dd | ||
|
|
443c715f51 | ||
|
|
3b56053849 | ||
|
|
b92887e76d | ||
|
|
b442f85bf4 | ||
|
|
83be3ff7e8 | ||
|
|
c1015d31e4 | ||
|
|
77eefdbd55 | ||
|
|
88e184e7e5 | ||
|
|
6ce72e9185 | ||
|
|
bbc73a21d8 | ||
|
|
8b501eb051 | ||
|
|
f0db21f9c9 | ||
|
|
c8564838bc | ||
|
|
18d548f979 | ||
|
|
4a3651b7da | ||
|
|
80f13188a3 | ||
|
|
9adbf431ca | ||
|
|
1eeda5d9f7 | ||
|
|
94020f0fb1 | ||
|
|
dcaefea3cc | ||
|
|
e8421fa923 | ||
|
|
9dfc5870fb | ||
|
|
5b5415d6b7 | ||
|
|
de4b995616 | ||
|
|
1e1ce54e5b | ||
|
|
5114ecbaee | ||
|
|
193e2696ad | ||
|
|
bec34f2d3d | ||
|
|
adba74b735 | ||
|
|
fe799ddfff | ||
|
|
f9bb64505b | ||
|
|
9c7f6e1de7 | ||
|
|
54c5656df5 | ||
|
|
0a93154f32 | ||
|
|
91bf459ab2 | ||
|
|
ed6a32cea7 | ||
|
|
730415aa74 | ||
|
|
951da38e80 | ||
|
|
d0af8726d3 | ||
|
|
ff4e6fc8d7 | ||
|
|
d720090310 | ||
|
|
f71976b487 | ||
|
|
a215f362cc | ||
|
|
76aa10c52c | ||
|
|
c8e0ba5544 | ||
|
|
3f9461e91c | ||
|
|
c9dbc33649 | ||
|
|
9788133b03 | ||
|
|
673f0d9a99 | ||
|
|
8193f309dc | ||
|
|
ddc6bd817d | ||
|
|
f06931b1b7 | ||
|
|
b15c751808 | ||
|
|
37fd98bb03 | ||
|
|
eb4bbff8f4 | ||
|
|
abd733865b | ||
|
|
a8ae30079e | ||
|
|
008c7d582e | ||
|
|
15138605c3 | ||
|
|
f7605dcb66 | ||
|
|
d3345a58b1 | ||
|
|
5f2c3803f4 | ||
|
|
57e833d71f | ||
|
|
0a639404c4 | ||
|
|
b076dd8041 | ||
|
|
e40034521b | ||
|
|
543a5f6881 | ||
|
|
700b036c1b | ||
|
|
f92f0ad02e | ||
|
|
fa14b94570 | ||
|
|
0915fb72a2 | ||
|
|
b57540ecfc | ||
|
|
75423660d8 | ||
|
|
06bd07ff8d | ||
|
|
69d759635f | ||
|
|
60a02e343b | ||
|
|
06409da72e | ||
|
|
510d42b12f | ||
|
|
8651e05e75 | ||
|
|
c118d9884d | ||
|
|
2c5d4c75d4 | ||
|
|
aedafc0336 | ||
|
|
88a3091a90 | ||
|
|
49ff1b44ea | ||
|
|
16981a8afa | ||
|
|
0e9691c628 | ||
|
|
be7c55f432 | ||
|
|
a8f1c76811 | ||
|
|
5a19c74604 | ||
|
|
809ecb1155 | ||
|
|
b6c2c26580 | ||
|
|
63a9567858 | ||
|
|
8ff05cdeac | ||
|
|
4b2e80fa36 | ||
|
|
07e039b566 | ||
|
|
2dfc23e217 | ||
|
|
1b2003a2b4 | ||
|
|
21448d2fd5 | ||
|
|
d2b3bded72 | ||
|
|
afe53aba7d | ||
|
|
0b8deb11a2 | ||
|
|
aa5bab250a | ||
|
|
a309b24053 | ||
|
|
13b4ca6560 | ||
|
|
b89d3f1ee8 | ||
|
|
c03f1dc9bf | ||
|
|
25c8b0ceaf | ||
|
|
980792e190 | ||
|
|
3d79001a92 | ||
|
|
3ab9a1f63b | ||
|
|
f51211e93f | ||
|
|
1764bbdd18 | ||
|
|
a02163f01d | ||
|
|
eb65336fa9 | ||
|
|
64d291ea20 | ||
|
|
44f28f8791 | ||
|
|
1081fc4b54 | ||
|
|
efd2de870a | ||
|
|
64177a52ec | ||
|
|
a02e08ad2a | ||
|
|
64df7e3d04 | ||
|
|
faa0e60b99 | ||
|
|
c0913668d3 | ||
|
|
ecbedf5536 | ||
|
|
273657a6ab | ||
|
|
781f2ac73d | ||
|
|
9609bb1449 | ||
|
|
80fa251649 | ||
|
|
2ee362a79b | ||
|
|
9759902dac | ||
|
|
d0986de775 | ||
|
|
5c07ae47bb | ||
|
|
810d9ea95d | ||
|
|
c6aa104462 | ||
|
|
fcd8586883 | ||
|
|
43c646b6da | ||
|
|
dd244e6988 | ||
|
|
86db8fabc6 | ||
|
|
fc64b2c5f8 | ||
|
|
ef028b1e91 | ||
|
|
f5d7f794c9 | ||
|
|
893966dfae | ||
|
|
6c5119455d | ||
|
|
2a21d61400 | ||
|
|
2c6b8aefcf | ||
|
|
a2c161be08 | ||
|
|
428335fd0d | ||
|
|
7790a0a9b6 | ||
|
|
0263b2b5e1 | ||
|
|
7aed43185b | ||
|
|
0cdb3aeb52 | ||
|
|
b404ca0a7a | ||
|
|
2478e2311f | ||
|
|
f4be1d138c | ||
|
|
f0f1ea0867 | ||
|
|
c9fa5aabad | ||
|
|
6c21c2043f | ||
|
|
d0c85850f5 | ||
|
|
06597f1897 | ||
|
|
69580cd698 | ||
|
|
00c3ca47c0 | ||
|
|
0a131f380a | ||
|
|
ee5796cb78 | ||
|
|
257b249b9d | ||
|
|
84cf468a22 | ||
|
|
083fcca882 | ||
|
|
ab5035ba05 | ||
|
|
bb788fdd0b | ||
|
|
ec5df48d01 | ||
|
|
3189a473fb | ||
|
|
9ea9b85988 | ||
|
|
7061cbf0fa | ||
|
|
0d78dda8c4 | ||
|
|
e295e3b70f | ||
|
|
e2dcfb7965 | ||
|
|
3d777cd263 | ||
|
|
6724098f5b | ||
|
|
ab53f7c311 | ||
|
|
1225c817b4 | ||
|
|
64508c741e | ||
|
|
c36b897878 | ||
|
|
8701a54603 | ||
|
|
5bffb3dea3 | ||
|
|
1b1e90c268 | ||
|
|
978cb4be9f | ||
|
|
d75e3ecac9 | ||
|
|
00d9664b95 | ||
|
|
6075b599f3 | ||
|
|
8a4bf871f1 | ||
|
|
b5364727a2 | ||
|
|
262153eecc | ||
|
|
df6e0a0846 | ||
|
|
470cce73ab | ||
|
|
1cc07232a7 | ||
|
|
9ddd3d3ed9 | ||
|
|
862a53ddaf | ||
|
|
eef879c152 | ||
|
|
663ba16b59 | ||
|
|
1d3eb0e60c | ||
|
|
195352c403 | ||
|
|
ec294af55a | ||
|
|
c48458faa5 | ||
|
|
5273d63f3a | ||
|
|
52d69ecfda | ||
|
|
cbd9a90477 | ||
|
|
f410cd7e41 | ||
|
|
14f009e2f7 | ||
|
|
5febfbc8ff | ||
|
|
13584d7319 | ||
|
|
798d2b2cb7 | ||
|
|
cbc4f4e422 | ||
|
|
12046503ca | ||
|
|
1f229ba275 | ||
|
|
3265b0e73f | ||
|
|
57e22ef491 | ||
|
|
fa740a42a9 | ||
|
|
7530751d98 | ||
|
|
a2fe036e2c | ||
|
|
d431b504bd | ||
|
|
4f5bcdbe76 | ||
|
|
575301ad32 | ||
|
|
8cc0cdc6a1 | ||
|
|
a4df9a871b | ||
|
|
c420fc6aad | ||
|
|
7ecbce28aa | ||
|
|
7b1bc2a675 | ||
|
|
6e18d0e254 | ||
|
|
4842c9e572 | ||
|
|
0fbe28a348 | ||
|
|
a54ecca32b | ||
|
|
5a3bcc716b | ||
|
|
b45f903198 | ||
|
|
703e0a2ca1 | ||
|
|
31b4c39b5b | ||
|
|
41ac2dea08 | ||
|
|
65fa1aaa2d | ||
|
|
796a349c61 | ||
|
|
ebeb49b5e7 | ||
|
|
8bb58e453b | ||
|
|
99906c8b98 | ||
|
|
fcb45d9c41 | ||
|
|
41ba4d0d51 | ||
|
|
47ef7e87f7 | ||
|
|
9ac758ae86 | ||
|
|
a2a391d3b5 | ||
|
|
8d36a1d7f7 | ||
|
|
8d0da09454 | ||
|
|
8d8a9f3105 | ||
|
|
4cf7f99de0 | ||
|
|
9e21911ca3 | ||
|
|
e6399a265d | ||
|
|
81d3584e09 | ||
|
|
993add338d | ||
|
|
7f2ce74dd7 | ||
|
|
ca532c5db6 | ||
|
|
ed66271be3 | ||
|
|
1c39820eb1 | ||
|
|
6efcab3d2d | ||
|
|
edb4798518 | ||
|
|
596ac680da | ||
|
|
8a8b3076c8 | ||
|
|
4b7a0b43b1 | ||
|
|
ee34448844 | ||
|
|
788d49a3bb | ||
|
|
3c416a4d60 | ||
|
|
0b46f19ba6 | ||
|
|
628978f894 | ||
|
|
d098897c79 | ||
|
|
a65a231da3 | ||
|
|
ea5a510d45 | ||
|
|
a9494394da | ||
|
|
41dac08cfa | ||
|
|
bccd0824b9 | ||
|
|
c3b13b5df3 | ||
|
|
8f860e516e | ||
|
|
0707bb49bd | ||
|
|
f08c562955 | ||
|
|
e38ab01752 | ||
|
|
6a37e72ae3 | ||
|
|
d5013d6df5 | ||
|
|
583dc15700 | ||
|
|
a0acf1e550 | ||
|
|
0eb8949ad2 | ||
|
|
f757580ed4 | ||
|
|
e5feda7ad7 | ||
|
|
157dd9e1c2 | ||
|
|
6607bcc0bb | ||
|
|
cf3ea0c7db | ||
|
|
ff4a1b2468 | ||
|
|
66455600c7 | ||
|
|
f78d127b1c | ||
|
|
7df5e3ca8e | ||
|
|
e7292ecbe2 | ||
|
|
c5bb52d93f | ||
|
|
d4f011d00c | ||
|
|
f1e7425821 | ||
|
|
2e44aff5f0 | ||
|
|
0b3f582e10 | ||
|
|
e8cc0deeb5 | ||
|
|
f17a3c70e4 | ||
|
|
74103ec3e0 | ||
|
|
ec8fa47a39 | ||
|
|
fd6e7ebe03 | ||
|
|
7e5e221c8d | ||
|
|
e3a5091ebd | ||
|
|
c0bff1c3ff | ||
|
|
8317744d31 | ||
|
|
47379ff7a2 | ||
|
|
88a7b7d3e2 | ||
|
|
3d1b0f0bd9 | ||
|
|
e326a9ea2f | ||
|
|
84a8d8d1f6 | ||
|
|
95839728a1 | ||
|
|
9113bc4004 | ||
|
|
ea86afec16 | ||
|
|
f055f13a3a | ||
|
|
363306bcd1 | ||
|
|
22c5e76b0b | ||
|
|
b63ce9af18 | ||
|
|
51ae75a54f | ||
|
|
8d8abac32a | ||
|
|
9a93e58080 | ||
|
|
cb1c3a834a | ||
|
|
e8987c0683 | ||
|
|
503fff32b6 | ||
|
|
4b91b9c304 | ||
|
|
877d81cffa | ||
|
|
9607ee480a | ||
|
|
499055e247 | ||
|
|
2a48759bc9 | ||
|
|
1348f97546 | ||
|
|
f7ca64b1aa | ||
|
|
341c08adee | ||
|
|
c88ad36600 | ||
|
|
6b2836b455 | ||
|
|
1063a4cd19 | ||
|
|
97b75578ba | ||
|
|
2197f1656a | ||
|
|
e8051ca1ec | ||
|
|
60cc590bf2 | ||
|
|
a4bc3f33e6 | ||
|
|
ec26dd6564 | ||
|
|
e8716847f8 | ||
|
|
053dba59a1 | ||
|
|
1d670fcddb | ||
|
|
287e9caf46 | ||
|
|
04e271570b | ||
|
|
ddd4c4c022 | ||
|
|
75f2e1f847 | ||
|
|
a3ec0f77e0 | ||
|
|
475cd7cd60 | ||
|
|
b2210d00a9 | ||
|
|
f0ad48597f | ||
|
|
405cebd482 | ||
|
|
26d4fe3ce8 | ||
|
|
0f58868830 | ||
|
|
87e7cfe29c | ||
|
|
e04d7cd627 | ||
|
|
470dde0e38 | ||
|
|
b7063b364c | ||
|
|
df19317c95 | ||
|
|
f6adcd2651 | ||
|
|
7b4cb8e3f5 | ||
|
|
5e4aea58f1 | ||
|
|
3b9ce4ca2d | ||
|
|
2843a18602 | ||
|
|
e4e06a877f | ||
|
|
39a6d7d8ef | ||
|
|
5cf260f38a | ||
|
|
88572303fb | ||
|
|
5fff368a2d | ||
|
|
006d98151f | ||
|
|
94f3ab393f | ||
|
|
4e3f3e2080 | ||
|
|
96db01006c | ||
|
|
e2acbc56d0 | ||
|
|
ebc71b492e | ||
|
|
ec9ab8129e | ||
|
|
c64621f510 | ||
|
|
b61120d3b5 | ||
|
|
9bc7bb8115 | ||
|
|
0108250ed9 | ||
|
|
79ca3cfd69 | ||
|
|
a83ab56f97 | ||
|
|
dc93478e6b | ||
|
|
970448effc | ||
|
|
7e326f97e2 | ||
|
|
4ae9f6878d | ||
|
|
49227967bc | ||
|
|
2696494443 | ||
|
|
bab1858bfc | ||
|
|
65cacaa756 | ||
|
|
159ee7c7b4 | ||
|
|
aef5517bfa | ||
|
|
98569203a6 | ||
|
|
093bb529d2 | ||
|
|
9d31c57e2a | ||
|
|
940c0e8ca2 | ||
|
|
584749b524 | ||
|
|
7249510553 | ||
|
|
c786952219 | ||
|
|
950904f59a | ||
|
|
99553d0ae5 | ||
|
|
f9cf3a0c95 | ||
|
|
a45cbfdb07 | ||
|
|
af70240191 | ||
|
|
9be8bb2416 | ||
|
|
14d5525ced | ||
|
|
679111fa88 | ||
|
|
90d3c2d9a9 | ||
|
|
f7860a329c | ||
|
|
f5aae88a31 | ||
|
|
0144a9473e | ||
|
|
37ebc3b991 | ||
|
|
b837d9bdf4 | ||
|
|
f3b0c2ec9d | ||
|
|
74f9a943cc | ||
|
|
7b91c9c26f | ||
|
|
f686589d1e | ||
|
|
0d8b76d2b2 | ||
|
|
0834593f9f | ||
|
|
0412410be0 | ||
|
|
301ed5c3ce | ||
|
|
5e0050cc9a | ||
|
|
2bd8b5c4ba | ||
|
|
d71e7a7beb | ||
|
|
1ba6aa75d7 | ||
|
|
7f32342ec3 | ||
|
|
36451db928 | ||
|
|
d1ed8bb952 | ||
|
|
f40d677164 | ||
|
|
d42f5ee993 | ||
|
|
484eda2ee5 | ||
|
|
419ead9191 | ||
|
|
34750774d7 | ||
|
|
293d173079 | ||
|
|
81dffce4f4 | ||
|
|
8058a800ed | ||
|
|
0e78d40da2 | ||
|
|
93211a31bc | ||
|
|
ab6b2ef008 | ||
|
|
58a83b0d17 | ||
|
|
b394b93723 | ||
|
|
fb3acbdbc2 | ||
|
|
533e5f4242 | ||
|
|
da3495beac | ||
|
|
6d5f5c37df | ||
|
|
b9670a292b | ||
|
|
78d07c8d8a | ||
|
|
b86394b79b | ||
|
|
e976f4f627 | ||
|
|
dfb1c1e234 | ||
|
|
a74fa3d52c | ||
|
|
b6296a40b6 | ||
|
|
69c8a8e161 | ||
|
|
4e956dc80d | ||
|
|
62f3f70910 | ||
|
|
43de5e9e0c | ||
|
|
c8161ed4ee | ||
|
|
69214d11b1 | ||
|
|
96dcf6063e | ||
|
|
6052d19c2f | ||
|
|
88982e043f | ||
|
|
fa90a42806 | ||
|
|
fe31af5c80 | ||
|
|
032df4b90a | ||
|
|
7141d237d9 | ||
|
|
704f36639b | ||
|
|
42b0172ab2 | ||
|
|
a7c202231f | ||
|
|
1d680df6d0 | ||
|
|
ff06ab64c6 | ||
|
|
3b69a3083c | ||
|
|
8208241e55 | ||
|
|
1af83576f2 | ||
|
|
3a5abf552a | ||
|
|
8ad7ad326a | ||
|
|
958544f2a7 | ||
|
|
96359fbc99 | ||
|
|
8d1d08b0c2 | ||
|
|
a662f82a1b | ||
|
|
4c07332c8a | ||
|
|
baabbc3658 | ||
|
|
0c87de44b4 | ||
|
|
476556e864 | ||
|
|
788d5a645a | ||
|
|
052be82288 | ||
|
|
f64912c09d | ||
|
|
cbba98279b | ||
|
|
acb489ad79 | ||
|
|
ed6098fdf4 | ||
|
|
4f3252bfe8 | ||
|
|
2b9ea5007b | ||
|
|
b7e2222d46 | ||
|
|
54a51904e9 | ||
|
|
8b2bab9d51 | ||
|
|
df64798bbb | ||
|
|
d455d3a62f | ||
|
|
99dd0bbcb2 | ||
|
|
a29009be91 | ||
|
|
066859b806 | ||
|
|
e3d1d3ea62 | ||
|
|
976554fc82 | ||
|
|
e603b06715 | ||
|
|
bd27f6a2ae | ||
|
|
1c4253f465 | ||
|
|
4c788c156b | ||
|
|
0e24164da3 | ||
|
|
b0377b54b0 | ||
|
|
2ff5a7b599 | ||
|
|
1d957c7f5c | ||
|
|
c1690b26c4 | ||
|
|
2bb9385b53 | ||
|
|
792e6d6a2c | ||
|
|
845e612b68 | ||
|
|
5c7b99373e | ||
|
|
aa0ec38b20 | ||
|
|
dc69749e3b | ||
|
|
09058e2457 | ||
|
|
2725cd93f6 | ||
|
|
f7f763d1d3 | ||
|
|
debbba6454 | ||
|
|
99f6e65e7b | ||
|
|
74dd106082 | ||
|
|
a6119f6a75 | ||
|
|
cf92ced1c8 | ||
|
|
5794502f98 | ||
|
|
366faf6871 | ||
|
|
acb9f950df | ||
|
|
51c7f12486 | ||
|
|
2da16a0b69 | ||
|
|
dd410dcd7e | ||
|
|
dc082c3442 | ||
|
|
f5a9b4446a | ||
|
|
8f38ba5bd0 | ||
|
|
1a25a0704f | ||
|
|
50d24d7756 | ||
|
|
a1dff8ad9b | ||
|
|
989259c87f | ||
|
|
c696b34a84 | ||
|
|
5c42aa6fce | ||
|
|
082a1f38f4 | ||
|
|
0accbb77a7 | ||
|
|
12b8166743 | ||
|
|
9a7b4bd06e | ||
|
|
ff1f99a03f | ||
|
|
88fd8038c8 | ||
|
|
440b9fb6d3 | ||
|
|
2141cb9c0a | ||
|
|
f5c43d6506 | ||
|
|
df44a79e1b | ||
|
|
ba4a68d0e3 | ||
|
|
5879a71f9c | ||
|
|
1108433465 | ||
|
|
f5e49fa82e | ||
|
|
f7e0edca12 | ||
|
|
d289aa327e | ||
|
|
65cd2bcb88 | ||
|
|
05162a7f9d | ||
|
|
97983db785 | ||
|
|
12931612ea | ||
|
|
f377d0387f | ||
|
|
2b8b8807ff | ||
|
|
a18ce5adf6 | ||
|
|
875a2b98ff | ||
|
|
dc3414d6dd | ||
|
|
57f4d42de0 | ||
|
|
2cd979d34c | ||
|
|
f27002b565 | ||
|
|
e3a32f29a8 | ||
|
|
95bc51ce3d | ||
|
|
7bc54e1517 | ||
|
|
88d927a827 | ||
|
|
c34b111b38 | ||
|
|
a997334816 | ||
|
|
1193e17266 | ||
|
|
95164d8cc0 | ||
|
|
348dffcda6 | ||
|
|
ae89452936 | ||
|
|
2bcd904df6 | ||
|
|
120cc0680d | ||
|
|
c673dbf9f2 | ||
|
|
92f04a7a42 | ||
|
|
a612302a11 | ||
|
|
f435a98a2a | ||
|
|
2624ea089e | ||
|
|
985233c2dd | ||
|
|
24b1fa1b08 | ||
|
|
af3615f1ee | ||
|
|
62bd06f465 | ||
|
|
adcf5bb20a | ||
|
|
e2c9662fa1 | ||
|
|
7cabcb10c1 | ||
|
|
8268616ec8 | ||
|
|
44f9b81085 | ||
|
|
bca3e45940 | ||
|
|
4e42dec4ab | ||
|
|
359bd3d598 | ||
|
|
114541d0b7 | ||
|
|
ea76d24f4c | ||
|
|
a87f5ac16a | ||
|
|
05672deefa | ||
|
|
9ea3c2f121 | ||
|
|
f7d4657c14 | ||
|
|
9933271b2a | ||
|
|
cb7cf5e18e | ||
|
|
866fa443fe | ||
|
|
44e526a0e8 | ||
|
|
72d1b54956 | ||
|
|
40b4cc49e0 | ||
|
|
9585341d9c | ||
|
|
a2c556f5c7 | ||
|
|
be6c90ed49 | ||
|
|
293ad9b32a | ||
|
|
4ad6bacc5d | ||
|
|
cadb20c18a | ||
|
|
8dabefebb2 | ||
|
|
f115c7a943 | ||
|
|
18b4d6808d | ||
|
|
6e34b048ff | ||
|
|
81ee9524c7 | ||
|
|
98fb795f97 | ||
|
|
e060b2ee4d | ||
|
|
23d8057222 | ||
|
|
d01f57d3e6 | ||
|
|
2608a0ebe7 | ||
|
|
b61cfdb054 | ||
|
|
678bf86337 | ||
|
|
743dc9a738 | ||
|
|
ac3d361778 | ||
|
|
bab9b0fa66 | ||
|
|
612401a644 | ||
|
|
9c0503a99f | ||
|
|
da67953c61 | ||
|
|
5f1651a30f | ||
|
|
042ad8d711 | ||
|
|
9bbc1d4318 | ||
|
|
a0d0180e03 | ||
|
|
de97975144 | ||
|
|
c56a861ec7 | ||
|
|
c4a087d4dd | ||
|
|
77cf56a4b6 | ||
|
|
1ace4df160 | ||
|
|
f4a77cad06 | ||
|
|
fc0b15ad45 | ||
|
|
07533fcdcb | ||
|
|
2b5b59bea5 | ||
|
|
9a7b8b1cca | ||
|
|
ec7b12257b | ||
|
|
179433da2f | ||
|
|
a57c56ed96 | ||
|
|
c6c1bf1f77 | ||
|
|
af046b9af8 | ||
|
|
11cc960be5 | ||
|
|
07114fc894 | ||
|
|
305c6ef064 | ||
|
|
3b91e41690 | ||
|
|
43126239ff | ||
|
|
ab87c33670 | ||
|
|
e70ee09a4d | ||
|
|
1691d4a71f | ||
|
|
e690f28517 | ||
|
|
a57738e817 | ||
|
|
f36fd5f0d1 | ||
|
|
bd4c092943 | ||
|
|
9ab6d08fb0 | ||
|
|
e998335718 | ||
|
|
a73d9e3804 | ||
|
|
70161c5628 | ||
|
|
551f509b49 | ||
|
|
363f837acb | ||
|
|
ef33f01504 | ||
|
|
faaa2cec1f | ||
|
|
163caf0e8d | ||
|
|
8533edd19b | ||
|
|
4cd34bc851 | ||
|
|
d86c1b6c9c | ||
|
|
56d7cee8cf | ||
|
|
53ed973eec | ||
|
|
d08fb575b1 | ||
|
|
d5bdadc18e | ||
|
|
292da06150 | ||
|
|
4af41b41f5 | ||
|
|
bce40d9e42 | ||
|
|
f70b500aac | ||
|
|
ce18994664 | ||
|
|
a96d32d284 | ||
|
|
f07660e8c5 | ||
|
|
7ec0071823 | ||
|
|
90a8ac9c71 | ||
|
|
a5c5fd8d3e | ||
|
|
3dfa3fd157 | ||
|
|
c40bdc90e9 | ||
|
|
e14d7d686e | ||
|
|
b683c9bae1 | ||
|
|
342f647135 | ||
|
|
c88a610f21 | ||
|
|
b672a58c35 | ||
|
|
029bdaccde | ||
|
|
84e5c47caa | ||
|
|
bfd6be634f | ||
|
|
ebfbb354ed | ||
|
|
6adac12fab | ||
|
|
6a039fd700 | ||
|
|
1a59e47737 | ||
|
|
344e2124c9 | ||
|
|
59cc18d85b | ||
|
|
ae75fdacd7 | ||
|
|
58e86a37f5 | ||
|
|
4df1104b7a | ||
|
|
685eae7c04 | ||
|
|
24d421a449 | ||
|
|
0554637c56 | ||
|
|
b1b4736315 | ||
|
|
2582e762b7 | ||
|
|
326598a75c | ||
|
|
5c597de900 | ||
|
|
96e5241507 | ||
|
|
fef8b98f32 | ||
|
|
530952551f | ||
|
|
f21678f55b | ||
|
|
f2dd130256 | ||
|
|
f870417a30 | ||
|
|
160ccef8d3 | ||
|
|
eb2d62dacb | ||
|
|
9d23b81dae | ||
|
|
d650ba20d9 | ||
|
|
d8473f9249 | ||
|
|
3385c2b5b1 | ||
|
|
6ce9a36715 | ||
|
|
99da137be0 | ||
|
|
c2f517ba18 | ||
|
|
8c7263f16e | ||
|
|
8c6466bf2a | ||
|
|
d252a6156a | ||
|
|
8f20ff8ca0 | ||
|
|
5b40ffe474 | ||
|
|
1e5f83593c | ||
|
|
86cd9c7bf7 | ||
|
|
46ba55d886 | ||
|
|
e4247472f9 | ||
|
|
337afdfe8f | ||
|
|
09b459619b | ||
|
|
2789c29c98 | ||
|
|
8bc307b5a1 | ||
|
|
c3fe359fa6 | ||
|
|
a00b565fcc | ||
|
|
4b22a1e2d2 | ||
|
|
e773ec32d1 | ||
|
|
2e83863e90 | ||
|
|
0460bd2ae8 | ||
|
|
9a5364f309 | ||
|
|
23301e10ea | ||
|
|
35333681c1 | ||
|
|
b876f815fb | ||
|
|
943efd66b0 | ||
|
|
30af95d034 | ||
|
|
d5adedb708 | ||
|
|
349fc2f69e | ||
|
|
ecbf9966ba | ||
|
|
e35dfe1a5a | ||
|
|
e0b93c2e45 | ||
|
|
cc68be49bf | ||
|
|
33f8fa0aff | ||
|
|
650df2a8f1 | ||
|
|
75c187d5a3 | ||
|
|
95eb1454f4 | ||
|
|
f5cc652685 | ||
|
|
2cc0090f81 | ||
|
|
6b04ff1c94 | ||
|
|
5f4519b378 | ||
|
|
3a925d9903 | ||
|
|
d4e6253447 | ||
|
|
4c0d85ee67 | ||
|
|
bb09ff341e | ||
|
|
801b32a667 | ||
|
|
9e31fb6e9a | ||
|
|
175423b3ba | ||
|
|
9a9a5ba452 | ||
|
|
d574f09e6a | ||
|
|
74a34ec14b | ||
|
|
032293c26f | ||
|
|
3eedfce46e | ||
|
|
48a2d023f5 | ||
|
|
11395e7e84 | ||
|
|
1a59ade32a | ||
|
|
31c2d183f6 | ||
|
|
8c93d477ba | ||
|
|
720a815479 | ||
|
|
d1d5ab9930 | ||
|
|
eb74d93d48 | ||
|
|
935c56961b | ||
|
|
87763af644 | ||
|
|
8f3f5d1366 | ||
|
|
fb1a49e87e | ||
|
|
0dce0b9a5b | ||
|
|
fda512f904 | ||
|
|
955c83baa9 | ||
|
|
965e269cfd | ||
|
|
067a11f1d9 | ||
|
|
f84a2d0bc9 | ||
|
|
a28a9d2121 | ||
|
|
6b8c7a8ca5 | ||
|
|
221292436a | ||
|
|
430d09eb55 | ||
|
|
94bd37031d | ||
|
|
7a769830fe | ||
|
|
81b67db101 | ||
|
|
0cd3b6553e | ||
|
|
5af323dc51 | ||
|
|
5c2c39c9dd | ||
|
|
de2eeaab0b | ||
|
|
ece872b81a | ||
|
|
ee8e892bb4 |
@@ -379,7 +379,6 @@ Group: OpenLayers {
|
|||||||
|
|
||||||
File: Popup (no auto-title, OpenLayers/Popup.js)
|
File: Popup (no auto-title, OpenLayers/Popup.js)
|
||||||
File: Anchored (no auto-title, OpenLayers/Popup/Anchored.js)
|
File: Anchored (no auto-title, OpenLayers/Popup/Anchored.js)
|
||||||
File: AnchoredBubble (no auto-title, OpenLayers/Popup/AnchoredBubble.js)
|
|
||||||
File: Framed (no auto-title, OpenLayers/Popup/Framed.js)
|
File: Framed (no auto-title, OpenLayers/Popup/Framed.js)
|
||||||
File: FramedCloud (no auto-title, OpenLayers/Popup/FramedCloud.js)
|
File: FramedCloud (no auto-title, OpenLayers/Popup/FramedCloud.js)
|
||||||
} # Group: Popup
|
} # Group: Popup
|
||||||
|
|||||||
@@ -32,6 +32,13 @@ def build(config_file = None, output_file = None, options = None):
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
print "No minimize"
|
print "No minimize"
|
||||||
|
|
||||||
|
try:
|
||||||
|
import uglify_js
|
||||||
|
uglify_js.check_available()
|
||||||
|
have_compressor.append("uglify-js")
|
||||||
|
except Exception, E:
|
||||||
|
print "No uglify-js (%s)" % E
|
||||||
|
|
||||||
use_compressor = None
|
use_compressor = None
|
||||||
if options.compressor and options.compressor in have_compressor:
|
if options.compressor and options.compressor in have_compressor:
|
||||||
use_compressor = options.compressor
|
use_compressor = options.compressor
|
||||||
@@ -52,7 +59,7 @@ def build(config_file = None, output_file = None, options = None):
|
|||||||
|
|
||||||
print "Merging libraries."
|
print "Merging libraries."
|
||||||
try:
|
try:
|
||||||
if use_compressor == "closure":
|
if use_compressor == "closure" or use_compressor == 'uglify-js':
|
||||||
sourceFiles = mergejs.getNames(sourceDirectory, configFilename)
|
sourceFiles = mergejs.getNames(sourceDirectory, configFilename)
|
||||||
else:
|
else:
|
||||||
merged = mergejs.run(sourceDirectory, None, configFilename)
|
merged = mergejs.run(sourceDirectory, None, configFilename)
|
||||||
@@ -60,6 +67,15 @@ def build(config_file = None, output_file = None, options = None):
|
|||||||
print "\nAbnormal termination."
|
print "\nAbnormal termination."
|
||||||
sys.exit("ERROR: %s" % E)
|
sys.exit("ERROR: %s" % E)
|
||||||
|
|
||||||
|
if options.amdname:
|
||||||
|
options.amdname = "'" + options.amdname + "',"
|
||||||
|
else:
|
||||||
|
options.amdname = ""
|
||||||
|
|
||||||
|
if options.amd == 'pre':
|
||||||
|
print "\nAdding AMD function."
|
||||||
|
merged = "define(%sfunction(){%sreturn OpenLayers;});" % (options.amdname, merged)
|
||||||
|
|
||||||
print "Compressing using %s" % use_compressor
|
print "Compressing using %s" % use_compressor
|
||||||
if use_compressor == "jsmin":
|
if use_compressor == "jsmin":
|
||||||
minimized = jsmin.jsmin(merged)
|
minimized = jsmin.jsmin(merged)
|
||||||
@@ -98,9 +114,25 @@ def build(config_file = None, output_file = None, options = None):
|
|||||||
print "\nAbnormal termination due to compilation errors."
|
print "\nAbnormal termination due to compilation errors."
|
||||||
sys.exit("ERROR: Closure Compilation failed! See compilation errors.")
|
sys.exit("ERROR: Closure Compilation failed! See compilation errors.")
|
||||||
print "Closure Compilation has completed successfully."
|
print "Closure Compilation has completed successfully."
|
||||||
|
elif use_compressor == "uglify-js":
|
||||||
|
minimized = uglify_js.compile(sourceFiles)
|
||||||
|
if minimized is None:
|
||||||
|
print "\nAbnormal termination due to compilation errors."
|
||||||
|
sys.exit("ERROR: Uglify JS compilation failed! See compilation errors.")
|
||||||
|
|
||||||
|
print "Uglify JS compilation has completed successfully."
|
||||||
|
|
||||||
else: # fallback
|
else: # fallback
|
||||||
minimized = merged
|
minimized = merged
|
||||||
|
|
||||||
|
if options.amd == 'post':
|
||||||
|
print "\nAdding AMD function."
|
||||||
|
minimized = "define(%sfunction(){%sreturn OpenLayers;});" % (options.amdname, minimized)
|
||||||
|
|
||||||
|
if options.status:
|
||||||
|
print "\nAdding status file."
|
||||||
|
minimized = "// status: " + file(options.status).read() + minimized
|
||||||
|
|
||||||
print "\nAdding license file."
|
print "\nAdding license file."
|
||||||
minimized = file("license.txt").read() + minimized
|
minimized = file("license.txt").read() + minimized
|
||||||
|
|
||||||
@@ -111,7 +143,10 @@ def build(config_file = None, output_file = None, options = None):
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
opt = optparse.OptionParser(usage="%s [options] [config_file] [output_file]\n Default config_file is 'full.cfg', Default output_file is 'OpenLayers.js'")
|
opt = optparse.OptionParser(usage="%s [options] [config_file] [output_file]\n Default config_file is 'full.cfg', Default output_file is 'OpenLayers.js'")
|
||||||
opt.add_option("-c", "--compressor", dest="compressor", help="compression method: one of 'jsmin', 'minimize', 'closure_ws', 'closure', or 'none'", default="jsmin")
|
opt.add_option("-c", "--compressor", dest="compressor", help="compression method: one of 'jsmin' (default), 'minimize', 'closure_ws', 'closure', or 'none'", default="jsmin")
|
||||||
|
opt.add_option("-s", "--status", dest="status", help="name of a file whose contents will be added as a comment at the front of the output file. For example, when building from a git repo, you can save the output of 'git describe --tags' in this file. Default is no file.", default=False)
|
||||||
|
opt.add_option("--amd", dest="amd", help="output should be AMD module; wrap merged files in define function; can be either 'pre' (before compilation) or 'post' (after compilation). Wrapping the OpenLayers var in a function means the filesize can be reduced by the closure compiler using 'pre', but be aware that a few functions depend on the OpenLayers variable being present. Either option can be used with jsmin or minimize compression. Default false, not AMD.", default=False)
|
||||||
|
opt.add_option("--amdname", dest="amdname", help="only useful with amd option. Name of AMD module. Default no name, anonymous module.", default=False)
|
||||||
(options, args) = opt.parse_args()
|
(options, args) = opt.parse_args()
|
||||||
if not len(args):
|
if not len(args):
|
||||||
build(options=options)
|
build(options=options)
|
||||||
|
|||||||
@@ -2,14 +2,14 @@
|
|||||||
|
|
||||||
OpenLayers.js -- OpenLayers Map Viewer Library
|
OpenLayers.js -- OpenLayers Map Viewer Library
|
||||||
|
|
||||||
Copyright 2005-2011 OpenLayers Contributors, released under the FreeBSD
|
Copyright (c) 2006-2013 by OpenLayers Contributors
|
||||||
license. Please see http://svn.openlayers.org/trunk/openlayers/license.txt
|
Published under the 2-clause BSD license.
|
||||||
for the full text of the license.
|
See http://openlayers.org/dev/license.txt for the full text of the license, and http://openlayers.org/dev/authors.txt for full list of contributors.
|
||||||
|
|
||||||
Includes compressed code under the following licenses:
|
Includes compressed code under the following licenses:
|
||||||
|
|
||||||
(For uncompressed versions of the code used please see the
|
(For uncompressed versions of the code used, please see the
|
||||||
OpenLayers SVN repository: <http://openlayers.org/>)
|
OpenLayers Github repository: <https://github.com/openlayers/openlayers>)
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ OpenLayers/Protocol/HTTP.js
|
|||||||
OpenLayers/Protocol/WFS.js
|
OpenLayers/Protocol/WFS.js
|
||||||
OpenLayers/Protocol/WFS/v1_0_0.js
|
OpenLayers/Protocol/WFS/v1_0_0.js
|
||||||
OpenLayers/Strategy/Fixed.js
|
OpenLayers/Strategy/Fixed.js
|
||||||
|
OpenLayers/TileManager.js
|
||||||
|
|
||||||
[exclude]
|
[exclude]
|
||||||
|
|
||||||
|
|||||||
@@ -7,4 +7,5 @@
|
|||||||
[include]
|
[include]
|
||||||
|
|
||||||
[exclude]
|
[exclude]
|
||||||
|
Firebug
|
||||||
OpenLayers.js
|
OpenLayers.js
|
||||||
|
|||||||
@@ -1,49 +0,0 @@
|
|||||||
Customizing OpenLayers
|
|
||||||
======================
|
|
||||||
|
|
||||||
OpenLayers is designed to fit many needs -- fitting in alongside all kinds of
|
|
||||||
various applications which are currently in use.
|
|
||||||
|
|
||||||
Currently, OpenLayers supports a 'theme' option when creating a map. This
|
|
||||||
theme option allows you to specify the location of a CSS theme which should
|
|
||||||
be included.
|
|
||||||
|
|
||||||
A default theme is available as an example in the theme/ directory: the setup
|
|
||||||
is:
|
|
||||||
|
|
||||||
* theme/
|
|
||||||
* theme/default/
|
|
||||||
* theme/default/style.css
|
|
||||||
* theme/default/img/
|
|
||||||
|
|
||||||
Currently, the OpenLayers code does not support class names, and therefore,
|
|
||||||
it is not possible to control many aspects of OpenLayers code with CSS
|
|
||||||
classes. However, with this framework in place, we expect to invest time
|
|
||||||
to make existing features and new features use the CSS theming framework
|
|
||||||
where apropriate.
|
|
||||||
|
|
||||||
|
|
||||||
Class Naming
|
|
||||||
============
|
|
||||||
Elements should have class names which are descriptive of the Javascript
|
|
||||||
class from which they come. For example, the main layer switcher element
|
|
||||||
in the OpenLayers.Control.LayerSwitcher would be classed:
|
|
||||||
|
|
||||||
olControlLayerSwitcher
|
|
||||||
|
|
||||||
This would allow users to add to their style.css class in their theme,
|
|
||||||
changing, for example:
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
.olControlLayerSwitcher input {
|
|
||||||
width:10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
Sub elements of a particular control can add to the class name:
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
.olControlLayerSwitcherBaseLabel {
|
|
||||||
color: red;
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
Automatically generated OpenLayers API documentation is online:
|
|
||||||
|
|
||||||
http://dev.openlayers.org/apidocs
|
|
||||||
|
|
||||||
More information on documentation is available from:
|
|
||||||
|
|
||||||
http://trac.openlayers.org/wiki/Documentation
|
|
||||||
@@ -379,7 +379,6 @@ Group: OpenLayers {
|
|||||||
|
|
||||||
File: Popup (no auto-title, OpenLayers/Popup.js)
|
File: Popup (no auto-title, OpenLayers/Popup.js)
|
||||||
File: Anchored (no auto-title, OpenLayers/Popup/Anchored.js)
|
File: Anchored (no auto-title, OpenLayers/Popup/Anchored.js)
|
||||||
File: AnchoredBubble (no auto-title, OpenLayers/Popup/AnchoredBubble.js)
|
|
||||||
File: Framed (no auto-title, OpenLayers/Popup/Framed.js)
|
File: Framed (no auto-title, OpenLayers/Popup/Framed.js)
|
||||||
File: FramedCloud (no auto-title, OpenLayers/Popup/FramedCloud.js)
|
File: FramedCloud (no auto-title, OpenLayers/Popup/FramedCloud.js)
|
||||||
} # Group: Popup
|
} # Group: Popup
|
||||||
|
|||||||
@@ -12,11 +12,12 @@
|
|||||||
format = new OpenLayers.Format.WMSDescribeLayer();
|
format = new OpenLayers.Format.WMSDescribeLayer();
|
||||||
html = "<br>";
|
html = "<br>";
|
||||||
resp = format.read(req.responseText);
|
resp = format.read(req.responseText);
|
||||||
for(var i = 0; i < resp.length; i++) {
|
var layerDescriptions = resp.layerDescriptions;
|
||||||
html += "Layer: typeName: "+ resp[i].typeName+",";
|
for(var i = 0; i < layerDescriptions.length; i++) {
|
||||||
|
html += "Layer: typeName: "+layerDescriptions[i].typeName+",";
|
||||||
html += "<ul>";
|
html += "<ul>";
|
||||||
html += "<li>owsURL: "+resp[i].owsURL+"</li>";
|
html += "<li>owsURL: "+layerDescriptions[i].owsURL+"</li>";
|
||||||
html += "<li>owsType: "+resp[i].owsType+"</li>";
|
html += "<li>owsType: "+layerDescriptions[i].owsType+"</li>";
|
||||||
html += "</ul>"
|
html += "</ul>"
|
||||||
}
|
}
|
||||||
document.getElementById('output').innerHTML = html;
|
document.getElementById('output').innerHTML = html;
|
||||||
|
|||||||
@@ -6,9 +6,8 @@
|
|||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
<title>OpenLayers All Overlays with Google and OSM</title>
|
<title>OpenLayers All Overlays with Google and OSM</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css">
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../theme/default/google.css" type="text/css">
|
|
||||||
<link rel="stylesheet" href="style.css" type="text/css">
|
<link rel="stylesheet" href="style.css" type="text/css">
|
||||||
<script src="http://maps.google.com/maps/api/js?v=3.6&sensor=false"></script>
|
<script src="http://maps.google.com/maps/api/js?v=3&sensor=false"></script>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script src="all-overlays-google.js"></script>
|
<script src="all-overlays-google.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -23,7 +23,9 @@ var hybrid = new OpenLayers.Layer.Bing({
|
|||||||
|
|
||||||
map.addLayers([road, aerial, hybrid]);
|
map.addLayers([road, aerial, hybrid]);
|
||||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||||
|
// Zoom level numbering depends on metadata from Bing, which is not yet loaded.
|
||||||
|
var zoom = map.getZoomForResolution(76.43702827453613);
|
||||||
map.setCenter(new OpenLayers.LonLat(-71.147, 42.472).transform(
|
map.setCenter(new OpenLayers.LonLat(-71.147, 42.472).transform(
|
||||||
new OpenLayers.Projection("EPSG:4326"),
|
new OpenLayers.Projection("EPSG:4326"),
|
||||||
map.getProjectionObject()
|
map.getProjectionObject()
|
||||||
), 11);
|
), zoom);
|
||||||
|
|||||||
81
examples/bootstrap.html
Normal file
81
examples/bootstrap.html
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Bootstraped OpenLayers</title>
|
||||||
|
<link rel="stylesheet" href="../theme/default/style.css">
|
||||||
|
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap.min.css" rel="stylesheet">
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
padding-top: 60px;
|
||||||
|
padding-bottom: 40px;
|
||||||
|
}
|
||||||
|
#map {
|
||||||
|
height: 350px;
|
||||||
|
background-color: #eee;
|
||||||
|
}
|
||||||
|
.olControlAttribution {
|
||||||
|
bottom: 3px;
|
||||||
|
left: 10px;
|
||||||
|
line-height: 9px;
|
||||||
|
font-size: 9px;
|
||||||
|
color: #ccc;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-responsive.min.css" rel="stylesheet">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||||
|
<div class="navbar-inner">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<a class="brand" href="/">openlayers.org</a>
|
||||||
|
<ul class="nav">
|
||||||
|
<li>
|
||||||
|
<a href="./">
|
||||||
|
<i class="icon-globe icon-white"></i> examples
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="container-fluid" ng-controller="AlertsCtrl">
|
||||||
|
<div class="row-fluid">
|
||||||
|
<div class="span7">
|
||||||
|
<div id="map"></div>
|
||||||
|
</div>
|
||||||
|
<div class="span5">
|
||||||
|
<h4>OpenLayers and Bootstrap</h4>
|
||||||
|
<p>
|
||||||
|
This example demonstrates an OpenLayers map in a fluid
|
||||||
|
layout using Bootstrap CSS.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Note that the OpenLayers stylesheet is loaded before
|
||||||
|
Bootstrap. The Bootstrap CSS sets the maximum width for
|
||||||
|
images to be 100% (of their containing element).
|
||||||
|
</p>
|
||||||
|
<pre><code>img {
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
</code></pre>
|
||||||
|
<p>
|
||||||
|
This causes problems for images that you might want to be
|
||||||
|
bigger than their containing element (e.g. big tile in small
|
||||||
|
map viewport). To overcome this, the OpenLayers CSS
|
||||||
|
overrides this <code>max-width</code> setting. If you are
|
||||||
|
not loading the OpenLayers default CSS or are having trouble
|
||||||
|
with tile sizing and Bootstrap, add the following to your
|
||||||
|
markup:
|
||||||
|
</p>
|
||||||
|
<pre><code><style>
|
||||||
|
img.olTileImage {
|
||||||
|
max-width: none;
|
||||||
|
}
|
||||||
|
</style></code></pre>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
|
<script src="bootstrap.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
31
examples/bootstrap.js
vendored
Normal file
31
examples/bootstrap.js
vendored
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
var map = new OpenLayers.Map({
|
||||||
|
div: "map",
|
||||||
|
projection: "EPSG:900913",
|
||||||
|
layers: [
|
||||||
|
new OpenLayers.Layer.XYZ(
|
||||||
|
"Imagery",
|
||||||
|
[
|
||||||
|
"http://oatile1.mqcdn.com/naip/${z}/${x}/${y}.png",
|
||||||
|
"http://oatile2.mqcdn.com/naip/${z}/${x}/${y}.png",
|
||||||
|
"http://oatile3.mqcdn.com/naip/${z}/${x}/${y}.png",
|
||||||
|
"http://oatile4.mqcdn.com/naip/${z}/${x}/${y}.png"
|
||||||
|
],
|
||||||
|
{
|
||||||
|
attribution: "Tiles Courtesy of <a href='http://open.mapquest.co.uk/' target='_blank'>MapQuest</a>. Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency. <img src='http://developer.mapquest.com/content/osm/mq_logo.png' border='0'>",
|
||||||
|
transitionEffect: "resize",
|
||||||
|
wrapDateLine: true
|
||||||
|
}
|
||||||
|
)
|
||||||
|
],
|
||||||
|
controls: [
|
||||||
|
new OpenLayers.Control.Navigation({
|
||||||
|
dragPanOptions: {
|
||||||
|
enableKinetic: true
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
new OpenLayers.Control.Zoom(),
|
||||||
|
new OpenLayers.Control.Attribution()
|
||||||
|
],
|
||||||
|
center: [0, 0],
|
||||||
|
zoom: 1
|
||||||
|
});
|
||||||
@@ -8,13 +8,10 @@ function init() {
|
|||||||
div: "map",
|
div: "map",
|
||||||
projection: "EPSG:900913",
|
projection: "EPSG:900913",
|
||||||
layers: [
|
layers: [
|
||||||
new OpenLayers.Layer.WMS("OSGeo", "http://vmap0.tiles.osgeo.org/wms/vmap0", {
|
new OpenLayers.Layer.WMS(
|
||||||
layers: "basic"
|
"OSGeo", "http://vmap0.tiles.osgeo.org/wms/vmap0",
|
||||||
}, {
|
{layers: "basic"}
|
||||||
eventListeners: {
|
)
|
||||||
tileloaded: updateStatus
|
|
||||||
}
|
|
||||||
})
|
|
||||||
],
|
],
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
zoom: 1
|
zoom: 1
|
||||||
@@ -38,6 +35,7 @@ function init() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// update the number of cached tiles and detect local storage support
|
// update the number of cached tiles and detect local storage support
|
||||||
|
map.layers[0].events.on({'tileloaded': updateStatus});
|
||||||
function updateStatus() {
|
function updateStatus() {
|
||||||
if (window.localStorage) {
|
if (window.localStorage) {
|
||||||
status.innerHTML = localStorage.length + " entries in cache.";
|
status.innerHTML = localStorage.length + " entries in cache.";
|
||||||
|
|||||||
71
examples/cartodb-geojson.html
Normal file
71
examples/cartodb-geojson.html
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Reading Features From CartoDB using GeoJSON</title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="style.css" type="text/css">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||||
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1 id="title">Reading Features From CartoDB using GeoJSON</h1>
|
||||||
|
<div id="tags">
|
||||||
|
protocol, script, cartodb
|
||||||
|
</div>
|
||||||
|
<p id="shortdesc">
|
||||||
|
Demonstrates how to load features on OpenLayers using CartoDB SQL API.
|
||||||
|
</p>
|
||||||
|
<div id="map" class="smallmap"></div>
|
||||||
|
<div id="docs">
|
||||||
|
<p>
|
||||||
|
<a href="http://cartodb.com/">CartoDB</a> is an Open Source
|
||||||
|
Geopatial Database on the cloud. It allows you to import your
|
||||||
|
data in shapefiles, KML, OpenStreeMap files, CSV, etc. and
|
||||||
|
then analyze and visualize it. Internally CartoDB uses PostGIS
|
||||||
|
2.0 so all functionality in PostGIS can be used straight
|
||||||
|
away. CartoDB exposes two APIS. One
|
||||||
|
to <a href="http://developers.cartodb.com/documentation/cartodb-apis.html#maps_api">generate maps</a>
|
||||||
|
as tiles with interactivity, and another <a href="http://developers.cartodb.com/documentation/cartodb-apis.html#sql_api">SQL API</a>
|
||||||
|
to retrieve vector data using among other formats, GeoJSON. In
|
||||||
|
this example we do a very simple query to obtain all protected
|
||||||
|
areas in Costa Rica from a public table. You can adapt the SQL
|
||||||
|
to include where clauses or complicate geospatial queries.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
View the source code of this page to see how this is done. And
|
||||||
|
check the table on CartoDB
|
||||||
|
for <a href="https://examples.cartodb.com/tables/costa_rica_pa/public#/map">Protected Areas in Costa Rica</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
var map = new OpenLayers.Map({
|
||||||
|
div: "map",
|
||||||
|
layers: [
|
||||||
|
new OpenLayers.Layer.OSM(),
|
||||||
|
new OpenLayers.Layer.Vector("Vectors", {
|
||||||
|
projection: new OpenLayers.Projection("EPSG:4326"),
|
||||||
|
strategies: [new OpenLayers.Strategy.Fixed()],
|
||||||
|
protocol: new OpenLayers.Protocol.Script({
|
||||||
|
url: "http://examples.cartodb.com/api/v2/sql",
|
||||||
|
params: {
|
||||||
|
q: "select * from costa_rica_pa LIMIT 50",
|
||||||
|
format: "geojson"
|
||||||
|
},
|
||||||
|
format: new OpenLayers.Format.GeoJSON({
|
||||||
|
ignoreExtraDims: true
|
||||||
|
}),
|
||||||
|
callbackKey: "callback"
|
||||||
|
}),
|
||||||
|
eventListeners: {
|
||||||
|
"featuresadded": function() {
|
||||||
|
this.map.zoomToExtent(this.getDataExtent());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
]
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
trigger: function(e) {
|
trigger: function(e) {
|
||||||
var lonlat = map.getLonLatFromViewPortPx(e.xy);
|
var lonlat = map.getLonLatFromPixel(e.xy);
|
||||||
alert("You clicked near " + lonlat.lat + " N, " +
|
alert("You clicked near " + lonlat.lat + " N, " +
|
||||||
+ lonlat.lon + " E");
|
+ lonlat.lon + " E");
|
||||||
}
|
}
|
||||||
@@ -75,7 +75,7 @@
|
|||||||
|
|
||||||
<p id="shortdesc">
|
<p id="shortdesc">
|
||||||
This example shows the use of the click handler and
|
This example shows the use of the click handler and
|
||||||
getLonLatFromViewPortPx functions to trigger events on mouse click.
|
getLonLatFromPixel functions to trigger events on mouse click.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map" class="smallmap"></div>
|
||||||
|
|||||||
BIN
examples/data/4_m_citylights_lg.gif
Normal file
BIN
examples/data/4_m_citylights_lg.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
BIN
examples/data/tazdem.tiff
Normal file
BIN
examples/data/tazdem.tiff
Normal file
Binary file not shown.
@@ -20,7 +20,7 @@ map.addControl(draw);
|
|||||||
draw.activate();
|
draw.activate();
|
||||||
|
|
||||||
// handle clicks on method links
|
// handle clicks on method links
|
||||||
$("insertXY").onclick = function() {
|
document.getElementById("insertXY").onclick = function() {
|
||||||
var values = parseInput(
|
var values = parseInput(
|
||||||
window.prompt(
|
window.prompt(
|
||||||
"Enter map coordinates for new point (e.g. '-111, 46')", "x, y"
|
"Enter map coordinates for new point (e.g. '-111, 46')", "x, y"
|
||||||
@@ -30,7 +30,7 @@ $("insertXY").onclick = function() {
|
|||||||
draw.insertXY(values[0], values[1]);
|
draw.insertXY(values[0], values[1]);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
$("insertDeltaXY").onclick = function() {
|
document.getElementById("insertDeltaXY").onclick = function() {
|
||||||
var values = parseInput(
|
var values = parseInput(
|
||||||
window.prompt(
|
window.prompt(
|
||||||
"Enter offset values for new point (e.g. '15, -10')", "dx, dy"
|
"Enter offset values for new point (e.g. '15, -10')", "dx, dy"
|
||||||
@@ -40,7 +40,7 @@ $("insertDeltaXY").onclick = function() {
|
|||||||
draw.insertDeltaXY(values[0], values[1]);
|
draw.insertDeltaXY(values[0], values[1]);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
$("insertDirectionLength").onclick = function() {
|
document.getElementById("insertDirectionLength").onclick = function() {
|
||||||
var values = parseInput(
|
var values = parseInput(
|
||||||
window.prompt(
|
window.prompt(
|
||||||
"Enter direction and length offset values for new point (e.g. '-45, 10')", "direction, length"
|
"Enter direction and length offset values for new point (e.g. '-45, 10')", "direction, length"
|
||||||
@@ -50,7 +50,7 @@ $("insertDirectionLength").onclick = function() {
|
|||||||
draw.insertDirectionLength(values[0], values[1]);
|
draw.insertDirectionLength(values[0], values[1]);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
$("insertDeflectionLength").onclick = function() {
|
document.getElementById("insertDeflectionLength").onclick = function() {
|
||||||
var values = parseInput(
|
var values = parseInput(
|
||||||
window.prompt(
|
window.prompt(
|
||||||
"Enter deflection and length offset values for new point (e.g. '15, 20')", "deflection, length"
|
"Enter deflection and length offset values for new point (e.g. '15, 20')", "deflection, length"
|
||||||
@@ -60,10 +60,10 @@ $("insertDeflectionLength").onclick = function() {
|
|||||||
draw.insertDeflectionLength(values[0], values[1]);
|
draw.insertDeflectionLength(values[0], values[1]);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
$("cancel").onclick = function() {
|
document.getElementById("cancel").onclick = function() {
|
||||||
draw.cancel();
|
draw.cancel();
|
||||||
};
|
};
|
||||||
$("finishSketch").onclick = function() {
|
document.getElementById("finishSketch").onclick = function() {
|
||||||
draw.finishSketch();
|
draw.finishSketch();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
47
examples/encoded-polyline.html
Normal file
47
examples/encoded-polyline.html
Normal file
File diff suppressed because one or more lines are too long
46
examples/feature-events.html
Normal file
46
examples/feature-events.html
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||||
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
|
<title>OpenLayers Feature Events Example</title>
|
||||||
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="style.css" type="text/css">
|
||||||
|
<style type="text/css">
|
||||||
|
#result {
|
||||||
|
height: 60px;
|
||||||
|
width: 514px;
|
||||||
|
font-size: smaller;
|
||||||
|
overflow: auto;
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1 id="title">Feature Events Example</h1>
|
||||||
|
|
||||||
|
<div id="tags">
|
||||||
|
feature, select, hover
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="shortdesc">Feature hover and click events</div>
|
||||||
|
|
||||||
|
<div id="map" class="smallmap"></div>
|
||||||
|
<div id="docs">
|
||||||
|
<p id="result">Hover over or click features on the map.</p>
|
||||||
|
|
||||||
|
<p>This example shows how to use the 'featureclick', 'nofeatureclick',
|
||||||
|
'featureover' and 'featureout' events to make features interactive.
|
||||||
|
Look at the <a href="feature-events.js">feature-events.js</a> source
|
||||||
|
code to see how this is done.</p>
|
||||||
|
|
||||||
|
<p>Note that these events can be registered both on the map and on
|
||||||
|
individual layers. If many layers need to be observed, it is
|
||||||
|
recommended to register listeners once on the map for performance
|
||||||
|
reasons.</p>
|
||||||
|
</div>
|
||||||
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
|
<script src="feature-events.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
67
examples/feature-events.js
Normal file
67
examples/feature-events.js
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
var layerListeners = {
|
||||||
|
featureclick: function(e) {
|
||||||
|
log(e.object.name + " says: " + e.feature.id + " clicked.");
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
nofeatureclick: function(e) {
|
||||||
|
log(e.object.name + " says: No feature clicked.");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var style = new OpenLayers.StyleMap({
|
||||||
|
'default': OpenLayers.Util.applyDefaults(
|
||||||
|
{label: "${l}", pointRadius: 10},
|
||||||
|
OpenLayers.Feature.Vector.style["default"]
|
||||||
|
),
|
||||||
|
'select': OpenLayers.Util.applyDefaults(
|
||||||
|
{pointRadius: 10},
|
||||||
|
OpenLayers.Feature.Vector.style.select
|
||||||
|
)
|
||||||
|
});
|
||||||
|
var layer1 = new OpenLayers.Layer.Vector("Layer 1", {
|
||||||
|
styleMap: style,
|
||||||
|
eventListeners: layerListeners
|
||||||
|
});
|
||||||
|
layer1.addFeatures([
|
||||||
|
new OpenLayers.Feature.Vector(OpenLayers.Geometry.fromWKT("POINT(-1 -1)"), {l:1}),
|
||||||
|
new OpenLayers.Feature.Vector(OpenLayers.Geometry.fromWKT("POINT(1 1)"), {l:1})
|
||||||
|
]);
|
||||||
|
var layer2 = new OpenLayers.Layer.Vector("Layer 2", {
|
||||||
|
styleMap: style,
|
||||||
|
eventListeners: layerListeners
|
||||||
|
});
|
||||||
|
layer2.addFeatures([
|
||||||
|
new OpenLayers.Feature.Vector(OpenLayers.Geometry.fromWKT("POINT(-1 1)"), {l:2}),
|
||||||
|
new OpenLayers.Feature.Vector(OpenLayers.Geometry.fromWKT("POINT(1 -1)"), {l:2})
|
||||||
|
]);
|
||||||
|
|
||||||
|
var map = new OpenLayers.Map({
|
||||||
|
div: "map",
|
||||||
|
allOverlays: true,
|
||||||
|
layers: [layer1, layer2],
|
||||||
|
zoom: 6,
|
||||||
|
center: [0, 0],
|
||||||
|
eventListeners: {
|
||||||
|
featureover: function(e) {
|
||||||
|
e.feature.renderIntent = "select";
|
||||||
|
e.feature.layer.drawFeature(e.feature);
|
||||||
|
log("Map says: Pointer entered " + e.feature.id + " on " + e.feature.layer.name);
|
||||||
|
},
|
||||||
|
featureout: function(e) {
|
||||||
|
e.feature.renderIntent = "default";
|
||||||
|
e.feature.layer.drawFeature(e.feature);
|
||||||
|
log("Map says: Pointer left " + e.feature.id + " on " + e.feature.layer.name);
|
||||||
|
},
|
||||||
|
featureclick: function(e) {
|
||||||
|
log("Map says: " + e.feature.id + " clicked on " + e.feature.layer.name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
function log(msg) {
|
||||||
|
if (!log.timer) {
|
||||||
|
result.innerHTML = "";
|
||||||
|
log.timer = window.setTimeout(function() {delete log.timer;}, 100);
|
||||||
|
}
|
||||||
|
result.innerHTML += msg + "<br>";
|
||||||
|
}
|
||||||
@@ -1,18 +1,8 @@
|
|||||||
var urls = [
|
|
||||||
"http://a.tile.openstreetmap.org/${z}/${x}/${y}.png",
|
|
||||||
"http://b.tile.openstreetmap.org/${z}/${x}/${y}.png",
|
|
||||||
"http://c.tile.openstreetmap.org/${z}/${x}/${y}.png"
|
|
||||||
];
|
|
||||||
|
|
||||||
var map = new OpenLayers.Map({
|
var map = new OpenLayers.Map({
|
||||||
div: "map",
|
div: "map",
|
||||||
layers: [
|
layers: [
|
||||||
new OpenLayers.Layer.XYZ("OSM (with buffer)", urls, {
|
new OpenLayers.Layer.OSM("OSM (without buffer)"),
|
||||||
transitionEffect: "resize", buffer: 2, sphericalMercator: true
|
new OpenLayers.Layer.OSM("OSM (with buffer)", null, {buffer: 2})
|
||||||
}),
|
|
||||||
new OpenLayers.Layer.XYZ("OSM (without buffer)", urls, {
|
|
||||||
transitionEffect: "resize", buffer: 0, sphericalMercator: true
|
|
||||||
})
|
|
||||||
],
|
],
|
||||||
controls: [
|
controls: [
|
||||||
new OpenLayers.Control.Navigation({
|
new OpenLayers.Control.Navigation({
|
||||||
|
|||||||
35
examples/fusiontables.html
Normal file
35
examples/fusiontables.html
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>OpenLayers Example For Reading Features From Google Fusion Tables</title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="style.css" type="text/css">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||||
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1 id="title">Reading Features From A Google Fusion Tables Table</h1>
|
||||||
|
<div id="tags">
|
||||||
|
protocol, script, fusion tables
|
||||||
|
</div>
|
||||||
|
<p id="shortdesc">
|
||||||
|
Demonstrates how, with a custom read method, the script protocol and GeoJSON format can be used to read features stored in a table on Google Fusion Tables.
|
||||||
|
</p>
|
||||||
|
<div id="map" class="smallmap"></div>
|
||||||
|
<div id="docs">
|
||||||
|
<p>
|
||||||
|
Google Fusion Tables can be used to store features, and access them using SQL-type commands over HTTP. Tables are accessed using an authorization key; create/update/delete of tables requires an OAuth2 token, but tables can be public, in which case a simple apikey is all that's needed to read them. Geometries can be stored in Location columns in KML format, but the default output is a JSON object with the geometry as GeoJSON. With a custom read method, this example parses the geometry for each row, storing the other columns as feature attributes. You can of course add a 'where' clause to the SQL statement or change the column names to limit the data retrieved. Point geometries can also be stored in Latitude/Longitude columns, and the script could easily be modified to use those instead.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
View the <a href="fusiontables.js" target="_blank">fusiontables.js</a>
|
||||||
|
source to see how this is done. You will need to get your own apikey from <a href="https://code.google.com/apis/console">Google's API Console</a> for this to function on your domain.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<a href="https://www.google.com/fusiontables/DataSource?docid=1g5DrXcdotCiO_yffkdW0zhuJk0a1i80SPvERHI8">Table used</a>. <a href="https://developers.google.com/fusiontables/docs/v1/using">Fusion Tables Developers Guide</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<script src="fusiontables.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
51
examples/fusiontables.js
Normal file
51
examples/fusiontables.js
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
// change this to your api key
|
||||||
|
var apikey = "AIzaSyD_1zzMAoZjuP-m4LyhieuYmqiVJTEajyI";
|
||||||
|
|
||||||
|
var map = new OpenLayers.Map({
|
||||||
|
div: "map",
|
||||||
|
layers: [
|
||||||
|
new OpenLayers.Layer.OSM(),
|
||||||
|
new OpenLayers.Layer.Vector("Vectors", {
|
||||||
|
projection: new OpenLayers.Projection("EPSG:4326"),
|
||||||
|
strategies: [new OpenLayers.Strategy.Fixed()],
|
||||||
|
protocol: new OpenLayers.Protocol.Script({
|
||||||
|
url: "https://www.googleapis.com/fusiontables/v1/query",
|
||||||
|
params: {
|
||||||
|
sql: "select * from 1g5DrXcdotCiO_yffkdW0zhuJk0a1i80SPvERHI8",
|
||||||
|
key: apikey
|
||||||
|
},
|
||||||
|
format: new OpenLayers.Format.GeoJSON({
|
||||||
|
ignoreExtraDims: true,
|
||||||
|
read: function(json) {
|
||||||
|
var row, feature, atts = {}, features = [];
|
||||||
|
var cols = json.columns; // column names
|
||||||
|
for (var i = 0; i < json.rows.length; i++) {
|
||||||
|
row = json.rows[i];
|
||||||
|
feature = new OpenLayers.Feature.Vector();
|
||||||
|
atts = {};
|
||||||
|
for (var j = 0; j < row.length; j++) {
|
||||||
|
// 'location's are json objects, other types are strings
|
||||||
|
if (typeof row[j] === "object") {
|
||||||
|
feature.geometry = this.parseGeometry(row[j].geometry);
|
||||||
|
} else {
|
||||||
|
atts[cols[j]] = row[j];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
feature.attributes = atts;
|
||||||
|
// if no geometry, not much point in continuing with this row
|
||||||
|
if (feature.geometry) {
|
||||||
|
features.push(feature);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return features;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}),
|
||||||
|
eventListeners: {
|
||||||
|
"featuresadded": function () {
|
||||||
|
this.map.zoomToExtent(this.getDataExtent());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
]
|
||||||
|
});
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
function init() {
|
function init() {
|
||||||
map = new OpenLayers.Map( 'map',
|
map = new OpenLayers.Map( 'map',
|
||||||
{
|
{
|
||||||
'maxExtent': new OpenLayers.Bounds(0, 0, $("map").clientWidth, $("map").clientHeight),
|
'maxExtent': new OpenLayers.Bounds(0, 0, document.getElementById("map").clientWidth, document.getElementById("map").clientHeight),
|
||||||
controls: [],
|
controls: [],
|
||||||
maxResolution: 'auto'}
|
maxResolution: 'auto'}
|
||||||
);
|
);
|
||||||
|
|||||||
46
examples/geojson-reprojected.html
Normal file
46
examples/geojson-reprojected.html
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||||
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
|
<title>OpenLayers GeoJSON Reprojected Example</title>
|
||||||
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="style.css" type="text/css">
|
||||||
|
<style type="text/css">
|
||||||
|
.olControlAttribution {
|
||||||
|
left: 2px;
|
||||||
|
right: inherit;
|
||||||
|
bottom: 3px;
|
||||||
|
line-height: 11px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1 id="title">GeoJSON Reprojected</h1>
|
||||||
|
|
||||||
|
<div id="tags">
|
||||||
|
geojson, bing, projection
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="shortdesc">Display GeoJSON data over Bing tiles</div>
|
||||||
|
|
||||||
|
<div id="map" class="smallmap"></div>
|
||||||
|
|
||||||
|
<div id="docs">
|
||||||
|
<p>This example demonstrates the use of GeoJSON over Bing tiles. The
|
||||||
|
GeoJSON vector data is in geographic coordinates (EPSG:4326). The Bing
|
||||||
|
tiles are in a spherical mercator projection (EPSG:900913). By setting
|
||||||
|
the <code>projection</code> property of the GeoJSON layer to the source
|
||||||
|
projection (EPSG:4326), the features are properly displayed over the
|
||||||
|
base layer. In general, the map projection determines how raster or
|
||||||
|
vector data is displayed. The layer projection corresponds to the
|
||||||
|
projection of the data source.
|
||||||
|
<p>See the
|
||||||
|
<a target="_blank" href="geojson-reprojected.js">geojson-reprojected.js</a>
|
||||||
|
source for details on how this is done.</p>
|
||||||
|
</div>
|
||||||
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
|
<script src="geojson-reprojected.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
27
examples/geojson-reprojected.js
Normal file
27
examples/geojson-reprojected.js
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
// API key for http://openlayers.org. Please get your own at
|
||||||
|
// http://bingmapsportal.com/ and use that instead.
|
||||||
|
var apiKey = "AqTGBsziZHIJYYxgivLBf0hVdrAk9mWO5cQcb8Yux8sW5M8c8opEC2lZqKR1ZZXf";
|
||||||
|
|
||||||
|
var hybrid = new OpenLayers.Layer.Bing({
|
||||||
|
key: apiKey,
|
||||||
|
type: "AerialWithLabels",
|
||||||
|
name: "Bing Aerial With Labels"
|
||||||
|
});
|
||||||
|
|
||||||
|
var vector = new OpenLayers.Layer.Vector("GeoJSON", {
|
||||||
|
projection: "EPSG:4326",
|
||||||
|
strategies: [new OpenLayers.Strategy.Fixed()],
|
||||||
|
protocol: new OpenLayers.Protocol.HTTP({
|
||||||
|
url: "geojson-reprojected.json",
|
||||||
|
format: new OpenLayers.Format.GeoJSON()
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
var center = new OpenLayers.LonLat(-109.6, 46.7).transform("EPSG:4326", "EPSG:900913");
|
||||||
|
|
||||||
|
var map = new OpenLayers.Map({
|
||||||
|
div: "map",
|
||||||
|
layers: [hybrid, vector],
|
||||||
|
center: center,
|
||||||
|
zoom: 4
|
||||||
|
});
|
||||||
1
examples/geojson-reprojected.json
Normal file
1
examples/geojson-reprojected.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"type":"FeatureCollection","features":[{"type":"Feature","id":"USA-MT","properties":{"fips":"30","name":"Montana"},"geometry":{"type":"Polygon","coordinates":[[[-104.047534,49.000239],[-104.042057,47.861036],[-104.047534,45.944106],[-104.042057,44.996596],[-104.058488,44.996596],[-105.91517,45.002073],[-109.080842,45.002073],[-111.05254,45.002073],[-111.047063,44.476286],[-111.227803,44.580348],[-111.386634,44.75561],[-111.616665,44.547487],[-111.819312,44.509148],[-111.868605,44.563917],[-112.104113,44.520102],[-112.241036,44.569394],[-112.471068,44.481763],[-112.783254,44.48724],[-112.887315,44.394132],[-113.002331,44.448902],[-113.133778,44.772041],[-113.341901,44.782995],[-113.456917,44.865149],[-113.45144,45.056842],[-113.571933,45.128042],[-113.736241,45.330689],[-113.834826,45.522382],[-113.807441,45.604536],[-113.98818,45.703121],[-114.086765,45.593582],[-114.333228,45.456659],[-114.546828,45.560721],[-114.497536,45.670259],[-114.568736,45.774321],[-114.387997,45.88386],[-114.492059,46.037214],[-114.464674,46.272723],[-114.322274,46.645155],[-114.612552,46.639678],[-114.623506,46.705401],[-114.886399,46.809463],[-114.930214,46.919002],[-115.302646,47.187372],[-115.324554,47.258572],[-115.527201,47.302388],[-115.718894,47.42288],[-115.724371,47.696727],[-116.04751,47.976051],[-116.04751,49.000239],[-111.50165,48.994762],[-109.453274,49.000239],[-104.047534,49.000239]]]}}]}
|
||||||
@@ -92,16 +92,15 @@ geolocate.events.register("locationupdated",geolocate,function(e) {
|
|||||||
geolocate.events.register("locationfailed",this,function() {
|
geolocate.events.register("locationfailed",this,function() {
|
||||||
OpenLayers.Console.log('Location detection failed');
|
OpenLayers.Console.log('Location detection failed');
|
||||||
});
|
});
|
||||||
|
document.getElementById('locate').onclick = function() {
|
||||||
$('locate').onclick = function() {
|
|
||||||
vector.removeAllFeatures();
|
vector.removeAllFeatures();
|
||||||
geolocate.deactivate();
|
geolocate.deactivate();
|
||||||
$('track').checked = false;
|
document.getElementById('track').checked = false;
|
||||||
geolocate.watch = false;
|
geolocate.watch = false;
|
||||||
firstGeolocation = true;
|
firstGeolocation = true;
|
||||||
geolocate.activate();
|
geolocate.activate();
|
||||||
};
|
};
|
||||||
$('track').onclick = function() {
|
document.getElementById('track').onclick = function() {
|
||||||
vector.removeAllFeatures();
|
vector.removeAllFeatures();
|
||||||
geolocate.deactivate();
|
geolocate.deactivate();
|
||||||
if (this.checked) {
|
if (this.checked) {
|
||||||
@@ -110,4 +109,4 @@ $('track').onclick = function() {
|
|||||||
geolocate.activate();
|
geolocate.activate();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
$('track').checked = false;
|
document.getElementById('track').checked = false;
|
||||||
|
|||||||
@@ -48,7 +48,6 @@
|
|||||||
</style>
|
</style>
|
||||||
<script defer="defer" type="text/javascript">
|
<script defer="defer" type="text/javascript">
|
||||||
OpenLayers.ProxyHost = "proxy.cgi?url=";
|
OpenLayers.ProxyHost = "proxy.cgi?url=";
|
||||||
|
|
||||||
var map, infocontrols, water, highlightlayer;
|
var map, infocontrols, water, highlightlayer;
|
||||||
|
|
||||||
function load() {
|
function load() {
|
||||||
@@ -125,7 +124,7 @@
|
|||||||
highlightLayer.addFeatures(evt.features);
|
highlightLayer.addFeatures(evt.features);
|
||||||
highlightLayer.redraw();
|
highlightLayer.redraw();
|
||||||
} else {
|
} else {
|
||||||
$('responseText').innerHTML = evt.text;
|
document.getElementById('responseText').innerHTML = evt.text;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,9 +6,8 @@
|
|||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
<title>OpenLayers Google (v3) Layer Example</title>
|
<title>OpenLayers Google (v3) Layer Example</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css">
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../theme/default/google.css" type="text/css">
|
|
||||||
<link rel="stylesheet" href="style.css" type="text/css">
|
<link rel="stylesheet" href="style.css" type="text/css">
|
||||||
<script src="http://maps.google.com/maps/api/js?v=3.6&sensor=false"></script>
|
<script src="http://maps.google.com/maps/api/js?v=3&sensor=false"></script>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script src="google-v3-alloverlays.js"></script>
|
<script src="google-v3-alloverlays.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -6,9 +6,8 @@
|
|||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
<title>OpenLayers Google (v3) Layer Example</title>
|
<title>OpenLayers Google (v3) Layer Example</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css">
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../theme/default/google.css" type="text/css">
|
|
||||||
<link rel="stylesheet" href="style.css" type="text/css">
|
<link rel="stylesheet" href="style.css" type="text/css">
|
||||||
<script src="http://maps.google.com/maps/api/js?v=3.6&sensor=false"></script>
|
<script src="http://maps.google.com/maps/api/js?v=3&sensor=false"></script>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script src="google-v3.js"></script>
|
<script src="google-v3.js"></script>
|
||||||
</head>
|
</head>
|
||||||
@@ -30,10 +29,6 @@
|
|||||||
spherical mercator projection. See the
|
spherical mercator projection. See the
|
||||||
<a href="google-v3.js" target="_blank">google-v3.js source</a>
|
<a href="google-v3.js" target="_blank">google-v3.js source</a>
|
||||||
to see how this is done.
|
to see how this is done.
|
||||||
<p>
|
|
||||||
In order to position the Google attribution div in the default
|
|
||||||
location, you must include the extra theme/default/google.css
|
|
||||||
stylesheet.
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -1,35 +1,34 @@
|
|||||||
var map;
|
var map;
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
map = new OpenLayers.Map('map');
|
map = new OpenLayers.Map('map', {
|
||||||
|
projection: 'EPSG:3857',
|
||||||
|
layers: [
|
||||||
|
new OpenLayers.Layer.Google(
|
||||||
|
"Google Physical",
|
||||||
|
{type: google.maps.MapTypeId.TERRAIN}
|
||||||
|
),
|
||||||
|
new OpenLayers.Layer.Google(
|
||||||
|
"Google Streets", // the default
|
||||||
|
{numZoomLevels: 20}
|
||||||
|
),
|
||||||
|
new OpenLayers.Layer.Google(
|
||||||
|
"Google Hybrid",
|
||||||
|
{type: google.maps.MapTypeId.HYBRID, numZoomLevels: 20}
|
||||||
|
),
|
||||||
|
new OpenLayers.Layer.Google(
|
||||||
|
"Google Satellite",
|
||||||
|
{type: google.maps.MapTypeId.SATELLITE, numZoomLevels: 22}
|
||||||
|
)
|
||||||
|
],
|
||||||
|
center: new OpenLayers.LonLat(10.2, 48.9)
|
||||||
|
// Google.v3 uses web mercator as projection, so we have to
|
||||||
|
// transform our coordinates
|
||||||
|
.transform('EPSG:4326', 'EPSG:3857'),
|
||||||
|
zoom: 5
|
||||||
|
});
|
||||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||||
|
|
||||||
var gphy = new OpenLayers.Layer.Google(
|
|
||||||
"Google Physical",
|
|
||||||
{type: google.maps.MapTypeId.TERRAIN}
|
|
||||||
);
|
|
||||||
var gmap = new OpenLayers.Layer.Google(
|
|
||||||
"Google Streets", // the default
|
|
||||||
{numZoomLevels: 20}
|
|
||||||
);
|
|
||||||
var ghyb = new OpenLayers.Layer.Google(
|
|
||||||
"Google Hybrid",
|
|
||||||
{type: google.maps.MapTypeId.HYBRID, numZoomLevels: 20}
|
|
||||||
);
|
|
||||||
var gsat = new OpenLayers.Layer.Google(
|
|
||||||
"Google Satellite",
|
|
||||||
{type: google.maps.MapTypeId.SATELLITE, numZoomLevels: 22}
|
|
||||||
);
|
|
||||||
|
|
||||||
map.addLayers([gphy, gmap, ghyb, gsat]);
|
|
||||||
|
|
||||||
// Google.v3 uses EPSG:900913 as projection, so we have to
|
|
||||||
// transform our coordinates
|
|
||||||
map.setCenter(new OpenLayers.LonLat(10.2, 48.9).transform(
|
|
||||||
new OpenLayers.Projection("EPSG:4326"),
|
|
||||||
map.getProjectionObject()
|
|
||||||
), 5);
|
|
||||||
|
|
||||||
// add behavior to html
|
// add behavior to html
|
||||||
var animate = document.getElementById("animate");
|
var animate = document.getElementById("animate");
|
||||||
animate.onclick = function() {
|
animate.onclick = function() {
|
||||||
|
|||||||
@@ -93,7 +93,7 @@
|
|||||||
<h1 id="title">Graticule Example</h1>
|
<h1 id="title">Graticule Example</h1>
|
||||||
|
|
||||||
<div id="tags">
|
<div id="tags">
|
||||||
graticule, grid
|
graticule, grid, projection, proj4js, reproject, transform
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p id="shortdesc">
|
<p id="shortdesc">
|
||||||
|
|||||||
@@ -68,8 +68,6 @@
|
|||||||
highlightCtrl.activate();
|
highlightCtrl.activate();
|
||||||
selectCtrl.activate();
|
selectCtrl.activate();
|
||||||
|
|
||||||
map.addControl(new OpenLayers.Control.EditingToolbar(vectors));
|
|
||||||
|
|
||||||
map.setCenter(new OpenLayers.LonLat(0, 0), 1);
|
map.setCenter(new OpenLayers.LonLat(0, 0), 1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,14 +19,12 @@
|
|||||||
function init(){
|
function init(){
|
||||||
map = new OpenLayers.Map('map');
|
map = new OpenLayers.Map('map');
|
||||||
|
|
||||||
var options = {numZoomLevels: 3};
|
|
||||||
|
|
||||||
var graphic = new OpenLayers.Layer.Image(
|
var graphic = new OpenLayers.Layer.Image(
|
||||||
'City Lights',
|
'City Lights',
|
||||||
'http://earthtrends.wri.org/images/maps/4_m_citylights_lg.gif',
|
'data/4_m_citylights_lg.gif',
|
||||||
new OpenLayers.Bounds(-180, -88.759, 180, 88.759),
|
new OpenLayers.Bounds(-180, -88.759, 180, 88.759),
|
||||||
new OpenLayers.Size(580, 288),
|
new OpenLayers.Size(580, 288),
|
||||||
options
|
{numZoomLevels: 3}
|
||||||
);
|
);
|
||||||
|
|
||||||
graphic.events.on({
|
graphic.events.on({
|
||||||
@@ -38,9 +36,12 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var jpl_wms = new OpenLayers.Layer.WMS( "NASA Global Mosaic",
|
var jpl_wms = new OpenLayers.Layer.WMS(
|
||||||
"http://t1.hypercube.telascience.org/cgi-bin/landsat7",
|
"Global Imagery",
|
||||||
{layers: "landsat7"}, options);
|
"http://demo.opengeo.org/geoserver/wms",
|
||||||
|
{layers: "bluemarble"},
|
||||||
|
{maxExtent: [-160, -88.759, 160, 88.759], numZoomLevels: 3}
|
||||||
|
);
|
||||||
|
|
||||||
map.addLayers([graphic, jpl_wms]);
|
map.addLayers([graphic, jpl_wms]);
|
||||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||||
|
|||||||
@@ -29,12 +29,13 @@ function init() {
|
|||||||
var fid, points = [], feature;
|
var fid, points = [], feature;
|
||||||
for (var i=0, len=e.features.length; i<len; i++) {
|
for (var i=0, len=e.features.length; i<len; i++) {
|
||||||
feature = e.features[i];
|
feature = e.features[i];
|
||||||
if (feature.fid !== fid || i === len-1) {
|
if ((fid && feature.fid !== fid) || i === len-1) {
|
||||||
fid = feature.fid;
|
|
||||||
this.addNodes(points, {silent: true});
|
this.addNodes(points, {silent: true});
|
||||||
points = [];
|
points = [];
|
||||||
|
} else {
|
||||||
|
points.push(feature);
|
||||||
}
|
}
|
||||||
points.push(feature);
|
fid = feature.fid;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ function init() {
|
|||||||
|
|
||||||
// create the select feature control
|
// create the select feature control
|
||||||
var selector = new OpenLayers.Control.SelectFeature(vector,{
|
var selector = new OpenLayers.Control.SelectFeature(vector,{
|
||||||
|
hover:true,
|
||||||
autoActivate:true
|
autoActivate:true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -7,49 +7,6 @@
|
|||||||
<title>OpenLayers MapBox Example</title>
|
<title>OpenLayers MapBox Example</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css">
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css">
|
||||||
<link rel="stylesheet" href="style.css" type="text/css">
|
<link rel="stylesheet" href="style.css" type="text/css">
|
||||||
<style>
|
|
||||||
.olControlAttribution {
|
|
||||||
bottom: 5px;
|
|
||||||
font-size: 9px;
|
|
||||||
}
|
|
||||||
div.olControlZoomPanel {
|
|
||||||
top: 10px;
|
|
||||||
left: 10px;
|
|
||||||
}
|
|
||||||
div.olControlZoomPanel .olControlZoomInItemInactive,
|
|
||||||
div.olControlZoomPanel .olControlZoomOutItemInactive {
|
|
||||||
background: rgba(0, 0, 0, 0.2);
|
|
||||||
position: absolute;
|
|
||||||
}
|
|
||||||
div.olControlZoomPanel .olControlZoomInItemInactive {
|
|
||||||
border-radius: 3px 3px 0 0;
|
|
||||||
}
|
|
||||||
div.olControlZoomPanel .olControlZoomOutItemInactive {
|
|
||||||
border-radius: 0 0 3px 3px ;
|
|
||||||
top: 20px;
|
|
||||||
}
|
|
||||||
div.olControlZoomPanel div:hover {
|
|
||||||
background: rgba(0, 0, 0, 0.5);
|
|
||||||
}
|
|
||||||
div.olControlZoomPanel .olControlZoomOutItemInactive:after ,
|
|
||||||
div.olControlZoomPanel .olControlZoomInItemInactive:after {
|
|
||||||
font-weight: bold;
|
|
||||||
content: '+';
|
|
||||||
font-size: 18px;
|
|
||||||
padding: 0 2px;
|
|
||||||
z-index: 2000;
|
|
||||||
color: #fff;
|
|
||||||
line-height: 1em;
|
|
||||||
}
|
|
||||||
div.olControlZoomPanel .olControlZoomOutItemInactive:after {
|
|
||||||
content: '–';
|
|
||||||
line-height: 0.9em;
|
|
||||||
padding: 0 5px;
|
|
||||||
}
|
|
||||||
div.olControlZoomPanel .olControlZoomToMaxExtentItemInactive {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1 id="title">Basic MapBox OSM Example</h1>
|
<h1 id="title">Basic MapBox OSM Example</h1>
|
||||||
|
|||||||
@@ -1,34 +1,21 @@
|
|||||||
var streets = new OpenLayers.Layer.XYZ(
|
var earth = new OpenLayers.Layer.XYZ(
|
||||||
"MapBox Streets",
|
"Natural Earth",
|
||||||
[
|
[
|
||||||
"http://a.tiles.mapbox.com/v3/mapbox.mapbox-streets/${z}/${x}/${y}.png",
|
"http://a.tiles.mapbox.com/v3/mapbox.natural-earth-hypso-bathy/${z}/${x}/${y}.png",
|
||||||
"http://b.tiles.mapbox.com/v3/mapbox.mapbox-streets/${z}/${x}/${y}.png",
|
"http://b.tiles.mapbox.com/v3/mapbox.natural-earth-hypso-bathy/${z}/${x}/${y}.png",
|
||||||
"http://c.tiles.mapbox.com/v3/mapbox.mapbox-streets/${z}/${x}/${y}.png",
|
"http://c.tiles.mapbox.com/v3/mapbox.natural-earth-hypso-bathy/${z}/${x}/${y}.png",
|
||||||
"http://d.tiles.mapbox.com/v3/mapbox.mapbox-streets/${z}/${x}/${y}.png"
|
"http://d.tiles.mapbox.com/v3/mapbox.natural-earth-hypso-bathy/${z}/${x}/${y}.png"
|
||||||
], {
|
], {
|
||||||
attribution: "Tiles © <a href='http://mapbox.com/'>MapBox</a> | " +
|
attribution: "Tiles © <a href='http://mapbox.com/'>MapBox</a>",
|
||||||
"Data © <a href='http://www.openstreetmap.org/'>OpenStreetMap</a> " +
|
|
||||||
"and contributors, CC-BY-SA",
|
|
||||||
sphericalMercator: true,
|
sphericalMercator: true,
|
||||||
transitionEffect: "resize",
|
wrapDateLine: true,
|
||||||
buffer: 1,
|
numZoomLevels: 5
|
||||||
numZoomLevels: 16
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
var map = new OpenLayers.Map({
|
var map = new OpenLayers.Map({
|
||||||
div: "map",
|
div: "map",
|
||||||
layers: [streets],
|
layers: [earth],
|
||||||
controls: [
|
|
||||||
new OpenLayers.Control.Attribution(),
|
|
||||||
new OpenLayers.Control.Navigation({
|
|
||||||
dragPanOptions: {
|
|
||||||
enableKinetic: true
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
new OpenLayers.Control.ZoomPanel(),
|
|
||||||
new OpenLayers.Control.Permalink({anchor: true})
|
|
||||||
],
|
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
zoom: 1
|
zoom: 1
|
||||||
});
|
});
|
||||||
|
|||||||
28
examples/mapquest.html
Normal file
28
examples/mapquest.html
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||||
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
|
<title>OpenLayers MapQuest Demo</title>
|
||||||
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="style.css" type="text/css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1 id="title">OpenLayers with MapQuest Tiles</h1>
|
||||||
|
<div id="shortdesc">
|
||||||
|
This example demonstrates the use of MapQuest tiles with OpenLayers.
|
||||||
|
</div>
|
||||||
|
<div id="tags">
|
||||||
|
MapQuest, OSM, XYZ
|
||||||
|
</div>
|
||||||
|
<div id="map" class="smallmap"></div>
|
||||||
|
<div id="docs">
|
||||||
|
<p>
|
||||||
|
See the <a href="mapquest.js" target="_blank">mapquest.js source</a> for
|
||||||
|
detail on using MapQuest tiles in OpenLayers.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
|
<script src="mapquest.js"></script>
|
||||||
|
</body>
|
||||||
36
examples/mapquest.js
Normal file
36
examples/mapquest.js
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
var map = new OpenLayers.Map({
|
||||||
|
div: "map",
|
||||||
|
projection: "EPSG:900913",
|
||||||
|
layers: [
|
||||||
|
new OpenLayers.Layer.XYZ(
|
||||||
|
"OpenStreetMap",
|
||||||
|
[
|
||||||
|
"http://otile1.mqcdn.com/tiles/1.0.0/map/${z}/${x}/${y}.png",
|
||||||
|
"http://otile2.mqcdn.com/tiles/1.0.0/map/${z}/${x}/${y}.png",
|
||||||
|
"http://otile3.mqcdn.com/tiles/1.0.0/map/${z}/${x}/${y}.png",
|
||||||
|
"http://otile4.mqcdn.com/tiles/1.0.0/map/${z}/${x}/${y}.png"
|
||||||
|
],
|
||||||
|
{
|
||||||
|
attribution: "Data, imagery and map information provided by <a href='http://www.mapquest.com/' target='_blank'>MapQuest</a>, <a href='http://www.openstreetmap.org/' target='_blank'>Open Street Map</a> and contributors, <a href='http://creativecommons.org/licenses/by-sa/2.0/' target='_blank'>CC-BY-SA</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png' border='0'>",
|
||||||
|
transitionEffect: "resize"
|
||||||
|
}
|
||||||
|
),
|
||||||
|
new OpenLayers.Layer.XYZ(
|
||||||
|
"Imagery",
|
||||||
|
[
|
||||||
|
"http://otile1.mqcdn.com/tiles/1.0.0/sat/${z}/${x}/${y}.png",
|
||||||
|
"http://otile2.mqcdn.com/tiles/1.0.0/sat/${z}/${x}/${y}.png",
|
||||||
|
"http://otile3.mqcdn.com/tiles/1.0.0/sat/${z}/${x}/${y}.png",
|
||||||
|
"http://otile4.mqcdn.com/tiles/1.0.0/sat/${z}/${x}/${y}.png"
|
||||||
|
],
|
||||||
|
{
|
||||||
|
attribution: "Tiles Courtesy of <a href='http://open.mapquest.co.uk/' target='_blank'>MapQuest</a>. Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency. <img src='http://developer.mapquest.com/content/osm/mq_logo.png' border='0'>",
|
||||||
|
transitionEffect: "resize"
|
||||||
|
}
|
||||||
|
)
|
||||||
|
],
|
||||||
|
center: [0, 0],
|
||||||
|
zoom: 1
|
||||||
|
});
|
||||||
|
|
||||||
|
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||||
@@ -99,7 +99,7 @@
|
|||||||
|
|
||||||
var pixel = new OpenLayers.Pixel(center.x + x, center.y + y);
|
var pixel = new OpenLayers.Pixel(center.x + x, center.y + y);
|
||||||
|
|
||||||
var lonLat = map.getLonLatFromViewPortPx(pixel);
|
var lonLat = map.getLonLatFromPixel(pixel);
|
||||||
features.push(
|
features.push(
|
||||||
new OpenLayers.Feature.Vector(
|
new OpenLayers.Feature.Vector(
|
||||||
new OpenLayers.Geometry.Point(lonLat.lon, lonLat.lat)
|
new OpenLayers.Geometry.Point(lonLat.lon, lonLat.lat)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
<link rel="stylesheet" href="style.mobile.css" type="text/css">
|
<link rel="stylesheet" href="../theme/default/style.mobile.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css">
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css">
|
||||||
<script src="../lib/OpenLayers.js?mobile"></script>
|
<script src="../lib/OpenLayers.js?mobile"></script>
|
||||||
<script src="mobile-drawing.js"></script>
|
<script src="mobile-drawing.js"></script>
|
||||||
|
|||||||
@@ -5,7 +5,15 @@ function init() {
|
|||||||
styleMap: new OpenLayers.StyleMap({
|
styleMap: new OpenLayers.StyleMap({
|
||||||
temporary: OpenLayers.Util.applyDefaults({
|
temporary: OpenLayers.Util.applyDefaults({
|
||||||
pointRadius: 16
|
pointRadius: 16
|
||||||
}, OpenLayers.Feature.Vector.style.temporary)
|
}, OpenLayers.Feature.Vector.style.temporary),
|
||||||
|
'default': OpenLayers.Util.applyDefaults({
|
||||||
|
pointRadius: 16,
|
||||||
|
strokeWidth: 3,
|
||||||
|
}, OpenLayers.Feature.Vector.style['default']),
|
||||||
|
select: OpenLayers.Util.applyDefaults({
|
||||||
|
pointRadius: 16,
|
||||||
|
strokeWidth: 3
|
||||||
|
}, OpenLayers.Feature.Vector.style.select)
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css">
|
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css">
|
||||||
<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
|
<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
|
||||||
<script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"></script>
|
<script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"></script>
|
||||||
<link rel="stylesheet" href="style.mobile.css" type="text/css">
|
<link rel="stylesheet" href="../theme/default/style.mobile.css" type="text/css">
|
||||||
<link rel="stylesheet" href="style.mobile-jq.css" type="text/css">
|
<link rel="stylesheet" href="style.mobile-jq.css" type="text/css">
|
||||||
<script src="../lib/OpenLayers.js?mobile"></script>
|
<script src="../lib/OpenLayers.js?mobile"></script>
|
||||||
<script src="mobile-base.js"></script>
|
<script src="mobile-base.js"></script>
|
||||||
|
|||||||
@@ -3,101 +3,108 @@ window.location.replace(window.location.href.split("#")[0] + "#mappage");
|
|||||||
|
|
||||||
var selectedFeature = null;
|
var selectedFeature = null;
|
||||||
|
|
||||||
$(document).ready(function() {
|
// fix height of content
|
||||||
|
function fixContentHeight() {
|
||||||
|
var footer = $("div[data-role='footer']:visible"),
|
||||||
|
content = $("div[data-role='content']:visible:visible"),
|
||||||
|
viewHeight = $(window).height(),
|
||||||
|
contentHeight = viewHeight - footer.outerHeight();
|
||||||
|
|
||||||
// fix height of content
|
if ((content.outerHeight() + footer.outerHeight()) !== viewHeight) {
|
||||||
function fixContentHeight() {
|
contentHeight -= (content.outerHeight() - content.height() + 1);
|
||||||
var footer = $("div[data-role='footer']:visible"),
|
content.height(contentHeight);
|
||||||
content = $("div[data-role='content']:visible:visible"),
|
|
||||||
viewHeight = $(window).height(),
|
|
||||||
contentHeight = viewHeight - footer.outerHeight();
|
|
||||||
|
|
||||||
if ((content.outerHeight() + footer.outerHeight()) !== viewHeight) {
|
|
||||||
contentHeight -= (content.outerHeight() - content.height() + 1);
|
|
||||||
content.height(contentHeight);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (window.map && window.map instanceof OpenLayers.Map) {
|
|
||||||
map.updateSize();
|
|
||||||
} else {
|
|
||||||
// initialize map
|
|
||||||
init(function(feature) {
|
|
||||||
selectedFeature = feature;
|
|
||||||
$.mobile.changePage("#popup", "pop");
|
|
||||||
});
|
|
||||||
initLayerList();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
$(window).bind("orientationchange resize pageshow", fixContentHeight);
|
|
||||||
document.body.onload = fixContentHeight;
|
|
||||||
|
|
||||||
// Map zoom
|
if (window.map && window.map instanceof OpenLayers.Map) {
|
||||||
$("#plus").click(function(){
|
map.updateSize();
|
||||||
map.zoomIn();
|
} else {
|
||||||
});
|
// initialize map
|
||||||
$("#minus").click(function(){
|
init(function(feature) {
|
||||||
map.zoomOut();
|
selectedFeature = feature;
|
||||||
});
|
$.mobile.changePage("#popup", "pop");
|
||||||
$("#locate").click(function(){
|
|
||||||
var control = map.getControlsBy("id", "locate-control")[0];
|
|
||||||
if (control.active) {
|
|
||||||
control.getCurrentLocation();
|
|
||||||
} else {
|
|
||||||
control.activate();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#popup').live('pageshow',function(event, ui){
|
|
||||||
var li = "";
|
|
||||||
for(var attr in selectedFeature.attributes){
|
|
||||||
li += "<li><div style='width:25%;float:left'>" + attr + "</div><div style='width:75%;float:right'>"
|
|
||||||
+ selectedFeature.attributes[attr] + "</div></li>";
|
|
||||||
}
|
|
||||||
$("ul#details-list").empty().append(li).listview("refresh");
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#searchpage').live('pageshow',function(event, ui){
|
|
||||||
$('#query').bind('change', function(e){
|
|
||||||
$('#search_results').empty();
|
|
||||||
if ($('#query')[0].value === '') {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$.mobile.showPageLoadingMsg();
|
|
||||||
|
|
||||||
// Prevent form send
|
|
||||||
e.preventDefault();
|
|
||||||
|
|
||||||
var searchUrl = 'http://ws.geonames.org/searchJSON?featureClass=P&maxRows=10';
|
|
||||||
searchUrl += '&name_startsWith=' + $('#query')[0].value;
|
|
||||||
$.getJSON(searchUrl, function(data) {
|
|
||||||
$.each(data.geonames, function() {
|
|
||||||
var place = this;
|
|
||||||
$('<li>')
|
|
||||||
.hide()
|
|
||||||
.append($('<h2 />', {
|
|
||||||
text: place.name
|
|
||||||
}))
|
|
||||||
.append($('<p />', {
|
|
||||||
html: '<b>' + place.countryName + '</b> ' + place.fcodeName
|
|
||||||
}))
|
|
||||||
.appendTo('#search_results')
|
|
||||||
.click(function() {
|
|
||||||
$.mobile.changePage('#mappage');
|
|
||||||
var lonlat = new OpenLayers.LonLat(place.lng, place.lat);
|
|
||||||
map.setCenter(lonlat.transform(gg, sm), 10);
|
|
||||||
})
|
|
||||||
.show();
|
|
||||||
});
|
|
||||||
$('#search_results').listview('refresh');
|
|
||||||
$.mobile.hidePageLoadingMsg();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
// only listen to the first event triggered
|
initLayerList();
|
||||||
$('#searchpage').die('pageshow', arguments.callee);
|
}
|
||||||
});
|
}
|
||||||
|
|
||||||
|
// one-time initialisation of button handlers
|
||||||
|
|
||||||
|
$("#plus").live('click', function(){
|
||||||
|
map.zoomIn();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#minus").live('click', function(){
|
||||||
|
map.zoomOut();
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#locate").live('click',function(){
|
||||||
|
var control = map.getControlsBy("id", "locate-control")[0];
|
||||||
|
if (control.active) {
|
||||||
|
control.getCurrentLocation();
|
||||||
|
} else {
|
||||||
|
control.activate();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//fix the content height AFTER jQuery Mobile has rendered the map page
|
||||||
|
$('#mappage').live('pageshow',function (){
|
||||||
|
fixContentHeight();
|
||||||
|
});
|
||||||
|
|
||||||
|
$(window).bind("orientationchange resize pageshow", fixContentHeight);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$('#popup').live('pageshow',function(event, ui){
|
||||||
|
var li = "";
|
||||||
|
for(var attr in selectedFeature.attributes){
|
||||||
|
li += "<li><div style='width:25%;float:left'>" + attr + "</div><div style='width:75%;float:right'>"
|
||||||
|
+ selectedFeature.attributes[attr] + "</div></li>";
|
||||||
|
}
|
||||||
|
$("ul#details-list").empty().append(li).listview("refresh");
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#searchpage').live('pageshow',function(event, ui){
|
||||||
|
$('#query').bind('change', function(e){
|
||||||
|
$('#search_results').empty();
|
||||||
|
if ($('#query')[0].value === '') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$.mobile.showPageLoadingMsg();
|
||||||
|
|
||||||
|
// Prevent form send
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
var searchUrl = 'http://ws.geonames.org/searchJSON?featureClass=P&maxRows=10';
|
||||||
|
searchUrl += '&name_startsWith=' + $('#query')[0].value;
|
||||||
|
$.getJSON(searchUrl, function(data) {
|
||||||
|
$.each(data.geonames, function() {
|
||||||
|
var place = this;
|
||||||
|
$('<li>')
|
||||||
|
.hide()
|
||||||
|
.append($('<h2 />', {
|
||||||
|
text: place.name
|
||||||
|
}))
|
||||||
|
.append($('<p />', {
|
||||||
|
html: '<b>' + place.countryName + '</b> ' + place.fcodeName
|
||||||
|
}))
|
||||||
|
.appendTo('#search_results')
|
||||||
|
.click(function() {
|
||||||
|
$.mobile.changePage('#mappage');
|
||||||
|
var lonlat = new OpenLayers.LonLat(place.lng, place.lat);
|
||||||
|
map.setCenter(lonlat.transform(gg, sm), 10);
|
||||||
|
})
|
||||||
|
.show();
|
||||||
|
});
|
||||||
|
$('#search_results').listview('refresh');
|
||||||
|
$.mobile.hidePageLoadingMsg();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
// only listen to the first event triggered
|
||||||
|
$('#searchpage').die('pageshow', arguments.callee);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
function initLayerList() {
|
function initLayerList() {
|
||||||
$('#layerspage').page();
|
$('#layerspage').page();
|
||||||
$('<li>', {
|
$('<li>', {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
<link rel="stylesheet" href="style.mobile.css" type="text/css">
|
<link rel="stylesheet" href="../theme/default/style.mobile.css" type="text/css">
|
||||||
<script src="../lib/OpenLayers.js?mobile"></script>
|
<script src="../lib/OpenLayers.js?mobile"></script>
|
||||||
<script src="mobile-layers.js"></script>
|
<script src="mobile-layers.js"></script>
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
<title>Mobile Navigation Example</title>
|
<title>Mobile Navigation Example</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css">
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css">
|
||||||
<link rel="stylesheet" href="style.mobile.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.mobile.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css">
|
<link rel="stylesheet" href="style.css" type="text/css">
|
||||||
<script type="text/javascript" src="../lib/OpenLayers.js?mobile"></script>
|
<script type="text/javascript" src="../lib/OpenLayers.js?mobile"></script>
|
||||||
<script type="text/javascript" src="mobile-navigation.js"></script>
|
<script type="text/javascript" src="mobile-navigation.js"></script>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<title>OpenLayers with Sencha Touch</title>
|
<title>OpenLayers with Sencha Touch</title>
|
||||||
<script src="../lib/OpenLayers.js?mobile"></script>
|
<script src="../lib/OpenLayers.js?mobile"></script>
|
||||||
<link rel="stylesheet" href="style.mobile.css" type="text/css">
|
<link rel="stylesheet" href="../theme/default/style.mobile.css" type="text/css">
|
||||||
<link rel="stylesheet" href="http://cdn.sencha.io/touch/1.1.0/resources/css/sencha-touch.css">
|
<link rel="stylesheet" href="http://cdn.sencha.io/touch/1.1.0/resources/css/sencha-touch.css">
|
||||||
<script src="http://cdn.sencha.io/touch/1.1.0/sencha-touch.js"></script>
|
<script src="http://cdn.sencha.io/touch/1.1.0/sencha-touch.js"></script>
|
||||||
<script src="mobile-sencha.js"></script>
|
<script src="mobile-sencha.js"></script>
|
||||||
|
|||||||
@@ -5,16 +5,55 @@ html, body, #map {
|
|||||||
}
|
}
|
||||||
#map {
|
#map {
|
||||||
cursor: move;
|
cursor: move;
|
||||||
|
background-color: #CCCCCC;
|
||||||
|
/* no highlighting of the map area when tapping the map on touch devices */
|
||||||
|
-webkit-tap-highlight-color: transparent;
|
||||||
}
|
}
|
||||||
#title, #tags, #shortdesc {
|
#title, #tags, #shortdesc {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
div.olMapViewport {
|
||||||
|
-ms-touch-action: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Turn on GPU support where available */
|
||||||
.olTileImage {
|
.olTileImage {
|
||||||
|
-webkit-transform: translateZ(0);
|
||||||
|
-moz-transform: translateZ(0);
|
||||||
|
-o-transform: translateZ(0);
|
||||||
|
-ms-transform: translateZ(0);
|
||||||
|
transform: translateZ(0);
|
||||||
|
-webkit-backface-visibility: hidden;
|
||||||
|
-moz-backface-visibility: hidden;
|
||||||
|
-ms-backface-visibility: hidden;
|
||||||
|
backface-visibility: hidden;
|
||||||
|
-webkit-perspective: 1000;
|
||||||
|
-moz-perspective: 1000;
|
||||||
|
-ms-perspective: 1000;
|
||||||
|
perspective: 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Tile fade animation */
|
||||||
|
.olLayerGrid .olTileImage {
|
||||||
-webkit-transition: opacity 0.2s linear;
|
-webkit-transition: opacity 0.2s linear;
|
||||||
-moz-transition: opacity 0.2s linear;
|
-moz-transition: opacity 0.2s linear;
|
||||||
-o-transition: opacity 0.2s linear;
|
-o-transition: opacity 0.2s linear;
|
||||||
transition: opacity 0.2s linear;
|
transition: opacity 0.2s linear;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Zoom Box */
|
||||||
|
.olHandlerBoxZoomBox {
|
||||||
|
border: 2px solid red;
|
||||||
|
position: absolute;
|
||||||
|
background-color: white;
|
||||||
|
opacity: 0.50;
|
||||||
|
font-size: 1px;
|
||||||
|
filter: alpha(opacity=50);
|
||||||
|
}
|
||||||
|
.olDrawBox {
|
||||||
|
cursor: crosshair;
|
||||||
|
}
|
||||||
|
|
||||||
div.olControlAttribution {
|
div.olControlAttribution {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
@@ -163,4 +202,4 @@ div.layerPanel div.mapButtonItemActive:after {
|
|||||||
div.layerPanel div.mapButtonItemInactive,
|
div.layerPanel div.mapButtonItemInactive,
|
||||||
div.layerPanel div.mapButtonItemActive {
|
div.layerPanel div.mapButtonItemActive {
|
||||||
margin-left: 1px;
|
margin-left: 1px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,49 +46,53 @@ var map;
|
|||||||
|
|
||||||
// Geolocate control for the Locate button - the locationupdated handler
|
// Geolocate control for the Locate button - the locationupdated handler
|
||||||
// draws a cross at the location and a circle showing the accuracy radius.
|
// draws a cross at the location and a circle showing the accuracy radius.
|
||||||
zoomPanel.addControls([
|
var geolocate = new OpenLayers.Control.Geolocate({
|
||||||
new OpenLayers.Control.Geolocate({
|
type: OpenLayers.Control.TYPE_TOGGLE,
|
||||||
type: OpenLayers.Control.TYPE_TOGGLE,
|
bind: false,
|
||||||
geolocationOptions: {
|
watch: true,
|
||||||
enableHighAccuracy: false,
|
geolocationOptions: {
|
||||||
maximumAge: 0,
|
enableHighAccuracy: false,
|
||||||
timeout: 7000
|
maximumAge: 0,
|
||||||
|
timeout: 7000
|
||||||
|
},
|
||||||
|
eventListeners: {
|
||||||
|
activate: function() {
|
||||||
|
map.addLayer(vector);
|
||||||
},
|
},
|
||||||
eventListeners: {
|
deactivate: function() {
|
||||||
activate: function() {
|
map.removeLayer(vector);
|
||||||
map.addLayer(vector);
|
vector.removeAllFeatures();
|
||||||
},
|
},
|
||||||
deactivate: function() {
|
locationupdated: function(e) {
|
||||||
map.removeLayer(vector);
|
vector.removeAllFeatures();
|
||||||
vector.removeAllFeatures();
|
vector.addFeatures([
|
||||||
},
|
new OpenLayers.Feature.Vector(e.point, null, {
|
||||||
locationupdated: function(e) {
|
graphicName: 'cross',
|
||||||
vector.removeAllFeatures();
|
strokeColor: '#f00',
|
||||||
vector.addFeatures([
|
strokeWidth: 2,
|
||||||
new OpenLayers.Feature.Vector(e.point, null, {
|
fillOpacity: 0,
|
||||||
graphicName: 'cross',
|
pointRadius: 10
|
||||||
|
}),
|
||||||
|
new OpenLayers.Feature.Vector(
|
||||||
|
OpenLayers.Geometry.Polygon.createRegularPolygon(
|
||||||
|
new OpenLayers.Geometry.Point(e.point.x, e.point.y),
|
||||||
|
e.position.coords.accuracy / 2, 50, 0
|
||||||
|
), null, {
|
||||||
|
fillOpacity: 0.1,
|
||||||
|
fillColor: '#000',
|
||||||
strokeColor: '#f00',
|
strokeColor: '#f00',
|
||||||
strokeWidth: 2,
|
strokeOpacity: 0.6
|
||||||
fillOpacity: 0,
|
}
|
||||||
pointRadius: 10
|
)
|
||||||
}),
|
]);
|
||||||
new OpenLayers.Feature.Vector(
|
map.zoomToExtent(vector.getDataExtent());
|
||||||
OpenLayers.Geometry.Polygon.createRegularPolygon(
|
|
||||||
new OpenLayers.Geometry.Point(e.point.x, e.point.y),
|
|
||||||
e.position.coords.accuracy / 2, 50, 0
|
|
||||||
), null, {
|
|
||||||
fillOpacity: 0.1,
|
|
||||||
fillColor: '#000',
|
|
||||||
strokeColor: '#f00',
|
|
||||||
strokeOpacity: 0.6
|
|
||||||
}
|
|
||||||
)
|
|
||||||
]);
|
|
||||||
map.zoomToExtent(vector.getDataExtent());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
]);
|
});
|
||||||
|
zoomPanel.addControls([geolocate]);
|
||||||
|
|
||||||
|
// Fallback layer when outside Vienna
|
||||||
|
var osm = new OpenLayers.Layer.OSM();
|
||||||
|
|
||||||
// Map with navigation controls optimized for touch devices
|
// Map with navigation controls optimized for touch devices
|
||||||
map = new OpenLayers.Map({
|
map = new OpenLayers.Map({
|
||||||
@@ -96,22 +100,10 @@ var map;
|
|||||||
theme: null,
|
theme: null,
|
||||||
projection: "EPSG:3857",
|
projection: "EPSG:3857",
|
||||||
units: "m",
|
units: "m",
|
||||||
maxExtent: [-20037508.34, -20037508.34, 20037508.34, 20037508.34],
|
maxResolution: 38.21851413574219,
|
||||||
maxResolution: 156543.0339,
|
numZoomLevels: 8,
|
||||||
numZoomLevels: 20,
|
|
||||||
controls: [
|
controls: [
|
||||||
new OpenLayers.Control.Navigation({
|
new OpenLayers.Control.Navigation(),
|
||||||
mouseWheelOptions: {
|
|
||||||
cumulative: false,
|
|
||||||
interval: 20
|
|
||||||
},
|
|
||||||
dragPanOptions: {
|
|
||||||
enableKinetic: {
|
|
||||||
deceleration: 0.02
|
|
||||||
}
|
|
||||||
},
|
|
||||||
zoomBoxEnabled: false
|
|
||||||
}),
|
|
||||||
new OpenLayers.Control.Attribution(),
|
new OpenLayers.Control.Attribution(),
|
||||||
zoomPanel,
|
zoomPanel,
|
||||||
layerPanel
|
layerPanel
|
||||||
@@ -121,6 +113,15 @@ var map;
|
|||||||
// update anchor for permalinks
|
// update anchor for permalinks
|
||||||
var ctr = map.getCenter();
|
var ctr = map.getCenter();
|
||||||
window.location.hash = "x="+ctr.lon+"&y="+ctr.lat+"&z="+map.getZoom();
|
window.location.hash = "x="+ctr.lon+"&y="+ctr.lat+"&z="+map.getZoom();
|
||||||
|
// switch to OSM when outside Vienna
|
||||||
|
if (!map.getExtent().intersectsBounds(fmzk.tileFullExtent)) {
|
||||||
|
if (map.baseLayer !== osm) {
|
||||||
|
map.addLayer(osm);
|
||||||
|
map.setBaseLayer(osm);
|
||||||
|
}
|
||||||
|
} else if (map.baseLayer === osm) {
|
||||||
|
map.removeLayer(osm);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -130,6 +131,14 @@ var map;
|
|||||||
// Vector layer for the location cross and circle
|
// Vector layer for the location cross and circle
|
||||||
var vector = new OpenLayers.Layer.Vector("Vector Layer");
|
var vector = new OpenLayers.Layer.Vector("Vector Layer");
|
||||||
|
|
||||||
|
// Defaults for the WMTS layers
|
||||||
|
var defaults = {
|
||||||
|
zoomOffset: 12,
|
||||||
|
requestEncoding: "REST",
|
||||||
|
matrixSet: "google3857",
|
||||||
|
attribution: 'Datenquelle: Stadt Wien - <a href="http://data.wien.gv.at">data.wien.gv.at</a>'
|
||||||
|
};
|
||||||
|
|
||||||
// The WMTS layers we're going to add
|
// The WMTS layers we're going to add
|
||||||
var fmzk, aerial, labels;
|
var fmzk, aerial, labels;
|
||||||
|
|
||||||
@@ -149,21 +158,16 @@ var map;
|
|||||||
url: "http://maps.wien.gv.at/wmts/1.0.0/WMTSCapabilities.xml",
|
url: "http://maps.wien.gv.at/wmts/1.0.0/WMTSCapabilities.xml",
|
||||||
success: function(request) {
|
success: function(request) {
|
||||||
var format = new OpenLayers.Format.WMTSCapabilities();
|
var format = new OpenLayers.Format.WMTSCapabilities();
|
||||||
var defaults = {
|
|
||||||
requestEncoding: "REST",
|
|
||||||
matrixSet: "google3857",
|
|
||||||
attribution: 'Datenquelle: Stadt Wien - <a href="http://data.wien.gv.at">data.wien.gv.at</a>'
|
|
||||||
};
|
|
||||||
var doc = request.responseText,
|
var doc = request.responseText,
|
||||||
caps = format.read(doc);
|
caps = format.read(doc);
|
||||||
fmzk = format.createLayer(caps, OpenLayers.Util.applyDefaults(
|
fmzk = format.createLayer(caps, OpenLayers.Util.applyDefaults(
|
||||||
{layer:"fmzk", requestEncoding:"REST", transitionEffect:"resize"}, defaults
|
{layer:"fmzk"}, defaults
|
||||||
));
|
));
|
||||||
aerial = format.createLayer(caps, OpenLayers.Util.applyDefaults(
|
aerial = format.createLayer(caps, OpenLayers.Util.applyDefaults(
|
||||||
{layer:"lb", requestEncoding:"REST", transitionEffect:"resize"}, defaults
|
{layer:"lb"}, defaults
|
||||||
));
|
));
|
||||||
labels = format.createLayer(caps, OpenLayers.Util.applyDefaults(
|
labels = format.createLayer(caps, OpenLayers.Util.applyDefaults(
|
||||||
{layer:"beschriftung", requestEncoding:"REST", isBaseLayer: false},
|
{layer:"beschriftung", isBaseLayer: false, transitionEffect: 'map-resize'},
|
||||||
defaults
|
defaults
|
||||||
));
|
));
|
||||||
map.addLayers([fmzk, aerial, labels]);
|
map.addLayers([fmzk, aerial, labels]);
|
||||||
@@ -177,32 +181,43 @@ var map;
|
|||||||
// and create layers" block above.
|
// and create layers" block above.
|
||||||
/*
|
/*
|
||||||
var extent = new OpenLayers.Bounds(1799448.394855, 6124949.74777, 1848250.442089, 6162571.828177);
|
var extent = new OpenLayers.Bounds(1799448.394855, 6124949.74777, 1848250.442089, 6162571.828177);
|
||||||
var defaults = {
|
defaults.tileFullExtent = extent;
|
||||||
requestEncoding: "REST",
|
|
||||||
matrixSet: "google3857",
|
|
||||||
tileFullExtent: extent,
|
|
||||||
attribution: 'Datenquelle: Stadt Wien - <a href="http://data.wien.gv.at">data.wien.gv.at</a>'
|
|
||||||
};
|
|
||||||
fmzk = new OpenLayers.Layer.WMTS(OpenLayers.Util.applyDefaults({
|
fmzk = new OpenLayers.Layer.WMTS(OpenLayers.Util.applyDefaults({
|
||||||
url: "http://www.wien.gv.at/wmts/fmzk/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg",
|
url: [
|
||||||
|
"http://maps.wien.gv.at/wmts/fmzk/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg",
|
||||||
|
"http://maps1.wien.gv.at/wmts/fmzk/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg",
|
||||||
|
"http://maps2.wien.gv.at/wmts/fmzk/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg",
|
||||||
|
"http://maps3.wien.gv.at/wmts/fmzk/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg",
|
||||||
|
"http://maps4.wien.gv.at/wmts/fmzk/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg"
|
||||||
|
],
|
||||||
layer: "fmzk",
|
layer: "fmzk",
|
||||||
style: "pastell",
|
style: "pastell"
|
||||||
transitionEffect: "resize"
|
|
||||||
},
|
},
|
||||||
defaults));
|
defaults));
|
||||||
aerial = new OpenLayers.Layer.WMTS(OpenLayers.Util.applyDefaults({
|
aerial = new OpenLayers.Layer.WMTS(OpenLayers.Util.applyDefaults({
|
||||||
url: "http://www.wien.gv.at/wmts/lb/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg",
|
url: [
|
||||||
|
"http://maps.wien.gv.at/wmts/lb/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg",
|
||||||
|
"http://maps1.wien.gv.at/wmts/lb/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg",
|
||||||
|
"http://maps2.wien.gv.at/wmts/lb/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg",
|
||||||
|
"http://maps3.wien.gv.at/wmts/lb/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg",
|
||||||
|
"http://maps4.wien.gv.at/wmts/lb/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg"
|
||||||
|
],
|
||||||
layer: "lb",
|
layer: "lb",
|
||||||
style: "farbe",
|
style: "farbe"
|
||||||
transitionEffect: "resize"
|
|
||||||
},
|
},
|
||||||
defaults));
|
defaults));
|
||||||
labels = new OpenLayers.Layer.WMTS(OpenLayers.Util.applyDefaults({
|
labels = new OpenLayers.Layer.WMTS(OpenLayers.Util.applyDefaults({
|
||||||
url: "http://www.wien.gv.at/wmts/beschriftung/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png",
|
url: [
|
||||||
|
"http://maps.wien.gv.at/wmts/beschriftung/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png",
|
||||||
|
"http://maps1.wien.gv.at/wmts/beschriftung/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png",
|
||||||
|
"http://maps2.wien.gv.at/wmts/beschriftung/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png",
|
||||||
|
"http://maps3.wien.gv.at/wmts/beschriftung/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png",
|
||||||
|
"http://maps4.wien.gv.at/wmts/beschriftung/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png"
|
||||||
|
],
|
||||||
layer: "beschriftung",
|
layer: "beschriftung",
|
||||||
style: "normal",
|
style: "normal",
|
||||||
transitionEffect: null,
|
isBaseLayer: false,
|
||||||
isBaseLayer: false
|
transitionEffect: 'map-resize'
|
||||||
},
|
},
|
||||||
defaults));
|
defaults));
|
||||||
map.addLayers([fmzk, aerial, labels]);
|
map.addLayers([fmzk, aerial, labels]);
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
<link rel="stylesheet" href="style.mobile.css" type="text/css">
|
<link rel="stylesheet" href="../theme/default/style.mobile.css" type="text/css">
|
||||||
<script src="../lib/OpenLayers.js?mobile"></script>
|
<script src="../lib/OpenLayers.js?mobile"></script>
|
||||||
<script src="mobile.js"></script>
|
<script src="mobile.js"></script>
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" debug="true">
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||||
@@ -7,41 +7,61 @@
|
|||||||
<title>MousePosition Control</title>
|
<title>MousePosition Control</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css">
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css">
|
||||||
<link rel="stylesheet" href="style.css" type="text/css">
|
<link rel="stylesheet" href="style.css" type="text/css">
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js" type="text/javascript"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var map;
|
var map;
|
||||||
function init(){
|
function init(){
|
||||||
var map = new OpenLayers.Map('map');
|
var map = new OpenLayers.Map('map');
|
||||||
|
|
||||||
map.addControl(new OpenLayers.Control.MousePosition());
|
map.addControl(
|
||||||
|
new OpenLayers.Control.MousePosition({
|
||||||
|
prefix: '<a target="_blank" ' +
|
||||||
|
'href="http://spatialreference.org/ref/epsg/4326/">' +
|
||||||
|
'EPSG:4326</a> coordinates: ',
|
||||||
|
separator: ' | ',
|
||||||
|
numDigits: 2,
|
||||||
|
emptyString: 'Mouse is not over map.'
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
||||||
"http://vmap0.tiles.osgeo.org/wms/vmap0",
|
"http://vmap0.tiles.osgeo.org/wms/vmap0",
|
||||||
{layers: 'basic'} );
|
{layers: 'basic'} );
|
||||||
|
|
||||||
map.addLayers([ol_wms]);
|
map.addLayers([ol_wms]);
|
||||||
if (!map.getCenter()) map.zoomToMaxExtent();
|
if (!map.getCenter()) {
|
||||||
|
map.zoomToMaxExtent();
|
||||||
|
}
|
||||||
|
|
||||||
map.events.register("mousemove", map, function(e) {
|
map.events.register("mousemove", map, function(e) {
|
||||||
var position = this.events.getMousePosition(e);
|
var position = this.events.getMousePosition(e);
|
||||||
OpenLayers.Util.getElement("coords").innerHTML = position;
|
OpenLayers.Util.getElement("coords").innerHTML = position;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="init()">
|
<body onload="init();">
|
||||||
<h1 id="title">MousePosition Control</h1>
|
<h1 id="title">MousePosition Control</h1>
|
||||||
<div id="tags">
|
<div id="tags">
|
||||||
coordinate
|
coordinate
|
||||||
</div>
|
</div>
|
||||||
<p id="shortdesc">
|
<p id="shortdesc">
|
||||||
Use the MousePosition Control to display the coordinates of the cursor
|
Use the MousePosition Control to display the coordinates of the cursor
|
||||||
inside or outside the map div.
|
inside or outside the map div.
|
||||||
</p>
|
</p>
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map" class="smallmap"></div>
|
||||||
<div id="coords"></div>
|
<div id="coords" style="height: 1.5em;"></div>
|
||||||
<p>Moving your mouse to the upper left corner of this map should return
|
<p>
|
||||||
'x=0,y=0' -- in the past, it didn't in IE. If it returns 2,2, consider it a
|
This example also shows how to use the the "prefix", "separator" and
|
||||||
bug, and report it.</p>
|
"numDigits" options to customize the output of the MousePosition-Control.
|
||||||
|
By also setting the "emptyString"-property, the contents of the controls
|
||||||
|
element are resetted to the given string when the mouse isn't above the
|
||||||
|
map.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Moving your mouse to the upper left corner of this map should return
|
||||||
|
'x=0,y=0' (pixel coordinates) -- in the past, it didn't in IE. If it
|
||||||
|
returns 'x=2,y=2', consider it a bug, and report it.
|
||||||
|
</p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -73,7 +73,7 @@
|
|||||||
// from bottom to top so as to quickly signal whether or not y-ordering is working.
|
// from bottom to top so as to quickly signal whether or not y-ordering is working.
|
||||||
while (bottom.y > top.y) {
|
while (bottom.y > top.y) {
|
||||||
bottom.y -= POINT_DISTANCE;
|
bottom.y -= POINT_DISTANCE;
|
||||||
var lonLat = map.getLonLatFromViewPortPx(bottom);
|
var lonLat = map.getLonLatFromPixel(bottom);
|
||||||
orderingFeatures.push(
|
orderingFeatures.push(
|
||||||
new OpenLayers.Feature.Vector(
|
new OpenLayers.Feature.Vector(
|
||||||
new OpenLayers.Geometry.Point(lonLat.lon, lonLat.lat)
|
new OpenLayers.Geometry.Point(lonLat.lon, lonLat.lat)
|
||||||
@@ -89,7 +89,7 @@
|
|||||||
var indexFeatures = [];
|
var indexFeatures = [];
|
||||||
var useFirst = true;
|
var useFirst = true;
|
||||||
while (left.x <= right.x) {
|
while (left.x <= right.x) {
|
||||||
var lonLat = map.getLonLatFromViewPortPx(left);
|
var lonLat = map.getLonLatFromPixel(left);
|
||||||
var point = new OpenLayers.Feature.Vector(
|
var point = new OpenLayers.Feature.Vector(
|
||||||
new OpenLayers.Geometry.Point(lonLat.lon, lonLat.lat)
|
new OpenLayers.Geometry.Point(lonLat.lon, lonLat.lat)
|
||||||
);
|
);
|
||||||
@@ -147,8 +147,8 @@
|
|||||||
// and succomb to y-ordering.
|
// and succomb to y-ordering.
|
||||||
var orderingFeatures = [];
|
var orderingFeatures = [];
|
||||||
while (bottom.y > top.y && left.x < right.x) {
|
while (bottom.y > top.y && left.x < right.x) {
|
||||||
var bottomLonLat = map.getLonLatFromViewPortPx(bottom);
|
var bottomLonLat = map.getLonLatFromPixel(bottom);
|
||||||
var leftLonLat = map.getLonLatFromViewPortPx(left);
|
var leftLonLat = map.getLonLatFromPixel(left);
|
||||||
orderingFeatures.push(
|
orderingFeatures.push(
|
||||||
new OpenLayers.Feature.Vector(
|
new OpenLayers.Feature.Vector(
|
||||||
new OpenLayers.Geometry.Point(leftLonLat.lon, bottomLonLat.lat),
|
new OpenLayers.Geometry.Point(leftLonLat.lon, bottomLonLat.lat),
|
||||||
|
|||||||
@@ -6,9 +6,8 @@
|
|||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
<title>OpenLayers OSM and Google Example</title>
|
<title>OpenLayers OSM and Google Example</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css">
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css">
|
||||||
<link rel="stylesheet" href="../theme/default/google.css" type="text/css">
|
|
||||||
<link rel="stylesheet" href="style.css" type="text/css">
|
<link rel="stylesheet" href="style.css" type="text/css">
|
||||||
<script src="http://maps.google.com/maps/api/js?v=3.6&sensor=false"></script>
|
<script src="http://maps.google.com/maps/api/js?v=3&sensor=false"></script>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script src="osm-google.js"></script>
|
<script src="osm-google.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
32
examples/osm-marker-popup.html
Normal file
32
examples/osm-marker-popup.html
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||||
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
|
<title>OpenLayers OSM and Google Example</title>
|
||||||
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="style.css" type="text/css">
|
||||||
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
|
<script src="osm-marker-popup.js"></script>
|
||||||
|
</head>
|
||||||
|
<body onload="init()">
|
||||||
|
<h1 id="title">OSM with Marker and Popup</h1>
|
||||||
|
<p id="shortdesc">
|
||||||
|
Demonstrate use of an OSM layer with a marker and a popup.
|
||||||
|
</p>
|
||||||
|
<div id="tags">
|
||||||
|
openstreetmap osm marker popup
|
||||||
|
</div>
|
||||||
|
<div id="map" class="smallmap"></div>
|
||||||
|
<div id="docs">
|
||||||
|
<p>
|
||||||
|
A common use case for OpenLayers is to display a marker at a
|
||||||
|
location on the map, and add some information in a popup. It
|
||||||
|
is also easy to add a tooltip with a short description.
|
||||||
|
See the <a href="osm-marker-popup.js" target="_blank">
|
||||||
|
osm-marker-popup.js source</a> to see how this is done.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
39
examples/osm-marker-popup.js
Normal file
39
examples/osm-marker-popup.js
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
var map;
|
||||||
|
function init() {
|
||||||
|
|
||||||
|
// The overlay layer for our marker, with a simple diamond as symbol
|
||||||
|
var overlay = new OpenLayers.Layer.Vector('Overlay', {
|
||||||
|
styleMap: new OpenLayers.StyleMap({
|
||||||
|
externalGraphic: '../img/marker.png',
|
||||||
|
graphicWidth: 20, graphicHeight: 24, graphicYOffset: -24,
|
||||||
|
title: '${tooltip}'
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
// The location of our marker and popup. We usually think in geographic
|
||||||
|
// coordinates ('EPSG:4326'), but the map is projected ('EPSG:3857').
|
||||||
|
var myLocation = new OpenLayers.Geometry.Point(10.2, 48.9)
|
||||||
|
.transform('EPSG:4326', 'EPSG:3857');
|
||||||
|
|
||||||
|
// We add the marker with a tooltip text to the overlay
|
||||||
|
overlay.addFeatures([
|
||||||
|
new OpenLayers.Feature.Vector(myLocation, {tooltip: 'OpenLayers'})
|
||||||
|
]);
|
||||||
|
|
||||||
|
// A popup with some information about our location
|
||||||
|
var popup = new OpenLayers.Popup.FramedCloud("Popup",
|
||||||
|
myLocation.getBounds().getCenterLonLat(), null,
|
||||||
|
'<a target="_blank" href="http://openlayers.org/">We</a> ' +
|
||||||
|
'could be here.<br>Or elsewhere.', null,
|
||||||
|
true // <-- true if we want a close (X) button, false otherwise
|
||||||
|
);
|
||||||
|
|
||||||
|
// Finally we create the map
|
||||||
|
map = new OpenLayers.Map({
|
||||||
|
div: "map", projection: "EPSG:3857",
|
||||||
|
layers: [new OpenLayers.Layer.OSM(), overlay],
|
||||||
|
center: myLocation.getBounds().getCenterLonLat(), zoom: 15
|
||||||
|
});
|
||||||
|
// and add the popup to it.
|
||||||
|
map.addPopup(popup);
|
||||||
|
}
|
||||||
@@ -80,7 +80,9 @@
|
|||||||
|
|
||||||
// create an overview map control with the default options
|
// create an overview map control with the default options
|
||||||
var overview1 = new OpenLayers.Control.OverviewMap({
|
var overview1 = new OpenLayers.Control.OverviewMap({
|
||||||
maximized: true
|
maximized: true,
|
||||||
|
maximizeTitle: 'Show the overview map',
|
||||||
|
minimizeTitle: 'Hide the overview map'
|
||||||
});
|
});
|
||||||
map1.addControl(overview1);
|
map1.addControl(overview1);
|
||||||
|
|
||||||
|
|||||||
41
examples/polar-projections.html
Normal file
41
examples/polar-projections.html
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||||
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
|
<title>Switch between polar projections</title>
|
||||||
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="style.css" type="text/css">
|
||||||
|
<script type="text/javascript" src="http://svn.osgeo.org/metacrs/proj4js/trunk/lib/proj4js-compressed.js"></script>
|
||||||
|
<script type="text/javascript" src="http://spatialreference.org/ref/epsg/3574/proj4js/"></script>
|
||||||
|
<script type="text/javascript" src="http://spatialreference.org/ref/epsg/3576/proj4js/"></script>
|
||||||
|
<script type="text/javascript" src="http://spatialreference.org/ref/epsg/3571/proj4js/"></script>
|
||||||
|
<script type="text/javascript" src="http://spatialreference.org/ref/epsg/3573/proj4js/"></script>
|
||||||
|
<script type="text/javascript" src="../lib/OpenLayers.js"></script>
|
||||||
|
<script type="text/javascript" src="polar-projections.js"></script>
|
||||||
|
</head>
|
||||||
|
<body onload="init()">
|
||||||
|
<h1 id="title">Polar Projections WMS Example</h1>
|
||||||
|
|
||||||
|
<div id="tags">
|
||||||
|
switch projections polar
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="shortdesc">Switch between different projections</div>
|
||||||
|
|
||||||
|
<div id="map" class="smallmap" style="height:512px"></div>
|
||||||
|
<button id='epsg3574'>EPSG:3574</button>
|
||||||
|
<button id='epsg3576'>EPSG:3576</button>
|
||||||
|
<button id='epsg3571'>EPSG:3571</button>
|
||||||
|
<button id='epsg3573'>EPSG:3573</button>
|
||||||
|
|
||||||
|
<div id="docs">
|
||||||
|
<p>This example shows how to switch between different projections,
|
||||||
|
maintaining the center and resolution.</p>
|
||||||
|
<p>Click the buttons above to try it, and see
|
||||||
|
<a href='polar-projections.js'>polar-projections.js</a> for the
|
||||||
|
source code.</p>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
84
examples/polar-projections.js
Normal file
84
examples/polar-projections.js
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
var map, layer, overlay;
|
||||||
|
|
||||||
|
var projectionOptions = {
|
||||||
|
'EPSG:3574': {
|
||||||
|
projection: new OpenLayers.Projection('EPSG:3574'),
|
||||||
|
units: 'm',
|
||||||
|
maxExtent: new OpenLayers.Bounds(-5505054, -5505054, 5505054, 5505054),
|
||||||
|
maxResolution: 5505054 / 128,
|
||||||
|
numZoomLevels: 18
|
||||||
|
},
|
||||||
|
'EPSG:3576': {
|
||||||
|
projection: new OpenLayers.Projection('EPSG:3576'),
|
||||||
|
units: 'm',
|
||||||
|
maxExtent: new OpenLayers.Bounds(-5505054, -5505054, 5505054, 5505054),
|
||||||
|
maxResolution: 5505054 / 128,
|
||||||
|
numZoomLevels: 18
|
||||||
|
},
|
||||||
|
'EPSG:3571': {
|
||||||
|
projection: new OpenLayers.Projection('EPSG:3571'),
|
||||||
|
units: 'm',
|
||||||
|
maxExtent: new OpenLayers.Bounds(-5505054, -5505054, 5505054, 5505054),
|
||||||
|
maxResolution: 5505054 / 128,
|
||||||
|
numZoomLevels: 18
|
||||||
|
},
|
||||||
|
'EPSG:3573': {
|
||||||
|
projection: new OpenLayers.Projection('EPSG:3573'),
|
||||||
|
units: 'm',
|
||||||
|
maxExtent: new OpenLayers.Bounds(-5505054, -5505054, 5505054, 5505054),
|
||||||
|
maxResolution: 5505054 / 128,
|
||||||
|
numZoomLevels: 18
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
function setProjection() {
|
||||||
|
projCode = this.innerHTML;
|
||||||
|
var oldExtent = map.getExtent();
|
||||||
|
var oldCenter = map.getCenter();
|
||||||
|
var oldProjection = map.getProjectionObject();
|
||||||
|
|
||||||
|
// map projection is controlled by the base layer
|
||||||
|
map.baseLayer.addOptions(projectionOptions[projCode]);
|
||||||
|
|
||||||
|
// with the base layer updated, the map has the new projection now
|
||||||
|
var newProjection = map.getProjectionObject();
|
||||||
|
|
||||||
|
// transform the center of the old projection, not the extent
|
||||||
|
map.setCenter(
|
||||||
|
oldCenter.transform(oldProjection, newProjection,
|
||||||
|
map.getZoomForExtent(oldExtent.transform(oldProjection, newProjection))
|
||||||
|
));
|
||||||
|
|
||||||
|
for (var i=map.layers.length-1; i>=0; --i) {
|
||||||
|
// update grid settings
|
||||||
|
map.layers[i].addOptions(projectionOptions[projCode]);
|
||||||
|
// redraw layer - just in case center and zoom are the same in old and
|
||||||
|
// new projection
|
||||||
|
map.layers[i].redraw();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function init() {
|
||||||
|
map = new OpenLayers.Map('map');
|
||||||
|
layer = new OpenLayers.Layer.WMS(
|
||||||
|
'world',
|
||||||
|
'http://v2.suite.opengeo.org/geoserver/wms',
|
||||||
|
{layers: 'world', version: '1.1.1'},
|
||||||
|
projectionOptions['EPSG:3574']
|
||||||
|
);
|
||||||
|
overlay = new OpenLayers.Layer.WMS(
|
||||||
|
'world',
|
||||||
|
'http://v2.suite.opengeo.org/geoserver/wms',
|
||||||
|
{transparent: 'true', layers: 'world:borders', styles: 'line'},
|
||||||
|
projectionOptions['EPSG:3574']
|
||||||
|
);
|
||||||
|
overlay.isBaseLayer = false;
|
||||||
|
map.addLayers([layer, overlay]);
|
||||||
|
map.zoomToMaxExtent();
|
||||||
|
|
||||||
|
// add behaviour to dom elements
|
||||||
|
document.getElementById('epsg3574').onclick = setProjection;
|
||||||
|
document.getElementById('epsg3576').onclick = setProjection;
|
||||||
|
document.getElementById('epsg3571').onclick = setProjection;
|
||||||
|
document.getElementById('epsg3573').onclick = setProjection;
|
||||||
|
}
|
||||||
@@ -20,7 +20,7 @@ allowedHosts = ['www.openlayers.org', 'openlayers.org',
|
|||||||
'prototype.openmnnd.org', 'geo.openplans.org',
|
'prototype.openmnnd.org', 'geo.openplans.org',
|
||||||
'sigma.openplans.org', 'demo.opengeo.org',
|
'sigma.openplans.org', 'demo.opengeo.org',
|
||||||
'www.openstreetmap.org', 'sample.azavea.com',
|
'www.openstreetmap.org', 'sample.azavea.com',
|
||||||
'v2.suite.opengeo.org', 'v-swe.uni-muenster.de:8080',
|
'v2.suite.opengeo.org', 'v-swe.uni-muenster.de:8080',
|
||||||
'vmap0.tiles.osgeo.org', 'www.openrouteservice.org',
|
'vmap0.tiles.osgeo.org', 'www.openrouteservice.org',
|
||||||
'maps.wien.gv.at']
|
'maps.wien.gv.at']
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var map, drawControls;
|
var map, drawControls;
|
||||||
|
|
||||||
OpenLayers.Feature.Vector.style['default']['strokeWidth'] = '2';
|
OpenLayers.Feature.Vector.style['default']['strokeWidth'] = '2';
|
||||||
function init(){
|
function init(){
|
||||||
map = new OpenLayers.Map('map');
|
map = new OpenLayers.Map('map');
|
||||||
@@ -33,10 +34,10 @@
|
|||||||
});
|
});
|
||||||
vectors.events.on({
|
vectors.events.on({
|
||||||
'featureselected': function(feature) {
|
'featureselected': function(feature) {
|
||||||
$('counter').innerHTML = this.selectedFeatures.length;
|
document.getElementById('counter').innerHTML = this.selectedFeatures.length;
|
||||||
},
|
},
|
||||||
'featureunselected': function(feature) {
|
'featureunselected': function(feature) {
|
||||||
$('counter').innerHTML = this.selectedFeatures.length;
|
document.getElementById('counter').innerHTML = this.selectedFeatures.length;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -35,13 +35,12 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
OpenLayers.Feature.Vector.style['default']['strokeWidth'] = '2';
|
OpenLayers.Feature.Vector.style['default']['strokeWidth'] = '2';
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
initMap();
|
initMap();
|
||||||
initUI();
|
initUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var map, draw, modify, snap, split, vectors;
|
var map, draw, modify, snap, split, vectors;
|
||||||
function initMap() {
|
function initMap() {
|
||||||
|
|
||||||
@@ -185,15 +184,15 @@
|
|||||||
*/
|
*/
|
||||||
function initUI() {
|
function initUI() {
|
||||||
// add behavior to snap elements
|
// add behavior to snap elements
|
||||||
var snapCheck = $("snap_toggle");
|
var snapCheck = document.getElementById("snap_toggle");
|
||||||
snapCheck.checked = true;
|
snapCheck.checked = true;
|
||||||
snapCheck.onclick = function() {
|
snapCheck.onclick = function() {
|
||||||
if(snapCheck.checked) {
|
if(snapCheck.checked) {
|
||||||
snap.activate();
|
snap.activate();
|
||||||
$("snap_options").style.display = "block";
|
document.getElementById("snap_options").style.display = "block";
|
||||||
} else {
|
} else {
|
||||||
snap.deactivate();
|
snap.deactivate();
|
||||||
$("snap_options").style.display = "none";
|
document.getElementById("snap_options").style.display = "none";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var target, type, tog, tol;
|
var target, type, tog, tol;
|
||||||
@@ -201,12 +200,12 @@
|
|||||||
var target = snap.targets[0];
|
var target = snap.targets[0];
|
||||||
for(var j=0; j<types.length; ++j) {
|
for(var j=0; j<types.length; ++j) {
|
||||||
type = types[j];
|
type = types[j];
|
||||||
tog = $("target_" + type);
|
tog = document.getElementById("target_" + type);
|
||||||
tog.checked = target[type];
|
tog.checked = target[type];
|
||||||
tog.onclick = (function(tog, type, target) {
|
tog.onclick = (function(tog, type, target) {
|
||||||
return function() {target[type] = tog.checked;}
|
return function() {target[type] = tog.checked;}
|
||||||
})(tog, type, target);
|
})(tog, type, target);
|
||||||
tol = $("target_" + type + "Tolerance");
|
tol = document.getElementById("target_" + type + "Tolerance");
|
||||||
tol.value = target[type + "Tolerance"];
|
tol.value = target[type + "Tolerance"];
|
||||||
tol.onchange = (function(tol, type, target) {
|
tol.onchange = (function(tol, type, target) {
|
||||||
return function() {
|
return function() {
|
||||||
@@ -216,24 +215,24 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// add behavior to split elements
|
// add behavior to split elements
|
||||||
var splitCheck = $("split_toggle");
|
var splitCheck = document.getElementById("split_toggle");
|
||||||
splitCheck.checked = true;
|
splitCheck.checked = true;
|
||||||
splitCheck.onclick = function() {
|
splitCheck.onclick = function() {
|
||||||
if(splitCheck.checked) {
|
if(splitCheck.checked) {
|
||||||
split.activate();
|
split.activate();
|
||||||
$("split_options").style.display = "block";
|
document.getElementById("split_options").style.display = "block";
|
||||||
} else {
|
} else {
|
||||||
split.deactivate();
|
split.deactivate();
|
||||||
$("split_options").style.display = "none";
|
document.getElementById("split_options").style.display = "none";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var edgeCheck = $("edge_toggle");
|
var edgeCheck = document.getElementById("edge_toggle");
|
||||||
edgeCheck.checked = split.edge;
|
edgeCheck.checked = split.edge;
|
||||||
edgeCheck.onclick = function() {
|
edgeCheck.onclick = function() {
|
||||||
split.edge = edgeCheck.checked;
|
split.edge = edgeCheck.checked;
|
||||||
};
|
};
|
||||||
|
|
||||||
$("clear").onclick = function() {
|
document.getElementById("clear").onclick = function() {
|
||||||
modify.deactivate();
|
modify.deactivate();
|
||||||
vectors.destroyFeatures();
|
vectors.destroyFeatures();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
OpenLayers.Feature.Vector.style['default']['strokeWidth'] = '2';
|
OpenLayers.Feature.Vector.style['default']['strokeWidth'] = '2';
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
initMap();
|
initMap();
|
||||||
initUI();
|
initUI();
|
||||||
@@ -194,7 +194,7 @@
|
|||||||
* property values.
|
* property values.
|
||||||
*/
|
*/
|
||||||
function initUI() {
|
function initUI() {
|
||||||
var check = $("snapping");
|
var check = document.getElementById("snapping");
|
||||||
check.checked = true;
|
check.checked = true;
|
||||||
check.onclick = function() {
|
check.onclick = function() {
|
||||||
if(check.checked) {
|
if(check.checked) {
|
||||||
@@ -204,7 +204,7 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var sel = $("editable");
|
var sel = document.getElementById("editable");
|
||||||
sel.value = "poly";
|
sel.value = "poly";
|
||||||
sel.onchange = function() {
|
sel.onchange = function() {
|
||||||
updateEditable(sel.value);
|
updateEditable(sel.value);
|
||||||
@@ -216,12 +216,12 @@
|
|||||||
target = snap.targets[i];
|
target = snap.targets[i];
|
||||||
for(var j=0; j<types.length; ++j) {
|
for(var j=0; j<types.length; ++j) {
|
||||||
type = types[j];
|
type = types[j];
|
||||||
tog = $(i + "_" + type);
|
tog = document.getElementById(i + "_" + type);
|
||||||
tog.checked = target[type];
|
tog.checked = target[type];
|
||||||
tog.onclick = (function(tog, type, target) {
|
tog.onclick = (function(tog, type, target) {
|
||||||
return function() {target[type] = tog.checked;}
|
return function() {target[type] = tog.checked;}
|
||||||
})(tog, type, target);
|
})(tog, type, target);
|
||||||
tol = $(i + "_" + type + "Tolerance");
|
tol = document.getElementById(i + "_" + type + "Tolerance");
|
||||||
tol.value = target[type + "Tolerance"];
|
tol.value = target[type + "Tolerance"];
|
||||||
tol.onchange = (function(tol, type, target) {
|
tol.onchange = (function(tol, type, target) {
|
||||||
return function() {
|
return function() {
|
||||||
|
|||||||
@@ -17,12 +17,16 @@
|
|||||||
right: inherit;
|
right: inherit;
|
||||||
width: 400px;
|
width: 400px;
|
||||||
}
|
}
|
||||||
|
/* conditionally position control differently for Google Maps */
|
||||||
|
.olForeignContainer div.olControlMousePosition {
|
||||||
|
bottom: 28px;
|
||||||
|
}
|
||||||
#map {
|
#map {
|
||||||
height: 512px;
|
height: 512px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script src="http://maps.google.com/maps/api/js?v=3.6&sensor=false"></script>
|
<script src="http://maps.google.com/maps/api/js?v=3&sensor=false"></script>
|
||||||
|
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
</head>
|
</head>
|
||||||
@@ -38,7 +42,12 @@
|
|||||||
</p>
|
</p>
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map" class="smallmap"></div>
|
||||||
|
|
||||||
<div id="docs"></div>
|
<div id="docs">
|
||||||
|
<p>Note that maps with Google layers are a special case, because we
|
||||||
|
cannot control the position of the attribution. To conditionally
|
||||||
|
position controls differently for Google layers, prepend the
|
||||||
|
css selector with <code>.olForeignContainer</code>.</p>
|
||||||
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
var map = new OpenLayers.Map({
|
var map = new OpenLayers.Map({
|
||||||
|
|||||||
@@ -10,20 +10,46 @@
|
|||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var map, photos;
|
var map, photos;
|
||||||
OpenLayers.ProxyHost = (window.location.host == "localhost") ?
|
|
||||||
"/cgi-bin/proxy.cgi?url=" : "proxy.cgi?url=";
|
/**
|
||||||
|
* A specific format for parsing Flickr API JSON responses.
|
||||||
|
*/
|
||||||
|
OpenLayers.Format.Flickr = OpenLayers.Class(OpenLayers.Format, {
|
||||||
|
read: function(obj) {
|
||||||
|
if(obj.stat === 'fail') {
|
||||||
|
throw new Error(
|
||||||
|
['Flickr failure response (',
|
||||||
|
obj.code,
|
||||||
|
'): ',
|
||||||
|
obj.message].join(''));
|
||||||
|
}
|
||||||
|
if(!obj || !obj.photos ||
|
||||||
|
!OpenLayers.Util.isArray(obj.photos.photo)) {
|
||||||
|
throw new Error(
|
||||||
|
'Unexpected Flickr response');
|
||||||
|
}
|
||||||
|
var photos = obj.photos.photo, photo,
|
||||||
|
x, y, point,
|
||||||
|
feature, features = [];
|
||||||
|
for(var i=0,l=photos.length; i<l; i++) {
|
||||||
|
photo = photos[i];
|
||||||
|
x = photo.longitude;
|
||||||
|
y = photo.latitude;
|
||||||
|
point = new OpenLayers.Geometry.Point(x, y);
|
||||||
|
feature = new OpenLayers.Feature.Vector(point, {
|
||||||
|
title: photo.title,
|
||||||
|
img_url: photo.url_s
|
||||||
|
});
|
||||||
|
features.push(feature);
|
||||||
|
}
|
||||||
|
return features;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
map = new OpenLayers.Map('map', {
|
map = new OpenLayers.Map('map');
|
||||||
restrictedExtent: new OpenLayers.Bounds(-180, -90, 180, 90)
|
|
||||||
});
|
var base = new OpenLayers.Layer.OSM();
|
||||||
var base = new OpenLayers.Layer.WMS("Imagery",
|
|
||||||
["http://t1.hypercube.telascience.org/tiles?",
|
|
||||||
"http://t2.hypercube.telascience.org/tiles?",
|
|
||||||
"http://t3.hypercube.telascience.org/tiles?",
|
|
||||||
"http://t4.hypercube.telascience.org/tiles?"],
|
|
||||||
{layers: 'landsat7'}
|
|
||||||
);
|
|
||||||
|
|
||||||
var style = new OpenLayers.Style({
|
var style = new OpenLayers.Style({
|
||||||
externalGraphic: "${img_url}",
|
externalGraphic: "${img_url}",
|
||||||
@@ -31,24 +57,28 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
photos = new OpenLayers.Layer.Vector("Photos", {
|
photos = new OpenLayers.Layer.Vector("Photos", {
|
||||||
strategies: [new OpenLayers.Strategy.BBOX()],
|
projection: "EPSG:4326",
|
||||||
protocol: new OpenLayers.Protocol.HTTP({
|
strategies: [new OpenLayers.Strategy.BBOX({resFactor: 1})],
|
||||||
url: "http://labs.metacarta.com/flickrbrowse/flickr.py/flickr",
|
protocol: new OpenLayers.Protocol.Script({
|
||||||
|
url: "http://api.flickr.com/services/rest",
|
||||||
params: {
|
params: {
|
||||||
format: "WFS",
|
api_key: 'b5e8c0e287e678671c3d8b2c0f3ced85',
|
||||||
sort: "interestingness-desc",
|
format: 'json',
|
||||||
service: "WFS",
|
method: 'flickr.photos.search',
|
||||||
request: "GetFeatures",
|
extras: 'geo,url_s',
|
||||||
srs: "EPSG:4326",
|
per_page: 10,
|
||||||
maxfeatures: 10
|
page: 1
|
||||||
},
|
},
|
||||||
format: new OpenLayers.Format.GML()
|
callbackKey: 'jsoncallback',
|
||||||
|
format: new OpenLayers.Format.Flickr()
|
||||||
}),
|
}),
|
||||||
styleMap: new OpenLayers.StyleMap(style)
|
styleMap: new OpenLayers.StyleMap(style)
|
||||||
});
|
});
|
||||||
|
|
||||||
map.addLayers([base, photos]);
|
map.addLayers([base, photos]);
|
||||||
map.setCenter(new OpenLayers.LonLat(-116.45, 35.42), 5);
|
map.setCenter(
|
||||||
|
new OpenLayers.LonLat(-567468.5392481,
|
||||||
|
4950672.5471436), 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@@ -56,7 +86,7 @@
|
|||||||
<body onload="init()">
|
<body onload="init()">
|
||||||
<h1 id="title">BBOX Strategy Example</h1>
|
<h1 id="title">BBOX Strategy Example</h1>
|
||||||
<div id="tags">
|
<div id="tags">
|
||||||
vector, feature, stylemap, wfs, bbox, strategy, cleanup
|
vector, feature, stylemap, bbox, strategy, script, flickr
|
||||||
</div>
|
</div>
|
||||||
<p id="shortdesc">
|
<p id="shortdesc">
|
||||||
Uses a BBOX strategy to request features within a bounding box.
|
Uses a BBOX strategy to request features within a bounding box.
|
||||||
@@ -67,6 +97,10 @@
|
|||||||
previously requested data bounds are invalidated (by browsing to
|
previously requested data bounds are invalidated (by browsing to
|
||||||
some area not covered by those bounds), another request for data
|
some area not covered by those bounds), another request for data
|
||||||
is issued.</p>
|
is issued.</p>
|
||||||
|
|
||||||
|
<p>This particular example uses the <a
|
||||||
|
href="http://www.flickr.com/services/api/">Flickr API.</a></p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -73,67 +73,67 @@ var map, vectorlayer, features, stylemap, select;
|
|||||||
|
|
||||||
// The function that gets called on feature selection: shows information
|
// The function that gets called on feature selection: shows information
|
||||||
// about the feature/cluser in a div on the page
|
// about the feature/cluser in a div on the page
|
||||||
var showInformation = function(evt){
|
var showInformation = function(evt){
|
||||||
var feature = evt.feature;
|
var feature = evt.feature;
|
||||||
var info = 'Last hovered feature:<br>';
|
var info = 'Last hovered feature:<br>';
|
||||||
if (feature.cluster) {
|
if (feature.cluster) {
|
||||||
info += ' Cluster of ' + feature.attributes.count + ' features:';
|
info += ' Cluster of ' + feature.attributes.count + ' features:';
|
||||||
var clazzes = {
|
var clazzes = {
|
||||||
'1': 0,
|
'1': 0,
|
||||||
'2': 0,
|
'2': 0,
|
||||||
'3': 0,
|
'3': 0,
|
||||||
'4': 0
|
'4': 0
|
||||||
};
|
};
|
||||||
for (var i = 0; i < feature.attributes.count; i++) {
|
for (var i = 0; i < feature.attributes.count; i++) {
|
||||||
var feat = feature.cluster[i];
|
var feat = feature.cluster[i];
|
||||||
clazzes[feat.attributes.clazz]++;
|
clazzes[feat.attributes.clazz]++;
|
||||||
}
|
}
|
||||||
for (var j=1; j<=4; j++) {
|
for (var j=1; j<=4; j++) {
|
||||||
var plural_s = (clazzes[j] !== 1) ? 's' : '';
|
var plural_s = (clazzes[j] !== 1) ? 's' : '';
|
||||||
info += '<br> • clazz ' + j + ': ' + clazzes[j] + ' feature' + plural_s;
|
info += '<br> • clazz ' + j + ': ' + clazzes[j] + ' feature' + plural_s;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
info += ' Single feature of clazz = ' + feature.attributes.clazz;
|
info += ' Single feature of clazz = ' + feature.attributes.clazz;
|
||||||
}
|
}
|
||||||
$('info').innerHTML = info;
|
document.getElementById('info').innerHTML = info;
|
||||||
};
|
};
|
||||||
|
|
||||||
// The function that gets called on feature selection. Shows information
|
// The function that gets called on feature selection. Shows information
|
||||||
// about the number of "points" on the map.
|
// about the number of "points" on the map.
|
||||||
var updateGeneralInformation = function() {
|
var updateGeneralInformation = function() {
|
||||||
var info = 'Currently ' + vectorlayer.features.length + ' points are shown on the map.';
|
var info = 'Currently ' + vectorlayer.features.length + ' points are shown on the map.';
|
||||||
$('generalinfo').innerHTML = info;
|
document.getElementById('generalinfo').innerHTML = info;
|
||||||
};
|
};
|
||||||
|
|
||||||
// instanciate the map
|
|
||||||
map = new OpenLayers.Map("map");
|
|
||||||
|
|
||||||
// background WMS
|
// instanciate the map
|
||||||
|
map = new OpenLayers.Map("map");
|
||||||
|
|
||||||
|
// background WMS
|
||||||
var ol_wms = new OpenLayers.Layer.WMS("OpenLayers WMS", "http://vmap0.tiles.osgeo.org/wms/vmap0", {
|
var ol_wms = new OpenLayers.Layer.WMS("OpenLayers WMS", "http://vmap0.tiles.osgeo.org/wms/vmap0", {
|
||||||
layers: "basic"
|
layers: "basic"
|
||||||
});
|
});
|
||||||
|
|
||||||
// context to style the vectorlayer
|
// context to style the vectorlayer
|
||||||
var context = {
|
var context = {
|
||||||
getColor: function(feature){
|
getColor: function(feature){
|
||||||
var color = '#aaaaaa';
|
var color = '#aaaaaa';
|
||||||
if (feature.attributes.clazz && feature.attributes.clazz === 4) {
|
if (feature.attributes.clazz && feature.attributes.clazz === 4) {
|
||||||
color = '#ee0000';
|
color = '#ee0000';
|
||||||
} else if(feature.cluster) {
|
} else if(feature.cluster) {
|
||||||
var onlyFour = true;
|
var onlyFour = true;
|
||||||
for (var i = 0; i < feature.cluster.length; i++) {
|
for (var i = 0; i < feature.cluster.length; i++) {
|
||||||
if (onlyFour && feature.cluster[i].attributes.clazz !== 4) {
|
if (onlyFour && feature.cluster[i].attributes.clazz !== 4) {
|
||||||
onlyFour = false;
|
onlyFour = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (onlyFour === true) {
|
if (onlyFour === true) {
|
||||||
color = '#ee0000';
|
color = '#ee0000';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// style the vectorlayer
|
// style the vectorlayer
|
||||||
stylemap = new OpenLayers.StyleMap({
|
stylemap = new OpenLayers.StyleMap({
|
||||||
'default': new OpenLayers.Style({
|
'default': new OpenLayers.Style({
|
||||||
@@ -143,32 +143,32 @@ var map, vectorlayer, features, stylemap, select;
|
|||||||
strokeColor: "#666666",
|
strokeColor: "#666666",
|
||||||
strokeWidth: 1,
|
strokeWidth: 1,
|
||||||
strokeOpacity: 1,
|
strokeOpacity: 1,
|
||||||
graphicZIndex: 1
|
graphicZIndex: 1
|
||||||
}, {
|
}, {
|
||||||
context: context
|
context: context
|
||||||
}),
|
}),
|
||||||
'select' : new OpenLayers.Style({
|
'select' : new OpenLayers.Style({
|
||||||
pointRadius: 5,
|
pointRadius: 5,
|
||||||
fillColor: "#ffff00",
|
fillColor: "#ffff00",
|
||||||
fillOpacity: 1,
|
fillOpacity: 1,
|
||||||
strokeColor: "#666666",
|
strokeColor: "#666666",
|
||||||
strokeWidth: 1,
|
strokeWidth: 1,
|
||||||
strokeOpacity: 1,
|
strokeOpacity: 1,
|
||||||
graphicZIndex: 2
|
graphicZIndex: 2
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
// the vectorlayer
|
// the vectorlayer
|
||||||
vectorlayer = new OpenLayers.Layer.Vector('Vectorlayer', {styleMap: stylemap, strategies: []});
|
vectorlayer = new OpenLayers.Layer.Vector('Vectorlayer', {styleMap: stylemap, strategies: []});
|
||||||
|
|
||||||
// the select control
|
// the select control
|
||||||
select = new OpenLayers.Control.SelectFeature(
|
select = new OpenLayers.Control.SelectFeature(
|
||||||
vectorlayer, {hover: true}
|
vectorlayer, {hover: true}
|
||||||
);
|
);
|
||||||
map.addControl(select);
|
map.addControl(select);
|
||||||
select.activate();
|
select.activate();
|
||||||
vectorlayer.events.on({"featureselected": showInformation});
|
vectorlayer.events.on({"featureselected": showInformation});
|
||||||
|
|
||||||
map.addLayers([ol_wms, vectorlayer]);
|
map.addLayers([ol_wms, vectorlayer]);
|
||||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||||
map.zoomToMaxExtent();
|
map.zoomToMaxExtent();
|
||||||
@@ -197,18 +197,18 @@ var map, vectorlayer, features, stylemap, select;
|
|||||||
switch(this.value) {
|
switch(this.value) {
|
||||||
case 'cluster':
|
case 'cluster':
|
||||||
// standard clustering
|
// standard clustering
|
||||||
strategies.push(new OpenLayers.Strategy.Cluster());
|
strategies.push(new OpenLayers.Strategy.Cluster());
|
||||||
break;
|
break;
|
||||||
case 'attribute-cluster':
|
case 'attribute-cluster':
|
||||||
// use the custom class: only cluster features of the same clazz
|
// use the custom class: only cluster features of the same clazz
|
||||||
strategies.push(new OpenLayers.Strategy.AttributeCluster({
|
strategies.push(new OpenLayers.Strategy.AttributeCluster({
|
||||||
attribute:'clazz'
|
attribute:'clazz'
|
||||||
}));
|
}));
|
||||||
break;
|
break;
|
||||||
case 'rule-cluster':
|
case 'rule-cluster':
|
||||||
// use the custom class: only cluster features that have a
|
// use the custom class: only cluster features that have a
|
||||||
// clazz smaller than 4
|
// clazz smaller than 4
|
||||||
strategies.push(new OpenLayers.Strategy.RuleCluster({
|
strategies.push(new OpenLayers.Strategy.RuleCluster({
|
||||||
rule: new OpenLayers.Rule({
|
rule: new OpenLayers.Rule({
|
||||||
filter: new OpenLayers.Filter.Comparison({
|
filter: new OpenLayers.Filter.Comparison({
|
||||||
type: OpenLayers.Filter.Comparison.LESS_THAN,
|
type: OpenLayers.Filter.Comparison.LESS_THAN,
|
||||||
@@ -219,24 +219,24 @@ var map, vectorlayer, features, stylemap, select;
|
|||||||
}));
|
}));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// remove layer and control
|
// remove layer and control
|
||||||
map.removeLayer(vectorlayer);
|
map.removeLayer(vectorlayer);
|
||||||
map.removeControl(select);
|
map.removeControl(select);
|
||||||
// rebuild layer
|
// rebuild layer
|
||||||
vectorlayer = new OpenLayers.Layer.Vector('Vectorlayer', {styleMap: stylemap, strategies: strategies});
|
vectorlayer = new OpenLayers.Layer.Vector('Vectorlayer', {styleMap: stylemap, strategies: strategies});
|
||||||
map.addLayer( vectorlayer );
|
map.addLayer( vectorlayer );
|
||||||
vectorlayer.addFeatures(features);
|
vectorlayer.addFeatures(features);
|
||||||
// rebuild select control
|
// rebuild select control
|
||||||
select = new OpenLayers.Control.SelectFeature(
|
select = new OpenLayers.Control.SelectFeature(
|
||||||
vectorlayer, {hover: true}
|
vectorlayer, {hover: true}
|
||||||
);
|
);
|
||||||
map.addControl(select);
|
map.addControl(select);
|
||||||
select.activate();
|
select.activate();
|
||||||
vectorlayer.events.on({"featureselected": showInformation});
|
vectorlayer.events.on({"featureselected": showInformation});
|
||||||
// update meta information
|
// update meta information
|
||||||
updateGeneralInformation();
|
updateGeneralInformation();
|
||||||
};
|
};
|
||||||
// bind the behviour to the radios
|
// bind the behviour to the radios
|
||||||
var inputs = document.getElementsByTagName('input');
|
var inputs = document.getElementsByTagName('input');
|
||||||
for( var cnt = 0; cnt < inputs.length; cnt++) {
|
for( var cnt = 0; cnt < inputs.length; cnt++) {
|
||||||
var input = inputs[cnt];
|
var input = inputs[cnt];
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
</style>
|
</style>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
// create a semi-random grid of features to be clustered
|
// create a semi-random grid of features to be clustered
|
||||||
var dx = 3;
|
var dx = 3;
|
||||||
var dy = 3;
|
var dy = 3;
|
||||||
@@ -38,10 +37,8 @@
|
|||||||
function init() {
|
function init() {
|
||||||
map = new OpenLayers.Map('map');
|
map = new OpenLayers.Map('map');
|
||||||
var base = new OpenLayers.Layer.WMS("OpenLayers WMS",
|
var base = new OpenLayers.Layer.WMS("OpenLayers WMS",
|
||||||
["http://t3.tilecache.osgeo.org/wms-c/Basic.py",
|
"http://vmap0.tiles.osgeo.org/wms/vmap0",
|
||||||
"http://t2.tilecache.osgeo.org/wms-c/Basic.py",
|
{layers: 'basic'}
|
||||||
"http://t1.tilecache.osgeo.org/wms-c/Basic.py"],
|
|
||||||
{layers: 'satellite'}
|
|
||||||
);
|
);
|
||||||
|
|
||||||
var style = new OpenLayers.Style({
|
var style = new OpenLayers.Style({
|
||||||
@@ -90,24 +87,24 @@
|
|||||||
map.setCenter(new OpenLayers.LonLat(0, 0), 2);
|
map.setCenter(new OpenLayers.LonLat(0, 0), 2);
|
||||||
|
|
||||||
reset();
|
reset();
|
||||||
$("reset").onclick = reset;
|
document.getElementById("reset").onclick = reset;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function reset() {
|
function reset() {
|
||||||
var distance = parseInt($("distance").value);
|
var distance = parseInt(document.getElementById("distance").value);
|
||||||
var threshold = parseInt($("threshold").value);
|
var threshold = parseInt(document.getElementById("threshold").value);
|
||||||
strategy.distance = distance || strategy.distance;
|
strategy.distance = distance || strategy.distance;
|
||||||
strategy.threshold = threshold || strategy.threshold;
|
strategy.threshold = threshold || strategy.threshold;
|
||||||
$("distance").value = strategy.distance;
|
document.getElementById("distance").value = strategy.distance;
|
||||||
$("threshold").value = strategy.threshold || "null";
|
document.getElementById("threshold").value = strategy.threshold || "null";
|
||||||
clusters.removeFeatures(clusters.features);
|
clusters.removeFeatures(clusters.features);
|
||||||
clusters.addFeatures(features);
|
clusters.addFeatures(features);
|
||||||
}
|
}
|
||||||
|
|
||||||
function display(event) {
|
function display(event) {
|
||||||
var f = event.feature;
|
var f = event.feature;
|
||||||
var el = $("output");
|
var el = document.getElementById("output");
|
||||||
if(f.cluster) {
|
if(f.cluster) {
|
||||||
el.innerHTML = "cluster of " + f.attributes.count;
|
el.innerHTML = "cluster of " + f.attributes.count;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -69,21 +69,47 @@
|
|||||||
<script src="Jugl.js"></script>
|
<script src="Jugl.js"></script>
|
||||||
<script src="animator.js"></script>
|
<script src="animator.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
var map, template;
|
var map, template;
|
||||||
OpenLayers.ProxyHost = (window.location.host == "localhost") ?
|
|
||||||
"/cgi-bin/proxy.cgi?url=" : "proxy.cgi?url=";
|
/**
|
||||||
|
* A specific format for parsing Flickr API JSON responses.
|
||||||
|
*/
|
||||||
|
OpenLayers.Format.Flickr = OpenLayers.Class(OpenLayers.Format, {
|
||||||
|
read: function(obj) {
|
||||||
|
if(obj.stat === 'fail') {
|
||||||
|
throw new Error(
|
||||||
|
['Flickr failure response (',
|
||||||
|
obj.code,
|
||||||
|
'): ',
|
||||||
|
obj.message].join(''));
|
||||||
|
}
|
||||||
|
if(!obj || !obj.photos ||
|
||||||
|
!OpenLayers.Util.isArray(obj.photos.photo)) {
|
||||||
|
throw new Error(
|
||||||
|
'Unexpected Flickr response');
|
||||||
|
}
|
||||||
|
var photos = obj.photos.photo, photo,
|
||||||
|
x, y, point,
|
||||||
|
feature, features = [];
|
||||||
|
for(var i=0,l=photos.length; i<l; i++) {
|
||||||
|
photo = photos[i];
|
||||||
|
x = photo.longitude;
|
||||||
|
y = photo.latitude;
|
||||||
|
point = new OpenLayers.Geometry.Point(x, y);
|
||||||
|
feature = new OpenLayers.Feature.Vector(point, {
|
||||||
|
title: photo.title,
|
||||||
|
img_url: photo.url_s
|
||||||
|
});
|
||||||
|
features.push(feature);
|
||||||
|
}
|
||||||
|
return features;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
map = new OpenLayers.Map('map', {
|
map = new OpenLayers.Map('map');
|
||||||
restrictedExtent: new OpenLayers.Bounds(-180, -90, 180, 90)
|
var base = new OpenLayers.Layer.OSM();
|
||||||
});
|
|
||||||
var base = new OpenLayers.Layer.WMS("Imagery",
|
|
||||||
["http://t1.hypercube.telascience.org/tiles?",
|
|
||||||
"http://t2.hypercube.telascience.org/tiles?",
|
|
||||||
"http://t3.hypercube.telascience.org/tiles?",
|
|
||||||
"http://t4.hypercube.telascience.org/tiles?"],
|
|
||||||
{layers: 'landsat7'}
|
|
||||||
);
|
|
||||||
|
|
||||||
var style = new OpenLayers.Style({
|
var style = new OpenLayers.Style({
|
||||||
pointRadius: "${radius}",
|
pointRadius: "${radius}",
|
||||||
@@ -101,22 +127,24 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
var photos = new OpenLayers.Layer.Vector("Photos", {
|
var photos = new OpenLayers.Layer.Vector("Photos", {
|
||||||
|
projection: "EPSG:4326",
|
||||||
strategies: [
|
strategies: [
|
||||||
new OpenLayers.Strategy.Fixed(),
|
new OpenLayers.Strategy.Fixed(),
|
||||||
new OpenLayers.Strategy.Cluster()
|
new OpenLayers.Strategy.Cluster()
|
||||||
],
|
],
|
||||||
protocol: new OpenLayers.Protocol.HTTP({
|
protocol: new OpenLayers.Protocol.Script({
|
||||||
url: "http://labs.metacarta.com/flickrbrowse/flickr.py/flickr",
|
url: "http://api.flickr.com/services/rest",
|
||||||
params: {
|
params: {
|
||||||
format: "WFS",
|
api_key: 'b5e8c0e287e678671c3d8b2c0f3ced85',
|
||||||
sort: "interestingness-desc",
|
format: 'json',
|
||||||
service: "WFS",
|
method: 'flickr.photos.search',
|
||||||
request: "GetFeatures",
|
extras: 'geo,url_s',
|
||||||
srs: "EPSG:4326",
|
per_page: 150,
|
||||||
maxfeatures: 150,
|
page: 1,
|
||||||
bbox: [-180, -90, 180, 90]
|
bbox: [-180, -90, 180, 90]
|
||||||
},
|
},
|
||||||
format: new OpenLayers.Format.GML()
|
callbackKey: 'jsoncallback',
|
||||||
|
format: new OpenLayers.Format.Flickr()
|
||||||
}),
|
}),
|
||||||
styleMap: new OpenLayers.StyleMap({
|
styleMap: new OpenLayers.StyleMap({
|
||||||
"default": style,
|
"default": style,
|
||||||
@@ -144,21 +172,21 @@
|
|||||||
|
|
||||||
function display(event) {
|
function display(event) {
|
||||||
// clear previous photo list and create new one
|
// clear previous photo list and create new one
|
||||||
$("photos").innerHTML = "";
|
document.getElementById("photos").innerHTML = "";
|
||||||
var node = template.process({
|
var node = template.process({
|
||||||
context: {features: event.feature.cluster},
|
context: {features: event.feature.cluster},
|
||||||
clone: true,
|
clone: true,
|
||||||
parent: $("photos")
|
parent: document.getElementById("photos")
|
||||||
});
|
});
|
||||||
// set up forward/rewind
|
// set up forward/rewind
|
||||||
var forward = Animator.apply($("list"), ["start", "end"], {duration: 1500});
|
var forward = Animator.apply(document.getElementById("list"), ["start", "end"], {duration: 1500});
|
||||||
$("scroll-end").onmouseover = function() {forward.seekTo(1)};
|
document.getElementById("scroll-end").onmouseover = function() {forward.seekTo(1)};
|
||||||
$("scroll-end").onmouseout = function() {forward.seekTo(forward.state)};
|
document.getElementById("scroll-end").onmouseout = function() {forward.seekTo(forward.state)};
|
||||||
$("scroll-start").onmouseover = function() {forward.seekTo(0)};
|
document.getElementById("scroll-start").onmouseover = function() {forward.seekTo(0)};
|
||||||
$("scroll-start").onmouseout = function() {forward.seekTo(forward.state)};
|
document.getElementById("scroll-start").onmouseout = function() {forward.seekTo(forward.state)};
|
||||||
// set up photo zoom
|
// set up photo zoom
|
||||||
for(var i=0; i<event.feature.cluster.length; ++i) {
|
for(var i=0; i<event.feature.cluster.length; ++i) {
|
||||||
listen($("link-" + i), Animator.apply($("photo-" + i), ["thumb", "big"]));
|
listen(document.getElementById("link-" + i), Animator.apply(document.getElementById("photo-" + i), ["thumb", "big"]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -172,7 +200,7 @@
|
|||||||
<body onload="init()">
|
<body onload="init()">
|
||||||
<h1 id="title">Cluster Strategy Example</h1>
|
<h1 id="title">Cluster Strategy Example</h1>
|
||||||
<div id="tags">
|
<div id="tags">
|
||||||
vector, feature, stylemap, wfs, cluster, strategy, cleanup
|
vector, feature, stylemap, cluster, strategy, flickr, script
|
||||||
</div>
|
</div>
|
||||||
<p id="shortdesc">
|
<p id="shortdesc">
|
||||||
Uses a cluster strategy to render points representing clusters of features.
|
Uses a cluster strategy to render points representing clusters of features.
|
||||||
@@ -181,6 +209,8 @@
|
|||||||
<div id="docs">
|
<div id="docs">
|
||||||
<p>The Cluster strategy lets you display points representing clusters
|
<p>The Cluster strategy lets you display points representing clusters
|
||||||
of features within some pixel distance.</p>
|
of features within some pixel distance.</p>
|
||||||
|
<p>This particular example uses the <a
|
||||||
|
href="http://www.flickr.com/services/api/">Flickr API.</a></p>
|
||||||
</div>
|
</div>
|
||||||
<div id="photos"></div>
|
<div id="photos"></div>
|
||||||
<p>Hover over a cluster on the map to see the photos it includes.</p>
|
<p>Hover over a cluster on the map to see the photos it includes.</p>
|
||||||
|
|||||||
@@ -10,20 +10,45 @@
|
|||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var map, photos, paging;
|
var map, photos, paging;
|
||||||
OpenLayers.ProxyHost = (window.location.host == "localhost") ?
|
|
||||||
"/cgi-bin/proxy.cgi?url=" : "proxy.cgi?url=";
|
/**
|
||||||
|
* A specific format for parsing Flickr API JSON responses.
|
||||||
|
*/
|
||||||
|
OpenLayers.Format.Flickr = OpenLayers.Class(OpenLayers.Format, {
|
||||||
|
read: function(obj) {
|
||||||
|
if(obj.stat === 'fail') {
|
||||||
|
throw new Error(
|
||||||
|
['Flickr failure response (',
|
||||||
|
obj.code,
|
||||||
|
'): ',
|
||||||
|
obj.message].join(''));
|
||||||
|
}
|
||||||
|
if(!obj || !obj.photos ||
|
||||||
|
!OpenLayers.Util.isArray(obj.photos.photo)) {
|
||||||
|
throw new Error(
|
||||||
|
'Unexpected Flickr response');
|
||||||
|
}
|
||||||
|
var photos = obj.photos.photo, photo,
|
||||||
|
x, y, point,
|
||||||
|
feature, features = [];
|
||||||
|
for(var i=0,l=photos.length; i<l; i++) {
|
||||||
|
photo = photos[i];
|
||||||
|
x = photo.longitude;
|
||||||
|
y = photo.latitude;
|
||||||
|
point = new OpenLayers.Geometry.Point(x, y);
|
||||||
|
feature = new OpenLayers.Feature.Vector(point, {
|
||||||
|
title: photo.title,
|
||||||
|
img_url: photo.url_s
|
||||||
|
});
|
||||||
|
features.push(feature);
|
||||||
|
}
|
||||||
|
return features;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
map = new OpenLayers.Map('map', {
|
map = new OpenLayers.Map('map');
|
||||||
restrictedExtent: new OpenLayers.Bounds(-180, -90, 180, 90)
|
var base = new OpenLayers.Layer.OSM();
|
||||||
});
|
|
||||||
var base = new OpenLayers.Layer.WMS("Imagery",
|
|
||||||
["http://t1.hypercube.telascience.org/tiles?",
|
|
||||||
"http://t2.hypercube.telascience.org/tiles?",
|
|
||||||
"http://t3.hypercube.telascience.org/tiles?",
|
|
||||||
"http://t4.hypercube.telascience.org/tiles?"],
|
|
||||||
{layers: 'landsat7'}
|
|
||||||
);
|
|
||||||
|
|
||||||
var style = new OpenLayers.Style({
|
var style = new OpenLayers.Style({
|
||||||
externalGraphic: "${img_url}",
|
externalGraphic: "${img_url}",
|
||||||
@@ -33,19 +58,21 @@
|
|||||||
paging = new OpenLayers.Strategy.Paging();
|
paging = new OpenLayers.Strategy.Paging();
|
||||||
|
|
||||||
photos = new OpenLayers.Layer.Vector("Photos", {
|
photos = new OpenLayers.Layer.Vector("Photos", {
|
||||||
|
projection: "EPSG:4326",
|
||||||
strategies: [new OpenLayers.Strategy.Fixed(), paging],
|
strategies: [new OpenLayers.Strategy.Fixed(), paging],
|
||||||
protocol: new OpenLayers.Protocol.HTTP({
|
protocol: new OpenLayers.Protocol.Script({
|
||||||
url: "http://labs.metacarta.com/flickrbrowse/flickr.py/flickr",
|
url: "http://api.flickr.com/services/rest",
|
||||||
params: {
|
params: {
|
||||||
format: "WFS",
|
api_key: 'b5e8c0e287e678671c3d8b2c0f3ced85',
|
||||||
sort: "interestingness-desc",
|
format: 'json',
|
||||||
service: "WFS",
|
method: 'flickr.photos.search',
|
||||||
request: "GetFeatures",
|
extras: 'geo,url_s',
|
||||||
srs: "EPSG:4326",
|
per_page: 100,
|
||||||
maxfeatures: 100,
|
page: 1,
|
||||||
bbox: [-180, -90, 180, 90]
|
bbox: [-180, -90, 180, 90]
|
||||||
},
|
},
|
||||||
format: new OpenLayers.Format.GML()
|
callbackKey: 'jsoncallback',
|
||||||
|
format: new OpenLayers.Format.Flickr()
|
||||||
}),
|
}),
|
||||||
styleMap: new OpenLayers.StyleMap(style)
|
styleMap: new OpenLayers.StyleMap(style)
|
||||||
});
|
});
|
||||||
@@ -66,7 +93,7 @@
|
|||||||
<body onload="init()">
|
<body onload="init()">
|
||||||
<h1 id="title">Paging Strategy Example</h1>
|
<h1 id="title">Paging Strategy Example</h1>
|
||||||
<div id="tags">
|
<div id="tags">
|
||||||
vector, feature, stylemap, wfs, paging, strategy, cleanup
|
vector, feature, stylemap, paging, strategy, flickr, script
|
||||||
</div>
|
</div>
|
||||||
<p id="shortdesc">
|
<p id="shortdesc">
|
||||||
Uses a paging strategy to cache large batches of features and render a page at a time.
|
Uses a paging strategy to cache large batches of features and render a page at a time.
|
||||||
@@ -81,6 +108,8 @@
|
|||||||
that do not support paging on the server. In this case, the protocol requests a
|
that do not support paging on the server. In this case, the protocol requests a
|
||||||
batch of 100 features, the strategy caches those and supplies a single
|
batch of 100 features, the strategy caches those and supplies a single
|
||||||
page at a time to the layer.</p>
|
page at a time to the layer.</p>
|
||||||
|
<p>This particular example uses the <a
|
||||||
|
href="http://www.flickr.com/services/api/">Flickr API.</a></p>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,42 +0,0 @@
|
|||||||
div.olControlZoom {
|
|
||||||
position: absolute;
|
|
||||||
top: 8px;
|
|
||||||
left: 8px;
|
|
||||||
}
|
|
||||||
* {
|
|
||||||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
|
||||||
}
|
|
||||||
div.olControlZoom a {
|
|
||||||
display: block;
|
|
||||||
margin: 1px;
|
|
||||||
padding: 0;
|
|
||||||
color: white;
|
|
||||||
font-size: 28px;
|
|
||||||
font-family: sans-serif;
|
|
||||||
font-weight: bold;
|
|
||||||
text-decoration: none;
|
|
||||||
text-align: center;
|
|
||||||
height: 32px;
|
|
||||||
width: 32px;
|
|
||||||
line-height: 28px;
|
|
||||||
text-shadow: 0 0 3px rgba(0,0,0,0.8);
|
|
||||||
background: #666666; /* fallback for IE - IE6 requires background shorthand*/
|
|
||||||
background: rgba(0, 0, 0, 0.3);
|
|
||||||
filter: alpha(opacity=60);
|
|
||||||
}
|
|
||||||
a.olControlZoomIn {
|
|
||||||
border-radius: 4px 4px 0 0;
|
|
||||||
}
|
|
||||||
a.olControlZoomOut {
|
|
||||||
border-radius: 0 0 4px 4px;
|
|
||||||
}
|
|
||||||
div.olControlZoom a:hover {
|
|
||||||
background: #444444; /* fallback for IE */
|
|
||||||
background: rgba(0, 0, 0, 0.5);
|
|
||||||
filter: alpha(opacity=80);
|
|
||||||
}
|
|
||||||
@media only screen and (max-width: 600px) {
|
|
||||||
div.olControlZoom a:hover {
|
|
||||||
background: rgba(0, 0, 0, 0.3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -78,7 +78,7 @@
|
|||||||
|
|
||||||
<p id="shortdesc">
|
<p id="shortdesc">
|
||||||
Shows how to use a StyleMap to style features with rule based styling.
|
Shows how to use a StyleMap to style features with rule based styling.
|
||||||
A style map references on or more OpenLayers.Style objects. These
|
A style map references one or more OpenLayers.Style objects. These
|
||||||
OpenLayers.Style objects are collections of OpenLayers.Rule objects
|
OpenLayers.Style objects are collections of OpenLayers.Rule objects
|
||||||
that determine how features are styled. An OpenLayers.Rule object
|
that determine how features are styled. An OpenLayers.Rule object
|
||||||
combines an OpenLayers.Filter object with a symbolizer. A filter is used
|
combines an OpenLayers.Filter object with a symbolizer. A filter is used
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var map, layer;
|
var map, layer;
|
||||||
function init(){
|
function init(){
|
||||||
map = new OpenLayers.Map( $('map'), {
|
map = new OpenLayers.Map( 'map', {
|
||||||
resolutions: [0.087890625, 0.0439453125, 0.02197265625, 0.010986328125]
|
resolutions: [0.087890625, 0.0439453125, 0.02197265625, 0.010986328125]
|
||||||
});
|
});
|
||||||
layer = new OpenLayers.Layer.TileCache("TileCache Layer",
|
layer = new OpenLayers.Layer.TileCache("TileCache Layer",
|
||||||
|
|||||||
@@ -64,7 +64,7 @@
|
|||||||
you would not inlude Proj4JS the way it is done in this example.
|
you would not inlude Proj4JS the way it is done in this example.
|
||||||
In a production environment you would furthermore have a local copy
|
In a production environment you would furthermore have a local copy
|
||||||
of the Proj4JS-projection definition that is hotlinked in this
|
of the Proj4JS-projection definition that is hotlinked in this
|
||||||
example.
|
example (see Graticule example for how to do this).
|
||||||
</p>
|
</p>
|
||||||
<div id="map">
|
<div id="map">
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
var map, vector;
|
var map, vector;
|
||||||
|
|
||||||
function init(){
|
function init(){
|
||||||
map = new OpenLayers.Map('map', {
|
map = new OpenLayers.Map('map', {
|
||||||
projection: 'EPSG:31467',
|
projection: 'EPSG:31467',
|
||||||
@@ -7,16 +8,16 @@ function init(){
|
|||||||
numZoomLevels: 1,
|
numZoomLevels: 1,
|
||||||
controls: [
|
controls: [
|
||||||
new OpenLayers.Control.Attribution({
|
new OpenLayers.Control.Attribution({
|
||||||
div: $('attribution')
|
div: document.getElementById('attribution')
|
||||||
}),
|
}),
|
||||||
new OpenLayers.Control.MousePosition({
|
new OpenLayers.Control.MousePosition({
|
||||||
div: $('mouse-position-31467'),
|
div: document.getElementById('mouse-position-31467'),
|
||||||
prefix: 'Coordinates: ',
|
prefix: 'Coordinates: ',
|
||||||
suffix: ' (in <a href="http://spatialreference.org/ref/epsg/'
|
suffix: ' (in <a href="http://spatialreference.org/ref/epsg/'
|
||||||
+ '31467/">EPSG:31467</a>)'
|
+ '31467/">EPSG:31467</a>)'
|
||||||
}),
|
}),
|
||||||
new OpenLayers.Control.MousePosition({
|
new OpenLayers.Control.MousePosition({
|
||||||
div: $('mouse-position-4326'),
|
div: document.getElementById('mouse-position-4326'),
|
||||||
displayProjection: new OpenLayers.Projection('EPSG:4326'),
|
displayProjection: new OpenLayers.Projection('EPSG:4326'),
|
||||||
prefix: 'Coordinates: ',
|
prefix: 'Coordinates: ',
|
||||||
suffix: ' (in <a href="http://spatialreference.org/ref/epsg/'
|
suffix: ' (in <a href="http://spatialreference.org/ref/epsg/'
|
||||||
@@ -59,7 +60,7 @@ function addVector(x, y, btn){
|
|||||||
|
|
||||||
status += '<br /><code class="emph"> '
|
status += '<br /><code class="emph"> '
|
||||||
+ geometry.toString() + '</code>.';
|
+ geometry.toString() + '</code>.';
|
||||||
$('status').innerHTML = status;
|
document.getElementById('status').innerHTML = status;
|
||||||
|
|
||||||
var feature = new OpenLayers.Feature.Vector(geometry, {}, {
|
var feature = new OpenLayers.Feature.Vector(geometry, {}, {
|
||||||
strokeColor: '#333333',
|
strokeColor: '#333333',
|
||||||
@@ -110,7 +111,7 @@ function addOutline(btn) {
|
|||||||
transformedFeature = new OpenLayers.Feature.Vector(geometry, {}, style);
|
transformedFeature = new OpenLayers.Feature.Vector(geometry, {}, style);
|
||||||
|
|
||||||
vector.addFeatures([transformedFeature]);
|
vector.addFeatures([transformedFeature]);
|
||||||
$('status').innerHTML = 'Transformed polygon';
|
document.getElementById('status').innerHTML = 'Transformed polygon';
|
||||||
btn.disabled = true;
|
btn.disabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,8 +125,8 @@ function clearVectors(){
|
|||||||
'btnGermany'
|
'btnGermany'
|
||||||
];
|
];
|
||||||
for (var i = 0, len = ids.length; i < len; i++) {
|
for (var i = 0, len = ids.length; i < len; i++) {
|
||||||
var elem = $(ids[i]);
|
var elem = document.getElementById(ids[i]);
|
||||||
elem.disabled = false;
|
elem.disabled = false;
|
||||||
}
|
}
|
||||||
$('status').innerHTML = '';
|
document.getElementById('status').innerHTML = '';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,8 @@
|
|||||||
strokeWidth: 3,
|
strokeWidth: 3,
|
||||||
strokeDashstyle: "dashdot",
|
strokeDashstyle: "dashdot",
|
||||||
pointRadius: 6,
|
pointRadius: 6,
|
||||||
pointerEvents: "visiblePainted"
|
pointerEvents: "visiblePainted",
|
||||||
|
title: "this is a green line"
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -70,8 +71,8 @@
|
|||||||
style_mark.graphicXOffset = 10; // default is -(style_mark.graphicWidth/2);
|
style_mark.graphicXOffset = 10; // default is -(style_mark.graphicWidth/2);
|
||||||
style_mark.graphicYOffset = -style_mark.graphicHeight;
|
style_mark.graphicYOffset = -style_mark.graphicHeight;
|
||||||
style_mark.externalGraphic = "../img/marker.png";
|
style_mark.externalGraphic = "../img/marker.png";
|
||||||
// graphicTitle only works in Firefox and Internet Explorer
|
// title only works in Firefox and Internet Explorer
|
||||||
style_mark.graphicTitle = "this is a test tooltip";
|
style_mark.title = "this is a test tooltip";
|
||||||
|
|
||||||
var vectorLayer = new OpenLayers.Layer.Vector("Simple Geometry", {
|
var vectorLayer = new OpenLayers.Layer.Vector("Simple Geometry", {
|
||||||
style: layer_style,
|
style: layer_style,
|
||||||
|
|||||||
@@ -87,8 +87,9 @@
|
|||||||
gml3: new OpenLayers.Format.GML.v3(gmlOptionsIn),
|
gml3: new OpenLayers.Format.GML.v3(gmlOptionsIn),
|
||||||
kml: new OpenLayers.Format.KML(kmlOptionsIn),
|
kml: new OpenLayers.Format.KML(kmlOptionsIn),
|
||||||
atom: new OpenLayers.Format.Atom(in_options),
|
atom: new OpenLayers.Format.Atom(in_options),
|
||||||
gpx: new OpenLayers.Format.GPX(in_options)
|
gpx: new OpenLayers.Format.GPX(in_options),
|
||||||
},
|
encoded_polyline: new OpenLayers.Format.EncodedPolyline(in_options)
|
||||||
|
},
|
||||||
'out': {
|
'out': {
|
||||||
wkt: new OpenLayers.Format.WKT(out_options),
|
wkt: new OpenLayers.Format.WKT(out_options),
|
||||||
geojson: new OpenLayers.Format.GeoJSON(out_options),
|
geojson: new OpenLayers.Format.GeoJSON(out_options),
|
||||||
@@ -97,8 +98,9 @@
|
|||||||
gml3: new OpenLayers.Format.GML.v3(gmlOptionsOut),
|
gml3: new OpenLayers.Format.GML.v3(gmlOptionsOut),
|
||||||
kml: new OpenLayers.Format.KML(out_options),
|
kml: new OpenLayers.Format.KML(out_options),
|
||||||
atom: new OpenLayers.Format.Atom(out_options),
|
atom: new OpenLayers.Format.Atom(out_options),
|
||||||
gpx: new OpenLayers.Format.GPX(out_options)
|
gpx: new OpenLayers.Format.GPX(out_options),
|
||||||
}
|
encoded_polyline: new OpenLayers.Format.EncodedPolyline(out_options)
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
function init(){
|
function init(){
|
||||||
@@ -202,6 +204,7 @@
|
|||||||
<option value="gml3">GML (v3)</option>
|
<option value="gml3">GML (v3)</option>
|
||||||
<option value="wkt">Well-Known Text (WKT)</option>
|
<option value="wkt">Well-Known Text (WKT)</option>
|
||||||
<option value="gpx">GPX</option>
|
<option value="gpx">GPX</option>
|
||||||
|
<option value="encoded_polyline">Encoded Polyline</option>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<label for="prettyPrint">Pretty print</label>
|
<label for="prettyPrint">Pretty print</label>
|
||||||
|
|||||||
@@ -22,7 +22,8 @@
|
|||||||
<div id="docs">
|
<div id="docs">
|
||||||
<p>
|
<p>
|
||||||
This example shows the basic use of a vector layer with the
|
This example shows the basic use of a vector layer with the
|
||||||
WFS protocol.
|
WFS protocol, and shows how to switch between a WMS and a vector
|
||||||
|
layer at a certain scale.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
See the <a href="wfs-states.js" target="_blank">wfs-states.js
|
See the <a href="wfs-states.js" target="_blank">wfs-states.js
|
||||||
|
|||||||
@@ -13,7 +13,13 @@ function init() {
|
|||||||
"http://vmap0.tiles.osgeo.org/wms/vmap0",
|
"http://vmap0.tiles.osgeo.org/wms/vmap0",
|
||||||
{layers: "basic"}
|
{layers: "basic"}
|
||||||
),
|
),
|
||||||
|
new OpenLayers.Layer.WMS("States WMS",
|
||||||
|
"http://demo.opengeo.org/geoserver/wms",
|
||||||
|
{layers: "topp:states", format: "image/png", transparent: true},
|
||||||
|
{maxScale: 15000000}
|
||||||
|
),
|
||||||
new OpenLayers.Layer.Vector("States", {
|
new OpenLayers.Layer.Vector("States", {
|
||||||
|
minScale: 15000000,
|
||||||
strategies: [new OpenLayers.Strategy.BBOX()],
|
strategies: [new OpenLayers.Strategy.BBOX()],
|
||||||
protocol: new OpenLayers.Protocol.WFS({
|
protocol: new OpenLayers.Protocol.WFS({
|
||||||
url: "http://demo.opengeo.org/geoserver/wfs",
|
url: "http://demo.opengeo.org/geoserver/wfs",
|
||||||
|
|||||||
@@ -20,15 +20,15 @@
|
|||||||
<h1 id="title">Web Map Tile Service (WMTS) Capabilities Parsing</h1>
|
<h1 id="title">Web Map Tile Service (WMTS) Capabilities Parsing</h1>
|
||||||
<div id="tags">
|
<div id="tags">
|
||||||
wmts, capabilities, getcapabilities
|
wmts, capabilities, getcapabilities
|
||||||
</div>
|
</div>
|
||||||
<p id="shortdesc">
|
<p id="shortdesc">
|
||||||
The WMTS Capabilities format allows for parsing of capabilities
|
The WMTS Capabilities format allows for parsing of capabilities
|
||||||
documents from OGC Web Map Tile Service (WMTS) version 1.0.0
|
documents from OGC Web Map Tile Service (WMTS) version 1.0.0
|
||||||
implementations.
|
implementations.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map" class="smallmap"></div>
|
||||||
|
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
<p>
|
<p>
|
||||||
This example creates an OpenLayers.Layer.WMTS layer to based
|
This example creates an OpenLayers.Layer.WMTS layer to based
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
OpenLayers.ProxyHost = "/proxy/?url=";
|
OpenLayers.ProxyHost = "proxy.cgi/?url=";
|
||||||
|
|
||||||
var map, format;
|
var map, format;
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
|
|
||||||
format = new OpenLayers.Format.WMTSCapabilities({
|
format = new OpenLayers.Format.WMTSCapabilities({
|
||||||
/**
|
/**
|
||||||
* This particular service is not in compliance with the WMTS spec and
|
* This particular service is not in compliance with the WMTS spec and
|
||||||
* is providing coordinates in y, x order regardless of the CRS. To
|
* is providing coordinates in y, x order regardless of the CRS. To
|
||||||
* work around this, we can provide the format a table of CRS URN that
|
* work around this, we can provide the format a table of CRS URN that
|
||||||
* should be considered y, x order. These will extend the defaults on
|
* should be considered y, x order. These will extend the defaults on
|
||||||
* the format.
|
* the format.
|
||||||
*/
|
*/
|
||||||
yx: {
|
yx: {
|
||||||
@@ -38,22 +38,21 @@ function init() {
|
|||||||
isBaseLayer: false
|
isBaseLayer: false
|
||||||
});
|
});
|
||||||
map.addLayer(layer);
|
map.addLayer(layer);
|
||||||
},
|
},
|
||||||
failure: function() {
|
failure: function() {
|
||||||
alert("Trouble getting capabilities doc");
|
alert("Trouble getting capabilities doc");
|
||||||
OpenLayers.Console.error.apply(OpenLayers.Console, arguments);
|
OpenLayers.Console.error.apply(OpenLayers.Console, arguments);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
map = new OpenLayers.Map({
|
map = new OpenLayers.Map({
|
||||||
div: "map",
|
div: "map",
|
||||||
projection: "EPSG:900913"
|
projection: "EPSG:900913"
|
||||||
});
|
});
|
||||||
|
|
||||||
var osm = new OpenLayers.Layer.OSM();
|
var osm = new OpenLayers.Layer.OSM();
|
||||||
|
|
||||||
map.addLayer(osm);
|
map.addLayer(osm);
|
||||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||||
map.setCenter(new OpenLayers.LonLat(-13677832, 5213272), 13);
|
map.setCenter(new OpenLayers.LonLat(-13677832, 5213272), 13);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
31
examples/wps-client.html
Normal file
31
examples/wps-client.html
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||||
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
|
<title>OpenLayers WPS Client Example</title>
|
||||||
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="style.css" type="text/css">
|
||||||
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
|
<script src="wps-client.js"></script>
|
||||||
|
</head>
|
||||||
|
<body onload="init()">
|
||||||
|
<h1 id="title">WPS Client Example</h1>
|
||||||
|
|
||||||
|
<div id="tags">
|
||||||
|
wps
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="shortdesc">Shows the usage of the WPS Client</div>
|
||||||
|
|
||||||
|
<div id="map" class="smallmap"></div>
|
||||||
|
|
||||||
|
<div id="docs">
|
||||||
|
<p>This example shows how simple it is to use the WPS Client. It
|
||||||
|
buffers an intersection of a geometry and a feature, which is
|
||||||
|
accomplished by chaining two processes. See
|
||||||
|
<a href="wps-client.js">wps-client.js</a> to see how this is done.</p>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
75
examples/wps-client.js
Normal file
75
examples/wps-client.js
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
OpenLayers.ProxyHost = 'proxy.cgi?url=';
|
||||||
|
|
||||||
|
var map, client, intersect, buffer;
|
||||||
|
|
||||||
|
function init() {
|
||||||
|
|
||||||
|
map = new OpenLayers.Map('map', {
|
||||||
|
allOverlays: true,
|
||||||
|
center: [114, 16],
|
||||||
|
zoom: 4,
|
||||||
|
layers: [new OpenLayers.Layer.Vector()]
|
||||||
|
});
|
||||||
|
|
||||||
|
var features = [new OpenLayers.Feature.Vector(OpenLayers.Geometry.fromWKT(
|
||||||
|
'LINESTRING(117 22,112 18,118 13, 115 8)'
|
||||||
|
))];
|
||||||
|
var geometry = OpenLayers.Geometry.fromWKT(
|
||||||
|
'POLYGON((110 20,120 20,120 10,110 10,110 20),(112 17,118 18,118 16,112 15,112 17))'
|
||||||
|
);
|
||||||
|
|
||||||
|
map.baseLayer.addFeatures(features);
|
||||||
|
map.baseLayer.addFeatures([new OpenLayers.Feature.Vector(geometry)]);
|
||||||
|
|
||||||
|
client = new OpenLayers.WPSClient({
|
||||||
|
servers: {
|
||||||
|
opengeo: 'http://demo.opengeo.org/geoserver/wps'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Create a process and configure it
|
||||||
|
intersect = client.getProcess('opengeo', 'JTS:intersection');
|
||||||
|
intersect.configure({
|
||||||
|
// spatial input can be a feature or a geometry or an array of
|
||||||
|
// features or geometries
|
||||||
|
inputs: {
|
||||||
|
a: features,
|
||||||
|
b: geometry
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Create another process which chains the previous one and execute it
|
||||||
|
buffer = client.getProcess('opengeo', 'JTS:buffer');
|
||||||
|
buffer.execute({
|
||||||
|
inputs: {
|
||||||
|
geom: intersect.output(),
|
||||||
|
distance: 1
|
||||||
|
},
|
||||||
|
success: function(outputs) {
|
||||||
|
// outputs.result is a feature or an array of features for spatial
|
||||||
|
// processes.
|
||||||
|
map.baseLayer.addFeatures(outputs.result);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Instead of creating a process and executing it, we could call execute on
|
||||||
|
// the client directly if we are only dealing with a single process:
|
||||||
|
/*
|
||||||
|
client.execute({
|
||||||
|
server: "opengeo",
|
||||||
|
process: "JTS:intersection",
|
||||||
|
// spatial input can be a feature or a geometry or an array of
|
||||||
|
// features or geometries
|
||||||
|
inputs: {
|
||||||
|
a: features,
|
||||||
|
b: geometry
|
||||||
|
},
|
||||||
|
success: function(outputs) {
|
||||||
|
// outputs.result is a feature or an array of features for spatial
|
||||||
|
// processes.
|
||||||
|
map.baseLayer.addFeatures(outputs.result);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
*/
|
||||||
|
|
||||||
|
}
|
||||||
89
examples/wps.html
Normal file
89
examples/wps.html
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||||
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
|
<title>OpenLayers WPS Builder Example</title>
|
||||||
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css">
|
||||||
|
<link rel="stylesheet" href="style.css" type="text/css">
|
||||||
|
<style type="text/css">
|
||||||
|
.olControlEditingToolbar .olControlModifyFeatureItemInactive {
|
||||||
|
background-image: url(../theme/default/img/draw_point_off.png);
|
||||||
|
}
|
||||||
|
.olControlEditingToolbar .olControlModifyFeatureItemActive {
|
||||||
|
background-image: url(../theme/default/img/draw_point_on.png);
|
||||||
|
}
|
||||||
|
textarea {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
height: 3em;
|
||||||
|
}
|
||||||
|
label {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.notsupported {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
button {
|
||||||
|
display: block;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
#docs {
|
||||||
|
top: 6em;
|
||||||
|
left: 550px;
|
||||||
|
position: absolute;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1 id="title">WPS Builder Example</h1>
|
||||||
|
|
||||||
|
<div id="tags">
|
||||||
|
wps, process, advanced
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="shortdesc">Using WPS formats to interact with WPS</div>
|
||||||
|
|
||||||
|
<div id="docs">
|
||||||
|
<p>This example shows WPS in action by using the WPSCapabilities,
|
||||||
|
WPSDescribeProcess and WPSExecute formats. See
|
||||||
|
<a target="_blank" href="wps.js">wps.js</a> for the
|
||||||
|
source code. <b>Note: For applications using WPS, the high level
|
||||||
|
approach shown in the <a href="wps-client.html">wps-client</a> example
|
||||||
|
is recommended instead.</b></p>
|
||||||
|
<ol>
|
||||||
|
<li>Select a process from the list below the map. The list is
|
||||||
|
populated with the result of a WPS GetCapabilities request, parsed
|
||||||
|
using <code>OpenLayers.Format.WPSCapabilities::read</code>.</li>
|
||||||
|
<li>Fill out the Input form. Hover over fields to get a description.
|
||||||
|
Required fields are marked with a "*".
|
||||||
|
To use a geometry from the map as input, select the geometry on the
|
||||||
|
map (using the pen symbol on the left of the toolbar) and just
|
||||||
|
click the field. The form is generated from the object returned by
|
||||||
|
<code>OpenLayers.Format.WPSDescribeProcess::read</code></li>
|
||||||
|
<li>Click "Execute" and examine the result in the result text area.
|
||||||
|
If the result can be parsed as features, it will be displayed on
|
||||||
|
the map as well. The process data is sent to the server with the
|
||||||
|
serialized XML from <code>OpenLayers.Format.WPSExecute::write</code>,
|
||||||
|
which can use a modified
|
||||||
|
<code>OpenLayers.Format.WPSDescribeProcess</code> result object as
|
||||||
|
input.</li>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="example" style="width:520px">
|
||||||
|
<div id="map" class="smallmap"></div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<select id="processes"><option>Select a process</option></select>
|
||||||
|
<p id="abstract"></p>
|
||||||
|
<div id="input"></div>
|
||||||
|
<div id="output"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
|
<script src="wps.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
353
examples/wps.js
Normal file
353
examples/wps.js
Normal file
@@ -0,0 +1,353 @@
|
|||||||
|
OpenLayers.ProxyHost = "proxy.cgi?url=";
|
||||||
|
|
||||||
|
var wps = "http://demo.opengeo.org/geoserver/wps",
|
||||||
|
capabilities, // the capabilities, read by Format.WPSCapabilities::read
|
||||||
|
process; // the process description from Format.WPSDescribeProcess::read
|
||||||
|
|
||||||
|
// get some capabilities
|
||||||
|
getCapabilities();
|
||||||
|
|
||||||
|
// create the UI
|
||||||
|
var layer = new OpenLayers.Layer.Vector("Scratchpad");
|
||||||
|
var toolbar = new OpenLayers.Control.EditingToolbar(layer);
|
||||||
|
toolbar.addControls([new OpenLayers.Control.ModifyFeature(layer, {
|
||||||
|
title: "Select feature"
|
||||||
|
})]);
|
||||||
|
var map = new OpenLayers.Map('map', {
|
||||||
|
controls: [
|
||||||
|
toolbar,
|
||||||
|
new OpenLayers.Control.ZoomPanel(),
|
||||||
|
new OpenLayers.Control.PanPanel()
|
||||||
|
],
|
||||||
|
layers: [
|
||||||
|
new OpenLayers.Layer.WMS(
|
||||||
|
"OSM", "http://maps.opengeo.org/geowebcache/service/wms",
|
||||||
|
{layers: "openstreetmap", format: "image/png"}
|
||||||
|
), layer
|
||||||
|
]
|
||||||
|
});
|
||||||
|
map.zoomToMaxExtent();
|
||||||
|
|
||||||
|
// add behavior to html elements
|
||||||
|
document.getElementById("processes").onchange = describeProcess;
|
||||||
|
|
||||||
|
// using OpenLayers.Format.WPSCapabilities to read the capabilities
|
||||||
|
function getCapabilities() {
|
||||||
|
OpenLayers.Request.GET({
|
||||||
|
url: wps,
|
||||||
|
params: {
|
||||||
|
"SERVICE": "WPS",
|
||||||
|
"REQUEST": "GetCapabilities"
|
||||||
|
},
|
||||||
|
success: function(response){
|
||||||
|
capabilities = new OpenLayers.Format.WPSCapabilities().read(
|
||||||
|
response.responseText
|
||||||
|
);
|
||||||
|
var dropdown = document.getElementById("processes");
|
||||||
|
var offerings = capabilities.processOfferings, option;
|
||||||
|
// populate the dropdown
|
||||||
|
for (var p in offerings) {
|
||||||
|
option = document.createElement("option");
|
||||||
|
option.innerHTML = offerings[p].identifier;
|
||||||
|
option.value = p;
|
||||||
|
dropdown.appendChild(option);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// using OpenLayers.Format.WPSDescribeProcess to get information about a
|
||||||
|
// process
|
||||||
|
function describeProcess() {
|
||||||
|
var selection = this.options[this.selectedIndex].value;
|
||||||
|
OpenLayers.Request.GET({
|
||||||
|
url: wps,
|
||||||
|
params: {
|
||||||
|
"SERVICE": "WPS",
|
||||||
|
"REQUEST": "DescribeProcess",
|
||||||
|
"VERSION": capabilities.version,
|
||||||
|
"IDENTIFIER": selection
|
||||||
|
},
|
||||||
|
success: function(response) {
|
||||||
|
process = new OpenLayers.Format.WPSDescribeProcess().read(
|
||||||
|
response.responseText
|
||||||
|
).processDescriptions[selection];
|
||||||
|
buildForm();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// dynamically create a form from the process description
|
||||||
|
function buildForm() {
|
||||||
|
document.getElementById("abstract").innerHTML = process["abstract"];
|
||||||
|
document.getElementById("input").innerHTML = "<h3>Input:</h3>";
|
||||||
|
document.getElementById("output").innerHTML = "";
|
||||||
|
|
||||||
|
var inputs = process.dataInputs, supported = true,
|
||||||
|
sld = "text/xml; subtype=sld/1.0.0",
|
||||||
|
input;
|
||||||
|
for (var i=0,ii=inputs.length; i<ii; ++i) {
|
||||||
|
input = inputs[i];
|
||||||
|
if (input.complexData) {
|
||||||
|
var formats = input.complexData.supported.formats;
|
||||||
|
if (formats["application/wkt"]) {
|
||||||
|
addWKTInput(input);
|
||||||
|
} else if (formats["text/xml; subtype=wfs-collection/1.0"]) {
|
||||||
|
addWFSCollectionInput(input);
|
||||||
|
} else if (formats["image/tiff"]) {
|
||||||
|
addRasterInput(input);
|
||||||
|
} else if (formats[sld]) {
|
||||||
|
addXMLInput(input, sld);
|
||||||
|
} else {
|
||||||
|
supported = false;
|
||||||
|
}
|
||||||
|
} else if (input.boundingBoxData) {
|
||||||
|
addBoundingBoxInput(input);
|
||||||
|
} else if (input.literalData) {
|
||||||
|
addLiteralInput(input);
|
||||||
|
} else {
|
||||||
|
supported = false;
|
||||||
|
}
|
||||||
|
if (input.minOccurs > 0) {
|
||||||
|
document.getElementById("input").appendChild(document.createTextNode("* "));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (supported) {
|
||||||
|
var executeButton = document.createElement("button");
|
||||||
|
executeButton.innerHTML = "Execute";
|
||||||
|
document.getElementById("input").appendChild(executeButton);
|
||||||
|
executeButton.onclick = execute;
|
||||||
|
} else {
|
||||||
|
document.getElementById("input").innerHTML = '<span class="notsupported">' +
|
||||||
|
"Sorry, the WPS builder does not support the selected process." +
|
||||||
|
"</span>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// helper function to dynamically create a textarea for geometry (WKT) data
|
||||||
|
// input
|
||||||
|
function addWKTInput(input, previousSibling) {
|
||||||
|
var name = input.identifier;
|
||||||
|
var container = document.getElementById("input");
|
||||||
|
var label = document.createElement("label");
|
||||||
|
label["for"] = name;
|
||||||
|
label.title = input["abstract"];
|
||||||
|
label.innerHTML = name + " (select feature, then click field):";
|
||||||
|
previousSibling && previousSibling.nextSibling ?
|
||||||
|
container.insertBefore(label, previousSibling.nextSibling) :
|
||||||
|
container.appendChild(label);
|
||||||
|
var field = document.createElement("textarea");
|
||||||
|
field.onclick = function () {
|
||||||
|
if (layer.selectedFeatures.length) {
|
||||||
|
this.innerHTML = new OpenLayers.Format.WKT().write(
|
||||||
|
layer.selectedFeatures[0]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
createCopy(input, this, addWKTInput);
|
||||||
|
};
|
||||||
|
field.onblur = function() {
|
||||||
|
input.data = field.value ? {
|
||||||
|
complexData: {
|
||||||
|
mimeType: "application/wkt",
|
||||||
|
value: this.value
|
||||||
|
}
|
||||||
|
} : undefined;
|
||||||
|
};
|
||||||
|
field.title = input["abstract"];
|
||||||
|
field.id = name;
|
||||||
|
previousSibling && previousSibling.nextSibling ?
|
||||||
|
container.insertBefore(field, previousSibling.nextSibling.nextSibling) :
|
||||||
|
container.appendChild(field);
|
||||||
|
}
|
||||||
|
|
||||||
|
// helper function for xml input
|
||||||
|
function addXMLInput(input, type) {
|
||||||
|
var name = input.identifier;
|
||||||
|
var field = document.createElement("input");
|
||||||
|
field.title = input["abstract"];
|
||||||
|
field.value = name + " (" + type + ")";
|
||||||
|
field.onblur = function() {
|
||||||
|
input.data = field.value ? {
|
||||||
|
complexData: {
|
||||||
|
mimeType: type,
|
||||||
|
value: this.value
|
||||||
|
}
|
||||||
|
} : undefined;
|
||||||
|
};
|
||||||
|
document.getElementById("input").appendChild(field);
|
||||||
|
}
|
||||||
|
|
||||||
|
// helper function to dynamically create a WFS collection reference input
|
||||||
|
function addWFSCollectionInput(input) {
|
||||||
|
var name = input.identifier;
|
||||||
|
var field = document.createElement("input");
|
||||||
|
field.title = input["abstract"];
|
||||||
|
field.value = name + " (layer on demo server)";
|
||||||
|
addValueHandlers(field, function() {
|
||||||
|
input.reference = field.value ? {
|
||||||
|
mimeType: "text/xml; subtype=wfs-collection/1.0",
|
||||||
|
href: "http://geoserver/wfs",
|
||||||
|
method: "POST",
|
||||||
|
body: {
|
||||||
|
wfs: {
|
||||||
|
version: "1.0.0",
|
||||||
|
outputFormat: "GML2",
|
||||||
|
featureType: field.value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} : undefined;
|
||||||
|
});
|
||||||
|
document.getElementById("input").appendChild(field);
|
||||||
|
}
|
||||||
|
|
||||||
|
// helper function to dynamically create a raster (GeoTIFF) url input
|
||||||
|
function addRasterInput(input) {
|
||||||
|
var name = input.identifier;
|
||||||
|
var field = document.createElement("input");
|
||||||
|
field.title = input["abstract"];
|
||||||
|
var url = window.location.href.split("?")[0];
|
||||||
|
field.value = url.substr(0, url.lastIndexOf("/")+1) + "data/tazdem.tiff";
|
||||||
|
document.getElementById("input").appendChild(field);
|
||||||
|
(field.onblur = function() {
|
||||||
|
input.reference = {
|
||||||
|
mimeType: "image/tiff",
|
||||||
|
href: field.value,
|
||||||
|
method: "GET"
|
||||||
|
};
|
||||||
|
})();
|
||||||
|
}
|
||||||
|
|
||||||
|
// helper function to dynamically create a bounding box input
|
||||||
|
function addBoundingBoxInput(input) {
|
||||||
|
var name = input.identifier;
|
||||||
|
var field = document.createElement("input");
|
||||||
|
field.title = input["abstract"];
|
||||||
|
field.value = "left,bottom,right,top (EPSG:4326)";
|
||||||
|
document.getElementById("input").appendChild(field);
|
||||||
|
addValueHandlers(field, function() {
|
||||||
|
input.boundingBoxData = {
|
||||||
|
projection: "EPSG:4326",
|
||||||
|
bounds: OpenLayers.Bounds.fromString(field.value)
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// helper function to create a literal input textfield or dropdown
|
||||||
|
function addLiteralInput(input, previousSibling) {
|
||||||
|
var name = input.identifier;
|
||||||
|
var container = document.getElementById("input");
|
||||||
|
var anyValue = input.literalData.anyValue;
|
||||||
|
// anyValue means textfield, otherwise we create a dropdown
|
||||||
|
var field = document.createElement(anyValue ? "input" : "select");
|
||||||
|
field.id = name;
|
||||||
|
field.title = input["abstract"];
|
||||||
|
previousSibling && previousSibling.nextSibling ?
|
||||||
|
container.insertBefore(field, previousSibling.nextSibling) :
|
||||||
|
container.appendChild(field);
|
||||||
|
if (anyValue) {
|
||||||
|
var dataType = input.literalData.dataType;
|
||||||
|
field.value = name + (dataType ? " (" + dataType + ")" : "");
|
||||||
|
addValueHandlers(field, function() {
|
||||||
|
input.data = field.value ? {
|
||||||
|
literalData: {
|
||||||
|
value: field.value
|
||||||
|
}
|
||||||
|
} : undefined;
|
||||||
|
createCopy(input, field, addLiteralInput);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
var option;
|
||||||
|
option = document.createElement("option");
|
||||||
|
option.innerHTML = name;
|
||||||
|
field.appendChild(option);
|
||||||
|
for (var v in input.literalData.allowedValues) {
|
||||||
|
option = document.createElement("option");
|
||||||
|
option.value = v;
|
||||||
|
option.innerHTML = v;
|
||||||
|
field.appendChild(option);
|
||||||
|
}
|
||||||
|
field.onchange = function() {
|
||||||
|
createCopy(input, field, addLiteralInput);
|
||||||
|
input.data = this.selectedIndex ? {
|
||||||
|
literalData: {
|
||||||
|
value: this.options[this.selectedIndex].value
|
||||||
|
}
|
||||||
|
} : undefined;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// if maxOccurs is > 1, this will add a copy of the field
|
||||||
|
function createCopy(input, field, fn) {
|
||||||
|
if (input.maxOccurs && input.maxOccurs > 1 && !field.userSelected) {
|
||||||
|
// add another copy of the field - we don't check maxOccurs
|
||||||
|
field.userSelected = true;
|
||||||
|
var newInput = OpenLayers.Util.extend({}, input);
|
||||||
|
// we recognize copies by the occurrence property
|
||||||
|
newInput.occurrence = (input.occurrence || 0) + 1;
|
||||||
|
process.dataInputs.push(newInput);
|
||||||
|
fn(newInput, field);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// helper function for adding events to form fields
|
||||||
|
function addValueHandlers(field, onblur) {
|
||||||
|
field.onclick = function() {
|
||||||
|
if (!this.initialValue) {
|
||||||
|
this.initialValue = this.value;
|
||||||
|
this.value = "";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
field.onblur = function() {
|
||||||
|
if (!this.value) {
|
||||||
|
this.value = this.initialValue;
|
||||||
|
delete this.initialValue;
|
||||||
|
}
|
||||||
|
onblur.apply(this, arguments);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// execute the process
|
||||||
|
function execute() {
|
||||||
|
var output = process.processOutputs[0];
|
||||||
|
var input;
|
||||||
|
// remove occurrences that the user has not filled out
|
||||||
|
for (var i=process.dataInputs.length-1; i>=0; --i) {
|
||||||
|
input = process.dataInputs[i];
|
||||||
|
if ((input.minOccurs === 0 || input.occurrence) && !input.data && !input.reference) {
|
||||||
|
OpenLayers.Util.removeItem(process.dataInputs, input);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
process.responseForm = {
|
||||||
|
rawDataOutput: {
|
||||||
|
identifier: output.identifier
|
||||||
|
}
|
||||||
|
};
|
||||||
|
if (output.complexOutput && output.complexOutput.supported.formats["application/wkt"]) {
|
||||||
|
process.responseForm.rawDataOutput.mimeType = "application/wkt";
|
||||||
|
}
|
||||||
|
OpenLayers.Request.POST({
|
||||||
|
url: wps,
|
||||||
|
data: new OpenLayers.Format.WPSExecute().write(process),
|
||||||
|
success: showOutput
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// add the process's output to the page
|
||||||
|
function showOutput(response) {
|
||||||
|
var result = document.getElementById("output");
|
||||||
|
result.innerHTML = "<h3>Output:</h3>";
|
||||||
|
var features;
|
||||||
|
var contentType = response.getResponseHeader("Content-Type");
|
||||||
|
if (contentType == "application/wkt") {
|
||||||
|
features = new OpenLayers.Format.WKT().read(response.responseText);
|
||||||
|
} else if (contentType == "text/xml; subtype=wfs-collection/1.0") {
|
||||||
|
features = new OpenLayers.Format.WFST.v1_0_0().read(response.responseText);
|
||||||
|
}
|
||||||
|
if (features && (features instanceof OpenLayers.Feature.Vector || features.length)) {
|
||||||
|
layer.addFeatures(features);
|
||||||
|
result.innerHTML += "The result should also be visible on the map.";
|
||||||
|
}
|
||||||
|
result.innerHTML += "<textarea>" + response.responseText + "</textarea>";
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
|
/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
|
||||||
* full list of contributors). Published under the Clear BSD license.
|
* full list of contributors). Published under the 2-clause BSD license.
|
||||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the
|
* See license.txt in the OpenLayers distribution or repository for the
|
||||||
* full text of the license. */
|
* full text of the license. */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -132,6 +132,7 @@
|
|||||||
jsFiles = [
|
jsFiles = [
|
||||||
"OpenLayers/BaseTypes/Class.js",
|
"OpenLayers/BaseTypes/Class.js",
|
||||||
"OpenLayers/Util.js",
|
"OpenLayers/Util.js",
|
||||||
|
"OpenLayers/Util/vendorPrefix.js",
|
||||||
"OpenLayers/Animation.js",
|
"OpenLayers/Animation.js",
|
||||||
"OpenLayers/BaseTypes.js",
|
"OpenLayers/BaseTypes.js",
|
||||||
"OpenLayers/BaseTypes/Bounds.js",
|
"OpenLayers/BaseTypes/Bounds.js",
|
||||||
@@ -143,10 +144,9 @@
|
|||||||
"OpenLayers/Console.js",
|
"OpenLayers/Console.js",
|
||||||
"OpenLayers/Tween.js",
|
"OpenLayers/Tween.js",
|
||||||
"OpenLayers/Kinetic.js",
|
"OpenLayers/Kinetic.js",
|
||||||
"Rico/Corner.js",
|
|
||||||
"Rico/Color.js",
|
|
||||||
"OpenLayers/Events.js",
|
"OpenLayers/Events.js",
|
||||||
"OpenLayers/Events/buttonclick.js",
|
"OpenLayers/Events/buttonclick.js",
|
||||||
|
"OpenLayers/Events/featureclick.js",
|
||||||
"OpenLayers/Request.js",
|
"OpenLayers/Request.js",
|
||||||
"OpenLayers/Request/XMLHttpRequest.js",
|
"OpenLayers/Request/XMLHttpRequest.js",
|
||||||
"OpenLayers/Projection.js",
|
"OpenLayers/Projection.js",
|
||||||
@@ -190,7 +190,6 @@
|
|||||||
"OpenLayers/Layer/Zoomify.js",
|
"OpenLayers/Layer/Zoomify.js",
|
||||||
"OpenLayers/Layer/ArcGISCache.js",
|
"OpenLayers/Layer/ArcGISCache.js",
|
||||||
"OpenLayers/Popup/Anchored.js",
|
"OpenLayers/Popup/Anchored.js",
|
||||||
"OpenLayers/Popup/AnchoredBubble.js",
|
|
||||||
"OpenLayers/Popup/Framed.js",
|
"OpenLayers/Popup/Framed.js",
|
||||||
"OpenLayers/Popup/FramedCloud.js",
|
"OpenLayers/Popup/FramedCloud.js",
|
||||||
"OpenLayers/Feature.js",
|
"OpenLayers/Feature.js",
|
||||||
@@ -305,6 +304,7 @@
|
|||||||
"OpenLayers/Format/GML/v2.js",
|
"OpenLayers/Format/GML/v2.js",
|
||||||
"OpenLayers/Format/GML/v3.js",
|
"OpenLayers/Format/GML/v3.js",
|
||||||
"OpenLayers/Format/Atom.js",
|
"OpenLayers/Format/Atom.js",
|
||||||
|
"OpenLayers/Format/EncodedPolyline.js",
|
||||||
"OpenLayers/Format/KML.js",
|
"OpenLayers/Format/KML.js",
|
||||||
"OpenLayers/Format/GeoRSS.js",
|
"OpenLayers/Format/GeoRSS.js",
|
||||||
"OpenLayers/Format/WFS.js",
|
"OpenLayers/Format/WFS.js",
|
||||||
@@ -312,6 +312,10 @@
|
|||||||
"OpenLayers/Format/OWSCommon/v1.js",
|
"OpenLayers/Format/OWSCommon/v1.js",
|
||||||
"OpenLayers/Format/OWSCommon/v1_0_0.js",
|
"OpenLayers/Format/OWSCommon/v1_0_0.js",
|
||||||
"OpenLayers/Format/OWSCommon/v1_1_0.js",
|
"OpenLayers/Format/OWSCommon/v1_1_0.js",
|
||||||
|
"OpenLayers/Format/WCSCapabilities.js",
|
||||||
|
"OpenLayers/Format/WCSCapabilities/v1.js",
|
||||||
|
"OpenLayers/Format/WCSCapabilities/v1_0_0.js",
|
||||||
|
"OpenLayers/Format/WCSCapabilities/v1_1_0.js",
|
||||||
"OpenLayers/Format/WFSCapabilities.js",
|
"OpenLayers/Format/WFSCapabilities.js",
|
||||||
"OpenLayers/Format/WFSCapabilities/v1.js",
|
"OpenLayers/Format/WFSCapabilities/v1.js",
|
||||||
"OpenLayers/Format/WFSCapabilities/v1_0_0.js",
|
"OpenLayers/Format/WFSCapabilities/v1_0_0.js",
|
||||||
@@ -393,7 +397,10 @@
|
|||||||
"OpenLayers/Symbolizer/Raster.js",
|
"OpenLayers/Symbolizer/Raster.js",
|
||||||
"OpenLayers/Lang.js",
|
"OpenLayers/Lang.js",
|
||||||
"OpenLayers/Lang/en.js",
|
"OpenLayers/Lang/en.js",
|
||||||
"OpenLayers/Spherical.js"
|
"OpenLayers/Spherical.js",
|
||||||
|
"OpenLayers/TileManager.js",
|
||||||
|
"OpenLayers/WPSClient.js",
|
||||||
|
"OpenLayers/WPSProcess.js"
|
||||||
]; // etc.
|
]; // etc.
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -413,5 +420,10 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Constant: VERSION_NUMBER
|
* Constant: VERSION_NUMBER
|
||||||
|
*
|
||||||
|
* This constant identifies the version of OpenLayers.
|
||||||
|
*
|
||||||
|
* When asking questions or reporting issues, make sure to include the output of
|
||||||
|
* OpenLayers.VERSION_NUMBER in the question or issue-description.
|
||||||
*/
|
*/
|
||||||
OpenLayers.VERSION_NUMBER="Release 2.12-rc1";
|
OpenLayers.VERSION_NUMBER="Release 2.13";
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
|
/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
|
||||||
|
* full list of contributors). Published under the 2-clause BSD license.
|
||||||
|
* See license.txt in the OpenLayers distribution or repository for the
|
||||||
|
* full text of the license. */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
|
|
||||||
* full list of contributors). Published under the Clear BSD license.
|
|
||||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the
|
|
||||||
* full text of the license.
|
|
||||||
*
|
|
||||||
* @requires OpenLayers/SingleFile.js
|
* @requires OpenLayers/SingleFile.js
|
||||||
|
* @requires OpenLayers/Util/vendorPrefix.js
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -19,11 +20,8 @@ OpenLayers.Animation = (function(window) {
|
|||||||
* Property: isNative
|
* Property: isNative
|
||||||
* {Boolean} true if a native requestAnimationFrame function is available
|
* {Boolean} true if a native requestAnimationFrame function is available
|
||||||
*/
|
*/
|
||||||
var isNative = !!(window.requestAnimationFrame ||
|
var requestAnimationFrame = OpenLayers.Util.vendorPrefix.js(window, "requestAnimationFrame");
|
||||||
window.webkitRequestAnimationFrame ||
|
var isNative = !!(requestAnimationFrame);
|
||||||
window.mozRequestAnimationFrame ||
|
|
||||||
window.oRequestAnimationFrame ||
|
|
||||||
window.msRequestAnimationFrame);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function: requestFrame
|
* Function: requestFrame
|
||||||
@@ -36,11 +34,7 @@ OpenLayers.Animation = (function(window) {
|
|||||||
* element - {DOMElement} Optional element that visually bounds the animation.
|
* element - {DOMElement} Optional element that visually bounds the animation.
|
||||||
*/
|
*/
|
||||||
var requestFrame = (function() {
|
var requestFrame = (function() {
|
||||||
var request = window.requestAnimationFrame ||
|
var request = window[requestAnimationFrame] ||
|
||||||
window.webkitRequestAnimationFrame ||
|
|
||||||
window.mozRequestAnimationFrame ||
|
|
||||||
window.oRequestAnimationFrame ||
|
|
||||||
window.msRequestAnimationFrame ||
|
|
||||||
function(callback, element) {
|
function(callback, element) {
|
||||||
window.setTimeout(callback, 16);
|
window.setTimeout(callback, 16);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
|
/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
|
||||||
* full list of contributors). Published under the Clear BSD license.
|
* full list of contributors). Published under the 2-clause BSD license.
|
||||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the
|
* See license.txt in the OpenLayers distribution or repository for the
|
||||||
* full text of the license. */
|
* full text of the license. */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -127,7 +127,9 @@ OpenLayers.String = {
|
|||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
replacement = context;
|
replacement = context;
|
||||||
}
|
}
|
||||||
|
if (replacement === undefined) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
replacement = replacement[subs[i]];
|
replacement = replacement[subs[i]];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -189,13 +191,18 @@ OpenLayers.String = {
|
|||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* value - {String}
|
* value - {String}
|
||||||
|
* trimWhitespace - {Boolean}
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* {Number|String} a Number if the passed value is a number, a String
|
* {Number|String} a Number if the passed value is a number, a String
|
||||||
* otherwise.
|
* otherwise.
|
||||||
*/
|
*/
|
||||||
numericIf: function(value) {
|
numericIf: function(value, trimWhitespace) {
|
||||||
return OpenLayers.String.isNumeric(value) ? parseFloat(value) : value;
|
var originalValue = value;
|
||||||
|
if (trimWhitespace === true && value != null && value.replace) {
|
||||||
|
value = value.replace(/^\s*|\s*$/g, "");
|
||||||
|
}
|
||||||
|
return OpenLayers.String.isNumeric(value) ? parseFloat(value) : originalValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -290,7 +297,25 @@ OpenLayers.Number = {
|
|||||||
str = integer + dsep + rem;
|
str = integer + dsep + rem;
|
||||||
}
|
}
|
||||||
return str;
|
return str;
|
||||||
}
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method: zeroPad
|
||||||
|
* Create a zero padded string optionally with a radix for casting numbers.
|
||||||
|
*
|
||||||
|
* Parameters:
|
||||||
|
* num - {Number} The number to be zero padded.
|
||||||
|
* len - {Number} The length of the string to be returned.
|
||||||
|
* radix - {Number} An integer between 2 and 36 specifying the base to use
|
||||||
|
* for representing numeric values.
|
||||||
|
*/
|
||||||
|
zeroPad: function(num, len, radix) {
|
||||||
|
var str = num.toString(radix || 10);
|
||||||
|
while (str.length < len) {
|
||||||
|
str = "0" + str;
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
|
/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
|
||||||
* full list of contributors). Published under the Clear BSD license.
|
* full list of contributors). Published under the 2-clause BSD license.
|
||||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the
|
* See license.txt in the OpenLayers distribution or repository for the
|
||||||
* full text of the license. */
|
* full text of the license. */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -63,7 +63,7 @@ OpenLayers.Bounds = OpenLayers.Class({
|
|||||||
* left - {Number} The left bounds of the box. Note that for width
|
* left - {Number} The left bounds of the box. Note that for width
|
||||||
* calculations, this is assumed to be less than the right value.
|
* calculations, this is assumed to be less than the right value.
|
||||||
* bottom - {Number} The bottom bounds of the box. Note that for height
|
* bottom - {Number} The bottom bounds of the box. Note that for height
|
||||||
* calculations, this is assumed to be more than the top value.
|
* calculations, this is assumed to be less than the top value.
|
||||||
* right - {Number} The right bounds.
|
* right - {Number} The right bounds.
|
||||||
* top - {Number} The top bounds.
|
* top - {Number} The top bounds.
|
||||||
*
|
*
|
||||||
@@ -128,6 +128,7 @@ OpenLayers.Bounds = OpenLayers.Class({
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* APIMethod: toString
|
* APIMethod: toString
|
||||||
|
* Returns a string representation of the bounds object.
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* {String} String representation of bounds object.
|
* {String} String representation of bounds object.
|
||||||
@@ -138,6 +139,11 @@ OpenLayers.Bounds = OpenLayers.Class({
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* APIMethod: toArray
|
* APIMethod: toArray
|
||||||
|
* Returns an array representation of the bounds object.
|
||||||
|
*
|
||||||
|
* Returns an array of left, bottom, right, top properties, or -- when the
|
||||||
|
* optional parameter is true -- an array of the bottom, left, top,
|
||||||
|
* right properties.
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* reverseAxisOrder - {Boolean} Should we reverse the axis order?
|
* reverseAxisOrder - {Boolean} Should we reverse the axis order?
|
||||||
@@ -155,6 +161,7 @@ OpenLayers.Bounds = OpenLayers.Class({
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* APIMethod: toBBOX
|
* APIMethod: toBBOX
|
||||||
|
* Returns a boundingbox-string representation of the bounds object.
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* decimal - {Integer} How many significant digits in the bbox coords?
|
* decimal - {Integer} How many significant digits in the bbox coords?
|
||||||
@@ -163,7 +170,7 @@ OpenLayers.Bounds = OpenLayers.Class({
|
|||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* {String} Simple String representation of bounds object.
|
* {String} Simple String representation of bounds object.
|
||||||
* (e.g. <i>"5,42,10,45"</i>)
|
* (e.g. "5,42,10,45")
|
||||||
*/
|
*/
|
||||||
toBBOX:function(decimal, reverseAxisOrder) {
|
toBBOX:function(decimal, reverseAxisOrder) {
|
||||||
if (decimal== null) {
|
if (decimal== null) {
|
||||||
@@ -202,9 +209,10 @@ OpenLayers.Bounds = OpenLayers.Class({
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* APIMethod: getWidth
|
* APIMethod: getWidth
|
||||||
|
* Returns the width of the bounds.
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* {Float} The width of the bounds
|
* {Float} The width of the bounds (right minus left).
|
||||||
*/
|
*/
|
||||||
getWidth:function() {
|
getWidth:function() {
|
||||||
return (this.right - this.left);
|
return (this.right - this.left);
|
||||||
@@ -212,6 +220,7 @@ OpenLayers.Bounds = OpenLayers.Class({
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* APIMethod: getHeight
|
* APIMethod: getHeight
|
||||||
|
* Returns the height of the bounds.
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* {Float} The height of the bounds (top minus bottom).
|
* {Float} The height of the bounds (top minus bottom).
|
||||||
@@ -222,9 +231,10 @@ OpenLayers.Bounds = OpenLayers.Class({
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* APIMethod: getSize
|
* APIMethod: getSize
|
||||||
|
* Returns an <OpenLayers.Size> object of the bounds.
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* {<OpenLayers.Size>} The size of the box.
|
* {<OpenLayers.Size>} The size of the bounds.
|
||||||
*/
|
*/
|
||||||
getSize:function() {
|
getSize:function() {
|
||||||
return new OpenLayers.Size(this.getWidth(), this.getHeight());
|
return new OpenLayers.Size(this.getWidth(), this.getHeight());
|
||||||
@@ -232,6 +242,8 @@ OpenLayers.Bounds = OpenLayers.Class({
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* APIMethod: getCenterPixel
|
* APIMethod: getCenterPixel
|
||||||
|
* Returns the <OpenLayers.Pixel> object which represents the center of the
|
||||||
|
* bounds.
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* {<OpenLayers.Pixel>} The center of the bounds in pixel space.
|
* {<OpenLayers.Pixel>} The center of the bounds in pixel space.
|
||||||
@@ -243,7 +255,9 @@ OpenLayers.Bounds = OpenLayers.Class({
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* APIMethod: getCenterLonLat
|
* APIMethod: getCenterLonLat
|
||||||
*
|
* Returns the <OpenLayers.LonLat> object which represents the center of the
|
||||||
|
* bounds.
|
||||||
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* {<OpenLayers.LonLat>} The center of the bounds in map space.
|
* {<OpenLayers.LonLat>} The center of the bounds in map space.
|
||||||
*/
|
*/
|
||||||
@@ -297,11 +311,24 @@ OpenLayers.Bounds = OpenLayers.Class({
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* APIMethod: add
|
* APIMethod: add
|
||||||
*
|
* Shifts the coordinates of the bound by the given horizontal and vertical
|
||||||
|
* deltas.
|
||||||
|
*
|
||||||
|
* (start code)
|
||||||
|
* var bounds = new OpenLayers.Bounds(0, 0, 10, 10);
|
||||||
|
* bounds.toString();
|
||||||
|
* // => "0,0,10,10"
|
||||||
|
*
|
||||||
|
* bounds.add(-1.5, 4).toString();
|
||||||
|
* // => "-1.5,4,8.5,14"
|
||||||
|
* (end)
|
||||||
|
*
|
||||||
|
* This method will throw a TypeError if it is passed null as an argument.
|
||||||
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* x - {Float}
|
* x - {Float} horizontal delta
|
||||||
* y - {Float}
|
* y - {Float} vertical delta
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* {<OpenLayers.Bounds>} A new bounds whose coordinates are the same as
|
* {<OpenLayers.Bounds>} A new bounds whose coordinates are the same as
|
||||||
* this, but shifted by the passed-in x and y values.
|
* this, but shifted by the passed-in x and y values.
|
||||||
@@ -316,51 +343,77 @@ OpenLayers.Bounds = OpenLayers.Class({
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* APIMethod: extend
|
* APIMethod: extend
|
||||||
* Extend the bounds to include the point, lonlat, or bounds specified.
|
* Extend the bounds to include the <OpenLayers.LonLat>,
|
||||||
* Note, this function assumes that left < right and bottom < top.
|
* <OpenLayers.Geometry.Point> or <OpenLayers.Bounds> specified.
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Please note that this function assumes that left < right and
|
||||||
* object - {Object} Can be LonLat, Point, or Bounds
|
* bottom < top.
|
||||||
|
*
|
||||||
|
* Parameters:
|
||||||
|
* object - {<OpenLayers.LonLat>, <OpenLayers.Geometry.Point> or
|
||||||
|
* <OpenLayers.Bounds>} The object to be included in the new bounds
|
||||||
|
* object.
|
||||||
*/
|
*/
|
||||||
extend:function(object) {
|
extend:function(object) {
|
||||||
var bounds = null;
|
|
||||||
if (object) {
|
if (object) {
|
||||||
// clear cached center location
|
|
||||||
switch(object.CLASS_NAME) {
|
switch(object.CLASS_NAME) {
|
||||||
case "OpenLayers.LonLat":
|
case "OpenLayers.LonLat":
|
||||||
bounds = new OpenLayers.Bounds(object.lon, object.lat,
|
this.extendXY(object.lon, object.lat);
|
||||||
object.lon, object.lat);
|
|
||||||
break;
|
break;
|
||||||
case "OpenLayers.Geometry.Point":
|
case "OpenLayers.Geometry.Point":
|
||||||
bounds = new OpenLayers.Bounds(object.x, object.y,
|
this.extendXY(object.x, object.y);
|
||||||
object.x, object.y);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "OpenLayers.Bounds":
|
case "OpenLayers.Bounds":
|
||||||
bounds = object;
|
// clear cached center location
|
||||||
|
this.centerLonLat = null;
|
||||||
|
|
||||||
|
if ( (this.left == null) || (object.left < this.left)) {
|
||||||
|
this.left = object.left;
|
||||||
|
}
|
||||||
|
if ( (this.bottom == null) || (object.bottom < this.bottom) ) {
|
||||||
|
this.bottom = object.bottom;
|
||||||
|
}
|
||||||
|
if ( (this.right == null) || (object.right > this.right) ) {
|
||||||
|
this.right = object.right;
|
||||||
|
}
|
||||||
|
if ( (this.top == null) || (object.top > this.top) ) {
|
||||||
|
this.top = object.top;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (bounds) {
|
},
|
||||||
this.centerLonLat = null;
|
|
||||||
if ( (this.left == null) || (bounds.left < this.left)) {
|
/**
|
||||||
this.left = bounds.left;
|
* APIMethod: extendXY
|
||||||
}
|
* Extend the bounds to include the XY coordinate specified.
|
||||||
if ( (this.bottom == null) || (bounds.bottom < this.bottom) ) {
|
*
|
||||||
this.bottom = bounds.bottom;
|
* Parameters:
|
||||||
}
|
* x - {number} The X part of the the coordinate.
|
||||||
if ( (this.right == null) || (bounds.right > this.right) ) {
|
* y - {number} The Y part of the the coordinate.
|
||||||
this.right = bounds.right;
|
*/
|
||||||
}
|
extendXY:function(x, y) {
|
||||||
if ( (this.top == null) || (bounds.top > this.top) ) {
|
// clear cached center location
|
||||||
this.top = bounds.top;
|
this.centerLonLat = null;
|
||||||
}
|
|
||||||
}
|
if ((this.left == null) || (x < this.left)) {
|
||||||
|
this.left = x;
|
||||||
|
}
|
||||||
|
if ((this.bottom == null) || (y < this.bottom)) {
|
||||||
|
this.bottom = y;
|
||||||
|
}
|
||||||
|
if ((this.right == null) || (x > this.right)) {
|
||||||
|
this.right = x;
|
||||||
|
}
|
||||||
|
if ((this.top == null) || (y > this.top)) {
|
||||||
|
this.top = y;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* APIMethod: containsLonLat
|
* APIMethod: containsLonLat
|
||||||
|
* Returns whether the bounds object contains the given <OpenLayers.LonLat>.
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* ll - {<OpenLayers.LonLat>|Object} OpenLayers.LonLat or an
|
* ll - {<OpenLayers.LonLat>|Object} OpenLayers.LonLat or an
|
||||||
@@ -399,6 +452,7 @@ OpenLayers.Bounds = OpenLayers.Class({
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* APIMethod: containsPixel
|
* APIMethod: containsPixel
|
||||||
|
* Returns whether the bounds object contains the given <OpenLayers.Pixel>.
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* px - {<OpenLayers.Pixel>}
|
* px - {<OpenLayers.Pixel>}
|
||||||
@@ -414,6 +468,7 @@ OpenLayers.Bounds = OpenLayers.Class({
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* APIMethod: contains
|
* APIMethod: contains
|
||||||
|
* Returns whether the bounds object contains the given x and y.
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* x - {Float}
|
* x - {Float}
|
||||||
@@ -535,7 +590,7 @@ OpenLayers.Bounds = OpenLayers.Class({
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* APIMethod: containsBounds
|
* APIMethod: containsBounds
|
||||||
* Determine whether the target bounds is contained within this bounds.
|
* Returns whether the bounds object contains the given <OpenLayers.Bounds>.
|
||||||
*
|
*
|
||||||
* bounds - {<OpenLayers.Bounds>} The target bounds.
|
* bounds - {<OpenLayers.Bounds>} The target bounds.
|
||||||
* partial - {Boolean} If any of the target corners is within this bounds
|
* partial - {Boolean} If any of the target corners is within this bounds
|
||||||
@@ -565,10 +620,12 @@ OpenLayers.Bounds = OpenLayers.Class({
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* APIMethod: determineQuadrant
|
* APIMethod: determineQuadrant
|
||||||
*
|
* Returns the the quadrant ("br", "tr", "tl", "bl") in which the given
|
||||||
|
* <OpenLayers.LonLat> lies.
|
||||||
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* lonlat - {<OpenLayers.LonLat>}
|
* lonlat - {<OpenLayers.LonLat>}
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* {String} The quadrant ("br" "tr" "tl" "bl") of the bounds in which the
|
* {String} The quadrant ("br" "tr" "tl" "bl") of the bounds in which the
|
||||||
* coordinate lies.
|
* coordinate lies.
|
||||||
@@ -615,6 +672,7 @@ OpenLayers.Bounds = OpenLayers.Class({
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* APIMethod: wrapDateLine
|
* APIMethod: wrapDateLine
|
||||||
|
* Wraps the bounds object around the dateline.
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* maxExtent - {<OpenLayers.Bounds>}
|
* maxExtent - {<OpenLayers.Bounds>}
|
||||||
@@ -681,12 +739,18 @@ OpenLayers.Bounds = OpenLayers.Class({
|
|||||||
/**
|
/**
|
||||||
* APIFunction: fromString
|
* APIFunction: fromString
|
||||||
* Alternative constructor that builds a new OpenLayers.Bounds from a
|
* Alternative constructor that builds a new OpenLayers.Bounds from a
|
||||||
* parameter string
|
* parameter string.
|
||||||
*
|
*
|
||||||
|
* (begin code)
|
||||||
|
* OpenLayers.Bounds.fromString("5,42,10,45");
|
||||||
|
* // => equivalent to ...
|
||||||
|
* new OpenLayers.Bounds(5, 42, 10, 45);
|
||||||
|
* (end)
|
||||||
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* str - {String}Comma-separated bounds string. (e.g. <i>"5,42,10,45"</i>)
|
* str - {String} Comma-separated bounds string. (e.g. "5,42,10,45")
|
||||||
* reverseAxisOrder - {Boolean} Does the string use reverse axis order?
|
* reverseAxisOrder - {Boolean} Does the string use reverse axis order?
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* {<OpenLayers.Bounds>} New bounds object built from the
|
* {<OpenLayers.Bounds>} New bounds object built from the
|
||||||
* passed-in String.
|
* passed-in String.
|
||||||
@@ -698,11 +762,16 @@ OpenLayers.Bounds.fromString = function(str, reverseAxisOrder) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* APIFunction: fromArray
|
* APIFunction: fromArray
|
||||||
* Alternative constructor that builds a new OpenLayers.Bounds
|
* Alternative constructor that builds a new OpenLayers.Bounds from an array.
|
||||||
* from an array
|
*
|
||||||
*
|
* (begin code)
|
||||||
|
* OpenLayers.Bounds.fromArray( [5, 42, 10, 45] );
|
||||||
|
* // => equivalent to ...
|
||||||
|
* new OpenLayers.Bounds(5, 42, 10, 45);
|
||||||
|
* (end)
|
||||||
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* bbox - {Array(Float)} Array of bounds values (e.g. <i>[5,42,10,45]</i>)
|
* bbox - {Array(Float)} Array of bounds values (e.g. [5,42,10,45])
|
||||||
* reverseAxisOrder - {Boolean} Does the array use reverse axis order?
|
* reverseAxisOrder - {Boolean} Does the array use reverse axis order?
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
@@ -716,12 +785,17 @@ OpenLayers.Bounds.fromArray = function(bbox, reverseAxisOrder) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* APIFunction: fromSize
|
* APIFunction: fromSize
|
||||||
* Alternative constructor that builds a new OpenLayers.Bounds
|
* Alternative constructor that builds a new OpenLayers.Bounds from a size.
|
||||||
* from a size
|
*
|
||||||
*
|
* (begin code)
|
||||||
|
* OpenLayers.Bounds.fromSize( new OpenLayers.Size(10, 20) );
|
||||||
|
* // => equivalent to ...
|
||||||
|
* new OpenLayers.Bounds(0, 20, 10, 0);
|
||||||
|
* (end)
|
||||||
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* size - {<OpenLayers.Size>|Object} OpenLayers.Size or an object with
|
* size - {<OpenLayers.Size> or Object} <OpenLayers.Size> or an object with
|
||||||
* a 'w' and 'h' properties.
|
* both 'w' and 'h' properties.
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* {<OpenLayers.Bounds>} New bounds object built from the passed-in size.
|
* {<OpenLayers.Bounds>} New bounds object built from the passed-in size.
|
||||||
@@ -737,6 +811,14 @@ OpenLayers.Bounds.fromSize = function(size) {
|
|||||||
* Function: oppositeQuadrant
|
* Function: oppositeQuadrant
|
||||||
* Get the opposite quadrant for a given quadrant string.
|
* Get the opposite quadrant for a given quadrant string.
|
||||||
*
|
*
|
||||||
|
* (begin code)
|
||||||
|
* OpenLayers.Bounds.oppositeQuadrant( "tl" );
|
||||||
|
* // => "br"
|
||||||
|
*
|
||||||
|
* OpenLayers.Bounds.oppositeQuadrant( "tr" );
|
||||||
|
* // => "bl"
|
||||||
|
* (end)
|
||||||
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* quadrant - {String} two character quadrant shortstring
|
* quadrant - {String} two character quadrant shortstring
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
|
/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
|
||||||
* full list of contributors). Published under the Clear BSD license.
|
* full list of contributors). Published under the 2-clause BSD license.
|
||||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the
|
* See license.txt in the OpenLayers distribution or repository for the
|
||||||
* full text of the license. */
|
* full text of the license. */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
|
/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
|
||||||
* full list of contributors). Published under the Clear BSD license.
|
* full list of contributors). Published under the 2-clause BSD license.
|
||||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the
|
* See license.txt in the OpenLayers distribution or repository for the
|
||||||
* full text of the license. */
|
* full text of the license. */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -15,6 +15,14 @@
|
|||||||
*/
|
*/
|
||||||
OpenLayers.Date = {
|
OpenLayers.Date = {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* APIProperty: dateRegEx
|
||||||
|
* The regex to be used for validating dates. You can provide your own
|
||||||
|
* regex for instance for adding support for years before BC. Default
|
||||||
|
* value is: /^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:(?:T(\d{1,2}):(\d{2}):(\d{2}(?:\.\d+)?)(Z|(?:[+-]\d{1,2}(?::(\d{2}))?)))|Z)?$/
|
||||||
|
*/
|
||||||
|
dateRegEx: /^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:(?:T(\d{1,2}):(\d{2}):(\d{2}(?:\.\d+)?)(Z|(?:[+-]\d{1,2}(?::(\d{2}))?)))|Z)?$/,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* APIMethod: toISOString
|
* APIMethod: toISOString
|
||||||
* Generates a string representing a date. The format of the string follows
|
* Generates a string representing a date. The format of the string follows
|
||||||
@@ -41,13 +49,6 @@ OpenLayers.Date = {
|
|||||||
return date.toISOString();
|
return date.toISOString();
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
function pad(num, len) {
|
|
||||||
var str = num + "";
|
|
||||||
while (str.length < len) {
|
|
||||||
str = "0" + str;
|
|
||||||
}
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
return function(date) {
|
return function(date) {
|
||||||
var str;
|
var str;
|
||||||
if (isNaN(date.getTime())) {
|
if (isNaN(date.getTime())) {
|
||||||
@@ -57,12 +58,12 @@ OpenLayers.Date = {
|
|||||||
} else {
|
} else {
|
||||||
str =
|
str =
|
||||||
date.getUTCFullYear() + "-" +
|
date.getUTCFullYear() + "-" +
|
||||||
pad(date.getUTCMonth() + 1, 2) + "-" +
|
OpenLayers.Number.zeroPad(date.getUTCMonth() + 1, 2) + "-" +
|
||||||
pad(date.getUTCDate(), 2) + "T" +
|
OpenLayers.Number.zeroPad(date.getUTCDate(), 2) + "T" +
|
||||||
pad(date.getUTCHours(), 2) + ":" +
|
OpenLayers.Number.zeroPad(date.getUTCHours(), 2) + ":" +
|
||||||
pad(date.getUTCMinutes(), 2) + ":" +
|
OpenLayers.Number.zeroPad(date.getUTCMinutes(), 2) + ":" +
|
||||||
pad(date.getUTCSeconds(), 2) + "." +
|
OpenLayers.Number.zeroPad(date.getUTCSeconds(), 2) + "." +
|
||||||
pad(date.getUTCMilliseconds(), 3) + "Z";
|
OpenLayers.Number.zeroPad(date.getUTCMilliseconds(), 3) + "Z";
|
||||||
}
|
}
|
||||||
return str;
|
return str;
|
||||||
};
|
};
|
||||||
@@ -91,7 +92,7 @@ OpenLayers.Date = {
|
|||||||
*/
|
*/
|
||||||
parse: function(str) {
|
parse: function(str) {
|
||||||
var date;
|
var date;
|
||||||
var match = str.match(/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:(?:T(\d{1,2}):(\d{2}):(\d{2}(?:\.\d+)?)(Z|(?:[+-]\d{1,2}(?::(\d{2}))?)))|Z)?$/);
|
var match = str.match(this.dateRegEx);
|
||||||
if (match && (match[1] || match[7])) { // must have at least year or time
|
if (match && (match[1] || match[7])) { // must have at least year or time
|
||||||
var year = parseInt(match[1], 10) || 0;
|
var year = parseInt(match[1], 10) || 0;
|
||||||
var month = (parseInt(match[2], 10) - 1) || 0;
|
var month = (parseInt(match[2], 10) - 1) || 0;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
|
/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
|
||||||
* full list of contributors). Published under the Clear BSD license.
|
* full list of contributors). Published under the 2-clause BSD license.
|
||||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the
|
* See license.txt in the OpenLayers distribution or repository for the
|
||||||
* full text of the license. */
|
* full text of the license. */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
|
/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
|
||||||
* full list of contributors). Published under the Clear BSD license.
|
* full list of contributors). Published under the 2-clause BSD license.
|
||||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the
|
* See license.txt in the OpenLayers distribution or repository for the
|
||||||
* full text of the license. */
|
* full text of the license. */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
|
/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
|
||||||
* full list of contributors). Published under the Clear BSD license.
|
* full list of contributors). Published under the 2-clause BSD license.
|
||||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the
|
* See license.txt in the OpenLayers distribution or repository for the
|
||||||
* full text of the license. */
|
* full text of the license. */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
|
/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
|
||||||
* full list of contributors). Published under the Clear BSD license.
|
* full list of contributors). Published under the 2-clause BSD license.
|
||||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the
|
* See license.txt in the OpenLayers distribution or repository for the
|
||||||
* full text of the license. */
|
* full text of the license. */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
|
/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
|
||||||
* full list of contributors). Published under the Clear BSD license.
|
* full list of contributors). Published under the 2-clause BSD license.
|
||||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the
|
* See license.txt in the OpenLayers distribution or repository for the
|
||||||
* full text of the license. */
|
* full text of the license. */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for
|
/* Copyright (c) 2006-2013 by OpenLayers Contributors (see authors.txt for
|
||||||
* full list of contributors). Published under the Clear BSD license.
|
* full list of contributors). Published under the 2-clause BSD license.
|
||||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the
|
* See license.txt in the OpenLayers distribution or repository for the
|
||||||
* full text of the license. */
|
* full text of the license. */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -120,6 +120,12 @@ OpenLayers.Control = OpenLayers.Class({
|
|||||||
*/
|
*/
|
||||||
active: null,
|
active: null,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Property: handlerOptions
|
||||||
|
* {Object} Used to set non-default properties on the control's handler
|
||||||
|
*/
|
||||||
|
handlerOptions: null,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Property: handler
|
* Property: handler
|
||||||
* {<OpenLayers.Handler>} null
|
* {<OpenLayers.Handler>} null
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user