working with zoompoint using geographic coordinates

Bob Cook bcook at OJCTECH.COM
Fri Aug 27 17:02:02 EDT 2004


I need to perhaps be more specific:

Here is my original question:
> I would like my map of the United States and its territories to have a
> feature that allows a user to type in a latitude and longitude in form
> input fields (e.g., lat: 40N long: 88W), then have the map pan to that
> point, and zoom in.

I am using PHP-Mapscript.

My map is using a projection. (I'm not sure if this is relevant, but I
think it might be).

I know that mapserver can pan and zoom to a given point on the map
(the $mapObj->zoompoint() method will do this), but the point you give
the method seems to need to be a point with x,y coordinates that are
in pixels.

So I need to be able to somehow translate latitude and longitude values
into pixel values..?

Or is there some other way to do get values like 40N, 88W into values
that mapserver can use to create the boundaries (extents) of the map
with the latitude and longitude at its center?

Another way of asking this question might be: how to numbers for latitude
and longitude map onto a mapfile's extent attributes?

Thanks,
-Bob Cook


On Fri, Aug 27, 2004 at 09:40:29PM -0100, Siki Zoltan wrote:
> Hi,
>
> You can do it with cgi mapserver. Check mapxy, scale, mapsize, etc.
> cgi variables. You can create a form with input fileds having the name
> of the mapserver cgi variables (some hidden field neccessary e.g. map) and
> submit it to the maserv cgi. You can use javascript to checkthe input
> values.

Thanks for your quick reply. However, I'm not sure I completely
understand your response. Are you saying that if I use cgi mapserver
that it will automatically translate 40N 88W into a point on the map and
allow me to zoom in with it as the center? Something like:

<form>
.
.
.
<input type="image" name="map" src="[map]"/>
<input type="text" name="latitude" value=""/>
<input type="text" name="longitude" value=""/>
.
.
<input type="submit" name="submitLatLong" value="Submit"/>
</form>

Is all I need? CGI Mapserver will handle the rest?

> On Fri, 27 Aug 2004, Bob Cook wrote:
>
> > I'm relatively new to mapserver, so I may be trying to do something that
> > can't be done easily.
> >
> > I would like my map of the United States and its territories to have a
> > feature that allows a user to type in a latitude and longitude in form
> > input fields (e.g., lat: 40N long: 88W), then have the map pan to that
> > point, and zoom in.
> >
> > Is there any way of doing this?
> >
> > Thanks,
> > -Bob Cook
> >

--
/************************************************************\
* Bob Cook             Software Engineer - OJC Technologies  *
* bcook at ojctech.com    Engineering From the Right Brain      *
*                       217-278-3933                         *
*                                                            *
*         "Kyrie Eleison...Dona Nobis Pacem"                 *
*                                                            *
*                                                            *
\************************************************************/



More information about the mapserver-users mailing list