طرح رنگ نقشه
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
برای نقشههایی از نوع 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 و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-08-27 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-27 بهوقت ساعت هماهنگ جهانی."],[[["\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)."]]