Skip Navigation

[Resolved] Google Map only showing marker from 1 custom post

This support ticket is created 6 years 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/Hong_Kong (GMT+08:00)

This topic contains 1 reply, has 2 voices.

Last updated by Luo Yang 6 years ago.

Assisted by: Luo Yang.

Author
Posts
#1216966

I've set up a custom post type with an address custom field. I've got 3 test posts all with valid addresses.

Using views (after following the Toolset guide) I've created a view for the map, I'm attempting to display the custom post type as a marker for each post. When I put the map on my site, Google Maps only showing marker from 1 custom post.

The loop editor code is as follows:

[wpv-layout-start]
[wpv-items-found]
[wpv-map-render map_id="map-7" map_height="450px" cluster="on"][/wpv-map-render]
<!-- wpv-loop-start -->
<wpv-loop>
[wpv-map-marker map_id='map-7' marker_id='marker-16' marker_field='wpcf-partner-address']
<h4>[wpv-post-title]</h4><br>
<h6>[types field='partner-address'][/types]</h6><br>
<h6>Tel: [types field='partner-phone-number'][/types]</h6><br>
<h6>Website: [types field='partner-website'][/types]</h6><br>[/wpv-map-marker]
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
[wpml-string context="wpv-views"]No items found[/wpml-string]
[/wpv-no-items-found]
[wpv-layout-end]

#1217354

Hello,

Two issues:
1) Each map marker should use an unique ID, for example, you can replace this line from:
[wpv-map-marker map_id='map-7' marker_id='marker-16' marker_field='wpcf-partner-address']

To:
[wpv-map-marker map_id='map-7' marker_id='marker-[wpv-post-id]' marker_field='wpcf-partner-address']

2) Dashboard-> Toolset-> Settings-> Maps
Please provide the second Google API key into box "2nd key for server-side requests"

More help:
https://toolset.com/documentation/user-guides/display-on-google-maps/creating-a-google-maps-api-key/