[TileMap] Fixed a couple of small things

This commit is contained in:
Khalah Jones-Golden 2015-05-15 17:28:12 -04:00
parent 1000f18740
commit 2bfaf515d2
2 changed files with 5 additions and 3 deletions

View file

@ -613,9 +613,11 @@ define(function (require) {
// exp = 0.5 for square root ratio
// exp = 1 for linear ratio
var exp = 0.5;
var precisionBiasNumerator = 200;
var precisionBiasBase = 5;
var pct = count / max;
var constantZoomRadius = 0.5 * Math.pow(2, zoom);
var precisionScale = 200 / Math.pow(5, precision);
var precisionScale = precisionBiasNumerator / Math.pow(precisionBiasBase, precision);
return Math.pow(pct, exp) * constantZoomRadius * precisionScale;
};

View file

@ -191,7 +191,7 @@ define(function (require) {
var radius = Math.pow(pct, exp) * constantZoomRadius * precisionScale;
var test = chart.radiusScale(count, max, zoom, precision);
expect(_.isNumber(test)).to.be(true);
expect(test).to.be.a('number');
expect(test).to.be(radius);
});
});
@ -258,4 +258,4 @@ define(function (require) {
});
});
});
});