<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18854"></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT size=2 face=Arial>Looking at various examples of
how to use styles in OpenLayers, we have built the following:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2 face=Arial>var Layer_AddressWebService_1 = new
OpenLayers.Layer.Vector(<BR>
"AddressWebService_1",<BR>
{<BR> styleMap: new
OpenLayers.StyleMap(<BR>
{<BR>
"default": new
OpenLayers.Style(<BR>
{<BR>
rules:
<BR>
[<BR>
new
OpenLayers.Rule(<BR>
{<BR>
symbolizer:<BR>
{<BR>
"Point":<BR>
{<BR>
pointRadius:
4,<BR>
graphicName:
'square',<BR>
fillColor:
'blue',<BR>
fillOpacity:
1,<BR>
strokeWidth:
1,<BR>
strokeOpacity:
1,<BR>
strokeColor:
'#0000FF'<BR>
}<BR>
}<BR>
})<BR>
]<BR>
})<BR> })<BR> },
{<BR> displayInLayerSwitcher:
false,<BR> isBaseLayer:
false<BR> }<BR>);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2 face=Arial>We think this should resemble and hopefully be
functionally identical to:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2 face=Arial>var awsSymbolizer = {<BR>
"Point": {<BR> pointRadius:
4,<BR><SPAN class=437253614-21122009>
</SPAN> graphicName: "square",<BR><SPAN
class=437253614-21122009>
</SPAN> fillColor: "blue",<BR><SPAN
class=437253614-21122009> </SPAN> fillOpacity:
1,<BR><SPAN class=437253614-21122009>
</SPAN> strokeWidth: 1,<BR><SPAN
class=437253614-21122009>
</SPAN> strokeOpacity: 1,<BR><SPAN
class=437253614-21122009>
</SPAN> strokeColor: "#0000FF"<BR><SPAN
class=437253614-21122009> </SPAN> }<BR>};</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>var awsStyle = new
OpenLayers.Style();<BR>awsStyle.addRules([new OpenLayers.Rule({symbolizer:
awsSymbolizer})]);<BR>var awsStyleMap = new OpenLayers.StyleMap({"default":
awsStyle}); <BR><SPAN class=437253614-21122009>var
Layer_AddressWebService_1</SPAN> = new
OpenLayers.Layer.Vector("AddressWebService_1",</FONT></DIV>
<DIV><FONT size=2 face=Arial>{</FONT></DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN
class=437253614-21122009> </SPAN>styleMap:
awsStyleMap</FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2>}, {</FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN
class=437253614-21122009> </SPAN>displayInLayerSwitcher:
false<SPAN class=437253614-21122009>, </SPAN></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN
class=437253614-21122009> isBaseLayer:
false</SPAN></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN
class=437253614-21122009></SPAN>});<BR></DIV></FONT></FONT>
<DIV><FONT face=Arial><FONT size=2>But it is not. When using the latter, points
are visualised fine, but using the first part, results in nothing.<SPAN
class=731053515-21122009> The problem lies around the rules. </SPAN><SPAN
class=437253614-21122009>Can anyone tell me what the major difference
is?</SPAN></FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV> </DIV>
<DIV><FONT size=2 face=Arial>Regards Casper</FONT></DIV></BODY></HTML>