<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi Tamas: I think something like this would be super useful. Currently MapServer does not load (directly) or parse the SVG. It's relying on svg-cairo or rsvg for that. So to support parameters one would need to parse and then process the XML looking for parameters.
 To avoid doing this for every file I'd thinking adding something to a symbolObj to trigger the extra processing might be a possibility. Any chance svg-cairo or rsvg support this (where you'd pass a key/value store along with the filename)?</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I was wondering how you'd store the colors, etc... within the mapfile. I don't think that it makes sense to bind it to a styleObj as is. Not enough flexibility for symbols with multiple colors or whatever, plus I'd assume you'd want the flexibility to use SVG
 files that already define parameter names. So, I'd think we would need to use a hash within the styleObj to hold the configuration parameters something like:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
STYLE</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
  SYMBOL 'some-svg-symbol'</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
  SIZE 10</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
  OPTIONS</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
    'color1' 'red'</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
    'color2' 'green'</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
  END</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
END</div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
--Steve</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> mapserver-dev <mapserver-dev-bounces@lists.osgeo.org> on behalf of Tamas Szekeres <szekerest@gmail.com><br>
<b>Sent:</b> Thursday, September 5, 2019 7:28 AM<br>
<b>To:</b> mapserver-dev@lists.osgeo.org <mapserver-dev@lists.osgeo.org><br>
<b>Subject:</b> [mapserver-dev] SVG symbols with modifiable parameters</font>
<div> </div>
</div>
<div>
<div>
<div dir="ltr">Hi,
<div><br>
</div>
<div>I have a requirement to be able to modify some parameters of the SVG symbols according to the parameters of the corresponding style in the mapfile configuration. This would provide significant help to avoid maintaining large number of SVG definitions with
 the same shape, but different colors or line widths. Or one could also replace the truetype symbols with the SVG variants if needed.</div>
<div><br>
</div>
<div>Would that be reasonable to implement something like this?</div>
<div><br>
</div>
<div><a href="https://gcc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fblog.sourcepole.ch%2F2011%2F06%2F30%2Fsvg-symbols-in-qgis-with-modifiable-colors%2F&data=02%7C01%7Csteve.lime%40state.mn.us%7Cb40a05dc806743f8ca7608d731fca1ca%7Ceb14b04624c445198f26b89c2159828c%7C0%7C1%7C637032833418334660&sdata=UXiBHDUUxJgYY%2BAdS4s51u6EltjBGhr6Ywha3z91Eio%3D&reserved=0" originalsrc="http://blog.sourcepole.ch/2011/06/30/svg-symbols-in-qgis-with-modifiable-colors/" shash="PwxFa0ugWr3/r8hfbrdwGPW96e5nf9S5XVSyFfK0JMzs4RB/oLG0adoBKNC3ApQCZMYx6mF7zAXFSXqMnZImigqTOoIthPLJfFg78kWcyKrxes5EhPpPt4K+uGetkApKDUCGcHjCfqQk6lxRoMfRLPnG9DFQSvt3nG3XfyeI594=">http://blog.ch/2011/06/30/svg-symbols-in-qgis-with-modifiable-colors/</a> </div>
<div><br>
</div>
<div>I think we could easily modify the SVG definition in msPreloadSVGSymbol, where the symbol definition would be loaded and modified in a local buffer before passing that to the renderer.</div>
<div><br>
</div>
<div>Best regards,</div>
<div><br>
</div>
<div>Tamas</div>
<div><br>
</div>
</div>
</div>
</div>
</body>
</html>