Moved javascript to mapworker.js file