diff --git a/CHANGELOG.md b/CHANGELOG.md index 52543b6..72a8164 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ ## Changelog +### 0.6.0 + +* Bump `mapnik-reference` dependency to 1.0.0 to allow for using `buffer-size` in the + `Map` element. + ### 0.5.0 * Now uses the [mapnik-reference](https://github.com/mapnik/mapnik-reference) npm module diff --git a/lib/carto/tree/color.js b/lib/carto/tree/color.js index 5dd711b..213b2bc 100644 --- a/lib/carto/tree/color.js +++ b/lib/carto/tree/color.js @@ -23,15 +23,14 @@ tree.Color = function Color(rgb, a) { this.is = 'color'; this.alpha = typeof(a) === 'number' ? a : 1; }; + tree.Color.prototype = { eval: function() { return this; }, - // // If we have some transparency, the only way to represent it // is via `rgba`. Otherwise, we use the hex representation, // which has better compatibility with older browsers. // Values are capped between `0` and `255`, rounded and zero-padded. - // toString: function() { if (this.alpha < 1.0) { return 'rgba(' + this.rgb.map(function(c) { @@ -46,12 +45,10 @@ tree.Color.prototype = { } }, - // // Operations have to be done per-channel, if not, // channels will spill onto each other. Once we have // our result, in the form of an integer triplet, // we create a new Color node to hold the result. - // operate: function(op, other) { var result = []; diff --git a/package.json b/package.json index 470526b..43eab5f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "carto", - "version": "0.5.0", + "version": "0.6.0", "description": "Mapnik Stylesheet Compiler", "url": "https://github.com/mapbox/carto", "repositories": [{ @@ -36,7 +36,7 @@ }, "dependencies": { "underscore": "~1.3.3", - "mapnik-reference": "~0.0.1", + "mapnik-reference": "~1.0.0", "xml2js": "~0.1.13" }, "devDependencies": { diff --git a/test/rendering/buffersize.mml b/test/rendering/buffersize.mml new file mode 100644 index 0000000..8d779b3 --- /dev/null +++ b/test/rendering/buffersize.mml @@ -0,0 +1,23 @@ +{ + "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": [ + "buffersize.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" + } + }, + { + "class": "new", + "name": "countries", + "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/buffersize.mss b/test/rendering/buffersize.mss new file mode 100644 index 0000000..8c160b8 --- /dev/null +++ b/test/rendering/buffersize.mss @@ -0,0 +1,10 @@ +Map { + buffer-size: 256; +} + +#world { + text-name: "[NAME]"; + text-size: 11; + text-face-name: "Georgia Regular", "Arial Italic"; +} + diff --git a/test/rendering/buffersize.result b/test/rendering/buffersize.result new file mode 100644 index 0000000..501ac0d --- /dev/null +++ b/test/rendering/buffersize.result @@ -0,0 +1,23 @@ + + + + + + + + + + + world + + + + + + +