I'm using ms4w and working on my local machine and want to build a map like in the MapServer Example 1.9 (https://mapserver.org/tutorial/section1.html).
Unfortunately the HTML template doens't display the image of the map. The map images are only generated and saved in the tmp folder, but not shown in the browser.
My HTML template index.html looks like this:
<form name="mapserv" method="GET" action="http://127.0.0.1/cgi-bin/mapserv.exe">
<!-- HIDDEN MAPSERVER CGI VARIABLES -->
<input type="hidden" name="program" value="http://127.0.0.1/cgi-bin/mapserv.exe">
<input type="hidden" name="map" value="C:/MapServer-Project/myMap.map">
<input type="hidden" name="imgext" value="270353 5135877 931021 6201334">
<input type="hidden" name="imgxy" value="200 150">
<input type="hidden" name="zoom" value="0">
<input type="hidden" name="layer" value="airports">
<input type="hidden" name="mode" value="browse">
<div align="center">
<table border="1" cellpadding="0" cellspacing="0">
<tr>
<td>
<!-- THE INTERACTIVE, DYNAMICALLY CREATED MAP -->
<input type="image" name="img" src=[img] width="400" height="300">
</td>
</tr>
</table>
</div>
</form>
The web definiton in my mapfile myMap.map looks like this:
WEB
TEMPLATE 'index.html'
IMAGEPATH data/tmp/
IMAGEURL tmp
END
Folder structure:
-[]C
-[]MapServer-Project
-index.html
-myMap.map
-[]data
-[]tmp
I think there is a problem with relative paths. I think the img-tag in <input type="image" name="img" src=[img] width="400" height="300">
is not able to find the C:/MapServer-Project/data/tmp
folder.
For exmple somehow I can't use /cgi-bin/mapserv.exe
for <form name="mapserv" method="GET" action="http://127.0.0.1/cgi-bin/mapserv.exe">
. I have to use the http://127.0.0.1
prefix. Otherwise the application can't finde the file.