function initMap(){ var latlng = []; var marker = []; var infoWindow = []; var geocoder = new google.maps.Geocoder(); var townmap = new google.maps.Map(document.getElementById('bihoro_town_map'), { center: {lat: $let, lng: $lng}, zoom: $zoom, }); setMakerInfo(aftergeo); function setMakerInfo(callback){ var cRef = markerData.length; for (var i = 0; i < markerData.length; i++) { (function (i) { geocoder.geocode({'address': markerData[i]['address']}, function(results, status) { if (status === google.maps.GeocoderStatus.OK) { marker[i] = new google.maps.Marker({ position: results[0].geometry.location, map: townmap, }); infoWindow[i] = new google.maps.InfoWindow({ content: '