Skip Navigation

[Resolved] Re-render Toolset Maps Via WordPress Ajax

This support ticket is created 4 years, 5 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 2 replies, has 2 voices.

Last updated by suhelaK 4 years, 5 months ago.

Assisted by: Christian Cox.

Author
Posts
#1720189

Tell us what you are trying to do?

trying to output the toolset map shortcode from a custom filter but the map does not show when re-rendered with do_shortcode via WordPress Ajax.

Is there any documentation that you are following?

https://toolset.com/documentation/programmer-reference/maps/maps-shortcodes/#wpv-map-render

Is there a similar example that we can see?

What is the link to your site?

#1721017

Hello, first I would verify that maps load normally on this page on the page load event. In other words, add a map to the page using the normal map shortcode, visible without any AJAX loading or pagination. Once you have confirmed that, try reloading the AJAX map placement using the following method from the Maps JavaScript API:

WPViews.view_addon_maps.reload_map('map-1');

Replace map-1 with the ID of the map used in do_shortcode. If you have multiple maps, you can find all the map objects here:

WPViews.view_addon_maps.maps

Or you can inspect the maps object keys for a simple list of IDs:

var mapKeys = Object.keys(WPViews.view_addon_maps.maps);

A few more links to various information about the maps JavaScript API: https://toolset.com/documentation/programmer-reference/maps/

Let me know if this does not resolve the problem and I can take a closer look.

#1721189

Hi Christian, the shortcode definitely works when it is loaded normally, and with the reload api you provided, resolved the issue. Thank you so much! will be keeping the links you provided for future references