Working gith Google map API and promises