mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-17 22:24:49 +02:00
Adds increased zoom keyboard shortcuts.
This commit is contained in:
@@ -264,6 +264,8 @@ window.iD = function () {
|
||||
context.pan = map.pan;
|
||||
context.zoomIn = map.zoomIn;
|
||||
context.zoomOut = map.zoomOut;
|
||||
context.zoomInFurther = map.zoomInFurther;
|
||||
context.zoomOutFurther = map.zoomOutFurther;
|
||||
|
||||
context.surfaceRect = function() {
|
||||
// Work around a bug in Firefox.
|
||||
|
||||
+13
-2
@@ -327,8 +327,19 @@ iD.Map = function(context) {
|
||||
return redraw();
|
||||
};
|
||||
|
||||
map.zoomIn = function() { interpolateZoom(~~map.zoom() + 1); };
|
||||
map.zoomOut = function() { interpolateZoom(~~map.zoom() - 1); };
|
||||
function zoomIn(integer) {
|
||||
interpolateZoom(~~map.zoom() + integer);
|
||||
}
|
||||
|
||||
function zoomOut(integer) {
|
||||
interpolateZoom(~~map.zoom() - integer);
|
||||
}
|
||||
|
||||
map.zoomIn = function() { zoomIn(1); };
|
||||
map.zoomInFurther = function() { zoomIn(4); };
|
||||
|
||||
map.zoomOut = function() { zoomOut(1); };
|
||||
map.zoomOutFurther = function() { zoomOut(4); };
|
||||
|
||||
map.center = function(loc) {
|
||||
if (!arguments.length) {
|
||||
|
||||
@@ -33,10 +33,15 @@ iD.ui.Zoom = function(context) {
|
||||
_.each(['=','ffequals','plus','ffplus'], function(key) {
|
||||
keybinding.on(key, function() { context.zoomIn(); });
|
||||
keybinding.on('⇧' + key, function() { context.zoomIn(); });
|
||||
keybinding.on('ctrl+' + key, function() { context.zoomInFurther(); });
|
||||
keybinding.on('ctrl+⇧' + key, function() { context.zoomInFurther(); });
|
||||
});
|
||||
|
||||
_.each(['-','ffminus','_','dash'], function(key) {
|
||||
keybinding.on(key, function() { context.zoomOut(); });
|
||||
keybinding.on('⇧' + key, function() { context.zoomOut(); });
|
||||
keybinding.on('ctrl+' + key, function() { context.zoomOutFurther(); });
|
||||
keybinding.on('ctrl+⇧' + key, function() { context.zoomOutFurther(); });
|
||||
});
|
||||
|
||||
d3.select(document)
|
||||
|
||||
Reference in New Issue
Block a user