Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery Mobile not loading Google Map (except on refresh)
    primarykey
    data
    text
    <p>I'm using Jquery Mobile 1.0 and Google Maps v3 to load a user location map. The map loads fine when accessed via direct url but when accessed from a link, it chokes up and nothing is displayed. If I refresh the page, the map loads fine.</p> <p>Here's a link to a test build that mimics the issue: <a href="http://stacefelder.com/stacefelder/Tests/index.html">http://stacefelder.com/stacefelder/Tests/index.html</a> click 'My Map' to see ... nothing. Hit refresh to see the map load.</p> <p>Here's the script in the map page header:</p> <pre><code>&lt;script type="text/javascript"&gt; $('#basic_map').live("pageshow", function() { if(navigator.geolocation) { navigator.geolocation.getCurrentPosition(function(position){ initialize(position.coords.latitude,position.coords.longitude); }); } }); function initialize(lat,lng) { var latlng = new google.maps.LatLng(lat, lng); var myOptions = { zoom: 8, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("map_canvas"),myOptions); } &lt;/script&gt; </code></pre> <p>And here's the html in the map page body:</p> <pre><code>&lt;div data-role="page" id="basic_map"&gt; &lt;div data-role="header"&gt; &lt;h1&gt;map test 901&lt;/h1&gt; &lt;/div&gt; &lt;div id="map_canvas"&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>I've also tried <code>pagecreate</code> instead of <code>pageshow</code> with no discernable difference. Any idea what I'm missing here? Thanks for any and all suggestions!</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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