он работает для нормального представления, но не явно в пределах уличного обзора. src="https://i.sstatic.net/nSf19MnP.png" />
Jsfiddle:
https://jsfiddle.net/Maybach/3j75f2w9/7/
(its just cloned from their official documentation and i added the Объект параметров) < /p>
html: < /h3>
Код: Выделить всё
Disabling the Default UI
< /code>
javascript: < /h3>
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
function initMap() {
const map = new google.maps.Map(document.getElementById("map"), {
zoom: 4,
center: { lat: -33, lng: 151 },
disableDefaultUI: true,
});
}
window.initMap = initMap;
< /code>
css: < /h3>
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
/*
* Always set the map height explicitly to define the size of the div element
* that contains the map.
*/
#map {
height: 100%;
}
/*
* Optional: Makes the sample page fill the window.
*/
html,
body {
height: 100%;
margin: 0;
padding: 0;
}
#floating-panel {
position: absolute;
top: 10px;
left: 25%;
z-index: 5;
background-color: #fff;
padding: 5px;
border: 1px solid #999;
text-align: center;
font-family: "Roboto", "sans-serif";
line-height: 30px;
padding-left: 10px;
}
#floating-panel {
margin-left: -100px;
}
Я добавил объект параметров, чтобы удалить ZoomControls: false , работая в пределах нормального представления. будет скрыто, когда активирован StreetView.
Подробнее здесь: https://stackoverflow.com/questions/794 ... streetview