Layers visbility
Ferencik Ioan
ferencik.ioan at PERSONAL.RO
Wed Apr 20 04:24:03 PDT 2005
Hi all,
I am currently developping a simple Mapserver aplication. I need to do the
folowing: create a div in my index php where i will have checkboxes
representing my layers. I want the user to be able to set my layers visibility
(status) on or off. I have the folowing html
<? include ('rosia.php'); ?>
<html>
<head>
<title> Rosia Montana Environmental Mapserver</title>
</head>
<body>
<center style="color: rgb(42, 29, 89); font: bold 14pt ;" ><b> Rosia
Montana Gold Corporation Environmental Mapserver</b></center>
<hr/>
<form METHOD=POST ACTION="<?php echo $HTTP_SERVER_VARS['PHP_SELF']?>" >
<div name="harta" id="harta" style="position: absolute; top:
8%; left: 1%; width: 63%; height: 73%; border: 3px solid black ">
<INPUT TYPE=IMAGE NAME="mapa" SRC="<?php echo
$image_url?>" style= >
</div>
<div name="navigare" id="navigare" style="position: absolute;
top: 8%; left: 65%; width: 32%; height: 8%; border: 1px solid black ">
<div name="titlunav" id="titlunav" style="position:
relative; top: 0%; left: 0%; width: 100%; height: 30%; border-bottom: 1px solid
black; background: rgb(42, 29, 89); color: white; ">
<center><b> Navigation Controls</b></center>
</div>
<table border="0" align="center"
valign="middle">
<tr>
<td>
<INPUT TYPE=RADIO
NAME="zoom" VALUE=0 <?php echo check_pan?>>
</td>
<td>
<img
src="imagini/tool_pan.gif" height=25 alt="Click the radio button to pan" >
</td>
<td>
<INPUT TYPE=RADIO NAME="zoom"
VALUE=1 <?php echo $check_zin?>>
</td>
<td>
<img
src="imagini/tool_zoomin_off.gif" height=25 >
</td>
<td>
<INPUT TYPE=RADIO NAME="zoom"
VALUE=-1 <?php echo $check_zout?>>
</td>
<td>
<img
src="imagini/tool_zoomout_off.gif" height=25 >
</td>
<td>
<font face="verdana"
color="red" size=-2 >Zoom Size </font>
<INPUT TYPE=TEXT NAME="zsize"
VALUE="<?php echo $val_zsize?>" SIZE=2>
</td>
<td>
<img
src="imagini/tool_zoomfull.gif" height=25 >
</td>
<td>
<INPUT TYPE=SUBMIT NAME="full"
VALUE="Zoom full" SIZE=2 style=" color:#fff; background:#596380;">
</td>
<INPUT TYPE=HIDDEN
NAME="extent" VALUE="<?php echo $extent_to_html?>">
</tr>
</table>
</div>
<div name="layer" id="layer" style="position: absolute; top:
16%; left: 65%; width: 32%; height: 25%; border: 1px solid black ">
<div name="titlulay" id="titlulay" style="position:
relative; top: 0%; left: 0%; width: 100%; height: 10%; border-bottom: 1px solid
black; background: rgb(42, 29, 89); color: white; ">
<center><b> Layer Control</b></center>
</div>
<table>
<tr>
<td>
<input type="checkbox"
name="layer" value="rivers" <?echo $river_vis ?> > Rivers  
</td>
</tr>
<tr>
<td>
<input type="checkbox"
name="layer" value="aries" <? echo $aries_vis ?> >Aries  
</td>
</tr>
<tr>
<td>
<input type="checkbox"
name="layer" value="DEM" <? echo $dem_vis ?> > DEM  
</td>
</tr>
<tr>
<td>
<input type="submit"
name="submit" value="Update Map" SIZE=2 style="color:#fff;
background:#596380;">
</td>
</tr>
</table>
</div>
<div name="legenda" id="legenda" style="position: absolute;
top: 42%; left: 65%; width: 32%; height: 26%; border: 1px solid black ">
<div name="titluleg" id="titluleg" style="position:
relative; top: 0%; left: 0%; width: 100%; height: 10%; border-bottom: 1px solid
black; background: rgb(42, 29, 89); color: white; ">
<center><b> Legend</b></center>
</div>
<img src="<?php echo $leg ?>" />
</div>
<div name="referinta" id="referinta" style="position: absolute;
top: 68%; left: 65%; width: 205px; height: 17%px; border: 1px solid black ">
<div name="titluref" id="titluref" style="position:
relative; top: 0%; left: 0%; width: 100%; height: 15%; border-bottom: 1px solid
black; background: rgb(42, 29, 89); color: white; ">
<center><b> Reference map</b></center>
</div>
<INPUT TYPE=IMAGE NAME="ref" SRC="<?php echo $ref ?>"
style= >
</div>
<div name="scara" id="scara" style="position: absolute; top:
85%; left: 21%; width: 20%; height: 8%; border: 1px solid black ">
<div name="titluscara" id="titluscara" style="position:
relative; top: 0%; left: 0%; width: 100%; height: 36%; border-bottom: 1px solid
black; background: rgb(42, 29, 89); color: white; ">
<center><b> Scale bar</b></center>
</div>
<div align="center" style="margin-top: 6px"> <INPUT
TYPE=IMAGE NAME="scara" SRC="<?php echo $scara?>" ></div>
</div>
</>
</body>
</html>
how could I achieve this through phpmapscript?
i think that the logic should be
if the checbox is checked $layer->set("status", MS_ON)
else $layer->set ("status", MS_OFF)
i undestood it can be achieved only with not default layers
nay suggestion is welcomed
_____________________________________________
Cinefil?Castiga o excursie la Venetia
http://www.cineplus.ro/concurs
More information about the MapServer-users
mailing list