Compare commits
18 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
85881d99dd | ||
|
d3a5c97143 | ||
|
8ed3ad15c1 | ||
|
72f79efbdd | ||
|
161516b721 | ||
|
e48d5ff993 | ||
|
31abb8bee0 | ||
|
e2177cf443 | ||
|
664b45cdde | ||
|
368dad0d11 | ||
|
4dfe5361b3 | ||
|
3596991362 | ||
|
bf4c67034a | ||
|
ad5d919139 | ||
|
9fb894181d | ||
|
ffdf2d3c9b | ||
|
cbe66020f9 | ||
|
056081ace6 |
@ -1,7 +1,9 @@
|
||||
language: node_js
|
||||
|
||||
node_js:
|
||||
- "0.11"
|
||||
- "0.10"
|
||||
- '6'
|
||||
- '8'
|
||||
- '10'
|
||||
|
||||
script:
|
||||
- npm test
|
||||
|
9
CHANGELOG.carto.md
Normal file
9
CHANGELOG.carto.md
Normal file
@ -0,0 +1,9 @@
|
||||
## CARTO's Changelog
|
||||
|
||||
## 0.15.1-cdb5
|
||||
2018-11-20
|
||||
|
||||
* Support Node.js 6, 8 and, 10
|
||||
* Drop support for Node.js 0.10 and 0.11
|
||||
* Add package-lock.json
|
||||
* Add CHANGELOG.carto.md
|
@ -838,6 +838,18 @@ var _mapnik_reference_latest = {
|
||||
"default-value": "point",
|
||||
"doc": "How this shield should be placed. Point placement attempts to place it on top of points, line places along lines multiple times per feature, vertex places on the vertexes of polygons, and interior attempts to place inside of polygons."
|
||||
},
|
||||
"placement-type": {
|
||||
"css": "shield-placement-type",
|
||||
"doc": "Re-position and/or re-size shield to avoid overlaps. \"simple\" for basic algorithm (using shield-placements string,) \"dummy\" to turn this feature off.",
|
||||
"type": [
|
||||
"dummy",
|
||||
"simple",
|
||||
"list"
|
||||
],
|
||||
"expression":true,
|
||||
"default-meaning": "Alternative placements will not be enabled.",
|
||||
"default-value": "dummy"
|
||||
},
|
||||
"avoid-edges": {
|
||||
"css": "shield-avoid-edges",
|
||||
"doc": "Tell positioning algorithm to avoid labeling near intersection edges.",
|
||||
|
@ -93,9 +93,9 @@ tree.Filterset.prototype.toJS = function(env) {
|
||||
}
|
||||
var attrs = "data";
|
||||
if (op === '=~') {
|
||||
return "(" + attrs + "['" + filter.key.value + "'] + '').match(" + (val.is === 'string' ? "'" + val.toString().replace(/'/g, "\\'") + "'" : val) + ")";
|
||||
return "(" + attrs + "['" + filter.key.value + "'] + '').match(" + (val.is === 'string' ? "'" + val.toString().replace(/'/g, "\\'").replace(/&/g, '&') + "'" : val) + ")";
|
||||
}
|
||||
return attrs + "['" + filter.key.value + "'] " + op + " " + (val.is === 'string' ? "'" + val.toString().replace(/'/g, "\\'") + "'" : val);
|
||||
return attrs + "['" + filter.key.value + "'] " + op + " " + (val.is === 'string' ? "'" + val.toString().replace(/'/g, "\\'").replace(/&/g, '&') + "'" : val);
|
||||
}).join(' && ');
|
||||
};
|
||||
|
||||
|
@ -33,7 +33,13 @@ tree.Value.prototype = {
|
||||
var val = this.ev(env);
|
||||
var v = val.toString();
|
||||
if(val.is === "color" || val.is === 'uri' || val.is === 'string' || val.is === 'keyword') {
|
||||
v = "'" + v + "'";
|
||||
v = "'" + v.replace(/&/g, '&') + "'";
|
||||
} else if (Array.isArray(this.value) && this.value.length > 1) {
|
||||
// This covers something like `line-dasharray: 5, 10;`
|
||||
// where the return _value has more than one element.
|
||||
// Without this the generated code will look like:
|
||||
// _value = 5, 10; which will ignore the 10.
|
||||
v = '[' + this.value.join(',') + ']';
|
||||
} else if (val.is === 'field') {
|
||||
// replace [variable] by ctx['variable']
|
||||
v = v.replace(/\[([^\]]*)\]/g, function(matched) {
|
||||
|
2110
package-lock.json
generated
Normal file
2110
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
10
package.json
10
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "carto",
|
||||
"version": "0.15.1-cdb4",
|
||||
"version": "0.15.1-cdb5",
|
||||
"description": "CartoCSS Stylesheet Compiler",
|
||||
"url": "https://github.com/cartodb/carto",
|
||||
"repository": {
|
||||
@ -53,7 +53,11 @@
|
||||
"scripts": {
|
||||
"pretest": "npm install",
|
||||
"test": "mocha -R spec",
|
||||
"tdd" : "env HIDE_LOGS=true mocha -w -R spec",
|
||||
"coverage": "istanbul cover ./node_modules/.bin/_mocha && coveralls < ./coverage/lcov.info"
|
||||
"tdd": "env HIDE_LOGS=true mocha -w -R spec",
|
||||
"coverage": "istanbul cover ./node_modules/.bin/_mocha && coveralls < ./coverage/lcov.info",
|
||||
"bump": "npm version patch",
|
||||
"bump:major": "npm version major",
|
||||
"bump:minor": "npm version minor",
|
||||
"postversion": "git push origin master --follow-tags"
|
||||
}
|
||||
}
|
||||
|
@ -195,6 +195,18 @@ describe('RenderingJS', function() {
|
||||
assert.equal(width, 8);
|
||||
});
|
||||
|
||||
it("should work with numbers", function(){
|
||||
var css = [
|
||||
'#layer {',
|
||||
' line-dasharray: 5, 10;',
|
||||
'}'
|
||||
].join('\n');
|
||||
var shader = (new carto.RendererJS({ debug: false })).render(css);
|
||||
var layer = shader.getLayers()[0];
|
||||
var dasharray = layer.shader['line-dasharray'].style({value: 4}, {zoom: 1});
|
||||
assert.deepEqual(dasharray, [5, 10]);
|
||||
});
|
||||
|
||||
it("should not throw `ReferenceError` with `=~` operator", function(){
|
||||
var css = [
|
||||
'#layer[name=~".*wadus*"] {',
|
||||
|
Loading…
Reference in New Issue
Block a user