Note that there are some explanatory texts on larger screens.

plurals
  1. POgooglemaps info window popup doesn't loading the dynamic content
    text
    copied!<p>please help me with this issue. I have the following code with working address variable. I tryed to add titles to the Infowindow so when a user clicks on a marker on the map to see some content in popup. Unfortunately, for all popups I can see the same title. I tested, it is a correct js array, but shows only the first titles that comes from the array.. Please help to solve this issue.. Thank you in advance guys !</p> <pre><code>&lt;script type="text/javascript" charset="utf-8"&gt; var map; var address = &lt; ? php echo json_encode($adr); ? &gt; ; var titles = &lt; ? php echo json_encode($ttl); ? &gt; ; var x = 0; var nbAddresses = address.length; var geocoder; var mark; var contentString = titles[x]; function init() { var moptions = { zoom: 10, mapTypeId: google.maps.MapTypeId.ROADMAP } map = new google.maps.Map(document.getElementById("map"), moptions); geocoder = new google.maps.Geocoder(); for (var i = 0; i &lt; nbAddresses; i++) { geocoder.geocode({ 'address': address[i] }, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { mark = new google.maps.Marker({ position: results[0].geometry.location, map: map, title: titles[x] }); map.setCenter(results[0].geometry.location); x++; setInfoWindow(); } }); } function setInfoWindow() { google.maps.event.addListener(mark, 'click', function(event) { var iwindow = new google.maps.InfoWindow(); iwindow.setContent(contentString); iwindow.open(map, this); }); } } window.onload = init; &lt;/script&gt; </code></pre>
 

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