I have successfully coded the section where I retrieve JSON markers and loop through them. However, despite this, the markers do not seem to be appearing on the map. Could someone please assist me in identifying the mistake?
$.ajax({
url: "get_markers.php",
type: 'POST',
dataType: 'json',
data: {'address':address},
success: function (html, status, response) {
$.each(html, function(i, place) {
alert(JSON.stringify(place.lat)+","+JSON.stringify(place.lng));
latLng = new google.maps.LatLng(JSON.stringify(place.lat), JSON.stringify(place.lng));
marker = new google.maps.Marker({
position: latLng,
map: map
//title: data.title
});
});
}
I have ensured that the variables map, latLng, and marker are defined correctly. Additionally, I am receiving the correct latitude and longitude values when using an alert(..).
Thank you!