[Mapserver-users] How to use REQUIRES in mapfile?

nicolas.fortin at ec.gc.ca nicolas.fortin at ec.gc.ca
Thu Dec 18 09:56:53 PST 2003


Thx Steve for your answer!

The layers now display correctly but even if one layer isn't there, the
legend appears.  Is it normal?

Nicolas

-----Message d'origine-----
De : Steve Lime [mailto:steve.lime at dnr.state.mn.us] 
Envoyé : Thursday, December 18, 2003 11:41 AM
À : nicolas.fortin at ec.gc.ca; mapserver-users at lists.gis.umn.edu
Objet : Re: RE : [Mapserver-users] How to use REQUIRES in mapfile?


I do. Requires allows you to control visibility based on other layers. For
example:

  REQUIRES "![landsat]"

Means that a layer will be on only if the layer named landsat is not on. You
can also do and's and or's so this would work:

  REQUIRES "![landsat] and![modis]"

There is a special tag called [raster] that allows you to control a layer
depending whether any raster layers are currently displayed. You might do
this to make a layer transparent in one context and opaque in another. So
this would be valid:

  REQUIRES "![raster]"

That is, display if no background rasters are shown. Note that context is
checked only after a layer has already been made visible via MapScript or
the CGI.

Steve

>>> <nicolas.fortin at ec.gc.ca> 12/18/2003 9:56:41 AM >>>
No answer yet...nobody use this element??

-----Message d'origine-----
De : nicolas.fortin at ec.gc.ca [mailto:nicolas.fortin at ec.gc.ca] 
Envoyé : Wednesday, December 17, 2003 3:20 PM
À : mapserver-users at lists.gis.umn.edu 
Objet : [Mapserver-users] How to use REQUIRES in mapfile?


Hi list,
 
I have two layers using the same grid and I only want one of them on the map
at a time so I tried to use the REQUIRES element in my mapfile as seen in
the Mapfile Reference 4.0 (07-02-2003) : REQUIRES ([15] != 1) Where 15 is
the name of the layer using the same grid
 
And I got:
getString(): Symbol definition error. Parsing error near ([15] != 1):(line
94) 
 
How can I use this element?
Thx,

Nicolas Fortin 
Mathématicien, Programmeur, Analyste de données 
SMC-Québec Hydrologie, Environnement Canada 
1141, Rte de l'Église, Sainte-Foy(QC) G1V 4H5 
(418)648-2516 
nicolas.fortin at ec.gc.ca <mailto:nicolas.fortin at ec.gc.ca 
<mailto:nicolas.fortin at ec.gc.ca> > 

 



_______________________________________________
Mapserver-users mailing list
Mapserver-users at lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users




More information about the MapServer-users mailing list