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
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
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