<div dir="ltr">Hi Tim: I was wondering if I'd see any messages on that topic. Short story is that the functionality was removed in MS8. I never liked the all-or-nothing aspect of it and was working on a method to control which objects would be allowed to be updated. The solutions I came up with were convoluted and were going to add a lot of complexity to the codebase for little value. That functionality is poorly documented and by itself overly complicates the code. So after a note to mapserver-users trying to judge how much it was used - with limited replies - it was decided to remove it. I'm dealing with my own upgrade issues as a result, but it's worth it in the end IMHO.<div><br></div><div>If necessary, it's better to revisit with another method - ideally something along the lines of runsubs. The challenge is specifying when to apply them and how to validate values. Strings are easy, but numeric/color values aren't so we'd need to do something like add runtime bindings (similar to attribute bindings) so you'd write SIZE %mysize% instead. One advantage being you could reuse the variable across layers.</div><div><br></div><div>So, what are the options right now? It sort of depends on your needs. Do you need to only support a couple of sizes for a class or do you truly need *any* size? Options include:</div><div><ul><li>multiple mapfiles - probably using includes to limit redundancy</li><li>class groups</li><li>if you're using a db backend I think attribute bindings could work paired with runsubs</li></ul></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div>DATA "shape FROM (select *, %textsize% AS textsize FROM ...)</div></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>VALIDATION</div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>    "textsize_default" "13"</div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>    "textsize" "^8|10|12|14$"<br></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>END</div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>CLASS</div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>  LABEL</div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>    SIZE [textsize] # I think attribute binding works here</div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>  END</div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>END</div></blockquote><div><ul><li>MapScript - load the mapfile, do the changes you need, render the map</li></ul><div>Happy to discuss further and perhaps other folks have ideas.</div></div><div><br></div><div>--Steve</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Oct 6, 2022 at 12:47 PM Tim Kempisty via MapServer-users <<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;">Good afternoon, all.<div><br></div><div>I am migrating a project from MS7 to the new Mapserver 8.0.0, and I've stumbled upon evidence that map_object notation support for CGI variable substitution may be broken.</div><div><br></div><div>Here's the relevant doc for CGI Controls:</div><div><br></div><div><a href="https://mapserver.org/cgi/controls.html" target="_blank">https://mapserver.org/cgi/controls.html</a> </div><div><br></div><div>Scoll down to the heading:  "Changing map file parameters via a form or a URL" </div><div>We have been using the map_object notation method to set custom image sizes and font sizes.</div><div><br></div><div>Excuse the messy query string.  The important parts are  "&map_size" and "&map.layer[...]"</div><div><br></div><div><div style="margin:0px;font-stretch:normal;font-size:14px;line-height:normal;font-family:"Courier New";background-color:rgba(255,255,255,0.8)"><span style="font-variant-ligatures:no-common-ligatures">/var/www/cgi-bin/mapserv.cgi -nh "QUERY_STRING=mode=map&map=/usr/local/mapfiles/kempisty/nbm_view/foo.map&layer=genNoDec&model=blend&ver=v4.0&sector=conus&element=maxt&issuancetime=2022-10-06T14:00&validtime=2022-10-08T06:00&mapext=-3270279.3477121103%20-163255.0404466032%202666810.2533767014%203144901.0582670807&map_size=1215+677&map.layer[genNoDec].class[0].label[0]=SIZE+8" > /var/www/html/kempisty/foo7.png</span></div></div><div><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div><div><span style="font-variant-ligatures:no-common-ligatures">MS7 gives a map size 1215x677 with labels rendered in 8 point font, as expected.  The same command, using mapserver 8 instead of 7, g</span>ives an image size 2345x1597 (map size as defined in the mapfile) with labels rendered in 13 point font (also as defined in the mapfile).</div></div><div><span style="font-variant-ligatures:no-common-ligatures"><div><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div><span style="font-variant-ligatures:no-common-ligatures">Using MS8... if I send &mapsize=1215+677 instead of &map_size=1215+677 ... I will get the image at the correct size.  So the predefined CGI control variables still work.  It suggests to me, it is only the map_object notation method that is broken.  Has that been disabled in MS8, or is it now subject to a new configuration requirement that I'm not aware of?</span></div><div><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div><span style="font-variant-ligatures:no-common-ligatures">Relevant string isolated for reference:</span></div><div><span style="font-variant-ligatures:no-common-ligatures"><span style="font-family:"Courier New";font-size:14px;background-color:rgba(255,255,255,0.8)">&map_size=1215+677&map.layer[genNoDec].class[0].label[0]=SIZE+8"</span></span></div><div><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div>I'm open to other methods of changing font size on the fly.  We did it this way because %var% runtime substitutions aren't supported for CLASS: LABEL: SIZE.</div><div><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div><span style="font-variant-ligatures:no-common-ligatures">-Tim Kempisty</span></div><div><span style="font-variant-ligatures:no-common-ligatures"><br></span></div></span></div></div>_______________________________________________<br>
MapServer-users mailing list<br>
<a href="mailto:MapServer-users@lists.osgeo.org" target="_blank">MapServer-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/mapserver-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
</blockquote></div>