Compare commits
66 Commits
release-2.
...
release-2.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6a7dab4ea8 | ||
|
|
c7c21ea08a | ||
|
|
5f8dc06823 | ||
|
|
130e527702 | ||
|
|
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 |
@@ -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.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 Util"
|
||||
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,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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
7
doc/Util.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
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).
|
||||
@@ -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>
|
||||
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>
|
||||
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/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>
|
||||
46
examples/getfeatureinfo.html
Normal file
@@ -0,0 +1,46 @@
|
||||
<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) {
|
||||
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>
|
||||
@@ -23,20 +23,23 @@
|
||||
var map, layer;
|
||||
|
||||
function init(){
|
||||
map = new OpenLayers.Map( $('map') );
|
||||
map = new OpenLayers.Map( $('map') ,
|
||||
{ controls: [new OpenLayers.Control.MouseDefaults()] });
|
||||
|
||||
var normal = new OpenLayers.Layer.Google( "Google" );
|
||||
var normal = new OpenLayers.Layer.Google( "Google", // );
|
||||
{ minZoomLevel: 3, maxZoomLevel: 8 });
|
||||
var satellite = new OpenLayers.Layer.Google( "Google Satellite" , {type: G_SATELLITE_MAP });
|
||||
var hybrid = new OpenLayers.Layer.Google( "Google Hybrid" , {type: G_HYBRID_MAP });
|
||||
|
||||
|
||||
map.addLayers([normal, satellite, hybrid]);
|
||||
map.addLayers([satellite, normal, hybrid]);
|
||||
|
||||
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() );
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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($F('opacity')) + 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:80/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>
|
||||
58
examples/mm.html
Normal file
@@ -0,0 +1,58 @@
|
||||
<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%;
|
||||
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>
|
||||
@@ -1,36 +1,36 @@
|
||||
<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>
|
||||
<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>
|
||||
|
||||
@@ -22,8 +22,9 @@
|
||||
|
||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||
map.zoomToMaxExtent();
|
||||
|
||||
}
|
||||
|
||||
|
||||
function changer() {
|
||||
popup.setBackgroundColor("red");
|
||||
popup.setSize(new OpenLayers.Size(100,600));
|
||||
@@ -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>
|
||||
@@ -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.isBaseLayer = false;
|
||||
map.addLayers([jpl_wms,ka_wms]);
|
||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||
map.addControl(new OpenLayers.Control.MouseToolbar());
|
||||
|
||||
@@ -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]);
|
||||
|
||||
@@ -18,20 +18,23 @@
|
||||
|
||||
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 });
|
||||
map.addLayer(velayer);
|
||||
|
||||
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,35 +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 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>
|
||||
<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>
|
||||
|
||||
@@ -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,39 @@
|
||||
<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>
|
||||
<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="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>
|
||||
|
||||
54
examples/zoomLevels.html
Normal file
@@ -0,0 +1,54 @@
|
||||
<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 = 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 |
|
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 |
@@ -67,12 +67,14 @@ if (typeof(_OPENLAYERS_SFL_) == "undefined") {
|
||||
"OpenLayers/Tile/Image.js",
|
||||
"OpenLayers/Tile/WFS.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/KaMap.js",
|
||||
"OpenLayers/Layer/MultiMap.js",
|
||||
"OpenLayers/Layer/Markers.js",
|
||||
"OpenLayers/Layer/Text.js",
|
||||
"OpenLayers/Layer/WorldWind.js",
|
||||
@@ -81,6 +83,7 @@ if (typeof(_OPENLAYERS_SFL_) == "undefined") {
|
||||
"OpenLayers/Layer/WMS/Untiled.js",
|
||||
"OpenLayers/Layer/GeoRSS.js",
|
||||
"OpenLayers/Layer/Boxes.js",
|
||||
"OpenLayers/Layer/Canvas.js",
|
||||
"OpenLayers/Popup/Anchored.js",
|
||||
"OpenLayers/Popup/AnchoredBubble.js",
|
||||
"OpenLayers/Control.js",
|
||||
|
||||
@@ -31,8 +31,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);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -123,8 +123,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);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -193,8 +193,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);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -315,10 +315,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);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -420,8 +420,8 @@ 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);
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
OpenLayers.Control = Class.create();
|
||||
OpenLayers.Control.prototype = {
|
||||
|
||||
/** @type String */
|
||||
id: null,
|
||||
|
||||
/** this gets set in the addControl() function in OpenLayers.Map
|
||||
* @type OpenLayers.Map */
|
||||
map: null,
|
||||
@@ -28,6 +31,8 @@ OpenLayers.Control.prototype = {
|
||||
*/
|
||||
initialize: function (options) {
|
||||
Object.extend(this, options);
|
||||
|
||||
this.id = OpenLayers.Util.createUniqueID(this.CLASS_NAME + "_");
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -57,6 +62,7 @@ OpenLayers.Control.prototype = {
|
||||
draw: function (px) {
|
||||
if (this.div == null) {
|
||||
this.div = OpenLayers.Util.createDiv();
|
||||
this.div.id = this.id;
|
||||
}
|
||||
if (px != null) {
|
||||
this.position = px.clone();
|
||||
|
||||
@@ -119,16 +119,18 @@ OpenLayers.Control.LayerSwitcher.prototype =
|
||||
inputElem.type = (baseLayer) ? "radio" : "checkbox";
|
||||
inputElem.value = layer.name;
|
||||
inputElem.checked = checked;
|
||||
inputElem.defaultChecked = checked;
|
||||
inputElem.layer = layer;
|
||||
inputElem.control = this;
|
||||
Event.observe(inputElem, "mouseup",
|
||||
this.onInputClick.bindAsEventListener(inputElem));
|
||||
|
||||
// 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));
|
||||
|
||||
labelSpan.style.verticalAlign = (baseLayer) ? "bottom" : "baseline";
|
||||
Event.observe(labelSpan, "click",
|
||||
this.onInputClick.bindAsEventListener(inputElem));
|
||||
// create line break
|
||||
var br = document.createElement("br");
|
||||
|
||||
@@ -158,11 +160,17 @@ OpenLayers.Control.LayerSwitcher.prototype =
|
||||
*
|
||||
* @param {Event} e
|
||||
*/
|
||||
onLabelClick: function(e) {
|
||||
var clickedRadioButton = ((this.type == "radio") && (this.checked));
|
||||
if (!clickedRadioButton) {
|
||||
|
||||
onInputClick: function(e) {
|
||||
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();
|
||||
}
|
||||
Event.stop(e);
|
||||
},
|
||||
|
||||
/** Need to update the map accordingly whenever user clicks in either of
|
||||
@@ -189,7 +197,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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -271,6 +279,8 @@ OpenLayers.Control.LayerSwitcher.prototype =
|
||||
|
||||
Event.observe(this.div, "mouseup",
|
||||
this.mouseUp.bindAsEventListener(this));
|
||||
Event.observe(this.div, "click",
|
||||
this.ignoreEvent);
|
||||
Event.observe(this.div, "mousedown",
|
||||
this.mouseDown.bindAsEventListener(this));
|
||||
Event.observe(this.div, "dblclick", this.ignoreEvent);
|
||||
@@ -301,8 +311,9 @@ OpenLayers.Control.LayerSwitcher.prototype =
|
||||
|
||||
this.baseLayersDiv = document.createElement("div");
|
||||
this.baseLayersDiv.style.paddingLeft = "10px";
|
||||
Event.observe(this.baseLayersDiv, "click",
|
||||
/*Event.observe(this.baseLayersDiv, "click",
|
||||
this.onLayerClick.bindAsEventListener(this));
|
||||
*/
|
||||
this.layersDiv.appendChild(this.baseLayersDiv);
|
||||
|
||||
|
||||
@@ -315,8 +326,9 @@ OpenLayers.Control.LayerSwitcher.prototype =
|
||||
|
||||
this.dataLayersDiv = document.createElement("div");
|
||||
this.dataLayersDiv.style.paddingLeft = "10px";
|
||||
Event.observe(this.dataLayersDiv, "click",
|
||||
/*Event.observe(this.dataLayersDiv, "click",
|
||||
this.onLayerClick.bindAsEventListener(this));
|
||||
*/
|
||||
this.layersDiv.appendChild(this.dataLayersDiv);
|
||||
|
||||
this.div.appendChild(this.layersDiv);
|
||||
|
||||
@@ -60,6 +60,7 @@ OpenLayers.Control.MouseDefaults.prototype =
|
||||
var newCenter = this.map.getLonLatFromViewPortPx( evt.xy );
|
||||
this.map.setCenter(newCenter, this.map.zoom + 1);
|
||||
Event.stop(evt);
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -80,6 +81,7 @@ 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);
|
||||
}
|
||||
@@ -95,8 +97,8 @@ OpenLayers.Control.MouseDefaults.prototype =
|
||||
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";
|
||||
}
|
||||
@@ -124,20 +126,7 @@ OpenLayers.Control.MouseDefaults.prototype =
|
||||
defaultMouseUp: function (evt) {
|
||||
if (!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 +141,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;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -173,6 +165,44 @@ OpenLayers.Control.MouseDefaults.prototype =
|
||||
this.map.zoomOut();
|
||||
},
|
||||
|
||||
/** 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);
|
||||
var zoom = this.map.getZoomForExtent(bounds);
|
||||
this.map.setCenter(new OpenLayers.LonLat(
|
||||
(start.lon + end.lon) / 2,
|
||||
(start.lat + end.lat) / 2
|
||||
), zoom);
|
||||
} 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;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Mouse ScrollWheel code thanks to http://adomas.org/javascript-mouse-wheel/
|
||||
@@ -189,7 +219,7 @@ OpenLayers.Control.MouseDefaults.prototype =
|
||||
var inMap = false;
|
||||
var elem = Event.element(e);
|
||||
while(elem != null) {
|
||||
if (elem == this.map.div) {
|
||||
if (this.map && elem == this.map.div) {
|
||||
inMap = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -6,12 +6,14 @@
|
||||
* @class
|
||||
*
|
||||
* @requires OpenLayers/Control.js
|
||||
* @requires OpenLayers/Control/MouseDefaults.js
|
||||
*/
|
||||
OpenLayers.Control.MouseToolbar = Class.create();
|
||||
OpenLayers.Control.MouseToolbar.X = 6;
|
||||
OpenLayers.Control.MouseToolbar.Y = 300;
|
||||
OpenLayers.Control.MouseToolbar.prototype =
|
||||
Object.extend( new OpenLayers.Control(), {
|
||||
Object.extend( new OpenLayers.Control(),
|
||||
Object.extend( new 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,22 +38,16 @@ 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"); });
|
||||
return this.div;
|
||||
|
||||
},
|
||||
@@ -66,9 +65,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, Event.stop);
|
||||
btn.action = id;
|
||||
btn.title = title;
|
||||
btn.alt = title;
|
||||
@@ -79,11 +79,28 @@ OpenLayers.Control.MouseToolbar.prototype =
|
||||
return btn;
|
||||
},
|
||||
|
||||
buttonClick: function(evt) {
|
||||
/**
|
||||
* @param {Event} evt
|
||||
*/
|
||||
buttonDown: function(evt) {
|
||||
if (!Event.isLeftClick(evt)) return;
|
||||
this.switchModeTo(evt.element.action);
|
||||
this.buttonClicked = evt.element.action;
|
||||
Event.stop(evt);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {Event} evt
|
||||
*/
|
||||
buttonUp: function(evt) {
|
||||
if (!Event.isLeftClick(evt)) return;
|
||||
if (this.buttonClicked != null) {
|
||||
if (this.buttonClicked == evt.element.action) {
|
||||
this.switchModeTo(evt.element.action);
|
||||
}
|
||||
Event.stop(evt);
|
||||
this.buttonClicked = null;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {Event} evt
|
||||
@@ -92,7 +109,9 @@ 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);
|
||||
Event.stop(evt);
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -102,8 +121,10 @@ OpenLayers.Control.MouseToolbar.prototype =
|
||||
if (!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 +143,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 +167,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);
|
||||
@@ -175,7 +199,9 @@ OpenLayers.Control.MouseToolbar.prototype =
|
||||
|
||||
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 +214,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 +242,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";
|
||||
}
|
||||
@@ -235,21 +272,8 @@ OpenLayers.Control.MouseToolbar.prototype =
|
||||
if (!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,11 +285,26 @@ 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;
|
||||
}
|
||||
}
|
||||
});
|
||||
}));
|
||||
|
||||
|
||||
@@ -76,7 +76,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");
|
||||
|
||||
@@ -12,6 +12,7 @@ OpenLayers.Control.PanZoomBar.X = 4;
|
||||
OpenLayers.Control.PanZoomBar.Y = 4;
|
||||
OpenLayers.Control.PanZoomBar.prototype =
|
||||
Object.extend( new OpenLayers.Control.PanZoom(), {
|
||||
|
||||
/** @type Array(...) */
|
||||
buttons: null,
|
||||
|
||||
@@ -25,19 +26,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 +78,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 +94,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 +116,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 +130,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;
|
||||
},
|
||||
/*
|
||||
@@ -136,7 +151,7 @@ OpenLayers.Control.PanZoomBar.prototype =
|
||||
var y = evt.xy.y;
|
||||
var top = Position.page(evt.object)[1];
|
||||
var levels = Math.floor((y - top)/this.zoomStopHeight);
|
||||
this.map.zoomTo(this.map.getMaxZoomLevel() - levels);
|
||||
this.map.zoomTo((this.map.getNumZoomLevels() -1) - levels);
|
||||
Event.stop(evt);
|
||||
},
|
||||
|
||||
@@ -170,8 +185,8 @@ OpenLayers.Control.PanZoomBar.prototype =
|
||||
this.slider.style.top = newTop+"px";
|
||||
}
|
||||
this.mouseDragStart = evt.xy.clone();
|
||||
Event.stop(evt);
|
||||
}
|
||||
Event.stop(evt);
|
||||
},
|
||||
|
||||
/*
|
||||
@@ -183,8 +198,8 @@ OpenLayers.Control.PanZoomBar.prototype =
|
||||
if (!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();
|
||||
@@ -198,8 +213,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,7 +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. */
|
||||
|
||||
|
||||
/**
|
||||
* @class
|
||||
*/
|
||||
@@ -37,11 +37,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
|
||||
@@ -159,8 +162,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 +178,10 @@ OpenLayers.Events.prototype = {
|
||||
break;
|
||||
}
|
||||
}
|
||||
// don't fall through to other DOM elements
|
||||
if (!this.fallThrough) {
|
||||
Event.stop(evt);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -205,8 +211,9 @@ OpenLayers.Events.prototype = {
|
||||
this.element.offsets = Position.page(this.element);
|
||||
}
|
||||
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 */
|
||||
|
||||
@@ -42,7 +42,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,7 +63,7 @@ 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) {
|
||||
@@ -89,6 +89,10 @@ OpenLayers.Feature.prototype= {
|
||||
return this.marker;
|
||||
},
|
||||
|
||||
destroyMarker: function() {
|
||||
this.marker.destroy();
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -2,66 +2,65 @@
|
||||
* See http://svn.openlayers.org/trunk/openlayers/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 = 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].getElementsByTagName("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"
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -43,18 +43,30 @@ 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,
|
||||
@@ -62,8 +74,6 @@ OpenLayers.Layer.prototype = {
|
||||
/** @type float */
|
||||
maxScale: null,
|
||||
|
||||
/** @type String */
|
||||
units: null,
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
@@ -82,13 +92,13 @@ OpenLayers.Layer.prototype = {
|
||||
|
||||
this.name = name;
|
||||
|
||||
//generate unique id based on name
|
||||
this.id = OpenLayers.Util.createUniqueID("Layer_");
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -148,6 +158,12 @@ OpenLayers.Layer.prototype = {
|
||||
Object.extend(this, this.options);
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
onMapResize: function() {
|
||||
//this function can be implemented by subclasses
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Bounds} bound
|
||||
@@ -163,24 +179,33 @@ OpenLayers.Layer.prototype = {
|
||||
* 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',
|
||||
'projection', 'units',
|
||||
'scales', 'resolutions',
|
||||
'maxScale', 'minScale',
|
||||
'maxResolution', 'minResolution',
|
||||
'minZoomLevel', 'maxZoomLevel', 'units',
|
||||
'scales', 'resolutions'
|
||||
|
||||
'minExtent', 'maxExtent',
|
||||
'numZoomLevels'
|
||||
);
|
||||
if (this.map.maxZoomLevel && !this.numZoomLevels) {
|
||||
this.numZoomLevels = this.map.maxZoomLevel + 1;
|
||||
}
|
||||
for(var i=0; i < properties.length; i++) {
|
||||
if (this[properties[i]] == null) {
|
||||
this[properties[i]] = this.map[properties[i]];
|
||||
}
|
||||
}
|
||||
if (this.isBaseLayer) {
|
||||
this.initResolutions();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -201,7 +226,7 @@ OpenLayers.Layer.prototype = {
|
||||
if ((visible) && (this.map != null)) {
|
||||
var extent = this.map.getExtent();
|
||||
if (extent != null) {
|
||||
this.moveTo(this.map.getExtent());
|
||||
this.moveTo(this.map.getExtent(), true);
|
||||
}
|
||||
}
|
||||
if ((this.map != null) &&
|
||||
@@ -211,147 +236,225 @@ OpenLayers.Layer.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/********************************************************/
|
||||
/* */
|
||||
/* Layer Options */
|
||||
/* */
|
||||
/* Accessor functions to Layer Options parameters */
|
||||
/* */
|
||||
/********************************************************/
|
||||
|
||||
/**
|
||||
* @type String
|
||||
*/
|
||||
getProjection: function() {
|
||||
return this.projection;
|
||||
},
|
||||
|
||||
/**
|
||||
* @type OpenLayers.Bounds
|
||||
*/
|
||||
getMaxExtent: function() {
|
||||
return this.maxExtent;
|
||||
},
|
||||
|
||||
/**
|
||||
* @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() {
|
||||
|
||||
if ((this.scales != null) || (this.resolutions != null)) {
|
||||
//preset levels
|
||||
if (this.scales != null) {
|
||||
this.resolutions = new Array();
|
||||
for(var i = 0; i < this.scales.length; i++) {
|
||||
this.resolutions[i] =
|
||||
OpenLayers.Util.getResolutionFromScale(this.scales[i],
|
||||
this.units);
|
||||
}
|
||||
}
|
||||
this.numZoomLevels = this.resolutions.length;
|
||||
|
||||
} else {
|
||||
//maxResolution and numZoomLevels
|
||||
|
||||
this.resolutions = new Array();
|
||||
|
||||
// determine maxResolution
|
||||
if (this.minScale) {
|
||||
this.maxResolution =
|
||||
OpenLayers.Util.getResolutionFromScale(this.minScale,
|
||||
this.units);
|
||||
} else if (this.maxResolution == "auto") {
|
||||
var viewSize = this.map.getSize();
|
||||
var wRes = this.maxExtent.getWidth() / viewSize.w;
|
||||
var hRes = this.maxExtent.getHeight()/ viewSize.h;
|
||||
this.maxResolution = Math.max(wRes, hRes);
|
||||
}
|
||||
|
||||
// determine minResolution
|
||||
if (this.maxScale != null) {
|
||||
this.minResolution =
|
||||
OpenLayers.Util.getResolutionFromScale(this.maxScale);
|
||||
} else if ((this.minResolution == "auto") &&
|
||||
(this.minExtent != null)){
|
||||
var viewSize = this.map.getSize();
|
||||
var wRes = this.minExtent.getWidth() / viewSize.w;
|
||||
var hRes = this.minExtent.getHeight()/ viewSize.h;
|
||||
this.minResolution = Math.max(wRes, hRes);
|
||||
}
|
||||
|
||||
// determine numZoomLevels
|
||||
if (this.minResolution != null) {
|
||||
var ratio = this.maxResolution / this.minResolution;
|
||||
this.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 < this.numZoomLevels; i++) {
|
||||
this.resolutions.push(this.maxResolution / Math.pow(2, i));
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @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
|
||||
|
||||
/** Calculates based on resolution, center, and mapsize
|
||||
*
|
||||
* @param {float} resolution Specific resolution to get an extent for.
|
||||
* If null, this.getResolution() is called
|
||||
* @returns A Bounds object which represents the lon/lat bounds of the
|
||||
* current viewPort.
|
||||
* @type OpenLayers.Bounds
|
||||
*/
|
||||
getExtent: function () {
|
||||
getExtent: function(resolution) {
|
||||
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);
|
||||
var center = this.map.getCenter();
|
||||
if (center != null) {
|
||||
|
||||
if (resolution == null) {
|
||||
resolution = this.getResolution();
|
||||
}
|
||||
var size = this.map.getSize();
|
||||
var w_deg = size.w * resolution;
|
||||
var h_deg = size.h * resolution;
|
||||
|
||||
extent = new OpenLayers.Bounds(center.lon - w_deg / 2,
|
||||
center.lat - h_deg / 2,
|
||||
center.lon + w_deg / 2,
|
||||
center.lat + h_deg / 2);
|
||||
|
||||
}
|
||||
|
||||
return extent;
|
||||
},
|
||||
|
||||
/**
|
||||
* @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 {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);
|
||||
* @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) {
|
||||
|
||||
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 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))
|
||||
);
|
||||
for(var i=1; i <= this.resolutions.length; i++) {
|
||||
if ( this.resolutions[i] < resolution) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return (i - 1);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Bounds} bounds
|
||||
*
|
||||
* @return {int}
|
||||
*/
|
||||
getZoomForExtent: function (bounds) {
|
||||
// this should be implemented by subclasses
|
||||
* @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 lonlat = null;
|
||||
if (viewPortPx != null) {
|
||||
var size = this.map.getSize();
|
||||
var center = this.map.getCenter();
|
||||
var res = this.map.getResolution();
|
||||
|
||||
var delta_x = viewPortPx.x - (size.w / 2);
|
||||
var delta_y = viewPortPx.y - (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
|
||||
*/
|
||||
getViewPortPxFromLonLat: function (lonlat) {
|
||||
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;
|
||||
},
|
||||
|
||||
/**
|
||||
* 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.setOpacity(element, opacity);
|
||||
}
|
||||
},
|
||||
|
||||
/** @final @type String */
|
||||
CLASS_NAME: "OpenLayers.Layer"
|
||||
|
||||
117
lib/OpenLayers/Layer/Canvas.js
Normal file
@@ -0,0 +1,117 @@
|
||||
/* 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/Layer.js
|
||||
*/
|
||||
OpenLayers.Layer.Canvas = Class.create();
|
||||
OpenLayers.Layer.Canvas.prototype =
|
||||
Object.extend( new 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} minor
|
||||
*/
|
||||
moveTo:function(bounds, zoomChanged, minor) {
|
||||
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"
|
||||
});
|
||||
@@ -37,9 +37,6 @@ OpenLayers.Layer.EventPane.prototype =
|
||||
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";
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -52,15 +49,20 @@ 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);
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
133
lib/OpenLayers/Layer/FixedZoomLevels.js
Normal file
@@ -0,0 +1,133 @@
|
||||
/* 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. */
|
||||
|
||||
|
||||
/**
|
||||
* 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 = 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() {
|
||||
// resolutions are set automatically in the black-box. this is the
|
||||
// definition of a fixed-zoom-levels layer
|
||||
},
|
||||
|
||||
/**
|
||||
* @returns Degrees per Pixel
|
||||
* @type float
|
||||
*/
|
||||
getResolution: function() {
|
||||
var viewSize = this.map.getSize();
|
||||
var extent = this.getExtent();
|
||||
return Math.max( extent.getWidth() / viewSize.w,
|
||||
extent.getHeight() / viewSize.h );
|
||||
},
|
||||
|
||||
/** 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) {
|
||||
|
||||
var extent = OpenLayers.Layer.prototype.getExtent.apply(this,
|
||||
[resolution]);
|
||||
|
||||
return this.getZoomForExtent(extent);
|
||||
},
|
||||
|
||||
/** @final @type String */
|
||||
CLASS_NAME: "FixedZoomLevels.js"
|
||||
};
|
||||
|
||||
@@ -11,11 +11,6 @@ OpenLayers.Layer.GeoRSS = Class.create();
|
||||
OpenLayers.Layer.GeoRSS.prototype =
|
||||
Object.extend( new OpenLayers.Layer.Markers(), {
|
||||
|
||||
/** GeoRSS layer is never a base layer.
|
||||
* @type Boolean
|
||||
*/
|
||||
isBaseLayer: false,
|
||||
|
||||
/** store url of text file
|
||||
* @type str */
|
||||
location:null,
|
||||
@@ -75,8 +70,22 @@ 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 = "No title";
|
||||
try {
|
||||
title = OpenLayers.Util.getNodes(itemlist[i],
|
||||
"title")[0].firstChild.nodeValue;
|
||||
}
|
||||
catch (e) { alert(e); }
|
||||
|
||||
var description = "No description";
|
||||
try {
|
||||
description = OpenLayers.Util.getNodes(itemlist[i],
|
||||
"description")[0].firstChild.nodeValue;
|
||||
}
|
||||
catch (e) { alert(e); }
|
||||
|
||||
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);
|
||||
|
||||
@@ -2,31 +2,8 @@
|
||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
|
||||
* text of the license. */
|
||||
|
||||
if (typeof GMap2 != "undefined") {
|
||||
|
||||
/** Hack-on function because GMAPS does not give it to us
|
||||
*
|
||||
* @param {GLatLng} gLatLng
|
||||
*
|
||||
* @returns A GPoint specifying gLatLng translated into "Container" coords
|
||||
* @type GPoint
|
||||
*/
|
||||
GMap2.prototype.fromLatLngToContainerPixel = function(gLatLng) {
|
||||
|
||||
// first we translate into "DivPixel"
|
||||
var gPoint = this.fromLatLngToDivPixel(gLatLng);
|
||||
|
||||
// locate the sliding "Div" div
|
||||
// it seems like "b" is the main div
|
||||
var div = this.b.firstChild.firstChild;
|
||||
|
||||
// adjust by the offset of "Div" and voila!
|
||||
gPoint.x += div.offsetLeft;
|
||||
gPoint.y += div.offsetTop;
|
||||
|
||||
return gPoint;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @class
|
||||
@@ -35,7 +12,8 @@ if (typeof GMap2 != "undefined") {
|
||||
*/
|
||||
OpenLayers.Layer.Google = Class.create();
|
||||
OpenLayers.Layer.Google.prototype =
|
||||
Object.extend( new OpenLayers.Layer.EventPane(), {
|
||||
Object.extend( new OpenLayers.Layer.EventPane(),
|
||||
Object.extend( new OpenLayers.Layer.FixedZoomLevels(), {
|
||||
|
||||
/** @type Boolean */
|
||||
isFixed: true,
|
||||
@@ -49,7 +27,7 @@ OpenLayers.Layer.Google.prototype =
|
||||
// OPTIONS
|
||||
|
||||
/** @type int */
|
||||
minZoomLevel: -1,
|
||||
minZoomLevel: 0,
|
||||
|
||||
/** @type int */
|
||||
maxZoomLevel: 16,
|
||||
@@ -62,9 +40,13 @@ OpenLayers.Layer.Google.prototype =
|
||||
*/
|
||||
initialize: function(name, options) {
|
||||
OpenLayers.Layer.EventPane.prototype.initialize.apply(this, arguments);
|
||||
OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,
|
||||
arguments);
|
||||
if (this.maxExtent == null) {
|
||||
this.maxExtent = new OpenLayers.Bounds(-180, -90, 180, 90);
|
||||
}
|
||||
this.addContainerPxFunction();
|
||||
this.numZoomLevels = this.maxZoomLevel - this.minZoomLevel + 1;
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -147,6 +129,13 @@ OpenLayers.Layer.Google.prototype =
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {Event} evt
|
||||
*/
|
||||
onMapResize: function() {
|
||||
this.gmap.checkResize();
|
||||
},
|
||||
|
||||
/** If we can't load the GMap, then display an error message to the
|
||||
* user and tell them where to go for help.
|
||||
*
|
||||
@@ -259,6 +248,11 @@ OpenLayers.Layer.Google.prototype =
|
||||
if ((this.gmap != null) && (this.gmap.getCenter() != null)) {
|
||||
var gBounds = this.getGLatLngBoundsFromOLBounds(bounds);
|
||||
var gZoom = this.gmap.getBoundsZoomLevel(gBounds);
|
||||
|
||||
//make sure zoom is within bounds
|
||||
var gZoom = Math.min(Math.max(gZoom, this.minZoomLevel),
|
||||
this.maxZoomLevel);
|
||||
|
||||
zoom = this.getOLZoomFromGZoom(gZoom);
|
||||
}
|
||||
return zoom;
|
||||
@@ -287,7 +281,7 @@ OpenLayers.Layer.Google.prototype =
|
||||
getOLZoomFromGZoom: function(gZoom) {
|
||||
var zoom = null;
|
||||
if (gZoom != null) {
|
||||
zoom = gZoom;
|
||||
zoom = gZoom - this.minZoomLevel;
|
||||
}
|
||||
return zoom;
|
||||
},
|
||||
@@ -302,7 +296,7 @@ OpenLayers.Layer.Google.prototype =
|
||||
getGZoomFromOLZoom: function(olZoom) {
|
||||
var zoom = null;
|
||||
if (olZoom != null) {
|
||||
zoom = olZoom;
|
||||
zoom = olZoom + this.minZoomLevel;
|
||||
}
|
||||
return zoom;
|
||||
},
|
||||
@@ -416,8 +410,34 @@ OpenLayers.Layer.Google.prototype =
|
||||
}
|
||||
return gLatLngBounds;
|
||||
},
|
||||
|
||||
|
||||
|
||||
addContainerPxFunction: function() {
|
||||
if (typeof GMap2 != "undefined" && !GMap2.fromLatLngToContainerPixel) {
|
||||
|
||||
/** Hack-on function because GMAPS does not give it to us
|
||||
*
|
||||
* @param {GLatLng} gLatLng
|
||||
*
|
||||
* @returns A GPoint specifying gLatLng translated into "Container" coords
|
||||
* @type GPoint
|
||||
*/
|
||||
GMap2.prototype.fromLatLngToContainerPixel = function(gLatLng) {
|
||||
|
||||
// first we translate into "DivPixel"
|
||||
var gPoint = this.fromLatLngToDivPixel(gLatLng);
|
||||
|
||||
// locate the sliding "Div" div
|
||||
// it seems like "b" is the main div
|
||||
var div = this.b.firstChild.firstChild;
|
||||
|
||||
// adjust by the offset of "Div" and voila!
|
||||
gPoint.x += div.offsetLeft;
|
||||
gPoint.y += div.offsetTop;
|
||||
|
||||
return gPoint;
|
||||
};
|
||||
}
|
||||
},
|
||||
/** @final @type String */
|
||||
CLASS_NAME: "OpenLayers.Layer.Google"
|
||||
});
|
||||
}));
|
||||
|
||||
@@ -42,7 +42,6 @@ OpenLayers.Layer.Grid.prototype =
|
||||
destroy: function() {
|
||||
this.clearGrid();
|
||||
this.grid = null;
|
||||
this.alpha = null;
|
||||
this.tileSize = null;
|
||||
OpenLayers.Layer.HTTPRequest.prototype.destroy.apply(this, arguments);
|
||||
},
|
||||
@@ -88,30 +87,6 @@ OpenLayers.Layer.Grid.prototype =
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {String} tileID
|
||||
*
|
||||
* @returns The OpenLayers.Tile with the corresponding ID from the grid.
|
||||
* if no tile is found, returns null
|
||||
* @type OpenLayers.Tile
|
||||
*/
|
||||
getTile: function(tileID) {
|
||||
var foundTile = null;
|
||||
if (this.grid) {
|
||||
|
||||
for(var iRow = 0; iRow < this.grid.length; iRow++) {
|
||||
var row = this.grid[iRow];
|
||||
for(var iCol = 0; iCol < row.length; iCol++) {
|
||||
var tile = row[iCol];
|
||||
if (tile.id == tileID) {
|
||||
foundTile = tile;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return foundTile;
|
||||
},
|
||||
|
||||
/** This function is called whenever the map is moved. All the moving
|
||||
* of actual 'tiles' is done by the map, but moveTo's role is to accept
|
||||
* a bounds and make sure the data that that bounds requires is pre-loaded.
|
||||
@@ -150,6 +125,8 @@ OpenLayers.Layer.Grid.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
* @private
|
||||
*
|
||||
* @returns A Bounds object representing the bounds of all the currently
|
||||
* loaded tiles (including those partially or not at all seen
|
||||
* onscreen)
|
||||
@@ -170,7 +147,7 @@ OpenLayers.Layer.Grid.prototype =
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
_initTiles:function() {
|
||||
var viewSize = this.map.getSize();
|
||||
@@ -246,8 +223,16 @@ OpenLayers.Layer.Grid.prototype =
|
||||
this.spiralTileLoad();
|
||||
},
|
||||
|
||||
/**
|
||||
/**
|
||||
* @private
|
||||
*
|
||||
* Starts at the top right corner of the grid and proceeds in a spiral
|
||||
* towards the center, adding tiles one at a time to the beginning of a
|
||||
* queue.
|
||||
*
|
||||
* Once all the grid's tiles have been added to the queue, we go back
|
||||
* and iterate through the queue (thus reversing the spiral order from
|
||||
* outside-in to inside-out), calling draw() on each tile.
|
||||
*/
|
||||
spiralTileLoad: function() {
|
||||
var tileQueue = new Array();
|
||||
@@ -279,19 +264,25 @@ OpenLayers.Layer.Grid.prototype =
|
||||
break;
|
||||
}
|
||||
|
||||
// if the test grid coordinates are within the bounds of the
|
||||
// grid, get a reference to the tile.
|
||||
var tile = null;
|
||||
if ((testRow < this.grid.length) &&
|
||||
(testCell < this.grid[0].length)) {
|
||||
if ((testRow < this.grid.length) && (testRow >= 0) &&
|
||||
(testCell < this.grid[0].length) && (testCell >= 0)) {
|
||||
tile = this.grid[testRow][testCell];
|
||||
}
|
||||
|
||||
if ((tile != null) && (!tile.queued)) {
|
||||
//add tile to beginning of queue, mark it as queued.
|
||||
tileQueue.unshift(tile);
|
||||
tile.queued = true;
|
||||
|
||||
//restart the directions counter and take on the new coords
|
||||
directionsTried = 0;
|
||||
iRow = testRow;
|
||||
iCell = testCell;
|
||||
} else {
|
||||
//need to try to load a tile in a different direction
|
||||
direction = (direction + 1) % 4;
|
||||
directionsTried++;
|
||||
}
|
||||
@@ -301,6 +292,7 @@ OpenLayers.Layer.Grid.prototype =
|
||||
for(var i=0; i < tileQueue.length; i++) {
|
||||
var tile = tileQueue[i]
|
||||
tile.draw();
|
||||
//mark tile as unqueued for the next time (since tiles are reused)
|
||||
tile.queued = false;
|
||||
}
|
||||
},
|
||||
@@ -320,67 +312,6 @@ OpenLayers.Layer.Grid.prototype =
|
||||
},
|
||||
|
||||
|
||||
/********************************************************/
|
||||
/* */
|
||||
/* Baselayer Functions */
|
||||
/* */
|
||||
/********************************************************/
|
||||
|
||||
/** Calculates based on resolution, center, and mapsize
|
||||
*
|
||||
* @returns A Bounds object which represents the lon/lat bounds of the
|
||||
* current viewPort.
|
||||
* @type OpenLayers.Bounds
|
||||
*/
|
||||
getExtent: function () {
|
||||
var extent = null;
|
||||
|
||||
var center = this.map.getCenter();
|
||||
if (center != null) {
|
||||
|
||||
var res = this.getResolution();
|
||||
var size = this.map.getSize();
|
||||
var w_deg = size.w * res;
|
||||
var h_deg = size.h * res;
|
||||
|
||||
extent = new OpenLayers.Bounds(center.lon - w_deg / 2,
|
||||
center.lat - h_deg / 2,
|
||||
center.lon + w_deg / 2,
|
||||
center.lat + h_deg / 2);
|
||||
|
||||
}
|
||||
|
||||
return extent;
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Bounds} bounds
|
||||
*
|
||||
* @return {int}
|
||||
*/
|
||||
getZoomForExtent: function (bounds) {
|
||||
|
||||
var maxRes = this.map.getMaxResolution();
|
||||
var viewSize = this.map.getSize();
|
||||
|
||||
var width = bounds.getWidth();
|
||||
var height = bounds.getHeight();
|
||||
|
||||
var degPerPixel = (width > height) ? width / viewSize.w
|
||||
: height / viewSize.h;
|
||||
|
||||
var zoom = Math.floor( (Math.log(maxRes/degPerPixel)) / Math.log(2) );
|
||||
|
||||
var maxZoomLevel = this.map.getMaxZoomLevel();
|
||||
var minZoomLevel = this.map.getMinZoomLevel();
|
||||
|
||||
//make sure zoom is within bounds
|
||||
zoom = Math.min( Math.max(zoom, minZoomLevel),
|
||||
maxZoomLevel );
|
||||
|
||||
return zoom;
|
||||
},
|
||||
|
||||
/** go through and remove all tiles from the grid, calling
|
||||
* destroy() on each of them to kill circular references
|
||||
*
|
||||
@@ -461,7 +392,7 @@ OpenLayers.Layer.Grid.prototype =
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/** @final @type String */
|
||||
CLASS_NAME: "OpenLayers.Layer.Grid"
|
||||
});
|
||||
|
||||
@@ -36,10 +36,6 @@ OpenLayers.Layer.HTTPRequest.prototype =
|
||||
this.params = Object.extend( new Object(), params);
|
||||
},
|
||||
|
||||
setMap: function(map) {
|
||||
OpenLayers.Layer.prototype.setMap.apply(this, arguments);
|
||||
this.initResolutions();
|
||||
},
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@@ -130,37 +126,6 @@ OpenLayers.Layer.HTTPRequest.prototype =
|
||||
}
|
||||
return requestString;
|
||||
},
|
||||
|
||||
initResolutions: function() {
|
||||
if (this.scales != null) {
|
||||
this.resolutions = new Array();
|
||||
for(var i = 0; i < this.scales.length; i++)
|
||||
this.resolutions[i] = OpenLayers.Util.getResolutionFromScale(this.scales[i], this.units);
|
||||
this.maxZoomLevel = this.resolutions.length;
|
||||
} else if (this.resolutions != null) {
|
||||
this.maxZoomLevel = this.resolutions.length;
|
||||
} else {
|
||||
this.resolutions = new Array();
|
||||
if (this.minScale)
|
||||
this.maxResolution = OpenLayers.Util.getResolutionFromScale(this.minScale, this.units);
|
||||
var maxRes = this.getMaxResolution();
|
||||
if (this.maxScale) {
|
||||
/* This will cause this.map.getMaxZoomLevel() to be set the next time
|
||||
* it is called, which means that the next portion here will succeed. */
|
||||
var minRes = OpenLayers.Util.getResolutionFromScale(this.maxScale);
|
||||
this.maxZoomLevel = Math.floor(Math.log(maxRes/minRes) / Math.log(2));
|
||||
}
|
||||
for (var i=this.getMinZoomLevel(); i <= this.getMaxZoomLevel(); i++) {
|
||||
this.resolutions.push(maxRes / Math.pow(2, i));
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
getResolution: function() {
|
||||
var zoom = this.map.getZoom();
|
||||
|
||||
return this.resolutions[zoom];
|
||||
},
|
||||
|
||||
/** @final @type String */
|
||||
CLASS_NAME: "OpenLayers.Layer.HTTPRequest"
|
||||
|
||||
@@ -49,7 +49,7 @@ OpenLayers.Layer.KaMap.prototype =
|
||||
*/
|
||||
getURL: function (bounds) {
|
||||
var mapRes = this.map.getResolution();
|
||||
var scale = this.map.getScale();
|
||||
var scale = Math.round((this.map.getScale() * 10000)) / 10000;
|
||||
var cellSize = new OpenLayers.Size(mapRes*this.tileSize.w, mapRes*this.tileSize.h);
|
||||
var pX = Math.round(((bounds.left) / cellSize.w) * this.tileSize.w);
|
||||
var pY = -Math.round(((bounds.top) / cellSize.h) * this.tileSize.h);
|
||||
|
||||
338
lib/OpenLayers/Layer/MultiMap.js
Normal file
@@ -0,0 +1,338 @@
|
||||
/* 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/Layer/EventPane.js
|
||||
*/
|
||||
OpenLayers.Layer.MultiMap = Class.create();
|
||||
OpenLayers.Layer.MultiMap.prototype =
|
||||
Object.extend( new OpenLayers.Layer.EventPane(), {
|
||||
|
||||
/** @type MMMap */
|
||||
multimap: null,
|
||||
|
||||
/** @type int */
|
||||
minZoomLevel: 1,
|
||||
|
||||
/** @type int */
|
||||
maxZoomLevel: 17,
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*
|
||||
* @param {String} name
|
||||
*/
|
||||
initialize:function(name) {
|
||||
OpenLayers.Layer.EventPane.prototype.initialize.apply(this, arguments);
|
||||
|
||||
this.numZoomLevels = this.maxZoomLevel - this.minZoomLevel + 1;
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Map} map
|
||||
*/
|
||||
setMap:function(map) {
|
||||
OpenLayers.Layer.EventPane.prototype.setMap.apply(this, arguments);
|
||||
|
||||
// once our layer has been added to the map, we can load the multimap
|
||||
this.loadMMMap();
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Bounds} bounds
|
||||
* @param {Boolean} zoomChanged
|
||||
* @param {Boolean} minor
|
||||
*/
|
||||
moveTo:function(bounds, zoomChanged, minor) {
|
||||
|
||||
if (this.multimap != null) {
|
||||
var olCenter = this.map.getCenter();
|
||||
var mmCenter = this.getMMLatLongFromOLLonLat(olCenter);
|
||||
|
||||
if (zoomChanged) {
|
||||
var olZoom = this.map.getZoom();
|
||||
var mmZoom = this.getMMZoomFromOLZoom(olZoom);
|
||||
|
||||
this.multimap.goToPosition(mmCenter, mmZoom);
|
||||
} else {
|
||||
this.multimap.goToPosition(mmCenter);
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
loadMMMap:function() {
|
||||
|
||||
try {
|
||||
// create MMMap, hide nav controls
|
||||
this.multimap = new MultimapViewer(this.div);
|
||||
} catch (e) {
|
||||
// do nothing this is to keep from crashing
|
||||
// if the MM library was not loaded.
|
||||
}
|
||||
|
||||
|
||||
if (this.multimap == null) {
|
||||
this.loadWarningMessage();
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/** If we can't load the multimap, then display an error message to the
|
||||
* user and tell them where to go for help.
|
||||
*
|
||||
* @private
|
||||
*
|
||||
*/
|
||||
loadWarningMessage:function() {
|
||||
|
||||
this.div.style.backgroundColor = "darkblue";
|
||||
|
||||
var html = "";
|
||||
html += "The MM Layer was unable to load correctly.<br>";
|
||||
html += "<br>";
|
||||
html += "To get rid of this message, click on the MM Layer's "
|
||||
html += "tab in the layer switcher in the upper-right corner.<br>";
|
||||
html += "<br>";
|
||||
html += "Most likely, this is because the MM library";
|
||||
html += " script was either not correctly included.<br>";
|
||||
html += "<br>";
|
||||
html += "Demmlopers: For help getting this working correctly, ";
|
||||
html += "<a href='http://trac.openlayers.org/wiki/MultiMapLayer' "
|
||||
html += "target='_blank'>";
|
||||
html += "click here";
|
||||
html += "</a>";
|
||||
|
||||
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("mmWarning",
|
||||
topLeft,
|
||||
size,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
"auto");
|
||||
|
||||
div.style.padding = "7px";
|
||||
div.style.backgroundColor = "yellow";
|
||||
|
||||
div.innerHTML = html;
|
||||
this.div.appendChild(div);
|
||||
},
|
||||
|
||||
|
||||
/********************************************************/
|
||||
/* */
|
||||
/* Baselayer Functions */
|
||||
/* */
|
||||
/********************************************************/
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Pixel} viewPortPx
|
||||
*
|
||||
* @returns An OpenLayers.LonLat which is the passed-in view port
|
||||
* OpenLayers.Pixel, translated into lon/lat by MM
|
||||
* If multimap is not loaded, returns null.
|
||||
* @type OpenLayers.LonLat
|
||||
*/
|
||||
getLonLatFromViewPortPx: function (viewPortPx) {
|
||||
var lonlat = null;
|
||||
if (this.multimap != null) {
|
||||
var pixel = this.getPixelFromOLPixel(viewPortPx);
|
||||
var zoom = this.multimap.getZoomFactor();
|
||||
pixel.x = pixel.x - (this.map.getSize().w/2);
|
||||
pixel.y = pixel.y - (this.map.getSize().h/2);
|
||||
var mmLatLong = this.multimap.getMapPositionAt(pixel);
|
||||
lonlat = this.getOLLonLatFromMMLatLong(mmLatLong);
|
||||
}
|
||||
return lonlat;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.LonLat} lonlat
|
||||
*
|
||||
* @returns An OpenLayers.Pixel which is the passed-in OpenLayers.LonLat,
|
||||
* translated into view port pixels BY MM
|
||||
* If multimap is not loaded, returns null.
|
||||
* @type OpenLayers.Pixel
|
||||
*/
|
||||
getViewPortPxFromLonLat: function (lonlat) {
|
||||
var viewPortPx = null;
|
||||
if (this.multimap != null) {
|
||||
var mmLatLong = this.getMMLatLongFromOLLonLat(lonlat);
|
||||
var pixel = this.multimap.geoPosToContainerPixels(mmLatLong);
|
||||
viewPortPx = this.getOLPixelFromPixel(pixel);
|
||||
}
|
||||
return viewPortPx;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Bounds} bounds
|
||||
*
|
||||
* @returns Corresponding zoom lemml for a specified Bounds.
|
||||
* If multimap is not loaded, returns null.
|
||||
* @type int
|
||||
*/
|
||||
getZoomForExtent: function (bounds) {
|
||||
|
||||
var zoom = null;
|
||||
if (this.multimap != null) {
|
||||
var maxRes = this.map.getMaxResolution();
|
||||
var viewSize = this.map.getSize();
|
||||
|
||||
var width = bounds.getWidth();
|
||||
var height = bounds.getHeight();
|
||||
|
||||
var degPerPixel = (width > height) ? width / viewSize.w
|
||||
: height / viewSize.h;
|
||||
|
||||
var mmZoom = Math.floor( (Math.log(maxRes/degPerPixel)) /
|
||||
Math.log(2) );
|
||||
|
||||
//make sure zoom is within bounds
|
||||
var mmZoom = Math.min(Math.max(mmZoom, this.minZoomLevel),
|
||||
this.maxZoomLevel);
|
||||
|
||||
zoom = this.getOLZoomFromMMZoom(mmZoom);
|
||||
}
|
||||
return zoom;
|
||||
},
|
||||
|
||||
|
||||
/********************************************************/
|
||||
/* */
|
||||
/* Translation Functions */
|
||||
/* */
|
||||
/* The following functions translate GMaps and OL */
|
||||
/* formats for Pixel, LonLat, Bounds, and Zoom */
|
||||
/* */
|
||||
/********************************************************/
|
||||
|
||||
//
|
||||
// TRANSLATION: GZoom <-> OpenLayers Zoom
|
||||
//
|
||||
|
||||
/**
|
||||
* @param {int} mmZoom
|
||||
*
|
||||
* @returns An OpenLayers Zoom lemml, translated from the passed in mmZoom
|
||||
* Returns null if null value is passed in
|
||||
* @type int
|
||||
*/
|
||||
getOLZoomFromMMZoom: function(mmZoom) {
|
||||
if (mmZoom) return mmZoom - 1;
|
||||
return null;
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {int} olZoom
|
||||
*
|
||||
* @returns A MMZoom lemml, translated from the passed in olZoom
|
||||
* Returns null if null value is passed in
|
||||
* @type int
|
||||
*/
|
||||
getMMZoomFromOLZoom: function(olZoom) {
|
||||
if (olZoom) return olZoom + 1;
|
||||
return null;
|
||||
},
|
||||
|
||||
//
|
||||
// TRANSLATION: MMLatLong <-> LonLat
|
||||
//
|
||||
|
||||
/**
|
||||
* @param {MMLatLong} mmLatLong
|
||||
*
|
||||
* @returns An OpenLayers.LonLat, translated from the passed in MMLatLong
|
||||
* Returns null if null value is passed in
|
||||
* @type OpenLayers.LonLat
|
||||
*/
|
||||
getOLLonLatFromMMLatLong: function(mmLatLong) {
|
||||
var olLonLat = null;
|
||||
if (mmLatLong != null) {
|
||||
olLonLat = new OpenLayers.LonLat(mmLatLong.lon,
|
||||
mmLatLong.lat);
|
||||
}
|
||||
return olLonLat;
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.LonLat} olLonLat
|
||||
*
|
||||
* @returns A MMLatLong, translated from the passed in OpenLayers.LonLat
|
||||
* Returns null if null value is passed in
|
||||
* @type MMLatLong
|
||||
*/
|
||||
getMMLatLongFromOLLonLat: function(olLonLat) {
|
||||
var mmLatLong = null;
|
||||
if (olLonLat != null) {
|
||||
mmLatLong = new MMLatLon(olLonLat.lat, olLonLat.lon);
|
||||
}
|
||||
return mmLatLong;
|
||||
},
|
||||
|
||||
|
||||
//
|
||||
// TRANSLATION: Pixel <-> OpenLayers.Pixel
|
||||
//
|
||||
|
||||
/**
|
||||
* @param {Pixel} pixel
|
||||
*
|
||||
* @returns An OpenLayers.Pixel, translated from the passed in Pixel
|
||||
* Returns null if null value is passed in
|
||||
* @type OpenLayers.Pixel
|
||||
*/
|
||||
getOLPixelFromPixel: function(pixel) {
|
||||
var olPixel = null;
|
||||
if (pixel != null) {
|
||||
olPixel = new OpenLayers.Pixel(pixel.x, pixel.y);
|
||||
}
|
||||
return olPixel;
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Pixel} olPixel
|
||||
*
|
||||
* @returns A Pixel, translated from the passed in OpenLayers.Pixel
|
||||
* Returns null if null value is passed in
|
||||
*
|
||||
* As it turns out, the only specifications we can see for the
|
||||
* MM-compatible Pixel is an x & y property, which emmry
|
||||
* OpenLayers.Pixel has by default. So just leamm it as-is.
|
||||
*
|
||||
* @type Pixel
|
||||
*/
|
||||
getPixelFromOLPixel: function(olPixel) {
|
||||
var pixel = null;
|
||||
if (olPixel != null) {
|
||||
pixel = new MMPoint(olPixel.x, olPixel.y);
|
||||
}
|
||||
return pixel;
|
||||
},
|
||||
|
||||
destroy: function() {
|
||||
this.multimap = null;
|
||||
OpenLayers.Layer.EventPane.prototype.destroy.apply(this, arguments);
|
||||
},
|
||||
|
||||
/** @final @type String */
|
||||
CLASS_NAME: "OpenLayers.Layer.MultiMap"
|
||||
});
|
||||
@@ -11,12 +11,6 @@ OpenLayers.Layer.Text = Class.create();
|
||||
OpenLayers.Layer.Text.prototype =
|
||||
Object.extend( new OpenLayers.Layer.Markers(), {
|
||||
|
||||
/** Text layer is never a base layer.
|
||||
*
|
||||
* @type Boolean
|
||||
*/
|
||||
isBaseLayer: false,
|
||||
|
||||
/** store url of text file - this should be specified in the
|
||||
* "options" hashtable
|
||||
* @type str */
|
||||
|
||||
@@ -9,11 +9,18 @@
|
||||
*/
|
||||
OpenLayers.Layer.VirtualEarth = Class.create();
|
||||
OpenLayers.Layer.VirtualEarth.prototype =
|
||||
Object.extend( new OpenLayers.Layer.EventPane(), {
|
||||
|
||||
Object.extend( new OpenLayers.Layer.EventPane(),
|
||||
Object.extend( new OpenLayers.Layer.FixedZoomLevels(), {
|
||||
|
||||
/** @type VEMap */
|
||||
vemap: null,
|
||||
|
||||
/** @type int */
|
||||
minZoomLevel: 1,
|
||||
|
||||
/** @type int */
|
||||
maxZoomLevel: 17,
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*
|
||||
@@ -21,6 +28,10 @@ OpenLayers.Layer.VirtualEarth.prototype =
|
||||
*/
|
||||
initialize:function(name) {
|
||||
OpenLayers.Layer.EventPane.prototype.initialize.apply(this, arguments);
|
||||
OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,
|
||||
arguments);
|
||||
|
||||
this.numZoomLevels = this.maxZoomLevel - this.minZoomLevel + 1;
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -200,24 +211,26 @@ OpenLayers.Layer.VirtualEarth.prototype =
|
||||
*/
|
||||
getZoomForExtent: function (bounds) {
|
||||
|
||||
var maxRes = this.map.getMaxResolution();
|
||||
var viewSize = this.map.getSize();
|
||||
|
||||
var width = bounds.getWidth();
|
||||
var height = bounds.getHeight();
|
||||
|
||||
var degPerPixel = (width > height) ? width / viewSize.w
|
||||
: height / viewSize.h;
|
||||
|
||||
var zoom = Math.floor( (Math.log(maxRes/degPerPixel)) / Math.log(2) );
|
||||
|
||||
var maxZoomLevel = this.map.getMaxZoomLevel();
|
||||
var minZoomLevel = this.map.getMinZoomLevel();
|
||||
var zoom = null;
|
||||
if (this.vemap != null) {
|
||||
var maxRes = this.map.getMaxResolution();
|
||||
var viewSize = this.map.getSize();
|
||||
|
||||
//make sure zoom is within bounds
|
||||
zoom = Math.min( Math.max(zoom, minZoomLevel),
|
||||
maxZoomLevel );
|
||||
|
||||
var width = bounds.getWidth();
|
||||
var height = bounds.getHeight();
|
||||
|
||||
var degPerPixel = (width > height) ? width / viewSize.w
|
||||
: height / viewSize.h;
|
||||
|
||||
var veZoom = Math.floor( (Math.log(maxRes/degPerPixel)) /
|
||||
Math.log(2) );
|
||||
|
||||
//make sure zoom is within bounds
|
||||
var veZoom = Math.min(Math.max(veZoom, this.minZoomLevel),
|
||||
this.maxZoomLevel);
|
||||
|
||||
zoom = this.getOLZoomFromVEZoom(veZoom);
|
||||
}
|
||||
return zoom;
|
||||
},
|
||||
|
||||
@@ -245,7 +258,7 @@ OpenLayers.Layer.VirtualEarth.prototype =
|
||||
getOLZoomFromVEZoom: function(veZoom) {
|
||||
var zoom = null;
|
||||
if (veZoom != null) {
|
||||
zoom = veZoom;
|
||||
zoom = veZoom - this.minZoomLevel;
|
||||
}
|
||||
return zoom;
|
||||
},
|
||||
@@ -260,7 +273,7 @@ OpenLayers.Layer.VirtualEarth.prototype =
|
||||
getVEZoomFromOLZoom: function(olZoom) {
|
||||
var zoom = null;
|
||||
if (olZoom != null) {
|
||||
zoom = olZoom;
|
||||
zoom = olZoom + this.minZoomLevel;
|
||||
}
|
||||
return zoom;
|
||||
},
|
||||
@@ -342,4 +355,4 @@ OpenLayers.Layer.VirtualEarth.prototype =
|
||||
|
||||
/** @final @type String */
|
||||
CLASS_NAME: "OpenLayers.Layer.VirtualEarth"
|
||||
});
|
||||
}));
|
||||
|
||||
@@ -18,6 +18,8 @@ OpenLayers.Layer.WFS.prototype =
|
||||
* @type Boolean
|
||||
*/
|
||||
isBaseLayer: false,
|
||||
|
||||
buffer: 1,
|
||||
|
||||
/** Allow the user to specify special classes for features and tiles.
|
||||
*
|
||||
@@ -157,10 +159,10 @@ OpenLayers.Layer.WFS.prototype =
|
||||
*
|
||||
* Once params have been changed, we will need to re-init our tiles
|
||||
*
|
||||
* @param {Object} params Hashtable of new params to use
|
||||
* @param {Object} newParams Hashtable of new params to use
|
||||
*/
|
||||
mergeNewParams:function(params) {
|
||||
var upperParams = OpenLayers.Util.upperCaseObject(params);
|
||||
mergeNewParams:function(newParams) {
|
||||
var upperParams = OpenLayers.Util.upperCaseObject(newParams);
|
||||
var newArguments = [upperParams];
|
||||
OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this, newArguments);
|
||||
|
||||
@@ -171,7 +173,7 @@ OpenLayers.Layer.WFS.prototype =
|
||||
|
||||
/** combine the layer's url with its params and these newParams.
|
||||
*
|
||||
* Add the SRS parameter from getProjection() -- this is probably
|
||||
* Add the SRS parameter from 'projection' -- this is probably
|
||||
* more eloquently done via a setProjection() method, but this
|
||||
* works for now and always.
|
||||
*
|
||||
|
||||
@@ -21,9 +21,6 @@ OpenLayers.Layer.WMS.prototype =
|
||||
format: "image/jpeg"
|
||||
},
|
||||
|
||||
/** @type Boolean */
|
||||
isBaseLayer: null,
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*
|
||||
@@ -48,9 +45,12 @@ OpenLayers.Layer.WMS.prototype =
|
||||
);
|
||||
}
|
||||
|
||||
// if the layer is transparent, it will be an overlay
|
||||
this.isBaseLayer = ((this.params.TRANSPARENT != "true") &&
|
||||
(this.params.TRANSPARENT != true));
|
||||
// unless explicitly set in options, if the layer is transparent,
|
||||
// it will be an overlay
|
||||
if ((options == null) || !(options.isBaseLayer)) {
|
||||
this.isBaseLayer = ((this.params.TRANSPARENT != "true") &&
|
||||
(this.params.TRANSPARENT != true));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -121,10 +121,10 @@ OpenLayers.Layer.WMS.prototype =
|
||||
*
|
||||
* Once params have been changed, we will need to re-init our tiles
|
||||
*
|
||||
* @param {Object} params Hashtable of new params to use
|
||||
* @param {Object} newParams Hashtable of new params to use
|
||||
*/
|
||||
mergeNewParams:function(params) {
|
||||
var upperParams = OpenLayers.Util.upperCaseObject(params);
|
||||
mergeNewParams:function(newParams) {
|
||||
var upperParams = OpenLayers.Util.upperCaseObject(newParams);
|
||||
var newArguments = [upperParams];
|
||||
OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this,
|
||||
newArguments);
|
||||
@@ -136,7 +136,7 @@ OpenLayers.Layer.WMS.prototype =
|
||||
|
||||
/** combine the layer's url with its params and these newParams.
|
||||
*
|
||||
* Add the SRS parameter from getProjection() -- this is probably
|
||||
* Add the SRS parameter from projection -- this is probably
|
||||
* more eloquently done via a setProjection() method, but this
|
||||
* works for now and always.
|
||||
*
|
||||
|
||||
@@ -22,10 +22,6 @@ OpenLayers.Layer.WMS.Untiled.prototype =
|
||||
format: "image/jpeg"
|
||||
},
|
||||
|
||||
|
||||
/** @type Boolean */
|
||||
isBaseLayer: null,
|
||||
|
||||
/** @type DOMElement */
|
||||
imgDiv: null,
|
||||
|
||||
@@ -37,12 +33,12 @@ OpenLayers.Layer.WMS.Untiled.prototype =
|
||||
* @param {String} url
|
||||
* @param {Object} params
|
||||
*/
|
||||
initialize: function(name, url, params) {
|
||||
initialize: function(name, url, params, options) {
|
||||
var newArguments = new Array();
|
||||
if (arguments.length > 0) {
|
||||
//uppercase params
|
||||
params = OpenLayers.Util.upperCaseObject(params);
|
||||
newArguments.push(name, url, params);
|
||||
newArguments.push(name, url, params, options);
|
||||
}
|
||||
OpenLayers.Layer.HTTPRequest.prototype.initialize.apply(this,
|
||||
newArguments);
|
||||
@@ -54,10 +50,12 @@ OpenLayers.Layer.WMS.Untiled.prototype =
|
||||
);
|
||||
}
|
||||
|
||||
// if the layer is transparent, it will be an overlay
|
||||
this.isBaseLayer = ((this.params.TRANSPARENT != "true") &&
|
||||
(this.params.TRANSPARENT != true));
|
||||
|
||||
// unless explicitly set in options, if the layer is transparent,
|
||||
// it will be an overlay
|
||||
if ((options == null) || (options.isBaseLayer == null)) {
|
||||
this.isBaseLayer = ((this.params.TRANSPARENT != "true") &&
|
||||
(this.params.TRANSPARENT != true));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -177,11 +175,32 @@ OpenLayers.Layer.WMS.Untiled.prototype =
|
||||
* @param {Object} newParams
|
||||
*/
|
||||
mergeNewParams:function(newParams) {
|
||||
var upperParams = OpenLayers.Util.upperCaseObject(newParams);
|
||||
var newArguments = [upperParams];
|
||||
OpenLayers.Layer.HTTPRequest.prototype.mergeNewParams.apply(this,
|
||||
arguments);
|
||||
newArguments);
|
||||
//redraw
|
||||
this.moveTo();
|
||||
},
|
||||
|
||||
/** combine the layer's url with its params and these newParams.
|
||||
*
|
||||
* Add the SRS parameter from 'projection' -- this is probably
|
||||
* more eloquently done via a setProjection() method, but this
|
||||
* works for now and always.
|
||||
*
|
||||
* @param {Object} newParams
|
||||
*
|
||||
* @type String
|
||||
*/
|
||||
getFullRequestString:function(newParams) {
|
||||
var projection = this.map.getProjection();
|
||||
this.params.SRS = (projection == "none") ? null : projection;
|
||||
|
||||
return OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(
|
||||
this, arguments);
|
||||
},
|
||||
|
||||
/** This function first removes the previous image div, then adds a new
|
||||
* one according to the transparency property.
|
||||
*
|
||||
|
||||
@@ -25,11 +25,11 @@ OpenLayers.Layer.WorldWind.prototype =
|
||||
|
||||
zoomLevels: null,
|
||||
|
||||
initialize: function(name, url, lzd, zoomLevels, params) {
|
||||
initialize: function(name, url, lzd, zoomLevels, params, options) {
|
||||
this.lzd = lzd;
|
||||
this.zoomLevels = zoomLevels;
|
||||
var newArguments = new Array();
|
||||
newArguments.push(name, url, params);
|
||||
newArguments.push(name, url, params, options);
|
||||
OpenLayers.Layer.Grid.prototype.initialize.apply(this, newArguments);
|
||||
this.params = (params ? params : {});
|
||||
if (arguments.length > 0 && params) {
|
||||
@@ -46,19 +46,16 @@ OpenLayers.Layer.WorldWind.prototype =
|
||||
return new OpenLayers.Tile.Image(this, position, bounds,
|
||||
url, this.tileSize);
|
||||
} else {
|
||||
var tile = new Object();
|
||||
tile.draw = function() {};
|
||||
tile.destroy = function() {};
|
||||
tile.bounds = bounds;
|
||||
tile.bounds = position;
|
||||
return tile;
|
||||
return new OpenLayers.Tile.Image(this, position, bounds,
|
||||
OpenLayers.Util.getImagesLocation() + "blank.gif",
|
||||
this.tileSize);
|
||||
}
|
||||
},
|
||||
|
||||
getZoom: function () {
|
||||
var zoom = this.map.getZoom();
|
||||
var extent = this.map.getMaxExtent();
|
||||
zoom = zoom - Math.log(this.map.maxResolution / (this.lzd/512))/Math.log(2);
|
||||
zoom = zoom - Math.log(this.maxResolution / (this.lzd/512))/Math.log(2);
|
||||
return zoom;
|
||||
},
|
||||
|
||||
@@ -71,14 +68,21 @@ OpenLayers.Layer.WorldWind.prototype =
|
||||
* @type String
|
||||
*/
|
||||
getURL: function (bounds) {
|
||||
var zoom = this.getZoom();
|
||||
var extent = this.map.getMaxExtent();
|
||||
var deg = this.lzd/Math.pow(2,this.getZoom());
|
||||
var x = Math.floor((bounds.left - extent.left)/deg);
|
||||
var y = Math.floor((bounds.bottom - extent.bottom)/deg);
|
||||
return this.getFullRequestString(
|
||||
if (this.map.getResolution() <= (this.lzd/512)
|
||||
&& this.getZoom() <= this.zoomLevels) {
|
||||
return this.getFullRequestString(
|
||||
{ L: zoom,
|
||||
X: x,
|
||||
Y: y
|
||||
});
|
||||
} else {
|
||||
return OpenLayers.Util.getImagesLocation() + "blank.gif";
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
|
||||
@@ -2,149 +2,318 @@
|
||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
|
||||
* text of the license. */
|
||||
|
||||
// load Yahoo map control script
|
||||
document.write("<script src='http://api.maps.yahoo.com/ajaxymap?v=3.0&appid=euzuro-openlayers'></script>");
|
||||
|
||||
/**
|
||||
* @class
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* @requires OpenLayers/Layer.js
|
||||
*/
|
||||
OpenLayers.Layer.Yahoo = Class.create();
|
||||
OpenLayers.Layer.Yahoo.prototype = Object.extend( new OpenLayers.Layer(), {
|
||||
|
||||
/** Yahoo layer is always a base layer.
|
||||
*
|
||||
* @type Boolean
|
||||
*/
|
||||
isBaseLayer: true,
|
||||
* @requires OpenLayers/Layer/EventPane.js
|
||||
*/
|
||||
OpenLayers.Layer.Yahoo = Class.create();
|
||||
OpenLayers.Layer.Yahoo.prototype =
|
||||
Object.extend( new OpenLayers.Layer.EventPane(), {
|
||||
|
||||
/** @type YMap */
|
||||
yahoomap: null,
|
||||
|
||||
/** @type Boolean */
|
||||
isFixed: true,
|
||||
|
||||
/** @type GMap2 gmap stores the Google Map element */
|
||||
ymap:null,
|
||||
|
||||
/** @type Boolean */
|
||||
dragging:false,
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*
|
||||
* @param {String} name
|
||||
*/
|
||||
initialize: function(name) {
|
||||
OpenLayers.Layer.prototype.initialize.apply(this, [name]);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Map} map
|
||||
*/
|
||||
setMap:function(map) {
|
||||
OpenLayers.Layer.prototype.setMap.apply(this, arguments);
|
||||
|
||||
// once our layer has been added to the map, we can create the vemap
|
||||
this.map.events.register("addlayer", this, this.loadYMap);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Bounds} bounds
|
||||
/** @type int */
|
||||
minZoomLevel: 0,
|
||||
|
||||
/** @type int */
|
||||
maxZoomLevel: 15,
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*
|
||||
* @param {String} name
|
||||
*/
|
||||
initialize:function(name) {
|
||||
OpenLayers.Layer.EventPane.prototype.initialize.apply(this, arguments);
|
||||
|
||||
this.numZoomLevels = this.maxZoomLevel - this.minZoomLevel + 1;
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Map} map
|
||||
*/
|
||||
setMap:function(map) {
|
||||
OpenLayers.Layer.EventPane.prototype.setMap.apply(this, arguments);
|
||||
|
||||
// once our layer has been added to the map, we can load the yahoomap
|
||||
this.loadYMap();
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Bounds} bounds
|
||||
* @param {Boolean} zoomChanged
|
||||
* @param {Boolean} minor
|
||||
*/
|
||||
moveTo:function(bounds, zoomChanged, minor) {
|
||||
|
||||
if ((this.ymap != null) && (!this.dragging)) {
|
||||
|
||||
var olCenter = this.map.getCenter();
|
||||
var yCenter = this.getYMapCenter();
|
||||
|
||||
var olZoom = this.map.getZoom();
|
||||
var yZoom = this.ymap.getZoomLevel();
|
||||
|
||||
if ((!olCenter.equals(yCenter)) || (( 16 - olZoom) != yZoom)) {
|
||||
this.ymap.drawZoomAndCenter(new YGeoPoint(olCenter.lat, olCenter.lon),
|
||||
16 - olZoom);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
loadYMap:function() {
|
||||
// create div and set to same size as map
|
||||
var yDiv = OpenLayers.Util.createDiv(this.name);
|
||||
var sz = this.map.getSize();
|
||||
yDiv.style.width = sz.w;
|
||||
yDiv.style.height = sz.h;
|
||||
this.div.appendChild(yDiv);
|
||||
|
||||
// create GMap, hide nav controls
|
||||
this.ymap = new YMap(this.div);
|
||||
|
||||
// catch pans and zooms from GMap
|
||||
YEvent.Capture(this.ymap,
|
||||
EventsList.endPan,
|
||||
this.catchPanZoom,
|
||||
this);
|
||||
|
||||
// catch pans and zooms from GMap
|
||||
YEvent.Capture(this.ymap,
|
||||
EventsList.endAutoPan,
|
||||
this.catchPanZoom,
|
||||
this);
|
||||
|
||||
|
||||
// attach to the drag start and end and we<77>ll set a flag so that
|
||||
// we dont get recursivity. this is because the events fall through
|
||||
// the gmaps div and into the main layer div
|
||||
YEvent.Capture(this.ymap,
|
||||
EventsList.startPan,
|
||||
this.dragStart,
|
||||
this);
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
dragStart: function() {
|
||||
this.dragging = true;
|
||||
},
|
||||
|
||||
/**
|
||||
* @private
|
||||
*
|
||||
* @param {Event} e
|
||||
*/
|
||||
catchPanZoom: function(e) {
|
||||
this.dragging = false;
|
||||
|
||||
var olCenter = this.getYMapCenter();
|
||||
var yZoom = this.ymap.getZoomLevel();
|
||||
|
||||
this.map.setCenter(olCenter, 16 - yZoom);
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* @private
|
||||
*
|
||||
* @returns An OpenLayers.LonLat with the center of the ymap, or null if
|
||||
* the YMap has not been centered yet
|
||||
* @type OpenLayers.LonLat
|
||||
*/
|
||||
getYMapCenter:function() {
|
||||
var olCenter = null;
|
||||
var yCenter = this.ymap.getCenterLatLon();
|
||||
if (yCenter != null) {
|
||||
olCenter = new OpenLayers.LonLat(yCenter.Lon, yCenter.Lat);
|
||||
}
|
||||
return olCenter;
|
||||
},
|
||||
|
||||
|
||||
/** @final @type String */
|
||||
CLASS_NAME: "OpenLayers.Layer.Yahoo"
|
||||
});
|
||||
|
||||
if (this.yahoomap != null) {
|
||||
var olCenter = this.map.getCenter();
|
||||
var mmCenter = this.getYLatLongFromOLLonLat(olCenter);
|
||||
|
||||
if (zoomChanged) {
|
||||
var olZoom = this.map.getZoom();
|
||||
var mmZoom = this.getYZoomFromOLZoom(olZoom);
|
||||
this.yahoomap.setZoomLevel(mmZoom);
|
||||
}
|
||||
this.yahoomap.drawZoomAndCenter(mmCenter, mmZoom);
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
loadYMap:function() {
|
||||
this.yahoomap = new YMap(this.div);
|
||||
|
||||
|
||||
if (this.yahoomap == null) {
|
||||
this.loadWarningMessage();
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/** If we can't load the yahoomap, then display an error message to the
|
||||
* user and tell them where to go for help.
|
||||
*
|
||||
* @private
|
||||
*
|
||||
*/
|
||||
loadWarningMessage:function() {
|
||||
|
||||
this.div.style.backgroundColor = "darkblue";
|
||||
|
||||
var html = "";
|
||||
html += "The Y Layer was unable to load correctly.<br>";
|
||||
html += "<br>";
|
||||
html += "To get rid of this message, click on the Y Layer's "
|
||||
html += "tab in the layer switcher in the upper-right corner.<br>";
|
||||
html += "<br>";
|
||||
html += "Most likely, this is because the Y library";
|
||||
html += " script was either not correctly included.<br>";
|
||||
html += "<br>";
|
||||
html += "Demmlopers: For help getting this working correctly, ";
|
||||
html += "<a href='http://trac.openlayers.org/wiki/YahooLayer' "
|
||||
html += "target='_blank'>";
|
||||
html += "click here";
|
||||
html += "</a>";
|
||||
|
||||
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("mmWarning",
|
||||
topLeft,
|
||||
size,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
"auto");
|
||||
|
||||
div.style.padding = "7px";
|
||||
div.style.backgroundColor = "yellow";
|
||||
|
||||
div.innerHTML = html;
|
||||
this.div.appendChild(div);
|
||||
},
|
||||
|
||||
|
||||
/********************************************************/
|
||||
/* */
|
||||
/* Baselayer Functions */
|
||||
/* */
|
||||
/********************************************************/
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Pixel} viewPortPx
|
||||
*
|
||||
* @returns An OpenLayers.LonLat which is the passed-in view port
|
||||
* OpenLayers.Pixel, translated into lon/lat by Y
|
||||
* If yahoomap is not loaded, returns null.
|
||||
* @type OpenLayers.LonLat
|
||||
*/
|
||||
getLonLatFromViewPortPx: function (viewPortPx) {
|
||||
var lonlat = null;
|
||||
if (this.yahoomap != null) {
|
||||
var pixel = this.getPixelFromOLPixel(viewPortPx);
|
||||
var mmLatLong = this.yahoomap.convertXYLatLon(pixel);
|
||||
lonlat = this.getOLLonLatFromYLatLong(mmLatLong);
|
||||
}
|
||||
return lonlat;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.LonLat} lonlat
|
||||
*
|
||||
* @returns An OpenLayers.Pixel which is the passed-in OpenLayers.LonLat,
|
||||
* translated into view port pixels BY Y
|
||||
* If yahoomap is not loaded, returns null.
|
||||
* @type OpenLayers.Pixel
|
||||
*/
|
||||
getViewPortPxFromLonLat: function (lonlat) {
|
||||
var viewPortPx = null;
|
||||
if (this.yahoomap != null) {
|
||||
var mmLatLong = this.getYLatLongFromOLLonLat(lonlat);
|
||||
var pixel = this.yahoomap.convertLatLonXY(mmLatLong);
|
||||
viewPortPx = this.getOLPixelFromPixel(pixel);
|
||||
}
|
||||
return viewPortPx;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Bounds} bounds
|
||||
*
|
||||
* @returns Corresponding zoom lemml for a specified Bounds.
|
||||
* If yahoomap is not loaded, returns null.
|
||||
* @type int
|
||||
*/
|
||||
getZoomForExtent: function (bounds) {
|
||||
|
||||
var zoom = null;
|
||||
if (this.yahoomap != null) {
|
||||
var maxRes = this.map.getMaxResolution();
|
||||
var viewSize = this.map.getSize();
|
||||
|
||||
var width = bounds.getWidth();
|
||||
var height = bounds.getHeight();
|
||||
|
||||
var degPerPixel = (width > height) ? width / viewSize.w
|
||||
: height / viewSize.h;
|
||||
|
||||
var mmZoom = Math.floor( (Math.log(maxRes/degPerPixel)) /
|
||||
Math.log(2) );
|
||||
|
||||
//make sure zoom is within bounds
|
||||
var mmZoom = Math.min(Math.max(mmZoom, this.minZoomLevel),
|
||||
this.maxZoomLevel);
|
||||
|
||||
zoom = this.getOLZoomFromYZoom(mmZoom);
|
||||
}
|
||||
return zoom;
|
||||
},
|
||||
|
||||
|
||||
/********************************************************/
|
||||
/* */
|
||||
/* Translation Functions */
|
||||
/* */
|
||||
/* The following functions translate GMaps and OL */
|
||||
/* formats for Pixel, LonLat, Bounds, and Zoom */
|
||||
/* */
|
||||
/********************************************************/
|
||||
|
||||
//
|
||||
// TRANSLATION: GZoom <-> OpenLayers Zoom
|
||||
//
|
||||
|
||||
/**
|
||||
* @param {int} mmZoom
|
||||
*
|
||||
* @returns An OpenLayers Zoom lemml, translated from the passed in mmZoom
|
||||
* Returns null if null value is passed in
|
||||
* @type int
|
||||
*/
|
||||
getOLZoomFromYZoom: function(mmZoom) {
|
||||
return 18 - mmZoom;
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {int} olZoom
|
||||
*
|
||||
* @returns A YZoom lemml, translated from the passed in olZoom
|
||||
* Returns null if null value is passed in
|
||||
* @type int
|
||||
*/
|
||||
getYZoomFromOLZoom: function(olZoom) {
|
||||
return 18 - olZoom;
|
||||
},
|
||||
|
||||
//
|
||||
// TRANSLATION: YLatLong <-> LonLat
|
||||
//
|
||||
|
||||
/**
|
||||
* @param {YLatLong} mmLatLong
|
||||
*
|
||||
* @returns An OpenLayers.LonLat, translated from the passed in YLatLong
|
||||
* Returns null if null value is passed in
|
||||
* @type OpenLayers.LonLat
|
||||
*/
|
||||
getOLLonLatFromYLatLong: function(mmLatLong) {
|
||||
var olLonLat = null;
|
||||
if (mmLatLong != null) {
|
||||
olLonLat = new OpenLayers.LonLat(mmLatLong.Lon,
|
||||
mmLatLong.Lat);
|
||||
}
|
||||
return olLonLat;
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.LonLat} olLonLat
|
||||
*
|
||||
* @returns A YLatLong, translated from the passed in OpenLayers.LonLat
|
||||
* Returns null if null value is passed in
|
||||
* @type YLatLong
|
||||
*/
|
||||
getYLatLongFromOLLonLat: function(olLonLat) {
|
||||
var mmLatLong = null;
|
||||
if (olLonLat != null) {
|
||||
mmLatLong = new YGeoPoint(olLonLat.lat, olLonLat.lon);
|
||||
}
|
||||
return mmLatLong;
|
||||
},
|
||||
|
||||
|
||||
//
|
||||
// TRANSLATION: Pixel <-> OpenLayers.Pixel
|
||||
//
|
||||
|
||||
/**
|
||||
* @param {Pixel} pixel
|
||||
*
|
||||
* @returns An OpenLayers.Pixel, translated from the passed in Pixel
|
||||
* Returns null if null value is passed in
|
||||
* @type OpenLayers.Pixel
|
||||
*/
|
||||
getOLPixelFromPixel: function(pixel) {
|
||||
var olPixel = null;
|
||||
if (pixel != null) {
|
||||
olPixel = new OpenLayers.Pixel(pixel.x, pixel.y);
|
||||
}
|
||||
return olPixel;
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Pixel} olPixel
|
||||
*
|
||||
* @returns A Pixel, translated from the passed in OpenLayers.Pixel
|
||||
* Returns null if null value is passed in
|
||||
*
|
||||
* As it turns out, the only specifications we can see for the
|
||||
* Y-compatible Pixel is an x & y property, which emmry
|
||||
* OpenLayers.Pixel has by default. So just leamm it as-is.
|
||||
*
|
||||
* @type Pixel
|
||||
*/
|
||||
getPixelFromOLPixel: function(olPixel) {
|
||||
var pixel = null;
|
||||
if (olPixel != null) {
|
||||
pixel = new YCoordPoint(olPixel.x, olPixel.y);
|
||||
}
|
||||
return pixel;
|
||||
},
|
||||
|
||||
/** @final @type String */
|
||||
CLASS_NAME: "OpenLayers.Layer.Yahoo"
|
||||
});
|
||||
|
||||
@@ -78,33 +78,38 @@ OpenLayers.Map.prototype = {
|
||||
|
||||
// Options
|
||||
|
||||
/** @type OpenLayers.Size */
|
||||
tileSize: null,
|
||||
|
||||
/** @type String */
|
||||
projection: "EPSG:4326",
|
||||
|
||||
/** @type OpenLayers.Bounds */
|
||||
maxExtent: null,
|
||||
|
||||
/** @type String */
|
||||
units: 'degrees',
|
||||
|
||||
/** default max is 360 deg / 256 px, which corresponds to
|
||||
* zoom level 0 on gmaps
|
||||
*
|
||||
* @type float */
|
||||
maxResolution: 1.40625,
|
||||
|
||||
/** @type int */
|
||||
minZoomLevel: 0,
|
||||
|
||||
/** @type int */
|
||||
maxZoomLevel: 16,
|
||||
/** @type float */
|
||||
minResolution: null,
|
||||
|
||||
/** @type OpenLayers.Size */
|
||||
tileSize: null,
|
||||
/** @type float */
|
||||
maxScale: null,
|
||||
|
||||
/** @type String */
|
||||
units: 'degrees',
|
||||
|
||||
/** @type Float */
|
||||
/** @type float */
|
||||
minScale: null,
|
||||
|
||||
/** @type OpenLayers.Bounds */
|
||||
maxExtent: null,
|
||||
|
||||
/** @type OpenLayers.Bounds */
|
||||
minExtent: null,
|
||||
|
||||
/** @type int */
|
||||
numZoomLevels: 16,
|
||||
|
||||
|
||||
/**
|
||||
@@ -129,6 +134,8 @@ OpenLayers.Map.prototype = {
|
||||
// the layerContainerDiv is the one that holds all the layers
|
||||
id = div.id + "_OpenLayers_Container";
|
||||
this.layerContainerDiv = OpenLayers.Util.createDiv(id);
|
||||
this.layerContainerDiv.style.zIndex=this.Z_INDEX_BASE['Popup']-1;
|
||||
|
||||
this.viewPortDiv.appendChild(this.layerContainerDiv);
|
||||
|
||||
this.events = new OpenLayers.Events(this, div, this.EVENT_TYPES);
|
||||
@@ -148,7 +155,7 @@ OpenLayers.Map.prototype = {
|
||||
Event.observe(window, 'resize',
|
||||
this.updateSize.bindAsEventListener(this));
|
||||
}
|
||||
|
||||
|
||||
//set the default options
|
||||
this.setOptions(options);
|
||||
|
||||
@@ -207,16 +214,6 @@ OpenLayers.Map.prototype = {
|
||||
// now add the options declared by the user
|
||||
// (these will override defaults)
|
||||
Object.extend(this, options);
|
||||
|
||||
// if maxResolution is specified as "auto", calculate it
|
||||
// based on the maxExtent and the viewSize
|
||||
//
|
||||
if (this.maxResolution == "auto" || this.maxResolution == null) {
|
||||
var maxExtent = this.getMaxExtent();
|
||||
var viewSize = this.getSize();
|
||||
this.maxResolution = Math.max(maxExtent.getWidth() / viewSize.w,
|
||||
maxExtent.getHeight() / viewSize.h );
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -374,9 +371,12 @@ OpenLayers.Map.prototype = {
|
||||
if (center != null) {
|
||||
var zoom = this.getZoom();
|
||||
this.zoom = null;
|
||||
if (zoom > this.baseLayer.numZoomLevels - 1) {
|
||||
zoom = this.baseLayer.numZoomLevels - 1;
|
||||
}
|
||||
this.setCenter(center, zoom);
|
||||
|
||||
}
|
||||
|
||||
if ((noEvent == null) || (noEvent == false)) {
|
||||
this.events.triggerEvent("changebaselayer");
|
||||
}
|
||||
@@ -438,7 +438,9 @@ OpenLayers.Map.prototype = {
|
||||
removePopup: function(popup) {
|
||||
this.popups.remove(popup);
|
||||
if (popup.div) {
|
||||
this.layerContainerDiv.removeChild(popup.div);
|
||||
try { this.layerContainerDiv.removeChild(popup.div); }
|
||||
catch (e) { } // Popups sometimes apparently get disconnected
|
||||
// from the layerContainerDiv, and cause complaints.
|
||||
}
|
||||
popup.map = null;
|
||||
},
|
||||
@@ -470,18 +472,25 @@ OpenLayers.Map.prototype = {
|
||||
if (oldSize == null)
|
||||
this.size = oldSize = newSize;
|
||||
if (!newSize.equals(oldSize)) {
|
||||
// move the layer container so that the map is still centered
|
||||
var dx = (newSize.w - oldSize.w) / 2,
|
||||
dy = (newSize.h - oldSize.h) / 2;
|
||||
var lcStyle = this.layerContainerDiv.style;
|
||||
lcStyle.left = (parseInt(lcStyle.left) + dx) + "px";
|
||||
lcStyle.top = (parseInt(lcStyle.top ) + dy) + "px";
|
||||
// reset the map center
|
||||
this.layerContainerOrigin = this.center.clone();
|
||||
|
||||
//notify layers of mapresize
|
||||
for(var i=0; i < this.layers.length; i++) {
|
||||
this.layers[i].onMapResize();
|
||||
}
|
||||
|
||||
// store the new size
|
||||
this.size = newSize;
|
||||
// the div might have moved on the page, also
|
||||
this.events.element.offsets = null;
|
||||
|
||||
if (this.baseLayer != null) {
|
||||
var center = new OpenLayers.Pixel(newSize.w /2, newSize.h / 2);
|
||||
var centerLL = this.getLonLatFromViewPortPx(center);
|
||||
var zoom = this.getZoom();
|
||||
this.zoom = null;
|
||||
this.setCenter(this.getCenter(), zoom);
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
@@ -561,7 +570,6 @@ OpenLayers.Map.prototype = {
|
||||
* trigger movestart/end events
|
||||
*/
|
||||
setCenter: function (lonlat, zoom, minor) {
|
||||
|
||||
var zoomChanged = (this.isValidZoomLevel(zoom)) &&
|
||||
(zoom != this.getZoom());
|
||||
|
||||
@@ -598,12 +606,12 @@ OpenLayers.Map.prototype = {
|
||||
this.popups[i].updatePosition();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//send the move call to the baselayer and all the overlays
|
||||
var bounds = this.getExtent();
|
||||
for (var i = 0; i < this.layers.length; i++) {
|
||||
var layer = this.layers[i];
|
||||
if ((layer == this.baseLayer) || !layer.isBaseLayer) {
|
||||
if (layer.getVisibility()) {
|
||||
layer.moveTo(bounds, zoomChanged, minor);
|
||||
}
|
||||
}
|
||||
@@ -643,8 +651,8 @@ OpenLayers.Map.prototype = {
|
||||
*/
|
||||
isValidZoomLevel: function(zoomLevel) {
|
||||
return ( (zoomLevel != null) &&
|
||||
(zoomLevel >= this.getMinZoomLevel()) &&
|
||||
(zoomLevel <= this.getMaxZoomLevel()) );
|
||||
(zoomLevel >= 0) &&
|
||||
(zoomLevel < this.getNumZoomLevels()) );
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -680,15 +688,9 @@ OpenLayers.Map.prototype = {
|
||||
*/
|
||||
getProjection: function() {
|
||||
var projection = null;
|
||||
|
||||
if (this.baseLayer != null) {
|
||||
projection = this.baseLayer.getProjection();
|
||||
projection = this.baseLayer.projection;
|
||||
}
|
||||
|
||||
if (projection == null) {
|
||||
projection = this.projection;
|
||||
}
|
||||
|
||||
return projection;
|
||||
},
|
||||
|
||||
@@ -698,15 +700,9 @@ OpenLayers.Map.prototype = {
|
||||
*/
|
||||
getMaxResolution: function() {
|
||||
var maxResolution = null;
|
||||
|
||||
if (this.baseLayer != null) {
|
||||
maxResolution = this.baseLayer.getMaxResolution();
|
||||
maxResolution = this.baseLayer.maxResolution;
|
||||
}
|
||||
|
||||
if (maxResolution == null) {
|
||||
maxResolution = this.maxResolution;
|
||||
}
|
||||
|
||||
return maxResolution;
|
||||
},
|
||||
|
||||
@@ -715,55 +711,25 @@ OpenLayers.Map.prototype = {
|
||||
*/
|
||||
getMaxExtent: function () {
|
||||
var maxExtent = null;
|
||||
|
||||
if (this.baseLayer != null) {
|
||||
maxExtent = this.baseLayer.getMaxExtent();
|
||||
}
|
||||
|
||||
if (maxExtent == null) {
|
||||
maxExtent = this.maxExtent;
|
||||
}
|
||||
|
||||
maxExtent = this.baseLayer.maxExtent;
|
||||
}
|
||||
return maxExtent;
|
||||
},
|
||||
|
||||
/**
|
||||
* @returns The maximum zoom level that can be reached in the map
|
||||
* @returns The total number of zoom levels that can be displayed by the
|
||||
* current baseLayer.
|
||||
* @type int
|
||||
*/
|
||||
getMaxZoomLevel: function() {
|
||||
var maxZoomLevel = null;
|
||||
|
||||
getNumZoomLevels: function() {
|
||||
var numZoomLevels = null;
|
||||
if (this.baseLayer != null) {
|
||||
maxZoomLevel = this.baseLayer.getMaxZoomLevel();
|
||||
numZoomLevels = this.baseLayer.numZoomLevels;
|
||||
}
|
||||
|
||||
if (maxZoomLevel == null) {
|
||||
maxZoomLevel = this.maxZoomLevel;
|
||||
}
|
||||
|
||||
return maxZoomLevel;
|
||||
return numZoomLevels;
|
||||
},
|
||||
|
||||
/**
|
||||
* @returns The minimum zoom level that can be reached in the map
|
||||
* @type int
|
||||
*/
|
||||
getMinZoomLevel: function() {
|
||||
var minZoomLevel = null;
|
||||
|
||||
if (this.baseLayer != null) {
|
||||
minZoomLevel = this.baseLayer.getMinZoomLevel();
|
||||
}
|
||||
|
||||
if (minZoomLevel == null) {
|
||||
minZoomLevel = this.minZoomLevel;
|
||||
}
|
||||
|
||||
return minZoomLevel;
|
||||
},
|
||||
|
||||
|
||||
/********************************************************/
|
||||
/* */
|
||||
/* Baselayer Functions */
|
||||
@@ -783,7 +749,6 @@ OpenLayers.Map.prototype = {
|
||||
*/
|
||||
getExtent: function () {
|
||||
var extent = null;
|
||||
|
||||
if (this.baseLayer != null) {
|
||||
extent = this.baseLayer.getExtent();
|
||||
}
|
||||
@@ -797,7 +762,6 @@ OpenLayers.Map.prototype = {
|
||||
*/
|
||||
getResolution: function () {
|
||||
var resolution = null;
|
||||
|
||||
if (this.baseLayer != null) {
|
||||
resolution = this.baseLayer.getResolution();
|
||||
}
|
||||
@@ -811,9 +775,8 @@ OpenLayers.Map.prototype = {
|
||||
*/
|
||||
getScale: function () {
|
||||
var scale = null;
|
||||
|
||||
if (this.baseLayer != null) {
|
||||
var res = this.baseLayer.getResolution();
|
||||
var res = this.getResolution();
|
||||
var units = this.baseLayer.units;
|
||||
scale = res * OpenLayers.INCHES_PER_UNIT[units] *
|
||||
OpenLayers.DOTS_PER_INCH;
|
||||
@@ -823,21 +786,35 @@ OpenLayers.Map.prototype = {
|
||||
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Bounds} bounds
|
||||
*
|
||||
* @returns A suitable zoom level for the specified bounds.
|
||||
* If no baselayer is set, returns null.
|
||||
* @type int
|
||||
*/
|
||||
* @param {OpenLayers.Bounds} bounds
|
||||
*
|
||||
* @returns A suitable zoom level for the specified bounds.
|
||||
* If no baselayer is set, returns null.
|
||||
* @type int
|
||||
*/
|
||||
getZoomForExtent: function (bounds) {
|
||||
zoom = null;
|
||||
|
||||
var zoom = null;
|
||||
if (this.baseLayer != null) {
|
||||
zoom = this.baseLayer.getZoomForExtent(bounds);
|
||||
}
|
||||
return zoom;
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {float} resolution
|
||||
*
|
||||
* @returns A suitable zoom level for the specified resolution.
|
||||
* If no baselayer is set, returns null.
|
||||
* @type int
|
||||
*/
|
||||
getZoomForResolution: function(resolution) {
|
||||
var zoom = null;
|
||||
if (this.baseLayer != null) {
|
||||
zoom = this.baseLayer.getZoomForResolution(resolution);
|
||||
}
|
||||
return zoom;
|
||||
},
|
||||
|
||||
/********************************************************/
|
||||
/* */
|
||||
/* Zooming Functions */
|
||||
@@ -853,7 +830,9 @@ OpenLayers.Map.prototype = {
|
||||
* @param {int} zoom
|
||||
*/
|
||||
zoomTo: function(zoom) {
|
||||
this.setCenter(null, zoom);
|
||||
if (this.isValidZoomLevel(zoom)) {
|
||||
this.setCenter(null, zoom);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -927,7 +906,11 @@ OpenLayers.Map.prototype = {
|
||||
* @private
|
||||
*/
|
||||
getLonLatFromViewPortPx: function (viewPortPx) {
|
||||
return this.baseLayer.getLonLatFromViewPortPx(viewPortPx);
|
||||
var lonlat = null;
|
||||
if (this.baseLayer != null) {
|
||||
lonlat = this.baseLayer.getLonLatFromViewPortPx(viewPortPx);
|
||||
}
|
||||
return lonlat;
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -940,7 +923,11 @@ OpenLayers.Map.prototype = {
|
||||
* @private
|
||||
*/
|
||||
getViewPortPxFromLonLat: function (lonlat) {
|
||||
return this.baseLayer.getViewPortPxFromLonLat(lonlat);
|
||||
var px = null;
|
||||
if (this.baseLayer != null) {
|
||||
px = this.baseLayer.getViewPortPxFromLonLat(lonlat);
|
||||
}
|
||||
return px;
|
||||
},
|
||||
|
||||
|
||||
@@ -1010,11 +997,11 @@ OpenLayers.Map.prototype = {
|
||||
var dX = -parseInt(this.layerContainerDiv.style.left);
|
||||
var dY = -parseInt(this.layerContainerDiv.style.top);
|
||||
layerPx = viewPortPx.add(dX, dY);
|
||||
if (isNaN(layerPx.x) || isNaN(layerPx.y)) {
|
||||
layerPx = null;
|
||||
}
|
||||
}
|
||||
if (!isNaN(layerPx.x) && !isNaN(layerPx.y)) {
|
||||
return layerPx;
|
||||
}
|
||||
return null;
|
||||
return layerPx;
|
||||
},
|
||||
|
||||
//
|
||||
|
||||
@@ -30,7 +30,16 @@ OpenLayers.Marker.prototype = {
|
||||
initialize: function(lonlat, icon) {
|
||||
if (arguments.length > 0) {
|
||||
this.lonlat = lonlat;
|
||||
this.icon = (icon) ? icon : OpenLayers.Marker.defaultIcon();
|
||||
|
||||
var newIcon = (icon) ? icon : OpenLayers.Marker.defaultIcon();
|
||||
if (this.icon == null) {
|
||||
this.icon = newIcon;
|
||||
} else {
|
||||
this.icon.url = newIcon.url;
|
||||
this.icon.size = newIcon.size;
|
||||
this.icon.offset = newIcon.offset;
|
||||
this.icon.calculateOffset = newIcon.calculateOffset;
|
||||
}
|
||||
this.events = new OpenLayers.Events(this, this.icon.imageDiv, null);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -2,232 +2,313 @@
|
||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
|
||||
* text of the license. */
|
||||
|
||||
/**
|
||||
* @class
|
||||
*/
|
||||
OpenLayers.Popup = Class.create();
|
||||
|
||||
OpenLayers.Popup.count = 0;
|
||||
OpenLayers.Popup.WIDTH = 200;
|
||||
OpenLayers.Popup.HEIGHT = 200;
|
||||
OpenLayers.Popup.COLOR = "white";
|
||||
OpenLayers.Popup.OPACITY = 1;
|
||||
OpenLayers.Popup.BORDER = "0px";
|
||||
|
||||
OpenLayers.Popup.prototype = {
|
||||
|
||||
/** @type OpenLayers.Events*/
|
||||
events: null,
|
||||
|
||||
/** @type String */
|
||||
id: "",
|
||||
|
||||
/** @type OpenLayers.LonLat */
|
||||
lonlat: null,
|
||||
|
||||
/** @type DOMElement */
|
||||
div: null,
|
||||
|
||||
/** @type OpenLayers.Size*/
|
||||
size: null,
|
||||
|
||||
/** @type String */
|
||||
contentHTML: "",
|
||||
|
||||
/** @type String */
|
||||
backgroundColor: "",
|
||||
|
||||
/** @type float */
|
||||
opacity: "",
|
||||
|
||||
/** @type String */
|
||||
border: "",
|
||||
|
||||
/** this gets set in Map.js when the popup is added to the map
|
||||
* @type OpenLayers.Map */
|
||||
map: null,
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*
|
||||
* @param {String} id
|
||||
* @param {OpenLayers.LonLat} lonlat
|
||||
* @param {OpenLayers.Size} size
|
||||
* @param {String} contentHTML
|
||||
*/
|
||||
initialize:function(id, lonlat, size, contentHTML) {
|
||||
OpenLayers.Popup.count += 1;
|
||||
this.id = (id != null) ? id : "Popup" + OpenLayers.Popup.count;
|
||||
this.lonlat = lonlat;
|
||||
this.size = (size != null) ? size
|
||||
: new OpenLayers.Size(
|
||||
OpenLayers.Popup.WIDTH,
|
||||
OpenLayers.Popup.HEIGHT);
|
||||
if (contentHTML != null) {
|
||||
this.contentHTML = contentHTML;
|
||||
}
|
||||
this.backgroundColor = OpenLayers.Popup.COLOR;
|
||||
this.opacity = OpenLayers.Popup.OPACITY;
|
||||
this.border = OpenLayers.Popup.BORDER;
|
||||
|
||||
this.div = OpenLayers.Util.createDiv(this.id + "_div", null, null,
|
||||
null, null, null, "hidden");
|
||||
|
||||
this.events = new OpenLayers.Events(this, this.div, null);
|
||||
},
|
||||
|
||||
/**
|
||||
*/
|
||||
destroy: function() {
|
||||
if (this.map != null) {
|
||||
this.map.removePopup(this);
|
||||
}
|
||||
this.div = null;
|
||||
this.map = null;
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Pixel} px
|
||||
*
|
||||
* @returns Reference to a div that contains the drawn popup
|
||||
* @type DOMElement
|
||||
*/
|
||||
draw: function(px) {
|
||||
if (px == null) {
|
||||
if ((this.lonlat != null) && (this.map != null)) {
|
||||
px = this.map.getLayerPxFromLonLat(this.lonlat);
|
||||
}
|
||||
}
|
||||
|
||||
this.setSize();
|
||||
this.setBackgroundColor();
|
||||
this.setOpacity();
|
||||
this.setBorder();
|
||||
this.setContentHTML();
|
||||
this.moveTo(px);
|
||||
|
||||
return this.div;
|
||||
},
|
||||
|
||||
/**
|
||||
* if the popup has a lonlat and its map members set,
|
||||
* then have it move itself to its proper position
|
||||
*/
|
||||
updatePosition: function() {
|
||||
if ((this.lonlat) && (this.map)) {
|
||||
var px = this.map.getLayerPxFromLonLat(this.lonlat);
|
||||
this.moveTo(px);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Pixel} px
|
||||
*/
|
||||
moveTo: function(px) {
|
||||
if ((px != null) && (this.div != null)) {
|
||||
this.div.style.left = px.x + "px";
|
||||
this.div.style.top = px.y + "px";
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @returns Boolean indicating whether or not the popup is visible
|
||||
* @type Boolean
|
||||
*/
|
||||
visible: function() {
|
||||
return Element.visible(this.div);
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
toggle: function() {
|
||||
Element.toggle(this.div);
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
show: function() {
|
||||
Element.show(this.div);
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
hide: function() {
|
||||
Element.hide(this.div);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Size} size
|
||||
*/
|
||||
setSize:function(size) {
|
||||
if (size != undefined) {
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
if (this.div != null) {
|
||||
this.div.style.width = this.size.w + "px";
|
||||
this.div.style.height = this.size.h + "px";
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {String} color
|
||||
*/
|
||||
setBackgroundColor:function(color) {
|
||||
if (color != undefined) {
|
||||
this.backgroundColor = color;
|
||||
}
|
||||
|
||||
if (this.div != null) {
|
||||
this.div.style.backgroundColor = this.backgroundColor;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {float} opacity
|
||||
*/
|
||||
setOpacity:function(opacity) {
|
||||
if (opacity != undefined) {
|
||||
this.opacity = opacity;
|
||||
}
|
||||
|
||||
if (this.div != null) {
|
||||
// for Mozilla and Safari
|
||||
this.div.style.opacity = this.opacity;
|
||||
|
||||
// for IE
|
||||
this.div.style.filter = 'alpha(opacity=' + this.opacity*100 + ')';
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {int} border
|
||||
*/
|
||||
setBorder:function(border) {
|
||||
if (border != undefined) {
|
||||
this.border = border;
|
||||
}
|
||||
|
||||
if (this.div != null) {
|
||||
this.div.style.border = this.border;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {String} contentHTML
|
||||
*/
|
||||
setContentHTML:function(contentHTML) {
|
||||
if (contentHTML != null) {
|
||||
this.contentHTML = contentHTML;
|
||||
}
|
||||
|
||||
if (this.div != null) {
|
||||
this.div.innerHTML = this.contentHTML;
|
||||
}
|
||||
},
|
||||
|
||||
CLASS_NAME: "OpenLayers.Popup"
|
||||
};
|
||||
/**
|
||||
* @class
|
||||
*/
|
||||
OpenLayers.Popup = Class.create();
|
||||
|
||||
OpenLayers.Popup.WIDTH = 200;
|
||||
OpenLayers.Popup.HEIGHT = 200;
|
||||
OpenLayers.Popup.COLOR = "white";
|
||||
OpenLayers.Popup.OPACITY = 1;
|
||||
OpenLayers.Popup.BORDER = "0px";
|
||||
|
||||
OpenLayers.Popup.prototype = {
|
||||
|
||||
/** @type OpenLayers.Events*/
|
||||
events: null,
|
||||
|
||||
/** @type String */
|
||||
id: "",
|
||||
|
||||
/** @type OpenLayers.LonLat */
|
||||
lonlat: null,
|
||||
|
||||
/** @type DOMElement */
|
||||
div: null,
|
||||
|
||||
/** @type OpenLayers.Size*/
|
||||
size: null,
|
||||
|
||||
/** @type String */
|
||||
contentHTML: "",
|
||||
|
||||
/** @type String */
|
||||
backgroundColor: "",
|
||||
|
||||
/** @type float */
|
||||
opacity: "",
|
||||
|
||||
/** @type String */
|
||||
border: "",
|
||||
|
||||
/** this gets set in Map.js when the popup is added to the map
|
||||
* @type OpenLayers.Map */
|
||||
map: null,
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*
|
||||
* @param {String} id
|
||||
* @param {OpenLayers.LonLat} lonlat
|
||||
* @param {OpenLayers.Size} size
|
||||
* @param {String} contentHTML
|
||||
*/
|
||||
initialize:function(id, lonlat, size, contentHTML) {
|
||||
if (id == null) {
|
||||
id = OpenLayers.Util.createUniqueID(this.CLASS_NAME + "_");
|
||||
}
|
||||
|
||||
this.id = id;
|
||||
this.lonlat = lonlat;
|
||||
this.size = (size != null) ? size
|
||||
: new OpenLayers.Size(
|
||||
OpenLayers.Popup.WIDTH,
|
||||
OpenLayers.Popup.HEIGHT);
|
||||
if (contentHTML != null) {
|
||||
this.contentHTML = contentHTML;
|
||||
}
|
||||
this.backgroundColor = OpenLayers.Popup.COLOR;
|
||||
this.opacity = OpenLayers.Popup.OPACITY;
|
||||
this.border = OpenLayers.Popup.BORDER;
|
||||
|
||||
this.div = OpenLayers.Util.createDiv(this.id, null, null,
|
||||
null, null, null, "hidden");
|
||||
|
||||
this.registerEvents();
|
||||
},
|
||||
|
||||
/**
|
||||
*/
|
||||
destroy: function() {
|
||||
if (this.map != null) {
|
||||
this.map.removePopup(this);
|
||||
}
|
||||
this.div = null;
|
||||
this.map = null;
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Pixel} px
|
||||
*
|
||||
* @returns Reference to a div that contains the drawn popup
|
||||
* @type DOMElement
|
||||
*/
|
||||
draw: function(px) {
|
||||
if (px == null) {
|
||||
if ((this.lonlat != null) && (this.map != null)) {
|
||||
px = this.map.getLayerPxFromLonLat(this.lonlat);
|
||||
}
|
||||
}
|
||||
|
||||
this.setSize();
|
||||
this.setBackgroundColor();
|
||||
this.setOpacity();
|
||||
this.setBorder();
|
||||
this.setContentHTML();
|
||||
this.moveTo(px);
|
||||
|
||||
return this.div;
|
||||
},
|
||||
|
||||
/**
|
||||
* if the popup has a lonlat and its map members set,
|
||||
* then have it move itself to its proper position
|
||||
*/
|
||||
updatePosition: function() {
|
||||
if ((this.lonlat) && (this.map)) {
|
||||
var px = this.map.getLayerPxFromLonLat(this.lonlat);
|
||||
this.moveTo(px);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Pixel} px
|
||||
*/
|
||||
moveTo: function(px) {
|
||||
if ((px != null) && (this.div != null)) {
|
||||
this.div.style.left = px.x + "px";
|
||||
this.div.style.top = px.y + "px";
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @returns Boolean indicating whether or not the popup is visible
|
||||
* @type Boolean
|
||||
*/
|
||||
visible: function() {
|
||||
return Element.visible(this.div);
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
toggle: function() {
|
||||
Element.toggle(this.div);
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
show: function() {
|
||||
Element.show(this.div);
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
hide: function() {
|
||||
Element.hide(this.div);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Size} size
|
||||
*/
|
||||
setSize:function(size) {
|
||||
if (size != undefined) {
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
if (this.div != null) {
|
||||
this.div.style.width = this.size.w + "px";
|
||||
this.div.style.height = this.size.h + "px";
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {String} color
|
||||
*/
|
||||
setBackgroundColor:function(color) {
|
||||
if (color != undefined) {
|
||||
this.backgroundColor = color;
|
||||
}
|
||||
|
||||
if (this.div != null) {
|
||||
this.div.style.backgroundColor = this.backgroundColor;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {float} opacity
|
||||
*/
|
||||
setOpacity:function(opacity) {
|
||||
if (opacity != undefined) {
|
||||
this.opacity = opacity;
|
||||
}
|
||||
|
||||
if (this.div != null) {
|
||||
// for Mozilla and Safari
|
||||
this.div.style.opacity = this.opacity;
|
||||
|
||||
// for IE
|
||||
this.div.style.filter = 'alpha(opacity=' + this.opacity*100 + ')';
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {int} border
|
||||
*/
|
||||
setBorder:function(border) {
|
||||
if (border != undefined) {
|
||||
this.border = border;
|
||||
}
|
||||
|
||||
if (this.div != null) {
|
||||
this.div.style.border = this.border;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {String} contentHTML
|
||||
*/
|
||||
setContentHTML:function(contentHTML) {
|
||||
if (contentHTML != null) {
|
||||
this.contentHTML = contentHTML;
|
||||
}
|
||||
|
||||
if (this.div != null) {
|
||||
this.div.innerHTML = this.contentHTML;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/** Do this in a separate function so that subclasses can
|
||||
* choose to override it if they wish to deal differently
|
||||
* with mouse events
|
||||
*
|
||||
* Note in the following handler functions that some special
|
||||
* care is needed to deal correctly with mousing and popups.
|
||||
*
|
||||
* Because the user might select the zoom-rectangle option and
|
||||
* then drag it over a popup, we need a safe way to allow the
|
||||
* mousemove and mouseup events to pass through the popup when
|
||||
* they are initiated from outside.
|
||||
*
|
||||
* Otherwise, we want to essentially kill the event propagation
|
||||
* for all other events, though we have to do so carefully,
|
||||
* without disabling basic html functionality, like clicking on
|
||||
* hyperlinks or drag-selecting text.
|
||||
*/
|
||||
registerEvents:function() {
|
||||
this.events = new OpenLayers.Events(this, this.div, null, true);
|
||||
|
||||
this.events.register("mousedown", this, this.onmousedown);
|
||||
this.events.register("mousemove", this, this.onmousemove);
|
||||
this.events.register("mouseup", this, this.onmouseup);
|
||||
this.events.register("click", this,
|
||||
OpenLayers.Util.safeStopPropagation);
|
||||
this.events.register("mouseout", this, this.onmouseout);
|
||||
this.events.register("dblclick", this,
|
||||
OpenLayers.Util.safeStopPropagation);
|
||||
},
|
||||
|
||||
/** When mouse goes down within the popup, make a note of
|
||||
* it locally, and then do not propagate the mousedown
|
||||
* (but do so safely so that user can select text inside)
|
||||
*
|
||||
* @param {Event} evt
|
||||
*/
|
||||
onmousedown: function (evt) {
|
||||
this.mousedown = true;
|
||||
OpenLayers.Util.safeStopPropagation(evt);
|
||||
},
|
||||
|
||||
/** If the drag was started within the popup, then
|
||||
* do not propagate the mousemove (but do so safely
|
||||
* so that user can select text inside)
|
||||
*
|
||||
* @param {Event} evt
|
||||
*/
|
||||
onmousemove: function (evt) {
|
||||
if (this.mousedown) {
|
||||
OpenLayers.Util.safeStopPropagation(evt);
|
||||
}
|
||||
},
|
||||
|
||||
/** When mouse comes up within the popup, after going down
|
||||
* in it, reset the flag, and then (once again) do not
|
||||
* propagate the event, but do so safely so that user can
|
||||
* select text inside
|
||||
*
|
||||
* @param {Event} evt
|
||||
*/
|
||||
onmouseup: function (evt) {
|
||||
if (this.mousedown) {
|
||||
this.mousedown = false;
|
||||
OpenLayers.Util.safeStopPropagation(evt);
|
||||
}
|
||||
},
|
||||
|
||||
/** When mouse goes out of the popup set the flag to false so that
|
||||
* if they let go and then drag back in, we won't be confused.
|
||||
*
|
||||
* @param {Event} evt
|
||||
*
|
||||
* @type Boolean
|
||||
*/
|
||||
onmouseout: function (evt) {
|
||||
this.mousedown = false;
|
||||
},
|
||||
|
||||
CLASS_NAME: "OpenLayers.Popup"
|
||||
};
|
||||
|
||||
@@ -1,126 +1,126 @@
|
||||
/* 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/Popup.js
|
||||
*/
|
||||
OpenLayers.Popup.Anchored = Class.create();
|
||||
OpenLayers.Popup.Anchored.prototype =
|
||||
Object.extend( new OpenLayers.Popup(), {
|
||||
|
||||
/** "lr", "ll", "tr", "tl" - relative position of the popup.
|
||||
* @type String */
|
||||
relativePosition: null,
|
||||
|
||||
/** Object which must have expose a 'size' (OpenLayers.Size) and
|
||||
* 'offset' (OpenLayers.Pixel)
|
||||
* @type Object */
|
||||
anchor: null,
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*
|
||||
* @param {String} id
|
||||
* @param {OpenLayers.LonLat} lonlat
|
||||
* @param {OpenLayers.Size} size
|
||||
* @param {String} contentHTML
|
||||
* @param {Object} anchor Object which must expose a
|
||||
* - 'size' (OpenLayers.Size) and
|
||||
* - 'offset' (OpenLayers.Pixel)
|
||||
* (this is generally an OpenLayers.Icon)
|
||||
*/
|
||||
initialize:function(id, lonlat, size, contentHTML, anchor) {
|
||||
var newArguments = new Array(id, lonlat, size, contentHTML);
|
||||
OpenLayers.Popup.prototype.initialize.apply(this, newArguments);
|
||||
|
||||
this.anchor = (anchor != null) ? anchor
|
||||
: { size: new OpenLayers.Size(0,0),
|
||||
offset: new OpenLayers.Pixel(0,0)};
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Pixel} px
|
||||
*
|
||||
* @returns Reference to a div that contains the drawn popup
|
||||
* @type DOMElement
|
||||
*/
|
||||
draw: function(px) {
|
||||
if (px == null) {
|
||||
if ((this.lonlat != null) && (this.map != null)) {
|
||||
px = this.map.getLayerPxFromLonLat(this.lonlat);
|
||||
}
|
||||
}
|
||||
|
||||
//calculate relative position
|
||||
this.relativePosition = this.calculateRelativePosition(px);
|
||||
|
||||
return OpenLayers.Popup.prototype.draw.apply(this, arguments);
|
||||
},
|
||||
|
||||
/**
|
||||
* @private
|
||||
*
|
||||
* @param {OpenLayers.Pixel} px
|
||||
*
|
||||
* @returns The relative position ("br" "tr" "tl "bl") at which the popup
|
||||
* should be placed
|
||||
* @type String
|
||||
*/
|
||||
calculateRelativePosition:function(px) {
|
||||
var lonlat = this.map.getLonLatFromLayerPx(px);
|
||||
|
||||
var extent = this.map.getExtent();
|
||||
var quadrant = extent.determineQuadrant(lonlat);
|
||||
|
||||
return OpenLayers.Bounds.oppositeQuadrant(quadrant);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Pixel} px
|
||||
*/
|
||||
moveTo: function(px) {
|
||||
|
||||
var newPx = this.calculateNewPx(px);
|
||||
|
||||
var newArguments = new Array(newPx);
|
||||
OpenLayers.Popup.prototype.moveTo.apply(this, newArguments);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Size} size
|
||||
*/
|
||||
setSize:function(size) {
|
||||
OpenLayers.Popup.prototype.setSize.apply(this, arguments);
|
||||
|
||||
if ((this.lonlat) && (this.map)) {
|
||||
var px = this.map.getLayerPxFromLonLat(this.lonlat);
|
||||
this.moveTo(px);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @private
|
||||
*
|
||||
* @param {OpenLayers.Pixel} px
|
||||
*
|
||||
* @returns The the new px position of the popup on the screen
|
||||
* relative to the passed-in px
|
||||
* @type OpenLayers.Pixel
|
||||
*/
|
||||
calculateNewPx:function(px) {
|
||||
var newPx = px.offset(this.anchor.offset);
|
||||
|
||||
var top = (this.relativePosition.charAt(0) == 't');
|
||||
newPx.y += (top) ? -this.size.h : this.anchor.size.h;
|
||||
|
||||
var left = (this.relativePosition.charAt(1) == 'l');
|
||||
newPx.x += (left) ? -this.size.w : this.anchor.size.w;
|
||||
|
||||
return newPx;
|
||||
},
|
||||
|
||||
CLASS_NAME: "OpenLayers.Popup.Anchored"
|
||||
});
|
||||
*/
|
||||
OpenLayers.Popup.Anchored = Class.create();
|
||||
OpenLayers.Popup.Anchored.prototype =
|
||||
Object.extend( new OpenLayers.Popup(), {
|
||||
|
||||
/** "lr", "ll", "tr", "tl" - relative position of the popup.
|
||||
* @type String */
|
||||
relativePosition: null,
|
||||
|
||||
/** Object which must have expose a 'size' (OpenLayers.Size) and
|
||||
* 'offset' (OpenLayers.Pixel)
|
||||
* @type Object */
|
||||
anchor: null,
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*
|
||||
* @param {String} id
|
||||
* @param {OpenLayers.LonLat} lonlat
|
||||
* @param {OpenLayers.Size} size
|
||||
* @param {String} contentHTML
|
||||
* @param {Object} anchor Object which must expose a
|
||||
* - 'size' (OpenLayers.Size) and
|
||||
* - 'offset' (OpenLayers.Pixel)
|
||||
* (this is generally an OpenLayers.Icon)
|
||||
*/
|
||||
initialize:function(id, lonlat, size, contentHTML, anchor) {
|
||||
var newArguments = new Array(id, lonlat, size, contentHTML);
|
||||
OpenLayers.Popup.prototype.initialize.apply(this, newArguments);
|
||||
|
||||
this.anchor = (anchor != null) ? anchor
|
||||
: { size: new OpenLayers.Size(0,0),
|
||||
offset: new OpenLayers.Pixel(0,0)};
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Pixel} px
|
||||
*
|
||||
* @returns Reference to a div that contains the drawn popup
|
||||
* @type DOMElement
|
||||
*/
|
||||
draw: function(px) {
|
||||
if (px == null) {
|
||||
if ((this.lonlat != null) && (this.map != null)) {
|
||||
px = this.map.getLayerPxFromLonLat(this.lonlat);
|
||||
}
|
||||
}
|
||||
|
||||
//calculate relative position
|
||||
this.relativePosition = this.calculateRelativePosition(px);
|
||||
|
||||
return OpenLayers.Popup.prototype.draw.apply(this, arguments);
|
||||
},
|
||||
|
||||
/**
|
||||
* @private
|
||||
*
|
||||
* @param {OpenLayers.Pixel} px
|
||||
*
|
||||
* @returns The relative position ("br" "tr" "tl "bl") at which the popup
|
||||
* should be placed
|
||||
* @type String
|
||||
*/
|
||||
calculateRelativePosition:function(px) {
|
||||
var lonlat = this.map.getLonLatFromLayerPx(px);
|
||||
|
||||
var extent = this.map.getExtent();
|
||||
var quadrant = extent.determineQuadrant(lonlat);
|
||||
|
||||
return OpenLayers.Bounds.oppositeQuadrant(quadrant);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Pixel} px
|
||||
*/
|
||||
moveTo: function(px) {
|
||||
|
||||
var newPx = this.calculateNewPx(px);
|
||||
|
||||
var newArguments = new Array(newPx);
|
||||
OpenLayers.Popup.prototype.moveTo.apply(this, newArguments);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Size} size
|
||||
*/
|
||||
setSize:function(size) {
|
||||
OpenLayers.Popup.prototype.setSize.apply(this, arguments);
|
||||
|
||||
if ((this.lonlat) && (this.map)) {
|
||||
var px = this.map.getLayerPxFromLonLat(this.lonlat);
|
||||
this.moveTo(px);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @private
|
||||
*
|
||||
* @param {OpenLayers.Pixel} px
|
||||
*
|
||||
* @returns The the new px position of the popup on the screen
|
||||
* relative to the passed-in px
|
||||
* @type OpenLayers.Pixel
|
||||
*/
|
||||
calculateNewPx:function(px) {
|
||||
var newPx = px.offset(this.anchor.offset);
|
||||
|
||||
var top = (this.relativePosition.charAt(0) == 't');
|
||||
newPx.y += (top) ? -this.size.h : this.anchor.size.h;
|
||||
|
||||
var left = (this.relativePosition.charAt(1) == 'l');
|
||||
newPx.x += (left) ? -this.size.w : this.anchor.size.w;
|
||||
|
||||
return newPx;
|
||||
},
|
||||
|
||||
CLASS_NAME: "OpenLayers.Popup.Anchored"
|
||||
});
|
||||
|
||||
@@ -1,184 +1,184 @@
|
||||
/* 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/Popup/Anchored.js
|
||||
*/
|
||||
OpenLayers.Popup.AnchoredBubble = Class.create();
|
||||
|
||||
//Border space for the rico corners
|
||||
OpenLayers.Popup.AnchoredBubble.CORNER_SIZE = 5;
|
||||
|
||||
OpenLayers.Popup.AnchoredBubble.prototype =
|
||||
Object.extend( new OpenLayers.Popup.Anchored(), {
|
||||
|
||||
/** @type DOMElement */
|
||||
contentDiv:null,
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*
|
||||
* @param {String} id
|
||||
* @param {OpenLayers.LonLat} lonlat
|
||||
* @param {OpenLayers.Size} size
|
||||
* @param {String} contentHTML
|
||||
* @param {Object} anchor Object which must expose a
|
||||
* - 'size' (OpenLayers.Size) and
|
||||
* - 'offset' (OpenLayers.Pixel)
|
||||
* (this is generally an OpenLayers.Icon)
|
||||
*/
|
||||
initialize:function(id, lonlat, size, contentHTML, anchor) {
|
||||
OpenLayers.Popup.Anchored.prototype.initialize.apply(this, arguments);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Pixel} px
|
||||
*
|
||||
* @returns Reference to a div that contains the drawn popup
|
||||
* @type DOMElement
|
||||
*/
|
||||
draw: function(px) {
|
||||
|
||||
OpenLayers.Popup.Anchored.prototype.draw.apply(this, arguments);
|
||||
|
||||
// make the content Div
|
||||
var contentSize = this.size.clone();
|
||||
contentSize.h -= (2 * OpenLayers.Popup.AnchoredBubble.CORNER_SIZE);
|
||||
|
||||
var id = this.div.id + "-contentDiv";
|
||||
this.contentDiv = OpenLayers.Util.createDiv(id, null, contentSize,
|
||||
null, "relative", null,
|
||||
"hidden");
|
||||
this.div.appendChild(this.contentDiv);
|
||||
this.setContentHTML();
|
||||
|
||||
this.setRicoCorners(true);
|
||||
|
||||
//set the popup color and opacity
|
||||
this.setBackgroundColor();
|
||||
this.setOpacity();
|
||||
|
||||
return this.div;
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Size} size
|
||||
*/
|
||||
setSize:function(size) {
|
||||
OpenLayers.Popup.Anchored.prototype.setSize.apply(this, arguments);
|
||||
|
||||
if (this.contentDiv != null) {
|
||||
|
||||
var contentSize = this.size.clone();
|
||||
contentSize.h -= (2 * OpenLayers.Popup.AnchoredBubble.CORNER_SIZE);
|
||||
|
||||
this.contentDiv.style.height = contentSize.h + "px";
|
||||
|
||||
//size has changed - must redo corners
|
||||
this.setRicoCorners(false);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {String} color
|
||||
*/
|
||||
setBackgroundColor:function(color) {
|
||||
if (color != undefined) {
|
||||
this.backgroundColor = color;
|
||||
}
|
||||
|
||||
if (this.div != null) {
|
||||
if (this.contentDiv != null) {
|
||||
this.div.style.background = "transparent";
|
||||
Rico.Corner.changeColor(this.contentDiv, this.backgroundColor);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {float} opacity
|
||||
*/
|
||||
setOpacity:function(opacity) {
|
||||
if (opacity != undefined) {
|
||||
this.opacity = opacity;
|
||||
}
|
||||
|
||||
if (this.div != null) {
|
||||
if (this.contentDiv != null) {
|
||||
Rico.Corner.changeOpacity(this.contentDiv, this.opacity);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/** Bubble Popups can not have a border
|
||||
*
|
||||
* @param {int} border
|
||||
*/
|
||||
setBorder:function(border) {
|
||||
this.border = 0;
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {String} contentHTML
|
||||
*/
|
||||
setContentHTML:function(contentHTML) {
|
||||
if (contentHTML != null) {
|
||||
this.contentHTML = contentHTML;
|
||||
}
|
||||
|
||||
if (this.contentDiv != null) {
|
||||
this.contentDiv.innerHTML = this.contentHTML;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @private
|
||||
*
|
||||
* @param {Boolean} firstTime Is this the first time the corners are being
|
||||
* rounded?
|
||||
*
|
||||
* update the rico corners according to the popup's
|
||||
* current relative postion
|
||||
*/
|
||||
setRicoCorners:function(firstTime) {
|
||||
|
||||
var corners = this.getCornersToRound(this.relativePosition);
|
||||
var options = {corners: corners,
|
||||
color: this.backgroundColor,
|
||||
bgColor: "transparent",
|
||||
blend: false};
|
||||
|
||||
if (firstTime) {
|
||||
Rico.Corner.round(this.div, options);
|
||||
} else {
|
||||
Rico.Corner.reRound(this.contentDiv, options);
|
||||
//set the popup color and opacity
|
||||
this.setBackgroundColor();
|
||||
this.setOpacity();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @private
|
||||
*
|
||||
* @returns The proper corners string ("tr tl bl br") for rico
|
||||
* to round
|
||||
* @type String
|
||||
*/
|
||||
getCornersToRound:function() {
|
||||
|
||||
var corners = ['tl', 'tr', 'bl', 'br'];
|
||||
|
||||
//we want to round all the corners _except_ the opposite one.
|
||||
var corner = OpenLayers.Bounds.oppositeQuadrant(this.relativePosition);
|
||||
corners.remove(corner);
|
||||
|
||||
return corners.join(" ");
|
||||
},
|
||||
|
||||
CLASS_NAME: "OpenLayers.Popup.AnchoredBubble"
|
||||
});
|
||||
*/
|
||||
OpenLayers.Popup.AnchoredBubble = Class.create();
|
||||
|
||||
//Border space for the rico corners
|
||||
OpenLayers.Popup.AnchoredBubble.CORNER_SIZE = 5;
|
||||
|
||||
OpenLayers.Popup.AnchoredBubble.prototype =
|
||||
Object.extend( new OpenLayers.Popup.Anchored(), {
|
||||
|
||||
/** @type DOMElement */
|
||||
contentDiv:null,
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*
|
||||
* @param {String} id
|
||||
* @param {OpenLayers.LonLat} lonlat
|
||||
* @param {OpenLayers.Size} size
|
||||
* @param {String} contentHTML
|
||||
* @param {Object} anchor Object which must expose a
|
||||
* - 'size' (OpenLayers.Size) and
|
||||
* - 'offset' (OpenLayers.Pixel)
|
||||
* (this is generally an OpenLayers.Icon)
|
||||
*/
|
||||
initialize:function(id, lonlat, size, contentHTML, anchor) {
|
||||
OpenLayers.Popup.Anchored.prototype.initialize.apply(this, arguments);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Pixel} px
|
||||
*
|
||||
* @returns Reference to a div that contains the drawn popup
|
||||
* @type DOMElement
|
||||
*/
|
||||
draw: function(px) {
|
||||
|
||||
OpenLayers.Popup.Anchored.prototype.draw.apply(this, arguments);
|
||||
|
||||
// make the content Div
|
||||
var contentSize = this.size.clone();
|
||||
contentSize.h -= (2 * OpenLayers.Popup.AnchoredBubble.CORNER_SIZE);
|
||||
|
||||
var id = this.div.id + "_contentDiv";
|
||||
this.contentDiv = OpenLayers.Util.createDiv(id, null, contentSize,
|
||||
null, "relative", null,
|
||||
"hidden");
|
||||
this.div.appendChild(this.contentDiv);
|
||||
this.setContentHTML();
|
||||
|
||||
this.setRicoCorners(true);
|
||||
|
||||
//set the popup color and opacity
|
||||
this.setBackgroundColor();
|
||||
this.setOpacity();
|
||||
|
||||
return this.div;
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Size} size
|
||||
*/
|
||||
setSize:function(size) {
|
||||
OpenLayers.Popup.Anchored.prototype.setSize.apply(this, arguments);
|
||||
|
||||
if (this.contentDiv != null) {
|
||||
|
||||
var contentSize = this.size.clone();
|
||||
contentSize.h -= (2 * OpenLayers.Popup.AnchoredBubble.CORNER_SIZE);
|
||||
|
||||
this.contentDiv.style.height = contentSize.h + "px";
|
||||
|
||||
//size has changed - must redo corners
|
||||
this.setRicoCorners(false);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {String} color
|
||||
*/
|
||||
setBackgroundColor:function(color) {
|
||||
if (color != undefined) {
|
||||
this.backgroundColor = color;
|
||||
}
|
||||
|
||||
if (this.div != null) {
|
||||
if (this.contentDiv != null) {
|
||||
this.div.style.background = "transparent";
|
||||
Rico.Corner.changeColor(this.contentDiv, this.backgroundColor);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {float} opacity
|
||||
*/
|
||||
setOpacity:function(opacity) {
|
||||
if (opacity != undefined) {
|
||||
this.opacity = opacity;
|
||||
}
|
||||
|
||||
if (this.div != null) {
|
||||
if (this.contentDiv != null) {
|
||||
Rico.Corner.changeOpacity(this.contentDiv, this.opacity);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/** Bubble Popups can not have a border
|
||||
*
|
||||
* @param {int} border
|
||||
*/
|
||||
setBorder:function(border) {
|
||||
this.border = 0;
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {String} contentHTML
|
||||
*/
|
||||
setContentHTML:function(contentHTML) {
|
||||
if (contentHTML != null) {
|
||||
this.contentHTML = contentHTML;
|
||||
}
|
||||
|
||||
if (this.contentDiv != null) {
|
||||
this.contentDiv.innerHTML = this.contentHTML;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @private
|
||||
*
|
||||
* @param {Boolean} firstTime Is this the first time the corners are being
|
||||
* rounded?
|
||||
*
|
||||
* update the rico corners according to the popup's
|
||||
* current relative postion
|
||||
*/
|
||||
setRicoCorners:function(firstTime) {
|
||||
|
||||
var corners = this.getCornersToRound(this.relativePosition);
|
||||
var options = {corners: corners,
|
||||
color: this.backgroundColor,
|
||||
bgColor: "transparent",
|
||||
blend: false};
|
||||
|
||||
if (firstTime) {
|
||||
Rico.Corner.round(this.div, options);
|
||||
} else {
|
||||
Rico.Corner.reRound(this.contentDiv, options);
|
||||
//set the popup color and opacity
|
||||
this.setBackgroundColor();
|
||||
this.setOpacity();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @private
|
||||
*
|
||||
* @returns The proper corners string ("tr tl bl br") for rico
|
||||
* to round
|
||||
* @type String
|
||||
*/
|
||||
getCornersToRound:function() {
|
||||
|
||||
var corners = ['tl', 'tr', 'bl', 'br'];
|
||||
|
||||
//we want to round all the corners _except_ the opposite one.
|
||||
var corner = OpenLayers.Bounds.oppositeQuadrant(this.relativePosition);
|
||||
corners.remove(corner);
|
||||
|
||||
return corners.join(" ");
|
||||
},
|
||||
|
||||
CLASS_NAME: "OpenLayers.Popup.AnchoredBubble"
|
||||
});
|
||||
|
||||
@@ -64,7 +64,9 @@ OpenLayers.Tile.Image.prototype =
|
||||
*/
|
||||
clear: function() {
|
||||
OpenLayers.Tile.prototype.clear.apply(this, arguments);
|
||||
this.imgDiv.style.display = "none";
|
||||
if(this.imgDiv) {
|
||||
this.imgDiv.style.display = "none";
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -100,6 +102,9 @@ OpenLayers.Tile.Image.prototype =
|
||||
true);
|
||||
}
|
||||
this.layer.div.appendChild(this.imgDiv);
|
||||
if(this.layer.opacity != null) {
|
||||
OpenLayers.Util.setOpacity(this.imgDiv, this.layer.opacity);
|
||||
}
|
||||
},
|
||||
|
||||
/** @final @type String */
|
||||
|
||||
@@ -79,8 +79,8 @@ OpenLayers.Tile.WFS.prototype =
|
||||
if (this.urls != null) {
|
||||
|
||||
for(var i=0; i < this.urls.length; i++) {
|
||||
var params = { BBOX:bounds.toBBOX() };
|
||||
var url = this.urls[i] +
|
||||
var params = { BBOX:this.bounds.toBBOX() };
|
||||
var url = this.urls[i] + "&" +
|
||||
OpenLayers.Util.getParameterString(params);
|
||||
OpenLayers.loadURL(url, null, this, success, failure);
|
||||
}
|
||||
|
||||
@@ -125,14 +125,30 @@ OpenLayers.Util.createImage = function(id, px, sz, imgURL, position, border,
|
||||
return image;
|
||||
};
|
||||
|
||||
/**
|
||||
* Set the opacity of a DOM Element
|
||||
* Note that for this function to work in IE, elements must "have layout"
|
||||
* according to:
|
||||
* http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/haslayout.asp
|
||||
*
|
||||
* @param {DOMElement} element Set the opacity on this DOM element
|
||||
* @param {Float} opacity Opacity value (0.0 - 1.0)
|
||||
*/
|
||||
OpenLayers.Util.setOpacity = function(element, opacity) {
|
||||
element.style.opacity = opacity;
|
||||
element.style.filter = 'alpha(opacity=' + (opacity * 100) + ')';
|
||||
}
|
||||
|
||||
OpenLayers.Util.onImageLoad = function() {
|
||||
this.style.backgroundColor = null;
|
||||
this.style.display = "";
|
||||
};
|
||||
|
||||
OpenLayers.Util.onImageLoadErrorColor = "pink";
|
||||
|
||||
OpenLayers.Util.onImageLoadError = function() {
|
||||
this.style.backgroundColor = "pink";
|
||||
this.style.backgroundColor = OpenLayers.Util.onImageLoadErrorColor;
|
||||
this.style.display = "";
|
||||
};
|
||||
|
||||
|
||||
@@ -355,6 +371,8 @@ OpenLayers.Util.getXmlNodeValue = function(node) {
|
||||
Try.these(
|
||||
function() {
|
||||
val = node.text;
|
||||
if (!val)
|
||||
val = node.textContent;
|
||||
},
|
||||
function() {
|
||||
val = node.textContent;
|
||||
@@ -499,3 +517,15 @@ OpenLayers.Util.getResolutionFromScale = function (scale, units) {
|
||||
* OpenLayers.DOTS_PER_INCH);
|
||||
return resolution;
|
||||
};
|
||||
|
||||
/** Safely stop the propagation of an event *without* preventing
|
||||
* the default browser action from occurring.
|
||||
*
|
||||
* @param {Event} evt
|
||||
*/
|
||||
OpenLayers.Util.safeStopPropagation = function(evt) {
|
||||
if (evt.stopPropagation) {
|
||||
evt.stopPropagation();
|
||||
}
|
||||
evt.cancelBubble = true;
|
||||
};
|
||||
|
||||
56
news.txt
Normal file
@@ -0,0 +1,56 @@
|
||||
OpenLayers 2.0 Release Notes
|
||||
|
||||
* Deprecated Methods which were removed:
|
||||
|
||||
For details, see r1228
|
||||
|
||||
* OpenLayers.Map
|
||||
* removed: getFullExtent() -- use getMaxExtent() instead
|
||||
* removed: zoomToFullExtent() -- use zoomToMaxExtent() instead
|
||||
* OpenLayers.Layer.Grid
|
||||
* removed: setTileSize() -- user should instead pass a 'tileSize' property
|
||||
as one of the options when initializing the Grid Layer. ex:
|
||||
|
||||
var url = "http://octo.metacarta.com/cgi-bin/mapserv";
|
||||
var options = {tileSize: new OpenLayers.Size(500,50)};
|
||||
var map = new OpenLayers.Map('map', options);
|
||||
layer = new OpenLayers.Layer.WMS(name, url, params);
|
||||
|
||||
* OpenLayers.Layer.HTTPRequest
|
||||
* removed: changeParams() -- use mergeNewParams() instead
|
||||
* OpenLayers.Pixel
|
||||
* removed: copyOf() -- use clone() instead
|
||||
* OpenLayers.Size
|
||||
* removed: copyOf() -- use clone() instead
|
||||
* OpenLayers.LonLat
|
||||
* removed: copyOf() -- use clone() instead
|
||||
* OpenLayers.Bounds
|
||||
* removed: copyOf() -- use clone() instead
|
||||
* Array
|
||||
* removed: copyOf() -- use clone() instead
|
||||
|
||||
* MouseWheel
|
||||
* It is now possible to zoom in/out with the mouse wheel instead of clicks.
|
||||
|
||||
* Spiral Gridding
|
||||
* Instead of loading from the top to bottom of the map, Openlayers will
|
||||
now start loading tiles from the center of the map.
|
||||
|
||||
* Tile Re-Use
|
||||
* In order to lower memory constraints and reduce element creation times,
|
||||
OpenLayers now creates a single set of images/tiles and reuses them as
|
||||
you scroll around the map.
|
||||
|
||||
* New Layer Support
|
||||
* Google
|
||||
* Virtual Earth
|
||||
* GeoRSS (RSS 1.0 and 2.0 in FF, IE, RSS 2.0 in Safari)
|
||||
* KaMap
|
||||
* Untiled WMS
|
||||
|
||||
* Scale Based Methods
|
||||
* It is now possible to set zooms based on the concept of scale. See
|
||||
documentation in the options for the Map constructor.
|
||||
|
||||
OpenLayers 1.0
|
||||
Initial release.
|
||||
@@ -38,7 +38,10 @@ Using OpenLayers in Your Own Website
|
||||
|
||||
The examples/ directory is full of useful examples.
|
||||
|
||||
There is some documentation at http://trac.openlayers.org/ as well.
|
||||
Dcumentation is available in the doc/ directory: to build an HTML version
|
||||
of the documentation, run ./docs.sh in the build/ directory.
|
||||
|
||||
Information on changes in the API is available in news.txt.
|
||||
|
||||
--------------------------
|
||||
Contributing to OpenLayers
|
||||
|
||||
@@ -19,9 +19,11 @@
|
||||
<li>test_Layer_KaMap.html</li>
|
||||
<li>test_Layer_WMS.html</li>
|
||||
<li>test_Layer_Google.html</li>
|
||||
<li>test_Layer_MultiMap.html</li>
|
||||
<li>test_Tile.html</li>
|
||||
<li>test_Tile_Image.html</li>
|
||||
<li>test_Control.html</li>
|
||||
<li>test_Control_MouseToolbar.html</li>
|
||||
<li>test_Control_LayerSwitcher.html</li>
|
||||
<li>test_Control_PanZoom.html</li>
|
||||
<li>test_Control_PanZoomBar.html</li>
|
||||
|
||||
@@ -663,7 +663,7 @@ Test.AnotherWay._test_object_t.prototype.delay_call=function()
|
||||
Test.AnotherWay._test_object_t.prototype.open_window=function( url, fn, timeout_seconds )
|
||||
{
|
||||
if( timeout_seconds==null ) {
|
||||
timeout_seconds=2;
|
||||
timeout_seconds=4;
|
||||
}
|
||||
var no_close=document.getElementById( "dont_close_test_windows" );
|
||||
var action={ action_kind: "window", wnd_url: url.toString(), wnd_wnd: null, wnd_fn: fn, wnd_timeout_milliseconds: timeout_seconds*1000, wnd_no_close: no_close.checked };
|
||||
@@ -785,7 +785,7 @@ Test.AnotherWay._set_iframe_location=function( iframe, loc, outside_path_correct
|
||||
Test.AnotherWay._start_loading_page=function()
|
||||
{
|
||||
var test_page=Test.AnotherWay._g_tests_queue[0];
|
||||
test_page.loading_timeout_milliseconds=2000;
|
||||
test_page.loading_timeout_milliseconds=4000;
|
||||
test_page.timeout_id=setTimeout( Test.AnotherWay._loading_timeout, Test.AnotherWay._g_timeout_granularity );
|
||||
test_page.wait_msg=Test.AnotherWay._print_counter_result( test_page.url, "loading...", test_page.loading_timeout_milliseconds, "loading" );
|
||||
if( test_page.convention=="jsan" ) {
|
||||
|
||||
@@ -28,6 +28,18 @@
|
||||
t.ok( boundsCenter.equals(center), "bounds.getCenterLonLat() has correct value" );
|
||||
}
|
||||
|
||||
function test_01a_Bounds_constructorFromStrings(t) {
|
||||
t.plan( 6 );
|
||||
bounds = new OpenLayers.Bounds("0","2","10","4");
|
||||
t.ok( bounds instanceof OpenLayers.Bounds, "new OpenLayers.Bounds returns Bounds object" );
|
||||
t.eq( bounds.CLASS_NAME, "OpenLayers.Bounds", "bounds.CLASS_NAME is set correctly" );
|
||||
t.eq( bounds.left, 0, "bounds.left is set correctly" );
|
||||
t.eq( bounds.bottom, 2, "bounds.bottom is set correctly" );
|
||||
t.eq( bounds.right, 10, "bounds.right is set correctly" );
|
||||
t.eq( bounds.top, 4, "bounds.top is set correctly" );
|
||||
|
||||
}
|
||||
|
||||
function test_02_Bounds_toBBOX(t) {
|
||||
t.plan( 1 );
|
||||
bounds = new OpenLayers.Bounds(1,2,3,4);
|
||||
|
||||
58
tests/test_Control_MouseToolbar.html
Normal file
@@ -0,0 +1,58 @@
|
||||
<html>
|
||||
<head>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
<script type="text/javascript"><!--
|
||||
var map;
|
||||
function test_01_Control_MouseToolbar_constructor (t) {
|
||||
t.plan( 1 );
|
||||
|
||||
control = new OpenLayers.Control.MouseToolbar();
|
||||
t.ok( control instanceof OpenLayers.Control.MouseToolbar, "new OpenLayers.Control.MouseToolbar returns object" );
|
||||
}
|
||||
function test_02_Control_MouseToolbar_addControl (t) {
|
||||
t.plan( 7 );
|
||||
map = new OpenLayers.Map('map');
|
||||
control = new OpenLayers.Control.MouseToolbar();
|
||||
t.ok( control instanceof OpenLayers.Control.MouseToolbar, "new OpenLayers.Control.MouseToolbar returns object" );
|
||||
t.ok( map instanceof OpenLayers.Map, "new OpenLayers.Map creates map" );
|
||||
map.addControl(control);
|
||||
t.ok( control.map === map, "Control.map is set to the map object" );
|
||||
t.ok( map.controls[2] === control, "map.controls contains control" );
|
||||
t.eq( parseInt(control.div.style.zIndex), map.Z_INDEX_BASE['Control'] + 3, "Control div zIndexed properly" );
|
||||
t.eq( parseInt(map.viewPortDiv.lastChild.style.zIndex), map.Z_INDEX_BASE['Control'] + 3, "Viewport div contains control div" );
|
||||
t.eq( control.div.style.top, "6px", "Control div top located correctly by default");
|
||||
|
||||
}
|
||||
function test_03_Control_MouseToolbar_control_events (t) {
|
||||
t.plan( 1 );
|
||||
if ((navigator.userAgent.indexOf("compatible") == -1)) {
|
||||
var evt = {which: 1}; // control expects left-click
|
||||
map = new OpenLayers.Map('map');
|
||||
var layer = new OpenLayers.Layer.WMS("Test Layer",
|
||||
"http://octo.metacarta.com/cgi-bin/mapserv?",
|
||||
{map: "/mapdata/vmap_wms.map", layers: "basic"});
|
||||
map.addLayer(layer);
|
||||
|
||||
control = new OpenLayers.Control.MouseToolbar();
|
||||
map.addControl(control);
|
||||
|
||||
var centerLL = new OpenLayers.LonLat(0,0);
|
||||
map.setCenter(centerLL, 5);
|
||||
|
||||
evt.shiftKey = true;
|
||||
evt.xy = new OpenLayers.Size(5,5);
|
||||
control.defaultMouseDown(evt);
|
||||
evt.xy = new OpenLayers.Size(15,15);
|
||||
control.defaultMouseUp(evt);
|
||||
t.eq(map.getZoom(), 6, "Map zoom set correctly after zoombox");
|
||||
} else {
|
||||
t.ok(true, "IE does not run this test.")
|
||||
}
|
||||
}
|
||||
// -->
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="map" style="width: 1024px; height: 512px;"/>
|
||||
</body>
|
||||
</html>
|
||||
@@ -20,7 +20,11 @@
|
||||
if (!map.getCenter()) map.zoomToMaxExtent();
|
||||
map.addControl(control);
|
||||
map.pan(5, 0);
|
||||
t.eq($('permalink').href, location+"?lat=0&lon=1.75781&zoom=2", "Panning sets permalink");
|
||||
if (/MSIE/.test(navigator.userAgent)) {
|
||||
t.eq($('permalink').href, "?lat=0&lon=1.75781&zoom=2", "Panning sets permalink");
|
||||
} else {
|
||||
t.eq($('permalink').href, location+"?lat=0&lon=1.75781&zoom=2", "Panning sets permalink");
|
||||
}
|
||||
}
|
||||
function test_03_Control_Permalink_updateLinksBase (t) {
|
||||
t.plan( 2 );
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
t.ok( feature instanceof OpenLayers.Feature, "new OpenLayers.Feature returns Feature object" );
|
||||
t.eq( feature.layer, layer, "feature.layer set correctly" );
|
||||
t.ok( feature.id.startsWith("Feature_"), "feature.id set correctly" );
|
||||
t.ok( feature.id.startsWith("OpenLayers.Feature_"), "feature.id set correctly" );
|
||||
t.ok( feature.lonlat.equals(lonlat), "feature.lonlat set correctly" );
|
||||
t.eq( feature.data.iconURL, iconURL, "feature.data.iconURL set correctly" );
|
||||
t.ok( feature.data.iconSize.equals(iconSize), "feature.data.iconSize set correctly" );
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
var layer;
|
||||
|
||||
function test_01_Layer_constructor (t) {
|
||||
t.plan( 14 );
|
||||
t.plan( 13 );
|
||||
|
||||
var options = { chicken: 151, foo: "bar", projection: "none" };
|
||||
var layer = new OpenLayers.Layer('Test Layer', options);
|
||||
@@ -15,7 +15,6 @@
|
||||
|
||||
t.eq( layer.name, "Test Layer", "layer.name is correct" );
|
||||
t.ok( layer.id != null, "Layer is given an id");
|
||||
t.ok( layer.id.startsWith("Layer_"), "layer id starts correctly");
|
||||
t.ok( layer.projection, "none", "default layer projection correctly set");
|
||||
t.ok( ((layer.chicken == 151) && (layer.foo == "bar")), "layer.options correctly set to Layer Object" );
|
||||
t.ok( ((layer.options["chicken"] == 151) && (layer.options["foo"] == "bar")), "layer.options correctly backed up" );
|
||||
@@ -89,28 +88,25 @@
|
||||
|
||||
function test_04_Layer_StandardOptionsAccessors (t) {
|
||||
|
||||
t.plan( 5 );
|
||||
t.plan( 4 );
|
||||
|
||||
var projection = "chicken";
|
||||
var maxExtent = new OpenLayers.Bounds(50,50,100,100);
|
||||
var maxResolution = 1.5726;
|
||||
var minZoomLevel = 5;
|
||||
var maxZoomLevel = 15;
|
||||
var numZoomLevels = 11;
|
||||
|
||||
var options = { projection: projection,
|
||||
maxExtent: maxExtent,
|
||||
maxResolution: maxResolution,
|
||||
minZoomLevel: minZoomLevel,
|
||||
maxZoomLevel: maxZoomLevel
|
||||
numZoomLevels: numZoomLevels
|
||||
};
|
||||
|
||||
var layer = new OpenLayers.Layer('Test Layer', options);
|
||||
|
||||
t.eq(layer.getProjection(), projection, "getProjection() works");
|
||||
t.ok(layer.getMaxExtent().equals(maxExtent), "getMaxExtent() works");
|
||||
t.eq(layer.getMaxResolution(), maxResolution, "getMaxResolution() works");
|
||||
t.eq(layer.getMinZoomLevel(), minZoomLevel, "getMinZoomLevel() works");
|
||||
t.eq(layer.getMaxZoomLevel(), maxZoomLevel, "getMaxZoomLevel() works");
|
||||
t.eq(layer.projection, projection, "projection set correctly");
|
||||
t.ok(layer.maxExtent.equals(maxExtent), "maxExtent set correctly");
|
||||
t.eq(layer.maxResolution, maxResolution, "maxResolution set correctly");
|
||||
t.eq(layer.numZoomLevels, numZoomLevels, "numZoomLevels set correctly");
|
||||
}
|
||||
|
||||
function test_05_Layer_visibility(t) {
|
||||
|
||||
@@ -56,7 +56,11 @@
|
||||
// MOUSEMOVE test does not seem to work...
|
||||
// t.plan( 2 );
|
||||
|
||||
t.plan(1);
|
||||
if (document.createEventObject) {
|
||||
t.plan(2);
|
||||
} else {
|
||||
t.plan(1);
|
||||
}
|
||||
var map = new OpenLayers.Map('map');
|
||||
|
||||
layer = new OpenLayers.Layer.EventPane('Test Layer');
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
bounds = new OpenLayers.Bounds(10,10,100,100);
|
||||
zoom = layer.getZoomForExtent(bounds);
|
||||
|
||||
t.eq( zoom, 3, "getZoomForExtent() returns correct value");
|
||||
t.eq( zoom, 2, "getZoomForExtent() returns correct value");
|
||||
}
|
||||
|
||||
|
||||
@@ -114,13 +114,13 @@
|
||||
* -insertColumn
|
||||
* -insertRow
|
||||
|
||||
function test_07_Layer_Grid_moveTo(t) {
|
||||
function 07_Layer_Grid_moveTo(t) {
|
||||
}
|
||||
|
||||
function test_08_Layer_Grid_insertColumn(t) {
|
||||
function 08_Layer_Grid_insertColumn(t) {
|
||||
}
|
||||
|
||||
function test_09_Layer_Grid_insertRow(t) {
|
||||
function 09_Layer_Grid_insertRow(t) {
|
||||
}
|
||||
|
||||
*
|
||||
@@ -166,41 +166,15 @@
|
||||
}
|
||||
|
||||
|
||||
function test_11_Layer_Grid_getTile(t) {
|
||||
|
||||
t.plan(2);
|
||||
|
||||
var options = {tileSize: new OpenLayers.Size(500,50)};
|
||||
var map = new OpenLayers.Map('map', options);
|
||||
|
||||
//test with tile creation
|
||||
layer = new OpenLayers.Layer.WMS(name, url, params);
|
||||
map.addLayer(layer);
|
||||
|
||||
map.setCenter(new OpenLayers.LonLat(0,0), 5);
|
||||
|
||||
//grab a reference to one of the tiles
|
||||
var tile = layer.grid[0][0];
|
||||
|
||||
var gotTile = layer.getTile(tile.id);
|
||||
|
||||
t.ok( gotTile == tile, "got right tile");
|
||||
|
||||
gotTile = layer.getTile("chicken");
|
||||
t.ok( gotTile == null, "getTile() of bogus id returns null");
|
||||
}
|
||||
|
||||
|
||||
function test_99_Layer_Grid_destroy (t) {
|
||||
|
||||
t.plan( 4 );
|
||||
t.plan( 3 );
|
||||
|
||||
var map = new OpenLayers.Map('map');
|
||||
layer = new OpenLayers.Layer.Grid(name, url, params);
|
||||
map.addLayer(layer);
|
||||
layer.destroy();
|
||||
t.eq( layer.grid, null, "layer.grid is null after destroy" );
|
||||
t.eq( layer.alpha, null, "layer.alpha is null after destroy" );
|
||||
t.eq( layer.tileSize, null, "layer.tileSize is null after destroy" );
|
||||
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
bounds = new OpenLayers.Bounds(10,10,100,100);
|
||||
zoom = layer.getZoomForExtent(bounds);
|
||||
|
||||
t.eq( zoom, 3, "getZoomForExtent() returns correct value");
|
||||
t.eq( zoom, 2, "getZoomForExtent() returns correct value");
|
||||
}
|
||||
|
||||
|
||||
@@ -107,13 +107,13 @@
|
||||
* -insertColumn
|
||||
* -insertRow
|
||||
|
||||
function test_07_Layer_KaMap_moveTo(t) {
|
||||
function 07_Layer_KaMap_moveTo(t) {
|
||||
}
|
||||
|
||||
function test_08_Layer_KaMap_insertColumn(t) {
|
||||
function 08_Layer_KaMap_insertColumn(t) {
|
||||
}
|
||||
|
||||
function test_09_Layer_KaMap_insertRow(t) {
|
||||
function 09_Layer_KaMap_insertRow(t) {
|
||||
}
|
||||
|
||||
*
|
||||
@@ -158,42 +158,15 @@
|
||||
t.ok( (layer.tileSize.h == 50) && (layer.tileSize.w == 500), "tileSize has been set correctly");
|
||||
}
|
||||
|
||||
|
||||
function test_11_Layer_KaMap_getTile(t) {
|
||||
|
||||
t.plan(2);
|
||||
|
||||
var options = {tileSize: new OpenLayers.Size(500,50)};
|
||||
var map = new OpenLayers.Map('map', options);
|
||||
|
||||
//test with tile creation
|
||||
layer = new OpenLayers.Layer.KaMap(name, url, params, units);
|
||||
map.addLayer(layer);
|
||||
|
||||
map.setCenter(new OpenLayers.LonLat(0,0), 5);
|
||||
|
||||
//grab a reference to one of the tiles
|
||||
var tile = layer.grid[0][0];
|
||||
|
||||
var gotTile = layer.getTile(tile.id);
|
||||
|
||||
t.ok( gotTile == tile, "got right tile");
|
||||
|
||||
gotTile = layer.getTile("chicken");
|
||||
t.ok( gotTile == null, "getTile() of bogus id returns null");
|
||||
}
|
||||
|
||||
|
||||
function test_99_Layer_KaMap_destroy (t) {
|
||||
|
||||
t.plan( 4 );
|
||||
t.plan( 3 );
|
||||
|
||||
var map = new OpenLayers.Map('map');
|
||||
layer = new OpenLayers.Layer.KaMap(name, url, params, units);
|
||||
map.addLayer(layer);
|
||||
layer.destroy();
|
||||
t.eq( layer.grid, null, "layer.grid is null after destroy" );
|
||||
t.eq( layer.alpha, null, "layer.alpha is null after destroy" );
|
||||
t.eq( layer.tileSize, null, "layer.tileSize is null after destroy" );
|
||||
|
||||
|
||||
|
||||
128
tests/test_Layer_MultiMap.html
Normal file
@@ -0,0 +1,128 @@
|
||||
<html>
|
||||
<head>
|
||||
<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 layer;
|
||||
|
||||
function test_01_Layer_MultiMap_constructor (t) {
|
||||
t.plan( 4 );
|
||||
|
||||
var map = new OpenLayers.Map('map');
|
||||
var layer = new OpenLayers.Layer.MultiMap('Goog Layer');
|
||||
map.addLayer(layer);
|
||||
|
||||
|
||||
t.ok( layer instanceof OpenLayers.Layer.MultiMap, "new OpenLayers.Layer.MultiMap returns object" );
|
||||
t.eq( layer.CLASS_NAME, "OpenLayers.Layer.MultiMap", "CLASS_NAME variable set correctly");
|
||||
|
||||
t.eq( layer.name, "Goog Layer", "layer.name is correct" );
|
||||
|
||||
t.ok ( layer.multimap != null, "MultiMap Object correctly loaded");
|
||||
}
|
||||
|
||||
function test_02_Layer_MultiMap_isBaseLayer (t) {
|
||||
t.plan(1);
|
||||
|
||||
var layer = new OpenLayers.Layer.MultiMap('Goog Layer');
|
||||
|
||||
t.ok(layer.isBaseLayer, "a default load of google layer responds as a base layer");
|
||||
}
|
||||
|
||||
function test_03_Layer_MultiMap_Translation_zoom (t) {
|
||||
|
||||
t.plan( 4 );
|
||||
|
||||
var map = new OpenLayers.Map('map');
|
||||
var layer = new OpenLayers.Layer.MultiMap('Goog Layer');
|
||||
map.addLayer(layer);
|
||||
|
||||
// these two lines specify an appropriate translation.
|
||||
// the code afterwards works by itself to test that translation
|
||||
// works correctly both ways.
|
||||
var gZoom = 5;
|
||||
var correspondingOLZoom = 4;
|
||||
|
||||
|
||||
olZoom = layer.getOLZoomFromMMZoom(gZoom);
|
||||
t.eq(olZoom, correspondingOLZoom, "Translation from GZoom to OL Zoom works");
|
||||
t.eq(layer.getMMZoomFromOLZoom(olZoom), gZoom, "Translation from OL Zoom to GZoom works");
|
||||
|
||||
t.ok( layer.getMMZoomFromOLZoom(null) == null, "getGZoomFromOLZoom(null) returns null");
|
||||
t.ok( layer.getOLZoomFromMMZoom(null) == null, "getOLZoomFromGZoom(null) returns null");
|
||||
}
|
||||
|
||||
function test_04_Layer_MultiMap_Translation_lonlat (t) {
|
||||
|
||||
t.plan( 4 );
|
||||
|
||||
var map = new OpenLayers.Map('map');
|
||||
var layer = new OpenLayers.Layer.MultiMap('Goog Layer');
|
||||
map.addLayer(layer);
|
||||
|
||||
// these two lines specify an appropriate translation.
|
||||
// the code afterwards works by itself to test that translation
|
||||
// works correctly both ways.
|
||||
var gLatLng = new MMLatLon(50,100);
|
||||
var correspondingOLLonLat = new OpenLayers.LonLat(100,50);
|
||||
|
||||
|
||||
olLonLat = layer.getOLLonLatFromMMLatLong(gLatLng);
|
||||
t.ok(olLonLat.equals(correspondingOLLonLat), "Translation from GLatLng to OpenLayers.LonLat works");
|
||||
|
||||
var transGLatLng = layer.getMMLatLongFromOLLonLat(olLonLat);
|
||||
t.ok( (transGLatLng.lat == gLatLng.lat) && (transGLatLng.lon == transGLatLng.lon), "Translation from OpenLayers.LonLat to GLatLng works");
|
||||
|
||||
t.ok( layer.getMMLatLongFromOLLonLat(null) == null, "getGLatLngFromOLLonLat(null) returns null");
|
||||
t.ok( layer.getOLLonLatFromMMLatLong(null) == null, "getOLLonLatFromGLatLng(null) returns null");
|
||||
}
|
||||
|
||||
function test_05_Layer_MultiMap_Translation_pixel (t) {
|
||||
|
||||
t.plan( 4 );
|
||||
|
||||
var map = new OpenLayers.Map('map');
|
||||
var layer = new OpenLayers.Layer.MultiMap('Goog Layer');
|
||||
map.addLayer(layer);
|
||||
|
||||
// these two lines specify an appropriate translation.
|
||||
// the code afterwards works by itself to test that translation
|
||||
// works correctly both ways.
|
||||
var gPoint = new MMPoint(50,100);
|
||||
var correspondingOLPixel = new OpenLayers.Pixel(50, 100);
|
||||
|
||||
|
||||
olPixel = layer.getOLPixelFromPixel(gPoint);
|
||||
t.ok( olPixel.equals(correspondingOLPixel), "Translation from GPoint to OpenLayers.Pixel works");
|
||||
|
||||
var transGPoint = layer.getPixelFromOLPixel(olPixel);
|
||||
t.ok( ((transGPoint.x == transGPoint.x) && (transGPoint.y == transGPoint.y)), "Translation from OpenLayers.Pixel to GPoint works");
|
||||
|
||||
t.ok( layer.getPixelFromOLPixel(null) == null, "getGPointFromOLPixel(null) returns null");
|
||||
t.ok( layer.getOLPixelFromPixel(null) == null, "getOLPixelFromGPoint(null) returns null");
|
||||
}
|
||||
|
||||
|
||||
function test_99_Layer_destroy (t) {
|
||||
t.plan( 5 );
|
||||
|
||||
var map = new OpenLayers.Map('map');
|
||||
|
||||
layer = new OpenLayers.Layer.MultiMap('Test Layer');
|
||||
map.addLayer(layer);
|
||||
|
||||
layer.destroy();
|
||||
|
||||
t.eq( layer.name, null, "layer.name is null after destroy" );
|
||||
t.eq( layer.div, null, "layer.div is null after destroy" );
|
||||
t.eq( layer.map, null, "layer.map is null after destroy" );
|
||||
t.eq( layer.options, null, "layer.options is null after destroy" );
|
||||
t.eq( layer.multimap, null, "layer.gmap is null after destroy" );
|
||||
}
|
||||
// -->
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="map"></div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -149,6 +149,31 @@
|
||||
t.eq(str, "http://octo.metacarta.com/cgi-bin/mapserv?LAYERS=basic&FORMAT=image/png&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application/vnd.ogc.se_inimage", "getFullRequestString() by default does *not* add SRS value if projection is 'none'");
|
||||
|
||||
}
|
||||
|
||||
function test_08_Layer_WMS_setOpacity (t) {
|
||||
t.plan( 5 );
|
||||
|
||||
var map = new OpenLayers.Map('map');
|
||||
map.projection = "xx";
|
||||
tUrl = "http://octo.metacarta.com/cgi-bin/mapserv";
|
||||
tParams = { layers: 'basic',
|
||||
format: 'image/png'};
|
||||
tOptions = { 'opacity': '0.5' };
|
||||
var tLayer = new OpenLayers.Layer.WMS(name, tUrl, tParams, tOptions);
|
||||
map.addLayer(tLayer);
|
||||
map.zoomToMaxExtent();
|
||||
t.eq(tLayer.opacity, "0.5", "Opacity is set correctly");
|
||||
t.eq(tLayer.div.firstChild.style.opacity, "0.5", "Opacity on tile is correct");
|
||||
tLayer.setOpacity("0.6");
|
||||
t.eq(tLayer.opacity, "0.6", "setOpacity works properly");
|
||||
t.eq(tLayer.div.firstChild.style.opacity, "0.6", "Opacity on tile is changed correctly");
|
||||
var pixel = new OpenLayers.Pixel(5,6);
|
||||
var tile = tLayer.addTile(new OpenLayers.Bounds(1,2,3,4), pixel);
|
||||
tile.draw();
|
||||
t.eq(tile.imgDiv.style.opacity, "0.6", "Tile opacity is set correctly");
|
||||
|
||||
}
|
||||
|
||||
|
||||
function test_99_Layer_WMS_destroy (t) {
|
||||
|
||||
|
||||
@@ -13,6 +13,15 @@
|
||||
t.eq( lonlat.lon, 6, "lonlat.lon is set correctly");
|
||||
t.eq( lonlat.lat, 5, "lonlat.lat is set correctly");
|
||||
}
|
||||
|
||||
function test_01a_LonLat_constructorFromStrings (t) {
|
||||
t.plan( 4 );
|
||||
lonlat = new OpenLayers.LonLat("6", "5");
|
||||
t.ok( lonlat instanceof OpenLayers.LonLat, "new OpenLayers.LonLat returns LonLat object" );
|
||||
t.eq( lonlat.CLASS_NAME, "OpenLayers.LonLat", "lonlat.CLASS_NAME is set correctly");
|
||||
t.eq( lonlat.lon, 6, "lonlat.lon is set correctly");
|
||||
t.eq( lonlat.lat, 5, "lonlat.lat is set correctly");
|
||||
}
|
||||
|
||||
function test_02_LonLat_toString(t) {
|
||||
t.plan( 1 );
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
t.ok( map.controls instanceof Array, "map.controls is an Array" );
|
||||
t.ok( map.events instanceof OpenLayers.Events, "map.events is an OpenLayers.Events" );
|
||||
t.ok( map.getMaxExtent() instanceof OpenLayers.Bounds, "map.maxExtent is an OpenLayers.Bounds" );
|
||||
t.ok( map.getMaxZoomLevel() > 0, "map.maxZoomLevel is set" );
|
||||
t.ok( map.getNumZoomLevels() > 0, "map has a default numZoomLevels" );
|
||||
}
|
||||
function test_02_Map_center(t) {
|
||||
t.plan(3);
|
||||
@@ -63,8 +63,8 @@
|
||||
}
|
||||
function test_04_Map_options(t) {
|
||||
t.plan(2);
|
||||
map = new OpenLayers.Map($('map'), {maxZoomLevel: 5, maxResolution: 3.14159});
|
||||
t.eq( map.maxZoomLevel, 5, "map.maxZoomLevel set correctly via options hashtable" );
|
||||
map = new OpenLayers.Map($('map'), {numZoomLevels: 6, maxResolution: 3.14159});
|
||||
t.eq( map.numZoomLevels, 6, "map.numZoomLevels set correctly via options hashtable" );
|
||||
t.eq( map.maxResolution, 3.14159, "map.maxResolution set correctly via options hashtable" );
|
||||
}
|
||||
function test_05_Map_center(t) {
|
||||
@@ -151,18 +151,10 @@
|
||||
}
|
||||
t.ok(!found, "popup.div successfully removed from the map's viewPort");
|
||||
}
|
||||
function test_10_Map_auto_res(t) {
|
||||
t.plan(2);
|
||||
map = new OpenLayers.Map($('map'), {maxZoomLevel: 5, maxResolution: 'auto'});
|
||||
t.eq( map.maxResolution, 1/3, "map.maxResolution set correctly via auto" );
|
||||
map = new OpenLayers.Map($('map'), {maxZoomLevel: 5, maxResolution: null});
|
||||
t.eq( map.maxResolution, 1/3, "map.maxResolution set correctly via null" );
|
||||
}
|
||||
|
||||
/*** THIS IS A GOOD TEST, BUT IT SHOULD BE MOVED TO WMS.
|
||||
* Also, it won't work until we figure out the viewSize bug
|
||||
|
||||
function test_08_Map_px_lonlat_translation (t) {
|
||||
function 08_Map_px_lonlat_translation (t) {
|
||||
t.plan( 6 );
|
||||
map = new OpenLayers.Map($('map'));
|
||||
var baseLayer = new OpenLayers.Layer.WMS("Test Layer",
|
||||
|
||||
@@ -13,6 +13,15 @@
|
||||
t.eq( pixel.y, 6, "pixel.y is set correctly");
|
||||
}
|
||||
|
||||
function test_01a_Pixel_constructorFromString (t) {
|
||||
t.plan( 4 );
|
||||
pixel = new OpenLayers.Pixel("5","6");
|
||||
t.ok( pixel instanceof OpenLayers.Pixel, "new OpenLayers.Pixel returns Pixel object" );
|
||||
t.eq( pixel.CLASS_NAME, "OpenLayers.Pixel", "pixel.CLASS_NAME is set correctly");
|
||||
t.eq( pixel.x, 5, "pixel.x is set correctly");
|
||||
t.eq( pixel.y, 6, "pixel.y is set correctly");
|
||||
}
|
||||
|
||||
function test_02_Pixel_toString(t) {
|
||||
t.plan( 1 );
|
||||
pixel = new OpenLayers.Pixel(5,6);
|
||||
|
||||
@@ -1,107 +1,105 @@
|
||||
<html>
|
||||
<head>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
<script type="text/javascript"><!--
|
||||
var popup;
|
||||
|
||||
function test_01_Popup_default_constructor(t) {
|
||||
t.plan( 8 );
|
||||
|
||||
var size = new OpenLayers.Size(OpenLayers.Popup.WIDTH,
|
||||
OpenLayers.Popup.HEIGHT);
|
||||
popup = new OpenLayers.Popup();
|
||||
|
||||
t.ok( popup instanceof OpenLayers.Popup, "new OpenLayers.Popup returns Popup object" );
|
||||
t.ok(popup.id.startsWith("Popup"), "good default popup.id");
|
||||
t.ok(popup.size.equals(size), "good default popup.size");
|
||||
t.eq(popup.contentHTML, "", "good default popup.contentHTML");
|
||||
t.eq(popup.backgroundColor, OpenLayers.Popup.COLOR, "good default popup.backgroundColor");
|
||||
t.eq(popup.opacity, OpenLayers.Popup.OPACITY, "good default popup.opacity");
|
||||
t.eq(popup.border, OpenLayers.Popup.BORDER, "good default popup.border");
|
||||
|
||||
|
||||
var oldIndex = parseInt(popup.id.slice("Popup".length));
|
||||
|
||||
popup = new OpenLayers.Popup();
|
||||
var newIndex = parseInt(popup.id.slice("Popup".length));
|
||||
|
||||
t.eq(newIndex, oldIndex + 1, "default id generator incrementing correctly");
|
||||
}
|
||||
|
||||
function test_02_Popup_constructor (t) {
|
||||
t.plan( 5 );
|
||||
|
||||
var id = "chicken";
|
||||
var w = 500;
|
||||
var h = 400;
|
||||
var sz = new OpenLayers.Size(w,h);
|
||||
var lon = 5;
|
||||
var lat = 40;
|
||||
var ll = new OpenLayers.LonLat(lon, lat);
|
||||
var content = "foo";
|
||||
|
||||
popup = new OpenLayers.Popup(id,
|
||||
ll,
|
||||
sz,
|
||||
content);
|
||||
|
||||
t.ok( popup instanceof OpenLayers.Popup, "new OpenLayers.Popup returns Popup object" );
|
||||
t.eq(popup.id, id, "popup.id set correctly");
|
||||
t.ok(popup.lonlat.equals(ll), "popup.lonlat set correctly");
|
||||
t.ok(popup.size.equals(sz), "popup.size set correctly");
|
||||
t.eq(popup.contentHTML, content, "contentHTML porpoerty of set correctly");
|
||||
}
|
||||
|
||||
function test_03_Popup_draw(t) {
|
||||
|
||||
t.plan( 11 );
|
||||
|
||||
var id = "chicken";
|
||||
var x = 50;
|
||||
var y = 100;
|
||||
var w = 500;
|
||||
var h = 400;
|
||||
var content = "charlie";
|
||||
var color = "red";
|
||||
var opacity = 0.5;
|
||||
var border = "1px solid";
|
||||
|
||||
|
||||
popup = new OpenLayers.Popup(id);
|
||||
popup.setSize(new OpenLayers.Size(w, h));
|
||||
popup.setContentHTML(content);
|
||||
popup.setBackgroundColor(color);
|
||||
popup.setOpacity(opacity);
|
||||
popup.setBorder(border);
|
||||
popup.draw(new OpenLayers.Pixel(x, y));
|
||||
|
||||
t.eq(popup.div.id, id + "_div", "popup.div.id set correctly");
|
||||
t.eq(popup.div.style.left, x + "px", "left position of popup.div set correctly");
|
||||
t.eq(popup.div.style.top, y + "px", "top position of popup.div set correctly");
|
||||
t.eq(popup.div.style.width, w + "px", "width position of popup.div set correctly");
|
||||
t.eq(popup.div.style.height, h + "px", "heightposition of popup.div set correctly");
|
||||
t.eq(popup.div.innerHTML, content, "good default popup.contentHTML");
|
||||
t.eq(popup.div.style.backgroundColor, color, "good default popup.backgroundColor");
|
||||
|
||||
if (navigator.appName.indexOf("Microsoft") == -1) {
|
||||
t.eq(parseFloat(popup.div.style.opacity), opacity, "good default popup.opacity");
|
||||
} else {
|
||||
t.eq(popup.div.style.filter, "alpha(opacity=" + opacity*100 + ")", "good default popup.opacity");
|
||||
}
|
||||
t.ok(popup.div.style.border.indexOf(border) != -1, "good default popup.border");
|
||||
|
||||
x += 50;
|
||||
popup.moveTo(new OpenLayers.Pixel(x, y));
|
||||
t.eq(popup.div.style.left, x + "px", "moveTo updates left position of popup.div correctly");
|
||||
t.eq(popup.div.style.top, y + "px", "moveTo updates top position of popup.div correctly");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// -->
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
<html>
|
||||
<head>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
<script type="text/javascript"><!--
|
||||
var popup;
|
||||
|
||||
function test_01_Popup_default_constructor(t) {
|
||||
t.plan( 8 );
|
||||
|
||||
var size = new OpenLayers.Size(OpenLayers.Popup.WIDTH,
|
||||
OpenLayers.Popup.HEIGHT);
|
||||
popup = new OpenLayers.Popup();
|
||||
|
||||
t.ok( popup instanceof OpenLayers.Popup, "new OpenLayers.Popup returns Popup object" );
|
||||
t.ok(popup.id.startsWith("OpenLayers.Popup"), "valid default popupid");
|
||||
var firstID = popup.id;
|
||||
t.ok(popup.size.equals(size), "good default popup.size");
|
||||
t.eq(popup.contentHTML, "", "good default popup.contentHTML");
|
||||
t.eq(popup.backgroundColor, OpenLayers.Popup.COLOR, "good default popup.backgroundColor");
|
||||
t.eq(popup.opacity, OpenLayers.Popup.OPACITY, "good default popup.opacity");
|
||||
t.eq(popup.border, OpenLayers.Popup.BORDER, "good default popup.border");
|
||||
|
||||
|
||||
popup = new OpenLayers.Popup();
|
||||
var newID = popup.id;
|
||||
t.ok(newID != firstID, "default id generator creating unique ids");
|
||||
}
|
||||
|
||||
function test_02_Popup_constructor (t) {
|
||||
t.plan( 5 );
|
||||
|
||||
var id = "chicken";
|
||||
var w = 500;
|
||||
var h = 400;
|
||||
var sz = new OpenLayers.Size(w,h);
|
||||
var lon = 5;
|
||||
var lat = 40;
|
||||
var ll = new OpenLayers.LonLat(lon, lat);
|
||||
var content = "foo";
|
||||
|
||||
popup = new OpenLayers.Popup(id,
|
||||
ll,
|
||||
sz,
|
||||
content);
|
||||
|
||||
t.ok( popup instanceof OpenLayers.Popup, "new OpenLayers.Popup returns Popup object" );
|
||||
t.eq(popup.id, id, "popup.id set correctly");
|
||||
t.ok(popup.lonlat.equals(ll), "popup.lonlat set correctly");
|
||||
t.ok(popup.size.equals(sz), "popup.size set correctly");
|
||||
t.eq(popup.contentHTML, content, "contentHTML porpoerty of set correctly");
|
||||
}
|
||||
|
||||
function test_03_Popup_draw(t) {
|
||||
|
||||
t.plan( 11 );
|
||||
|
||||
var id = "chicken";
|
||||
var x = 50;
|
||||
var y = 100;
|
||||
var w = 500;
|
||||
var h = 400;
|
||||
var content = "charlie";
|
||||
var color = "red";
|
||||
var opacity = 0.5;
|
||||
var border = "1px solid";
|
||||
|
||||
|
||||
popup = new OpenLayers.Popup(id);
|
||||
popup.setSize(new OpenLayers.Size(w, h));
|
||||
popup.setContentHTML(content);
|
||||
popup.setBackgroundColor(color);
|
||||
popup.setOpacity(opacity);
|
||||
popup.setBorder(border);
|
||||
popup.draw(new OpenLayers.Pixel(x, y));
|
||||
|
||||
t.eq(popup.div.id, id, "popup.div.id set correctly");
|
||||
t.eq(popup.div.style.left, x + "px", "left position of popup.div set correctly");
|
||||
t.eq(popup.div.style.top, y + "px", "top position of popup.div set correctly");
|
||||
t.eq(popup.div.style.width, w + "px", "width position of popup.div set correctly");
|
||||
t.eq(popup.div.style.height, h + "px", "heightposition of popup.div set correctly");
|
||||
t.eq(popup.div.innerHTML, content, "good default popup.contentHTML");
|
||||
t.eq(popup.div.style.backgroundColor, color, "good default popup.backgroundColor");
|
||||
|
||||
if (navigator.appName.indexOf("Microsoft") == -1) {
|
||||
t.eq(parseFloat(popup.div.style.opacity), opacity, "good default popup.opacity");
|
||||
} else {
|
||||
t.eq(popup.div.style.filter, "alpha(opacity=" + opacity*100 + ")", "good default popup.opacity");
|
||||
}
|
||||
t.ok(popup.div.style.border.indexOf(border) != -1, "good default popup.border");
|
||||
|
||||
x += 50;
|
||||
popup.moveTo(new OpenLayers.Pixel(x, y));
|
||||
t.eq(popup.div.style.left, x + "px", "moveTo updates left position of popup.div correctly");
|
||||
t.eq(popup.div.style.top, y + "px", "moveTo updates top position of popup.div correctly");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// -->
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -13,6 +13,15 @@
|
||||
t.eq( size.h, 6, "size.h is set correctly");
|
||||
}
|
||||
|
||||
function test_01a_Size_constructorFromString (t) {
|
||||
t.plan( 4 );
|
||||
size = new OpenLayers.Size("5","6");
|
||||
t.ok( size instanceof OpenLayers.Size, "new OpenLayers.Size returns size object" );
|
||||
t.eq( size.CLASS_NAME, "OpenLayers.Size", "size.CLASS_NAME is set correctly");
|
||||
t.eq( size.w, 5, "size.w is set correctly");
|
||||
t.eq( size.h, 6, "size.h is set correctly");
|
||||
}
|
||||
|
||||
function test_02_Size_toString(t) {
|
||||
t.plan( 1 );
|
||||
size = new OpenLayers.Size(5,6);
|
||||
|
||||
@@ -121,11 +121,9 @@ class Config:
|
||||
for line in open(filename)
|
||||
if line != "\n"] # Skip blank lines
|
||||
|
||||
self.forceFirst = \
|
||||
lines[lines.index("[first]") + 1:lines.index("[last]")]
|
||||
self.forceFirst = lines[lines.index("[first]") + 1:lines.index("[last]")]
|
||||
|
||||
self.forceLast = \
|
||||
lines[lines.index("[last]") + 1:lines.index("[exclude]")]
|
||||
self.forceLast = lines[lines.index("[last]") + 1:lines.index("[exclude]")]
|
||||
|
||||
self.exclude = lines[lines.index("[exclude]") + 1:]
|
||||
|
||||
@@ -163,9 +161,7 @@ if __name__ == "__main__":
|
||||
allFiles.append(filepath)
|
||||
|
||||
## Header inserted at the start of each file in the output
|
||||
HEADER = "/* " + "=" * 70 + "\n"\
|
||||
" %s\n" +\
|
||||
" " + "=" * 70 + " */\n\n"
|
||||
HEADER = "/* " + "=" * 70 + " %s\n" + " " + "=" * 70 + " */\n\n"
|
||||
|
||||
files = {}
|
||||
|
||||
@@ -200,12 +196,10 @@ if __name__ == "__main__":
|
||||
## Move forced first and last files to the required position
|
||||
if cfg:
|
||||
print "Re-ordering files...\n"
|
||||
order = cfg.forceFirst + \
|
||||
[item
|
||||
order = cfg.forceFirst + [item
|
||||
for item in order
|
||||
if ((item not in cfg.forceFirst) and
|
||||
(item not in cfg.forceLast))] + \
|
||||
cfg.forceLast
|
||||
(item not in cfg.forceLast))] + cfg.forceLast
|
||||
|
||||
## Double check all dependencies have been met
|
||||
for fp in order:
|
||||
|
||||