问题
When I try to get the current position
navigator.geolocation.getCurrentPosition(handleCoordinates, handleError, {timeout:10000})
it returns
"Network location provider at 'https://www.googleapis.com/' : Returned error code 400."
Can somebody suggest any possible ways?
回答1:
You should configure correct google api key to request google related services in chromium.
https://github.com/electron/electron/blob/master/docs/api/environment-variables.md#google_api_key
https://github.com/electron/electron/issues/9420
来源:https://stackoverflow.com/questions/47955815/how-to-getcurrentposition-via-navigator-geolocation-in-electron-app