So I'm experimenting with MapServer on my notebook with Windows XP SP2, Apache 2.0.54, and MapServer for Windows (MS4W) 1.2.2.
My file placement scheme is fairly complex, because I put map-related files (.MAP, .SHP, etc) and HTML files on different folders. Here's the folders where I put map-related files: C:\mapfiles\mapfile\ C:\mapfiles\shp\ C:\mapfiles\font\ C:\mapfiles\simbol\ And here's the folders where I put HTML templates and TEMP files: C:\ms4w\Apache\htdocs\html\ C:\ms4w\Apache\htdocs\temp\ C:\ms4w\Apache\cgi-bin\ -=> where mapserv.exe resides I do not use absolute folder hierarchy in my URL references, though. Instead, I use relative folder hierarchy. For example, here's how I write the URL on my browser, to call a map file from the folder where mapserv.exe resides (traversing from C:\ms4w\Apache\cgi-bin\to C:\mapfiles\mapfile\): http://localhost/cgi-bin/mapserv.exe?map=../../../mapfiles/mapfile/map01.map&layers=All&mode=map And here's how I specify the SHP folders from my map files. SHAPEPATH "../shp" FONTSET "../font/font.dat" SYMBOLSET "../simbol/simbol.sym" IMAGECOLOR 210 233 255 # biru muda WEB TEMPLATE '../../ms4w/Apache/htdocs/html/map01_tmp1.html' IMAGEPATH '../../ms4w/Apache/htdocs/temp/' IMAGEURL '../../ms4w/Apache/htdocs/temp/' So as you see above, I use relative folder hierarchy to specify those folders (IMO it's a good practice in linux environment). So far, I have created various map files and I haven't had any problems displaying maps (SHP layers) in static mode (&mode=map). Then I tried to use interactive mode (&mode=browse). I have created a map file for that purpose, and I have made the necessary HTML template file and the HTML legends file. I attached those files with this mail: - map file: map01.map - HTML template: map01_tmp1.html - HTML legends: map01_leg.html First, I tested my map file in static mode, and the maps are displayed correctly without problems. However, when I try to call the map file in browse mode, the map just failed to display. All I got is just red "X" where the map should be displayed. (I cannot attach the screenshots because they're larger than 80k) I have confirmed that it is not the problem with my browser; I have tried another browser (Opera) and the problem stays. Besides, non-MapServer web pages (like Google, etc) display pictures with no problem. And when I checked the TEMP folder (C:\ms4w\Apache\htdocs\temp\), MapServer actually CREATED all those temporary GIF files whenever I open the map file using browser mode. In fact, when I view the resulting HTML codes from my browser, the page DOES refer to the temporary .GIF files being created by MapServer. I attached the resulting HTML code as well (03_the_resulting_html_code.txt). Alas, the page just does not display those temporary .GIF files --it just displays all the red "X" marks. So what's wrong here? Is it the fault of my browser? But I have tried other browser and the problem stays. Or maybe because my complex folder scheme? Probably because I use relative folder hierarcy to call the necessary files? But all map files I have created have no problems at all displaying the maps in static mode. Or maybe there's a component I forgot to install? Help! -Kresh __________________________________________________________________ So be it. If saying "NO" means being alone, then to hell with love, with women, with marriage, with God, religions, bars, nightclubs, computer games, and all the shit life keeps pumping at me. I'll walk alone, but with freedom and a healed pride. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
map01.map
Description: 1821074254-map01.map
http://localhost/cgi-bin/mapserv.exe?map=../../../mapfiles/mapfile/map01.map&layers=All&mode=mapTitle: Template Aplikasi MapServer Peta Interaktif
|
Skala |
Tampilan Peta Pilih Tampilan: Perbesaran 4 kali Perbesaran 2 kali Ketengahkan di posisi click Perkecil 2 kali Perkecil 4 kali < br> Legenda [legend] |
[leg_layer_name]
[leg_class_html_visibility_flag=15]
[/leg_class_html]
<!-- MapServer version 4.6.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
OUTPUT=PDF OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=FREETYPE
SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT
SUPPORTS=WCS_SERVER INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL
INPUT=SHAPEFILE DEBUG=MSDEBUG -->
<html>
<head><title>Template Aplikasi MapServer</title></head>
<body><b>Peta Interaktif</b></br>
<!-- Form Utama -->
<form method="GET" action="mapserv.exe">
<input type="hidden" name="map" value="../../../mapfiles/mapfile/map01.map">
<input type="hidden" name="imgext" value="105.060000 -7.860000 108.900000
-5.820000">
<input type="hidden" name="imglb" value="3.84 2.04">
<!-- Table untuk format halaman -->
<table border=1 cellpadding=5>
<tr>
<!-- kolom pertama: peta dan skala -->
<td align=center>
<!-- PETA -->
<input type="image" name="img"
src="../../ms4w/Apache/htdocs/temp/Jabar11927898033924.gif"
style="border:0;width:384;height:204"><br>
<!-- SKALA -->
<b>Skala</b><br>
<img src="../../ms4w/Apache/htdocs/temp/Jabarsb11927898033924.gif"
alt="Skala batang">
</td>
<!-- kolom kedua: listbox zoom level & legenda -->
<td valign=top>
<!--listbox zoom level -->
<b>Tampilan Peta</b><br>
Pilih Tampilan: <br>
<select name="zoom" size="1">
<option value="4" > Perbesaran 4 kali
<option value="2" > Perbesaran 2 kali
<option value="1" selected> Ketengahkan di posisi click
<option value="-2" > Perkecil 2 kali
<option value="-4" > Perkecil 4 kali
</select><
br>
<!-- LEGENDA -->
<FONT SIZE=+1><B>Legenda</B></FONT><BR><HR> <HR>
</td> </tr>
</table>
</form>
</body>
</html>
