依据 VectorDraw 封装的

需要在 public/index.html 中引入 js 点击跳转

在这里插入图片描述

前言

点击跳转 npm
或 npm i cad-project --save


增加元素 AddEntity


  <auto-cad ref="autoCad" path="data/testcad.vds" :ids="example" />
	data() {
    return {
      //Id是元素Id -> AutoCad 里面的 HandleId
      // Type : undo 变换为红色 done 绿色 doing 黄色
      example: [
        { Id: 12695, Type: "undo" },
        { Id: 12724, Type: "done" },
        { Id: 12789, Type: "doing" },
      ],
     };
  	},
	/**
     * eEntityType : circle、triangle、square、pentagram
     * ptPosition : [0, 0]
     * dCircumcircleRadius : 1
     * aColor : "255,255,0"
     * bHatch : 是否填充 bool
     * type_str : 类型名称 用于区分
     */
	 this.$refs.autoCad.AddEntity(...args)

增加图片 AddImage

    /**
     * name_id : 名称唯一
     * base_str :图片base64字符串
     * position :经纬度[x,y,0]
     * type_str : 类型名称 '摄像头' '风险源' 等
     */
	 var entity = this.$refs.autoCad.AddImage(name_id, base_str, position, type_str)

后续可以继续增加

Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