<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body>
I had thought about this as well. Names would allow you take advantage of attribute binding and expressions. I’d think this would also require a type attribute though since these would be configure-only styles that wouldn’t take part in the normal rendering
pipeline. Depends on how much we wanted to support since this would mean 1 param = 1 style. A dictionary might be cleaner.
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> mapserver-dev <mapserver-dev-bounces@lists.osgeo.org> on behalf of Seth G <sethg@geographika.co.uk><br>
<b>Sent:</b> Wednesday, September 11, 2019 7:05:53 AM<br>
<b>To:</b> mapserver-dev@lists.osgeo.org <mapserver-dev@lists.osgeo.org><br>
<b>Subject:</b> Re: [mapserver-dev] SVG symbols with modifiable parameters</font>
<div> </div>
</div>
<style type="text/css">
<!--
p.x_MsoNormal, p.x_MsoNoSpacing
{margin:0}
-->
</style>
<div>
<table class="x_MsoNormalTable" border="0" cellspacing="0" cellpadding="0" align="left" width="`"100%`"" style="width:100.0%">
<tbody>
<tr style="">
<td style="background:#FFC845; padding:5.25pt 1.5pt 5.25pt 1.5pt"></td>
<td width="`"100%`"" cellpadding="`"7px" color="`"#FFFF00`"" style="width:100.0%; background:#FFF3DD; padding:5.25pt 3.75pt 5.25pt 11.25pt; word-wrap:break-word">
<div>
<p class="x_MsoNormal" style=""></p>
<div style="font-size:11pt; font-family:Calibri,sans-serif; color:#003865"><b>This message may be from an external email source.</b><br>
</div>
<div style="font-size:9pt; font-family:Calibri,sans-serif; color:#003865">Do not select links or open attachments unless verified. Report all suspicious emails to Minnesota IT Services Security Operations Center.</div>
<p></p>
</div>
</td>
</tr>
</tbody>
</table>
<br>
<hr>
<div>
<div>From a purely Mapfile syntax point of view it would be nice to add in named styles (as per
<a href="https://gcc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmapserver.org%2Fmapfile%2Fstyle.html%23style&data=02%7C01%7Csteve.lime%40state.mn.us%7C7121adb9fb044a6b797208d736b1cc1b%7Ceb14b04624c445198f26b89c2159828c%7C0%7C0%7C637038009571135436&sdata=C4CPNOK%2BRmL6ODpbMRAxGBCigZwxpbyVK5LK5q6koQ8%3D&reserved=0" originalsrc="https://mapserver.org/mapfile/style.html#style" shash="IaOqHCK+ll4GmxoUS5Hfkw96z8FulvlQAvi8m0cRFMtUcME53zscv4aXgICyB2ZbV270MZraux8cKsjmggQtlYJH60Ud8LcqjKa1f515sfwMTGExdS6dToRmg8anRYoNv0PdwAzIzxP6gdUJEClCKLA2V1Khz1q1AIwixyjePBA=">
https://mapserver.org/mapfile/style.html#style</a> - The final intent is to have named styles (<b>Not yet supported</b>) that will be re-usable through the mapfile).<br>
</div>
<div><br>
</div>
<div>Then for SVG the following syntax could be used, with the name used to match an SVG parameter name:<br>
</div>
<div><br>
</div>
<div>STYLE<br>
</div>
<div> SYMBOL 'some-svg-symbol'<br>
</div>
<div> NAME 'color1'<br>
</div>
<div> COLOR 255 0 0<br>
</div>
<div>END<br>
</div>
<div>STYLE<br>
</div>
<div> SYMBOL 'some-svg-symbol'<br>
</div>
<div> NAME 'color2'<br>
</div>
<div> COLOR 0 255 0<br>
</div>
<div>END<br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>On Wed, Sep 11, 2019, at 7:01 AM, Lime, Steve D (MNIT) wrote:<br>
</div>
<blockquote type="cite" id="x_qt">
<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)?<br>
</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:<br>
</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<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
SYMBOL 'some-svg-symbol'<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
SIZE 10<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
OPTIONS<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
'color1' 'red'<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
'color2' 'green'<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
END<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
END<br>
</div>
<div id="x_qt-appendonsend"><br>
</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<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div>
<hr style="display:inline-block; width:98%">
<br>
</div>
<div dir="ltr" id="x_qt-divRplyFwdMsg">
<div><span class="x_font" style="font-family:Calibri,sans-serif"><span class="x_colour" style="color:#000000"><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</span></span>
</div>
<div> <br>
</div>
</div>
<div>
<div>
<div dir="ltr">
<div>Hi, <br>
</div>
<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.<br>
</div>
<div><br>
</div>
<div>Would that be reasonable to implement something like this?<br>
</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%7C7121adb9fb044a6b797208d736b1cc1b%7Ceb14b04624c445198f26b89c2159828c%7C0%7C0%7C637038009571140430&sdata=F2ydHZh6lCkjbupOlD2KJGWkqw1UUMnuGJaEgcnf8AU%3D&reserved=0" originalsrc="http://blog.sourcepole.ch/2011/06/30/svg-symbols-in-qgis-with-modifiable-colors/" shash="tuHDMsMnHYrn6vY7Kdvd/Z6/nKPzVYLOR4yg6Llob/osOxi7P1mY8ulB+B6aDcqKaFyGB87k2LoRUFqhO4BcNGRdpyawxGB+q3NHdA8g4oCqiLwadDmh8V/CngcL/CgiRbslGi1qKW5GhduJ+Qj0uXzu6+LbjNwHqkp63ON6068=">http://blog.ch/2011/06/30/svg-symbols-in-qgis-with-modifiable-colors/</a> <br>
</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.<br>
</div>
<div><br>
</div>
<div>Best regards,<br>
</div>
<div><br>
</div>
<div>Tamas<br>
</div>
<div><br>
</div>
</div>
</div>
</div>
<div>_______________________________________________<br>
</div>
<div>mapserver-dev mailing list<br>
</div>
<div>mapserver-dev@lists.osgeo.org<br>
</div>
<div>https://lists.osgeo.org/mailman/listinfo/mapserver-dev<br>
</div>
</blockquote>
<div><br>
</div>
</div>
</div>
</body>
</html>