Files
openlayers/examples/accessible.js
mprins a6d26c53e1 Enhance and improve the accessibility example.
Changes to improve the accessibility example:

 - remove the `accesskey` attributes. Use of the `accesskey` is generally not recommended as it tends to cause conflicts with AT software and user settings.
 - Change the scripted "Go to map" accesskey to a regular skiplink.
 - Use script to inject the buttons below the map, if the map were to fail for lack of javascript support the buttons should not be there either. These should be buttons (and not hyperlinks) because they provide an action not a navigation.
 - Update the docs.
 - Add an empty `alt` attribute to the logo since it is strictly decorative (this should probably be done sitewide - which IMO is out of scope for this PR)
2014-06-03 09:28:43 +02:00

27 lines
644 B
JavaScript

goog.require('ol.Map');
goog.require('ol.View2D');
goog.require('ol.layer.Tile');
goog.require('ol.source.OSM');
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
})
],
renderer: exampleNS.getRendererFromQueryString(),
target: 'map',
view: new ol.View2D({
center: [0, 0],
zoom: 2
})
});
jQuery('#map').after('<button type="button" ' +
'onclick="map.getView().setZoom(map.getView().getZoom() - 1);">' +
'Zoom out</button>');
jQuery('#map').after('<button type="button" ' +
'onclick="map.getView().setZoom(map.getView().getZoom() + 1);">' +
'Zoom in</button>');