[Mapserver-users] Query : No results
Emil Zegers
EZS at DeStraat.NL
Wed Apr 7 13:42:43 PDT 2004
As said by others, you should use the EMPTY object and you can use the
same logic for errors with the ERROR object
WEB
TEMPLATE 'mapdisplay.html'
IMAGEPATH 'c:/inetpub/wwwroot/tmp/'
IMAGEURL '/tmp/'
ERROR 'error_en.htm'
EMPTY 'empty_en.htm'
LOG 'test.log'
END #WEB
Here's an example of 'empty_en.htm' to go back to the previous page.
<html>
<head>
<title>StraGisWeb</title>
<link href="/cgi-bin/default.css" rel="stylesheet" type="text/css"
/>
</head>
</body>
<script type="text/javascript">
var msgError = 'No results. Try another search.';
window.document.write(msgError);
window.alert(msgError);
history.go(-1);
</script>
</body>
</html>
Same for 'error_en.htm'
<html>
<head>
<title>StraGisWeb</title>
<link href="/cgi-bin/default.css" rel="stylesheet" type="text/css"
/>
</head>
<body>
<script type="text/javascript">
var msgError = 'Unkwn error. The previous page will be shown.';
window.document.write(msgError);
window.alert(msgError);
history.go(-1);
</script>
</body>
</html>
Maybe useful.
Emil
>>> Sebastien Vincent <svincent at idems.fr> 4/7/2004 10:00:21 AM >>>
Hello,
I run mapserv 4.0.1 without any problems.
I put the mapserv form and variables in a frame of my webpage. The
tools, reference map, scalebar, layers control etc... are in the main
page. With javascript I change the values of the hidden vars witch are
in the frame and I submit the form. It works pretty fine :)
I can know doing some querys, but when the query have no results,
mapserv return a page, with only a message saying that there is no
results. I want to display in this case, another page (saying "In
French", for my visitors, that the query failed, and reload the map as
it was before the query).
I searched CGI vars, Templates and Map File references. But without
results, searched also and the mailling list archive without more
results.
This is the reason I'm asking you :/
Thanks in advance if you have any advice for me,
best regards,
seb :)
______________________________________________________
This message has been checked for all known viruses
______________________________________________________
More information about the MapServer-users
mailing list