ref.x, ref.y
Stephen Lime
steve.lime at dnr.state.mn.us
Wed Mar 15 14:19:21 PST 2000
Image coordinates are to be expected. Ref.x and ref.y are the coordinates of the mouse
click and are converted to map coordinates on the server. I think the problem is that you
haven't specified a size (eg. SIZE 100 125) in the reference object. It could be grabbed
from the image itself I suppose (requires opening the file an extra time) but at this point
it needs to be hardcoded in the map file.
Steve
>>> RAldridge <RAldridge at linuxstart.com> 03/15/00 04:07PM >>>
I'm trying to use my reference map as an input image that will pan the main map to be centered on the point that is clicked on the reference map. When I click on the reference map, however, the coordinates for ref.x and ref.y appear to be in image coordinates rather than map coordinates. I end up with a blank image for my main map. Below is a snippet from my .map file. Any help is appreciated.
Thanks,
Robert Aldridge
#
# Start of map file
#
NAME DEMO
STATUS ON
SIZE 350 500
SHADESET ../symbols/shade.sym
MARKERSET ../symbols/marker.sym
LINESET ../symbols/line.sym
EXTENT 254189.000000 1117801.000000 292781.000000 1151833.000000
UNITS FEET
SHAPEPATH "data"
IMAGECOLOR 255 255 255
# LABELOVERLAP FALSE
#
# Start of web interface definition
#
WEB
HEADER demo_header.html
TEMPLATE demo.html
EMPTY "/gspc_demo/empty.html"
MINSCALE 1000
MAXSCALE 1550000
IMAGEPATH "/www/htdocs/temp/"
END
#
# Start of reference map
#
REFERENCE
IMAGE graphics/reference_base.png
EXTENT 254189.000000 1117801.000000 292781.000000 1151833.000000
STATUS ON
COLOR -1 -1 -1
OUTLINECOLOR 255 0 0
END
#
# Start of legend
#
LEGEND
KEYSIZE 20 15
# IMAGECOLOR 196 196 196
LABEL
TYPE BITMAP
SIZE MEDIUM
COLOR 0 0 89
END
STATUS ON
END
#
# Start of scalebar
#
SCALEBAR
IMAGECOLOR 255 255 255
LABEL
COLOR 0 0 0
SIZE SMALL
END
SIZE 250 5
COLOR 255 255 255
BACKGROUNDCOLOR 0 0 0
OUTLINECOLOR 0 0 0
UNITS MILES
INTERVALS 3
STATUS ON
END
#
# Start of layer definitions
#
LAYER
NAME "Base"
TYPE POLYGON
More information about the MapServer-users
mailing list