"map-mode" vers. "browse-mode"
Ed McNierney
ed at TOPOZONE.COM
Tue Aug 17 08:46:40 PDT 2004
Karsten -
Wilkommen! Your problem is with the "IMAGEURL" statement. When MapServer gets a mode=map request, the image data is streamed back directly to the client browser. In a mode=browse request, two new things must happen: the image is written to disk in the IMAGEPATH directory, and the IMAGEURL string is used to generate a URL that points to that image.
You report that you are creating images in the tmp directory, so that's good - but if the URL is incorrect you won't be able to see them. Take a look at the source code of the HTML output, or look at the properties of the missing map image. In either case you should be able to see the <IMG SRC="your tmp file"> tag, and you should see that there is something wrong with that URL - a missing / after the "tmp" is likely. By looking at the incorrect string you should be able to deduce how to change the IMAGEURL to fix it.
If you still have trouble, post the HTML output from your mode=browse request.
- Ed
Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA 01863
ed at topozone.com
(978) 251-4242
-----Original Message-----
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On Behalf Of K. Lessing
Sent: Tuesday, August 17, 2004 11:33 AM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: [UMN_MAPSERVER-USERS] "map-mode" vers. "browse-mode"
Dear List,
my name is Karsten Lessing. This is my first posting to this list, I am not sure if it goes without saying to introduce oneself here ... so I will make that part short:
I studied geography with a main fokus on geoinformatics and remote sensing. Since a couple of days I am trying to get Mapserver 4.2.2 running on SuSE 9.1 with Apache2.
Therefore I installed Apache2 and MapServer locally. Apache and MapServer themself are working fine: The start page of Apache can be displayed with the URL: http://localhost/ MapServers typical error answer: "No query information to decode.
QUERY_STRING is set, but empty" is displayed.
The mapserver is running in the directory: /srv/www/cgi-bin
I built a .map file (baumklassen.map) and a .html template file
(erstes_template.html)
The code of the .map file is:
MAP
NAME SoSo
SHAPEPATH "/srv/www/htdocs/daten"
EXTENT 22 -30 31 -34
STATUS ON
SIZE 300 300
WEB
TEMPLATE /srv/www/htdocs/erstes_template.html
IMAGEPATH /srv/www/htdocs/tmp/
IMAGEURL tmp
END
LAYER
NAME "vegetation"
DATA "vege"
STATUS DEFAULT
TYPE polygon
CLASS
COLOR 250 45 67
END
END
END
The code of the .html template is:
<html>
<head>
<title>das erste Template</title>
</head>
<body><body bgcolor="#FBECA0">
<table>
<td width="700" height="700" colspan="0" rowspan="0" align="center"
valign="middle" bgcolor="#205B8D">
<p><img src="[img]"></p>
</td>
</table>
</body>
</html>
Both are stored in the directory: srv/www/htdocs/ Further more I created a "tmp" directory under /srv/www/htdocs/ to store all temporary built pictures in.
Following URL string displays the data as a picture correctly:
http://localhost/cgi-bin/mapserv40?map=/srv/www/htdocs/baumklassen.map&mode=map
Folling URL (just with the "mode" difference) http://localhost/cgi-bin/mapserv40?map=/srv/www/htdocs/baumklassen.map&mode=browse
displays the contents of the .html file (table background color, etc.) but not the mapdata.
Therefore just an icon is displayed which indicates that anything should be in this place!
Each time activating the MapServer with the second URL string a picture is stored locally in the "tmp" directory
- but obviously, it can not be displayed in the .html file.
Does anybody have an idea why ?
I also downloaded the whole MapServer tutorial 4.0 from:
http://terrasip.gis.umn.edu/projects/tutorial/
and installed it locally (This is also the reason why my mapserver is called "mapserv40" ) As in above described example everthing is fine up to chapter 1.9. In chapter 1.9 the first picture which is generated in "map"-mode is displayed, but not the second one which is generated in "browse"-mode !!!
I already assumed that it could be a authorisation problem. Therefore gave each directory: srv, www, cgi-bin, htdocs, daten, tmp and each above mentioned files all rights with "chmod a+rwx ..." (I know, this can not be a solution ... but just to leave no doupts i did it in this all-embracing way.)
Does anybody have a clue what the answer to my problem could be? Is it just an incomplete .html coding or does it have anything to do with the Apache webserver ...?
best regards
karsten
More information about the MapServer-users
mailing list