[Mapserver-users] Reference map to show bounding coordinates extent not map extent

Steve Lime steve.lime at dnr.state.mn.us
Wed Feb 4 22:04:59 PST 2004


You can build your reference maps just as a regular map. I've done that
before. In fact you used to have to if you wanted to do things like
change the representation of the extent based on scale. 

The idea goes like this. In a new mapfile

1) set the main EXTENT to whatever your reference image is
2) set the size to match the reference image
3) add the reference image as a raster layer, make sure to set TRANSFORM
FALSE (this effectively pastes the image in the map)
4) create a layer to draw the extent with, the coordinates will be
supplied dynamically, this might work

LAYER
  NAME 'box'
  TYPE POLYGON
  STATUS OFF
  CLASS COLOR 255 0 0 END
END

5) now, in your template make a call to the mapfile, something like:

http://.../cgi-bin/mapserv?mode=map&map=reference.map&layer=box
&map_box_feature=new&map_box_feature_points=[rawminx]+[rawminy]+[rawminx]+[rawmaxy]+...

Basically you do exactly what MapServer does internally in the reference
map functions, but you force feed it the rectangle of your choice
dynamically. The reference map on this page is built using this
approach:

  http://www.dnr.state.mn.us/maps/tomo.html

Hope this helps!

Steve


>>> <John.Hockaday at ga.gov.au> 02/04/04 11:10 PM >>>
Hi all,

I am using cgi mapserv to identify a bounding box which is used to
define a
region in another application.  I use JavaScript to allow the user to
drag a
bounding box on the [img] and the resulting [rawminx], [rawminy] etc.
coordinates are sent to mapserv which returns an image zoomed into the
selected region.  The image size is fixed so there is some area either
above
and below or to the left and right of the selected region which is
outside of
the area defined by the user.

Mapserv also returns a reference map and the defined area on that map
shows
the extent of the mapserv image but not the extent of the region defined
by
the user.

Are there some parameters that can be sent to a cgi mapserv so that the
reference map indicates the [rawminx], [rawminy], [rawmaxx] and
[rawmaxy]
converted to lats and long instead of the [imgext]?  Or is there some
other
way of creating a reference map with the [imgbox] coordinates and not
the
[imgext] coordinates?

Thanks.


John

_______________________________________________
Mapserver-users mailing list
Mapserver-users at lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users




More information about the MapServer-users mailing list