Is there a way to let the user switch between miles and kilometers in the exposed proximity filter? This issue implies that was available in D7 but I can't see any way to do it in D9.

Comments

Michelle created an issue. See original summary.

itamair’s picture

Status: Active » Needs work

Nice catch @Michelle ... actually this proximity filters implementation doesn't make the Units form element exposed ... in the View Exposed Proximity Filters. It could be indeed a valid add-on ... but that needs work.
I can put on my TODO list, but cannot put on top of it.
I don't feel should be a big deal ...
Feel welcome in providing a working (and well QAed) patch eventually on it ...

michelle’s picture

Thanks. Going to see what we can do for the client to work around this. If we end up with something that could be useful to others, I'll add it here.

michelle’s picture

We ended up working around it by adding the proximity filter twice, once set to miles and one set to kilometers. The second one didn't have the form and the form from the first one luckily worked with both. I then form altered a drop down to switch and a coworker added in javascript to show/hide the distance boxes to toggle between them. It works but isn't anything that makes sense to put in the module itself. Having the exposed filter handle it would be the best way to go in the module.

michelle’s picture

Category: Support request » Feature request
itamair’s picture

Title: Miles/Kilometers in exposed filter » (Miles/Kilometers) Proximity Units selection in exposed filter
itamair’s picture

Status: Needs work » Needs review
StatusFileSize
new9.47 KB

#Michelle thanks ...
I found both time and commitment to implement this Feature request, with the attached patch.
I am committing it into dev and going to deploy a brand new 8.x-1.49 release with it ...

Please Test and Review it, and let me know if you find any regression/bug in it ... and eventually re-open this.

  • itamair committed fc2f7797 on 8.x-1.x
    Issue #3327487 by itamair: (Miles/Kilometers) Proximity Units selection...
itamair’s picture

Status: Needs review » Fixed

  • itamair committed b21b0a44 on 8.x-1.x
    Issue #3327487 by itamair, Michelle: (Miles/Kilometers) Proximity Units...
itamair’s picture

Now a new checkbox is present that lets you expose the Units selector in the View Exposed Filter form, as you can see from the attached screenshots.
The Geofield Live Demo home page/map is already working with this setting: https://www.geodemocracy.com/drupal_geofield_stack_demo/web

michelle’s picture

@itamair - Great! Thank you!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.