How to zoom to place names

Rob Chavez rchavez at perseus.tufts.edu
Wed May 10 10:49:41 PDT 2000


I assume you are using mapscript?

I've done something similar with mapscript.  First a user selects a
placename from an HTML select form that parameter gets passed to the script,
which looks up the placename in an SQL database and grabs the points and the
bounding box; the bounding box gets parsed as the map extent (with a little
padding) and the point is rendered and labeled.  I can post some code, if in
fact you are using mapscript and would like to see it.

One browser problem I've run into and something to consider: very large
select lists sometime break browsers.  I've used a placename list that are
over 2000 items long and had Netscape go down in flames (only on Macs).
This is probably just a simple memory allocation problem, but it does affect
the end user's experience with your work.

Rob Chavez
Programmer
Perseus Project
rchavez at perseus.tufts.edu
http://www.perseus.tufts.edu

----- Original Message -----
From: Doug Nebert <ddnebert at usgs.gov>
To: <mapserver-users at lists.gis.umn.edu>
Sent: Wednesday, May 10, 2000 1:08 PM
Subject: How to zoom to place names


> I have a need to use my map interface in two ways: 1) for the
> geographically literate, let them zoom in by dragging a rectangle and 2)
> for the spatially-challenged have a picklist of places that they can
> click on and have the map zoom to that location upon request.
>
> How should I package and translate such place names (they have envelope
> bounding rectangles associated with them) so that a refresh_map event
> would request a new map to be drawn for that area?
>
> How should I structure the names service? The biggest trick is that I
> have a large number of place names I could bring to use from an online
> gazetteer of 700,000 placenames! But I think I will start small with
> political subdivisions and big cities that only number in the thousands.
>
> Any hints or examples of code as to how I might structure this would be
> most helpful, and the kind of thing I would think many would like to see
> in a demo FAQ.
>
> --
> Douglas D. Nebert
> Clearinghouse Coordinator
> FGDC Secretariat Phone: +1 703 648 4151 Fax: +1 703 648-5755
> Pager Messaging: http://clearinghouse3.fgdc.gov/dougmsg.html




More information about the MapServer-users mailing list