[mapserver-users] mapserver user can not make the shapefile data correctly show in the browser

Fawcett, David (MPCA) David.Fawcett at state.mn.us
Wed Aug 22 14:04:03 PDT 2012


Yang Li,

You may want to try to use a relative URL for the IMAGEURL.

Try changing it from:

IMAGEURL "/output/"

To:

IMAGEURL "output/"


David.

From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of ??
Sent: Wednesday, August 22, 2012 11:50 AM
To: mapserver-users at lists.osgeo.org
Cc: mapserver-dev at lists.osgeo.org
Subject: [mapserver-users] mapserver user can not make the shapefile data correctly show in the browser


Hello,
respected everyone,

I have a problem when using Mapserver. I just using Maperver to rend an shapefile on ubuntu 12.04. but the expect image is not correctly showing, i think there maybe some problem with my mapfile set, especially with IMAGEURL define?

I use a guide in the link :http://www.gistutor.com/mapserver/3-beginner-mapserver-tutorials/7-how-to-generate-a-simple-map-using-mapserver-and-a-shapefile.html



I assign the mapfile & template.html&start.html in my www DIR,

which is like this:

mapfiel.map:

MAP

NAME parcels_map

STATUS ON

SIZE 420 300

EXTENT 489885 5450946 490904 5451637

UNITS METERS

SHAPEPATH "shapefiles"

IMAGECOLOR 255 255 255

WEB

TEMPLATE "template.html"

IMAGEPATH "/var/www/output/"

IMAGEURL "/output/"

END

LAYER

NAME "parcel_boundaries"

DATA parcels

STATUS DEFAULT

TYPE POLYGON

CLASS

NAME "parcels_color"

COLOR 255 215 0

END

END

# end of map file

END





starrtmap.html:

<html>

<head><title>Creating a simple image using Mapserver and a Shapefile</title></head>

<body bgcolor="#FFFFFF">

<h2>Creating a simple image using Mapserver and a Shapefile</h2>

<p><hr><p>

This page simply contains a link which sends a set of instructions to the Mapserver application using a mapfile.<br />

The information stored within the mapfile tells the Mapserver application how to draw the map.<p>

<!-- The following link sends the local file structure path of the mapfile to the web location of the mapserver executable file -->

<A HREF="http://localhost/cgi-bin/mapserv?map=/var/www/mapfile.map">

Click on this link</A> to view a map generated using a Shapefile.

<p><hr><p>

</body>

</html>



template.html:

<!-- MapServer Template -->

<html>

<head><title>Simple Mapserver Template HTML Document</title></head>

<body bgcolor=#AAAAAA>

<h2>The image below was illustrated based on the instructions sent in the mapfile.</h2>

<!-- When using Mapserver with a template, the Mapserver application looks for the [img] tag within the template document to place the map -->

<img src="/[img]" border=1>

</body>

</html>



when I run the “http://localhost/cgi-bin/mapserv?map=/var/www/mapfile.map” in my address colum.

The expect map is not shown.



The page is showing content of template.html expectly, but there is only a image icon , but with no picture. And the status bar in the firefox brower is showing : conecting to output ..



I notice that in the var/www/output DIR, there have been some png file generated. And is the png containing the polygon in the shapefile. Every time when I click the “http://localhost/cgi-bin/mapserv?map=/var/www/mapfile.map” link, a new png file is generated in output DIR.



I want to know if the IMAGEURL in the mapfile is set wrongly? Why the png is genrated correctly but not showing in the browser? Any one can help me?


--
Yang Li
GIS Developer
P.R.China


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20120822/e5e9cf04/attachment.htm>


More information about the MapServer-users mailing list