[Mapserver-users] trying to start - mapserver and php Mapscript
David Fawcett
David.Fawcett at state.mn.us
Thu Jul 22 11:55:49 PDT 2004
Leonardo,
A couple of things that I see with a quick scan.
1. IMAGEURL
You have IMAGEURL "c:/temp/", this looks like a path to me. You want to use a URL. e.g.
IMAGEURL "/tmp/" where /tmp/ is a directory in your Web root.
2. Because you are only displaying one data layer, comment out your projection info until you get your application working. There is no need for projection info until you are displaying multiple layers of different projections.
3. Change the STATUS of your layer 'quadras' to DEFAULT.
David.
David J. Fawcett
MN Office of Environmental Assistance
>>> <leonardovilela at cdlbh.com.br> 7/22/2004 11:32:09 AM >>>
Hello, I´m Leonardo Vilela, from Brazil and need too help.
I´m trying to disponibilize a map that I have in shapefile in web with mapserver.
I´m studying the mapserver's features and reading the documentation, but it´s being very dificcult and i think that i need help.
There are some questions that I need to understand, and I expect that someone can help me:
1 - I´ve downoloaded a dll file called php_mapscript_42.dll and put it in php's extension dir, the demos of mapserver worked correct, but others examples that i study uses a archive called php_mapscript.so, what is php_mapscript.so? I need this to run In a apache/php server on windows?
2 - I have a shapefile that contains all squares of a town, I want try to view it with mapserver.
I do a .map file with the projections of the place that i found in http://mapserver.gis.umn.edu/doc40/proj.html , and create a simple file in php to generate a image.
The image was blank. There wasn´t error messages, but there wasn't any polygons...
I´m sending a copy that a file to yours, and i expect that someone can help me.
Thank´s a lot:
MAP FILE
MAP
NAME quadras
STATUS ON
SIZE 800 500
IMAGETYPE PNG
IMAGECOLOR 240 240 240
SHAPEPATH "/mapserver/"
EXTENT -8000000 300000 5000000 1500000
UNITS METERS
PROJECTION
"proj=utm"
"zone=23"
"south"
"ellps=GRS67"
"towgs84=-57,1,-41,0,0,0,0"
"units=m"
"no_defs"
END
WEB
IMAGEPATH "c:/temp/"
IMAGEURL "c:/temp/"
END
LAYER
NAME "quadras"
TYPE POLYGON
STATUS ON
DATA "quadras"
PROJECTION
"proj=utm"
"zone=23"
"south"
"ellps=GRS67"
"towgs84=-57,1,-41,0,0,0,0"
"units=m"
"no_defs"
END
CLASS
NAME "quadras"
OUTLINECOLOR 60 60 60
COLOR 255 255 0
SYMBOL 0
END
END
LAYER
NAME "credits"
STATUS DEFAULT
TRANSFORM FALSE
TYPE ANNOTATION
FEATURE
POINTS
10 480
END
TEXT 'Made with Mapserver.'
END
CLASS
LABEL
TYPE BITMAP
POSITION CR
COLOR 0 0 0
END
END
END
END
PHP FILE
<?php
$map_file="quadras.map";
$map = ms_newMapObj($map_file);
$image=$map->draw();
$image_url=$image->saveWebImage();
?>
<HTML>
<HEAD>
<TITLE>Quadras</TITLE>
</HEAD>
<BODY>
<img SRC="<?php echo $image_url?>">
/a></h2>
</BODY>
</html>
More information about the MapServer-users
mailing list