Improve calls to movestart/moveend so that they happen at the start/end of
moves. This includes fixing pantween to set playing to false after it is done, and fixing the map to store its dragging state again so we can use it to figure out when a move has started. git-svn-id: http://svn.openlayers.org/trunk/openlayers@6398 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -1449,7 +1449,7 @@ OpenLayers.Map = OpenLayers.Class({
|
||||
// if neither center nor zoom will change, no need to do anything
|
||||
if (zoomChanged || centerChanged || !dragging) {
|
||||
|
||||
if (!dragging && !noEvent) {
|
||||
if (!this.dragging && !noEvent) {
|
||||
this.events.triggerEvent("movestart");
|
||||
}
|
||||
|
||||
@@ -1522,6 +1522,10 @@ OpenLayers.Map = OpenLayers.Class({
|
||||
if (!dragging && !noEvent) {
|
||||
this.events.triggerEvent("moveend");
|
||||
}
|
||||
|
||||
// Store the map dragging state for later use
|
||||
this.dragging = !!dragging;
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -146,6 +146,7 @@ OpenLayers.Tween = OpenLayers.Class({
|
||||
if (this.time > this.duration) {
|
||||
if (this.callbacks && this.callbacks.done) {
|
||||
this.callbacks.done.call(this, this.finish);
|
||||
this.playing = false;
|
||||
}
|
||||
window.clearInterval(this.interval);
|
||||
this.interval = null;
|
||||
|
||||
Reference in New Issue
Block a user