[Mapserver-users] Zoom to in a mapserver project
Steve Lime
steve.lime at dnr.state.mn.us
Wed Feb 11 15:00:59 PST 2004
Attribute queries is 4.x changed from earlier versions. Instead of
altering the filter in the mapfile you basically send them as part of
the CGI request. Try changing the function to:
function findBuilding(inBuilding){
var aForm = document.forms[0]
aForm.qstring.value = inBuilding;
aForm.qitem.value = 'Bldg_name';
aForm.mode.value = "itemquery";
aForm.qlayer.value = "building_query";
aForm.mapext.value = "shapes";
aForm.buffer.value = "0.005";
aForm.submit()
}
and the map file snippet to:
LAYER # this layer just displays one building when it has been
queried
NAME "building_query"
DATA Build
TYPE POLYGON
STATUS OFF
CLASS
TEMPLATE "demo.html" # Use to display map
#COLOR 255 0 0
#OUTLINECOLOR 255 0 0
END # CLASS
END # LAYER
Steve
>>> "Jean Christophe BARRA" <jcbarra at club-internet.fr> 2/11/2004
12:48:17 PM >>>
Hello,
I come from France and my english is poor, sorry;-)
I have a mapserver project (mapserver4.01) and the first shape (shp
ESRI) is nammed "departements"
(yours counties).
In the map file, his status is default.
I want to propose to users the possibility to zoom to a "departement".
I make a itemquery with mapext=shapes as I have seen in this example :
function findBuilding(inBuilding){
var aForm = document.forms[0]
aForm.building.value = inBuilding;
aForm.mode.value = "itemquery";
aForm.qlayer.value = "building_query";
aForm.mapext.value = "shapes";
aForm.buffer.value = "0.005";
aForm.submit()
}
and in my map file -
LAYER # this layer just displays one building when it has been
queried
NAME "building_query"
DATA Build
TYPE POLYGON
STATUS OFF
FILTERITEM Bldg_name
FILTER "%building%"
CLASS
TEMPLATE "demo.html" # Use to display map
#COLOR 255 0 0
#OUTLINECOLOR 255 0 0
END # CLASS
END # LAYER
Mapserver don't work, the return is :
msQueryAttributes: Query non defined.
Can someone help me?
Thank's
More information about the MapServer-users
mailing list