Title: Map on bootstrap modal
Last modified: August 24, 2016

---

# Map on bootstrap modal

 *  Resolved [jeeltcraft](https://wordpress.org/support/users/jeeltcraft/)
 * (@jeeltcraft)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/map-on-bootstrap-modal/)
 * Hi, I need help to resize de google map on a boostrap modal, the javascript transition
   that opens the modal hides the map, I can only see the marker but not the map,
   everyone on bootstrap community says that I need to add this code in order to
   make the map visible while the modal (#modal-3) has fired the shown event:
 * google.maps.event.addDomListener(window, “resize”, resizingMap());
 *     ```
       $('#modal-3').on('shown.bs.modal', function() {
          //Must wait until the render of the modal appear, thats why we use the resizeMap and NOT resizingMap!! ;-)
          resizeMap();
       })
   
       function resizeMap() {
          if(typeof map =="undefined") return;
          setTimeout( function(){resizingMap();} , 400);
       }
   
       function resizingMap() {
          if(typeof map =="undefined") return;
          var center = map.getCenter();
          google.maps.event.trigger(map, "resize");
          map.setCenter(center);
       }
       ```
   
 * May I add this in your wpsl-gmap.js file?
 * Thanks in advance,
    LauraC
 * [https://wordpress.org/plugins/wp-store-locator/](https://wordpress.org/plugins/wp-store-locator/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [jeeltcraft](https://wordpress.org/support/users/jeeltcraft/)
 * (@jeeltcraft)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/map-on-bootstrap-modal/#post-6164405)
 * Ok, sorry for the questions, I may have problems with chrome, the map works perfectly
   on bootstrap modal 🙂

Viewing 1 replies (of 1 total)

The topic ‘Map on bootstrap modal’ is closed to new replies.

 * ![](https://ps.w.org/wp-store-locator/assets/icon-256x256.jpg?rev=1007784)
 * [WP Store Locator](https://wordpress.org/plugins/wp-store-locator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-store-locator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-store-locator/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-store-locator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-store-locator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-store-locator/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [jeeltcraft](https://wordpress.org/support/users/jeeltcraft/)
 * Last activity: [10 years, 10 months ago](https://wordpress.org/support/topic/map-on-bootstrap-modal/#post-6164405)
 * Status: resolved