This is my code in Openlayers 3.9.0
<article id="map" class="map"></article>
<script src='/javascripts/js/ol-debug.js'></script>
<script>
var layer = new ol.layer.Tile({
source: new ol.source.OSM()
});
var kbz = new ol.interaction.KeyboardZoom();
var dr = new ol.interaction.DragRotateAndZoom();
var center = ol.proj.transform([-1.812, 52.443], 'EPSG:4326', 'EPSG:3857');
var view = new ol.View({
center: center,
zoom: 6
});
var map = new ol.Map({
target: 'map',
layers: [layer],
view: view
});
map.addInteraction(kbz);
map.addInteraction(dr);
</script>
I just want to pass some extra Interactions to the map after I create it. I get no errors in my console. The weird part is that I can dragRotate
, this works fine, but the keyboardZoom
does not work. I fail to understand why keyboardZoom
fails, or how to fix this.