I started looking into using something similar to this example of the GRID layer definition in a MapServer mapfile that will draw lat/lon line grid at least every 5 degrees:
LAYER NAME "grid" METADATA "DESCRIPTION" "Grid" END TYPE LINE STATUS ON CLASS NAME "Graticule" COLOR 0 0 0 LABEL COLOR 255 0 0 FONT "sans" TYPE truetype SIZE 8 POSITION AUTO PARTIALS FALSE BUFFER 2 OUTLINECOLOR 255 255 255 END END PROJECTION "init=epsg:4326" END GRID LABELFORMAT '%g°' MININTERVAL 5 END END # Layer
However, I don't want the MININTERVAL value to be hardcoded and would like to be able to vary that value by entering a different value in the URL call from a web page using the map_object notation. But, I've been unsuccessful. I have tried this in the URL call to MapServer:
&map_layer[grid].grid=MININTERVAL+10 #changing to 10 degrees instead of 5
using the second example at this link: https://mapserver.org/cgi/controls.html#cgi-mapfile-change-parameters. But, I either get a parsing error or an Internal Server error. I've tried turning debug level to 5 and looking at logs but they don't offer any help. Perhaps I'm just not using the correct map_object notation, but I'm not sure what else to use given the examples in the link. I also attempted to look at the MapServer code to no avail.
I'm using MapServer v 7.2.2 but it seems like the GRID layer has been available for a while now.