[OpenLayers-Users] Setting attributes of a Feature.Vector
Christopher Schmidt
crschmidt at metacarta.com
Thu Oct 11 11:24:48 EDT 2007
On Thu, Oct 11, 2007 at 04:52:15PM +0200, Andy Dale wrote:
> It seems the for loop causes the problem, the following does not work:
>
> for(item in feats) {
> for(i = 0; i < feats.length; i++) {
> maybe i have got a bit confused over what is possible in wit for loops in
> javascript ?
Probabaly so.
for (item in feats) { }
will return 0, 1, 2, etc.
It's the keys, not the objects, which are returned.
However, in general, you should just use the for (i = 0; i <
feats.length; i++) types -- there are resources on the web that you can
read about why and how, I'm sure, I'm just not up to researching them at
the moment :)
Regards,
--
Christopher Schmidt
MetaCarta
More information about the Users
mailing list