XYZ Maps Documentation
    Preparing search index...

    Interface CustomLayerOptions

    Options to configure the CustomLayer.

    interface CustomLayerOptions {
        max?: number;
        min?: number;
        name?: string;
        renderOptions?: { mode?: string; zIndex?: number; zLayer?: number };
        visible?: boolean;
        onLayerAdd?(ev: CustomEvent): any;
        onLayerRemove?(ev: CustomEvent): any;
        render?(
            context: WebGLRenderingContext | CanvasRenderingContext2D,
            matrix: Float64Array,
        ): any;
    }

    Hierarchy (View Summary)

    Index
    max?: number

    maximum zoom level at which data from the Layer will be displayed.

    min?: number

    minimum zoom level at which data from the Layer will be displayed.

    name?: string

    Name of the Layer.

    renderOptions?: { mode?: string; zIndex?: number; zLayer?: number }

    Options to configure the renderer.

    Type Declaration

    • Optionalmode?: string

      The used rendering mode. Use '2d' for traditional flat map layers that are located on the ground-plane, otherwise '3d'.

      @DefaultValue: '2d'

    • OptionalzIndex?: number

      Indicates the drawing order within the layer. Styles with larger zIndex value are rendered above those with smaller values. The zIndex is defined relative to the "zLayer" property. If "zLayer" is defined all zIndex values are relative to the "zLayer" value.

    • OptionalzLayer?: number

      Indicates drawing order across multiple layers. Styles using zLayer with a high value are rendered on top of zLayers with a low value. If no zLayer is defined the zLayer depends on the display layer order. The first (lowest) layer has a zLayer value of 1.

      {...zLayer: 2, zIndex: 5} will be rendered on top of {...zLayer: 1, zIndex: 10}
      
    visible?: boolean

    Indicates whether the layer should be visible (true) or hidden (false).

    true
    
    • Event Listener that will be called when the layer is added to the display.

      Parameters

      • ev: CustomEvent

        Event of type "layerAdd"

      Returns any

    • Event Listener that will be called when the layer is removed from the display.

      Parameters

      • ev: CustomEvent

        Event of type "layerRemove"

      Returns any

    • The render function will be called each frame. It enables seamless drawing into the rendering context of the map. The context states are correctly set already to allow "simple" drawing at the respective zIndex/zLayer. The camera matrix projects from the world coordinate system (WebMercator projected, topLeft [0,0] -> bottomRight [1,1]) to the clipspace.

      Parameters

      • context: WebGLRenderingContext | CanvasRenderingContext2D

        the rendering context of the map.

      • matrix: Float64Array

        the camera matrix of the map.

      Returns any