Merge pull request #173 from mapbox/fix-mapnik-functions

Fix mapnik functions
This commit is contained in:
Tom MacWright 2012-08-15 14:09:02 -07:00
commit 73a7c6b87a
8 changed files with 11 additions and 19 deletions

View File

@ -84,18 +84,10 @@ tree.Call.prototype = {
},
toString: function(env, format) {
if (format === 'image-filter') {
if (this.args.length) {
return this.name + ':' + this.args.join(',');
} else {
return this.name;
}
if (this.args.length) {
return this.name + '(' + this.args.join(',') + ')';
} else {
if (this.args.length) {
return this.name + '(' + this.args.join(',') + ')';
} else {
return this.name;
}
return this.name;
}
}
};

View File

@ -12,7 +12,7 @@ tree.ImageFilter.prototype = {
toString: function() {
if (this.args) {
return this.filter + ':' + this.args.join(',');
return this.filter + '(' + this.args.join(',') + ')';
} else {
return this.filter;
}

View File

@ -36,8 +36,8 @@ tree.Style.prototype.toXML = function(env) {
if (image_filters.length) {
attrs_xml += ' image-filters="' + image_filters.map(function(f) {
return f.eval(env).toXML(env, true, ' ', 'image-filter');
}).join(' ') + '" ';
return f.eval(env).toXML(env, true, ',', 'image-filter');
}).join(',') + '" ';
}
if (comp_op.length) {

View File

@ -3,7 +3,7 @@
<Map 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" maximum-extent="-20037508.34,-20037508.34,20037508.34,20037508.34">
<Style name="world" filter-mode="first" image-filters="blur sharpen agg-stack-blur:2,2" comp-op="src-in">
<Style name="world" filter-mode="first" image-filters="blur,sharpen,agg-stack-blur(2,2)" comp-op="src-in">
<Rule>
<PolygonSymbolizer fill="#ffffff" />
<LineSymbolizer stroke="#ff0000" stroke-width="0.5" stroke-dasharray="2, 3" />

View File

@ -1,4 +1,4 @@
#world {
point-file: url(foo.png);
point-transform: "translate(2, 2)";
point-transform: "translate(2, 2), scale(2, 2)";
}

View File

@ -5,7 +5,7 @@
<Style name="world" filter-mode="first" >
<Rule>
<PointSymbolizer file="foo.png" transform="translate(2, 2)" />
<PointSymbolizer file="foo.png" transform="translate(2, 2), scale(2, 2)" />
</Rule>
</Style>
<Layer name="world"

View File

@ -1,4 +1,4 @@
#world {
point-file:url(foo.png);
point-transform: scale(2 * 5 * [POP2005], [POP2005]);
point-transform: scale(2 * 5 * [POP2005], [POP2005]), rotate(10,1,-1);
}

View File

@ -5,7 +5,7 @@
<Style name="world" filter-mode="first" >
<Rule>
<PointSymbolizer file="foo.png" transform="scale(10*[POP2005],[POP2005])" />
<PointSymbolizer file="foo.png" transform="scale(10*[POP2005],[POP2005]), rotate(10,1,-1)" />
</Rule>
</Style>
<Layer name="world"