I have a working map generated by this code:
// create the map with the proper center
var map = new ol.Map({
controls: ol.control.defaults().extend(
[new ol.control.ScaleLine()]
),
view: new ol.View({
center: ol.proj.fromLonLat([center.long, center.lat]),
zoom: zoom
}),
layers: [new ol.layer.Tile({
source: new ol.source.OSM()
})],
target: 'mapdiv'
}
);
The map has zoom buttons and scale line, and I'm able to zoom the map with the keyboard by adding onclick events to the zoom buttons.
I want to be able to drag the map with the keyboard (with the arrow keys). So I'm trying to add the drag buttons, but I cannot find a way to get them. How can I add them?
Alternatively, is there another way to achieve keyboard dragging?
I'm not interested in rotations.