[Mapserver-users] drawLabelCache doesnot work

Murat Isik muratisik at megatek.com.tr
Tue Nov 11 03:35:25 EST 2003


This is a multi-part message in MIME format.

------=_NextPart_000_004C_01C3A83F.84A92730
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hello,
In order to label a layer in mapscript I have the following lines in my =
php code:

$img =3D $myMap->draw();
$myMap->drawLabelCache($img);
$image_url =3D $img->saveWebImage(GIF,1,1,0);


The layer it should label is named ERENKOY_ORNEKSOKAK_PL_polyline. Here =
is my layer definition for this layer:

LAYER
  NAME ERENKOY_ORNEKSOKAK_PL_polyline
  TYPE line
  GROUP sokaklar
  STATUS ON
  DATA ERENKOY_ORNEKSOKAK_PL_polyline

CLASSITEM 'ID'
  CLASS
       EXPRESSION /./
  COLOR 66 34 249
  END
LABELCACHE OFF
LABELITEM 'ADI'
  CLASS
   NAME 'ADI'
#EXPRESSION /./
   COLOR 161 02 110
    LABEL
      TYPE truetype
#      FORCE true
      FONT arial
      COLOR 0 0 0
       ANGLE AUTO
     BACKGROUNDCOLOR 250 250 250 #WIT
      POSITION AUTO
        SIZE 0
        MINSIZE 2
      SIZE 8
   END
  END
END


But I am getting no labels. Mapscript even doesnot render image without

CLASSITEM 'ID'
  CLASS
       EXPRESSION /./
 =20
ADI is the label item, name of the coloumn in dbf to be used for =
labelling. Any ideas?

Murat Isik


------=_NextPart_000_004C_01C3A83F.84A92730
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.3700.6699" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hello,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>In order to label a layer in mapscript =
I have the=20
following lines in my php code:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>$img =3D=20
$myMap-&gt;draw();<BR>$myMap-&gt;drawLabelCache($img);<BR>$image_url =3D =

$img-&gt;saveWebImage(GIF,1,1,0);<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>The layer it should label is named=20
ERENKOY_ORNEKSOKAK_PL_polyline. Here is my layer definition for this=20
layer:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>LAYER<BR>&nbsp; NAME=20
ERENKOY_ORNEKSOKAK_PL_polyline<BR>&nbsp; TYPE line<BR>&nbsp; GROUP=20
sokaklar<BR>&nbsp; STATUS ON<BR>&nbsp; DATA=20
ERENKOY_ORNEKSOKAK_PL_polyline</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>CLASSITEM 'ID'<BR>&nbsp;=20
CLASS<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXPRESSION /./<BR>&nbsp; =
COLOR 66=20
34 249<BR>&nbsp; END<BR>LABELCACHE OFF<BR>LABELITEM 'ADI'<BR>&nbsp;=20
CLASS<BR>&nbsp;&nbsp; NAME 'ADI'<BR>#EXPRESSION /./<BR>&nbsp;&nbsp; =
COLOR 161 02=20
110<BR>&nbsp;&nbsp;&nbsp; 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; COLOR 0 0=20
0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ANGLE =
AUTO<BR>&nbsp;&nbsp;&nbsp;&nbsp;=20
BACKGROUNDCOLOR 250 250 250 #WIT<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
POSITION=20
AUTO<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SIZE=20
0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MINSIZE=20
2<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SIZE 8<BR>&nbsp;&nbsp; END<BR>&nbsp; =

END<BR>END</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>But I am getting no labels. Mapscript =
even doesnot=20
render image without</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><FONT face=3DArial size=3D2>CLASSITEM =
'ID'<BR>&nbsp;=20
CLASS<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXPRESSION /./<BR>&nbsp;=20
</FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>ADI is the label item, name of the =
coloumn in dbf=20
to be used for labelling. Any ideas?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Murat =
Isik<BR></DIV></FONT></BODY></HTML>

------=_NextPart_000_004C_01C3A83F.84A92730--




More information about the mapserver-users mailing list