Hey Luo,
Thanks for the assist.
So, since I am using the types beta I have been told I need to use the views beta anyway. Since that's the case I decided to go the shortcode route within a view and use render_view from the API.
https://toolset.com/documentation/user-guides/display-on-google-maps/
https://toolset.com/documentation/user-guides/maps-shortcodes/
I am using the new relationships.
https://toolset.com/documentation/programmer-reference/views-api/#render_view
In my single-event.php template file I am using the following to render out the view:
echo render_view( array( 'id' => 179 ) );
I have the following primary post types:
Events CPT - 'events' slug
Venues CPT - 'venues' slug
They are joined in a one to many relationship by the intermediary - Events at Venues - 'venues-events' slug
I have created a view (id 179) that queries 'venues' with the post relationship filter:
'selects posts in an Events at Venue relationship, that are related to the Post where this view is shown
(screenshot - view_query_filter)
In the Loop Wizard I've selected:
Venue Address is : [types field="venue-map-location"][/types]<br>
Venue Post ID is : [wpv-post-id]
[wpv-map-render map_id="map-6" map_height="400" single_zoom="16"][/wpv-map-render]
[wpv-map-marker map_id="map-6" marker_id="marker-[wpv-post-id]" marker_title="Uberdooze" marker_field="wpcf-venue-map-location"][/wpv-map-marker]
(Screenshot - view_template)
So I can see it is querying the correct venue post, as the address field is outputting correctly.
The post ID of the venue is displaying the correct ID (this was just for troubleshooting.
You can see this from the screenshot of the post edit, address and ID.
(Screenshot - post_edit)
But the map that is being outputted is not showing any marker at all and is showing a location in the middle of the sea.
(Screenshot - Output)
I am expecting that this is my own stupidity and I've missed something in the documentation, it would be grand if you could help point me in the right direction.
I've also made a duplicator as this site isn't live even on staging. It's actually a site/theme I'm looking to rewwork from using CMB2 to adapt to a better workflow for users that should become possible with the new relationships in the Types/Views beta.
Thanks again
Jeff