├── .eslintrc.yml ├── .gitignore ├── .npmignore ├── .travis.yml ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── appveyor.yml ├── bin └── carto ├── build ├── carto.tmbundle │ ├── Commands │ │ └── preview.tmCommand │ ├── Syntaxes │ │ ├── carto.tmLanguage │ │ └── mml.tmLanguage │ └── info.plist ├── syntaxgenerate ├── tmlanguage_template.js ├── vim-carto │ ├── ftdetect │ │ └── carto.vim │ └── syntax │ │ └── carto.vim └── vimsyntax_template.js ├── docs ├── Makefile ├── api │ └── mapnik │ │ ├── 2.0.0.rst │ │ ├── 2.0.1.rst │ │ ├── 2.0.2.rst │ │ ├── 2.1.0.rst │ │ ├── 2.1.1.rst │ │ ├── 2.2.0.rst │ │ ├── 2.3.0.rst │ │ ├── 3.0.0.rst │ │ ├── 3.0.20.rst │ │ ├── 3.0.3.rst │ │ └── 3.0.6.rst ├── conf.py ├── generate.js ├── index.rst ├── installation_usage.rst ├── language_elements.rst ├── mapnik_api._ ├── mapnik_api.rst ├── mml.rst ├── styling_concepts.rst └── symbolizers._ ├── lib └── carto │ ├── functions.js │ ├── index.js │ ├── mml.js │ ├── parser.js │ ├── renderer.js │ ├── tree.js │ ├── tree │ ├── call.js │ ├── color.js │ ├── comment.js │ ├── definition.js │ ├── dimension.js │ ├── element.js │ ├── expression.js │ ├── field.js │ ├── filter.js │ ├── filterset.js │ ├── fontset.js │ ├── imagefilter.js │ ├── invalid.js │ ├── keyword.js │ ├── layer.js │ ├── literal.js │ ├── operation.js │ ├── quoted.js │ ├── reference.js │ ├── rule.js │ ├── ruleset.js │ ├── selector.js │ ├── style.js │ ├── url.js │ ├── value.js │ ├── variable.js │ └── zoom.js │ └── util.js ├── man └── carto.1 ├── package-lock.json ├── package.json └── test ├── benchmark ├── opened.mml ├── opened.mss └── opened.result ├── bincarto.test.js ├── color.test.js ├── comment.test.js ├── eclint.test.js ├── errorhandling.test.js ├── errorhandling ├── bad_filter.mml ├── bad_filter.mss ├── bad_filter.result ├── bad_op.mml ├── bad_op.mss ├── bad_op.result ├── bad_op_2.mml ├── bad_op_2.mss ├── bad_op_2.result ├── color_functions.mml ├── color_functions.mss ├── color_functions.result ├── contradiction.mml ├── contradiction.mss ├── contradiction.result ├── contradiction_2.mss ├── contradiction_2.result ├── function_args.mml ├── function_args.mss ├── function_args.result ├── invalid_attachment.mml ├── invalid_attachment.mss ├── invalid_attachment.result ├── invalid_color_in_fn.mss ├── invalid_color_in_fn.result ├── invalid_property.mml ├── invalid_property.mss ├── invalid_property.result ├── invalid_value.mml ├── invalid_value.mss ├── invalid_value.result ├── invaliddimension.mml ├── invaliddimension.mss ├── invaliddimension.result ├── issue119.mml ├── issue119.mss ├── issue119.result ├── issue123.mml ├── issue123.mss ├── issue123.result ├── issue124.mml ├── issue124.mss ├── issue124.result ├── issue165.mml ├── issue165.result ├── issue297.mml ├── issue297.mss ├── issue297.result ├── issue_204_a.mss ├── issue_204_a.result ├── issue_204_b.mss ├── issue_204_b.result ├── issue_204_c.mss ├── issue_204_c.result ├── issue_218.mss ├── issue_218.result ├── issue_29.mml ├── issue_29.mss ├── issue_29.result ├── issue_462.mss ├── issue_462.result ├── issue_474.mss ├── issue_474.result ├── mapnik_keyword.mml ├── mapnik_keyword.mss ├── mapnik_keyword.result ├── missing_close.mml ├── missing_close.mss ├── missing_close.result ├── multi_stylesheets.mml ├── multi_stylesheets.result ├── multi_stylesheets_a.mss ├── multi_stylesheets_b.mss ├── multi_stylesheets_b.result ├── no_stylesheet.mml ├── no_stylesheet.result ├── nopound.mml ├── nopound.mss ├── nopound.result ├── notenoughargs.mml ├── notenoughargs.mss ├── notenoughargs.result ├── stylesheet_absolute_file.mml ├── stylesheet_absolute_file.result ├── stylesheet_absolute_file_syswin.result ├── stylesheet_no_data.mml ├── stylesheet_no_data.result ├── stylesheet_no_id.mml ├── stylesheet_no_id.result ├── undefined_variable.mml ├── undefined_variable.mss ├── undefined_variable.result ├── zoom_as_var.mml ├── zoom_as_var.mss ├── zoom_as_var.result ├── zoommax.mml ├── zoommax.mss └── zoommax.result ├── field.test.js ├── filter.test.js ├── filterset.test.js ├── operation.test.js ├── quoted.test.js ├── reference.test.js ├── rendering-mss.test.js ├── rendering-mss ├── basic_attachment_internal.mss ├── basic_attachment_internal.xml ├── basic_attachment_internal_before.mss ├── basic_attachment_internal_before.xml ├── basic_attachment_internal_before_and_after.mss ├── basic_attachment_internal_before_and_after.xml ├── basic_attachment_internal_double.mss ├── basic_attachment_internal_double.xml ├── basic_attachment_internal_with_label.mss ├── basic_attachment_internal_with_label.xml ├── basic_attachment_separate.mss ├── basic_attachment_separate.xml ├── basic_attachment_separate_before.mss ├── basic_attachment_separate_before.xml ├── basic_attachment_separate_before_and_after.mss ├── basic_attachment_separate_before_and_after.xml ├── basic_attachment_separate_double.mss ├── basic_attachment_separate_double.xml ├── basic_attachment_separate_with_label.mss ├── basic_attachment_separate_with_label.xml ├── color_functions.mss ├── color_functions.xml ├── empty_name.mss ├── empty_name.xml ├── image-filters.mss ├── image-filters.xml ├── issue_121.mss ├── issue_121.xml ├── issue_197.mss ├── issue_197.xml ├── issue_214.mss ├── issue_214.xml ├── issue_232.mss ├── issue_232.xml ├── issue_247_1.mss ├── issue_247_1.xml ├── issue_247_2.mss ├── issue_247_2.xml ├── issue_284.mss ├── issue_284.xml ├── issue_284_b.mss ├── issue_284_b.xml ├── issue_284_c.mss ├── issue_284_c.xml ├── issue_303.mss ├── issue_303.xml ├── issue_339.mss ├── issue_339.xml ├── issue_339b.mss ├── issue_339b.xml ├── issue_370.mss ├── issue_370.xml ├── issue_370_b.mss ├── issue_370_b.xml ├── issue_377.mss ├── issue_377.xml ├── issue_443.mss ├── issue_443.xml ├── issue_462.mss ├── issue_462.xml ├── issue_462a.mss ├── issue_462a.xml ├── issue_462b.mss ├── issue_462b.xml ├── line-width-zoom.mss ├── line-width-zoom.xml ├── quoted_attr.mss ├── quoted_attr.xml ├── scale-hsla-filter.mss ├── scale-hsla-filter.xml ├── should-discard-empty-style-and-attach.mss ├── should-discard-empty-style-and-attach.xml ├── should-discard-empty-style.mss ├── should-discard-empty-style.xml ├── should-discard-empty-style2.mss ├── should-discard-empty-style2.xml ├── style-level-prop-only.mss ├── style-level-prop-only.xml ├── style-level-prop-only2.mss ├── style-level-prop-only2.xml ├── style-level-prop-only3.mss ├── style-level-prop-only3.xml ├── text-face-name-escaping.mss ├── text-face-name-escaping.xml ├── variable-quoting-of-enum.mss ├── variable-quoting-of-enum.xml ├── zoom-like-field-name.mss ├── zoom-like-field-name.xml ├── zoom_space.mss └── zoom_space.xml ├── rendering.test.js ├── rendering ├── afghanistan_votes.mml ├── afghanistan_votes.mss ├── afghanistan_votes.result ├── background_attributes.mml ├── background_attributes.mss ├── background_attributes.result ├── buffersize.mml ├── buffersize.mss ├── buffersize.result ├── building_height.mml ├── building_height.mss ├── building_height.result ├── combined_class.mml ├── combined_class.mss ├── combined_class.result ├── complex_cascades.mml ├── complex_cascades.mss ├── complex_cascades.result ├── complexfontset.mml ├── complexfontset.mss ├── complexfontset.result ├── cross_stylesheet_variable.mml ├── cross_stylesheet_variable.result ├── cross_stylesheet_variable_a.mss ├── cross_stylesheet_variable_b.mss ├── data_only.mml ├── data_only.result ├── empty_style.mml ├── empty_style.mss ├── empty_style.result ├── empty_url.mml ├── empty_url.mss ├── empty_url.result ├── external_image.mml ├── external_image.mss ├── external_image.result ├── fadeout.mml ├── fadeout.mss ├── fadeout.result ├── field.mml ├── field.mss ├── field.result ├── field_advanced.mml ├── field_advanced.mss ├── field_advanced.result ├── filter_comparing_fields.mml ├── filter_comparing_fields.mss ├── filter_comparing_fields.result ├── filterexp.mml ├── filterexp.mss ├── filterexp.result ├── filterquote.mml ├── filterquote.mss ├── filterquote.result ├── filters.mml ├── filters.mss ├── filters.result ├── filtervariable.mml ├── filtervariable.mss ├── filtervariable.result ├── filtervariable2.mml ├── filtervariable2.mss ├── filtervariable2.result ├── fontset-duplication.mml ├── fontset-duplication.mss ├── fontset-duplication.result ├── gray_function.mml ├── gray_function.mss ├── gray_function.result ├── highzooms.mml ├── highzooms.mss ├── highzooms.result ├── identity.mml ├── identity.mss ├── identity.result ├── image_filters.mml ├── image_filters.mss ├── image_filters.result ├── imagefilter-duplication.mml ├── imagefilter-duplication.mss ├── imagefilter-duplication.result ├── instance_names.mml ├── instance_names.mss ├── instance_names.result ├── issue294.mml ├── issue294.result ├── issue32.mml ├── issue32.mss ├── issue32.result ├── issue32a.mss ├── issue60.mml ├── issue60.mss ├── issue60.result ├── issue_100_filters.mml ├── issue_100_filters.mss ├── issue_100_filters.result ├── issue_121.mml ├── issue_121.mss ├── issue_121.result ├── issue_239.mml ├── issue_239.result ├── issue_239_a.mss ├── issue_239_b.mss ├── issue_273.mml ├── issue_273.mss ├── issue_273.result ├── issue_291.mml ├── issue_291.mss ├── issue_291.result ├── issue_296.mml ├── issue_296.mss ├── issue_296.result ├── issue_333.mml ├── issue_333.mss ├── issue_333.result ├── issue_338.mml ├── issue_338.mss ├── issue_338.result ├── issue_348.mml ├── issue_348.result ├── issue_394.mss ├── issue_394_api2.3.0.mml ├── issue_394_api2.3.0.result ├── issue_394_api3.0.0.mml ├── issue_394_api3.0.0.result ├── issue_411.mml ├── issue_411.mss ├── issue_411.result ├── issue_450.mml ├── issue_450.result ├── issue_469.mml ├── issue_469.mss ├── issue_469.result ├── layer_nodatasource.mml ├── layer_nodatasource.mss ├── layer_nodatasource.result ├── layer_properties.mml ├── layer_properties.mss ├── layer_properties.result ├── mapnik_keyword.mml ├── mapnik_keyword.mss ├── mapnik_keyword.result ├── modulus.mml ├── modulus.mss ├── modulus.result ├── multiple_symbolizers.mml ├── multiple_symbolizers.mss ├── multiple_symbolizers.result ├── nesting_class.mml ├── nesting_class.mss ├── nesting_class.result ├── nominzoom.mml ├── nominzoom.mss ├── nominzoom.result ├── noquote_font.mml ├── noquote_font.mss ├── noquote_font.result ├── parameters.mml ├── parameters.result ├── partial_overrides.mml ├── partial_overrides.mss ├── partial_overrides.result ├── raster-mesh-size.mml ├── raster-mesh-size.mss ├── raster-mesh-size.result ├── raster.mml ├── raster.mss ├── raster.result ├── raster_colorizer.mml ├── raster_colorizer.mss ├── raster_colorizer.result ├── raster_colorizer_comma.mml ├── raster_colorizer_comma.mss ├── raster_colorizer_comma.result ├── raster_colorizer_onestop.mml ├── raster_colorizer_onestop.mss ├── raster_colorizer_onestop.result ├── rastercolorizer.mml ├── rastercolorizer.mss ├── rastercolorizer.result ├── regex.mml ├── regex.mss ├── regex.result ├── regex_nest.mml ├── regex_nest.mss ├── regex_nest.result ├── selector_comment.mml ├── selector_comment.mss ├── selector_comment.result ├── sharedclass.mml ├── sharedclass.mss ├── sharedclass.result ├── simplefontset.mml ├── simplefontset.mss ├── simplefontset.result ├── simplevariabletest.mml ├── simplevariabletest.mss ├── simplevariabletest.result ├── style_fold.mml ├── style_fold.mss ├── style_fold.result ├── style_level_opacity.mml ├── style_level_opacity.mss ├── style_level_opacity.result ├── support4504.mml ├── support4504.mss ├── support4504.result ├── symbolizer_order.mml ├── symbolizer_order.mss ├── symbolizer_order.result ├── text_property_overrides.mml ├── text_property_overrides.mss ├── text_property_overrides.result ├── transforms.mml ├── transforms.mss ├── transforms.result ├── transforms_backwards.mml ├── transforms_backwards.mss ├── transforms_backwards.result ├── transforms_field.mml ├── transforms_field.mss ├── transforms_field.result ├── transforms_single.mml ├── transforms_single.mss ├── transforms_single.result ├── units.mml ├── units.mss ├── units.result ├── unsigned.mml ├── unsigned.mss ├── unsigned.result ├── var_concat.mml ├── var_concat.mss ├── var_concat.result ├── weird_comments.mml ├── weird_comments.mss ├── weird_comments.result ├── weird_comments_2.mml ├── weird_comments_2.mss ├── weird_comments_2.result ├── weird_simple_comments.mml ├── weird_simple_comments.mss ├── weird_simple_comments.result ├── zoomlevels.mml ├── zoomlevels.mss ├── zoomlevels.result ├── zoomselector.mml ├── zoomselector.mss └── zoomselector.result ├── rule.test.js ├── specificity.test.js ├── specificity ├── classes.mss ├── classes.result ├── demo.mss ├── demo.result ├── filters_and_ids.mss ├── filters_and_ids.result ├── issue60.mml ├── issue60.mss └── issue60.result ├── support ├── .eslintrc.yml ├── diff.js └── helper.js └── version.test.js /.gitignore: -------------------------------------------------------------------------------- 1 | **/node_modules 2 | .DS_Store 3 | test/rendering/layers/ 4 | test/rendering/cache/ 5 | test/rendering-mss/npm-debug.log 6 | docs/_build/ 7 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | npm_modules/ 3 | test/ 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | 3 | sudo: false 4 | 5 | node_js: 6 | - "14" 7 | - "13" 8 | - "12" 9 | - "11" 10 | - "10" 11 | - "8" 12 | 13 | script: 14 | - npm test 15 | - if [[ ${TRAVIS_NODE_VERSION} == "8" ]]; then npm run coverage; fi; 16 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | # Test against this versions of Node.js 2 | environment: 3 | matrix: 4 | - nodejs_version: 14 5 | - nodejs_version: 12 6 | - nodejs_version: 10 7 | - nodejs_version: 8 8 | 9 | # Install scripts. (runs after repo cloning) 10 | install: 11 | # Get the latest stable version of Node.js or io.js 12 | - ps: Install-Product node $env:nodejs_version 13 | # install modules 14 | - npm install 15 | 16 | # Post-install test scripts. 17 | test_script: 18 | # Output useful info for debugging. 19 | - node --version 20 | - npm --version 21 | # run tests 22 | - npm test 23 | 24 | # Don't actually build. 25 | build: off 26 | -------------------------------------------------------------------------------- /build/carto.tmbundle/info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Carto 7 | ordering 8 | 9 | 43F4EF91-F880-4CE7-A4C8-02DA726BC5FF 10 | 4A0B3C2B-5F11-4D70-AFF4-EC4A4A042D66 11 | 12 | uuid 13 | 3D813315-4B2E-4537-8E22-BD1A75AB84A9 14 | 15 | 16 | -------------------------------------------------------------------------------- /build/vim-carto/ftdetect/carto.vim: -------------------------------------------------------------------------------- 1 | au BufRead,BufNewFile *.mss set filetype=carto 2 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | SPHINXPROJ = carto 8 | SOURCEDIR = . 9 | BUILDDIR = _build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | ######## 2 | CartoCSS 3 | ######## 4 | 5 | CartoCSS (short: Carto) is a language for map design. It is similar in syntax to CSS, but builds upon it with specific abilities to 6 | filter map data and by providing things like variables. It targets the `Mapnik renderer `_ and is able to generate Mapnik XML or 7 | a JSON variant of Mapnik XML. It can run from the command line or in the browser by using a bundler like Browserify. 8 | 9 | Carto is an evolution of the `Cascadenik `_ idea and language, with an emphasis on speed and flexibility. 10 | 11 | .. toctree:: 12 | :maxdepth: 2 13 | :caption: Contents: 14 | 15 | installation_usage 16 | language_elements 17 | styling_concepts 18 | mml 19 | mapnik_api 20 | -------------------------------------------------------------------------------- /docs/mapnik_api._: -------------------------------------------------------------------------------- 1 | ************************ 2 | Mapnik API documentation 3 | ************************ 4 | 5 | The following is a list of properties provided in CartoCSS that you can apply to map elements 6 | when using the Mapnik renderer. Each API version of Mapnik has its own subsection. Pick the one that 7 | applies to the version you are running. If there is no subsection for your specific version the 8 | next older listed version applies to this version. 9 | 10 | <%= versions %> 11 | -------------------------------------------------------------------------------- /docs/mapnik_api.rst: -------------------------------------------------------------------------------- 1 | ************************ 2 | Mapnik API documentation 3 | ************************ 4 | 5 | The following is a list of properties provided in CartoCSS that you can apply to map elements 6 | when using the Mapnik renderer. Each API version of Mapnik has its own subsection. Pick the one that 7 | applies to the version you are running. If there is no subsection for your specific version the 8 | next older listed version applies to this version. 9 | 10 | .. include:: api/mapnik/3.0.20.rst 11 | .. include:: api/mapnik/3.0.6.rst 12 | .. include:: api/mapnik/3.0.3.rst 13 | .. include:: api/mapnik/3.0.0.rst 14 | .. include:: api/mapnik/2.3.0.rst 15 | .. include:: api/mapnik/2.2.0.rst 16 | .. include:: api/mapnik/2.1.1.rst 17 | .. include:: api/mapnik/2.1.0.rst 18 | .. include:: api/mapnik/2.0.2.rst 19 | .. include:: api/mapnik/2.0.1.rst 20 | .. include:: api/mapnik/2.0.0.rst 21 | -------------------------------------------------------------------------------- /lib/carto/tree.js: -------------------------------------------------------------------------------- 1 | /** 2 | * TODO: document this. What does this do? 3 | */ 4 | module.exports.find = function (obj, fun) { 5 | for (var i = 0, r; i < obj.length; i++) { 6 | r = fun.call(obj, obj[i]); 7 | if (r) { return r; } 8 | } 9 | return null; 10 | }; 11 | -------------------------------------------------------------------------------- /lib/carto/tree/comment.js: -------------------------------------------------------------------------------- 1 | (function(tree) { 2 | 3 | tree.Comment = function Comment(value, silent) { 4 | this.value = value; 5 | this.silent = !!silent; 6 | }; 7 | 8 | tree.Comment.prototype = { 9 | toString: function() { 10 | return ''; 11 | }, 12 | 'ev': function() { return this; } 13 | }; 14 | 15 | })(require('../tree')); 16 | -------------------------------------------------------------------------------- /lib/carto/tree/element.js: -------------------------------------------------------------------------------- 1 | (function(tree) { 2 | 3 | // An element is an id or class selector 4 | tree.Element = function Element(value) { 5 | this.value = value.trim(); 6 | if (this.value[0] === '#') { 7 | this.type = 'id'; 8 | this.clean = this.value.replace(/^#/, ''); 9 | } 10 | if (this.value[0] === '.') { 11 | this.type = 'class'; 12 | this.clean = this.value.replace(/^\./, ''); 13 | } 14 | if (this.value.indexOf('*') !== -1) { 15 | this.type = 'wildcard'; 16 | } 17 | }; 18 | 19 | // Determine the 'specificity matrix' of this 20 | // specific selector 21 | tree.Element.prototype.specificity = function() { 22 | return [ 23 | (this.type === 'id') ? 1 : 0, // a 24 | (this.type === 'class') ? 1 : 0 // b 25 | ]; 26 | }; 27 | 28 | tree.Element.prototype.toString = function() { return this.value; }; 29 | 30 | })(require('../tree')); 31 | -------------------------------------------------------------------------------- /lib/carto/tree/field.js: -------------------------------------------------------------------------------- 1 | (function(tree) { 2 | 3 | tree.Field = function Field(content) { 4 | this.value = content || ''; 5 | }; 6 | 7 | tree.Field.prototype = { 8 | is: 'field', 9 | toString: function() { 10 | return '[' + this.value + ']'; 11 | }, 12 | 'ev': function() { 13 | return this; 14 | } 15 | }; 16 | 17 | })(require('../tree')); 18 | -------------------------------------------------------------------------------- /lib/carto/tree/imagefilter.js: -------------------------------------------------------------------------------- 1 | (function(tree) { 2 | 3 | tree.ImageFilter = function ImageFilter(filter, args) { 4 | this.filter = filter; 5 | this.args = args || null; 6 | }; 7 | 8 | tree.ImageFilter.prototype = { 9 | is: 'imagefilter', 10 | ev: function() { return this; }, 11 | 12 | toString: function() { 13 | if (this.args) { 14 | return this.filter + '(' + this.args.join(',') + ')'; 15 | } else { 16 | return this.filter; 17 | } 18 | } 19 | }; 20 | 21 | 22 | })(require('../tree')); 23 | -------------------------------------------------------------------------------- /lib/carto/tree/invalid.js: -------------------------------------------------------------------------------- 1 | (function (tree) { 2 | 3 | var util = require('../util'); 4 | 5 | tree.Invalid = function Invalid(chunk, index, message, filename) { 6 | this.chunk = chunk; 7 | this.index = index; 8 | this.message = message || "Invalid code: " + this.chunk; 9 | this.filename = filename; 10 | }; 11 | 12 | tree.Invalid.prototype.is = 'invalid'; 13 | 14 | tree.Invalid.prototype.ev = function(env) { 15 | util.error(env, { 16 | chunk: this.chunk, 17 | index: this.index, 18 | message: this.message || "Invalid code: " + this.chunk, 19 | filename: this.filename 20 | }); 21 | return { 22 | is: 'undefined' 23 | }; 24 | }; 25 | })(require('../tree')); 26 | -------------------------------------------------------------------------------- /lib/carto/tree/keyword.js: -------------------------------------------------------------------------------- 1 | (function(tree) { 2 | 3 | tree.Keyword = function Keyword(value) { 4 | this.value = value; 5 | var special = { 6 | 'transparent': 'color', 7 | 'true': 'boolean', 8 | 'false': 'boolean' 9 | }; 10 | this.is = special[value] ? special[value] : 'keyword'; 11 | }; 12 | tree.Keyword.prototype = { 13 | ev: function() { return this; }, 14 | toString: function() { return this.value; } 15 | }; 16 | 17 | })(require('../tree')); 18 | -------------------------------------------------------------------------------- /lib/carto/tree/literal.js: -------------------------------------------------------------------------------- 1 | // A literal is a literal string for Mapnik - the 2 | // result of the combination of a `tree.Field` with any 3 | // other type. 4 | (function(tree) { 5 | 6 | tree.Literal = function Field(content) { 7 | this.value = content || ''; 8 | this.is = 'field'; 9 | }; 10 | 11 | tree.Literal.prototype = { 12 | toString: function() { 13 | return this.value; 14 | }, 15 | 'ev': function() { 16 | return this; 17 | } 18 | }; 19 | 20 | })(require('../tree')); 21 | -------------------------------------------------------------------------------- /lib/carto/tree/quoted.js: -------------------------------------------------------------------------------- 1 | (function(tree) { 2 | 3 | tree.Quoted = function Quoted(content) { 4 | this.value = content || ''; 5 | }; 6 | 7 | tree.Quoted.prototype = { 8 | is: 'string', 9 | 10 | toString: function(quotes) { 11 | var escapedValue = this.value 12 | .replace(/&/g, '&') 13 | var xmlvalue = escapedValue 14 | .replace(/\'/g, '\\\'') 15 | .replace(/\"/g, '"') 16 | .replace(//g, '>'); 18 | return (quotes === true) ? "'" + xmlvalue + "'" : escapedValue; 19 | }, 20 | 21 | 'ev': function() { 22 | return this; 23 | }, 24 | 25 | operate: function(env, op, other) { 26 | return new tree.Quoted(tree.operate(op, this.toString(), other.toString(this.contains_field))); 27 | } 28 | }; 29 | 30 | })(require('../tree')); 31 | -------------------------------------------------------------------------------- /lib/carto/tree/selector.js: -------------------------------------------------------------------------------- 1 | (function(tree) { 2 | 3 | tree.Selector = function Selector(filters, zoom, elements, attachment, conditions, index) { 4 | this.elements = elements || []; 5 | this.attachment = attachment; 6 | this.filters = filters || {}; 7 | this.zoom = typeof zoom !== 'undefined' ? zoom : tree.Zoom.all; 8 | this.conditions = conditions; 9 | this.index = index; 10 | }; 11 | 12 | // Determine the specificity of this selector 13 | // based on the specificity of its elements - calling 14 | // Element.specificity() in order to do so 15 | // 16 | // [ID, Class, Filters, Position in document] 17 | tree.Selector.prototype.specificity = function() { 18 | return this.elements.reduce(function(memo, e) { 19 | var spec = e.specificity(); 20 | memo[0] += spec[0]; 21 | memo[1] += spec[1]; 22 | return memo; 23 | }, [0, 0, this.conditions, this.index]); 24 | }; 25 | 26 | })(require('../tree')); 27 | -------------------------------------------------------------------------------- /lib/carto/tree/url.js: -------------------------------------------------------------------------------- 1 | (function(tree) { 2 | 3 | tree.URL = function URL(val, paths) { 4 | this.value = val; 5 | this.paths = paths; 6 | }; 7 | 8 | tree.URL.prototype = { 9 | is: 'uri', 10 | toString: function() { 11 | return this.value.toString(); 12 | }, 13 | ev: function(ctx) { 14 | return new tree.URL(this.value.ev(ctx), this.paths); 15 | } 16 | }; 17 | 18 | })(require('../tree')); 19 | -------------------------------------------------------------------------------- /test/benchmark/opened.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "opened.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "data", 8 | "name": "data", 9 | "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", 10 | "Datasource": { 11 | "file": "http://client-data.s3.amazonaws.com/ndi-afghanistan/district_boundaries.zip", 12 | "type": "shape" 13 | } 14 | }] 15 | } 16 | -------------------------------------------------------------------------------- /test/comment.test.js: -------------------------------------------------------------------------------- 1 | var assert = require('assert'); 2 | var tree = require('../lib/carto/tree.js'); 3 | require('../lib/carto/tree/comment'); 4 | 5 | describe('Comment', function() { 6 | describe('basic functionality', function() { 7 | it('should be constructed', function() { 8 | var f = new tree.Comment('hello world'); 9 | assert.deepEqual(f.toString(), ''); 10 | assert.deepEqual(f.ev(), f); 11 | assert.ok(f); 12 | }); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /test/eclint.test.js: -------------------------------------------------------------------------------- 1 | var lint = require('mocha-eslint'); 2 | 3 | describe('jslint', function() { 4 | var paths = [ 5 | 'bin', 6 | 'lib', 7 | 'test' 8 | ]; 9 | 10 | var options = {}; 11 | options.formatter = 'compact'; 12 | lint(paths, options); 13 | }); 14 | -------------------------------------------------------------------------------- /test/errorhandling/bad_filter.mml: -------------------------------------------------------------------------------- 1 | { 2 | "Layer": [ 3 | { 4 | "id": "a" 5 | } 6 | ], 7 | "Stylesheet": [ 8 | "bad_filter.mss" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /test/errorhandling/bad_filter.mss: -------------------------------------------------------------------------------- 1 | Map { } 2 | @x: 'X'; 3 | [CODE='X'][CODE!=@x] { } 4 | -------------------------------------------------------------------------------- /test/errorhandling/bad_filter.result: -------------------------------------------------------------------------------- 1 | Error: bad_filter.mss:3:10 [[CODE]!=@x] added to [CODE]=X produces an invalid filter -------------------------------------------------------------------------------- /test/errorhandling/bad_op.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "bad_op.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/errorhandling/bad_op.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | line-width: 20% + 2px; 3 | } 4 | -------------------------------------------------------------------------------- /test/errorhandling/bad_op.result: -------------------------------------------------------------------------------- 1 | Error: bad_op.mss:2:4 If two operands differ, the first must not be % -------------------------------------------------------------------------------- /test/errorhandling/bad_op_2.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "bad_op_2.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/errorhandling/bad_op_2.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | line-width: 20px * 2%; 3 | } 4 | -------------------------------------------------------------------------------- /test/errorhandling/bad_op_2.result: -------------------------------------------------------------------------------- 1 | Error: bad_op_2.mss:2:4 Percent values can only be added or subtracted from other values -------------------------------------------------------------------------------- /test/errorhandling/color_functions.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "color_functions.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/errorhandling/color_functions.mss: -------------------------------------------------------------------------------- 1 | @foo: 'bar'; 2 | #world { 3 | polygon-fill: hsl(1, @foo, 3); 4 | } 5 | -------------------------------------------------------------------------------- /test/errorhandling/color_functions.result: -------------------------------------------------------------------------------- 1 | Error: color_functions.mss:3:31 incorrect arguments given to hsl() -------------------------------------------------------------------------------- /test/errorhandling/contradiction.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "contradiction.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/district.geojson", 11 | "type": "ogr", 12 | "layer": "OGRGeoJSON" 13 | } 14 | }] 15 | } 16 | -------------------------------------------------------------------------------- /test/errorhandling/contradiction.mss: -------------------------------------------------------------------------------- 1 | #world[FeatureCla!=""][FeatureCla=""] { 2 | polygon-fill: #fff; 3 | } 4 | -------------------------------------------------------------------------------- /test/errorhandling/contradiction.result: -------------------------------------------------------------------------------- 1 | Error: contradiction.mss:1:37 [[FeatureCla]=] added to [FeatureCla]!= produces an invalid filter -------------------------------------------------------------------------------- /test/errorhandling/contradiction_2.mss: -------------------------------------------------------------------------------- 1 | #world[FeatureCla=""][FeatureCla!=""] { 2 | polygon-fill: #fff; 3 | } 4 | -------------------------------------------------------------------------------- /test/errorhandling/contradiction_2.result: -------------------------------------------------------------------------------- 1 | Error: contradiction_2.mss:1:37 [[FeatureCla]!=] added to [FeatureCla]= produces an invalid filter -------------------------------------------------------------------------------- /test/errorhandling/function_args.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "function_args.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/errorhandling/function_args.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | point-transform: scale(2, 2); 3 | image-filters: agg-stack-blu(2, 1); 4 | } 5 | -------------------------------------------------------------------------------- /test/errorhandling/function_args.result: -------------------------------------------------------------------------------- 1 | Error: function_args.mss:3:38 unknown function agg-stack-blu(), did you mean agg-stack-blur(2) -------------------------------------------------------------------------------- /test/errorhandling/invalid_attachment.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "invalid_attachment.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/errorhandling/invalid_attachment.mss: -------------------------------------------------------------------------------- 1 | #world::test::test2 { 2 | polygon-fill: #f00; 3 | } 4 | -------------------------------------------------------------------------------- /test/errorhandling/invalid_attachment.result: -------------------------------------------------------------------------------- 1 | Error: invalid_attachment.mss:1:19 Encountered second attachment name. -------------------------------------------------------------------------------- /test/errorhandling/invalid_color_in_fn.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | polygon-fill: spin(#f00f00f, 10); 3 | } 4 | -------------------------------------------------------------------------------- /test/errorhandling/invalid_color_in_fn.result: -------------------------------------------------------------------------------- 1 | Error: invalid_color_in_fn.mss:2:34 incorrect arguments given to spin() -------------------------------------------------------------------------------- /test/errorhandling/invalid_property.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "invalid_property.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/errorhandling/invalid_property.mss: -------------------------------------------------------------------------------- 1 | #world[zoom=5] { 2 | polygon-fill: #f00; 3 | polygonopacity: 0.5; 4 | } 5 | -------------------------------------------------------------------------------- /test/errorhandling/invalid_property.result: -------------------------------------------------------------------------------- 1 | Error: invalid_property.mss:3:2 Unrecognized rule: polygonopacity. Did you mean polygon-opacity? -------------------------------------------------------------------------------- /test/errorhandling/invalid_value.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "invalid_value.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/errorhandling/invalid_value.mss: -------------------------------------------------------------------------------- 1 | #world[zoom=5] { 2 | text-face-name: 2; 3 | text-name: 'foo'; 4 | } 5 | -------------------------------------------------------------------------------- /test/errorhandling/invalid_value.result: -------------------------------------------------------------------------------- 1 | Error: invalid_value.mss:2:2 Invalid value for text-face-name, the type font is expected. 2 (of type float) was given. -------------------------------------------------------------------------------- /test/errorhandling/invaliddimension.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "invaliddimension.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/errorhandling/invaliddimension.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | line-width: 10wifflewaffles; 3 | } 4 | -------------------------------------------------------------------------------- /test/errorhandling/invaliddimension.result: -------------------------------------------------------------------------------- 1 | Error: invaliddimension.mss:2:4 Invalid unit: 'wifflewaffles' -------------------------------------------------------------------------------- /test/errorhandling/issue119.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "issue119.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "countries", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/errorhandling/issue119.mss: -------------------------------------------------------------------------------- 1 | #countries { 2 | background-color:#f00; 3 | } 4 | -------------------------------------------------------------------------------- /test/errorhandling/issue119.result: -------------------------------------------------------------------------------- 1 | Error: issue119.mss:2:2 Map properties are not permitted in other rules -------------------------------------------------------------------------------- /test/errorhandling/issue123.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "issue123.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "countries", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/errorhandling/issue123.mss: -------------------------------------------------------------------------------- 1 | #countries { 2 | ::outline { 3 | line-color: darken(#85c5d3); 4 | line-width: 2; 5 | line-join: round; 6 | } 7 | polygon-fill: #fff; 8 | } 9 | -------------------------------------------------------------------------------- /test/errorhandling/issue123.result: -------------------------------------------------------------------------------- 1 | Error: issue123.mss:3:31 incorrect number of arguments for darken(). 2 expected. -------------------------------------------------------------------------------- /test/errorhandling/issue124.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "issue124.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "countries", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/errorhandling/issue124.mss: -------------------------------------------------------------------------------- 1 | #countries { 2 | [NAME = 14]{ 3 | polygon-pattern-file: url(stripe8.png; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /test/errorhandling/issue124.result: -------------------------------------------------------------------------------- 1 | Error: issue124.mss:6:0 missing closing `}` -------------------------------------------------------------------------------- /test/errorhandling/issue165.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | ], 5 | "Layer": [{ 6 | "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", 7 | "Datasource": { 8 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 9 | "type": "shape" 10 | } 11 | }] 12 | } 13 | -------------------------------------------------------------------------------- /test/errorhandling/issue165.result: -------------------------------------------------------------------------------- 1 | Error: The id attribute is required for layers. -------------------------------------------------------------------------------- /test/errorhandling/issue297.mml: -------------------------------------------------------------------------------- 1 | { 2 | "Stylesheet": [ 3 | "issue297.mss" 4 | ], 5 | "Layer": [{ 6 | "id": "t" 7 | }] 8 | } 9 | -------------------------------------------------------------------------------- /test/errorhandling/issue297.mss: -------------------------------------------------------------------------------- 1 | #t { 2 | text-name: valid; 3 | text-face-name: 2; 4 | } 5 | -------------------------------------------------------------------------------- /test/errorhandling/issue297.result: -------------------------------------------------------------------------------- 1 | Error: issue297.mss:3:2 Invalid value for text-face-name, the type font is expected. 2 (of type float) was given. -------------------------------------------------------------------------------- /test/errorhandling/issue_204_a.mss: -------------------------------------------------------------------------------- 1 | #countries { 2 | polygon-fill: green; 3 | }} -------------------------------------------------------------------------------- /test/errorhandling/issue_204_a.result: -------------------------------------------------------------------------------- 1 | Error: issue_204_a.mss:3:1 missing opening `{` -------------------------------------------------------------------------------- /test/errorhandling/issue_204_b.mss: -------------------------------------------------------------------------------- 1 | #countries { 2 | polygon-fill: green; 3 | }} -------------------------------------------------------------------------------- /test/errorhandling/issue_204_b.result: -------------------------------------------------------------------------------- 1 | Error: issue_204_b.mss:3:3 missing opening `{` -------------------------------------------------------------------------------- /test/errorhandling/issue_204_c.mss: -------------------------------------------------------------------------------- 1 | #countries { 2 | polygon-fill: green; 3 | }} 4 | -------------------------------------------------------------------------------- /test/errorhandling/issue_204_c.result: -------------------------------------------------------------------------------- 1 | Error: issue_204_c.mss:4:0 missing opening `{` -------------------------------------------------------------------------------- /test/errorhandling/issue_218.mss: -------------------------------------------------------------------------------- 1 | #country-label { 2 | [one = 2] 3 | marker-width:1; 4 | } 5 | } -------------------------------------------------------------------------------- /test/errorhandling/issue_218.result: -------------------------------------------------------------------------------- 1 | Error: issue_218.mss:5:2 missing opening `{` -------------------------------------------------------------------------------- /test/errorhandling/issue_29.mml: -------------------------------------------------------------------------------- 1 | { 2 | "name": "", 3 | "scale": 1, 4 | "Stylesheet": [ 5 | "issue_29.mss" 6 | ], 7 | "Layer": [ 8 | { 9 | "id": "test" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /test/errorhandling/issue_29.mss: -------------------------------------------------------------------------------- 1 | #bla { 2 | marker-fill: black; 3 | } 4 | -------------------------------------------------------------------------------- /test/errorhandling/issue_29.result: -------------------------------------------------------------------------------- 1 | Warning: Layer test has no styles associated with it. 2 | Warning: issue_29.mss:2:4 Styles do not match layer selector #bla. -------------------------------------------------------------------------------- /test/errorhandling/issue_462.mss: -------------------------------------------------------------------------------- 1 | #test { 2 | shield: auto; 3 | text: auto; 4 | line-pattern: auto; 5 | polygon-pattern: auto; 6 | } 7 | -------------------------------------------------------------------------------- /test/errorhandling/issue_462.result: -------------------------------------------------------------------------------- 1 | Warning: issue_462.mss:2:4 shield is unstable. It may change in the future. 2 | Error: issue_462.mss:2:4 Invalid value for shield, the type keyword (options: none) is expected. auto (of type keyword) was given. 3 | Warning: issue_462.mss:3:4 text is unstable. It may change in the future. 4 | Error: issue_462.mss:3:4 Invalid value for text, the type keyword (options: none) is expected. auto (of type keyword) was given. 5 | Warning: issue_462.mss:4:4 line-pattern is unstable. It may change in the future. 6 | Error: issue_462.mss:4:4 Invalid value for line-pattern, the type keyword (options: none) is expected. auto (of type keyword) was given. 7 | Warning: issue_462.mss:5:4 polygon-pattern is unstable. It may change in the future. 8 | Error: issue_462.mss:5:4 Invalid value for polygon-pattern, the type keyword (options: none) is expected. auto (of type keyword) was given. -------------------------------------------------------------------------------- /test/errorhandling/issue_474.mss: -------------------------------------------------------------------------------- 1 | #test { 2 | marker-type: ellipse; 3 | line-offset: 2; 4 | text-name: [name]; 5 | text-face-name: Arial; 6 | text-largest-bbox-only: true; 7 | } 8 | -------------------------------------------------------------------------------- /test/errorhandling/issue_474.result: -------------------------------------------------------------------------------- 1 | Warning: issue_474.mss:2:4 marker-type is deprecated. It may be removed in the future. 2 | Warning: issue_474.mss:3:4 line-offset is unstable. It may change in the future. 3 | Warning: issue_474.mss:6:4 text-largest-bbox-only is experimental. It may change, be renamed or removed in the future. -------------------------------------------------------------------------------- /test/errorhandling/mapnik_keyword.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "mapnik_keyword.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/errorhandling/mapnik_keyword.mss: -------------------------------------------------------------------------------- 1 | #world[[FOO]=nul] { 2 | line-width:2; 3 | } 4 | -------------------------------------------------------------------------------- /test/errorhandling/mapnik_keyword.result: -------------------------------------------------------------------------------- 1 | Error: mapnik_keyword.mss:1:6 nul is not a valid keyword in a filter expression -------------------------------------------------------------------------------- /test/errorhandling/missing_close.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "missing_close.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/errorhandling/missing_close.mss: -------------------------------------------------------------------------------- 1 | #world[natural="water" 2 | { 3 | polygon-fill: blue; 4 | } 5 | -------------------------------------------------------------------------------- /test/errorhandling/missing_close.result: -------------------------------------------------------------------------------- 1 | Error: missing_close.mss:1:5 Missing closing ] of filter. -------------------------------------------------------------------------------- /test/errorhandling/multi_stylesheets.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "multi_stylesheets_b.mss", 5 | "multi_stylesheets_a.mss" 6 | ], 7 | "Layer": [{ 8 | "id": "world", 9 | "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", 10 | "Datasource": { 11 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 12 | "type": "shape" 13 | } 14 | }] 15 | } 16 | -------------------------------------------------------------------------------- /test/errorhandling/multi_stylesheets.result: -------------------------------------------------------------------------------- 1 | Error: multi_stylesheets_b.mss:2:2 Unrecognized rule: polygonopacity. Did you mean polygon-opacity? -------------------------------------------------------------------------------- /test/errorhandling/multi_stylesheets_a.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | polygon-opacity: 0.5; 3 | line-width:4; 4 | line-color:#fff; 5 | line-opacity:0.3; 6 | } 7 | -------------------------------------------------------------------------------- /test/errorhandling/multi_stylesheets_b.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | polygonopacity: 0.5; 3 | } 4 | -------------------------------------------------------------------------------- /test/errorhandling/multi_stylesheets_b.result: -------------------------------------------------------------------------------- 1 | Error: multi_stylesheets_b.mss:2:2 Unrecognized rule: polygonopacity. Did you mean polygon-opacity? -------------------------------------------------------------------------------- /test/errorhandling/no_stylesheet.mml: -------------------------------------------------------------------------------- 1 | { 2 | "Layer": [ 3 | { 4 | "id": "a" 5 | } 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /test/errorhandling/no_stylesheet.result: -------------------------------------------------------------------------------- 1 | Error: Expecting a Stylesheet property containing an (array of) stylesheet object(s) of the form { id: 'x', 'data': 'y' }. -------------------------------------------------------------------------------- /test/errorhandling/nopound.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "nopound.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/errorhandling/nopound.mss: -------------------------------------------------------------------------------- 1 | world { 2 | ::outline { 3 | line-color: #85c5d3; 4 | line-width: 2; 5 | line-join: round; 6 | } 7 | polygon-fill: #fff; 8 | } 9 | -------------------------------------------------------------------------------- /test/errorhandling/nopound.result: -------------------------------------------------------------------------------- 1 | Error: nopound.mss:1:0 Invalid code: world { -------------------------------------------------------------------------------- /test/errorhandling/notenoughargs.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "notenoughargs.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/errorhandling/notenoughargs.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | ::outline { 3 | line-color: darken(#85c5d3); 4 | line-width: 2; 5 | line-join: round; 6 | } 7 | polygon-fill: #fff; 8 | } 9 | -------------------------------------------------------------------------------- /test/errorhandling/notenoughargs.result: -------------------------------------------------------------------------------- 1 | Error: notenoughargs.mss:3:31 incorrect number of arguments for darken(). 2 expected. -------------------------------------------------------------------------------- /test/errorhandling/stylesheet_absolute_file.mml: -------------------------------------------------------------------------------- 1 | { 2 | "Stylesheet": [ 3 | "/home/test/test.mss" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /test/errorhandling/stylesheet_absolute_file.result: -------------------------------------------------------------------------------- 1 | Error: Failed to load file /home/test/test.mss. -------------------------------------------------------------------------------- /test/errorhandling/stylesheet_absolute_file_syswin.result: -------------------------------------------------------------------------------- 1 | Error: Failed to load file C:\home\test\test.mss. -------------------------------------------------------------------------------- /test/errorhandling/stylesheet_no_data.mml: -------------------------------------------------------------------------------- 1 | { 2 | "Layer": [ 3 | { 4 | "id": "a" 5 | } 6 | ], 7 | "Stylesheet": [{ 8 | "id": "b" 9 | }] 10 | } 11 | -------------------------------------------------------------------------------- /test/errorhandling/stylesheet_no_data.result: -------------------------------------------------------------------------------- 1 | Error: Expecting a stylesheet object of the form { id: 'x', 'data': 'y' } for the Stylesheet property. -------------------------------------------------------------------------------- /test/errorhandling/stylesheet_no_id.mml: -------------------------------------------------------------------------------- 1 | { 2 | "Layer": [ 3 | { 4 | "id": "a" 5 | } 6 | ], 7 | "Stylesheet": [{ 8 | "data": "test" 9 | }] 10 | } 11 | -------------------------------------------------------------------------------- /test/errorhandling/stylesheet_no_id.result: -------------------------------------------------------------------------------- 1 | Error: Expecting a stylesheet object of the form { id: 'x', 'data': 'y' } for the Stylesheet property. -------------------------------------------------------------------------------- /test/errorhandling/undefined_variable.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "undefined_variable.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/errorhandling/undefined_variable.mss: -------------------------------------------------------------------------------- 1 | #world[zoom=5] { 2 | polygon-fill: @something; 3 | line-color: @something + #111; 4 | marker-fill: darken(@something, 10); 5 | } 6 | -------------------------------------------------------------------------------- /test/errorhandling/undefined_variable.result: -------------------------------------------------------------------------------- 1 | Error: undefined_variable.mss:2:16 variable @something is undefined 2 | Error: undefined_variable.mss:3:14 variable @something is undefined 3 | Error: undefined_variable.mss:4:22 variable @something is undefined -------------------------------------------------------------------------------- /test/errorhandling/zoom_as_var.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "zoom_as_var.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/errorhandling/zoom_as_var.mss: -------------------------------------------------------------------------------- 1 | #world[zoom=5] { 2 | polygon-opacity: zoom / 0.5; 3 | } 4 | -------------------------------------------------------------------------------- /test/errorhandling/zoom_as_var.result: -------------------------------------------------------------------------------- 1 | Error: zoom_as_var.mss:2:2 Cannot do math with type keyword. -------------------------------------------------------------------------------- /test/errorhandling/zoommax.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "zoommax.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/errorhandling/zoommax.mss: -------------------------------------------------------------------------------- 1 | #world[zoom > 40] { 2 | polygon-fill: #fff; 3 | } 4 | -------------------------------------------------------------------------------- /test/errorhandling/zoommax.result: -------------------------------------------------------------------------------- 1 | Error: zoommax.mss:1:6 Only zoom levels between 0 and 25 supported. -------------------------------------------------------------------------------- /test/field.test.js: -------------------------------------------------------------------------------- 1 | var assert = require('assert'); 2 | var tree = require('../lib/carto/tree.js'); 3 | require('../lib/carto/tree/field'); 4 | 5 | describe('Field', function() { 6 | describe('basic functionality', function() { 7 | it('should be constructed', function() { 8 | var f = new tree.Field("foo"); 9 | assert.ok(f); 10 | assert.equal(f.is, 'field'); 11 | }); 12 | it('should produce xml-friendly output', function() { 13 | var f = new tree.Field("bar"); 14 | assert.ok(f); 15 | assert.equal(f.toString(), "[bar]"); 16 | }); 17 | }); 18 | }); 19 | -------------------------------------------------------------------------------- /test/quoted.test.js: -------------------------------------------------------------------------------- 1 | var assert = require('assert'); 2 | var tree = require('../lib/carto/tree.js'); 3 | require('../lib/carto/tree/quoted'); 4 | 5 | describe('Quoted', function() { 6 | describe('basic functionality', function() { 7 | it('should be constructed', function() { 8 | var f = new tree.Quoted("Tom's & \"\""); 9 | assert.ok(f); 10 | assert.equal(f.is, 'string'); 11 | }); 12 | it('should produce normal output', function() { 13 | var f = new tree.Quoted("Tom's & \"\""); 14 | assert.ok(f); 15 | assert.equal(f.toString(), "Tom's & \"\""); 16 | }); 17 | it('should produce xml-friendly output', function() { 18 | var f = new tree.Quoted("Tom's & \"\""); 19 | assert.ok(f); 20 | assert.equal(f.toString(true), "'Tom\\'s & "<quoted>"'"); 21 | }); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /test/rendering-mss/basic_attachment_internal.mss: -------------------------------------------------------------------------------- 1 | #layer { 2 | // default attachement comes before 3 | line-color: chartreuse; 4 | line-width: 10; 5 | ::inline { 6 | line-color: lime; 7 | line-width: 5; 8 | } 9 | } -------------------------------------------------------------------------------- /test/rendering-mss/basic_attachment_internal.xml: -------------------------------------------------------------------------------- 1 | 6 | 11 | -------------------------------------------------------------------------------- /test/rendering-mss/basic_attachment_internal_before.mss: -------------------------------------------------------------------------------- 1 | #layer { 2 | ::outline { 3 | line-color: aliceblue; 4 | line-width: 5; 5 | } 6 | // default attachement comes after 7 | line-color: orchid; 8 | line-width: 10; 9 | } -------------------------------------------------------------------------------- /test/rendering-mss/basic_attachment_internal_before.xml: -------------------------------------------------------------------------------- 1 | 6 | 11 | -------------------------------------------------------------------------------- /test/rendering-mss/basic_attachment_internal_before_and_after.mss: -------------------------------------------------------------------------------- 1 | #layer { 2 | ::outline { 3 | line-color: salmon; 4 | line-width: 10; 5 | } 6 | line-color: coral; 7 | line-width: 5; 8 | ::inline { 9 | line-color: moccasin; 10 | line-width: 1; 11 | } 12 | } -------------------------------------------------------------------------------- /test/rendering-mss/basic_attachment_internal_before_and_after.xml: -------------------------------------------------------------------------------- 1 | 6 | 11 | 16 | -------------------------------------------------------------------------------- /test/rendering-mss/basic_attachment_internal_double.mss: -------------------------------------------------------------------------------- 1 | #layer { 2 | ::outline { 3 | line-color: whitesmoke; 4 | line-width: 10; 5 | } 6 | ::inline { 7 | line-color: mintcream; 8 | line-width: 5; 9 | } 10 | } -------------------------------------------------------------------------------- /test/rendering-mss/basic_attachment_internal_double.xml: -------------------------------------------------------------------------------- 1 | 6 | 11 | -------------------------------------------------------------------------------- /test/rendering-mss/basic_attachment_internal_with_label.mss: -------------------------------------------------------------------------------- 1 | #places { 2 | marker-width: 10; 3 | marker-allow-overlap: true; 4 | marker-fill: peru; 5 | ::label { 6 | text-face-name: "DejaVu Sans Book"; 7 | text-name: "'1'"; 8 | text-fill: tomato; 9 | text-allow-overlap: true; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /test/rendering-mss/basic_attachment_internal_with_label.xml: -------------------------------------------------------------------------------- 1 | 6 | 11 | -------------------------------------------------------------------------------- /test/rendering-mss/basic_attachment_separate.mss: -------------------------------------------------------------------------------- 1 | #layer { 2 | // default attachement comes before 3 | line-color: chartreuse; 4 | line-width: 10; 5 | } 6 | #layer::inline { 7 | line-color: lime; 8 | line-width: 5; 9 | } -------------------------------------------------------------------------------- /test/rendering-mss/basic_attachment_separate.xml: -------------------------------------------------------------------------------- 1 | 6 | 11 | -------------------------------------------------------------------------------- /test/rendering-mss/basic_attachment_separate_before.mss: -------------------------------------------------------------------------------- 1 | #layer::outline { 2 | line-color: aliceblue; 3 | line-width: 10; 4 | } 5 | #layer { 6 | // default attachment comes after 7 | line-color: orchid; 8 | line-width: 5; 9 | } -------------------------------------------------------------------------------- /test/rendering-mss/basic_attachment_separate_before.xml: -------------------------------------------------------------------------------- 1 | 6 | 11 | -------------------------------------------------------------------------------- /test/rendering-mss/basic_attachment_separate_before_and_after.mss: -------------------------------------------------------------------------------- 1 | #layer::outline { 2 | line-color: salmon; 3 | line-width: 10; 4 | } 5 | #layer { 6 | line-color: coral; 7 | line-width: 5; 8 | } 9 | #layer::inline { 10 | line-color: moccasin; 11 | line-width: 1; 12 | } -------------------------------------------------------------------------------- /test/rendering-mss/basic_attachment_separate_before_and_after.xml: -------------------------------------------------------------------------------- 1 | 6 | 11 | 16 | -------------------------------------------------------------------------------- /test/rendering-mss/basic_attachment_separate_double.mss: -------------------------------------------------------------------------------- 1 | #layer::outline { 2 | line-color: whitesmoke; 3 | line-width: 10; 4 | } 5 | #layer::inline { 6 | line-color: mintcream; 7 | line-width: 5; 8 | } -------------------------------------------------------------------------------- /test/rendering-mss/basic_attachment_separate_double.xml: -------------------------------------------------------------------------------- 1 | 6 | 11 | -------------------------------------------------------------------------------- /test/rendering-mss/basic_attachment_separate_with_label.mss: -------------------------------------------------------------------------------- 1 | #layer { 2 | marker-width: 10; 3 | marker-allow-overlap: true; 4 | marker-fill: peru; 5 | } 6 | #layer::label { 7 | text-face-name: "DejaVu Sans Book"; 8 | text-name: "'1'"; 9 | text-fill: tomato; 10 | text-allow-overlap: true; 11 | } 12 | -------------------------------------------------------------------------------- /test/rendering-mss/basic_attachment_separate_with_label.xml: -------------------------------------------------------------------------------- 1 | 6 | 11 | -------------------------------------------------------------------------------- /test/rendering-mss/empty_name.mss: -------------------------------------------------------------------------------- 1 | #poi-point { 2 | text-name: ""; 3 | text-face-name: "DejaVu Sans Book"; 4 | text-size: 10; 5 | text-fill: chocolate; 6 | } -------------------------------------------------------------------------------- /test/rendering-mss/empty_name.xml: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /test/rendering-mss/image-filters.mss: -------------------------------------------------------------------------------- 1 | #layer { 2 | image-filters:invert(); 3 | image-filters-inflate:true; 4 | direct-image-filters:invert(); 5 | } -------------------------------------------------------------------------------- /test/rendering-mss/image-filters.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test/rendering-mss/issue_121.mss: -------------------------------------------------------------------------------- 1 | #data { 2 | [[dem] > [rep]] { marker-fill: #00f;} 3 | } 4 | -------------------------------------------------------------------------------- /test/rendering-mss/issue_121.xml: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /test/rendering-mss/issue_197.mss: -------------------------------------------------------------------------------- 1 | @foo: 6; 2 | @a: 8; 3 | 4 | #bar[zoom > @foo] { marker-width: 1; } 5 | #a[zoom = @a] { marker-width: 1; } 6 | -------------------------------------------------------------------------------- /test/rendering-mss/issue_197.xml: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /test/rendering-mss/issue_214.xml: -------------------------------------------------------------------------------- 1 | 15 | -------------------------------------------------------------------------------- /test/rendering-mss/issue_232.mss: -------------------------------------------------------------------------------- 1 | @sans_bold: 'Helvetica Neue', 'Foo Bar'; 2 | #world[zoom>=11][zoom<=22][reflen<=8][type='bicycle'] { 3 | [network='ncn'],[network='rcn'] { 4 | shield-name: "[ref]"; 5 | shield-face-name: @sans_bold; 6 | shield-file: url(img/shield-motorway-1.png); 7 | [network='ncn'] { 8 | [reflen=8] { shield-file: url(img/shield-motorway-8.png); } 9 | } 10 | [network='rcn'] { 11 | [reflen=8] { shield-file: url(img/shield-trunk-8.png); } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering-mss/issue_247_1.mss: -------------------------------------------------------------------------------- 1 | #countries { 2 | ::outline { 3 | line-color: #85c5d3; 4 | line-width: 4; 5 | line-join: round; 6 | //[ne_10m_adm = 'AAA'] { } 7 | } 8 | ::inline { 9 | line-color: black; 10 | line-width: 1; 11 | } 12 | } -------------------------------------------------------------------------------- /test/rendering-mss/issue_247_1.xml: -------------------------------------------------------------------------------- 1 | 6 | 11 | -------------------------------------------------------------------------------- /test/rendering-mss/issue_247_2.mss: -------------------------------------------------------------------------------- 1 | #countries { 2 | ::outline { 3 | line-color: #85c5d3; 4 | line-width: 4; 5 | line-join: round; 6 | [ne_10m_adm = 'AAA'] { } 7 | } 8 | ::inline { 9 | line-color: black; 10 | line-width: 1; 11 | } 12 | } -------------------------------------------------------------------------------- /test/rendering-mss/issue_247_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 16 | -------------------------------------------------------------------------------- /test/rendering-mss/issue_284.mss: -------------------------------------------------------------------------------- 1 | #roads_high::outline { 2 | [type='primary'] { 3 | line-color: red; 4 | } 5 | [foo='bar'] { 6 | line-width: 10; 7 | } 8 | } 9 | 10 | #roads_high { 11 | [type='primary'] { 12 | line-color: red; 13 | } 14 | [foo='bar'] { 15 | line-width: 10; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /test/rendering-mss/issue_284.xml: -------------------------------------------------------------------------------- 1 | 15 | 29 | -------------------------------------------------------------------------------- /test/rendering-mss/issue_284_b.mss: -------------------------------------------------------------------------------- 1 | #roads_high::inline { 2 | [type='primary'] { 3 | line-color: darkred; 4 | } 5 | [foo='bar'] { 6 | line-width: 11; 7 | } 8 | } 9 | 10 | #roads_high::outline { 11 | [type='primary'] { 12 | line-color: red; 13 | } 14 | [foo='bar'] { 15 | line-width: 10; 16 | } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /test/rendering-mss/issue_284_b.xml: -------------------------------------------------------------------------------- 1 | 15 | 29 | -------------------------------------------------------------------------------- /test/rendering-mss/issue_284_c.mss: -------------------------------------------------------------------------------- 1 | #roads_high { 2 | [type='primary'] { 3 | line-color: darkred; 4 | } 5 | [foo='bar'] { 6 | line-width: 11; 7 | } 8 | } 9 | 10 | #roads_high { 11 | [type='primary'] { 12 | line-color: red; 13 | } 14 | [foo='bar'] { 15 | line-width: 10; 16 | } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /test/rendering-mss/issue_284_c.xml: -------------------------------------------------------------------------------- 1 | 15 | -------------------------------------------------------------------------------- /test/rendering-mss/issue_303.mss: -------------------------------------------------------------------------------- 1 | #layer["Hello&Goodbye"="yes"] { 2 | text-name: [name]; 3 | text-face-name: "El&Font Bubble Regular"; 4 | } -------------------------------------------------------------------------------- /test/rendering-mss/issue_303.xml: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /test/rendering-mss/issue_339.mss: -------------------------------------------------------------------------------- 1 | #poi_label[maki=''] { opacity:.5; } -------------------------------------------------------------------------------- /test/rendering-mss/issue_339.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test/rendering-mss/issue_339b.mss: -------------------------------------------------------------------------------- 1 | #poi_label[maki=''] { 2 | opacity:1.0; 3 | comp-op:src-over; 4 | } -------------------------------------------------------------------------------- /test/rendering-mss/issue_339b.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/carto/305107201d4f8c4a2b9118c0077dde904f4224ed/test/rendering-mss/issue_339b.xml -------------------------------------------------------------------------------- /test/rendering-mss/issue_370.mss: -------------------------------------------------------------------------------- 1 | [way_pixels < 192000][way_pixels > 3000] { 2 | line-width: 1; 3 | } -------------------------------------------------------------------------------- /test/rendering-mss/issue_370.xml: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /test/rendering-mss/issue_370_b.mss: -------------------------------------------------------------------------------- 1 | [way_pixels <= 192000][way_pixels >= 3000] { 2 | line-width: 1; 3 | } -------------------------------------------------------------------------------- /test/rendering-mss/issue_370_b.xml: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /test/rendering-mss/issue_377.mss: -------------------------------------------------------------------------------- 1 | [[height] % 50 = 0] { 2 | marker-fill: red; 3 | } 4 | -------------------------------------------------------------------------------- /test/rendering-mss/issue_377.xml: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /test/rendering-mss/issue_443.mss: -------------------------------------------------------------------------------- 1 | @water: #a0c8f0; 2 | 3 | #water { 4 | polygon-fill: @water - #111; 5 | } -------------------------------------------------------------------------------- /test/rendering-mss/issue_443.xml: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /test/rendering-mss/issue_462.mss: -------------------------------------------------------------------------------- 1 | #foo { 2 | line: none; 3 | line-width: 2; 4 | [feature = 'bar'] { 5 | line-color: red; 6 | } 7 | [feature = 'baz'] { 8 | line-color: blue; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /test/rendering-mss/issue_462.xml: -------------------------------------------------------------------------------- 1 | 11 | -------------------------------------------------------------------------------- /test/rendering-mss/issue_462a.mss: -------------------------------------------------------------------------------- 1 | #foo { 2 | line: auto; 3 | [feature = 'bar'] { 4 | line-color: red; 5 | } 6 | [feature = 'baz'] { 7 | line-color: blue; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /test/rendering-mss/issue_462a.xml: -------------------------------------------------------------------------------- 1 | 14 | -------------------------------------------------------------------------------- /test/rendering-mss/issue_462b.mss: -------------------------------------------------------------------------------- 1 | #foo { 2 | shield: none; 3 | [feature = 'bar'] { 4 | shield-name: "[refs]"; 5 | shield-face-name: "Arial"; 6 | shield-file: url('test.svg'); 7 | shield-fill: red; 8 | } 9 | [feature = 'baz'] { 10 | shield-name: "[refs]"; 11 | shield-face-name: "Arial"; 12 | shield-file: url('test.svg'); 13 | shield-fill: blue; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /test/rendering-mss/issue_462b.xml: -------------------------------------------------------------------------------- 1 | 11 | -------------------------------------------------------------------------------- /test/rendering-mss/line-width-zoom.mss: -------------------------------------------------------------------------------- 1 | #layer { 2 | line-width:"@zoom"; 3 | } -------------------------------------------------------------------------------- /test/rendering-mss/line-width-zoom.xml: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /test/rendering-mss/quoted_attr.mss: -------------------------------------------------------------------------------- 1 | #layer[power = 'generator']['generator:source' = 'wind']::power { 2 | marker-width:0; 3 | } -------------------------------------------------------------------------------- /test/rendering-mss/quoted_attr.xml: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /test/rendering-mss/scale-hsla-filter.mss: -------------------------------------------------------------------------------- 1 | #layer { 2 | polygon-fill:red; 3 | image-filters:scale-hsla(.5,.5,.5,.5,.5,.5,.5,.5); 4 | direct-image-filters:scale-hsla(.5,.5,.5,.5,.5,.5,.5,.5); 5 | } -------------------------------------------------------------------------------- /test/rendering-mss/scale-hsla-filter.xml: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /test/rendering-mss/should-discard-empty-style-and-attach.mss: -------------------------------------------------------------------------------- 1 | #landcover { 2 | ::foo { 3 | } 4 | } -------------------------------------------------------------------------------- /test/rendering-mss/should-discard-empty-style-and-attach.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test/rendering-mss/should-discard-empty-style.mss: -------------------------------------------------------------------------------- 1 | #landcover { 2 | } -------------------------------------------------------------------------------- /test/rendering-mss/should-discard-empty-style.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/carto/305107201d4f8c4a2b9118c0077dde904f4224ed/test/rendering-mss/should-discard-empty-style.xml -------------------------------------------------------------------------------- /test/rendering-mss/should-discard-empty-style2.mss: -------------------------------------------------------------------------------- 1 | #landcover { 2 | ::a { 3 | //polygon-fill: #aacbaf; 4 | } 5 | ::b { 6 | // marker-width:4; 7 | } 8 | } -------------------------------------------------------------------------------- /test/rendering-mss/should-discard-empty-style2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /test/rendering-mss/style-level-prop-only.mss: -------------------------------------------------------------------------------- 1 | #landcover { 2 | opacity:.5; 3 | } -------------------------------------------------------------------------------- /test/rendering-mss/style-level-prop-only.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test/rendering-mss/style-level-prop-only2.mss: -------------------------------------------------------------------------------- 1 | #landcover { 2 | comp-op:color-burn; 3 | } -------------------------------------------------------------------------------- /test/rendering-mss/style-level-prop-only2.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test/rendering-mss/style-level-prop-only3.mss: -------------------------------------------------------------------------------- 1 | #landcover { 2 | image-filters:invert(); 3 | } -------------------------------------------------------------------------------- /test/rendering-mss/style-level-prop-only3.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test/rendering-mss/text-face-name-escaping.mss: -------------------------------------------------------------------------------- 1 | #layer { 2 | text-name: [name]; 3 | text-face-name: "El&Font Bubble Regular"; 4 | } 5 | -------------------------------------------------------------------------------- /test/rendering-mss/text-face-name-escaping.xml: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /test/rendering-mss/variable-quoting-of-enum.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | line-rasterizer: 'fast'; 3 | // carto should collapse to one 4 | line-rasterizer: fast; 5 | } 6 | -------------------------------------------------------------------------------- /test/rendering-mss/variable-quoting-of-enum.xml: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /test/rendering-mss/zoom-like-field-name.mss: -------------------------------------------------------------------------------- 1 | #world[zoomy > 2] { 2 | polygon-fill:#f00; 3 | } -------------------------------------------------------------------------------- /test/rendering-mss/zoom-like-field-name.xml: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /test/rendering-mss/zoom_space.mss: -------------------------------------------------------------------------------- 1 | #world[ zoom > 2] { 2 | polygon-fill:#f00; 3 | } 4 | -------------------------------------------------------------------------------- /test/rendering-mss/zoom_space.xml: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /test/rendering/afghanistan_votes.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "afghanistan_votes.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "data", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/district.geojson", 11 | "type": "ogr", 12 | "layer": "OGRGeoJSON" 13 | } 14 | }] 15 | } 16 | -------------------------------------------------------------------------------- /test/rendering/background_attributes.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "background_attributes.mss" 5 | ], 6 | "Layer": [] 7 | } 8 | -------------------------------------------------------------------------------- /test/rendering/background_attributes.mss: -------------------------------------------------------------------------------- 1 | Map { 2 | background-color: #fff; 3 | } 4 | -------------------------------------------------------------------------------- /test/rendering/background_attributes.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /test/rendering/buffersize.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "buffersize.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/buffersize.mss: -------------------------------------------------------------------------------- 1 | Map { 2 | buffer-size: 256; 3 | } 4 | 5 | #world { 6 | text-name: "[NAME]"; 7 | text-size: 11; 8 | text-face-name: "Georgia Regular", "Arial Italic"; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /test/rendering/buffersize.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 13 | 15 | world 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /test/rendering/building_height.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "building_height.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/building_height.mss: -------------------------------------------------------------------------------- 1 | @n: 4; 2 | #world { 3 | building-height: 2 * 3 * [HEIGHT] + 2 + [NOTHEIGHT] + (@n * 2); 4 | } 5 | -------------------------------------------------------------------------------- /test/rendering/building_height.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 11 | 13 | world 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /test/rendering/combined_class.mss: -------------------------------------------------------------------------------- 1 | /* Applies to all layers with .land class */ 2 | .land { 3 | line-color: #ccc; 4 | line-width: 0.5; 5 | polygon-fill: #eee; 6 | } 7 | .land#lakes { 8 | line-color: #ccc; 9 | line-width: 0.5; 10 | polygon-fill: #000; 11 | } 12 | -------------------------------------------------------------------------------- /test/rendering/complex_cascades.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | polygon-fill: #FFF; 3 | line-color:#F00; 4 | line-width: 0.5; 5 | } 6 | 7 | #world[NAME='United States'] { 8 | polygon-fill:#CCC; 9 | [zoom > 6] { polygon-fill:#DDD; } 10 | [zoom > 7] { polygon-fill:#999; } 11 | [zoom > 5] { polygon-fill:#666; } 12 | } 13 | 14 | #world[NAME='Canada'], 15 | #countries { 16 | polygon-fill: #eee; 17 | line-color: #ccc; 18 | line-width: 1; 19 | 20 | .new { 21 | polygon-fill: #CCC; 22 | } 23 | 24 | .new[zoom > 5] { 25 | line-width:0.5; 26 | 27 | [NAME='United States'] { 28 | polygon-fill:#AFC; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /test/rendering/complexfontset.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | text-name: "[NAME]"; 3 | text-size: 11; 4 | text-face-name: "Georgia Regular", "Arial Italic"; 5 | } 6 | 7 | #countries { 8 | text-name: "[NAME]"; 9 | text-size: 11; 10 | text-face-name: "Georgia Regular", "Arial Italic"; 11 | } 12 | -------------------------------------------------------------------------------- /test/rendering/cross_stylesheet_variable.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "cross_stylesheet_variable_a.mss", 5 | "cross_stylesheet_variable_b.mss" 6 | ], 7 | "Layer": [{ 8 | "id": "world", 9 | "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", 10 | "Datasource": { 11 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 12 | "type": "shape" 13 | } 14 | }] 15 | } 16 | -------------------------------------------------------------------------------- /test/rendering/cross_stylesheet_variable.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 11 | 14 | world 15 | 16 | [absolute path] 17 | shape 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /test/rendering/cross_stylesheet_variable_a.mss: -------------------------------------------------------------------------------- 1 | @b: #f00; 2 | -------------------------------------------------------------------------------- /test/rendering/cross_stylesheet_variable_b.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | polygon-fill: @b; 3 | } 4 | -------------------------------------------------------------------------------- /test/rendering/data_only.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [], 4 | "Layer": [{ 5 | "id": "world", 6 | "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", 7 | "Datasource": { 8 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 9 | "type": "shape" 10 | } 11 | }] 12 | } 13 | -------------------------------------------------------------------------------- /test/rendering/data_only.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /test/rendering/empty_style.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "empty_style.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/empty_style.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | ::outline { 3 | line-color: #000000; 4 | } 5 | ::fill { 6 | line-color: #ffffff; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test/rendering/empty_style.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 11 | 16 | 18 | world-outline 19 | world-fill 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /test/rendering/empty_url.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "empty_url.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/empty_url.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | marker-file:url(""); 3 | } 4 | -------------------------------------------------------------------------------- /test/rendering/empty_url.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 11 | 13 | world 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /test/rendering/external_image.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "external_image.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/external_image.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | polygon-pattern-file: url('http://a.tile.openstreetmap.org/0/0/0.png'); 3 | } 4 | -------------------------------------------------------------------------------- /test/rendering/external_image.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 11 | 14 | world 15 | 16 | [absolute path] 17 | shape 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /test/rendering/fadeout.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "fadeout.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/fadeout.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | marker-fill: fadeout(#000, 50%); 3 | } 4 | -------------------------------------------------------------------------------- /test/rendering/fadeout.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 11 | 13 | world 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /test/rendering/field.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "field.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/field.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | text-name: "hello " + [NAME] + " hello"; 3 | text-size: 11; 4 | text-face-name: "Georgia Regular", "Arial Italic"; 5 | } 6 | 7 | -------------------------------------------------------------------------------- /test/rendering/field.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 14 | 16 | world 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /test/rendering/field_advanced.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "field_advanced.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/field_advanced.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | text-name: "hello " + [NAME] + " hello" + 2; 3 | text-size: 11; 4 | text-face-name: "Georgia Regular", "Arial Italic"; 5 | } 6 | 7 | -------------------------------------------------------------------------------- /test/rendering/field_advanced.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 14 | 16 | world 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /test/rendering/filter_comparing_fields.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "filter_comparing_fields.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "class": "world", 9 | "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", 10 | "Datasource": { 11 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 12 | "type": "shape" 13 | } 14 | }] 15 | } 16 | -------------------------------------------------------------------------------- /test/rendering/filter_comparing_fields.mss: -------------------------------------------------------------------------------- 1 | #world[[FOO] = [BAR]] { 2 | polygon-fill: #FFF; 3 | line-color:#F00; 4 | line-width: 0.5; 5 | } 6 | 7 | #world[[BAR] = [HI]] { 8 | polygon-fill: #FFF; 9 | line-color:#F00; 10 | line-width: 0.5; 11 | } 12 | 13 | #world[[BAR] = [HI]] { 14 | polygon-fill: #FFF; 15 | line-color:#F00; 16 | line-width: 5; 17 | } 18 | 19 | #world[[BAR] > [HI]] { 20 | polygon-fill: #FFF; 21 | line-color:#F00; 22 | line-width: 5; 23 | } 24 | -------------------------------------------------------------------------------- /test/rendering/filterexp.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "filterexp.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/filterexp.mss: -------------------------------------------------------------------------------- 1 | #world [a = 1.2e3][b = 1.2e-3][c = 1.2e+3] { polygon-fill:#fff; } 2 | -------------------------------------------------------------------------------- /test/rendering/filterexp.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 14 | world 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /test/rendering/filterquote.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "filterquote.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/filterquote.mss: -------------------------------------------------------------------------------- 1 | #world[name2=" Sa'ad"] { 2 | polygon-fill:#fff; 3 | } 4 | -------------------------------------------------------------------------------- /test/rendering/filterquote.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 14 | world 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /test/rendering/filters.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "filters.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/filters.mss: -------------------------------------------------------------------------------- 1 | #world[[POP2005] > 100.1] { 2 | polygon-fill: #FFF; 3 | line-color:#F00; 4 | line-width: 0.5; 5 | } 6 | -------------------------------------------------------------------------------- /test/rendering/filters.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 13 | 15 | world 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /test/rendering/filtervariable.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "filtervariable.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/filtervariable.mss: -------------------------------------------------------------------------------- 1 | @us: 'US'; 2 | @thing: [COUNTRY]; 3 | 4 | #world[COUNTRY=@us] { 5 | polygon-fill: #000; 6 | } 7 | #world[@thing != 'US'] { 8 | polygon-fill: #f00; 9 | } 10 | -------------------------------------------------------------------------------- /test/rendering/filtervariable.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 16 | 19 | world 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /test/rendering/filtervariable2.mml: -------------------------------------------------------------------------------- 1 | { 2 | "Layer": [ 3 | { 4 | "id": "a" 5 | } 6 | ], 7 | "Stylesheet": [ 8 | "filtervariable2.mss" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /test/rendering/filtervariable2.mss: -------------------------------------------------------------------------------- 1 | Map { } 2 | @x: 'X'; 3 | [CODE!=@x] { 4 | line-color: red; 5 | [zoom>=15] { line-color: green; } 6 | } 7 | -------------------------------------------------------------------------------- /test/rendering/filtervariable2.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 18 | 20 | a 21 | 22 | 23 | -------------------------------------------------------------------------------- /test/rendering/gray_function.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "gray_function.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/gray_function.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | polygon-fill:gray; 3 | } 4 | -------------------------------------------------------------------------------- /test/rendering/gray_function.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 11 | 13 | world 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /test/rendering/highzooms.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "highzooms.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/highzooms.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | polygon-fill: #000; 3 | [zoom=22] { polygon-fill: #f00000; } 4 | [zoom=21] { polygon-fill: #0f0000; } 5 | [zoom=20] { polygon-fill: #00f000; } 6 | [zoom=19] { polygon-fill: #000f00; } 7 | [zoom=18] { polygon-fill: #0000f0; } 8 | [zoom=17] { polygon-fill: #00000f; } 9 | } 10 | -------------------------------------------------------------------------------- /test/rendering/identity.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "identity.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/identity.mss: -------------------------------------------------------------------------------- 1 | #world[foo='bar'] { 2 | #world[foo='bar'] { 3 | marker-width: 5; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /test/rendering/identity.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 14 | world 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /test/rendering/image_filters.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "image_filters.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/image_filters.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | polygon-fill: #FFF; 3 | line-color:#F00; 4 | line-width: 0.5; 5 | image-filters: blur(), sharpen(), agg-stack-blur(2, 2); 6 | comp-op: src-in; 7 | line-dasharray: 2, 3; 8 | } 9 | -------------------------------------------------------------------------------- /test/rendering/image_filters.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 14 | world 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /test/rendering/imagefilter-duplication.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "imagefilter-duplication.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/imagefilter-duplication.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | image-filters:agg-stack-blur(3,3); 3 | [zoom=2] { line-width: 3; } 4 | [zoom=3] { line-width: 5; } 5 | } 6 | -------------------------------------------------------------------------------- /test/rendering/instance_names.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "instance_names.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/instance_names.mss: -------------------------------------------------------------------------------- 1 | #world[zoom >= 13] { 2 | center/line-width: 1; 3 | center/line-color: black; 4 | } 5 | 6 | #world[zoom >= 14] { 7 | center/line-width: 5; 8 | center/line-color: blue; 9 | } 10 | 11 | #world[highway='primary'][zoom >= 14] { 12 | dash/line-color: red; 13 | dash/line-width: 15; 14 | dash/line-dasharray: 5,15; 15 | } 16 | -------------------------------------------------------------------------------- /test/rendering/issue294.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [], 4 | "Layer": [{ 5 | "id": "world", 6 | "Datasource": { 7 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 8 | "type": "shape" 9 | } 10 | }] 11 | } 12 | -------------------------------------------------------------------------------- /test/rendering/issue294.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /test/rendering/issue32.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "issue32a.mss", 5 | "issue32.mss" 6 | ], 7 | "Layer": [{ 8 | "id": "world", 9 | "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", 10 | "Datasource": { 11 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 12 | "type": "shape" 13 | } 14 | }] 15 | } 16 | -------------------------------------------------------------------------------- /test/rendering/issue32.mss: -------------------------------------------------------------------------------- 1 | Map { 2 | background-color: #aaaaff; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /test/rendering/issue32a.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | ::outline { 3 | line-color: #000000; 4 | line-width: 8.0; 5 | } 6 | line-color: #ffffff; 7 | line-width: 6.0; 8 | } 9 | -------------------------------------------------------------------------------- /test/rendering/issue60.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "issue60.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/issue60.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | [NET_INFLOW > -30000] { polygon-fill: #f00; } 3 | [NET_INFLOW > -10000] { polygon-fill: #0f0; } 4 | } 5 | 6 | #world [OBJECTID=12] { polygon-pattern-file:url(../resources/textures/stripe.png); } 7 | -------------------------------------------------------------------------------- /test/rendering/issue_100_filters.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "issue_100_filters.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/issue_100_filters.mss: -------------------------------------------------------------------------------- 1 | #world[zoom>10][area>16000000], 2 | #world[zoom>11][area>4000000], 3 | #world[zoom>12][area>1000000], 4 | #world[zoom>13][area>500000], 5 | #world[zoom>14][area>250000], 6 | #world[zoom>15][area>125000], 7 | #world[zoom>16][area>62500], 8 | #world[zoom>17] { 9 | text-name:'[name]'; 10 | text-face-name:'Helvetica'; 11 | text-halo-fill:#fff; 12 | text-halo-radius:2; 13 | text-placement:interior; 14 | text-size:11; 15 | text-wrap-width:20; 16 | } 17 | -------------------------------------------------------------------------------- /test/rendering/issue_121.mss: -------------------------------------------------------------------------------- 1 | #filtertest[[a] > [b]] { 2 | marker-fill: #ff0000; 3 | } 4 | 5 | #filtertest[[a] > [b] * 2] { 6 | marker-fill: #00ff00; 7 | } 8 | 9 | #filtertest[[a] > 10 * 2] { 10 | marker-fill: #0000ff; 11 | } 12 | -------------------------------------------------------------------------------- /test/rendering/issue_239_a.mss: -------------------------------------------------------------------------------- 1 | // Only the coastlines should be visible, 2 | // not land boundaries. 3 | #countries::outline { 4 | line-color: #024; 5 | line-width: 2; 6 | line-join: round; 7 | } -------------------------------------------------------------------------------- /test/rendering/issue_239_b.mss: -------------------------------------------------------------------------------- 1 | // This attachment should cover most of the outlines 2 | #countries::fill { 3 | polygon-fill: #ace; 4 | polygon-gamma: 0.3; 5 | } 6 | -------------------------------------------------------------------------------- /test/rendering/issue_273.mss: -------------------------------------------------------------------------------- 1 | .countries-and-states { 2 | line-color: #024; 3 | line-width: 2; 4 | line-join: round; 5 | } 6 | -------------------------------------------------------------------------------- /test/rendering/issue_291.mss: -------------------------------------------------------------------------------- 1 | .a { 2 | line-width: 1; 3 | .b { 4 | line-width: 8; 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /test/rendering/issue_296.mml: -------------------------------------------------------------------------------- 1 | { 2 | "Stylesheet": [ 3 | "issue_296.mss" 4 | ], 5 | "Layer": [ 6 | { 7 | "id": "world" 8 | }, 9 | { 10 | "id": "sea" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /test/rendering/issue_296.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | polygon-fill: grey; 3 | [data_column = null] { polygon-fill: red; polygon-opacity: 0.5; } 4 | [data_column >= 100] { polygon-fill: blue; } 5 | } 6 | 7 | #sea { 8 | polygon-fill: grey; 9 | [data_column = null] { polygon-fill: red; } 10 | [data_column >= 100] { polygon-fill: blue; } 11 | } 12 | -------------------------------------------------------------------------------- /test/rendering/issue_333.mml: -------------------------------------------------------------------------------- 1 | { 2 | "Stylesheet": [ 3 | "issue_333.mss" 4 | ], 5 | "Layer": [ 6 | { 7 | "id": "world" 8 | } 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /test/rendering/issue_333.mss: -------------------------------------------------------------------------------- 1 | @fonts-a: "Arial", "Helvetica Neue"; 2 | @fonts-b: "Roboto", @fonts-a; 3 | 4 | #world { 5 | text-face-name: @fonts-b; 6 | text-name: [title]; 7 | text-size: 11; 8 | } 9 | -------------------------------------------------------------------------------- /test/rendering/issue_333.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 14 | 15 | world 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /test/rendering/issue_338.mml: -------------------------------------------------------------------------------- 1 | { 2 | "Stylesheet": [ 3 | "issue_338.mss" 4 | ], 5 | "Layer": [ 6 | { 7 | "id": "world" 8 | } 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /test/rendering/issue_338.mss: -------------------------------------------------------------------------------- 1 | @var: 'foo'; 2 | @var: 'oof'; 3 | 4 | #world { 5 | text-face-name: 'Arial'; 6 | text-name: @var + 'bar'; 7 | } 8 | -------------------------------------------------------------------------------- /test/rendering/issue_338.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | world 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /test/rendering/issue_348.mml: -------------------------------------------------------------------------------- 1 | { 2 | "name": "", 3 | "test": null, 4 | "scale": 1, 5 | "Stylesheet": [ 6 | ], 7 | "Layer": [ 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /test/rendering/issue_348.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 1 6 | 7 | 8 | -------------------------------------------------------------------------------- /test/rendering/issue_394.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | line-width: 2; 3 | line-color: #024; 4 | } 5 | -------------------------------------------------------------------------------- /test/rendering/issue_394_api2.3.0.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "issue_394.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | }, 13 | "properties": { 14 | "minzoom": 7, 15 | "maxzoom": 9 16 | } 17 | }] 18 | } 19 | -------------------------------------------------------------------------------- /test/rendering/issue_394_api2.3.0.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 11 | 15 | world 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /test/rendering/issue_394_api3.0.0.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "issue_394.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | }, 13 | "properties": { 14 | "minzoom": 7, 15 | "maxzoom": 9 16 | } 17 | }] 18 | } 19 | -------------------------------------------------------------------------------- /test/rendering/issue_394_api3.0.0.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 11 | 15 | world 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /test/rendering/issue_411.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "issue_411.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "test", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/issue_411.mss: -------------------------------------------------------------------------------- 1 | #test { 2 | [zoom >= 3][way_pixels > 0.00000010000][way_pixels < 0.00003600000] { 3 | text-name: "[name]"; 4 | text-size: 10; 5 | [zoom >= 4] { 6 | text-size: 11; 7 | } 8 | text-fill: #ff0000; 9 | text-face-name: 'Arial'; 10 | } 11 | [zoom >= 3][render = '1_outline'] { 12 | text-name: "[name]"; 13 | text-size: 12; 14 | text-fill: #ff0000; 15 | text-face-name: 'Arial'; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /test/rendering/issue_469.mml: -------------------------------------------------------------------------------- 1 | { 2 | "Stylesheet": [ 3 | "issue_469.mss" 4 | ], 5 | "Layer": [ 6 | { 7 | "properties": { 8 | "minzoom": 4, 9 | "maxzoom": 8 10 | }, 11 | "id": "place", 12 | "class": "place" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /test/rendering/issue_469.mss: -------------------------------------------------------------------------------- 1 | .place { 2 | [type="continent"][zoom <= 2] { 3 | text-name: "[name]"; 4 | text-face-name: "Arial"; 5 | text-size: 12; 6 | } 7 | [type="country"][zoom <= 3] { 8 | text-name: "[name]"; 9 | text-face-name: "Arial"; 10 | text-size: 10; 11 | } 12 | [type="city"][zoom <= 14] { 13 | [zoom >= 4] { 14 | text-name: "[name]"; 15 | text-face-name: "Arial"; 16 | text-size: 10; 17 | } 18 | [zoom >= 9] { text-size: 12; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /test/rendering/issue_469.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 15 | place 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /test/rendering/layer_nodatasource.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "layer_nodatasource.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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" 9 | }] 10 | } 11 | -------------------------------------------------------------------------------- /test/rendering/layer_nodatasource.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | polygon-fill: green; 3 | line-color: hsl(30, 40%, 90%); 4 | } 5 | -------------------------------------------------------------------------------- /test/rendering/layer_nodatasource.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 14 | world 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /test/rendering/layer_properties.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "layer_properties.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "properties": { 10 | "cache-features": "true" 11 | }, 12 | "Datasource": { 13 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 14 | "type": "shape" 15 | } 16 | }] 17 | } 18 | -------------------------------------------------------------------------------- /test/rendering/layer_properties.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | polygon-fill: green; 3 | line-color: hsl(30, 40%, 90%); 4 | } 5 | -------------------------------------------------------------------------------- /test/rendering/layer_properties.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 15 | world 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /test/rendering/mapnik_keyword.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "mapnik_keyword.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/mapnik_keyword.mss: -------------------------------------------------------------------------------- 1 | #world[[FOO]=null] { 2 | line-width:2; 3 | } 4 | -------------------------------------------------------------------------------- /test/rendering/mapnik_keyword.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 14 | world 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /test/rendering/modulus.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "modulus.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/modulus.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | text-name: "hello "; 3 | text-size: 11 % 2; 4 | text-face-name: "Georgia Regular", "Arial Italic"; 5 | } 6 | 7 | -------------------------------------------------------------------------------- /test/rendering/modulus.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 14 | 16 | world 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /test/rendering/multiple_symbolizers.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "multiple_symbolizers.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/multiple_symbolizers.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | polygon-fill: #fff; 3 | line-width: 2; 4 | alternate/line-color: #f00; 5 | } 6 | -------------------------------------------------------------------------------- /test/rendering/multiple_symbolizers.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 13 | 16 | world 17 | 18 | [absolute path] 19 | shape 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /test/rendering/nesting_class.mss: -------------------------------------------------------------------------------- 1 | /* Applies to all layers with .land class */ 2 | .land { 3 | line-color: #ccc; 4 | line-width: 0.5; 5 | polygon-fill: #eee; 6 | /* Applies to #lakes.land */ 7 | #lakes { 8 | polygon-fill: #000; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /test/rendering/nominzoom.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "nominzoom.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/nominzoom.mss: -------------------------------------------------------------------------------- 1 | #world[zoom < 5] { 2 | polygon-fill: #000; 3 | } 4 | -------------------------------------------------------------------------------- /test/rendering/nominzoom.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 14 | world 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /test/rendering/noquote_font.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "noquote_font.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/noquote_font.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | text-name: 'foo'; 3 | text-face-name: Helvetica; 4 | } 5 | -------------------------------------------------------------------------------- /test/rendering/noquote_font.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 11 | 13 | world 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /test/rendering/parameters.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "bounds": [-180,-85,180,85], 4 | "center": [-78,40,8], 5 | "name": "Parameters", 6 | "description": "Mapnik parameter test.", 7 | "legend": "

