[mapserver-users] Back to basics...
erwin at perik.nu
Thu Sep 12 06:12:21 EDT 2002
Example of creating a layer from a shapefile:
Then did following:
0) Create map-object
1) Get object/points from existing-shapefile or from in this case, your
2) Put it in new-shapefile (as you did in your php-script)
3) Create dbf-file with name of new-shapefile
4) Clear new-shapefile
5) Add new-layer to map-object (default of this layer is set to OFF)
6) Show new-layer (turn it ON)
7) Draw the map (now includes newly created shapefile ;-) )
*** In 0) you use like: $Map = ms_newMapObj("blabla.map");
*** In 1) you determine input. This could be the 3 points you have in
your example, but also could be a shape or lat/lon from a database (eg.
*** Option 2) and 3) and 4) you have in your mapscript. This creates a
shapefile + corresponding dbf-file.
*** Option 5) and 6) is best done using a dummy-layer which is set to
OFF in your map-file. You turn it on AND attach the new shapefile-data
from by using:
$Dummylayer = ms_newLayerObj($Map); // a new layerobject
$Dummylayer = $Map->getLayerByName("MapLayer");
$Dummylayer->set("status", 1); // Turn it on
$Dummylayer->set("data", $shpFname); // Add your created
While your map-layer looks something like:
COLOR 0 0 0
*** Option 7) is something like:
$ImgMap = $Map->draw();
This should do the trick.
From: owner-mapserver-users at lists.gis.umn.edu
[mailto:owner-mapserver-users at lists.gis.umn.edu] On Behalf Of
Sent: donderdag 12 september 2002 0:26
To: mapserver-users at lists.gis.umn.edu
Subject: [mapserver-users] Back to basics...
I'm doing a small personal project where I'd like to search an Oracle
database via a website using Perl/cgi (not too difficult), but then
display the query as points on a (simple) map. The data base is of
historic/prehistoric sites so all I need to map are points. I'm
(gratefully) using an evaluation version of MapInfo Pro 7 and have
access to university servers etc. It seems that MapServer is suited to
this, but my query here is ..er.. how do I get started?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the mapserver-users