Skip Navigation

[Resolved] Can the Google Place JSON be accessed via the Toolset Maps?

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 7 years ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 -
- 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 7 replies, has 2 voices.

Last updated by harryT 7 years ago.

Assisted by: Noman.

Author
Posts
#512482

I am trying to use the Google Place Details JSON to display data. Does the Toolset Maps plugin make use of the place_id field, as detailed in hidden link ? And if so, how do I access it?

#512578

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Harry,

Thank you for contacting Toolset Support. I am not quite sure what you are trying to achieve, but yes we do have place_id and following all standard methods as suggested by Google Maps API. You can see place_id in 2 files if you search in Toolset Maps folder, please see attached screenshot. And you can access it via custom jQuery / JS code.

You may want to utilize our Toolset Views API:
https://toolset.com/documentation/programmer-reference/
https://toolset.com/documentation/user-guides/maps-shortcodes/

It would need some custom coding to make it happen. We have some recommended list of service providers here if you would like to take a look: https://toolset.com/consultant/

Have a great day,
Thank you

#512595
Screenshot 2017-04-12 05.47.15.png

To answer your question, I want to use the place_id number to fill in all of the data that Google generates on a search, like the attached screenshot (Address, phone number, website, Google ratings, etc.).

This appears to be what I need - but where's the screenshot you spoke of?

I figured that it would take some custom coding. But if I can get the JSON from the place_id, then I can use JavaScript to display the data.

#512624

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

place_id maps.png

Hello Harry,

Oh sorry, looks like image didn't get attached. I have added the screenshot now so you can see it.

Thank you

#513238

It looks like you've already written what I need in the var placeDetails

  var placesDetails = ("id place_id url website vicinity reference name rating " +
    "international_phone_number icon formatted_phone_number").split(" ");

How do I show that in a View? I assume it goes in one of the JS editors, but what's the structure? Do you have an example?

#513402

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Harry,

No, sorry we do not have any example for this one. You can add JS code in the JS editor. It depends on how you want to use that, you can pass all parameters in the placesDetails variable either manually or in a dynamic way.

This feature is not part of Toolset and as a support policy we do not do custom coding and as such assisting with the modification of this code is out of our support forum scope. If you would like us to add some feature request for this please let us know.

Thank you

#513447

I wasn't looking for custom coding; I was looking for a general idea of how JS is handled in a View, i.e.: enclosing tags and brackets, file structure, etc. Surely someone has a screenshot of that.

#513457

Disregard that last comment. I figured it out through experimentation and the (limited) page on JS in Views.

For those looking for an answer to my question: just write/paste your code into the second JS editor box. Try it with the example alert code offered on the documentation page: https://toolset.com/documentation/user-guides/adding-custom-javascript-views/

It would be helpful if the documentation on that page were a lot clearer and included some screenshots. For example: why are there two places to put JS and what's the difference between the two? On your JQuery example, show a better example: first the code with the "$" tags, then without.

The forum ‘Types Community Support’ is closed to new topics and replies.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.