You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue is similar to #8032. This time the issue is relevant only if AttributionControl is added to the map.
I made an animation, which changes map style using setPaintProperty() periodicaly. Changing the style triggers update of the attribution string, which is recreated from scratch each time and pasted using innerHTML into attribution control. After the innerHTML setter is called, the number of DOM nodes jumps up (depends on the number of dom nodes in the subtree thrown out by replacing the new content). In case of fast animation, DOM GC sweep causes noticeable freezing after some time of running.
The new attribution string on each call is in my case exactly the same as previous one, therefore innerHTML replace only adds unwanted DOM garbage...:)
Do you think is there any way how to avoid unnecessary update of the attribution HTML?
I don't know the code of Mapbox GL JS in full details, therefore I am not sure if there would be possible to change this behavior without complications, but it looks like that it should be possible to change _updateAttributions() in this way:
check if there are any changes in attribution compared to current state
make an innerHTML update only in case there IS any change
I guess it would be needed to hold the previous state of attributions array, because innerHTML getter may return slightly different html code compared to what was set...
The text was updated successfully, but these errors were encountered:
mapbox-gl-js version: 0.53.1
browser: tested in Chrome, possibly all
Steps to Trigger Behavior
The issue is similar to #8032. This time the issue is relevant only if AttributionControl is added to the map.
I made an animation, which changes map style using
setPaintProperty()
periodicaly. Changing the style triggers update of the attribution string, which is recreated from scratch each time and pasted usinginnerHTML
into attribution control. After theinnerHTML
setter is called, the number of DOM nodes jumps up (depends on the number of dom nodes in the subtree thrown out by replacing the new content). In case of fast animation, DOM GC sweep causes noticeable freezing after some time of running.The new attribution string on each call is in my case exactly the same as previous one, therefore
innerHTML
replace only adds unwanted DOM garbage...:)Do you think is there any way how to avoid unnecessary update of the attribution HTML?
I don't know the code of Mapbox GL JS in full details, therefore I am not sure if there would be possible to change this behavior without complications, but it looks like that it should be possible to change
_updateAttributions()
in this way:innerHTML
update only in case there IS any changeI guess it would be needed to hold the previous state of attributions array, because innerHTML getter may return slightly different html code compared to what was set...
The text was updated successfully, but these errors were encountered: