Local Weather project - slow retrieval of Latitude and Longitude

Not sure how to fix this, or get around it - having a slow response from the HTML5’s Geolocation API in trying to get my latitude and longitude. It takes about 10 to 15 seconds. If the user clicks on the Show Me (the weather) button before they’re retrieved, it does nothing. I’m wondering if it’s just my set up/ISP/browser.

Would appreciate others trying this to see if they get the same delay as well. I usually store the lat and long in a hidden field, but I’ve revealed them so you can see when they load (bottom left, under the background check buttons).

Thanks!

check out the code in this pen, the reason it’s all in the html bucket is that was the only way I could get it to run at any reasonable success rate on codepen - there are quite a few known issues with this challenge

http://codepen.io/EgoDominusVos/pen/rjyyWj?editors=1000

1 Like

It’s lightning fast for me. Do you live in a rural area? Browser geolocation uses a lot of different resources to get your position, such as your surrounding wifi and bluetooth networks. The farther you are from urban life, the harder geolocation has to work.

1 Like

Glad it’s not just me! That ‘waiting for location’ is a good idea - think I need to do something similar - thanks!

1 Like

Glad to hear it ran fast - I’m in LA so bit of a headscratcher why it’s so slow. Thanks for checking it out!

1 Like