posted an update

var map; function control_businesses() { map = new google.maps.Map(document.getElementById('map'), { center: {lat: 43.1610, lng: -77.6109}, zoom: 13, mapTypeControl: false }); var styleControl = document.getElementById('style-control-selector'); map.controls[google.maps.ControlPosition.TOP_LEFT].push(styleControl); document.getElementById('hide-business').addEventListener('click', function() { map.setOptions({styles: styles['hide']}); }); document.getElementById('show-business').addEventListener('click', function() { map.setOptions({styles: styles['default']}); }); map.addListener('click', function(e) { placeMarkerAndPanTo(e.latLng, map); }); function placeMarkerAndPanTo(position, map) { var marker = new google.maps.Marker({ position: position, map: map }); var popup = document.getElementById("myPopup"); popup.classList.toggle("show"); map.panTo(position); } } function MyFunction() { var person = prompt("Please add a comment"); document.getElementById("demo").innerHTML = person } var styles = { default: null, hide: [ { featureType: 'poi.business', stylers: [{visibility: 'off'}] }, ] };

Log in or sign up for Devpost to join the conversation.