Geolocation function: http vs https

Asked

Viewed 94 times

0

I’m making an application that should identify the user’s location and through an API call (https://openweathermap.org/api), inform the weather conditions of the place. To know the location, use the function getCurrentPosition(). This works well in Firefox, but when I try with Chrome, it gives the following error on the console:

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

So I try to switch to https, but then the API doesn’t work. How can I resolve this conflict?

  • 1

    you have to launch your application from a site https (with certificate) otherwise Google does not accept the call.

  • What error appears when you say "API does not work"? Because the URL "https://openweathermap.org/api" is already in HTTPS, I don’t understand why it doesn’t work, more details of the errors please.

  • You have to purchase an SSL certificate and install it on your server. Required.

  • Related question. http://answall.com/questions/47194/howcan I acquire https-na-minha-apply%C3%A7%C3%a3o-web? Rq=1

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.