Same problem with Proximity Filters as in version 1 for Drupal 8.

1) The first "Adresse" (boundary) for the user to enter a city.
2) The second "Distance" (proximity) based on the first exposed filter, so that the user selects a search radius.

If I enter 1 "Athis de l'Orne" and in 2 "50 km", the results are displayed for "Athis de l'Orne" but nothing is displayed in the radius of "50 km".

Why ?

I did the test on simplytest.me

I added :
- a node with the location (61100 Flers, France)
- a node with the location (61450 Banvou, France)
- a node with the location (14000 Caen, France)

My furthest node is 50 km away.

I enter the filter exposed address (61100 Flers, France). Only the point (61100 Flers, France) is displayed on the map.

If I add the distance 200 km, only the point (61100 Flers, France) is displayed.

Logically I should see the 3 points.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

zenimagine created an issue. See original summary.

zenimagine’s picture

Manoj Raj.R’s picture

Component: Geolocation field » Geolocation Field / Backend
Priority: Major » Critical

Any Solutions for above filter question?

ChristianAdamski’s picture

Priority: Critical » Normal
zenimagine’s picture

zenimagine’s picture

Version: 8.x-2.0-beta1 » 8.x-2.x-dev
zenimagine’s picture

zenimagine’s picture

This problem severely limits the functionality of the module. Can not perform a proximity search with an address.

Proximity search has never worked with this module and it's a shame. Is it added ?

zenimagine’s picture

Do you have a patch for this problem ? Thank you

tannerg’s picture

This is a serious limitation in my view as well.

I think this is the most requested feature for this and the geofield module.

It seems to work fine using the default value provided by the contextual filter - it is just that changing the source origin does not work. No matter what I put in the URL for the lat long center - the filter picks up my default value.

hsponner’s picture

Also following this issue, really would appreciate this function.

ChristianAdamski’s picture

With all due respect, you can always sponsor me, if this is so urgent. I am doing this in my spare time after all.

ChristianAdamski’s picture

Status: Active » Needs review
FileSize
181.67 KB

This got a bit large, but I won't break it up right now.
- moved proximity handling to Plugins
- introduced "nominatim" OSM Geocoder
- introduced separate ProximityFormField using viewsForm as opposed to ProximityField which does not
- fixed a lot of issues around geocoders
- multiple bugfixes along the way

TODO:
- can't test client location locally for lack of https right now

Status: Needs review » Needs work

The last submitted patch, 13: 2936637-13-boundary-rework.patch, failed testing. View results

ChristianAdamski’s picture

- lotsa schema fixes

ChristianAdamski’s picture

Status: Needs work » Needs review
FileSize
207.79 KB

Actual error in Proximity Argument

Status: Needs review » Needs work

The last submitted patch, 16: 2936637-16-proximity-rework.patch, failed testing. View results

ChristianAdamski’s picture

Status: Needs work » Needs review
FileSize
207.58 KB

Argument handling fixed.

Status: Needs review » Needs work

The last submitted patch, 18: 2936637-18-proximity-rework.patch, failed testing. View results

ChristianAdamski’s picture

Status: Needs work » Needs review
FileSize
212.57 KB

Test / demo view updated

Status: Needs review » Needs work

The last submitted patch, 20: 2936637-20-proximity-rework.patch, failed testing. View results

ChristianAdamski’s picture

Status: Needs work » Needs review
FileSize
212.36 KB

Status: Needs review » Needs work

The last submitted patch, 22: 2936637-22-proximity-rework.patch, failed testing. View results

ChristianAdamski’s picture

Status: Needs work » Needs review
FileSize
211.83 KB

Ahh. Accidentally added a google geocoder reference to demo/test view, which does not have google enabled.

  • ChristianAdamski authored 269ba08 on 8.x-2.x
    Issue #2936637 by ChristianAdamski: In "Filter Criteria" the "Proximity...
ChristianAdamski’s picture

Status: Needs review » Fixed

This will cause a lot of fallout. I am sure a lot will break/broke. But the whole structure is much saner now and can be adapted much easier.

"Client location" needs a bit more love in #2879171: Proximity Field - Use HTML5 Geolocation as source

zenimagine’s picture

Excellent news ;-)

What can be broken? the views ?

Status: Fixed » Closed (fixed)

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

zenimagine’s picture

Issue summary: View changes
Rob230’s picture

Is there any documentation for this? I was using the proximity filter in v1 of the module and it worked fine when setting the coordinates proximity_lat and proximity_lng (direct_input) pictured below. It would find how far the location field was from those hardcoded coordinates, and then the proximity field would be able to display the value.

direct input example

In v3 it's completely broken. It has a huge number of options but none of them seem to work. From stepping through the code, center is never set when it's trying to find the proximity. Coordinates input causes some extra options to appear after you apply it, but any value entered is lost when saving.

coordinates input example

Fixed coordinates causes some options to appear inside the location input list. But neither seems to actually set the center. In ViewProximityFilter $filter->value['center'] is always empty regardless of what I have configured and the proximity field pointing to that filter always shows 0 miles.

fixed coordinates example

The documentation on https://www.drupal.org/docs/contributed-modules/geolocation-field/how-to... it seems to be explaining how to find the proximity to itself? Or I don't understand it. It doesn't make any sense. How do I get it to simply show the proximity of a field on the node to a hardcoded center point?