[mapserver-users] Imagemap size doesn't match display map

sscottgis sorenscott at gmail.com
Fri Jan 9 10:47:52 PST 2009


I have created an imagemap/image for the lower 48 states using 2 mapfiles to
define the polygons following the demo in the wiki. They noted that if you
use separate maps, the SIZE and EXTENT should be the same. I have those set
the same in both files, but the imagemap that gets returned is vertically
squished.

Here's the map file for the imagemap layer:

MAP
NAME "droughtplan_imgmap"
STATUS ON
SIZE 500 275

# set projection for map
PROJECTION
  "init=epsg:4326"
END

EXTENT -126 24 -66 50 
UNITS METERS
STATUS ON
IMAGECOLOR 255 255 255

WEB
  IMAGEPATH "e:/ms4w/tmp/ms_tmp/"
  IMAGEURL "/ms_tmp/"
END

#QUERYMAP
#  STATUS ON
#  STYLE NORMAL
#END

LAYER
  NAME "droughtplans_imgmap"
  STATUS DEFAULT
  TYPE POLYGON
  DATA "../data/droughtplans_imgmap"
    TEMPLATE "planbody.html"
    HEADER "planheader.html"
    FOOTER "planfooter.html"
    
  CLASSITEM "State"
  	CLASS
  	  COLOR -1 -1 -1
  	  NAME "State"
  	  OUTLINECOLOR 110 110 110
  	END
  END
END
END

and the file for the display layer:
MAP
NAME "droughtplan_wms"
STATUS ON
SIZE 500 275

# set projection for map
PROJECTION
  "init=epsg:4326"
END

EXTENT -126 24 -66 50 
UNITS METERS
STATUS ON
IMAGECOLOR 255 255 255

# image format
OUTPUTFORMAT
  NAME png
  DRIVER "GD/PNG"
  MIMETYPE "image/png"
  IMAGEMODE RGB
  EXTENSION "png"
END

WEB
  IMAGEPATH "e:/ms4w/tmp/ms_tmp/"
  IMAGEURL "/ms_tmp/"
  HEADER "../templates/query_header.html"
  FOOTER "../templates/query_footer.html"
END

QUERYMAP
  STATUS ON
  STYLE NORMAL
END

LAYER
  NAME "droughtplans"
  STATUS DEFAULT
  TYPE POLYGON
  DATA "../data/droughtplans"
  
  DUMP TRUE
  
  HEADER ../templates/ndmc_query_header.html
  TEMPLATE ../templates/ndmc_query_body.html
  
  CLASSITEM "Status"
  	CLASS
  		COLOR 255 255 255
  		OUTLINECOLOR 110 110 110
  		EXPRESSION "0"
  		NAME "No Plan"
  		SYMBOL 0
  	END
  	CLASS
			COLOR 139 209 0
			OUTLINECOLOR 110 110 110
			EXPRESSION "1"
			NAME "Emphasizing Mitigation"
			SYMBOL 0
  	END
  	CLASS
			COLOR 255 255 0
			OUTLINECOLOR 110 110 110
			EXPRESSION "2"
			NAME "Emphasizing Response"
			SYMBOL 0
  	END
  	CLASS
			COLOR 255 128 0
			OUTLINECOLOR 110 110 110
			EXPRESSION "3"
			NAME "Emphasizing Disaster"
			SYMBOL 0
  	END
  	CLASS
			COLOR 255 0 0
			OUTLINECOLOR 110 110 110
			EXPRESSION "4"
			NAME "Local Plans"
			SYMBOL 0
  	END
  END
END
END

The header and footer are the basic <map> tags described in the wiki, but
with the map height and width set to the 500, 275 dimensions from the files. 

Here's the body template:
<area shape="poly" coords="[shpxy precision=0 proj=image]"
href="http://myserver/Resources/state.aspx?state=[State]" title="[State]"
alt="[State]">

 and the call to the image layer (these are part of an ASP.NET 2.0 web page
and added as part of an httprequest):

http://myserver/cgi-bin/mapserv.exe?map=/ms4w/apps/drmon/service/droughtplans_wms.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=droughtplans&WIDTH=500&HEIGHT=275&srs=EPSG:4326&styles=default&format=image/png&bbox=-126,24,-66,50

I've got the extents and sizes set to the same 500, 275 dimensions
everywhere, but the imagemap is still flattened (more like a box at 500 x
200). Everything else works fine--all of the areas are defined, the links
work,etc; it just isn't aligned properly. Is there something missing or
something else going on here? 

Any help/ideas are greatly appreciated.
Soren
-- 
View this message in context: http://n2.nabble.com/Imagemap-size-doesn%27t-match-display-map-tp2134663p2134663.html
Sent from the Mapserver - User mailing list archive at Nabble.com.




More information about the MapServer-users mailing list