function drawmap not defined when loading external js with resourceLoader
I have created a public gist
a Widget to an external JS file and load it dynamically with the
ResourceLoader. However, the developer console returns the following
error: jQuery.Deferred exception: drawmap is not defined when I am
accessing the function defined in the external script. Checking the
state in the developer console with
'mw.loader.getState("ext.iswiki.display_project_map")' returns: "ready".
When the Resource Loader debug mode is enabled in LocalSettings.php the
function is found and called.