let map; var InfoObj = []; function initMap() { map = new google.maps.Map(document.getElementById("map"), { center: new google.maps.LatLng('26.464742205729884', '127.90118405571964'), 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: 'Alphabet International Preschool', link: 'See Profile › ', position: new google.maps.LatLng('26.449942897650907', ' 127.90444102751744'), icon: unverifiedIcon, title: 'Alphabet International Preschool' },]; 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;