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

    Type Alias IPrimitiveGraphicLayersModule

    Primitive 图形图层模块

    管理 PrimitiveGraphicLayer 图形图层及其中的 PrimitiveGraphic 图形对象。

    type IPrimitiveGraphicLayersModule = {
        addGraphic: (layerName: string, graphic: IPrimitiveGraphic) => boolean;
        addLayer: (
            name: string,
            geometryType: IGeometry3DType,
            style?: Partial<IStyle3D>,
        ) => boolean;
        clearLayer: (name: string) => boolean;
        containsLayer: (name: string) => boolean;
        getGraphic: (
            layerName: string,
            graphicId: string,
        ) => IPrimitiveGraphic | undefined;
        getGraphicCount: (name: string) => number;
        getGraphicExtra: (
            layerName: string,
            graphicId: string,
        ) => Record<string, unknown> | undefined;
        getLayers: () => string[];
        getLayersCount: () => number;
        getLayerStyle: (name: string) => IStyle3D | undefined;
        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;
        setLayerStyle: (name: string, style: Partial<IStyle3D>) => boolean;
        setVisible: (name: string, visible: boolean) => boolean;
        viewEntireLayer: (name: string, duration?: number) => boolean;
    }
    Index

    Properties

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

    向 Primitive 图层添加图形

    Type declaration

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

        Returns boolean

        图层不存在、几何类型不符、id 重复或图形非法时返回 false

    addLayer: (
        name: string,
        geometryType: IGeometry3DType,
        style?: Partial<IStyle3D>,
    ) => boolean

    添加 Primitive 图形图层

    Type declaration

      • (
            name: string,
            geometryType: IGeometry3DType,
            style?: Partial<IStyle3D>,
        ): boolean
      • Parameters

        • name: string

          图层名

        • geometryType: IGeometry3DType

          图层几何类型,图层只接受该类型的图形

        • Optionalstyle: Partial<IStyle3D>

          图层风格,省略时使用该几何类型的默认风格

        Returns boolean

        是否成功

    clearLayer: (name: string) => boolean

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

    Type declaration

      • (name: string): boolean
      • Parameters

        • name: string

        Returns boolean

        图层不存在时返回 false

    containsLayer: (name: string) => boolean

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

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

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

    getGraphicCount: (name: string) => number

    Primitive 图层中的图形数量,图层不存在时返回 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

        图形的属性信息

    getLayers: () => string[]

    获取所有 Primitive 图形图层名称

    getLayersCount: () => number

    获取图层数量

    getLayerStyle: (name: string) => IStyle3D | undefined

    获取 Primitive 图层风格

    Type declaration

      • (name: string): IStyle3D | undefined
      • Parameters

        • name: string

        Returns IStyle3D | undefined

        图层不存在时返回 undefined

    isVisible: (name: string) => boolean

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

    removeAllLayers: () => void

    移除所有 Primitive 图形图层

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

    从 Primitive 图层移除图形

    removeLayer: (name: string) => boolean

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

    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

    setLayerStyle: (name: string, style: Partial<IStyle3D>) => boolean

    设置 Primitive 图层风格并重建图层内所有图形

    Type declaration

      • (name: string, style: Partial<IStyle3D>): boolean
      • Parameters

        Returns boolean

        图层不存在时返回 false

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

    设置 Primitive 图层可见性

    Type declaration

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

        • name: string
        • visible: boolean

        Returns boolean

        图层不存在时返回 false

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

    全幅显示 Primitive 图层

    Type declaration

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

        • name: string

          图层名

        • Optionalduration: number

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

        Returns boolean

        图层不存在时返回 false