هنگامی که یک سبک نقشه را سفارشی می کنید، به درک اینکه چگونه استایل ویژگی های مختلف نقشه ممکن است بر سبک های دیگر روی نقشه تأثیر بگذارد کمک می کند. چندین لایه وجود دارد که همپوشانی دارند:
نقشه پایه : هنگامی که شروع به ایجاد یک سبک نقشه می کنید، اولیه ای که می بینید سبک نقشه پایه است. یعنی نقشه پیش فرض. هر ویژگی نقشه ای که سفارشی نمی کنید، سبک اصلی نقشه را حفظ می کند.
سبکهای نقشه : سبکهای سفارشی، سبکهای لایه نقشه پایه را لغو میکنند. در این تصویر، سبک نقشه سفارشی مناطق شهری را به صورت آبی و جاده ها را به رنگ آبی تیره غلبه می کند.
عناصر سبک : هر ویژگی نقشه دارای یک یا چند عنصر سبک است که می توانید آنها را سفارشی کنید. در این تصویر، ویژگی نقشه مناطق شهری رنگ پر چند ضلعی به صورت آبی و رنگ پر شدن شبکه جاده ها به رنگ آبی استایل داده شده است.
سلسله مراتب ویژگی نقشه
در یک سبک نقشه، ویژگی های نقشه به صورت سلسله مراتبی سازماندهی می شوند، با 4 ویژگی نقشه گسترده در بالا، و سایر ویژگی های نقشه در زیر آنها در یک سلسله مراتب منطقی مرتب شده اند. به طور پیشفرض، یک ویژگی نقشه، سبکهای عنصر را برای ویژگی نقشه بالای آن در سلسله مراتب (والد آن) به ارث میبرد. با این حال، میتوانید سبک سطح بالا را با تنظیم یک یا چند عنصر سبک برای ویژگیهای نقشه در زیر آن (ویژگیهای نقشه کودک) لغو کنید. برای جزئیات بیشتر در مورد سلسله مراتب ویژگی های نقشه، به چه چیزی می توانید در نقشه استایل دهید مراجعه کنید.
هر ویژگی نقشه دارای یک یا چند عنصر یا بخش هایی از ویژگی نقشه است که می توانید به آنها استایل دهید. به عنوان مثال، رنگ پر برای چند ضلعی (شکل ویژگی نقشه) یک عنصر است، همانطور که رنگ ضربه ای برای برچسب متن است. شما به هر عنصر به طور جداگانه استایل می دهید و هر عنصری که استایل نمی دهید، سبک پیش فرض را حفظ می کند. از آنجایی که عناصر جدا هستند، میتوانید رنگ پرشده را برای متن برچسب استایل دهید و رنگ خط (طرح کلی) را بهعنوان پیشفرض (یا به ارث بردن از سبک والد) بگذارید.
در اینجا چند دستورالعمل مفید برای درک نحوه عملکرد سلسله مراتب سبک و وراثت آورده شده است.
سبکهای فرزند پیشفرض از والدین به ارث میبرند : برای اینکه همه ویژگیهای نقشه فرزند یک سبک را به ارث ببرند، سبک را برای ویژگی نقشه والد تنظیم کنید و سبک فرزند را به عنوان پیشفرض بگذارید.
سبکهای فرزند سفارشی، والد را لغو میکنند : برای نادیده گرفتن سبک والد، یک سبک سفارشی را روی ویژگی فرزند تنظیم کنید.
عناصر سبک مستقل هستند : عناصر سبکی که می توانید برای یک ویژگی نقشه تنظیم کنید (به عنوان مثال، چند ضلعی، نماد برچسب، و پر کردن و خط متن برچسب) مستقل از یکدیگر هستند. اگر رنگ چند ضلعی را تنظیم کنید، اما نماد را به حال خود رها کنید، سبک چند ضلعی بر سبک والد لغو می شود، اما نماد سبک والد یا پیش فرض را به ارث می برد.
برای پنهان کردن ویژگیهای نقشه، Visibility را خاموش کنید : اگر میخواهید فقط یک چیز را روی نقشه خود ببینید، باید دید را برای هر چیز دیگری خاموش کنید.
مثال سلسله مراتب و وراثت
در اینجا مثالی از نحوه عملکرد وراثت و سلسله مراتب آورده شده است.
ویژگی نقشه سطح بالای Natural را انتخاب کنید و رنگ Polygon Fill را روی زرد قرار دهید. این سبک همه چند ضلعی ها را برای ویژگی های نقشه در زیر Natural به رنگ زرد در می آورد:
شما می خواهید لند کاور که زیر نچرال است نیز زرد باشد، بنابراین آن را بدون استایل رها می کنید و سبک را از Natural به ارث می برد.
شما می خواهید جنگل ها سبز باشند، بنابراین در زیر پوشش زمین ، Forest را باز می کنید و چند ضلعی آن را سبز رنگ می کنید. این سبک کودک سفارشی سبکهای Land cover و Natural را لغو میکند.
شما میخواهید یخ به صورت آبی کمرنگ نشان داده شود، بنابراین در زیر پوشش زمین ، یخ را باز کرده و چند ضلعی آن را رنگآمیزی رنگپریده کنید.
و در آخر، شما می خواهید آب آبی باشد، بنابراین Natural>Water را انتخاب کرده و چند ضلعی آن را aqua رنگ می کنید. تنظیم سبک کودک آب سبک والد را برای طبیعی نادیده می گیرد.
فرآیند مشابهی را دنبال کنید تا ویژگی های نقشه را برای نیازهای خود برجسته کنید.
تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی."],[],[],null,["# Understand map style inheritance and hierarchy\n\nSelect platform: [Android](/maps/documentation/android-sdk/cloud-customization/map-hier \"View this page for the Android platform docs.\") [iOS](/maps/documentation/ios-sdk/cloud-customization/map-hier \"View this page for the iOS platform docs.\") [JavaScript](/maps/documentation/javascript/cloud-customization/map-hier \"View this page for the JavaScript platform docs.\") [Web Service](/maps/documentation/maps-static/cloud-customization/map-hier \"View this page for the Web Service platform docs.\")\n\n\u003cbr /\u003e\n\nWhen you customize a map style, it helps to understand how styling different map\nfeatures may affect other styles on the map. There are several layers that\noverlap:\n\n- **The base map**: When you start creating a map style, the initial\n you see is the style of the base map; that is, the default map. Any map\n features you don't customize retain the base map styling.\n\n- **Map styles**: Custom styles override the styles on the base map layer.\n In this image, the custom map style overrides the urban areas as aqua\n and roads as dark blue.\n\n- **Style elements**: Each map feature has one or more style elements that\n you can customize. In this image, the urban areas map feature polygon\n fill color is styled as aqua, and the road network fill color\n is styled as blue.\n\nMap feature hierarchy\n---------------------\n\nWithin a map style, map features are organized hierarchically, with 4 broad\nmap features at the top, and all other map features arranged beneath them in\na logical hierarchy. By default, a map feature inherits the element styles\nfor the map feature above it in the hierarchy (its parent); however, you\ncan override the top level style by setting one or more of the style elements\nfor map features underneath it (child map features). For details on the map\nfeature hierarchy, see [What you can style on a map](/maps/documentation/ios-sdk/cloud-customization/taxonomy).\n\nEach map feature has one or more elements, or parts of the map feature, that\nyou can style. For example, the fill color for the polygon (the map feature\nshape) is an element, as is the stroke color for the text label. You style\neach element separately, and any element you don't style retains the default\nstyle. Since elements are separate, you can style the fill color for label\ntext, and leave the stroke (outline) color as the default (or inheriting\nfrom a parent style).\n\nHere are some helpful guidelines in understanding how style hierarchy and\ninheritance work.\n\n- **Default child styles inherit from the parent**: To have all\n child map features inherit a style, set the style for the parent map feature,\n and leave the child style as the default.\n\n- **Custom child styles override the parent**: To override the parent style,\n set a custom style on the child feature.\n\n- **Style elements are independent**: The style elements you can set for a\n map feature (for example, the polygon, the label icon, and the label text\n fill and stroke) are independent from each other. If you set the polygon\n color, but leave the icon alone, the polygon style overrides the parent\n style, but the icon inherits the parent or default style.\n\n- **Turn off Visibility to hide map features**: If you want to see only one\n thing on your map, you have to turn off visibility for everything else.\n\n | **Note:** When you hide map features or make them semi-transparent, you may expose boundary inaccuracies. Map feature boundaries are not always precise, but are adjusted to look correct when all layers are visible. For more details, see [Manage styles that overlap](/maps/documentation/ios-sdk/cloud-customization/overlap).\n\nHierarchy and Inheritance Example\n---------------------------------\n\nHere is an example of how inheritance and hierarchy works.\n\n1. Select the top-level map feature of **Natural** , and set the\n **Polygon Fill color** to yellow. This styles all polygons for map\n features under **Natural** to be yellow:\n\n2. You want **Land cover** , which is under **Natural** , to also be yellow,\n so you leave it unstyled, and it inherits the style from **Natural**.\n\n3. You want forests to be green, so under **Land cover** , you open **Forest** ,\n and color its polygon green. This custom child style overrides the\n styles for **Land cover** and **Natural**.\n\n4. You want ice to be shown a pale aqua, so also under **Land cover** , you\n open **Ice**, and color its polygon pale aqua.\n\n5. And last, you want water to be aqua, so you select **Natural\\\u003eWater** , and\n color its polygon aqua. Setting the child style **Water** overrides the parent\n style for **Natural**.\n\nFollow a similar process to highlight the map features for your needs."]]