vue3 + arcgis.js4.x---new Draw画板功能(画线)

在这里插入图片描述

const draw = new Draw({ view: window.customMap })
const graphicsLayer = new GraphicsLayer({
  id: 'custom-draw-layer'
})
window.customMap.map.add(graphicsLayer)
// 画线
const action = draw.create('polyline', { mode: 'click' })
action.on(['vertex-add'], (event) => {
  const paths = event.vertices.map((item) => webMercatorUtils.xyToLngLat(item[0], item[1]))
  const polylineGraphic = new Graphic()
  polylineGraphic.geometry = {
    type: 'polyline',
    paths
  }
  polylineGraphic.symbol = new SimpleLineSymbol({
    color: '#ff0000',
    width: '3px',
    style: 'solid'
  })
  graphicsLayer.add(polylineGraphic)
})

相关推荐

  1. vue3 vuex 4.x 持久化

    2024-06-08 08:50:02       13 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-06-08 08:50:02       16 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-06-08 08:50:02       16 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-06-08 08:50:02       15 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-06-08 08:50:02       18 阅读

热门阅读

  1. Docker基础命令

    2024-06-08 08:50:02       11 阅读
  2. C++ class 和 struct 区别

    2024-06-08 08:50:02       9 阅读
  3. Outlook设置邮箱签名

    2024-06-08 08:50:02       8 阅读
  4. 【设计模式之外观模式 -- C++】

    2024-06-08 08:50:02       8 阅读
  5. 速盾:服务器cdn加速超时如何解决?

    2024-06-08 08:50:02       8 阅读
  6. WDF驱动开发-PNP和电源管理(一)

    2024-06-08 08:50:02       11 阅读
  7. xmind父主题快捷键Ctrl+Enter

    2024-06-08 08:50:02       8 阅读
  8. 关于json文件的保存

    2024-06-08 08:50:02       8 阅读