Open mind84 opened 8 months ago
Same problem occurs in LWC 3.7.8.
$("lizmap-treeview")
returns nothing after treecreated
or uicreated
have been fired.
To workaround this problem I created another event domtreeadded fired after lizmap-treeview was injected into the DOM.
-> lizmap-web-client-3.7.8/assets/src/legacy/map.js line 5019
document.getElementById('switcher-layers').insertAdjacentHTML('afterend', '<lizmap-treeview></lizmap-treeview>');
/**
* Event when the tree has been added to DOM
* @event domtreeadded
*/
self.events.triggerEvent("domtreeadded", self);
line 5050
// initializing the lizMap events
obj.events = new OpenLayers.Events(
obj, null,
['domtreeadded','treecreated'
What is the bug?
Hi, I noticed that the
treecreated
event fires before the newlizmap-treeview
web component is added to the DOM, wich happen afteruicreated
event fires.Se image below: The
treecreated
event appears to be designed to only work with the old Lizmap 3.6 tree view.Any chances to port this event in LWC >= 3.7 ?
Thanks!
Steps to reproduce the issue
add this external js to reproduce the issue:
layertree_event.js.zip
Versions
Versions :
Check Lizmap plugin
QGIS server version, only if the section above doesn't mention the QGIS Server version
No response
Operating system
Debian GNU/Linux trixie/sid
Browsers
Firefox, Chrome
Browsers version
last
Relevant log output
No response