Comparing version 0.14.1 to 0.15.0
@@ -126,3 +126,3 @@ var _ = require('underscore'); | ||
for (var k = 0, rule, style_name; k < sorted.length; k++) { | ||
rule = sorted[k]; | ||
rule = foldStyle(sorted[k]); | ||
style_name = l.name + (rule.attachment !== '__default__' ? '-' + rule.attachment : ''); | ||
@@ -359,2 +359,15 @@ | ||
// Removes dead style definitions that can never be reached | ||
// when filter-mode="first". The style is modified in-place | ||
// and returned. The style must be sorted. | ||
function foldStyle(style) { | ||
for (var i = 0; i < style.length; i++) { | ||
for (var j = style.length - 1; j > i; j--) { | ||
if (style[j].filters.cloneWith(style[i].filters) === null) | ||
style.splice(j, 1); | ||
} | ||
} | ||
return style; | ||
} | ||
/** | ||
@@ -361,0 +374,0 @@ * Find a rule like Map { background-color: #fff; }, |
@@ -29,2 +29,14 @@ var tree = require('../tree'); | ||
} | ||
// Rebuild the filters dict after var subst. | ||
var result = new tree.Filterset(); | ||
for (var i in this.filters) { | ||
var err = result.add(this.filters[i]); | ||
if (err) { | ||
var filename = this.filters[i].filename; | ||
if (filename) | ||
err = filename + ': ' + err; | ||
throw new Error(err); | ||
} | ||
} | ||
this.filters = result.filters; | ||
return this; | ||
@@ -88,3 +100,3 @@ }; | ||
if (value.match(/^[0-9]+(\.[0-9]*)?$/)) value = parseFloat(value); | ||
if (value.match(/^[+-]?[0-9]+(\.[0-9]*)?$/)) value = parseFloat(value); | ||
@@ -91,0 +103,0 @@ switch (filter.op) { |
{ | ||
"name": "carto", | ||
"version": "0.14.1", | ||
"version": "0.15.0", | ||
"description": "Mapnik Stylesheet Compiler", | ||
@@ -41,3 +41,3 @@ "url": "https://github.com/mapbox/carto", | ||
"underscore": "~1.6.0", | ||
"mapnik-reference": "~7.0.0", | ||
"mapnik-reference": "~8.2.0", | ||
"optimist": "~0.6.0" | ||
@@ -44,0 +44,0 @@ }, |
@@ -14,3 +14,3 @@ # CartoCSS | ||
For users looking to learn how to use TileMill the best places to start are to 1) Download [TileMill](http://mapbox.com/carto/) and review the [Carto reference documentation](http://mapbox.com/carto/). | ||
For users looking to learn how to use TileMill the best places to start are to 1) Download [TileMill](https://github.com/mapbox/carto/) and review the [Carto reference documentation](https://github.com/mapbox/carto/blob/master/docs/latest.md). | ||
@@ -26,3 +26,3 @@ Tutorials like the [TileMill Crashcourse](https://www.mapbox.com/tilemill/docs/crashcourse/styling/) are a great place to start to learn the basics of CartoCSS. | ||
- [How to style polygons](https://www.mapbox.com/tilemill/docs/guides/styling-polygons/) | ||
- See also the (Styling Concepts)[#styling-concepts] for explanations of advanced features. | ||
- See also the [Styling Concepts](#styling-concepts) for explanations of advanced features. | ||
@@ -226,5 +226,7 @@ ## Developers | ||
To install, download or clone this repository, then add the `vim-carto` | ||
directory located at `build/vim-carto` to your `~/.vim` file. | ||
To install, download or clone this repository, then copy the `vim-carto` | ||
directory located at `build/vim-carto` to your `~/.vim` directory. | ||
cp build/vim-carto/* ~/.vim -R | ||
## Credits | ||
@@ -231,0 +233,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
379682
3385
249
1
+ Addedmapnik-reference@8.2.0(transitive)
- Removedmapnik-reference@7.0.1(transitive)
Updatedmapnik-reference@~8.2.0