Skip Navigation

[Resolved] Split: Calculate distance by Map API and use in view. – How to createa form

This support ticket is created 5 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 6 replies, has 2 voices.

Last updated by Himanshu Agarwal 5 years, 10 months ago.

Assisted by: Minesh.

Author
Posts
#1175364

Thank you for reply.

Please help me, how to make a form to take location from user end?

I mean a form that show fields, Start location and End location with google api and user fill the location (only places).

After submit calculate distance between filled locations (places), and show that distance and location to a View in a template (toolset).

Please let me know, how to make this process step by step?

#1175365

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - have you created the Toolset form using which you can take the values from the users.

- Install and activate the Types, Toolset Forms and Toolset Maps and Toolset views plugin.
- Create a start and end location fields and assign to your desired post type
- Create a new post form and autogenerate the form
- Create a new page and add the newly created post form to it

More info:
=> How to add custom fields: hidden link
=> https://toolset.com/documentation/getting-started-with-toolset/publish-content-from-the-front-end/forms-for-editing/

#1175367

I do not need to add post data or edit any post data.

I need a form working like this in toolset:

hidden link

( kindly ignore the map i just need the distance and duration)

I just need a from with two location (only places) fields.

Enter the location and submit, then show distance between two entered location on a template with the help of google api.

#1175403

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Ahh, ok, now I understand what exactly you are looking for.

I will give a try to check if this possible to add two custom fields as the filter and if we can able to display the distance.

I will get in touch with you tomorrow.

#1175782

I already tried it that use custom field (Address) in filter but its not working at all.

Please give me a solution as soon as possible.

#1175791

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Ok - I tried to implement the solution you need but there is no way available to add multiple address fields as the filter.

The only way you can add map filter is using distance filter but it has the limitation that you can add only one distance filter.
So there is no way to add start and end location.

Even if we able to integrate the two distance fields within view's search filter the issue will be there is no way you can grab the distance filter value from URL param as for target value it only accepts either post field, term field or user field as you can see with the following screenshot:
=> hidden link

More info:
=> https://toolset.com/documentation/user-guides/display-on-google-maps/filtering-and-ordering-map-markers-by-distance/

Now, to implement the feature you are looking for needs custom programming that is beyond the scope of our support policy. If you need custom programming for your project, please feel free to contact our certified partners:
=> https://toolset.com/contractors/

#1176725

Thank you!