Note that there are some explanatory texts on larger screens.

plurals
  1. POGoogle maps multi maps on same page issue
    primarykey
    data
    text
    <p>I have the folowing problem with google map implementation. I have a list with restourants and with to show separate map for each restourant instead of showing all of them in 1 map. I create separate div:</p> <pre><code>&lt;div class="googleMap" id="googleMap&lt;?php echo $row[0];?&gt;" style="width:500px;height:380px;position:absolute;"&gt;&lt;/div&gt; </code></pre> <p>that gets its own id. Than i have :</p> <pre><code>&lt;a class="show_map" id="',$row[0],'" href="#" style="font-size:12px;color:red;margin-top:-3px;"&gt;restourants on the map&lt;/a&gt; </code></pre> <p>which shows / hide the div with id and the function for google map:</p> <pre><code>function initialize(){ var restaurant= &lt;?php echo json_encode($r[11]); ?&gt;; //alert(hotel); var mapProp = { center:myCenter, zoom:16, mapTypeId:google.maps.MapTypeId.ROADMAP }; var map=new google.maps.Map(document.getElementById("googleMap" + restaurant),mapProp); var marker=new google.maps.Marker({ position:myCenter, }); marker.setMap(map); var infowindow = new google.maps.InfoWindow({ content:"Hello World!" }); infowindow.open(map,marker); } google.maps.event.addDomListener(window, 'load', initialize); </code></pre> <p>after all I can see only same map for the first property and I suppose this is because the function is the same for all maps?? I am very new with js and I am stacked for 2 days now. Please help me with this how to have separate map for each restaurant?</p> <p>At least if you can give me some directions what could be the reason for not showing individual map for each property.. Thank you in advance</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. 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