-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show and sort by distance to each masjid from current location #80
Comments
@fayez-nazzal now all masjids will come with lat/lng info. We can now calculate and sort by the distance for all of them! |
lat/lang means interesting map visualizations! |
@hammady Can you tell which sort will happen first, prayer time or location? Or are we only going to sort by location when someone requests it? I prefer to auto-detect the location as soon as the page loads, which will only be successful when the permission is granted in the browser. In case the page is visited for the first time, the location won't be shown, but a browser popup will appear in the address-bar asking for permission. As soon as it's accepted, we do that work. In that mean time we show the status on a toast at the top of the page. +I had an idea to show a persistent toast in the top that shows a summary - Nearest Masjid, Distance to that masjid, Next prayer, remaining time for the next prayer. And in the opposite side show nearest 5 masjids with relative info. But this is for another PR. What do you think? |
@fayez-nazzal I think the page should default to sort by time because this is the simplest approach which does not require any permissions. When it comes to sharing the user location, most conscious users will not grant the permission unless it is absolutely necessary. That's in general. We don't want occasional users to see this permission request before they trust us. |
Let's discuss your second idea in a separate issue. If you can also provide any mockups it will help me understand. |
We can add a button to request the precise location of the user then show the distance (straight line) to each masjid in the tables. If available, we can also sort by distance. This is an approximation of the actual route to each masjid which requires accessing a remote API to calculate directions. The straight line distance can be calculated easily using the Euclidean distance formula for latitude/longitude defined locations. A quick search led me to this library: https://www.npmjs.com/package/geolib.
The text was updated successfully, but these errors were encountered: