Skip Navigation

[Resolved] Toolset Maps Google API not displaying markers on the front end

This support ticket is created 4 years, 3 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Karachi (GMT+05:00)

This topic contains 5 replies, has 2 voices.

Last updated by Stephen 4 years, 3 months ago.

Assisted by: Waqar.

Author
Posts
#1400307
Screen Shot 2019-12-04 at 4.26.34 PM.png
Screen Shot 2019-12-04 at 4.22.46 PM.png
Screen Shot 2019-12-04 at 4.16.05 PM.png

I am trying to: Use the Toolset Maps plugin to display custom post type custom address fields. I have reviewed all support tickets and performed all requested troubleshooting activities. It works on the backend, but doesn't on the front-end render. It is like it doesn't see marker shortcode referencing the immediately preceding map shortcode with unique map ID. I have gone ahead and done the following, including:
Switching to WP 2020 theme
Deactivating all plugins
Ensuring there are no restrictions on both API keys
Activating (Geocoding API, Maps Embed API, Maps JavaScript API, Maps Static API)
Hardcoding the address
referencing the custom field of the CPT

Nothing has worked to get it to render properly.

Link to a page where the issue can be seen:
hidden link
I expected to see:
The address that was included in the CPT's custom field (toolset address field).
Instead, I got:
Ocean

#1400623

Waqar
Supporter

Languages: English (English )

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

Hi Stephen,

Thank you for contacting us and I'd be happy to assist.

When I checked the page ( hidden link ), a map with a marker was already showing.

But from the code, it seems that this map may be added using a different plugin than Toolset Maps. I'll need admin access to see how the Toolset Maps plugin's shortcodes are being used to show the map and the marker and troubleshoot accordingly.

Note: Your next reply will be private and please make a complete backup copy, before sharing the access details.

regards,
Waqar

#1401603

Waqar
Supporter

Languages: English (English )

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

Hi Stephen,

Thank you for sharing admin access to the test website.

The view "Single Member Listing Map" was set up to show 1 "Member Listings" post, ordered by date.

Based on these settings, it was always bringing in the "Southwest Mobile Homes, LLC" post as a result, which doesn't have any location set in the "Address of Your Organization" field and this is why no map marker was showing on any "Member Listings" posts.

To make this view bring in the post in which it was being used, I added the following changes.

1. I disabled the option "Don't include current page in query result" as we do in fact want the current page/post in the results and also added a post ID filter to include only those posts, whose ID is passed in view's shortcode attribute "ids".

Screenshot: hidden link

2. Next, In the Elementor template "Single Member Listing" that shows the map, I added a text widget and called view's shortcode, including the attribute "ids".


[wpv-view name="single-member-listing-map" ids="[wpv-post-id]"]

Note how the "wpv-post-id" shortcode ( https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-id ) was used to include the current post's ID.

Here is a guide on passing arguments to views:
https://toolset.com/documentation/user-guides/passing-arguments-to-views/

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#1402005

Thank you so much Waqar.

I am able to share that the initial problem has been resolved. I will say that I do not understand why the prescribed method for performing the function of placing a Google map & marker doesn't work on my app.

Due to the fact that this is the case I have a follow up question:

How would you place a list of markers, being a index/aggregate of all members' addresses, on a single map?

#1402901

Waqar
Supporter

Languages: English (English )

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

Thanks for the update and glad that it works.

>> I will say that I do not understand why the prescribed method for performing the function of placing a Google map & marker doesn't work on my app.

- While adding Toolset shortcodes and elements, it is important to keep track of the scope of the current item.

In the video tutorial that you referred to, the map and the marker were placed directly inside the single post page's template.
Visual representation: Content Template -> Map & Marker

But on your website, the map and the marker were not placed directly in the single post's page's template, but inside a view "Single Member Listing Map".

That view is then used in an Elementor template for the single posts, which is why, we had to include the extra step, to tell the view, which post do we want.
Visual representation: Content Template (Elementor) -> View -> Content template for view's single item -> Map & Marker )

Hope this makes it more clear.

>> How would you place a list of markers, being a index/aggregate of all members' addresses, on a single map?

- Showing multiple markers on a single map is very simple, as explained in this guide:
https://toolset.com/documentation/user-guides/display-on-google-maps/displaying-markers-on-google-maps/#displaying-a-map-with-a-list-of-markers-coming-from-a-view

In summary, you'll create a post view, which will loop through the required posts and you'll insert a map, outside the view's loop.
( so that it displays only once and doesn't repeat with each item in the view's results )

The markers for the view's result item should be inside the loop, as they'll be unique for each post and we do want them to repeat for each result.

#1404537

My issue is resolved now. Thank you!

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