javascript - Google Maps Javascript - 放大时禁用 3d View

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

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

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

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

最佳答案

那是45-degree imagery在卫星 View 中。你可以设置 tilt: 0MapOptions 初始化 map 时避免 map 在非常近距离放大时使用该图像。这是一个 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>

关于javascript - Google Maps Javascript - 放大时禁用 3d View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50881777/

相关文章:

google-apps-script - Google表格,用于在一个单元格中设置多个超链接的脚本

google-apps-script - 有没有办法从电子表格中的给定网址生成面包屑?

javascript - Google Apps 脚本和 JavaScript 中的 base64 编码的不同结果

javascript - 在 javascript 中使用 cookie 存储和恢复滚动位置

javascript - 无法读取空帮助的属性 "style"。 [Javascript、HTML、CSS、JQuery]

javascript - 谷歌地图 v3 API 标记在关闭其 InfoWindow (InfoBubble) 时消失

php - 如何将这些坐标转换为谷歌地图可读坐标?

Android - 离线、非矢量、自定义 map

Javascript按顺序调用函数

javascript - node express,注销后如何清除cookie