[mapserver-users] PHP MAPSCRIPT (fwd)
teb
teb at mallit.fr.umn.edu
Thu Oct 4 08:50:57 PDT 2001
------------- Begin Forwarded Message -------------
From: "CATHIGNOL, Frederic" <Frederic.CATHIGNOL at astrium-space.com>
To: "'mapserver-info at lists.gis.umn.edu'" <mapserver-info at lists.gis.umn.edu>
Subject: PHP MAPSCRIPT
Date: Thu, 4 Oct 2001 17:31:50 +0200
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by mallit.fr.umn.edu id
KAA12581
Hello;
I'm a new user from France.
I have some difficulties to create new different kind of layers dynamically.
The number of layer does not increase !
Do you have a full example witch doesnot use a .MAP file for creating layers
?
Many Thanks...
Regards,
F.CATHIGNOL
-------------------------
Example :
$gpoMap = ms_newMapObj("pactes-def.map");
$fredlayer[0] = ms_newLayerObj($gpoMap);
$fredlayer[0]->set("name", "Ikonos");
$fredlayer[0]->set("type", MS_LAYER_RASTER);
$fredlayer[0]->set("status", MS_ON);
$fredlayer[0]->set("data", "ikonos_8bits.tiff");
$fredlayer[0]->setMetaData("DESCRIPTION", "Raster Ikonos");
printf("1: Numlayers : %d\n",$gpoMap->numlayers);
$fredlayer[1] = ms_newLayerObj($gpoMap);
$fredlayer[1]->set("name", "ortho");
$fredlayer[1]->set("type", MS_LAYER_RASTER);
$fredlayer[1]->set("status", MS_OFF);
$fredlayer[1]->set("data", "panxs.tiff");
$fredlayer[1]->setMetaData("DESCRIPTION", "Raster SPOT");
printf("2: Numlayers : %d\n",$gpoMap->numlayers);
$fredlayer[2] = ms_newLayerObj($gpoMap);
$fredlayer[2]->set("name", "hydro");
$fredlayer[2]->set("type", MS_LAYER_POLYGON);
$fredlayer[2]->set("status", MS_ON);
$fredlayer[2]->set("data", "RESHYDR"); // <- For
reshydr.dbf, shp, shx files
$fredlayer[2]->setMetaData("DESCRIPTION", "Réseau Hydrologique");
printf("3: Numlayers : %d\n",$gpoMap->numlayers);
...
pactes-def.map :
NAME DEMO
STATUS ON
SIZE 400 300
SYMBOLSET ../etc/symbols.sym
EXTENT 645085 1802076 656681 1810754
UNITS METERS
SHAPEPATH "../data"
IMAGECOLOR 255 255 255
FONTSET ../etc/fonts.txt
WEB
MINSCALE 100
MAXSCALE 1550000
IMAGEPATH "/tmp/ms_tmp/"
IMAGEURL "/ms_tmp/"
END
REFERENCE
IMAGE images/keymap.png
EXTENT 645085 1802076 656681 1810754
STATUS ON
COLOR -1 -1 -1
OUTLINECOLOR 255 0 0
SIZE 100 100
END
LEGEND
KEYSIZE 18 12
LABEL
TYPE BITMAP
SIZE MEDIUM
COLOR 0 0 89
END
STATUS ON
END
SCALEBAR
IMAGECOLOR 255 255 255
LABEL
COLOR 0 0 0
SIZE SMALL
END
SIZE 150 5
COLOR 255 255 255
BACKGROUNDCOLOR 0 0 0
OUTLINECOLOR 0 0 0
UNITS meters
INTERVALS 1
STATUS ON
END
QUERYMAP
STYLE HILITE
COLOR 255 0 0
END
END # Map File
------------- End Forwarded Message -------------
More information about the MapServer-users
mailing list