Note that there are some explanatory texts on larger screens.

plurals
  1. POInfo windows code
    text
    copied!<p>I have a problem. I can't put each marker with info windows, neither the description </p> <p>example:</p> <pre><code>var marker = new google.maps.Marker({ position: myLatlng, map: map, title: 'Uluru (Ayers Rock)' </code></pre> <p><a href="https://developers.google.com/maps/documentation/javascript/examples/infowindow-simple" rel="nofollow">https://developers.google.com/maps/documentation/javascript/examples/infowindow-simple</a></p> <pre><code>var map function initialize() { var centerLatlng = new google.maps.LatLng(38.697476,-9.207047); var myOptions = { zoom: 12, center: centerLatlng, mapTypeId: google.maps.MapTypeId.ROADMAP } map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); var placescoordjs = {{=XML(response.json(placescoord))}} var marker, i; for (i = 0; i &lt; placescoordjs.length; i++) { marker = new google.maps.Marker({ position: new google.maps.LatLng(placescoordjs[i][0],placescoordjs[i][1]), map: map }); } } function mymarker() { var myLatlng = new google.maps.LatLng({{=coordenadas[0]}},{{=coordenadas[1]}}); var myOptions = { zoom: 10, center: myLatlng, mapTypeId: google.maps.MapTypeId.ROADMAP } var marker = new google.maps.Marker({ position: myLatlng, map: map, title:"My Marker!!" }); map.setCenter(myLatlng); marker.setMap(map); } var infowindow = new google.maps.InfoWindow({ content: "&lt;html&gt;https://pt.wikipedia.org/wiki/Lisboa&lt;/html&gt;" }); google.maps.event.addListener(marker, 'click', function() { infowindow.open(map,marker); }); </code></pre> <p>I have this code. I have a database that "puts" the markers in the map but how i can add each marker the description and a info windows?</p>
 

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