[mapserver-users] Mapserver Expressions
Charlie Allgrove
charlie.allgrove at bsgwireless.com
Wed Dec 11 09:10:31 PST 2013
Hi
I'm looking to change the symbol used on a given layer, based on the
(Google) zoom level supplied to the mapserv CGI.
The Layer in question in the map file looks like this:
LAYER
VALIDATION
'tile' '^[0-9]+ [0-9]+ [0-9]{1,2}$'
END
PROJECTION
"init=epsg:4326"
END
NAME hubs
TYPE point
STATUS ON
DATA 'hub_data.shp'
CLASS
EXPRESSION('%tile%' ~ '16$')
NAME 'hub_layer_small'
STYLE
SYMBOL 'cloud_500'
END #STYLE
END #CLASS
CLASS
EXPRESSION('%tile%' ~ '17$')
NAME 'hub_layer_large'
STYLE
SYMBOL 'cloud_200'
END #STYLE
END #CLASS
CLASS
NAME 'hub_layer_default'
STYLE
SYMBOL 'cloud_200'
SIZE 2
END #STYLE
END #CLASS
TEMPLATE "xxx"
METADATA
"wms_title" "Hub data layer"
END
END #LAYER
Requests are made to the CGI with the following example querystring:
?layer=hubs&mode=tile&tilemode=gmap&tile=19288 24631 16
I *thought* it was possible to use EXPRESSION to test the 'tile' variable
and act accordingly, but it's not working (I always get the default class
used instead).
> ./mapserv -v
MapServer version 6.0.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ
SUPPORTS=AGG SUPPORTS=CAIRO SUPPORTS=FREETYPE SUPPORTS=ICONV
SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER
SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI
SUPPORTS=THREADS SUPPORTS=GEOS INPUT=POSTGIS INPUT=OGR INPUT=GDAL
INPUT=SHAPEFILE
Any pointers? Thanks in advance.
Charlie
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20131211/e79a2224/attachment.htm>
More information about the MapServer-users
mailing list