Push to 0.8.0, push mapnik-reference dependency to 3.0.0. Changes are
detailed in the CHANGELOG and are extensive; this is backwards-compatible and introduces new field and functions types in reference.json which allow more powerful use of transforms, image filters, and expressions in Mapnik
This commit is contained in:
parent
d1574100af
commit
05718df884
@ -9,18 +9,13 @@
|
||||
### 0.7.1
|
||||
|
||||
* Updated mapnik-reference to `~2.2.1`
|
||||
|
||||
* Added support for `status` parameter on layers.
|
||||
|
||||
* Command line `carto` program gained `--nosymlink` option to pass to millstone to use absolute paths instead of symlinking files.
|
||||
|
||||
* Removed unsupported mixin code.
|
||||
>>>>>>> b165c2080d0b876278222078fa322450e148cc41
|
||||
|
||||
### 0.7.0
|
||||
|
||||
* Updated mapnik-reference to `~2.1.0`
|
||||
|
||||
* Support an `opacity` property on any style that is a style-level property
|
||||
|
||||
### 0.6.0
|
||||
|
@ -1,11 +1,13 @@
|
||||
(function(tree) {
|
||||
|
||||
tree.Call = function Call(name, args, index) {
|
||||
this.is = 'call';
|
||||
|
||||
this.name = name;
|
||||
this.args = args;
|
||||
this.is = 'call';
|
||||
this.index = index;
|
||||
};
|
||||
|
||||
tree.Call.prototype = {
|
||||
//
|
||||
// When evaluating a function call,
|
||||
@ -31,7 +33,7 @@ tree.Call.prototype = {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.name in tree.functions) { // 1.
|
||||
if (this.name in tree.functions) {
|
||||
if (tree.functions[this.name].length === args.length) {
|
||||
return tree.functions[this.name].apply(tree.functions, args);
|
||||
} else {
|
||||
@ -80,11 +82,20 @@ tree.Call.prototype = {
|
||||
}
|
||||
}
|
||||
},
|
||||
toString: function(env) {
|
||||
if (this.args.length) {
|
||||
return this.name + ':' + this.args.join(',');
|
||||
|
||||
toString: function(env, format) {
|
||||
if (format === 'image-filter') {
|
||||
if (this.args.length) {
|
||||
return this.name + ':' + this.args.join(',');
|
||||
} else {
|
||||
return this.name;
|
||||
}
|
||||
} else {
|
||||
return this.name;
|
||||
if (this.args.length) {
|
||||
return this.name + '(' + this.args.join(',') + ')';
|
||||
} else {
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -35,7 +35,7 @@ tree.Rule.prototype.toString = function() {
|
||||
// rule without the usual attribute="content" wrapping. Right
|
||||
// now this is just for the TextSymbolizer, but applies to other
|
||||
// properties in reference.json which specify serialization=content
|
||||
tree.Rule.prototype.toXML = function(env, content) {
|
||||
tree.Rule.prototype.toXML = function(env, content, sep, format) {
|
||||
if (!tree.Reference.validSelector(this.name)) {
|
||||
return env.error({
|
||||
message: "Unrecognized rule: " + this.name,
|
||||
@ -77,7 +77,7 @@ tree.Rule.prototype.toXML = function(env, content) {
|
||||
var f = tree._getFontSet(env, this.value.value);
|
||||
return 'fontset-name="' + f.name + '"';
|
||||
} else if (content) {
|
||||
return this.value.toString(env, this.name);
|
||||
return this.value.toString(env, this.name, sep);
|
||||
} else {
|
||||
return tree.Reference.selectorName(this.name) +
|
||||
'="' +
|
||||
|
@ -36,10 +36,10 @@ tree.Style.prototype.toXML = function(env) {
|
||||
|
||||
if (image_filters.length) {
|
||||
attrs_xml += ' image-filters="' + image_filters.map(function(f) {
|
||||
return f.toXML(env, true);
|
||||
}).join(',') + '" ';
|
||||
return f.eval(env).toXML(env, true, ' ', 'image-filter');
|
||||
}).join(' ') + '" ';
|
||||
}
|
||||
|
||||
|
||||
if (comp_op.length) {
|
||||
attrs_xml += ' comp-op="' + comp_op[0].value.eval(env).toString() + '" ';
|
||||
}
|
||||
|
@ -14,9 +14,9 @@ tree.Value.prototype = {
|
||||
}));
|
||||
}
|
||||
},
|
||||
toString: function(env, selector, sep) {
|
||||
toString: function(env, selector, sep, format) {
|
||||
return this.value.map(function(e) {
|
||||
return e.toString(env);
|
||||
return e.toString(env, format);
|
||||
}).join(sep || ', ');
|
||||
},
|
||||
clone: function() {
|
||||
|
@ -36,7 +36,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"underscore": "~1.3.3",
|
||||
"mapnik-reference": "https://github.com/mapnik/mapnik-reference/tarball/transform-functions",
|
||||
"mapnik-reference": "~3.0.0",
|
||||
"xml2js": "~0.1.13"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@ -2,7 +2,7 @@
|
||||
polygon-fill: #FFF;
|
||||
line-color:#F00;
|
||||
line-width: 0.5;
|
||||
image-filters: blur() sharpen() agg-stack-blur(2, 2);
|
||||
image-filters: blur(), sharpen(), agg-stack-blur(2, 2);
|
||||
composite-operation: src-in;
|
||||
line-dasharray: 2, 3;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user