【问题标题】:Google Maps Javascript - Disable 3d view when zoomed inGoogle Maps Javascript - 放大时禁用 3d 视图
【发布时间】:2018-06-15 19:41:35
【问题描述】:

有没有办法在放大时禁止谷歌地图进入 3d 模式?

我想保持这样,只是放大: here

但是当我当前放大时,它会 3d 渲染建筑物: here

【问题讨论】:

    标签: javascript google-maps google-apps-script google-api google-apps


    【解决方案1】:

    这是卫星视图中的45-degree imagery。您可以在初始化地图时在MapOptions 中设置tilt: 0,以避免地图在非常靠近时使用该图像。这是simple sample JSBin

    <!DOCTYPE html>
    <html>
      <head>
        <title>Simple Map</title>
        <meta name="viewport" content="initial-scale=1.0">
        <meta charset="utf-8">
        <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 id="map"></div>
        <script>
          var map;
          function initMap() {
            map = new google.maps.Map(document.getElementById('map'), {
              center: new google.maps.LatLng(37.422009,-122.084302),
              tilt: 0,
              mapTypeId: "satellite",
              zoom: 19
            });
          }
        </script>
        <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_KEY&callback=initMap"
        async defer></script>
      </body>
    </html>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-05-10
      • 2022-09-26
      • 1970-01-01
      • 2014-01-12
      • 2013-01-08
      相关资源
      最近更新 更多