ebidel / geo-location

Web component element for the Geolocation API
https://webcomponents.org/element/ebidel/geo-location
86 stars 25 forks source link

Fire error when user dismisses the location request in Firefox/IE #17

Closed rubenstolk closed 8 years ago

rubenstolk commented 8 years ago

Firefox asks the user to share his location using a popup, that popup can be dismissed. When the user does so, the watchPosition never throws an error. Perhaps we should add a timeout handler that fires an error if watchPosition doesn't success or error?

ebidel commented 8 years ago

Or use the permissions api: https://www.chromestatus.com/features/6376494003650560

rubenstolk commented 8 years ago

That's a nice solution but won't solve things fro IE...

ebidel commented 8 years ago

Yea, but that's the proper way to do this, then fallback for other browsers.

However, I'm not sure I agree this is an error or should be handled by the element. It's really up to the consumer of this component to implement a timeout (or decide what to do if they user neglects the prompt) if they need it.

ebidel commented 8 years ago

Also, don't the geo location API error callbacks get called if the user has denied permission?

rubenstolk commented 8 years ago

This issue is about when the user has neither accepted nor denied permission. I might agree that it should not be handled by the element, on the other hand it makes the element more natural and complete. See https://github.com/ebidel/geo-location/pull/18.