GithubHelp home page GithubHelp logo

position-editor's Introduction

点位编辑器

从地球开始的建筑结构树的编辑,包含了点,圆,矩形,多边形,及背景图的编辑. 编辑器分成两个部分,当在地球一级时,用leaflet地图编辑器进行点位编辑, 当在建筑层级时,使用reactflow进行节点编辑.

参考

地图编辑器:

xyflow编辑器:

组态: FUXA组态 svg实现图形编辑器系列一:精灵系统(https://alanyf.gitee.io/monorepo/graphic-editor/#/)

设计

编辑器:用于在地球或者建筑节点上编辑子点位.

数据结构:

  • 点位表结构(position) { _id,name,parent,ancestor:[],nodeType:'structure/position', locationType:'gnss/xy',location:[],areaType:'circle/rectangle/polygon',area:[] tenant,customer,owner(创建者),createdAt,updatedAt. }
  • 点位列表
  • 当前操作所在节点(即当前parent节点),可能是地球(null)或建筑(structure)

界面:

  • 左边节点树(包含创建点位和建筑按钮,分不同形状(null无区域点/circle/rectangle/polygon))
  • 右边属性框
    • 基本属性:名称,父节点,祖先列表,节点类型
    • 位置区域属性: 位置类型:gnss/xyz,位置,区域类型,区域
    • 扩展插件(面板):关联设备列表框,关联耗材框,可能耗材与设备关联,插件面板带入了各种函数,插件面板本身会带入当前点位信息.
  • 底部信息框,用来显示操作提示等.
  • 图表位,可以按广告位方式管理,一般将横向分成M份,纵向分成N份.位置:(0 ~ M-1)/(0 ~ N-1),传入额外参数为当前节点.

业务逻辑:

  • 得到第一级节点列表,即查询parent=null的节点列表
  • 点中某一级的某个节点(不管是在哪一级),界面中parent都是其父节点.如果点中地球,则父节点还在地球,即null.
  • 点中某个节点,如果是建筑节点,则需要获取其子节点列表,动态加载.

组件实现:

  • 属性: 节点保存函数(创建,更新),查找节点函数.
  • 状态:
    • 父节点parent(当前操作节点),
    • 节点map(nodeMap)
    • 树状结构treeData:[{key(节点_id),title(节点名称name),isLeaf(是否为叶子节点position类型),children:[]},...]

leaflet使用天地图

申请天地图keyhttp://lbs.tianditu.gov.cn/server/MapService.html

可以参考https://github.com/htoooth/Leaflet.ChineseTmsProviders/blob/master/src/leaflet.ChineseTmsProviders.js得到天地图的配置.

测试

yarn
yarn dev

问题

  1. leaflet-distortableimage卸载时报错,Uncaught TypeError: Cannot read properties of null (reading 'off')publiclab/Leaflet.DistortableImage#1391,修改EditHandle.

position-editor's People

Contributors

windsome avatar moklick avatar

Watchers

 avatar  avatar

position-editor's Issues

视频播放地址

这是加密可播地址:
{
"msg": "操作成功",
"code": "200",
"data": {
"id": null,
"url": "ezopen://open.ys7.com/J36256031/1.hd.live",
"expireTime": null
}
}

这是不加密可播地址:
m3u8:{
"msg": "操作成功",
"code": "200",
"data": {
"id": "713335136104079360",
"url": "https://open.ys7.com/v3/openlive/J36256031_1_1.m3u8?expire=1716430749&id=713335136104079360&t=aa5ccf57c81500a84453bea4ccb358cf76f63fa2fe7f190f81756a8b9a4f4716&ev=100",
"expireTime": "2024-05-23 10:19:09"
}
}
rtmp:{
"msg": "操作成功",
"code": "200",
"data": {
"id": "713335348715159552",
"url": "rtmp://rtmp01open.ys7.com:1935/v3/openlive/J36256031_1_1?expire=1716430800&id=713335348715159552&t=84698147ee7d46463a74528d15097fc179755285f291e29f7ba0cb006ef885fc&ev=100",
"expireTime": "2024-05-23 10:20:00"
}
}
flv:{
"msg": "操作成功",
"code": "200",
"data": {
"id": "713335416770125824",
"url": "https://rtmp01open.ys7.com:9188/v3/openlive/J36256031_1_1.flv?expire=1716430816&id=713335416770125824&t=e0481e1d4013c111518d698f6c2d1cfd0c9a40f8c77341e1e3672e8c3f3336d1&ev=100",
"expireTime": "2024-05-23 10:20:16"
}
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.