Compare commits
673 Commits
v3.4.0
...
release-2.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 | ||
|
|
fe31af5c80 | ||
|
|
032df4b90a | ||
|
|
7141d237d9 | ||
|
|
1d680df6d0 | ||
|
|
8d1d08b0c2 | ||
|
|
a662f82a1b | ||
|
|
0c87de44b4 | ||
|
|
99dd0bbcb2 | ||
|
|
74dd106082 | ||
|
|
a6119f6a75 | ||
|
|
cf92ced1c8 | ||
|
|
a18ce5adf6 | ||
|
|
875a2b98ff | ||
|
|
f27002b565 | ||
|
|
e3a32f29a8 | ||
|
|
a87f5ac16a | ||
|
|
da67953c61 | ||
|
|
ec7b12257b | ||
|
|
4cd34bc851 | ||
|
|
d86c1b6c9c | ||
|
|
56d7cee8cf | ||
|
|
53ed973eec | ||
|
|
d08fb575b1 | ||
|
|
d5bdadc18e | ||
|
|
292da06150 | ||
|
|
4af41b41f5 | ||
|
|
a5c5fd8d3e | ||
|
|
3dfa3fd157 | ||
|
|
c40bdc90e9 | ||
|
|
029bdaccde | ||
|
|
84e5c47caa | ||
|
|
e773ec32d1 | ||
|
|
2e83863e90 | ||
|
|
ee8e892bb4 |
@@ -379,7 +379,6 @@ Group: OpenLayers {
|
||||
|
||||
File: Popup (no auto-title, OpenLayers/Popup.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: FramedCloud (no auto-title, OpenLayers/Popup/FramedCloud.js)
|
||||
} # Group: Popup
|
||||
|
||||
@@ -32,6 +32,13 @@ def build(config_file = None, output_file = None, options = None):
|
||||
except ImportError:
|
||||
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
|
||||
if options.compressor and options.compressor in have_compressor:
|
||||
use_compressor = options.compressor
|
||||
@@ -52,7 +59,7 @@ def build(config_file = None, output_file = None, options = None):
|
||||
|
||||
print "Merging libraries."
|
||||
try:
|
||||
if use_compressor == "closure":
|
||||
if use_compressor == "closure" or use_compressor == 'uglify-js':
|
||||
sourceFiles = mergejs.getNames(sourceDirectory, configFilename)
|
||||
else:
|
||||
merged = mergejs.run(sourceDirectory, None, configFilename)
|
||||
@@ -60,6 +67,15 @@ def build(config_file = None, output_file = None, options = None):
|
||||
print "\nAbnormal termination."
|
||||
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
|
||||
if use_compressor == "jsmin":
|
||||
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."
|
||||
sys.exit("ERROR: Closure Compilation failed! See compilation errors.")
|
||||
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
|
||||
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."
|
||||
minimized = file("license.txt").read() + minimized
|
||||
|
||||
@@ -111,7 +143,10 @@ def build(config_file = None, output_file = None, options = None):
|
||||
|
||||
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.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()
|
||||
if not len(args):
|
||||
build(options=options)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
OpenLayers.js -- OpenLayers Map Viewer Library
|
||||
|
||||
Copyright (c) 2006-2012 by OpenLayers Contributors
|
||||
Copyright (c) 2006-2013 by OpenLayers Contributors
|
||||
Published under the 2-clause BSD 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.
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ OpenLayers/Protocol/HTTP.js
|
||||
OpenLayers/Protocol/WFS.js
|
||||
OpenLayers/Protocol/WFS/v1_0_0.js
|
||||
OpenLayers/Strategy/Fixed.js
|
||||
OpenLayers/TileManager.js
|
||||
|
||||
[exclude]
|
||||
|
||||
|
||||
@@ -379,7 +379,6 @@ Group: OpenLayers {
|
||||
|
||||
File: Popup (no auto-title, OpenLayers/Popup.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: FramedCloud (no auto-title, OpenLayers/Popup/FramedCloud.js)
|
||||
} # Group: Popup
|
||||
|
||||
@@ -12,11 +12,12 @@
|
||||
format = new OpenLayers.Format.WMSDescribeLayer();
|
||||
html = "<br>";
|
||||
resp = format.read(req.responseText);
|
||||
for(var i = 0; i < resp.length; i++) {
|
||||
html += "Layer: typeName: "+ resp[i].typeName+",";
|
||||
var layerDescriptions = resp.layerDescriptions;
|
||||
for(var i = 0; i < layerDescriptions.length; i++) {
|
||||
html += "Layer: typeName: "+layerDescriptions[i].typeName+",";
|
||||
html += "<ul>";
|
||||
html += "<li>owsURL: "+resp[i].owsURL+"</li>";
|
||||
html += "<li>owsType: "+resp[i].owsType+"</li>";
|
||||
html += "<li>owsURL: "+layerDescriptions[i].owsURL+"</li>";
|
||||
html += "<li>owsType: "+layerDescriptions[i].owsType+"</li>";
|
||||
html += "</ul>"
|
||||
}
|
||||
document.getElementById('output').innerHTML = html;
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<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/google.css" type="text/css">
|
||||
<link rel="stylesheet" href="style.css" type="text/css">
|
||||
<script src="http://maps.google.com/maps/api/js?v=3&sensor=false"></script>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
|
||||
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",
|
||||
projection: "EPSG:900913",
|
||||
layers: [
|
||||
new OpenLayers.Layer.WMS("OSGeo", "http://vmap0.tiles.osgeo.org/wms/vmap0", {
|
||||
layers: "basic"
|
||||
}, {
|
||||
eventListeners: {
|
||||
tileloaded: updateStatus
|
||||
}
|
||||
})
|
||||
new OpenLayers.Layer.WMS(
|
||||
"OSGeo", "http://vmap0.tiles.osgeo.org/wms/vmap0",
|
||||
{layers: "basic"}
|
||||
)
|
||||
],
|
||||
center: [0, 0],
|
||||
zoom: 1
|
||||
@@ -38,6 +35,7 @@ function init() {
|
||||
};
|
||||
|
||||
// update the number of cached tiles and detect local storage support
|
||||
map.layers[0].events.on({'tileloaded': updateStatus});
|
||||
function updateStatus() {
|
||||
if (window.localStorage) {
|
||||
status.innerHTML = localStorage.length + " entries in cache.";
|
||||
|
||||
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 |
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
@@ -1,18 +1,9 @@
|
||||
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({
|
||||
div: "map",
|
||||
tileManager: new OpenLayers.TileManager(),
|
||||
layers: [
|
||||
new OpenLayers.Layer.XYZ("OSM (with buffer)", urls, {
|
||||
transitionEffect: "resize", buffer: 2, sphericalMercator: true
|
||||
}),
|
||||
new OpenLayers.Layer.XYZ("OSM (without buffer)", urls, {
|
||||
transitionEffect: "resize", buffer: 0, sphericalMercator: true
|
||||
})
|
||||
new OpenLayers.Layer.OSM("OSM (without buffer)"),
|
||||
new OpenLayers.Layer.OSM("OSM (with buffer)", null, {buffer: 2})
|
||||
],
|
||||
controls: [
|
||||
new OpenLayers.Control.Navigation({
|
||||
|
||||
@@ -20,11 +20,14 @@
|
||||
<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 can be made public, in which case no authorization is needed to read them. Geometries can be stored in Location columns in KML format. The default output is a CSV dump of each table row/column selected. Multi-line CSV files are not easy to parse in Javascript, but by adding a jsonCallback parameter to the HTTP command, the output will be 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.
|
||||
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. <a href="https://www.google.com/fusiontables/DataSource?docid=1g5DrXcdotCiO_yffkdW0zhuJk0a1i80SPvERHI8">Table used</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>
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// change this to your api key
|
||||
var apikey = "AIzaSyD_1zzMAoZjuP-m4LyhieuYmqiVJTEajyI";
|
||||
|
||||
var map = new OpenLayers.Map({
|
||||
div: "map",
|
||||
layers: [
|
||||
@@ -6,21 +9,24 @@ var map = new OpenLayers.Map({
|
||||
projection: new OpenLayers.Projection("EPSG:4326"),
|
||||
strategies: [new OpenLayers.Strategy.Fixed()],
|
||||
protocol: new OpenLayers.Protocol.Script({
|
||||
url: "https://www.google.com/fusiontables/api/query",
|
||||
params: {sql: "select * from 1g5DrXcdotCiO_yffkdW0zhuJk0a1i80SPvERHI8"},
|
||||
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.table.cols; // column names
|
||||
for (var i = 0; i < json.table.rows.length; i++) {
|
||||
row = json.table.rows[i];
|
||||
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]);
|
||||
feature.geometry = this.parseGeometry(row[j].geometry);
|
||||
} else {
|
||||
atts[cols[j]] = row[j];
|
||||
}
|
||||
@@ -33,8 +39,7 @@ var map = new OpenLayers.Map({
|
||||
}
|
||||
return features;
|
||||
}
|
||||
}),
|
||||
callbackKey: "jsonCallback"
|
||||
})
|
||||
}),
|
||||
eventListeners: {
|
||||
"featuresadded": function () {
|
||||
|
||||
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]]]}}]}
|
||||
@@ -6,7 +6,6 @@
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<title>OpenLayers Google (v3) Layer Example</title>
|
||||
<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">
|
||||
<script src="http://maps.google.com/maps/api/js?v=3&sensor=false"></script>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<title>OpenLayers Google (v3) Layer Example</title>
|
||||
<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">
|
||||
<script src="http://maps.google.com/maps/api/js?v=3&sensor=false"></script>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
@@ -30,21 +29,6 @@
|
||||
spherical mercator projection. See the
|
||||
<a href="google-v3.js" target="_blank">google-v3.js source</a>
|
||||
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>
|
||||
<strong>Note on Google Maps API versioning:</strong>
|
||||
This example uses the "nightly" version of Google Maps
|
||||
API. This is specified by using <code>v=3</code> in the
|
||||
the Google Maps API URL. Production applications should use the
|
||||
"release" or "frozen" versions of Google Maps
|
||||
API. See the <code>OpenLayers.Layer.Google.v3</code> API
|
||||
docs, and the
|
||||
<a href="https://developers.google.com/maps/documentation/javascript/basics#Versioning">Versioning Section</a>
|
||||
of the Google Maps API docs, for more details.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,35 +1,34 @@
|
||||
var map;
|
||||
|
||||
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());
|
||||
|
||||
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
|
||||
var animate = document.getElementById("animate");
|
||||
animate.onclick = function() {
|
||||
|
||||
@@ -19,14 +19,12 @@
|
||||
function init(){
|
||||
map = new OpenLayers.Map('map');
|
||||
|
||||
var options = {numZoomLevels: 3};
|
||||
|
||||
var graphic = new OpenLayers.Layer.Image(
|
||||
'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.Size(580, 288),
|
||||
options
|
||||
{numZoomLevels: 3}
|
||||
);
|
||||
|
||||
graphic.events.on({
|
||||
@@ -38,9 +36,12 @@
|
||||
}
|
||||
});
|
||||
|
||||
var jpl_wms = new OpenLayers.Layer.WMS( "NASA Global Mosaic",
|
||||
"http://t1.hypercube.telascience.org/cgi-bin/landsat7",
|
||||
{layers: "landsat7"}, options);
|
||||
var jpl_wms = new OpenLayers.Layer.WMS(
|
||||
"Global Imagery",
|
||||
"http://demo.opengeo.org/geoserver/wms",
|
||||
{layers: "bluemarble"},
|
||||
{maxExtent: [-160, -88.759, 160, 88.759], numZoomLevels: 3}
|
||||
);
|
||||
|
||||
map.addLayers([graphic, jpl_wms]);
|
||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||
|
||||
@@ -1,35 +1,21 @@
|
||||
var streets = new OpenLayers.Layer.XYZ(
|
||||
"MapBox Streets",
|
||||
var earth = new OpenLayers.Layer.XYZ(
|
||||
"Natural Earth",
|
||||
[
|
||||
"http://a.tiles.mapbox.com/v3/mapbox.mapbox-streets/${z}/${x}/${y}.png",
|
||||
"http://b.tiles.mapbox.com/v3/mapbox.mapbox-streets/${z}/${x}/${y}.png",
|
||||
"http://c.tiles.mapbox.com/v3/mapbox.mapbox-streets/${z}/${x}/${y}.png",
|
||||
"http://d.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.natural-earth-hypso-bathy/${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.natural-earth-hypso-bathy/${z}/${x}/${y}.png"
|
||||
], {
|
||||
attribution: "Tiles © <a href='http://mapbox.com/'>MapBox</a> | " +
|
||||
"Data © <a href='http://www.openstreetmap.org/'>OpenStreetMap</a> " +
|
||||
"and contributors, CC-BY-SA",
|
||||
attribution: "Tiles © <a href='http://mapbox.com/'>MapBox</a>",
|
||||
sphericalMercator: true,
|
||||
wrapDateLine: true,
|
||||
transitionEffect: "resize",
|
||||
buffer: 1,
|
||||
numZoomLevels: 17
|
||||
numZoomLevels: 5
|
||||
}
|
||||
);
|
||||
|
||||
var map = new OpenLayers.Map({
|
||||
div: "map",
|
||||
layers: [streets],
|
||||
controls: [
|
||||
new OpenLayers.Control.Attribution(),
|
||||
new OpenLayers.Control.Navigation({
|
||||
dragPanOptions: {
|
||||
enableKinetic: true
|
||||
}
|
||||
}),
|
||||
new OpenLayers.Control.Zoom(),
|
||||
new OpenLayers.Control.Permalink({anchor: true})
|
||||
],
|
||||
layers: [earth],
|
||||
center: [0, 0],
|
||||
zoom: 1
|
||||
});
|
||||
|
||||
@@ -5,26 +5,26 @@ var map = new OpenLayers.Map({
|
||||
new OpenLayers.Layer.XYZ(
|
||||
"OpenStreetMap",
|
||||
[
|
||||
"http://otile1.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png",
|
||||
"http://otile2.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png",
|
||||
"http://otile3.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png",
|
||||
"http://otile4.mqcdn.com/tiles/1.0.0/osm/${z}/${x}/${y}.png"
|
||||
"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: "Tiles Courtesy of <a href='http://open.mapquest.co.uk/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png' border='0'>",
|
||||
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://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"
|
||||
"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> <img src='http://developer.mapquest.com/content/osm/mq_logo.png' border='0'>",
|
||||
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"
|
||||
}
|
||||
)
|
||||
@@ -33,4 +33,4 @@ var map = new OpenLayers.Map({
|
||||
zoom: 1
|
||||
});
|
||||
|
||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||
|
||||
@@ -42,6 +42,7 @@ var init = function (onSelectFeatureFunction) {
|
||||
theme: null,
|
||||
projection: sm,
|
||||
numZoomLevels: 18,
|
||||
tileManager: new OpenLayers.TileManager(),
|
||||
controls: [
|
||||
new OpenLayers.Control.Attribution(),
|
||||
new OpenLayers.Control.TouchNavigation({
|
||||
|
||||
@@ -5,7 +5,15 @@ function init() {
|
||||
styleMap: new OpenLayers.StyleMap({
|
||||
temporary: OpenLayers.Util.applyDefaults({
|
||||
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)
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
@@ -12,12 +12,48 @@ html, body, #map {
|
||||
#title, #tags, #shortdesc {
|
||||
display: none;
|
||||
}
|
||||
div.olMapViewport {
|
||||
-ms-touch-action: none;
|
||||
}
|
||||
|
||||
/* Turn on GPU support where available */
|
||||
.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;
|
||||
-moz-transition: opacity 0.2s linear;
|
||||
-o-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 {
|
||||
position: absolute;
|
||||
font-size: 10px;
|
||||
@@ -166,4 +202,4 @@ div.layerPanel div.mapButtonItemActive:after {
|
||||
div.layerPanel div.mapButtonItemInactive,
|
||||
div.layerPanel div.mapButtonItemActive {
|
||||
margin-left: 1px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,49 +46,53 @@ var map;
|
||||
|
||||
// Geolocate control for the Locate button - the locationupdated handler
|
||||
// draws a cross at the location and a circle showing the accuracy radius.
|
||||
zoomPanel.addControls([
|
||||
new OpenLayers.Control.Geolocate({
|
||||
type: OpenLayers.Control.TYPE_TOGGLE,
|
||||
geolocationOptions: {
|
||||
enableHighAccuracy: false,
|
||||
maximumAge: 0,
|
||||
timeout: 7000
|
||||
var geolocate = new OpenLayers.Control.Geolocate({
|
||||
type: OpenLayers.Control.TYPE_TOGGLE,
|
||||
bind: false,
|
||||
watch: true,
|
||||
geolocationOptions: {
|
||||
enableHighAccuracy: false,
|
||||
maximumAge: 0,
|
||||
timeout: 7000
|
||||
},
|
||||
eventListeners: {
|
||||
activate: function() {
|
||||
map.addLayer(vector);
|
||||
},
|
||||
eventListeners: {
|
||||
activate: function() {
|
||||
map.addLayer(vector);
|
||||
},
|
||||
deactivate: function() {
|
||||
map.removeLayer(vector);
|
||||
vector.removeAllFeatures();
|
||||
},
|
||||
locationupdated: function(e) {
|
||||
vector.removeAllFeatures();
|
||||
vector.addFeatures([
|
||||
new OpenLayers.Feature.Vector(e.point, null, {
|
||||
graphicName: 'cross',
|
||||
deactivate: function() {
|
||||
map.removeLayer(vector);
|
||||
vector.removeAllFeatures();
|
||||
},
|
||||
locationupdated: function(e) {
|
||||
vector.removeAllFeatures();
|
||||
vector.addFeatures([
|
||||
new OpenLayers.Feature.Vector(e.point, null, {
|
||||
graphicName: 'cross',
|
||||
strokeColor: '#f00',
|
||||
strokeWidth: 2,
|
||||
fillOpacity: 0,
|
||||
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',
|
||||
strokeWidth: 2,
|
||||
fillOpacity: 0,
|
||||
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',
|
||||
strokeOpacity: 0.6
|
||||
}
|
||||
)
|
||||
]);
|
||||
map.zoomToExtent(vector.getDataExtent());
|
||||
}
|
||||
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 = new OpenLayers.Map({
|
||||
@@ -96,22 +100,11 @@ var map;
|
||||
theme: null,
|
||||
projection: "EPSG:3857",
|
||||
units: "m",
|
||||
maxExtent: [-20037508.34, -20037508.34, 20037508.34, 20037508.34],
|
||||
maxResolution: 156543.0339,
|
||||
numZoomLevels: 20,
|
||||
maxResolution: 38.21851413574219,
|
||||
numZoomLevels: 8,
|
||||
tileManager: new OpenLayers.TileManager(),
|
||||
controls: [
|
||||
new OpenLayers.Control.Navigation({
|
||||
mouseWheelOptions: {
|
||||
cumulative: false,
|
||||
interval: 20
|
||||
},
|
||||
dragPanOptions: {
|
||||
enableKinetic: {
|
||||
deceleration: 0.02
|
||||
}
|
||||
},
|
||||
zoomBoxEnabled: false
|
||||
}),
|
||||
new OpenLayers.Control.Navigation(),
|
||||
new OpenLayers.Control.Attribution(),
|
||||
zoomPanel,
|
||||
layerPanel
|
||||
@@ -121,6 +114,15 @@ var map;
|
||||
// update anchor for permalinks
|
||||
var ctr = map.getCenter();
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -132,14 +134,11 @@ var map;
|
||||
|
||||
// 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>'
|
||||
};
|
||||
// No fade transitions on Android 4, because they are buggy
|
||||
if (/Android 4\.0.*Safari\/.*/.test(navigator.userAgent)) {
|
||||
defaults.className = "nofade";
|
||||
}
|
||||
|
||||
// The WMTS layers we're going to add
|
||||
var fmzk, aerial, labels;
|
||||
@@ -163,13 +162,13 @@ var map;
|
||||
var doc = request.responseText,
|
||||
caps = format.read(doc);
|
||||
fmzk = format.createLayer(caps, OpenLayers.Util.applyDefaults(
|
||||
{layer:"fmzk", requestEncoding:"REST", transitionEffect:"resize"}, defaults
|
||||
{layer:"fmzk"}, defaults
|
||||
));
|
||||
aerial = format.createLayer(caps, OpenLayers.Util.applyDefaults(
|
||||
{layer:"lb", requestEncoding:"REST", transitionEffect:"resize"}, defaults
|
||||
{layer:"lb"}, defaults
|
||||
));
|
||||
labels = format.createLayer(caps, OpenLayers.Util.applyDefaults(
|
||||
{layer:"beschriftung", requestEncoding:"REST", className:"nofade", isBaseLayer: false},
|
||||
{layer:"beschriftung", isBaseLayer: false, transitionEffect: 'map-resize'},
|
||||
defaults
|
||||
));
|
||||
map.addLayers([fmzk, aerial, labels]);
|
||||
@@ -185,26 +184,41 @@ var map;
|
||||
var extent = new OpenLayers.Bounds(1799448.394855, 6124949.74777, 1848250.442089, 6162571.828177);
|
||||
defaults.tileFullExtent = extent;
|
||||
fmzk = new OpenLayers.Layer.WMTS(OpenLayers.Util.applyDefaults({
|
||||
url: "http://maps.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",
|
||||
style: "pastell",
|
||||
transitionEffect: "resize"
|
||||
style: "pastell"
|
||||
},
|
||||
defaults));
|
||||
aerial = new OpenLayers.Layer.WMTS(OpenLayers.Util.applyDefaults({
|
||||
url: "http://maps.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",
|
||||
style: "farbe",
|
||||
transitionEffect: "resize"
|
||||
style: "farbe"
|
||||
},
|
||||
defaults));
|
||||
labels = new OpenLayers.Layer.WMTS(OpenLayers.Util.applyDefaults({
|
||||
url: "http://maps.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",
|
||||
style: "normal",
|
||||
transitionEffect: null,
|
||||
isBaseLayer: false,
|
||||
className: "nofade"
|
||||
transitionEffect: 'map-resize'
|
||||
},
|
||||
defaults));
|
||||
map.addLayers([fmzk, aerial, labels]);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" debug="true">
|
||||
<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">
|
||||
@@ -7,41 +7,61 @@
|
||||
<title>MousePosition Control</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="../lib/OpenLayers.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
var map;
|
||||
function init(){
|
||||
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",
|
||||
{layers: 'basic'} );
|
||||
|
||||
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);
|
||||
OpenLayers.Util.getElement("coords").innerHTML = position;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="init()">
|
||||
<body onload="init();">
|
||||
<h1 id="title">MousePosition Control</h1>
|
||||
<div id="tags">
|
||||
coordinate
|
||||
coordinate
|
||||
</div>
|
||||
<p id="shortdesc">
|
||||
Use the MousePosition Control to display the coordinates of the cursor
|
||||
inside or outside the map div.
|
||||
</p>
|
||||
<div id="map" class="smallmap"></div>
|
||||
<div id="coords"></div>
|
||||
<p>Moving your mouse to the upper left corner of this map should return
|
||||
'x=0,y=0' -- in the past, it didn't in IE. If it returns 2,2, consider it a
|
||||
bug, and report it.</p>
|
||||
<div id="coords" style="height: 1.5em;"></div>
|
||||
<p>
|
||||
This example also shows how to use the the "prefix", "separator" and
|
||||
"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>
|
||||
</html>
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
<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="../theme/default/google.css" type="text/css">
|
||||
<link rel="stylesheet" href="style.css" type="text/css">
|
||||
<script src="http://maps.google.com/maps/api/js?v=3&sensor=false"></script>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
|
||||
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);
|
||||
}
|
||||
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;
|
||||
}
|
||||
@@ -17,6 +17,10 @@
|
||||
right: inherit;
|
||||
width: 400px;
|
||||
}
|
||||
/* conditionally position control differently for Google Maps */
|
||||
.olForeignContainer div.olControlMousePosition {
|
||||
bottom: 28px;
|
||||
}
|
||||
#map {
|
||||
height: 512px;
|
||||
}
|
||||
@@ -38,7 +42,12 @@
|
||||
</p>
|
||||
<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">
|
||||
|
||||
var map = new OpenLayers.Map({
|
||||
|
||||
@@ -37,10 +37,8 @@
|
||||
function init() {
|
||||
map = new OpenLayers.Map('map');
|
||||
var base = new OpenLayers.Layer.WMS("OpenLayers WMS",
|
||||
["http://t3.tilecache.osgeo.org/wms-c/Basic.py",
|
||||
"http://t2.tilecache.osgeo.org/wms-c/Basic.py",
|
||||
"http://t1.tilecache.osgeo.org/wms-c/Basic.py"],
|
||||
{layers: 'satellite'}
|
||||
"http://vmap0.tiles.osgeo.org/wms/vmap0",
|
||||
{layers: 'basic'}
|
||||
);
|
||||
|
||||
var style = new OpenLayers.Style({
|
||||
|
||||
@@ -87,8 +87,9 @@
|
||||
gml3: new OpenLayers.Format.GML.v3(gmlOptionsIn),
|
||||
kml: new OpenLayers.Format.KML(kmlOptionsIn),
|
||||
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': {
|
||||
wkt: new OpenLayers.Format.WKT(out_options),
|
||||
geojson: new OpenLayers.Format.GeoJSON(out_options),
|
||||
@@ -97,8 +98,9 @@
|
||||
gml3: new OpenLayers.Format.GML.v3(gmlOptionsOut),
|
||||
kml: new OpenLayers.Format.KML(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(){
|
||||
@@ -202,6 +204,7 @@
|
||||
<option value="gml3">GML (v3)</option>
|
||||
<option value="wkt">Well-Known Text (WKT)</option>
|
||||
<option value="gpx">GPX</option>
|
||||
<option value="encoded_polyline">Encoded Polyline</option>
|
||||
</select>
|
||||
|
||||
<label for="prettyPrint">Pretty print</label>
|
||||
|
||||
@@ -22,7 +22,8 @@
|
||||
<div id="docs">
|
||||
<p>
|
||||
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>
|
||||
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",
|
||||
{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", {
|
||||
minScale: 15000000,
|
||||
strategies: [new OpenLayers.Strategy.BBOX()],
|
||||
protocol: new OpenLayers.Protocol.WFS({
|
||||
url: "http://demo.opengeo.org/geoserver/wfs",
|
||||
|
||||
@@ -20,15 +20,15 @@
|
||||
<h1 id="title">Web Map Tile Service (WMTS) Capabilities Parsing</h1>
|
||||
<div id="tags">
|
||||
wmts, capabilities, getcapabilities
|
||||
</div>
|
||||
</div>
|
||||
<p id="shortdesc">
|
||||
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.
|
||||
</p>
|
||||
|
||||
|
||||
<div id="map" class="smallmap"></div>
|
||||
|
||||
|
||||
<div id="docs">
|
||||
<p>
|
||||
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;
|
||||
|
||||
function init() {
|
||||
|
||||
|
||||
format = new OpenLayers.Format.WMTSCapabilities({
|
||||
/**
|
||||
* This particular service is not in compliance with the WMTS spec and
|
||||
* 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
|
||||
* should be considered y, x order. These will extend the defaults on
|
||||
* 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
|
||||
* the format.
|
||||
*/
|
||||
yx: {
|
||||
@@ -38,22 +38,21 @@ function init() {
|
||||
isBaseLayer: false
|
||||
});
|
||||
map.addLayer(layer);
|
||||
},
|
||||
},
|
||||
failure: function() {
|
||||
alert("Trouble getting capabilities doc");
|
||||
OpenLayers.Console.error.apply(OpenLayers.Console, arguments);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
map = new OpenLayers.Map({
|
||||
div: "map",
|
||||
projection: "EPSG:900913"
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
var osm = new OpenLayers.Layer.OSM();
|
||||
|
||||
map.addLayer(osm);
|
||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||
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);
|
||||
}
|
||||
});
|
||||
*/
|
||||
|
||||
}
|
||||
@@ -50,7 +50,9 @@
|
||||
<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.</p>
|
||||
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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
@@ -132,6 +132,7 @@
|
||||
jsFiles = [
|
||||
"OpenLayers/BaseTypes/Class.js",
|
||||
"OpenLayers/Util.js",
|
||||
"OpenLayers/Util/vendorPrefix.js",
|
||||
"OpenLayers/Animation.js",
|
||||
"OpenLayers/BaseTypes.js",
|
||||
"OpenLayers/BaseTypes/Bounds.js",
|
||||
@@ -143,8 +144,6 @@
|
||||
"OpenLayers/Console.js",
|
||||
"OpenLayers/Tween.js",
|
||||
"OpenLayers/Kinetic.js",
|
||||
"Rico/Corner.js",
|
||||
"Rico/Color.js",
|
||||
"OpenLayers/Events.js",
|
||||
"OpenLayers/Events/buttonclick.js",
|
||||
"OpenLayers/Request.js",
|
||||
@@ -190,7 +189,6 @@
|
||||
"OpenLayers/Layer/Zoomify.js",
|
||||
"OpenLayers/Layer/ArcGISCache.js",
|
||||
"OpenLayers/Popup/Anchored.js",
|
||||
"OpenLayers/Popup/AnchoredBubble.js",
|
||||
"OpenLayers/Popup/Framed.js",
|
||||
"OpenLayers/Popup/FramedCloud.js",
|
||||
"OpenLayers/Feature.js",
|
||||
@@ -305,6 +303,7 @@
|
||||
"OpenLayers/Format/GML/v2.js",
|
||||
"OpenLayers/Format/GML/v3.js",
|
||||
"OpenLayers/Format/Atom.js",
|
||||
"OpenLayers/Format/EncodedPolyline.js",
|
||||
"OpenLayers/Format/KML.js",
|
||||
"OpenLayers/Format/GeoRSS.js",
|
||||
"OpenLayers/Format/WFS.js",
|
||||
@@ -312,6 +311,10 @@
|
||||
"OpenLayers/Format/OWSCommon/v1.js",
|
||||
"OpenLayers/Format/OWSCommon/v1_0_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/v1.js",
|
||||
"OpenLayers/Format/WFSCapabilities/v1_0_0.js",
|
||||
@@ -393,7 +396,10 @@
|
||||
"OpenLayers/Symbolizer/Raster.js",
|
||||
"OpenLayers/Lang.js",
|
||||
"OpenLayers/Lang/en.js",
|
||||
"OpenLayers/Spherical.js"
|
||||
"OpenLayers/Spherical.js",
|
||||
"OpenLayers/TileManager.js",
|
||||
"OpenLayers/WPSClient.js",
|
||||
"OpenLayers/WPSProcess.js"
|
||||
]; // etc.
|
||||
}
|
||||
|
||||
@@ -413,5 +419,10 @@
|
||||
|
||||
/**
|
||||
* 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-rc7";
|
||||
OpenLayers.VERSION_NUMBER="Release 2.13-rc1";
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
/**
|
||||
* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license.
|
||||
*
|
||||
* full text of the license. */
|
||||
|
||||
/**
|
||||
* @requires OpenLayers/SingleFile.js
|
||||
* @requires OpenLayers/Util/vendorPrefix.js
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -19,11 +20,8 @@ OpenLayers.Animation = (function(window) {
|
||||
* Property: isNative
|
||||
* {Boolean} true if a native requestAnimationFrame function is available
|
||||
*/
|
||||
var isNative = !!(window.requestAnimationFrame ||
|
||||
window.webkitRequestAnimationFrame ||
|
||||
window.mozRequestAnimationFrame ||
|
||||
window.oRequestAnimationFrame ||
|
||||
window.msRequestAnimationFrame);
|
||||
var requestAnimationFrame = OpenLayers.Util.vendorPrefix.js(window, "requestAnimationFrame");
|
||||
var isNative = !!(requestAnimationFrame);
|
||||
|
||||
/**
|
||||
* Function: requestFrame
|
||||
@@ -36,11 +34,7 @@ OpenLayers.Animation = (function(window) {
|
||||
* element - {DOMElement} Optional element that visually bounds the animation.
|
||||
*/
|
||||
var requestFrame = (function() {
|
||||
var request = window.requestAnimationFrame ||
|
||||
window.webkitRequestAnimationFrame ||
|
||||
window.mozRequestAnimationFrame ||
|
||||
window.oRequestAnimationFrame ||
|
||||
window.msRequestAnimationFrame ||
|
||||
var request = window[requestAnimationFrame] ||
|
||||
function(callback, element) {
|
||||
window.setTimeout(callback, 16);
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
@@ -127,7 +127,9 @@ OpenLayers.String = {
|
||||
if (i == 0) {
|
||||
replacement = context;
|
||||
}
|
||||
|
||||
if (replacement === undefined) {
|
||||
break;
|
||||
}
|
||||
replacement = replacement[subs[i]];
|
||||
}
|
||||
|
||||
@@ -295,7 +297,25 @@ OpenLayers.Number = {
|
||||
str = integer + dsep + rem;
|
||||
}
|
||||
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,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* 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
|
||||
* calculations, this is assumed to be less than the right value.
|
||||
* 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.
|
||||
* top - {Number} The top bounds.
|
||||
*
|
||||
@@ -128,6 +128,7 @@ OpenLayers.Bounds = OpenLayers.Class({
|
||||
|
||||
/**
|
||||
* APIMethod: toString
|
||||
* Returns a string representation of the bounds object.
|
||||
*
|
||||
* Returns:
|
||||
* {String} String representation of bounds object.
|
||||
@@ -138,6 +139,11 @@ OpenLayers.Bounds = OpenLayers.Class({
|
||||
|
||||
/**
|
||||
* 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:
|
||||
* reverseAxisOrder - {Boolean} Should we reverse the axis order?
|
||||
@@ -155,6 +161,7 @@ OpenLayers.Bounds = OpenLayers.Class({
|
||||
|
||||
/**
|
||||
* APIMethod: toBBOX
|
||||
* Returns a boundingbox-string representation of the bounds object.
|
||||
*
|
||||
* Parameters:
|
||||
* decimal - {Integer} How many significant digits in the bbox coords?
|
||||
@@ -163,7 +170,7 @@ OpenLayers.Bounds = OpenLayers.Class({
|
||||
*
|
||||
* Returns:
|
||||
* {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) {
|
||||
if (decimal== null) {
|
||||
@@ -202,9 +209,10 @@ OpenLayers.Bounds = OpenLayers.Class({
|
||||
|
||||
/**
|
||||
* APIMethod: getWidth
|
||||
* Returns the width of the bounds.
|
||||
*
|
||||
* Returns:
|
||||
* {Float} The width of the bounds
|
||||
* {Float} The width of the bounds (right minus left).
|
||||
*/
|
||||
getWidth:function() {
|
||||
return (this.right - this.left);
|
||||
@@ -212,6 +220,7 @@ OpenLayers.Bounds = OpenLayers.Class({
|
||||
|
||||
/**
|
||||
* APIMethod: getHeight
|
||||
* Returns the height of the bounds.
|
||||
*
|
||||
* Returns:
|
||||
* {Float} The height of the bounds (top minus bottom).
|
||||
@@ -222,9 +231,10 @@ OpenLayers.Bounds = OpenLayers.Class({
|
||||
|
||||
/**
|
||||
* APIMethod: getSize
|
||||
* Returns an <OpenLayers.Size> object of the bounds.
|
||||
*
|
||||
* Returns:
|
||||
* {<OpenLayers.Size>} The size of the box.
|
||||
* {<OpenLayers.Size>} The size of the bounds.
|
||||
*/
|
||||
getSize:function() {
|
||||
return new OpenLayers.Size(this.getWidth(), this.getHeight());
|
||||
@@ -232,6 +242,8 @@ OpenLayers.Bounds = OpenLayers.Class({
|
||||
|
||||
/**
|
||||
* APIMethod: getCenterPixel
|
||||
* Returns the <OpenLayers.Pixel> object which represents the center of the
|
||||
* bounds.
|
||||
*
|
||||
* Returns:
|
||||
* {<OpenLayers.Pixel>} The center of the bounds in pixel space.
|
||||
@@ -243,7 +255,9 @@ OpenLayers.Bounds = OpenLayers.Class({
|
||||
|
||||
/**
|
||||
* APIMethod: getCenterLonLat
|
||||
*
|
||||
* Returns the <OpenLayers.LonLat> object which represents the center of the
|
||||
* bounds.
|
||||
*
|
||||
* Returns:
|
||||
* {<OpenLayers.LonLat>} The center of the bounds in map space.
|
||||
*/
|
||||
@@ -297,11 +311,24 @@ OpenLayers.Bounds = OpenLayers.Class({
|
||||
|
||||
/**
|
||||
* 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:
|
||||
* x - {Float}
|
||||
* y - {Float}
|
||||
*
|
||||
* x - {Float} horizontal delta
|
||||
* y - {Float} vertical delta
|
||||
*
|
||||
* Returns:
|
||||
* {<OpenLayers.Bounds>} A new bounds whose coordinates are the same as
|
||||
* this, but shifted by the passed-in x and y values.
|
||||
@@ -316,51 +343,77 @@ OpenLayers.Bounds = OpenLayers.Class({
|
||||
|
||||
/**
|
||||
* APIMethod: extend
|
||||
* Extend the bounds to include the point, lonlat, or bounds specified.
|
||||
* Note, this function assumes that left < right and bottom < top.
|
||||
*
|
||||
* Parameters:
|
||||
* object - {Object} Can be LonLat, Point, or Bounds
|
||||
* Extend the bounds to include the <OpenLayers.LonLat>,
|
||||
* <OpenLayers.Geometry.Point> or <OpenLayers.Bounds> specified.
|
||||
*
|
||||
* Please note that this function assumes that left < right and
|
||||
* 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) {
|
||||
var bounds = null;
|
||||
if (object) {
|
||||
// clear cached center location
|
||||
switch(object.CLASS_NAME) {
|
||||
case "OpenLayers.LonLat":
|
||||
bounds = new OpenLayers.Bounds(object.lon, object.lat,
|
||||
object.lon, object.lat);
|
||||
case "OpenLayers.LonLat":
|
||||
this.extendXY(object.lon, object.lat);
|
||||
break;
|
||||
case "OpenLayers.Geometry.Point":
|
||||
bounds = new OpenLayers.Bounds(object.x, object.y,
|
||||
object.x, object.y);
|
||||
this.extendXY(object.x, object.y);
|
||||
break;
|
||||
|
||||
case "OpenLayers.Bounds":
|
||||
bounds = object;
|
||||
|
||||
case "OpenLayers.Bounds":
|
||||
// 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;
|
||||
}
|
||||
|
||||
if (bounds) {
|
||||
this.centerLonLat = null;
|
||||
if ( (this.left == null) || (bounds.left < this.left)) {
|
||||
this.left = bounds.left;
|
||||
}
|
||||
if ( (this.bottom == null) || (bounds.bottom < this.bottom) ) {
|
||||
this.bottom = bounds.bottom;
|
||||
}
|
||||
if ( (this.right == null) || (bounds.right > this.right) ) {
|
||||
this.right = bounds.right;
|
||||
}
|
||||
if ( (this.top == null) || (bounds.top > this.top) ) {
|
||||
this.top = bounds.top;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* APIMethod: extendXY
|
||||
* Extend the bounds to include the XY coordinate specified.
|
||||
*
|
||||
* Parameters:
|
||||
* x - {number} The X part of the the coordinate.
|
||||
* y - {number} The Y part of the the coordinate.
|
||||
*/
|
||||
extendXY:function(x, y) {
|
||||
// clear cached center location
|
||||
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
|
||||
* Returns whether the bounds object contains the given <OpenLayers.LonLat>.
|
||||
*
|
||||
* Parameters:
|
||||
* ll - {<OpenLayers.LonLat>|Object} OpenLayers.LonLat or an
|
||||
@@ -399,6 +452,7 @@ OpenLayers.Bounds = OpenLayers.Class({
|
||||
|
||||
/**
|
||||
* APIMethod: containsPixel
|
||||
* Returns whether the bounds object contains the given <OpenLayers.Pixel>.
|
||||
*
|
||||
* Parameters:
|
||||
* px - {<OpenLayers.Pixel>}
|
||||
@@ -414,6 +468,7 @@ OpenLayers.Bounds = OpenLayers.Class({
|
||||
|
||||
/**
|
||||
* APIMethod: contains
|
||||
* Returns whether the bounds object contains the given x and y.
|
||||
*
|
||||
* Parameters:
|
||||
* x - {Float}
|
||||
@@ -535,7 +590,7 @@ OpenLayers.Bounds = OpenLayers.Class({
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* partial - {Boolean} If any of the target corners is within this bounds
|
||||
@@ -565,10 +620,12 @@ OpenLayers.Bounds = OpenLayers.Class({
|
||||
|
||||
/**
|
||||
* APIMethod: determineQuadrant
|
||||
*
|
||||
* Returns the the quadrant ("br", "tr", "tl", "bl") in which the given
|
||||
* <OpenLayers.LonLat> lies.
|
||||
*
|
||||
* Parameters:
|
||||
* lonlat - {<OpenLayers.LonLat>}
|
||||
*
|
||||
*
|
||||
* Returns:
|
||||
* {String} The quadrant ("br" "tr" "tl" "bl") of the bounds in which the
|
||||
* coordinate lies.
|
||||
@@ -615,6 +672,7 @@ OpenLayers.Bounds = OpenLayers.Class({
|
||||
|
||||
/**
|
||||
* APIMethod: wrapDateLine
|
||||
* Wraps the bounds object around the dateline.
|
||||
*
|
||||
* Parameters:
|
||||
* maxExtent - {<OpenLayers.Bounds>}
|
||||
@@ -681,12 +739,18 @@ OpenLayers.Bounds = OpenLayers.Class({
|
||||
/**
|
||||
* APIFunction: fromString
|
||||
* 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:
|
||||
* 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?
|
||||
*
|
||||
*
|
||||
* Returns:
|
||||
* {<OpenLayers.Bounds>} New bounds object built from the
|
||||
* passed-in String.
|
||||
@@ -698,11 +762,16 @@ OpenLayers.Bounds.fromString = function(str, reverseAxisOrder) {
|
||||
|
||||
/**
|
||||
* APIFunction: fromArray
|
||||
* Alternative constructor that builds a new OpenLayers.Bounds
|
||||
* from an array
|
||||
*
|
||||
* Alternative constructor that builds a new OpenLayers.Bounds from an array.
|
||||
*
|
||||
* (begin code)
|
||||
* OpenLayers.Bounds.fromArray( [5, 42, 10, 45] );
|
||||
* // => equivalent to ...
|
||||
* new OpenLayers.Bounds(5, 42, 10, 45);
|
||||
* (end)
|
||||
*
|
||||
* 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?
|
||||
*
|
||||
* Returns:
|
||||
@@ -716,12 +785,17 @@ OpenLayers.Bounds.fromArray = function(bbox, reverseAxisOrder) {
|
||||
|
||||
/**
|
||||
* APIFunction: fromSize
|
||||
* Alternative constructor that builds a new OpenLayers.Bounds
|
||||
* from a size
|
||||
*
|
||||
* Alternative constructor that builds a new OpenLayers.Bounds from a size.
|
||||
*
|
||||
* (begin code)
|
||||
* OpenLayers.Bounds.fromSize( new OpenLayers.Size(10, 20) );
|
||||
* // => equivalent to ...
|
||||
* new OpenLayers.Bounds(0, 20, 10, 0);
|
||||
* (end)
|
||||
*
|
||||
* Parameters:
|
||||
* size - {<OpenLayers.Size>|Object} OpenLayers.Size or an object with
|
||||
* a 'w' and 'h' properties.
|
||||
* size - {<OpenLayers.Size> or Object} <OpenLayers.Size> or an object with
|
||||
* both 'w' and 'h' properties.
|
||||
*
|
||||
* Returns:
|
||||
* {<OpenLayers.Bounds>} New bounds object built from the passed-in size.
|
||||
@@ -737,6 +811,14 @@ OpenLayers.Bounds.fromSize = function(size) {
|
||||
* Function: oppositeQuadrant
|
||||
* Get the opposite quadrant for a given quadrant string.
|
||||
*
|
||||
* (begin code)
|
||||
* OpenLayers.Bounds.oppositeQuadrant( "tl" );
|
||||
* // => "br"
|
||||
*
|
||||
* OpenLayers.Bounds.oppositeQuadrant( "tr" );
|
||||
* // => "bl"
|
||||
* (end)
|
||||
*
|
||||
* Parameters:
|
||||
* quadrant - {String} two character quadrant shortstring
|
||||
*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
@@ -49,13 +49,6 @@ OpenLayers.Date = {
|
||||
return date.toISOString();
|
||||
};
|
||||
} else {
|
||||
function pad(num, len) {
|
||||
var str = num + "";
|
||||
while (str.length < len) {
|
||||
str = "0" + str;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
return function(date) {
|
||||
var str;
|
||||
if (isNaN(date.getTime())) {
|
||||
@@ -65,12 +58,12 @@ OpenLayers.Date = {
|
||||
} else {
|
||||
str =
|
||||
date.getUTCFullYear() + "-" +
|
||||
pad(date.getUTCMonth() + 1, 2) + "-" +
|
||||
pad(date.getUTCDate(), 2) + "T" +
|
||||
pad(date.getUTCHours(), 2) + ":" +
|
||||
pad(date.getUTCMinutes(), 2) + ":" +
|
||||
pad(date.getUTCSeconds(), 2) + "." +
|
||||
pad(date.getUTCMilliseconds(), 3) + "Z";
|
||||
OpenLayers.Number.zeroPad(date.getUTCMonth() + 1, 2) + "-" +
|
||||
OpenLayers.Number.zeroPad(date.getUTCDate(), 2) + "T" +
|
||||
OpenLayers.Number.zeroPad(date.getUTCHours(), 2) + ":" +
|
||||
OpenLayers.Number.zeroPad(date.getUTCMinutes(), 2) + ":" +
|
||||
OpenLayers.Number.zeroPad(date.getUTCSeconds(), 2) + "." +
|
||||
OpenLayers.Number.zeroPad(date.getUTCMilliseconds(), 3) + "Z";
|
||||
}
|
||||
return str;
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
@@ -19,8 +19,8 @@ OpenLayers.Control.Attribution =
|
||||
OpenLayers.Class(OpenLayers.Control, {
|
||||
|
||||
/**
|
||||
* APIProperty: seperator
|
||||
* {String} String used to seperate layers.
|
||||
* APIProperty: separator
|
||||
* {String} String used to separate layers.
|
||||
*/
|
||||
separator: ", ",
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
@@ -111,7 +111,7 @@ OpenLayers.Control.CacheWrite = OpenLayers.Class(OpenLayers.Control, {
|
||||
addLayer: function(evt) {
|
||||
evt.layer.events.on({
|
||||
tileloadstart: this.makeSameOrigin,
|
||||
tileloaded: this.cache,
|
||||
tileloaded: this.onTileLoaded,
|
||||
scope: this
|
||||
});
|
||||
},
|
||||
@@ -128,7 +128,7 @@ OpenLayers.Control.CacheWrite = OpenLayers.Class(OpenLayers.Control, {
|
||||
removeLayer: function(evt) {
|
||||
evt.layer.events.un({
|
||||
tileloadstart: this.makeSameOrigin,
|
||||
tileloaded: this.cache,
|
||||
tileloaded: this.onTileLoaded,
|
||||
scope: this
|
||||
});
|
||||
},
|
||||
@@ -156,6 +156,22 @@ OpenLayers.Control.CacheWrite = OpenLayers.Class(OpenLayers.Control, {
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: onTileLoaded
|
||||
* Decides whether a tile can be cached and calls the cache method.
|
||||
*
|
||||
* Parameters:
|
||||
* evt - {Event}
|
||||
*/
|
||||
onTileLoaded: function(evt) {
|
||||
if (this.active && !evt.aborted &&
|
||||
evt.tile instanceof OpenLayers.Tile.Image &&
|
||||
evt.tile.url.substr(0, 5) !== 'data:') {
|
||||
this.cache({tile: evt.tile});
|
||||
delete OpenLayers.Control.CacheWrite.urlMap[evt.tile.url];
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: cache
|
||||
* Adds a tile to the cache. When the cache is full, the "cachefull" event
|
||||
@@ -166,29 +182,25 @@ OpenLayers.Control.CacheWrite = OpenLayers.Class(OpenLayers.Control, {
|
||||
* <OpenLayers.Tile.Image> with the data to add to the cache
|
||||
*/
|
||||
cache: function(obj) {
|
||||
if (this.active && window.localStorage) {
|
||||
if (window.localStorage) {
|
||||
var tile = obj.tile;
|
||||
if (tile instanceof OpenLayers.Tile.Image &&
|
||||
tile.url.substr(0, 5) !== 'data:') {
|
||||
try {
|
||||
var canvasContext = tile.getCanvasContext();
|
||||
if (canvasContext) {
|
||||
var urlMap = OpenLayers.Control.CacheWrite.urlMap;
|
||||
var url = urlMap[tile.url] || tile.url;
|
||||
window.localStorage.setItem(
|
||||
"olCache_" + url,
|
||||
canvasContext.canvas.toDataURL(this.imageFormat)
|
||||
);
|
||||
delete urlMap[tile.url];
|
||||
}
|
||||
} catch(e) {
|
||||
// local storage full or CORS violation
|
||||
var reason = e.name || e.message;
|
||||
if (reason && this.quotaRegEx.test(reason)) {
|
||||
this.events.triggerEvent("cachefull", {tile: tile});
|
||||
} else {
|
||||
OpenLayers.Console.error(e.toString());
|
||||
}
|
||||
try {
|
||||
var canvasContext = tile.getCanvasContext();
|
||||
if (canvasContext) {
|
||||
var urlMap = OpenLayers.Control.CacheWrite.urlMap;
|
||||
var url = urlMap[tile.url] || tile.url;
|
||||
window.localStorage.setItem(
|
||||
"olCache_" + url,
|
||||
canvasContext.canvas.toDataURL(this.imageFormat)
|
||||
);
|
||||
}
|
||||
} catch(e) {
|
||||
// local storage full or CORS violation
|
||||
var reason = e.name || e.message;
|
||||
if (reason && this.quotaRegEx.test(reason)) {
|
||||
this.events.triggerEvent("cachefull", {tile: tile});
|
||||
} else {
|
||||
OpenLayers.Console.error(e.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
@@ -56,11 +56,11 @@ OpenLayers.Control.DragPan = OpenLayers.Class(OpenLayers.Control, {
|
||||
* {Boolean} Set this option to enable "kinetic dragging". Can be
|
||||
* set to true or to an object. If set to an object this
|
||||
* object will be passed to the {<OpenLayers.Kinetic>}
|
||||
* constructor. Defaults to false.
|
||||
* If you set this property, you should ensure that
|
||||
* OpenLayers/Kinetic.js is included in your build config
|
||||
* constructor. Defaults to true.
|
||||
* To get kinetic dragging, ensure that OpenLayers/Kinetic.js is
|
||||
* included in your build config.
|
||||
*/
|
||||
enableKinetic: false,
|
||||
enableKinetic: true,
|
||||
|
||||
/**
|
||||
* APIProperty: kineticInterval
|
||||
@@ -77,7 +77,7 @@ OpenLayers.Control.DragPan = OpenLayers.Class(OpenLayers.Control, {
|
||||
* <panMapDone> as callbacks.
|
||||
*/
|
||||
draw: function() {
|
||||
if(this.enableKinetic) {
|
||||
if (this.enableKinetic && OpenLayers.Kinetic) {
|
||||
var config = {interval: this.kineticInterval};
|
||||
if(typeof this.enableKinetic === "object") {
|
||||
config = OpenLayers.Util.extend(config, this.enableKinetic);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
@@ -45,8 +45,15 @@ OpenLayers.Control.Geolocate = OpenLayers.Class(OpenLayers.Control, {
|
||||
/**
|
||||
* Property: geolocation
|
||||
* {Object} The geolocation engine, as a property to be possibly mocked.
|
||||
* This is set lazily to avoid a memory leak in IE9.
|
||||
*/
|
||||
geolocation: navigator.geolocation,
|
||||
geolocation: null,
|
||||
|
||||
/**
|
||||
* Property: available
|
||||
* {Boolean} The navigator.geolocation object is available.
|
||||
*/
|
||||
available: ('geolocation' in navigator),
|
||||
|
||||
/**
|
||||
* APIProperty: bind
|
||||
@@ -90,6 +97,10 @@ OpenLayers.Control.Geolocate = OpenLayers.Class(OpenLayers.Control, {
|
||||
* {Boolean} The control was effectively activated.
|
||||
*/
|
||||
activate: function () {
|
||||
if (this.available && !this.geolocation) {
|
||||
// set lazily to avoid IE9 memory leak
|
||||
this.geolocation = navigator.geolocation;
|
||||
}
|
||||
if (!this.geolocation) {
|
||||
this.events.triggerEvent("locationuncapable");
|
||||
return false;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
@@ -6,6 +6,7 @@
|
||||
/**
|
||||
* @requires OpenLayers/Control.js
|
||||
* @requires OpenLayers/Handler/Keyboard.js
|
||||
* @requires OpenLayers/Events.js
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -75,7 +76,16 @@ OpenLayers.Control.KeyboardDefaults = OpenLayers.Class(OpenLayers.Control, {
|
||||
*/
|
||||
defaultKeyPress: function (evt) {
|
||||
var size, handled = true;
|
||||
switch(evt.keyCode) {
|
||||
|
||||
var target = OpenLayers.Event.element(evt);
|
||||
if (target &&
|
||||
(target.tagName == 'INPUT' ||
|
||||
target.tagName == 'TEXTAREA' ||
|
||||
target.tagName == 'SELECT')) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (evt.keyCode) {
|
||||
case OpenLayers.Event.KEY_LEFT:
|
||||
this.map.pan(-this.slideFactor, 0);
|
||||
break;
|
||||
|
||||
@@ -1,49 +1,30 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
|
||||
/**
|
||||
/**
|
||||
* @requires OpenLayers/Control.js
|
||||
* @requires OpenLayers/Lang.js
|
||||
* @requires OpenLayers/Console.js
|
||||
* @requires OpenLayers/Util.js
|
||||
* @requires OpenLayers/Events/buttonclick.js
|
||||
*/
|
||||
|
||||
/**
|
||||
* Class: OpenLayers.Control.LayerSwitcher
|
||||
* The LayerSwitcher control displays a table of contents for the map. This
|
||||
* The LayerSwitcher control displays a table of contents for the map. This
|
||||
* allows the user interface to switch between BaseLasyers and to show or hide
|
||||
* Overlays. By default the switcher is shown minimized on the right edge of
|
||||
* Overlays. By default the switcher is shown minimized on the right edge of
|
||||
* the map, the user may expand it by clicking on the handle.
|
||||
*
|
||||
* To create the LayerSwitcher outside of the map, pass the Id of a html div
|
||||
* To create the LayerSwitcher outside of the map, pass the Id of a html div
|
||||
* as the first argument to the constructor.
|
||||
*
|
||||
*
|
||||
* Inherits from:
|
||||
* - <OpenLayers.Control>
|
||||
*/
|
||||
OpenLayers.Control.LayerSwitcher =
|
||||
OpenLayers.Class(OpenLayers.Control, {
|
||||
OpenLayers.Control.LayerSwitcher = OpenLayers.Class(OpenLayers.Control, {
|
||||
|
||||
/**
|
||||
* APIProperty: roundedCorner
|
||||
* {Boolean} If true the Rico library is used for rounding the corners
|
||||
* of the layer switcher div, defaults to false. *Deprecated*. Use
|
||||
* CSS3's border-radius instead. If this option is set to true the
|
||||
* Rico/Corner.js script must be loaded in the page, and therefore
|
||||
* listed in the build profile.
|
||||
*
|
||||
*/
|
||||
roundedCorner: false,
|
||||
|
||||
/**
|
||||
* APIProperty: roundedCornerColor
|
||||
* {String} The color of the rounded corners, only applies if roundedCorner
|
||||
* is true, defaults to "darkblue".
|
||||
*/
|
||||
roundedCornerColor: "darkblue",
|
||||
|
||||
/**
|
||||
* Property: layerStates
|
||||
* {Array(Object)} Basically a copy of the "state" of the map's layers
|
||||
@@ -51,90 +32,85 @@ OpenLayers.Control.LayerSwitcher =
|
||||
* unnecessarily redrawing the control.
|
||||
*/
|
||||
layerStates: null,
|
||||
|
||||
|
||||
// DOM Elements
|
||||
|
||||
|
||||
/**
|
||||
* Property: layersDiv
|
||||
* {DOMElement}
|
||||
* {DOMElement}
|
||||
*/
|
||||
layersDiv: null,
|
||||
|
||||
/**
|
||||
|
||||
/**
|
||||
* Property: baseLayersDiv
|
||||
* {DOMElement}
|
||||
*/
|
||||
baseLayersDiv: null,
|
||||
|
||||
/**
|
||||
/**
|
||||
* Property: baseLayers
|
||||
* {Array(Object)}
|
||||
*/
|
||||
baseLayers: null,
|
||||
|
||||
|
||||
/**
|
||||
|
||||
|
||||
/**
|
||||
* Property: dataLbl
|
||||
* {DOMElement}
|
||||
* {DOMElement}
|
||||
*/
|
||||
dataLbl: null,
|
||||
|
||||
/**
|
||||
|
||||
/**
|
||||
* Property: dataLayersDiv
|
||||
* {DOMElement}
|
||||
* {DOMElement}
|
||||
*/
|
||||
dataLayersDiv: null,
|
||||
|
||||
/**
|
||||
/**
|
||||
* Property: dataLayers
|
||||
* {Array(Object)}
|
||||
* {Array(Object)}
|
||||
*/
|
||||
dataLayers: null,
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Property: minimizeDiv
|
||||
* {DOMElement}
|
||||
* {DOMElement}
|
||||
*/
|
||||
minimizeDiv: null,
|
||||
|
||||
/**
|
||||
/**
|
||||
* Property: maximizeDiv
|
||||
* {DOMElement}
|
||||
* {DOMElement}
|
||||
*/
|
||||
maximizeDiv: null,
|
||||
|
||||
|
||||
/**
|
||||
* APIProperty: ascending
|
||||
* {Boolean}
|
||||
* {Boolean}
|
||||
*/
|
||||
ascending: true,
|
||||
|
||||
|
||||
/**
|
||||
* Constructor: OpenLayers.Control.LayerSwitcher
|
||||
*
|
||||
*
|
||||
* Parameters:
|
||||
* options - {Object}
|
||||
*/
|
||||
initialize: function(options) {
|
||||
OpenLayers.Control.prototype.initialize.apply(this, arguments);
|
||||
this.layerStates = [];
|
||||
|
||||
if(this.roundedCorner) {
|
||||
OpenLayers.Console.warn('roundedCorner option is deprecated');
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* APIMethod: destroy
|
||||
*/
|
||||
* APIMethod: destroy
|
||||
*/
|
||||
destroy: function() {
|
||||
|
||||
//clear out layers info and unregister their events
|
||||
|
||||
//clear out layers info and unregister their events
|
||||
this.clearLayersArray("base");
|
||||
this.clearLayersArray("data");
|
||||
|
||||
|
||||
this.map.events.un({
|
||||
buttonclick: this.onButtonClick,
|
||||
addlayer: this.redraw,
|
||||
@@ -144,15 +120,15 @@ OpenLayers.Control.LayerSwitcher =
|
||||
scope: this
|
||||
});
|
||||
this.events.unregister("buttonclick", this, this.onButtonClick);
|
||||
|
||||
|
||||
OpenLayers.Control.prototype.destroy.apply(this, arguments);
|
||||
},
|
||||
|
||||
/**
|
||||
/**
|
||||
* Method: setMap
|
||||
*
|
||||
* Properties:
|
||||
* map - {<OpenLayers.Map>}
|
||||
* map - {<OpenLayers.Map>}
|
||||
*/
|
||||
setMap: function(map) {
|
||||
OpenLayers.Control.prototype.setMap.apply(this, arguments);
|
||||
@@ -176,9 +152,9 @@ OpenLayers.Control.LayerSwitcher =
|
||||
* Method: draw
|
||||
*
|
||||
* Returns:
|
||||
* {DOMElement} A reference to the DIV DOMElement containing the
|
||||
* {DOMElement} A reference to the DIV DOMElement containing the
|
||||
* switcher tabs.
|
||||
*/
|
||||
*/
|
||||
draw: function() {
|
||||
OpenLayers.Control.prototype.draw.apply(this);
|
||||
|
||||
@@ -191,7 +167,7 @@ OpenLayers.Control.LayerSwitcher =
|
||||
}
|
||||
|
||||
// populate div with current info
|
||||
this.redraw();
|
||||
this.redraw();
|
||||
|
||||
return this.div;
|
||||
},
|
||||
@@ -224,13 +200,13 @@ OpenLayers.Control.LayerSwitcher =
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
/**
|
||||
* Method: clearLayersArray
|
||||
* User specifies either "base" or "data". we then clear all the
|
||||
* corresponding listeners, the div, and reinitialize a new array.
|
||||
*
|
||||
*
|
||||
* Parameters:
|
||||
* layersType - {String}
|
||||
* layersType - {String}
|
||||
*/
|
||||
clearLayersArray: function(layersType) {
|
||||
this[layersType + "LayersDiv"].innerHTML = "";
|
||||
@@ -241,54 +217,53 @@ OpenLayers.Control.LayerSwitcher =
|
||||
/**
|
||||
* Method: checkRedraw
|
||||
* Checks if the layer state has changed since the last redraw() call.
|
||||
*
|
||||
*
|
||||
* Returns:
|
||||
* {Boolean} The layer state changed since the last redraw() call.
|
||||
* {Boolean} The layer state changed since the last redraw() call.
|
||||
*/
|
||||
checkRedraw: function() {
|
||||
var redraw = false;
|
||||
if ( !this.layerStates.length ||
|
||||
(this.map.layers.length != this.layerStates.length) ) {
|
||||
redraw = true;
|
||||
} else {
|
||||
for (var i=0, len=this.layerStates.length; i<len; i++) {
|
||||
var layerState = this.layerStates[i];
|
||||
var layer = this.map.layers[i];
|
||||
if ( (layerState.name != layer.name) ||
|
||||
(layerState.inRange != layer.inRange) ||
|
||||
(layerState.id != layer.id) ||
|
||||
(layerState.visibility != layer.visibility) ) {
|
||||
redraw = true;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
for (var i = 0, len = this.layerStates.length; i < len; i++) {
|
||||
var layerState = this.layerStates[i];
|
||||
var layer = this.map.layers[i];
|
||||
if ( (layerState.name != layer.name) ||
|
||||
(layerState.inRange != layer.inRange) ||
|
||||
(layerState.id != layer.id) ||
|
||||
(layerState.visibility != layer.visibility) ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return redraw;
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
/**
|
||||
* Method: redraw
|
||||
* Goes through and takes the current state of the Map and rebuilds the
|
||||
* control to display that state. Groups base layers into a
|
||||
* control to display that state. Groups base layers into a
|
||||
* radio-button group and lists each data layer with a checkbox.
|
||||
*
|
||||
* Returns:
|
||||
* Returns:
|
||||
* {DOMElement} A reference to the DIV DOMElement containing the control
|
||||
*/
|
||||
*/
|
||||
redraw: function() {
|
||||
//if the state hasn't changed since last redraw, no need
|
||||
//if the state hasn't changed since last redraw, no need
|
||||
// to do anything. Just return the existing div.
|
||||
if (!this.checkRedraw()) {
|
||||
return this.div;
|
||||
}
|
||||
if (!this.checkRedraw()) {
|
||||
return this.div;
|
||||
}
|
||||
|
||||
//clear out previous layers
|
||||
//clear out previous layers
|
||||
this.clearLayersArray("base");
|
||||
this.clearLayersArray("data");
|
||||
|
||||
|
||||
var containsOverlays = false;
|
||||
var containsBaseLayers = false;
|
||||
|
||||
|
||||
// Save state -- for checking layer if the map state changed.
|
||||
// We save this before redrawing, because in the process of redrawing
|
||||
// we will trigger more visibility changes, and we want to not redraw
|
||||
@@ -298,12 +273,12 @@ OpenLayers.Control.LayerSwitcher =
|
||||
for (var i=0; i <len; i++) {
|
||||
var layer = this.map.layers[i];
|
||||
this.layerStates[i] = {
|
||||
'name': layer.name,
|
||||
'name': layer.name,
|
||||
'visibility': layer.visibility,
|
||||
'inRange': layer.inRange,
|
||||
'id': layer.id
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
var layers = this.map.layers.slice();
|
||||
if (!this.ascending) { layers.reverse(); }
|
||||
@@ -317,16 +292,22 @@ OpenLayers.Control.LayerSwitcher =
|
||||
containsBaseLayers = true;
|
||||
} else {
|
||||
containsOverlays = true;
|
||||
}
|
||||
}
|
||||
|
||||
// only check a baselayer if it is *the* baselayer, check data
|
||||
// layers if they are visible
|
||||
var checked = (baseLayer) ? (layer == this.map.baseLayer)
|
||||
: layer.getVisibility();
|
||||
|
||||
|
||||
// create input element
|
||||
var inputElem = document.createElement("input");
|
||||
inputElem.id = this.id + "_input_" + layer.name;
|
||||
var inputElem = document.createElement("input"),
|
||||
// The input shall have an id attribute so we can use
|
||||
// labels to interact with them.
|
||||
inputId = OpenLayers.Util.createUniqueID(
|
||||
this.id + "_input_"
|
||||
);
|
||||
|
||||
inputElem.id = inputId;
|
||||
inputElem.name = (baseLayer) ? this.id + "_baseLayers" : layer.name;
|
||||
inputElem.type = (baseLayer) ? "radio" : "checkbox";
|
||||
inputElem.value = layer.name;
|
||||
@@ -339,9 +320,11 @@ OpenLayers.Control.LayerSwitcher =
|
||||
if (!baseLayer && !layer.inRange) {
|
||||
inputElem.disabled = true;
|
||||
}
|
||||
|
||||
|
||||
// create span
|
||||
var labelSpan = document.createElement("label");
|
||||
// this isn't the DOM attribute 'for', but an arbitrary name we
|
||||
// use to find the appropriate input element in <onButtonClick>
|
||||
labelSpan["for"] = inputElem.id;
|
||||
OpenLayers.Element.addClass(labelSpan, "labelSpan olButton");
|
||||
labelSpan._layer = layer.id;
|
||||
@@ -350,12 +333,12 @@ OpenLayers.Control.LayerSwitcher =
|
||||
labelSpan.style.color = "gray";
|
||||
}
|
||||
labelSpan.innerHTML = layer.name;
|
||||
labelSpan.style.verticalAlign = (baseLayer) ? "bottom"
|
||||
labelSpan.style.verticalAlign = (baseLayer) ? "bottom"
|
||||
: "baseline";
|
||||
// create line break
|
||||
var br = document.createElement("br");
|
||||
|
||||
|
||||
|
||||
|
||||
var groupArray = (baseLayer) ? this.baseLayers
|
||||
: this.dataLayers;
|
||||
groupArray.push({
|
||||
@@ -363,8 +346,8 @@ OpenLayers.Control.LayerSwitcher =
|
||||
'inputElem': inputElem,
|
||||
'labelSpan': labelSpan
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
var groupDiv = (baseLayer) ? this.baseLayersDiv
|
||||
: this.dataLayersDiv;
|
||||
groupDiv.appendChild(inputElem);
|
||||
@@ -374,24 +357,24 @@ OpenLayers.Control.LayerSwitcher =
|
||||
}
|
||||
|
||||
// if no overlays, dont display the overlay label
|
||||
this.dataLbl.style.display = (containsOverlays) ? "" : "none";
|
||||
|
||||
this.dataLbl.style.display = (containsOverlays) ? "" : "none";
|
||||
|
||||
// if no baselayers, dont display the baselayer label
|
||||
this.baseLbl.style.display = (containsBaseLayers) ? "" : "none";
|
||||
this.baseLbl.style.display = (containsBaseLayers) ? "" : "none";
|
||||
|
||||
return this.div;
|
||||
},
|
||||
|
||||
/**
|
||||
/**
|
||||
* Method: updateMap
|
||||
* Cycles through the loaded data and base layer input arrays and makes
|
||||
* the necessary calls to the Map object such that that the map's
|
||||
* visual state corresponds to what the user has selected in
|
||||
* the necessary calls to the Map object such that that the map's
|
||||
* visual state corresponds to what the user has selected in
|
||||
* the control.
|
||||
*/
|
||||
updateMap: function() {
|
||||
|
||||
// set the newly selected base layer
|
||||
// set the newly selected base layer
|
||||
for(var i=0, len=this.baseLayers.length; i<len; i++) {
|
||||
var layerEntry = this.baseLayers[i];
|
||||
if (layerEntry.inputElem.checked) {
|
||||
@@ -401,18 +384,18 @@ OpenLayers.Control.LayerSwitcher =
|
||||
|
||||
// set the correct visibilities for the overlays
|
||||
for(var i=0, len=this.dataLayers.length; i<len; i++) {
|
||||
var layerEntry = this.dataLayers[i];
|
||||
var layerEntry = this.dataLayers[i];
|
||||
layerEntry.layer.setVisibility(layerEntry.inputElem.checked);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
/**
|
||||
* Method: maximizeControl
|
||||
* Set up the labels and divs for the control
|
||||
*
|
||||
*
|
||||
* Parameters:
|
||||
* e - {Event}
|
||||
* e - {Event}
|
||||
*/
|
||||
maximizeControl: function(e) {
|
||||
|
||||
@@ -424,17 +407,17 @@ OpenLayers.Control.LayerSwitcher =
|
||||
this.showControls(false);
|
||||
|
||||
if (e != null) {
|
||||
OpenLayers.Event.stop(e);
|
||||
OpenLayers.Event.stop(e);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
/**
|
||||
* Method: minimizeControl
|
||||
* Hide all the contents of the control, shrink the size,
|
||||
* Hide all the contents of the control, shrink the size,
|
||||
* add the maximize icon
|
||||
*
|
||||
* Parameters:
|
||||
* e - {Event}
|
||||
* e - {Event}
|
||||
*/
|
||||
minimizeControl: function(e) {
|
||||
|
||||
@@ -448,7 +431,7 @@ OpenLayers.Control.LayerSwitcher =
|
||||
this.showControls(true);
|
||||
|
||||
if (e != null) {
|
||||
OpenLayers.Event.stop(e);
|
||||
OpenLayers.Event.stop(e);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -456,7 +439,7 @@ OpenLayers.Control.LayerSwitcher =
|
||||
* Method: showControls
|
||||
* Hide/Show all LayerSwitcher controls depending on whether we are
|
||||
* minimized or not
|
||||
*
|
||||
*
|
||||
* Parameters:
|
||||
* minimize - {Boolean}
|
||||
*/
|
||||
@@ -467,14 +450,14 @@ OpenLayers.Control.LayerSwitcher =
|
||||
|
||||
this.layersDiv.style.display = minimize ? "none" : "";
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
/**
|
||||
* Method: loadContents
|
||||
* Set up the labels and divs for the control
|
||||
*/
|
||||
loadContents: function() {
|
||||
|
||||
// layers list div
|
||||
// layers list div
|
||||
this.layersDiv = document.createElement("div");
|
||||
this.layersDiv.id = this.id + "_layersDiv";
|
||||
OpenLayers.Element.addClass(this.layersDiv, "layersDiv");
|
||||
@@ -482,14 +465,14 @@ OpenLayers.Control.LayerSwitcher =
|
||||
this.baseLbl = document.createElement("div");
|
||||
this.baseLbl.innerHTML = OpenLayers.i18n("Base Layer");
|
||||
OpenLayers.Element.addClass(this.baseLbl, "baseLbl");
|
||||
|
||||
|
||||
this.baseLayersDiv = document.createElement("div");
|
||||
OpenLayers.Element.addClass(this.baseLayersDiv, "baseLayersDiv");
|
||||
|
||||
this.dataLbl = document.createElement("div");
|
||||
this.dataLbl.innerHTML = OpenLayers.i18n("Overlays");
|
||||
OpenLayers.Element.addClass(this.dataLbl, "dataLbl");
|
||||
|
||||
|
||||
this.dataLayersDiv = document.createElement("div");
|
||||
OpenLayers.Element.addClass(this.dataLayersDiv, "dataLayersDiv");
|
||||
|
||||
@@ -503,46 +486,36 @@ OpenLayers.Control.LayerSwitcher =
|
||||
this.layersDiv.appendChild(this.dataLayersDiv);
|
||||
this.layersDiv.appendChild(this.baseLbl);
|
||||
this.layersDiv.appendChild(this.baseLayersDiv);
|
||||
}
|
||||
|
||||
this.div.appendChild(this.layersDiv);
|
||||
|
||||
if(this.roundedCorner) {
|
||||
OpenLayers.Rico.Corner.round(this.div, {
|
||||
corners: "tl bl",
|
||||
bgColor: "transparent",
|
||||
color: this.roundedCornerColor,
|
||||
blend: false
|
||||
});
|
||||
OpenLayers.Rico.Corner.changeOpacity(this.layersDiv, 0.75);
|
||||
}
|
||||
|
||||
this.div.appendChild(this.layersDiv);
|
||||
|
||||
// maximize button div
|
||||
var img = OpenLayers.Util.getImageLocation('layer-switcher-maximize.png');
|
||||
this.maximizeDiv = OpenLayers.Util.createAlphaImageDiv(
|
||||
"OpenLayers_Control_MaximizeDiv",
|
||||
null,
|
||||
null,
|
||||
img,
|
||||
"OpenLayers_Control_MaximizeDiv",
|
||||
null,
|
||||
null,
|
||||
img,
|
||||
"absolute");
|
||||
OpenLayers.Element.addClass(this.maximizeDiv, "maximizeDiv olButton");
|
||||
this.maximizeDiv.style.display = "none";
|
||||
|
||||
|
||||
this.div.appendChild(this.maximizeDiv);
|
||||
|
||||
// minimize button div
|
||||
var img = OpenLayers.Util.getImageLocation('layer-switcher-minimize.png');
|
||||
this.minimizeDiv = OpenLayers.Util.createAlphaImageDiv(
|
||||
"OpenLayers_Control_MinimizeDiv",
|
||||
null,
|
||||
null,
|
||||
img,
|
||||
"OpenLayers_Control_MinimizeDiv",
|
||||
null,
|
||||
null,
|
||||
img,
|
||||
"absolute");
|
||||
OpenLayers.Element.addClass(this.minimizeDiv, "minimizeDiv olButton");
|
||||
this.minimizeDiv.style.display = "none";
|
||||
|
||||
this.div.appendChild(this.minimizeDiv);
|
||||
},
|
||||
|
||||
|
||||
CLASS_NAME: "OpenLayers.Control.LayerSwitcher"
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
OpenLayers.Control.Measure = OpenLayers.Class(OpenLayers.Control, {
|
||||
|
||||
/**
|
||||
/**
|
||||
* APIProperty: events
|
||||
* {<OpenLayers.Events>} Events instance for listeners and triggering
|
||||
* control specific events.
|
||||
@@ -41,28 +41,28 @@ OpenLayers.Control.Measure = OpenLayers.Class(OpenLayers.Control, {
|
||||
* APIProperty: handlerOptions
|
||||
* {Object} Used to set non-default properties on the control's handler
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Property: callbacks
|
||||
* {Object} The functions that are sent to the handler for callback
|
||||
*/
|
||||
callbacks: null,
|
||||
|
||||
|
||||
/**
|
||||
* Property: displaySystem
|
||||
* APIProperty: displaySystem
|
||||
* {String} Display system for output measurements. Supported values
|
||||
* are 'english', 'metric', and 'geographic'. Default is 'metric'.
|
||||
*/
|
||||
displaySystem: 'metric',
|
||||
|
||||
|
||||
/**
|
||||
* Property: geodesic
|
||||
* APIProperty: geodesic
|
||||
* {Boolean} Calculate geodesic metrics instead of planar metrics. This
|
||||
* requires that geometries can be transformed into Geographic/WGS84
|
||||
* (if that is not already the map projection). Default is false.
|
||||
*/
|
||||
geodesic: false,
|
||||
|
||||
|
||||
/**
|
||||
* Property: displaySystemUnits
|
||||
* {Object} Units for various measurement systems. Values are arrays
|
||||
@@ -111,10 +111,10 @@ OpenLayers.Control.Measure = OpenLayers.Class(OpenLayers.Control, {
|
||||
|
||||
/**
|
||||
* Constructor: OpenLayers.Control.Measure
|
||||
*
|
||||
*
|
||||
* Parameters:
|
||||
* handler - {<OpenLayers.Handler>}
|
||||
* options - {Object}
|
||||
* handler - {<OpenLayers.Handler>}
|
||||
* options - {Object}
|
||||
*/
|
||||
initialize: function(handler, options) {
|
||||
OpenLayers.Control.prototype.initialize.apply(this, [options]);
|
||||
@@ -125,14 +125,14 @@ OpenLayers.Control.Measure = OpenLayers.Class(OpenLayers.Control, {
|
||||
}
|
||||
this.callbacks = OpenLayers.Util.extend(callbacks, this.callbacks);
|
||||
|
||||
// let the handler options override, so old code that passes 'persist'
|
||||
// let the handler options override, so old code that passes 'persist'
|
||||
// directly to the handler does not need an update
|
||||
this.handlerOptions = OpenLayers.Util.extend(
|
||||
{persist: this.persist}, this.handlerOptions
|
||||
);
|
||||
this.handler = new handler(this, this.callbacks, this.handlerOptions);
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* APIMethod: deactivate
|
||||
*/
|
||||
@@ -164,7 +164,7 @@ OpenLayers.Control.Measure = OpenLayers.Class(OpenLayers.Control, {
|
||||
delete this.callbacks.modify;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Method: updateHandler
|
||||
*
|
||||
@@ -194,7 +194,7 @@ OpenLayers.Control.Measure = OpenLayers.Class(OpenLayers.Control, {
|
||||
this.cancelDelay();
|
||||
this.measure(geometry, "measure");
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Method: measurePartial
|
||||
* Called each time a new point is added to the measurement sketch.
|
||||
@@ -225,9 +225,11 @@ OpenLayers.Control.Measure = OpenLayers.Class(OpenLayers.Control, {
|
||||
/**
|
||||
* Method: measureImmediate
|
||||
* Called each time the measurement sketch is modified.
|
||||
*
|
||||
* Parameters: point - {<OpenLayers.Geometry.Point>} The point at the
|
||||
* mouseposition. feature - {<OpenLayers.Feature.Vector>} The sketch feature.
|
||||
*
|
||||
* Parameters:
|
||||
* point - {<OpenLayers.Geometry.Point>} The point at the mouse position.
|
||||
* feature - {<OpenLayers.Feature.Vector>} The sketch feature.
|
||||
* drawing - {Boolean} Indicates whether we're currently drawing.
|
||||
*/
|
||||
measureImmediate : function(point, feature, drawing) {
|
||||
if (drawing && !this.handler.freehandMode(this.handler.evt)) {
|
||||
@@ -270,7 +272,7 @@ OpenLayers.Control.Measure = OpenLayers.Class(OpenLayers.Control, {
|
||||
geometry: geometry
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Method: getBestArea
|
||||
* Based on the <displaySystem> returns the area of a geometry.
|
||||
@@ -294,7 +296,7 @@ OpenLayers.Control.Measure = OpenLayers.Class(OpenLayers.Control, {
|
||||
}
|
||||
return [area, unit];
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Method: getArea
|
||||
*
|
||||
@@ -321,7 +323,7 @@ OpenLayers.Control.Measure = OpenLayers.Class(OpenLayers.Control, {
|
||||
}
|
||||
return area;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Method: getBestLength
|
||||
* Based on the <displaySystem> returns the length of a geometry.
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
|
||||
/**
|
||||
* @requires OpenLayers/Control/DragFeature.js
|
||||
* @requires OpenLayers/Control/SelectFeature.js
|
||||
* @requires OpenLayers/Handler/Drag.js
|
||||
* @requires OpenLayers/Handler/Keyboard.js
|
||||
*/
|
||||
|
||||
@@ -22,6 +21,13 @@
|
||||
*/
|
||||
OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
|
||||
/**
|
||||
* APIProperty: documentDrag
|
||||
* {Boolean} If set to true, dragging vertices will continue even if the
|
||||
* mouse cursor leaves the map viewport. Default is false.
|
||||
*/
|
||||
documentDrag: false,
|
||||
|
||||
/**
|
||||
* APIProperty: geometryTypes
|
||||
* {Array(String)} To restrict modification to a limited set of geometry
|
||||
@@ -43,7 +49,7 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
* Default is true.
|
||||
*/
|
||||
toggle: true,
|
||||
|
||||
|
||||
/**
|
||||
* APIProperty: standalone
|
||||
* {Boolean} Set to true to create a control without SelectFeature
|
||||
@@ -60,20 +66,26 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
* {<OpenLayers.Layer.Vector>}
|
||||
*/
|
||||
layer: null,
|
||||
|
||||
|
||||
/**
|
||||
* Property: feature
|
||||
* {<OpenLayers.Feature.Vector>} Feature currently available for modification.
|
||||
*/
|
||||
feature: null,
|
||||
|
||||
|
||||
/**
|
||||
* Property: vertex
|
||||
* {<OpenLayers.Feature.Vector>} Vertex currently being modified.
|
||||
*/
|
||||
vertex: null,
|
||||
|
||||
/**
|
||||
* Property: vertices
|
||||
* {Array(<OpenLayers.Feature.Vector>)} Verticies currently available
|
||||
* for dragging.
|
||||
*/
|
||||
vertices: null,
|
||||
|
||||
|
||||
/**
|
||||
* Property: virtualVertices
|
||||
* {Array(<OpenLayers.Feature.Vector>)} Virtual vertices in the middle
|
||||
@@ -81,24 +93,12 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
*/
|
||||
virtualVertices: null,
|
||||
|
||||
/**
|
||||
* Property: selectControl
|
||||
* {<OpenLayers.Control.SelectFeature>}
|
||||
*/
|
||||
selectControl: null,
|
||||
|
||||
/**
|
||||
* Property: dragControl
|
||||
* {<OpenLayers.Control.DragFeature>}
|
||||
*/
|
||||
dragControl: null,
|
||||
|
||||
/**
|
||||
* Property: handlers
|
||||
* {Object}
|
||||
*/
|
||||
handlers: null,
|
||||
|
||||
|
||||
/**
|
||||
* APIProperty: deleteCodes
|
||||
* {Array(Integer)} Keycodes for deleting verticies. Set to null to disable
|
||||
@@ -113,7 +113,7 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
* {Object} A symbolizer to be used for virtual vertices.
|
||||
*/
|
||||
virtualStyle: null,
|
||||
|
||||
|
||||
/**
|
||||
* APIProperty: vertexRenderIntent
|
||||
* {String} The renderIntent to use for vertices. If no <virtualStyle> is
|
||||
@@ -225,63 +225,50 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
if(!(OpenLayers.Util.isArray(this.deleteCodes))) {
|
||||
this.deleteCodes = [this.deleteCodes];
|
||||
}
|
||||
var control = this;
|
||||
|
||||
// configure the select control
|
||||
var selectOptions = {
|
||||
geometryTypes: this.geometryTypes,
|
||||
clickout: this.clickout,
|
||||
toggle: this.toggle,
|
||||
onBeforeSelect: this.beforeSelectFeature,
|
||||
onSelect: this.selectFeature,
|
||||
onUnselect: this.unselectFeature,
|
||||
scope: this
|
||||
};
|
||||
if(this.standalone === false) {
|
||||
this.selectControl = new OpenLayers.Control.SelectFeature(
|
||||
layer, selectOptions
|
||||
);
|
||||
}
|
||||
|
||||
// configure the drag control
|
||||
var dragOptions = {
|
||||
geometryTypes: ["OpenLayers.Geometry.Point"],
|
||||
onStart: function(feature, pixel) {
|
||||
control.dragStart.apply(control, [feature, pixel]);
|
||||
|
||||
// configure the drag handler
|
||||
var dragCallbacks = {
|
||||
down: function(pixel) {
|
||||
this.vertex = null;
|
||||
var feature = this.layer.getFeatureFromEvent(
|
||||
this.handlers.drag.evt);
|
||||
if (feature) {
|
||||
this.dragStart(feature);
|
||||
} else if (this.feature && this.clickout) {
|
||||
this.unselectFeature(this.feature);
|
||||
}
|
||||
},
|
||||
onDrag: function(feature, pixel) {
|
||||
control.dragVertex.apply(control, [feature, pixel]);
|
||||
move: function(pixel) {
|
||||
delete this._unselect;
|
||||
if (this.vertex) {
|
||||
this.dragVertex(this.vertex, pixel);
|
||||
}
|
||||
},
|
||||
onComplete: function(feature) {
|
||||
control.dragComplete.apply(control, [feature]);
|
||||
up: function() {
|
||||
this.handlers.drag.stopDown = false;
|
||||
if (this._unselect) {
|
||||
this.unselectFeature(this._unselect);
|
||||
delete this._unselect;
|
||||
}
|
||||
},
|
||||
featureCallbacks: {
|
||||
over: function(feature) {
|
||||
/**
|
||||
* In normal mode, the feature handler is set up to allow
|
||||
* dragging of all points. In standalone mode, we only
|
||||
* want to allow dragging of sketch vertices and virtual
|
||||
* vertices - or, in the case of a modifiable point, the
|
||||
* point itself.
|
||||
*/
|
||||
if(control.standalone !== true || feature._sketch ||
|
||||
control.feature === feature) {
|
||||
control.dragControl.overFeature.apply(
|
||||
control.dragControl, [feature]);
|
||||
}
|
||||
done: function(pixel) {
|
||||
if (this.vertex) {
|
||||
this.dragComplete(this.vertex);
|
||||
}
|
||||
}
|
||||
};
|
||||
this.dragControl = new OpenLayers.Control.DragFeature(
|
||||
layer, dragOptions
|
||||
);
|
||||
var dragOptions = {
|
||||
documentDrag: this.documentDrag,
|
||||
stopDown: false
|
||||
};
|
||||
|
||||
// configure the keyboard handler
|
||||
var keyboardOptions = {
|
||||
keydown: this.handleKeypress
|
||||
};
|
||||
this.handlers = {
|
||||
keyboard: new OpenLayers.Handler.Keyboard(this, keyboardOptions)
|
||||
keyboard: new OpenLayers.Handler.Keyboard(this, keyboardOptions),
|
||||
drag: new OpenLayers.Handler.Drag(this, dragCallbacks, dragOptions)
|
||||
};
|
||||
},
|
||||
|
||||
@@ -290,9 +277,14 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
* Take care of things that are not handled in superclass.
|
||||
*/
|
||||
destroy: function() {
|
||||
if (this.map) {
|
||||
this.map.events.un({
|
||||
"removelayer": this.handleMapEvents,
|
||||
"changelayer": this.handleMapEvents,
|
||||
scope: this
|
||||
});
|
||||
}
|
||||
this.layer = null;
|
||||
this.standalone || this.selectControl.destroy();
|
||||
this.dragControl.destroy();
|
||||
OpenLayers.Control.prototype.destroy.apply(this, []);
|
||||
},
|
||||
|
||||
@@ -304,8 +296,14 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
* {Boolean} Successfully activated the control.
|
||||
*/
|
||||
activate: function() {
|
||||
return ((this.standalone || this.selectControl.activate()) &&
|
||||
this.handlers.keyboard.activate() &&
|
||||
this.moveLayerToTop();
|
||||
this.map.events.on({
|
||||
"removelayer": this.handleMapEvents,
|
||||
"changelayer": this.handleMapEvents,
|
||||
scope: this
|
||||
});
|
||||
return (this.handlers.keyboard.activate() &&
|
||||
this.handlers.drag.activate() &&
|
||||
OpenLayers.Control.prototype.activate.apply(this, arguments));
|
||||
},
|
||||
|
||||
@@ -320,29 +318,26 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
var deactivated = false;
|
||||
// the return from the controls is unimportant in this case
|
||||
if(OpenLayers.Control.prototype.deactivate.apply(this, arguments)) {
|
||||
this.moveLayerBack();
|
||||
this.map.events.un({
|
||||
"removelayer": this.handleMapEvents,
|
||||
"changelayer": this.handleMapEvents,
|
||||
scope: this
|
||||
});
|
||||
this.layer.removeFeatures(this.vertices, {silent: true});
|
||||
this.layer.removeFeatures(this.virtualVertices, {silent: true});
|
||||
this.vertices = [];
|
||||
this.dragControl.deactivate();
|
||||
var feature = this.feature;
|
||||
var valid = feature && feature.geometry && feature.layer;
|
||||
if(this.standalone === false) {
|
||||
if(valid) {
|
||||
this.selectControl.unselect.apply(this.selectControl,
|
||||
[feature]);
|
||||
}
|
||||
this.selectControl.deactivate();
|
||||
} else {
|
||||
if(valid) {
|
||||
this.unselectFeature(feature);
|
||||
}
|
||||
}
|
||||
this.handlers.drag.deactivate();
|
||||
this.handlers.keyboard.deactivate();
|
||||
var feature = this.feature;
|
||||
if (feature && feature.geometry && feature.layer) {
|
||||
this.unselectFeature(feature);
|
||||
}
|
||||
deactivated = true;
|
||||
}
|
||||
return deactivated;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Method: beforeSelectFeature
|
||||
* Called before a feature is selected.
|
||||
@@ -359,19 +354,27 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
/**
|
||||
* APIMethod: selectFeature
|
||||
* Select a feature for modification in standalone mode. In non-standalone
|
||||
* mode, this method is called when the select feature control selects a
|
||||
* feature. Register a listener to the beforefeaturemodified event and
|
||||
* return false to prevent feature modification.
|
||||
* mode, this method is called when a feature is selected by clicking.
|
||||
* Register a listener to the beforefeaturemodified event and return false
|
||||
* to prevent feature modification.
|
||||
*
|
||||
* Parameters:
|
||||
* feature - {<OpenLayers.Feature.Vector>} the selected feature.
|
||||
*/
|
||||
selectFeature: function(feature) {
|
||||
if (!this.standalone || this.beforeSelectFeature(feature) !== false) {
|
||||
if (this.geometryTypes && OpenLayers.Util.indexOf(this.geometryTypes,
|
||||
feature.geometry.CLASS_NAME) == -1) {
|
||||
return;
|
||||
}
|
||||
if (this.beforeSelectFeature(feature) !== false) {
|
||||
if (this.feature) {
|
||||
this.unselectFeature(this.feature);
|
||||
}
|
||||
this.feature = feature;
|
||||
this.layer.selectedFeatures.push(feature);
|
||||
this.layer.drawFeature(feature, 'select');
|
||||
this.modified = false;
|
||||
this.resetVertices();
|
||||
this.dragControl.activate();
|
||||
this.onModificationStart(this.feature);
|
||||
}
|
||||
// keep track of geometry modifications
|
||||
@@ -401,8 +404,9 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
this.layer.destroyFeatures([this.radiusHandle], {silent: true});
|
||||
delete this.radiusHandle;
|
||||
}
|
||||
this.layer.drawFeature(this.feature, 'default');
|
||||
this.feature = null;
|
||||
this.dragControl.deactivate();
|
||||
OpenLayers.Util.removeItem(this.layer.selectedFeatures, feature);
|
||||
this.onModificationEnd(feature);
|
||||
this.layer.events.triggerEvent("afterfeaturemodified", {
|
||||
feature: feature,
|
||||
@@ -410,64 +414,48 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
});
|
||||
this.modified = false;
|
||||
},
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Method: dragStart
|
||||
* Called by the drag feature control with before a feature is dragged.
|
||||
* This method is used to differentiate between points and vertices
|
||||
* of higher order geometries. This respects the <geometryTypes>
|
||||
* property and forces a select of points when the drag control is
|
||||
* already active (and stops events from propagating to the select
|
||||
* control).
|
||||
* Called by the drag handler before a feature is dragged. This method is
|
||||
* used to differentiate between points and vertices
|
||||
* of higher order geometries.
|
||||
*
|
||||
* Parameters:
|
||||
* feature - {<OpenLayers.Feature.Vector>} The point or vertex about to be
|
||||
* dragged.
|
||||
* pixel - {<OpenLayers.Pixel>} Pixel location of the mouse event.
|
||||
*/
|
||||
dragStart: function(feature, pixel) {
|
||||
// only change behavior if the feature is not in the vertices array
|
||||
if(feature != this.feature && !feature.geometry.parent &&
|
||||
feature != this.dragHandle && feature != this.radiusHandle) {
|
||||
if(this.standalone === false && this.feature) {
|
||||
// unselect the currently selected feature
|
||||
this.selectControl.clickFeature.apply(this.selectControl,
|
||||
[this.feature]);
|
||||
}
|
||||
// check any constraints on the geometry type
|
||||
if(this.geometryTypes == null ||
|
||||
OpenLayers.Util.indexOf(this.geometryTypes,
|
||||
feature.geometry.CLASS_NAME) != -1) {
|
||||
// select the point
|
||||
this.standalone || this.selectControl.clickFeature.apply(
|
||||
this.selectControl, [feature]);
|
||||
/**
|
||||
* TBD: These lines improve workflow by letting the user
|
||||
* immediately start dragging after the mouse down.
|
||||
* However, it is very ugly to be messing with controls
|
||||
* and their handlers in this way. I'd like a better
|
||||
* solution if the workflow change is necessary.
|
||||
*/
|
||||
// prepare the point for dragging
|
||||
this.dragControl.overFeature.apply(this.dragControl,
|
||||
[feature]);
|
||||
this.dragControl.lastPixel = pixel;
|
||||
this.dragControl.handlers.drag.started = true;
|
||||
this.dragControl.handlers.drag.start = pixel;
|
||||
this.dragControl.handlers.drag.last = pixel;
|
||||
dragStart: function(feature) {
|
||||
var isPoint = feature.geometry.CLASS_NAME ==
|
||||
'OpenLayers.Geometry.Point';
|
||||
if (!this.standalone &&
|
||||
((!feature._sketch && isPoint) || !feature._sketch)) {
|
||||
if (this.toggle && this.feature === feature) {
|
||||
// mark feature for unselection
|
||||
this._unselect = feature;
|
||||
}
|
||||
this.selectFeature(feature);
|
||||
}
|
||||
if (feature._sketch || isPoint) {
|
||||
// feature is a drag or virtual handle or point
|
||||
this.vertex = feature;
|
||||
this.handlers.drag.stopDown = true;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Method: dragVertex
|
||||
* Called by the drag feature control with each drag move of a vertex.
|
||||
* Called by the drag handler with each drag move of a vertex.
|
||||
*
|
||||
* Parameters:
|
||||
* vertex - {<OpenLayers.Feature.Vector>} The vertex being dragged.
|
||||
* pixel - {<OpenLayers.Pixel>} Pixel location of the mouse event.
|
||||
*/
|
||||
dragVertex: function(vertex, pixel) {
|
||||
var pos = this.map.getLonLatFromViewPortPx(pixel);
|
||||
var geom = vertex.geometry;
|
||||
geom.move(pos.lon - geom.x, pos.lat - geom.y);
|
||||
this.modified = true;
|
||||
/**
|
||||
* Five cases:
|
||||
@@ -479,9 +467,6 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
*/
|
||||
if(this.feature.geometry.CLASS_NAME == "OpenLayers.Geometry.Point") {
|
||||
// dragging a simple point
|
||||
if(this.feature != vertex) {
|
||||
this.feature = vertex;
|
||||
}
|
||||
this.layer.events.triggerEvent("vertexmodified", {
|
||||
vertex: vertex.geometry,
|
||||
feature: this.feature,
|
||||
@@ -518,7 +503,7 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
this.virtualVertices = [];
|
||||
}
|
||||
this.layer.drawFeature(this.feature, this.standalone ? undefined :
|
||||
this.selectControl.renderIntent);
|
||||
'select');
|
||||
}
|
||||
// keep the vertex on top so it gets the mouseout after dragging
|
||||
// this should be removed in favor of an option to draw under or
|
||||
@@ -528,7 +513,7 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
|
||||
/**
|
||||
* Method: dragComplete
|
||||
* Called by the drag feature control when the feature dragging is complete.
|
||||
* Called by the drag handler when the feature dragging is complete.
|
||||
*
|
||||
* Parameters:
|
||||
* vertex - {<OpenLayers.Feature.Vector>} The vertex being dragged.
|
||||
@@ -564,16 +549,6 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
* Method: resetVertices
|
||||
*/
|
||||
resetVertices: function() {
|
||||
// if coming from a drag complete we're about to destroy the vertex
|
||||
// that was just dragged. For that reason, the drag feature control
|
||||
// will never detect a mouse-out on that vertex, meaning that the drag
|
||||
// handler won't be deactivated. This can cause errors because the drag
|
||||
// feature control still has a feature to drag but that feature is
|
||||
// destroyed. To prevent this, we call outFeature on the drag feature
|
||||
// control if the control actually has a feature to drag.
|
||||
if(this.dragControl.feature) {
|
||||
this.dragControl.outFeature(this.dragControl.feature);
|
||||
}
|
||||
if(this.vertices.length > 0) {
|
||||
this.layer.removeFeatures(this.vertices, {silent: true});
|
||||
this.vertices = [];
|
||||
@@ -624,11 +599,10 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
// check for delete key
|
||||
if(this.feature &&
|
||||
OpenLayers.Util.indexOf(this.deleteCodes, code) != -1) {
|
||||
var vertex = this.dragControl.feature;
|
||||
if(vertex &&
|
||||
OpenLayers.Util.indexOf(this.vertices, vertex) != -1 &&
|
||||
!this.dragControl.handlers.drag.dragging &&
|
||||
vertex.geometry.parent) {
|
||||
var vertex = this.layer.getFeatureFromEvent(this.handlers.drag.evt);
|
||||
if (vertex &&
|
||||
OpenLayers.Util.indexOf(this.vertices, vertex) != -1 &&
|
||||
!this.handlers.drag.dragging && vertex.geometry.parent) {
|
||||
// remove the vertex
|
||||
vertex.geometry.parent.removeComponent(vertex.geometry);
|
||||
this.layer.events.triggerEvent("vertexremoved", {
|
||||
@@ -637,8 +611,7 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
pixel: evt.xy
|
||||
});
|
||||
this.layer.drawFeature(this.feature, this.standalone ?
|
||||
undefined :
|
||||
this.selectControl.renderIntent);
|
||||
undefined : 'select');
|
||||
this.modified = true;
|
||||
this.resetVertices();
|
||||
this.setFeatureState();
|
||||
@@ -792,11 +765,49 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
* map - {<OpenLayers.Map>} The control's map.
|
||||
*/
|
||||
setMap: function(map) {
|
||||
this.standalone || this.selectControl.setMap(map);
|
||||
this.dragControl.setMap(map);
|
||||
this.handlers.drag.setMap(map);
|
||||
OpenLayers.Control.prototype.setMap.apply(this, arguments);
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: handleMapEvents
|
||||
*
|
||||
* Parameters:
|
||||
* evt - {Object}
|
||||
*/
|
||||
handleMapEvents: function(evt) {
|
||||
if (evt.type == "removelayer" || evt.property == "order") {
|
||||
this.moveLayerToTop();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: moveLayerToTop
|
||||
* Moves the layer for this handler to the top, so mouse events can reach
|
||||
* it.
|
||||
*/
|
||||
moveLayerToTop: function() {
|
||||
var index = Math.max(this.map.Z_INDEX_BASE['Feature'] - 1,
|
||||
this.layer.getZIndex()) + 1;
|
||||
this.layer.setZIndex(index);
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: moveLayerBack
|
||||
* Moves the layer back to the position determined by the map's layers
|
||||
* array.
|
||||
*/
|
||||
moveLayerBack: function() {
|
||||
var index = this.layer.getZIndex() - 1;
|
||||
if (index >= this.map.Z_INDEX_BASE['Feature']) {
|
||||
this.layer.setZIndex(index);
|
||||
} else {
|
||||
this.map.setLayerZIndex(this.layer,
|
||||
this.map.getLayerIndex(this.layer));
|
||||
}
|
||||
},
|
||||
|
||||
CLASS_NAME: "OpenLayers.Control.ModifyFeature"
|
||||
});
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
@@ -13,11 +13,23 @@
|
||||
* The MousePosition control displays geographic coordinates of the mouse
|
||||
* pointer, as it is moved about the map.
|
||||
*
|
||||
* You can use the <prefix>- or <suffix>-properties to provide more information
|
||||
* about the displayed coordinates to the user:
|
||||
*
|
||||
* (code)
|
||||
* var mousePositionCtrl = new OpenLayers.Control.MousePosition({
|
||||
* prefix: '<a target="_blank" ' +
|
||||
* 'href="http://spatialreference.org/ref/epsg/4326/">' +
|
||||
* 'EPSG:4326</a> coordinates: '
|
||||
* }
|
||||
* );
|
||||
* (end code)
|
||||
*
|
||||
* Inherits from:
|
||||
* - <OpenLayers.Control>
|
||||
*/
|
||||
OpenLayers.Control.MousePosition = OpenLayers.Class(OpenLayers.Control, {
|
||||
|
||||
|
||||
/**
|
||||
* APIProperty: autoActivate
|
||||
* {Boolean} Activate the control when it is added to a map. Default is
|
||||
@@ -25,50 +37,55 @@ OpenLayers.Control.MousePosition = OpenLayers.Class(OpenLayers.Control, {
|
||||
*/
|
||||
autoActivate: true,
|
||||
|
||||
/**
|
||||
/**
|
||||
* Property: element
|
||||
* {DOMElement}
|
||||
* {DOMElement}
|
||||
*/
|
||||
element: null,
|
||||
|
||||
/**
|
||||
|
||||
/**
|
||||
* APIProperty: prefix
|
||||
* {String}
|
||||
* {String} A string to be prepended to the current pointers coordinates
|
||||
* when it is rendered. Defaults to the empty string ''.
|
||||
*/
|
||||
prefix: '',
|
||||
|
||||
/**
|
||||
|
||||
/**
|
||||
* APIProperty: separator
|
||||
* {String}
|
||||
* {String} A string to be used to seperate the two coordinates from each
|
||||
* other. Defaults to the string ', ', which will result in a
|
||||
* rendered coordinate of e.g. '42.12, 21.22'.
|
||||
*/
|
||||
separator: ', ',
|
||||
|
||||
/**
|
||||
|
||||
/**
|
||||
* APIProperty: suffix
|
||||
* {String}
|
||||
* {String} A string to be appended to the current pointers coordinates
|
||||
* when it is rendered. Defaults to the empty string ''.
|
||||
*/
|
||||
suffix: '',
|
||||
|
||||
/**
|
||||
|
||||
/**
|
||||
* APIProperty: numDigits
|
||||
* {Integer}
|
||||
* {Integer} The number of digits each coordinate shall have when being
|
||||
* rendered, Defaults to 5.
|
||||
*/
|
||||
numDigits: 5,
|
||||
|
||||
/**
|
||||
|
||||
/**
|
||||
* APIProperty: granularity
|
||||
* {Integer}
|
||||
* {Integer}
|
||||
*/
|
||||
granularity: 10,
|
||||
|
||||
/**
|
||||
* APIProperty: emptyString
|
||||
* APIProperty: emptyString
|
||||
* {String} Set this to some value to set when the mouse is outside the
|
||||
* map.
|
||||
*/
|
||||
emptyString: null,
|
||||
|
||||
/**
|
||||
|
||||
/**
|
||||
* Property: lastXy
|
||||
* {<OpenLayers.Pixel>}
|
||||
*/
|
||||
@@ -76,14 +93,14 @@ OpenLayers.Control.MousePosition = OpenLayers.Class(OpenLayers.Control, {
|
||||
|
||||
/**
|
||||
* APIProperty: displayProjection
|
||||
* {<OpenLayers.Projection>} The projection in which the
|
||||
* mouse position is displayed
|
||||
* {<OpenLayers.Projection>} The projection in which the mouse position is
|
||||
* displayed.
|
||||
*/
|
||||
displayProjection: null,
|
||||
|
||||
displayProjection: null,
|
||||
|
||||
/**
|
||||
* Constructor: OpenLayers.Control.MousePosition
|
||||
*
|
||||
*
|
||||
* Parameters:
|
||||
* options - {Object} Options for control.
|
||||
*/
|
||||
@@ -109,7 +126,7 @@ OpenLayers.Control.MousePosition = OpenLayers.Class(OpenLayers.Control, {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* APIMethod: deactivate
|
||||
*/
|
||||
@@ -127,7 +144,7 @@ OpenLayers.Control.MousePosition = OpenLayers.Class(OpenLayers.Control, {
|
||||
/**
|
||||
* Method: draw
|
||||
* {DOMElement}
|
||||
*/
|
||||
*/
|
||||
draw: function() {
|
||||
OpenLayers.Control.prototype.draw.apply(this, arguments);
|
||||
|
||||
@@ -136,12 +153,12 @@ OpenLayers.Control.MousePosition = OpenLayers.Class(OpenLayers.Control, {
|
||||
this.div.top = "";
|
||||
this.element = this.div;
|
||||
}
|
||||
|
||||
|
||||
return this.div;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Method: redraw
|
||||
* Method: redraw
|
||||
*/
|
||||
redraw: function(evt) {
|
||||
|
||||
@@ -160,18 +177,18 @@ OpenLayers.Control.MousePosition = OpenLayers.Class(OpenLayers.Control, {
|
||||
}
|
||||
|
||||
lonLat = this.map.getLonLatFromPixel(evt.xy);
|
||||
if (!lonLat) {
|
||||
if (!lonLat) {
|
||||
// map has not yet been properly initialized
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (this.displayProjection) {
|
||||
lonLat.transform(this.map.getProjectionObject(),
|
||||
lonLat.transform(this.map.getProjectionObject(),
|
||||
this.displayProjection );
|
||||
}
|
||||
}
|
||||
this.lastXy = evt.xy;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
var newHtml = this.formatOutput(lonLat);
|
||||
|
||||
if (newHtml != this.element.innerHTML) {
|
||||
@@ -200,7 +217,7 @@ OpenLayers.Control.MousePosition = OpenLayers.Class(OpenLayers.Control, {
|
||||
var newHtml =
|
||||
this.prefix +
|
||||
lonLat.lon.toFixed(digits) +
|
||||
this.separator +
|
||||
this.separator +
|
||||
lonLat.lat.toFixed(digits) +
|
||||
this.suffix;
|
||||
return newHtml;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
@@ -77,7 +77,9 @@ OpenLayers.Control.Navigation = OpenLayers.Class(OpenLayers.Control, {
|
||||
/**
|
||||
* Property: mouseWheelOptions
|
||||
* {Object} Options passed to the MouseWheel control (only useful if
|
||||
* <zoomWheelEnabled> is set to true)
|
||||
* <zoomWheelEnabled> is set to true). Default is no options for maps
|
||||
* with fractionalZoom set to true, otherwise
|
||||
* {cumulative: false, interval: 50, maxDelta: 6}
|
||||
*/
|
||||
mouseWheelOptions: null,
|
||||
|
||||
@@ -208,10 +210,15 @@ OpenLayers.Control.Navigation = OpenLayers.Class(OpenLayers.Control, {
|
||||
{map: this.map, keyMask: this.zoomBoxKeyMask});
|
||||
this.dragPan.draw();
|
||||
this.zoomBox.draw();
|
||||
var wheelOptions = this.map.fractionalZoom ? {} : {
|
||||
cumulative: false,
|
||||
interval: 50,
|
||||
maxDelta: 6
|
||||
};
|
||||
this.handlers.wheel = new OpenLayers.Handler.MouseWheel(
|
||||
this, {"up" : this.wheelUp,
|
||||
"down": this.wheelDown},
|
||||
this.mouseWheelOptions );
|
||||
this, {up : this.wheelUp, down: this.wheelDown},
|
||||
OpenLayers.Util.extend(wheelOptions, this.mouseWheelOptions)
|
||||
);
|
||||
if (OpenLayers.Control.PinchZoom) {
|
||||
this.pinchZoom = new OpenLayers.Control.PinchZoom(
|
||||
OpenLayers.Util.extend(
|
||||
@@ -238,8 +245,7 @@ OpenLayers.Control.Navigation = OpenLayers.Class(OpenLayers.Control, {
|
||||
* evt - {Event}
|
||||
*/
|
||||
defaultDblClick: function (evt) {
|
||||
var newCenter = this.map.getLonLatFromViewPortPx( evt.xy );
|
||||
this.map.setCenter(newCenter, this.map.zoom + 1);
|
||||
this.map.zoomTo(this.map.zoom + 1, evt.xy);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -249,8 +255,7 @@ OpenLayers.Control.Navigation = OpenLayers.Class(OpenLayers.Control, {
|
||||
* evt - {Event}
|
||||
*/
|
||||
defaultDblRightClick: function (evt) {
|
||||
var newCenter = this.map.getLonLatFromViewPortPx( evt.xy );
|
||||
this.map.setCenter(newCenter, this.map.zoom - 1);
|
||||
this.map.zoomTo(this.map.zoom - 1, evt.xy);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -264,22 +269,14 @@ OpenLayers.Control.Navigation = OpenLayers.Class(OpenLayers.Control, {
|
||||
if (!this.map.fractionalZoom) {
|
||||
deltaZ = Math.round(deltaZ);
|
||||
}
|
||||
var currentZoom = this.map.getZoom();
|
||||
var newZoom = this.map.getZoom() + deltaZ;
|
||||
var currentZoom = this.map.getZoom(),
|
||||
newZoom = currentZoom + deltaZ;
|
||||
newZoom = Math.max(newZoom, 0);
|
||||
newZoom = Math.min(newZoom, this.map.getNumZoomLevels());
|
||||
if (newZoom === currentZoom) {
|
||||
return;
|
||||
}
|
||||
var size = this.map.getSize();
|
||||
var deltaX = size.w/2 - evt.xy.x;
|
||||
var deltaY = evt.xy.y - size.h/2;
|
||||
var newRes = this.map.baseLayer.getResolutionForZoom(newZoom);
|
||||
var zoomPoint = this.map.getLonLatFromPixel(evt.xy);
|
||||
var newCenter = new OpenLayers.LonLat(
|
||||
zoomPoint.lon + deltaX * newRes,
|
||||
zoomPoint.lat + deltaY * newRes );
|
||||
this.map.setCenter( newCenter, newZoom );
|
||||
this.map.zoomTo(newZoom, evt.xy);
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
@@ -7,6 +7,9 @@
|
||||
* @requires OpenLayers/Control.js
|
||||
* @requires OpenLayers/BaseTypes.js
|
||||
* @requires OpenLayers/Events/buttonclick.js
|
||||
* @requires OpenLayers/Map.js
|
||||
* @requires OpenLayers/Handler/Click.js
|
||||
* @requires OpenLayers/Handler/Drag.js
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -450,7 +453,7 @@ OpenLayers.Control.OverviewMap = OpenLayers.Class(OpenLayers.Control, {
|
||||
*/
|
||||
isSuitableOverview: function() {
|
||||
var mapExtent = this.map.getExtent();
|
||||
var maxExtent = this.map.maxExtent;
|
||||
var maxExtent = this.map.getMaxExtent();
|
||||
var testExtent = new OpenLayers.Bounds(
|
||||
Math.max(mapExtent.left, maxExtent.left),
|
||||
Math.max(mapExtent.bottom, maxExtent.bottom),
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
|
||||
/**
|
||||
* @requires OpenLayers/Control.js
|
||||
* @requires OpenLayers/Control/Button.js
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -15,7 +15,7 @@
|
||||
* Inherits from:
|
||||
* - <OpenLayers.Control>
|
||||
*/
|
||||
OpenLayers.Control.Pan = OpenLayers.Class(OpenLayers.Control, {
|
||||
OpenLayers.Control.Pan = OpenLayers.Class(OpenLayers.Control.Button, {
|
||||
|
||||
/**
|
||||
* APIProperty: slideFactor
|
||||
@@ -40,14 +40,6 @@ OpenLayers.Control.Pan = OpenLayers.Class(OpenLayers.Control, {
|
||||
*/
|
||||
direction: null,
|
||||
|
||||
/**
|
||||
* Property: type
|
||||
* {String} The type of <OpenLayers.Control> -- When added to a
|
||||
* <Control.Panel>, 'type' is used by the panel to determine how to
|
||||
* handle our events.
|
||||
*/
|
||||
type: OpenLayers.Control.TYPE_BUTTON,
|
||||
|
||||
/**
|
||||
* Constructor: OpenLayers.Control.Pan
|
||||
* Control which handles the panning (in any of the cardinal directions)
|
||||
@@ -70,26 +62,27 @@ OpenLayers.Control.Pan = OpenLayers.Class(OpenLayers.Control, {
|
||||
* Method: trigger
|
||||
*/
|
||||
trigger: function(){
|
||||
if (this.map) {
|
||||
var getSlideFactor = OpenLayers.Function.bind(function (dim) {
|
||||
return this.slideRatio ?
|
||||
this.map.getSize()[dim] * this.slideRatio :
|
||||
this.slideFactor;
|
||||
}, this);
|
||||
|
||||
var getSlideFactor = OpenLayers.Function.bind(function (dim) {
|
||||
return this.slideRatio ?
|
||||
this.map.getSize()[dim] * this.slideRatio :
|
||||
this.slideFactor;
|
||||
}, this);
|
||||
|
||||
switch (this.direction) {
|
||||
case OpenLayers.Control.Pan.NORTH:
|
||||
this.map.pan(0, -getSlideFactor("h"));
|
||||
break;
|
||||
case OpenLayers.Control.Pan.SOUTH:
|
||||
this.map.pan(0, getSlideFactor("h"));
|
||||
break;
|
||||
case OpenLayers.Control.Pan.WEST:
|
||||
this.map.pan(-getSlideFactor("w"), 0);
|
||||
break;
|
||||
case OpenLayers.Control.Pan.EAST:
|
||||
this.map.pan(getSlideFactor("w"), 0);
|
||||
break;
|
||||
switch (this.direction) {
|
||||
case OpenLayers.Control.Pan.NORTH:
|
||||
this.map.pan(0, -getSlideFactor("h"));
|
||||
break;
|
||||
case OpenLayers.Control.Pan.SOUTH:
|
||||
this.map.pan(0, getSlideFactor("h"));
|
||||
break;
|
||||
case OpenLayers.Control.Pan.WEST:
|
||||
this.map.pan(-getSlideFactor("w"), 0);
|
||||
break;
|
||||
case OpenLayers.Control.Pan.EAST:
|
||||
this.map.pan(getSlideFactor("w"), 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
@@ -99,6 +99,7 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
|
||||
|
||||
this.map.events.un({
|
||||
"changebaselayer": this.redraw,
|
||||
"updatesize": this.redraw,
|
||||
scope: this
|
||||
});
|
||||
|
||||
@@ -116,7 +117,11 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
|
||||
*/
|
||||
setMap: function(map) {
|
||||
OpenLayers.Control.PanZoom.prototype.setMap.apply(this, arguments);
|
||||
this.map.events.register("changebaselayer", this, this.redraw);
|
||||
this.map.events.on({
|
||||
"changebaselayer": this.redraw,
|
||||
"updatesize": this.redraw,
|
||||
scope: this
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -189,6 +194,7 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
|
||||
_addZoomBar:function(centered) {
|
||||
var imgLocation = OpenLayers.Util.getImageLocation("slider.png");
|
||||
var id = this.id + "_" + this.map.id;
|
||||
var minZoom = this.map.getMinZoom();
|
||||
var zoomsToEnd = this.map.getNumZoomLevels() - 1 - this.map.getZoom();
|
||||
var slider = OpenLayers.Util.createAlphaImageDiv(id,
|
||||
centered.add(-1, zoomsToEnd * this.zoomStopHeight),
|
||||
@@ -211,7 +217,7 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
|
||||
|
||||
var sz = {
|
||||
w: this.zoomStopWidth,
|
||||
h: this.zoomStopHeight * this.map.getNumZoomLevels()
|
||||
h: this.zoomStopHeight * (this.map.getNumZoomLevels() - minZoom)
|
||||
};
|
||||
var imgLocation = OpenLayers.Util.getImageLocation("zoombar.png");
|
||||
var div = null;
|
||||
@@ -242,7 +248,7 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
|
||||
this.map.events.register("zoomend", this, this.moveZoomBar);
|
||||
|
||||
centered = centered.add(0,
|
||||
this.zoomStopHeight * this.map.getNumZoomLevels());
|
||||
this.zoomStopHeight * (this.map.getNumZoomLevels() - minZoom));
|
||||
return centered;
|
||||
},
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
@@ -21,12 +21,6 @@ OpenLayers.Control.PinchZoom = OpenLayers.Class(OpenLayers.Control, {
|
||||
*/
|
||||
type: OpenLayers.Control.TYPE_TOOL,
|
||||
|
||||
/**
|
||||
* Property: containerCenter
|
||||
* {Object} Cached object representing the layer container center (in pixels).
|
||||
*/
|
||||
containerCenter: null,
|
||||
|
||||
/**
|
||||
* Property: pinchOrigin
|
||||
* {Object} Cached object representing the pinch start (in pixels).
|
||||
@@ -45,6 +39,17 @@ OpenLayers.Control.PinchZoom = OpenLayers.Class(OpenLayers.Control, {
|
||||
* true.
|
||||
*/
|
||||
autoActivate: true,
|
||||
|
||||
/**
|
||||
* APIProperty: preserveCenter
|
||||
* {Boolean} Set this to true if you don't want the map center to change
|
||||
* while pinching. For example you may want to set preserveCenter to
|
||||
* true when the user location is being watched and you want to preserve
|
||||
* the user location at the center of the map even if he zooms in or
|
||||
* out using pinch. This property's value can be changed any time on an
|
||||
* existing instance. Default is false.
|
||||
*/
|
||||
preserveCenter: false,
|
||||
|
||||
/**
|
||||
* APIProperty: handlerOptions
|
||||
@@ -69,57 +74,6 @@ OpenLayers.Control.PinchZoom = OpenLayers.Class(OpenLayers.Control, {
|
||||
}, this.handlerOptions);
|
||||
},
|
||||
|
||||
/**
|
||||
* APIMethod: activate
|
||||
* Activate this control. Must be called after the control is added to a
|
||||
* map.
|
||||
*
|
||||
* Returns:
|
||||
* {Boolean} The control was successfully activated.
|
||||
*/
|
||||
activate: function() {
|
||||
var activated = OpenLayers.Control.prototype.activate.apply(this,arguments);
|
||||
if (activated) {
|
||||
this.map.events.on({
|
||||
moveend: this.updateContainerCenter,
|
||||
scope: this
|
||||
});
|
||||
this.updateContainerCenter();
|
||||
}
|
||||
return activated;
|
||||
},
|
||||
|
||||
/**
|
||||
* APIMethod: deactivate
|
||||
* Deactivate this control.
|
||||
*
|
||||
* Returns:
|
||||
* {Boolean} The control was successfully deactivated.
|
||||
*/
|
||||
deactivate: function() {
|
||||
var deactivated = OpenLayers.Control.prototype.deactivate.apply(this,arguments);
|
||||
if (this.map && this.map.events) {
|
||||
this.map.events.un({
|
||||
moveend: this.updateContainerCenter,
|
||||
scope: this
|
||||
});
|
||||
}
|
||||
return deactivated;
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: updateContainerCenter
|
||||
* Must be called each time the layer container moves.
|
||||
*/
|
||||
updateContainerCenter: function() {
|
||||
var container = this.map.layerContainerDiv;
|
||||
// the layer container div is a square of 100px/100px
|
||||
this.containerCenter = {
|
||||
x: parseInt(container.style.left, 10) + 50,
|
||||
y: parseInt(container.style.top, 10) + 50
|
||||
};
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: pinchStart
|
||||
*
|
||||
@@ -129,8 +83,10 @@ OpenLayers.Control.PinchZoom = OpenLayers.Class(OpenLayers.Control, {
|
||||
* of the pinch gesture. This give us the current scale of the pinch.
|
||||
*/
|
||||
pinchStart: function(evt, pinchData) {
|
||||
this.pinchOrigin = evt.xy;
|
||||
this.currentCenter = evt.xy;
|
||||
var xy = (this.preserveCenter) ?
|
||||
this.map.getPixelFromLonLat(this.map.getCenter()) : evt.xy;
|
||||
this.pinchOrigin = xy;
|
||||
this.currentCenter = xy;
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -143,29 +99,18 @@ OpenLayers.Control.PinchZoom = OpenLayers.Class(OpenLayers.Control, {
|
||||
*/
|
||||
pinchMove: function(evt, pinchData) {
|
||||
var scale = pinchData.scale;
|
||||
var containerCenter = this.containerCenter;
|
||||
var containerOrigin = this.map.layerContainerOriginPx;
|
||||
var pinchOrigin = this.pinchOrigin;
|
||||
var current = evt.xy;
|
||||
var current = (this.preserveCenter) ?
|
||||
this.map.getPixelFromLonLat(this.map.getCenter()) : evt.xy;
|
||||
|
||||
var dx = Math.round((current.x - pinchOrigin.x) + (scale - 1) * (containerCenter.x - pinchOrigin.x));
|
||||
var dy = Math.round((current.y - pinchOrigin.y) + (scale - 1) * (containerCenter.y - pinchOrigin.y));
|
||||
var dx = Math.round((containerOrigin.x + current.x - pinchOrigin.x) + (scale - 1) * (containerOrigin.x - pinchOrigin.x));
|
||||
var dy = Math.round((containerOrigin.y + current.y - pinchOrigin.y) + (scale - 1) * (containerOrigin.y - pinchOrigin.y));
|
||||
|
||||
this.applyTransform(
|
||||
"translate(" + dx + "px, " + dy + "px) scale(" + scale + ")"
|
||||
);
|
||||
this.map.applyTransform(dx, dy, scale);
|
||||
this.currentCenter = current;
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: applyTransform
|
||||
* Applies the given transform to layers.
|
||||
*/
|
||||
applyTransform: function(transform) {
|
||||
var style = this.map.layerContainerDiv.style;
|
||||
style['-webkit-transform'] = transform;
|
||||
style['-moz-transform'] = transform;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Method: pinchDone
|
||||
*
|
||||
@@ -177,7 +122,7 @@ OpenLayers.Control.PinchZoom = OpenLayers.Class(OpenLayers.Control, {
|
||||
* of the pinch gesture. This give us the final scale of the pinch.
|
||||
*/
|
||||
pinchDone: function(evt, start, last) {
|
||||
this.applyTransform("");
|
||||
this.map.applyTransform();
|
||||
var zoom = this.map.getZoomForResolution(this.map.getResolution() / last.scale, true);
|
||||
if (zoom !== this.map.getZoom() || !this.currentCenter.equals(this.pinchOrigin)) {
|
||||
var resolution = this.map.getResolutionForZoom(zoom);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
@@ -96,7 +96,7 @@ OpenLayers.Control.SLDSelect = OpenLayers.Class(OpenLayers.Control, {
|
||||
* layerOptions: {
|
||||
* styleMap: new OpenLayers.StyleMap({
|
||||
* "default": {strokeColor: "yellow"}
|
||||
* });
|
||||
* })
|
||||
* }
|
||||
* }
|
||||
* });
|
||||
@@ -533,12 +533,13 @@ OpenLayers.Control.SLDSelect = OpenLayers.Class(OpenLayers.Control, {
|
||||
}
|
||||
|
||||
var selectionLayer = this.createSelectionLayer(layer);
|
||||
var sld = this.createSLD(layer, filters, geometryAttributes);
|
||||
|
||||
this.events.triggerEvent("selected", {
|
||||
layer: layer,
|
||||
filters: filters
|
||||
});
|
||||
|
||||
var sld = this.createSLD(layer, filters, geometryAttributes);
|
||||
|
||||
selectionLayer.mergeNewParams({SLD_BODY: sld});
|
||||
delete this._queue;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
@@ -305,12 +305,17 @@ OpenLayers.Control.SelectFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
for(l=0; l<layers.length; ++l) {
|
||||
layer = layers[l];
|
||||
numExcept = 0;
|
||||
while(layer.selectedFeatures.length > numExcept) {
|
||||
feature = layer.selectedFeatures[numExcept];
|
||||
if(!options || options.except != feature) {
|
||||
this.unselect(feature);
|
||||
} else {
|
||||
++numExcept;
|
||||
//layer.selectedFeatures is null when layer is destroyed and
|
||||
//one of it's preremovelayer listener calls setLayer
|
||||
//with another layer on this control
|
||||
if(layer.selectedFeatures != null) {
|
||||
while(layer.selectedFeatures.length > numExcept) {
|
||||
feature = layer.selectedFeatures[numExcept];
|
||||
if(!options || options.except != feature) {
|
||||
this.unselect(feature);
|
||||
} else {
|
||||
++numExcept;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
@@ -124,7 +124,7 @@ OpenLayers.Control.Snapping = OpenLayers.Class(OpenLayers.Control, {
|
||||
* objects below. If the items in the targets list are vector layers
|
||||
* (instead of configuration objects), the defaults from the <defaults>
|
||||
* property will apply. The editable layer itself may be a target
|
||||
* layer - allowing newly created or edited features to be snapped to
|
||||
* layer, allowing newly created or edited features to be snapped to
|
||||
* existing features from the same layer. If no targets are provided
|
||||
* the layer given in the constructor (as <layer>) will become the
|
||||
* initial target.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
@@ -175,8 +175,7 @@ OpenLayers.Control.TouchNavigation = OpenLayers.Class(OpenLayers.Control, {
|
||||
* evt - {Event}
|
||||
*/
|
||||
defaultDblClick: function (evt) {
|
||||
var newCenter = this.map.getLonLatFromViewPortPx(evt.xy);
|
||||
this.map.setCenter(newCenter, this.map.zoom + 1);
|
||||
this.map.zoomTo(this.map.zoom + 1, evt.xy);
|
||||
},
|
||||
|
||||
CLASS_NAME: "OpenLayers.Control.TouchNavigation"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
@@ -15,10 +15,10 @@
|
||||
/**
|
||||
* Class: OpenLayers.Control.WMSGetFeatureInfo
|
||||
* The WMSGetFeatureInfo control uses a WMS query to get information about a point on the map. The
|
||||
* information may be in a display-friendly format such as HTML, or a machine-friendly format such
|
||||
* as GML, depending on the server's capabilities and the client's configuration. This control
|
||||
* handles click or hover events, attempts to parse the results using an OpenLayers.Format, and
|
||||
* fires a 'getfeatureinfo' event with the click position, the raw body of the response, and an
|
||||
* information may be in a display-friendly format such as HTML, or a machine-friendly format such
|
||||
* as GML, depending on the server's capabilities and the client's configuration. This control
|
||||
* handles click or hover events, attempts to parse the results using an OpenLayers.Format, and
|
||||
* fires a 'getfeatureinfo' event with the click position, the raw body of the response, and an
|
||||
* array of features if it successfully read the response.
|
||||
*
|
||||
* Inherits from:
|
||||
@@ -49,23 +49,25 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
|
||||
*/
|
||||
maxFeatures: 10,
|
||||
|
||||
/** APIProperty: clickCallback
|
||||
* {String} The click callback to register in the
|
||||
* {<OpenLayers.Handler.Click>} object created when the hover
|
||||
* option is set to false. Default is "click".
|
||||
/**
|
||||
* APIProperty: clickCallback
|
||||
* {String} The click callback to register in the
|
||||
* {<OpenLayers.Handler.Click>} object created when the hover
|
||||
* option is set to false. Default is "click".
|
||||
*/
|
||||
clickCallback: "click",
|
||||
|
||||
/** APIProperty: output
|
||||
* {String} Either "features" or "object". When triggering a
|
||||
* getfeatureinfo request should we pass on an array of features
|
||||
* or an object with with a "features" property and other properties
|
||||
* (such as the url of the WMS). Default is "features".
|
||||
|
||||
/**
|
||||
* APIProperty: output
|
||||
* {String} Either "features" or "object". When triggering a getfeatureinfo
|
||||
* request should we pass on an array of features or an object with with
|
||||
* a "features" property and other properties (such as the url of the
|
||||
* WMS). Default is "features".
|
||||
*/
|
||||
output: "features",
|
||||
|
||||
|
||||
/**
|
||||
* Property: layers
|
||||
* APIProperty: layers
|
||||
* {Array(<OpenLayers.Layer.WMS>)} The layers to query for feature info.
|
||||
* If omitted, all map WMS layers with a url that matches this <url> or
|
||||
* <layerUrls> will be considered.
|
||||
@@ -73,21 +75,21 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
|
||||
layers: null,
|
||||
|
||||
/**
|
||||
* Property: queryVisible
|
||||
* APIProperty: queryVisible
|
||||
* {Boolean} If true, filter out hidden layers when searching the map for
|
||||
* layers to query. Default is false.
|
||||
*/
|
||||
queryVisible: false,
|
||||
|
||||
/**
|
||||
* Property: url
|
||||
* APIProperty: url
|
||||
* {String} The URL of the WMS service to use. If not provided, the url
|
||||
* of the first eligible layer will be used.
|
||||
*/
|
||||
url: null,
|
||||
|
||||
|
||||
/**
|
||||
* Property: layerUrls
|
||||
* APIProperty: layerUrls
|
||||
* {Array(String)} Optional list of urls for layers that should be queried.
|
||||
* This can be used when the layer url differs from the url used for
|
||||
* making GetFeatureInfo requests (in the case of a layer using cached
|
||||
@@ -96,18 +98,18 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
|
||||
layerUrls: null,
|
||||
|
||||
/**
|
||||
* Property: infoFormat
|
||||
* {String} The mimetype to request from the server. If you are using
|
||||
* drillDown mode and have multiple servers that do not share a common
|
||||
* infoFormat, you can override the control's infoFormat by providing an
|
||||
* INFO_FORMAT parameter in your <OpenLayers.Layer.WMS> instance(s).
|
||||
* APIProperty: infoFormat
|
||||
* {String} The mimetype to request from the server. If you are using
|
||||
* drillDown mode and have multiple servers that do not share a common
|
||||
* infoFormat, you can override the control's infoFormat by providing an
|
||||
* INFO_FORMAT parameter in your <OpenLayers.Layer.WMS> instance(s).
|
||||
*/
|
||||
infoFormat: 'text/html',
|
||||
|
||||
|
||||
/**
|
||||
* Property: vendorParams
|
||||
* APIProperty: vendorParams
|
||||
* {Object} Additional parameters that will be added to the request, for
|
||||
* WMS implementations that support them. This could e.g. look like
|
||||
* WMS implementations that support them. This could e.g. look like
|
||||
* (start code)
|
||||
* {
|
||||
* radius: 5
|
||||
@@ -115,16 +117,16 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
|
||||
* (end)
|
||||
*/
|
||||
vendorParams: {},
|
||||
|
||||
|
||||
/**
|
||||
* Property: format
|
||||
* APIProperty: format
|
||||
* {<OpenLayers.Format>} A format for parsing GetFeatureInfo responses.
|
||||
* Default is <OpenLayers.Format.WMSGetFeatureInfo>.
|
||||
*/
|
||||
format: null,
|
||||
|
||||
|
||||
/**
|
||||
* Property: formatOptions
|
||||
* APIProperty: formatOptions
|
||||
* {Object} Optional properties to set on the format (if one is not provided
|
||||
* in the <format> property.
|
||||
*/
|
||||
@@ -140,21 +142,21 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
|
||||
* }
|
||||
* (end)
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Property: handler
|
||||
* {Object} Reference to the <OpenLayers.Handler> for this control
|
||||
*/
|
||||
handler: null,
|
||||
|
||||
|
||||
/**
|
||||
* Property: hoverRequest
|
||||
* {<OpenLayers.Request>} contains the currently running hover request
|
||||
* (if any).
|
||||
*/
|
||||
hoverRequest: null,
|
||||
|
||||
/**
|
||||
|
||||
/**
|
||||
* APIProperty: events
|
||||
* {<OpenLayers.Events>} Events instance for listeners and triggering
|
||||
* control specific events.
|
||||
@@ -166,7 +168,7 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
|
||||
*
|
||||
* Supported event types (in addition to those from <OpenLayers.Control.events>):
|
||||
* beforegetfeatureinfo - Triggered before the request is sent.
|
||||
* The event object has an *xy* property with the position of the
|
||||
* The event object has an *xy* property with the position of the
|
||||
* mouse click or hover event that triggers the request.
|
||||
* nogetfeatureinfo - no queryable layers were found.
|
||||
* getfeatureinfo - Triggered when a GetFeatureInfo response is received.
|
||||
@@ -184,20 +186,20 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
|
||||
* Constructor: <OpenLayers.Control.WMSGetFeatureInfo>
|
||||
*
|
||||
* Parameters:
|
||||
* options - {Object}
|
||||
* options - {Object}
|
||||
*/
|
||||
initialize: function(options) {
|
||||
options = options || {};
|
||||
options.handlerOptions = options.handlerOptions || {};
|
||||
|
||||
OpenLayers.Control.prototype.initialize.apply(this, [options]);
|
||||
|
||||
|
||||
if(!this.format) {
|
||||
this.format = new OpenLayers.Format.WMSGetFeatureInfo(
|
||||
options.formatOptions
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if(this.drillDown === true) {
|
||||
this.hover = false;
|
||||
}
|
||||
@@ -220,11 +222,11 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: getInfoForClick
|
||||
* Method: getInfoForClick
|
||||
* Called on click
|
||||
*
|
||||
* Parameters:
|
||||
* evt - {<OpenLayers.Event>}
|
||||
* evt - {<OpenLayers.Event>}
|
||||
*/
|
||||
getInfoForClick: function(evt) {
|
||||
this.events.triggerEvent("beforegetfeatureinfo", {xy: evt.xy});
|
||||
@@ -233,7 +235,7 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
|
||||
OpenLayers.Element.addClass(this.map.viewPortDiv, "olCursorWait");
|
||||
this.request(evt.xy, {});
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Method: getInfoForHover
|
||||
* Pause callback for the hover handler
|
||||
@@ -284,7 +286,7 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
|
||||
}
|
||||
return layers;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Method: urlMatches
|
||||
* Test to see if the provided url matches either the control <url> or one
|
||||
@@ -383,7 +385,7 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
|
||||
* Method: getStyleNames
|
||||
* Gets the STYLES parameter for the layer. Make sure the STYLES parameter
|
||||
* matches the LAYERS parameter
|
||||
*
|
||||
*
|
||||
* Parameters:
|
||||
* layer - {<OpenLayers.Layer.WMS>}
|
||||
*
|
||||
@@ -411,12 +413,12 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
|
||||
/**
|
||||
* Method: request
|
||||
* Sends a GetFeatureInfo request to the WMS
|
||||
*
|
||||
*
|
||||
* Parameters:
|
||||
* clickPosition - {<OpenLayers.Pixel>} The position on the map where the
|
||||
* mouse event occurred.
|
||||
* options - {Object} additional options for this method.
|
||||
*
|
||||
*
|
||||
* Valid options:
|
||||
* - *hover* {Boolean} true if we do the request for the hover handler
|
||||
*/
|
||||
@@ -428,13 +430,13 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
|
||||
OpenLayers.Element.removeClass(this.map.viewPortDiv, "olCursorWait");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
options = options || {};
|
||||
if(this.drillDown === false) {
|
||||
var wmsOptions = this.buildWMSOptions(this.url, layers,
|
||||
clickPosition, layers[0].params.FORMAT);
|
||||
clickPosition, layers[0].params.FORMAT);
|
||||
var request = OpenLayers.Request.GET(wmsOptions);
|
||||
|
||||
|
||||
if (options.hover === true) {
|
||||
this.hoverRequest = request;
|
||||
}
|
||||
@@ -458,9 +460,9 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
|
||||
var layers;
|
||||
for (var url in services) {
|
||||
layers = services[url];
|
||||
var wmsOptions = this.buildWMSOptions(url, layers,
|
||||
var wmsOptions = this.buildWMSOptions(url, layers,
|
||||
clickPosition, layers[0].params.FORMAT);
|
||||
OpenLayers.Request.GET(wmsOptions);
|
||||
OpenLayers.Request.GET(wmsOptions);
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -488,11 +490,11 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
|
||||
// Reset the cursor.
|
||||
OpenLayers.Element.removeClass(this.map.viewPortDiv, "olCursorWait");
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Method: handleResponse
|
||||
* Handler for the GetFeatureInfo response.
|
||||
*
|
||||
*
|
||||
* Parameters:
|
||||
* xy - {<OpenLayers.Pixel>} The position on the map where the
|
||||
* mouse event occurred.
|
||||
@@ -500,7 +502,7 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
|
||||
* url - {String} The url which was used for this request.
|
||||
*/
|
||||
handleResponse: function(xy, request, url) {
|
||||
|
||||
|
||||
var doc = request.responseXML;
|
||||
if(!doc || !doc.documentElement) {
|
||||
doc = request.responseText;
|
||||
@@ -518,7 +520,7 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
|
||||
this._features = (this._features || []).concat(features);
|
||||
}
|
||||
if (this._requestCount === this._numRequests) {
|
||||
this.triggerGetFeatureInfo(request, xy, this._features.concat());
|
||||
this.triggerGetFeatureInfo(request, xy, this._features.concat());
|
||||
delete this._features;
|
||||
delete this._requestCount;
|
||||
delete this._numRequests;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
@@ -37,9 +37,9 @@ OpenLayers.Control.Zoom = OpenLayers.Class(OpenLayers.Control, {
|
||||
/**
|
||||
* APIProperty: zoomOutText
|
||||
* {String}
|
||||
* Text for zoom-out link. Default is "-".
|
||||
* Text for zoom-out link. Default is "\u2212".
|
||||
*/
|
||||
zoomOutText: "-",
|
||||
zoomOutText: "\u2212",
|
||||
|
||||
/**
|
||||
* APIProperty: zoomOutId
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
@@ -69,7 +69,8 @@ OpenLayers.Control.ZoomBox = OpenLayers.Class(OpenLayers.Control, {
|
||||
*/
|
||||
zoomBox: function (position) {
|
||||
if (position instanceof OpenLayers.Bounds) {
|
||||
var bounds;
|
||||
var bounds,
|
||||
targetCenterPx = position.getCenterPixel();
|
||||
if (!this.out) {
|
||||
var minXY = this.map.getLonLatFromPixel({
|
||||
x: position.left,
|
||||
@@ -82,13 +83,12 @@ OpenLayers.Control.ZoomBox = OpenLayers.Class(OpenLayers.Control, {
|
||||
bounds = new OpenLayers.Bounds(minXY.lon, minXY.lat,
|
||||
maxXY.lon, maxXY.lat);
|
||||
} else {
|
||||
var pixWidth = Math.abs(position.right-position.left);
|
||||
var pixHeight = Math.abs(position.top-position.bottom);
|
||||
var pixWidth = position.right - position.left;
|
||||
var pixHeight = position.bottom - position.top;
|
||||
var zoomFactor = Math.min((this.map.size.h / pixHeight),
|
||||
(this.map.size.w / pixWidth));
|
||||
var extent = this.map.getExtent();
|
||||
var center = this.map.getLonLatFromPixel(
|
||||
position.getCenterPixel());
|
||||
var center = this.map.getLonLatFromPixel(targetCenterPx);
|
||||
var xmin = center.lon - (extent.getWidth()/2)*zoomFactor;
|
||||
var xmax = center.lon + (extent.getWidth()/2)*zoomFactor;
|
||||
var ymin = center.lat - (extent.getHeight()/2)*zoomFactor;
|
||||
@@ -96,18 +96,27 @@ OpenLayers.Control.ZoomBox = OpenLayers.Class(OpenLayers.Control, {
|
||||
bounds = new OpenLayers.Bounds(xmin, ymin, xmax, ymax);
|
||||
}
|
||||
// always zoom in/out
|
||||
var lastZoom = this.map.getZoom();
|
||||
this.map.zoomToExtent(bounds);
|
||||
var lastZoom = this.map.getZoom(),
|
||||
size = this.map.getSize(),
|
||||
centerPx = {x: size.w / 2, y: size.h / 2},
|
||||
zoom = this.map.getZoomForExtent(bounds),
|
||||
oldRes = this.map.getResolution(),
|
||||
newRes = this.map.getResolutionForZoom(zoom),
|
||||
zoomOriginPx = {
|
||||
x: (oldRes * targetCenterPx.x - newRes * centerPx.x) /
|
||||
(oldRes - newRes),
|
||||
y: (oldRes * targetCenterPx.y - newRes * centerPx.y) /
|
||||
(oldRes - newRes)
|
||||
};
|
||||
this.map.zoomTo(zoom, zoomOriginPx);
|
||||
if (lastZoom == this.map.getZoom() && this.alwaysZoom == true){
|
||||
this.map.zoomTo(lastZoom + (this.out ? -1 : 1));
|
||||
}
|
||||
} else if (this.zoomOnClick) { // it's a pixel
|
||||
if (!this.out) {
|
||||
this.map.setCenter(this.map.getLonLatFromPixel(position),
|
||||
this.map.getZoom() + 1);
|
||||
this.map.zoomTo(this.map.getZoom() + 1, position);
|
||||
} else {
|
||||
this.map.setCenter(this.map.getLonLatFromPixel(position),
|
||||
this.map.getZoom() - 1);
|
||||
this.map.zoomTo(this.map.getZoom() - 1, position);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
|
||||
/**
|
||||
* @requires OpenLayers/Control.js
|
||||
* @requires OpenLayers/Control/Button.js
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -14,21 +14,15 @@
|
||||
* Inherits from:
|
||||
* - <OpenLayers.Control>
|
||||
*/
|
||||
OpenLayers.Control.ZoomIn = OpenLayers.Class(OpenLayers.Control, {
|
||||
OpenLayers.Control.ZoomIn = OpenLayers.Class(OpenLayers.Control.Button, {
|
||||
|
||||
/**
|
||||
* Property: type
|
||||
* {String} The type of <OpenLayers.Control> -- When added to a
|
||||
* <Control.Panel>, 'type' is used by the panel to determine how to
|
||||
* handle our events.
|
||||
*/
|
||||
type: OpenLayers.Control.TYPE_BUTTON,
|
||||
|
||||
/**
|
||||
* Method: trigger
|
||||
*/
|
||||
trigger: function(){
|
||||
this.map.zoomIn();
|
||||
if (this.map) {
|
||||
this.map.zoomIn();
|
||||
}
|
||||
},
|
||||
|
||||
CLASS_NAME: "OpenLayers.Control.ZoomIn"
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
|
||||
/**
|
||||
* @requires OpenLayers/Control.js
|
||||
* @requires OpenLayers/Control/Button.js
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -14,21 +14,15 @@
|
||||
* Inherits from:
|
||||
* - <OpenLayers.Control>
|
||||
*/
|
||||
OpenLayers.Control.ZoomOut = OpenLayers.Class(OpenLayers.Control, {
|
||||
OpenLayers.Control.ZoomOut = OpenLayers.Class(OpenLayers.Control.Button, {
|
||||
|
||||
/**
|
||||
* Property: type
|
||||
* {String} The type of <OpenLayers.Control> -- When added to a
|
||||
* <Control.Panel>, 'type' is used by the panel to determine how to
|
||||
* handle our events.
|
||||
*/
|
||||
type: OpenLayers.Control.TYPE_BUTTON,
|
||||
|
||||
/**
|
||||
* Method: trigger
|
||||
*/
|
||||
trigger: function(){
|
||||
this.map.zoomOut();
|
||||
if (this.map) {
|
||||
this.map.zoomOut();
|
||||
}
|
||||
},
|
||||
|
||||
CLASS_NAME: "OpenLayers.Control.ZoomOut"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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 2-clause BSD license.
|
||||
* See license.txt in the OpenLayers distribution or repository for the
|
||||
* full text of the license. */
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user