XYZ Maps Documentation
    Preparing search index...

    Type Alias Style

    Style: CommonStyle

    The Style object defines how certain features should be rendered. A style object must always contain the attributes "zIndex" and "type" as well as the mandatory attributes of the corresponding "type":

    • Circle: "radius" must be included and either "fill" or "stroke" should be included.
    • Rect: "width" must be included and "height" will be set with the same value as "width" if only "width" is present. Either "fill" or "stroke" should be included
    • Text: "text" or "textRef" should be included and "fill" or "stroke" should also be included for text color
    • Image: "src" and "width" must be included. "height" will be set with the same value as "width" if only "width" is present.
    • Line: "stroke" must be included.
    • Polygon: "fill" or "stroke" must be included.
    • Box: "width" must be included, while "height" and "depth" will be set with the same value as "width" if only "width" is present. Either "fill" or "stroke" should be included
    • Sphere: A style of type Sphere must include "radius" and "fill".
    • VerticalLine: "stroke" must be included.
    // example of Circle:
    {zIndex: 0, type: "Circle", radius: 16, fill: "#FFFF00"}

    // example of Rect:
    {zIndex: 0, type: "Rect", fill: "#4C9EEF", stroke: "#0156BB", width: 20, height: 20}

    // example of Text:
    {zIndex:1, type: "Text", fill: "#FFFFFF", text: "HERE", font: "normal 12px Arial"}

    // example of Image:
    {zIndex: 0, type: "Image", src: "./xyz.png", width: 20, height: 20}

    // example of Line:
    {zIndex: 0, type: "Line", opacity: 0.5, stroke: "#BE6B65", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 16}

    // example of Polygon:
    {zIndex: 0, type: "Polygon", opacity: 0.5, stroke: "#BE6B65", fill: "#FFFFFF"}

    // example of Box:
    {zIndex: 0, type: "Box", width: 16, height: 16, depth: 16, stroke: "#BE6B65", fill: "#FFFFFF"}

    // example of Sphere:
    {zIndex: 0, type: "Sphere", radius: 16, fill: "#FFFFFF"}