Skip Navigation

[Resolved] Map markers generate Javascript error if contain full stops or brackets

This support ticket is created 5 years, 1 month 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.

Our next available supporter will start replying to tickets in about 4.13 hours from now. Thank you for your understanding.

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 Gavin 5 years, 1 month ago.

Assisted by: Waqar.

Author
Posts
#1372023
mapmarkererror.png

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

#1372201

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

#1374093

Thank you. I have replaced IDs with slugs.