OpenLayers OpenLayers

Ticket #42: keyboard.2.patch

File keyboard.2.patch, 1.1 kB (added by crschmidt, 2 years ago)
  • lib/OpenLayers/Control/KeyboardDefaults.js

    old new  
    2828    draw: function() { 
    2929        OpenLayers.Event.observe(document,  
    3030                      'keypress',  
    31                       this.defaultKeyDown.bind(this)); 
     31                      this.defaultKeyDown.bindAsEventListener(this)); 
    3232    }, 
    3333     
    3434    /** 
     
    4848            case OpenLayers.Event.KEY_DOWN: 
    4949                this.map.pan(0, 50); 
    5050                break; 
     51            case 33: // Page Up  
     52                this.map.zoomIn(); 
     53                break; 
     54            case 34: // Page Down  
     55                this.map.zoomOut(); 
     56                break; 
    5157        } 
     58        switch(evt.charCode) { 
     59            case 43: // + 
     60                this.map.zoomIn(); 
     61                break; 
     62            case 45: // - 
     63                this.map.zoomOut(); 
     64                break; 
     65        }         
    5266    }, 
    5367     
    5468    /** @final @type String */