<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2963" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff>
<DIV dir=ltr align=left><SPAN class=012520108-26092006><FONT face=Arial
color=#0000ff size=2>Murat,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=012520108-26092006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=012520108-26092006><FONT face=Arial
color=#0000ff size=2>Are you sure you want all your villages to have the same
label ($villagename)?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=012520108-26092006><FONT face=Arial
color=#0000ff size=2>I think you may want to define a
labelitem:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=012520108-26092006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=012520108-26092006><FONT face=Arial
color=#0000ff size=2>$point_layer->set("labelitem","villagename"); //
"villagename" is the name of the attribute of the layer</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=012520108-26092006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=012520108-26092006><FONT face=Arial
color=#0000ff size=2>Also, you quoted "$koyadi", which is probably not correct.
Or remove the '$'.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=012520108-26092006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=012520108-26092006><FONT face=Arial
color=#0000ff size=2>Have you tested whether any part of this code works? Which
part is giving you trouble? Does your PHP log say anything?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=012520108-26092006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=012520108-26092006><FONT face=Arial
color=#0000ff size=2>regards,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=012520108-26092006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=012520108-26092006><FONT face=Arial
color=#0000ff size=2>Jacob</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=012520108-26092006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV><BR>
<BLOCKQUOTE
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> UMN MapServer Users List
[mailto:MAPSERVER-USERS@LISTS.UMN.EDU] <B>On Behalf Of </B>Murat
BEYHAN<BR><B>Sent:</B> 26 September 2006 15:56<BR><B>To:</B>
MAPSERVER-USERS@LISTS.UMN.EDU<BR><B>Subject:</B> [UMN_MAPSERVER-USERS] adding
label to point layer in PHPMapscript<BR></FONT><BR></DIV>
<DIV></DIV>Dear Friends, <BR><BR>I'have draw point layer by using php. That
point only one in the map. <BR>Now I would like to make label for that point
as $villagename <BR>I have tried following codes but I think something wrong.
<BR>Could you help me What is my mistake... <BR>Regards <BR>Murat
<BR>$villagename='kanamura'; <BR> $map_path="/var/www/html/zone/";
<BR> $map = ms_newMapObj($map_path."zone.map");
<BR> $map->setExtent($nMinX, $nMinY, $nMaxX, $nMaxY); <BR>
<BR>// create a temp layer to hold our points <BR>$point_layer =
ms_newLayerObj($map); <BR>$point_layer->set("name", "$koyadi");
<BR>$point_layer->set("type", MS_LAYER_POINT);
<BR>$point_layer->set("status", MS_DEFAULT);
<BR>$point_layer->setProjection("proj=latlong",MS_TRUE); <BR><BR>// create
a class and style for this layer <BR>$point_class =
ms_newClassObj($point_layer); <BR>$point_style = ms_newStyleObj($point_class);
<BR>$point_symbol = $map->getSymbolByName("cpoint");
<BR><BR>$point_style->set("symbol", $point_symbol);
<BR>$point_style->set("size", 12);
<BR>$point_style->color->setRGB(255,0,255);
<BR>$point_style->outlinecolor->setRGB(255,255,0); <BR><BR>$label =
$point_class->label; <BR>$label->set("position", MS_CC);
<BR>$label->set("font","sans"); <BR>$label->set("type",MS_TRUEYPE);
<BR>$label->set("size",MS_MEDIUM); <BR>$label->color->setRGB(22,8,3);
<BR>$label->backgroundcolor->setRGB(0,0,0);
<BR>$label->set(minsize,4); <BR>$label->set(maxsize,100000); <BR><BR>//
draw our image without the points <BR> $ref =
$map->drawreferencemap(); <BR> $legend=$map->drawLegend();
<BR><BR>$image = $map->draw(); <BR><BR>// initialize our point and add it
to the map <BR>$point = ms_newPointObj(); <BR>$longitude=$lon;// comes from
select queries from mysql as a result <BR>$latitude=$lat;// comes from select
queries from mysql as a result <BR><BR>$point->setXY($longitude,
$latitude); <BR>$point->draw($map, $point_layer, $image, 0, ""); <BR>
$map_url=$image->saveWebImage(); <BR> $ref_url =
$ref->saveWebImage(); <BR>
$legend_url=$legend->saveWebImage(); <BR><BR>-- <BR>This message has
been scanned for viruses and <BR>dangerous content by <A
href="http://www.mailscanner.info/"><B>MailScanner</B></A>, and is
<BR>believed to be clean. </BLOCKQUOTE></BODY></HTML>