[Mapserver-users] layer STATUS as CGI parameter
Steve Lime
steve.lime at dnr.state.mn.us
Thu Feb 13 11:04:23 PST 2003
With the MapServer CGI all layers are OFF (except for DEFAULTs) and must
explicitly
turned on with the layer CGI layer parameter. So, to turn on counties
you'd use
layer=counties and so on...
Steve
Stephen Lime
Data & Applications Manager
Minnesota DNR
500 Lafayette Road
St. Paul, MN 55155
651-297-2937
>>> richard hornsby <rhornsby at io.osuedc.org> 02/12/03 06:56PM >>>
[ OT: thanks for your very thorough reply last week(?) regarding label
placement and the scanline method, Steve. ]
I was able to turn layers on and off for a few minutes via the URL,
and
now I'm utterly confused as to why it isn't working. The only way I
can
get layers to show up is to set them to DEFAULT in the map file, ie ON
doesn't turn them on, which doesn't give me the ability to turn the
layer
OFF on the URL.
I've tried referencing the layers both by index and name to no avail.
A (working) sample URL goes like this:
http://io.osuedc.org/cgi-bin/mapserv?map=/usr/local/apache/htdocs/mapserv/ohio/senatezoom.map&district=01&mode=itemquerymap&mapext=shapes&qlayer=DISTRICT&map_counties=ON
If the county outlines are turned on, it should look like this:
http://io.osuedc.org/mapserv/ohio/withlines.png
the mapfile goes like so:
MAP
NAME senatezoom
EXTENT -84.820159 38.403202 -80.518693 41.977523
SIZE 300 300
SHAPEPATH "/usr/local/apache/htdocs/mapserv/ohio/data"
FONTSET "/usr/X11R6/lib/X11/fonts/Truetype/fonts.list"
WEB
IMAGEPATH "/usr/local/apache/htdocs/tmp/"
IMAGEURL "/tmp/"
END
QUERYMAP
STATUS ON
STYLE HILITE
COLOR 132 31 31
OUTLINECOLOR -1 -1 -1
END
LAYER
NAME DISTRICT
DATA ohiosenate
STATUS ON
TYPE POLYGON
FILTERITEM DISTRICT
FILTER "%district%"
CLASS
COLOR 102 164 139
OUTLINECOLOR -1 -1 -1
TEMPLATE senatezoom_template.html
END # class
END # layer
LAYER # county outlines
NAME counties
DATA ohio_counties
STATUS ON ##### changing this to DEFAULT turns on the layer #####
TYPE POLYGON
CLASS
COLOR -1 -1 -1
OUTLINECOLOR 0 0 0
END
END
LAYER # labels
NAME countynames
DATA ohio_counties
STATUS ON ##### changing this to DEFAULT turns on the layer #####
TYPE ANNOTATION
LABELITEM "COUNTY"
CLASS # labels
LABEL
COLOR 255 255 255
FONT arial
TYPE TRUETYPE
ANTIALIAS TRUE
SIZE 9
POSITION CC
PARTIALS FALSE
FORCE FALSE
MINDISTANCE 3
BUFFER 3
END # label
END # class
END # labels layer
END # mapfile
Certainly, I'm missing something ... ? Thanks for pointing it out
gently ;)
-rj
osuedc
--
Information Center, n.:
A room staffed by professional computer people whose job it is
to
tell you why you cannot have the information you require.
rj hornsby . systems engineer . www.osuedc.org
human and community resource development
p 614 688 8761 . f 614 688 8762
_______________________________________________
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