Resource icon

[J] Auto Complete Location 1.3.3

No permission to download
I'm unclear how the Types field works:

1579118827730.webp

Google's documentation here is very poor and vague, as usual.

We would like members to indicate which city they live in. But some would prefer to specify only a US state (or Canadian province), or others just want to refer to the country, for privacy reasons. I can probably add what I need to "Types" to enable this (since the VerticalScope sites use Google API for their locations, and I can enter my state and country with no problem), but Google is no help in determining what else I need to add in order to accomplish this.

Thanks! If this works, it is exactly what we have needed!
 
I have successfully installed the addon and I have two questions.

1. I have enabled auto-fill user base on IP address, it didn't work.
2. are there data kept in our database that I can reuse to match members base on distance?

Many thanks for the help in advance.
 
@JustinHawk - Asking a potentially silly question. What specific API do I use?

Is it this?

1615664471976.webp

I entered my generic google api from the console which is unrestricted and seem to have an issue with the location field -

1615664538961.webp

1615664568122.webp

Many thanks!
 
I think you need the Maps JavaScript API enabled.
I tried that API and enabled it. I now get this -

1615671895439.webp

I've now enabled every single maps related API on the Google Marketplace, again leaving the API unrestricted and it's still the same. Hopefully someone can shed more light on the subject. I'm completely out of my depth.
 
@JustinHawk I think there's a bug with your types field.

It defaults to the value of cities

Your template assumes this field should always be wrapped in parenthesis for a collection, but according to the supported types page I think it's only cities and regions that should be like that.

This means if you use another type such as geocode, address, or establishment , it doesn't work.

Also, if you specify a country restriction, but remove types completely, it will break due to the extra comma in the types conditional.
 
I tried that API and enabled it. I now get this -

View attachment 248471

I've now enabled every single maps related API on the Google Marketplace, again leaving the API unrestricted and it's still the same. Hopefully someone can shed more light on the subject. I'm completely out of my depth.

You might just have to give it some time for the changes to kick in. There can be a bit of delay sometimes when editing Google API settings.

I have Maps and Places enabled and it's working

1615672669498.webp
 
I'm getting a console error with this line in j_acl_location when using a custom field too

input.addEventListener("change", function(){ input.value = ""; });

I think as getElementsbyClassName return an html collection to input (instead of an element as in getElementbyID), it should be something like this:

input[0].addEventListener("change", function(){ input[0].value = ""; });
 
@JustinHawk I think there's a bug with your types field.

It defaults to the value of cities

Your template assumes this field should always be wrapped in parenthesis for a collection, but according to the supported types page I think it's only cities and regions that should be like that.

This means if you use another type such as geocode, address, or establishment , it doesn't work.

Also, if you specify a country restriction, but remove types completely, it will break due to the extra comma in the types conditional.
I'm getting a console error with this line in j_acl_location when using a custom field too

input.addEventListener("change", function(){ input.value = ""; });

I think as getElementsbyClassName return an html collection to input (instead of an element as in getElementbyID), it should be something like this:

input[0].addEventListener("change", function(){ input[0].value = ""; });
Thanks a lot. I have updated it now 😅
Please try latest version and let me know :)
 
You might just have to give it some time for the changes to kick in. There can be a bit of delay sometimes when editing Google API settings.

I have Maps and Places enabled and it's working

View attachment 248472
I'm still getting the same issue. It's really weird. 100% I have both of those api's enabled. It's telling me in the console that I don't - and that I need to enable them. I've tried disabling and enabling. Same thing. It's like the API key isn't being applied from within XF.

Any ideas @JustinHawk ??

Thank you! :)
 
I'm still getting the same issue. It's really weird. 100% I have both of those api's enabled. It's telling me in the console that I don't - and that I need to enable them. I've tried disabling and enabling. Same thing. It's like the API key isn't being applied from within XF.

Any ideas @JustinHawk ??

Thank you! :)
You can try following these steps : https://mpm.pm/threads/j-auto-complete-location.84/post-358

Edit: Send me a conversation with details I will have a look on your website.

Regards
J
 
Top Bottom