let map; var InfoObj = []; function initMap() { map = new google.maps.Map(document.getElementById("map"), { center: new google.maps.LatLng('35.0178371', '135.8552084'), 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: 'Friends International Preschools', link: 'See Profile › ', position: new google.maps.LatLng('34.98294487670048', ' 135.9247881544326'), icon: unverifiedIcon, title: 'Friends International Preschools' },]; 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;