【问题标题】:3D Earth globe on google maps API JS谷歌地图 API JS 上的 3D 地球地球仪
【发布时间】:2023-03-26 19:55:01
【问题描述】:

小问题:

有没有办法用 google maps web API 来表示 3D 地球?


google maps,我们现在可以将地球可视化为 3D 球体。

这是一个例子:


我正在使用谷歌地图 API 开发一个 HTML 项目,我想在我的网站上使用这个地球表示。

但是,我没有找到任何关于这个主题的话题。

有没有办法像google maps web site3D 那样使用谷歌地图 API 来表示 3D 地球?


这是我的地图示例(当然是我的代码摘录以澄清问题):

var map;
      function initMap() {
        map = new google.maps.Map(document.getElementById('map'), {
          center: {lat: -34.397, lng: 150.644},
          zoom: 8
        });
      }
      /* 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;
      }
    <meta name="viewport" content="initial-scale=1.0">
    <meta charset="utf-8">
    <div id="map"></div>

    <script src="https://maps.googleapis.com/maps/api/js?callback=initMap"
    async defer></script>

这是我网站上的地图图片:

此地图仅将地球表示为一个平面球。我怎样才能得到与谷歌地图网站上相同的结果?


通知: 我在推特上发现了这个post,女巫介绍了谷歌地图网站上的功能。

【问题讨论】:

  • 你可以试试CesiumJs
  • 好吧,我已经尝试过了,但它不适合我的网络应用 @JônatasCastro 。

标签: javascript google-maps google-maps-api-3


【解决方案1】:

我认为 API 中尚不提供此功能。

我可以在 Google 问题跟踪器中看到与您的问题类似的功能请求:

https://issuetracker.google.com/issues/111576221

我建议您关注功能请求以添加您的投票并订阅更多通知。希望有一天 Google 会在 API 中实现这一功能。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-11-16
    • 1970-01-01
    相关资源
    最近更新 更多