ly-front/README.md

82 lines
3.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## 图层切换树组件配置文件说明
```
treeConfig.json: 主页及其二级页面图层切换树结构,具体可以看现有示例。
{
homePage: [ //homePage、positionEquipment、airspace... :主页及其二级页面名称
{
"name": "全部" //名称:全部、阵地设备、... (必须)
"show": false //初始化显隐状态 (必须)
"icon": "qb.png" //图标,位置在views/mapControl/map/map.js (必须)
"type": "all" //带表该节点为全部,勾选时会将其他所有节点选中状态 (非必须)
"apiParam": "1" //存在apiParam节点则认为该节点的所有子节点是通过请求接口数据请求参数为1 (非必须)
"children": [] //二级节点,该节点不需要通过请求时,可配置静态节点,如二三维度,行政区划图层等(非必须)
"legendOptions": { //图例配置,当该节点及其子节点中展示状态时,展示图例内容(非必须)
"legendData": [//图例数据
{
"name": "适飞空域", //图例名称
"color": "rgba(126, 192, 80, 1)" //图例颜色,颜色或图标二选一
"icon": "qb.png" //图例图标,颜色或图标二选一
}
]
}
}
]
}
mapLayer.json: 请求回来的节点数据,配置图层样式及气泡等内容
{
"1": [ //图层接口请求参数对应的图层样式
"name": "反制设备", //要与接口请求回来的节点名称一直
"show": true, //现有状态
"children": [ //子节点
{
"name": "全向干扰", //子节点名称,要与接口返回对应
"show": true, //显隐状态
"popup": { //气泡配置
"templateName": "positionTemplate", //要使用的气泡模板
"width": 310, //气泡宽度
"height": 170 //气泡高度
},
"render": { //图层专题展示
"type": "simple", //简单专题symbol数组类型时key代表数据中字段value代表值对象类型则有数据源中存在空间数据就行.其他类型还有circleWave覆盖范围圆、heatMap热力图、administrativeRegion行政区划、2D二维、3D三维等,详细看示例
"symbol": [
{
"key": "onlineStatus", //数据中的字段
"value": "0", //字段的值
"type": "point", //点类型
"style": { //点样式
"url": "fzsb-qxgr.png", //点图标
"width": 36, //图标宽度
"height": 53 //图标高度
}
},
{
"key": "onlineStatus",
"value": "1",
"type": "point",
"style": {
"url": "fzsb-qxgr-off.png",
"width": 36,
"height": 53
}
}
]
}
}
]
]
}
mapLayer.json
type是数据类型 circleWave(圆) point(点)
symbol是数组 里面有在线和离线的图标 通过value来区分
treeConfig.json
节点带apiParam代表该节点的内容要通过请求覆盖
legendOptions是在图层上面展示图例
名字是根据不同的二级页面 展示不同的图层内容
在图层增加数据时 需要在所有同样的二级菜单下增加相同的数据
```
在iframe里面部署之后 根据配置更改的字段标识 ***_***