[Mapserver-users] Any One Plz?
Dwijadas
Dwijadas
Fri May 23 02:54:53 PDT 2003
Hi
list users
I mailed earlier about the problem i am facing but no one has
given any reply. So Plz this time I am expecting to get support
from someone of you.
PROBLEM1:-
I am using mapserver3.5 and new to it. I had already
displayed a single layer and then multilayer, labels. Now I am
trying for selecting layers through interactive interface with
facilities of zooming and panning. I have written the mapfile and
template
fie(both given below). In the template file in the [ ] portion, i
have used the values directly. e.g in ["map"] i have given
["c:\program....\templ.map"] (See below in the template file).
So whatever the layer i select with the corresponding zooming the
images are formed in the "images" directory under the web server.
The problem is that the image is not displayed in the browser. So
Plz. tell me where is the problem? I have read the CGI reference
variables. But not finding any way to fetch the image in the
browser.
My Mapfile:-
NAME templ
EXTENT 2700051.860 2462746.020 3582564.801 3012459.468
SIZE 400 300
SHAPEPATH "C:\Program Files\Apache Group\Apache2\htdocs\shape"
FONTSET "C:\Program Files\Apache
Group\Apache2\htdocs\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 ".\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
AND 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>
<! THE PROBLEM IS HERE IN THE NEXT TWO LINE>
<input type="image" name="img" src= "[img]">
<! <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>
PROBLEM2:-(If i donot used the values inside [ ] directly)
I have tried with [ ] also AS 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 file i have written
like this-
<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 which you refers in the
mail.
But probably i messing it up. So here mainly I am unable to
use the CGI variables properly, and in what CGI variables, and
where to write so that i can select a layer with zooming
facilities and mainly to display the image in the browser.
"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