diff --git a/reference/styles/sections/components.md b/reference/styles/sections/components.md index 71187c9..c845c38 100644 --- a/reference/styles/sections/components.md +++ b/reference/styles/sections/components.md @@ -1,6 +1,6 @@ --- -title: Components -description: In the Components tab, you can toggle the visibility of components, edit component properties, eject a component into layers, and define colors and typography groups. +标题: 组件库 +描述: 在组件选项卡中,你可以切换组件的可见性,编辑组件的属性,从组件弹出图层以及定义颜色和字体排版。 prependJs: - "import AppropriateImage from '../../../../components/appropriate-image';" - "import Browser from '@mapbox/dr-ui/browser';" @@ -14,15 +14,15 @@ prependJs: - "import ColorsTab from '../../../../video/reference-styles-components-colors-tab.mp4';" - "import ColorPalette from '../../../../video/reference-styles-components-color-palette.mp4';" - "import TypographyTab from '../../../../video/reference-styles-components-typography-tab.mp4';" -contentType: reference -tag: beta +contentType: 参考 +标签: 测试版 --- -## Components +## 组件库 {{ }} -In the **Components** tab, you can toggle the visibility of components, edit component properties, eject a component into layers, and define colors and typography groups. +在**组件库**选项卡中,你可以切换组件的可见性,编辑组件的属性,从组件弹出图层以及定义颜色和字体排版。 {{ @@ -33,13 +33,13 @@ In the **Components** tab, you can toggle the visibility of components, edit com }} -### Components list +### 组件库列表 -All components in the current style are listed at the top of the Components tab. While there are over a dozen components used throughout Mapbox template styles, the exact list of components will depend on the template style you are editing. +当前样式的所有组件都列在组件库选项卡的顶部。虽然在整个Mapbox模板样式中使用了十几个组件,但是准确的组件列表将取决于你正在编辑的模板样式。 -#### Hide and show components +#### 隐藏和显示组件 -To hide the map features in a component, hover over the component name in the list. A {{ }} will appear. Click the icon to hide the component. To show a hidden component, click the {{ }}. +要隐藏一个组件中的地图要素,请将鼠标悬停在列表中的组件名称上。一个 {{ }} 将会出现。单击这个图标来隐藏组件。要显示隐藏的组件,请单击 {{ }}。 {{ @@ -50,12 +50,11 @@ To hide the map features in a component, hover over the component name in the li }} -#### Edit component properties +#### 编辑组建属性 -To edit the style of map features in a component, click on the name of the component in the list. A panel listing the available component properties will open. - -There are a few component properties for each component, and the properties available vary between components. A single component property can control multiple layer properties across several layers. Values for component properties are often defined using a toggle (on or off), a dropdown menu with a few options, or a slider with several options along a scale. +要编辑组件中的地图要素的样式,请单击列表中组件的名称。将打开一个可用组件属性列表的弹窗。 +每个组件都有一些组件属性,并且各个组件之间可用的属性有所不同。 单个组件属性可以控制不同图层的多个图层属性。通常使用切换(打开或关闭)、带有几个选项的下拉菜单、或带有刻度的带有多个选项的滑块定义组件属性的值。 {{ }} -{{}} -Unlike layer properties, component properties are not directly related to the [Mapbox Style Specification](https://docs.mapbox.com/mapbox-gl-js/style-spec/) and cannot be edited outside Mapbox Studio (at runtime). +{{}} +与图层属性不同,组件属性与[Mapbox样式规范](https://docs.mapbox.com/mapbox-gl-js/style-spec/)不直接相关,并且不能在Mapbox Studio外部进行编辑(在运行时) {{}} -#### More options +#### 更多选择 -Toggle from **Edit** to **More options** in the component properties panel to **Eject component** and **View layers**. +从组件属性面板中的 **编辑** 切换到 **更多选项** ,**弹出组件** 和 **查看图层**。 -Click **Eject component** to split the component into layers. When you eject a component, you are no longer able to edit the layers within that component as a single unit. After ejecting a component, the layers will continue to use the layer properties inherited from the initial component properties until they are manually edited. Going forward all layers _must_ be styled using layer properties directly. +单击 **弹出组件** 将组件拆分为多个图层。弹出组件时,您将无法再以一个单元的形式编辑该组件中的图层。弹出组件后,图层将继续使用从初始组件属性继承的图层属性,直到对其进行手动编辑。之后,必须直接使用图层属性设置所有图层的样式。 -**Once a component is ejected, it can't be reversed.** +**组件一旦弹出为图层,图层将无法重新组成组件.** {{ @@ -86,8 +85,7 @@ Click **Eject component** to split the component into layers. When you eject a c
}} -Click **View layers** to see all layers within the selected component. Clicking **View layers** will switch your current view from the **Components** tab to the **Layers** tab and select all the layers in the layer list. - +单击**查看图层**来查看所选组件中的所有图层。单击**查看图层**会将当前视图从**组件库**选项卡切换到**图层**选项卡,然后在图层列表中选择所有图层。 {{