Fix absolute paths in other symbolizer types

This commit is contained in:
Tom MacWright 2012-12-26 18:19:39 -05:00
parent 9f00195100
commit 3f31bcbe5f
4 changed files with 9 additions and 7 deletions

View File

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

View File

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

View File

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

View File

@ -180,10 +180,12 @@ helper.removeAbsoluteImages = function(xml) {
xml.Map.forEach(function(map) {
if (map.Style) map.Style.forEach(function(style) {
style.Rule.forEach(function(rule) {
if (rule.PolygonPatternSymbolizer) {
rule.PolygonPatternSymbolizer.forEach(function(symbolizer) {
symbolizer.file = '[absolute path]';
});
for (var symbolizer in rule) {
for (var i = 0; i < rule[symbolizer].length; i++) {
if (rule[symbolizer][i].file) {
rule[symbolizer][i].file = '[absolute path]';
}
}
}
});
});