Esri / nearby-javascript

ArcGIS API for JavaScript app to find places nearby and route to the nearest location.
Apache License 2.0
41 stars 24 forks source link

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

Closed codergrl closed 5 years ago

codergrl commented 5 years ago

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?

mikewilburn commented 5 years ago

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.

codergrl commented 5 years ago

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.

mikewilburn commented 5 years ago

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!

fallsdownhill commented 5 years ago

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.

codergrl commented 5 years ago

@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.

odoe commented 5 years ago

Done in https://github.com/ArcGIS/nearby-javascript/commit/ed2a0f4bf0900cf9e2256cdcc8d8442699a588b2 and currently live

codergrl commented 5 years ago

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.

odoe commented 5 years ago

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.

odoe commented 5 years ago

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

codergrl commented 5 years ago

I like the alert workaround.

mikewilburn commented 5 years ago

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

odoe commented 5 years ago

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

mikewilburn commented 5 years ago

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

Chrome: image

Safari: image