הוספת פוליגון למפה
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
בחירת פלטפורמה:
Android
iOS
אפשר להוסיף מצולע למפה תלת-ממדית.
בדוגמת הקוד הבאה אפשר לראות איך משתמשים במבנה Polygon
כדי להוסיף מצולע תלת-ממדי ולמקם אותו במרחב תלת-ממדי.
Swift
Map(mode: .hybrid) {
Polygon(
outerCoordinates: [
.init(latitude: 37.7749, longitude: -122.4194, altitude: 0),
.init(latitude: 37.7740, longitude: -122.4184, altitude: 0),
.init(latitude: 37.7750, longitude: -122.4174, altitude: 0),
]
)
}
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-08-31 (שעון UTC).
[null,null,["עדכון אחרון: 2025-08-31 (שעון UTC)."],[],[],null,["# Add a polygon to a map\n\nSelect platform: [Android](/maps/documentation/maps-3d/android-sdk/add-polygons \"View this page for the Android platform docs.\") [iOS](/maps/documentation/maps-3d/ios-sdk/add-polygons \"View this page for the iOS 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 add a polygon to a 3D map.\n\n\nThe following code sample demonstrates how use the [`Polygon`](/maps/documentation/maps-3d/ios-sdk/reference/Structs/Polygon) struct to add a 3D polygon and position it in 3D space. \n\n### Swift\n\n```\n Map(mode: .hybrid) {\n Polygon(\n outerCoordinates: [\n .init(latitude: 37.7749, longitude: -122.4194, altitude: 0),\n .init(latitude: 37.7740, longitude: -122.4184, altitude: 0),\n .init(latitude: 37.7750, longitude: -122.4174, altitude: 0),\n ]\n )\n }\n \n \n```"]]