rename main function to teo_mapjs_main and define it out of an anonymous function