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 <[email protected]> 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) <[email protected]>: >> 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 <[email protected]> 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 >>>> [email protected] >>>> http://openlayers.org/mailman/listinfo/users >>>> >>>> >>> >>> >>> >>> >> >> >> -- >> Bart van den Eijnden >> OSGIS, Open Source GIS >> [email protected] >> http://www.osgis.nl >> >> > > > > -- > Mauro Bianchi > [email protected] > -- Ivan Grcic _______________________________________________ Users mailing list [email protected] http://openlayers.org/mailman/listinfo/users
