Geolocation - Network location provider at 'https://www.googleapis.com/' : No response received

☆樱花仙子☆ 提交于 2020-07-08 03:42:38

问题


I search for this error but there isn't any solution to solve it. some similar questions and solutions are available but in case of 400,404 and other responses. but I've no response!!

I'm using mac and my location accessing and other permissions are guaranteed browsers for using location services. So I can use my chrome or safari location services in other pages.

window.navigator.geolocation.getCurrentPosition(console.log, console.log, {timeout:5000}) 

an easy way to access user location but the response was: "Network location provider at 'https://www.googleapis.com/': No response received."

Is there any way to use another location services instead of googleapis in browser?


回答1:


works fine for me. Could it be you are just not looking at the returned promise?

window.navigator.geolocation.getCurrentPosition((res)=>{console.log(res)}, (err)=>{}, {timeout:5000})

also: This feature only works over HTTPS. Local development enviornment? https://developer.mozilla.org/en-US/docs/Web/API/Geolocation_API




回答2:


I think there is another problem with this action.

Unfortunately, Google closed the developer's access API from some country like Iran.

So, I must find another way to get the user location.



来源:https://stackoverflow.com/questions/62670186/geolocation-network-location-provider-at-https-www-googleapis-com-no-re

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!