uses radius from cartocss renderer

This commit is contained in:
Francisco Dans 2015-05-05 14:47:54 +02:00
parent fa5791483e
commit 9486bd9667
2 changed files with 4 additions and 3 deletions

View File

@ -86,5 +86,6 @@
module.exports = {
renderPoint: renderPoint,
renderSprite: renderSprite,
renderRectangle: renderRectangle
renderRectangle: renderRectangle,
maxSpriteRadius: MAX_SPRITE_RADIUS
};

View File

@ -137,8 +137,8 @@ var Filters = require('./torque_filters');
if (qualifiedUrl && this._iconsToLoad <= 0 && this._icons[qualifiedUrl]) {
var img = this._icons[qualifiedUrl];
var dWidth = Math.min(st['marker-width'] * 2 || img.width, this.options.maxSpriteSize || 512);
var dHeight = Math.min((st['marker-height'] || dWidth) * (img.width / img.height), this.options.maxSpriteSize || 512);
var dWidth = Math.min(st['marker-width'] * 2 || img.width, cartocss.maxSpriteRadius * 2);
var dHeight = Math.min((st['marker-height'] || dWidth) * (img.width / img.height), cartocss.maxSpriteRadius * 2);
canvas.width = ctx.width = dWidth;
canvas.height = ctx.height = dHeight;