refactor javascript code for map.js
change: application.html.erb (need to import glmap api before app assets)