向地图添加标记
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
您可以使用标记来吸引用户注意地图上的某个位置。
以下代码示例展示了如何使用 Marker
结构向 3D 地图添加基本标记。
Swift
Marker(
position: .init(
latitude: 37.8044862,
longitude: -122.4301493
)
)
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-31。
[null,null,["最后更新时间 (UTC):2025-08-31。"],[],[],null,["# Add a marker to a map\n\nSelect platform: [Android](/maps/documentation/maps-3d/android-sdk/add-a-marker \"View this page for the Android platform docs.\") [iOS](/maps/documentation/maps-3d/ios-sdk/add-a-marker \"View this page for the iOS platform docs.\") [JavaScript](/maps/documentation/javascript/3d/marker-add \"View this page for the JavaScript platform docs.\")\n\n\u003cbr /\u003e\n\n| This product or feature is Experimental (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 descriptions](/maps/launch-stages).\n\n\nYou can use markers to draw a user's attention to a location on a map.\n\nThe following code sample demonstrates how to use the [`Marker`](/maps/documentation/maps-3d/ios-sdk/reference/Structs/Marker) struct to add a basic marker to a 3D map. \n\n### Swift\n\n```\n Marker(\n position: .init(\n latitude: 37.8044862,\n longitude: -122.4301493\n )\n )\n \n```\n| **Tip:** For more information on working with markers, see:\n|\n| - [Configure marker altitude](/maps/documentation/maps-3d/ios-sdk/configure-marker-altitude)\n| - [Configure marker collision behavior](/maps/documentation/maps-3d/ios-sdk/configure-marker-collision-behavior)"]]