Hacker News new | comments | show | ask | jobs | submit login

I expect the call to geolocator requires a network round-trip, with displayMapAt getting scheduled to be called when the result appears; meanwhile your code can do other things. (I'm not familiar with this API, though; I could be wrong.)

Another way to do this sort of thing, that might feel more composable: have geolocator.getLatLng() return a 'promise' object that will be asynchronously resolved.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact