[mapserver-users] GPX file viewer with mapserver
Alexander Napoleon
vncntt at gmail.com
Thu Mar 13 17:31:17 PDT 2008
Hi,
I want to make a .gpx file viewer with PHP/Mapscript and OGR extension, but
I got errors. Can you give me advices? Do ORG extension of PHP support .gpx
file? Is my map file correct? Thank you very much!
Here is the errors:
-------------------------------------
*Warning*: [MapServer Error]: msDrawMap(): Failed to draw layer named
'12-MAR-08'. in *F:\ms4w\Apache\htdocs\vd\gpx\gpx.php* on line *9*
*Warning*: [MapServer Error]: msOGRFileOpen(): Open failed for OGR
connection `test.gpx'. File not found or unsupported format. in *
F:\ms4w\Apache\htdocs\vd\gpx\gpx.php* on line *9*
*Fatal error*: Call to a member function saveWebImage() on a non-object in *
F:\ms4w\Apache\htdocs\vd\gpx\gpx.php* on line *10
------------------------------------------
*Here is my map file:
-----------------------------------------------
NAME "Europe in purple"
SIZE 400 400
STATUS ON
#SYMBOLSET "/var/www/html/maps/symbols/symbols.sym"
EXTENT 54.288403988 10.519452095 54.361188412 10.601441860
UNITS METERS
#SHAPEPATH "data"
WEB
IMAGEPATH "f:/ms4w/Apache/htdocs/vd/gpx/"
IMAGEURL "/vd/gpx/"
END
LAYER
NAME "test"
TYPE LINE
CONNECTIONTYPE OGR
CONNECTION "test.gpx"
STATUS ON
DATA "0"
#MAXSCALE 8000000
CLASS
STYLE
COLOR 110 50 100
#OUTLINECOLOR 200 200 200
#SYMBOL 0
END
END
END
END
------------------------------
And my php code:
------------------------------
<?php
dl('php_mapscript.dll');
dl('php_ogr.dll');
//phpinfo();
$map_path="F:\ms4w\Apache\htdocs\vd\gpx\\";
$map = ms_newMapObj($map_path."gpx.map");
$image=$map->draw();
$image_url=$image->saveWebImage();
?>
<HTML>
<HEAD>
<TITLE>Example 1: Displaying a map</TITLE>
</HEAD>
<BODY>
<IMG SRC=<?php echo $image_url; ?> >
</BODY>
</HTML>
-------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20080314/c9864ea1/attachment.htm>
More information about the MapServer-users
mailing list