จัดรูปแบบแผนที่ตามบริบท
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ

ตอนนี้คุณใช้บริบทเพื่อเปลี่ยนรูปแบบแผนที่ในแอปได้แล้ว สร้างรูปแบบแผนที่สว่าง มืด
และขาวดำเพื่อสลับรูปแบบใน
แอปโดยอัตโนมัติโดยไม่ต้องเปลี่ยนรหัสแผนที่ เมื่อสร้างรูปแบบแผนที่ คุณจะเลือกรูปแบบฐานได้หลายแบบ ได้แก่ สว่าง มืด สว่างขาวดำ หรือมืดขาวดำ
เลือกสไตล์พื้นฐานที่ใกล้เคียงกับสไตล์เป้าหมายมากที่สุด แล้วปรับแต่งให้
ตรงกับความต้องการ
เมื่อปรับแต่งรูปแบบแผนที่สว่างและมืดแล้ว คุณจะเชื่อมโยงทั้ง 2 รูปแบบกับ
รหัสแผนที่เดียวได้ เมื่อใช้รหัสแผนที่ในแอปพลิเคชัน สไตล์แผนที่จะเปลี่ยนโดยอัตโนมัติระหว่างสไตล์แผนที่เมื่อแผนที่เข้าสู่โหมดสว่างหรือมืด
หากต้องการเริ่มต้นใช้งานรูปแบบแผนที่สว่างและมืดด้วยรหัสแผนที่ ให้ไปที่
สร้างรูปแบบใหม่และ
เชื่อมโยงรูปแบบกับรหัสแผนที่
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-31 UTC
[null,null,["อัปเดตล่าสุด 2025-08-31 UTC"],[],[],null,["# Style maps based on context\n\nSelect platform: [Android](/maps/documentation/android-sdk/cloud-customization/contextual-styling \"View this page for the Android platform docs.\") [iOS](/maps/documentation/ios-sdk/cloud-customization/contextual-styling \"View this page for the iOS platform docs.\") [JavaScript](/maps/documentation/javascript/cloud-customization/contextual-styling \"View this page for the JavaScript platform docs.\") [Web Service](/maps/documentation/maps-static/cloud-customization/contextual-styling \"View this page for the Web Service platform docs.\")\n\n\u003cbr /\u003e\n\n| Dark styles are [Experimental](/maps/launch-stages#experimental).\n\nYou can now use context to change a map style in your app. Create light, dark,\nand monochrome map styles to automatically switch styles in\nyour apps without changing the map ID. When you create a map style, you can\nselect from several base styles: light, dark, monochrome light, or monochrome\ndark. Choose the base style closest to your target style and then customize for\nyour needs.\n\nWith a light and dark map style customized, you can then associate both with\none map ID. When you use the map ID in your applications, the map style\nautomatically switches between map styles when the map goes into light or dark\nmode.\n\nTo get started using light and dark map styles with map IDs, go to\n[Create a new style](/maps/documentation/ios-sdk/cloud-customization/map-styles#create-new-style) and\n[Associate your style to a map ID](/maps/documentation/ios-sdk/cloud-customization/map-styles#associate-style-with-map-id)."]]