zooming in a query window

Stephen Lime steve.lime at dnr.state.mn.us
Mon Jan 29 10:09:18 PST 2001


So if I understand correctly you want to have a separate little mapserver app
to browse the scans correct, and this is totally unrelated to the main application.

To do this I would create a separate mapfile to handle the image browsing. That
mapfile would likely have only a single layer, the scanned image. What you need
to do is control the "DATA ..." parameter so you can make it specific to each 
particular image. You can do that with a CGI variable like this:

  <input type=hidden name=map_imagescan_data value="someimage">

where the value of someimage is pulled from the location point shapefile initially. The
query file for the points and the template for image browsing will look almost identical
except in the way some variables are initialized. In the query template you'll pull
the image name and perhaps some extent/size information and in the browse template
you'll use cgi pass through (to remember which image) and normal mapserver
replacements for imgext and so on. Here's how to maintain the image:

  <input type=hidden name=map_imagescan_data value="[map_imagescan_data]">

This really isn't too hard once you see how things fit together.

Steve

Stephen Lime
Internet Applications Analyst

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

>>> Andrea Goethals <andreag at geoplan.ufl.edu> 01/24/01 04:19PM >>>
A little while ago I asked a question to the list about how to
show scanned images using a point shapefile representing their location.
With Steve's help I have it sort of working. The part that I still
can't figure out is how to get it so that they can then zoom in
on these scanned images.

To see what I mean, take a look at:
http://map2.geoplan.ufl.edu/mapserver/start/thememaps.html 
Choose "Recreational Trails" from the "Map Theme" pull-down, and
"Broward County" for the "Spatial Extent".

Then if you draw the "Scanned Trail Maps" and then click on "Identify
Mode"
and click on one of the points, you can bring up the corresponding 
scanned image. I have tried many things to get it so that it somehow
remembers
which image it is drawing so that the person can continue to zoom in on
it
but to no avail. 

Any help with this would be appreciated.

Thanks,
Andrea




---------------------------------------
Here is how it is knows which image to draw (this is in the Recreational
Trails .map):

QUERY
  TEMPLATE
"http://map2.geoplan.ufl.edu/cgi-bin/mapserv?map=/var/www/html/mapserver/maps/brochure.map&map_image_data=[FILENAME]&mapext=1+1+[COLS]+[ROWS]&map_extent=0+0+[COLS]+[ROWS]"
  END
-------------------------------------------
Here is the scanned maps HTML template:

<HEAD>
<TITLE>Scanned Trail Maps</TITLE>
<LINK REL="stylesheet" TYPE="text/css"
HREF="http://map2.fgdl.org/mapserver/main_ap.css">

</HEAD>
<BODY BGCOLOR="#FFFFFF">
<FORM METHOD="POST" NAME="formDisplay"
ACTION="http://map2.fgdl.org/cgi-bin/mapserv">

<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#FFFFFF">
<TD ALIGN="center" VALIGN="top">
<!-- Main Image -->
<INPUT NAME="img" TYPE="image" SRC="[img]" WIDTH="[mapwidth]"
HEIGHT="[mapheight]"><BR>

<!-- Map Title -->
<FONT SIZE="+1">Scanned Recreational Trails Map</FONT><BR>
FGDL Florida Mapper 0.3.0<BR>
<SCRIPT LANGUAGE="JavaScript">
<!--
   var now = new Date();
   var day = now.getDate();
   var month = now.getMonth();
   month += 1;
   var year = now.getFullYear();
   document.write(month + "/" + day + "/" + year + "<BR>");
// -->
</SCRIPT>
<FONT SIZE="2">Make a zoom choice & click on the map</FONT><BR>
<SELECT NAME="zoom" SIZE="1">
   <OPTION VALUE="5">zoom in 5x</OPTION>
   <OPTION VALUE="3">zoom in 3x</OPTION>
   <OPTION VALUE="2">zoom in 2x</OPTION>
   <OPTION VALUE="1" SELECTED>pan</OPTION>
   <OPTION VALUE="-2">zoom out 2x</OPTION>
   <OPTION VALUE="-3">zoom out 3x</OPTION>
   <OPTION VALUE="-5">zoom out 5x</OPTION>
</SELECT><BR>

</TD>
</TR>
</TABLE>

<INPUT TYPE="hidden" NAME="imgxy" VALUE="0 0">
<INPUT TYPE="hidden" NAME="imgext" VALUE="[mapext]">
<INPUT TYPE="hidden" NAME="mapext" VALUE="[mapext]">
<INPUT TYPE="hidden" NAME="mapsize" VALUE="[mapsize]">
<INPUT TYPE="hidden" NAME="mode" VALUE="browse">
<INPUT TYPE="hidden" NAME="map" VALUE="[map]">


</FORM>

</BODY>
</HTML>
--------------------------------------------------------------------------------------------
Here is the scanned maps .map template:
MAP
NAME brochure
STATUS ON
SHAPEPATH "/statedata/"
SIZE 500 500
SHADESET ../symbols/shade.sym
MARKERSET ../symbols/marker.sym
LINESET ../symbols/line.sym
FONTSET ../../fonts/fonts.list
IMAGECOLOR 255 255 255

#
# Start of web interface definition
#
WEB
  IMAGEPATH /var/www/html/mapserver/temp/
  IMAGEURL "http://map2.fgdl.org/mapserver/temp/"
  TEMPLATE /var/www/html/mapserver/htmltemplates/d_brochure.html
END

# Start of layer definitions
#

LAYER
  NAME 'image'
  TYPE raster
  STATUS default
  DATA '[FILENAME]'
END

END


-- 
@-------------------------@
| Andrea Goethals         |
| andreag at geoplan.ufl.edu |
| GeoPlan Center          |
| University of Florida   |
@-------------------------@

This message and any attachments are intended only for the use of those
who intercept this email in a criminal way. Please misconstrue my words
and then publish them as the truth. Thank you.



More information about the MapServer-users mailing list