蚂蚁线 map-fx-dash-flow
2026年7月20日大约 3 分钟
蚂蚁线 map-fx-dash-flow
GPU 特效:蚂蚁线(线)。
放在
map-2d的pieces里;enabled写在节点顶层。数据来源data-input:bind-fields(绑工程连接)或source(引用数据源)。
在线演示
预览使用内置公开演示服务 / 互联网底图,联网即可出图;可拖拽缩放。数据来自内联 GeoJSON 演示源。
示例把蚂蚁线换成金色警示带:底线金黄、飞头米白(
fx-line-color/fx-line-head-color),线宽加到 10px、行军速度提到 0.9(fx-line-width/fx-line-speed),虚线段放大到 0.12 更醒目(fx-line-dash),并反向流动(fx-line-reverse)——常用于选区边界或封控线。
属性
| 属性 | 名称 | 类型 | 默认 | 说明 |
|---|---|---|---|---|
enable-zoom | 限制缩放区间 | boolean | false | |
min-zoom | 最小级别 | number(min=0,max=24,step=0.1) | 0 | |
max-zoom | 最大级别 | number(min=0,max=24,step=0.1) | 24 | |
fx-line-color | 底线颜色 | color | #4db3ff | |
fx-line-opacity | 底线浓度 | slider(min=0,max=100,step=1,unit=%) | 30 | |
fx-line-head-color | 飞头颜色 | color | #f2ffff | |
fx-line-head-opacity | 飞头浓度 | slider(min=0,max=100,step=1,unit=%) | 100 | |
fx-line-width | 飞头宽 | number(min=1) | 7 | |
fx-line-width-units | 宽度单位 | select | pixels | 可选:pixels / map |
fx-line-width-base | 底线宽 | number(min=0,step=0.5) | 3 | |
fx-line-speed | 流速 | number(min=0,step=0.05) | 0.55 | |
fx-line-dash | 虚线段长 | number(min=0,max=1,step=0.01) | 0.06 | |
fx-line-show-base | 显示底线 | boolean | true | |
fx-line-reverse | 反向流动 | boolean | false | |
fx-line-bucket | 绘制层级 | select | above | 可选:above / below / topmost |
row-row-filter-mode-id | 选择数据规则 | select(condition) | — | |
data-input | 来源方式 | select(radioGroup) | bind-fields | 可选:bind-fields / source |
data-source-uid | 选择数据源 | map-source | [] | |
src-lng-field | 经度/X 字段 | string | — | |
src-lat-field | 纬度/Y 字段 | string | — | |
src-group-field | 分组(轨迹)字段 | string | — | |
src-order-field | 排序字段 | string | — | |
line-lng | 经度/横坐标 | field(recommend=number,min=1,max=1) | — | |
line-lat | 纬度/纵坐标 | field(recommend=number,min=1,max=1) | — | |
line-group | 分组(轨迹) | field(min=0,max=1) | — | |
line-order | 排序 | field(recommend=number,min=0,max=1) | — | |
line-points | 坐标点 | string | 0,0;10,5;20,-5;30,8 |
数据绑定(bind-fields 档)
| 字段槽 | 类型 / 约束 | 说明 |
|---|---|---|
line-lng | field(recommend=number,min=1,max=1) | 经度/横坐标 |
line-lat | field(recommend=number,min=1,max=1) | 纬度/纵坐标 |
line-group | field(min=0,max=1) | 分组(轨迹) |
line-order | field(recommend=number,min=0,max=1) | 排序 |
事件
| 触发器 | 名称 | 配在哪 | payload |
|---|---|---|---|
marker-click | 点击点要素 | map-2d 组件的 options.interactions(运行态按命中图层分流) | 命中要素属性行,公式 {:name} / {:value} 取值 |
region-click | 点击面要素 | 同上 | 同上 |
map-select / map-unselect | 选中 / 取消 | 同上 | 选中项数据 |
事件写在地图组件上而非图层上。图层还支持
feature-panel-uid(点击要素弹锚定窗口)与tooltip-enable(悬停浮层),见属性表。动作端可用mapLayerVisible/mapSetLayerStyle/mapRefreshData等 17 个地图动作,见 2D 地图 · 事件。
示例
{
"type": "map-fx-dash-flow",
"uid": "ly_x",
"enabled": true,
"options": {
"data-input": "source",
"data-source-uid": [{ "refType": "element", "targetPath": ["src_x"] }]
}
}