Problem with flashing icons

33 views
Skip to first unread message

Cecile Trace de Trail

unread,
Feb 28, 2018, 2:07:41 AM2/28/18
to OpenLayers Dev
Hello,

I have a problem when I try to display many points, styled with icons, on my map : the icons are flashing !
It stops when I zoom in on some icons. You can see an exemple here : https://tracedetrail.com/assets/test_pi.html

When I add only a few points on the map, there is no problem. Here is the same example but with only ten points : https://tracedetrail.com/assets/test_pi_10.html

Can you help me solve this problem?

Thanks !

Cécile

Andreas Hocevar

unread,
Feb 28, 2018, 2:19:21 AM2/28/18
to OpenLayers Dev on behalf of Cecile Trace de Trail
Create your ol.style.Icon only once (outside the style function) or cache it. It will also improve rendering performance significantly.

Andreas.
--
You received this message because you are subscribed to the Google Groups "OpenLayers Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openlayers-dev+unsubscribe@googlegroups.com.
To post to this group, send email to openlayers-dev@googlegroups.com.
Visit this group at https://groups.google.com/group/openlayers-dev.
To view this discussion on the web visit https://groups.google.com/d/msgid/openlayers-dev/5e98537f-cd14-4160-8520-086ef119d480%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Antoine Abt

unread,
Feb 28, 2018, 2:24:57 AM2/28/18
to OpenLayers Dev on behalf of Andreas Hocevar
See https://openlayers.org/en/latest/examples/earthquake-custom-symbol.html
for an example with cached styles.

On 28 February 2018 at 08:19, OpenLayers Dev on behalf of Andreas
Hocevar <openlay...@googlegroups.com> wrote:
> Create your ol.style.Icon only once (outside the style function) or cache
> it. It will also improve rendering performance significantly.
>
> Andreas.
>
>
> On Wednesday, February 28, 2018, Cecile Trace de Trail via OpenLayers Dev
> <openlayers-dev+APn2wQeJUEc2VlneY...@googlegroups.com>
> wrote:
>>
>> Hello,
>>
>> I have a problem when I try to display many points, styled with icons, on
>> my map : the icons are flashing !
>> It stops when I zoom in on some icons. You can see an exemple here :
>> https://tracedetrail.com/assets/test_pi.html
>>
>> When I add only a few points on the map, there is no problem. Here is the
>> same example but with only ten points :
>> https://tracedetrail.com/assets/test_pi_10.html
>>
>> Can you help me solve this problem?
>>
>> Thanks !
>>
>> Cécile
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "OpenLayers Dev" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to openlayers-de...@googlegroups.com.
>> To post to this group, send email to openlay...@googlegroups.com.
> --
> You received this message because you are subscribed to the Google Groups
> "OpenLayers Dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to openlayers-de...@googlegroups.com.
> To post to this group, send email to openlay...@googlegroups.com.
> Visit this group at https://groups.google.com/group/openlayers-dev.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/openlayers-dev/CAOiJ94i7304Q7_YLC3eOZhmbcEwbgjPnDMyTbZq9iz8cViJyFQ%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.



--
Antoine Abt

Camptocamp France SAS
http://www.camptocamp.com

Cecile Trace de Trail

unread,
Feb 28, 2018, 2:46:31 AM2/28/18
to OpenLayers Dev
Yes, it does the job !
https://tracedetrail.com/assets/test_pi_solved.html

Thanks Andreas.


Cecile Trace de Trail

unread,
Feb 28, 2018, 2:48:13 AM2/28/18
to OpenLayers Dev
Merci Antoine ! J'avais déjà testé un correctif, mais ça semble être très similaire.
Reply all
Reply to author
Forward
0 new messages