1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- import defined from "../Core/defined.js";
- function KmlTourWait(duration) {
- this.type = "KmlTourWait";
- this.blocking = true;
- this.duration = duration;
- this.timeout = null;
- }
- KmlTourWait.prototype.play = function (done) {
- var self = this;
- this.activeCallback = done;
- this.timeout = setTimeout(function () {
- delete self.activeCallback;
- done(false);
- }, this.duration * 1000);
- };
- KmlTourWait.prototype.stop = function () {
- clearTimeout(this.timeout);
- if (defined(this.activeCallback)) {
- this.activeCallback(true);
- }
- };
- export default KmlTourWait;
|