REQUIRES syntax in Mapfile

Steve Lime Steve.Lime at DNR.STATE.MN.US
Mon Feb 4 18:16:13 EST 2008


Try:

  REQUIRES "[OtherRoad]"

The tokenizer is just looking for a string there...

Steve

>>> On 2/4/2008 at 2:55 PM, in message <47A77BAC.9040507 at asdf.co.nz>, Neil Fincham
<neil at ASDF.CO.NZ> wrote:
> Hi All,
> 
> 	Quick question today, what is the correct syntax for the REQUIRES tag
> in the mapfile?  I have tried "REQUIRES ([OtherRoad] = 1)" (I.E, the
> layer OtherRoad must be on for the layer to display) and a few other
> things and I don't seem to be getting any joy.  I have included the map
> layer definitions below;-
> 
>   LAYER
>     NAME 'OtherRoad'
>     TYPE LINE
>     CONNECTIONTYPE postgis
>     CONNECTION 'host=localhost user=postgres dbname=NZMM'
>     DATA 'the_geom FROM public.road_all_layer2_polyline'
>     METADATA
>       'wms_title' 'OtherRoad'
>     END
>     MAXSCALE 15000
>     STATUS ON
>     LABELITEM "road_name"
>     TRANSPARENCY 100
>     CLASS
>       NAME 'Road - Other'
>       STYLE
>         SYMBOL road-line
>         SIZE 1
>         COLOR 0 0 0
>       END
>     END
>   END
> 
>   LAYER
>     NAME 'MinorRuralRoad'
>     TYPE LINE
>     CONNECTIONTYPE postgis
>     CONNECTION 'host=localhost user=postgres dbname=NZMM'
>     DATA 'the_geom FROM public.road_all_layer2_polyline'
>     METADATA
>       'wms_title' 'MinorRuralRoad'
>     END
>     MAXSCALE 15000
>     STATUS ON
>     LABELITEM "road_name"
>     TRANSPARENCY 100
>     REQUIRES ([OtherRoad] eq 1)
>     CLASS
>       NAME 'Minor Rural Road'
>       EXPRESSION ("[class]" = "MINOR RURAL ROAD")
>       LABEL
>         COLOR  0 0 0
>         FONT sans
>         TYPE truetype
>         SIZE 6
>         POSITION AUTO
>         PARTIALS FALSE
>         ANGLE FOLLOW
>         BUFFER 10
> 	OUTLINECOLOR 255 255 255
>       END
> 	STYLE
>         SYMBOL road-line
>         SIZE 6
>         COLOR 0 0 0
>       END
>       STYLE
>         SYMBOL road-line
>         SIZE 5
>         COLOR 255 0 255
>       END
>     END
>   END
> 
> Thanks Heaps
> 
> 
> Neil



More information about the mapserver-users mailing list