Skip to content Skip to sidebar Skip to footer

Google Maps Two Maps On Same Page

well i'm using this code for my website now -> http://bootply.com/98836 but i need two of maps in same page so i duplicate it and just change 'div id' first map is

Change the IDs, and create a map on each div:

<div id="map-canvas-first"></div>
<span id="map-input-first"> address </span>


<div id="maps-canvas-second"></div>
<span id="maps-input-second"> address </span>


mapFirst = new google.maps.Map(document.getElementById('map-canvas-first'),mapOptions);
mapSecond = new google.maps.Map(document.getElementById('map-canvas-second'),mapOptions);

Solution 2:

please do not use an id twice. IDs are unique

Maybe this helps:

How to Display Multiple Google Maps per page with API V3


Post a Comment for "Google Maps Two Maps On Same Page"