21.2.6. 比例尺项目

比例尺提供地图项目上要素大小和要素之间距离的直观指示。比例尺项目需要地图项目。使用 比例尺 Add Scale Bar 刀具随动 items creation instructions 要添加新的比例尺项目,以后可以使用与中公开的相同方式进行操作 与布局项目交互

By default, a new scale bar item shows the scale of the map item over which it is drawn. If there is no map item below, the reference map is used. You can customize it in the Item Properties panel. Other than the items common properties, this feature has the following functionalities (see 图 21.33):

../../../../_images/scalebar_properties.png

图 21.33 比例尺项目属性面板

21.2.6.1. 主要属性

The Main properties group of the scale bar Item Properties panel provides the following functionalities (see 图 21.34):

../../../../_images/scalebar_mainproperties.png

图 21.34 比例尺主要属性组

  1. 首先,选择比例尺要附加到的地图

  2. 然后,选择比例尺的样式。可用的样式包括:

    • Single boxDouble box 样式,其中包含一行或两行交替的颜色框;

    • MiddleUpDown 线条勾号;

    • Stepped line 绘制比例尺的阶梯线表示形式的样式

    • Hollow 该样式为线段绘制具有交替颜色的单个框,并通过交替线段绘制水平线

    • Numeric ,其中打印比例(例如, 1:50000 )。

  3. 根据需要设置属性

21.2.6.2. 单位

The Units group of the scale bar Item Properties panel provides the functionalities to set the units of display and some text formatting (see 图 21.35):

../../../../_images/scalebar_units.png

图 21.35 比例尺单位组

  • 选择要使用的单位 Scalebar units 。有许多可能的选择: Map Units (默认设置), MetersFeetMilesNautical Miles ..。还有一些衍生品。单位转换是自动处理的。

  • 这个 Label unit multiplier 指定每个标记单位的比例尺单位数。例如,如果您的比例尺单位设置为“米”,乘数1000将导致比例尺标签为“公里”。

  • 这个 Label for units 字段定义用于描述比例尺单位的文本,例如 mkm 。这应该与之匹配,以反映上面的乘数。

  • 新闻发布会 Customize 紧邻 Number format 控制比例尺中数字的所有格式属性,包括千位分隔符、小数位数、科学记数法等(请参见 数字格式设置 以了解更多详细信息)。在为当前QGIS区域设置之外的受众制作地图时非常有用,或者当您想要改变区域设置默认设置的样式时(例如,当区域设置默认设置为隐藏它们时,添加数千个分隔符)。

21.2.6.3. 细分市场

The Segments group of the scale bar Item Properties panel provides the functionalities to configure the number and size of segments and subdivisions (see 图 21.36):

../../../../_images/scalebar_segments.png

图 21.36 “比例尺分段”组

  • 您可以定义 Segments 将分别绘制在 0 比例尺的:

    • 上的唯一线段的细分数 Left 侧面

    • 上的数据段数 Right 侧面

  • 您可以设置线段的宽度或比例尺总长度的范围:

    • 以比例尺单位设置线段的长度 (Fixed width )

    • 或将总比例尺大小限制为 mm 使用 Fit segment width 选择。在后一种情况下,每次地图比例更改时,都会调整比例尺的大小(并更新其标签)以适应上下限范围集。

  • Height 用于定义条形的高度。

  • Right segment subdivisions 用于定义比例尺右侧分段可以具有的节数(对于 Line Ticks DownLine Ticks MiddleLine Ticks Up 比例尺样式)。

  • Subdivision height 用于定义细分段的高度。

21.2.6.4. 显示

这个 Display 比例尺的组 Item Properties Panel提供以下功能:

../../../../_images/scalebar_display.png

图 21.37 比例尺显示组

您可以定义比例尺在其框架中的显示方式。

  • Box margin :文本和框架边框之间的间距

  • Label margin :文本和比例尺图形之间的空格

  • Vertical label placement :它可以在比例尺分段的上方或下方

  • Horizontal label placement :将在比例尺分段的边缘或中心居中

  • Primary fillSecondary fill 比例尺图形的 fill symbols properties (颜色、不透明度、图案、效果...)-用于 Single BoxDouble BoxHollow 风格

  • Line style 比例尺图形的 line symbols properties (颜色、笔触、连接、帽子样式、图案、效果...)-除 Numeric 格调

  • Division styleSubdivision style 中的分割和细分线段 Line Ticks UpLine Ticks MiddleLine Ticks Down 比例尺样式使用 line symbols properties (颜色、笔触、连接、帽子样式、图案、效果...)

  • Alignment 将文本放在框架的左侧、中间或右侧(仅适用于 Numeric 比例尺样式)

  • Font 要设置 properties (大小、字体、颜色、字母间距、阴影、背景...)比例尺标签的。

由于比例尺的大多数显示属性都依赖于其属性可以是数据定义的符号,因此可以呈现数据定义的比例尺。

Example :应用于刻度标签的粗体属性的以下代码将在数字是500的倍数时以粗体显示:

-- returns True (or 1) if the value displayed on the bar
-- is a multiple of 500

@scale_value % 500 = 0