How to remove box from new Google Maps embeds?

前端 未结 11 1855
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-29 02:26

Google appear to have changed how their iFrames work. There is now an infobox at the top left that tries to display the place name. The problem is that here in Ireland it\'s

11条回答
  •  自闭症患者
    2020-12-29 03:15

    mid 2017,, you can use built in Google api control flag disableDefaultUI

    use it like this:

    function initMap() {
      var map = new google.maps.Map(document.getElementById('map'), {
        zoom: 4,
        center: {lat: -33, lng: 151},
        disableDefaultUI: true
      });
    }
    

    ref: https://developers.google.com/maps/documentation/javascript/controls#DisablingDefaults

提交回复
热议问题