OpenLayers OpenLayers

Ticket #1402: google.patch

File google.patch, 1.2 kB (added by overstdr, 10 months ago)

Changes made to Google.js file to allow smoothDrag in 2.93

  • lib/OpenLayers/Layer/Google.js

    old new  
    123123            termsOfUse.style.bottom = ""; 
    124124 
    125125            //can we do smooth panning? (some versions don't) 
    126             if ( !this.mapObject.G || !this.mapObject.G.qb || 
    127                  (typeof this.mapObject.G.qb != "function") ) { 
    128  
     126            if ( !this.mapObject.G || (!this.mapObject.G.qb && !this.mapObject.G.vb) || 
     127                 (typeof this.mapObject.G.qb != "function" && typeof this.mapObject.G.vb != "function")) { 
    129128                this.dragPanMapObject = null; 
    130129            } 
    131130 
     
    342341     * dY - {Integer} 
    343342     */ 
    344343    dragPanMapObject: function(dX, dY) { 
    345         var newX = this.mapObject.G.left - dX; 
    346         var newY = this.mapObject.G.top + dY; 
    347         this.mapObject.G.qb(newX, newY); 
     344        try { 
     345            var newX = this.mapObject.G.left - dX; 
     346            var newY = this.mapObject.G.top + dY; 
     347            if(this.mapObject.G.qb) { 
     348                this.mapObject.G.qb(newX, newY); 
     349            } else if(this.mapObject.G.vb) { 
     350                this.mapObject.G.vb(newX, newY); 
     351            } 
     352        } catch(e) { 
     353            //prevent failures. 
     354        } 
    348355    }, 
    349356    
    350357    /**