]> dev.renevier.net Git - syp.git/blob - openlayers/examples/accessible.html
avoid html injection in item title
[syp.git] / openlayers / examples / accessible.html
1 <html xmlns="http://www.w3.org/1999/xhtml">
2     <head>
3         <title>OpenLayers Accessible Example</title>
4         <link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
5         <link rel="stylesheet" href="style.css" type="text/css" />
6         <style type="text/css">
7             table {
8                 border: 1 px solid white;
9                 padding: 0;
10             }
11             td {
12                 text-align: center;
13             }
14             a {
15                 text-decoration: none;
16                 font-size: 1.2em;
17             }
18             a em {
19                 font-style: normal;
20                 font-weight: normal;
21                 text-decoration: underline;
22             }
23             a:hover {
24                 text-decoration: underline;
25             }
26             a.api {
27                 font-size:1em;
28                 text-decoration:underline;
29             }
30         </style>
31         <script src="../lib/OpenLayers.js"></script>
32         <script type="text/javascript">
33             var map = null;
34             function init(){
35                 var options = {
36                     controls: [new OpenLayers.Control.KeyboardDefaults()]
37                 };
38                 map = new OpenLayers.Map('map', options);
39                 var wms = new OpenLayers.Layer.WMS(
40                     "OpenLayers WMS",
41                     "http://labs.metacarta.com/wms/vmap0?",
42                     {layers: 'basic'}
43                 );
44                 map.addLayer(wms);
45                 map.zoomToMaxExtent();
46             }
47         </script>
48     </head>
49     <body onload="init()">
50         <h1 id="title">Accessible Example</h1>
51
52         <div id="tags">
53         </div>
54
55         <p id="shortdesc">
56             Demonstrate how to use the KeyboardDefaults option parameter for layer types.
57         </p>
58
59         <table>
60             <tbody>
61                 <tr>
62                     <td>
63                         <a href="javascript: void map.zoomOut();"
64                            accesskey="o">
65                             zoom <em>o</em>ut
66                         </a>
67                     </td>
68                     <td>
69                         <a href="javascript: void map.pan(0, -map.getSize().h / 4);"
70                            accesskey="n">
71                             pan <em>n</em>orth
72                         </a>
73                     </td>
74                     <td>
75                         <a href="javascript: void map.zoomIn();"
76                            accesskey="i">
77                             zoom <em>i</em>n
78                         </a>
79                     </td>
80                 </tr>
81                 <tr>
82                     <td>
83                         <a href="javascript: void map.pan(-map.getSize().w / 4, 0);"
84                            accesskey="w">
85                             pan <em>w</em>est
86                         </a>
87                     </td>
88                     <td id="map" class="smallmap"></td>
89                     <td>
90                         <a href="javascript: void map.pan(map.getSize().w / 4, 0);"
91                            accesskey="e">
92                             pan <em>e</em>ast
93                         </a>
94                     </td>
95                 </tr>
96                 <tr>
97                     <td>&nbsp;</td>
98                     <td>
99                         <a href="javascript: void map.pan(0, map.getSize().h / 4);"
100                            accesskey="s">
101                             pan <em>s</em>outh
102                         </a>
103                     </td>
104                     <td>&nbsp;</td>
105                 </tr>
106             </tbody>
107         </table>
108
109         <div id="docs">
110             <p>Navigate the map in one of three ways:
111                 <ul>
112                     <li>Click on the named links to zoom and pan</li>
113                     <li>Use following keys to pan and zoom:
114                         <ul>
115                             <li>+ (zoom in)</li>
116                             <li>- (zoom out)</li>
117                             <li>up-arrow (pan north)</li>
118                             <li>down-arrow (pan south)</li>
119                             <li>left-arrow (pan east)</li>
120                             <li>right-arrow (pan west)</li>
121                         </ul>
122                     </li>
123                     <li>If access keys work for links in your browser, use:
124                         <ul>
125                             <li>i (zoom in)</li>
126                             <li>o (zoom out)</li>
127                             <li>n (pan north)</li>
128                             <li>s (pan south)</li>
129                             <li>e (pan east)</li>
130                             <li>w (pan west)</li>
131                         </ul>
132                     </li>
133                 </ul>
134             </p>
135
136             This is an example of using alternate methods to control panning and zooming.  This approach uses map.pan() and map.zoom().  You'll note that to pan, additional math is necessary along with map.size() in order to set the distance to pan.
137         </div>
138     </body>
139 </html>