Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here is the working code,</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;Log In Page&lt;/title&gt; &lt;script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false&amp;libraries=places"&gt;&lt;/script&gt; &lt;script&gt; var myCenter=new google.maps.LatLng(51.508742,-0.120850); function initialize() { var mapProp = { center:myCenter, zoom:5, mapTypeId:google.maps.MapTypeId.ROADMAP }; var map=new google.maps.Map(document.getElementById("googleMap"),mapProp); var arr = [{id:1,latitude_chargement:45.7604,longitude_chargement:5.68552,title:"THIS IS FRANCE"},{id:2,latitude_chargement:60.05,longitude_chargement:-43.1667,title:"THIS IS GREENLAND"},{id:3,latitude_chargement:48.853873,longitude_chargement:2.351074,title:"THIS IS PARIS"}]; var contentString; var infowindow = new google.maps.InfoWindow(); for(i = 0; i &lt; arr.length; i++) { contentString = '&lt;div id="content"&gt;'+arr[i].title+'&lt;/div&gt;'; var marker = new google.maps.Marker({ position: new google.maps.LatLng(arr[i].latitude_chargement, arr[i].longitude_chargement), map : map, title: arr[i].title, icon: 'https://maps.google.com/mapfiles/ms/icons/blue-dot.png', content:contentString }); google.maps.event.addListener(marker, 'click', function() { infowindow.open(map, this); infowindow.setContent(this.content); }); marker.setMap(map); } } google.maps.event.addDomListener(window, 'load', initialize); &lt;/script&gt; &lt;style&gt; #googleMap { width:600px; height:600px; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="googleMap"&gt;&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Also your France and Greenland coordinates were swapped</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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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