You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# In format_sld_xml, add:# For polgyons, add a stroke color.# If this isn't a polygon, the sld wil be returned unchanged#xml_str=self.add_polygon_stroke(xml_str)
self.formatted_sld_xml=remove_whitespace_from_xml(xml_str)
Add new method
defadd_polygon_stroke(self, sld_xml_str):
""" The default stroke (for polygons) is: <Stroke/> Update it to a lighter color. (If <Stroke/> isn't found, return the sld_xml_str as is) """ifsld_xml_strisNone:
returnNonestroke_color='#ececec'no_stroke='<sld:Stroke/>'default_stroke= ('<sld:Stroke>''<sld:CssParameter name="stroke">%s</sld:CssParameter>''<sld:CssParameter name="stroke-width">0.75</sld:CssParameter>''</sld:Stroke>') %stroke_colorreturnsld_xml_str.replace(no_stroke, default_stroke)