插件事件

interface EventMap {
    configChange: ((event: {
        config: AreaMakerPluginType.Config;
        prevConfig: AreaMakerPluginType.Config;
        userAction: boolean;
    }) => void);
    dataChange: ((data: AreaMakerPluginType.ServerData, prevData?: AreaMakerPluginType.ServerData) => void);
    dataLoaded: ((data: AreaMakerPluginType.ServerData) => void);
    disable: ((event: {
        userAction: boolean;
    }) => void);
    dispose: (() => void);
    enable: ((event: {
        userAction: boolean;
    }) => void);
    hide: ((event: {
        userAction: boolean;
    }) => void);
    show: ((event: {
        userAction: boolean;
    }) => void);
    stateChange: ((params: {
        prevState?: AreaMakerPluginType.State;
        state: AreaMakerPluginType.State;
        userAction: boolean;
    }) => void);
    wantsTap: ((event: {
        intersectObjects: Intersection[];
        target: AreaMakerItem;
    }) => boolean | void);
}

Hierarchy

Properties

configChange: ((event: {
    config: AreaMakerPluginType.Config;
    prevConfig: AreaMakerPluginType.Config;
    userAction: boolean;
}) => void)

config 变更的回调

dataChange: ((data: AreaMakerPluginType.ServerData, prevData?: AreaMakerPluginType.ServerData) => void)

数据变更

dataLoaded: ((data: AreaMakerPluginType.ServerData) => void)

数据加载完成

disable: ((event: {
    userAction: boolean;
}) => void)

enabled 从 true 到 false 的回调

dispose: (() => void)

插件被销毁

enable: ((event: {
    userAction: boolean;
}) => void)

enabled 从 false 到 true 的回调

hide: ((event: {
    userAction: boolean;
}) => void)

visible 从 true 到 false 的回调

show: ((event: {
    userAction: boolean;
}) => void)

visible 从 false 到 true 的回调

stateChange: ((params: {
    prevState?: AreaMakerPluginType.State;
    state: AreaMakerPluginType.State;
    userAction: boolean;
}) => void)

插件状态变化

wantsTap: ((event: {
    intersectObjects: Intersection[];
    target: AreaMakerItem;
}) => boolean | void)

插件内容点击的回调

Type declaration

    • (event): boolean | void
    • Parameters

      • event: {
            intersectObjects: Intersection[];
            target: AreaMakerItem;
        }
        • intersectObjects: Intersection[]

          射线与标注模型的交点集合

        • target: AreaMakerItem

          点击的标注实例

      Returns boolean | void

      | 返回 false 会阻止 Five wantsFiveTapGesture 的回调,其余 return 值会被忽略