let map; var InfoObj = []; function initMap() { map = new google.maps.Map(document.getElementById("map"), { center: new google.maps.LatLng('35.011564', '135.7681489'), 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: 'Kyoto International School', link: 'See Profile › ', position: new google.maps.LatLng('35.02433015014026', ' 135.7510201480776'), icon: verifiedIcon, title: 'Kyoto 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;