[OpenLayers-Users] Draw features one by one in IE?

Eric Lemoine eric.c2c at gmail.com
Sat Jun 21 09:50:19 EDT 2008


On Wed, Jun 18, 2008 at 10:06 AM, realjax <jax at schildmos.nl> wrote:
>
> Hi,
>
> Since drawing rotated features (with an icon) in IE 6 is painstakingly slow
> (14 times slower then Firefox), I was trying to see if I could have features
> painted on the screen one by one, so the user has at least some visual
> feedback, instead of looking at what seems a dead application for several
> seconds.
>
> When using the addFeatures method of the Vector class, IE -and Firefox as
> well for that matter- only show all features at once, *after* all features
> have been added.  Even when I create a loop to add only one feature at a
> time, the layer is only redrawn after completion of the loop.
>
> When I attach a function to the event onFeatureAdded and for instance log
> something to the console, things work as I'd expect and IE draws the
> features one by one..
>
> Can anyone comment on this, am I missing something ?

Hi

Do you unserialize the features (using some Format object) before you
add them to the vector layer? If so have you verified that it is not
that unserialization process that actually takes time in IE6? Given
that addFeatures seem to draw all features at once it seems to me that
addFeatures is very fast. addFeatures gets slower when you write to
the console for each feature, hence the "features drawn one by one"
effect. If that's indeed the unserialization process that takes time,
one could imagine requesting features page by page (possibly using the
paging strategy that's being developed in the vector-behavior
sandbox).

Hope this helps,

--
Eric



More information about the Users mailing list