XYZ Maps Documentation
    Preparing search index...

    Interface ModelStyleExperimental

    Interface for configuring the visual appearance of Models. The default orientation is with the Y axis pointing up.

    interface ModelStyle {
        cullFace?: false | "Front" | "Back";
        emissive?:
            | Color
            | StyleZoomRange<Color>
            | StyleExpression<Color>
            | StyleValueFunction<Color>;
        light?: string;
        model: string | ModelData | StyleValueFunction<ModelData>;
        modelId?: number;
        rotate?: number[];
        scale?: number[];
        shininess?: number;
        specular?:
            | Color
            | StyleZoomRange<Color>
            | StyleExpression<Color>
            | StyleValueFunction<Color>;
        transform?: number[];
        translate?: number[];
        type: "Model";
        zIndex:
            | number
            | StyleValueFunction<number>
            | StyleZoomRange<number>
            | StyleExpression<number>;
        zLayer?: number | StyleValueFunction<number> | StyleExpression<number>;
    }
    Index
    cullFace?: false | "Front" | "Back"

    Configure Face culling. To enable culling set cullFace to "Front" or "Back", to disable set to false. The used winding order is counter-clock-wise. Face culling is disabled by default.

    @defaultValue: false

    emissive?:
        | Color
        | StyleZoomRange<Color>
        | StyleExpression<Color>
        | StyleValueFunction<Color>

    Sets the emissive color of the "Model", giving it a glow effect.

    Combination with Material Emissive:

    • The provided emissive color value will be combined with Material.emissive through color addition.

    Color for a detailed list of possible supported formats.

    light?: string

    Specifies the name of the light group to use for illuminating specific features on a layer. This property must reference a key corresponding to a light group defined in LayerStyle.lights. A light group consists of lighting sources such as ambient or directional lights that affect the appearance of features.

    If light is not defined, the default light group "defaultLight" will be used to illuminate the layer's features.

    LayerStyle.lights for defining and referencing available light groups.

    "defaultLight"
    

    The Model data that should be rendered. In addition to passing the model directly, a string can also be provided that references a Wavefront OBJ file.

    {zIndex: 0, type: "Model", model: "./MyModel.obj"}
    
    modelId?: number
    rotate?: number[]

    rotate the model by the given vector [radX,radY,radZ]. The order of rotation is x first, then y, followed by z.

    scale?: number[]

    Scale the model by the given vector [sx,sy,sz].

    shininess?: number

    Sets the shininess of the "Model", determining how glossy its surface appears. A higher value makes the ``"Model"` surface more reflective.

    Combination with Material Shininess:

    • Effect: The shininess value controls the size and intensity of the specular highlight, which is colored by the specular property.
    • Specular Dependency: The shininess property enhances the effect of the specular color. If specular is not set, shininess has no visible effect.
    • Range: The shininess value typically ranges from 0 to 128.
    • Low Values (0-10): Produce a wide, diffused highlight, resulting in a matte or dull appearance.
    • High Values (50-128): Produce a small, intense highlight, resulting in a glossy or shiny appearance.
    32
    
    specular?:
        | Color
        | StyleZoomRange<Color>
        | StyleExpression<Color>
        | StyleValueFunction<Color>

    Sets the specular color of the "Model", affecting how it reflects light.

    Combination with Material Specular:

    • The provided specular value will be combined with Material.specular through color addition.
    • Effect: The specular property determines the color of the light reflection, while the shininess value controls the intensity and size of the reflection.
    • Shininess Dependency: If specular is set and shininess is not explicitly set, the default shininess value will be used to control the reflection's appearance.

    Color for a detailed list of possible supported formats.

    transform?: number[]

    4x4 transformation matrix to transform the model. if transform is defined, scale, translate and rotate are ignored.

    translate?: number[]

    Translate the model by the given vector [tx,ty,tz].

    type: "Model"

    Specifies the type of style to render.

    zIndex:
        | number
        | StyleValueFunction<number>
        | StyleZoomRange<number>
        | StyleExpression<number>

    Indicates the drawing order within a 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.

    zLayer?: number | StyleValueFunction<number> | StyleExpression<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, it will fall back to the LayerStyle.zLayer or depend 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}