Wednesday, 15 August 2018

dojo - OpenLayers controls keyboard shortcuts


I'd like to hook up keyboard shortcuts to my map controls e.g. holding down 'z' will activate the zoombox tool etc. I can't seen anything relevent in the API for doing this. Is it easily done? My controls are sat beneath dojo toggle buttons and menu items like so:


// zoom tool
zoomBoxTool = new OpenLayers.Control.ZoomBox();
map.addControl(zoomBoxTool);

// zoom button
var zoomBoxButton = new dijit.form.ToggleButton({
label : "Zoom",

iconClass: "zoomIcon",
showLabel : false,
onChange : function(val) {
toggleTool(val, zoomBoxTool, this)
}
});


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...