I'd personally recommend geojson output from FeatureServer. The extra values/columns will show up under 'properties' for each feature, and you can access those from OL no problem - try google geojson stylemap for some examples (i assume) or ask again if you get stuck. <div>
<div><br></div><div><br></div><div> -Josh<br>
<br><br><div class="gmail_quote">On Mon, Aug 17, 2009 at 7:12 AM, Mak Kolybabi <span dir="ltr"><<a href="mailto:mak.kolybabi@telenium.ca">mak.kolybabi@telenium.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I've blown a day or two now searching Google and fiddling with OpenLayers and<br>
FeatureServer trying to get this to work, so I figure it's time to ask for help, again.<br>
<br>
I have a table in PostGIS that I make available through FeatureServer. This table is<br>
nothing special, just your regular the_geom and a few other columns. When I request this<br>
table from FeatureServer as GeoRSS, all the other columns (type, name, etc.) are put in<br>
<content>. When I request this same table as WFS, all the columns show up as tags in the<br>
"fs" namespace.<br>
<br>
Is there any format that FeatureServer produces that OpenLayers rules can select against<br>
for formatting? For example, I would like each feature -- all are points -- to be a<br>
different colour based on type, so I was trying things like:<br>
<br>
var rule1 = new OpenLayers.Rule({<br>
filter: new OpenLayers.Filter.Comparison({<br>
type: OpenLayers.Filter.Comparison.EQUAL_TO,<br>
property: "type",<br>
value: "value1"<br>
}),<br>
symbolizer: {<br>
fillColor: "green"<br>
}<br>
});<br>
<br>
var rule2 = new OpenLayers.Rule({<br>
filter: new OpenLayers.Filter.Comparison({<br>
type: OpenLayers.Filter.Comparison.EQUAL_TO,<br>
property: "type",<br>
value: "value2"<br>
}),<br>
symbolizer: {<br>
fillColor: "red"<br>
}<br>
});<br>
<br>
var style = new OpenLayers.Style();<br>
style.addRules([rule1, rule2]);<br>
<br>
var style_map = new OpenLayers.StyleMap({<br>
"default": style,<br>
"select": style<br>
});<br>
<br>
var features = new OpenLayers.Layer.WFS(<br>
"Features",<br>
"featureserver/featureserver.py/feature_table?format=WFS", {<br>
styleMap: style_map<br>
});<br>
map.addLayer(features);<br>
<br>
But it would seem that OpenLayers can't gain access to the columns returned by<br>
FeatureServer. Is there a specific format I have to request from FeatureServer to get<br>
these rules to work? Or is my entire approach wrong?<br>
<font color="#888888"><br>
--<br>
Mak Kolybabi<br>
Programmer<br>
Telenium Inc.<br>
204-957-2821<br>
</font><br>_______________________________________________<br>
Featureserver mailing list<br>
<a href="mailto:Featureserver@openlayers.org">Featureserver@openlayers.org</a><br>
<a href="http://featureserver.org/mailman/listinfo/featureserver" target="_blank">http://featureserver.org/mailman/listinfo/featureserver</a><br>
<br></blockquote></div><br></div></div>