Thank you for contacting Toolset Support. I would be happy to help you in solving this.
This is happening because Google Maps can not be initialized on hidden containers (tabs, accordions, etc…). For a workaround, we need to know the ID of the map that we want to reload and use inside tabs.
Please add the following JS code in Layouts >> Layouts CSS and JS Editor >> JavaScript Editor >> and replace the ‘map-2’ with your 2nd map’s ID:
jQuery('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
WPViews.view_addon_maps.reload_map('map-2');
})
Thanks for the help. It is working partly now and I just have some additional questions. If the map is related to a location field how do I find the map-id?
The first part is the part where the user click on a location in a view and it then focus on it. How should I change that to work with the map on the second tab?
I have discussed this with our 2nd tier support and they said that it can not be done with built-in features of Toolset. More custom coding can make it happen as a workaround, but this is something you will need to get done through a developer. We have some recommended list of service providers here if you would like to take a look: https://toolset.com/consultant/
I will try to find out if there is something we can offer you at this point, some hook or anything related to that, I believe we don't have any such thing available but will double check with senior staff and I will update you soon.
It will need customization to this shortcode to create a new custom short code and as well as some workaround with javascript to get the Map ID of a map that is shown as part of a field.
Sorry we are not able to help much at this point. We have some recommended list of service providers here if you would like to take a look: https://toolset.com/consultant/
Have a great day.
Thank you
The topic ‘[Closed] Maps not showing properly in tabs’ is closed to new replies.