Compare commits
289 Commits
release-2.
...
release-2.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
606991fc0d | ||
|
|
2642f000fd | ||
|
|
8ebc5b227a | ||
|
|
4cac0a24ea | ||
|
|
6c9cb570c7 | ||
|
|
f028effec2 | ||
|
|
5d00a21863 | ||
|
|
ba85494e5e | ||
|
|
7c0bc17be1 | ||
|
|
86d4133039 | ||
|
|
6462a7dc29 | ||
|
|
112978ac3d | ||
|
|
01cf10f53d | ||
|
|
88ac5a803c | ||
|
|
7e9eef8d07 | ||
|
|
b46a513077 | ||
|
|
f17ec3ab7d | ||
|
|
063a10d4ac | ||
|
|
46767efed2 | ||
|
|
9c6817f5d6 | ||
|
|
94dc03ea90 | ||
|
|
2d7f2d2f47 | ||
|
|
c014e5ea72 | ||
|
|
d5a7f1ef5c | ||
|
|
ba89ea595e | ||
|
|
cc3a4c113b | ||
|
|
2467940cd3 | ||
|
|
bef4a7d3a9 | ||
|
|
046fbf0662 | ||
|
|
632a2bd123 | ||
|
|
ff4899f520 | ||
|
|
15c2ab578f | ||
|
|
c951391368 | ||
|
|
36eb8c0bc9 | ||
|
|
e6ef35c174 | ||
|
|
5e7b2e03f1 | ||
|
|
71bcdb9b7c | ||
|
|
e1d715fc94 | ||
|
|
4c9e46e240 | ||
|
|
c14732b711 | ||
|
|
41f798eaf2 | ||
|
|
d77b849405 | ||
|
|
b4ae7778b6 | ||
|
|
76850371fe | ||
|
|
fb7b5fff56 | ||
|
|
57dc3a7f53 | ||
|
|
ac949589a0 | ||
|
|
1f18b68e7d | ||
|
|
17633136aa | ||
|
|
6e8754af91 | ||
|
|
876051d619 | ||
|
|
8bd55016aa | ||
|
|
7ecc62e55a | ||
|
|
819ccd7e06 | ||
|
|
b5334bde43 | ||
|
|
1325843cb3 | ||
|
|
9f9c366154 | ||
|
|
3d58bc6698 | ||
|
|
786c2a20fb | ||
|
|
af6307fd9b | ||
|
|
43c916a433 | ||
|
|
69b66e2100 | ||
|
|
f50fd0b7ac | ||
|
|
7ced2241fe | ||
|
|
02c285091e | ||
|
|
e31b13135d | ||
|
|
7eb3f4bb9a | ||
|
|
cb3af3eaba | ||
|
|
27a8fee770 | ||
|
|
b1490cf7a9 | ||
|
|
97f92fb3a8 | ||
|
|
0450c8e21e | ||
|
|
7c2a8a0cab | ||
|
|
60ba893119 | ||
|
|
da1984d764 | ||
|
|
e3386b3d50 | ||
|
|
a9baa4798f | ||
|
|
4aef16e1bd | ||
|
|
185fd44437 | ||
|
|
8b909e9e53 | ||
|
|
9bae3e8848 | ||
|
|
f27cbc855f | ||
|
|
e7834c8922 | ||
|
|
9b73a9a4c9 | ||
|
|
5425ea861c | ||
|
|
6387b71d88 | ||
|
|
53d2fd3033 | ||
|
|
3be99e67e6 | ||
|
|
5280553306 | ||
|
|
95ec8bdc82 | ||
|
|
f49885444b | ||
|
|
8e4b06effd | ||
|
|
990f01a9c2 | ||
|
|
f97ffae403 | ||
|
|
c6d40eb2d3 | ||
|
|
a5483e0f6d | ||
|
|
9e8f7f796c | ||
|
|
dd3562c26a | ||
|
|
7e5cd23ad0 | ||
|
|
5364ce73e5 | ||
|
|
781fbf1822 | ||
|
|
99ea5db027 | ||
|
|
fbd82a300b | ||
|
|
7562f7097f | ||
|
|
dd2a5df781 | ||
|
|
f5d644733b | ||
|
|
5d4ba864dc | ||
|
|
407604cc35 | ||
|
|
7ba704305a | ||
|
|
a1ca8ebd08 | ||
|
|
7a1d3601a1 | ||
|
|
bf075e63e0 | ||
|
|
a0ed21125c | ||
|
|
46b0402b0b | ||
|
|
ad545a0280 | ||
|
|
6366edc515 | ||
|
|
2b7c6cc844 | ||
|
|
3cf66a5779 | ||
|
|
fee4d6f973 | ||
|
|
8782ee3e15 | ||
|
|
1f4a53291f | ||
|
|
6de0698f43 | ||
|
|
9e4bf497ca | ||
|
|
3a177683d5 | ||
|
|
ab4f69ac48 | ||
|
|
a1a1128ac7 | ||
|
|
07ef71b7b0 | ||
|
|
d81c2f0187 | ||
|
|
deb64d31fe | ||
|
|
0da08584d8 | ||
|
|
17eecb955d | ||
|
|
c6db421ae6 | ||
|
|
4739147a2f | ||
|
|
efa9499d57 | ||
|
|
67ced536c0 | ||
|
|
33c37ef78b | ||
|
|
fcc84782df | ||
|
|
fe4ae239d5 | ||
|
|
3a611993ce | ||
|
|
1414f0f656 | ||
|
|
abde2fbc23 | ||
|
|
5d724258e1 | ||
|
|
dc34753b50 | ||
|
|
510ab8561c | ||
|
|
f428473283 | ||
|
|
1935953796 | ||
|
|
844f92afe5 | ||
|
|
3ece418354 | ||
|
|
86d573dd83 | ||
|
|
dc7c266f1f | ||
|
|
8dfb4c3ce9 | ||
|
|
e1a36bdc58 | ||
|
|
9f9c53218a | ||
|
|
4a14ae5346 | ||
|
|
994230e580 | ||
|
|
91505ff5d6 | ||
|
|
526c8a6e1e | ||
|
|
25da469210 | ||
|
|
7fa0910fcf | ||
|
|
66250b1342 | ||
|
|
964f777e64 | ||
|
|
7280a6211e | ||
|
|
4f8c62df3f | ||
|
|
3a3e412090 | ||
|
|
10e7761a97 | ||
|
|
8fe89ba734 | ||
|
|
3e4109781b | ||
|
|
348b0b388d | ||
|
|
634588abf0 | ||
|
|
7e11c37610 | ||
|
|
0adeb2670d | ||
|
|
97418cb70b | ||
|
|
cab24b665d | ||
|
|
628409a993 | ||
|
|
a758efb2f2 | ||
|
|
642c438c2c | ||
|
|
2cb4306beb | ||
|
|
66a5d90965 | ||
|
|
07fc49ab31 | ||
|
|
36a76054a4 | ||
|
|
41f619b05e | ||
|
|
890b2a6ffc | ||
|
|
14a2418a62 | ||
|
|
5852fb835e | ||
|
|
c5f2196f98 | ||
|
|
2c80da26ff | ||
|
|
ee29537bbe | ||
|
|
1de712c82f | ||
|
|
97147a21a8 | ||
|
|
381f1d454d | ||
|
|
0565566118 | ||
|
|
cf7920ea11 | ||
|
|
73fb43712f | ||
|
|
1cedf957b0 | ||
|
|
b774b592cd | ||
|
|
3b60032995 | ||
|
|
b5c6522c2b | ||
|
|
2255e7d56c | ||
|
|
e658877014 | ||
|
|
5804cc6cb3 | ||
|
|
003f00bc22 | ||
|
|
dabba5ef41 | ||
|
|
086e1efb5f | ||
|
|
6e2fd1bbf9 | ||
|
|
492b144147 | ||
|
|
5bd2c55610 | ||
|
|
c52e730378 | ||
|
|
439ff9943e | ||
|
|
a558ad0d88 | ||
|
|
42cb6b1fc3 | ||
|
|
157af40d45 | ||
|
|
651caa931a | ||
|
|
7cd4022d7b | ||
|
|
34dfbef5a5 | ||
|
|
b77dc94f32 | ||
|
|
4ab9950902 | ||
|
|
22c3ba7430 | ||
|
|
520f081688 | ||
|
|
601a6c8376 | ||
|
|
263ff16782 | ||
|
|
74dfbbc927 | ||
|
|
c38874b374 | ||
|
|
42db224f3d | ||
|
|
5ad0f05fc2 | ||
|
|
d289fea786 | ||
|
|
dd41ac7693 | ||
|
|
88ff0bc9af | ||
|
|
f9fdb04f8c | ||
|
|
e295aee763 | ||
|
|
760e1ca014 | ||
|
|
c0fc945824 | ||
|
|
24381c2f37 | ||
|
|
cea09f7fdb | ||
|
|
25b539d8bb | ||
|
|
c76dc1c211 | ||
|
|
c5afbacc93 | ||
|
|
a210e16479 | ||
|
|
9cf595df01 | ||
|
|
7ce7f2484b | ||
|
|
6793507a34 | ||
|
|
c8e7d93f95 | ||
|
|
84a677f910 | ||
|
|
9d0c94d915 | ||
|
|
4a65590d3e | ||
|
|
720c8507f7 | ||
|
|
28bff61128 | ||
|
|
8305808bee | ||
|
|
83f26a9336 | ||
|
|
e1878d3f65 | ||
|
|
244e9543cd | ||
|
|
b157687eb2 | ||
|
|
cab72e3299 | ||
|
|
861335f356 | ||
|
|
899101ef0b | ||
|
|
31692f51fe | ||
|
|
e906982443 | ||
|
|
9b355b76dc | ||
|
|
00e354511e | ||
|
|
74f5b814eb | ||
|
|
6fd2302450 | ||
|
|
dd3dcef4ed | ||
|
|
e8bd5086df | ||
|
|
e1a1b94582 | ||
|
|
4b0d947f3e | ||
|
|
51c86b7b3c | ||
|
|
ae704e5158 | ||
|
|
33499f59e9 | ||
|
|
7a1ae31fc4 | ||
|
|
d1ac37984e | ||
|
|
a2ded73387 | ||
|
|
ef00010111 | ||
|
|
0c1caaf717 | ||
|
|
8be2cfbc71 | ||
|
|
ecdb77fa9c | ||
|
|
954d0b351a | ||
|
|
57161a94be | ||
|
|
693eab5cc9 | ||
|
|
d486e1964b | ||
|
|
b9c6293b2c | ||
|
|
f582775d11 | ||
|
|
a8891101d6 | ||
|
|
b6200568d4 | ||
|
|
84d4e70fa5 | ||
|
|
e9331479dc | ||
|
|
7ed62ba639 | ||
|
|
9233d5446d | ||
|
|
104e509eb9 | ||
|
|
282d9d6047 | ||
|
|
2871b2c38c |
@@ -1,36 +1,36 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 12.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 51448) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
|
||||
<!ENTITY ns_extend "http://ns.adobe.com/Extensibility/1.0/">
|
||||
<!ENTITY ns_ai "http://ns.adobe.com/AdobeIllustrator/10.0/">
|
||||
<!ENTITY ns_graphs "http://ns.adobe.com/Graphs/1.0/">
|
||||
<!ENTITY ns_vars "http://ns.adobe.com/Variables/1.0/">
|
||||
<!ENTITY ns_imrep "http://ns.adobe.com/ImageReplacement/1.0/">
|
||||
<!ENTITY ns_sfw "http://ns.adobe.com/SaveForWeb/1.0/">
|
||||
<!ENTITY ns_custom "http://ns.adobe.com/GenericCustomNamespace/1.0/">
|
||||
<!ENTITY ns_adobe_xpath "http://ns.adobe.com/XPath/1.0/">
|
||||
<!ENTITY ns_svg "http://www.w3.org/2000/svg">
|
||||
<!ENTITY ns_xlink "http://www.w3.org/1999/xlink">
|
||||
]>
|
||||
<svg version="1.1" id="Layer_1" xmlns:x="&ns_extend;" xmlns:i="&ns_ai;" xmlns:graph="&ns_graphs;"
|
||||
xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" width="28.375" height="28" viewBox="0 0 28.375 28"
|
||||
overflow="visible" enable-background="new 0 0 28.375 28" xml:space="preserve">
|
||||
<g i:extraneous="self">
|
||||
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M27.875,1.375"/>
|
||||
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M0,1.375"/>
|
||||
<path fill="none" stroke="#FFFFFF" d="M0,27.475"/>
|
||||
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M1,27.645"/>
|
||||
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M1,0.544"/>
|
||||
<line fill="none" stroke="#00008B" x1="0.875" y1="27.5" x2="27.875" y2="27.475"/>
|
||||
<rect x="0.875" y="1.045" fill="#00008B" width="27.125" height="26"/>
|
||||
<line fill="none" stroke="#00008B" x1="27.875" y1="26.925" x2="27.875" y2="0.925"/>
|
||||
<line fill="none" stroke="#FFFFFF" x1="1.375" y1="0.5" x2="27.375" y2="0.5"/>
|
||||
<line fill="none" stroke="#FFFFFF" x1="0.875" y1="1" x2="0.875" y2="27"/>
|
||||
|
||||
<rect x="5.252" y="11.157" transform="matrix(0.7933 -0.6088 0.6088 0.7933 -5.1621 12.1086)" fill="#FFBF00" width="20" height="5"/>
|
||||
<line fill="#FFBF00" stroke="#000000" x1="8.376" y1="15.783" x2="10.717" y2="18.766"/>
|
||||
<line fill="#FFBF00" stroke="#000000" x1="11.946" y1="13.043" x2="14.288" y2="16.027"/>
|
||||
<line fill="#FFBF00" stroke="#000000" x1="15.342" y1="10.437" x2="17.684" y2="13.42"/>
|
||||
<line fill="#FFBF00" stroke="#000000" x1="18.69" y1="7.869" x2="21.03" y2="10.852"/>
|
||||
</g>
|
||||
</svg>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 12.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 51448) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
|
||||
<!ENTITY ns_extend "http://ns.adobe.com/Extensibility/1.0/">
|
||||
<!ENTITY ns_ai "http://ns.adobe.com/AdobeIllustrator/10.0/">
|
||||
<!ENTITY ns_graphs "http://ns.adobe.com/Graphs/1.0/">
|
||||
<!ENTITY ns_vars "http://ns.adobe.com/Variables/1.0/">
|
||||
<!ENTITY ns_imrep "http://ns.adobe.com/ImageReplacement/1.0/">
|
||||
<!ENTITY ns_sfw "http://ns.adobe.com/SaveForWeb/1.0/">
|
||||
<!ENTITY ns_custom "http://ns.adobe.com/GenericCustomNamespace/1.0/">
|
||||
<!ENTITY ns_adobe_xpath "http://ns.adobe.com/XPath/1.0/">
|
||||
<!ENTITY ns_svg "http://www.w3.org/2000/svg">
|
||||
<!ENTITY ns_xlink "http://www.w3.org/1999/xlink">
|
||||
]>
|
||||
<svg version="1.1" id="Layer_1" xmlns:x="&ns_extend;" xmlns:i="&ns_ai;" xmlns:graph="&ns_graphs;"
|
||||
xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" width="28.375" height="28" viewBox="0 0 28.375 28"
|
||||
overflow="visible" enable-background="new 0 0 28.375 28" xml:space="preserve">
|
||||
<g i:extraneous="self">
|
||||
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M27.875,1.375"/>
|
||||
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M0,1.375"/>
|
||||
<path fill="none" stroke="#FFFFFF" d="M0,27.475"/>
|
||||
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M1,27.645"/>
|
||||
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M1,0.544"/>
|
||||
<line fill="none" stroke="#00008B" x1="0.875" y1="27.5" x2="27.875" y2="27.475"/>
|
||||
<rect x="0.875" y="1.045" fill="#00008B" width="27.125" height="26"/>
|
||||
<line fill="none" stroke="#00008B" x1="27.875" y1="26.925" x2="27.875" y2="0.925"/>
|
||||
<line fill="none" stroke="#FFFFFF" x1="1.375" y1="0.5" x2="27.375" y2="0.5"/>
|
||||
<line fill="none" stroke="#FFFFFF" x1="0.875" y1="1" x2="0.875" y2="27"/>
|
||||
|
||||
<rect x="5.252" y="11.157" transform="matrix(0.7933 -0.6088 0.6088 0.7933 -5.1621 12.1086)" fill="#FFBF00" width="20" height="5"/>
|
||||
<line fill="#FFBF00" stroke="#000000" x1="8.376" y1="15.783" x2="10.717" y2="18.766"/>
|
||||
<line fill="#FFBF00" stroke="#000000" x1="11.946" y1="13.043" x2="14.288" y2="16.027"/>
|
||||
<line fill="#FFBF00" stroke="#000000" x1="15.342" y1="10.437" x2="17.684" y2="13.42"/>
|
||||
<line fill="#FFBF00" stroke="#000000" x1="18.69" y1="7.869" x2="21.03" y2="10.852"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
@@ -1,36 +1,36 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 12.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 51448) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
|
||||
<!ENTITY ns_extend "http://ns.adobe.com/Extensibility/1.0/">
|
||||
<!ENTITY ns_ai "http://ns.adobe.com/AdobeIllustrator/10.0/">
|
||||
<!ENTITY ns_graphs "http://ns.adobe.com/Graphs/1.0/">
|
||||
<!ENTITY ns_vars "http://ns.adobe.com/Variables/1.0/">
|
||||
<!ENTITY ns_imrep "http://ns.adobe.com/ImageReplacement/1.0/">
|
||||
<!ENTITY ns_sfw "http://ns.adobe.com/SaveForWeb/1.0/">
|
||||
<!ENTITY ns_custom "http://ns.adobe.com/GenericCustomNamespace/1.0/">
|
||||
<!ENTITY ns_adobe_xpath "http://ns.adobe.com/XPath/1.0/">
|
||||
<!ENTITY ns_svg "http://www.w3.org/2000/svg">
|
||||
<!ENTITY ns_xlink "http://www.w3.org/1999/xlink">
|
||||
]>
|
||||
<svg version="1.1" id="Layer_1" xmlns:x="&ns_extend;" xmlns:i="&ns_ai;" xmlns:graph="&ns_graphs;"
|
||||
xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" width="28.375" height="28" viewBox="0 0 28.375 28"
|
||||
overflow="visible" enable-background="new 0 0 28.375 28" xml:space="preserve">
|
||||
<g i:extraneous="self">
|
||||
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M27.875,1.375"/>
|
||||
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M0,1.375"/>
|
||||
<path fill="none" stroke="#FFFFFF" d="M0,27.475"/>
|
||||
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M1,27.645"/>
|
||||
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M1,0.544"/>
|
||||
<line fill="none" stroke="#FFFFFF" x1="0.875" y1="27.5" x2="27.875" y2="27.475"/>
|
||||
<rect x="0.875" y="1.045" fill="#ADD8E6" width="27.125" height="26"/>
|
||||
<line fill="none" stroke="#FFFFFF" x1="27.875" y1="26.925" x2="27.875" y2="0.925"/>
|
||||
<line fill="none" stroke="#00008B" x1="1.375" y1="0.5" x2="27.375" y2="0.5"/>
|
||||
<line fill="none" stroke="#00008B" x1="0.875" y1="1" x2="0.875" y2="27"/>
|
||||
|
||||
<rect x="4.252" y="12.157" transform="matrix(0.7933 -0.6088 0.6088 0.7933 -5.9776 11.7065)" fill="#FFBF00" width="20" height="5"/>
|
||||
<line fill="#FFBF00" stroke="#000000" x1="7.376" y1="16.783" x2="9.717" y2="19.766"/>
|
||||
<line fill="#FFBF00" stroke="#000000" x1="10.946" y1="14.043" x2="13.288" y2="17.027"/>
|
||||
<line fill="#FFBF00" stroke="#000000" x1="14.342" y1="11.437" x2="16.684" y2="14.42"/>
|
||||
<line fill="#FFBF00" stroke="#000000" x1="17.69" y1="8.869" x2="20.03" y2="11.852"/>
|
||||
</g>
|
||||
</svg>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 12.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 51448) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
|
||||
<!ENTITY ns_extend "http://ns.adobe.com/Extensibility/1.0/">
|
||||
<!ENTITY ns_ai "http://ns.adobe.com/AdobeIllustrator/10.0/">
|
||||
<!ENTITY ns_graphs "http://ns.adobe.com/Graphs/1.0/">
|
||||
<!ENTITY ns_vars "http://ns.adobe.com/Variables/1.0/">
|
||||
<!ENTITY ns_imrep "http://ns.adobe.com/ImageReplacement/1.0/">
|
||||
<!ENTITY ns_sfw "http://ns.adobe.com/SaveForWeb/1.0/">
|
||||
<!ENTITY ns_custom "http://ns.adobe.com/GenericCustomNamespace/1.0/">
|
||||
<!ENTITY ns_adobe_xpath "http://ns.adobe.com/XPath/1.0/">
|
||||
<!ENTITY ns_svg "http://www.w3.org/2000/svg">
|
||||
<!ENTITY ns_xlink "http://www.w3.org/1999/xlink">
|
||||
]>
|
||||
<svg version="1.1" id="Layer_1" xmlns:x="&ns_extend;" xmlns:i="&ns_ai;" xmlns:graph="&ns_graphs;"
|
||||
xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" width="28.375" height="28" viewBox="0 0 28.375 28"
|
||||
overflow="visible" enable-background="new 0 0 28.375 28" xml:space="preserve">
|
||||
<g i:extraneous="self">
|
||||
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M27.875,1.375"/>
|
||||
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M0,1.375"/>
|
||||
<path fill="none" stroke="#FFFFFF" d="M0,27.475"/>
|
||||
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M1,27.645"/>
|
||||
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M1,0.544"/>
|
||||
<line fill="none" stroke="#FFFFFF" x1="0.875" y1="27.5" x2="27.875" y2="27.475"/>
|
||||
<rect x="0.875" y="1.045" fill="#ADD8E6" width="27.125" height="26"/>
|
||||
<line fill="none" stroke="#FFFFFF" x1="27.875" y1="26.925" x2="27.875" y2="0.925"/>
|
||||
<line fill="none" stroke="#00008B" x1="1.375" y1="0.5" x2="27.375" y2="0.5"/>
|
||||
<line fill="none" stroke="#00008B" x1="0.875" y1="1" x2="0.875" y2="27"/>
|
||||
|
||||
<rect x="4.252" y="12.157" transform="matrix(0.7933 -0.6088 0.6088 0.7933 -5.9776 11.7065)" fill="#FFBF00" width="20" height="5"/>
|
||||
<line fill="#FFBF00" stroke="#000000" x1="7.376" y1="16.783" x2="9.717" y2="19.766"/>
|
||||
<line fill="#FFBF00" stroke="#000000" x1="10.946" y1="14.043" x2="13.288" y2="17.027"/>
|
||||
<line fill="#FFBF00" stroke="#000000" x1="14.342" y1="11.437" x2="16.684" y2="14.42"/>
|
||||
<line fill="#FFBF00" stroke="#000000" x1="17.69" y1="8.869" x2="20.03" y2="11.852"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
@@ -1,44 +1,44 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 12.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 51448) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
|
||||
<!ENTITY ns_extend "http://ns.adobe.com/Extensibility/1.0/">
|
||||
<!ENTITY ns_ai "http://ns.adobe.com/AdobeIllustrator/10.0/">
|
||||
<!ENTITY ns_graphs "http://ns.adobe.com/Graphs/1.0/">
|
||||
<!ENTITY ns_vars "http://ns.adobe.com/Variables/1.0/">
|
||||
<!ENTITY ns_imrep "http://ns.adobe.com/ImageReplacement/1.0/">
|
||||
<!ENTITY ns_sfw "http://ns.adobe.com/SaveForWeb/1.0/">
|
||||
<!ENTITY ns_custom "http://ns.adobe.com/GenericCustomNamespace/1.0/">
|
||||
<!ENTITY ns_adobe_xpath "http://ns.adobe.com/XPath/1.0/">
|
||||
<!ENTITY ns_svg "http://www.w3.org/2000/svg">
|
||||
<!ENTITY ns_xlink "http://www.w3.org/1999/xlink">
|
||||
]>
|
||||
<svg version="1.1" id="Layer_1" xmlns:x="&ns_extend;" xmlns:i="&ns_ai;" xmlns:graph="&ns_graphs;"
|
||||
xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" width="28.375" height="28" viewBox="0 0 28.375 28"
|
||||
overflow="visible" enable-background="new 0 0 28.375 28" xml:space="preserve">
|
||||
<g i:extraneous="self">
|
||||
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M27.875,1.375"/>
|
||||
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M0,1.375"/>
|
||||
<path fill="none" stroke="#FFFFFF" d="M0,27.475"/>
|
||||
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M1,27.645"/>
|
||||
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M1,0.544"/>
|
||||
<line fill="none" stroke="#00008B" x1="0.875" y1="27.5" x2="27.875" y2="27.475"/>
|
||||
<rect x="0.875" y="1.045" fill="#00008B" width="27.125" height="26"/>
|
||||
<line fill="none" stroke="#00008B" x1="27.875" y1="26.925" x2="27.875" y2="0.925"/>
|
||||
<line fill="none" stroke="#FFFFFF" x1="1.375" y1="0.5" x2="27.375" y2="0.5"/>
|
||||
<line fill="none" stroke="#FFFFFF" x1="0.875" y1="1" x2="0.875" y2="27"/>
|
||||
<path fill="#FFFFFF" stroke="#000000" d="M9.458,22.458c-0.473-0.168-1.02-1.269-1.363-1.695
|
||||
c-0.479-0.595-0.894-1.245-1.377-1.829c-0.733-0.887-1.356-1.729-1.854-2.764c-0.375-0.782-0.884-1.997-0.005-2.648
|
||||
c1.036-0.767,2.095-0.162,2.934,0.479c0.844,0.646,1.729,1.18,2.526,1.869c-0.372-0.305-0.548-0.986-0.778-1.421
|
||||
c-0.253-0.477-0.565-0.906-0.822-1.375c-0.359-0.657-0.767-1.201-1.21-1.823c-0.544-0.763-1.051-1.74-0.925-2.709
|
||||
c0.133-1.025,0.972-1.527,1.924-1.207c1.202,0.405,1.969,1.692,2.627,2.698c0.636,0.971,1.201,2.159,1.938,3.042
|
||||
c-0.222-0.209-0.148-0.508-0.155-0.782c-0.01-0.37-0.097-0.626-0.219-0.967c-0.162-0.455-0.219-0.972-0.24-1.45
|
||||
c-0.034-0.776-0.25-1.465-0.25-2.247c0-0.988-0.14-1.963,0.71-2.631c0.666-0.523,1.649-0.764,2.381-0.248
|
||||
c1.385,0.976,1.057,2.999,1.209,4.458c0.079,0.759,0.165,1.489,0.2,2.263c0.022,0.496,0.209,1.067,0.168,1.558
|
||||
c-0.146-0.269-0.113-0.749-0.127-1.057c-0.022-0.502-0.041-0.982-0.115-1.47c-0.114-0.743-0.188-1.564-0.25-2.324
|
||||
c-0.152-1.877,2.054-3.17,3.301-1.469c0.884,1.206,0.773,2.643,0.773,4.085c0,0.698-0.034,1.251-0.22,1.91
|
||||
c-0.13,0.459-0.293,1.222-0.239,1.638c0-0.902,0.334-1.697,0.334-2.588c0-0.678-0.272-2.099,0.581-2.334
|
||||
c1.065-0.294,2.008,0.875,2.428,1.66c0.458,0.855,0.555,1.901,0.409,2.882c-0.318,2.154-0.845,4.227-2.096,6.072
|
||||
c-0.268,0.396-0.485,0.838-0.79,1.22c-0.361,0.452-0.923,0.772-1.416,1.071c-0.381,0.232-0.764,0.53-1.176,0.604
|
||||
c-0.822,0.149-1.725,0.157-2.565,0.157c-1.29,0-2.564-0.068-3.832-0.251c-0.799-0.115-2.12,0.153-2.668-0.54"/>
|
||||
</g>
|
||||
</svg>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 12.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 51448) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
|
||||
<!ENTITY ns_extend "http://ns.adobe.com/Extensibility/1.0/">
|
||||
<!ENTITY ns_ai "http://ns.adobe.com/AdobeIllustrator/10.0/">
|
||||
<!ENTITY ns_graphs "http://ns.adobe.com/Graphs/1.0/">
|
||||
<!ENTITY ns_vars "http://ns.adobe.com/Variables/1.0/">
|
||||
<!ENTITY ns_imrep "http://ns.adobe.com/ImageReplacement/1.0/">
|
||||
<!ENTITY ns_sfw "http://ns.adobe.com/SaveForWeb/1.0/">
|
||||
<!ENTITY ns_custom "http://ns.adobe.com/GenericCustomNamespace/1.0/">
|
||||
<!ENTITY ns_adobe_xpath "http://ns.adobe.com/XPath/1.0/">
|
||||
<!ENTITY ns_svg "http://www.w3.org/2000/svg">
|
||||
<!ENTITY ns_xlink "http://www.w3.org/1999/xlink">
|
||||
]>
|
||||
<svg version="1.1" id="Layer_1" xmlns:x="&ns_extend;" xmlns:i="&ns_ai;" xmlns:graph="&ns_graphs;"
|
||||
xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" width="28.375" height="28" viewBox="0 0 28.375 28"
|
||||
overflow="visible" enable-background="new 0 0 28.375 28" xml:space="preserve">
|
||||
<g i:extraneous="self">
|
||||
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M27.875,1.375"/>
|
||||
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M0,1.375"/>
|
||||
<path fill="none" stroke="#FFFFFF" d="M0,27.475"/>
|
||||
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M1,27.645"/>
|
||||
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M1,0.544"/>
|
||||
<line fill="none" stroke="#00008B" x1="0.875" y1="27.5" x2="27.875" y2="27.475"/>
|
||||
<rect x="0.875" y="1.045" fill="#00008B" width="27.125" height="26"/>
|
||||
<line fill="none" stroke="#00008B" x1="27.875" y1="26.925" x2="27.875" y2="0.925"/>
|
||||
<line fill="none" stroke="#FFFFFF" x1="1.375" y1="0.5" x2="27.375" y2="0.5"/>
|
||||
<line fill="none" stroke="#FFFFFF" x1="0.875" y1="1" x2="0.875" y2="27"/>
|
||||
<path fill="#FFFFFF" stroke="#000000" d="M9.458,22.458c-0.473-0.168-1.02-1.269-1.363-1.695
|
||||
c-0.479-0.595-0.894-1.245-1.377-1.829c-0.733-0.887-1.356-1.729-1.854-2.764c-0.375-0.782-0.884-1.997-0.005-2.648
|
||||
c1.036-0.767,2.095-0.162,2.934,0.479c0.844,0.646,1.729,1.18,2.526,1.869c-0.372-0.305-0.548-0.986-0.778-1.421
|
||||
c-0.253-0.477-0.565-0.906-0.822-1.375c-0.359-0.657-0.767-1.201-1.21-1.823c-0.544-0.763-1.051-1.74-0.925-2.709
|
||||
c0.133-1.025,0.972-1.527,1.924-1.207c1.202,0.405,1.969,1.692,2.627,2.698c0.636,0.971,1.201,2.159,1.938,3.042
|
||||
c-0.222-0.209-0.148-0.508-0.155-0.782c-0.01-0.37-0.097-0.626-0.219-0.967c-0.162-0.455-0.219-0.972-0.24-1.45
|
||||
c-0.034-0.776-0.25-1.465-0.25-2.247c0-0.988-0.14-1.963,0.71-2.631c0.666-0.523,1.649-0.764,2.381-0.248
|
||||
c1.385,0.976,1.057,2.999,1.209,4.458c0.079,0.759,0.165,1.489,0.2,2.263c0.022,0.496,0.209,1.067,0.168,1.558
|
||||
c-0.146-0.269-0.113-0.749-0.127-1.057c-0.022-0.502-0.041-0.982-0.115-1.47c-0.114-0.743-0.188-1.564-0.25-2.324
|
||||
c-0.152-1.877,2.054-3.17,3.301-1.469c0.884,1.206,0.773,2.643,0.773,4.085c0,0.698-0.034,1.251-0.22,1.91
|
||||
c-0.13,0.459-0.293,1.222-0.239,1.638c0-0.902,0.334-1.697,0.334-2.588c0-0.678-0.272-2.099,0.581-2.334
|
||||
c1.065-0.294,2.008,0.875,2.428,1.66c0.458,0.855,0.555,1.901,0.409,2.882c-0.318,2.154-0.845,4.227-2.096,6.072
|
||||
c-0.268,0.396-0.485,0.838-0.79,1.22c-0.361,0.452-0.923,0.772-1.416,1.071c-0.381,0.232-0.764,0.53-1.176,0.604
|
||||
c-0.822,0.149-1.725,0.157-2.565,0.157c-1.29,0-2.564-0.068-3.832-0.251c-0.799-0.115-2.12,0.153-2.668-0.54"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.3 KiB |
@@ -1,44 +1,44 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 12.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 51448) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
|
||||
<!ENTITY ns_extend "http://ns.adobe.com/Extensibility/1.0/">
|
||||
<!ENTITY ns_ai "http://ns.adobe.com/AdobeIllustrator/10.0/">
|
||||
<!ENTITY ns_graphs "http://ns.adobe.com/Graphs/1.0/">
|
||||
<!ENTITY ns_vars "http://ns.adobe.com/Variables/1.0/">
|
||||
<!ENTITY ns_imrep "http://ns.adobe.com/ImageReplacement/1.0/">
|
||||
<!ENTITY ns_sfw "http://ns.adobe.com/SaveForWeb/1.0/">
|
||||
<!ENTITY ns_custom "http://ns.adobe.com/GenericCustomNamespace/1.0/">
|
||||
<!ENTITY ns_adobe_xpath "http://ns.adobe.com/XPath/1.0/">
|
||||
<!ENTITY ns_svg "http://www.w3.org/2000/svg">
|
||||
<!ENTITY ns_xlink "http://www.w3.org/1999/xlink">
|
||||
]>
|
||||
<svg version="1.1" id="Layer_1" xmlns:x="&ns_extend;" xmlns:i="&ns_ai;" xmlns:graph="&ns_graphs;"
|
||||
xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" width="28.375" height="28" viewBox="0 0 28.375 28"
|
||||
overflow="visible" enable-background="new 0 0 28.375 28" xml:space="preserve">
|
||||
<g i:extraneous="self">
|
||||
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M27.875,1.375"/>
|
||||
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M0,1.375"/>
|
||||
<path fill="none" stroke="#FFFFFF" d="M0,27.475"/>
|
||||
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M1,27.645"/>
|
||||
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M1,0.544"/>
|
||||
<line fill="none" stroke="#FFFFFF" x1="0.875" y1="27.5" x2="27.875" y2="27.475"/>
|
||||
<rect x="0.875" y="1.045" fill="#ADD8E6" width="27.125" height="26"/>
|
||||
<line fill="none" stroke="#FFFFFF" x1="27.875" y1="26.925" x2="27.875" y2="0.925"/>
|
||||
<line fill="none" stroke="#00008B" x1="1.375" y1="0.5" x2="27.375" y2="0.5"/>
|
||||
<line fill="none" stroke="#00008B" x1="0.875" y1="1" x2="0.875" y2="27"/>
|
||||
<path fill="#FFFFFF" stroke="#000000" d="M8.458,23.458c-0.473-0.168-1.02-1.269-1.363-1.695
|
||||
c-0.479-0.595-0.894-1.245-1.377-1.829c-0.733-0.887-1.356-1.729-1.854-2.764c-0.375-0.782-0.884-1.997-0.005-2.648
|
||||
c1.036-0.767,2.095-0.161,2.934,0.479c0.844,0.646,1.729,1.18,2.526,1.869c-0.372-0.305-0.548-0.986-0.778-1.421
|
||||
c-0.253-0.477-0.565-0.906-0.822-1.375c-0.359-0.657-0.767-1.201-1.21-1.823c-0.544-0.763-1.051-1.74-0.925-2.709
|
||||
c0.133-1.025,0.972-1.527,1.924-1.207c1.202,0.405,1.969,1.692,2.627,2.698c0.636,0.971,1.201,2.159,1.938,3.042
|
||||
c-0.222-0.21-0.148-0.509-0.155-0.783c-0.01-0.37-0.097-0.626-0.219-0.967c-0.162-0.455-0.219-0.972-0.24-1.45
|
||||
c-0.034-0.776-0.25-1.465-0.25-2.247c0-0.988-0.14-1.963,0.71-2.631c0.666-0.523,1.649-0.764,2.381-0.248
|
||||
c1.385,0.976,1.057,2.999,1.209,4.458c0.079,0.759,0.165,1.489,0.2,2.263c0.022,0.496,0.209,1.068,0.168,1.558
|
||||
c-0.146-0.27-0.113-0.75-0.127-1.058c-0.022-0.502-0.041-0.982-0.115-1.47c-0.114-0.743-0.188-1.564-0.25-2.324
|
||||
c-0.152-1.877,2.054-3.17,3.301-1.469c0.884,1.206,0.773,2.643,0.773,4.085c0,0.698-0.034,1.251-0.22,1.91
|
||||
c-0.13,0.459-0.293,1.222-0.239,1.639c0-0.902,0.334-1.697,0.334-2.589c0-0.678-0.272-2.099,0.581-2.334
|
||||
c1.065-0.294,2.008,0.875,2.428,1.66c0.458,0.855,0.555,1.901,0.409,2.883c-0.318,2.153-0.845,4.227-2.096,6.071
|
||||
c-0.268,0.396-0.485,0.838-0.79,1.22c-0.361,0.452-0.923,0.772-1.416,1.071c-0.381,0.232-0.764,0.53-1.176,0.604
|
||||
c-0.822,0.149-1.725,0.157-2.565,0.157c-1.29,0-2.564-0.068-3.832-0.251c-0.799-0.115-2.12,0.153-2.668-0.54"/>
|
||||
</g>
|
||||
</svg>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 12.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 51448) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
|
||||
<!ENTITY ns_extend "http://ns.adobe.com/Extensibility/1.0/">
|
||||
<!ENTITY ns_ai "http://ns.adobe.com/AdobeIllustrator/10.0/">
|
||||
<!ENTITY ns_graphs "http://ns.adobe.com/Graphs/1.0/">
|
||||
<!ENTITY ns_vars "http://ns.adobe.com/Variables/1.0/">
|
||||
<!ENTITY ns_imrep "http://ns.adobe.com/ImageReplacement/1.0/">
|
||||
<!ENTITY ns_sfw "http://ns.adobe.com/SaveForWeb/1.0/">
|
||||
<!ENTITY ns_custom "http://ns.adobe.com/GenericCustomNamespace/1.0/">
|
||||
<!ENTITY ns_adobe_xpath "http://ns.adobe.com/XPath/1.0/">
|
||||
<!ENTITY ns_svg "http://www.w3.org/2000/svg">
|
||||
<!ENTITY ns_xlink "http://www.w3.org/1999/xlink">
|
||||
]>
|
||||
<svg version="1.1" id="Layer_1" xmlns:x="&ns_extend;" xmlns:i="&ns_ai;" xmlns:graph="&ns_graphs;"
|
||||
xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" width="28.375" height="28" viewBox="0 0 28.375 28"
|
||||
overflow="visible" enable-background="new 0 0 28.375 28" xml:space="preserve">
|
||||
<g i:extraneous="self">
|
||||
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M27.875,1.375"/>
|
||||
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M0,1.375"/>
|
||||
<path fill="none" stroke="#FFFFFF" d="M0,27.475"/>
|
||||
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M1,27.645"/>
|
||||
<path fill="none" stroke="#00008B" stroke-width="1.5" d="M1,0.544"/>
|
||||
<line fill="none" stroke="#FFFFFF" x1="0.875" y1="27.5" x2="27.875" y2="27.475"/>
|
||||
<rect x="0.875" y="1.045" fill="#ADD8E6" width="27.125" height="26"/>
|
||||
<line fill="none" stroke="#FFFFFF" x1="27.875" y1="26.925" x2="27.875" y2="0.925"/>
|
||||
<line fill="none" stroke="#00008B" x1="1.375" y1="0.5" x2="27.375" y2="0.5"/>
|
||||
<line fill="none" stroke="#00008B" x1="0.875" y1="1" x2="0.875" y2="27"/>
|
||||
<path fill="#FFFFFF" stroke="#000000" d="M8.458,23.458c-0.473-0.168-1.02-1.269-1.363-1.695
|
||||
c-0.479-0.595-0.894-1.245-1.377-1.829c-0.733-0.887-1.356-1.729-1.854-2.764c-0.375-0.782-0.884-1.997-0.005-2.648
|
||||
c1.036-0.767,2.095-0.161,2.934,0.479c0.844,0.646,1.729,1.18,2.526,1.869c-0.372-0.305-0.548-0.986-0.778-1.421
|
||||
c-0.253-0.477-0.565-0.906-0.822-1.375c-0.359-0.657-0.767-1.201-1.21-1.823c-0.544-0.763-1.051-1.74-0.925-2.709
|
||||
c0.133-1.025,0.972-1.527,1.924-1.207c1.202,0.405,1.969,1.692,2.627,2.698c0.636,0.971,1.201,2.159,1.938,3.042
|
||||
c-0.222-0.21-0.148-0.509-0.155-0.783c-0.01-0.37-0.097-0.626-0.219-0.967c-0.162-0.455-0.219-0.972-0.24-1.45
|
||||
c-0.034-0.776-0.25-1.465-0.25-2.247c0-0.988-0.14-1.963,0.71-2.631c0.666-0.523,1.649-0.764,2.381-0.248
|
||||
c1.385,0.976,1.057,2.999,1.209,4.458c0.079,0.759,0.165,1.489,0.2,2.263c0.022,0.496,0.209,1.068,0.168,1.558
|
||||
c-0.146-0.27-0.113-0.75-0.127-1.058c-0.022-0.502-0.041-0.982-0.115-1.47c-0.114-0.743-0.188-1.564-0.25-2.324
|
||||
c-0.152-1.877,2.054-3.17,3.301-1.469c0.884,1.206,0.773,2.643,0.773,4.085c0,0.698-0.034,1.251-0.22,1.91
|
||||
c-0.13,0.459-0.293,1.222-0.239,1.639c0-0.902,0.334-1.697,0.334-2.589c0-0.678-0.272-2.099,0.581-2.334
|
||||
c1.065-0.294,2.008,0.875,2.428,1.66c0.458,0.855,0.555,1.901,0.409,2.883c-0.318,2.153-0.845,4.227-2.096,6.071
|
||||
c-0.268,0.396-0.485,0.838-0.79,1.22c-0.361,0.452-0.923,0.772-1.416,1.071c-0.381,0.232-0.764,0.53-1.176,0.604
|
||||
c-0.822,0.149-1.725,0.157-2.565,0.157c-1.29,0-2.564-0.068-3.832-0.251c-0.799-0.115-2.12,0.153-2.668-0.54"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.3 KiB |
27
build/build.py
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append("../tools")
|
||||
|
||||
import jsmin, mergejs
|
||||
|
||||
sourceDirectory = "../lib"
|
||||
configFilename = "library.cfg"
|
||||
outputFilename = "OpenLayers.js"
|
||||
|
||||
if len(sys.argv) > 1:
|
||||
configFilename = sys.argv[1] + ".cfg"
|
||||
if len(sys.argv) > 2:
|
||||
outputFilename = sys.argv[2]
|
||||
|
||||
print "Adding license file."
|
||||
merged = file("license.txt").read()
|
||||
print "Merging libraries."
|
||||
merged += mergejs.run(sourceDirectory, None, configFilename)
|
||||
print "Compressing."
|
||||
minimized = jsmin.jsmin(merged)
|
||||
|
||||
print "Writing to %s." % outputFilename
|
||||
file(outputFilename, "w").write(minimized)
|
||||
|
||||
print "Done."
|
||||
@@ -1,40 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Script to build compressed single file version of OpenLayers library
|
||||
#
|
||||
|
||||
OUTPUT_FILENAME=OpenLayers.js
|
||||
TMP_OUTPUT_FILENAME=tmp.${OUTPUT_FILENAME}
|
||||
|
||||
TOOLS_DIR=../tools
|
||||
|
||||
CFG_FILENAME=library.cfg
|
||||
|
||||
SRC_DIR=../lib
|
||||
|
||||
CMD_MERGE_JS=${TOOLS_DIR}/mergejs.py
|
||||
|
||||
CMD_SHRINKSAFE=${TOOLS_DIR}/shrinksafe.py
|
||||
CMD_JSMIN=${TOOLS_DIR}/jsmin.py
|
||||
|
||||
LICENSE_HEADER_FILENAME=license.txt
|
||||
|
||||
|
||||
## Generate "fat" single file library version
|
||||
${CMD_MERGE_JS} -c ${CFG_FILENAME} ${TMP_OUTPUT_FILENAME} ${SRC_DIR}
|
||||
|
||||
|
||||
## Compress ("shrink") the single file library version
|
||||
|
||||
echo
|
||||
echo Shrinking and post-processing...
|
||||
# (We also append the license header here.)
|
||||
cat ${LICENSE_HEADER_FILENAME} > ${OUTPUT_FILENAME}
|
||||
${CMD_JSMIN} <${TMP_OUTPUT_FILENAME} >> ${OUTPUT_FILENAME}
|
||||
|
||||
echo Cleaning up...
|
||||
rm $TMP_OUTPUT_FILENAME
|
||||
|
||||
echo
|
||||
echo Done.
|
||||
@@ -1,10 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
rm ../doc/reference.html
|
||||
CLASSES="Map Layer Layer.HTTPRequest Layer.Grid Layer.WMS Layer.KaMap Layer.EventPane Layer.Google Layer.VirtualEarth Layer.Markers Layer.Text Layer.GeoRSS Layer.Boxes Icon Marker Marker.Box Tile Tile.Image Tile.WFS Control Control.LayerSwitcher Control.MouseDefaults Control.MouseToolbar Control.PanZoom Control.PanZoomBar Control.Permalink Control.Scale LonLat Size Pixel Bounds"
|
||||
echo "<html><head><title>OpenLayers Class Reference Documentation</title><style type='text/css'> .type { background-color: #ddd } td { border: black solid 1px; padding: 3px; } table { border-collapse: collapse; margin: 5px 10px; } .classref { margin-left: 20px; }
|
||||
div.index { float:left; width: 300px; }
|
||||
</style></head><body>" >> ../doc/reference.html
|
||||
CLASSES="Map Layer Layer.Image Layer.HTTPRequest Layer.Grid Layer.WMS Layer.KaMap Layer.EventPane Layer.Google Layer.VirtualEarth Layer.Markers Layer.Text Layer.GeoRSS Layer.Boxes Layer.TMS Icon Marker Marker.Box Tile Tile.Image Tile.WFS Control Control.LayerSwitcher Control.MouseDefaults Control.MousePosition Control.MouseToolbar Control.OverviewMap Control.PanZoom Control.PanZoomBar Control.Permalink Control.Scale LonLat Size Pixel Bounds Util Ajax"
|
||||
echo "<html>
|
||||
<head>
|
||||
<title>OpenLayers Class Reference Documentation</title>
|
||||
<style type='text/css'>
|
||||
.type { background-color: #ddd }
|
||||
td { border: black solid 1px; padding: 3px; }
|
||||
table { border-collapse: collapse; margin: 5px 10px; }
|
||||
.classref { margin-left: 20px; }
|
||||
div.index { float:left; width: 300px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>" >> ../doc/reference.html
|
||||
|
||||
for i in $CLASSES; do
|
||||
echo "<div class='index'><a href='#OpenLayers.$i'>OpenLayers.$i</a></div>" >> ../doc/reference.html
|
||||
@@ -14,16 +23,17 @@ echo "<br style='clear:both' />" >> ../doc/reference.html
|
||||
|
||||
for i in $CLASSES; do
|
||||
cat ../doc/$i.txt | \
|
||||
perl -pe 's!^(.*?) -- (.*?) -- (.*?)$! <tr><td>$1</td><td>$2</td><td>$3</td></tr>!g' | \
|
||||
perl -pe 's!^( \* )?(.*?) -- (.*?)$! <tr><td>$2</td><td>$3</td></tr>!g' | \
|
||||
perl -pe 's!^ \* (.*)$! </table>\n\n<h3>$1</h3>\n <table>!' | \
|
||||
perl -pe 's!{OpenLayers.(.*?)\|(.*?)}!<a href="#OpenLayers.$1" title="OpenLayers.$1">\2</a>!g' | \
|
||||
perl -pe 's!{OpenLayers.(.*?)}!<a href="#OpenLayers.$1" title="OpenLayers.$1">OpenLayers.$1</a>!' | \
|
||||
perl -pe 's!{([A-Za-z]+?)\|(.+?)}!<span class="type" title="$1">\2<\/span>!g' | \
|
||||
perl -pe 's!{([A-Za-z]+?)}!<span class="type" title="$1">$1<\/span>!g' | \
|
||||
perl -pe 's!^\* (.*)$!</table>\n<h2>$1</h2>\n<table>!' | \
|
||||
perl -pe 's!^OpenLayers\.(.*)$!<h1><a name="OpenLayers.$1">OpenLayers.$1</a></h1><div class="classref">!' \
|
||||
perl -pe 's!^(.*?) -- (.*?) -- (.*?)$! <tr><td>$1</td><td>$2</td><td>$3</td></tr>!g;
|
||||
s!^( \* )?(.*?) -- (.*?)$! <tr><td>$2</td><td>$3</td></tr>!g;
|
||||
s!^ \* (.*)$! </table>\n\n<h3>$1</h3>\n <table>!;
|
||||
s!{OpenLayers.(.*?)\|(.*?)}!<a href="#OpenLayers.$1" title="OpenLayers.$1">\2</a>!g;
|
||||
s!{OpenLayers.(.*?)}!<a href="#OpenLayers.$1" title="OpenLayers.$1">OpenLayers.$1</a>!;
|
||||
s!{([A-Za-z]+?)\|(.+?)}!<span class="type" title="$1">\2<\/span>!g;
|
||||
s!{([A-Za-z]+?)}!<span class="type" title="$1">$1<\/span>!g;
|
||||
s!^\* (.*)$!</table>\n<h2>$1</h2>\n<table>!;
|
||||
s!^OpenLayers\.(.*)$!<h1><a name="OpenLayers.$1">OpenLayers.$1</a></h1><div class="classref">!' \
|
||||
>> ../doc/reference.html
|
||||
echo '</table></div>' >> ../doc/reference.html
|
||||
done
|
||||
echo "</body></html>" >> ../doc/reference.html
|
||||
echo " </body>
|
||||
</html>" >> ../doc/reference.html
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
[first]
|
||||
Prototype.js
|
||||
Rico/Corner.js
|
||||
OpenLayers/SingleFile.js
|
||||
OpenLayers.js
|
||||
OpenLayers/BaseTypes.js
|
||||
OpenLayers/Util.js
|
||||
Rico/Corner.js
|
||||
|
||||
[last]
|
||||
|
||||
[include]
|
||||
|
||||
[exclude]
|
||||
OpenLayers/Layer/Yahoo.js
|
||||
OpenLayers/Control/KeyboardDefaults.js
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
OpenLayers.js -- OpenLayers Map Viewer Library
|
||||
|
||||
Copyright 2005-2006 MetaCarta, Inc., released under the BSD License.
|
||||
Please see http://svn.openlayers.org/trunk/openlayers/license.txt
|
||||
Copyright 2005-2006 MetaCarta, Inc., released under the BSD license.
|
||||
Please see http://svn.openlayers.org/trunk/openlayers/release-license.txt
|
||||
for the full text of the license.
|
||||
|
||||
Includes compressed code under the following licenses:
|
||||
@@ -13,7 +13,9 @@
|
||||
|
||||
*/
|
||||
|
||||
/* Prototype JavaScript framework, version 1.4.0
|
||||
/* Contains portions of Prototype.js:
|
||||
*
|
||||
* Prototype JavaScript framework, version 1.4.0
|
||||
* (c) 2005 Sam Stephenson <sam@conio.net>
|
||||
*
|
||||
* Prototype is freely distributable under the terms of an MIT-style license.
|
||||
|
||||
20
build/lite.cfg
Normal file
@@ -0,0 +1,20 @@
|
||||
[first]
|
||||
OpenLayers/SingleFile.js
|
||||
OpenLayers.js
|
||||
OpenLayers/BaseTypes.js
|
||||
OpenLayers/Util.js
|
||||
|
||||
[last]
|
||||
|
||||
[include]
|
||||
OpenLayers/Events.js
|
||||
OpenLayers/Map.js
|
||||
OpenLayers/Layer.js
|
||||
OpenLayers/Layer/Grid.js
|
||||
OpenLayers/Layer/HTTPRequest.js
|
||||
OpenLayers/Layer/WMS.js
|
||||
OpenLayers/Layer/WMS/Untiled.js
|
||||
OpenLayers/Tile.js
|
||||
OpenLayers/Tile/Image.js
|
||||
|
||||
[exclude]
|
||||
@@ -11,4 +11,4 @@ This control will by default display a small image in the upper right corner of
|
||||
* Parameters
|
||||
position -- (inherited from {OpenLayers.Control}) {OpenLayers.Pixel} to use as the top-left corner of the control div, relative to the map area.
|
||||
activeColor -- The color to use for the background of the layer switcher div.
|
||||
|
||||
ascending -- Ascending determines whether layers are added to the layer switcher in ascending or descending order. If ascending is true, the lowest layer is appended to the list first. If ascending is false, the lowest layer is at the very bottom of the LayerSwitcher. Default is true.
|
||||
|
||||
32
doc/Control.MousePosition.txt
Normal file
@@ -0,0 +1,32 @@
|
||||
OpenLayers.Control.MousePosition
|
||||
|
||||
A small control which displays the Longitude and Latitude of the current mouse position, by defualt in the lower right of the map viewport.
|
||||
|
||||
* Constructor
|
||||
OpenLayers.Control.MousePosition({Object|options}) -- Creates a new MousePosition control.
|
||||
|
||||
|
||||
* Parameters
|
||||
|
||||
element -- if not null, div in which to display the MousePosition
|
||||
prefix -- html to precede the longitude value (default: '')
|
||||
separator -- html to separate the longitude and latitude values (default: '<br />')
|
||||
suffix -- html to follow the latitude value (default: '')
|
||||
numdigits -- number of digits to the right of the decimal (default: 5)
|
||||
granularity -- Don't refresh display if mouse has moved more than this (default: 10)
|
||||
|
||||
prefix, separator, and suffix are used to format the lon/lat values.
|
||||
|
||||
With:
|
||||
prefix = 'Lon: '
|
||||
suffix = '<br />Lat: '
|
||||
suffix = ''
|
||||
nudigits = 3
|
||||
Lon/Lat is displayed as:
|
||||
Lon: 95.123
|
||||
Lat: 35.456
|
||||
|
||||
If the mouse has never been over the map, Lon/Lat will equal 0/0. If the mouse is over the map, Lon/Lat will equal the current mouse position. If the mouse has been moved off the map, Lon/Lat will equal the value displayed at the time the mouse was moved off the map.
|
||||
|
||||
If the mouse is moving slowly, the Lon/Lat will refresh continuously. If the mouse is moving rapidly, the refresh of Lon/Lat will be suspended until the mouse has slowed down or stopped. (Trying to update the Lon/Lat value while the mouse is in rapid movemement makes the movement of the mouse unacceptably jerky.)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
OpenLayers.Control.MouseToolbar
|
||||
|
||||
Control to set up mouse handling. This includes clicks, double clicks, scrollwheel events, and mouse movement. There are a number of functions which act as the default handlers for these events: if you wish to create your own mouse control which behaves differently, you should create a subclass of MouseToolbar, replacing the functions whose behavior you wish to change. Additionally, a toolbar of images can be clicked to start events, as well as using the keyboard shortcuts.
|
||||
Control to set up mouse handling. This includes clicks, double clicks, scrollwheel events, and mouse movement. There are a number of functions which act as the default handlers for these events: if you wish to create your own mouse control which behaves differently, you should create a subclass of MouseToolbar, replacing the functions whose behavior you wish to change. Additionally, a toolbar of images can be clicked to start events, as well as using the keyboard shortcuts. Note that if you wish to use the MouseToolbar, you *must* add a 'controls' option to the map constructor, otherwise you will have both MouseDefaults and MouseToolbar on the map, which will not work.
|
||||
|
||||
* Constructor
|
||||
OpenLayers.Control.MouseToolbar({OpenLayers.Pixel|position}, {String|direction}) -- Creates a new control. The direction of the control can be either "vertical" or "horizontal". The default is vertical.
|
||||
|
||||
38
doc/Control.OverviewMap.txt
Normal file
@@ -0,0 +1,38 @@
|
||||
OpenLayers.Control.OverviewMap
|
||||
|
||||
This control provides a locator or overview map linked to another map. By default, the overview map shows up in the lower right of the main map and can be expdaned with the '+' button.
|
||||
|
||||
* Constructor
|
||||
OpenLayers.Control.OverviewMap(opts?) -- Creates a new overview map. The opts variable is an object with various options, as described in the options section below.
|
||||
|
||||
* Methods
|
||||
isSuitableOverview() -- {Boolean} -- Determines if the overview map is suitable given the extent and resolution of the main map.
|
||||
getRectPxBounds() -- {OpenLayers.Bounds|bounds} -- An OpenLayers.Bounds which is the extent rectangle's pixel bounds (relative to the parent element).
|
||||
setRectPxBounds({OpenLayers.Bounds|bounds}) -- none -- Set extent rectangle pixel bounds.
|
||||
getRectBoundsFromMapBounds({OpenLayers.Bounds|lonLatBounds}) -- {OpenLayers.Bounds|bounds} -- An OpenLayers.Bounds which is the passed-in map lon/lat extent translated into pixel bounds for the overview map.
|
||||
getMapBoundsFromRectBounds({OpenLayers.Bounds|pxBounds]}) -- {OpenLayers.Bounds|bounds} -- An OpenLayers.Bounds which is the passed-in overview rect bounds translated into lon/lat bounds for the overview map.
|
||||
getLonLatFromOverviewPx({OpenLayers.Pixel|pixel}) -- {OpenLayers.LonLat|lonlat} -- An OpenLayers.LonLat which is the passed-in overview map OpenLayers.Pixel translated into lon/lat by the overview map.
|
||||
getOverviewPxFromLonLat({OpenLayers.LonLat|lonlat}) -- {OpenLayers.Pixel|pixel} -- An OpenLayers.Pixel which is the passed-in OpenLayers.LonLat, translated into overview map pixels
|
||||
|
||||
|
||||
* Events
|
||||
* Rectangle events
|
||||
They are defined on OverviewMap.rectEvents
|
||||
|
||||
mouseover -- rectangle is moused over
|
||||
mouseout -- rectangle is no longer mousedout
|
||||
mousemove -- mouse moves inside rectangle
|
||||
mousedown -- mouse button is pressed over the rectangle.
|
||||
mouseup -- mouse button is released over the rectangle.
|
||||
click -- mouse clicked
|
||||
dblclick -- mouse double clicked
|
||||
|
||||
* Map events
|
||||
They are defined on OverviewMap.mapDivEvents
|
||||
|
||||
click -- mouse clicked
|
||||
|
||||
* Options:
|
||||
* minRatio -- The ratio of the overview map resolution to the main map resolution at which to zoom farther out on the overview map.
|
||||
* maxRatio -- The ratio of the overview map resolution to the main map resolution at which to zoom farther in on the overview map.
|
||||
* layers -- Ordered list of layers in the overview map. If none, then the map base layer is used.
|
||||
@@ -1,4 +1,4 @@
|
||||
OpenLayers.Control.PanZoom
|
||||
OpenLayers.Control.PanZoomBar
|
||||
|
||||
Creates a small toolset for controlling the location of the map with panning and zooming, including four directional arrows, a zoom in and zoom out, and a bar on which a slider can be moved to zoom in or out by multiple stops at once.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
OpenLayers.Control.Permalink
|
||||
|
||||
A small control which updates a "Permalink" to the map every time the viewport changes. This allows users to copy a link to a specfic map view. By default, it places itself in the lower right corner of the map,
|
||||
A small control which updates a "Permalink" to the map every time the viewport changes. This allows users to copy a link to a specfic map view. By default, it places itself in the lower right corner of the map. This control must be added to the map after a baselayer has been set.
|
||||
|
||||
* Constructor
|
||||
OpenLayers.Control.Scale({DOMElement|element}?, {String|base}) -- Creates a new permalink control. The DOMElement is used, if passed, as the element on which the 'href' is set. If you prefer to put this link on an element outside of the map, set this element to an anchor element to have its href updated when the map moves. If you wish to make the link go to some other URL (for example, an editing interface rather than the current URL), the 'base' property can be used, to which the ?lat=&lon=&zoom= will be appended after the map has moved.
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
OpenLayers.Layer.GeoRSS
|
||||
|
||||
GeoRSS layer. Pass a name and location of a GeoRSS file on the web, and a marker will be added to the map for each item in the GeoRSS feed. Uses OpenLayers.loadURL to load the XML, parses the data, and adds markers to the map.
|
||||
GeoRSS layer. Pass a name and location of a GeoRSS file on the web, and a marker will be added to the map for each item in the GeoRSS feed. Uses OpenLayers.loadURL to load the XML, parses the data, and adds markers to the map. The GeoRSS layer supports 1.0 and 2.0 in IE and Firefox, and supports 2.0 in Safari. (Ticket #111 explains the reason for this difference.)
|
||||
|
||||
|
||||
* Constructor
|
||||
OpenLayers.Layer.GeoRSS(name, url) -- Name and location of GeoRSS XML file.
|
||||
|
||||
@@ -12,5 +12,5 @@ The Google Layer in OpenLayers allows you to include Google Maps functionality i
|
||||
getGPointFromOLPixel({OpenLayers.Pixel|pixel}) -- GPoint -- Create GPoint from OpenLayers Pixel.
|
||||
|
||||
* Parameters
|
||||
type -- one of G_MAP, G_SATELLITE_MAP, G_HYBRID_MAP, used to choose the type of map to display.
|
||||
type -- one of G_NORMAL_MAP, G_SATELLITE_MAP, G_HYBRID_MAP, used to choose the type of map to display. (See <a href="http://www.google.com/apis/maps/documentation/reference.html#GMapType">GMapType in the Google documentation</a> for more.)
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@ Sublass of Layer used for services which require initiating multiple HTTPRequest
|
||||
OpenLayers.Layer.HTTPRequest(name, url, params, options) -- URL is the base URL to the layer. Params is a set of params to be included in the HTTP Request. Options is a set of options, extending the parameters of the layer.
|
||||
|
||||
* Methods
|
||||
initResolutions() -- none -- Based on the current minScale/maxScale/maxResolution/maxZoomLevels/scales/resolutions parameters, initializes an array of 'zoom levels' as this.resolutions, which are then used as an index into when zooming.
|
||||
initResolutions() -- none -- Based on the current minScale/maxScale/maxResolution/numZoomLevel/scales/resolutions parameters, initializes an array of 'zoom levels' as this.resolutions, which are then used as an index into when zooming.
|
||||
getFullRequestString(newParams) -- {String} -- Returns the full request string for a combination of the defaults on this layer and the parameters passed via newParams.
|
||||
|
||||
|
||||
* Options
|
||||
reproject -- If reproject is true, then the layer will alter the bounding boxes of its tiles to be based on the geographic location of the pixel bounds in the base layer. This is important for reprojecting WMS tiles onto something like Google Maps. Tile locations are calculated, and then when creating the tile request, the bounding box is adjusted to match the bounding box of the base layer at that location.
|
||||
|
||||
9
doc/Layer.Image.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
OpenLayers.Layer.Image
|
||||
|
||||
The Image Layer allows you to load a single image and use it as a layer in your
|
||||
map.
|
||||
|
||||
|
||||
* Constructor
|
||||
OpenLayers.Layer(name, url, {OpenLayers.Bounds|bounds}, {OpenLayers.Size|size}, {options}) -- Image Layer constructor requires a name, URL of the image, geographic bounds of the image, pixel size of the image, and an optional options parameter.
|
||||
|
||||
15
doc/Layer.TMS.txt
Normal file
@@ -0,0 +1,15 @@
|
||||
OpenLayers.Layer.TMS
|
||||
|
||||
The TMS layer allows one to connect to a TMS -- Tiled Map Service -- server to obtain images.
|
||||
|
||||
* Constructor
|
||||
OpenLayers.Layer.TMS(name, url, options) -- URL is the base URL to the layer. Options is a set of options, extending the parameters of the layer.
|
||||
|
||||
* Methods
|
||||
getURL({OpenLayers.Bounds|bounds}) -- {String} -- Returns a TMS URL for the given bounds based on the properties of the layer.
|
||||
All other methods are inherited from {OpenLayers.Layer.Grid}
|
||||
|
||||
* Options
|
||||
tileOrigin -- The tileOrigin option will allow you to set your tileOrigin to something other than the lower left extent of your map.
|
||||
layername -- Name of the layer in the TMS request.
|
||||
type -- The extension images have.
|
||||
@@ -1,6 +1,8 @@
|
||||
OpenLayers.Layer.WMS
|
||||
|
||||
The WMS layer allows one to connect to a WMS server to obtain images.
|
||||
The WMS layer allows one to connect to a WMS server to obtain images. Params are available as a hash on the layer object, however, all keys are upper-cased automatically for maximum compatibility with WMS servers, so a parameter which is set as 'layers' will be uppercased to LAYERS. Where 'layer' is your Javscript variable for the layer, layer.params.LAYERS is the value of the layers param as set by the constructor.
|
||||
|
||||
If you wish to change params, you should use mergeNewParams, rather than accessing the parameters directly.
|
||||
|
||||
* Constructor
|
||||
OpenLayers.Layer.WMS(name, url, params, options) -- URL is the base URL to the layer. Params is a set of params to be included in the HTTP Request. Options is a set of options, extending the parameters of the layer.
|
||||
@@ -9,5 +11,5 @@ The WMS layer allows one to connect to a WMS server to obtain images.
|
||||
getURL({OpenLayers.Bounds|bounds}) -- {String} -- Returns a WMS URL for the given bounds based on the properties of the layer.
|
||||
All other methods are inherited from {OpenLayers.Layer.Grid}
|
||||
|
||||
* Parameters
|
||||
* Options
|
||||
isBaseLayer -- WMS layers default to being base layers unless one of their parameters is 'transparent':'true'.
|
||||
|
||||
@@ -12,7 +12,6 @@ of different layers.
|
||||
clone() -- {OpenLayers.Layer} -- create a clone of the layer.
|
||||
setName({String|name}) -- none -- Set the name of the layer to something different.
|
||||
moveTo({OpenLayers.Bounds|bounds}, {Boolean|zoomChanged}) -- none -- Not implemented here, but the general function called on dragging or setCenter, to move the Layer to a new geographic location.
|
||||
reproject() -- none -- Subclassed by vector layers to redraw vectors when base layer changes.
|
||||
setMap(map) -- none -- Set the map property of the layer. Also set the parameters which are inherited from the map.
|
||||
getVisibility() -- {Boolean} -- Return true or false based on visibility of the layer.
|
||||
setVisibility({Boolean|visible}) -- none -- Set the layer visibility, and trigger the appropriate events.
|
||||
@@ -21,8 +20,10 @@ of different layers.
|
||||
getZoomForExtent({OpenLayers.Bounds|bounds}) -- {Integer} -- return the integer zoom which most closely matches the passed bounds.
|
||||
getLonLatFromViewPortPx({OpenLayers.Pixel|pixel}) -- {OpenLayers.LonLat} -- Returns an OpenLayers.LonLat which is the passed-in view port OpenLayers.Pixel, translated into lon/lat by the laye
|
||||
getViewPortPxFromLonLat({OpenLayers.LonLat|lonlat}) -- {OpenLayers.Pixel} -- Returns An OpenLayers.Pixel which is the passed-in OpenLayers.LonLat, translated into view port pixels
|
||||
addOptions({options})) -- none -- Change the options on the layer. This is the supported way to change properties of the layer.
|
||||
|
||||
* Parameters
|
||||
displayOutsideMaxExtent -- Determine whether images or data are loaded outside the maxExtent. Default is false.
|
||||
isBaseLayer -- This determines whether the layer is a base layer or an overlay. Only one Base Layer can be displayed on the map at once. Default is false.
|
||||
projection -- SRS string to describe the layer. If this is set on the map before the Layer is added to the map, it will inherit from the map.
|
||||
maxExtent -- an OpenLayers.Bounds for the layer. This is the maximum geographic extent of the layer. If this is set on the map before the Layer is added to the map, it will inherit from the map.
|
||||
@@ -31,6 +32,7 @@ of different layers.
|
||||
minScale -- The scale at zoom level 0. If this is set on the map before the Layer is added to the map, it will inherit from the map.
|
||||
maxScale -- The scale at the highest zoom level. If this is set on the map before the Layer is added to the map, it will inherit from the map.
|
||||
units -- The units the map is projected into. If this is set on the map before the Layer is added to the map, it will inherit from the map.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -54,6 +54,8 @@ Instantiate class {OpenLayers.Map} in order to create a map. This is the central
|
||||
changelayer -- a layer has some property of it, typically visibility, changed.
|
||||
changebaselayer -- the current base layer changes
|
||||
movestart -- start of a movement in the map
|
||||
move -- end of movement in a map. this happens while te mouse is dragging as well as for all other events.
|
||||
moveend -- end of movement in a map, but does not happen when the 'dragging' flag is set, as is the case when the move event is in the middle of a drag action.
|
||||
zoomend -- end of a zoom action
|
||||
mouseover -- map is moused over
|
||||
mouseout -- map is no longer mousedout
|
||||
@@ -72,4 +74,4 @@ Instantiate class {OpenLayers.Map} in order to create a map. This is the central
|
||||
* maxScale -- The maximum scale the map should include. Overrides maxZoomLevel if present.
|
||||
* units -- The units of the map. Defaults to degrees. Neccesary when using scale in any way.
|
||||
* scales -- An array of scale values. Overrides maxResolution, maxZoomLevel, resolutions, and min/max scale if present.
|
||||
|
||||
|
||||
|
||||
8
doc/Util.txt
Normal file
@@ -0,0 +1,8 @@
|
||||
OpenLayers.Util
|
||||
|
||||
Utility class. Stores a bunch of methods and settings that don't fit anywhere else.
|
||||
|
||||
* Options
|
||||
|
||||
OpenLayers.Util.onImageLoadErrorColor -- A string to set img.style.backgroundColor to if the onerror event fires for the image (useful for 500 errors from WMS, for example).
|
||||
OpenLayers.ImgPath -- A string to be used as the base for images for controls and the like. Should end with '/'.
|
||||
@@ -10,6 +10,8 @@ Patch contributors
|
||||
------------------
|
||||
Corey Puffault
|
||||
Tim Schaub
|
||||
Jeff Dege
|
||||
Sean Gilles
|
||||
|
||||
OpenLayers is graciously supported by MetaCarta, Inc.
|
||||
<http://www.metacarta.com>.
|
||||
|
||||
49
doc/customization
Normal file
@@ -0,0 +1,49 @@
|
||||
Customizing OpenLayers
|
||||
======================
|
||||
|
||||
OpenLayers is designed to fit many needs -- fitting in alongside all kinds of
|
||||
various applications which are currently in use.
|
||||
|
||||
Currently, OpenLayers supports a 'theme' option when creating a map. This
|
||||
theme option allows you to specify the location of a CSS theme which should
|
||||
be included.
|
||||
|
||||
A default theme is available as an example in the theme/ directory: the setup
|
||||
is:
|
||||
|
||||
* theme/
|
||||
* theme/default/
|
||||
* theme/default/style.css
|
||||
* theme/default/img/
|
||||
|
||||
Currently, the OpenLayers code does not support class names, and therefore,
|
||||
it is not possible to control many aspects of OpenLayers code with CSS
|
||||
classes. However, with this framework in place, we expect to invest time
|
||||
to make existing features and new features use the CSS theming framework
|
||||
where apropriate.
|
||||
|
||||
|
||||
Class Naming
|
||||
============
|
||||
Elements should have class names which are descriptive of the Javascript
|
||||
class from which they come. For example, the main layer switcher element
|
||||
in the OpenLayers.Control.LayerSwitcher would be classed:
|
||||
|
||||
olControlLayerSwitcher
|
||||
|
||||
This would allow users to add to their style.css class in their theme,
|
||||
changing, for example:
|
||||
|
||||
::
|
||||
|
||||
.olControlLayerSwitcher input {
|
||||
width:10px;
|
||||
}
|
||||
|
||||
Sub elements of a particular control can add to the class name:
|
||||
|
||||
::
|
||||
|
||||
.olControlLayerSwitcherBaseLabel {
|
||||
color: red;
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
|
||||
<style type="text/css">
|
||||
#map {
|
||||
width: 800px;
|
||||
height: 475px;
|
||||
border: 1px solid black;
|
||||
}
|
||||
</style>
|
||||
<!-- gmaps api key for http://openlayers.org/~euzuro -->
|
||||
<script src='http://maps.google.com/maps?file=api&v=2&key=ABQIAAAA9XNhd8q0UdwNC7YSO4YZghQELW4Ku31wWCtlZquTlkHLCFh9LBTYvc_eIShlmo0YZwSitw0fQ1ZyXA'></script>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
var lon = 5;
|
||||
var lat = 40;
|
||||
var zoom = 5;
|
||||
var map, layer, glayer;
|
||||
|
||||
OpenLayers.ProxyHost = "/proxy/?url=";
|
||||
function init(){
|
||||
map = new OpenLayers.Map( $('map') );
|
||||
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
||||
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
|
||||
map.addLayer(layer);
|
||||
|
||||
glayer = new OpenLayers.Layer.Google("goog");
|
||||
map.addLayer(glayer);
|
||||
|
||||
layer = new OpenLayers.Layer.WFS( "wfs",
|
||||
"http://labs.metacarta.com/search/WFS?",
|
||||
{maxfeatures: 1},
|
||||
{ featureClass: OpenLayers.Feature.WFS});
|
||||
map.addLayer(layer);
|
||||
|
||||
|
||||
map.setCenter(new OpenLayers.LonLat(0, 0), 2);
|
||||
|
||||
map.addControl( new OpenLayers.Control.LayerSwitcher() );
|
||||
}
|
||||
|
||||
function add() {
|
||||
|
||||
markers2 = new OpenLayers.Layer.Markers("markers2");
|
||||
map.addLayer(markers2);
|
||||
|
||||
|
||||
var icon = new OpenLayers.Icon('http://boston.openguides.org/markers/AQUA.png',new OpenLayers.Size(10,17));
|
||||
marker = new OpenLayers.Marker(new OpenLayers.LonLat(2, 41), icon);
|
||||
markers.addMarker(marker);
|
||||
}
|
||||
|
||||
|
||||
function remove() {
|
||||
markers.removeMarker(marker);
|
||||
}
|
||||
|
||||
|
||||
// -->
|
||||
</script>
|
||||
</head>
|
||||
<body onload="init()">
|
||||
<div id="map"></div>
|
||||
<div style="background-color:green" onclick="add()"> click to add the marker to the map</div>
|
||||
<div style="background-color:red" onclick="remove()"> click to remove the marker from the map</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,6 +1,5 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
|
||||
<style type="text/css">
|
||||
#map {
|
||||
width: 100%;
|
||||
@@ -14,7 +13,9 @@
|
||||
<script src='http://maps.google.com/maps?file=api&v=2&key=ABQIAAAA9XNhd8q0UdwNC7YSO4YZghSPUCi5aRYVveCcVYxzezM4iaj_gxQ9t-UajFL70jfcpquH5l1IJ-Zyyw'></script>
|
||||
<!-- Localhost key -->
|
||||
<!-- <script src='http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhT2yXp_ZAY8_ufC3CFXhHIE1NvwkxTS6gjckBmeABOGXIUiOiZObZESPg'></script>-->
|
||||
<script type="text/javascript" src="http://clients.multimap.com/API/maps/1.1/metacarta_04"></script>
|
||||
<script src='http://dev.virtualearth.net/mapcontrol/v3/mapcontrol.js'></script>
|
||||
<script src="http://api.maps.yahoo.com/ajaxymap?v=3.0&appid=euzuro-openlayers"></script>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
@@ -35,15 +36,18 @@
|
||||
{layers: 'basic'} );
|
||||
var google = new OpenLayers.Layer.Google( "Google Hybrid" , {type: G_HYBRID_MAP });
|
||||
var ve = new OpenLayers.Layer.VirtualEarth( "VE");
|
||||
var yahoo = new OpenLayers.Layer.Yahoo( "Yahoo");
|
||||
var mm = new OpenLayers.Layer.MultiMap( "MultiMap");
|
||||
|
||||
|
||||
map.addLayers([wms, google, ve]);
|
||||
map.addLayers([wms, google, ve, yahoo, mm]);
|
||||
|
||||
markers = new OpenLayers.Layer.Markers("markers");
|
||||
map.addLayer(markers);
|
||||
|
||||
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
|
||||
map.addControl( new OpenLayers.Control.LayerSwitcher() );
|
||||
map.addControl( new OpenLayers.Control.MousePosition() );
|
||||
|
||||
}
|
||||
|
||||
613
examples/canvas.html
Normal file
@@ -0,0 +1,613 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<style type="text/css">
|
||||
#map {
|
||||
width: 512px;
|
||||
height: 512px;
|
||||
border: 1px solid black;
|
||||
}
|
||||
</style>
|
||||
<script src='http://maps.google.com/maps?file=api&v=2&key=ABQIAAAA9XNhd8q0UdwNC7YSO4YZghSPUCi5aRYVveCcVYxzezM4iaj_gxQ9t-UajFL70jfcpquH5l1IJ-Zyyw'></script>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
var map, canvas;
|
||||
var click;
|
||||
function init(){
|
||||
map = new OpenLayers.Map('map');
|
||||
|
||||
var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
||||
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'});
|
||||
var g = new OpenLayers.Layer.Google("Google");
|
||||
canvas = new OpenLayers.Layer.Canvas("Canvas Layer");
|
||||
map.addLayers([ol_wms, g,canvas]);
|
||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||
// map.setCenter(new OpenLayers.LonLat(0, 0), 0);
|
||||
map.zoomToMaxExtent();
|
||||
canvas.drawLine(new OpenLayers.LonLat(-71,42), new OpenLayers.LonLat(0,0));
|
||||
canvas.setStrokeColor("red");
|
||||
canvas.setStrokeWidth(5);
|
||||
canvas.setAlpha(.5);
|
||||
map.events.register("click", map, function(e) {
|
||||
if (click) {
|
||||
canvas.drawLine(click, this.getLonLatFromPixel(e.xy));
|
||||
click = null;
|
||||
$('status').innerHTML = "";
|
||||
}
|
||||
else {
|
||||
click = this.getLonLatFromPixel(e.xy);
|
||||
$('status').innerHTML = "Point 1 stored: "+click+". <a href='#' onclick='click=null;return false'>Reset</a>";
|
||||
}
|
||||
});
|
||||
}
|
||||
function drawIt() {
|
||||
canvas.drawLine(
|
||||
new OpenLayers.LonLat(parseFloat($('lon1').value), parseFloat($('lat1').value)),
|
||||
new OpenLayers.LonLat(parseFloat($('lon2').value), parseFloat($('lat2').value))
|
||||
);
|
||||
}
|
||||
// -->
|
||||
</script>
|
||||
</head>
|
||||
<body onload="init()">
|
||||
<h1>OpenLayers Example</h1>
|
||||
<div style="float:right">
|
||||
<br />
|
||||
Start Lon: <input type="text" id="lon1" />
|
||||
Start Lat: <input type="text" id="lat1" /><br />
|
||||
End Lon: <input type="text" id="lon2" />
|
||||
End Lat: <input type="text" id="lat2" /><br />
|
||||
<input type="submit" value="Add line" onclick="drawIt()" />
|
||||
<div id="status"></div>
|
||||
<center>
|
||||
<table border="1" cellpadding="0" cellspacing="1">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td bgcolor="#000000">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#000000');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#000033">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#000033');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#000066">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#000066');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#000099">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#000099');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#0000cc">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#0000CC');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#0000ff">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#0000FF');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#330000">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#330000');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#330033">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#330033');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#330066">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#330066');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#330099">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#330099');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#3300cc">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#3300CC');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#3300ff">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#3300FF');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#660000">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#660000');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#660033">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#660033');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#660066">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#660066');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#660099">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#660099');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#6600cc">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#6600CC');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#6600ff">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#6600FF');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#990000">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#990000');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#990033">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#990033');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#990066">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#990066');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#990099">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#990099');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#9900cc">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#9900CC');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#9900ff">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#9900FF');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#cc0000">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#CC0000');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#cc0033">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#CC0033');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#cc0066">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#CC0066');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#cc0099">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#CC0099');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#cc00cc">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#CC00CC');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#cc00ff">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#CC00FF');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#ff0000">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#FF0000');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#ff0033">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#FF0033');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#ff0066">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#FF0066');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#ff0099">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#FF0099');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#ff00cc">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#FF00CC');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#ff00ff">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#FF00FF');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#003300">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#003300');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#003333">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#003333');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#003366">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#003366');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#003399">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#003399');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#0033cc">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#0033CC');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#0033ff">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#0033FF');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#333300">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#333300');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#333333">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#333333');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#333366">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#333366');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#333399">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#333399');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#3333cc">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#3333CC');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#3333ff">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#3333FF');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#663300">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#663300');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#663333">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#663333');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#663366">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#663366');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#663399">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#663399');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#6633cc">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#6633CC');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#6633ff">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#6633FF');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#993300">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#993300');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#993333">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#993333');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#993366">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#993366');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#993399">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#993399');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#9933cc">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#9933CC');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#9933ff">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#9933FF');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#cc3300">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#CC3300');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#cc3333">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#CC3333');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#cc33cc">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#CC33CC');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#cc33ff">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#CC33FF');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#ff3300">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#FF3300');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#ff3333">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#FF3333');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#ff3366">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#FF3366');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#ff3399">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#FF3399');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#ff33cc">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#FF33CC');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#ff33ff">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#FF33FF');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#006600">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#006600');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#006633">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#006633');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#006666">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#006666');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#006699">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#006699');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#0066cc">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#0066CC');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#336699">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#336699');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#3366cc">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#3366CC');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#3366ff">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#3366FF');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#666600">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#666600');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#666633">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#666633');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#666666">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#666666');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#666699">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#666699');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#6666cc">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#6666CC');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#6666ff">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#6666FF');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#996600">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#996600');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#996633">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#996633');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#9966ff">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#9966FF');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#cc6600">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#CC6600');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#cc6633">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#CC6633');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#cc6666">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#CC6666');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#cc6699">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#CC6699');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#cc66cc">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#CC66CC');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#cc66ff">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#CC66FF');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#ff6600">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#FF6600');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#ff6633">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#FF6633');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#009900">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#009900');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#009933">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#009933');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#009966">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#009966');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#009999">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#009999');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#0099cc">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#0099CC');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#0099ff">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#0099FF');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#339900">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#339900');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#339933">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#339933');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#339966">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#339966');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#339999">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#339999');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
<td bgcolor="#3399cc">
|
||||
<font size="-3">
|
||||
<a href="#" onclick="canvas.setStrokeColor('#3399CC');return false"> </a>
|
||||
</font>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="map"></div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -13,6 +13,13 @@
|
||||
function init(){
|
||||
var map = new OpenLayers.Map('map', { controls: [] });
|
||||
|
||||
map.addControl(new OpenLayers.Control.PanZoomBar());
|
||||
map.addControl(new OpenLayers.Control.MouseToolbar());
|
||||
map.addControl(new OpenLayers.Control.LayerSwitcher({'ascending':false}));
|
||||
map.addControl(new OpenLayers.Control.Permalink());
|
||||
map.addControl(new OpenLayers.Control.Permalink($('permalink')));
|
||||
map.addControl(new OpenLayers.Control.MousePosition());
|
||||
map.addControl(new OpenLayers.Control.OverviewMap());
|
||||
var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
||||
"http://labs.metacarta.com/wms/vmap0",
|
||||
{layers: 'basic'} );
|
||||
@@ -31,11 +38,6 @@
|
||||
dm_wms.setVisibility(false);
|
||||
|
||||
map.addLayers([ol_wms, jpl_wms, dm_wms]);
|
||||
map.addControl(new OpenLayers.Control.PanZoomBar());
|
||||
map.addControl(new OpenLayers.Control.MouseToolbar());
|
||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||
map.addControl(new OpenLayers.Control.Permalink());
|
||||
map.addControl(new OpenLayers.Control.Permalink($('permalink')));
|
||||
if (!map.getCenter()) map.zoomToMaxExtent();
|
||||
}
|
||||
// -->
|
||||
|
||||
@@ -13,18 +13,28 @@
|
||||
function init(){
|
||||
var map = new OpenLayers.Map('map');
|
||||
|
||||
var options = {
|
||||
resolutions: [1.40625,0.703125,0.3515625,0.17578125,0.087890625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.00137329101]
|
||||
};
|
||||
|
||||
var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
||||
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'});
|
||||
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'},
|
||||
options);
|
||||
|
||||
var options2 = {
|
||||
resolutions: [0.17578125,0.087890625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.00137329101]
|
||||
};
|
||||
var jpl_wms = new OpenLayers.Layer.WMS( "NASA Global Mosaic",
|
||||
"http://wms.jpl.nasa.gov/wms.cgi",
|
||||
{layers: "modis,global_mosaic"});
|
||||
{layers: "modis,global_mosaic"}, options2);
|
||||
|
||||
var dm_wms = new OpenLayers.Layer.WMS( "DM Solutions Demo",
|
||||
"http://www2.dmsolutions.ca/cgi-bin/mswms_gmap",
|
||||
{layers: "bathymetry,land_fn,park,drain_fn,drainage," +
|
||||
"prov_bound,fedlimit,rail,road,popplace",
|
||||
transparent: "true", format: "image/png" });
|
||||
transparent: "true", format: "image/png"},
|
||||
{minResolution: 0.17578125,
|
||||
maxResolution: 0.703125});
|
||||
|
||||
map.addLayers([ol_wms, jpl_wms, dm_wms]);
|
||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
|
||||
|
||||
<style type="text/css">
|
||||
body { font-family: sans-serif; font-weight: bold; font-size: .8em; }
|
||||
body {
|
||||
border: 0px;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
#map {
|
||||
width: 65%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 0px;
|
||||
padding: 0px;
|
||||
@@ -23,86 +21,29 @@
|
||||
var lat = 900863;
|
||||
var lon = 235829;
|
||||
var zoom = 6;
|
||||
var map, layer;
|
||||
var map, layer;
|
||||
|
||||
function init(){
|
||||
// these should be object methods or something
|
||||
map = new OpenLayers.Map( $('map') );
|
||||
var basemap = new OpenLayers.Layer.WMS( "Boston",
|
||||
"http://boston.freemap.in/cgi-bin/mapserv?",
|
||||
{map: '/www/freemap.in/boston/map/gmaps.map', layers: 'border,water,roads', format: 'png', 'transparent': 'off'},
|
||||
{map: '/www/freemap.in/boston/map/gmaps.map', layers: 'border,water,roads,rapid_transit,buildings', format: 'png', 'transparent': 'off'},
|
||||
// These are the important parts for creating a non-epsg:4326
|
||||
// map: Maxextent is the boundary of the map/tile loading area,
|
||||
// maxResolution is the units/pixel at the highest zoom, and
|
||||
// projection is the projection to be used in WMS/WFS Requests.
|
||||
{maxExtent: new OpenLayers.Bounds(33861, 717605, 330846, 1019656), maxResolution: 296985/1024, projection:"EPSG:2805" } );
|
||||
var rapid = new OpenLayers.Layer.WMS( "Rapid Transit",
|
||||
"http://boston.freemap.in/cgi-bin/mapserv?",
|
||||
{map: '/www/freemap.in/boston/map/mass.map', layers: 'rapid_transit', format: 'png', transparent:'true'} );
|
||||
var buildings = new OpenLayers.Layer.WMS( "Buildings",
|
||||
"http://boston.freemap.in/cgi-bin/mapserv?",
|
||||
{map: '/www/freemap.in/boston/map/mass.map', layers: 'buildings', format: 'png', transparent:'true'} );
|
||||
|
||||
map.addLayer(basemap);
|
||||
map.addLayer(rapid);
|
||||
map.addLayer(buildings);
|
||||
|
||||
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
|
||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||
}
|
||||
function getaddress() {
|
||||
if (!document.getElementById('address').value) {return; }
|
||||
document.getElementById('status').innerHTML = "Finding address...";
|
||||
var address = document.getElementById('address').value;
|
||||
address = escape(address);
|
||||
addr = "/geocode.cgi?address="+address;
|
||||
var handler = XMLrequest();
|
||||
if (handler) {
|
||||
handler.onreadystatechange=function() {
|
||||
if (handler.readyState == 4 && handler.status == 200) {
|
||||
var latlon = handler.responseText;
|
||||
latlon = latlon.split(",");
|
||||
if (latlon[1]) {
|
||||
map.setCenter(new OpenLayers.LonLat(parseFloat(latlon[1]), parseFloat(latlon[0])), 15);
|
||||
document.getElementById('status').innerHTML = "";
|
||||
|
||||
} else {
|
||||
document.getElementById('status').innerHTML = "Could not find address, sorry.";
|
||||
}
|
||||
}
|
||||
}
|
||||
handler.open("GET", addr, true);
|
||||
handler.send('');
|
||||
}
|
||||
}
|
||||
function XMLrequest() {
|
||||
xmlhttp={};
|
||||
try {
|
||||
xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
|
||||
} catch (e) {
|
||||
try {
|
||||
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
|
||||
} catch (E) { }
|
||||
}
|
||||
try {
|
||||
xmlhttp = new XMLHttpRequest();
|
||||
} catch (e) {}
|
||||
return xmlhttp;
|
||||
}
|
||||
function setLink() {
|
||||
var link = document.getElementById("link");
|
||||
var center = map.getCenter();
|
||||
var zoom = map.getZoom();
|
||||
link.innerHTML="http://boston.freemap.in/?zoom="+zoom+"&lat="+center.lat+"&lon="+center.lon;
|
||||
}
|
||||
// -->
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="init()">
|
||||
<div id="right" style="float:right;width:30%;padding:10px;" ><h1>Boston Free Map</h1><!--Search: <input type="text" id='address' name="address"><input type="submit" value="Go!" onclick="javascript:getaddress()"/>--><div id="status" style="height:20px;min-height:20px;"> </div>
|
||||
<div>Map powered by <a href="http://www.openlayers.org/">OpenLayers</a>
|
||||
and <a href="http://mapserver.gis.umn.edu/">MapServer</a>.
|
||||
Data downloaded from
|
||||
<a href="http://www.mass.gov/mgis/">Office of Geographic and Environmental Information (MassGIS)</a>.</div>
|
||||
<!--<a onclick="setLink(); return false" href="#" id="update">Update Link</a>
|
||||
<div id="link"></div>-->
|
||||
</div>
|
||||
<div id="map"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
40
examples/fullScreen.html
Normal file
@@ -0,0 +1,40 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<style type="text/css">
|
||||
#map {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 1px solid black;
|
||||
}
|
||||
</style>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
function init(){
|
||||
var map = new OpenLayers.Map('map');
|
||||
|
||||
var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
||||
"http://labs.metacarta.com:80/wms/vmap0?", {layers: 'basic'});
|
||||
|
||||
var jpl_wms = new OpenLayers.Layer.WMS( "NASA Global Mosaic",
|
||||
"http://wms.jpl.nasa.gov/wms.cgi",
|
||||
{layers: "modis,global_mosaic"});
|
||||
|
||||
var dm_wms = new OpenLayers.Layer.WMS( "DM Solutions Demo",
|
||||
"http://www2.dmsolutions.ca/cgi-bin/mswms_gmap",
|
||||
{layers: "bathymetry,land_fn,park,drain_fn,drainage," +
|
||||
"prov_bound,fedlimit,rail,road,popplace",
|
||||
transparent: "true", format: "image/png" });
|
||||
|
||||
map.addLayers([ol_wms, jpl_wms, dm_wms]);
|
||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||
// map.setCenter(new OpenLayers.LonLat(0, 0), 0);
|
||||
map.zoomToMaxExtent();
|
||||
}
|
||||
// -->
|
||||
</script>
|
||||
</head>
|
||||
<body onload="init()">
|
||||
<div id="map"></div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,6 +1,5 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
|
||||
<style type="text/css">
|
||||
#map {
|
||||
width: 800px;
|
||||
|
||||
47
examples/getfeatureinfo.html
Normal file
@@ -0,0 +1,47 @@
|
||||
<html>
|
||||
<head>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
<style type="text/css">
|
||||
ul, li { padding-left: 0px; margin-left: 0px; }
|
||||
</style>
|
||||
<title>World Map Query</title>
|
||||
</head>
|
||||
<body>
|
||||
<a id='permalink' href="">Permalink</a><br />
|
||||
<div style="float:right;width:28%">
|
||||
<h1 style="font-size:1.3em;">CIA Factbook</h1>
|
||||
<p style='font-size:.8em;'>Click a country to see statistics about the country below.</p>
|
||||
<div id="nodeList">
|
||||
</div>
|
||||
</div>
|
||||
<div id="map" style="width:70%; height:90%"></div>
|
||||
<script defer="defer" type="text/javascript">
|
||||
OpenLayers.ProxyHost = "/dev/examples/proxy.cgi?url=";
|
||||
var map = new OpenLayers.Map('map', {'maxResolution':'auto'});
|
||||
|
||||
var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
||||
"http://world.freemap.in/cgi-bin/mapserv?map=/www/freemap.in/world/map/factbook.map", {'layers': 'factbook'} );
|
||||
map.addLayer(wms);
|
||||
map.addControl(new OpenLayers.Control.Permalink($('permalink')));
|
||||
map.zoomToMaxExtent();
|
||||
map.events.register('click', map, function (e) {
|
||||
$('nodeList').innerHTML = "Loading... please wait...";
|
||||
var url = wms.getFullRequestString({
|
||||
REQUEST: "GetFeatureInfo",
|
||||
EXCEPTIONS: "application/vnd.ogc.se_xml",
|
||||
BBOX: wms.map.getExtent().toBBOX(),
|
||||
X: e.xy.x,
|
||||
Y: e.xy.y,
|
||||
INFO_FORMAT: 'text/html',
|
||||
QUERY_LAYERS: wms.params.LAYERS,
|
||||
WIDTH: wms.map.size.w,
|
||||
HEIGHT: wms.map.size.h});
|
||||
OpenLayers.loadURL(url, '', this, setHTML);
|
||||
Event.stop(e);
|
||||
});
|
||||
function setHTML(response) {
|
||||
$('nodeList').innerHTML = response.responseText;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,6 +1,5 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
|
||||
<style type="text/css">
|
||||
#map {
|
||||
width: 100%;
|
||||
@@ -11,7 +10,7 @@
|
||||
</style>
|
||||
|
||||
<!-- this gmaps key generated for http://openlayers.org/dev/ -->
|
||||
<script src='http://maps.google.com/maps?file=api&v=2&key=ABQIAAAA9XNhd8q0UdwNC7YSO4YZghSPUCi5aRYVveCcVYxzezM4iaj_gxQ9t-UajFL70jfcpquH5l1IJ-Zyyw'></script>
|
||||
<script src='http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ'></script>
|
||||
<!-- Localhost key -->
|
||||
<!-- <script src='http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhT2yXp_ZAY8_ufC3CFXhHIE1NvwkxTS6gjckBmeABOGXIUiOiZObZESPg'></script>-->
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
@@ -19,24 +18,37 @@
|
||||
<!--
|
||||
var lon = 5;
|
||||
var lat = 40;
|
||||
var zoom = 5;
|
||||
var zoom = 17;
|
||||
var map, layer;
|
||||
|
||||
function init(){
|
||||
map = new OpenLayers.Map( $('map') );
|
||||
map = new OpenLayers.Map( $('map') ,
|
||||
{ controls: [new OpenLayers.Control.MouseDefaults()] , 'numZoomLevels':20});
|
||||
|
||||
var normal = new OpenLayers.Layer.Google( "Google" );
|
||||
var satellite = new OpenLayers.Layer.Google( "Google Satellite" , {type: G_SATELLITE_MAP });
|
||||
var hybrid = new OpenLayers.Layer.Google( "Google Hybrid" , {type: G_HYBRID_MAP });
|
||||
var satellite = new OpenLayers.Layer.Google( "Google Satellite" , {type: G_SATELLITE_MAP, 'maxZoomLevel':18} );
|
||||
|
||||
|
||||
map.addLayers([normal, satellite, hybrid]);
|
||||
|
||||
map.addLayers([satellite]);
|
||||
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
||||
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic', 'transparent':true},
|
||||
{isBaseLayer: false} );
|
||||
layer.setVisibility(false);
|
||||
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
||||
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic', 'transparent':true},
|
||||
{isBaseLayer: false} );
|
||||
layer.setVisibility(false);
|
||||
map.addLayer(layer);
|
||||
var twms = new OpenLayers.Layer.WMS( "World Map",
|
||||
"http://world.freemap.in/cgi-bin/mapserv?",
|
||||
{map: '/www/freemap.in/world/map/factbooktrans.map', transparent:'true',
|
||||
layers: 'factbook', 'format':'png'} );
|
||||
map.addLayer(twms);
|
||||
markers = new OpenLayers.Layer.Markers("markers");
|
||||
map.addLayer(markers);
|
||||
|
||||
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
|
||||
map.setCenter(new OpenLayers.LonLat(10.205188,48.857593), 5);
|
||||
map.addControl( new OpenLayers.Control.LayerSwitcher() );
|
||||
map.addControl( new OpenLayers.Control.PanZoomBar() );
|
||||
|
||||
}
|
||||
|
||||
|
||||
51
examples/image-layer.html
Normal file
@@ -0,0 +1,51 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<style type="text/css">
|
||||
p {
|
||||
width: 512px;
|
||||
}
|
||||
#map {
|
||||
width: 512px;
|
||||
height: 256px;
|
||||
border: 1px solid gray;
|
||||
}
|
||||
</style>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
function init(){
|
||||
var map = new OpenLayers.Map('map');
|
||||
|
||||
var options = {maxResolution: 'auto', numZoomLevels: 3};
|
||||
|
||||
var graphic = new OpenLayers.Layer.Image(
|
||||
'City Lights',
|
||||
'http://earthtrends.wri.org/images/maps/4_m_citylights_lg.gif',
|
||||
new OpenLayers.Bounds(-180, -88.759, 180, 88.759),
|
||||
new OpenLayers.Size(580, 288),
|
||||
options);
|
||||
|
||||
var jpl_wms = new OpenLayers.Layer.WMS( "NASA Global Mosaic",
|
||||
"http://wms.jpl.nasa.gov/wms.cgi",
|
||||
{layers: "modis,global_mosaic"}, options);
|
||||
|
||||
map.addLayers([graphic, jpl_wms]);
|
||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||
map.zoomToMaxExtent();
|
||||
}
|
||||
// -->
|
||||
</script>
|
||||
</head>
|
||||
<body onload="init()">
|
||||
<h1>OpenLayers Image Layer Example</h1>
|
||||
<div id="map"></div>
|
||||
<p>
|
||||
The "City Lights" layer above is created from a single web accessible
|
||||
image. If you construct it without any resolution related options,
|
||||
the layer will be given a single resolution based on the extent/size.
|
||||
Otherwise, it behaves much like a regular layer. This is primarily
|
||||
intended to be used in an overview map - where another layer type
|
||||
might not make a good overview.
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -18,7 +18,7 @@
|
||||
{layers: 'basic'} );
|
||||
|
||||
var jpl_wms = new OpenLayers.Layer.KaMap( "Satellite",
|
||||
"/world/index.php", {g: "satellite", map: "world"});
|
||||
"http://www.openlayers.org/world/index.php", {g: "satellite", map: "world"});
|
||||
var dm_wms = new OpenLayers.Layer.WMS( "Canada",
|
||||
"http://www2.dmsolutions.ca/cgi-bin/mswms_gmap",
|
||||
{layers: "bathymetry,land_fn,park,drain_fn,drainage," +
|
||||
|
||||
86
examples/layer-opacity.html
Normal file
@@ -0,0 +1,86 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<style type="text/css">
|
||||
body {
|
||||
font-family: sans-serif;
|
||||
}
|
||||
#map {
|
||||
width: 512px;
|
||||
height: 350px;
|
||||
border: 1px solid lightgray;
|
||||
}
|
||||
p {
|
||||
width: 512px;
|
||||
}
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: black;
|
||||
font-weight: bold;
|
||||
font-size: 1.1em;
|
||||
}
|
||||
#opacity {
|
||||
padding: 0;
|
||||
text-align: center;
|
||||
width: 2em;
|
||||
font-family: sans-serif;
|
||||
background: transparent;
|
||||
color: black;
|
||||
border: 0;
|
||||
}
|
||||
p.note {
|
||||
font-style: italic;
|
||||
font-size: 0.8em;
|
||||
}
|
||||
</style>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
var map = null;
|
||||
var shade = null;
|
||||
var maxOpacity = 0.9;
|
||||
var minOpacity = 0.1;
|
||||
function changeOpacity(byOpacity) {
|
||||
var newOpacity = (parseFloat($('opacity').value) + byOpacity).toFixed(1);
|
||||
newOpacity = Math.min(maxOpacity,
|
||||
Math.max(minOpacity, newOpacity));
|
||||
$('opacity').value = newOpacity;
|
||||
shade.setOpacity(newOpacity);
|
||||
}
|
||||
function init(){
|
||||
var options = {
|
||||
projection: "EPSG:26912",
|
||||
units: 'm',
|
||||
maxExtent: new OpenLayers.Bounds(455402, 4967657, 473295, 4984095),
|
||||
maxResolution: 'auto',
|
||||
maxZoomLevel: 8
|
||||
};
|
||||
map = new OpenLayers.Map('map', options);
|
||||
var drg = new OpenLayers.Layer.WMS("Topo Maps",
|
||||
"http://terraservice.net/ogcmap.ashx",
|
||||
{layers: "DRG"});
|
||||
shade = new OpenLayers.Layer.WMS("Shaded Relief",
|
||||
"http://ims.cr.usgs.gov/servlet19/com.esri.wms.Esrimap/USGS_EDC_Elev_NED_3",
|
||||
{layers: "HR-NED.IMAGE", reaspect: "false", transparent: 'true'},
|
||||
{isBaseLayer: false, opacity: 0.3});
|
||||
map.addLayers([drg, shade]);
|
||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||
map.setCenter(new OpenLayers.LonLat(464348.5,4975876), 1);
|
||||
}
|
||||
// -->
|
||||
</script>
|
||||
</head>
|
||||
<body onload="init()">
|
||||
<h2>OpenLayers Layer Opacity Example</h2>
|
||||
<div id="map"></div>
|
||||
<p>
|
||||
Note that if you also have the setOpacity method defined on the Layer
|
||||
class, you can tweak the layer opacity after it has been added to the map.
|
||||
</p>
|
||||
<p>Opacity:
|
||||
<a title="decrease opacity" href="javascript: changeOpacity(-0.1);"><<</a>
|
||||
<input id="opacity" type="text" value="0.3" size="3" disabled="true" />
|
||||
<a title="increase opacity" href="javascript: changeOpacity(0.1);">>></a>
|
||||
</p>
|
||||
<p class="note">IE users: Wait until the shade layer has finished loading to try this.</p>
|
||||
</body>
|
||||
</html>
|
||||
31
examples/lite.html
Normal file
@@ -0,0 +1,31 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<style type="text/css">
|
||||
#map {
|
||||
width: 800px;
|
||||
height: 475px;
|
||||
border: 1px solid black;
|
||||
}
|
||||
</style>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
var lon = 5;
|
||||
var lat = 40;
|
||||
var zoom = 5;
|
||||
var map, layer;
|
||||
|
||||
function init(){
|
||||
map = new OpenLayers.Map( $('map') );
|
||||
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
||||
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
|
||||
map.addLayer(layer);
|
||||
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
|
||||
}
|
||||
// -->
|
||||
</script>
|
||||
</head>
|
||||
<body onload="init()">
|
||||
<div id="map"></div>
|
||||
</body>
|
||||
</html>
|
||||
43
examples/lonlatfrompx.html
Normal file
@@ -0,0 +1,43 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>OpenLayers Cursor Example</title>
|
||||
<style type="text/css">
|
||||
#map {
|
||||
width: 700px;
|
||||
height: 400px;
|
||||
border: 1px solid black;
|
||||
}
|
||||
</style>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
function init(){
|
||||
var map = new OpenLayers.Map('map', { controls: [] });
|
||||
|
||||
map.addControl(new OpenLayers.Control.PanZoomBar());
|
||||
map.addControl(new OpenLayers.Control.MouseToolbar());
|
||||
|
||||
map.addControl(new OpenLayers.Control.MousePosition());
|
||||
|
||||
var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
||||
"http://labs.metacarta.com/wms/vmap0",
|
||||
{layers: 'basic'} );
|
||||
|
||||
map.addLayers([ol_wms]);
|
||||
|
||||
OpenLayers.Event.observe($('map'),"click",mapclicked.bindAsEventListener(map));
|
||||
function mapclicked(e){
|
||||
var lonlat = map.getLonLatFromPixel(e.xy);
|
||||
alert("Lat: " + lonlat.lat + " (Pixel.x:" + e.xy.x + ")" + "\n" + "Lon: " + lonlat.lon + " (Pixel.y:" + e.xy.y + ")" );
|
||||
};
|
||||
|
||||
if (!map.getCenter()) map.zoomToMaxExtent();
|
||||
}
|
||||
// -->
|
||||
</script>
|
||||
</head>
|
||||
<body onload="init()">
|
||||
<h1>OpenLayers Cursor Example</h1>
|
||||
<div id="map"></div>
|
||||
</body>
|
||||
</html>
|
||||
34
examples/mapserver.html
Normal file
@@ -0,0 +1,34 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<style type="text/css">
|
||||
#map {
|
||||
width: 800px;
|
||||
height: 475px;
|
||||
border: 1px solid black;
|
||||
}
|
||||
</style>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
var lon = 5;
|
||||
var lat = 40;
|
||||
var zoom = 5;
|
||||
var map, layer;
|
||||
|
||||
function init(){
|
||||
map = new OpenLayers.Map( $('map') );
|
||||
layer = new OpenLayers.Layer.MapServer( "OpenLayers WMS",
|
||||
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
|
||||
map.addLayer(layer);
|
||||
|
||||
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
|
||||
map.addControl( new OpenLayers.Control.LayerSwitcher() );
|
||||
}
|
||||
|
||||
// -->
|
||||
</script>
|
||||
</head>
|
||||
<body onload="init()">
|
||||
<div id="map"></div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,6 +1,5 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
|
||||
<style type="text/css">
|
||||
#map {
|
||||
width: 512px;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
|
||||
<style type="text/css">
|
||||
#map {
|
||||
width: 512px;
|
||||
@@ -21,20 +20,29 @@
|
||||
|
||||
map.addLayer(layer);
|
||||
map.setCenter(new OpenLayers.LonLat(0, 0), 0);
|
||||
var markers = new OpenLayers.Layer.Markers( "Markers" );
|
||||
map.addLayer(markers);
|
||||
|
||||
var newl = new OpenLayers.Layer.Text( "text", { location:"./textfile.txt"} );
|
||||
map.addLayer(newl);
|
||||
|
||||
var markers = new OpenLayers.Layer.Markers( "Markers" );
|
||||
map.addLayer(markers);
|
||||
|
||||
var size = new OpenLayers.Size(10,17);
|
||||
var offset = new OpenLayers.Pixel(-(size.w/2), -size.h);
|
||||
var icon = new OpenLayers.Icon('http://boston.openguides.org/markers/AQUA.png',size,offset);
|
||||
markers.addMarker(new OpenLayers.Marker(new OpenLayers.LonLat(0,0),icon));
|
||||
markers.addMarker(new OpenLayers.Marker(new OpenLayers.LonLat(0,45),icon.clone()));
|
||||
|
||||
var halfIcon = icon.clone();
|
||||
markers.addMarker(new OpenLayers.Marker(new OpenLayers.LonLat(0,45),halfIcon));
|
||||
|
||||
marker = new OpenLayers.Marker(new OpenLayers.LonLat(90,10),icon.clone());
|
||||
marker.setOpacity(0.2);
|
||||
marker.events.register('mousedown', marker, function(evt) { alert(this.icon.url); Event.stop(evt); });
|
||||
markers.addMarker(marker);
|
||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||
map.zoomToMaxExtent();
|
||||
|
||||
halfIcon.setOpacity(0.5);
|
||||
}
|
||||
// -->
|
||||
</script>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
|
||||
<style type="text/css">
|
||||
#map {
|
||||
width: 512px;
|
||||
|
||||
57
examples/mm.html
Normal file
@@ -0,0 +1,57 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<style type="text/css">
|
||||
#map {
|
||||
width: 100%;
|
||||
height: 512px;
|
||||
border: 1px solid black;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<script type="text/javascript" src="http://clients.multimap.com/API/maps/1.1/metacarta_04"></script>
|
||||
|
||||
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
|
||||
var lon = 5;
|
||||
var lat = 40;
|
||||
var zoom = 5;
|
||||
var map, mmlayer, layer;
|
||||
|
||||
function init(){
|
||||
map = new OpenLayers.Map( $('map') ,
|
||||
{controls:[new OpenLayers.Control.MouseDefaults()]});
|
||||
|
||||
mmlayer = new OpenLayers.Layer.MultiMap( "MultiMap");
|
||||
map.addLayer(mmlayer);
|
||||
|
||||
markers = new OpenLayers.Layer.Markers("markers");
|
||||
map.addLayer(markers);
|
||||
|
||||
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
|
||||
map.addControl( new OpenLayers.Control.LayerSwitcher() );
|
||||
map.addControl( new OpenLayers.Control.PanZoomBar() );
|
||||
}
|
||||
|
||||
function add() {
|
||||
|
||||
marker = new OpenLayers.Marker(new OpenLayers.LonLat(2, 41));
|
||||
markers.addMarker(marker);
|
||||
}
|
||||
|
||||
function remove() {
|
||||
markers.removeMarker(marker);
|
||||
}
|
||||
// -->
|
||||
</script>
|
||||
</head>
|
||||
<body onload="init()">
|
||||
<h1>OpenLayers MultiMap Example</h1>
|
||||
<div id="map"></div>
|
||||
<div style="background-color:green" onclick="add()"> click to add the marker to the map</div>
|
||||
<div style="background-color:red" onclick="remove()"> click to remove the marker from the map</div>
|
||||
</body>
|
||||
</html>
|
||||
35
examples/multiserver.html
Normal file
@@ -0,0 +1,35 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<style type="text/css">
|
||||
#map {
|
||||
width: 800px;
|
||||
height: 475px;
|
||||
border: 1px solid black;
|
||||
}
|
||||
</style>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
var lon = 5;
|
||||
var lat = 40;
|
||||
var zoom = 5;
|
||||
var map, layer;
|
||||
|
||||
function init(){
|
||||
map = new OpenLayers.Map( $('map') );
|
||||
|
||||
var urlArray = ["http://labs.metacarta.com/wms-c/Basic.py",
|
||||
"http://monitor.metacarta.com/wms-c/Basic.py"];
|
||||
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
||||
urlArray,
|
||||
{layers: 'basic'} );
|
||||
map.addLayer(layer);
|
||||
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
|
||||
}
|
||||
// -->
|
||||
</script>
|
||||
</head>
|
||||
<body onload="init()">
|
||||
<div id="map"></div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
var ol_wms = new OpenLayers.Layer.WMS.Untiled( "OpenLayers WMS",
|
||||
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'} );
|
||||
ol_wms.isBaseLayer = true;
|
||||
ol_wms.addOptions({isBaseLayer: true});
|
||||
map.addLayers([ol_wms]);
|
||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||
map.setCenter(new OpenLayers.LonLat(0, 0), 0);
|
||||
|
||||
@@ -1,36 +1,35 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
|
||||
<style type="text/css">
|
||||
#map {
|
||||
width: 800px;
|
||||
height: 475px;
|
||||
border: 1px solid black;
|
||||
}
|
||||
</style>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
var zoom = 5;
|
||||
var map, layer;
|
||||
|
||||
function init(){
|
||||
map = new OpenLayers.Map( $('map') );
|
||||
layer = new OpenLayers.Layer.WMS( "OpenStreetMap WMS",
|
||||
"http://tile.openstreetmap.org/ruby/wmsmod.rbx?" );
|
||||
layer.setTileSize(new OpenLayers.Size(256,128));
|
||||
map.addLayer(layer);
|
||||
|
||||
map.setCenter(new OpenLayers.LonLat(-0.02197265625,51.492919921875), 13);
|
||||
map.addControl( new OpenLayers.Control.LayerSwitcher() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
// -->
|
||||
</script>
|
||||
</head>
|
||||
<body onload="init()">
|
||||
<div id="map"></div>
|
||||
</body>
|
||||
</html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<style type="text/css">
|
||||
#map {
|
||||
width: 800px;
|
||||
height: 475px;
|
||||
border: 1px solid black;
|
||||
}
|
||||
</style>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
var zoom = 5;
|
||||
var map, layer;
|
||||
|
||||
function init(){
|
||||
map = new OpenLayers.Map( $('map') );
|
||||
layer = new OpenLayers.Layer.WMS( "OpenStreetMap WMS",
|
||||
"http://tile.openstreetmap.org/ruby/wmsmod.rbx?" );
|
||||
layer.setTileSize(new OpenLayers.Size(256,128));
|
||||
map.addLayer(layer);
|
||||
|
||||
map.setCenter(new OpenLayers.LonLat(-0.02197265625,51.492919921875), 13);
|
||||
map.addControl( new OpenLayers.Control.LayerSwitcher() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
// -->
|
||||
</script>
|
||||
</head>
|
||||
<body onload="init()">
|
||||
<div id="map"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
47
examples/overviewmap.html
Normal file
@@ -0,0 +1,47 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>Overview Map Example</title>
|
||||
<script src="../lib/OpenLayers.js" type="text/javascript"></script>
|
||||
<style>
|
||||
#map{
|
||||
width:100%;
|
||||
height:500px;
|
||||
border:1px solid;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="map"></div>
|
||||
<script defer="defer" type="text/javascript">
|
||||
var map = new OpenLayers.Map('map');
|
||||
// my city
|
||||
var constantina = new OpenLayers.LonLat(-5.6165,37.8623);
|
||||
var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
||||
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
|
||||
var nasa_wms = new OpenLayers.Layer.WMS( "NASA Global Mosaic",
|
||||
"http://wms.jpl.nasa.gov/wms.cgi", {layers: "modis,global_mosaic"} );
|
||||
|
||||
map.addLayers([
|
||||
nasa_wms,
|
||||
wms
|
||||
]);
|
||||
|
||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||
|
||||
var options = {
|
||||
layers: [wms.clone()],
|
||||
minRatio: 8,
|
||||
maxRatio: 128
|
||||
};
|
||||
var overview = new OpenLayers.Control.OverviewMap(options);
|
||||
|
||||
map.addControl(overview);
|
||||
|
||||
map.setCenter(constantina, 4);
|
||||
|
||||
overview.maximizeControl();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,6 +1,5 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
|
||||
<style type="text/css">
|
||||
#map {
|
||||
width: 512px;
|
||||
@@ -22,8 +21,9 @@
|
||||
|
||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||
map.zoomToMaxExtent();
|
||||
|
||||
}
|
||||
|
||||
|
||||
function changer() {
|
||||
popup.setBackgroundColor("red");
|
||||
popup.setSize(new OpenLayers.Size(100,600));
|
||||
@@ -37,7 +37,8 @@
|
||||
popup = new OpenLayers.Popup("chicken",
|
||||
new OpenLayers.LonLat(5,40),
|
||||
new OpenLayers.Size(200,200),
|
||||
"example popup");
|
||||
"example popup",
|
||||
true);
|
||||
|
||||
map.addPopup(popup);
|
||||
}
|
||||
@@ -70,9 +71,9 @@
|
||||
function mousedown(evt) {
|
||||
if (popup == null) {
|
||||
popup = feature.createPopup();
|
||||
popup.setContentHTML("<a href='http://www.somethingconstructive.net' target='_blank'>click me</a>");
|
||||
popup.setBackgroundColor("yellow");
|
||||
popup.setOpacity(0.7);
|
||||
popup.events.register("mousedown", popup, onPopupMouseDown);
|
||||
markers.map.addPopup(popup);
|
||||
} else {
|
||||
markers.map.removePopup(popup);
|
||||
@@ -118,6 +119,6 @@
|
||||
<div style="background-color:red" onclick="remove()"> click to remove the popup from map</div>
|
||||
<div style="background-color:grey" onclick="removelayer()"> click to remove the markers layer</div>
|
||||
<div style="background-color:orange" onclick="alert(marker.onScreen())"> marker.onscreen()?</div>
|
||||
<div style="background-color:yellow" onclick="destroy()"> click to destroy the popup from map</div>
|
||||
<div style="background-color:yellow" onclick="destroy()"> click to destroy the popup from map</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -20,7 +20,7 @@ url = fs.getvalue('url', "http://openlayers.org")
|
||||
|
||||
# Designed to prevent Open Proxy type stuff.
|
||||
|
||||
allowedHosts = ['www.openlayers.org', 'openlayers.org', 'octo.metacarta.com', 'merrimack.metacarta.com', 'labs.metacarta.com']
|
||||
allowedHosts = ['www.openlayers.org', 'openlayers.org', 'octo.metacarta.com', 'merrimack.metacarta.com', 'labs.metacarta.com', 'world.freemap.in']
|
||||
|
||||
try:
|
||||
host = url.split("/")[2]
|
||||
|
||||
151
examples/scroll.html
Normal file
@@ -0,0 +1,151 @@
|
||||
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<title>OpenLayers: Home</title>
|
||||
<link rel="stylesheet" href="http://openlayers.org/common.css" type="text/css" />
|
||||
<link rel="stylesheet" href="http://trac.openlayers.org/chrome/common/css/trac.css" type="text/css" />
|
||||
<link rel="stylesheet" href="http://trac.openlayers.org/chrome/common/css/wiki.css" type="text/css" />
|
||||
<link rel="stylesheet" href="http://trac.openlayers.org/chrome/common/css/tracnav.css" type="text/css" />
|
||||
<link rel="stylesheet" href="http://openlayers.org/website.css" type="text/css" />
|
||||
<script type="text/javascript" src="//trac.openlayers.org/chrome/common/js/trac.js"></script>
|
||||
<!--[if lt IE 7]>
|
||||
<script defer="defer" type="text/javascript" src="/pngfix.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="olbanner">
|
||||
<img class="openlayersbannerimg" src="http://www.openlayers.org/images/OpenLayers.trac.png" style="height: 44px; width: 49px" border="0" alt="OpenLayers" />
|
||||
<a class="openlayersbanner" href="http://www.openlayers.org/" >
|
||||
OpenLayers</a>
|
||||
</div>
|
||||
<div id="navcontainer">
|
||||
<a class="navtabtraccurrent" href="http://www.openlayers.org">Home</a>
|
||||
<a class="navtab" href="http://trac.openlayers.org">Support & Development</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="mainnav" class="nav"><ul><li class="first"><a href="http://trac.openlayers.org/wiki" accesskey="1">Wiki</a></li><li><a href="/QuickTutorial" accesskey="2">Tutorial</a></li><li><a href="http://trac.openlayers.org/wiki/HowToDownload" accesskey="3">Download</a></li><li><a href="/gallery">Gallery</a></li><li><a href="/EmailLists">Email Lists</a></li></ul></div>
|
||||
|
||||
|
||||
<div id="main">
|
||||
<div id="mapFrame">
|
||||
<div id="map"></div>
|
||||
<div align="center"><b>Put an open map widget in any web page!</b></div>
|
||||
<div align="center">
|
||||
Double-click to zoom in, and drag to pan. Hold down the shift key
|
||||
and drag to zoom to a particular region.
|
||||
</div>
|
||||
</div>
|
||||
<h3>Get OpenLayers Now</h3>
|
||||
<p>
|
||||
Latest stable release: <a href="/api/2/OpenLayers.js">Link to the hosted version</a> | <a href="/download/OpenLayers-2.0.tar.gz">OpenLayers-2.0.tar.gz</a> | <a href="/doc/reference.html">Class Documentation</a> | <a href="/gallery/">See Screenshots</a>
|
||||
</p>
|
||||
<p><b>Latest Development Release</b>: Test out OpenLayers 2.1-RC2! <a href="/api/2.1-rc2/OpenLayers.js">Link to 2.1-RC2 Hosted Version</a>.</p>
|
||||
<p><b>FOSS4G</b>: Was the FOSS4G presentation too early for you this morning? The presentation is <a href="http://openlayers.org/presentations/foss4g2006/openlayers.odp">available in Open Office Impress format</a>, and the examples are <a href="http://openlayers.org/presentations/foss4g2006/examples/">available as well</a>.</p>
|
||||
<h3>About...</h3>
|
||||
<p>OpenLayers makes it easy to put a dynamic map in any web page. It can
|
||||
display map tiles and markers loaded from any source. <a
|
||||
href="http://www.metacarta.com/">MetaCarta</a> developed the initial version of
|
||||
OpenLayers and gave it to the public to further the use of geographic
|
||||
information of all kinds. OpenLayers is
|
||||
completely free, Open Source JavaScript, released under the BSD License.</p>
|
||||
|
||||
<h3>Put a map in your page.</h3>
|
||||
<p>We've released a Map Viewer Service that lets you put a map in your page easily. Just put this HTML in your page:</p>
|
||||
<pre>
|
||||
<iframe src="http://openlayers.org/viewer/"
|
||||
width="400px" height="200px"
|
||||
scrolling="no"
|
||||
marginwidth="0" marginheight="0"
|
||||
frameborder="0">
|
||||
</iframe></pre>
|
||||
|
||||
<p>Read more examples in the <a href="QuickTutorial">20-second tutorial</a>. The visual appearance of the MapViewer is not yet stable. If you like it, please join the <a href="EmailLists">users' email list</a> and tell us about your use.</p>
|
||||
|
||||
<h3>For Developers!</h3>
|
||||
<p>OpenLayers is a pure JavaScript library for displaying map data in most
|
||||
modern web browsers, with no server-side dependencies. OpenLayers implements a
|
||||
(still-developing) <a href="//trac.openlayers.org/wiki/Documentation">JavaScript
|
||||
API</a> for building rich web-based geographic applications, similar to the
|
||||
Google Maps and MSN Virtual Earth APIs, with one important difference --
|
||||
OpenLayers is Free Software, developed for and by the Open Source software
|
||||
community.</p>
|
||||
|
||||
<p>Furthermore, OpenLayers implements industry-standard methods for geographic
|
||||
data access, such as the OpenGIS Consortium's Web Mapping Service (WMS) and Web
|
||||
Feature Service (WFS) protocols. Under the hood, OpenLayers is written in
|
||||
object-oriented JavaScript, using <a
|
||||
href="//prototype.conio.net/">Prototype.js</a> and components from the <a
|
||||
href="//openrico.org/">Rico<a> library. The OpenLayers code base already has
|
||||
hundreds of <a href="/dev/tests/run-tests.html">unit tests</a>, via the <a
|
||||
href="http://straytree.com/TestAnotherWay/doc/index.html">Test.AnotherWay</a>
|
||||
framework.</p>
|
||||
|
||||
<p>As a framework, OpenLayers is intended to separate map <i>tools</i> from map
|
||||
<i>data</i> so that all the tools can operate on all the data sources. This
|
||||
separation breaks the proprietary silos that earlier GIS revolutions have
|
||||
taught civilization to avoid. The mapping revolution on the public Web should
|
||||
benefit from the experience of history.</p>
|
||||
|
||||
<h3>Getting the Code</h3>
|
||||
|
||||
<p>Releases are made available on the <a href="/download/">downloads</a> page.
|
||||
Additionally, if you wish to use OpenLayers in a web application, you can
|
||||
include
|
||||
<tt>
|
||||
<a href="http://www.openlayers.org/api/OpenLayers.js">http://www.openlayers.org/api/OpenLayers.js</a>
|
||||
</tt> in your page, to always get the latest release.</p>
|
||||
|
||||
<p> The code is also available in our
|
||||
<a href="//trac.openlayers.org/wiki/HowToDownload">Subversion repository</a>.
|
||||
Using Subversion, you can keep up to the absolute bleeding edge of the code.
|
||||
If you wish to report a bug in the API, and you are able to use Subversion,
|
||||
please see if the bug has been fixed in Subversion first: OpenLayers is
|
||||
under rapid development, so things change quickly.
|
||||
</p>
|
||||
|
||||
<p>If you don't have Subversion or don't want to download the code, you can
|
||||
still try some <a href="/dev/examples/">live examples</a> on
|
||||
openlayers.org. If you're familiar with JavaScript, try viewing the source
|
||||
of the examples to get an idea how the OpenLayers library is used.</p>
|
||||
|
||||
<p>OpenLayers is still undergoing rapid development, so expect a lot to change
|
||||
in the next few weeks and months. We need your support! Please check the <a
|
||||
href="//trac.openlayers.org">wiki</a> for the very latest updates and
|
||||
documentation, and thank you for taking an interest.</p>
|
||||
|
||||
</div>
|
||||
<script type="text/javascript" src="../lib/OpenLayers.js"></script>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
var map = new OpenLayers.Map('map');
|
||||
|
||||
var ol_wms = new OpenLayers.Layer.WMS( "World Map",
|
||||
"http://labs.metacarta.com/wms/vmap0?",
|
||||
{layers: 'basic'} );
|
||||
|
||||
var jpl_wms = new OpenLayers.Layer.KaMap( "Satellite",
|
||||
"/world/index.php", {g: "satellite", map: "world"});
|
||||
var dm_wms = new OpenLayers.Layer.WMS( "Canada",
|
||||
"http://www2.dmsolutions.ca/cgi-bin/mswms_gmap",
|
||||
{layers: "bathymetry,land_fn,park,drain_fn,drainage," +
|
||||
"prov_bound,fedlimit,rail,road,popplace",
|
||||
transparent: "true", format: "image/png" });
|
||||
|
||||
dm_wms.setVisibility(false);
|
||||
|
||||
map.addLayers([ol_wms, jpl_wms, dm_wms]);
|
||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||
map.zoomToMaxExtent();
|
||||
// -->
|
||||
</script>
|
||||
<div id="sidebar"></div>
|
||||
<div id="footer"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
29
examples/setextent.html
Normal file
@@ -0,0 +1,29 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Setting a visual Extent</title>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Setting a Visual Extent</h1>
|
||||
<p>
|
||||
Because the ability to set the map to a given extent is limited by the
|
||||
current resolutions available, zoomToExtent will not always set the map to
|
||||
exactly the right extent. In order to visually annotate the actual extent,
|
||||
this example, will use the Boxes layer to visually describe the desired
|
||||
extent as well as setting the map extent.
|
||||
</p>
|
||||
<div style="width:100%; height:75%" id="map"></div>
|
||||
<script defer="defer" type="text/javascript">
|
||||
var map = new OpenLayers.Map('map');
|
||||
var bounds = new OpenLayers.Bounds(-45,-45, 0, 45);
|
||||
var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
||||
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
|
||||
map.addLayer(wms);
|
||||
map.zoomToExtent(bounds);
|
||||
var boxes = new OpenLayers.Layer.Boxes("boxes");
|
||||
var box = new OpenLayers.Marker.Box(bounds);
|
||||
boxes.addMarker(box);
|
||||
map.addLayer(boxes);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,4 +1,4 @@
|
||||
point title description iconSize
|
||||
10,20 my orange title my orange description 21,25
|
||||
2,4 my aqua title my aqua description 21,25
|
||||
42,-71 my purple title my purple description<br/>is great. 21,25
|
||||
point title description icon
|
||||
10,20 my orange title my orange description
|
||||
2,4 my aqua title my aqua description
|
||||
42,-71 my purple title my purple description<br/>is great. http://www.openlayers.org/api/img/zoom-world-mini.png
|
||||
|
||||
@@ -14,11 +14,12 @@
|
||||
var map = new OpenLayers.Map('map', {'maxResolution': 1.40625/4, controls:[]});
|
||||
|
||||
var ka_wms = new OpenLayers.Layer.KaMap( "TIGER (KaMap)",
|
||||
"http://boston.freemap.in/tile.php" , { map: 'tiger', layers: 'TIGER' }, 'degrees', 72 );
|
||||
"http://boston.freemap.in/tile.php" , { map: 'tiger', layers: 'TIGER' });
|
||||
var jpl_wms = new OpenLayers.Layer.WMS( "NASA Global Mosaic",
|
||||
"http://wms.jpl.nasa.gov/wms.cgi",
|
||||
{layers: "modis,global_mosaic"});
|
||||
jpl_wms.setVisibility(false);
|
||||
ka_wms.addOptions({isBaseLayer: false});
|
||||
map.addLayers([jpl_wms,ka_wms]);
|
||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||
map.addControl(new OpenLayers.Control.MouseToolbar());
|
||||
|
||||
39
examples/tms.html
Normal file
@@ -0,0 +1,39 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<style type="text/css">
|
||||
#map {
|
||||
width: 800px;
|
||||
height: 475px;
|
||||
border: 1px solid black;
|
||||
}
|
||||
</style>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
var lon = 5;
|
||||
var lat = 40;
|
||||
var zoom = 5;
|
||||
var map, layer;
|
||||
|
||||
function init(){
|
||||
map = new OpenLayers.Map( $('map'), {maxResolution:1.40625/2} );
|
||||
layer = new OpenLayers.Layer.TMS( "TMS",
|
||||
"http://labs.metacarta.com/wms-c/Basic.py/", {layername: 'basic', type:'png'} );
|
||||
map.addLayer(layer);
|
||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
|
||||
}
|
||||
function addTMS() {
|
||||
l=new OpenLayers.Layer.TMS($('layer').value, $('url').value, {layername: $('layer').value, type:$('type').value});
|
||||
map.addLayer(l);
|
||||
map.setBaseLayer(l);
|
||||
}
|
||||
// -->
|
||||
</script>
|
||||
</head>
|
||||
<body onload="init()">
|
||||
URL of TMS (Should end in /): <input type="text" id="url" size="60" /> layer_name <input type="text" id="layer" /> <select id="type"><option>png</option><option>jpg</option></select> <input type="submit" onclick="addTMS()"/><br />
|
||||
Example: http://mapserver.refractions.net/cgi-bin/tms/, global_mosaic, jpg
|
||||
<div id="map"></div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -11,15 +11,15 @@
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
function init(){
|
||||
var map = new OpenLayers.Map('map', {'maxResolution': 1.6, maxZoomLevel:20});
|
||||
|
||||
var mapOptions = { maxResolution: 1.6, numZoomLevels: 21};
|
||||
var map = new OpenLayers.Map('map', mapOptions);
|
||||
|
||||
var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
||||
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'} );
|
||||
|
||||
var ww = new OpenLayers.Layer.WorldWind( "Urban",
|
||||
"http://worldwind25.arc.nasa.gov/tile/tile.aspx?", .8, 9,
|
||||
{T:"104"});
|
||||
ww.setTileSize(new OpenLayers.Size(512,512));
|
||||
{T:"104"}, { tileSize: new OpenLayers.Size(512,512) });
|
||||
|
||||
|
||||
map.addLayers([ol_wms, ww]);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
|
||||
<style type="text/css">
|
||||
#map {
|
||||
width: 100%;
|
||||
@@ -18,20 +17,31 @@
|
||||
|
||||
var lon = 5;
|
||||
var lat = 40;
|
||||
var zoom = 5;
|
||||
var zoom = 15;
|
||||
var map, velayer, layer;
|
||||
|
||||
function init(){
|
||||
map = new OpenLayers.Map( $('map') );
|
||||
map = new OpenLayers.Map( $('map') ,
|
||||
{controls:[new OpenLayers.Control.MouseDefaults()]});
|
||||
|
||||
velayer = new OpenLayers.Layer.VirtualEarth( "VE");
|
||||
velayer = new OpenLayers.Layer.VirtualEarth( "VE",
|
||||
{ minZoomLevel: 4, maxZoomLevel: 6, 'type': VEMapStyle.Aerial});
|
||||
map.addLayer(velayer);
|
||||
|
||||
var twms = new OpenLayers.Layer.WMS( "World Map",
|
||||
"http://world.freemap.in/cgi-bin/mapserv?",
|
||||
{ map: '/www/freemap.in/world/map/factbooktrans.map',
|
||||
transparent:'true',
|
||||
layers: 'factbook',
|
||||
'format':'png'} );
|
||||
map.addLayer(twms);
|
||||
|
||||
markers = new OpenLayers.Layer.Markers("markers");
|
||||
map.addLayer(markers);
|
||||
|
||||
map.setCenter(new OpenLayers.LonLat(lon, lat), 2);
|
||||
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
|
||||
map.addControl( new OpenLayers.Control.LayerSwitcher() );
|
||||
map.addControl( new OpenLayers.Control.PanZoomBar() );
|
||||
}
|
||||
|
||||
function add() {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
|
||||
<style type="text/css">
|
||||
#map {
|
||||
width: 512px;
|
||||
|
||||
@@ -1,35 +1,34 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
|
||||
<style type="text/css">
|
||||
#map {
|
||||
width: 800px;
|
||||
height: 475px;
|
||||
border: 1px solid black;
|
||||
}
|
||||
</style>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
var lon = 5;
|
||||
var lat = 40;
|
||||
var zoom = 5;
|
||||
var map, layer;
|
||||
|
||||
function init(){
|
||||
map = new OpenLayers.Map( $('map') );
|
||||
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
||||
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
|
||||
map.addLayer(layer);
|
||||
|
||||
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
|
||||
map.addControl( new OpenLayers.Control.LayerSwitcher() );
|
||||
}
|
||||
|
||||
// -->
|
||||
</script>
|
||||
</head>
|
||||
<body onload="init()">
|
||||
<div id="map"></div>
|
||||
</body>
|
||||
</html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<style type="text/css">
|
||||
#map {
|
||||
width: 800px;
|
||||
height: 475px;
|
||||
border: 1px solid black;
|
||||
}
|
||||
</style>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
var lon = 5;
|
||||
var lat = 40;
|
||||
var zoom = 5;
|
||||
var map, layer;
|
||||
|
||||
function init(){
|
||||
map = new OpenLayers.Map( $('map') );
|
||||
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
||||
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
|
||||
map.addLayer(layer);
|
||||
|
||||
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
|
||||
map.addControl( new OpenLayers.Control.LayerSwitcher() );
|
||||
}
|
||||
|
||||
// -->
|
||||
</script>
|
||||
</head>
|
||||
<body onload="init()">
|
||||
<div id="map"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -35,7 +35,7 @@ var map,ia_wms;
|
||||
<body onload="init()">
|
||||
<h1>OpenLayers Example</h1>
|
||||
<p>WMS-T example: update the times, and the radar image will change. Uses Layer.changeParams. Thanks to David Bitner for the inspiration, the original code, and the kick in the butt!</p>
|
||||
<input type='text' id='time' value="2005-08-29T13:00:00Z" onChange='ia_wms.changeParams({"time":this.value});' >
|
||||
<input type='text' id='time' value="2005-08-29T13:00:00Z" onChange='ia_wms.mergeNewParams({"time":this.value});' >
|
||||
<div id="map"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -10,20 +10,19 @@
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
var ol_wms, ww, ww2;
|
||||
function init(){
|
||||
var map = new OpenLayers.Map('map', {'maxResolution': .0703125*4});
|
||||
var map = new OpenLayers.Map('map', {'maxResolution': .28125, tileSize: new OpenLayers.Size(512, 512)});
|
||||
|
||||
var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
||||
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'} );
|
||||
ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
||||
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'} );
|
||||
|
||||
var ww = new OpenLayers.Layer.WorldWind( "Bathy",
|
||||
"http://worldwind25.arc.nasa.gov/tile/tile.aspx?", 36, 4,
|
||||
{T:"bmng.topo.bathy.200406"});
|
||||
ww.setTileSize(new OpenLayers.Size(512,512));
|
||||
var ww2 = new OpenLayers.Layer.WorldWind( "LANDSAT",
|
||||
ww = new OpenLayers.Layer.WorldWind( "Bathy",
|
||||
"http://worldwind25.arc.nasa.gov/tile/tile.aspx?", 36, 4,
|
||||
{T:"bmng.topo.bathy.200406"});
|
||||
ww2 = new OpenLayers.Layer.WorldWind( "LANDSAT",
|
||||
"http://worldwind25.arc.nasa.gov/tile/tile.aspx", 2.25, 4,
|
||||
{T:"105"});
|
||||
ww2.setTileSize(new OpenLayers.Size(512,512));
|
||||
|
||||
|
||||
|
||||
@@ -37,5 +36,7 @@
|
||||
<body onload="init()">
|
||||
<h1>OpenLayers Example</h1>
|
||||
<div id="map"></div>
|
||||
<p>This is a demonstration of using Tiled WorldWind layers. WorldWind requires you to define a "LZTD" -- the 3rd param of the constructor -- and the number of zoom levels it supports. When a worldwind layer is not visible at a given tile level, and empty tile is placed there instead. Note that the maxResolution of the map times 512px, must be a multiple of a power of two different from the LZTD -- in this case, .28125 * 512 is 144, which is 36*4, and 2.25*64.</p>
|
||||
<p>This example has a 'Bathy' layer, visible as you zoom out, and a 'landsat' layer, visible as you zoom in, both visible at zoom level 6.</p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" style="width:100%">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
<title>XHTML Example</title>
|
||||
<script src="../lib/OpenLayers.js" type="text/javascript"></script>
|
||||
</head>
|
||||
<body style="width:100%">
|
||||
<div style="width:100%; height:500px" id="map"></div>
|
||||
@@ -13,5 +14,10 @@
|
||||
map.addLayer(wms);
|
||||
map.zoomToMaxExtent();
|
||||
</script>
|
||||
<p>
|
||||
<a href="http://validator.w3.org/check/referer"><img
|
||||
src="http://www.w3.org/Icons/valid-xhtml10"
|
||||
alt="Valid XHTML 1.0!" height="31" width="88" /></a>
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,38 +1,38 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
|
||||
<style type="text/css">
|
||||
#map {
|
||||
width: 512px;
|
||||
height: 512px;
|
||||
border: 1px solid black;
|
||||
}
|
||||
</style>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
var map, layer, velayer;
|
||||
|
||||
function init(){
|
||||
map = new OpenLayers.Map('map');
|
||||
|
||||
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
||||
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
|
||||
map.addLayer(layer);
|
||||
|
||||
|
||||
yahooLayer = new OpenLayers.Layer.Yahoo( "Yahoo");
|
||||
|
||||
map.addLayer(yahooLayer);
|
||||
|
||||
map.setCenter(new OpenLayers.LonLat(-5, 40), 4);
|
||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||
}
|
||||
// -->
|
||||
</script>
|
||||
</head>
|
||||
<body onload="init()">
|
||||
<h1>OpenLayers Example</h1>
|
||||
<div id="map"></div>
|
||||
</body>
|
||||
</html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<style type="text/css">
|
||||
#map {
|
||||
width: 512px;
|
||||
height: 512px;
|
||||
border: 1px solid black;
|
||||
}
|
||||
</style>
|
||||
<script src="http://api.maps.yahoo.com/ajaxymap?v=3.0&appid=euzuro-openlayers"></script>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
var map, layer, velayer;
|
||||
|
||||
function init(){
|
||||
map = new OpenLayers.Map('map');
|
||||
|
||||
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
||||
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
|
||||
map.addLayer(layer);
|
||||
|
||||
|
||||
yahooLayer = new OpenLayers.Layer.Yahoo( "Yahoo");
|
||||
|
||||
map.addLayer(yahooLayer);
|
||||
|
||||
map.setCenter(new OpenLayers.LonLat(-5, 40), 4);
|
||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||
}
|
||||
// -->
|
||||
</script>
|
||||
</head>
|
||||
<body onload="init()">
|
||||
<h1>OpenLayers Example</h1>
|
||||
<div id="map"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
53
examples/zoomLevels.html
Normal file
@@ -0,0 +1,53 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<style type="text/css">
|
||||
#map {
|
||||
width: 800px;
|
||||
height: 475px;
|
||||
border: 1px solid black;
|
||||
}
|
||||
</style>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
var lon = 50;
|
||||
var lat = 0;
|
||||
var zoom = 0;
|
||||
var map, layer;
|
||||
|
||||
function init(){
|
||||
|
||||
var options = {
|
||||
// resolutions: [1.40625,0.703125,0.3515625,0.17578125,0.087890625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.00137329101],
|
||||
// scales: [50000000, 10000000],
|
||||
// maxResolution: 0.17578125,
|
||||
// minResolution: 0.0439453125,
|
||||
// maxScale: 10000000,
|
||||
// minScale: 50000000,
|
||||
minResolution: "auto",
|
||||
minExtent: new OpenLayers.Bounds(-1, -1, 1, 1),
|
||||
maxResolution: "auto",
|
||||
maxExtent: new OpenLayers.Bounds(-180, -90, 90, 180),
|
||||
// numZoomLevels: 5,
|
||||
controls: [new OpenLayers.Control.MouseDefaults()]
|
||||
};
|
||||
|
||||
map = new OpenLayers.Map( $('map') , options);
|
||||
|
||||
map.addControl(new OpenLayers.Control.PanZoomBar());
|
||||
|
||||
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
||||
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'});
|
||||
map.addLayer(layer);
|
||||
|
||||
|
||||
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
|
||||
}
|
||||
|
||||
// -->
|
||||
</script>
|
||||
</head>
|
||||
<body onload="init()">
|
||||
<div id="map"></div>
|
||||
</body>
|
||||
</html>
|
||||
BIN
img/blank.gif
Normal file
|
After Width: | Height: | Size: 42 B |
BIN
img/close.gif
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 1.2 KiB |
BIN
img/marker-blue.png
Normal file
|
After Width: | Height: | Size: 992 B |
BIN
img/marker-gold.png
Normal file
|
After Width: | Height: | Size: 831 B |
BIN
img/marker-green.png
Normal file
|
After Width: | Height: | Size: 967 B |
@@ -1,6 +1,7 @@
|
||||
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
|
||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
|
||||
* text of the license. */
|
||||
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
|
||||
* for the full text of the license. */
|
||||
|
||||
////
|
||||
/// This blob sucks in all the files in uncompressed form for ease of use
|
||||
///
|
||||
@@ -48,11 +49,10 @@ if (typeof(_OPENLAYERS_SFL_) == "undefined") {
|
||||
*/
|
||||
(function() {
|
||||
var jsfiles=new Array(
|
||||
"Prototype.js",
|
||||
"Rico/Corner.js",
|
||||
"Rico/Color.js",
|
||||
"OpenLayers/BaseTypes.js",
|
||||
"OpenLayers/Util.js",
|
||||
"Rico/Corner.js",
|
||||
"Rico/Color.js",
|
||||
"OpenLayers/Ajax.js",
|
||||
"OpenLayers/Events.js",
|
||||
"OpenLayers/Map.js",
|
||||
@@ -66,13 +66,17 @@ if (typeof(_OPENLAYERS_SFL_) == "undefined") {
|
||||
"OpenLayers/Feature/WFS.js",
|
||||
"OpenLayers/Tile/Image.js",
|
||||
"OpenLayers/Tile/WFS.js",
|
||||
"OpenLayers/Layer/Image.js",
|
||||
"OpenLayers/Layer/EventPane.js",
|
||||
"OpenLayers/Layer/FixedZoomLevels.js",
|
||||
"OpenLayers/Layer/Google.js",
|
||||
"OpenLayers/Layer/VirtualEarth.js",
|
||||
// "OpenLayers/Layer/Yahoo.js",
|
||||
"OpenLayers/Layer/Yahoo.js",
|
||||
"OpenLayers/Layer/HTTPRequest.js",
|
||||
"OpenLayers/Layer/Grid.js",
|
||||
"OpenLayers/Layer/MapServer.js",
|
||||
"OpenLayers/Layer/KaMap.js",
|
||||
"OpenLayers/Layer/MultiMap.js",
|
||||
"OpenLayers/Layer/Markers.js",
|
||||
"OpenLayers/Layer/Text.js",
|
||||
"OpenLayers/Layer/WorldWind.js",
|
||||
@@ -81,34 +85,41 @@ if (typeof(_OPENLAYERS_SFL_) == "undefined") {
|
||||
"OpenLayers/Layer/WMS/Untiled.js",
|
||||
"OpenLayers/Layer/GeoRSS.js",
|
||||
"OpenLayers/Layer/Boxes.js",
|
||||
"OpenLayers/Layer/Canvas.js",
|
||||
"OpenLayers/Layer/TMS.js",
|
||||
"OpenLayers/Popup/Anchored.js",
|
||||
"OpenLayers/Popup/AnchoredBubble.js",
|
||||
"OpenLayers/Control.js",
|
||||
"OpenLayers/Control/MouseDefaults.js",
|
||||
"OpenLayers/Control/MouseToolbar.js",
|
||||
"OpenLayers/Control/MousePosition.js",
|
||||
"OpenLayers/Control/OverviewMap.js",
|
||||
"OpenLayers/Control/KeyboardDefaults.js",
|
||||
"OpenLayers/Control/PanZoom.js",
|
||||
"OpenLayers/Control/PanZoomBar.js",
|
||||
"OpenLayers/Control/ArgParser.js",
|
||||
"OpenLayers/Control/Permalink.js",
|
||||
"OpenLayers/Control/Scale.js",
|
||||
"OpenLayers/Control/LayerSwitcher.js",
|
||||
"OpenLayers/Control/LayerTabs.js"
|
||||
"OpenLayers/Control/LayerSwitcher.js"
|
||||
); // etc.
|
||||
|
||||
var allScriptTags = "";
|
||||
var host = OpenLayers._getScriptLocation() + "lib/";
|
||||
|
||||
// check to see if prototype.js was already loaded
|
||||
// if so, skip the first dynamic include
|
||||
//
|
||||
var start=1;
|
||||
try { x = Prototype; }
|
||||
catch (e) { start=0; }
|
||||
|
||||
for (var i = start; i < jsfiles.length; i++) {
|
||||
var currentScriptTag = "<script src='" + host + jsfiles[i] + "'></script>";
|
||||
allScriptTags += currentScriptTag;
|
||||
for (var i = 0; i < jsfiles.length; i++) {
|
||||
if (/MSIE/.test(navigator.userAgent) || /Safari/.test(navigator.userAgent)) {
|
||||
var currentScriptTag = "<script src='" + host + jsfiles[i] + "'></script>";
|
||||
allScriptTags += currentScriptTag;
|
||||
} else {
|
||||
var s = document.createElement("script");
|
||||
s.src = host + jsfiles[i];
|
||||
var h = document.getElementsByTagName("head").length ?
|
||||
document.getElementsByTagName("head")[0] :
|
||||
document.body;
|
||||
h.appendChild(s);
|
||||
}
|
||||
}
|
||||
document.write(allScriptTags);
|
||||
if (allScriptTags) document.write(allScriptTags);
|
||||
})();
|
||||
}
|
||||
OpenLayers.VERSION_NUMBER="$Revision$";
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
|
||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
|
||||
* text of the license. */
|
||||
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
|
||||
* for the full text of the license. */
|
||||
|
||||
|
||||
OpenLayers.ProxyHost = "";
|
||||
//OpenLayers.ProxyHost = "examples/proxy.cgi?url=";
|
||||
@@ -60,7 +61,7 @@ OpenLayers.loadURL = function(uri, params, caller,
|
||||
: OpenLayers.nullHandler;
|
||||
|
||||
// from prototype.js
|
||||
new Ajax.Request(uri,
|
||||
new OpenLayers.Ajax.Request(uri,
|
||||
{ method: 'get',
|
||||
parameters: params,
|
||||
onComplete: success,
|
||||
@@ -83,7 +84,7 @@ OpenLayers.parseXMLString = function(text) {
|
||||
text = text.substring(index);
|
||||
}
|
||||
|
||||
var ajaxResponse = Try.these(
|
||||
var ajaxResponse = OpenLayers.Util.Try(
|
||||
function() {
|
||||
var xmldom = new ActiveXObject('Microsoft.XMLDOM');
|
||||
xmldom.loadXML(text);
|
||||
@@ -106,3 +107,202 @@ OpenLayers.parseXMLString = function(text) {
|
||||
|
||||
return ajaxResponse;
|
||||
};
|
||||
|
||||
OpenLayers.Ajax = {
|
||||
emptyFunction: function () {},
|
||||
|
||||
getTransport: function() {
|
||||
return OpenLayers.Util.Try(
|
||||
function() {return new ActiveXObject('Msxml2.XMLHTTP')},
|
||||
function() {return new ActiveXObject('Microsoft.XMLHTTP')},
|
||||
function() {return new XMLHttpRequest()}
|
||||
) || false;
|
||||
},
|
||||
|
||||
activeRequestCount: 0
|
||||
};
|
||||
|
||||
OpenLayers.Ajax.Responders = {
|
||||
responders: [],
|
||||
|
||||
register: function(responderToAdd) {
|
||||
for (var i = 0; i < this.responders.length; i++)
|
||||
if (responderToAdd == this.responders[i])
|
||||
return;
|
||||
this.responders.push(responderToAdd);
|
||||
},
|
||||
|
||||
dispatch: function(callback, request, transport, json) {
|
||||
for (var i = 0; i < this.responders.length; i++) {
|
||||
responder = this.responders[i];
|
||||
if (responder[callback] && typeof responder[callback] == 'function') {
|
||||
try {
|
||||
responder[callback].apply(responder, [request, transport, json]);
|
||||
} catch (e) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
OpenLayers.Ajax.Responders.register({
|
||||
onCreate: function() {
|
||||
OpenLayers.Ajax.activeRequestCount++;
|
||||
},
|
||||
|
||||
onComplete: function() {
|
||||
OpenLayers.Ajax.activeRequestCount--;
|
||||
}
|
||||
});
|
||||
|
||||
OpenLayers.Ajax.Base = function() {};
|
||||
OpenLayers.Ajax.Base.prototype = {
|
||||
setOptions: function(options) {
|
||||
this.options = {
|
||||
method: 'post',
|
||||
asynchronous: true,
|
||||
parameters: ''
|
||||
}
|
||||
OpenLayers.Util.extend(this.options, options || {});
|
||||
},
|
||||
|
||||
responseIsSuccess: function() {
|
||||
return this.transport.status == undefined
|
||||
|| this.transport.status == 0
|
||||
|| (this.transport.status >= 200 && this.transport.status < 300);
|
||||
},
|
||||
|
||||
responseIsFailure: function() {
|
||||
return !this.responseIsSuccess();
|
||||
}
|
||||
}
|
||||
|
||||
OpenLayers.Ajax.Request = OpenLayers.Class.create();
|
||||
OpenLayers.Ajax.Request.Events =
|
||||
['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete'];
|
||||
|
||||
OpenLayers.Ajax.Request.prototype = OpenLayers.Class.inherit( OpenLayers.Ajax.Base, {
|
||||
initialize: function(url, options) {
|
||||
this.transport = OpenLayers.Ajax.getTransport();
|
||||
this.setOptions(options);
|
||||
this.request(url);
|
||||
},
|
||||
|
||||
request: function(url) {
|
||||
var parameters = this.options.parameters || '';
|
||||
if (parameters.length > 0) parameters += '&_=';
|
||||
|
||||
try {
|
||||
this.url = url;
|
||||
if (this.options.method == 'get' && parameters.length > 0)
|
||||
this.url += (this.url.match(/\?/) ? '&' : '?') + parameters;
|
||||
|
||||
OpenLayers.Ajax.Responders.dispatch('onCreate', this, this.transport);
|
||||
|
||||
this.transport.open(this.options.method, this.url,
|
||||
this.options.asynchronous);
|
||||
|
||||
if (this.options.asynchronous) {
|
||||
this.transport.onreadystatechange = this.onStateChange.bind(this);
|
||||
setTimeout((function() {this.respondToReadyState(1)}).bind(this), 10);
|
||||
}
|
||||
|
||||
this.setRequestHeaders();
|
||||
|
||||
var body = this.options.postBody ? this.options.postBody : parameters;
|
||||
this.transport.send(this.options.method == 'post' ? body : null);
|
||||
|
||||
} catch (e) {
|
||||
this.dispatchException(e);
|
||||
}
|
||||
},
|
||||
|
||||
setRequestHeaders: function() {
|
||||
var requestHeaders =
|
||||
['X-Requested-With', 'XMLHttpRequest',
|
||||
'X-Prototype-Version', 'OpenLayers'];
|
||||
|
||||
if (this.options.method == 'post') {
|
||||
requestHeaders.push('Content-type',
|
||||
'application/x-www-form-urlencoded');
|
||||
|
||||
/* Force "Connection: close" for Mozilla browsers to work around
|
||||
* a bug where XMLHttpReqeuest sends an incorrect Content-length
|
||||
* header. See Mozilla Bugzilla #246651.
|
||||
*/
|
||||
if (this.transport.overrideMimeType)
|
||||
requestHeaders.push('Connection', 'close');
|
||||
}
|
||||
|
||||
if (this.options.requestHeaders)
|
||||
requestHeaders.push.apply(requestHeaders, this.options.requestHeaders);
|
||||
|
||||
for (var i = 0; i < requestHeaders.length; i += 2)
|
||||
this.transport.setRequestHeader(requestHeaders[i], requestHeaders[i+1]);
|
||||
},
|
||||
|
||||
onStateChange: function() {
|
||||
var readyState = this.transport.readyState;
|
||||
if (readyState != 1)
|
||||
this.respondToReadyState(this.transport.readyState);
|
||||
},
|
||||
|
||||
header: function(name) {
|
||||
try {
|
||||
return this.transport.getResponseHeader(name);
|
||||
} catch (e) {}
|
||||
},
|
||||
|
||||
evalJSON: function() {
|
||||
try {
|
||||
return eval(this.header('X-JSON'));
|
||||
} catch (e) {}
|
||||
},
|
||||
|
||||
evalResponse: function() {
|
||||
try {
|
||||
return eval(this.transport.responseText);
|
||||
} catch (e) {
|
||||
this.dispatchException(e);
|
||||
}
|
||||
},
|
||||
|
||||
respondToReadyState: function(readyState) {
|
||||
var event = OpenLayers.Ajax.Request.Events[readyState];
|
||||
var transport = this.transport, json = this.evalJSON();
|
||||
|
||||
if (event == 'Complete') {
|
||||
try {
|
||||
(this.options['on' + this.transport.status]
|
||||
|| this.options['on' + (this.responseIsSuccess() ? 'Success' : 'Failure')]
|
||||
|| OpenLayers.Ajax.emptyFunction)(transport, json);
|
||||
} catch (e) {
|
||||
this.dispatchException(e);
|
||||
}
|
||||
|
||||
if ((this.header('Content-type') || '').match(/^text\/javascript/i))
|
||||
this.evalResponse();
|
||||
}
|
||||
|
||||
try {
|
||||
(this.options['on' + event] || OpenLayers.Ajax.emptyFunction)(transport, json);
|
||||
OpenLayers.Ajax.Responders.dispatch('on' + event, this, transport, json);
|
||||
} catch (e) {
|
||||
this.dispatchException(e);
|
||||
}
|
||||
|
||||
/* Avoid memory leak in MSIE: clean up the oncomplete event handler */
|
||||
if (event == 'Complete')
|
||||
this.transport.onreadystatechange = OpenLayers.Ajax.emptyFunction;
|
||||
},
|
||||
|
||||
dispatchException: function(exception) {
|
||||
(this.options.onException || OpenLayers.Ajax.emptyFunction)(this, exception);
|
||||
OpenLayers.Ajax.Responders.dispatch('onException', this, exception);
|
||||
}
|
||||
});
|
||||
|
||||
OpenLayers.Ajax.getElementsByTagNameNS = function(parentnode, nsuri, nsprefix, tagname) {
|
||||
return parentnode.getElementsByTagNameNS ?
|
||||
parentnode.getElementsByTagNameNS(nsuri, tagname)
|
||||
: parentnode.getElementsByTagName(nsprefix + ':' + tagname);
|
||||
}
|
||||
|
||||
@@ -1,21 +1,51 @@
|
||||
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
|
||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
|
||||
* text of the license. */
|
||||
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
|
||||
* for the full text of the license. */
|
||||
|
||||
|
||||
/* OpenLayers.Class metaclass */
|
||||
OpenLayers.Class = {
|
||||
isPrototype: function () {}, // magic anonymous value
|
||||
|
||||
create: function() {
|
||||
return function() {
|
||||
if (arguments && arguments[0] != OpenLayers.Class.isPrototype)
|
||||
this.initialize.apply(this, arguments);
|
||||
}
|
||||
},
|
||||
|
||||
inherit: function () {
|
||||
var superClass = arguments[0];
|
||||
var proto = new superClass(OpenLayers.Class.isPrototype);
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
if (typeof arguments[i] == "function") {
|
||||
var mixin = arguments[i];
|
||||
arguments[i] = new mixin(OpenLayers.Class.isPrototype);
|
||||
}
|
||||
OpenLayers.Util.extend(proto, arguments[i]);
|
||||
}
|
||||
return proto;
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
OpenLayers.Class.inherit( OpenLayers.Layer.Grid, OpenLayers.Layer.HTTPRequest, {
|
||||
some stuff
|
||||
});
|
||||
*/
|
||||
|
||||
/*********************
|
||||
* *
|
||||
* PIXEL *
|
||||
* *
|
||||
*********************/
|
||||
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* This class represents a screen coordinate, in x and y coordinates
|
||||
*/
|
||||
OpenLayers.Pixel = Class.create();
|
||||
OpenLayers.Pixel = OpenLayers.Class.create();
|
||||
OpenLayers.Pixel.prototype = {
|
||||
|
||||
/** @type float */
|
||||
@@ -31,8 +61,8 @@ OpenLayers.Pixel.prototype = {
|
||||
* @param {float} y
|
||||
*/
|
||||
initialize: function(x, y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.x = parseFloat(x);
|
||||
this.y = parseFloat(y);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -86,7 +116,11 @@ OpenLayers.Pixel.prototype = {
|
||||
* @type OpenLayers.Pixel
|
||||
*/
|
||||
offset:function(px) {
|
||||
return this.add(px.x, px.y);
|
||||
var newPx = this.clone();
|
||||
if (px) {
|
||||
newPx = this.add(px.x, px.y);
|
||||
}
|
||||
return newPx;
|
||||
},
|
||||
|
||||
/** @final @type str */
|
||||
@@ -106,7 +140,7 @@ OpenLayers.Pixel.prototype = {
|
||||
*
|
||||
* This class represents a width and height pair
|
||||
*/
|
||||
OpenLayers.Size = Class.create();
|
||||
OpenLayers.Size = OpenLayers.Class.create();
|
||||
OpenLayers.Size.prototype = {
|
||||
|
||||
/** @type float */
|
||||
@@ -123,8 +157,8 @@ OpenLayers.Size.prototype = {
|
||||
* @param {float} h
|
||||
*/
|
||||
initialize: function(w, h) {
|
||||
this.w = w;
|
||||
this.h = h;
|
||||
this.w = parseFloat(w);
|
||||
this.h = parseFloat(h);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -177,7 +211,7 @@ OpenLayers.Size.prototype = {
|
||||
*
|
||||
* This class represents a longitude and latitude pair
|
||||
*/
|
||||
OpenLayers.LonLat = Class.create();
|
||||
OpenLayers.LonLat = OpenLayers.Class.create();
|
||||
OpenLayers.LonLat.prototype = {
|
||||
|
||||
/** @type float */
|
||||
@@ -193,8 +227,8 @@ OpenLayers.LonLat.prototype = {
|
||||
* @param {float} lat
|
||||
*/
|
||||
initialize: function(lon, lat) {
|
||||
this.lon = lon;
|
||||
this.lat = lat;
|
||||
this.lon = parseFloat(lon);
|
||||
this.lat = parseFloat(lat);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -290,7 +324,7 @@ OpenLayers.LonLat.fromString = function(str) {
|
||||
* This class represents a bounding box.
|
||||
* Data stored as left, bottom, right, top floats
|
||||
*/
|
||||
OpenLayers.Bounds = Class.create();
|
||||
OpenLayers.Bounds = OpenLayers.Class.create();
|
||||
OpenLayers.Bounds.prototype = {
|
||||
|
||||
/** @type float */
|
||||
@@ -315,10 +349,10 @@ OpenLayers.Bounds.prototype = {
|
||||
*
|
||||
*/
|
||||
initialize: function(left, bottom, right, top) {
|
||||
this.left = left;
|
||||
this.bottom = bottom;
|
||||
this.right = right;
|
||||
this.top = top;
|
||||
this.left = parseFloat(left);
|
||||
this.bottom = parseFloat(bottom);
|
||||
this.right = parseFloat(right);
|
||||
this.top = parseFloat(top);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -360,13 +394,24 @@ OpenLayers.Bounds.prototype = {
|
||||
},
|
||||
|
||||
/**
|
||||
* @return Simple String representation of OpenLayers.Bounds object.
|
||||
* (ex. <i>"5,42,10,45"</i>)
|
||||
* @type String
|
||||
*/
|
||||
toBBOX:function() {
|
||||
return (this.left + "," + this.bottom + ","
|
||||
+ this.right + "," + this.top);
|
||||
* @param {int} decimal How many significant digits in the bbox coords?
|
||||
* Default is 6
|
||||
*
|
||||
* @returns Simple String representation of OpenLayers.Bounds object.
|
||||
* (ex. <i>"5,42,10,45"</i>)
|
||||
* @type String
|
||||
*/
|
||||
toBBOX:function(decimal) {
|
||||
if (decimal== null) {
|
||||
decimal = 6;
|
||||
}
|
||||
var mult = Math.pow(10, decimal);
|
||||
var bbox = Math.round(this.left * mult) / mult + "," +
|
||||
Math.round(this.bottom * mult) / mult + "," +
|
||||
Math.round(this.right * mult) / mult + "," +
|
||||
Math.round(this.top * mult) / mult;
|
||||
|
||||
return bbox;
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -420,10 +465,34 @@ OpenLayers.Bounds.prototype = {
|
||||
* @type OpenLayers.Bounds
|
||||
*/
|
||||
add:function(x, y){
|
||||
return new OpenLayers.Box(this.left + x, this.bottom + y,
|
||||
this.right + x, this.top + y);
|
||||
return new OpenLayers.Bounds(this.left + x, this.bottom + y,
|
||||
this.right + x, this.top + y);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.LonLat} ll
|
||||
* @param {Boolean} inclusive Whether or not to include the border.
|
||||
* Default is true
|
||||
*
|
||||
* @return Whether or not the passed-in lonlat is within this bounds
|
||||
* @type Boolean
|
||||
*/
|
||||
containsLonLat:function(ll, inclusive) {
|
||||
return this.contains(ll.lon, ll.lat, inclusive);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Pixel} px
|
||||
* @param {Boolean} inclusive Whether or not to include the border.
|
||||
* Default is true
|
||||
*
|
||||
* @return Whether or not the passed-in pixel is within this bounds
|
||||
* @type Boolean
|
||||
*/
|
||||
containsPixel:function(px, inclusive) {
|
||||
return this.contains(px.x, px.y, inclusive);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {float} x
|
||||
* @param {float} y
|
||||
@@ -450,7 +519,40 @@ OpenLayers.Bounds.prototype = {
|
||||
}
|
||||
return contains;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Bounds} bounds
|
||||
* @param {Boolean} inclusive Whether or not to include the border.
|
||||
* Default is true
|
||||
*
|
||||
* @return Whether or not the passed-in OpenLayers.Bounds object intersects
|
||||
* this bounds. Simple math just check if either contains the other,
|
||||
* allowing for partial.
|
||||
* @type Boolean
|
||||
*/
|
||||
intersectsBounds:function(bounds, inclusive) {
|
||||
|
||||
if (inclusive == null) {
|
||||
inclusive = true;
|
||||
}
|
||||
var inBottom = (bounds.bottom == this.bottom && bounds.top == this.top) ?
|
||||
true : (((bounds.bottom > this.bottom) && (bounds.bottom < this.top)) ||
|
||||
((this.bottom > bounds.bottom) && (this.bottom < bounds.top)));
|
||||
var inTop = (bounds.bottom == this.bottom && bounds.top == this.top) ?
|
||||
true : (((bounds.top > this.bottom) && (bounds.top < this.top)) ||
|
||||
((this.top > bounds.bottom) && (this.top < bounds.top)));
|
||||
var inRight = (bounds.right == this.right && bounds.left == this.left) ?
|
||||
true : (((bounds.right > this.left) && (bounds.right < this.right)) ||
|
||||
((this.right > bounds.left) && (this.right < bounds.right)));
|
||||
var inLeft = (bounds.right == this.right && bounds.left == this.left) ?
|
||||
true : (((bounds.left > this.left) && (bounds.left < this.right)) ||
|
||||
((this.left > bounds.left) && (this.left < bounds.right)));
|
||||
|
||||
return (this.containsBounds(bounds, true, inclusive) ||
|
||||
bounds.containsBounds(this, true, inclusive) ||
|
||||
((inTop || inBottom ) && (inLeft || inRight )));
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Bounds} bounds
|
||||
* @param {Boolean} partial If true, only part of passed-in
|
||||
@@ -491,7 +593,7 @@ OpenLayers.Bounds.prototype = {
|
||||
inBottom = (bounds.bottom > this.bottom) && (bounds.bottom < this.top);
|
||||
}
|
||||
|
||||
return (partial) ? (inTop || inBottom) && (inLeft || inRight )
|
||||
return (partial) ? (inTop || inBottom ) && (inLeft || inRight )
|
||||
: (inTop && inLeft && inBottom && inRight);
|
||||
},
|
||||
|
||||
@@ -584,7 +686,88 @@ OpenLayers.Bounds.oppositeQuadrant = function(quadrant) {
|
||||
};
|
||||
|
||||
|
||||
/*********************
|
||||
* *
|
||||
* ELEMENT *
|
||||
* *
|
||||
*********************/
|
||||
|
||||
OpenLayers.Element = {
|
||||
visible: function(element) {
|
||||
return $(element).style.display != 'none';
|
||||
},
|
||||
|
||||
toggle: function() {
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
var element = $(arguments[i]);
|
||||
OpenLayers.Element[OpenLayers.Element.visible(element) ? 'hide' : 'show'](element);
|
||||
}
|
||||
},
|
||||
|
||||
hide: function() {
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
var element = $(arguments[i]);
|
||||
element.style.display = 'none';
|
||||
}
|
||||
},
|
||||
|
||||
show: function() {
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
var element = $(arguments[i]);
|
||||
element.style.display = '';
|
||||
}
|
||||
},
|
||||
|
||||
remove: function(element) {
|
||||
element = $(element);
|
||||
element.parentNode.removeChild(element);
|
||||
},
|
||||
|
||||
getHeight: function(element) {
|
||||
element = $(element);
|
||||
return element.offsetHeight;
|
||||
},
|
||||
|
||||
getDimensions: function(element) {
|
||||
element = $(element);
|
||||
if (OpenLayers.Element.getStyle(element, 'display') != 'none')
|
||||
return {width: element.offsetWidth, height: element.offsetHeight};
|
||||
|
||||
// All *Width and *Height properties give 0 on elements with display none,
|
||||
// so enable the element temporarily
|
||||
var els = element.style;
|
||||
var originalVisibility = els.visibility;
|
||||
var originalPosition = els.position;
|
||||
els.visibility = 'hidden';
|
||||
els.position = 'absolute';
|
||||
els.display = '';
|
||||
var originalWidth = element.clientWidth;
|
||||
var originalHeight = element.clientHeight;
|
||||
els.display = 'none';
|
||||
els.position = originalPosition;
|
||||
els.visibility = originalVisibility;
|
||||
return {width: originalWidth, height: originalHeight};
|
||||
},
|
||||
|
||||
getStyle: function(element, style) {
|
||||
element = $(element);
|
||||
var value = element.style[style.camelize()];
|
||||
if (!value) {
|
||||
if (document.defaultView && document.defaultView.getComputedStyle) {
|
||||
var css = document.defaultView.getComputedStyle(element, null);
|
||||
value = css ? css.getPropertyValue(style) : null;
|
||||
} else if (element.currentStyle) {
|
||||
value = element.currentStyle[style.camelize()];
|
||||
}
|
||||
}
|
||||
|
||||
if (window.opera && OpenLayers.Util.indexOf(['left', 'top', 'right', 'bottom'],style) != -1)
|
||||
if (OpenLayers.Element.getStyle(element, 'position') == 'static') value = 'auto';
|
||||
|
||||
return value == 'auto' ? null : value;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/*********************
|
||||
* *
|
||||
@@ -592,8 +775,6 @@ OpenLayers.Bounds.oppositeQuadrant = function(quadrant) {
|
||||
* *
|
||||
*********************/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @param {String} sStart
|
||||
*
|
||||
@@ -635,50 +816,26 @@ String.prototype.trim = function() {
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/*********************
|
||||
* *
|
||||
* ARRAY *
|
||||
* *
|
||||
*********************/
|
||||
|
||||
|
||||
|
||||
/** Remove an object from an array. Iterates through the array
|
||||
* to find the item, then removes it.
|
||||
*
|
||||
* @param {Object} item
|
||||
*
|
||||
* @returns A reference to the array
|
||||
* @type Array
|
||||
*/
|
||||
Array.prototype.remove = function(item) {
|
||||
for(var i=0; i < this.length; i++) {
|
||||
if(this[i] == item) {
|
||||
this.splice(i,1);
|
||||
//break;more than once??
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns A fresh copy of the array
|
||||
* @type Array
|
||||
*/
|
||||
Array.prototype.clone = function() {
|
||||
var clone = new Array();
|
||||
for (var i = 0; i < this.length; i++) {
|
||||
clone[i] = this[i];
|
||||
}
|
||||
return clone;
|
||||
String.indexOf = function(object) {
|
||||
for (var i = 0; i < this.length; i++)
|
||||
if (this[i] == object) return i;
|
||||
return -1;
|
||||
};
|
||||
|
||||
/**
|
||||
*/
|
||||
Array.prototype.clear = function() {
|
||||
this.length = 0;
|
||||
String.prototype.camelize = function() {
|
||||
var oStringList = this.split('-');
|
||||
if (oStringList.length == 1) return oStringList[0];
|
||||
|
||||
var camelizedString = this.indexOf('-') == 0
|
||||
? oStringList[0].charAt(0).toUpperCase() + oStringList[0].substring(1)
|
||||
: oStringList[0];
|
||||
|
||||
for (var i = 1, len = oStringList.length; i < len; i++) {
|
||||
var s = oStringList[i];
|
||||
camelizedString += s.charAt(0).toUpperCase() + s.substring(1);
|
||||
}
|
||||
|
||||
return camelizedString;
|
||||
};
|
||||
|
||||
|
||||
@@ -688,8 +845,6 @@ Array.prototype.clear = function() {
|
||||
* *
|
||||
*********************/
|
||||
|
||||
|
||||
|
||||
/** NOTE: Works only with integer values does *not* work with floats!
|
||||
*
|
||||
* @param {int} sig
|
||||
@@ -706,3 +861,28 @@ Number.prototype.limitSigDigs = function(sig) {
|
||||
}
|
||||
return parseInt(number);
|
||||
}
|
||||
|
||||
|
||||
/*********************
|
||||
* *
|
||||
* FUNCTION *
|
||||
* *
|
||||
*********************/
|
||||
|
||||
Function.prototype.bind = function() {
|
||||
var __method = this, args = [], object = arguments[0];
|
||||
for (var i = 1; i < arguments.length; i++)
|
||||
args.push(arguments[i]);
|
||||
return function(moreargs) {
|
||||
for (var i = 0; i < arguments.length; i++)
|
||||
args.push(arguments[i]);
|
||||
return __method.apply(object, args);
|
||||
}
|
||||
};
|
||||
|
||||
Function.prototype.bindAsEventListener = function(object) {
|
||||
var __method = this;
|
||||
return function(event) {
|
||||
return __method.call(object, event || window.event);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
|
||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
|
||||
* text of the license. */
|
||||
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
|
||||
* for the full text of the license. */
|
||||
|
||||
|
||||
/**
|
||||
* @class
|
||||
*/
|
||||
OpenLayers.Control = Class.create();
|
||||
OpenLayers.Control = OpenLayers.Class.create();
|
||||
OpenLayers.Control.prototype = {
|
||||
|
||||
/** @type String */
|
||||
id: null,
|
||||
|
||||
/** this gets set in the addControl() function in OpenLayers.Map
|
||||
* @type OpenLayers.Map */
|
||||
map: null,
|
||||
@@ -27,7 +31,9 @@ OpenLayers.Control.prototype = {
|
||||
* @param {Object} options
|
||||
*/
|
||||
initialize: function (options) {
|
||||
Object.extend(this, options);
|
||||
OpenLayers.Util.extend(this, options);
|
||||
|
||||
this.id = OpenLayers.Util.createUniqueID(this.CLASS_NAME + "_");
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -57,6 +63,8 @@ OpenLayers.Control.prototype = {
|
||||
draw: function (px) {
|
||||
if (this.div == null) {
|
||||
this.div = OpenLayers.Util.createDiv();
|
||||
this.div.id = this.id;
|
||||
this.div.className = 'olControl';
|
||||
}
|
||||
if (px != null) {
|
||||
this.position = px.clone();
|
||||
|
||||
114
lib/OpenLayers/Control/ArgParser.js
Normal file
@@ -0,0 +1,114 @@
|
||||
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
|
||||
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
|
||||
* for the full text of the license. */
|
||||
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* @requires OpenLayers/Control.js
|
||||
*/
|
||||
OpenLayers.Control.ArgParser = OpenLayers.Class.create();
|
||||
OpenLayers.Control.ArgParser.prototype =
|
||||
OpenLayers.Class.inherit( OpenLayers.Control, {
|
||||
|
||||
/** @type OpenLayers.LonLat */
|
||||
center: null,
|
||||
|
||||
/** @type int */
|
||||
zoom: null,
|
||||
|
||||
/** @type Array */
|
||||
layers: null,
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*
|
||||
* @param {DOMElement} element
|
||||
* @param {String} base
|
||||
*/
|
||||
initialize: function(element, base) {
|
||||
OpenLayers.Control.prototype.initialize.apply(this, arguments);
|
||||
},
|
||||
|
||||
/** Set the map property for the control.
|
||||
*
|
||||
* @param {OpenLayers.Map} map
|
||||
*/
|
||||
setMap: function(map) {
|
||||
OpenLayers.Control.prototype.setMap.apply(this, arguments);
|
||||
|
||||
//make sure we dont already have an arg parser attached
|
||||
for(var i=0; i< this.map.controls.length; i++) {
|
||||
var control = this.map.controls[i];
|
||||
if ( (control != this) &&
|
||||
(control.CLASS_NAME == "OpenLayers.Control.ArgParser") ) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i == this.map.controls.length) {
|
||||
|
||||
var args = OpenLayers.Util.getArgs();
|
||||
if (args.lat && args.lon) {
|
||||
this.center = new OpenLayers.LonLat(parseFloat(args.lon),
|
||||
parseFloat(args.lat));
|
||||
if (args.zoom) {
|
||||
this.zoom = parseInt(args.zoom);
|
||||
}
|
||||
|
||||
// when we add a new baselayer to see when we can set the center
|
||||
this.map.events.register('changebaselayer', this,
|
||||
this.setCenter);
|
||||
this.setCenter();
|
||||
}
|
||||
|
||||
if (args.layers) {
|
||||
this.layers = args.layers;
|
||||
|
||||
// when we add a new layer, set its visibility
|
||||
this.map.events.register('addlayer', this,
|
||||
this.configureLayers);
|
||||
this.configureLayers();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/** As soon as a baseLayer has been loaded, we center and zoom
|
||||
* ...and remove the handler.
|
||||
*/
|
||||
setCenter: function() {
|
||||
|
||||
if (this.map.baseLayer) {
|
||||
//dont need to listen for this one anymore
|
||||
this.map.events.unregister('changebaselayer', this,
|
||||
this.setCenter);
|
||||
|
||||
this.map.setCenter(this.center, this.zoom);
|
||||
}
|
||||
},
|
||||
|
||||
/** As soon as all the layers are loaded, cycle through them and
|
||||
* hide or show them.
|
||||
*/
|
||||
configureLayers: function() {
|
||||
|
||||
if (this.layers.length == this.map.layers.length) {
|
||||
this.map.events.unregister('addlayer', this, this.configureLayers);
|
||||
|
||||
for(var i=0; i < this.layers.length; i++) {
|
||||
|
||||
var layer = this.map.layers[i];
|
||||
var c = this.layers.charAt(i);
|
||||
|
||||
if (c == "B") {
|
||||
this.map.setBaseLayer(layer);
|
||||
} else if ( (c == "T") || (c == "F") ) {
|
||||
layer.setVisibility(c == "T");
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/** @final @type String */
|
||||
CLASS_NAME: "OpenLayers.Control.ArgParser"
|
||||
});
|
||||
@@ -1,15 +1,16 @@
|
||||
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
|
||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
|
||||
* text of the license. */
|
||||
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
|
||||
* for the full text of the license. */
|
||||
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* @requires OpenLayers/Control.js
|
||||
*/
|
||||
OpenLayers.Control.KeyboardDefaults = Class.create();
|
||||
OpenLayers.Control.KeyboardDefaults = OpenLayers.Class.create();
|
||||
OpenLayers.Control.KeyboardDefaults.prototype =
|
||||
Object.extend( new OpenLayers.Control(), {
|
||||
OpenLayers.Class.inherit( OpenLayers.Control, {
|
||||
|
||||
/** @type int */
|
||||
slideFactor: 50,
|
||||
@@ -25,7 +26,7 @@ OpenLayers.Control.KeyboardDefaults.prototype =
|
||||
*
|
||||
*/
|
||||
draw: function() {
|
||||
Event.observe(document,
|
||||
OpenLayers.Event.observe(document,
|
||||
'keypress',
|
||||
this.defaultKeyDown.bind(this));
|
||||
},
|
||||
@@ -35,16 +36,16 @@ OpenLayers.Control.KeyboardDefaults.prototype =
|
||||
*/
|
||||
defaultKeyDown: function (evt) {
|
||||
switch(evt.keyCode) {
|
||||
case Event.KEY_LEFT:
|
||||
case OpenLayers.Event.KEY_LEFT:
|
||||
this.map.pan(-50, 0);
|
||||
break;
|
||||
case Event.KEY_RIGHT:
|
||||
case OpenLayers.Event.KEY_RIGHT:
|
||||
this.map.pan(50, 0);
|
||||
break;
|
||||
case Event.KEY_UP:
|
||||
case OpenLayers.Event.KEY_UP:
|
||||
this.map.pan(0, -50);
|
||||
break;
|
||||
case Event.KEY_DOWN:
|
||||
case OpenLayers.Event.KEY_DOWN:
|
||||
this.map.pan(0, 50);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
|
||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
|
||||
* text of the license. */
|
||||
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
|
||||
* for the full text of the license. */
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* @requires OpenLayers/Control.js
|
||||
*/
|
||||
OpenLayers.Control.LayerSwitcher = Class.create();
|
||||
OpenLayers.Control.LayerSwitcher = OpenLayers.Class.create();
|
||||
OpenLayers.Control.LayerSwitcher.prototype =
|
||||
Object.extend( new OpenLayers.Control(), {
|
||||
OpenLayers.Class.inherit( OpenLayers.Control, {
|
||||
|
||||
/** @type String */
|
||||
activeColor: "darkblue",
|
||||
@@ -43,6 +43,9 @@ OpenLayers.Control.LayerSwitcher.prototype =
|
||||
/** @type DOMElement */
|
||||
maximizeDiv: null,
|
||||
|
||||
/** @type Boolean */
|
||||
ascending: true,
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
@@ -99,51 +102,64 @@ OpenLayers.Control.LayerSwitcher.prototype =
|
||||
|
||||
var containsOverlays = false;
|
||||
|
||||
for( var i = 0; i < this.map.layers.length; i++) {
|
||||
var layer = this.map.layers[i];
|
||||
var layers = this.map.layers.slice();
|
||||
if (!this.ascending) { layers.reverse(); }
|
||||
for( var i = 0; i < layers.length; i++) {
|
||||
var layer = layers[i];
|
||||
var baseLayer = layer.isBaseLayer;
|
||||
|
||||
if (!baseLayer) {
|
||||
containsOverlays = true;
|
||||
if (baseLayer || layer.displayInLayerSwitcher) {
|
||||
|
||||
if (!baseLayer) {
|
||||
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 = "input_" + layer.name;
|
||||
inputElem.name = (baseLayer) ? "baseLayers" : layer.name;
|
||||
inputElem.type = (baseLayer) ? "radio" : "checkbox";
|
||||
inputElem.value = layer.name;
|
||||
inputElem.checked = checked;
|
||||
inputElem.defaultChecked = checked;
|
||||
inputElem.layer = layer;
|
||||
inputElem.control = this;
|
||||
|
||||
if (!baseLayer && !layer.inRange) {
|
||||
inputElem.disabled = true;
|
||||
}
|
||||
OpenLayers.Event.observe(inputElem, "mouseup",
|
||||
this.onInputClick.bindAsEventListener(inputElem));
|
||||
|
||||
// create span
|
||||
var labelSpan = document.createElement("span");
|
||||
if (!baseLayer && !layer.inRange) {
|
||||
labelSpan.style.color = "gray";
|
||||
}
|
||||
labelSpan.innerHTML = layer.name;
|
||||
labelSpan.style.verticalAlign = (baseLayer) ? "bottom" : "baseline";
|
||||
OpenLayers.Event.observe(labelSpan, "click",
|
||||
this.onInputClick.bindAsEventListener(inputElem));
|
||||
// create line break
|
||||
var br = document.createElement("br");
|
||||
|
||||
|
||||
var groupArray = (baseLayer) ? this.baseLayerInputs
|
||||
: this.dataLayerInputs;
|
||||
groupArray.push(inputElem);
|
||||
|
||||
|
||||
var groupDiv = (baseLayer) ? this.baseLayersDiv
|
||||
: this.dataLayersDiv;
|
||||
groupDiv.appendChild(inputElem);
|
||||
groupDiv.appendChild(labelSpan);
|
||||
groupDiv.appendChild(br);
|
||||
}
|
||||
|
||||
// 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 = "input_" + layer.name;
|
||||
inputElem.name = (baseLayer) ? "baseLayers" : layer.name;
|
||||
inputElem.type = (baseLayer) ? "radio" : "checkbox";
|
||||
inputElem.value = layer.name;
|
||||
inputElem.checked = checked;
|
||||
inputElem.layer = layer;
|
||||
|
||||
// create span
|
||||
var labelSpan = document.createElement("span");
|
||||
labelSpan.innerHTML = layer.name;
|
||||
labelSpan.style.verticalAlign = (baseLayer) ? "bottom" : "auto";
|
||||
Event.observe(labelSpan,
|
||||
"click",
|
||||
this.onLabelClick.bindAsEventListener(inputElem));
|
||||
|
||||
// create line break
|
||||
var br = document.createElement("br");
|
||||
|
||||
|
||||
var groupArray = (baseLayer) ? this.baseLayerInputs
|
||||
: this.dataLayerInputs;
|
||||
groupArray.push(inputElem);
|
||||
|
||||
|
||||
var groupDiv = (baseLayer) ? this.baseLayersDiv
|
||||
: this.dataLayersDiv;
|
||||
groupDiv.appendChild(inputElem);
|
||||
groupDiv.appendChild(labelSpan);
|
||||
groupDiv.appendChild(br);
|
||||
|
||||
}
|
||||
|
||||
// if no overlays, dont display the overlay label
|
||||
@@ -158,11 +174,19 @@ OpenLayers.Control.LayerSwitcher.prototype =
|
||||
*
|
||||
* @param {Event} e
|
||||
*/
|
||||
onLabelClick: function(e) {
|
||||
var clickedRadioButton = ((this.type == "radio") && (this.checked));
|
||||
if (!clickedRadioButton) {
|
||||
this.checked = !this.checked;
|
||||
|
||||
onInputClick: function(e) {
|
||||
if (!this.disabled) {
|
||||
if (this.type == "radio") {
|
||||
this.checked = true;
|
||||
this.layer.map.setBaseLayer(this.layer, true);
|
||||
this.layer.map.events.triggerEvent("changebaselayer");
|
||||
} else {
|
||||
this.checked = !this.checked;
|
||||
this.control.updateMap();
|
||||
}
|
||||
}
|
||||
OpenLayers.Event.stop(e);
|
||||
},
|
||||
|
||||
/** Need to update the map accordingly whenever user clicks in either of
|
||||
@@ -189,7 +213,7 @@ OpenLayers.Control.LayerSwitcher.prototype =
|
||||
for(var i=0; i < this.baseLayerInputs.length; i++) {
|
||||
var input = this.baseLayerInputs[i];
|
||||
if (input.checked) {
|
||||
this.map.setBaseLayer(input.layer, true);
|
||||
this.map.setBaseLayer(input.layer, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -214,7 +238,7 @@ OpenLayers.Control.LayerSwitcher.prototype =
|
||||
this.showControls(false);
|
||||
|
||||
if (e != null) {
|
||||
Event.stop(e);
|
||||
OpenLayers.Event.stop(e);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -231,7 +255,7 @@ OpenLayers.Control.LayerSwitcher.prototype =
|
||||
this.showControls(true);
|
||||
|
||||
if (e != null) {
|
||||
Event.stop(e);
|
||||
OpenLayers.Event.stop(e);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -269,11 +293,13 @@ OpenLayers.Control.LayerSwitcher.prototype =
|
||||
this.div.style.color = "white";
|
||||
this.div.style.backgroundColor = "transparent";
|
||||
|
||||
Event.observe(this.div, "mouseup",
|
||||
OpenLayers.Event.observe(this.div, "mouseup",
|
||||
this.mouseUp.bindAsEventListener(this));
|
||||
Event.observe(this.div, "mousedown",
|
||||
OpenLayers.Event.observe(this.div, "click",
|
||||
this.ignoreEvent);
|
||||
OpenLayers.Event.observe(this.div, "mousedown",
|
||||
this.mouseDown.bindAsEventListener(this));
|
||||
Event.observe(this.div, "dblclick", this.ignoreEvent);
|
||||
OpenLayers.Event.observe(this.div, "dblclick", this.ignoreEvent);
|
||||
|
||||
|
||||
// layers list div
|
||||
@@ -297,13 +323,12 @@ OpenLayers.Control.LayerSwitcher.prototype =
|
||||
baseLbl.style.marginTop = "3px";
|
||||
baseLbl.style.marginLeft = "3px";
|
||||
baseLbl.style.marginBottom = "3px";
|
||||
this.layersDiv.appendChild(baseLbl);
|
||||
|
||||
this.baseLayersDiv = document.createElement("div");
|
||||
this.baseLayersDiv.style.paddingLeft = "10px";
|
||||
Event.observe(this.baseLayersDiv, "click",
|
||||
/*OpenLayers.Event.observe(this.baseLayersDiv, "click",
|
||||
this.onLayerClick.bindAsEventListener(this));
|
||||
this.layersDiv.appendChild(this.baseLayersDiv);
|
||||
*/
|
||||
|
||||
|
||||
this.dataLbl = document.createElement("div");
|
||||
@@ -311,22 +336,30 @@ OpenLayers.Control.LayerSwitcher.prototype =
|
||||
this.dataLbl.style.marginTop = "3px";
|
||||
this.dataLbl.style.marginLeft = "3px";
|
||||
this.dataLbl.style.marginBottom = "3px";
|
||||
this.layersDiv.appendChild(this.dataLbl);
|
||||
|
||||
this.dataLayersDiv = document.createElement("div");
|
||||
this.dataLayersDiv.style.paddingLeft = "10px";
|
||||
Event.observe(this.dataLayersDiv, "click",
|
||||
this.onLayerClick.bindAsEventListener(this));
|
||||
this.layersDiv.appendChild(this.dataLayersDiv);
|
||||
|
||||
if (this.ascending) {
|
||||
this.layersDiv.appendChild(baseLbl);
|
||||
this.layersDiv.appendChild(this.baseLayersDiv);
|
||||
this.layersDiv.appendChild(this.dataLbl);
|
||||
this.layersDiv.appendChild(this.dataLayersDiv);
|
||||
} else {
|
||||
this.layersDiv.appendChild(this.dataLbl);
|
||||
this.layersDiv.appendChild(this.dataLayersDiv);
|
||||
this.layersDiv.appendChild(baseLbl);
|
||||
this.layersDiv.appendChild(this.baseLayersDiv);
|
||||
}
|
||||
|
||||
this.div.appendChild(this.layersDiv);
|
||||
|
||||
Rico.Corner.round(this.div, {corners: "tl bl",
|
||||
bgColor: "transparent",
|
||||
color: this.activeColor,
|
||||
blend: false});
|
||||
OpenLayers.Rico.Corner.round(this.div, {corners: "tl bl",
|
||||
bgColor: "transparent",
|
||||
color: this.activeColor,
|
||||
blend: false});
|
||||
|
||||
Rico.Corner.changeOpacity(this.layersDiv, 0.75);
|
||||
OpenLayers.Rico.Corner.changeOpacity(this.layersDiv, 0.75);
|
||||
|
||||
var imgLocation = OpenLayers.Util.getImagesLocation();
|
||||
var sz = new OpenLayers.Size(18,18);
|
||||
@@ -343,7 +376,7 @@ OpenLayers.Control.LayerSwitcher.prototype =
|
||||
this.maximizeDiv.style.right = "0px";
|
||||
this.maximizeDiv.style.left = "";
|
||||
this.maximizeDiv.style.display = "none";
|
||||
Event.observe(this.maximizeDiv,
|
||||
OpenLayers.Event.observe(this.maximizeDiv,
|
||||
"click",
|
||||
this.maximizeControl.bindAsEventListener(this));
|
||||
|
||||
@@ -362,7 +395,7 @@ OpenLayers.Control.LayerSwitcher.prototype =
|
||||
this.minimizeDiv.style.right = "0px";
|
||||
this.minimizeDiv.style.left = "";
|
||||
this.minimizeDiv.style.display = "none";
|
||||
Event.observe(this.minimizeDiv,
|
||||
OpenLayers.Event.observe(this.minimizeDiv,
|
||||
"click",
|
||||
this.minimizeControl.bindAsEventListener(this));
|
||||
|
||||
@@ -375,7 +408,7 @@ OpenLayers.Control.LayerSwitcher.prototype =
|
||||
* @param {Event} evt
|
||||
*/
|
||||
ignoreEvent: function(evt) {
|
||||
Event.stop(evt);
|
||||
OpenLayers.Event.stop(evt);
|
||||
},
|
||||
|
||||
/** Register a local 'mouseDown' flag so that we'll know whether or not
|
||||
|
||||
@@ -1,226 +0,0 @@
|
||||
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
|
||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
|
||||
* text of the license. */
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* @requires OpenLayers/Control.js
|
||||
*/
|
||||
OpenLayers.Control.LayerTabs = Class.create();
|
||||
|
||||
/** color used in the UI to show a layer is active/displayed
|
||||
*
|
||||
* @final
|
||||
* @type String
|
||||
*/
|
||||
OpenLayers.Control.LayerTabs.ACTIVE_COLOR = "darkblue";
|
||||
|
||||
/** color used in the UI to show a layer is deactivated/hidden
|
||||
*
|
||||
* @final
|
||||
* @type String
|
||||
*/
|
||||
OpenLayers.Control.LayerTabs.NONACTIVE_COLOR = "lightblue";
|
||||
|
||||
|
||||
OpenLayers.Control.LayerTabs.prototype =
|
||||
Object.extend( new OpenLayers.Control(), {
|
||||
|
||||
/** @type String */
|
||||
activeColor: "",
|
||||
|
||||
/** @type String */
|
||||
nonActiveColor: "",
|
||||
|
||||
/** @type String */
|
||||
mode: "checkbox",
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
initialize: function(options) {
|
||||
this.activeColor = OpenLayers.Control.LayerTabs.ACTIVE_COLOR;
|
||||
this.nonActiveColor = OpenLayers.Control.LayerTabs.NONACTIVE_COLOR;
|
||||
this.backdrops = [];
|
||||
OpenLayers.Control.prototype.initialize.apply(this, arguments);
|
||||
},
|
||||
|
||||
/**
|
||||
* @returns A reference to the DIV DOMElement containing the switcher tabs
|
||||
* @type DOMElement
|
||||
*/
|
||||
draw: function() {
|
||||
// initialize our internal div
|
||||
OpenLayers.Control.prototype.draw.apply(this);
|
||||
|
||||
this.div.style.position = "absolute";
|
||||
this.div.style.top = "10px";
|
||||
this.div.style.right = "0px";
|
||||
this.div.style.left = "";
|
||||
this.div.style.fontFamily = "sans-serif";
|
||||
this.div.style.color = "white";
|
||||
this.div.style.fontWeight = "bold";
|
||||
this.div.style.marginTop = "3px";
|
||||
this.div.style.marginLeft = "3px";
|
||||
this.div.style.marginBottom = "3px";
|
||||
this.div.style.fontSize="smaller";
|
||||
this.div.style.width = "10em";
|
||||
|
||||
this.map.events.register("addlayer", this, this.redraw);
|
||||
this.map.events.register("removelayer", this, this.redraw);
|
||||
return this.redraw();
|
||||
},
|
||||
|
||||
/**
|
||||
* @returns A reference to the DIV DOMElement containing the switcher tabs
|
||||
* @type DOMElement
|
||||
*/
|
||||
redraw: function() {
|
||||
|
||||
//clear out previous incarnation of LayerTabs tabs
|
||||
this.div.innerHTML = "";
|
||||
var visible = false;
|
||||
for( var i = 0; i < this.map.layers.length; i++) {
|
||||
if (visible && this.mode == "radio") {
|
||||
this.map.layers[i].setVisibility(false);
|
||||
} else {
|
||||
visible = this.map.layers[i].getVisibility();
|
||||
}
|
||||
this.addTab(this.map.layers[i]);
|
||||
}
|
||||
|
||||
return this.div;
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {Event} evt
|
||||
*/
|
||||
singleClick: function(evt) {
|
||||
var div = Event.element(evt);
|
||||
|
||||
// See comment about OL #57 fix below.
|
||||
// If the click occurred on the corner spans we need
|
||||
// to make sure we act on the actual label tab instead.
|
||||
div = div.labelElement || div;
|
||||
|
||||
var layer = div.layer;
|
||||
if (this.mode == "radio") {
|
||||
for(var i=0; i < this.backdrops.length; i++) {
|
||||
this.setTabActivation(this.backdrops[i], false);
|
||||
this.backdrops[i].layer.setVisibility(false);
|
||||
}
|
||||
this.setTabActivation(div, true);
|
||||
layer.setVisibility(true);
|
||||
} else {
|
||||
var visible = layer.getVisibility();
|
||||
|
||||
this.setTabActivation(div, !visible);
|
||||
layer.setVisibility(!visible);
|
||||
}
|
||||
Event.stop(evt);
|
||||
},
|
||||
|
||||
/**
|
||||
* @private
|
||||
*
|
||||
* @param {Event} evt
|
||||
*/
|
||||
ignoreEvent: function(evt) {
|
||||
Event.stop(evt);
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
* @private
|
||||
*
|
||||
* @param {OpenLayers.Layer} layer
|
||||
*/
|
||||
addTab: function(layer) {
|
||||
|
||||
// Outer DIV - for Rico Corners
|
||||
//
|
||||
var backdropLabelOuter = document.createElement('div');
|
||||
backdropLabelOuter.id = "LayerTabs_" + layer.name + "_Tab";
|
||||
backdropLabelOuter.style.marginTop = "4px";
|
||||
backdropLabelOuter.style.marginBottom = "4px";
|
||||
|
||||
this._setEventHandlers(backdropLabelOuter);
|
||||
|
||||
// Inner Label - for Rico Corners
|
||||
//
|
||||
var backdropLabel = document.createElement('p');
|
||||
backdropLabel.innerHTML = layer.name;
|
||||
backdropLabel.style.marginTop = "0px";
|
||||
backdropLabel.style.marginBottom = "0px";
|
||||
backdropLabel.style.paddingLeft = "10px";
|
||||
backdropLabel.style.paddingRight = "10px";
|
||||
|
||||
// add reference to layer onto the div for use in event handlers
|
||||
backdropLabel.layer = layer;
|
||||
|
||||
// set event handlers
|
||||
this._setEventHandlers(backdropLabel);
|
||||
|
||||
// add label to div
|
||||
backdropLabelOuter.appendChild(backdropLabel);
|
||||
|
||||
this.backdrops.push(backdropLabel);
|
||||
|
||||
// add div to main LayerTabs Div
|
||||
this.div.appendChild(backdropLabelOuter);
|
||||
|
||||
Rico.Corner.round(backdropLabelOuter, {corners: "tl bl",
|
||||
bgColor: "transparent",
|
||||
color: "white",
|
||||
blend: false});
|
||||
|
||||
// extend the event handlers to operate on the
|
||||
// rounded corners as well. (Fixes OL #57.)
|
||||
var spanElements=backdropLabel.parentNode.getElementsByTagName("span");
|
||||
|
||||
for (var currIdx = 0; currIdx < spanElements.length; currIdx++) {
|
||||
this._setEventHandlers(spanElements[currIdx], backdropLabel);
|
||||
}
|
||||
|
||||
this.setTabActivation(backdropLabel, layer.getVisibility());
|
||||
},
|
||||
|
||||
/*
|
||||
@private
|
||||
|
||||
@param {DOMElement} div
|
||||
@param {Boolean} activate
|
||||
*/
|
||||
_setEventHandlers : function(element, labelDiv) {
|
||||
|
||||
// We only want to respond to a mousedown event.
|
||||
element.onclick = this.singleClick.bindAsEventListener(this);
|
||||
element.ondblclick = this.singleClick.bindAsEventListener(this);
|
||||
element.onmouseup = this.ignoreEvent.bindAsEventListener(this);
|
||||
element.onmousedown = this.ignoreEvent.bindAsEventListener(this);
|
||||
|
||||
// If we are operating on a corner span we need to store a
|
||||
// reference to the actual tab. (See comment about OL #57 fix above.)
|
||||
if (labelDiv) {
|
||||
element.labelElement = labelDiv;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @private
|
||||
*
|
||||
* @param {DOMElement} div
|
||||
* @param {Boolean} activate
|
||||
*/
|
||||
setTabActivation:function(div, activate) {
|
||||
var color = (activate) ? this.activeColor : this.nonActiveColor;
|
||||
Rico.Corner.changeColor(div, color);
|
||||
},
|
||||
|
||||
|
||||
|
||||
/** @final @type String */
|
||||
CLASS_NAME: "OpenLayers.Control.LayerTabs"
|
||||
});
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
|
||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
|
||||
* text of the license. */
|
||||
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
|
||||
* for the full text of the license. */
|
||||
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* @requires OpenLayers/Control.js
|
||||
*/
|
||||
OpenLayers.Control.MouseDefaults = Class.create();
|
||||
OpenLayers.Control.MouseDefaults = OpenLayers.Class.create();
|
||||
OpenLayers.Control.MouseDefaults.prototype =
|
||||
Object.extend( new OpenLayers.Control(), {
|
||||
OpenLayers.Class.inherit( OpenLayers.Control, {
|
||||
|
||||
/** @type Boolean */
|
||||
performedDrag: false,
|
||||
@@ -19,14 +20,6 @@ OpenLayers.Control.MouseDefaults.prototype =
|
||||
*/
|
||||
initialize: function() {
|
||||
OpenLayers.Control.prototype.initialize.apply(this, arguments);
|
||||
|
||||
//register mousewheel events specifically on the window and document
|
||||
Event.observe(window, "DOMMouseScroll",
|
||||
this.onWheelEvent.bindAsEventListener(this));
|
||||
Event.observe(window, "mousewheel",
|
||||
this.onWheelEvent.bindAsEventListener(this));
|
||||
Event.observe(document, "mousewheel",
|
||||
this.onWheelEvent.bindAsEventListener(this));
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -39,6 +32,24 @@ OpenLayers.Control.MouseDefaults.prototype =
|
||||
this.map.events.register( "mouseup", this, this.defaultMouseUp );
|
||||
this.map.events.register( "mousemove", this, this.defaultMouseMove );
|
||||
this.map.events.register( "mouseout", this, this.defaultMouseOut );
|
||||
|
||||
this.registerWheelEvents();
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
registerWheelEvents: function() {
|
||||
|
||||
//register mousewheel events specifically on the window and document
|
||||
OpenLayers.Event.observe(window, "DOMMouseScroll",
|
||||
this.onWheelEvent.bindAsEventListener(this));
|
||||
OpenLayers.Event.observe(window, "mousewheel",
|
||||
this.onWheelEvent.bindAsEventListener(this));
|
||||
OpenLayers.Event.observe(document, "mousewheel",
|
||||
this.onWheelEvent.bindAsEventListener(this));
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -47,7 +58,7 @@ OpenLayers.Control.MouseDefaults.prototype =
|
||||
* @type Boolean
|
||||
*/
|
||||
defaultClick: function (evt) {
|
||||
if (!Event.isLeftClick(evt)) return;
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) return;
|
||||
var notAfterDrag = !this.performedDrag;
|
||||
this.performedDrag = false;
|
||||
return notAfterDrag;
|
||||
@@ -59,14 +70,15 @@ OpenLayers.Control.MouseDefaults.prototype =
|
||||
defaultDblClick: function (evt) {
|
||||
var newCenter = this.map.getLonLatFromViewPortPx( evt.xy );
|
||||
this.map.setCenter(newCenter, this.map.zoom + 1);
|
||||
Event.stop(evt);
|
||||
OpenLayers.Event.stop(evt);
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {Event} evt
|
||||
*/
|
||||
defaultMouseDown: function (evt) {
|
||||
if (!Event.isLeftClick(evt)) return;
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) return;
|
||||
this.mouseDragStart = evt.xy.clone();
|
||||
this.performedDrag = false;
|
||||
if (evt.shiftKey) {
|
||||
@@ -80,23 +92,27 @@ OpenLayers.Control.MouseDefaults.prototype =
|
||||
this.zoomBox.style.backgroundColor = "white";
|
||||
this.zoomBox.style.filter = "alpha(opacity=50)"; // IE
|
||||
this.zoomBox.style.opacity = "0.50";
|
||||
this.zoomBox.style.fontSize = "1px";
|
||||
this.zoomBox.style.zIndex = this.map.Z_INDEX_BASE["Popup"] - 1;
|
||||
this.map.viewPortDiv.appendChild(this.zoomBox);
|
||||
}
|
||||
document.onselectstart=function() { return false; }
|
||||
Event.stop(evt);
|
||||
OpenLayers.Event.stop(evt);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {Event} evt
|
||||
*/
|
||||
defaultMouseMove: function (evt) {
|
||||
// record the mouse position, used in onWheelEvent
|
||||
this.mousePosition = evt.xy.clone();
|
||||
|
||||
if (this.mouseDragStart != null) {
|
||||
if (this.zoomBox) {
|
||||
var deltaX = Math.abs(this.mouseDragStart.x - evt.xy.x);
|
||||
var deltaY = Math.abs(this.mouseDragStart.y - evt.xy.y);
|
||||
this.zoomBox.style.width = deltaX+"px";
|
||||
this.zoomBox.style.height = deltaY+"px";
|
||||
this.zoomBox.style.width = Math.max(1, deltaX) + "px";
|
||||
this.zoomBox.style.height = Math.max(1, deltaY) + "px";
|
||||
if (evt.xy.x < this.mouseDragStart.x) {
|
||||
this.zoomBox.style.left = evt.xy.x+"px";
|
||||
}
|
||||
@@ -122,22 +138,9 @@ OpenLayers.Control.MouseDefaults.prototype =
|
||||
* @param {Event} evt
|
||||
*/
|
||||
defaultMouseUp: function (evt) {
|
||||
if (!Event.isLeftClick(evt)) return;
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) return;
|
||||
if (this.zoomBox) {
|
||||
var start = this.map.getLonLatFromViewPortPx( this.mouseDragStart );
|
||||
var end = this.map.getLonLatFromViewPortPx( evt.xy );
|
||||
var top = Math.max(start.lat, end.lat);
|
||||
var bottom = Math.min(start.lat, end.lat);
|
||||
var left = Math.min(start.lon, end.lon);
|
||||
var right = Math.max(start.lon, end.lon);
|
||||
var bounds = new OpenLayers.Bounds(left, bottom, right, top);
|
||||
var zoom = this.map.getZoomForExtent(bounds);
|
||||
this.map.setCenter(new OpenLayers.LonLat(
|
||||
(start.lon + end.lon) / 2,
|
||||
(start.lat + end.lat) / 2
|
||||
), zoom);
|
||||
this.map.viewPortDiv.removeChild(document.getElementById("zoomBox"));
|
||||
this.zoomBox = null;
|
||||
this.zoomBoxEnd(evt);
|
||||
} else {
|
||||
if (this.performedDrag) {
|
||||
this.map.setCenter(this.map.center);
|
||||
@@ -152,9 +155,12 @@ OpenLayers.Control.MouseDefaults.prototype =
|
||||
* @param {Event} evt
|
||||
*/
|
||||
defaultMouseOut: function (evt) {
|
||||
if (this.mouseDragStart != null
|
||||
&& OpenLayers.Util.mouseLeft(evt, this.map.div)) {
|
||||
this.defaultMouseUp(evt);
|
||||
if (this.mouseDragStart != null &&
|
||||
OpenLayers.Util.mouseLeft(evt, this.map.div)) {
|
||||
if (this.zoomBox) {
|
||||
this.removeZoomBox();
|
||||
}
|
||||
this.mouseDragStart = null;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -162,15 +168,55 @@ OpenLayers.Control.MouseDefaults.prototype =
|
||||
/** User spun scroll wheel up
|
||||
*
|
||||
*/
|
||||
defaultWheelUp: function() {
|
||||
this.map.zoomIn();
|
||||
defaultWheelUp: function(evt) {
|
||||
if (this.map.getZoom() <= this.map.getNumZoomLevels()) {
|
||||
this.map.setCenter(this.map.getLonLatFromPixel(evt.xy),
|
||||
this.map.getZoom() + 1);
|
||||
}
|
||||
},
|
||||
|
||||
/** User spun scroll wheel down
|
||||
*
|
||||
*/
|
||||
defaultWheelDown: function() {
|
||||
this.map.zoomOut();
|
||||
defaultWheelDown: function(evt) {
|
||||
if (this.map.getZoom() > 0) {
|
||||
this.map.setCenter(this.map.getLonLatFromPixel(evt.xy),
|
||||
this.map.getZoom() - 1);
|
||||
}
|
||||
},
|
||||
|
||||
/** Zoombox function.
|
||||
*
|
||||
*/
|
||||
zoomBoxEnd: function(evt) {
|
||||
if (this.mouseDragStart != null) {
|
||||
if (Math.abs(this.mouseDragStart.x - evt.xy.x) > 5 ||
|
||||
Math.abs(this.mouseDragStart.y - evt.xy.y) > 5) {
|
||||
var start = this.map.getLonLatFromViewPortPx( this.mouseDragStart );
|
||||
var end = this.map.getLonLatFromViewPortPx( evt.xy );
|
||||
var top = Math.max(start.lat, end.lat);
|
||||
var bottom = Math.min(start.lat, end.lat);
|
||||
var left = Math.min(start.lon, end.lon);
|
||||
var right = Math.max(start.lon, end.lon);
|
||||
var bounds = new OpenLayers.Bounds(left, bottom, right, top);
|
||||
this.map.zoomToExtent(bounds);
|
||||
} else {
|
||||
var end = this.map.getLonLatFromViewPortPx( evt.xy );
|
||||
this.map.setCenter(new OpenLayers.LonLat(
|
||||
(end.lon),
|
||||
(end.lat)
|
||||
), this.map.getZoom() + 1);
|
||||
}
|
||||
this.removeZoomBox();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Remove the zoombox from the screen and nullify our reference to it.
|
||||
*/
|
||||
removeZoomBox: function() {
|
||||
this.map.viewPortDiv.removeChild(this.zoomBox);
|
||||
this.zoomBox = null;
|
||||
},
|
||||
|
||||
|
||||
@@ -187,9 +233,9 @@ OpenLayers.Control.MouseDefaults.prototype =
|
||||
|
||||
// first determine whether or not the wheeling was inside the map
|
||||
var inMap = false;
|
||||
var elem = Event.element(e);
|
||||
var elem = OpenLayers.Event.element(e);
|
||||
while(elem != null) {
|
||||
if (elem == this.map.div) {
|
||||
if (this.map && elem == this.map.div) {
|
||||
inMap = true;
|
||||
break;
|
||||
}
|
||||
@@ -211,15 +257,20 @@ OpenLayers.Control.MouseDefaults.prototype =
|
||||
delta = -e.detail / 3;
|
||||
}
|
||||
if (delta) {
|
||||
// add the mouse position to the event because mozilla has a bug
|
||||
// with clientX and clientY (see https://bugzilla.mozilla.org/show_bug.cgi?id=352179)
|
||||
// getLonLatFromViewPortPx(e) returns wrong values
|
||||
e.xy = this.mousePosition;
|
||||
|
||||
if (delta < 0) {
|
||||
this.defaultWheelDown();
|
||||
this.defaultWheelDown(e);
|
||||
} else {
|
||||
this.defaultWheelUp();
|
||||
this.defaultWheelUp(e);
|
||||
}
|
||||
}
|
||||
|
||||
//only wheel the map, not the window
|
||||
Event.stop(e);
|
||||
OpenLayers.Event.stop(e);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
107
lib/OpenLayers/Control/MousePosition.js
Normal file
@@ -0,0 +1,107 @@
|
||||
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
|
||||
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
|
||||
* for the full text of the license. */
|
||||
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* @requires OpenLayers/Control.js
|
||||
*/
|
||||
OpenLayers.Control.MousePosition = OpenLayers.Class.create();
|
||||
OpenLayers.Control.MousePosition.prototype =
|
||||
OpenLayers.Class.inherit( OpenLayers.Control, {
|
||||
|
||||
/** @type DOMElement */
|
||||
element: null,
|
||||
|
||||
/** @type String */
|
||||
prefix: '',
|
||||
|
||||
/** @type String */
|
||||
separator: ', ',
|
||||
|
||||
/** @type String */
|
||||
suffix: '',
|
||||
|
||||
/** @type int */
|
||||
numdigits: 5,
|
||||
|
||||
/** @type int */
|
||||
granularity: 10,
|
||||
|
||||
/** @type OpenLayers.LonLat */
|
||||
lastXy: null,
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*
|
||||
* @param {DOMElement} options Options for control.
|
||||
*/
|
||||
initialize: function(options) {
|
||||
OpenLayers.Control.prototype.initialize.apply(this, arguments);
|
||||
},
|
||||
|
||||
/**
|
||||
* @type DOMElement
|
||||
*/
|
||||
draw: function() {
|
||||
OpenLayers.Control.prototype.draw.apply(this, arguments);
|
||||
|
||||
if (!this.element) {
|
||||
this.div.left = "";
|
||||
this.div.top = "";
|
||||
this.div.className = "olControlMousePosition";
|
||||
this.element = this.div;
|
||||
}
|
||||
|
||||
this.redraw();
|
||||
return this.div;
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
redraw: function(evt) {
|
||||
|
||||
var lonLat;
|
||||
|
||||
if (evt == null) {
|
||||
lonLat = new OpenLayers.LonLat(0, 0);
|
||||
} else {
|
||||
if (this.lastXy == null ||
|
||||
Math.abs(evt.xy.x - this.lastXy.x) > this.granularity ||
|
||||
Math.abs(evt.xy.y - this.lastXy.y) > this.granularity)
|
||||
{
|
||||
this.lastXy = evt.xy;
|
||||
return;
|
||||
}
|
||||
|
||||
lonLat = this.map.getLonLatFromPixel(evt.xy);
|
||||
this.lastXy = evt.xy;
|
||||
}
|
||||
|
||||
var digits = parseInt(this.numdigits);
|
||||
var newHtml =
|
||||
this.prefix +
|
||||
lonLat.lon.toFixed(digits) +
|
||||
this.separator +
|
||||
lonLat.lat.toFixed(digits) +
|
||||
this.suffix;
|
||||
|
||||
if (newHtml != this.element.innerHTML) {
|
||||
this.element.innerHTML = newHtml;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
setMap: function() {
|
||||
OpenLayers.Control.prototype.setMap.apply(this, arguments);
|
||||
this.map.events.register( 'mousemove', this, this.redraw);
|
||||
},
|
||||
|
||||
/** @final @type String */
|
||||
CLASS_NAME: "OpenLayers.Control.MousePosition"
|
||||
});
|
||||
@@ -1,17 +1,19 @@
|
||||
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
|
||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
|
||||
* text of the license. */
|
||||
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
|
||||
* for the full text of the license. */
|
||||
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* @requires OpenLayers/Control.js
|
||||
* @requires OpenLayers/Control/MouseDefaults.js
|
||||
*/
|
||||
OpenLayers.Control.MouseToolbar = Class.create();
|
||||
OpenLayers.Control.MouseToolbar = OpenLayers.Class.create();
|
||||
OpenLayers.Control.MouseToolbar.X = 6;
|
||||
OpenLayers.Control.MouseToolbar.Y = 300;
|
||||
OpenLayers.Control.MouseToolbar.prototype =
|
||||
Object.extend( new OpenLayers.Control(), {
|
||||
OpenLayers.Class.inherit( OpenLayers.Control.MouseDefaults, {
|
||||
|
||||
mode: null,
|
||||
|
||||
@@ -19,6 +21,9 @@ OpenLayers.Control.MouseToolbar.prototype =
|
||||
|
||||
direction: "vertical",
|
||||
|
||||
/** @type String */
|
||||
buttonClicked: null,
|
||||
|
||||
initialize: function(position, direction) {
|
||||
OpenLayers.Control.prototype.initialize.apply(this, arguments);
|
||||
this.position = new OpenLayers.Pixel(OpenLayers.Control.MouseToolbar.X,
|
||||
@@ -33,24 +38,20 @@ OpenLayers.Control.MouseToolbar.prototype =
|
||||
},
|
||||
|
||||
draw: function() {
|
||||
OpenLayers.Control.prototype.draw.apply(this, arguments);
|
||||
OpenLayers.Control.prototype.draw.apply(this, arguments);
|
||||
OpenLayers.Control.MouseDefaults.prototype.draw.apply(this, arguments);
|
||||
this.buttons = new Object();
|
||||
this.map.events.register( "dblclick", this, this.defaultDblClick );
|
||||
this.map.events.register( "mousedown", this, this.defaultMouseDown );
|
||||
this.map.events.register( "mouseup", this, this.defaultMouseUp );
|
||||
this.map.events.register( "mousemove", this, this.defaultMouseMove );
|
||||
this.map.events.register( "mouseout", this, this.defaultMouseOut );
|
||||
var sz = new OpenLayers.Size(28,28);
|
||||
var centered = this.position;
|
||||
this._addButton("zoombox", "drag-rectangle-off.png", "drag-rectangle-on.png", centered, sz, "Shift->Drag to zoom to area");
|
||||
centered = centered.add((this.direction == "vertical" ? 0 : sz.w), (this.direction == "vertical" ? sz.h : 0));
|
||||
this._addButton("pan", "panning-hand-off.png", "panning-hand-on.png", centered, sz, "Drag the map to pan.");
|
||||
centered = centered.add((this.direction == "vertical" ? 0 : sz.w), (this.direction == "vertical" ? sz.h : 0));
|
||||
this._addButton("measure", "measuring-stick-off.png", "measuring-stick-on.png", centered, sz, "Hold alt when clicking to show distance between selected points");
|
||||
this.switchModeTo("pan");
|
||||
this.map.events.register("zoomend", this, function() { this.switchModeTo("pan"); });
|
||||
|
||||
this.registerWheelEvents();
|
||||
|
||||
return this.div;
|
||||
|
||||
},
|
||||
|
||||
_addButton:function(id, img, activeImg, xy, sz, title) {
|
||||
@@ -66,9 +67,10 @@ OpenLayers.Control.MouseToolbar.prototype =
|
||||
btn.imgLocation = imgLocation;
|
||||
btn.activeImgLocation = activeImgLocation;
|
||||
|
||||
btn.events = new OpenLayers.Events(this, btn);
|
||||
btn.events.register("mousedown", this, this.buttonClick);
|
||||
btn.events.register("mouseup", this, Event.stop);
|
||||
btn.events = new OpenLayers.Events(this, btn, null, true);
|
||||
btn.events.register("mousedown", this, this.buttonDown);
|
||||
btn.events.register("mouseup", this, this.buttonUp);
|
||||
btn.events.register("dblclick", this, OpenLayers.Event.stop);
|
||||
btn.action = id;
|
||||
btn.title = title;
|
||||
btn.alt = title;
|
||||
@@ -79,10 +81,27 @@ OpenLayers.Control.MouseToolbar.prototype =
|
||||
return btn;
|
||||
},
|
||||
|
||||
buttonClick: function(evt) {
|
||||
if (!Event.isLeftClick(evt)) return;
|
||||
this.switchModeTo(evt.element.action);
|
||||
Event.stop(evt);
|
||||
/**
|
||||
* @param {Event} evt
|
||||
*/
|
||||
buttonDown: function(evt) {
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) return;
|
||||
this.buttonClicked = evt.element.action;
|
||||
OpenLayers.Event.stop(evt);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {Event} evt
|
||||
*/
|
||||
buttonUp: function(evt) {
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) return;
|
||||
if (this.buttonClicked != null) {
|
||||
if (this.buttonClicked == evt.element.action) {
|
||||
this.switchModeTo(evt.element.action);
|
||||
}
|
||||
OpenLayers.Event.stop(evt);
|
||||
this.buttonClicked = null;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -92,18 +111,22 @@ OpenLayers.Control.MouseToolbar.prototype =
|
||||
this.switchModeTo("pan");
|
||||
this.performedDrag = false;
|
||||
var newCenter = this.map.getLonLatFromViewPortPx( evt.xy );
|
||||
this.map.setCenter(newCenter, this.map.zoom + 2);
|
||||
this.map.setCenter(newCenter, this.map.zoom + 1);
|
||||
OpenLayers.Event.stop(evt);
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {Event} evt
|
||||
*/
|
||||
defaultMouseDown: function (evt) {
|
||||
if (!Event.isLeftClick(evt)) return;
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) return;
|
||||
this.mouseDragStart = evt.xy.clone();
|
||||
this.performedDrag = false;
|
||||
this.startViaKeyboard = false;
|
||||
if (evt.shiftKey && this.mode !="zoombox") {
|
||||
this.switchModeTo("zoombox");
|
||||
this.startViaKeyboard = true;
|
||||
} else if (evt.altKey && this.mode !="measure") {
|
||||
this.switchModeTo("measure");
|
||||
} else if (!this.mode) {
|
||||
@@ -122,8 +145,10 @@ OpenLayers.Control.MouseToolbar.prototype =
|
||||
this.zoomBox.style.backgroundColor = "white";
|
||||
this.zoomBox.style.filter = "alpha(opacity=50)"; // IE
|
||||
this.zoomBox.style.opacity = "0.50";
|
||||
this.zoomBox.style.fontSize = "1px";
|
||||
this.zoomBox.style.zIndex = this.map.Z_INDEX_BASE["Popup"] - 1;
|
||||
this.map.viewPortDiv.appendChild(this.zoomBox);
|
||||
this.performedDrag = true;
|
||||
break;
|
||||
case "measure":
|
||||
var distance = "";
|
||||
@@ -144,6 +169,7 @@ OpenLayers.Control.MouseToolbar.prototype =
|
||||
"absolute");
|
||||
this.measureBox.style.width="4px";
|
||||
this.measureBox.style.height="4px";
|
||||
this.measureBox.style.fontSize = "1px";
|
||||
this.measureBox.style.backgroundColor="red";
|
||||
this.measureBox.style.zIndex = this.map.Z_INDEX_BASE["Popup"] - 1;
|
||||
this.map.layerContainerDiv.appendChild(this.measureBox);
|
||||
@@ -170,12 +196,14 @@ OpenLayers.Control.MouseToolbar.prototype =
|
||||
break;
|
||||
}
|
||||
document.onselectstart = function() { return false; }
|
||||
Event.stop(evt);
|
||||
OpenLayers.Event.stop(evt);
|
||||
},
|
||||
|
||||
switchModeTo: function(mode) {
|
||||
if (mode != this.mode) {
|
||||
if (this.mode) {
|
||||
|
||||
|
||||
if (this.mode && this.buttons[this.mode]) {
|
||||
OpenLayers.Util.modifyAlphaImageDiv(this.buttons[this.mode], null, null, null, this.buttons[this.mode].imgLocation);
|
||||
}
|
||||
if (this.mode == "measure" && mode != "measure") {
|
||||
@@ -188,7 +216,18 @@ OpenLayers.Control.MouseToolbar.prototype =
|
||||
this.measureStart = null;
|
||||
}
|
||||
this.mode = mode;
|
||||
OpenLayers.Util.modifyAlphaImageDiv(this.buttons[mode], null, null, null, this.buttons[mode].activeImgLocation);
|
||||
if (this.buttons[mode]) {
|
||||
OpenLayers.Util.modifyAlphaImageDiv(this.buttons[mode], null, null, null, this.buttons[mode].activeImgLocation);
|
||||
}
|
||||
switch (this.mode) {
|
||||
case "zoombox":
|
||||
this.map.div.style.cursor = "crosshair";
|
||||
break;
|
||||
default:
|
||||
this.map.div.style.cursor = "default";
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
@@ -205,8 +244,8 @@ OpenLayers.Control.MouseToolbar.prototype =
|
||||
case "zoombox":
|
||||
var deltaX = Math.abs(this.mouseDragStart.x - evt.xy.x);
|
||||
var deltaY = Math.abs(this.mouseDragStart.y - evt.xy.y);
|
||||
this.zoomBox.style.width = deltaX+"px";
|
||||
this.zoomBox.style.height = deltaY+"px";
|
||||
this.zoomBox.style.width = Math.max(1, deltaX) + "px";
|
||||
this.zoomBox.style.height = Math.max(1, deltaY) + "px";
|
||||
if (evt.xy.x < this.mouseDragStart.x) {
|
||||
this.zoomBox.style.left = evt.xy.x+"px";
|
||||
}
|
||||
@@ -232,24 +271,11 @@ OpenLayers.Control.MouseToolbar.prototype =
|
||||
* @param {Event} evt
|
||||
*/
|
||||
defaultMouseUp: function (evt) {
|
||||
if (!Event.isLeftClick(evt)) return;
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) return;
|
||||
switch (this.mode) {
|
||||
case "zoombox":
|
||||
var start = this.map.getLonLatFromViewPortPx( this.mouseDragStart );
|
||||
var end = this.map.getLonLatFromViewPortPx( evt.xy );
|
||||
var top = Math.max(start.lat, end.lat);
|
||||
var bottom = Math.min(start.lat, end.lat);
|
||||
var left = Math.min(start.lon, end.lon);
|
||||
var right = Math.max(start.lon, end.lon);
|
||||
var bounds = new OpenLayers.Bounds(left, bottom, right, top);
|
||||
var zoom = this.map.getZoomForExtent(bounds);
|
||||
this.map.setCenter(new OpenLayers.LonLat(
|
||||
(start.lon + end.lon) / 2,
|
||||
(start.lat + end.lat) / 2
|
||||
), zoom);
|
||||
this.map.viewPortDiv.removeChild(document.getElementById("zoomBox"));
|
||||
this.zoomBox = null;
|
||||
this.leaveMode();
|
||||
this.zoomBoxEnd(evt);
|
||||
if (this.startViaKeyboard) this.leaveMode();
|
||||
break;
|
||||
case "pan":
|
||||
if (this.performedDrag) {
|
||||
@@ -261,10 +287,25 @@ OpenLayers.Control.MouseToolbar.prototype =
|
||||
this.map.div.style.cursor = "default";
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {Event} evt
|
||||
*/
|
||||
defaultMouseOut: function (evt) {
|
||||
if (this.mouseDragStart != null
|
||||
&& OpenLayers.Util.mouseLeft(evt, this.map.div)) {
|
||||
this.defaultMouseUp(evt);
|
||||
if (this.zoomBox) {
|
||||
this.removeZoomBox();
|
||||
if (this.startViaKeyboard) this.leaveMode();
|
||||
}
|
||||
this.mouseDragStart = null;
|
||||
this.map.div.style.cursor = "default";
|
||||
}
|
||||
},
|
||||
|
||||
defaultClick: function (evt) {
|
||||
if (this.performedDrag) {
|
||||
this.performedDrag = false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
540
lib/OpenLayers/Control/OverviewMap.js
Normal file
@@ -0,0 +1,540 @@
|
||||
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
|
||||
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
|
||||
* for the full text of the license. */
|
||||
/**
|
||||
* @fileoverview Locator Map Control
|
||||
* @author Tim Schaub
|
||||
*/
|
||||
|
||||
// @require: OpenLayers/Control.js
|
||||
|
||||
/**
|
||||
* @class
|
||||
*/
|
||||
OpenLayers.Control.OverviewMap = OpenLayers.Class.create();
|
||||
|
||||
OpenLayers.Control.OverviewMap.prototype =
|
||||
OpenLayers.Class.inherit( OpenLayers.Control, {
|
||||
|
||||
/** For div.id
|
||||
* @type String */
|
||||
id: "OverviewMap",
|
||||
|
||||
/** @type DOMElement */
|
||||
element: null,
|
||||
|
||||
/**
|
||||
* The overvew map itself.
|
||||
* @type OpenLayers.Map
|
||||
*/
|
||||
ovmap: null,
|
||||
|
||||
/**
|
||||
* The overvew map size in pixels. Note that this is the size of the map
|
||||
* itself - the element that contains the map (class name
|
||||
* olControlOverviewMapElement) may have padding or other style attributes
|
||||
* added via CSS.
|
||||
* @type OpenLayers.Size
|
||||
*/
|
||||
size: new OpenLayers.Size(180, 90),
|
||||
|
||||
/**
|
||||
* Ordered list of layers in the overview map. If none are sent at
|
||||
* construction, then the default below is used.
|
||||
*
|
||||
* @type Array(OpenLayers.Layer)
|
||||
*/
|
||||
layers: [],
|
||||
|
||||
/**
|
||||
* The ratio of the overview map resolution to the main map resolution
|
||||
* at which to zoom farther out on the overview map.
|
||||
* @type Float
|
||||
*/
|
||||
minRatio: 8,
|
||||
|
||||
/**
|
||||
* The ratio of the overview map resolution to the main map resolution
|
||||
* at which to zoom farther in on the overview map.
|
||||
* @type Float
|
||||
*/
|
||||
maxRatio: 32,
|
||||
|
||||
/**
|
||||
* An object containing any non-default properties to be sent to the
|
||||
* overview map's map constructor. These should include any non-default
|
||||
* options that the main map was constructed with.
|
||||
* @type: Object
|
||||
*/
|
||||
mapOptions: {},
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @param {Object} options Hashtable of options to set on the overview map
|
||||
*/
|
||||
initialize: function(options) {
|
||||
OpenLayers.Control.prototype.initialize.apply(this, [options]);
|
||||
},
|
||||
|
||||
/**
|
||||
* @type DOMElement
|
||||
*/
|
||||
draw: function() {
|
||||
OpenLayers.Control.prototype.draw.apply(this, arguments);
|
||||
if(!(this.layers.length > 0)) {
|
||||
if (this.map.baseLayer) {
|
||||
var layer = this.map.baseLayer.clone();
|
||||
this.layers = [layer];
|
||||
} else {
|
||||
this.map.events.register("changebaselayer", this, this.baseLayerDraw);
|
||||
return this.div;
|
||||
}
|
||||
}
|
||||
|
||||
// create overview map DOM elements
|
||||
this.element = document.createElement('div');
|
||||
this.element.className = 'olControlOverviewMapElement';
|
||||
this.element.style.display = 'none';
|
||||
|
||||
this.mapDiv = document.createElement('div');
|
||||
this.mapDiv.style.width = this.size.w + 'px';
|
||||
this.mapDiv.style.height = this.size.h + 'px';
|
||||
this.mapDiv.style.position = 'relative';
|
||||
this.mapDiv.style.overflow = 'hidden';
|
||||
this.mapDiv.id = OpenLayers.Util.createUniqueID('overviewMap');
|
||||
|
||||
this.extentRectangle = document.createElement('div');
|
||||
this.extentRectangle.style.position = 'absolute';
|
||||
this.extentRectangle.style.zIndex = 1000; //HACK
|
||||
this.extentRectangle.style.backgroundImage = 'url(' +
|
||||
OpenLayers.Util.getImagesLocation() +
|
||||
'/blank.png)';
|
||||
this.extentRectangle.className = 'olControlOverviewMapExtentRectangle';
|
||||
this.mapDiv.appendChild(this.extentRectangle);
|
||||
|
||||
this.element.appendChild(this.mapDiv);
|
||||
|
||||
this.div.appendChild(this.element);
|
||||
|
||||
this.map.events.register('moveend', this, this.update);
|
||||
|
||||
// Set up events. The image div recenters the map on click.
|
||||
// The extent rectangle can be dragged to recenter the map.
|
||||
// If the mousedown happened elsewhere, then mousemove and mouseup
|
||||
// should slip through.
|
||||
this.elementEvents = new OpenLayers.Events(this, this.element);
|
||||
this.elementEvents.register('mousedown', this, function(e) {
|
||||
OpenLayers.Event.stop(e);
|
||||
});
|
||||
this.elementEvents.register('click', this, function(e) {
|
||||
OpenLayers.Event.stop(e);
|
||||
});
|
||||
this.elementEvents.register('dblclick', this, function(e) {
|
||||
OpenLayers.Event.stop(e);
|
||||
});
|
||||
this.rectEvents = new OpenLayers.Events(this, this.extentRectangle);
|
||||
this.rectEvents.register('mouseover', this, this.rectMouseOver);
|
||||
this.rectEvents.register('mouseout', this, this.rectMouseOut);
|
||||
this.rectEvents.register('mousedown', this, this.rectMouseDown);
|
||||
this.rectEvents.register('mousemove', this, this.rectMouseMove);
|
||||
this.rectEvents.register('mouseup', this, this.rectMouseUp);
|
||||
this.rectEvents.register('click', this, function(e) {
|
||||
OpenLayers.Event.stop(e);
|
||||
});
|
||||
this.rectEvents.register('dblclick', this, this.rectDblClick );
|
||||
this.mapDivEvents = new OpenLayers.Events(this, this.mapDiv);
|
||||
this.mapDivEvents.register('click', this, this.mapDivClick);
|
||||
|
||||
// Optionally add min/max buttons if the control will go in the
|
||||
// map viewport.
|
||||
if(!this.div.parentNode ||
|
||||
(this.div.parentNode.className == 'olMapViewport')) {
|
||||
this.div.className = 'olControlOverviewMapContainer';
|
||||
var imgLocation = OpenLayers.Util.getImagesLocation();
|
||||
// maximize button div
|
||||
var img = imgLocation + 'layer-switcher-maximize.png';
|
||||
this.maximizeDiv = OpenLayers.Util.createAlphaImageDiv(
|
||||
'olControlOverviewMapMaximizeButton',
|
||||
null,
|
||||
new OpenLayers.Size(18,18),
|
||||
img,
|
||||
'absolute');
|
||||
this.maximizeDiv.style.display = 'none';
|
||||
this.maximizeDiv.className = 'olControlOverviewMapMaximizeButton';
|
||||
OpenLayers.Event.observe(this.maximizeDiv,
|
||||
'click',
|
||||
this.maximizeControl.bindAsEventListener(this));
|
||||
this.div.appendChild(this.maximizeDiv);
|
||||
|
||||
// minimize button div
|
||||
var img = imgLocation + 'layer-switcher-minimize.png';
|
||||
this.minimizeDiv = OpenLayers.Util.createAlphaImageDiv(
|
||||
'OpenLayers_Control_minimizeDiv',
|
||||
null,
|
||||
new OpenLayers.Size(18,18),
|
||||
img,
|
||||
'absolute');
|
||||
this.minimizeDiv.style.display = 'none';
|
||||
this.minimizeDiv.className = 'olControlOverviewMapMinimizeButton';
|
||||
OpenLayers.Event.observe(this.minimizeDiv,
|
||||
'click',
|
||||
this.minimizeControl.bindAsEventListener(this));
|
||||
|
||||
this.div.appendChild(this.minimizeDiv);
|
||||
|
||||
this.minimizeControl();
|
||||
} else {
|
||||
// show the overview map
|
||||
this.element.style.display = '';
|
||||
}
|
||||
|
||||
return this.div;
|
||||
},
|
||||
|
||||
baseLayerDraw: function() {
|
||||
this.draw();
|
||||
this.map.events.unregister("changebaselayer", this, this.baseLayerDraw);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Event} evt
|
||||
*/
|
||||
rectMouseOver: function (evt) {
|
||||
this.extentRectangle.style.cursor = 'move';
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Event} evt
|
||||
*/
|
||||
rectMouseOut: function (evt) {
|
||||
this.extentRectangle.style.cursor = 'default';
|
||||
if(this.rectDragStart != null) {
|
||||
if(this.performedRectDrag) {
|
||||
this.updateMapToRect();
|
||||
}
|
||||
document.onselectstart = null;
|
||||
this.rectDragStart = null;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Event} evt
|
||||
*/
|
||||
rectMouseDown: function (evt) {
|
||||
if(!OpenLayers.Event.isLeftClick(evt)) return;
|
||||
this.rectDragStart = evt.xy.clone();
|
||||
this.performedRectDrag = false;
|
||||
OpenLayers.Event.stop(evt);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Event} evt
|
||||
*/
|
||||
rectMouseMove: function(evt) {
|
||||
if(this.rectDragStart != null) {
|
||||
var deltaX = this.rectDragStart.x - evt.xy.x;
|
||||
var deltaY = this.rectDragStart.y - evt.xy.y;
|
||||
var rectPxBounds = this.getRectPxBounds();
|
||||
var rectTop = rectPxBounds.top;
|
||||
var rectLeft = rectPxBounds.left;
|
||||
var rectHeight = Math.abs(rectPxBounds.getHeight());
|
||||
var rectWidth = rectPxBounds.getWidth();
|
||||
// don't allow dragging off of parent element
|
||||
var newTop = Math.max(0, (rectTop - deltaY));
|
||||
newTop = Math.min(newTop,
|
||||
this.ovmap.size.h - this.hComp - rectHeight);
|
||||
var newLeft = Math.max(0, (rectLeft - deltaX));
|
||||
newLeft = Math.min(newLeft,
|
||||
this.ovmap.size.w - this.wComp - rectWidth);
|
||||
this.setRectPxBounds(new OpenLayers.Bounds(newLeft,
|
||||
newTop + rectHeight,
|
||||
newLeft + rectWidth,
|
||||
newTop));
|
||||
this.rectDragStart = evt.xy.clone();
|
||||
this.performedRectDrag = true;
|
||||
OpenLayers.Event.stop(evt);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Event} evt
|
||||
*/
|
||||
rectMouseUp: function(evt) {
|
||||
if(!OpenLayers.Event.isLeftClick(evt)) return;
|
||||
if(this.performedRectDrag) {
|
||||
this.updateMapToRect();
|
||||
OpenLayers.Event.stop(evt);
|
||||
}
|
||||
document.onselectstart = null;
|
||||
this.rectDragStart = null;
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Event} evt
|
||||
*/
|
||||
rectDblClick: function(evt) {
|
||||
this.performedRectDrag = false;
|
||||
OpenLayers.Event.stop(evt);
|
||||
this.updateOverview();
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Event} evt
|
||||
*/
|
||||
mapDivClick: function(evt) {
|
||||
var pxBounds = this.getRectPxBounds();
|
||||
var pxCenter = pxBounds.getCenterPixel();
|
||||
var deltaX = evt.xy.x - pxCenter.x;
|
||||
var deltaY = evt.xy.y - pxCenter.y;
|
||||
var top = pxBounds.top;
|
||||
var left = pxBounds.left;
|
||||
var height = Math.abs(pxBounds.getHeight());
|
||||
var width = pxBounds.getWidth();
|
||||
var newTop = Math.max(0, (top + deltaY));
|
||||
newTop = Math.min(newTop, this.ovmap.size.h - height);
|
||||
var newLeft = Math.max(0, (left + deltaX));
|
||||
newLeft = Math.min(newLeft, this.ovmap.size.w - width);
|
||||
this.setRectPxBounds(new OpenLayers.Bounds(newLeft,
|
||||
newTop + height,
|
||||
newLeft + width,
|
||||
newTop));
|
||||
this.updateMapToRect();
|
||||
OpenLayers.Event.stop(evt);
|
||||
},
|
||||
|
||||
/** Set up the labels and divs for the control
|
||||
*
|
||||
* @param {OpenLayers.Event} e
|
||||
*/
|
||||
maximizeControl: function(e) {
|
||||
this.element.style.display = '';
|
||||
this.showToggle(false);
|
||||
if (e != null) {
|
||||
OpenLayers.Event.stop(e);
|
||||
}
|
||||
},
|
||||
|
||||
/** Hide all the contents of the control, shrink the size,
|
||||
* add the maximize icon
|
||||
*
|
||||
* @param {OpenLayers.Event} e
|
||||
*/
|
||||
minimizeControl: function(e) {
|
||||
this.element.style.display = 'none';
|
||||
this.showToggle(true);
|
||||
if (e != null) {
|
||||
OpenLayers.Event.stop(e);
|
||||
}
|
||||
},
|
||||
|
||||
/** Hide/Show all LayerSwitcher controls depending on whether we are
|
||||
* minimized or not
|
||||
*
|
||||
* @private
|
||||
*
|
||||
* @param {Boolean} minimize
|
||||
*/
|
||||
showToggle: function(minimize) {
|
||||
this.maximizeDiv.style.display = minimize ? '' : 'none';
|
||||
this.minimizeDiv.style.display = minimize ? 'none' : '';
|
||||
},
|
||||
|
||||
/**
|
||||
* Update the overview map after layers move.
|
||||
*/
|
||||
update: function() {
|
||||
if(this.ovmap == null) {
|
||||
this.createMap();
|
||||
}
|
||||
|
||||
if(!this.isSuitableOverview()) {
|
||||
this.updateOverview();
|
||||
}
|
||||
|
||||
// update extent rectangle
|
||||
this.updateRectToMap();
|
||||
},
|
||||
|
||||
/**
|
||||
* Determines if the overview map is suitable given the extent and
|
||||
* resolution of the main map.
|
||||
*/
|
||||
isSuitableOverview: function() {
|
||||
var mapExtent = this.map.getExtent();
|
||||
var maxExtent = this.map.maxExtent;
|
||||
var testExtent = new OpenLayers.Bounds(
|
||||
Math.max(mapExtent.left, maxExtent.left),
|
||||
Math.max(mapExtent.bottom, maxExtent.bottom),
|
||||
Math.min(mapExtent.right, maxExtent.right),
|
||||
Math.min(mapExtent.top, maxExtent.top));
|
||||
var resRatio = this.ovmap.getResolution() / this.map.getResolution();
|
||||
return ((resRatio > this.minRatio) &&
|
||||
(resRatio <= this.maxRatio) &&
|
||||
(this.ovmap.getExtent().containsBounds(testExtent)));
|
||||
},
|
||||
|
||||
updateOverview: function() {
|
||||
var mapRes = this.map.getResolution();
|
||||
var targetRes = this.ovmap.getResolution();
|
||||
var resRatio = targetRes / mapRes;
|
||||
if(resRatio > this.maxRatio) {
|
||||
// zoom in overview map
|
||||
targetRes = this.minRatio * mapRes;
|
||||
} else if(resRatio <= this.minRatio) {
|
||||
// zoom out overview map
|
||||
targetRes = this.maxRatio * mapRes;
|
||||
}
|
||||
this.ovmap.setCenter(this.map.center,
|
||||
this.ovmap.getZoomForResolution(targetRes));
|
||||
this.updateRectToMap();
|
||||
},
|
||||
|
||||
createMap: function() {
|
||||
// create the overview map
|
||||
var options = OpenLayers.Util.extend(
|
||||
{controls: [], maxResolution: 'auto'}, this.mapOptions);
|
||||
this.ovmap = new OpenLayers.Map(this.mapDiv.id, options);
|
||||
this.ovmap.addLayers(this.layers);
|
||||
this.ovmap.zoomToMaxExtent();
|
||||
// check extent rectangle border width
|
||||
this.wComp = parseInt(OpenLayers.Element.getStyle(this.extentRectangle,
|
||||
'border-left-width')) +
|
||||
parseInt(OpenLayers.Element.getStyle(this.extentRectangle,
|
||||
'border-right-width'));
|
||||
this.wComp = (this.wComp) ? this.wComp : 2;
|
||||
this.hComp = parseInt(OpenLayers.Element.getStyle(this.extentRectangle,
|
||||
'border-top-width')) +
|
||||
parseInt(OpenLayers.Element.getStyle(this.extentRectangle,
|
||||
'border-bottom-width'));
|
||||
this.hComp = (this.hComp) ? this.hComp : 2;
|
||||
},
|
||||
|
||||
/**
|
||||
* Updates the extent rectangle position and size to match the map extent
|
||||
*/
|
||||
updateRectToMap: function() {
|
||||
// The base layer for overview map needs to be in the same projection
|
||||
// as the base layer for the main map. This should be made more robust.
|
||||
if(this.map.units != 'degrees') {
|
||||
if(this.map.getProjection() != this.ovmap.getProjection()) {
|
||||
alert('The overview map only works when it is in the same projection as the main map');
|
||||
}
|
||||
}
|
||||
var pxBounds = this.getRectBoundsFromMapBounds(this.map.getExtent());
|
||||
this.setRectPxBounds(pxBounds);
|
||||
},
|
||||
|
||||
/**
|
||||
* Updates the map extent to match the extent rectangle position and size
|
||||
*/
|
||||
updateMapToRect: function() {
|
||||
var pxBounds = this.getRectPxBounds();
|
||||
var lonLatBounds = this.getMapBoundsFromRectBounds(pxBounds);
|
||||
this.map.setCenter(lonLatBounds.getCenterLonLat(), this.map.zoom);
|
||||
},
|
||||
|
||||
/**
|
||||
* Get extent rectangle pixel bounds
|
||||
* @returns An OpenLayers.Bounds wich is the extent rectangle's pixel
|
||||
* bounds (relative to the parent element)
|
||||
*/
|
||||
getRectPxBounds: function() {
|
||||
var top = parseInt(this.extentRectangle.style.top);
|
||||
var left = parseInt(this.extentRectangle.style.left);
|
||||
var height = parseInt(this.extentRectangle.style.height);
|
||||
var width = parseInt(this.extentRectangle.style.width);
|
||||
return new OpenLayers.Bounds(left, top + height, left + width, top);
|
||||
},
|
||||
|
||||
/**
|
||||
* Set extent rectangle pixel bounds.
|
||||
* @param {OpenLayers.Bounds} pxBounds
|
||||
*/
|
||||
setRectPxBounds: function(pxBounds) {
|
||||
var top = Math.max(pxBounds.top, 0);
|
||||
var left = Math.max(pxBounds.left, 0);
|
||||
var bottom = Math.min(pxBounds.top + Math.abs(pxBounds.getHeight()),
|
||||
this.ovmap.size.h - this.hComp);
|
||||
var right = Math.min(pxBounds.left + pxBounds.getWidth(),
|
||||
this.ovmap.size.w - this.wComp);
|
||||
this.extentRectangle.style.top = parseInt(top) + 'px';
|
||||
this.extentRectangle.style.left = parseInt(left) + 'px';
|
||||
this.extentRectangle.style.height = parseInt(bottom - top)+ 'px';
|
||||
this.extentRectangle.style.width = parseInt(right - left) + 'px';
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Bounds} lonLatBounds
|
||||
*
|
||||
* @returns An OpenLayers.Bounds which is the passed-in map lon/lat extent
|
||||
* translated into pixel bounds for the overview map
|
||||
* @type OpenLayers.Bounds
|
||||
*/
|
||||
getRectBoundsFromMapBounds: function(lonLatBounds) {
|
||||
var leftBottomLonLat = new OpenLayers.LonLat(lonLatBounds.left,
|
||||
lonLatBounds.bottom);
|
||||
var rightTopLonLat = new OpenLayers.LonLat(lonLatBounds.right,
|
||||
lonLatBounds.top);
|
||||
var leftBottomPx = this.getOverviewPxFromLonLat(leftBottomLonLat);
|
||||
var rightTopPx = this.getOverviewPxFromLonLat(rightTopLonLat);
|
||||
return new OpenLayers.Bounds(leftBottomPx.x, leftBottomPx.y,
|
||||
rightTopPx.x, rightTopPx.y);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Bounds} pxBounds
|
||||
*
|
||||
* @returns An OpenLayers.Bounds which is the passed-in overview rect bounds
|
||||
* translated into lon/lat bounds for the overview map
|
||||
* @type OpenLayers.Bounds
|
||||
*/
|
||||
getMapBoundsFromRectBounds: function(pxBounds) {
|
||||
var leftBottomPx = new OpenLayers.Pixel(pxBounds.left,
|
||||
pxBounds.bottom);
|
||||
var rightTopPx = new OpenLayers.Pixel(pxBounds.right,
|
||||
pxBounds.top);
|
||||
var leftBottomLonLat = this.getLonLatFromOverviewPx(leftBottomPx);
|
||||
var rightTopLonLat = this.getLonLatFromOverviewPx(rightTopPx);
|
||||
return new OpenLayers.Bounds(leftBottomLonLat.lon, leftBottomLonLat.lat,
|
||||
rightTopLonLat.lon, rightTopLonLat.lat);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Pixel} overviewMapPx
|
||||
*
|
||||
* @returns An OpenLayers.LonLat which is the passed-in overview map
|
||||
* OpenLayers.Pixel, translated into lon/lat by the overview map
|
||||
* @type OpenLayers.LonLat
|
||||
*/
|
||||
getLonLatFromOverviewPx: function(overviewMapPx) {
|
||||
var size = this.ovmap.size;
|
||||
var res = this.ovmap.getResolution();
|
||||
var center = this.ovmap.getExtent().getCenterLonLat();
|
||||
|
||||
var delta_x = overviewMapPx.x - (size.w / 2);
|
||||
var delta_y = overviewMapPx.y - (size.h / 2);
|
||||
|
||||
return new OpenLayers.LonLat(center.lon + delta_x * res ,
|
||||
center.lat - delta_y * res);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.LonLat} lonlat
|
||||
*
|
||||
* @returns An OpenLayers.Pixel which is the passed-in OpenLayers.LonLat,
|
||||
* translated into overview map pixels
|
||||
* @type OpenLayers.Pixel
|
||||
*/
|
||||
getOverviewPxFromLonLat: function(lonlat) {
|
||||
var res = this.ovmap.getResolution();
|
||||
var extent = this.ovmap.getExtent();
|
||||
return new OpenLayers.Pixel(
|
||||
Math.round(1/res * (lonlat.lon - extent.left)),
|
||||
Math.round(1/res * (extent.top - lonlat.lat))
|
||||
);
|
||||
},
|
||||
|
||||
/** @final @type String */
|
||||
CLASS_NAME: 'OpenLayers.Control.OverviewMap'
|
||||
|
||||
});
|
||||
@@ -1,17 +1,18 @@
|
||||
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
|
||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
|
||||
* text of the license. */
|
||||
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
|
||||
* for the full text of the license. */
|
||||
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* @requires OpenLayers/Control.js
|
||||
*/
|
||||
OpenLayers.Control.PanZoom = Class.create();
|
||||
OpenLayers.Control.PanZoom = OpenLayers.Class.create();
|
||||
OpenLayers.Control.PanZoom.X = 4;
|
||||
OpenLayers.Control.PanZoom.Y = 4;
|
||||
OpenLayers.Control.PanZoom.prototype =
|
||||
Object.extend( new OpenLayers.Control(), {
|
||||
OpenLayers.Class.inherit( OpenLayers.Control, {
|
||||
|
||||
/** @type int */
|
||||
slideFactor: 50,
|
||||
@@ -76,7 +77,6 @@ OpenLayers.Control.PanZoom.prototype =
|
||||
*/
|
||||
_addButton:function(id, img, xy, sz) {
|
||||
var imgLocation = OpenLayers.Util.getImagesLocation() + img;
|
||||
// var btn = new ol.AlphaImage("_"+id, imgLocation, xy, sz);
|
||||
var btn = OpenLayers.Util.createAlphaImageDiv(
|
||||
"OpenLayers_Control_PanZoom_" + id,
|
||||
xy, sz, imgLocation, "absolute");
|
||||
@@ -102,7 +102,7 @@ OpenLayers.Control.PanZoom.prototype =
|
||||
* @type Boolean
|
||||
*/
|
||||
doubleClick: function (evt) {
|
||||
Event.stop(evt);
|
||||
OpenLayers.Event.stop(evt);
|
||||
return false;
|
||||
},
|
||||
|
||||
@@ -110,7 +110,7 @@ OpenLayers.Control.PanZoom.prototype =
|
||||
* @param {Event} evt
|
||||
*/
|
||||
buttonDown: function (evt) {
|
||||
if (!Event.isLeftClick(evt)) return;
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) return;
|
||||
|
||||
switch (this.action) {
|
||||
case "panup":
|
||||
@@ -136,7 +136,7 @@ OpenLayers.Control.PanZoom.prototype =
|
||||
break;
|
||||
}
|
||||
|
||||
Event.stop(evt);
|
||||
OpenLayers.Event.stop(evt);
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
|
||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
|
||||
* text of the license. */
|
||||
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
|
||||
* for the full text of the license. */
|
||||
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* @requires OpenLayers/Control/PanZoom.js
|
||||
*/
|
||||
OpenLayers.Control.PanZoomBar = Class.create();
|
||||
OpenLayers.Control.PanZoomBar = OpenLayers.Class.create();
|
||||
OpenLayers.Control.PanZoomBar.X = 4;
|
||||
OpenLayers.Control.PanZoomBar.Y = 4;
|
||||
OpenLayers.Control.PanZoomBar.prototype =
|
||||
Object.extend( new OpenLayers.Control.PanZoom(), {
|
||||
OpenLayers.Class.inherit( OpenLayers.Control.PanZoom, {
|
||||
|
||||
/** @type Array(...) */
|
||||
buttons: null,
|
||||
|
||||
@@ -25,19 +27,33 @@ OpenLayers.Control.PanZoomBar.prototype =
|
||||
OpenLayers.Control.PanZoom.prototype.initialize.apply(this, arguments);
|
||||
this.position = new OpenLayers.Pixel(OpenLayers.Control.PanZoomBar.X,
|
||||
OpenLayers.Control.PanZoomBar.Y);
|
||||
|
||||
// put code here to catch "changebaselayer" event from map, because
|
||||
// we are going to have to redraw this thing each time, because
|
||||
// maxZoom will/might change.
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Map} map
|
||||
*/
|
||||
setMap: function(map) {
|
||||
OpenLayers.Control.PanZoom.prototype.setMap.apply(this, arguments);
|
||||
this.map.events.register("changebaselayer", this, this.redraw);
|
||||
},
|
||||
|
||||
/** clear the div and start over.
|
||||
*
|
||||
*/
|
||||
redraw: function() {
|
||||
if (this.div != null) {
|
||||
this.div.innerHTML = "";
|
||||
}
|
||||
this.draw();
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Pixel} px
|
||||
*/
|
||||
draw: function(px) {
|
||||
// initialize our internal div
|
||||
OpenLayers.Control.prototype.draw.apply(this, arguments);
|
||||
px = this.position;
|
||||
px = this.position.clone();
|
||||
|
||||
// place the controls
|
||||
this.buttons = new Array();
|
||||
@@ -63,15 +79,15 @@ OpenLayers.Control.PanZoomBar.prototype =
|
||||
var imgLocation = OpenLayers.Util.getImagesLocation();
|
||||
|
||||
var id = "OpenLayers_Control_PanZoomBar_Slider" + this.map.id;
|
||||
var zoomsToEnd = this.map.getNumZoomLevels() - 1 - this.map.getZoom();
|
||||
var slider = OpenLayers.Util.createAlphaImageDiv(id,
|
||||
centered.add(-1,
|
||||
(this.map.getMaxZoomLevel())*this.zoomStopHeight),
|
||||
centered.add(-1, zoomsToEnd * this.zoomStopHeight),
|
||||
new OpenLayers.Size(20,9),
|
||||
imgLocation+"slider.png",
|
||||
"absolute");
|
||||
this.slider = slider;
|
||||
|
||||
this.sliderEvents = new OpenLayers.Events(this, slider);
|
||||
this.sliderEvents = new OpenLayers.Events(this, slider, null, true);
|
||||
this.sliderEvents.register("mousedown", this, this.zoomBarDown);
|
||||
this.sliderEvents.register("mousemove", this, this.zoomBarDrag);
|
||||
this.sliderEvents.register("mouseup", this, this.zoomBarUp);
|
||||
@@ -79,7 +95,7 @@ OpenLayers.Control.PanZoomBar.prototype =
|
||||
this.sliderEvents.register("click", this, this.doubleClick);
|
||||
|
||||
sz = new OpenLayers.Size();
|
||||
sz.h = this.zoomStopHeight*(this.map.getMaxZoomLevel()+1);
|
||||
sz.h = this.zoomStopHeight * this.map.getNumZoomLevels();
|
||||
sz.w = this.zoomStopWidth;
|
||||
var div = null
|
||||
|
||||
@@ -101,7 +117,7 @@ OpenLayers.Control.PanZoomBar.prototype =
|
||||
|
||||
this.zoombarDiv = div;
|
||||
|
||||
this.divEvents = new OpenLayers.Events(this, div);
|
||||
this.divEvents = new OpenLayers.Events(this, div, null, true);
|
||||
this.divEvents.register("mousedown", this, this.divClick);
|
||||
this.divEvents.register("mousemove", this, this.passEventToSlider);
|
||||
this.divEvents.register("dblclick", this, this.doubleClick);
|
||||
@@ -115,7 +131,7 @@ OpenLayers.Control.PanZoomBar.prototype =
|
||||
this.map.events.register("zoomend", this, this.moveZoomBar);
|
||||
|
||||
centered = centered.add(0,
|
||||
this.zoomStopHeight*(this.map.getMaxZoomLevel()+1));
|
||||
this.zoomStopHeight * this.map.getNumZoomLevels());
|
||||
return centered;
|
||||
},
|
||||
/*
|
||||
@@ -132,12 +148,12 @@ OpenLayers.Control.PanZoomBar.prototype =
|
||||
* and sets the zoom level appropriately.
|
||||
*/
|
||||
divClick: function (evt) {
|
||||
if (!Event.isLeftClick(evt)) return;
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) return;
|
||||
var y = evt.xy.y;
|
||||
var top = Position.page(evt.object)[1];
|
||||
var top = OpenLayers.Util.pagePosition(evt.object)[1];
|
||||
var levels = Math.floor((y - top)/this.zoomStopHeight);
|
||||
this.map.zoomTo(this.map.getMaxZoomLevel() - levels);
|
||||
Event.stop(evt);
|
||||
this.map.zoomTo((this.map.getNumZoomLevels() -1) - levels);
|
||||
OpenLayers.Event.stop(evt);
|
||||
},
|
||||
|
||||
/*
|
||||
@@ -145,13 +161,13 @@ OpenLayers.Control.PanZoomBar.prototype =
|
||||
* event listener for clicks on the slider
|
||||
*/
|
||||
zoomBarDown:function(evt) {
|
||||
if (!Event.isLeftClick(evt)) return;
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) return;
|
||||
this.map.events.register("mousemove", this, this.passEventToSlider);
|
||||
this.map.events.register("mouseup", this, this.passEventToSlider);
|
||||
this.mouseDragStart = evt.xy.clone();
|
||||
this.zoomStart = evt.xy.clone();
|
||||
this.div.style.cursor = "move";
|
||||
Event.stop(evt);
|
||||
OpenLayers.Event.stop(evt);
|
||||
},
|
||||
|
||||
/*
|
||||
@@ -163,15 +179,15 @@ OpenLayers.Control.PanZoomBar.prototype =
|
||||
zoomBarDrag:function(evt) {
|
||||
if (this.mouseDragStart != null) {
|
||||
var deltaY = this.mouseDragStart.y - evt.xy.y
|
||||
var offsets = Position.page(this.zoombarDiv);
|
||||
var offsets = OpenLayers.Util.pagePosition(this.zoombarDiv);
|
||||
if ((evt.clientY - offsets[1]) > 0 &&
|
||||
(evt.clientY - offsets[1]) < parseInt(this.zoombarDiv.style.height) - 2) {
|
||||
var newTop = parseInt(this.slider.style.top) - deltaY;
|
||||
this.slider.style.top = newTop+"px";
|
||||
}
|
||||
this.mouseDragStart = evt.xy.clone();
|
||||
OpenLayers.Event.stop(evt);
|
||||
}
|
||||
Event.stop(evt);
|
||||
},
|
||||
|
||||
/*
|
||||
@@ -180,16 +196,16 @@ OpenLayers.Control.PanZoomBar.prototype =
|
||||
* and switch to it.
|
||||
*/
|
||||
zoomBarUp:function(evt) {
|
||||
if (!Event.isLeftClick(evt)) return;
|
||||
if (!OpenLayers.Event.isLeftClick(evt)) return;
|
||||
if (this.zoomStart) {
|
||||
this.div.style.cursor="default";
|
||||
this.map.events.remove("mousemove");
|
||||
this.map.events.remove("mouseup");
|
||||
this.map.events.unregister("mouseup", this, this.passEventToSlider);
|
||||
this.map.events.unregister("mousemove", this, this.passEventToSlider);
|
||||
var deltaY = this.zoomStart.y - evt.xy.y
|
||||
this.map.zoomTo(this.map.zoom + Math.round(deltaY/this.zoomStopHeight));
|
||||
this.moveZoomBar();
|
||||
this.mouseDragStart = null;
|
||||
Event.stop(evt);
|
||||
OpenLayers.Event.stop(evt);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -198,8 +214,8 @@ OpenLayers.Control.PanZoomBar.prototype =
|
||||
*/
|
||||
moveZoomBar:function() {
|
||||
var newTop =
|
||||
(this.map.getMaxZoomLevel() - this.map.getZoom()) * this.zoomStopHeight
|
||||
+ this.startTop + 1;
|
||||
((this.map.getNumZoomLevels()-1) - this.map.getZoom()) *
|
||||
this.zoomStopHeight + this.startTop + 1;
|
||||
this.slider.style.top = newTop + "px";
|
||||
},
|
||||
|
||||
|
||||
@@ -1,22 +1,23 @@
|
||||
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
|
||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
|
||||
* text of the license. */
|
||||
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
|
||||
* for the full text of the license. */
|
||||
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* @requires OpenLayers/Control.js
|
||||
*/
|
||||
OpenLayers.Control.Permalink = Class.create();
|
||||
OpenLayers.Control.Permalink = OpenLayers.Class.create();
|
||||
OpenLayers.Control.Permalink.prototype =
|
||||
Object.extend( new OpenLayers.Control(), {
|
||||
OpenLayers.Class.inherit( OpenLayers.Control, {
|
||||
|
||||
/** @type DOMElement */
|
||||
element: null,
|
||||
|
||||
/** @type String */
|
||||
base: '',
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*
|
||||
@@ -26,7 +27,29 @@ OpenLayers.Control.Permalink.prototype =
|
||||
initialize: function(element, base) {
|
||||
OpenLayers.Control.prototype.initialize.apply(this, arguments);
|
||||
this.element = element;
|
||||
if (base) this.base = base;
|
||||
if (base) {
|
||||
this.base = base;
|
||||
}
|
||||
},
|
||||
|
||||
/** Set the map property for the control.
|
||||
*
|
||||
* @param {OpenLayers.Map} map
|
||||
*/
|
||||
setMap: function(map) {
|
||||
OpenLayers.Control.prototype.setMap.apply(this, arguments);
|
||||
|
||||
//make sure we have an arg parser attached
|
||||
for(var i=0; i< this.map.controls.length; i++) {
|
||||
var control = this.map.controls[i];
|
||||
if (control.CLASS_NAME == "OpenLayers.Control.ArgParser") {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i == this.map.controls.length) {
|
||||
this.map.addControl(new OpenLayers.Control.ArgParser());
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -34,29 +57,16 @@ OpenLayers.Control.Permalink.prototype =
|
||||
*/
|
||||
draw: function() {
|
||||
OpenLayers.Control.prototype.draw.apply(this, arguments);
|
||||
var args = OpenLayers.Util.getArgs();
|
||||
if (args.lat && args.lon) {
|
||||
this.map.setCenter(
|
||||
new OpenLayers.LonLat(parseFloat(args.lon), parseFloat(args.lat))
|
||||
);
|
||||
}
|
||||
if (args.zoom) {
|
||||
this.map.zoomTo(parseInt(args.zoom));
|
||||
}
|
||||
|
||||
if (!this.element) {
|
||||
this.div.className = 'olControlPermalink';
|
||||
this.element = document.createElement("a");
|
||||
this.div.style.right = "3px";
|
||||
this.div.style.bottom = "3px";
|
||||
this.div.style.left = "";
|
||||
this.div.style.top = "";
|
||||
this.div.style.display = "block";
|
||||
this.div.style.position = "absolute";
|
||||
this.element.style.fontSize="smaller";
|
||||
this.element.innerHTML = "Permalink";
|
||||
this.element.href="";
|
||||
this.div.appendChild(this.element);
|
||||
}
|
||||
this.map.events.register( 'moveend', this, this.updateLink);
|
||||
this.map.events.register('moveend', this, this.updateLink);
|
||||
return this.div;
|
||||
},
|
||||
|
||||
@@ -65,13 +75,25 @@ OpenLayers.Control.Permalink.prototype =
|
||||
*/
|
||||
updateLink: function() {
|
||||
var center = this.map.getCenter();
|
||||
var zoom = this.map.getZoom();
|
||||
var lat = Math.round(center.lat*100000)/100000;
|
||||
var lon = Math.round(center.lon*100000)/100000;
|
||||
this.element.href = this.base+"?lat="+lat+"&lon="+lon+"&zoom="+zoom;
|
||||
var zoom = "zoom=" + this.map.getZoom();
|
||||
var lat = "lat=" + Math.round(center.lat*100000)/100000;
|
||||
var lon = "lon=" + Math.round(center.lon*100000)/100000;
|
||||
|
||||
var layers = "layers=";
|
||||
for(var i=0; i< this.map.layers.length; i++) {
|
||||
var layer = this.map.layers[i];
|
||||
|
||||
if (layer.isBaseLayer) {
|
||||
layers += (layer == this.map.baseLayer) ? "B" : "0";
|
||||
} else {
|
||||
layers += (layer.getVisibility()) ? "T" : "F";
|
||||
}
|
||||
}
|
||||
var href = this.base + "?" + lat + "&" + lon + "&" + zoom +
|
||||
"&" + layers;
|
||||
this.element.href = href;
|
||||
},
|
||||
|
||||
|
||||
/** @final @type String */
|
||||
CLASS_NAME: "OpenLayers.Control.Permalink"
|
||||
});
|
||||
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
|
||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
|
||||
* text of the license. */
|
||||
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
|
||||
* for the full text of the license. */
|
||||
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* @requires OpenLayers/Control.js
|
||||
*/
|
||||
OpenLayers.Control.Scale = Class.create();
|
||||
OpenLayers.Control.Scale = OpenLayers.Class.create();
|
||||
OpenLayers.Control.Scale.prototype =
|
||||
Object.extend( new OpenLayers.Control(), {
|
||||
OpenLayers.Class.inherit( OpenLayers.Control, {
|
||||
/** @type DOMElement */
|
||||
element: null,
|
||||
|
||||
@@ -31,12 +32,7 @@ OpenLayers.Control.Scale.prototype =
|
||||
OpenLayers.Control.prototype.draw.apply(this, arguments);
|
||||
if (!this.element) {
|
||||
this.element = document.createElement("div");
|
||||
this.div.style.right = "3px";
|
||||
this.div.style.bottom = "2em";
|
||||
this.div.style.left = "";
|
||||
this.div.style.top = "";
|
||||
this.div.style.display = "block";
|
||||
this.div.style.position = "absolute";
|
||||
this.div.className = "olControlScale";
|
||||
this.element.style.fontSize="smaller";
|
||||
this.div.appendChild(this.element);
|
||||
}
|
||||
|
||||
@@ -1,11 +1,123 @@
|
||||
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
|
||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
|
||||
* text of the license. */
|
||||
|
||||
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
|
||||
* for the full text of the license. */
|
||||
|
||||
|
||||
OpenLayers.Event = {
|
||||
KEY_BACKSPACE: 8,
|
||||
KEY_TAB: 9,
|
||||
KEY_RETURN: 13,
|
||||
KEY_ESC: 27,
|
||||
KEY_LEFT: 37,
|
||||
KEY_UP: 38,
|
||||
KEY_RIGHT: 39,
|
||||
KEY_DOWN: 40,
|
||||
KEY_DELETE: 46,
|
||||
|
||||
element: function(event) {
|
||||
return event.target || event.srcElement;
|
||||
},
|
||||
|
||||
isLeftClick: function(event) {
|
||||
return (((event.which) && (event.which == 1)) ||
|
||||
((event.button) && (event.button == 1)));
|
||||
},
|
||||
|
||||
pointerX: function(event) {
|
||||
return event.pageX || (event.clientX +
|
||||
(document.documentElement.scrollLeft || document.body.scrollLeft));
|
||||
},
|
||||
|
||||
pointerY: function(event) {
|
||||
return event.pageY || (event.clientY +
|
||||
(document.documentElement.scrollTop || document.body.scrollTop));
|
||||
},
|
||||
|
||||
stop: function(event) {
|
||||
if (event.preventDefault) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
} else {
|
||||
event.returnValue = false;
|
||||
event.cancelBubble = true;
|
||||
}
|
||||
},
|
||||
|
||||
// find the first node with the given tagName, starting from the
|
||||
// node the event was triggered on; traverses the DOM upwards
|
||||
findElement: function(event, tagName) {
|
||||
var element = OpenLayers.Event.element(event);
|
||||
while (element.parentNode && (!element.tagName ||
|
||||
(element.tagName.toUpperCase() != tagName.toUpperCase())))
|
||||
element = element.parentNode;
|
||||
return element;
|
||||
},
|
||||
|
||||
observers: false,
|
||||
|
||||
_observeAndCache: function(element, name, observer, useCapture) {
|
||||
if (!this.observers) this.observers = [];
|
||||
if (element.addEventListener) {
|
||||
this.observers.push([element, name, observer, useCapture]);
|
||||
element.addEventListener(name, observer, useCapture);
|
||||
} else if (element.attachEvent) {
|
||||
this.observers.push([element, name, observer, useCapture]);
|
||||
element.attachEvent('on' + name, observer);
|
||||
}
|
||||
},
|
||||
|
||||
unloadCache: function() {
|
||||
if (!OpenLayers.Event.observers) return;
|
||||
for (var i = 0; i < OpenLayers.Event.observers.length; i++) {
|
||||
OpenLayers.Event.stopObserving.apply(this, OpenLayers.Event.observers[i]);
|
||||
OpenLayers.Event.observers[i][0] = null;
|
||||
}
|
||||
OpenLayers.Event.observers = false;
|
||||
},
|
||||
|
||||
observe: function(elementParam, name, observer, useCapture) {
|
||||
var element = $(elementParam);
|
||||
useCapture = useCapture || false;
|
||||
|
||||
if (name == 'keypress' &&
|
||||
(navigator.appVersion.match(/Konqueror|Safari|KHTML/)
|
||||
|| element.attachEvent))
|
||||
name = 'keydown';
|
||||
|
||||
this._observeAndCache(element, name, observer, useCapture);
|
||||
},
|
||||
|
||||
stopObserving: function(elementParam, name, observer, useCapture) {
|
||||
var element = $(elementParam);
|
||||
useCapture = useCapture || false;
|
||||
|
||||
if (name == 'keypress' &&
|
||||
(navigator.appVersion.match(/Konqueror|Safari|KHTML/)
|
||||
|| element.detachEvent))
|
||||
name = 'keydown';
|
||||
|
||||
if (element && element.removeEventListener) {
|
||||
element.removeEventListener(name, observer, useCapture);
|
||||
} else if (element && element.detachEvent) {
|
||||
element.detachEvent('on' + name, observer);
|
||||
}
|
||||
}
|
||||
};
|
||||
/* prevent memory leaks in IE */
|
||||
OpenLayers.Event.observe(window, 'unload', OpenLayers.Event.unloadCache, false);
|
||||
|
||||
if (window.Event) {
|
||||
OpenLayers.Util.extend(window.Event, OpenLayers.Event);
|
||||
} else {
|
||||
var Event = OpenLayers.Event;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @class
|
||||
*/
|
||||
OpenLayers.Events = Class.create();
|
||||
OpenLayers.Events = OpenLayers.Class.create();
|
||||
OpenLayers.Events.prototype = {
|
||||
|
||||
/** @final @type Array: supported events */
|
||||
@@ -29,7 +141,6 @@ OpenLayers.Events.prototype = {
|
||||
/** @type Array: list of support application events */
|
||||
eventTypes: null,
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*
|
||||
@@ -37,11 +148,14 @@ OpenLayers.Events.prototype = {
|
||||
* is being added
|
||||
* @param {DOMElement} element A dom element to respond to browser events
|
||||
* @param {Array} eventTypes Array of custom application events
|
||||
* @param {Boolean} fallThrough Allow events to fall through after these
|
||||
* have been handled?
|
||||
*/
|
||||
initialize: function (object, element, eventTypes) {
|
||||
initialize: function (object, element, eventTypes, fallThrough) {
|
||||
this.object = object;
|
||||
this.element = element;
|
||||
this.eventTypes = eventTypes;
|
||||
this.fallThrough = fallThrough;
|
||||
this.listeners = new Object();
|
||||
|
||||
// if eventTypes is specified, create a listeners list for each
|
||||
@@ -69,11 +183,11 @@ OpenLayers.Events.prototype = {
|
||||
this.listeners[eventType] = new Array();
|
||||
|
||||
// use Prototype to register the event cross-browser
|
||||
Event.observe(element, eventType,
|
||||
OpenLayers.Event.observe(element, eventType,
|
||||
this.handleBrowserEvent.bindAsEventListener(this));
|
||||
}
|
||||
// disable dragstart in IE so that mousedown/move/up works normally
|
||||
Event.observe(element, "dragstart", Event.stop);
|
||||
OpenLayers.Event.observe(element, "dragstart", OpenLayers.Event.stop);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -159,8 +273,7 @@ OpenLayers.Events.prototype = {
|
||||
|
||||
// execute all callbacks registered for specified type
|
||||
var listeners = this.listeners[type];
|
||||
if (listeners != null) {
|
||||
|
||||
if ((listeners != null) && (listeners.length > 0)) {
|
||||
for (var i = 0; i < listeners.length; i++) {
|
||||
var callback = listeners[i];
|
||||
var continueChain;
|
||||
@@ -176,6 +289,10 @@ OpenLayers.Events.prototype = {
|
||||
break;
|
||||
}
|
||||
}
|
||||
// don't fall through to other DOM elements
|
||||
if (!this.fallThrough) {
|
||||
OpenLayers.Util.safeStopPropagation(evt);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -202,11 +319,18 @@ OpenLayers.Events.prototype = {
|
||||
*/
|
||||
getMousePosition: function (evt) {
|
||||
if (!this.element.offsets) {
|
||||
this.element.offsets = Position.page(this.element);
|
||||
this.element.offsets = OpenLayers.Util.pagePosition(this.element);
|
||||
this.element.offsets[0] += (document.documentElement.scrollLeft
|
||||
|| document.body.scrollLeft);
|
||||
this.element.offsets[1] += (document.documentElement.scrollTop
|
||||
|| document.body.scrollTop);
|
||||
}
|
||||
return new OpenLayers.Pixel(
|
||||
evt.clientX - this.element.offsets[0],
|
||||
evt.clientY - this.element.offsets[1]);
|
||||
(evt.clientX + (document.documentElement.scrollLeft
|
||||
|| document.body.scrollLeft)) - this.element.offsets[0],
|
||||
(evt.clientY + (document.documentElement.scrollTop
|
||||
|| document.body.scrollTop)) - this.element.offsets[1]
|
||||
);
|
||||
},
|
||||
|
||||
/** @final @type String */
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
|
||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
|
||||
* text of the license. */
|
||||
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
|
||||
* for the full text of the license. */
|
||||
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* @requires OpenLayers/Util.js
|
||||
*/
|
||||
OpenLayers.Feature = Class.create();
|
||||
OpenLayers.Feature = OpenLayers.Class.create();
|
||||
OpenLayers.Feature.prototype= {
|
||||
|
||||
/** @type OpenLayers.Events */
|
||||
@@ -42,7 +43,7 @@ OpenLayers.Feature.prototype= {
|
||||
this.layer = layer;
|
||||
this.lonlat = lonlat;
|
||||
this.data = (data != null) ? data : new Object();
|
||||
this.id = OpenLayers.Util.createUniqueID('Feature_');
|
||||
this.id = OpenLayers.Util.createUniqueID(this.CLASS_NAME + "_");
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -63,20 +64,38 @@ OpenLayers.Feature.prototype= {
|
||||
this.lonlat = null;
|
||||
this.data = null;
|
||||
if (this.marker != null) {
|
||||
this.marker.destroy();
|
||||
this.destroyMarker(this.marker);
|
||||
this.marker = null;
|
||||
}
|
||||
if (this.popup != null) {
|
||||
this.popup.destroy();
|
||||
this.destroyPopup(this.popup);
|
||||
this.popup = null;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @returns Whether or not the feature is currently visible on screen
|
||||
* (based on its 'lonlat' property)
|
||||
* @type Boolean
|
||||
*/
|
||||
onScreen:function() {
|
||||
|
||||
var onScreen = false;
|
||||
if ((this.layer != null) && (this.layer.map != null)) {
|
||||
var screenBounds = this.layer.map.getExtent();
|
||||
onScreen = screenBounds.containsLonLat(this.lonlat);
|
||||
}
|
||||
return onScreen;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* @returns A Marker Object created from the 'lonlat' and 'icon' properties
|
||||
* set in this.data. If no 'lonlat' is set, returns null. If no
|
||||
* 'icon' is set, OpenLayers.Marker() will load the default image
|
||||
* 'icon' is set, OpenLayers.Marker() will load the default image.
|
||||
*
|
||||
* Note: this.marker is set to return value
|
||||
*
|
||||
* @type OpenLayers.Marker
|
||||
*/
|
||||
createMarker: function() {
|
||||
@@ -89,8 +108,24 @@ OpenLayers.Feature.prototype= {
|
||||
return this.marker;
|
||||
},
|
||||
|
||||
/** If user overrides the createMarker() function, s/he should be able
|
||||
* to also specify an alternative function for destroying it
|
||||
*/
|
||||
destroyMarker: function() {
|
||||
this.marker.destroy();
|
||||
},
|
||||
|
||||
/**
|
||||
* @returns A Popup Object created from the 'lonlat', 'popupSize',
|
||||
* and 'popupContentHTML' properties set in this.data. It uses
|
||||
* this.marker.icon as default anchor.
|
||||
*
|
||||
* If no 'lonlat' is set, returns null.
|
||||
* If no this.marker has been created, no anchor is sent.
|
||||
*
|
||||
* Note: this.popup is set to return value
|
||||
*
|
||||
* @type OpenLayers.Popup.AnchoredBubble
|
||||
*/
|
||||
createPopup: function() {
|
||||
|
||||
@@ -108,5 +143,13 @@ OpenLayers.Feature.prototype= {
|
||||
return this.popup;
|
||||
},
|
||||
|
||||
|
||||
/** As with the marker, if user overrides the createPopup() function, s/he
|
||||
* should also be able to override the destruction
|
||||
*/
|
||||
destroyPopup: function() {
|
||||
this.popup.destroy()
|
||||
},
|
||||
|
||||
CLASS_NAME: "OpenLayers.Feature"
|
||||
};
|
||||
|
||||
@@ -1,67 +1,62 @@
|
||||
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
|
||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
|
||||
* text of the license. */
|
||||
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
|
||||
* for the full text of the license. */
|
||||
|
||||
/**
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
*
|
||||
* @requires OpenLayers/Feature.js
|
||||
*/
|
||||
OpenLayers.Feature.WFS = Class.create();
|
||||
OpenLayers.Feature.WFS.prototype =
|
||||
Object.extend( new OpenLayers.Feature(), {
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*
|
||||
* @param {OpenLayers.Layer} layer
|
||||
* @param {XMLNode} xmlNode
|
||||
*/
|
||||
initialize: function(layer, xmlNode) {
|
||||
var newArguments = arguments;
|
||||
if (arguments.length > 0) {
|
||||
var data = this.processXMLNode(xmlNode);
|
||||
newArguments = new Array(layer, data.lonlat, data)
|
||||
}
|
||||
OpenLayers.Feature.prototype.initialize.apply(this, newArguments);
|
||||
|
||||
if (arguments.length > 0) {
|
||||
this.createMarker();
|
||||
this.layer.addMarker(this.marker);
|
||||
}
|
||||
},
|
||||
|
||||
destroy: function() {
|
||||
if (this.marker != null) {
|
||||
this.layer.removeMarker(this.marker);
|
||||
}
|
||||
OpenLayers.Feature.prototype.destroy.apply(this, arguments);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {XMLNode} xmlNode
|
||||
*
|
||||
* @returns Data Object with 'id', 'lonlat', and private properties set
|
||||
* @type Object
|
||||
*/
|
||||
processXMLNode: function(xmlNode) {
|
||||
//this should be overridden by subclasses
|
||||
// must return an Object with 'id' and 'lonlat' values set
|
||||
var point = xmlNode.getElementsByTagName("Point");
|
||||
var text = OpenLayers.Util.getXmlNodeValue(point[0]);
|
||||
var floats = text.split(",");
|
||||
*/
|
||||
OpenLayers.Feature.WFS = OpenLayers.Class.create();
|
||||
OpenLayers.Feature.WFS.prototype =
|
||||
OpenLayers.Class.inherit( OpenLayers.Feature, {
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*
|
||||
* @param {OpenLayers.Layer} layer
|
||||
* @param {XMLNode} xmlNode
|
||||
*/
|
||||
initialize: function(layer, xmlNode) {
|
||||
var newArguments = arguments;
|
||||
var data = this.processXMLNode(xmlNode);
|
||||
newArguments = new Array(layer, data.lonlat, data)
|
||||
OpenLayers.Feature.prototype.initialize.apply(this, newArguments);
|
||||
this.createMarker();
|
||||
this.layer.addMarker(this.marker);
|
||||
},
|
||||
|
||||
destroy: function() {
|
||||
if (this.marker != null) {
|
||||
this.layer.removeMarker(this.marker);
|
||||
}
|
||||
OpenLayers.Feature.prototype.destroy.apply(this, arguments);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {XMLNode} xmlNode
|
||||
*
|
||||
* @returns Data Object with 'id', 'lonlat', and private properties set
|
||||
* @type Object
|
||||
*/
|
||||
processXMLNode: function(xmlNode) {
|
||||
//this should be overridden by subclasses
|
||||
// must return an Object with 'id' and 'lonlat' values set
|
||||
var point = OpenLayers.Ajax.getElementsByTagNameNS(xmlNode, "http://www.opengis.net/gml", "gml", "Point");
|
||||
var text = OpenLayers.Util.getXmlNodeValue(OpenLayers.Ajax.getElementsByTagNameNS(point[0], "http://www.opengis.net/gml","gml", "coordinates")[0]);
|
||||
var floats = text.split(",");
|
||||
return {lonlat: new OpenLayers.LonLat(parseFloat(floats[0]),
|
||||
parseFloat(floats[1])),
|
||||
id: null};
|
||||
|
||||
},
|
||||
|
||||
/** @final @type String */
|
||||
CLASS_NAME: "OpenLayers.Feature.WFS"
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
|
||||
/** @final @type String */
|
||||
CLASS_NAME: "OpenLayers.Feature.WFS"
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
|
||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
|
||||
* text of the license. */
|
||||
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
|
||||
* for the full text of the license. */
|
||||
|
||||
|
||||
/**
|
||||
* @class
|
||||
*/
|
||||
OpenLayers.Icon = Class.create();
|
||||
OpenLayers.Icon = OpenLayers.Class.create();
|
||||
OpenLayers.Icon.prototype = {
|
||||
|
||||
/** image url
|
||||
@@ -39,8 +40,12 @@ OpenLayers.Icon.prototype = {
|
||||
initialize: function(url, size, offset, calculateOffset) {
|
||||
this.url = url;
|
||||
this.size = (size) ? size : new OpenLayers.Size(20,20);
|
||||
this.offset = (offset) ? offset : new OpenLayers.Pixel(0,0);
|
||||
this.calculateOffset = calculateOffset;
|
||||
this.offset = offset;
|
||||
this.calculateOffset = (calculateOffset) ? calculateOffset
|
||||
: function(size) {
|
||||
return new OpenLayers.Pixel(-(size.w/2),
|
||||
-(size.h/2));
|
||||
};
|
||||
|
||||
this.imageDiv = OpenLayers.Util.createAlphaImageDiv();
|
||||
},
|
||||
@@ -87,6 +92,16 @@ OpenLayers.Icon.prototype = {
|
||||
return this.imageDiv;
|
||||
},
|
||||
|
||||
|
||||
/** Change the icon's opacity
|
||||
* @param {float} opacity
|
||||
*/
|
||||
setOpacity: function(opacity) {
|
||||
OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv, null, null, null,
|
||||
null, null, null, null, opacity);
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Pixel} px
|
||||
*/
|
||||
@@ -120,4 +135,4 @@ OpenLayers.Icon.prototype = {
|
||||
|
||||
/** @final @type String */
|
||||
CLASS_NAME: "OpenLayers.Icon"
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
|
||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
|
||||
* text of the license. */
|
||||
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
|
||||
* for the full text of the license. */
|
||||
|
||||
|
||||
/**
|
||||
* @class
|
||||
*/
|
||||
OpenLayers.Layer = Class.create();
|
||||
OpenLayers.Layer = OpenLayers.Class.create();
|
||||
OpenLayers.Layer.prototype = {
|
||||
|
||||
/** @type String */
|
||||
@@ -36,6 +37,25 @@ OpenLayers.Layer.prototype = {
|
||||
* @type boolean */
|
||||
alpha: false,
|
||||
|
||||
/** should the layer's name appear in the layer switcher?
|
||||
*
|
||||
* @type boolean */
|
||||
displayInLayerSwitcher: true,
|
||||
|
||||
/** Whether or not the layer should be displayed in the map
|
||||
*
|
||||
* @type Boolean
|
||||
*/
|
||||
visibility: true,
|
||||
|
||||
/** Whether or not the map's current resolution is within this layer's
|
||||
* min/max range -- this is set in map's setCenter() whenever zoom
|
||||
* changes
|
||||
*
|
||||
* @type Boolean
|
||||
*/
|
||||
inRange: false,
|
||||
|
||||
// OPTIONS
|
||||
|
||||
/** @type Array */
|
||||
@@ -43,27 +63,40 @@ OpenLayers.Layer.prototype = {
|
||||
|
||||
/** @type String */
|
||||
projection: null,
|
||||
|
||||
|
||||
/** @type String */
|
||||
units: null,
|
||||
|
||||
/** @type Array */
|
||||
scales: null,
|
||||
|
||||
/** @type Array */
|
||||
resolutions: null,
|
||||
|
||||
/** @type OpenLayers.Bounds */
|
||||
maxExtent: null,
|
||||
|
||||
/** @type OpenLayers.Bounds */
|
||||
minExtent: null,
|
||||
|
||||
/** @type float */
|
||||
maxResolution: null,
|
||||
|
||||
/** @type float */
|
||||
minResolution: null,
|
||||
|
||||
/** @type int */
|
||||
minZoomLevel: null,
|
||||
|
||||
/** @type int */
|
||||
maxZoomLevel: null,
|
||||
numZoomLevels: null,
|
||||
|
||||
/** @type float */
|
||||
minScale: null,
|
||||
|
||||
/** @type float */
|
||||
maxScale: null,
|
||||
|
||||
/** @type Boolean */
|
||||
displayOutsideMaxExtent: false,
|
||||
|
||||
/** @type String */
|
||||
units: null,
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
@@ -72,24 +105,21 @@ OpenLayers.Layer.prototype = {
|
||||
* @param {Object} options Hashtable of extra options to tag onto the layer
|
||||
*/
|
||||
initialize: function(name, options) {
|
||||
if (arguments.length > 0) {
|
||||
//store a copy of the custom options for later cloning
|
||||
this.options = OpenLayers.Util.extend(new Object(), options);
|
||||
|
||||
//add options to layer
|
||||
OpenLayers.Util.extend(this, this.options);
|
||||
|
||||
//store a copy of the custom options for later cloning
|
||||
this.options = Object.extend(new Object(), options);
|
||||
|
||||
//add options to layer
|
||||
Object.extend(this, this.options);
|
||||
|
||||
this.name = name;
|
||||
|
||||
//generate unique id based on name
|
||||
this.id = OpenLayers.Util.createUniqueID("Layer_");
|
||||
|
||||
if (this.div == null) {
|
||||
this.div = OpenLayers.Util.createDiv();
|
||||
this.div.style.width = "100%";
|
||||
this.div.style.height = "100%";
|
||||
}
|
||||
this.name = name;
|
||||
|
||||
this.id = OpenLayers.Util.createUniqueID(this.CLASS_NAME + "_");
|
||||
|
||||
if (this.div == null) {
|
||||
this.div = OpenLayers.Util.createDiv();
|
||||
this.div.style.width = "100%";
|
||||
this.div.style.height = "100%";
|
||||
this.div.id = this.id;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -142,66 +172,87 @@ OpenLayers.Layer.prototype = {
|
||||
addOptions: function (newOptions) {
|
||||
|
||||
// update our copy for clone
|
||||
Object.extend(this.options, newOptions);
|
||||
OpenLayers.Util.extend(this.options, newOptions);
|
||||
|
||||
// add new options to this
|
||||
Object.extend(this, this.options);
|
||||
OpenLayers.Util.extend(this, newOptions);
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
onMapResize: function() {
|
||||
//this function can be implemented by subclasses
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Bounds} bound
|
||||
* @param {Boolean} zoomChanged tells when zoom has changed, as layers
|
||||
* have to do some init work in that case.
|
||||
* @param {Boolean} minor
|
||||
* @param {Boolean} dragging
|
||||
*/
|
||||
moveTo:function(bounds, zoomChanged, minor) {
|
||||
//this function can be implemented by subclasses.
|
||||
moveTo:function(bounds, zoomChanged, dragging) {
|
||||
var display = this.visibility;
|
||||
if (!this.isBaseLayer) {
|
||||
display = display && this.inRange;
|
||||
}
|
||||
this.display(display);
|
||||
},
|
||||
|
||||
/** Set the map property for the layer. This is done through an accessor
|
||||
* so that subclasses can override this and take special action once
|
||||
* they have their map variable set.
|
||||
*
|
||||
* Here we take care to bring over any of the necessary default properties
|
||||
* from the map.
|
||||
*
|
||||
* @param {OpenLayers.Map} map
|
||||
*/
|
||||
setMap: function(map) {
|
||||
this.map = map;
|
||||
|
||||
var properties = new Array(
|
||||
'projection', 'minExtent', 'maxExtent',
|
||||
'minScale', 'maxScale',
|
||||
'maxResolution', 'minResolution',
|
||||
'minZoomLevel', 'maxZoomLevel', 'units',
|
||||
'scales', 'resolutions'
|
||||
|
||||
);
|
||||
for(var i=0; i < properties.length; i++) {
|
||||
if (this[properties[i]] == null) {
|
||||
this[properties[i]] = this.map[properties[i]];
|
||||
}
|
||||
}
|
||||
// grab some essential layer data from the map if it hasn't already
|
||||
// been set
|
||||
this.maxExtent = this.maxExtent || this.map.maxExtent;
|
||||
this.projection = this.projection || this.map.projection;
|
||||
this.units = this.units || this.map.units;
|
||||
|
||||
this.initResolutions();
|
||||
|
||||
if (!this.isBaseLayer) {
|
||||
this.inRange = this.calculateInRange();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @returns Whether or not the layer is visible
|
||||
* @returns Whether or not the layer should be displayed (if in range)
|
||||
* @type Boolean
|
||||
*/
|
||||
getVisibility: function() {
|
||||
return (this.div.style.display != "none");
|
||||
return this.visibility;
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {Boolean} visible
|
||||
/** Set the visibility flag for the layer and hide/show&redraw accordingly.
|
||||
* Fire event unless otherwise specified
|
||||
*
|
||||
* Note that visibility is no longer simply whether or not the layer's
|
||||
* style.display is set to "block". Now we store a 'visibility' state
|
||||
* property on the layer class, this allows us to remember whether or not
|
||||
* we *desire* for a layer to be visible. In the case where the map's
|
||||
* resolution is out of the layer's range, this desire may be subverted.
|
||||
*
|
||||
* @param {Boolean} visible Whether or not to display the layer
|
||||
* (if in range)
|
||||
* @param {Boolean} noEvent
|
||||
*/
|
||||
setVisibility: function(visible, noEvent) {
|
||||
if (visible != this.getVisibility()) {
|
||||
this.div.style.display = (visible) ? "block" : "none";
|
||||
if ((visible) && (this.map != null)) {
|
||||
setVisibility: function(visibility, noEvent) {
|
||||
if (visibility != this.visibility) {
|
||||
this.visibility = visibility;
|
||||
this.display(visibility);
|
||||
if (this.map != null) {
|
||||
var extent = this.map.getExtent();
|
||||
if (extent != null) {
|
||||
this.moveTo(this.map.getExtent());
|
||||
this.moveTo(extent, true);
|
||||
}
|
||||
}
|
||||
if ((this.map != null) &&
|
||||
@@ -210,148 +261,302 @@ OpenLayers.Layer.prototype = {
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/********************************************************/
|
||||
/* */
|
||||
/* Layer Options */
|
||||
/* */
|
||||
/* Accessor functions to Layer Options parameters */
|
||||
/* */
|
||||
/********************************************************/
|
||||
|
||||
/**
|
||||
* @type String
|
||||
|
||||
/** Hide or show the Layer
|
||||
*
|
||||
* @param {Boolean} display
|
||||
*/
|
||||
getProjection: function() {
|
||||
return this.projection;
|
||||
},
|
||||
|
||||
display: function(display) {
|
||||
if (display != (this.div.style.display != "none")) {
|
||||
this.div.style.display = (display) ? "block" : "none";
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @type OpenLayers.Bounds
|
||||
* @returns Whether or not the layer is displayable at the current map's
|
||||
* current resolution
|
||||
* @type Boolean
|
||||
*/
|
||||
getMaxExtent: function() {
|
||||
return this.maxExtent;
|
||||
},
|
||||
calculateInRange: function() {
|
||||
var inRange = false;
|
||||
if (this.map) {
|
||||
var resolution = this.map.getResolution();
|
||||
inRange = ( (resolution >= this.minResolution) &&
|
||||
(resolution <= this.maxResolution) );
|
||||
}
|
||||
return inRange;
|
||||
},
|
||||
|
||||
/**
|
||||
* @type float
|
||||
* @param {Boolean} isBaseLayer
|
||||
*/
|
||||
getMaxResolution: function() {
|
||||
return this.maxResolution;
|
||||
},
|
||||
|
||||
/**
|
||||
* @returns The minimum zoom level that can be reached in this layer
|
||||
* @type int
|
||||
*/
|
||||
getMinZoomLevel: function() {
|
||||
return this.minZoomLevel;
|
||||
},
|
||||
|
||||
/**
|
||||
* @returns The maximum zoom level that can be reached in this layer
|
||||
* @type int
|
||||
*/
|
||||
getMaxZoomLevel: function() {
|
||||
return this.maxZoomLevel;
|
||||
setIsBaseLayer: function(isBaseLayer) {
|
||||
this.isBaseLayer = isBaseLayer;
|
||||
if (this.map != null) {
|
||||
this.map.events.triggerEvent("changelayer");
|
||||
}
|
||||
},
|
||||
|
||||
/********************************************************/
|
||||
/* */
|
||||
/* Baselayer Functions */
|
||||
/* */
|
||||
/* The following functions must all be implemented */
|
||||
/* by all base layers */
|
||||
/* */
|
||||
/********************************************************/
|
||||
|
||||
/**
|
||||
* @returns Degrees per Pixel
|
||||
|
||||
/** This method's responsibility is to set up the 'resolutions' array
|
||||
* for the layer -- this array is what the layer will use to interface
|
||||
* between the zoom levels of the map and the resolution display of the
|
||||
* layer.
|
||||
*
|
||||
* The user has several options that determine how the array is set up.
|
||||
*
|
||||
* For a detailed explanation, see the following wiki from the
|
||||
* openlayers.org homepage:
|
||||
*
|
||||
* http://trac.openlayers.org/wiki/SettingZoomLevels
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
initResolutions: function() {
|
||||
|
||||
// These are the relevant options which are used for calculating
|
||||
// resolutions information.
|
||||
//
|
||||
var props = new Array(
|
||||
'projection', 'units',
|
||||
'scales', 'resolutions',
|
||||
'maxScale', 'minScale',
|
||||
'maxResolution', 'minResolution',
|
||||
'minExtent', 'maxExtent',
|
||||
'numZoomLevels', 'maxZoomLevel'
|
||||
);
|
||||
|
||||
// First we create a new object where we will store all of the
|
||||
// resolution-related properties that we find in either the layer's
|
||||
// 'options' array or from the map.
|
||||
//
|
||||
var confProps = new Object();
|
||||
for(var i=0; i < props.length; i++) {
|
||||
var property = props[i];
|
||||
confProps[property] = this.options[property] || this.map[property];
|
||||
}
|
||||
|
||||
// If numZoomLevels hasn't been set and the maxZoomLevel *has*,
|
||||
// then use maxZoomLevel to calculate numZoomLevels
|
||||
//
|
||||
if ( (!confProps.numZoomLevels) && (confProps.maxZoomLevel) ) {
|
||||
confProps.numZoomLevels = confProps.maxZoomLevel + 1;
|
||||
}
|
||||
|
||||
// First off, we take whatever hodge-podge of values we have and
|
||||
// calculate/distill them down into a resolutions[] array
|
||||
//
|
||||
if ((confProps.scales != null) || (confProps.resolutions != null)) {
|
||||
//preset levels
|
||||
if (confProps.scales != null) {
|
||||
confProps.resolutions = new Array();
|
||||
for(var i = 0; i < confProps.scales.length; i++) {
|
||||
var scale = confProps.scales[i];
|
||||
confProps.resolutions[i] =
|
||||
OpenLayers.Util.getResolutionFromScale(scale,
|
||||
confProps.units);
|
||||
}
|
||||
}
|
||||
confProps.numZoomLevels = confProps.resolutions.length;
|
||||
|
||||
} else {
|
||||
//maxResolution and numZoomLevels based calculation
|
||||
|
||||
confProps.resolutions = new Array();
|
||||
|
||||
// determine maxResolution
|
||||
if (confProps.minScale) {
|
||||
confProps.maxResolution =
|
||||
OpenLayers.Util.getResolutionFromScale(confProps.minScale,
|
||||
confProps.units);
|
||||
} else if (confProps.maxResolution == "auto") {
|
||||
var viewSize = this.map.getSize();
|
||||
var wRes = confProps.maxExtent.getWidth() / viewSize.w;
|
||||
var hRes = confProps.maxExtent.getHeight()/ viewSize.h;
|
||||
confProps.maxResolution = Math.max(wRes, hRes);
|
||||
}
|
||||
|
||||
// determine minResolution
|
||||
if (confProps.maxScale != null) {
|
||||
confProps.minResolution =
|
||||
OpenLayers.Util.getResolutionFromScale(confProps.maxScale);
|
||||
} else if ( (confProps.minResolution == "auto") &&
|
||||
(confProps.minExtent != null) ) {
|
||||
var viewSize = this.map.getSize();
|
||||
var wRes = confProps.minExtent.getWidth() / viewSize.w;
|
||||
var hRes = confProps.minExtent.getHeight()/ viewSize.h;
|
||||
confProps.minResolution = Math.max(wRes, hRes);
|
||||
}
|
||||
|
||||
// determine numZoomLevels
|
||||
if (confProps.minResolution != null) {
|
||||
var ratio = confProps.maxResolution / confProps.minResolution;
|
||||
confProps.numZoomLevels =
|
||||
Math.floor(Math.log(ratio) / Math.log(2)) + 1;
|
||||
}
|
||||
|
||||
// now we have numZoomLevels and maxResolution,
|
||||
// we can populate the resolutions array
|
||||
for (var i=0; i < confProps.numZoomLevels; i++) {
|
||||
var res = confProps.maxResolution / Math.pow(2, i)
|
||||
confProps.resolutions.push(res);
|
||||
}
|
||||
}
|
||||
|
||||
//sort resolutions array ascendingly
|
||||
//
|
||||
confProps.resolutions.sort( function(a, b) { return(b-a); } );
|
||||
|
||||
// now set our newly calculated values back to the layer
|
||||
// Note: We specifically do *not* set them to layer.options, which we
|
||||
// will preserve as it was when we added this layer to the map.
|
||||
// this way cloned layers reset themselves to new map div
|
||||
// dimensions)
|
||||
//
|
||||
|
||||
this.resolutions = confProps.resolutions;
|
||||
this.maxResolution = confProps.resolutions[0];
|
||||
var lastIndex = confProps.resolutions.length - 1;
|
||||
this.minResolution = confProps.resolutions[lastIndex];
|
||||
|
||||
this.scales = new Array();
|
||||
for(var i = 0; i < confProps.resolutions.length; i++) {
|
||||
this.scales[i] =
|
||||
OpenLayers.Util.getScaleFromResolution(confProps.resolutions[i],
|
||||
confProps.units);
|
||||
}
|
||||
this.minScale = this.scales[0];
|
||||
this.maxScale = this.scales[this.scales.length - 1];
|
||||
|
||||
this.numZoomLevels = confProps.numZoomLevels;
|
||||
},
|
||||
|
||||
/**
|
||||
* @returns The currently selected resolution of the map, taken from the
|
||||
* resolutions array, indexed by current zoom level.
|
||||
* @type float
|
||||
*/
|
||||
getResolution: function() {
|
||||
var viewSize = this.map.getSize();
|
||||
var extent = this.map.getExtent();
|
||||
return Math.max( extent.getWidth() / viewSize.w,
|
||||
extent.getHeight() / viewSize.h );
|
||||
var zoom = this.map.getZoom();
|
||||
return this.resolutions[zoom];
|
||||
},
|
||||
|
||||
/** Calculates using px-> lonlat translation functions on tl and br
|
||||
* corners of viewport
|
||||
*
|
||||
|
||||
/**
|
||||
* @returns A Bounds object which represents the lon/lat bounds of the
|
||||
* current viewPort.
|
||||
* @type OpenLayers.Bounds
|
||||
*/
|
||||
getExtent: function () {
|
||||
var extent = null;
|
||||
|
||||
|
||||
var size = this.map.getSize();
|
||||
|
||||
var tlPx = new OpenLayers.Pixel(0,0);
|
||||
var tlLL = this.getLonLatFromViewPortPx(tlPx);
|
||||
getExtent: function() {
|
||||
// just use stock map calculateBounds function -- passing no arguments
|
||||
// means it will user map's current center & resolution
|
||||
//
|
||||
return this.map.calculateBounds();
|
||||
},
|
||||
|
||||
var brPx = new OpenLayers.Pixel(size.w, size.h);
|
||||
var brLL = this.getLonLatFromViewPortPx(brPx);
|
||||
/**
|
||||
* @param {OpenLayers.Bounds} bounds
|
||||
*
|
||||
* @returns The index of the zoomLevel (entry in the resolutions array)
|
||||
* that still contains the passed-in extent. We do this by
|
||||
* calculating the ideal resolution for the given exteng (based
|
||||
* on the map size) and then find the smallest resolution that
|
||||
* is greater than this ideal resolution.
|
||||
* @type int
|
||||
*/
|
||||
getZoomForExtent: function(extent) {
|
||||
var viewSize = this.map.getSize();
|
||||
var idealResolution = Math.max( extent.getWidth() / viewSize.w,
|
||||
extent.getHeight() / viewSize.h );
|
||||
|
||||
return this.getZoomForResolution(idealResolution);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {float} resolution
|
||||
*
|
||||
* @returns The index of the zoomLevel (entry in the resolutions array)
|
||||
* that is the smallest resolution that is greater than the
|
||||
* passed-in resolution.
|
||||
* @type int
|
||||
*/
|
||||
getZoomForResolution: function(resolution) {
|
||||
|
||||
if ((tlLL != null) && (brLL != null)) {
|
||||
extent = new OpenLayers.Bounds(tlLL.lon,
|
||||
brLL.lat,
|
||||
brLL.lon,
|
||||
tlLL.lat);
|
||||
for(var i=1; i < this.resolutions.length; i++) {
|
||||
if ( this.resolutions[i] < resolution) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return extent;
|
||||
return (i - 1);
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Pixel} viewPortPx
|
||||
*
|
||||
* @returns An OpenLayers.LonLat which is the passed-in view port
|
||||
* OpenLayers.Pixel, translated into lon/lat by the layer
|
||||
* @type OpenLayers.LonLat
|
||||
*/
|
||||
* @param {OpenLayers.Pixel} viewPortPx
|
||||
*
|
||||
* @returns An OpenLayers.LonLat which is the passed-in view port
|
||||
* OpenLayers.Pixel, translated into lon/lat by the layer
|
||||
* @type OpenLayers.LonLat
|
||||
*/
|
||||
getLonLatFromViewPortPx: function (viewPortPx) {
|
||||
var size = this.map.getSize();
|
||||
var center = this.map.getCenter(); //map center lon/lat
|
||||
var res = this.map.getResolution();
|
||||
|
||||
var delta_x = viewPortPx.x - (size.w / 2);
|
||||
var delta_y = viewPortPx.y - (size.h / 2);
|
||||
var lonlat = null;
|
||||
if (viewPortPx != null) {
|
||||
var size = this.map.getSize();
|
||||
var center = this.map.getCenter();
|
||||
var res = this.map.getResolution();
|
||||
|
||||
return new OpenLayers.LonLat(center.lon + delta_x * res ,
|
||||
center.lat - delta_y * res);
|
||||
var delta_x = viewPortPx.x - Math.ceil(size.w / 2);
|
||||
var delta_y = viewPortPx.y - Math.ceil(size.h / 2);
|
||||
|
||||
lonlat = new OpenLayers.LonLat(center.lon + delta_x * res ,
|
||||
center.lat - delta_y * res);
|
||||
}
|
||||
return lonlat;
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.LonLat} lonlat
|
||||
*
|
||||
* @returns An OpenLayers.Pixel which is the passed-in OpenLayers.LonLat,
|
||||
* translated into view port pixels
|
||||
* @type OpenLayers.Pixel
|
||||
*/
|
||||
* @param {OpenLayers.LonLat} lonlat
|
||||
*
|
||||
* @returns An OpenLayers.Pixel which is the passed-in OpenLayers.LonLat,
|
||||
* translated into view port pixels
|
||||
* @type OpenLayers.Pixel
|
||||
*/
|
||||
getViewPortPxFromLonLat: function (lonlat) {
|
||||
var resolution = this.map.getResolution();
|
||||
var extent = this.map.getExtent();
|
||||
return new OpenLayers.Pixel(
|
||||
Math.round(1/resolution * (lonlat.lon - extent.left)),
|
||||
Math.round(1/resolution * (extent.top - lonlat.lat))
|
||||
);
|
||||
var px = null;
|
||||
if (lonlat != null) {
|
||||
var resolution = this.map.getResolution();
|
||||
var extent = this.map.getExtent();
|
||||
px = new OpenLayers.Pixel(
|
||||
Math.round(1/resolution * (lonlat.lon - extent.left)),
|
||||
Math.round(1/resolution * (extent.top - lonlat.lat))
|
||||
);
|
||||
}
|
||||
return px;
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Bounds} bounds
|
||||
*
|
||||
* @return {int}
|
||||
*/
|
||||
getZoomForExtent: function (bounds) {
|
||||
// this should be implemented by subclasses
|
||||
* Sets the opacity for the entire layer (all images)
|
||||
* @param {Float} opacity
|
||||
*/
|
||||
setOpacity: function(opacity) {
|
||||
this.opacity = opacity;
|
||||
for(var i=0; i<this.div.childNodes.length; ++i) {
|
||||
var element = this.div.childNodes[i];
|
||||
OpenLayers.Util.modifyDOMElement(element, null, null, null,
|
||||
null, null, null, opacity);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* @param {int} zIdx
|
||||
* @private
|
||||
*/
|
||||
setZIndex: function (zIdx) {
|
||||
this.div.style.zIndex = zIdx;
|
||||
},
|
||||
|
||||
/** @final @type String */
|
||||
CLASS_NAME: "OpenLayers.Layer"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
|
||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
|
||||
* text of the license. */
|
||||
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
|
||||
* for the full text of the license. */
|
||||
|
||||
|
||||
/**
|
||||
* @class
|
||||
@@ -8,9 +9,9 @@
|
||||
* @requires OpenLayers/Layer.js
|
||||
* @requires OpenLayers/Layer/Markers.js
|
||||
*/
|
||||
OpenLayers.Layer.Boxes = Class.create();
|
||||
OpenLayers.Layer.Boxes = OpenLayers.Class.create();
|
||||
OpenLayers.Layer.Boxes.prototype =
|
||||
Object.extend( new OpenLayers.Layer.Markers(), {
|
||||
OpenLayers.Class.inherit( OpenLayers.Layer.Markers, {
|
||||
|
||||
initialize: function () {
|
||||
OpenLayers.Layer.Markers.prototype.initialize.apply(this, arguments);
|
||||
@@ -33,7 +34,8 @@ OpenLayers.Layer.Boxes.prototype =
|
||||
marker.display(false);
|
||||
} else {
|
||||
var sz = new OpenLayers.Size(
|
||||
botright.x - topleft.x, botright.y - topleft.y);
|
||||
Math.max(1, botright.x - topleft.x),
|
||||
Math.max(1, botright.y - topleft.y));
|
||||
var markerDiv = marker.draw(topleft, sz);
|
||||
if (!marker.drawn) {
|
||||
this.div.appendChild(markerDiv);
|
||||
|
||||
120
lib/OpenLayers/Layer/Canvas.js
Normal file
@@ -0,0 +1,120 @@
|
||||
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
|
||||
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
|
||||
* for the full text of the license. */
|
||||
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* @requires OpenLayers/Layer.js
|
||||
*/
|
||||
OpenLayers.Layer.Canvas = OpenLayers.Class.create();
|
||||
OpenLayers.Layer.Canvas.prototype =
|
||||
OpenLayers.Class.inherit( OpenLayers.Layer, {
|
||||
|
||||
/** Canvas layer is never a base layer.
|
||||
*
|
||||
* @type Boolean
|
||||
*/
|
||||
isBaseLayer: false,
|
||||
isFixed: true,
|
||||
/** internal marker list
|
||||
* @type Array(OpenLayers.Marker) */
|
||||
canvas: null,
|
||||
|
||||
lines: new Array(),
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*
|
||||
* @param {String} name
|
||||
* @param {Object} options Hashtable of extra options to tag onto the layer
|
||||
*/
|
||||
initialize: function(name, options) {
|
||||
OpenLayers.Layer.prototype.initialize.apply(this, arguments);
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
destroy: function() {
|
||||
// xxx actually destroy the canvas to scavenge ram?
|
||||
canvas = null;
|
||||
OpenLayers.Layer.prototype.destroy.apply(this, arguments);
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Bounds} bounds
|
||||
* @param {Boolean} zoomChanged
|
||||
* @param {Boolean} dragging
|
||||
*/
|
||||
moveTo:function(bounds, zoomChanged, dragging) {
|
||||
OpenLayers.Layer.prototype.moveTo.apply(this, arguments);
|
||||
|
||||
this.redraw();
|
||||
},
|
||||
|
||||
setStrokeColor: function(color) {
|
||||
var ctx = this.canvas.getContext("2d");
|
||||
ctx.strokeStyle = color;
|
||||
},
|
||||
setStrokeWidth: function(width) {
|
||||
var ctx = this.canvas.getContext("2d");
|
||||
ctx.lineWidth = width;
|
||||
},
|
||||
setAlpha: function(alpha) {
|
||||
var ctx = this.canvas.getContext("2d");
|
||||
ctx.globalAlpha = alpha;
|
||||
},
|
||||
/**
|
||||
*
|
||||
*/
|
||||
clearCanvas: function() {
|
||||
if(this.canvas != null) {
|
||||
this.canvas.getContext("2d").clearRect(0,0,this.map.getSize().w, this.map.getSize().h);
|
||||
// xxx use real width and height
|
||||
}
|
||||
},
|
||||
|
||||
drawLine: function(start, end) {
|
||||
var ctx = this.canvas.getContext("2d");
|
||||
this.addLine(start, end);
|
||||
this.lines.push(new Array(start,end, ctx.strokeStyle, ctx.lineWidth, ctx.globalAlpha));
|
||||
},
|
||||
addLine: function(start, end) {
|
||||
var ctx = this.canvas.getContext("2d");
|
||||
var startpx = this.map.getPixelFromLonLat(start);
|
||||
var endpx = this.map.getPixelFromLonLat(end);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(startpx.x, startpx.y);
|
||||
ctx.lineTo(endpx.x, endpx.y);
|
||||
ctx.closePath();
|
||||
ctx.stroke();
|
||||
},
|
||||
|
||||
/** clear all the marker div's from the layer and then redraw all of them.
|
||||
* Use the map to recalculate new placement of markers.
|
||||
*/
|
||||
redraw: function() {
|
||||
// xxx rebuild the canvas if smaller than the view
|
||||
// xxx may wish to overside the canvas with overflow=hidden by default
|
||||
if(!this.canvas) {
|
||||
this.canvas = document.createElement("CANVAS");
|
||||
this.canvas.setAttribute("width",this.map.getSize().w);
|
||||
this.canvas.setAttribute("height",this.map.getSize().h);
|
||||
this.div.appendChild(this.canvas);
|
||||
} else {
|
||||
this.clearCanvas();
|
||||
}
|
||||
for(var i=0; i < this.lines.length; i++) {
|
||||
this.setStrokeColor(this.lines[i][2]);
|
||||
this.setStrokeWidth(this.lines[i][3]);
|
||||
this.setAlpha(this.lines[i][4]);
|
||||
this.addLine(this.lines[i][0], this.lines[i][1]);
|
||||
}
|
||||
},
|
||||
|
||||
/** @final @type String */
|
||||
CLASS_NAME: "OpenLayers.Layer.Canvas"
|
||||
});
|
||||
@@ -1,6 +1,7 @@
|
||||
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
|
||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
|
||||
* text of the license. */
|
||||
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
|
||||
* for the full text of the license. */
|
||||
|
||||
|
||||
/**
|
||||
* @class
|
||||
@@ -8,9 +9,9 @@
|
||||
* @requires OpenLayers/Layer.js
|
||||
* @requires OpenLayers/Util.js
|
||||
*/
|
||||
OpenLayers.Layer.EventPane = Class.create();
|
||||
OpenLayers.Layer.EventPane = OpenLayers.Class.create();
|
||||
OpenLayers.Layer.EventPane.prototype =
|
||||
Object.extend(new OpenLayers.Layer, {
|
||||
OpenLayers.Class.inherit( OpenLayers.Layer, {
|
||||
|
||||
/** EventPaned layers are always base layers, by necessity.
|
||||
*
|
||||
@@ -25,6 +26,15 @@ OpenLayers.Layer.EventPane.prototype =
|
||||
/** @type DOMElement */
|
||||
pane: null,
|
||||
|
||||
|
||||
/** This is the object which will be used to load the 3rd party library
|
||||
* in the case of the google layer, this will be of type GMap,
|
||||
* in the case of the ve layer, this will be of type VEMap
|
||||
*
|
||||
* @type Object */
|
||||
mapObject: null,
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*
|
||||
@@ -33,17 +43,20 @@ OpenLayers.Layer.EventPane.prototype =
|
||||
*/
|
||||
initialize: function(name, options) {
|
||||
OpenLayers.Layer.prototype.initialize.apply(this, arguments);
|
||||
|
||||
if (arguments.length > 0) {
|
||||
if (this.pane == null) {
|
||||
this.pane = OpenLayers.Util.createDiv();
|
||||
this.pane.style.width = "100%";
|
||||
this.pane.style.height = "100%";
|
||||
this.pane.style.backgroundColor = "transparent";
|
||||
}
|
||||
if (this.pane == null) {
|
||||
this.pane = OpenLayers.Util.createDiv(this.div.id + "_EventPane");
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
destroy: function() {
|
||||
this.mapObject = null;
|
||||
OpenLayers.Layer.prototype.destroy.apply(this, arguments);
|
||||
},
|
||||
|
||||
|
||||
/** Set the map property for the layer. This is done through an accessor
|
||||
* so that subclasses can override this and take special action once
|
||||
* they have their map variable set.
|
||||
@@ -52,26 +65,248 @@ OpenLayers.Layer.EventPane.prototype =
|
||||
*/
|
||||
setMap: function(map) {
|
||||
OpenLayers.Layer.prototype.setMap.apply(this, arguments);
|
||||
|
||||
|
||||
this.pane.style.zIndex = parseInt(this.div.style.zIndex) + 1;
|
||||
this.pane.style.display = this.div.style.display;
|
||||
this.pane.style.width="100%";
|
||||
this.pane.style.height="100%";
|
||||
if (/MSIE/.test(navigator.userAgent)) {
|
||||
this.pane.style.background = "url("+OpenLayers.Util.getImagesLocation()+"blank.gif)";
|
||||
}
|
||||
|
||||
if (this.isFixed) {
|
||||
this.map.viewPortDiv.appendChild(this.pane);
|
||||
} else {
|
||||
this.map.layerContainerDiv.appendChild(this.pane);
|
||||
}
|
||||
this.map.events.attachToElement(this.pane);
|
||||
|
||||
// once our layer has been added to the map, we can load it
|
||||
this.loadMapObject();
|
||||
|
||||
// if map didn't load, display warning
|
||||
if (this.mapObject == null) {
|
||||
this.loadWarningMessage();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {Boolean} visible
|
||||
* @param {Boolean} noEvent
|
||||
/** If we can't load the GMap, then display an error message to the
|
||||
* user and tell them where to go for help.
|
||||
*
|
||||
* @private
|
||||
*
|
||||
*/
|
||||
setVisibility: function(visible, noEvent) {
|
||||
OpenLayers.Layer.prototype.setVisibility.apply(this, arguments);
|
||||
loadWarningMessage:function() {
|
||||
|
||||
this.div.style.backgroundColor = "darkblue";
|
||||
|
||||
var viewSize = this.map.getSize();
|
||||
|
||||
msgW = Math.min(viewSize.w, 300);
|
||||
msgH = Math.min(viewSize.h, 200);
|
||||
var size = new OpenLayers.Size(msgW, msgH);
|
||||
|
||||
var centerPx = new OpenLayers.Pixel(viewSize.w/2, viewSize.h/2);
|
||||
|
||||
var topLeft = centerPx.add(-size.w/2, -size.h/2);
|
||||
|
||||
var div = OpenLayers.Util.createDiv(this.name + "_warning",
|
||||
topLeft,
|
||||
size,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
"auto");
|
||||
|
||||
div.style.padding = "7px";
|
||||
div.style.backgroundColor = "yellow";
|
||||
|
||||
div.innerHTML = this.getWarningHTML();
|
||||
this.div.appendChild(div);
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* @param {Boolean} display
|
||||
*/
|
||||
display: function(display) {
|
||||
OpenLayers.Layer.prototype.display.apply(this, arguments);
|
||||
this.pane.style.display = this.div.style.display;
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {int} zIndex
|
||||
*/
|
||||
setZIndex: function (zIndex) {
|
||||
OpenLayers.Layer.prototype.setZIndex.apply(this, arguments);
|
||||
this.pane.style.zIndex = parseInt(this.div.style.zIndex) + 1;
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Bounds} bounds
|
||||
* @param {Boolean} zoomChanged
|
||||
* @param {Boolean} dragging
|
||||
*/
|
||||
moveTo:function(bounds, zoomChanged, dragging) {
|
||||
OpenLayers.Layer.prototype.moveTo.apply(this, arguments);
|
||||
|
||||
if (this.mapObject != null) {
|
||||
|
||||
var newCenter = this.map.getCenter();
|
||||
var newZoom = this.map.getZoom();
|
||||
|
||||
if (newCenter != null) {
|
||||
|
||||
var moOldCenter = this.getMapObjectCenter();
|
||||
var oldCenter = this.getOLLonLatFromMapObjectLonLat(moOldCenter);
|
||||
|
||||
var moOldZoom = this.getMapObjectZoom();
|
||||
var oldZoom= this.getOLZoomFromMapObjectZoom(moOldZoom);
|
||||
|
||||
if ( !(newCenter.equals(oldCenter)) ||
|
||||
!(newZoom == oldZoom) ) {
|
||||
|
||||
var center = this.getMapObjectLonLatFromOLLonLat(newCenter);
|
||||
var zoom = this.getMapObjectZoomFromOLZoom(newZoom);
|
||||
this.setMapObjectCenter(center, zoom);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/********************************************************/
|
||||
/* */
|
||||
/* Baselayer Functions */
|
||||
/* */
|
||||
/********************************************************/
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Pixel} viewPortPx
|
||||
*
|
||||
* @returns An OpenLayers.LonLat which is the passed-in view port
|
||||
* OpenLayers.Pixel, translated into lon/lat by GMAPS
|
||||
* If gmap is not loaded or not centered, returns null
|
||||
* @type OpenLayers.LonLat
|
||||
*/
|
||||
getLonLatFromViewPortPx: function (viewPortPx) {
|
||||
var lonlat = null;
|
||||
if ( (this.mapObject != null) &&
|
||||
(this.getMapObjectCenter() != null) ) {
|
||||
var moPixel = this.getMapObjectPixelFromOLPixel(viewPortPx);
|
||||
var moLonLat = this.getMapObjectLonLatFromMapObjectPixel(moPixel)
|
||||
lonlat = this.getOLLonLatFromMapObjectLonLat(moLonLat);
|
||||
}
|
||||
return lonlat;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.LonLat} lonlat
|
||||
*
|
||||
* @returns An OpenLayers.Pixel which is the passed-in OpenLayers.LonLat,
|
||||
* translated into view port pixels BY GMAPS
|
||||
* If gmap is not loaded or not centered, returns null
|
||||
* @type OpenLayers.Pixel
|
||||
*/
|
||||
getViewPortPxFromLonLat: function (lonlat) {
|
||||
var viewPortPx = null;
|
||||
if ( (this.mapObject != null) &&
|
||||
(this.getMapObjectCenter() != null) ) {
|
||||
|
||||
var moLonLat = this.getMapObjectLonLatFromOLLonLat(lonlat);
|
||||
var moPixel = this.getMapObjectPixelFromMapObjectLonLat(moLonLat)
|
||||
|
||||
viewPortPx = this.getOLPixelFromMapObjectPixel(moPixel);
|
||||
}
|
||||
return viewPortPx;
|
||||
},
|
||||
|
||||
/********************************************************/
|
||||
/* */
|
||||
/* Translation Functions */
|
||||
/* */
|
||||
/* The following functions translate Map Object and */
|
||||
/* OL formats for Pixel, LonLat */
|
||||
/* */
|
||||
/********************************************************/
|
||||
|
||||
//
|
||||
// TRANSLATION: MapObject LatLng <-> OpenLayers.LonLat
|
||||
//
|
||||
|
||||
/**
|
||||
* @param {Object} moLonLat
|
||||
*
|
||||
* @returns An OpenLayers.LonLat, translated from the passed in
|
||||
* MapObject LonLat
|
||||
* Returns null if null value is passed in
|
||||
* @type OpenLayers.LonLat
|
||||
*/
|
||||
getOLLonLatFromMapObjectLonLat: function(moLonLat) {
|
||||
var olLonLat = null;
|
||||
if (moLonLat != null) {
|
||||
var lon = this.getLongitudeFromMapObjectLonLat(moLonLat);
|
||||
var lat = this.getLatitudeFromMapObjectLonLat(moLonLat);
|
||||
olLonLat = new OpenLayers.LonLat(lon, lat);
|
||||
}
|
||||
return olLonLat;
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.LonLat} olLonLat
|
||||
*
|
||||
* @returns A MapObject LonLat, translated from the passed in
|
||||
* OpenLayers.LonLat
|
||||
* Returns null if null value is passed in
|
||||
* @type Object
|
||||
*/
|
||||
getMapObjectLonLatFromOLLonLat: function(olLonLat) {
|
||||
var moLatLng = null;
|
||||
if (olLonLat != null) {
|
||||
moLatLng = this.getMapObjectLonLatFromLonLat(olLonLat.lon,
|
||||
olLonLat.lat);
|
||||
}
|
||||
return moLatLng;
|
||||
},
|
||||
|
||||
|
||||
//
|
||||
// TRANSLATION: MapObject Pixel <-> OpenLayers.Pixel
|
||||
//
|
||||
|
||||
/**
|
||||
* @param {Object} moPixel
|
||||
*
|
||||
* @returns An OpenLayers.Pixel, translated from the passed in
|
||||
* MapObject Pixel
|
||||
* Returns null if null value is passed in
|
||||
* @type OpenLayers.Pixel
|
||||
*/
|
||||
getOLPixelFromMapObjectPixel: function(moPixel) {
|
||||
var olPixel = null;
|
||||
if (moPixel != null) {
|
||||
var x = this.getXFromMapObjectPixel(moPixel);
|
||||
var y = this.getYFromMapObjectPixel(moPixel);
|
||||
olPixel = new OpenLayers.Pixel(x, y);
|
||||
}
|
||||
return olPixel;
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Pixel} olPixel
|
||||
*
|
||||
* @returns A MapObject Pixel, translated from the passed in
|
||||
* OpenLayers.Pixel
|
||||
* Returns null if null value is passed in
|
||||
* @type Object
|
||||
*/
|
||||
getMapObjectPixelFromOLPixel: function(olPixel) {
|
||||
var moPixel = null;
|
||||
if (olPixel != null) {
|
||||
moPixel = this.getMapObjectPixelFromXY(olPixel.x, olPixel.y);
|
||||
}
|
||||
return moPixel;
|
||||
},
|
||||
|
||||
/** @final @type String */
|
||||
CLASS_NAME: "OpenLayers.Layer.EventPane"
|
||||
|
||||
234
lib/OpenLayers/Layer/FixedZoomLevels.js
Normal file
@@ -0,0 +1,234 @@
|
||||
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
|
||||
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
|
||||
* for the full text of the license. */
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Some Layers will already have established zoom levels (like google
|
||||
* or ve). Instead of trying to determine them and populate a resolutions[]
|
||||
* Array with those values, we will hijack the resolution functionality
|
||||
* here.
|
||||
*
|
||||
* When you subclass FixedZoomLevels:
|
||||
*
|
||||
* The initResolutions() call gets nullified, meaning no resolutions[] array
|
||||
* is set up. Which would be a big problem getResolution() in Layer, since
|
||||
* it merely takes map.zoom and indexes into resolutions[]... but....
|
||||
*
|
||||
* The getResolution() call is also overridden. Instead of using the
|
||||
* resolutions[] array, we simply calculate the current resolution based
|
||||
* on the current extent and the current map size. But how will we be able
|
||||
* to calculate the current extent without knowing the resolution...?
|
||||
*
|
||||
* The getExtent() function is also overridden. Instead of calculating extent
|
||||
* based on the center point and the current resolution, we instead
|
||||
* calculate the extent by getting the lonlats at the top-left and
|
||||
* bottom-right by using the getLonLatFromViewPortPx() translation function,
|
||||
* taken from the pixel locations (0,0) and the size of the map. But how
|
||||
* will we be able to do lonlat-px translation without resolution....?
|
||||
*
|
||||
* The getZoomForResolution() method is overridden. Instead of indexing into
|
||||
* the resolutions[] array, we call OpenLayers.Layer.getExent(), passing in
|
||||
* the desired resolution. With this extent, we then call getZoomForExtent()
|
||||
*
|
||||
*
|
||||
* Whenever you implement a layer using OpenLayers.Layer.FixedZoomLevels,
|
||||
* it is your responsibility to provide the following three functions:
|
||||
*
|
||||
* - getLonLatFromViewPortPx()
|
||||
* - getViewPortPxFromLonLat()
|
||||
* - getZoomForExtent()
|
||||
*
|
||||
* ...those three functions should generally be provided by any reasonable
|
||||
* API that you might be working from.
|
||||
*
|
||||
* @class
|
||||
*/
|
||||
OpenLayers.Layer.FixedZoomLevels = OpenLayers.Class.create();
|
||||
OpenLayers.Layer.FixedZoomLevels.prototype = {
|
||||
|
||||
/********************************************************/
|
||||
/* */
|
||||
/* Baselayer Functions */
|
||||
/* */
|
||||
/* The following functions must all be implemented */
|
||||
/* by all base layers */
|
||||
/* */
|
||||
/********************************************************/
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
initialize: function() {
|
||||
//this class is only just to add the following functions...
|
||||
// nothing to actually do here... but it is probably a good
|
||||
// idea to have layers that use these functions call this
|
||||
// inititalize() anyways, in case at some point we decide we
|
||||
// do want to put some functionality or state in here.
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
initResolutions: function() {
|
||||
|
||||
var props = new Array('minZoomLevel', 'maxZoomLevel', 'numZoomLevels');
|
||||
|
||||
for(var i=0; i < props.length; i++) {
|
||||
var property = props[i];
|
||||
this[property] = (this.options[property] != null)
|
||||
? this.options[property]
|
||||
: this.map[property];
|
||||
}
|
||||
|
||||
if ( (this.minZoomLevel == null) ||
|
||||
(this.minZoomLevel < this.MIN_ZOOM_LEVEL) ){
|
||||
this.minZoomLevel = this.MIN_ZOOM_LEVEL;
|
||||
}
|
||||
|
||||
var limitZoomLevels = this.MAX_ZOOM_LEVEL - this.minZoomLevel + 1;
|
||||
if (this.numZoomLevels != null) {
|
||||
this.numZoomLevels = Math.min(this.numZoomLevels, limitZoomLevels);
|
||||
} else {
|
||||
if (this.maxZoomLevel != null) {
|
||||
var zoomDiff = this.maxZoomLevel - this.minZoomLevel + 1;
|
||||
this.numZoomLevels = Math.min(zoomDiff, limitZoomLevels);
|
||||
} else {
|
||||
this.numZoomLevels = limitZoomLevels;
|
||||
}
|
||||
}
|
||||
|
||||
this.maxZoomLevel = this.minZoomLevel + this.numZoomLevels - 1;
|
||||
|
||||
if (this.RESOLUTIONS != null) {
|
||||
var resolutionsIndex = 0;
|
||||
this.resolutions = [];
|
||||
for(var i= this.minZoomLevel; i < this.numZoomLevels; i++) {
|
||||
this.resolutions[resolutionsIndex++] = this.RESOLUTIONS[i];
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @returns Degrees per Pixel
|
||||
* @type float
|
||||
*/
|
||||
getResolution: function() {
|
||||
|
||||
if (this.resolutions != null) {
|
||||
return OpenLayers.Layer.prototype.getResolution.apply(this, arguments);
|
||||
} else {
|
||||
var resolution = null;
|
||||
|
||||
var viewSize = this.map.getSize();
|
||||
var extent = this.getExtent();
|
||||
|
||||
if ((viewSize != null) && (extent != null)) {
|
||||
resolution = Math.max( extent.getWidth() / viewSize.w,
|
||||
extent.getHeight() / viewSize.h );
|
||||
}
|
||||
return resolution;
|
||||
}
|
||||
},
|
||||
|
||||
/** Calculates using px-> lonlat translation functions on tl and br
|
||||
* corners of viewport
|
||||
*
|
||||
* @returns A Bounds object which represents the lon/lat bounds of the
|
||||
* current viewPort.
|
||||
* @type OpenLayers.Bounds
|
||||
*/
|
||||
getExtent: function () {
|
||||
var extent = null;
|
||||
|
||||
|
||||
var size = this.map.getSize();
|
||||
|
||||
var tlPx = new OpenLayers.Pixel(0,0);
|
||||
var tlLL = this.getLonLatFromViewPortPx(tlPx);
|
||||
|
||||
var brPx = new OpenLayers.Pixel(size.w, size.h);
|
||||
var brLL = this.getLonLatFromViewPortPx(brPx);
|
||||
|
||||
if ((tlLL != null) && (brLL != null)) {
|
||||
extent = new OpenLayers.Bounds(tlLL.lon,
|
||||
brLL.lat,
|
||||
brLL.lon,
|
||||
tlLL.lat);
|
||||
}
|
||||
|
||||
return extent;
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {float} resolution
|
||||
*
|
||||
* @returns A suitable zoom level for the specified resolution.
|
||||
* If no baselayer is set, returns null.
|
||||
* @type int
|
||||
*/
|
||||
getZoomForResolution: function(resolution) {
|
||||
|
||||
if (this.resolutions != null) {
|
||||
return OpenLayers.Layer.prototype.getZoomForResolution.apply(this, arguments);
|
||||
} else {
|
||||
var extent = OpenLayers.Layer.prototype.getExtent.apply(this,
|
||||
[resolution]);
|
||||
|
||||
return this.getZoomForExtent(extent);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/********************************************************/
|
||||
/* */
|
||||
/* Translation Functions */
|
||||
/* */
|
||||
/* The following functions translate GMaps and OL */
|
||||
/* formats for Pixel, LonLat, Bounds, and Zoom */
|
||||
/* */
|
||||
/********************************************************/
|
||||
|
||||
|
||||
//
|
||||
// TRANSLATION: MapObject Zoom <-> OpenLayers Zoom
|
||||
//
|
||||
|
||||
/**
|
||||
* @param {int} gZoom
|
||||
*
|
||||
* @returns An OpenLayers Zoom level, translated from the passed in gZoom
|
||||
* Returns null if null value is passed in
|
||||
* @type int
|
||||
*/
|
||||
getOLZoomFromMapObjectZoom: function(moZoom) {
|
||||
var zoom = null;
|
||||
if (moZoom != null) {
|
||||
zoom = moZoom - this.minZoomLevel;
|
||||
}
|
||||
return zoom;
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {int} olZoom
|
||||
*
|
||||
* @returns A MapObject level, translated from the passed in olZoom
|
||||
* Returns null if null value is passed in
|
||||
* @type int
|
||||
*/
|
||||
getMapObjectZoomFromOLZoom: function(olZoom) {
|
||||
var zoom = null;
|
||||
if (olZoom != null) {
|
||||
zoom = olZoom + this.minZoomLevel;
|
||||
}
|
||||
return zoom;
|
||||
},
|
||||
|
||||
|
||||
/** @final @type String */
|
||||
CLASS_NAME: "FixedZoomLevels.js"
|
||||
};
|
||||
|
||||
@@ -1,21 +1,17 @@
|
||||
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
|
||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
|
||||
* text of the license. */
|
||||
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
|
||||
* for the full text of the license. */
|
||||
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* @requires OpenLayers/Layer/Markers.js
|
||||
*/
|
||||
OpenLayers.Layer.GeoRSS = Class.create();
|
||||
OpenLayers.Layer.GeoRSS = OpenLayers.Class.create();
|
||||
OpenLayers.Layer.GeoRSS.prototype =
|
||||
Object.extend( new OpenLayers.Layer.Markers(), {
|
||||
OpenLayers.Class.inherit( OpenLayers.Layer.Markers, {
|
||||
|
||||
/** GeoRSS layer is never a base layer.
|
||||
* @type Boolean
|
||||
*/
|
||||
isBaseLayer: false,
|
||||
|
||||
/** store url of text file
|
||||
* @type str */
|
||||
location:null,
|
||||
@@ -49,15 +45,40 @@ OpenLayers.Layer.GeoRSS.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {?} ajaxRequest
|
||||
* @param {XMLHttpRequest} ajaxRequest
|
||||
*/
|
||||
parseData: function(ajaxRequest) {
|
||||
var doc = ajaxRequest.responseXML;
|
||||
if (!doc || ajaxRequest.fileType!="XML") {
|
||||
doc = OpenLayers.parseXMLString(ajaxRequest.responseText);
|
||||
}
|
||||
this.name = doc.getElementsByTagName("title")[0].firstChild.nodeValue;
|
||||
var itemlist = doc.getElementsByTagName('item');
|
||||
|
||||
this.name = null;
|
||||
try {
|
||||
this.name = doc.getElementsByTagNameNS('*', 'title')[0].firstChild.nodeValue;
|
||||
}
|
||||
catch (e) {
|
||||
this.name = doc.getElementsByTagName('title')[0].firstChild.nodeValue;
|
||||
}
|
||||
|
||||
/* Try RSS items first, then Atom entries */
|
||||
var itemlist = null;
|
||||
try {
|
||||
itemlist = doc.getElementsByTagNameNS('*', 'item');
|
||||
}
|
||||
catch (e) {
|
||||
itemlist = doc.getElementsByTagName('item');
|
||||
}
|
||||
|
||||
if (itemlist.length == 0) {
|
||||
try {
|
||||
itemlist = doc.getElementsByTagNameNS('*', 'entry');
|
||||
}
|
||||
catch(e) {
|
||||
itemlist = doc.getElementsByTagName('entry');
|
||||
}
|
||||
}
|
||||
|
||||
for (var i = 0; i < itemlist.length; i++) {
|
||||
var data = {};
|
||||
var point = OpenLayers.Util.getNodes(itemlist[i], 'georss:point');
|
||||
@@ -75,32 +96,54 @@ OpenLayers.Layer.GeoRSS.prototype =
|
||||
continue;
|
||||
}
|
||||
location = new OpenLayers.LonLat(parseFloat(location[1]), parseFloat(location[0]));
|
||||
var title = OpenLayers.Util.getNodes(itemlist[i], "title")[0].firstChild.nodeValue;
|
||||
var description = OpenLayers.Util.getNodes(itemlist[i], "description")[0].firstChild.nodeValue;
|
||||
|
||||
/* Provide defaults for title and description */
|
||||
var title = "Untitled";
|
||||
try {
|
||||
title = OpenLayers.Util.getNodes(itemlist[i],
|
||||
"title")[0].firstChild.nodeValue;
|
||||
}
|
||||
catch (e) { title="Untitled"; }
|
||||
|
||||
/* First try RSS descriptions, then Atom summaries */
|
||||
var descr_nodes = null;
|
||||
try {
|
||||
descr_nodes = itemlist[i].getElementsByTagNameNS("*",
|
||||
"description");
|
||||
}
|
||||
catch (e) {
|
||||
descr_nodes = itemlist[i].getElementsByTagName("description");
|
||||
}
|
||||
if (descr_nodes.length == 0) {
|
||||
try {
|
||||
descr_nodes = itemlist[i].getElementsByTagNameNS("*",
|
||||
"summary");
|
||||
}
|
||||
catch (e) {
|
||||
descr_nodes = itemlist[i].getElementsByTagName("summary");
|
||||
}
|
||||
}
|
||||
|
||||
var description = "No description.";
|
||||
try {
|
||||
description = descr_nodes[0].firstChild.nodeValue;
|
||||
}
|
||||
catch (e) { description="No description."; }
|
||||
|
||||
try { var link = OpenLayers.Util.getNodes(itemlist[i], "link")[0].firstChild.nodeValue; } catch (e) { }
|
||||
data.icon = OpenLayers.Marker.defaultIcon();
|
||||
data.popupSize = new OpenLayers.Size(250, 100);
|
||||
data.popupSize = new OpenLayers.Size(250, 120);
|
||||
if ((title != null) && (description != null)) {
|
||||
contentHTML = "<br />";
|
||||
contentHTML += "<div style='margin: -0.5em 0.5em 0.5em 0.5em'>"
|
||||
|
||||
contentHTML += "<div style='height: 1.3em; overflow: hidden'>";
|
||||
contentHTML += "<span style='font-size: 1.2em; font-weight: bold'>";
|
||||
if (link) contentHTML += "<a href='"+link+"' target='_blank'>";
|
||||
contentHTML += title;
|
||||
if (link) contentHTML += "</a>";
|
||||
contentHTML += "</span>";
|
||||
contentHTML += "</div>";
|
||||
|
||||
|
||||
contentHTML += "<span style='font-size: 0.7em; align:center'>";
|
||||
contentHTML = '<div class="olLayerGeoRSSClose">[x]</div>';
|
||||
contentHTML += '<div class="olLayerGeoRSSTitle">';
|
||||
if (link) contentHTML += '<a class="link" href="'+link+'" target="_blank">';
|
||||
contentHTML += title;
|
||||
if (link) contentHTML += '</a>';
|
||||
contentHTML += '</div>';
|
||||
contentHTML += '<div style="" class="olLayerGeoRSSDescription">';
|
||||
contentHTML += description;
|
||||
contentHTML += "</span>";
|
||||
|
||||
contentHTML += "</div>"
|
||||
data['popupContentHTML'] = contentHTML;
|
||||
|
||||
//data['popupContentHTML'] = '<h2>'+title+'</h2><p>'+description+'</p>';
|
||||
contentHTML += '</div>';
|
||||
data['popupContentHTML'] = contentHTML;
|
||||
}
|
||||
var feature = new OpenLayers.Feature(this, location, data);
|
||||
this.features.push(feature);
|
||||
@@ -121,7 +164,7 @@ OpenLayers.Layer.GeoRSS.prototype =
|
||||
}
|
||||
if (!sameMarkerClicked) {
|
||||
var popup = this.createPopup();
|
||||
Event.observe(popup.div, "click",
|
||||
OpenLayers.Event.observe(popup.div, "click",
|
||||
function() {
|
||||
for(var i=0; i < this.layer.map.popups.length; i++) {
|
||||
this.layer.map.removePopup(this.layer.map.popups[i]);
|
||||
@@ -129,7 +172,7 @@ OpenLayers.Layer.GeoRSS.prototype =
|
||||
}.bindAsEventListener(this));
|
||||
this.layer.map.addPopup(popup);
|
||||
}
|
||||
Event.stop(evt);
|
||||
OpenLayers.Event.stop(evt);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -139,7 +182,7 @@ OpenLayers.Layer.GeoRSS.prototype =
|
||||
if (this.features != null) {
|
||||
while(this.features.length > 0) {
|
||||
var feature = this.features[0];
|
||||
this.features.remove(feature);
|
||||
OpenLayers.Util.removeItem(this.features, feature);
|
||||
feature.destroy();
|
||||
}
|
||||
}
|
||||
|
||||