Calculating new exents from a mouse click, VB or C# without Mapscript

Chip Taylor work at XWB.COM
Wed Jun 6 10:46:36 PDT 2007


We have our mapserver running on its own server and use it to display maps
in a variety of our products.  Most of the time we use it in mode=map to
simply generate a static image.  When we need to pan, etc, we bring up a
page in browser mode in a frame.

But now I need to be able to add pan and zoom independent of mapserver.
Mapserver will serve up a static image to be displayed on a separate
computer in an application. When the user clicks on that map, I need to be
able to call mapserver to serve up a new static map image based on the click
point.  I am using the static map image as the ImageURL of an asp image
button and capturing the x and y pixel coordinates of the click.  All fine
and good.  And I can calculate the original center point coordinates of the
original map from the mapextents passed to map server.  

Where I get lost is that, while I know the original extents passed to
mapserver (in decimal degrees), I have no idea what the extents of the map
image returned to me are.  So, I cannot calculate how many decimal degrees
are in each pixel, etc and cannot calculate the new extents based on the XY
coordinates of the mouse click.  

I cannot load Mapscript on the application server, nor can I load Mapserver,
dbox, jbox, etc there.  So, how would I go about calculating the new
extents?

Any and all help would be appreciated.

Chip Taylor
Prepared Response, Inc



More information about the MapServer-users mailing list