<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=364365121-08032010>Perhaps there is something wrong with the way you
declare your style for your layer. </SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=364365121-08032010></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=364365121-08032010>The below code works on WFS layer. ADMIN_NAME is an
attribute of the wfs.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=364365121-08032010></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2>var
styleMapLabelDS;</FONT></DIV>
<DIV> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2>function
set_styleMapLabelDS()<BR>{<BR> var template =
{<BR> strokeColor:
"#0000FF",<BR> strokeOpacity:
1,<BR> strokeWidth:
3,<BR> fillColor:
"#00AAFF",<BR> fillOpacity:
1,<BR> pointRadius:
5,<BR> pointerEvents:
"visiblePainted",</FONT></DIV>
<DIV> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff
size=2> label :
"${ADMIN_NAME}",</FONT></DIV>
<DIV> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff
size=2> labelOffsetX:
"10",<BR> labelOffsetY:
"-10",<BR> fontColor:
"red",<BR> fontSize:
10,<BR> fontFamily:
"Arial",<BR> fontWeight:
"bold",<BR> labelAlign:
"lt"<BR> };<BR> var templateB =
{<BR> strokeColor:
"#FF00FF",<BR> strokeOpacity:
1,<BR> strokeWidth:
3,<BR> fillColor:
"#AA00FF",<BR> fillOpacity:
1,<BR> pointRadius:
5,<BR> pointerEvents:
"visiblePainted",</FONT></DIV>
<DIV> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff
size=2> label :
"${ADMIN_NAME}",</FONT></DIV>
<DIV> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff
size=2> labelOffsetX:
"10",<BR> labelOffsetY:
"-10",<BR> fontColor:
"blue",<BR> fontSize:
10,<BR> fontFamily:
"Arial",<BR> fontWeight:
"bold",<BR> labelAlign:
"lt"<BR> };<BR> styleMapLabelDS = new
OpenLayers.StyleMap( { "default" : new OpenLayers.Style(template), "select" :
new OpenLayers.Style(templateB) } );<BR>}</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff
size=2>set_styleMapLabelDS();<BR><SPAN
class=364365121-08032010>myWFS</SPAN>["styleMap"]=styleMapLabelDS;<BR><SPAN
class=364365121-08032010>myWFS</SPAN>.redraw();<BR></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><A
href="http://gis.ibbeck.de/OLClient/OLClient.asp?WMC=./data/WMC/wfs_germany_reproject_and_labels.wmc.xml">http://gis.ibbeck.de/OLClient/OLClient.asp?WMC=./data/WMC/wfs_germany_reproject_and_labels.wmc.xml</A></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff
size=2> </DIV></FONT>
<DIV><SPAN class=364365121-08032010></SPAN><FONT face=Arial><FONT
color=#0000ff><FONT size=2>Arnd</FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=364365121-08032010></SPAN></FONT></FONT></FONT><BR> </DIV>
<DIV class=OutlookMessageHeader lang=de dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>Von:</B> users-bounces@openlayers.org
[mailto:users-bounces@openlayers.org] <B>Im Auftrag von </B>Luís de
Sousa<BR><B>Gesendet:</B> Montag, 8. März 2010 21:16<BR><B>An:</B>
users@openlayers.org<BR><B>Betreff:</B> Re: [OpenLayers-Users] Labels on WFS
layers<BR></FONT><BR></DIV>
<DIV></DIV>Hello again,<BR><BR>I can't get this to work in any way, no errors at
runtime but no labels either. The label properties is listed in the vector style
specification, among other that work perfectly:<BR><BR><A
href="http://dev.openlayers.org/releases/OpenLayers-2.8/doc/apidocs/files/OpenLayers/Feature/Vector-js.html">http://dev.openlayers.org/releases/OpenLayers-2.8/doc/apidocs/files/OpenLayers/Feature/Vector-js.html</A><BR><BR>It
can also be found a great deal of discussion on this list and elsewhere about
the development of this functionality, mostly from 2008. Has vector labeling
been fully implemented in OpenLayers-2.8? If not, what other ways are there to
get this to work?<BR><BR>Thank you,<BR><BR>Luís<BR><BR>
<DIV class=gmail_quote>2010/3/5 Luís de Sousa <SPAN dir=ltr><<A
href="mailto:luis.a.de.sousa@gmail.com">luis.a.de.sousa@gmail.com</A>></SPAN><BR>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">Hello
everyone,<BR><BR>I'm trying to set labels on a point layer using code like
this:<BR><BR>wfs2.style = OpenLayers.Util.applyDefaults(<BR>
{<BR>
strokeColor:
"#008000",<BR>
fillColor: "#FFFF00",<BR>
strokeWidth:
"2.0",<BR>
label: "${someAtribute}",<BR>
fontColor:
"#FF0000"<BR>
}<BR><BR>I don't get any errors at runtime, but no label appears. What
am I missing?<BR><BR>Thanks,<BR><FONT
color=#888888><BR>Luís<BR><BR></FONT></BLOCKQUOTE></DIV><BR></BODY></HTML>