Compare commits
69 Commits
release-2.
...
release-2.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ba42a3a1b5 | ||
|
|
739b821570 | ||
|
|
82f786c630 | ||
|
|
eb783aab37 | ||
|
|
a668730ec1 | ||
|
|
3aca63eabe | ||
|
|
7ca9d2ec83 | ||
|
|
0500b9cba2 | ||
|
|
581df4e5f1 | ||
|
|
a7da80c24b | ||
|
|
00dfc669d2 | ||
|
|
2ed1ce98b3 | ||
|
|
9f0b0e0ed7 | ||
|
|
f6a50a37fc | ||
|
|
deaebf8733 | ||
|
|
a6ff5584ad | ||
|
|
402021f24f | ||
|
|
abfbe30b2b | ||
|
|
a98ee2580d | ||
|
|
426e1cf2f9 | ||
|
|
e31c7aaf0b | ||
|
|
6e9ba61679 | ||
|
|
6ddeb07e90 | ||
|
|
2408752e27 | ||
|
|
39536e788a | ||
|
|
e2378ad68a | ||
|
|
44819f20e8 | ||
|
|
6a2fa9aaf1 | ||
|
|
ea9a6a6a23 | ||
|
|
4847d66d6a | ||
|
|
c4541115f9 | ||
|
|
d500981f09 | ||
|
|
8e51ada8de | ||
|
|
633e31da36 | ||
|
|
c1779d1520 | ||
|
|
29d6d8f017 | ||
|
|
f56dab0644 | ||
|
|
2ec05163ed | ||
|
|
1e8c8e8404 | ||
|
|
cd21f42dab | ||
|
|
1459ac5de9 | ||
|
|
484fc207cf | ||
|
|
cfd7858861 | ||
|
|
17581c714d | ||
|
|
1a12d90455 | ||
|
|
7035551fcf | ||
|
|
b11580aca3 | ||
|
|
b8f4577a78 | ||
|
|
4df6b8aa2b | ||
|
|
d2601b3684 | ||
|
|
1a0cbdfd25 | ||
|
|
9956bffe71 | ||
|
|
24047ee512 | ||
|
|
07d39aca00 | ||
|
|
7ae04f7423 | ||
|
|
d8d2b225e4 | ||
|
|
5952a7e3af | ||
|
|
8d1fe36b0f | ||
|
|
fa3b3a3d0c | ||
|
|
36ec579e39 | ||
|
|
b1cfe16347 | ||
|
|
9d3aea6a2f | ||
|
|
a90c976375 | ||
|
|
08981babaa | ||
|
|
3623889f3a | ||
|
|
1bb0952c68 | ||
|
|
d28f293cd9 | ||
|
|
5ffbe842c2 | ||
|
|
0da9f792c7 |
@@ -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.3 KiB After Width: | Height: | Size: 3.4 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.3 KiB After Width: | Height: | Size: 3.4 KiB |
@@ -1,7 +1,7 @@
|
||||
#!/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 Util"
|
||||
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>
|
||||
|
||||
@@ -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. 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.
|
||||
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.
|
||||
|
||||
* 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. This control must be added to the map after a baselayer has been set.
|
||||
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,
|
||||
|
||||
* 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.
|
||||
|
||||
@@ -12,6 +12,7 @@ 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.
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
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).
|
||||
68
examples/LayerSwitcher.html
Normal file
@@ -0,0 +1,68 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
|
||||
<style type="text/css">
|
||||
#map {
|
||||
width: 800px;
|
||||
height: 475px;
|
||||
border: 1px solid black;
|
||||
}
|
||||
</style>
|
||||
<!-- gmaps api key for http://openlayers.org/~euzuro -->
|
||||
<script src='http://maps.google.com/maps?file=api&v=2&key=ABQIAAAA9XNhd8q0UdwNC7YSO4YZghQELW4Ku31wWCtlZquTlkHLCFh9LBTYvc_eIShlmo0YZwSitw0fQ1ZyXA'></script>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
var lon = 5;
|
||||
var lat = 40;
|
||||
var zoom = 5;
|
||||
var map, layer, glayer;
|
||||
|
||||
OpenLayers.ProxyHost = "/proxy/?url=";
|
||||
function init(){
|
||||
map = new OpenLayers.Map( $('map') );
|
||||
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
||||
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
|
||||
map.addLayer(layer);
|
||||
|
||||
glayer = new OpenLayers.Layer.Google("goog");
|
||||
map.addLayer(glayer);
|
||||
|
||||
layer = new OpenLayers.Layer.WFS( "wfs",
|
||||
"http://labs.metacarta.com/search/WFS?",
|
||||
{maxfeatures: 1},
|
||||
{ featureClass: OpenLayers.Feature.WFS});
|
||||
map.addLayer(layer);
|
||||
|
||||
|
||||
map.setCenter(new OpenLayers.LonLat(0, 0), 2);
|
||||
|
||||
map.addControl( new OpenLayers.Control.LayerSwitcher() );
|
||||
}
|
||||
|
||||
function add() {
|
||||
|
||||
markers2 = new OpenLayers.Layer.Markers("markers2");
|
||||
map.addLayer(markers2);
|
||||
|
||||
|
||||
var icon = new OpenLayers.Icon('http://boston.openguides.org/markers/AQUA.png',new OpenLayers.Size(10,17));
|
||||
marker = new OpenLayers.Marker(new OpenLayers.LonLat(2, 41), icon);
|
||||
markers.addMarker(marker);
|
||||
}
|
||||
|
||||
|
||||
function remove() {
|
||||
markers.removeMarker(marker);
|
||||
}
|
||||
|
||||
|
||||
// -->
|
||||
</script>
|
||||
</head>
|
||||
<body onload="init()">
|
||||
<div id="map"></div>
|
||||
<div style="background-color:green" onclick="add()"> click to add the marker to the map</div>
|
||||
<div style="background-color:red" onclick="remove()"> click to remove the marker from the map</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,613 +0,0 @@
|
||||
<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>
|
||||
@@ -1,58 +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: 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,9 +22,8 @@
|
||||
|
||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||
map.zoomToMaxExtent();
|
||||
|
||||
}
|
||||
|
||||
|
||||
function changer() {
|
||||
popup.setBackgroundColor("red");
|
||||
popup.setSize(new OpenLayers.Size(100,600));
|
||||
@@ -71,9 +70,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);
|
||||
@@ -119,6 +118,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>
|
||||
|
||||
90
examples/test.html
Normal file
@@ -0,0 +1,90 @@
|
||||
<html>
|
||||
|
||||
<script src="../lib/Prototype.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
var one, two, div, msg;
|
||||
|
||||
function init() {
|
||||
|
||||
one = $("one");
|
||||
two = $("two");
|
||||
div = $("div");
|
||||
msg = $("msg");
|
||||
|
||||
Event.observe(div, "click", bar);
|
||||
|
||||
one.checked = true;
|
||||
two.checked = false;
|
||||
|
||||
Event.observe(one, "change", oneClick);
|
||||
Event.observe(two, "change", twoClick);
|
||||
|
||||
}
|
||||
|
||||
function bar(e) {
|
||||
message("clicked div");
|
||||
|
||||
Event.stop(e);
|
||||
|
||||
var status = "one: ";
|
||||
status += (one.checked) ? "checked" : "unchecked";
|
||||
status += " two: ";
|
||||
status += (two.checked) ? "checked" : "unchecked";
|
||||
message(status);
|
||||
}
|
||||
|
||||
function oneClick(e) {
|
||||
message("clicked one");
|
||||
}
|
||||
|
||||
function twoClick(e) {
|
||||
message("clicked two");
|
||||
}
|
||||
|
||||
function message(txt) {
|
||||
msg.innerHTML += " ** " + txt;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<body onload="init()" onclick="message('clicked body')" onmouseup="message('<br>')">
|
||||
|
||||
<div> The idea here is to simulate the layerswitcher radiobuttons UI
|
||||
without all the overhead of openlayers.
|
||||
<br>
|
||||
<br>
|
||||
There are event handlers attached to the following elements:
|
||||
<br>
|
||||
* Body - Prints message "clicked body" to message area
|
||||
<br>
|
||||
* Blue Div - Prints message "clicked div" to message area, stops
|
||||
the event propagation, prints a message with the
|
||||
status of the two radiobuttons
|
||||
<br>
|
||||
* Radio One - Prints message "clicked one" to message area
|
||||
<br>
|
||||
* Radio Two - Prints message "clicked two" to message area
|
||||
<br>
|
||||
<br>
|
||||
<b>
|
||||
The problem, as you will see if you click the radio buttons
|
||||
themselves, is that their "checked" status seems to update, but
|
||||
their visual UI bit does not. Can we fix this!?!
|
||||
</b>
|
||||
</div>
|
||||
|
||||
<div id="div" style="background-color:blue; margin:50px">
|
||||
<input id="one" type="radio" name="foo"/>
|
||||
<span> one </span>
|
||||
<br>
|
||||
<input id="two" type="radio" name="foo"/>
|
||||
<span> two </span>
|
||||
</div>
|
||||
|
||||
<div id="msg" style="background-color:pink; margin-top:200px">
|
||||
Events:
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -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>
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<!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">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" style="width:100%">
|
||||
<head>
|
||||
<title>XHTML Example</title>
|
||||
<script src="../lib/OpenLayers.js" type="text/javascript"></script>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
</head>
|
||||
<body style="width:100%">
|
||||
<div style="width:100%; height:500px" id="map"></div>
|
||||
@@ -14,10 +13,5 @@
|
||||
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,39 +1,38 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
|
||||
<style type="text/css">
|
||||
#map {
|
||||
width: 512px;
|
||||
height: 512px;
|
||||
border: 1px solid black;
|
||||
}
|
||||
</style>
|
||||
<script src="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>
|
||||
<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>
|
||||
|
||||
@@ -1,54 +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>
|
||||
<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>
|
||||
|
||||
@@ -67,14 +67,12 @@ 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",
|
||||
@@ -83,7 +81,6 @@ 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 = parseFloat(x);
|
||||
this.y = parseFloat(y);
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -123,8 +123,8 @@ OpenLayers.Size.prototype = {
|
||||
* @param {float} h
|
||||
*/
|
||||
initialize: function(w, h) {
|
||||
this.w = parseFloat(w);
|
||||
this.h = parseFloat(h);
|
||||
this.w = w;
|
||||
this.h = h;
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -193,8 +193,8 @@ OpenLayers.LonLat.prototype = {
|
||||
* @param {float} lat
|
||||
*/
|
||||
initialize: function(lon, lat) {
|
||||
this.lon = parseFloat(lon);
|
||||
this.lat = parseFloat(lat);
|
||||
this.lon = lon;
|
||||
this.lat = lat;
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -315,10 +315,10 @@ OpenLayers.Bounds.prototype = {
|
||||
*
|
||||
*/
|
||||
initialize: function(left, bottom, right, top) {
|
||||
this.left = parseFloat(left);
|
||||
this.bottom = parseFloat(bottom);
|
||||
this.right = parseFloat(right);
|
||||
this.top = parseFloat(top);
|
||||
this.left = left;
|
||||
this.bottom = bottom;
|
||||
this.right = right;
|
||||
this.top = top;
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -8,9 +8,6 @@
|
||||
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,
|
||||
@@ -31,8 +28,6 @@ OpenLayers.Control.prototype = {
|
||||
*/
|
||||
initialize: function (options) {
|
||||
Object.extend(this, options);
|
||||
|
||||
this.id = OpenLayers.Util.createUniqueID(this.CLASS_NAME + "_");
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -62,7 +57,6 @@ 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();
|
||||
|
||||
@@ -128,7 +128,7 @@ OpenLayers.Control.LayerSwitcher.prototype =
|
||||
// create span
|
||||
var labelSpan = document.createElement("span");
|
||||
labelSpan.innerHTML = layer.name;
|
||||
labelSpan.style.verticalAlign = (baseLayer) ? "bottom" : "baseline";
|
||||
labelSpan.style.verticalAlign = (baseLayer) ? "bottom" : "auto";
|
||||
Event.observe(labelSpan, "click",
|
||||
this.onInputClick.bindAsEventListener(inputElem));
|
||||
// create line break
|
||||
|
||||
@@ -81,7 +81,6 @@ 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);
|
||||
}
|
||||
@@ -97,8 +96,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 = Math.max(1, deltaX) + "px";
|
||||
this.zoomBox.style.height = Math.max(1, deltaY) + "px";
|
||||
this.zoomBox.style.width = deltaX+"px";
|
||||
this.zoomBox.style.height = deltaY+"px";
|
||||
if (evt.xy.x < this.mouseDragStart.x) {
|
||||
this.zoomBox.style.left = evt.xy.x+"px";
|
||||
}
|
||||
@@ -126,7 +125,24 @@ OpenLayers.Control.MouseDefaults.prototype =
|
||||
defaultMouseUp: function (evt) {
|
||||
if (!Event.isLeftClick(evt)) return;
|
||||
if (this.zoomBox) {
|
||||
this.zoomBoxEnd(evt);
|
||||
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);
|
||||
}
|
||||
this.map.viewPortDiv.removeChild(document.getElementById("zoomBox"));
|
||||
this.zoomBox = null;
|
||||
|
||||
} else {
|
||||
if (this.performedDrag) {
|
||||
this.map.setCenter(this.map.center);
|
||||
@@ -141,12 +157,9 @@ OpenLayers.Control.MouseDefaults.prototype =
|
||||
* @param {Event} evt
|
||||
*/
|
||||
defaultMouseOut: function (evt) {
|
||||
if (this.mouseDragStart != null &&
|
||||
OpenLayers.Util.mouseLeft(evt, this.map.div)) {
|
||||
if (this.zoomBox) {
|
||||
this.removeZoomBox();
|
||||
}
|
||||
this.mouseDragStart = null;
|
||||
if (this.mouseDragStart != null
|
||||
&& OpenLayers.Util.mouseLeft(evt, this.map.div)) {
|
||||
this.defaultMouseUp(evt);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -165,44 +178,6 @@ 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/
|
||||
@@ -219,7 +194,7 @@ OpenLayers.Control.MouseDefaults.prototype =
|
||||
var inMap = false;
|
||||
var elem = Event.element(e);
|
||||
while(elem != null) {
|
||||
if (this.map && elem == this.map.div) {
|
||||
if (elem == this.map.div) {
|
||||
inMap = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -6,14 +6,12 @@
|
||||
* @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.MouseDefaults(), {
|
||||
Object.extend( new OpenLayers.Control(), {
|
||||
|
||||
mode: null,
|
||||
|
||||
@@ -21,9 +19,6 @@ 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,
|
||||
@@ -38,9 +33,14 @@ OpenLayers.Control.MouseToolbar.prototype =
|
||||
},
|
||||
|
||||
draw: function() {
|
||||
OpenLayers.Control.prototype.draw.apply(this, arguments);
|
||||
OpenLayers.Control.MouseDefaults.prototype.draw.apply(this, arguments);
|
||||
OpenLayers.Control.prototype.draw.apply(this, arguments);
|
||||
this.buttons = new Object();
|
||||
this.map.events.register( "click", this, this.defaultClick );
|
||||
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");
|
||||
@@ -65,10 +65,10 @@ OpenLayers.Control.MouseToolbar.prototype =
|
||||
btn.imgLocation = imgLocation;
|
||||
btn.activeImgLocation = activeImgLocation;
|
||||
|
||||
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.events = new OpenLayers.Events(this, btn);
|
||||
btn.events.register("mousedown", this, this.buttonClick);
|
||||
btn.events.register("mouseup", this, Event.stop);
|
||||
btn.events.register("click", this, Event.stop);
|
||||
btn.action = id;
|
||||
btn.title = title;
|
||||
btn.alt = title;
|
||||
@@ -79,28 +79,11 @@ OpenLayers.Control.MouseToolbar.prototype =
|
||||
return btn;
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {Event} evt
|
||||
*/
|
||||
buttonDown: function(evt) {
|
||||
buttonClick: function(evt) {
|
||||
if (!Event.isLeftClick(evt)) return;
|
||||
this.buttonClicked = evt.element.action;
|
||||
this.switchModeTo(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
|
||||
@@ -109,7 +92,7 @@ OpenLayers.Control.MouseToolbar.prototype =
|
||||
this.switchModeTo("pan");
|
||||
this.performedDrag = false;
|
||||
var newCenter = this.map.getLonLatFromViewPortPx( evt.xy );
|
||||
this.map.setCenter(newCenter, this.map.zoom + 1);
|
||||
this.map.setCenter(newCenter, this.map.zoom + 2);
|
||||
Event.stop(evt);
|
||||
return false;
|
||||
},
|
||||
@@ -143,10 +126,8 @@ 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 = "";
|
||||
@@ -199,9 +180,7 @@ OpenLayers.Control.MouseToolbar.prototype =
|
||||
|
||||
switchModeTo: function(mode) {
|
||||
if (mode != this.mode) {
|
||||
|
||||
|
||||
if (this.mode && this.buttons[this.mode]) {
|
||||
if (this.mode) {
|
||||
OpenLayers.Util.modifyAlphaImageDiv(this.buttons[this.mode], null, null, null, this.buttons[this.mode].imgLocation);
|
||||
}
|
||||
if (this.mode == "measure" && mode != "measure") {
|
||||
@@ -214,18 +193,7 @@ OpenLayers.Control.MouseToolbar.prototype =
|
||||
this.measureStart = null;
|
||||
}
|
||||
this.mode = mode;
|
||||
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;
|
||||
}
|
||||
|
||||
OpenLayers.Util.modifyAlphaImageDiv(this.buttons[mode], null, null, null, this.buttons[mode].activeImgLocation);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -242,8 +210,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 = Math.max(1, deltaX) + "px";
|
||||
this.zoomBox.style.height = Math.max(1, deltaY) + "px";
|
||||
this.zoomBox.style.width = deltaX+"px";
|
||||
this.zoomBox.style.height = deltaY+"px";
|
||||
if (evt.xy.x < this.mouseDragStart.x) {
|
||||
this.zoomBox.style.left = evt.xy.x+"px";
|
||||
}
|
||||
@@ -272,7 +240,23 @@ OpenLayers.Control.MouseToolbar.prototype =
|
||||
if (!Event.isLeftClick(evt)) return;
|
||||
switch (this.mode) {
|
||||
case "zoombox":
|
||||
this.zoomBoxEnd(evt);
|
||||
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);
|
||||
}
|
||||
this.map.viewPortDiv.removeChild(document.getElementById("zoomBox"));
|
||||
this.zoomBox = null;
|
||||
if (this.startViaKeyboard) this.leaveMode();
|
||||
break;
|
||||
case "pan":
|
||||
@@ -285,26 +269,17 @@ 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)) {
|
||||
if (this.zoomBox) {
|
||||
this.removeZoomBox();
|
||||
if (this.startViaKeyboard) this.leaveMode();
|
||||
}
|
||||
this.mouseDragStart = null;
|
||||
this.map.div.style.cursor = "default";
|
||||
this.defaultMouseUp(evt);
|
||||
}
|
||||
},
|
||||
|
||||
defaultClick: function (evt) {
|
||||
if (this.performedDrag) {
|
||||
this.performedDrag = false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}));
|
||||
});
|
||||
|
||||
|
||||
@@ -76,6 +76,7 @@ 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,7 +12,6 @@ OpenLayers.Control.PanZoomBar.X = 4;
|
||||
OpenLayers.Control.PanZoomBar.Y = 4;
|
||||
OpenLayers.Control.PanZoomBar.prototype =
|
||||
Object.extend( new OpenLayers.Control.PanZoom(), {
|
||||
|
||||
/** @type Array(...) */
|
||||
buttons: null,
|
||||
|
||||
@@ -86,7 +85,7 @@ OpenLayers.Control.PanZoomBar.prototype =
|
||||
"absolute");
|
||||
this.slider = slider;
|
||||
|
||||
this.sliderEvents = new OpenLayers.Events(this, slider, null, true);
|
||||
this.sliderEvents = new OpenLayers.Events(this, slider);
|
||||
this.sliderEvents.register("mousedown", this, this.zoomBarDown);
|
||||
this.sliderEvents.register("mousemove", this, this.zoomBarDrag);
|
||||
this.sliderEvents.register("mouseup", this, this.zoomBarUp);
|
||||
@@ -116,7 +115,7 @@ OpenLayers.Control.PanZoomBar.prototype =
|
||||
|
||||
this.zoombarDiv = div;
|
||||
|
||||
this.divEvents = new OpenLayers.Events(this, div, null, true);
|
||||
this.divEvents = new OpenLayers.Events(this, div);
|
||||
this.divEvents.register("mousedown", this, this.divClick);
|
||||
this.divEvents.register("mousemove", this, this.passEventToSlider);
|
||||
this.divEvents.register("dblclick", this, this.doubleClick);
|
||||
@@ -185,8 +184,8 @@ OpenLayers.Control.PanZoomBar.prototype =
|
||||
this.slider.style.top = newTop+"px";
|
||||
}
|
||||
this.mouseDragStart = evt.xy.clone();
|
||||
Event.stop(evt);
|
||||
}
|
||||
Event.stop(evt);
|
||||
},
|
||||
|
||||
/*
|
||||
|
||||
@@ -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,14 +37,11 @@ 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, fallThrough) {
|
||||
initialize: function (object, element, eventTypes) {
|
||||
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
|
||||
@@ -162,7 +159,8 @@ OpenLayers.Events.prototype = {
|
||||
|
||||
// execute all callbacks registered for specified type
|
||||
var listeners = this.listeners[type];
|
||||
if ((listeners != null) && (listeners.length > 0)) {
|
||||
if (listeners != null) {
|
||||
|
||||
for (var i = 0; i < listeners.length; i++) {
|
||||
var callback = listeners[i];
|
||||
var continueChain;
|
||||
@@ -178,10 +176,6 @@ OpenLayers.Events.prototype = {
|
||||
break;
|
||||
}
|
||||
}
|
||||
// don't fall through to other DOM elements
|
||||
if (!this.fallThrough) {
|
||||
Event.stop(evt);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -211,9 +205,8 @@ OpenLayers.Events.prototype = {
|
||||
this.element.offsets = Position.page(this.element);
|
||||
}
|
||||
return new OpenLayers.Pixel(
|
||||
(evt.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft)) - this.element.offsets[0],
|
||||
(evt.clientY + (document.documentElement.scrollTop || document.body.scrollTop)) - this.element.offsets[1]
|
||||
);
|
||||
evt.clientX - this.element.offsets[0],
|
||||
evt.clientY - 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(this.CLASS_NAME + "_");
|
||||
this.id = OpenLayers.Util.createUniqueID('Feature_');
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,51 +2,51 @@
|
||||
* 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
|
||||
*/
|
||||
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(",");
|
||||
@@ -54,13 +54,13 @@ OpenLayers.Feature.WFS.prototype =
|
||||
parseFloat(floats[1])),
|
||||
id: null};
|
||||
|
||||
},
|
||||
|
||||
/** @final @type String */
|
||||
CLASS_NAME: "OpenLayers.Feature.WFS"
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
|
||||
/** @final @type String */
|
||||
CLASS_NAME: "OpenLayers.Feature.WFS"
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -43,28 +43,13 @@ 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 */
|
||||
numZoomLevels: null,
|
||||
|
||||
@@ -74,6 +59,8 @@ OpenLayers.Layer.prototype = {
|
||||
/** @type float */
|
||||
maxScale: null,
|
||||
|
||||
/** @type String */
|
||||
units: null,
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
@@ -92,13 +79,13 @@ OpenLayers.Layer.prototype = {
|
||||
|
||||
this.name = name;
|
||||
|
||||
this.id = OpenLayers.Util.createUniqueID(this.CLASS_NAME + "_");
|
||||
|
||||
//generate unique id based on name
|
||||
this.id = OpenLayers.Util.createUniqueID("Layer_");
|
||||
|
||||
if (this.div == null) {
|
||||
this.div = OpenLayers.Util.createDiv();
|
||||
this.div.style.width = "100%";
|
||||
this.div.style.height = "100%";
|
||||
this.div.id = this.id;
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -203,9 +190,6 @@ OpenLayers.Layer.prototype = {
|
||||
this[properties[i]] = this.map[properties[i]];
|
||||
}
|
||||
}
|
||||
if (this.isBaseLayer) {
|
||||
this.initResolutions();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -226,7 +210,7 @@ OpenLayers.Layer.prototype = {
|
||||
if ((visible) && (this.map != null)) {
|
||||
var extent = this.map.getExtent();
|
||||
if (extent != null) {
|
||||
this.moveTo(this.map.getExtent(), true);
|
||||
this.moveTo(this.map.getExtent());
|
||||
}
|
||||
}
|
||||
if ((this.map != null) &&
|
||||
@@ -236,6 +220,15 @@ OpenLayers.Layer.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/********************************************************/
|
||||
/* */
|
||||
/* Layer Options */
|
||||
/* */
|
||||
/* Accessor functions to Layer Options parameters */
|
||||
/* */
|
||||
/********************************************************/
|
||||
|
||||
/**
|
||||
* @param {Boolean} isBaseLayer
|
||||
*/
|
||||
@@ -245,169 +238,93 @@ OpenLayers.Layer.prototype = {
|
||||
this.map.events.triggerEvent("changelayer");
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @type String
|
||||
*/
|
||||
getProjection: function() {
|
||||
return this.projection;
|
||||
},
|
||||
|
||||
/**
|
||||
* @type OpenLayers.Bounds
|
||||
*/
|
||||
getMaxExtent: function() {
|
||||
return this.maxExtent;
|
||||
},
|
||||
|
||||
/**
|
||||
* @type float
|
||||
*/
|
||||
getMaxResolution: function() {
|
||||
return this.maxResolution;
|
||||
},
|
||||
|
||||
/**
|
||||
* @returns The total number of zoom levels this layer can reach
|
||||
* @type int
|
||||
*/
|
||||
getNumZoomLevels: function() {
|
||||
return this.numZoomLevels;
|
||||
},
|
||||
|
||||
/********************************************************/
|
||||
/* */
|
||||
/* Baselayer Functions */
|
||||
/* */
|
||||
/* The following functions must all be implemented */
|
||||
/* by all base layers */
|
||||
/* */
|
||||
/********************************************************/
|
||||
|
||||
/** 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.
|
||||
|
||||
/**
|
||||
* @returns Degrees per Pixel
|
||||
* @type float
|
||||
*/
|
||||
getResolution: function() {
|
||||
var zoom = this.map.getZoom();
|
||||
return this.resolutions[zoom];
|
||||
var viewSize = this.map.getSize();
|
||||
var extent = this.getExtent();
|
||||
return Math.max( extent.getWidth() / viewSize.w,
|
||||
extent.getHeight() / viewSize.h );
|
||||
},
|
||||
|
||||
/** Calculates based on resolution, center, and mapsize
|
||||
|
||||
/** Calculates using px-> lonlat translation functions on tl and br
|
||||
* corners of viewport
|
||||
*
|
||||
* @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(resolution) {
|
||||
getExtent: function () {
|
||||
var extent = null;
|
||||
|
||||
|
||||
var size = this.map.getSize();
|
||||
|
||||
var tlPx = new OpenLayers.Pixel(0,0);
|
||||
var tlLL = this.getLonLatFromViewPortPx(tlPx);
|
||||
|
||||
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);
|
||||
|
||||
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 {OpenLayers.Bounds} bounds
|
||||
*
|
||||
* @returns The index of the zoomLevel (entry in the resolutions array)
|
||||
* that still contains the passed-in extent. We do this by
|
||||
* calculating the ideal resolution for the given exteng (based
|
||||
* on the map size) and then find the smallest resolution that
|
||||
* is greater than this ideal resolution.
|
||||
* @type int
|
||||
*/
|
||||
getZoomForExtent: function(extent) {
|
||||
var viewSize = this.map.getSize();
|
||||
var idealResolution = Math.max( extent.getWidth() / viewSize.w,
|
||||
extent.getHeight() / viewSize.h );
|
||||
|
||||
return this.getZoomForResolution(idealResolution);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {float} resolution
|
||||
*
|
||||
* @returns The index of the zoomLevel (entry in the resolutions array)
|
||||
* that is the smallest resolution that is greater than the
|
||||
* passed-in resolution.
|
||||
* @type int
|
||||
*/
|
||||
getZoomForResolution: function(resolution) {
|
||||
|
||||
for(var i=1; i <= this.resolutions.length; i++) {
|
||||
if ( this.resolutions[i] < resolution) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return (i - 1);
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.Pixel} viewPortPx
|
||||
*
|
||||
* @returns An OpenLayers.LonLat which is the passed-in view port
|
||||
* OpenLayers.Pixel, translated into lon/lat by the layer
|
||||
* @type OpenLayers.LonLat
|
||||
*/
|
||||
* @param {OpenLayers.Pixel} viewPortPx
|
||||
*
|
||||
* @returns An OpenLayers.LonLat which is the passed-in view port
|
||||
* OpenLayers.Pixel, translated into lon/lat by the layer
|
||||
* @type OpenLayers.LonLat
|
||||
*/
|
||||
getLonLatFromViewPortPx: function (viewPortPx) {
|
||||
var size = this.map.getSize();
|
||||
var center = this.map.getCenter();
|
||||
@@ -421,12 +338,12 @@ OpenLayers.Layer.prototype = {
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {OpenLayers.LonLat} lonlat
|
||||
*
|
||||
* @returns An OpenLayers.Pixel which is the passed-in OpenLayers.LonLat,
|
||||
* translated into view port pixels
|
||||
* @type OpenLayers.Pixel
|
||||
*/
|
||||
* @param {OpenLayers.LonLat} lonlat
|
||||
*
|
||||
* @returns An OpenLayers.Pixel which is the passed-in OpenLayers.LonLat,
|
||||
* translated into view port pixels
|
||||
* @type OpenLayers.Pixel
|
||||
*/
|
||||
getViewPortPxFromLonLat: function (lonlat) {
|
||||
var resolution = this.map.getResolution();
|
||||
var extent = this.map.getExtent();
|
||||
@@ -437,17 +354,16 @@ OpenLayers.Layer.prototype = {
|
||||
},
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
* @param {OpenLayers.Bounds} bounds
|
||||
*
|
||||
* @return {int}
|
||||
*/
|
||||
getZoomForExtent: function (bounds) {
|
||||
// this should be implemented by subclasses
|
||||
},
|
||||
|
||||
|
||||
|
||||
/** @final @type String */
|
||||
CLASS_NAME: "OpenLayers.Layer"
|
||||
};
|
||||
|
||||
@@ -1,117 +0,0 @@
|
||||
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
|
||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
|
||||
* text of the license. */
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* @requires OpenLayers/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"
|
||||
});
|
||||
@@ -1,133 +0,0 @@
|
||||
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
|
||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
|
||||
* text of the license. */
|
||||
|
||||
|
||||
/**
|
||||
* 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"
|
||||
};
|
||||
|
||||
@@ -70,22 +70,8 @@ OpenLayers.Layer.GeoRSS.prototype =
|
||||
continue;
|
||||
}
|
||||
location = new OpenLayers.LonLat(parseFloat(location[1]), parseFloat(location[0]));
|
||||
|
||||
/* 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); }
|
||||
|
||||
var title = OpenLayers.Util.getNodes(itemlist[i], "title")[0].firstChild.nodeValue;
|
||||
var description = OpenLayers.Util.getNodes(itemlist[i], "description")[0].firstChild.nodeValue;
|
||||
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);
|
||||
|
||||
@@ -12,8 +12,7 @@
|
||||
*/
|
||||
OpenLayers.Layer.Google = Class.create();
|
||||
OpenLayers.Layer.Google.prototype =
|
||||
Object.extend( new OpenLayers.Layer.EventPane(),
|
||||
Object.extend( new OpenLayers.Layer.FixedZoomLevels(), {
|
||||
Object.extend( new OpenLayers.Layer.EventPane(), {
|
||||
|
||||
/** @type Boolean */
|
||||
isFixed: true,
|
||||
@@ -40,8 +39,6 @@ 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);
|
||||
}
|
||||
@@ -252,6 +249,7 @@ OpenLayers.Layer.Google.prototype =
|
||||
//make sure zoom is within bounds
|
||||
var gZoom = Math.min(Math.max(gZoom, this.minZoomLevel),
|
||||
this.maxZoomLevel);
|
||||
|
||||
|
||||
zoom = this.getOLZoomFromGZoom(gZoom);
|
||||
}
|
||||
@@ -440,4 +438,4 @@ OpenLayers.Layer.Google.prototype =
|
||||
},
|
||||
/** @final @type String */
|
||||
CLASS_NAME: "OpenLayers.Layer.Google"
|
||||
}));
|
||||
});
|
||||
|
||||
@@ -267,8 +267,8 @@ OpenLayers.Layer.Grid.prototype =
|
||||
// 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) && (testRow >= 0) &&
|
||||
(testCell < this.grid[0].length) && (testCell >= 0)) {
|
||||
if ((testRow < this.grid.length) &&
|
||||
(testCell < this.grid[0].length)) {
|
||||
tile = this.grid[testRow][testCell];
|
||||
}
|
||||
|
||||
@@ -392,7 +392,66 @@ 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.map.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) );
|
||||
|
||||
//make sure zoom is within bounds
|
||||
zoom = Math.min( Math.max(zoom, 0),
|
||||
this.getNumZoomLevels() - 1);
|
||||
|
||||
return zoom;
|
||||
},
|
||||
|
||||
|
||||
/** @final @type String */
|
||||
CLASS_NAME: "OpenLayers.Layer.Grid"
|
||||
});
|
||||
|
||||
@@ -36,6 +36,17 @@ OpenLayers.Layer.HTTPRequest.prototype =
|
||||
this.params = Object.extend( new Object(), params);
|
||||
},
|
||||
|
||||
/** When the layer is added to the map, once it has taken all the
|
||||
* relevant properties from the map (in Layer.setMap()), we will
|
||||
* make the call to initialize the layer's resolutions array.
|
||||
*
|
||||
* @param {OpenLayers.Map} map
|
||||
*/
|
||||
setMap: function(map) {
|
||||
OpenLayers.Layer.prototype.setMap.apply(this, arguments);
|
||||
this.initResolutions();
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@@ -126,6 +137,89 @@ OpenLayers.Layer.HTTPRequest.prototype =
|
||||
}
|
||||
return requestString;
|
||||
},
|
||||
|
||||
/** 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 zoom = this.map.getZoom();
|
||||
|
||||
return this.resolutions[zoom];
|
||||
},
|
||||
|
||||
/** @final @type String */
|
||||
CLASS_NAME: "OpenLayers.Layer.HTTPRequest"
|
||||
|
||||
@@ -1,338 +0,0 @@
|
||||
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
|
||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
|
||||
* text of the license. */
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* @requires OpenLayers/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"
|
||||
});
|
||||
@@ -9,9 +9,8 @@
|
||||
*/
|
||||
OpenLayers.Layer.VirtualEarth = Class.create();
|
||||
OpenLayers.Layer.VirtualEarth.prototype =
|
||||
Object.extend( new OpenLayers.Layer.EventPane(),
|
||||
Object.extend( new OpenLayers.Layer.FixedZoomLevels(), {
|
||||
|
||||
Object.extend( new OpenLayers.Layer.EventPane(), {
|
||||
|
||||
/** @type VEMap */
|
||||
vemap: null,
|
||||
|
||||
@@ -28,8 +27,6 @@ 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;
|
||||
},
|
||||
@@ -355,4 +352,4 @@ OpenLayers.Layer.VirtualEarth.prototype =
|
||||
|
||||
/** @final @type String */
|
||||
CLASS_NAME: "OpenLayers.Layer.VirtualEarth"
|
||||
}));
|
||||
});
|
||||
|
||||
@@ -173,7 +173,7 @@ OpenLayers.Layer.WFS.prototype =
|
||||
|
||||
/** combine the layer's url with its params and these newParams.
|
||||
*
|
||||
* Add the SRS parameter from 'projection' -- this is probably
|
||||
* Add the SRS parameter from getProjection() -- this is probably
|
||||
* more eloquently done via a setProjection() method, but this
|
||||
* works for now and always.
|
||||
*
|
||||
|
||||
@@ -21,6 +21,9 @@ OpenLayers.Layer.WMS.prototype =
|
||||
format: "image/jpeg"
|
||||
},
|
||||
|
||||
/** @type Boolean */
|
||||
isBaseLayer: null,
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*
|
||||
@@ -45,12 +48,9 @@ OpenLayers.Layer.WMS.prototype =
|
||||
);
|
||||
}
|
||||
|
||||
// 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));
|
||||
}
|
||||
// if the layer is transparent, it will be an overlay
|
||||
this.isBaseLayer = ((this.params.TRANSPARENT != "true") &&
|
||||
(this.params.TRANSPARENT != true));
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -136,7 +136,7 @@ OpenLayers.Layer.WMS.prototype =
|
||||
|
||||
/** combine the layer's url with its params and these newParams.
|
||||
*
|
||||
* Add the SRS parameter from projection -- this is probably
|
||||
* Add the SRS parameter from getProjection() -- this is probably
|
||||
* more eloquently done via a setProjection() method, but this
|
||||
* works for now and always.
|
||||
*
|
||||
|
||||
@@ -22,6 +22,10 @@ OpenLayers.Layer.WMS.Untiled.prototype =
|
||||
format: "image/jpeg"
|
||||
},
|
||||
|
||||
|
||||
/** @type Boolean */
|
||||
isBaseLayer: null,
|
||||
|
||||
/** @type DOMElement */
|
||||
imgDiv: null,
|
||||
|
||||
@@ -33,12 +37,12 @@ OpenLayers.Layer.WMS.Untiled.prototype =
|
||||
* @param {String} url
|
||||
* @param {Object} params
|
||||
*/
|
||||
initialize: function(name, url, params, options) {
|
||||
initialize: function(name, url, params) {
|
||||
var newArguments = new Array();
|
||||
if (arguments.length > 0) {
|
||||
//uppercase params
|
||||
params = OpenLayers.Util.upperCaseObject(params);
|
||||
newArguments.push(name, url, params, options);
|
||||
newArguments.push(name, url, params);
|
||||
}
|
||||
OpenLayers.Layer.HTTPRequest.prototype.initialize.apply(this,
|
||||
newArguments);
|
||||
@@ -50,12 +54,10 @@ OpenLayers.Layer.WMS.Untiled.prototype =
|
||||
);
|
||||
}
|
||||
|
||||
// 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));
|
||||
}
|
||||
// if the layer is transparent, it will be an overlay
|
||||
this.isBaseLayer = ((this.params.TRANSPARENT != "true") &&
|
||||
(this.params.TRANSPARENT != true));
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -183,24 +185,6 @@ OpenLayers.Layer.WMS.Untiled.prototype =
|
||||
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.
|
||||
*
|
||||
|
||||
@@ -2,318 +2,149 @@
|
||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
|
||||
* text of the license. */
|
||||
|
||||
/**
|
||||
* @class
|
||||
// load Yahoo map control script
|
||||
document.write("<script src='http://api.maps.yahoo.com/ajaxymap?v=3.0&appid=euzuro-openlayers'></script>");
|
||||
|
||||
/**
|
||||
* @class
|
||||
*
|
||||
* @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 int */
|
||||
minZoomLevel: 0,
|
||||
|
||||
/** @type int */
|
||||
maxZoomLevel: 15,
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @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.
|
||||
*
|
||||
* @param {String} name
|
||||
* @type Boolean
|
||||
*/
|
||||
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
|
||||
isBaseLayer: true,
|
||||
|
||||
/** @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
|
||||
* @param {Boolean} zoomChanged
|
||||
* @param {Boolean} minor
|
||||
*/
|
||||
moveTo:function(bounds, zoomChanged, minor) {
|
||||
|
||||
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"
|
||||
});
|
||||
|
||||
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"
|
||||
});
|
||||
|
||||
@@ -371,12 +371,9 @@ 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");
|
||||
}
|
||||
@@ -565,6 +562,7 @@ OpenLayers.Map.prototype = {
|
||||
* trigger movestart/end events
|
||||
*/
|
||||
setCenter: function (lonlat, zoom, minor) {
|
||||
|
||||
var zoomChanged = (this.isValidZoomLevel(zoom)) &&
|
||||
(zoom != this.getZoom());
|
||||
|
||||
@@ -601,12 +599,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.getVisibility()) {
|
||||
if ((layer == this.baseLayer) || !layer.isBaseLayer) {
|
||||
layer.moveTo(bounds, zoomChanged, minor);
|
||||
}
|
||||
}
|
||||
@@ -684,7 +682,7 @@ OpenLayers.Map.prototype = {
|
||||
getProjection: function() {
|
||||
var projection = null;
|
||||
if (this.baseLayer != null) {
|
||||
projection = this.baseLayer.projection;
|
||||
projection = this.baseLayer.getProjection();
|
||||
}
|
||||
return projection;
|
||||
},
|
||||
@@ -696,7 +694,7 @@ OpenLayers.Map.prototype = {
|
||||
getMaxResolution: function() {
|
||||
var maxResolution = null;
|
||||
if (this.baseLayer != null) {
|
||||
maxResolution = this.baseLayer.maxResolution;
|
||||
maxResolution = this.baseLayer.getMaxResolution();
|
||||
}
|
||||
return maxResolution;
|
||||
},
|
||||
@@ -707,7 +705,7 @@ OpenLayers.Map.prototype = {
|
||||
getMaxExtent: function () {
|
||||
var maxExtent = null;
|
||||
if (this.baseLayer != null) {
|
||||
maxExtent = this.baseLayer.maxExtent;
|
||||
maxExtent = this.baseLayer.getMaxExtent();
|
||||
}
|
||||
return maxExtent;
|
||||
},
|
||||
@@ -720,7 +718,7 @@ OpenLayers.Map.prototype = {
|
||||
getNumZoomLevels: function() {
|
||||
var numZoomLevels = null;
|
||||
if (this.baseLayer != null) {
|
||||
numZoomLevels = this.baseLayer.numZoomLevels;
|
||||
numZoomLevels = this.baseLayer.getNumZoomLevels();
|
||||
}
|
||||
return numZoomLevels;
|
||||
},
|
||||
@@ -781,35 +779,20 @@ 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) {
|
||||
var zoom = null;
|
||||
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 */
|
||||
|
||||
@@ -2,313 +2,232 @@
|
||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
|
||||
* text of the license. */
|
||||
|
||||
/**
|
||||
* @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"
|
||||
};
|
||||
/**
|
||||
* @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"
|
||||
};
|
||||
|
||||
@@ -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"
|
||||
});
|
||||
|
||||
@@ -102,9 +102,6 @@ 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 */
|
||||
|
||||
@@ -125,29 +125,14 @@ 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 = OpenLayers.Util.onImageLoadErrorColor;
|
||||
this.style.backgroundColor = "pink";
|
||||
};
|
||||
|
||||
|
||||
@@ -516,15 +501,3 @@ 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;
|
||||
};
|
||||
|
||||
@@ -19,11 +19,9 @@
|
||||
<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=4;
|
||||
timeout_seconds=2;
|
||||
}
|
||||
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=4000;
|
||||
test_page.loading_timeout_milliseconds=2000;
|
||||
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,18 +28,6 @@
|
||||
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);
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
<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>
|
||||
@@ -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("OpenLayers.Feature_"), "feature.id set correctly" );
|
||||
t.ok( feature.id.startsWith("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( 13 );
|
||||
t.plan( 14 );
|
||||
|
||||
var options = { chicken: 151, foo: "bar", projection: "none" };
|
||||
var layer = new OpenLayers.Layer('Test Layer', options);
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
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" );
|
||||
@@ -103,10 +104,10 @@
|
||||
|
||||
var layer = new OpenLayers.Layer('Test Layer', options);
|
||||
|
||||
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");
|
||||
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.getNumZoomLevels(), numZoomLevels, "getNumZoomLevels() works");
|
||||
}
|
||||
|
||||
function test_05_Layer_visibility(t) {
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
// t.plan( 2 );
|
||||
|
||||
if (document.createEventObject) {
|
||||
t.plan(2);
|
||||
t.plan(3);
|
||||
} else {
|
||||
t.plan(1);
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
bounds = new OpenLayers.Bounds(10,10,100,100);
|
||||
zoom = layer.getZoomForExtent(bounds);
|
||||
|
||||
t.eq( zoom, 2, "getZoomForExtent() returns correct value");
|
||||
t.eq( zoom, 3, "getZoomForExtent() returns correct value");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
bounds = new OpenLayers.Bounds(10,10,100,100);
|
||||
zoom = layer.getZoomForExtent(bounds);
|
||||
|
||||
t.eq( zoom, 2, "getZoomForExtent() returns correct value");
|
||||
t.eq( zoom, 3, "getZoomForExtent() returns correct value");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,128 +0,0 @@
|
||||
<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,31 +149,6 @@
|
||||
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,15 +13,6 @@
|
||||
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 );
|
||||
|
||||
@@ -13,15 +13,6 @@
|
||||
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,105 +1,107 @@
|
||||
<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>
|
||||
<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>
|
||||
|
||||
@@ -13,15 +13,6 @@
|
||||
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,9 +121,11 @@ 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:]
|
||||
|
||||
@@ -161,7 +163,9 @@ if __name__ == "__main__":
|
||||
allFiles.append(filepath)
|
||||
|
||||
## Header inserted at the start of each file in the output
|
||||
HEADER = "/* " + "=" * 70 + " %s\n" + " " + "=" * 70 + " */\n\n"
|
||||
HEADER = "/* " + "=" * 70 + "\n"\
|
||||
" %s\n" +\
|
||||
" " + "=" * 70 + " */\n\n"
|
||||
|
||||
files = {}
|
||||
|
||||
@@ -196,10 +200,12 @@ 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:
|
||||
|
||||