s2maps-gpu - v0.18.0
    Preparing search index...

    Interface LineStyle

    Line Style Guide

    Base Properties:

    • name: the name of the layer, useful for sorting a layer on insert or for removal
    • source: the name of the source whose data this layer will use
    • layer: the source's layer. Defaults to "default" for JSON data
    • minzoom: the minimum zoom level at which the layer will be visible
    • maxzoom: the maximum zoom level at which the layer will be visible
    • filter: [See Filter] a filter function to filter out features from the source layer
    • lch: use LCH coloring instead of RGB. Useful for color changing when the new color is very different from the old one
    • visible: whether the layer is visible or not
    • metadata: additional metadata. Used by style generators
    • color: Color of the line. Input either a string pull out the value using a Property.
    • opacity: the opacity of the line. Choose between [0, 1], or pull out the value using a Property.
    • width: the width of the line in pixels
    • gapwidth: split the line into two segments to reduce rendering artifacts
    • cap: [See Cap] the cap of the line. Either butt, square, or round
    • join: [See Join] the joiner used for the line. Either bevel, miter, or round
    • dasharray: A sequence of lengths and gaps that describe the pattern of dashes and gaps used to draw the line. Written as Array<[length: number, color: string]>
    • geoFilter: [See GeoFilter] filter the geometry types that will be drawn.
    • interactive: boolean flag. If true, when hovering over the line, the property data will be sent to the UI via an Event
    • cursor: [See Cursor] the cursor to use when hovering over the line
    interface LineStyle {
        cap?: Cap | PropertyOnlyStep<Cap>;
        color?: string | Property<string>;
        cursor?: string;
        dasharray?: [length: number, color: string][];
        filter?: Filter;
        gapwidth?: number | Property<number>;
        geoFilter?: ("line" | "poly")[];
        interactive?: boolean;
        join?: Join | PropertyOnlyStep<Join>;
        layer?: string;
        lch?: boolean;
        maxzoom?: number;
        metadata?: unknown;
        minzoom?: number;
        name?: string;
        opacity?: number | Property<number>;
        source?: string;
        type: "line";
        visible?: boolean;
        width?: number | Property<number>;
    }

    Hierarchy (View Summary)

    Index

    Properties

    A LAYOUT PropertyOnlyStep.

    butt

    can use butt, square, or round

    ex.

    { "cap": "round" }
    

    ex.

    { "cap": { "inputValue": { "key": "capType", "fallback": "round" } } }
    
    • inputValue: [See InputValue] access value in feature properties
    • dataCondition: [See DataCondition] filter based on feature property conditions
    • dataRange: [See DataRangeStep] filter based on feature property ranges
    • inputRange: [See InputRangeStep] filter based on map conditions like "zoom", "lon", "lat", "angle", or "pitch"
    • featureState: [See FeatureState] filter based on feature state
    • fallback: if all else fails, use this value. A value of Cap itself or pull from feature properties using Property
    color?: string | Property<string>

    A PAINT Property.

    "rgba(0, 0, 0, 1)"

    ex.

    { "color": "rgba(240, 2, 5, 1)" }
    

    ex.

    { "color": { "inputValue": { "key": "type", "fallback": "blue" } } }
    
    • inputValue: [See InputValue] access value in feature properties
    • dataCondition: [See DataCondition] filter based on feature property conditions
    • dataRange: [See DataRange] filter based on feature property ranges
    • inputRange: [See InputRange] filter based on map conditions like "zoom", "lon", "lat", "angle", or "pitch"
    • featureState: [See FeatureState] filter based on feature state
    • fallback: if all else fails, use this value. A value of string itself or pull from feature properties using Property
    cursor?: string

    the cursor to use when hovering over the line. Defaults to "default"

    dasharray?: [length: number, color: string][]

    The line will be dashed between visible and invisible.

    [] (empty array)

    ex.

    { "dasharray": [ [30, "#bbd3de"], [12, "rgba(255, 255, 255, 0)"] ] }
    
    filter?: Filter

    A filter function to filter out features from the source layer.

    example:

    "filter": { "key": "class", "comparator": "==", "value": "ocean" }
    

    another example:

    "filter": {
    "or": [
    { "key": "class", "comparator": "==", "value": "ocean" },
    { "key": "class", "comparator": "==", "value": "bay" }
    ]
    }

    another example:

    "filter": {
    "and": [
    { "key": "class", "comparator": "==", "value": "ocean" },
    { "key": "size", "comparator": "==", "value": "large" },
    { "key": "type", "comparator": "!=", "value": "pacific" }
    ]
    }
    gapwidth?: number | Property<number>

    A PAINT Property.

    0

    To improve render performance, you can provide a gap width to not draw a portion inside the line.

    NOTE: This feature is currently not supported.

    ex.

    { "gapWidth": 3 }
    

    ex.

    { "gapWidth": { "inputValue": { "key": "partitionSize", "fallback": 1.5 } } }
    
    • inputValue: [See InputValue] access value in feature properties
    • dataCondition: [See DataCondition] filter based on feature property conditions
    • dataRange: [See DataRange] filter based on feature property ranges
    • inputRange: [See InputRange] filter based on map conditions like "zoom", "lon", "lat", "angle", or "pitch"
    • featureState: [See FeatureState] filter based on feature state
    • fallback: if all else fails, use this value. A value of number itself or pull from feature properties using Property
    geoFilter?: ("line" | "poly")[]

    Filter the geometry types that will be drawn.

    [] (empty array)

    An empty array will supports both line & polygon geometry types.

    Ex. ["line"]: only draw lines

    interactive?: boolean

    if true, when hovering over the line, the property data will be sent to the UI via an Event. Defaults to false

    A LAYOUT PropertyOnlyStep.

    miter

    can use bevel, miter, or round

    ex.

    { "join": "round" }
    

    ex.

    { "join": { "inputValue": { "key": "joinType", "fallback": "round" } } }
    
    • inputValue: [See InputValue] access value in feature properties
    • dataCondition: [See DataCondition] filter based on feature property conditions
    • dataRange: [See DataRangeStep] filter based on feature property ranges
    • inputRange: [See InputRangeStep] filter based on map conditions like "zoom", "lon", "lat", "angle", or "pitch"
    • featureState: [See FeatureState] filter based on feature state
    • fallback: if all else fails, use this value. A value of Join itself or pull from feature properties using Property
    layer?: string

    The source's layer. Default for JSON data

    lch?: boolean

    Use LCH coloring instead of RGB. Useful for color changing when the new color is very different from the old one

    maxzoom?: number

    The maximum zoom level at which the layer will be visible

    metadata?: unknown

    Additional metadata. Used by style generators.

    minzoom?: number

    The minimum zoom level at which the layer will be visible

    name?: string

    The name of the layer - useful for sorting a layer on insert or for removal

    opacity?: number | Property<number>

    A PAINT Property.

    1

    ex.

    { "opacity": 0.5 }
    

    ex.

    { "opacity": { "inputValue": { "key": "opacity", "fallback": 1 } } }
    
    • inputValue: [See InputValue] access value in feature properties
    • dataCondition: [See DataCondition] filter based on feature property conditions
    • dataRange: [See DataRange] filter based on feature property ranges
    • inputRange: [See InputRange] filter based on map conditions like "zoom", "lon", "lat", "angle", or "pitch"
    • featureState: [See FeatureState] filter based on feature state
    • fallback: if all else fails, use this value. A value of number itself or pull from feature properties using Property
    source?: string

    The source used to generate the layer

    type: "line"

    Line Style Guide

    [See LayerStyleBase]

    • name: the name of the layer, useful for sorting a layer on insert or for removal
    • source: the name of the source whose data this layer will use
    • layer: the source's layer. Defaults to "default" for JSON data
    • minzoom: the minimum zoom level at which the layer will be visible
    • maxzoom: the maximum zoom level at which the layer will be visible
    • filter: [See Filter] a filter function to filter out features from the source layer
    • lch: use LCH coloring instead of RGB. Useful for color changing when the new color is very different from the old one
    • visible: whether the layer is visible or not
    • metadata: additional metadata. Used by style generators
    • color: Color of the line. Input either a string pull out the value using a Property.
    • opacity: the opacity of the line. Choose between [0, 1], or pull out the value using a Property.
    • width: the width of the line in pixels
    • gapwidth: split the line into two segments to reduce rendering artifacts
    • cap: [See Cap] the cap of the line. Either butt, square, or round
    • join: [See Join] the joiner used for the line. Either bevel, miter, or round
    • dasharray: A sequence of lengths and gaps that describe the pattern of dashes and gaps used to draw the line. Written as Array<[length: number, color: string]>
    • geoFilter: [See GeoFilter] filter the geometry types that will be drawn. Options are point, line, poly.
    • interactive: boolean flag. If true, when hovering over the line, the property data will be sent to the UI via an Event
    • cursor: [See Cursor] the cursor to use when hovering over the line
    visible?: boolean

    Whether the layer is visible or not

    width?: number | Property<number>

    A PAINT Property.

    1

    ex.

    { "width": 5 }
    

    ex.

    { "width": { "inputValue": { "key": "roadWidth", "fallback": 3.5 } } }
    
    • inputValue: [See InputValue] access value in feature properties
    • dataCondition: [See DataCondition] filter based on feature property conditions
    • dataRange: [See DataRange] filter based on feature property ranges
    • inputRange: [See InputRange] filter based on map conditions like "zoom", "lon", "lat", "angle", or "pitch"
    • featureState: [See FeatureState] filter based on feature state
    • fallback: if all else fails, use this value. A value of number itself or pull from feature properties using Property