Interface Marker2dOptions

interface Marker2dOptions {
    allowOverlap?: boolean;
    anchor?: Anchor;
    clickTolerance?: number;
    collideGroupName?: string;
    collideId?: string;
    collideIncludePopup?: boolean;
    collideZIndex?: number;
    color?: string;
    disableOpacity?: number;
    dragAsCommand?: boolean;
    dragUnProjectOpts?: UnProjectOpts;
    draggable?: boolean;
    element?: HTMLElement;
    fadeDistance?: number;
    image?: {
        height?: number;
        src: string;
        width?: number;
    };
    isHide?: boolean;
    occlusionOpacity?: number;
    offset?: [number, number];
    position?: [number, number, number] | Vector3;
    rotation?: number;
    scale?: number;
}

Properties

allowOverlap?: boolean

是否允许重叠 默认是

anchor?: Anchor

对齐方式

clickTolerance?: number

点击拖动时超过此距离即以为是开始拖动

collideGroupName?: string

碰撞监测组名 会对同一个组名内的进行碰撞检测

collideId?: string

同一个id会一起显示和隐藏

collideIncludePopup?: boolean

碰撞检测时,如果有弹出信息框也包括信息框的范围 默认是

collideZIndex?: number

碰撞检测时的zindex,值越大,越往上

color?: string

颜色

disableOpacity?: number

当透明度小于这个值时不响应事件 默认0.1

dragAsCommand?: boolean

拖动变化是否以命令执行(可撤销重做) 默认是

dragUnProjectOpts?: UnProjectOpts

拖动时位置投影选项

draggable?: boolean

是否可拖动 默认xz平面(地图模式xy平面), 按shift键捕捉到实体 按ctrl键垂直于相机平面的位置点

element?: HTMLElement

html元素

fadeDistance?: number

透明度随相机距离大小

image?: {
    height?: number;
    src: string;
    width?: number;
}

图片 element为空时有效

Type declaration

  • Optional height?: number

  • src: string

    图像地址,可以是svg

  • Optional width?: number

isHide?: boolean

开始时隐藏

occlusionOpacity?: number

遮挡时的透明度

offset?: [number, number]

偏移像素量

position?: [number, number, number] | Vector3

位置

rotation?: number

旋转角度(0-360)

scale?: number

缩放比例