Scripts loaded via ResourceLoader are not executed in global scope, so your variables/functions will not be global.
To make them global, you have to explicitly attach them to the `window` object – add this at the end of your external_script.js:
window.drawmap = drawmap;