1 <html xmlns="http://www.w3.org/1999/xhtml">
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">
8 border: 1 px solid white;
15 text-decoration: none;
21 text-decoration: underline;
24 text-decoration: underline;
28 text-decoration:underline;
31 <script src="../lib/OpenLayers.js"></script>
32 <script type="text/javascript">
36 controls: [new OpenLayers.Control.KeyboardDefaults()]
38 map = new OpenLayers.Map('map', options);
39 var wms = new OpenLayers.Layer.WMS(
41 "http://labs.metacarta.com/wms/vmap0?",
45 map.zoomToMaxExtent();
49 <body onload="init()">
50 <h1 id="title">Accessible Example</h1>
56 Demonstrate how to use the KeyboardDefaults option parameter for layer types.
63 <a href="javascript: void map.zoomOut();"
69 <a href="javascript: void map.pan(0, -map.getSize().h / 4);"
75 <a href="javascript: void map.zoomIn();"
83 <a href="javascript: void map.pan(-map.getSize().w / 4, 0);"
88 <td id="map" class="smallmap"></td>
90 <a href="javascript: void map.pan(map.getSize().w / 4, 0);"
99 <a href="javascript: void map.pan(0, map.getSize().h / 4);"
110 <p>Navigate the map in one of three ways:
112 <li>Click on the named links to zoom and pan</li>
113 <li>Use following keys to pan and zoom:
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>
123 <li>If access keys work for links in your browser, use:
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>
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.