[Mapserver-dev] Problems with itemquery in version 4.0
Jordi Valls
valls at amb.es
Fri Sep 17 08:09:49 EDT 2004
Hello mapserver users,
I am trying to use the itemquery example, from the test suit, with the
version 4.0.
I am using the mode itemquery and the parameters set with qitem and qstring.
The template displays correctly the values of the atributes of the feature
selected, but the map gets to nothing. Mapserver generates an image that
contains nothing. The template I use in the layer is :
<table cellpadding="5">
<tr>
<td>
<b>Nom:</b> [NOMM]<br>
<b>ID Numero:</b> [CODI]<br>
<b>Comarca:</b> [NOMC]<br>
</td><tr>
<td>
<img border="2" src="[img]" height="550" width="750"></td>
<td>
<img border="2"
src="http://pc12975[program]?map=[map]&qstring=[qstring]&qitem=[qitem]&mode=
itemquery&mapext=shapes&qlayer=[qlayer]" height="550" width="750">
</td>
</tr>
</table>
but [img] is correctly set to a jpg file that contains nothing and the
second image also displays nothing . Is this a bug of mapserver 4.0 or I am
doing something wrong?.Does anyone have an example of itemquery that runs on
version 4.0?
The first template:
function startquery() {
var i;
document.mapserv.qitem.value="CODI";
document.mapserv.qlayer.value="Municipis";
document.mapserv.mode.value="itemquery";
for(i=0; i<document.mapserv.codi.length; i++) {
if(document.mapserv.codi.options[i].selected){
document.mapserv.qstring.value=municipisIne[i];
}
}
document.mapserv.submit();
}
.....
<td width="10">
<select name="codi" size="1" style="width=155">
<script language="JavaScript">write_municipis()</script>
</select>
and an abstract of the map file:
LAYER NAME "Municipis"
DATA MunicipisCD
TYPE POLYGON
STATUS OFF
LABELITEM "NOMM"
TEMPLATE demo_item.html
CLASS
NAME "MUNICIPIS"
COLOR -1 -1 -1
OUTLINECOLOR 255 0 0
LABEL
COLOR 0 0 0
SHADOWCOLOR 218 218 218
SHADOWSIZE 2 2
TYPE BITMAP
POSITION CC
PARTIALS FALSE
BUFFER 2
END # end of label
END
END # end of layer
Many Thanks,
Jordi Valls i Alsedà
Servei d'Informació Territorial I Coordinació Tècnica
Mancomunitat de Municipis de l'Àrea Metropolitana de Barcelona
Carrer 62 Nro. 16-18 Edifici A Pl. 1ª Zona Franca 08040 Barcelona
www.amb.es
email: valls at amb.es
Tel 932235151
Fax. 932234710
More information about the mapserver-dev
mailing list