On Dec 20, 2007 6:20 PM, Ben Madin <[EMAIL PROTECTED]> wrote:
>  G'day all,
>
> I have a list of small polygons spread out over about 2500 kms, and I want
> to be able to zoom to a polygon by choosing it from a list.
>
> The data is all in a postgis database, so I can get the polygon names, gid
> and centroid location.
>
> I had through I would put the names into a select list, and have the gid as
> the option value.
>
> My question is, can I set a centre based on a gid in a call to the cgi, or
> can I put the centroid of the polygon into the options value and append it
> to the cgi call. What is the appropriate format for this?
>
> It is only a small application, and I done similar for other projects in
> php/mapscript, but I would rather stick to the cgi for now.

Using mode=itemnquery is a pretty standard way to do it. Several other
parameters are required. e.g.:

qitem=gid&qlayer=poly_layer&mapext=shapes&qstring=poly_gid

Another way, with PostGIS, you can also query the extent of one or
more polygons and then pass that extent to mapserv with mode=map.

-- 
Richard Greenwood
[EMAIL PROTECTED]
www.greenwoodmap.com

Reply via email to