Create a polygon layer using PHPMAPSCRIPT
Murat BEYHAN
beyhan at DEPREM.GOV.TR
Thu Oct 5 06:28:26 PDT 2006
Dear Friends;
I would like to make a polygon layer by using phpmapscript.
By the following php code code its not create any error.
But the layer could not be vieved on the map.
Actually I would like to make an expression that only one border of the
district will be drawn on the map since you selected the name of the district
from the database and there are two way to draw layer of the polygon, one is
to send the name of the district to the map and onether is create the layer
for that district on php. Am I rigth?
I really don't have any idea which way is acceptable for that. On the map file
the layer for the whole districts already drawn by the following
LAYER # ilceler
NAME district
DATA tr_ilce_siniri_dd
STATUS on
TYPE LINE
CLASSITEM "ILCE_AD"
CLASS
NAME "ILCE SINIRLARI"
### expression ('[il_adi]' eq '$iladi)
COLOR 211 211 211
OUTLINECOLOR 230 230 250
END # end of States class object
END # end of layer object
But I would like to draw a district highlighted on the map in order to see
easily than other district.
By using expression it is easy but The name of the district will be a variable
on php. Users on the net for accessing to draw their district. The name of the
district comes to php code as $iladi by querying mysql select expression.then
the name of the district will be hihglighted on the map.
I have tried the following but I couldn't construct how I will create polygone
layer on the php mapscript
any idea will be appreciated...
Thankyou
Murat
$layer = ms_newLayerObj($map);
$layer->set("name", "polygon");
$layer->set("data", "tr_ilce_siniri_dd");
$layer->set("type", MS_LAYER_POLYGON);
$layer->set("status", MS_ON);
$class = ms_newClassObj($layer);
$class->set("status", MS_ON);
$class->setExpression("'[ilce_ad]' EQ $ilceadi");
$class->label->set("type", MS_TRUETYPE);
$class->label->set("font", 'arial');
$class->label->color->setRGB( 200,200,200);
$class->label->outlinecolor->setRGB(255, 255, 255);
$class->label->set("size", 12);
$class->label->set("position", 9);
$style = ms_newStyleObj($class);
$style->set("symbol", $map->getsymbolbyname( 'cline'));
$style->set("size", 8);
$style->color->setRGB( 200,200,200);
$style->outlinecolor->setRGB(255, 255, 255);
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
More information about the MapServer-users
mailing list