[Mapserver-users] To mapserver Users

Dwijadas Dwijadas
Tue May 20 04:51:37 EDT 2003


Hello
      Users
           I am using mapserver3.5 which is working nicely and 
displaying
the multiple layers, labels etc in the browser.

         Now I want to add the functionality of layer_select, Pan 
, Zoom
etc based on the layer selected by a user. I have written two 
files one
map file another template file.But in the browser window the 
layers are
not displayed, Also Is it necessary to have a raster image on the 
background when i use layer_select , pan , zoom etc. Even no 
error
message is given in the browser.you can assume that the path names 
are correct. If anyone read this mail plz just tell me what is the 
wrong with it?and how to to do that by plain mapserv.exe or 
mapserv. Also is it necessary to have a mapscript for this type of 
example. I am generating the maps using the tutorials provided in 
the   http://terrasip.gis.umn.edu/tutorial

My map file is like:-(BASED ON THE TUTORIAL PROVIDED IN THE ABOVE 
URL)

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 "/home/hemen/symbols/symbols35.sym"

  WEB
    TEMPLATE templ.html
     IMAGEPATH "/images/"
     IMAGEURL "/temp/"
  END

LEGEND
    STATUS ON
     LABEL
    TYPE BITMAP
     COLOR 0 0 0
     SIZE TINY
     ANTIALIAS TRUE
    END
  END
  #REFERENCE
    #STATUS ON
    #IMAGE "./images/assamt.jpg"
    #SIZE 150 113
    #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
    STATUS ON
   TYPE LINE
   # CLASSITEM "dist_nam"
     CLASSITEM "length"

      CLASS
       NAME "length2"
       EXPRESSION  '/1*/'
       COLOR 240 240 240
       OUTLINECOLOR 0 0 0
     END # end of States class object
  END # end of layer object

  LAYER   # Shaded Relief Raster
     NAME relief
     DATA "/assamt.tif"
     STATUS ON  #
    TYPE RASTER
   END

LAYER
  NAME "river features"
      DATA assm-rvr
      STATUS ON
      TYPE LINE
      CLASSITEM "rvr_nm"
     CLASS
       NAME "Barak"
         EXPRESSION ('[rvr_nm]' = 'Barak')
        COLOR 164 164 255
     END
     CLASS
     NAME "Brahmaputra"
       EXPRESSION ('[rvr_nm]' = 'Brahmaputra')
       COLOR 64 64 255
      END
    CLASS
      NAME "Subansiri"
      EXPRESSION ('[rvr_nm]' = 'Subansiri')
      COLOR 210 235 255
     END
    CLASS
       NAME "Burhi Dihing"
       EXPRESSION ('[rvr_nm]' = 'Burhi Dihing')
       COLOR 128 128 220
     END
  CLASS
    NAME "Manas"
   EXPRESSION ('[rvr_nm]' = 'Manas')
   COLOR 200 128 255
END
CLASS
   NAME "Lohit"
   EXPRESSION ('[rvr_nm]' = 'Lohit')
  COLOR 200 128 255
END
END  # end of river features layer

LAYER
    NAME states
    DATA assam_a
    STATUS OFF
    TYPE LINE
    CLASSITEM "dist_nam"
    CLASS
    NAME "state"
    EXPRESSION '/C*/'
     COLOR 0 0 0
    END # end of States class object
END # end of layer object

LAYER # States Labels
   NAME "assam_a"
   DATA assam_a
   STATUS OFF
   TYPE ANNOTATION
   LABELITEM "dist_nam"
   CLASSITEM "state"
   CLASS # States class
   EXPRESSION '/C*/'
   COLOR  -1 -1 -1
     LABEL
     COLOR 132 31 31
     SHADOWCOLOR 218 218 218
     SHADOWSIZE 2 2
     TYPE BITMAP
     SIZE TINY
     ANTIALIAS TRUE
     POSITION CC
     PARTIALS FALSE
     BUFFER 2
   END # end of label
   END # end of States class object
  END # end of layer object
  END # end of map fil

*********************************************************************************
And the template file is----------

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<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="imgxy" value="199.5 149.5">
    <table border=1 cellpadding=3>
     <tr>
    <td align=center>
      <input type="image" name="img" src="/images/" border="0">
     </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="air_port"[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="/lgnd/">
         <p align="center"> <img src="/refrnce/">
       </td>
    </tr></table>
</form>
</body>
</html>


*************************************************************************************************

                                    From

                                 "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