|
|
|
@ -2,6 +2,7 @@
|
|
|
|
|
// min value to render a line.
|
|
|
|
|
// it does not make sense to render a line of a width is not even visible
|
|
|
|
|
var LINEWIDTH_MIN_VALUE = 0.05;
|
|
|
|
|
var MAX_SPRITE_RADIUS = 255;
|
|
|
|
|
|
|
|
|
|
function renderPoint(ctx, st) {
|
|
|
|
|
ctx.fillStyle = st['marker-fill'];
|
|
|
|
@ -78,13 +79,13 @@
|
|
|
|
|
if (st['marker-fill-opacity'] !== undefined || st['marker-opacity'] !== undefined) {
|
|
|
|
|
ctx.globalAlpha = st['marker-fill-opacity'] || st['marker-opacity'];
|
|
|
|
|
}
|
|
|
|
|
var maxSpriteRadius = 255;
|
|
|
|
|
ctx.drawImage(img, 0, 0, Math.min(img.width, maxSpriteRadius), Math.min(img.height, maxSpriteRadius));
|
|
|
|
|
ctx.drawImage(img, 0, 0, Math.min(img.width, MAX_SPRITE_RADIUS), Math.min(img.height, MAX_SPRITE_RADIUS));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
|
renderPoint: renderPoint,
|
|
|
|
|
renderSprite: renderSprite,
|
|
|
|
|
renderRectangle: renderRectangle
|
|
|
|
|
renderRectangle: renderRectangle,
|
|
|
|
|
MAX_SPRITE_RADIUS: MAX_SPRITE_RADIUS
|
|
|
|
|
};
|
|
|
|
|