This is HTML.

", 8 | "attribution": "OpenStreetMap", 9 | "template": "{{NAME}}", 10 | "minzoom": 0, 11 | "maxzoom": 12, 12 | "version": "1.0.0", 13 | "format": "png", 14 | "interactivity": { 15 | "layer": "world", 16 | "fields": ["NAME"] 17 | }, 18 | "customString": "Hello world", 19 | "customNumber": 5, 20 | "customBoolean": true, 21 | "customOmitted": { "foo": "bar" }, 22 | "Stylesheet": [], 23 | "Layer": [] 24 | } 25 | -------------------------------------------------------------------------------- /test/rendering/partial_overrides.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "partial_overrides.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "class": "m_0 m_1 m_2 m_3 m_4 m_5 m_6 m_7 m_8 m_9", 9 | "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", 10 | "Datasource": { 11 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 12 | "type": "shape" 13 | } 14 | }] 15 | } 16 | -------------------------------------------------------------------------------- /test/rendering/partial_overrides.mss: -------------------------------------------------------------------------------- 1 | #world.m_0 { 2 | line-width: 3; 3 | } 4 | 5 | #world.m_1[zoom > 2] { 6 | line-opacity: .2; 7 | } 8 | 9 | #world.m_2[zoom > 8] { 10 | line-opacity: .4; 11 | } 12 | 13 | #world.m_3[NAME!="Canada"] { 14 | line-width: 5; 15 | } 16 | 17 | #world.m_4[NAME="United States"] { 18 | line-color: #f00; 19 | } 20 | 21 | #world.m_6[NAME!="Canada"][zoom > 5] { 22 | line-opacity: .7; 23 | } 24 | 25 | #world.m_7[NAME!="Canada"][POP > 100000000] { 26 | line-width:20; 27 | } 28 | 29 | #world.m_8[NAME="United States"][zoom > 8] { 30 | line-opacity: .5; 31 | } 32 | 33 | #world.m_9[NAME="United States"][zoom > 8][zoom < 4] { 34 | line-opacity: .5; 35 | } 36 | -------------------------------------------------------------------------------- /test/rendering/raster-mesh-size.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "raster-mesh-size.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "data", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/nasa_raster/lasvegas_tm5_12jan09_crop_geo_merc.tif", 11 | "type": "gdal" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/raster-mesh-size.mss: -------------------------------------------------------------------------------- 1 | #data { 2 | raster-opacity: 1; 3 | raster-mesh-size: 1; 4 | } 5 | -------------------------------------------------------------------------------- /test/rendering/raster-mesh-size.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 11 | 14 | data 15 | 16 | [absolute path] 17 | gdal 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /test/rendering/raster.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "raster.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "data", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/nasa_raster/lasvegas_tm5_12jan09_crop_geo_merc.tif", 11 | "type": "gdal" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/raster.mss: -------------------------------------------------------------------------------- 1 | #data { 2 | raster-opacity: 1; 3 | raster-comp-op: hard-light; 4 | } 5 | -------------------------------------------------------------------------------- /test/rendering/raster.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 11 | 14 | data 15 | 16 | [absolute path] 17 | gdal 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /test/rendering/raster_colorizer.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "raster_colorizer.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/raster_colorizer.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | raster-opacity:1; 3 | raster-scaling:bilinear; 4 | raster-colorizer-default-mode: linear; 5 | raster-colorizer-default-color: transparent; 6 | raster-colorizer-stops: 7 | stop(0,#000) 8 | stop(1000, #00f) 9 | stop(2000, #0ff) 10 | stop(3000, #ff0) 11 | stop(4000, #f00); 12 | } 13 | -------------------------------------------------------------------------------- /test/rendering/raster_colorizer_comma.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "raster_colorizer_comma.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/raster_colorizer_comma.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | raster-colorizer-stops: 3 | stop(0,#000) 4 | stop(1000, #00f) 5 | stop(2000, #0ff) 6 | stop(3000, #ff0) 7 | stop(4000, #f00); 8 | } 9 | -------------------------------------------------------------------------------- /test/rendering/raster_colorizer_onestop.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "raster_colorizer_onestop.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/raster_colorizer_onestop.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | raster-opacity:1; 3 | raster-scaling:bilinear; 4 | raster-colorizer-default-mode: linear; 5 | raster-colorizer-default-color: transparent; 6 | raster-colorizer-stops: stop(0,#000); 7 | } 8 | -------------------------------------------------------------------------------- /test/rendering/raster_colorizer_onestop.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 14 | world 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /test/rendering/rastercolorizer.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "rastercolorizer.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/rastercolorizer.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | raster-opacity:0; 3 | raster-colorizer-default-mode:discrete; 4 | raster-colorizer-default-color:#f00; 5 | raster-colorizer-epsilon:0.05; 6 | raster-colorizer-stops: 7 | stop(5, #f00) 8 | stop(10, #f40, linear) 9 | stop(10, #f80); 10 | } -------------------------------------------------------------------------------- /test/rendering/rastercolorizer.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 14 | 16 | world 17 | 18 | [absolute path] 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /test/rendering/regex.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "regex.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/regex.mss: -------------------------------------------------------------------------------- 1 | #world[ISO =~ "U*"] { 2 | polygon-fill: #FFF; 3 | line-color:#F00; 4 | line-width: 0.5; 5 | } 6 | -------------------------------------------------------------------------------- /test/rendering/regex.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 13 | 15 | world 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /test/rendering/regex_nest.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "regex_nest.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "railway", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/regex_nest.mss: -------------------------------------------------------------------------------- 1 | #railway[foo='bar'] { 2 | [name =~ "East.*"] { 3 | line-color: green; 4 | line-width: 4; 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /test/rendering/regex_nest.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 14 | railway 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /test/rendering/selector_comment.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "selector_comment.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }, { 14 | "id": "countries", 15 | "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", 16 | "Datasource": { 17 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 18 | "type": "shape" 19 | } 20 | }] 21 | } 22 | -------------------------------------------------------------------------------- /test/rendering/selector_comment.mss: -------------------------------------------------------------------------------- 1 | #world, 2 | // bar 3 | // blah 4 | #countries { 5 | marker-width:4; 6 | } 7 | -------------------------------------------------------------------------------- /test/rendering/sharedclass.mss: -------------------------------------------------------------------------------- 1 | .a { 2 | polygon-fill: #f00; 3 | } 4 | 5 | .b { 6 | line-color: #0f0; 7 | } 8 | 9 | .c { 10 | marker-fill: #00f; 11 | } 12 | -------------------------------------------------------------------------------- /test/rendering/simplefontset.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "simplefontset.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/simplefontset.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | text-name: "[NAME]"; 3 | text-size: 11; 4 | text-face-name: "Georgia Regular", "Arial Italic"; 5 | } 6 | -------------------------------------------------------------------------------- /test/rendering/simplefontset.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 14 | 17 | world 18 | 19 | [absolute path] 20 | shape 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /test/rendering/simplevariabletest.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "simplevariabletest.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/simplevariabletest.mss: -------------------------------------------------------------------------------- 1 | @worldbackground: #fff; 2 | 3 | #world { 4 | polygon-fill: @worldbackground; 5 | } 6 | -------------------------------------------------------------------------------- /test/rendering/simplevariabletest.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 11 | 14 | world 15 | 16 | [absolute path] 17 | shape 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /test/rendering/style_fold.mml: -------------------------------------------------------------------------------- 1 | { 2 | "Layer": [ 3 | { 4 | "id": "a" 5 | } 6 | ], 7 | "Stylesheet": [ 8 | "style_fold.mss" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /test/rendering/style_fold.mss: -------------------------------------------------------------------------------- 1 | Map { } 2 | #a { 3 | [x = 'X'] { 4 | #a { 5 | line-cap: round; 6 | } 7 | } 8 | [y = 'Y'] { 9 | line-width: 2; 10 | #a { 11 | line-cap: round; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/style_fold.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 16 | 18 | a 19 | 20 | 21 | -------------------------------------------------------------------------------- /test/rendering/style_level_opacity.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "style_level_opacity.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/style_level_opacity.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | opacity:0.2; 3 | text-name: "[NAME]"; 4 | text-size: 11; 5 | text-face-name: "Georgia Regular", "Arial Italic"; 6 | } 7 | -------------------------------------------------------------------------------- /test/rendering/style_level_opacity.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 14 | 16 | world 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /test/rendering/support4504.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "support4504.mss" 5 | ], 6 | "Layer": [{ 7 | "class": "new", 8 | "id": "countries", 9 | "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", 10 | "Datasource": { 11 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 12 | "type": "shape" 13 | } 14 | }] 15 | } 16 | -------------------------------------------------------------------------------- /test/rendering/support4504.mss: -------------------------------------------------------------------------------- 1 | @z13: 19; 2 | @num_pixels: 50; 3 | @z13area: @z13 * @z13 * @num_pixels; 4 | 5 | #countries[way_area > @z13area] { 6 | polygon-opacity:0.2; 7 | } 8 | -------------------------------------------------------------------------------- /test/rendering/support4504.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 14 | countries 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /test/rendering/symbolizer_order.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "symbolizer_order.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/symbolizer_order.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | polygon-fill: #fff; 3 | line-width: 2; 4 | } 5 | -------------------------------------------------------------------------------- /test/rendering/symbolizer_order.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 15 | world 16 | 17 | [absolute path] 18 | shape 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /test/rendering/text_property_overrides.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "text_property_overrides.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "class": "m_0 m_1 m_2 m_3 m_4 m_5 m_6 m_7 m_8 m_9", 9 | "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", 10 | "Datasource": { 11 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 12 | "type": "shape" 13 | } 14 | }] 15 | } 16 | -------------------------------------------------------------------------------- /test/rendering/text_property_overrides.mss: -------------------------------------------------------------------------------- 1 | #world[zoom>3] { 2 | text-name:"[COUNTRY]"; 3 | text-face-name:"DejaVu Sans Book"; 4 | text-fill:#000; 5 | text-size:9; 6 | } 7 | #world[zoom=5] { text-size:10; } 8 | #world[zoom=6] { text-size:11; } 9 | #world[zoom=7] { text-size:12; } 10 | -------------------------------------------------------------------------------- /test/rendering/transforms.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "transforms.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/transforms.mss: -------------------------------------------------------------------------------- 1 | @trans: 2; 2 | #world { 3 | point-file: url(foo.png); 4 | point-transform: translate( @trans * 2, @trans); 5 | marker-width: 2; 6 | marker-transform: scale(2); 7 | } 8 | -------------------------------------------------------------------------------- /test/rendering/transforms.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 14 | world 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /test/rendering/transforms_backwards.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "transforms_backwards.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/transforms_backwards.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | point-file: url(foo.png); 3 | point-transform: "translate(2, 2), scale(2, 2)"; 4 | } 5 | -------------------------------------------------------------------------------- /test/rendering/transforms_backwards.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 11 | 13 | world 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /test/rendering/transforms_field.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "transforms_field.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/transforms_field.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | point-file:url(foo.png); 3 | point-transform: scale(2 * 5 * [POP2005], [POP2005]), rotate(10,1,-1); 4 | } 5 | -------------------------------------------------------------------------------- /test/rendering/transforms_field.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 11 | 13 | world 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /test/rendering/transforms_single.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "transforms_single.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/transforms_single.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | point-transform: scale(2, 2); 3 | } 4 | -------------------------------------------------------------------------------- /test/rendering/transforms_single.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 11 | 13 | world 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /test/rendering/units.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "units.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/units.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | line-width: 2mm; 3 | marker-width: 2pc; 4 | marker-height: 5pt; 5 | building-height: 10cm; 6 | } 7 | -------------------------------------------------------------------------------- /test/rendering/units.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 13 | 15 | world 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /test/rendering/unsigned.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "unsigned.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/unsigned.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | text-size:10.5; 3 | text-ratio:2.1; 4 | text-wrap-width:5; 5 | text-spacing:12.1; 6 | text-name:[FOO]; 7 | text-face-name:'Foo'; 8 | } 9 | -------------------------------------------------------------------------------- /test/rendering/unsigned.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 11 | 13 | world 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /test/rendering/var_concat.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "var_concat.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/var_concat.mss: -------------------------------------------------------------------------------- 1 | @var: 'foo'; 2 | 3 | #world { 4 | text-face-name: 'Helvetica'; 5 | text-name: @var + ' bar'; 6 | } 7 | -------------------------------------------------------------------------------- /test/rendering/var_concat.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 11 | 13 | world 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /test/rendering/weird_comments.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "weird_comments.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/weird_comments.mss: -------------------------------------------------------------------------------- 1 | #world { polygon-fill: #A22; } 2 | /* comment */ 3 | /* 4 | #world { line-opacity:0.5; } 5 | #world { line-width:10; } 6 | #world { line-color:#0ff; } 7 | */ 8 | 9 | /* *//* { *//* *//* *//* */#world { polygon-fill:#A33; }/* } */ 10 | 11 | 12 | /* { *//* [ ] *//* *//* { } *//* #world { polygon-fill:#a00; } */ -------------------------------------------------------------------------------- /test/rendering/weird_comments.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 13 | world 14 | 15 | [absolute path] 16 | shape 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /test/rendering/weird_comments_2.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "weird_comments_2.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/weird_comments_2.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | [ne_10m_adm = 'GBR'], /* United Kingdom */ 3 | [ne_10m_adm = 'FRA'] /* France */ 4 | { 5 | polygon-fill: #fff; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /test/rendering/weird_comments_2.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 16 | 18 | world 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /test/rendering/weird_simple_comments.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "weird_simple_comments.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/rendering/weird_simple_comments.mss: -------------------------------------------------------------------------------- 1 | #world { one/marker-file: url(http://upload.wikimedia.org/wikipedia/commons/7/72/Cup_of_coffee.svg); two/marker-file: url('http://upload.wikimedia.org/wikipedia/commons/7/72/Cup_of_coffee.svg'); three/marker-file: url(http://upload.wikimedia.org/wikipedia/en/c/ce/SVG-logo.svg); four/marker-file: url("http://a.tiles.mapbox.com/v3/marker/pin-m-fast-food+AA0000.png"); } 2 | -------------------------------------------------------------------------------- /test/rendering/weird_simple_comments.result: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 14 | 16 | world 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /test/rendering/zoomlevels.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "zoomlevels.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }, 14 | { 15 | "id": "countries", 16 | "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", 17 | "Datasource": { 18 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 19 | "type": "shape" 20 | } 21 | }] 22 | } 23 | -------------------------------------------------------------------------------- /test/rendering/zoomlevels.mss: -------------------------------------------------------------------------------- 1 | #world[zoom=9] { 2 | polygon-fill: #000; 3 | 4 | [zoom > 9] { 5 | polygon-fill: #FFF; 6 | } 7 | } 8 | 9 | #world[zoom<4] { 10 | polygon-fill: #FF0; 11 | } 12 | 13 | #world[zoom > 9][zoom <= 11] { 14 | polygon-fill: #DDD; 15 | } 16 | 17 | #countries { 18 | [zoom=1] { line-width:2; } 19 | [zoom=2] { line-width:1.5; } 20 | [zoom=3], [zoom=4] { line-width:1.25; } 21 | [zoom=5] { line-width:1; } 22 | [zoom=6] { line-width:0.9; } 23 | [zoom=7] { line-width:0.8; } 24 | [zoom=8] { line-width:0.7; } 25 | [zoom=9] { line-width:.6; } 26 | [zoom=10] { line-width:.5; } 27 | [zoom=11] { line-width:.4; } 28 | [zoom=12] { line-width:.3; } 29 | [zoom>12] { line-width:.25; } 30 | } 31 | -------------------------------------------------------------------------------- /test/rendering/zoomselector.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "zoomselector.mss" 5 | ], 6 | "Layer": [{ 7 | "id": "world", 8 | "class": "", 9 | "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", 10 | "Datasource": { 11 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 12 | "type": "shape" 13 | } 14 | }] 15 | } 16 | -------------------------------------------------------------------------------- /test/rendering/zoomselector.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | [zoom=9] { marker-height: 4; } 3 | [zoom>6][zoom<10] { marker-height: 3; } 4 | [zoom>3][zoom<7] { marker-height: 2; } 5 | [zoom<4] { marker-height: 1; } 6 | } 7 | -------------------------------------------------------------------------------- /test/rule.test.js: -------------------------------------------------------------------------------- 1 | var assert = require('assert'); 2 | var tree = require('../lib/carto/tree.js'); 3 | 4 | describe('Rule', function() { 5 | describe('To string', function() { 6 | it('with zoom', function() { 7 | const rule = new tree.Rule(new tree.Reference(null), 'name', 'value', 'index', 'filename'); 8 | rule.zoom = (new tree.Zoom()).setZoom((1 << 2 | 1 << 3 | 1 << 4)) 9 | assert.equal(rule.toString(), '[..XXX.....................] name: value') 10 | }); 11 | it('without zoom', function() { 12 | const rule = new tree.Rule(new tree.Reference(null), 'name', 'value', 'index', 'filename'); 13 | assert.equal(rule.toString(), '[..........................] name: value') 14 | }); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /test/specificity/classes.mss: -------------------------------------------------------------------------------- 1 | .baz .bar {} 2 | .foo {} 3 | .bar {} 4 | .foo .bar .baz {} 5 | .baz {} 6 | .baz .foo {} 7 | .foo .baz {} 8 | -------------------------------------------------------------------------------- /test/specificity/classes.result: -------------------------------------------------------------------------------- 1 | [ 2 | {"elements":[".foo",".bar",".baz"],"specificity":[0,3,0,29],"matchCount": 0}, 3 | {"elements":[".foo",".baz"],"specificity":[0,2,0,68],"matchCount": 0}, 4 | {"elements":[".baz",".foo"],"specificity":[0,2,0,55],"matchCount": 0}, 5 | {"elements":[".baz",".bar"],"specificity":[0,2,0,0],"matchCount": 0}, 6 | {"elements":[".baz"],"specificity":[0,1,0,47],"matchCount": 0}, 7 | {"elements":[".bar"],"specificity":[0,1,0,21],"matchCount": 0}, 8 | {"elements":[".foo"],"specificity":[0,1,0,13],"matchCount": 0} 9 | ] 10 | -------------------------------------------------------------------------------- /test/specificity/demo.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | polygon-fill:#CCC; 3 | } 4 | 5 | #world[NAME='United States'] { 6 | polygon-fill:#F00; 7 | 8 | [BLUE='red'] { 9 | 10 | } 11 | 12 | } 13 | 14 | #countries .countries .two { 15 | polygon-fill:#0FF; 16 | } 17 | 18 | #countries, #world { 19 | polygon-fill:#F0F; 20 | polygon-opacity: 0.5; 21 | } 22 | 23 | 24 | #countries, #countries.foo.bar.baz {} 25 | -------------------------------------------------------------------------------- /test/specificity/demo.result: -------------------------------------------------------------------------------- 1 | [ 2 | {"elements":["#countries",".foo",".bar",".baz"],"specificity":[1,3,0,241],"matchCount": 0}, 3 | {"elements":["#countries",".countries",".two"],"specificity":[1,2,0,149],"matchCount": 0}, 4 | {"elements":["#world"],"filters":["[NAME]=United States","[BLUE]=red"],"specificity":[1,0,2,90],"matchCount": 0}, 5 | {"elements":["#world"],"filters":["[NAME]=United States"],"specificity":[1,0,1,66],"matchCount": 0}, 6 | {"elements":["#countries"],"specificity":[1,0,0,241],"matchCount": 0}, 7 | {"elements":["#countries"],"specificity":[1,0,0,194],"matchCount": 0}, 8 | {"elements":["#world"],"specificity":[1,0,0,194],"matchCount": 0}, 9 | {"elements":["#world"],"specificity":[1,0,0,11],"matchCount": 0} 10 | ] 11 | -------------------------------------------------------------------------------- /test/specificity/filters_and_ids.mss: -------------------------------------------------------------------------------- 1 | #world [NAME='Canada'] {} 2 | #world [NAME='United States'] { 3 | [zoom > 5] {} 4 | } 5 | #world #countries [NAME='United States'] {} 6 | [NAME='United States'] {} 7 | [zoom > 5] {} -------------------------------------------------------------------------------- /test/specificity/filters_and_ids.result: -------------------------------------------------------------------------------- 1 | [ 2 | {"elements":["#world","#countries"],"filters":["[NAME]=United States"],"specificity":[2,0,1,94],"matchCount": 0}, 3 | {"elements":["#world"],"filters":["[NAME]=United States"],"zoom":"......XXXXXXXXXXXXXXXXXXXX","specificity":[1,0,2,60],"matchCount": 0}, 4 | {"elements":["#world"],"filters":["[NAME]=United States"],"specificity":[1,0,1,33],"matchCount": 0}, 5 | {"elements":["#world"],"filters":["[NAME]=Canada"],"specificity":[1,0,1,7],"matchCount": 0}, 6 | {"elements":[],"zoom":"......XXXXXXXXXXXXXXXXXXXX","specificity":[0,0,1,146],"matchCount": 0}, 7 | {"elements":[],"filters":["[NAME]=United States"],"specificity":[0,0,1,120],"matchCount": 0} 8 | ] 9 | -------------------------------------------------------------------------------- /test/specificity/issue60.mml: -------------------------------------------------------------------------------- 1 | { 2 | "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", 3 | "Stylesheet": [ 4 | "issue60.mss" 5 | ], 6 | "Layer": [{ 7 | "name": "world", 8 | "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", 9 | "Datasource": { 10 | "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", 11 | "type": "shape" 12 | } 13 | }] 14 | } 15 | -------------------------------------------------------------------------------- /test/specificity/issue60.mss: -------------------------------------------------------------------------------- 1 | #world { 2 | [NET_INFLOW > -30000] { polygon-fill: #f00; } 3 | [NET_INFLOW > -10000] { polygon-fill: #0f0; } 4 | } 5 | 6 | #world [OBJECTID=12] { polygon-pattern-file:url(../resources/textures/stripe.png); } 7 | -------------------------------------------------------------------------------- /test/specificity/issue60.result: -------------------------------------------------------------------------------- 1 | [ 2 | {"elements":["#world"],"filters":["[OBJECTID]=12"],"specificity":[1,0,1,131],"matchCount": 0}, 3 | {"elements":["#world"],"filters":["[NET_INFLOW]>-10000"],"specificity":[1,0,1,83],"matchCount": 0}, 4 | {"elements":["#world"],"filters":["[NET_INFLOW]>-30000"],"specificity":[1,0,1,35],"matchCount": 0}, 5 | {"elements":["#world"],"specificity":[1,0,0,0],"matchCount": 0} 6 | ] 7 | -------------------------------------------------------------------------------- /test/support/.eslintrc.yml: -------------------------------------------------------------------------------- 1 | rules: 2 | no-control-regex: 0 3 | -------------------------------------------------------------------------------- /test/version.test.js: -------------------------------------------------------------------------------- 1 | var carto = require('../lib/carto'); 2 | var path = require('path'); 3 | var assert = require('assert'); 4 | 5 | 6 | describe('Version check', function() { 7 | it('test version matches package.json version and changelog', function() { 8 | var info; 9 | if (parseInt(process.version.split('.')[1], 10) > 4) { 10 | info = require('../package.json'); 11 | assert.deepEqual(info.version.split('.'), carto.version); 12 | } else { 13 | info = JSON.parse(require('fs').readFileSync(path.join(__dirname,'../package.json'))); 14 | assert.deepEqual(info.version.split('.'), carto.version); 15 | } 16 | }); 17 | }); 18 | --------------------------------------------------------------------------------