Location custom field by AddonsLab

Location custom field by AddonsLab [Paid] 2.0.1

No permission to buy ($39.99)
I have an issue with the Google API autocomplete and range-based search feature that I wanted to inquire with the community about. The problem is that if I have two custom location fields filled in using autocomplete and one has the value "San Diego, CA" and the other has value "United States", the location filter doesn't work the way you'd expect for these two fields.

For example, based on these two fields, if I search for threads within 1 mile of San Diego, CA, you'd think that the "United States" thread would show up in the results in addition to the "San Diego" thread but that's not the case...only the "San Diego" thread shows up. In other words, for larger city/state/country boundaries that encompass smaller towns/cities, why don't those larger boundaries always show up when searching for threads related to the smaller unit?

Is there a fix for this? I'd like users to be able to enter their address, for example, and have all threads associated with cities, counties, states, etc., in which that address is located, show up in the results. Does Google autocomplete/range search have this capability?

Just to summarize what we have discussed via support ticket - location field geocoding stores a single point on the map, and this point is somewhere in the middle of the area, so the coordinates of "US" are some point in the US but not a specific point that could be used to do a range search. For now there is no solution for that issue, we might release an update when we manage to resolve it somehow.

I'm wondering if this addon is still in development and I'm interested in developing one similar if it isn't. Mine would need to find members that are within a certain proximity of a US zipcode. City/State would also be ideal but not necessary. This would be a directory of sorts and I haven't seen anyone do this, except in XF 1.x.

Sure, it is supported. If you see any missing features, let us know, and we will consider it including them in one of future updates. We also have a "User filter" add-on not released publicly which can use this custom field for member directory. We might at some point find time to release it publicly.

Thank you!
 
AddonsLab updated Location custom field by AddonsLab with a new update entry:

Address validation fixes

The release includes multiple fixes related to address validation in both form-based and API-based modes. The updated version uses Google API if the key is available to get place information, even when the form-based UI is used, so this information can be used by other add-ons if needed, as well as for formatting the address information correctly.

The new version is available for all licensed customers at https://customers.addonslab.com/marketplace.php/my-services/

Thank you!

Read the rest of this update entry...
 
You can show the value using the appropriate macro:

HTML:
<xf:macro
    template="allf_custom_fields_macros"
    name="filter_value_location"
    arg-info="{$field_value_here}"
    />

We will address the issue you have highlighted in your previous post and will inform you soon.

Thank you!

@AddonsLab, could you (or someone) please explain this a little more fully? If I have a user's location info stored in a custom user field (e.g., that they enter in preferences), how exactly would I use this code, or something like it, to retrieve the user's location info in a template?
 
I have changed the jQuery to vanilla js, now the add-on seems to work also on 2.3.3.
It needs my a long time to find a solution; the problem was to have this.element.
I got it with:

if (!this.element) {
this.element = document.querySelector('[data-xf-init="LocationFieldForm"]');
}

Probably there is a better way?
 
Can I create a notice with this add-on that will only be visible for people that have set their location to Amsterdam, Netherlands? As in does it support criteria's? This feature is disabled in the demo.

Unfortunately, this add-on does not include such a feature. For now, we do not have an estimate on when such a feature could be implemented.

Thank you!
 
Back
Top Bottom