Problem:
When adding Google Maps in tabs where the map is not in the first tab so that it is initially hidden, opening the tab which contains the map shows a placeholder for the map which is not actually rendered
Solution:
You need to add the following Javascript to re-initialise the map once the tab has been selected (be sure to edit the map id):
( function( $ ) { $( document ).ready( function(){ $('.et_pb_tabs_controls > li.maptab').on('click', function () { var timeoutID = window.setTimeout( function(){ WPViews.view_addon_maps.reload_map('map-2'); }, 600 ); }); }); })( jQuery );
Note that this solution is specifically for Divi tabs. The same problem arises with Bootstrap tabs, but there the solution is simpler: https://toolset.com/forums/topic/google-map-not-working-in-a-tabbed-interface/
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.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | - |
- | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | - |
Supporter timezone: Europe/London (GMT+01:00)
This topic contains 4 respuestas, has 2 mensajes.
Last updated by Tim Elliott hace 6 años, 12 meses.
Assisted by: Nigel.