madarasz / always-be-running

22 stars 6 forks source link

[Feature Request] Tournaments near me #42

Open gereons opened 7 years ago

gereons commented 7 years ago

Instead of (optionally) restricting the view for upcoming tournaments to a user's country, it would be great to have the option to say e.g. "show me everything in a 200km radius".

Use case: I'm in Cologne, fairly close to the Netherlands and Belgium, so tournaments in Eindhoven and Liége are much closer and attractive to me than those in Berlin or Munich.

GuvBubbs commented 7 years ago

I like this. If there isn't enough in your home country then it fills with the next closest.

madarasz commented 7 years ago

Hmm... Yeah, you can do this geolocation thing in the browser. Though I like to keep it simple. What should be the default distance? I want to spare the UI from another field. 200km sounds reasonable in Europe. I'm not so sure about the rest of the world, especially US.

Donald: "closest country" is trivial from New Zealand, anywhere else it's not :D I could try "closest" but you would still not be happy if it found a tournament next door but a year later...

madarasz commented 7 years ago

This is the best algorithm I thought up:

  1. Find the closest upcoming tournament
  2. Measure distance. If it's smaller than 150km, use that instead as distance.
  3. Search tournaments around user using double the distance.

Any better ideas?

gereons commented 7 years ago

I don't think this will work. My IP-based geolocation is somewhere in the outskirts of Cologne, and as there will always be an upcoming tournament in downtown Cologne, this would reduce the distance to 20 or 30km. Doubling that wouldn't even show me events in Aachen or Dortmund which are two of the closest cities that run tournaments.

I would actually prefer to have two user profile fields, home town and distance for this.

madarasz commented 7 years ago

I wrote in point "2" to use minimum distance of 150km, which is doubled. I guess you misunderstood me. So the search would be 300km minimum and twice the distance to the closest tournament.

I don't know if that's usable in the US.

gereons commented 7 years ago

Yeah, sorry, I totally misunderstood the "use that" to mean the "closest distance". :)

ANR-PeterPan commented 7 years ago

perhaps we can get a "europe" Country and/or US states too?

madarasz commented 7 years ago

@gereons @GuvBubbs @ANR-PeterPan: I implemented a "Zoom to me" button on the Upcoming page. Please check it out if it works.

Limitations:

gereons commented 7 years ago

Works ok for me, but I would change two things:

a) make it zoom in 1 or 2 levels deeper. At the current zoom level, I still see everything from Cardiff to Vienna.

b) automatically remove the country selection, because for people near borders (i.e., everyone in continental Europe) stopping at borders kinda defeats the purpose :) (Also, the Zoom button and the "no country" selection are very far apart)

5N00P1 commented 7 years ago

Agree with @gereons as I have to manually select the countries close to me, which is Poland & Czechia.

madarasz commented 7 years ago

@gereons: thx for the feedback. "A" is a bug, "B" will be implemented later with the improved filtering feature (the browser will download all tournaments once and do the filtering in the frontend, currently filtering is done by the backend)