@un-fao/visualization@0.1.0-review.1
    Preparing search index...

    Class SingleBandRasterLayer

    Hierarchy

    Index
    • Parameters

      • ...propObjects: Partial<
            LayerProps & {
                debounceTime?: number;
                maxCacheByteSize?: number;
                maxRequests?: number;
                nodata?: number;
                resampling?: RasterResampling;
                tileSize?: number;
            } & {
                assetKey?: string;
                displayMax?: number;
                displayMin?: number;
                hrefResolver?: (href: string, context: StacHrefContext) => string;
                onLegendResolved?: (legend: RasterLegendInfo | null) => void;
                onLoad?: (info: SingleBandRasterLoadInfo) => void;
                onSourceResolved?: (intent: RasterSourceIntent) => void;
                renderKey?: string;
                source: SingleBandRasterSourceInput;
                sourceBaseUrl?: string;
                style?: SingleBandRasterStyle;
            } & Required<CompositeLayerProps> & Required<LayerProps>,
        >[]

      Returns SingleBandRasterLayer

    context: LayerContext
    count: number
    id: string
    internalState: LayerState<SingleBandRasterLayer> | null
    lifecycle: Lifecycle
    parent: Layer<{}> | null
    props: StatefulComponentProps<
        LayerProps & {
            debounceTime?: number;
            maxCacheByteSize?: number;
            maxRequests?: number;
            nodata?: number;
            resampling?: RasterResampling;
            tileSize?: number;
        } & {
            assetKey?: string;
            displayMax?: number;
            displayMin?: number;
            hrefResolver?: (href: string, context: StacHrefContext) => string;
            onLegendResolved?: (legend: RasterLegendInfo | null) => void;
            onLoad?: (info: SingleBandRasterLoadInfo) => void;
            onSourceResolved?: (intent: RasterSourceIntent) => void;
            renderKey?: string;
            source: SingleBandRasterSourceInput;
            sourceBaseUrl?: string;
            style?: SingleBandRasterStyle;
        } & Required<CompositeLayerProps> & Required<LayerProps>,
    >
    state: SingleBandRasterLayerState
    defaultProps: DefaultProps
    layerName: string
    • get isComposite(): boolean

      true if this layer renders other layers

      Returns boolean

    • get isDrawable(): boolean

      true if the layer renders to screen

      Returns boolean

    • get isLoaded(): boolean

      Returns true if all async resources are loaded

      Returns boolean

    • get root(): Layer

      Returns Layer

    • get wrapLongitude(): boolean

      Returns true if using shader-based WGS84 longitude wrapping

      Returns boolean

    • get componentName(): string

      Returns string

    • Parameters

      • objectIndex: number

      Returns void

    • Parameters

      • __namedParameters: {
            parameters: Parameters;
            renderPass: RenderPass;
            shaderModuleProps: any;
            uniforms: any;
        }

      Returns void

    • (Internal) Called by manager when layer is about to be disposed Note: not guaranteed to be called on application shutdown

      Returns void

    • Override base Layer method

      Returns AttributeManager | null

    • Returns void

    • (Internal) Called after an update to rerender sub layers

      Parameters

      Returns void

    • Apply changed attributes to model

      Parameters

      • model: Model
      • changedAttributes: { [id: string]: Attribute }
      • OptionalbufferLayoutChanged: boolean

      Returns void

    • (Internal) Called by layer manager to transfer state from an old layer

      Parameters

      • oldLayer: Layer<
            LayerProps & {
                debounceTime?: number;
                maxCacheByteSize?: number;
                maxRequests?: number;
                nodata?: number;
                resampling?: RasterResampling;
                tileSize?: number;
            } & {
                assetKey?: string;
                displayMax?: number;
                displayMin?: number;
                hrefResolver?: (href: string, context: StacHrefContext) => string;
                onLegendResolved?: (legend: RasterLegendInfo | null) => void;
                onLoad?: (info: SingleBandRasterLoadInfo) => void;
                onSourceResolved?: (intent: RasterSourceIntent) => void;
                renderKey?: string;
                source: SingleBandRasterSourceInput;
                sourceBaseUrl?: string;
                style?: SingleBandRasterStyle;
            } & Required<CompositeLayerProps>,
        >

      Returns void

    • (Internal) Called by layer manager when a new layer is added or an existing layer is matched with a new instance

      Returns void

    • Recalculate any attributes if needed

      Returns void

    • Update sub layers to highlight the hovered object

      Parameters

      • info: {
            color: Uint8Array<ArrayBufferLike> | null;
            coordinate?: number[];
            devicePixel?: [number, number];
            index: number;
            layer: Layer<{}> | null;
            object?: any;
            picked: boolean;
            pixel?: [number, number];
            pixelRatio: number;
            sourceLayer?: Layer<{}> | null;
            viewport?: Viewport;
            x: number;
            y: number;
        }

      Returns void

    • Called when this layer is rendered into the given viewport

      Parameters

      • viewport: Viewport

      Returns void

    • Updater for the automatically populated instancePickingColors attribute

      Parameters

      • attribute: Attribute
      • __namedParameters: { numInstances: number }

      Returns void

    • Parameters

      • newProps: Partial<PropsT>

      Returns any

    • Parameters

      • color: any

      Returns number

    • (Internal) Sets the picking color at the specified index to null picking color. Used for multi-depth picking. This method may be overriden by layer implementations

      Parameters

      • objectIndex: number

      Returns void

    • Parameters

      • opts: DrawOptions

      Returns void

    • Parameters

      • i: any
      • Optionaltarget: number[]

      Returns [number, number, number]

    • Filters sub layers at draw time. Return true if the sub layer should be drawn.

      Parameters

      • context: FilterContext

      Returns boolean

    • Called once when layer is no longer matched and state will be discarded. Layers can destroy WebGL resources here.

      Parameters

      • context: LayerContext

      Returns void

    • Returns the attribute manager of this layer

      Returns AttributeManager | null

    • Returns [number[], number[]] | null

    • Returns the current change flags

      Returns ChangeFlags | undefined

    • Returns the most recent layer that matched to this state (When reacting to an async event, this layer may no longer be the latest)

      Returns
          | Layer<
              LayerProps & {
                  debounceTime?: number;
                  maxCacheByteSize?: number;
                  maxRequests?: number;
                  nodata?: number;
                  resampling?: RasterResampling;
                  tileSize?: number;
              } & {
                  assetKey?: string;
                  displayMax?: number;
                  displayMin?: number;
                  hrefResolver?: (href: string, context: StacHrefContext) => string;
                  onLegendResolved?: (legend: RasterLegendInfo | null) => void;
                  onLoad?: (info: SingleBandRasterLoadInfo) => void;
                  onSourceResolved?: (intent: RasterSourceIntent) => void;
                  renderKey?: string;
                  source: SingleBandRasterSourceInput;
                  sourceBaseUrl?: string;
                  style?: SingleBandRasterStyle;
              } & Required<CompositeLayerProps>,
          >
          | null

    • Returns the default parse options for async props

      Returns any

    • Returns an array of models used by this layer, can be overriden by layer subclass

      Returns Model[]

    • (Internal) Checks if this layer needs redraw

      Parameters

      • Optionalopts: { clearRedrawFlags: boolean }
        • clearRedrawFlags: boolean

          Reset redraw flags to false after the check

      Returns string | false

    • Deduces number of instances. Intention is to support:

      • Explicit setting of numInstances
      • Auto-deduction for ES6 containers that define a size member
      • Auto-deduction for Classic Arrays via the built-in length attribute
      • Auto-deduction via arrays

      Returns number

    • called to augment the info object that is bubbled up from a sublayer override Layer.getPickingInfo() because decoding / setting uniform do not apply to a composite layer.

      Parameters

      • __namedParameters: GetPickingInfoParams

      Returns {
          color: Uint8Array<ArrayBufferLike> | null;
          coordinate?: number[];
          devicePixel?: [number, number];
          index: number;
          layer: Layer<{}> | null;
          object?: any;
          picked: boolean;
          pixel?: [number, number];
          pixelRatio: number;
          sourceLayer?: Layer<{}> | null;
          viewport?: Viewport;
          x: number;
          y: number;
      }

    • Parameters

      • shaders: any

      Returns any

    • Buffer layout describes how many attribute values are packed for each data object The default (null) is one value each object. Some data formats (e.g. paths, polygons) have various length. Their buffer layout is in the form of [L0, L1, L2, ...]

      Returns NumericArray | null

    • Some composite layers cast user data into another format before passing to sublayers We need to unwrap them before calling the accessor so that they see the original data objects

      Type Parameters

      • In
      • Out

      Parameters

      • accessor: Accessor<In, Out>

      Returns Accessor<In, Out>

    • Returns sub layer class for a specific sublayer

      Type Parameters

      • T extends Layer<{}>

      Parameters

      • subLayerId: string
      • DefaultLayerClass: ConstructorOf<T>

      Returns ConstructorOf<T>

    • Returns sub layer props for a specific sublayer

      Parameters

      • OptionalsublayerProps: { id?: string; updateTriggers?: Record<string, any>; [propName: string]: any }

      Returns any

    • When casting user data into another format to pass to sublayers, add reference to the original object and object index

      Type Parameters

      • T

      Parameters

      • row: T
      • sourceObject: any
      • sourceObjectIndex: number

      Returns T

    • Return last rendered sub layers

      Returns Layer<{}>[]

    • Checks if this layer has ongoing uniform transition

      Returns boolean

    • Returns void

    • Default implementation of attribute invalidation, can be redefined

      Parameters

      • Optionalname: string

      Returns void

    • Returns boolean

      Returns true if the layer is visible in the picking pass

    • (Internal) Checks if this layer needs a deep update

      Returns boolean

    • Returns number[]

    • Parameters

      • info: {
            color: Uint8Array<ArrayBufferLike> | null;
            coordinate?: number[];
            devicePixel?: [number, number];
            index: number;
            layer: Layer<{}> | null;
            object?: any;
            picked: boolean;
            pixel?: [number, number];
            pixelRatio: number;
            sourceLayer?: Layer<{}> | null;
            viewport?: Viewport;
            x: number;
            y: number;
        }
      • pickingEvent: any

      Returns boolean

    • Parameters

      • info: {
            color: Uint8Array<ArrayBufferLike> | null;
            coordinate?: number[];
            devicePixel?: [number, number];
            index: number;
            layer: Layer<{}> | null;
            object?: any;
            picked: boolean;
            pixel?: [number, number];
            pixelRatio: number;
            sourceLayer?: Layer<{}> | null;
            viewport?: Viewport;
            x: number;
            y: number;
        }
      • pickingEvent: any

      Returns boolean

    • Projects a point with current view state from the current layer's coordinate system to screen

      Parameters

      • xyz: number[]

      Returns number[]

    • Projects a point with current view state from the current layer's coordinate system to the world space

      Parameters

      • xyz: number[]
      • Optionalparams: {
            autoOffset?: boolean;
            fromCoordinateOrigin?: [number, number, number];
            fromCoordinateSystem?: CoordinateSystem;
            viewport?: Viewport;
        }
        • OptionalautoOffset?: boolean

          Whether to apply offset mode automatically as does the project shader module. Offset mode places the origin of the common space at the given viewport's center. It is used in some use cases to improve precision in the vertex shader due to the fp32 float limitation. Use autoOffset:false if the returned position should not be dependent on the current viewport. Default true

        • OptionalfromCoordinateOrigin?: [number, number, number]

          The coordinate origin that the supplied position is in. Default to the same as coordinateOrigin.

        • OptionalfromCoordinateSystem?: CoordinateSystem

          The coordinate system that the supplied position is in. Default to the same as coordinateSystem.

        • Optionalviewport?: Viewport

          The viewport to use

      Returns [number, number, number]

    • (Internal) Propagate an error event through the system

      Parameters

      • error: Error
      • message: string

      Returns void

    • Returns SingleBandRasterRuntimeLayer | null

    • (Internal) Re-enable all picking indices after multi-depth picking

      Returns void

    • Dirty some change flags, will be handled by updateLayer

      Parameters

      • flags: Partial<ChangeFlags>

      Returns void

    • Sets the redraw flag for this layer, will trigger a redraw next animation frame

      Returns void

    • Mark this layer as needs a deep update

      Returns void

    • Update shader input parameters

      Parameters

      • ...props: [props: ShaderInputsProps<Partial<Record<string, Record<string, unknown>>>>]

      Returns void

    • Updates selected state members and marks the composite layer to need rerender

      Parameters

      • updateObject: any

      Returns void

    • Returns true if sub layer needs to be rendered

      Parameters

      • subLayerId: string
      • data: any

      Returns boolean

    • Controls if updateState should be called. By default returns true if any prop has changed

      Parameters

      • params: UpdateParameters<
            Layer<
                LayerProps & {
                    debounceTime?: number;
                    maxCacheByteSize?: number;
                    maxRequests?: number;
                    nodata?: number;
                    resampling?: RasterResampling;
                    tileSize?: number;
                } & {
                    assetKey?: string;
                    displayMax?: number;
                    displayMin?: number;
                    hrefResolver?: (href: string, context: StacHrefContext) => string;
                    onLegendResolved?: (legend: RasterLegendInfo | null) => void;
                    onLoad?: (info: SingleBandRasterLoadInfo) => void;
                    onSourceResolved?: (intent: RasterSourceIntent) => void;
                    renderKey?: string;
                    source: SingleBandRasterSourceInput;
                    sourceBaseUrl?: string;
                    style?: SingleBandRasterStyle;
                } & Required<CompositeLayerProps>,
            >,
        >

      Returns boolean

    • Returns a string representation of an object.

      Returns string

    • Unprojects a screen pixel to the current view's default coordinate system Note: this does not reverse project.

      Parameters

      • xy: number[]

      Returns number[]

    • Send updated attributes to the WebGL model

      Parameters

      • changedAttributes: { [id: string]: Attribute }

      Returns void

    • (Internal) Called by deck picker when the hovered object changes to update the auto highlight

      Parameters

      • info: {
            color: Uint8Array<ArrayBufferLike> | null;
            coordinate?: number[];
            devicePixel?: [number, number];
            index: number;
            layer: Layer<{}> | null;
            object?: any;
            picked: boolean;
            pixel?: [number, number];
            pixelRatio: number;
            sourceLayer?: Layer<{}> | null;
            viewport?: Viewport;
            x: number;
            y: number;
        }

      Returns void

    • Default implementation, all attributes will be invalidated and updated when data changes

      Parameters

      • params: UpdateParameters<
            Layer<
                LayerProps & {
                    debounceTime?: number;
                    maxCacheByteSize?: number;
                    maxRequests?: number;
                    nodata?: number;
                    resampling?: RasterResampling;
                    tileSize?: number;
                } & {
                    assetKey?: string;
                    displayMax?: number;
                    displayMin?: number;
                    hrefResolver?: (href: string, context: StacHrefContext) => string;
                    onLegendResolved?: (legend: RasterLegendInfo | null) => void;
                    onLoad?: (info: SingleBandRasterLoadInfo) => void;
                    onSourceResolved?: (intent: RasterSourceIntent) => void;
                    renderKey?: string;
                    source: SingleBandRasterSourceInput;
                    sourceBaseUrl?: string;
                    style?: SingleBandRasterStyle;
                } & Required<CompositeLayerProps>,
            >,
        >

      Returns void

    • Returns boolean

    • (Internal) called by layer manager to perform extra props validation (in development only)

      Returns void