Arnd and Eric,<div><br></div><div>  Thanks for the quick help.  I was thinking that it was looking for the properties off of the vector feature object, and was hoping passing in a different context would allow me to keep the fields on the same level as the coordinates.</div>
<div><br></div><div>  The current json document indeed does draw, but not not with the 
<span style>addUniqueValueRules</span> set.  Perhaps the formatter is creating a vector feature good enough to draw, but not filter.</div><div><br></div><div>  The source is from a C# web service call to a MongoDB collection (table in mongo parlance).  And performance is impressive, the 3 points was a sample from the original 1800 points (hence a W status thrown in there), which draw faster than the OSM basemap.  In fact performance doesn&#39;t start to drop off until 30K points, far more than I expected.</div>
<div><br></div><div>  Converting the source from a GeometryCollection to a FeatureCollection ins&#39;t a problem, but I have to figure out how to create an object from the MongoDB document that has the properties object inside the feature object.  Like I said, I was hoping the context would allow me to fake that :-)</div>
<div><br></div><div>Let me see what I can come up with.<br><br><div class="gmail_quote">On Wed, Jan 18, 2012 at 12:14 PM, Eric Lemoine <span dir="ltr">&lt;<a href="mailto:eric.lemoine@camptocamp.com">eric.lemoine@camptocamp.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br><br>On Wednesday, January 18, 2012, John Cole &lt;<a href="mailto:jcole@solidearth.com" target="_blank">jcole@solidearth.com</a>&gt; wrote:<br>
&gt; Hey guys,<br>&gt;   I&#39;m trying to use a stylemap on a GeoJson datasource, and want to change the color of the symbol based off of a field in the data.<br>
&gt; My data looks like:<br>&gt; {<br>&gt; &quot;type&quot; : &quot;GeometryCollection&quot;,<br>&gt; &quot;geometries&quot; : [{<br>&gt; &quot;type&quot; : &quot;Point&quot;,<br>&gt; &quot;_id&quot; : {<br>&gt; &quot;code&quot; : &quot;123&quot;,<br>

&gt; &quot;version&quot; : 0<br>&gt; },<br>&gt; &quot;coordinates&quot; : [-86.586502, 34.731189],<br>&gt; &quot;Status&quot; : &quot;W&quot;<br>&gt; }, {<br>&gt; &quot;type&quot; : &quot;Point&quot;,<br>&gt; &quot;_id&quot; : {<br>

&gt; &quot;code&quot; : &quot;234&quot;,<br>&gt; &quot;version&quot; : 0<br>&gt; },<br>&gt; &quot;coordinates&quot; : <a href="tel:%5B-86.57294326" value="+18657294326" target="_blank">[-86.57294326</a>, <a href="tel:34.73563314" value="+13473563314" target="_blank">34.73563314</a>],<br>
&gt; &quot;Status&quot; : &quot;W&quot;<br>&gt; }, {<br>&gt; &quot;type&quot; : &quot;Point&quot;,<br>
&gt; &quot;_id&quot; : {<br>&gt; &quot;code&quot; : &quot;456&quot;,<br>&gt; &quot;version&quot; : 0<br>&gt; },<br>&gt; &quot;coordinates&quot; : <a href="tel:%5B-86.45717254" value="+18645717254" target="_blank">[-86.45717254</a>, 34.82754903],<br>
&gt; &quot;Status&quot; : &quot;A&quot;<br>
&gt; }<br>&gt; ]<br>&gt; }<br><br></div></div>I don&#39;t think OpenLayers&#39;s GeoJSON format can produce OpenLayers.Feature.Vector objects from such a JSON doc. To produce features the GeoJSON format should receive a doc whose root object is of type FeatureCollection. <br>
<div class="im">
<br>&gt;<br>&gt; and my style stylemap:<br>&gt;         var styleMap = new OpenLayers.StyleMap({<br>&gt;             &quot;default&quot;: new OpenLayers.Style({<br>&gt;                 fillOpacity: 0.5,<br>&gt;                 pointRadius: 5,<br>

&gt;                 fillColor: &quot;#ee9900&quot;<br>&gt;             })<br>&gt;         });<br>&gt;         <br>&gt;         var lookup = {<br>&gt;             &quot;S&quot;: {fillColor: &quot;red&quot;},<br>&gt;             &quot;A&quot;: {fillColor: &quot;green&quot;},<br>

&gt;             &quot;X&quot;: {fillColor: &quot;blue&quot;}<br>&gt;         };<br>&gt;         styleMap.addUniqueValueRules(&quot;default&quot;, &quot;Status&quot;, lookup);<br>&gt; However, when I apply the addUniqueValueRules, no features are drawn.  Tracing through the draw cycle,<br>

&gt; line 117 of Comparison.js which is getting the value of &quot;Status&quot; from the context returns undefined.  What do I need to do to get the &quot;Status&quot; into the correct context?  <br><br><br></div>For your rules to work &quot;Status&quot; must be a property of the &quot;properties&quot; object in each &quot;feature&quot; object of the GeoJSON doc.<br>

<br>So make sure you have correctly formed feature objects in your layer. Each feature object should a &quot;Status&quot; property in its &quot;attributes&quot; object.<br><br>Hope this helps.<span class="HOEnZb"><font color="#888888"><br>
<br>-- <br>Eric Lemoine<br>
<br>Camptocamp France SAS<br>Savoie Technolac, BP 352<br>73377 Le Bourget du Lac, Cedex<br><br>Tel : 00 33 4 79 44 44 96<br>Mail : <a href="mailto:eric.lemoine@camptocamp.com" target="_blank">eric.lemoine@camptocamp.com</a><br>
<a href="http://www.camptocamp.com" target="_blank">http://www.camptocamp.com</a><br>
<br>
</font></span></blockquote></div><br></div>