Hello
I have a Post Type called Map Markers and I am displaying these on a map. All is working fine. However, two of my Map Markers generated Javascript errors (which I noticed when my Bootstrap 4.0 menu stopped working).
One was called St. Mary's Church and the other was called Royal Marine Barracks (Exiles Club).
When I removed the full stop from the first and the brackets from the second, I got no Javascript error.
Thanks
Gavin
Hi Gavin,
Thank you for contacting us and I'd be happy to assist.
I've performed some tests on my website and was able to reproduce the error from your screenshot, only when the post's title was used in the ID of the marker.
Example:
[wpv-map-marker map_id='map-1' marker_id='marker-[wpv-post-title]' marker_field='wpcf-field-slug'][/wpv-map-marker]
Using the title for the marker's ID is not a very good idea in the first place and you can replace it with the post's ID instead, which will always be unique for all posts and would also only consist of numbers.
( ref: https://toolset.com/documentation/user-guides/display-on-google-maps/displaying-markers-on-google-maps/#displaying-a-map-with-a-single-marker-for-a-content-template )
[wpv-map-marker map_id='map-1' marker_id='marker-[wpv-post-id]' marker_field='wpcf-field-slug'][/wpv-map-marker]
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar
Thank you. I have replaced IDs with slugs.