added setters
This commit is contained in:
parent
2655094cdc
commit
38210c693e
@ -26,6 +26,7 @@ function GMapsTorqueLayer(options) {
|
||||
this.stop = this.animator.stop.bind(this.animator);
|
||||
this.pause = this.animator.pause.bind(this.animator);
|
||||
this.toggle = this.animator.toggle.bind(this.animator);
|
||||
this.setDuration = this.animator.duration.bind(this.animator);
|
||||
|
||||
|
||||
CanvasLayer.call(this, {
|
||||
@ -80,6 +81,11 @@ GMapsTorqueLayer.prototype = _.extend({},
|
||||
|
||||
},
|
||||
|
||||
setSteps: function(steps) {
|
||||
this.provider.setSteps(steps);
|
||||
this._reloadTiles();
|
||||
},
|
||||
|
||||
getCanvas: function() {
|
||||
return this.canvas;
|
||||
},
|
||||
|
@ -33,8 +33,8 @@ L.TorqueLayer = L.CanvasLayer.extend({
|
||||
this.stop = this.animator.stop.bind(this.animator);
|
||||
this.pause = this.animator.pause.bind(this.animator);
|
||||
this.toggle = this.animator.toggle.bind(this.animator);
|
||||
this.setDuration = this.animator.duration.bind(this.animator);
|
||||
|
||||
this.setBlendMode = this.renderer.setBlendMode.bind(this.renderer);
|
||||
|
||||
L.CanvasLayer.prototype.initialize.call(this, options);
|
||||
|
||||
@ -44,6 +44,8 @@ L.TorqueLayer = L.CanvasLayer.extend({
|
||||
this.provider = new this.providers[this.options.provider](options);
|
||||
this.renderer = new this.renderers[this.options.renderer](this.getCanvas(), options);
|
||||
|
||||
this.setBlendMode = this.renderer.setBlendMode.bind(this.renderer);
|
||||
|
||||
// for each tile shown on the map request the data
|
||||
this.on('tileAdded', function(t) {
|
||||
var tileData = this.provider.getTileData(t, t.zoom, function(tileData) {
|
||||
@ -53,6 +55,11 @@ L.TorqueLayer = L.CanvasLayer.extend({
|
||||
}, this);
|
||||
},
|
||||
|
||||
setSteps: function(steps) {
|
||||
this.provider.setSteps(steps);
|
||||
this._reloadTiles();
|
||||
},
|
||||
|
||||
/**
|
||||
* render the selectef key
|
||||
* don't call this function directly, it's called by
|
||||
|
@ -224,6 +224,13 @@
|
||||
};
|
||||
},
|
||||
|
||||
setSteps: function(steps) {
|
||||
if (this.options.steps !== steps) {
|
||||
this.options.steps = steps;
|
||||
this.options.step = (this.options.end- this.options.start)/this.options.steps;
|
||||
}
|
||||
},
|
||||
|
||||
getBounds: function() {
|
||||
return this.options.bounds;
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user