let map; var InfoObj = []; function initMap() { map = new google.maps.Map(document.getElementById("map"), { center: new google.maps.LatLng('34.0662024', '132.9977906'), zoom: 13, mapID: 'e39d49d5658d4a5c' }); var verifiedIcon = 'https://uploads-ssl.webflow.com/628f0ea507794c6d0edbf965/62d3aff1aa648f67d40cc6ea_school-v-32.png'; var unverifiedIcon = 'https://uploads-ssl.webflow.com/628f0ea507794c6d0edbf965/62d3aff1cb5c40658297daff_school-uv-32.png'; const features = [{placeName: 'Imabari International School', link: 'See Profile › ', position: new google.maps.LatLng('34.06145614448952', ' 132.9911741300533'), icon: unverifiedIcon, title: 'Imabari International School' },]; for (let i = 0; i < features.length; i++) { var contentString = '
' + '

' + features[i].placeName + '

' + '

' + features[i].link + '

' + '
'; const marker = new google.maps.Marker({ position: features[i].position, icon: features[i].icon, title: features[i].title, map: map, }); const infowindow = new google.maps.InfoWindow({ content: contentString }); marker.addListener('click', function () { closeOtherInfo(); infowindow.open(marker.get('map'), marker); InfoObj[0] = infowindow; }); } }; function closeOtherInfo() { if (InfoObj.length > 0) { InfoObj[0].set("marker", null); InfoObj[0].close(); InfoObj[0].lengh = 0; } }; window.initMap = initMap;