limits sprite radius to 255

This commit is contained in:
Francisco Dans 2015-05-04 11:35:30 +02:00
parent 581d7a337d
commit aabf0f234c

View File

@ -78,7 +78,8 @@
if (st['marker-fill-opacity'] !== undefined || st['marker-opacity'] !== undefined) {
ctx.globalAlpha = st['marker-fill-opacity'] || st['marker-opacity'];
}
ctx.drawImage(img, 0, 0, img.width, img.height);
var maxSpriteRadius = 255;
ctx.drawImage(img, 0, 0, Math.min(img.width, maxSpriteRadius), Math.min(img.height, maxSpriteRadius));
}
}