[OpenLayers-Users] Cannot cycle through vector layer features

Ivan Grcic igrcic at gmail.com
Wed Jan 28 12:49:04 EST 2009


That was Bart ;) I was just trying to show you that GML loads in
background, and it takes some time to load it..thats why you get
features.length =0
Also check this example
http://openlayers.org/dev/examples/GMLParser.html

cheers

On Wed, Jan 28, 2009 at 6:27 PM, Mauro Bianchi <bianchimro at gmail.com> wrote:
> Thanks Ivan,
>
> overlay.events.register('loadend', this, function() { alert(xxxx); });
>
> is perfectly working.
>
>
> Best regards
> Mauro
>
>
>
>
>
> 2009/1/28 Bart van den Eijnden (OSGIS) <bartvde at osgis.nl>:
>> Instead, better use the loadend event for this.
>>
>> overlay.events.register('loadend', this, function() { alert(xxxx); });
>>
>> Best regards,
>> Bart
>>
>> Ivan Grcic wrote:
>>>
>>> Hi,
>>>
>>> what happens if u do something like this:
>>>
>>> setTimeout(function(){alert(overlay.features.length), 3000});
>>>
>>>
>>> On Wed, Jan 28, 2009 at 5:06 PM, goliah <bianchimro at gmail.com> wrote:
>>>
>>>>
>>>> Dear all,
>>>>
>>>> I want to cycle through a vector layer (GML in my case) features.
>>>> The layer loads and it's drawn, but i cannot access the features at all
>>>>
>>>> example:
>>>>
>>>> var overlay; //global variable
>>>>
>>>> overlay = new OpenLayers.Layer.GML("GML", 'file.gml');
>>>>
>>>> var l = overlay.features.length;   // this is ALWAYS 0!
>>>>
>>>> The strange thing is that, using firebug and watching the expression
>>>> "overlay.features.length" gives me the right number of features.
>>>>
>>>> Any idea?
>>>> Thanks
>>>> Mauro
>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://n2.nabble.com/Cannot-cycle-through-vector-layer-features-tp2233009p2233009.html
>>>> Sent from the OpenLayers Users mailing list archive at Nabble.com.
>>>>
>>>> _______________________________________________
>>>> Users mailing list
>>>> Users at openlayers.org
>>>> http://openlayers.org/mailman/listinfo/users
>>>>
>>>>
>>>
>>>
>>>
>>>
>>
>>
>> --
>> Bart van den Eijnden
>> OSGIS, Open Source GIS
>> bartvde at osgis.nl
>> http://www.osgis.nl
>>
>>
>
>
>
> --
> Mauro Bianchi
> bianchimro at gmail.com
>



-- 
Ivan Grcic



More information about the Users mailing list