在地图上绘制
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
您可以通过向地图添加对象来指定点、线、区域或对象的集合。Maps JavaScript API 中的 Photorealistic 3D Maps 将这些对象称为叠加层。叠加层与地理坐标绑定,因此当您拖动或缩放地图时,它们会随之移动。
叠加层类型
Maps JavaScript API 中的仿真 3D 地图支持多种不同类型的叠加层,您可以通过程序化方式添加这些叠加层:
- 弹出式窗格是一种特殊的叠加层,用于在地图上指定位置处显示内容(通常为文本或图像)。弹出式窗口类似于 Maps JavaScript API 中的信息窗口。
- 地图上的线条使用多段线来显示,多段线表示一系列以线段相连的有序点。
- 地图上任意形状的区域使用多边形来显示。与折线相同的是,多边形也是由一系列按顺序排列的地点构成。与多段线不同的是,多边形定义的是自身包围的区域。
- 模型是指以 3D 形状在地图上渲染的 glTF 资源。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-04-29。
[null,null,["最后更新时间 (UTC):2025-04-29。"],[],[],null,["\u003cbr /\u003e\n\n| This product or feature is in Preview (pre-GA). Pre-GA products and features might have limited support, and changes to pre-GA products and features might not be compatible with other pre-GA versions. Pre-GA Offerings are covered by the [Google\n| Maps Platform Service Specific Terms](https://cloud.google.com/maps-platform/terms/maps-service-terms). For more information, see the [launch stage\n| descriptions](/maps/launch-stages).\n\n\u003cbr /\u003e\n\nYou can add objects to the map to designate points, lines, areas, or collections\nof objects. The Photorealistic 3D Maps in Maps JavaScript API calls these objects overlays. Overlays are\ntied to geographic coordinates, so they move when you drag or zoom the\nmap.\n\nOverlay types\n\nThe Photorealistic 3D Maps in Maps JavaScript API supports several different types of overlays that you\ncan add programmatically:\n\n- A **[popover](/maps/documentation/javascript/3d/popovers)** is a special kind of overlay for displaying content (usually text or images) at a given location on a map. Popovers are analogous to [Info windows](/maps/documentation/javascript/infowindows) in the Maps JavaScript API.\n- Lines on the map are displayed using **[polylines](/maps/documentation/javascript/3d/shapes-lines#polylines)**, represented as an ordered sequence of points connected by line segments.\n- Areas of arbitrary shape on the map are displayed using **[polygons](/maps/documentation/javascript/3d/shapes-lines#polygons)**. Like polylines, polygons are an ordered sequence of locations. Unlike polylines, polygons define a region which they enclose.\n- **[Models](/maps/documentation/javascript/3d/models)** are gLTF resources that are rendered on the map as 3D shapes."]]