updated js to intialize map only after webpage is loaded.