Hi all, I have an openlayers app up at <a href="http://pocus.wustl.edu/wfs">http://pocus.wustl.edu/wfs</a> with a wfs layer that retrieves data from featureserver.<br><br>At one point, this was working. There's no telling what I've done but I can't figure it out.<br>
So, once you click 'update map', the wfs layer is added (appears in layers tab), but javascript throws an error:<br>Error: syntax error<br>Source File: <a href="http://pocus.wustl.edu/wfs/">http://pocus.wustl.edu/wfs/</a><br>
Line: 1, Column: 1<br>Source Code:<br>An error occurred: 'list' object has no attribute 'value'<br><br>line 1 column 1, great. It's definitely triggered on map.addLayer(wfs);<br><br>The important parts are in the function UpdateMap():<br>
//get variables and form url<br> wfs = new OpenLayers.Layer.WFS("WFS", url, {maxfeatures: 3000, typename: 'topp:multipolygon'}, {ratio: 1.0, extractAttributes: true});<br><br> wfs.preFeatureInsert= function(feature){<br>
features["\""+feature.fid+"\""] = feature;<br> var co = parseInt(feature.attributes['value']); ///there is a feature.attributes['value'], don't think it's this but I guess it might be<br>
if (co > scales[4])<br> feature.style.fillColor="red";<br> else if (co > scales[3])<br> feature.style.fillColor="#E79518";<br>
else if (co > scales[2])<br> feature.style.fillColor="#A8F257";<br> else if (co > scales[1])<br> feature.style.fillColor="#00F2AE";<br>
else if (co > scales[0])<br> feature.style.fillColor="#1A95E5";<br> else<br> feature.style.fillColor="blue";<br> fcount++;<br>
//feature.style.fillOpacity=0;<br> };<br><br> wfs.events.register("loadend", wfs, "hide_load()");<br> map.addLayer(wfs);<br>// document.write(wfs.getFullRequestString());<br>
var select = new OpenLayers.Control.SelectFeature(wfs, {onSelect: onFeatureSelect, onUnselect: onFeatureUnselect});<br> map.addControl(select);<br> select.activate();<br><br>wfs.getFullRequestString() prints out a functional request that I can straight paste and get XML<br>
example: <a href="http://pocus.wustl.edu/cgi-bin/featureserver3/featureserver.cgi/GIS?format=WFS&issum=true&param=CO&value=100&BBOX=-95.922852,35.402222,-89.880371,41.851196&maxfeatures=3000&typename=topp%3Amultipolygon&SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&SRS=EPSG%3A4326">http://pocus.wustl.edu/cgi-bin/featureserver3/featureserver.cgi/GIS?format=WFS&issum=true&param=CO&value=100&BBOX=-95.922852,35.402222,-89.880371,41.851196&maxfeatures=3000&typename=topp%3Amultipolygon&SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&SRS=EPSG%3A4326</a><br>
<br>(It takes a little over a minute for the SQL to return and featureserver to print, but it does eventually print)<br><br>Anyone have any ideas what list object is trying to access a value but can't, and why it's thrown immediately upon adding the layer to the map?<br>
<br>I would just be unbelievably grateful for any and all help.<br>Thanks!<br>-Ed<br>