मैप की कलर स्कीम
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
roadmap
और terrain
टाइप के मैप के लिए, google.maps.colorScheme
का इस्तेमाल करके मैप के रंग का मिला-जुला सेट (गहरे रंग वाला, हल्के रंग वाला या सिस्टम की मौजूदा सेटिंग) सेट किया जा सकता है. colorScheme
विकल्प को सिर्फ़ तब सेट किया जा सकता है, जब मैप को शुरू किया गया हो. मैप बनने के बाद इस विकल्प को सेट करने से कोई फ़र्क़ नहीं पड़ेगा.
रोडमैप
यहां दी गई इमेज में, roadmap
टाइप के लिए हल्के और गहरे रंग वाले मोड की कलर स्कीम दिखाई गई हैं.
इलाका
यहां दी गई इमेज में, terrain
टाइप के लिए हल्के और गहरे रंग वाले मोड की कलर स्कीम दिखाई गई हैं.
डिफ़ॉल्ट रूप से, मैप में लाइट मोड का इस्तेमाल किया जाता है. मैप बनाते समय, ColorScheme
इंपोर्ट करें. साथ ही, मैप के विकल्पों में जाकर मैप की कलर स्कीम (LIGHT
, DARK
या FOLLOW_SYSTEM
) तय करें. यहां दिखाया गया है कि ऐसा कैसे किया जाता है.
const {ColorScheme} = await google.maps.importLibrary("core")
const mapOptions = {
center: { lat: -34.397, lng: 150.644 },
zoom: 8,
colorScheme: ColorScheme.DARK,
}
map = new google.maps.Map(document.getElementById('map_canvas'), mapOptions);
मैप इंस्टैंशिएट होने के बाद विकल्पों को रीसेट करने पर, colorScheme
का कोई असर नहीं पड़ता.
रोडमैप मैप टाइप के लिए, लाइट स्टाइल और डार्क स्टाइल को अपनी पसंद के मुताबिक बनाने के लिए, क्लाउड पर मैप की स्टाइलिंग का इस्तेमाल करें.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-08-27 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-08-27 (UTC) को अपडेट किया गया."],[[["\u003cp\u003eRoadmap and terrain map types allow customization of color schemes (light, dark, or system default) using \u003ccode\u003egoogle.maps.colorScheme\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ecolorScheme\u003c/code\u003e option must be set during map initialization and cannot be changed afterward.\u003c/p\u003e\n"],["\u003cp\u003eBy default, maps use light mode; to change, import \u003ccode\u003eColorScheme\u003c/code\u003e and specify the desired scheme (LIGHT, DARK, or FOLLOW_SYSTEM) within map options.\u003c/p\u003e\n"],["\u003cp\u003eCustom styles using Map IDs are only compatible with the light color scheme for roadmap map types.\u003c/p\u003e\n"]]],[],null,["# Map color scheme\n\nFor maps of type `roadmap` and `terrain`, you can set the map color scheme\n(dark, light, or current system setting) by using `google.maps.colorScheme`. The\n`colorScheme` option can only be set when the map is initialized; setting this\noption after the map is created will have no effect. \n\n### Roadmap\n\nThe following image shows the light mode and dark mode color schemes for the\n`roadmap` type.\n\n### Terrain\n\nThe following image shows the light mode and dark mode color schemes for the\n`terrain` type.\n\nBy default, the map uses light mode. When creating the map, import `ColorScheme`\nand specify the map color scheme (`LIGHT`, `DARK`, or `FOLLOW_SYSTEM`) in\nmap options, as shown here. \n\n const {ColorScheme} = await google.maps.importLibrary(\"core\")\n\n const mapOptions = {\n center: { lat: -34.397, lng: 150.644 },\n zoom: 8,\n colorScheme: ColorScheme.DARK,\n }\n map = new google.maps.Map(document.getElementById('map_canvas'), mapOptions);\n\nIf you reset the options after the map is instantiated, `colorScheme` has no\neffect.\n\nTo create custom light styles and dark styles for your roadmap map types, use\n[cloud-based maps styling](/maps/documentation/javascript/cloud-customization)."]]