-1

sample image

Ignore the Hide|Show bar in the upper right hand corner. It was present in the image I screen grabbed for this example.

Google adds the following:

  • Google icon on the bottom left corner.
  • Text on the bottom right corner.
  • The little yellow man icon, + and - at the bottom of the right hand margin.
  • The zoom icon at the top right corner.

Is it possible to hide any or all of these programmatically?

4

1 回答 1

2

您实际上不应该隐藏或删除徽标 + 版权信息,但您可以使用disableDefaultUI: true.

例子:

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

更多信息可以在这里找到:https ://developers.google.com/maps/documentation/javascript/controls

于 2018-03-11T02:05:21.677 回答