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:
crschmidt
2008-02-28 19:47:38 +00:00
parent 248385ccf4
commit c92527fae5
2 changed files with 6 additions and 1 deletions

View File

@@ -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;
},
/**

View File

@@ -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;