Error with API on weather project

It seems work very well on mobile. But it doesn’t work on my laptop, the console is "
getCurrentPosition() and watchPosition() no longer work on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details."
My project: http://codepen.io/hungnguyen1895/pen/XjawPB
Anybody can help me out ?

I ran into this as well…

I’m not sure that this is the best option, but what I did to get around that was use the IP address + this api http://ip-api.com/, (specifically the JSON option: http://ip-api.com/json) to figure out what their latitude and longitude are

here’s the API documentation, if you’re interested: IP-API.com - Geolocation API - Documentation

it’s so weird, isn’t it :open_mouth:, did u check with the mobile ? did it work

1 Like

I didn’t even think to check it on mobile, I guess it’s a browser-specific thing right now so phones still support it or something?

in the api you gave it, the loc property looks like “loc”: “lal, log”,
how do I access to these 2 value separeted ?

thats an array just use .split(’,’);