[Mapserver-users] drawLabelCache doesnot work
Murat Isik
muratisik at megatek.com.tr
Tue Nov 11 00:35:25 PST 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> </DIV>
<DIV><FONT face=3DArial size=3D2>$img =3D=20
$myMap->draw();<BR>$myMap->drawLabelCache($img);<BR>$image_url =3D =
$img->saveWebImage(GIF,1,1,0);<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </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> </DIV>
<DIV><FONT face=3DArial size=3D2>LAYER<BR> NAME=20
ERENKOY_ORNEKSOKAK_PL_polyline<BR> TYPE line<BR> GROUP=20
sokaklar<BR> STATUS ON<BR> DATA=20
ERENKOY_ORNEKSOKAK_PL_polyline</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>CLASSITEM 'ID'<BR> =20
CLASS<BR> EXPRESSION /./<BR> =
COLOR 66=20
34 249<BR> END<BR>LABELCACHE OFF<BR>LABELITEM 'ADI'<BR> =20
CLASS<BR> NAME 'ADI'<BR>#EXPRESSION /./<BR> =
COLOR 161 02=20
110<BR> LABEL<BR> TYPE=20
truetype<BR># FORCE=20
true<BR> FONT=20
arial<BR> COLOR 0 0=20
0<BR> ANGLE =
AUTO<BR> =20
BACKGROUNDCOLOR 250 250 250 #WIT<BR> =
POSITION=20
AUTO<BR> SIZE=20
0<BR> MINSIZE=20
2<BR> SIZE 8<BR> END<BR> =
END<BR>END</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>But I am getting no labels. Mapscript =
even doesnot=20
render image without</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2><FONT face=3DArial size=3D2>CLASSITEM =
'ID'<BR> =20
CLASS<BR> EXPRESSION /./<BR> =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> </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