Skip Navigation

[Gelöst] Show Google Map in Bootstrap Collapse element

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.

Problem: I am including a Map View inside a collapsed element (using Bootstrap Collapse). When the collapsed element is shown, the Map does not appear.

Solution: Add a JavaScript event handler that reloads the Map when the collapsed element is shown. Wrap your code in a jQuery document ready handler:

jQuery(document).ready(function(){
  jQuery('#collapseExample').on('shown.bs.collapse', function(){
    WPViews.view_addon_maps.reload_map('map-2');
  });
});

Relevant Documentation:
https://getbootstrap.com/docs/4.0/components/collapse/

This support ticket is created vor 6 Jahre, 3 Monate. 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.

Heute stehen keine Supporter zur Arbeit im Werkzeugsatz-Forum zur Verfügung. Sie können gern Tickets erstellen, die wir bearbeiten werden, sobald wir online sind. Vielen Dank für Ihr Verständnis.

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)

Dieses Thema enthält 20 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von Christian Cox vor 6 Jahre, 3 Monate.

Assistiert von: Christian Cox.

Author
Artikel
#613864

The code isn't wrapped in a document ready handler, so there could be a race condition (sometimes it works, other times it does not). Add the event handler wrapper around this code and see if that helps:

jQuery(document).ready(function(){
  jQuery('#collapseExample').on('shown.bs.collapse', function(){
    WPViews.view_addon_maps.reload_map('map-2');
  });
});
#613875

Hi Christian,

It doesn't help. It shows a blank map and when I swipe it will show me the world overview map. What did I do to get this? So strange! What can we do?

#613877

Maybe this is a new topic but the reset button works but the results are a list without images per item. WhenI refresh it will show the images. Is this something that is bothering the map too?

Neue Threads, die von Christian Cox erstellt wurden und mit diesem verbunden sind, sind unten aufgeführt:

https://toolset.com/de/forums/topic/split-updated-results-are-not-displayed-correctly-when-i-reset-filters-in-a-custom-search-view-with-the-reset-button/

#613891

It appears that the map with ID "map-2" no longer exists. Did you remove the map shortcode, or modify the map ID in that shortcode?

#613899

I took a look and indeed it was gone and switched to 1 again. This is very stupid. I probably saved an open window on different computer. I am really learning a lot. Thanks so much for this marvelous support.

Any ideas o the reset button?

#613910

Not entirely sure about that...It will require some additional investigation. I have split that topic into a new ticket where we can follow up.

Dieses Ticket ist jetzt geschlossen. Wenn Sie ein Toolset Kunde sind und Hilfe benötigen, eröffnen Sie bitte ein neues Support-Ticket.