<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
h5
        {mso-style-priority:9;
        mso-style-link:"Heading 5 Char";
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:10.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.Heading5Char
        {mso-style-name:"Heading 5 Char";
        mso-style-priority:9;
        mso-style-link:"Heading 5";
        font-family:"Times New Roman","serif";
        font-weight:bold;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal>Hello,<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>I want to dynamically set a strokeColor based on feature.styler.color
rather that feature.attribute.color.<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>I am using this code:<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>var context = function(feature) {<o:p></o:p></p>

<p class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; feature.stylers
? ret = feature.stylers : ret = feature.attributes;<o:p></o:p></p>

<p class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ret
? null : ret = feature;<o:p></o:p></p>

<p class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return
ret;<o:p></o:p></p>

<p class=MsoNormal>}<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>var defaultStyle = new
OpenLayers.Style(OpenLayers.Util.applyDefaults({ strokeColor:
&quot;${color}&quot;, strokeWidth: 3 }<o:p></o:p></p>

<p class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ,
OpenLayers.Feature.Vector.style[&quot;default&quot;]), {context: context});<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>I have also tried this:<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>var defaultStyle = new
OpenLayers.Style(OpenLayers.Util.applyDefaults({ strokeColor:
&quot;${color}&quot;, strokeWidth: 3 }<o:p></o:p></p>

<p class=MsoNormal>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ,
OpenLayers.Feature.Vector.style[&quot;default&quot;]), {context: {styler:
null}}) ;<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>But neither seem to work! I am particularly confused as the
top example works for OpenLayers.Rule context manipulation.<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Any hints?<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<h5 style='margin-bottom:12.0pt;background:white'><span style='font-size:11.0pt;
font-family:"Calibri","sans-serif";color:#1F497D;font-weight:normal'>Cheers,</span><o:p></o:p></h5>

<h5 style='margin:0cm;margin-bottom:.0001pt;background:white;background-image:
initial;background-repeat:initial;background-attachment:initial;-webkit-background-clip: initial;
-webkit-background-origin: initial;background-position:initial initial'><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;
font-weight:normal'>James Sewell</span><o:p></o:p></h5>

<h5 style='margin:0cm;margin-bottom:.0001pt;background:white;background-image:
initial;background-repeat:initial;background-attachment:initial;-webkit-background-clip: initial;
-webkit-background-origin: initial;background-position:initial initial'><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;
font-weight:normal'>LISAsoft Developer</span><o:p></o:p></h5>

<h5 style='margin:0cm;margin-bottom:.0001pt;background:white;background-image:
initial;background-repeat:initial;background-attachment:initial;-webkit-background-clip: initial;
-webkit-background-origin: initial;background-position:initial initial'><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;
font-weight:normal'>+61 (3) 8680 3200 / +61 414 688 892</span><o:p></o:p></h5>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

</body>

</html>