 <p>The main issue is that the <code>map</code> variable is declared only in the scope of the anonymous callback on slideToggle. First of all declare at the top-level function scope.</p> <pre><code>function handle_geolocation_query(position){ var map, mapOptions = { zoom: 14, center: new google.maps.LatLng(position.coords.latitude, position.coords.longitude), mapTypeId: google.maps.MapTypeId.SATELLITE } ... </code></pre> <p>Then change the slideToggle callback to initialise the variable instead of redeclaring:</p> <pre><code>$('#map-canvas').slideToggle('slow', function(){ map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions); }); </code></pre> <p>Then you should pass <code>map</code> as a second parameter to your <code>InitializeGoogleMaps</code> function and call it using <code>InitializeGoogleMaps(results, map)</code>. See where this gets you and hit me back with any questions.</p>