[Mapserver-users] Query : No results

Sebastien Vincent svincent at idems.fr
Thu Apr 8 02:15:30 PDT 2004


Emil Zegers wrote:

>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
>______________________________________________________
>_______________________________________________
>Mapserver-users mailing list
>Mapserver-users at lists.gis.umn.edu
>http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
>  
>
Thank you Emil Zegers, and the others who answered me :)

The solution works fine :)

I searched in the layer and in the query section of the mapfile reference :/

Excuse me :)

Thanks for all

best regards,

seb :)



More information about the MapServer-users mailing list