Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to Display Multiple Google Maps per page with API V3
    primarykey
    data
    text
    <p>I have the following script. And I want to make both maps appear on the page, but no matter what I try I can only get the first map initialize() to display... the second one doesn't. Any suggestions? (also, I can't add it in the code, but the first map is being displayed in <code>&lt;div id="map_canvas"&gt;&lt;/div&gt;&lt;div id="route"&gt;&lt;/div&gt;</code> Thanks!</p> <pre><code>&lt;script type="text/javascript"&gt; // Create a directions object and register a map and DIV to hold the // resulting computed directions var map; var directionsPanel; var directions; function initialize() { map = new GMap(document.getElementById("map_canvas")); map.setCenter(new GLatLng(41.1255275,-73.6964801), 15); directionsPanel = document.getElementById("route"); directions = new GDirections(map, directionsPanel); directions.load("from: Armonk Fire Department, Armonk NY to: &lt;?php echo $LastCallGoogleAddress;?&gt; "); map.addControl(new GSmallMapControl()); map.addControl(new GMapTypeControl()); } &lt;/script&gt; &lt;div id="map_canvas2" style="width:200px; height:200px;"&gt;&lt;/div&gt; &lt;div id="route2"&gt;&lt;/div&gt; &lt;script type="text/javascript"&gt; // Create a directions object and register a map and DIV to hold the // resulting computed directions var map2; var directionsPanel2; var directions2; function initialize2() { map2 = new GMap(document.getElementById("map_canvas2")); map2.setCenter(new GLatLng(41.1255275,-73.6964801), 15); directionsPanel2 = document.getElementById("route2"); directions2 = new GDirections(map2, directionsPanel2); directions2.load("from: ADDRESS1 to: ADDRESS2 "); map2.addControl(new GSmallMapControl()); map2.addControl(new GMapTypeControl()); } &lt;/script&gt; &lt;script type="text/javascript"&gt; function loadmaps(){ initialize(); initialize2(); } &lt;/script&gt; </code></pre>
    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.
 

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