react-native-mobilex 开发文档
    Preparing search index...

    Type Alias IEntityGraphicLayersModule

    Entity 图形图层模块

    管理 EntityGraphicLayer 图形图层及其中的 EntityGraphic 图形对象。

    type IEntityGraphicLayersModule = {
        addGraphic: (layerName: string, graphic: IEntityGraphic) => boolean;
        addLayer: (name: string) => Promise<boolean>;
        clearLayer: (name: string) => boolean;
        containsLayer: (name: string) => boolean;
        getGraphic: (
            layerName: string,
            graphicId: string,
        ) => IEntityGraphic | undefined;
        getGraphicCount: (name: string) => number;
        getGraphicExtra: (
            layerName: string,
            graphicId: string,
        ) => Record<string, unknown> | undefined;
        getGraphicStyle: (
            layerName: string,
            graphicId: string,
        ) => IStyle3D | undefined;
        getLayers: () => string[];
        getLayersCount: () => number;
        isVisible: (name: string) => boolean;
        removeAllLayers: () => void;
        removeGraphic: (layerName: string, graphicId: string) => boolean;
        removeLayer: (name: string) => boolean;
        setGraphicExtra: (
            layerName: string,
            graphicId: string,
            extra: Record<string, unknown>,
        ) => void;
        setGraphicStyle: (
            layerName: string,
            graphicId: string,
            style: Partial<IStyle3D>,
        ) => void;
        setVisible: (name: string, visible: boolean) => boolean;
        viewEntireLayer: (name: string, duration?: number) => boolean;
    }
    Index

    Properties

    addGraphic: (layerName: string, graphic: IEntityGraphic) => boolean

    向 Entity 图层添加图形

    Type declaration

      • (layerName: string, graphic: IEntityGraphic): boolean
      • Parameters

        Returns boolean

        图层不存在、id 重复或图形非法时返回 false

    addLayer: (name: string) => Promise<boolean>

    添加 Entity 图形图层

    Type declaration

      • (name: string): Promise<boolean>
      • Parameters

        • name: string

          图层名

        Returns Promise<boolean>

        是否成功

    clearLayer: (name: string) => boolean

    清空指定 Entity 图层中的所有图形(图层本身保留)

    Type declaration

      • (name: string): boolean
      • Parameters

        • name: string

        Returns boolean

        图层不存在时返回 false

    containsLayer: (name: string) => boolean

    是否存在指定名称的 Entity 图形图层

    getGraphic: (layerName: string, graphicId: string) => IEntityGraphic | undefined

    获取 Entity 图层中的图形,不存在时返回 undefined

    getGraphicCount: (name: string) => number

    Entity 图层中的图形数量,图层不存在时返回 0

    getGraphicExtra: (
        layerName: string,
        graphicId: string,
    ) => Record<string, unknown> | undefined

    获取指定图形的属性信息

    Type declaration

      • (layerName: string, graphicId: string): Record<string, unknown> | undefined
      • Parameters

        • layerName: string

          图层名称

        • graphicId: string

          图形id

        Returns Record<string, unknown> | undefined

        图形的属性信息

    getGraphicStyle: (layerName: string, graphicId: string) => IStyle3D | undefined

    获取指定图形的风格

    Type declaration

      • (layerName: string, graphicId: string): IStyle3D | undefined
      • Parameters

        • layerName: string

          图层名

        • graphicId: string

          图形id

        Returns IStyle3D | undefined

        图形的风格

    getLayers: () => string[]

    获取所有 Entity 图形图层名称

    getLayersCount: () => number

    获取图层数量

    isVisible: (name: string) => boolean

    Entity 图层可见性,图层不存在时返回 false

    removeAllLayers: () => void

    清空所有 Entity 图形图层

    removeGraphic: (layerName: string, graphicId: string) => boolean

    从 Entity 图层移除图形

    removeLayer: (name: string) => boolean

    移除指定名称的 Entity 图形图层

    setGraphicExtra: (
        layerName: string,
        graphicId: string,
        extra: Record<string, unknown>,
    ) => void

    设置指定图形的属性信息

    Type declaration

      • (layerName: string, graphicId: string, extra: Record<string, unknown>): void
      • Parameters

        • layerName: string

          图层名称

        • graphicId: string

          图形id

        • extra: Record<string, unknown>

          要设置的属性信息

        Returns void

    setGraphicStyle: (
        layerName: string,
        graphicId: string,
        style: Partial<IStyle3D>,
    ) => void

    设置指定图层的风格

    Type declaration

      • (layerName: string, graphicId: string, style: Partial<IStyle3D>): void
      • Parameters

        • layerName: string

          图层名

        • graphicId: string

          图形id

        • style: Partial<IStyle3D>

          要设置的图形的风格

        Returns void

    setVisible: (name: string, visible: boolean) => boolean

    设置 Entity 图层可见性

    Type declaration

      • (name: string, visible: boolean): boolean
      • Parameters

        • name: string
        • visible: boolean

        Returns boolean

        图层不存在时返回 false

    viewEntireLayer: (name: string, duration?: number) => boolean

    全幅显示 Entity 图层

    Type declaration

      • (name: string, duration?: number): boolean
      • Parameters

        • name: string

          图层名

        • Optionalduration: number

          动画时间(秒),<=0 或省略时无动画

        Returns boolean

        图层不存在时返回 false