简体   繁体   English

谷歌地图 API JS 上的 3D 地球地球仪

[英]3D Earth globe on google maps API JS

Short question:简短的问题:

Is there a way to represent the 3D earth globe with google maps web API?有没有办法用谷歌地图 Web API 表示 3D 地球仪?


On google maps , we can now visualize the earth as a globe in 3D.谷歌地图上,我们现在可以将地球可视化为 3D 地球仪。

Here is an example:下面是一个例子:

咨询 https://www.google.fr/maps/@18.4980181,7.5767451,3z


I am developing an HTML project with google maps API and I would like to use this earth representation on my website.我正在使用谷歌地图 API 开发一个 HTML 项目,我想在我的网站上使用这个地球表示。

However, I do not find any topic about this subject.但是,我没有找到有关此主题的任何主题。

Is there a way to represent the 3D earth globe with google maps API as on the google maps web site 3D?有没有办法像谷歌地图网站3D 一样用谷歌地图 API 表示 3D 地球?


Here is an example of my map (it is of course an extract of my code to clarify the question):这是我的地图的一个例子(它当然是我用来澄清问题的代码的摘录):

 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>

Here is a picture of my map on my website:这是我网站上的地图图片:

在此处输入图片说明

This map only represents the earth as a planisphere.该地图仅将地球表示为一个平面。 How may I have the same result as on the google maps web site?我怎么可能得到与谷歌地图网站上相同的结果?


Notice : I found this post in twitter witch introduces the feature on the google maps web site.注意:我在 twitter 上找到了这篇文章,介绍了谷歌地图网站上的功能。

I believe this feature is not available in the API yet.我相信此功能在 API 中尚不可用。

I can see a feature request in Google issue tracker that looks like your question:我可以在 Google 问题跟踪器中看到一个与您的问题类似的功能请求:

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

I would suggest staring the feature request to add your vote and subscribe to further notifications.我建议您关注功能请求以添加您的投票并订阅进一步的通知。 Hopefully one day Google will implement this feature in the API.希望有一天 Google 会在 API 中实现这一功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM