FacilMap / facilmap

FacilMap is a privacy-friendly, open-source versatile online map that combines different services based on OpenStreetMap and makes it easy to find places, plan trips and add markers, lines and routes to custom maps with live collaboration.
https://facilmap.org/
GNU Affero General Public License v3.0
317 stars 21 forks source link

How to change units to US_Customary by default #296

Closed TheBig-O closed 1 month ago

TheBig-O commented 1 month ago

I've read through the docs and tried several options and none seem to have any effect on the units shown in the maps. From the docs, it says:

In addition, certain values can be shown in metric units or in US customary units. By default, metric units are used. This can be changed by sending a units query parameter or cookie with the value us_customary.

I tried adding a query parameter of: &units=us_customary and even ?units=us_customary. Neither worked Is there an environment variable we can add to the Docker-Compose.yml or some other way to force units into us_customary? ad query parameter is fine, if I can figure out how to do it. Thank you! I really like the work you've done. Just trying to tweak things to my preferences.

cdauth commented 1 month ago

There was a bug in the handling of the query parameter, that should be fixed now. Could you try again?

The user preferences allow each user to configure the units for themselves. But I guess you are trying to change the default units used in your self-hosted FacilMap instance? What is your use case for this? Is your instance somehow regional to the US, so you are expecting most of your users to use US units?

TheBig-O commented 1 month ago

I think it's fixed now. I updated the container and it seems to be holding onto my user setting of us_customary. That's really all I was hoping for. My guess is that most of my users would be US based, but I'm okay with letting them set their own settings. I tried &units=metric to see if it updated, but I didn't notice a change.

Thanks for the quick response!

cdauth commented 1 month ago

Glad to hear that it works now.

It should probably be ?units=metric (unless there are other query parameters) and it needs to come before the #.