通知:Google Maps Platform 即将推出全新基本地图样式。此次地图样式更新包括全新默认调色板、经过现代化改进的图钉,以及地图体验和易用性方面的改进。所有地图样式将于 2025 年 3 月自动更新。如需详细了解适用范围以及如何提前选择启用,请参阅
全新 Google Maps Platform 地图样式。
3D模型

您可以使用 Maps JavaScript API 中的仿真 3D 地图,将 GLTF 3D 模型直接渲染到 3D 地图中。这些逼真的 3D 对象可以表示建筑物、地标或其他自定义对象,并可以增强地图的视觉吸引力和功能。
模型应支持 glTF PBR 的核心属性。
不支持任何扩展程序或扩展程序属性。
将模型添加到地图
如需向地图添加模型,请使用 gmp-model-3d
元素,如下所示。默认情况下,如果省略 altitude-mode
属性,模型会被限制在地面上。
<gmp-model-3d position="lat,lng,altitude" altitude-mode="string" orientation="heading,tilt,roll" scale="x,y,z|number" src="string"></gmp-model-3d>
后续步骤
- 如需了解如何将您自己的 3D 模型添加到地图,请参阅 3D 模型示例。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-12-22。
[null,null,["最后更新时间 (UTC):2024-12-22。"],[[["Photorealistic 3D Maps in Maps JavaScript API allows rendering GLTF 3D models directly into 3D maps to represent buildings, landmarks, or other custom objects."],["The 3D models should support core properties of the glTF PBR, without any extensions or extension properties."],["You can add a model to the map using the `\u003cgmp-model-3d\u003e` element by specifying its position, altitude mode, orientation, scale, and source URL."],["This product or feature is currently experimental and might have limited support."]]],[]]