Replace map.zoomIn and map.zoomOut by map.zoom(delta)

This commit is contained in:
Éric Lemoine
2012-09-27 09:37:19 +02:00
parent 25e00e5d74
commit cf20fd3e49
3 changed files with 5 additions and 27 deletions
+2 -5
View File
@@ -27,11 +27,8 @@ ol.interaction.KeyboardZoom.prototype.handleMapBrowserEvent =
var charCode = keyEvent.charCode;
if (charCode == '+'.charCodeAt(0) || charCode == '-'.charCodeAt(0)) {
var map = mapBrowserEvent.map;
if (charCode == '+'.charCodeAt(0)) {
map.zoomIn();
} else {
map.zoomOut();
}
var delta = (charCode == '+'.charCodeAt(0)) ? 4 : -4;
map.zoom(delta);
keyEvent.preventDefault();
mapBrowserEvent.preventDefault();
}