Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First, based on the source linked to, the script which calls the map upon button click is doing nothing but throwing an error because you have it in the page before jQuery is loaded. You can see it in the error console. You need to move that to the bottom of the page after the rest of the scripts.</p> <p>Your reveal is "working" because you are using the <code>data-reveal-id</code> attribute on the menu item and the reveal script wires it up automatically.</p> <p>You are creating the map onload which is bad practice. Don't create it until/unless it is needed.</p> <p>So to fix your issue, this is what I did. Remove the <code>data-reveal-id</code> from the menu item and replace it with an ID, or you can just use some other selector to access it. I changed it to <code>id="myModal1"</code> since that is what you had in your event code already.</p> <p>Move your script which calls the map upon button click to the bottom, and change it to look like this:</p> <pre><code>$(document).ready(function() { var map; $('#myModal1').click(function() { if(!map){ var mapOptions = { center: new google.maps.LatLng(39.739318, -89.266507), zoom: 5, mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions); } $('#myModal').reveal(); }); </code></pre> <p>});</p> <p>This will create the map only when the user clicks the link to show it and only creates it once. That should fix it for you. If you have to, you can pass an opened callback to the <code>reveal()</code> call and trigger resize there but in my limited testing it was not necessary.</p> <p>You can also get rid of the entire initialize function.</p> <p>Now go get a band-aid and put some ice on that head.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload