Zoom to location by name or other parameter using cgi mapserv
Ben Madin
ben at REMOTEINFORMATION.COM.AU
Fri Dec 21 05:18:08 PST 2007
Thanks for your help Richard, I think I am closer, but I haven't got
it yet to the point I can write it up!
After struggling to work out the validation thing, I can run the
script, but as soon as I use mode=itemquery I return a list of
locations, and a querymap, beautifully shrunk down to show only the
polygon I am interested in.
However, I was hoping to be able to use this function in the main
window - as an example say I was looking for roadside stops by name,
it could then "zoom" me to the one I wanted, and I could continue
panning or zooming.
http://remote.local/cgi-bin/mapserv?
layer=coastline&layer=roads&layer=location
&layer=stops&mode=itemquery&qlayer=stops&qstring=gid=342
&map=%2FLibrary%2FWebServer%2FDocuments%2Froads%
2Froads.map&mapext=shapes&iw=650&ih=550
but if I use mode=browse, I just get my normal interface, with a
quarter of Australia to zoom in from!
I'm guessing the better option may just be to make the select list
with the extents of each object, queried from the database, so when
the form is submitted that is the mapext value.
cheers
Ben
On 21/12/2007, at 10:38 AM, Richard Greenwood wrote:
> 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
> richard.greenwood at gmail.com
> www.greenwoodmap.com
--
Ben Madin
REMOTE INFORMATION
t : +61 8 9192 5455
f : +61 8 9192 5535
m : 0448 887 220
Broome WA 6725
ben at remoteinformation.com.au
Out here, it pays to know...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20071221/6d23fe53/attachment.htm>
More information about the MapServer-users
mailing list