I want to display information on a page if the user’s browser is requesting permission to allow us to determine the user’s position, however I don’t want to attempt to display this information if the browser has already been authenticated to give us their location.
Is there a good way of doing this?
In detail. I want to display a message saying “Please click the box saying ‘Allow these guys to get your location’ ” because in user testing we’re finding that users don’t see the dialogue and become confused.
However, that results in us flashing up the help message even if we have their permission as they pass through the location lookup page. Storing the fact that they gave us their permission doesn’t help, because they may revoke that permission and we won’t know.
Any ideas?
Cheers
Mark.
You can hand over an Error Callback to
getCurrentPosition()to determine, whether the user has denied the tracking / Position could not be determined (spec).Additionally I would set a TimeOut which prompts your message after a certain amount of time because in this case the user most likely might have overlooked the browser dialog.
sample code:
However, you can still store the permission and check it. In case they revoke their permission you will run into the error-callback where you can take actions accordingly.