integrates mode selection in the draw function

This commit is contained in:
Francisco Dans 2015-05-12 12:12:18 +02:00
parent 3db32964f0
commit df494cadb6

View File

@ -100,7 +100,16 @@ BallRenderer.prototype = {
var ys = Math.pow(y - y0, 2); var ys = Math.pow(y - y0, 2);
return Math.sqrt( xs + ys ); return Math.sqrt( xs + ys );
}, },
draw: function(dataArray){ draw: function(modeData, dataArray){
switch (this.mode){
case "contour":
this.contour();
case "isopleth":
this.contour(5);
this.isopleth();
default:
this.heatmap();
}
if (!dataArray){ if (!dataArray){
if (this.isoplethLayer) dataArray = this.isoplethLayer; if (this.isoplethLayer) dataArray = this.isoplethLayer;
else if (this.contourLayer) dataArray = this.contourLayer; else if (this.contourLayer) dataArray = this.contourLayer;
@ -122,12 +131,6 @@ BallRenderer.prototype = {
to[i+3] = from[i+3]; to[i+3] = from[i+3];
} }
} }
},
reduceArray: function(){
},
expandArray: function(){
}, },
invalidate: function(full){ invalidate: function(full){
// if(!transit){ // if(!transit){