Support zooming with keyboard. Fixes #695

This commit is contained in:
Tom MacWright
2013-02-09 18:02:09 -05:00
parent d584eb2f9d
commit 6faf7a27c4
2 changed files with 6 additions and 2 deletions

View File

@@ -251,7 +251,11 @@ iD.ui = function(context) {
.on('←', pan([pa, 0]))
.on('↑', pan([0, pa]))
.on('→', pan([-pa, 0]))
.on('↓', pan([0, -pa]));
.on('↓', pan([0, -pa]))
.on('⇧+=', function() { map.zoomIn(); })
.on('+', function() { map.zoomIn(); })
.on('-', function() { map.zoomOut(); })
.on('dash', function() { map.zoomOut(); });
modes.forEach(function(m) {
keybinding.on(m.key, function() { if (map.editable()) context.enter(m); });

View File

@@ -151,7 +151,7 @@ d3.keybinding = function(namespace) {
'=': 187, 'equals': 187,
// Comma, or ,
',': 188, comma: 188,
//'-': 189, //???
'dash': 189, //???
// Period, or ., or full-stop
'.': 190, period: 190, 'full-stop': 190,
// Slash, or /, or forward-slash