improve the accessible.html example
This commit is contained in:
+38
-19
@@ -31,6 +31,15 @@
|
|||||||
font-size:1em;
|
font-size:1em;
|
||||||
text-decoration:underline;
|
text-decoration:underline;
|
||||||
}
|
}
|
||||||
|
a.accesskey {
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
a.accesskey:focus {
|
||||||
|
color: #436976;
|
||||||
|
}
|
||||||
|
a.zoom {
|
||||||
|
padding-right: 20px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
@@ -57,31 +66,37 @@
|
|||||||
keyboard, pan, panning, zoom, zooming, accesskey
|
keyboard, pan, panning, zoom, zooming, accesskey
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<a class="accesskey"
|
||||||
|
href=""
|
||||||
|
accesskey="1"
|
||||||
|
onclick="document.getElementById('map').focus(); return false;">
|
||||||
|
Go to map
|
||||||
|
</a>
|
||||||
|
|
||||||
<p id="shortdesc">
|
<p id="shortdesc">
|
||||||
Demonstrate how to use the KeyboardDefaults option parameter for layer types.
|
Demonstrate the KeyboardDefaults control and how to use links
|
||||||
|
with Access Keys to navigate the map with the keyboard.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<a class="zoom"
|
||||||
|
href="javascript: void map.zoomIn();"
|
||||||
|
accesskey="i">
|
||||||
|
zoom <em>i</em>n</a>
|
||||||
|
<a class="zoom"
|
||||||
|
href="javascript: void map.zoomOut();"
|
||||||
|
accesskey="o">
|
||||||
|
zoom <em>o</em>ut</a>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td> </td>
|
||||||
<a href="javascript: void map.zoomOut();"
|
|
||||||
accesskey="o">
|
|
||||||
zoom <em>o</em>ut
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
<td>
|
<td>
|
||||||
<a href="javascript: void map.pan(0, -map.getSize().h / 4);"
|
<a href="javascript: void map.pan(0, -map.getSize().h / 4);"
|
||||||
accesskey="n">
|
accesskey="n">
|
||||||
pan <em>n</em>orth
|
pan <em>n</em>orth
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
|
||||||
<a href="javascript: void map.zoomIn();"
|
|
||||||
accesskey="i">
|
|
||||||
zoom <em>i</em>n
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
@@ -90,7 +105,7 @@
|
|||||||
pan <em>w</em>est
|
pan <em>w</em>est
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td id="map" class="smallmap"></td>
|
<td id="map" class="smallmap" tabindex="0"></td>
|
||||||
<td>
|
<td>
|
||||||
<a href="javascript: void map.pan(map.getSize().w / 4, 0);"
|
<a href="javascript: void map.pan(map.getSize().w / 4, 0);"
|
||||||
accesskey="e">
|
accesskey="e">
|
||||||
@@ -113,9 +128,9 @@
|
|||||||
|
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
<p>Navigate the map in one of three ways:</p>
|
<p>Navigate the map in one of three ways:</p>
|
||||||
<ul>
|
<ol>
|
||||||
<li>Click on the named links to zoom and pan</li>
|
<li>Use Access Key "1" (alt + 1) to focus the map element, and
|
||||||
<li>Use following keys to pan and zoom:
|
use following keys to pan and zoom:
|
||||||
<ul>
|
<ul>
|
||||||
<li>+ (zoom in)</li>
|
<li>+ (zoom in)</li>
|
||||||
<li>- (zoom out)</li>
|
<li>- (zoom out)</li>
|
||||||
@@ -124,8 +139,12 @@
|
|||||||
<li>left-arrow (pan east)</li>
|
<li>left-arrow (pan east)</li>
|
||||||
<li>right-arrow (pan west)</li>
|
<li>right-arrow (pan west)</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
See <a href=http://en.wikipedia.org/wiki/Access_key>wikipedia</a> for
|
||||||
|
more detail about Access Keys.
|
||||||
</li>
|
</li>
|
||||||
<li>If access keys work for links in your browser, use:
|
<li>Navigate to pan and zoom links using the "tab" key, and
|
||||||
|
press "enter" to pan and zoom</li>
|
||||||
|
<li>If Access Keys work for links in your browser, use:
|
||||||
<ul>
|
<ul>
|
||||||
<li>i (zoom in)</li>
|
<li>i (zoom in)</li>
|
||||||
<li>o (zoom out)</li>
|
<li>o (zoom out)</li>
|
||||||
@@ -135,7 +154,7 @@
|
|||||||
<li>w (pan west)</li>
|
<li>w (pan west)</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ol>
|
||||||
<p>
|
<p>
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|||||||
Reference in New Issue
Block a user