Passing lat/lon to URL

Stephen Lime steve.lime at dnr.state.mn.us
Fri Feb 16 12:52:18 EST 2001


I'm not quite sure I see the problem. If I understand right, then you're using
the map for the user to identify a point correct? There are several ways to
deal with this. The easiest I think would be to create a second, really simple
map file that basically looks like:

MAP
  STATUS OFF # important, you don't want a map created
  UNITS meters # whatever matches the projection

  PROJECTION
    .. set your projection ...
  END

  WEB
    TEMPLATE "http://www.com/form?lat=[maplat]?lon=[maplon]"
  END
END

Then when the user clicks the "Select Location" button you switch mapfiles
to the above one. Then when the user clicks the process uses the simple
mapfile above which simply echos the click as lat/lon. You could also do it
with a query where you have a big simple shapefile that catches clicks any
where and has a similar template to the one above.

Steve

Stephen Lime
Internet Applications Analyst

Minnesota DNR
500 Lafayette Road
St. Paul, MN 55155
651-297-2937

>>> Douglas K. Rand <rand at meridian-enviro.com> 02/15/01 11:22AM >>>
I'm working on a fairly simple map browser that I need to pass a
latitude and longitude to another URL. I've got the browser working
using mapserv with zoom in/out and pan/recenter. What I need to figure
out is how to have another button/selection labled "Select Location"
that will cause the user to be forwarded either to a URL like
"http://www.com/form?lat=47.899474?lon=-96,843673" or to filter a HTML
document changing [maplat] and [maplon] to the lat/lon.

I seem to be stuck on this, any suggestions would be welcome.

Thanks.





More information about the mapserver-users mailing list