【问题标题】:Streetview look around but not move around街景环顾四周,但不四处走动
【发布时间】:2018-02-18 11:57:29
【问题描述】:

我已经嵌入了一个街景地图,我只想执行环顾四周的动作(通过单击并使用鼠标或指南针拖动)而不是移动到某个方向。

我尝试将指针事件应用于 none,但这会停止所有指针操作。

这是我的代码的链接: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>

【问题讨论】:

    标签: iframe google-street-view pointer-events


    【解决方案1】:

    尝试将StreetViewPanoramaOptions 设置为False 和/或LinksControl。在 Gmaps streetview API 参考中,他们还提到了streetViewControl。尝试一下。它在他们的参考页面上有很好的记录。

    【讨论】:

    • 谢谢!我不太确定如何将 StreetViewPanoramaOptions 和 LinksControl 与 Iframe 嵌入方法一起使用。我之前通过查找地点的位置(纬度和经度)使用了这种方法,但它似乎不起作用。这是我之前的方法:jsfiddle.net/Dimgk1984/zes7abua/13
    猜你喜欢
    • 1970-01-01
    • 2023-03-12
    • 1970-01-01
    • 2011-01-25
    • 1970-01-01
    • 1970-01-01
    • 2015-07-09
    • 1970-01-01
    • 2023-03-13
    相关资源
    最近更新 更多