let map; var InfoObj = []; function initMap() { map = new google.maps.Map(document.getElementById("map"), { center: new google.maps.LatLng('43.0617713', '141.3544506'), zoom: 12, 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: 'Hokkaido International School', link: 'See Profile › ', position: new google.maps.LatLng('43.01602924276661', ' 141.37213825601953'), icon: unverifiedIcon, title: 'Hokkaido 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;