adab1ts/veinapp

Geolocation

Closed this issue · 5 comments

Given a geolocation button, we need to ask user for geoloc permission. If he accepts, we must do inverse geocoding to get the corresponding address and populate the input search with it
while in the background we change the ICurrentSearch Store State

This is still unclear @zuzust
As we talked we can:

  • make the current user position as the new ICurrentSearch state and based on it change the list of near places.
  • just take the center of the map based on user coords without changing the ICurrentSearch state and wait until the user trigger a new search to change the list of near places.

@plastikaweb in my opinion, geosearches should only be triggered by explicit user actions so I prefer the second scenario. Bear in mind that, if the geolocation request triggers a new geosearch, the only way to request a geosearch for a different radius would be launching a second request. Two searches for one intent makes no sense to me.

I think that the first makes more sense from a user experience point of view, because when a user clicks the geoloc button is not for seeing where he is in the map, is for seeing the places near him (that's the porpuse of the app, it is not a geolocation app, is a search app). The radius thing, I don't understand, is the same issue when the user would make a normal search, it returns the selected radius at that moment.
Anyway, as we already had this discussion yesterday and I see the arguments from both sides have not changed, I'll do as you say :).

It is a matter of consistency and observing the SRP. When a user clicks the geoloc button (not the search button) she expects to be located by the app (that is the goal of geolocation), not to be pointed on the map. Imagine you are not in your area and don't know in which street you are. Then you ask the app to geolocate you (reverse geocoding as a visual aid). And only when you define your search (centre AND radius), you click the search button that triggers the geosearch. And that behaviour is consistent with the rest of user stories.

If the geolocation button triggers a search there will be two different buttons for the same purpose (I can imagine a user filling the search field and clicking the geoloc button). And you only be able to define the radius of your intended search after the first search triggered automagically by the geoloc click event. Two searches to reach your results.

Mmmm ok @zuzust, I like the explanation, it makes sense 😄 thanks!

Todo:

  • geolocation service
  • reverse geocoding method on geocoding service and mapzengeocoding service.
  • geolocation ui (button)
  • testing
  • User cases:
  • First time, ask the user to get permission and if he accepts get the coords. Do a reverser geolocation to get the address. Populate the input with it.
  • If user does not give permission do nothing (besides showing the permissionDenied message).
  • error messages (unsupportedBrowser, permissionDenied, positionUnavailable, timeout, unexpected)