[Mapserver-users] Reply it

Dwijadas Dwijadas
Fri May 23 02:41:58 EDT 2003


Hi
   Anyone there

Problem1:-

   I have trying to select layers using layer_select with zoom,
pan facilities using [ ],as the values between [ ] will filled 
up
by the mapserver from URL and .map file. But it is giving an 
error
message which  is like "msLoadMap(): Unable to access file.
Illegal mapfile name". I have even tried  with terrasip's 
examples
also. The problem remains same. In template form i have written
like this-(Template file using [map], [imgext] etc)

                 <form method="GET"
action="/cgi-bin/mapserv.exe">
     <input type="hidden" name="map" value= "[map]">
     <input type="hidden" name="imgext" value="[imgext]">
     <input type="hidden" name="imgxy" value="[imgxy]">
                  ................
                  ................
     <input type="image" name="ref" src="[ref]">
                  ...............
                  ...............
     <...... <img src="[legend]">

    Considering the CGI variable [map] in the template file,
Mapserver should atleast know the value of the "map" then it
should replace it. But from where and which portion of the 
mapfile
the mapserver will find the value of map?????(Probably form NAME
at the first line of the mapfile) then probably i have to give a
mappath like shapepath?

           Please tell me from which portion of the map file 
these
values([ ]) will come???? whether these values will be within 
the
WEB .....END structure ?? I am totally confused. I have gone
through the Mapserver CGI variables.But probably i messing it
up.And lastly, as i had putted these values directly earlier
without using [ ], but the images are formed in the images
directly. As there are lot of images are formed how mapserver 
will
fetch the latest image from images directly?

problem2:-

     Here my images are formed in the "images" directory under
"htdocs" directory. But the image is not displayed in the 
browser.I have used the values directly in the template file(map, 
imgext etc).
Where is the error? My template file and mapfile are given 
below-

  TEMPLATE FILE:-
  html>
   <head>
     <title>Through template file </title>
  <!  <link type="text/css" rel="stylesheet"
href="/projects/tutorial35/ms35.css" />
   </head>
   <body>
     <p>
     <form method="GET" action="/cgi-bin/mapserv.exe">
     <input type="hidden" name="map" value="c:\Program
Files\Apache Group\Apache2\htdocs\templ.map">
      <input type="hidden" name="imgext" value= "2700051.860
2462746.020 3582564.801 3012459.468">
     <input type="hidden" name="mapext" value= "2700051.860
2462746.020 3582564.801 3012459.468">
     <input type="hidden" name="imgxy" value="199.5 149.5">
    <! <input type="hidden" name="imgxy" value="[imgxy]">
    <table border=1 cellpadding=3>
     <tr>
    <td align=center>
   <! <input type="image" name="img" src= "[img]">
<!HERE IS THE PROBLEM >
    <input type="image" name="img" src= "c:\Program Files\Apache
Group\Apache2\htdocs\images\">
     </td>
      <td valign=top> <font size=+1 face=arial,helvetica>Map
Controls</font>
      <center><p> Select layers to display:<br>
      <select multiple name="layer">
      <option value="assam_a"[assam_a_select]> District Head
Quarters
       <option value="assm-rvr"[assm-rvr_select]> Rivers
       <option value="airport"[air_port_select]> Airports
        </select>
         <br>
         <br>
          Set your zoom option:<br>
        <select name="zoom" size="1">
         <option value="10" [zoom_10_select]> Zoom in 10 times
         <option value="8" [zoom_8_select]> Zoom in 8 times
            <option value="4" [zoom_4_select]> Zoom in 4 times
            <option value="3" [zoom_3_select]> Zoom in 3 times
            <option value="2" [zoom_2_select]> Zoom in 2 times
             <option value="1"  [zoom_1_select]> Recenter Map
           <option value="-2" [zoom_-2_select]> Zoom out 2 times
             <option value="-3" [zoom_-3_select]> Zoom out 3
times
            <option value="-4" [zoom_-4_select]> Zoom out 4
times
            <option value="-8" [zoom_-8_select]> Zoom out 8
times
            <option value="-10" [zoom_-10_select]> Zoom out 10
times
          </select>
          <br>
           <br>
          <input type="submit" name="submit"
value="Redraw"></center>
       <hr>
       <p align="center"><font
face=arial,helvetica><b>Legend</b></font><br>
          <img src="c:/Program Files/Apache
Group/Apache2/htdocs/lgnd/">
         <p align="center"> <img src="c:/Program Files/Apache
Group/Apache2/htdocs/images/">
       </td>
    </tr></table>
</form>
</body>
</html>


    MAP FILE:-
NAME  templ
EXTENT 2700051.860 2462746.020 3582564.801 3012459.468
SIZE 400 300
SHAPEPATH  "C:\Program Files\Apache Group\Apache2\htdocs\shape"
#FONTSET "/home/hemen/fonts/fonts.list"
#SYMBOLSET "C:\Program Files\Apache
Group\Apache2\htdocs\symbol\circle.sym"

  WEB
     TEMPLATE  templ.html
      IMAGEPATH  "C:\Program Files\Apache
Group\Apache2\htdocs\images\"
      #   IMAGEURL "C:\Program Files\Apache
Group\Apache2\htdocs\images\"
      IMAGEURL  ".\images\"
      LOG  "C:\Program Files\Apache
Group\Apache2\htdocs\fonts\log1.txt"
  END

# REFERENCE
  #  STATUS ON
  #  IMAGE "C:\Program Files\Apache
Group\Apache2\htdocs\images\assamt.gif"
  #  SIZE 10 10
  #  EXTENT 2700051.860 2462746.020 3582564.801 3012459.468
  # COLOR -1 -1 -1
  #  OUTLINECOLOR 255 0 0
  #END

LAYER # States -- background polys
    NAME states
    DATA assam_a
    STATUS DEFAULT
   TYPE POLYGON
   CLASS
     COLOR 255 255 135
     OUTLINECOLOR 0 0 0
     END # end of States class object
  END # end of layer object

   LAYER
      NAME "assm-rvr"
      DATA assm-rvr
      STATUS DEFAULT
      TYPE LINE
      CLASS
      COLOR 100 100 100
      OUTLINECOLOR 0 0 0
      END # end of class object
   END # end of layer object

LAYER
      NAME "dist-hq"
      DATA dist-hq
      STATUS DEFAULT
      TYPE POINT
      CLASS
      COLOR 100 100 100
      OUTLINECOLOR 0 0 0
      END # end of class object
   END
  END # end of layer object
  END # end of map file


                                           Thanking you
                                          "Dwijadas Dey"

___________________________________________________
Get email that means BUSINESS! me @ mycompany.com.
Just Rs.1499/year.
To start, click http://www.rediffmailpro.com




More information about the mapserver-users mailing list