In the last section we were able to determine our users current location just to show you something
interesting really quick.
I want you to recall that as the second argument to that get current position function we put an air
callback.
So one thing that we really want to test as we develop the supplication is to make sure that we have
a good understanding of what happens in the app.
If for some reason the geolocation call fails Now one reason that might cause that call to fail is if
the user declines or does not allow their position to be shared with our app.
I don't know about you but any time that any single web site in the world asked me for my location I
always decline it.
I was denied entirely unless I definitely want to have it share.
But vast majority time I always deny it.
So we're going to make sure that we develop our application to work even if a user declines that request
to share their location.
Now in order to test that flow to make sure that you and I understand what happens inside of our application
when it gets denied we need to to kind of reset our permissions very easily to make sure that we get
that allow or deny a pop up to appear on our screen again because as you might notice every time you
refreshed this page after allowing At one time you're never going to get asked again.
So in order to get asked again all you got to do is find this little guy next to our address.
You'll notice that we get this dropdown and it says location.
We are always allowing.
So in order to test our application and make sure that it still works correctly even if we deny the
location request I can reset this to ask default like so and then I can refresh the page and then I'm
back to square one where I get asked if I'm going to allow localhost thousand to know my location.
So this time around I go ahead and hit block and then you'll see that we get this position air object
that gives us some reason to tell us exactly why the geo location failed.
It's like I said we're going to be using this a little bit as we go on throughout this application to
make sure that the app still has a reasonable degree of functionality.
If for some reason we are not able to get the user's location Now one thing to keep in mind is that
if I now refresh the page again it's still going to be blocked.
So in practice you and I as we go to this application we're going to be using this dropdown many many
times to test out the entire flow of our application.
OK.
So now that we have a really good idea of how this geolocation stuff works.
One more quick pause then we'll come back and write some more code into our app component.