marker-line is not taken into account to calculate cached sprites size fixed #15

This commit is contained in:
javi 2013-10-10 10:58:43 +02:00
parent 1957a4b73f
commit fe8f58fd38

View File

@ -60,10 +60,12 @@
}, shaderVars); }, shaderVars);
var pointSize = st['point-radius']; var pointSize = st['point-radius'];
if(!pointSize) { if (!pointSize) {
throw new Error("marker-width property should be set"); throw new Error("marker-width property should be set");
} }
var canvasSize = pointSize*2;
// take into account the exterior ring to calculate the size
var canvasSize = (st.lineWidth || 0) + pointSize*2;
var canvas = document.createElement('canvas'); var canvas = document.createElement('canvas');
var ctx = canvas.getContext('2d'); var ctx = canvas.getContext('2d');