我已经嵌入了一个街景地图,我只想执行要环顾四周的动作(通过鼠标或指南针单击并拖动),但不要移动到某个方向。
我尝试将指针事件应用于无,但停止所有指针操作。
以下是我的代码的链接:https://jsfiddle.net/Dimgk1984/8tnxo3as
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Street View controls</title>
<style>
/* 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;
}
</style>
</head>
<body>
<div class="map-container">
<iframe src="https://www.google.com/maps/embed?pb=!4v1518736193836!6m8!1m7!1szChzPIAn4RIAAAQvxgbyEg!2m2!1d29.56028532748453!2d-95.08539144618427!3f213.12!4f0.18000000000000682!5f0.7820865974627469" style="margin-top:-100px" width="100%" height="1000" frameborder="0"allowfullscreen >
</iframe>
<style>
.map-container {
pointer-events: none;}
</style>
</body>
</html>
答案 0 :(得分:0)
尝试将StreetViewPanoramaOptions
设置为False
和/或LinksControl
。在Gmaps streetview API参考中,他们还提到了streetViewControl
。试试吧。它的参考页面上有很好的文档记录。