Bug? MapServer as an html <img .. > source
Ethan Alpert
ealpert at DIGITALGLOBE.COM
Fri Nov 19 18:39:14 PST 2004
Two STYLE blocks in your LAYER definition seem suscpicious. What happens if you set up the class like:
CLASS
NAME "Forest Fire Areas"
COLOR 200 110 110
OUTLINECOLOR 100 100 100
END
BTW, If you get a red X when using a <img> tag. Type the src part directly into the browser. ie:
http://yourmachine/cgi-bin/mapserv.exe?&mode=map&mapext=XX XX XX XX&map=[map]
&map_SIZE=125 75&layer=Forest_Fires_1965-2003'
This way you get an error message (hopefully). If you don't you might need to look at your webbrowser error log.
-e
________________________________
From: UMN MapServer Users List on behalf of Ken Lord
Sent: Fri 11/19/2004 7:27 PM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: [UMN_MAPSERVER-USERS] Bug? MapServer as an html <img .. > source
I use mapserver to generate thumbnail images in query result pages, using
mapserver as the source for an html <img ...> tag.
This has worked fine in MapServer 3.6 CGI without errors. I've used
variables passed in the URL to layers with filteritems to have the queried
features shown alone with background layers, used URL parameters to modify
the map file dynamicaly to embed and resize the scalebar, and added a cross
hair to center of the image using the map_webuser.. URL parameters.
I'm now trying to do the same with MapServer 4.2.0 CGI. using the same
polygon dataset as I was using in 3.6. It is not working consistantly.
It will work generating an image for some polygons, fail - not returning an
image when other polygons in the same layer are queried, and work for other
polygons in the same layer if you click in just the right place within
them. For all these queries, all the other attributes queried are being
returned correctly in my template. Restarting the server had the effect of
shuffling the polygons that would and wouldnt work.
I have simplified the image source string down to only the problem layer,
with no filtering, and only the parameters necessary to create the image.
Simplified, the img tag looks like this:
<img src='../scripts/mapserv.exe?&mode=map&mapext=XX XX XX XX&map=[map]
&map_SIZE=125 75&layer=Forest_Fires_1965-2003'>
The mapext gets filled in by javascript.
If I change it so that it displays some other background layer, but not the
layer being queried, the image returns properly everytime.
The layer within the mapfile looks like this:
LAYER
NAME Forest_Fires_1965-2003
TYPE POLYGON
STATUS ON
DATA "nt_FFIRES_a"
HEADER "results/Forest_Fires_1965-2003_header.html"
TEMPLATE "results/Forest_Fires_1965-2003_results.html"
TOLERANCE 2
TOLERANCEUNITS pixels
PROJECTION
"init=EPSG:26910"
END
CLASS
NAME "Forest Fire Areas"
STYLE
COLOR 200 110 110
END
STYLE
OUTLINECOLOR 100 100 100
END
END
END
I can't figure out why it works sometimes ... instead of always or never.
It is the identical dataset that works everytime for the same use with
mapserver 3.6. The shapefile is about 9mb of very irregular polygons.
Is this a new bug? has it already been fixed in 4.4? Will I have to keep a
set of 3.6 files in place just to make the thumbnails?
Any ideas would be appreciated, the thumbnails add a lot of power to the
query result pages.
Thanks,
Ken Lord
Vancouver BC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20041119/f1b1c686/attachment.htm>
More information about the MapServer-users
mailing list