Google Map API in Foundation reveal modal not displaying properly [duplicate]

烈酒焚心 提交于 2019-12-04 04:09:30

问题


Possible Duplicate:
Google Map API inside a Reveal Modal not showing fully

I have a Google Map API located within a Reveal Modal. For those that do not know what that is, it is basically a hidden container that pops up when a button is clicked. I have within this reveal modal the Google Map API, which is displaying, but not displaying all of the map, it is only showing maybe a third of it.

How do I get the whole map to display?

A link to my page: http://simplicitdesignanddevelopment.com/Fannie%20E%20Zurb/foundation/contact_us.html#

CLICK ON THE GOOGLE MAP BUTTON TO SEE THE ISSUE AT HAND

The Reveal Modal script:

<script type="text/javascript">
$(document).ready(function() {
$('#myModal1').click(function() {
$('#myModal').reveal();
});
});
</script>

The Div which contains the Google Map API

<div id="map_canvas" style="width:600px; height:300px;"></div>
<a class="close-reveal-modal">&#215;</a>
 </div>

The button which when clicked, reveals the Google Map

<div class="five columns">
  <ul class="button-group even three-up" id="contact-button-group">
    <li><a href="#" class="button" data-reveal-id="myModal">Google Map</a></li>
    <li><a href="#" class="button">Button 2</a></li>
    <li><a href="#" class="button">Button 3</a></li>
  </ul>
</div>

回答1:


After the modal is shown use google.maps.event.trigger(map, 'resize') where "map" is the instance of your map.



来源:https://stackoverflow.com/questions/13056637/google-map-api-in-foundation-reveal-modal-not-displaying-properly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!