Error with API on weather project

Error with API on weather project
0

#1

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 ?


#2

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: http://ip-api.com/docs/


#3

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


#4

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?


#5

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


#6

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