Note that there are some explanatory texts on larger screens.

plurals
  1. POGoogle maps API: JSON to jQuery
    primarykey
    data
    text
    <p>I'm having trouble getting my markers to show up using Google Maps API V3.</p> <p>This is my JavaScript:</p> <pre><code>function getMap(zoom, center) { var myOptions = { zoom: zoom, center: center, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("map"), myOptions); var marker = new google.maps.Marker({ position: centerBegin }) $.getJSON('json/markers.json', function (data) { $.each(data, function (i, marker) { var markerOptions = { map: map, position: new google.maps.LatLng(marker.latitude, marker.longtitude) , title: 'test'}; var marker = new google.maps.Marker(markerOptions); /*var marker = new google.maps.Marker({ position: new google.maps.LatLng(marker.latitude, marker.longtitude), content: i.toString(), map: map, title: 'test' });*/ }); }); </code></pre> <p>}</p> <p>Here is my JSON file:</p> <pre><code>{"markers": [ {"text":"Ondertekenen koopverkoopcontract", "latitude":-12.917239, "longtitude":-38.48209}, {"text":"Openen documentair krediet", "latitude":51.218584, "longtitude":4.40413}, {"text":"Transport van producent naar haven Salvador", "latitude":51.22952, "longtitude":4.411617}, {"text":"Vertrek naar haven Antwerpen", "latitude":-12.968114, "longtitude":-38.511543}, {"text":"Aankomst haven Antwerpen + vertrek naar Transibel", "latitude":51.22952, "longtitude":4.411617}, {"text":"Aankomst Transibel", "latitude":51.094863, "longtitude":4.12973}, {"text" : "center point", "latitude":28.767659, "longtitude":-31.640625} ]} </code></pre> <p>I cannot see any markers on my map. Can someone help me with this?</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.
 

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