[Mapserver-users] Newbie Itemnquery question

Richard Greenwood rich at greenwoodmap.com
Sun Jan 18 14:15:42 EST 2004


Richie Pierce wrote:

> I’m just getting started with Mapserver and have a couple of 
> questions. I’ve got a text box that a user enters a parcel number and 
> queries the parcel layer. Just like the CGI demo it is returning a 
> zoomed image and a cached cached. I am wanting the return to be in the 
> main map so that the user is still able to use the query and zoom 
> tools. I would prefer to continue using CGI and not have to delve into 
> scripting. I also wanted to be able to use partial searches and 
> haven’t been able to get that to work. Any help would be greatly 
> appreciated. Thanks
>
This can easily be done with CGI. In pretty general terms, you need your 
TEMPLATE "parcel.html" needs to display a map, not the attribute data. 
One way to do it is to call your inital template as the class template 
(you will need to add a couple form variables) but this keeps everything 
in one place.

Rich

> < My Form looks like this >
>
> <form method=GET action="/cgi-bin/mapserv.exe">
>
> <input type="hidden" name="map" 
> value="c:\..\wwwroot\cross_co\cross_co_query.map">
>
> <input type="hidden" name="program" value="/cgi-bin/mapserv.exe">
>
> <input type="hidden" name="map_web_imagepath" value="C:\tmp\ms_tmp\">
>
> <input type="hidden" name="map_web_imageurl" value="/ms_tmp/">
>
> <input type="hidden" name="mapext" value="shapes">
>
> <input type="hidden" name="savequery" value="true">
>
> <input type="hidden" name="layer" value="Parcel Points">
>
> <input type="hidden" name="mode" value="itemnquery">
>
> <input type="hidden" name="qlayer" value="parcel_points">
>
> <input type="hidden" name="qitem" value="parcel_id">
>
> <input type="TEXT" size="30" name="qstring" value="">
>
> <input type="submit" value="Search">
>
> </form>
>
> < My Layer entry in map file >
>
> LAYER
>
> NAME parcel_points
>
> TYPE POINT
>
> DATA structures_pt
>
> STATUS OFF
>
> METADATA
>
> "DESCRIPTION" "parcel_points"
>
> "RESULT_FIELDS" "parcel_id"
>
> END
>
> CLASSITEM 'parcel_id'
>
> CLASS
>
> SYMBOL 'circle'
>
> COLOR 255 2 78
>
> SIZE 10
>
> NAME 'parcel_points'
>
> TEMPLATE "parcel.html" # this template looks just like the Itasca demo 
> template
>
> END
>
> END
>
> Richie Pierce
>
> GIS Cadastral Specialist
>
> Arkansas Geographic Information Office
>
> 124 W. Capitol St.
>
> Little Rock, AR 72201
>
> (w) 501-682-2937
>
> (c) 501-416-CAMP
>
> www.gis.state.ar.us
>


-- 
Richard Greenwood
www.greenwoodmap.com




More information about the mapserver-users mailing list