[Mapserver-users] simple php/mapscript question

Murat Isik muratisik at megatek.com.tr
Tue Feb 17 08:08:16 EST 2004


This is a multi-part message in MIME format.

------=_NextPart_000_03A3_01C3F567.DF0B4440
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


Hello,

I am trying to build a php site with mapscript. So far it goes good but =
in order to have variable SIZE or COLOR settings for different =
situations I have to create multiple layers with almost same settings =
but with different names. For example this is one of them:

LAYER
  NAME roads6
  TYPE line
  STATUS OFF
  DATA ROADS_polyline
  LABELCACHE ON
  LABELITEM 'Name'
  CLASS
   NAME 'Roads'
   COLOR 55 60 223
    LABEL
      TYPE truetype
#      FORCE true
      FONT arial
      COLOR 0 0 0
      ANGLE AUTO
      POSITION AUTO
      MINSIZE 2
      SIZE 6
   END
  END
END


Within php I know how to make a layer ON:

$layer =3D $map->getLayerByName(roads6);
$layer->set("status", MS_ON);

Just like that, what are the ways to set the both COLORs and SIZE? I =
wish the mapserver site had more examples :(

Have a nice day.

Murat Isik


------=_NextPart_000_03A3_01C3F567.DF0B4440
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.3813.800" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV>&nbsp;</DIV>
<DIV><FONT size=3D2>Hello,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=3D2>I am trying to build a php site with mapscript. So =
far it goes=20
good but in order to have variable SIZE or COLOR settings for different=20
situations I have to create multiple layers with almost same settings =
but with=20
different names. For example this is one of them:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=3D2>LAYER<BR>&nbsp; NAME roads6<BR>&nbsp; TYPE =
line<BR>&nbsp;=20
STATUS OFF<BR>&nbsp; DATA ROADS_polyline<BR>&nbsp; LABELCACHE =
ON<BR>&nbsp;=20
LABELITEM 'Name'<BR>&nbsp; CLASS<BR>&nbsp;&nbsp; NAME =
'Roads'<BR>&nbsp;&nbsp;=20
<STRONG>COLOR 55 60 223</STRONG><BR>&nbsp;&nbsp;&nbsp;=20
LABEL<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TYPE=20
truetype<BR>#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FORCE=20
true<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FONT=20
arial<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <STRONG>COLOR 0 0=20
0</STRONG><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ANGLE=20
AUTO<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; POSITION=20
AUTO<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MINSIZE=20
2<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <STRONG>SIZE =
6</STRONG><BR>&nbsp;&nbsp;=20
END<BR>&nbsp; END<BR>END<BR></FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>Within php I know how to make a layer =
ON:</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>$layer =3D=20
$map-&gt;getLayerByName(roads6);<BR>$layer-&gt;set("status",=20
MS_ON);</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>Just like that, what are the ways to set the both =
COLORs and=20
SIZE? I wish the mapserver site had more examples :(</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>Have a nice day.</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>Murat Isik</FONT></DIV>
<DIV><FONT size=3D2>&nbsp;</DIV></FONT></BODY></HTML>

------=_NextPart_000_03A3_01C3F567.DF0B4440--




More information about the mapserver-users mailing list