Hi,<br><br>I am currently using Vector layer and creating features (currently only have a single feature) on it. The feature i am drawing is a regular polygon, it is created like so:<br><br>var cirFeature = new OpenLayers.Feature.Vector
(<br> new OpenLayers.Geometry.Polygon.createRegularPolygon(new OpenLayers.Geometry.Point(0, 0), 21.0, 40, 0));<br><br>After reading the documentation, i discovered that the attributes can be set in the constructor as the second parameter. The documentation states that the second parmeter is:
<br><br>"An optional object that will be mapped to the <a href="http://dev.openlayers.org/docs/files/OpenLayers/Feature/Vector-js.html#OpenLayers.Feature.Vector.attributes" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
attributes</a> property."<br><br>So I attempted to set the second parameter in a varity of ways such as:<br><br>1) new Array("value1","value2","value3");<br>2) {attrtibutes: {first: "test", second: 21}};
<br>3) {first: "test", second: 21};<br><br>I attempt to access the attributes as follows:<br><br>1) Call Layer.Vector.features<br>2) Iterate over the returned features<br>3) On each feature call Feature.attributes
<br>4) Try and access the attributes<br><br>In the above steps 1-4, 4 always fails becuase there are never any attributes set, can anyone point out where i have gone wrong ?<br><br><br>Thanks in advance,<br><br>Andy<br><br>