Skip to content

VCanvasSource

VCanvasSource 画布源。

基础用法

添加圆圈并在地图上移动

Api

canvasSourceProps

属性名说明类型默认值
coordinates图像角点坐标,左上顺时针array必填
animate画布源是否是动画的boolean-

canvasSourceEmits

事件名说明回调参数
load源加载完成后触发Function
getCanvas获取画布元素Function

类型定义

CanvasSourceSpecification

sources/CanvasSource/CanvasSource.ts
typescript
export type CanvasSourceSpecification = {
  type: 'canvas'
  coordinates: [
    [number, number],
    [number, number],
    [number, number],
    [number, number],
  ]
  animate?: boolean
  canvas: string | HTMLCanvasElement
}

CanvasSourceLoadEvent

sources/CanvasSource/CanvasSource.ts
typescript
export interface CanvasSourceLoadEvent {
  source: CanvasSource
  map: Map
  canvas: HTMLCanvasElement
}

基于 MIT 许可发布