[MapServer-users] Changing mapfile values via CGI parameters

Jörg Thomsen (WhereGroup) joerg.thomsen at wheregroup.com
Thu Mar 30 06:31:37 PDT 2023


Hi,

it's been removed.

see: https://mapserver.org/cgi/controls.html#using-mapserver-version-8
> Previous versions of the MapServer CGI program allowed certain 
 > parameters to be changed via a URL using a cumbersome synta


Here's a bit longer explanation Steve Lime  wrote a few month ago:

> -------- Weitergeleitete Nachricht --------
> Betreff: 	Re: [MapServer-users] mapserver 8 - CGI map_object substitutions broken?
> Datum: 	Thu, 6 Oct 2022 14:49:32 -0500
> Von: 	Steve Lime <sdlime at gmail.com>
> An: 	Tim Kempisty <timothy.kempisty at noaa.gov>
> Kopie (CC): 	mapserver-users at lists.osgeo.org
> 
> 
> 
> 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.
> 
> 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.
> 
> 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:
> 
>   * multiple mapfiles - probably using includes to limit redundancy
>   * class groups
>   * if you're using a db backend I think attribute bindings could work
>     paired with runsubs
> 
>     DATA "shape FROM (select *, %textsize% AS textsize FROM ...)
> 
>     VALIDATION
> 
>          "textsize_default" "13"
> 
>          "textsize" "^8|10|12|14$"
> 
>     END
> 
>     CLASS
> 
>        LABEL
> 
>          SIZE [textsize] # I think attribute binding works here
> 
>        END
> 
>     END
> 
>   * MapScript - load the mapfile, do the changes you need, render the map
> 
> Happy to discuss further and perhaps other folks have ideas.






Am 30.03.23 um 14:55 schrieb Benedek Petrovicz:
> Hi!
> 
> I just upgraded MapServer from 7.7.0 to 8.0.0 and some CGI parameters 
> just stopped working.
> 
> I'm trying to change the label size on a specific layer with the 
> following parameter: *map.layer[county].class[0].label[0]=SIZE+24*
> 
> In 7.7.0 it's working perfectly.
> In 8.0.0 it's not changing anything.
> 
> I couldn't find any notes about dropping this functionality in 8.0.0, 
> but I might have missed something.
> 
> What am I missing here?
> 
> Thank you!
> Benedek
> 
> _______________________________________________
> MapServer-users mailing list
> MapServer-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users

-- 
Viele Grüße,
Jörg Thomsen
---------------------------------------------
Aufwind durch Wissen!
Web-Seminare und Online-Schulungen
bei der www.foss-academy.com
---------------------------------------------


Jörg Thomsen
WhereGroup GmbH
Bundesallee 23
10717 Berlin
Germany

Tel: +49 (0)30 / 5130 278 74
Fax: +49 (0)30 / 5130 278 11	

joerg.thomsen at wheregroup.com
www.wheregroup.com

Geschäftsführer:
Olaf Knopp, Peter Stamm
Amtsgericht Bonn, HRB 9885

-------------------------------
Folgen Sie der WhereGroup auf twitter: http://twitter.com/WhereGroup_com



More information about the MapServer-users mailing list