Forum Academy Marketplace Showcase Pricing Features

Grindr like display

Hi,

I’m making an app like Grindr which will return a repeating list sorted by people nearest to me. BUT, I’m getting the list from the address they have in the db. This includes (different fields) state, city, address1, address 2, zip-code.

How do I do this? Is there a plugin that i can use? Any guide I can check on how to do this?

Thanks a lot.

You could use the inbuilt geographic address field type and use it for calculating the distance between the users and sort by that.

I can’t. It has to be from the address that they entered in the database. Not their exact current position. Anyway i can do this?

Geographic address is an address…if you tie it to the google geolocation service through the search input, your user can enter their address. from this, you can extract component parts, like street, county, country, state.

I’m not sure if you can create a geographic address from individual parts, like street, town, postcode etc. but you could try.

Is it just one field? How is it done? Do you have a sample I can check? Say I need them to enter their home address, would it work if they are somewhere else? Sorry for the newb questions…

@jogo88

Here you go, i have just put together this demo for you. Open the page and enter an address.

and in the editor:

2 Likes

wow, thank you so much! I’m gonna try and incorporate it on my page and see how it goes!

Appreciate this a lot man!

3 Likes

Hi Dave,

I adopted what you did to my account creation page but I’m having the following problems. The country and address (street) in the DB is empty. Granted, addresses in Japan are entered weird

Ex: 1-2-16 Katano

If you type that, it will auto complete but then I click on create the account, as you can see from the DB, the country field and street are empty.

What am I doing wrong?

You have typed County instead of Country in the :extract field. (i.e. missed the ‘r’)

Oh thanks. I didn’t know there was a county field too.

But what about the street? I changed “address1” to street too to match it but still not getting anything…

Have you tried putting each possible :extract field onto a test page and see what comes out for the addresses you are trying to work with? A bit like my demo page,

I don’t know in the ins-and-outs of how Google manipulate the fields for the location api.

It gives a list of fields for you to select from when you choose the :extract method.