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

View File

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

View File

@ -5,7 +5,7 @@
<Style name="world" filter-mode="first" > <Style name="world" filter-mode="first" >
<Rule> <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> </Rule>
</Style> </Style>
<Layer name="world" <Layer name="world"

View File

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