[OpenLayers-Users] Feature collection array from GeoJSON format

Zac Spitzer zac.spitzer at gmail.com
Tue Mar 24 20:48:51 EDT 2009


what does your GEOJSon look like?

On Wed, Mar 25, 2009 at 11:46 AM, Ken Martin <kpmartin at gmail.com> wrote:
> This may be nothing, but I'd recommend not using for-in in javascript.
>
> kpm via iphone
>
>
>
> On Mar 24, 2009, at 7:32 PM, "Robert Connolly" <r.connolly at auckland.ac.nz
>  > wrote:
>
>> Hi Everyone,
>>
>>
>>
>> I’m trying to extract features from a GeoJSON string using the GeoJS
>> ON format object. According to the documentation I’m supposed to be
>> getting an array of OpenLayers.Feature.Vector items, however when I
>> iterate over the array I just get zeros!
>>
>>
>>
>> Here’s a snippet of my code:
>>
>>
>>
>> var features = geojson_format.read(data);
>>
>> for(var feature in features)
>>
>> {
>>
>>                alert(feature);
>>
>> }
>>
>>
>>
>> The alert box just alerts ‘0’ (zero), for some reason. Does
>> anyone know what’s going on?
>>
>>
>>
>> Thanks in advance,
>>
>>
>>
>> Cheers,
>>
>>
>>
>> Rob Connolly
>>
>> _______________________________________________
>> Users mailing list
>> Users at openlayers.org
>> http://openlayers.org/mailman/listinfo/users
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>



-- 
Zac Spitzer -
http://zacster.blogspot.com
+61 405 847 168



More information about the Users mailing list