Esri / nearby-javascript

ArcGIS API for JavaScript app to find places nearby and route to the nearest location.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Should the app work even if user doesn't allow it to use their location?

codergrl opened this issue · comments

When the app starts, if I decline the prompt asking me to share my location, the app no longer works. It loads a map centered on Palm Springs but search and filtering doesn't work.

image

For one, I feel the app should somehow communicate to the user that they can't do anything because they haven't enabled location.

But the question is, should the app still work? Other than directions, which need the current location, I don't see why the rest of the functionality should be restricted. @mikewilburn @fallsdownhill thoughts? How does the Android app behave?

The app should work regardless of whether location permission is granted or not.

An argument could even be made that directions shouldn't require current location either -
The application could allow for a designated start (map point or address input), and if current location can be attained, that's also an optional input to the directions.

An argument could even be made that directions shouldn't require current location either -
The application could allow for a designated start (map point or address input), and if current location can be attained, that's also an optional input to the directions.

I don't disagree with that, but we've already showed that in the Maps App. This app is supposed to be much simpler, we don't want to replicate most of the functionality in Maps App.

Good point. We should keep it simple and only support routing from the user's current location. That's what the Android version does and we shouldn't diverge the app experience!

If you go in and turn off the location permission, the app just crashes. It's granting permissions automatically at install since it's going through Android Studio and targeting API 22(Android 5.1 - runtime permissions were added in 6.0). So I would have to update that logic(and target API version), and then make a decision on the app behavior at that time.

@fallsdownhill can you add an issue please to the Android app with what you just said. Thanks!

@odoe I'm marking this as a bug. The app should still allow the user to search for places within the current extent even if user's location isn't available. As far as directions, it's up to you. You can remove/hide the button if user's location isn't available, or leave it and when user taps on it prompt them to enable location services.

Done in ed2a0f4 and currently live

This seems partially resolved. When hitting Search, the list of results is now being populated. However, when the app initially loads, there are no initial results populated.

They need to do a search first or I have no way to get results. When loaded on a mobile, there is no map. This needs to be left up to the user to initiate.

I added an alert that the user needs to run a search if they have denied location permissions.

I like the alert workaround.

@odoe neither Mara nor I are able to reproduce the alert now. Reopening this.

@mikewilburn fixed, thats what I get for trying to get browser specific. It should just work now.

Verified. Now consistently getting this message when I've delete the page's cache and do not grant location access.

Chrome:
image

Safari:
image