[mapguide-users] Setting correct Legend checkboxes
77fredrik at gmail.com
Fri Jan 31 00:10:00 PST 2014
im using the linktoview widget for showing different layergroups. The
linktoview widget produces url's with parameter for groups to show, called
The maps then shows my layergroup correctly,
only problem is the checkbox in the legend for layergroup 'Cities' doesn't
var mapWidget = Fusion.getWidgetById('MainMap');
var Maps = mapWidget.getAllMaps();
Maps.layerRoot.groups.groups.legend.treeItem.checkbox.checked = true;
The code is working when executed via button in toolbar, but I want
the code executed when loading the page and this will not work,
errormessage: "WARNING: Exception occurred in AJAX callback.Message:
Cannot read property 'treeItem' of undefined Location: undefined
Im guessing it has something to do with the Legend hasn't finished
loading and i have to trigger some event when the legend has finished
Am I missing something, or do I have to add my own event in legend.js
when the legend has loaded or is there some other event i could use??
Am i missing something else?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the mapguide-users