Protect the trigger action of pan control by checking whether
we were added to a map prior to calling this.map.pan().
This commit is contained in:
@@ -70,7 +70,7 @@ OpenLayers.Control.Pan = OpenLayers.Class(OpenLayers.Control, {
|
||||
* Method: trigger
|
||||
*/
|
||||
trigger: function(){
|
||||
|
||||
if (this.map) {
|
||||
var getSlideFactor = OpenLayers.Function.bind(function (dim) {
|
||||
return this.slideRatio ?
|
||||
this.map.getSize()[dim] * this.slideRatio :
|
||||
@@ -91,6 +91,7 @@ OpenLayers.Control.Pan = OpenLayers.Class(OpenLayers.Control, {
|
||||
this.map.pan(getSlideFactor("w"), 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
CLASS_NAME: "OpenLayers.Control.Pan"
|
||||
|
||||
Reference in New Issue
Block a user