diff --git a/lib/carto/tree/color.js b/lib/carto/tree/color.js index b052cde..fbdb41c 100644 --- a/lib/carto/tree/color.js +++ b/lib/carto/tree/color.js @@ -19,7 +19,7 @@ tree.Color = function Color(rgb, a) { }); } - if (typeof(a) === 'Number') { + if (typeof(a) === 'number') { this.alpha = a; } else if (rgb.length === 4) { this.alpha = rgb[3]; diff --git a/test/rendering/fadeout.mml b/test/rendering/fadeout.mml new file mode 100644 index 0000000..8bd0d62 --- /dev/null +++ b/test/rendering/fadeout.mml @@ -0,0 +1,14 @@ +{ + "srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over", + "Stylesheet": [ + "fadeout.mss" + ], + "Layer": [{ + "name": "world", + "srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/fadeout.mss b/test/rendering/fadeout.mss new file mode 100644 index 0000000..2c74fc7 --- /dev/null +++ b/test/rendering/fadeout.mss @@ -0,0 +1,3 @@ +#world { + marker-fill: fadeout(#000, 5j); +} diff --git a/test/rendering/fadeout.result b/test/rendering/fadeout.result new file mode 100644 index 0000000..53e9633 --- /dev/null +++ b/test/rendering/fadeout.result @@ -0,0 +1,20 @@ + + + + + + + + world + + + + + + +