Skip Navigation

[Resolved] Toolset Map in Content Template

This support ticket is created 5 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 2 replies, has 2 voices.

Last updated by JamesS2731 5 years, 3 months ago.

Assisted by: Waqar.

Author
Posts
#1351061

Tell us what you are trying to do? Add a map to a custom post type to show a venue location, using it's postcode field to crete the marker.

Is there any documentation that you are following? Your Toolset Map guide.

Is there a similar example that we can see? Not really. You can see an example page with the map not showing the marker though - hidden link

What is the link to your site? Yep, sure - hidden link

Admin login details if required:

URL: hidden link

UN: toolset

PW: !n%T#eiqEWSceYHiUVqJFEK8

Content Template is Venues Content Template

When I add the map, then the map marker, I choose 'A post field storing an address' and 'The current post being displayed either directly or in a View loop' as the data field, but I then can't find the correct field when typing in suggestions (the field is a custom field 'postal_code'.

I tried choosing another field then updating the code manually but with no luck.

Any thoughts or ideas most welcomed.

Kind regards
James

#1351619

Hi James,

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

As explained in its documentation ( ref: https://toolset.com/documentation/user-guides/maps-shortcodes/#wpv-map-marker ), the "wpv-map-marker" shortcode can recognize the location information in these 3 formats:

a). "marker_field": can be used with only the "Address" type custom field.

b). "address": human-readable address that Google maps location API can understand.

c). "lat" and "lon": the exact latitude and the longitude of the location can be passed on through these two attributes.

Since the "postal_code" field on your website is not the "address" type custom field, it can't be used with the "marker_field" attribute.

But you can use it with "address" attribute, like this:


{!{wpv-map-render map_id='map-1'}!}{!{/wpv-map-render}!}

{!{wpv-map-marker map_id='map-1' marker_id='marker-3' address='{!{types field='postal_code'}!}{!{/types}!}'}!}{!{/wpv-map-marker}!}

Please note, how the value of this field is used in the "address" attribute in the map marker shortcode.

Important: At the moment, your Google Maps API key seems to be missing the needed service, for location services. Please check your Maps API key settings and make sure that all 3 services are enabled against it:
( ref: https://toolset.com/documentation/user-guides/display-on-google-maps/creating-a-google-maps-api-key/ )

- Google Maps Geolocation API
- Google Maps JavaScript API
- Google Places API Web Service

I hope this helps and please let me know how it goes.

regards,
Waqar

#1360971

Hi Waqar,

Many thanks for your quick response and my apologies for the delay in replying.

That's great, works perfectly! I had to adjust my referer restriction settings on the 2nd Maps API as suggested in one of your help articles - https://toolset.com/forums/topic/google-maps-api-with-referer-restrictions/ - but after that, everything worked as intended.

Many thanks for all your help.

Kind regards
James