tds-map-methods 0.1.14 → 0.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -220,6 +220,11 @@ loadLayer(map, {
220
220
  | <code>showFillcolor</code> | <code>boolean</code> | MICAPS 是否填色 |
221
221
  | <code>showIsoline</code> | <code>boolean</code> | MICAPS 是否显示等值线 |
222
222
  | <code>showPointMarkers</code> | <code>boolean</code> | MICAPS 是否显示符号点 |
223
+ | <code>showFrostLine</code> | <code>boolean</code> | MICAPS 是否显示霜冻线,默认 <code>true</code> |
224
+ | <code>frostLineColor</code> | <code>string</code> | MICAPS 霜冻线颜色,默认 <code>#ff0000</code> |
225
+ | <code>frostLineWidth</code> | <code>number</code> | MICAPS 霜冻线线条粗细;未配置时优先使用文件线宽,默认 <code>3</code> |
226
+ | <code>frostLineTickSpacing</code> | <code>number</code> | MICAPS 霜冻线锯齿间隔,默认 <code>22px</code> |
227
+ | <code>frostLineTickLength</code> | <code>number</code> | MICAPS 霜冻线锯齿大小,默认 <code>16px</code> |
223
228
  | <code>smooth</code> | <code>boolean</code> | 是否平滑掩膜边缘 |
224
229
  | <code>smoothIterations</code> | <code>number</code> | Chaikin 平滑迭代次数,建议 1 到 3 |
225
230
  | <code>valueTransform</code> | 函数或字符串 | 绘制和查询前转换栅格值;返回空值表示无效像素 |
@@ -571,6 +576,11 @@ await createMicContour(map, {
571
576
  showFillcolor: true,
572
577
  showIsoline: true,
573
578
  showPointMarkers: true,
579
+ showFrostLine: true,
580
+ frostLineColor: "#168aad",
581
+ frostLineWidth: 3,
582
+ frostLineTickSpacing: 22,
583
+ frostLineTickLength: 16,
574
584
  });
575
585
 
576
586
  removeMicContour(map, "micaps-weather");
@@ -584,9 +594,13 @@ removeMicContour(map, "micaps-weather");
584
594
  import { MIC_FREEZING_RAIN_DEFAULTS } from "tds-map-methods";
585
595
  ~~~
586
596
 
587
- 霜冻线同样无需额外配置:自动读取 `LINES_SYMBOL` 中编码为 `38` 的线段,
588
- 按照 MIC 原始坐标点依次连接为红色折线,并沿原始点序的一侧等距绘制短垂线。
589
- 主线使用文件线宽,默认线宽为 `3`;默认短线间距为 `22px`、长度为 `16px`。
597
+ 霜冻线会自动读取 `LINES_SYMBOL` 中编码为 `38` 的线段,按照 MIC 原始坐标点依次连接,
598
+ 并沿原始点序的一侧等距绘制短垂线。通过 `showFrostLine` 可控制霜冻线显隐,默认显示;
599
+ 主线和短垂线的颜色可通过 `frostLineColor` 配置,`frostLineWidth` 控制线条粗细,
600
+ `frostLineTickSpacing` 控制锯齿间隔,`frostLineTickLength` 控制锯齿大小。
601
+ 直接调用 `createMicContour` 时可传入这些参数,通过 `loadLayer` 创建时也可在图层的
602
+ `config` 中设置。颜色未配置时使用红色 `#ff0000`;线宽未配置时优先使用文件线宽,
603
+ 文件线宽无效时默认为 `3`;默认锯齿间隔为 `22px`、大小为 `16px`。
590
604
  霜冻线为独立图层,不参与降水区域切割,不受 `showIsoline`、`showFillcolor`
591
605
  或 `showPointMarkers` 控制;通过 `loadLayer` 创建时会随数据集一起显隐、更新和删除。
592
606
  可导入 `MIC_FROST_LINE_DEFAULTS` 查看内置颜色、默认线宽及短线尺寸。