~flavour/sahana-eden/trunk

« back to all changes in this revision

Viewing changes to static/scripts/gis/openlayers/lib/OpenLayers/Tween.js

  • Committer: Fran Boon
  • Date: 2012-01-21 16:10:49 UTC
  • Revision ID: fran@aidiq.com-20120121161049-u2ytuiymn1t312c6
JS upgrade: jQuery, jQueryUI, OpenLayers, Ext, GeoExt

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (c) 2006-2011 by OpenLayers Contributors (see authors.txt for 
 
1
/* Copyright (c) 2006-2012 by OpenLayers Contributors (see authors.txt for 
2
2
 * full list of contributors). Published under the Clear BSD license.  
3
3
 * See http://svn.openlayers.org/trunk/openlayers/license.txt for the
4
 
 * full text of the license. */
5
 
 
6
 
/**
 
4
 * full text of the license.
 
5
 *
7
6
 * @requires OpenLayers/BaseTypes/Class.js
 
7
 * @requires OpenLayers/Animation.js
8
8
 */
9
9
 
10
10
/**
13
13
OpenLayers.Tween = OpenLayers.Class({
14
14
    
15
15
    /**
16
 
     * Constant: INTERVAL
17
 
     * {int} Interval in milliseconds between 2 steps
18
 
     */
19
 
    INTERVAL: 10,
20
 
    
21
 
    /**
22
16
     * APIProperty: easing
23
17
     * {<OpenLayers.Easing>(Function)} Easing equation used for the animation
24
18
     *     Defaultly set to OpenLayers.Easing.Expo.easeOut
58
52
    time: null,
59
53
    
60
54
    /**
61
 
     * Property: interval
62
 
     * {int} Interval id returned by window.setInterval
 
55
     * Property: animationId
 
56
     * {int} Loop id returned by OpenLayers.Animation.start
63
57
     */
64
 
    interval: null,
 
58
    animationId: null,
65
59
    
66
60
    /**
67
61
     * Property: playing
97
91
        this.duration = duration;
98
92
        this.callbacks = options.callbacks;
99
93
        this.time = 0;
100
 
        if (this.interval) {
101
 
            window.clearInterval(this.interval);
102
 
            this.interval = null;
103
 
        }
 
94
        OpenLayers.Animation.stop(this.animationId);
 
95
        this.animationId = null;
104
96
        if (this.callbacks && this.callbacks.start) {
105
97
            this.callbacks.start.call(this, this.begin);
106
98
        }
107
 
        this.interval = window.setInterval(
108
 
            OpenLayers.Function.bind(this.play, this), this.INTERVAL);
 
99
        this.animationId = OpenLayers.Animation.start(
 
100
            OpenLayers.Function.bind(this.play, this)
 
101
        );
109
102
    },
110
103
    
111
104
    /**
121
114
        if (this.callbacks && this.callbacks.done) {
122
115
            this.callbacks.done.call(this, this.finish);
123
116
        }
124
 
        window.clearInterval(this.interval);
125
 
        this.interval = null;
 
117
        OpenLayers.Animation.stop(this.animationId);
 
118
        this.animationId = null;
126
119
        this.playing = false;
127
120
    },
128
121