LineStyle
interface LineStyle {
borderColor?: StyleExpress;
borderCovered?: boolean;
borderMask?: boolean;
borderWeight?: number | StyleExpress;
dashArray?: number[] | StyleExpress;
height?: number | StyleExpress;
linksLine?: boolean;
marginLength?: number;
sequence?: boolean;
strokeColor?: StyleExpress;
strokeColorControl?: (line: number, segment: number) => string;
strokeLineCap?: StyleExpress;
strokeLineJoin?: StyleExpress;
strokeOpacity?: number | StyleExpress;
strokeStyle?: StyleExpress;
strokeTextureHeight?: number | StyleExpress;
strokeTextureUrl?: StyleExpress;
strokeTextureWidth?: number | StyleExpress;
strokeWeight?: number | StyleExpress;
traceColor?: [number, number, number];
traceControl?: (line: number[]) => number[];
traceDisappear?: boolean;
traceStart?: boolean;
}
borderColor?: StyleExpress;
borderCovered?: boolean;
borderMask?: boolean;
borderWeight?: number | StyleExpress;
dashArray?: number[] | StyleExpress;
height?: number | StyleExpress;
linksLine?: boolean;
marginLength?: number;
sequence?: boolean;
strokeColor?: StyleExpress;
strokeColorControl?: (line: number, segment: number) => string;
strokeLineCap?: StyleExpress;
strokeLineJoin?: StyleExpress;
strokeOpacity?: number | StyleExpress;
strokeStyle?: StyleExpress;
strokeTextureHeight?: number | StyleExpress;
strokeTextureUrl?: StyleExpress;
strokeTextureWidth?: number | StyleExpress;
strokeWeight?: number | StyleExpress;
traceColor?: [number, number, number];
traceControl?: (line: number[]) => number[];
traceDisappear?: boolean;
traceStart?: boolean;
}
属性
描边颜色,默认值:'rgba(27, 142, 236, 1)'
是否描边覆盖填充。true 会出现描边被线填充覆盖现象;false 不会压盖但不允许使用图像纹理模式,默认值:true
是否受内部填充区域掩膜,如果存在 borderWeight 小于 0 则自动切换 false,默认值:true
描边宽度,单位像素,默认值:0
虚线设置,实线部分和间隙部分长度数组,默认值:[8, 4]
线图层高度,默认值:0
MultiLineString 是否以多段线形式组成一条线,可以通过 strokeColorControl 设置每段的颜色,默认值:false
间隔距离,单位像素,默认值:16
是否采用间隔填充纹理,默认值:false
线颜色,默认值:'rgba(25, 25, 250, 1)'
输入参数是第几条路线、第几段,输出是颜色字符串
线端头类型,可选 'round'、'butt'、'square',默认值:'square'
线连接处类型,可选 'miter'、'round'、'bevel',默认值:'round'
线透明度,取值范围0 - 1,默认值:1
线类型,可选 'solid'、'dashed'、'dotted',默认值:'solid'
填充纹理图片高度,需要是2的n次方
填充纹理图片地址。图片需要是竖向表达,在填充时会自动横向处理
填充纹理图片宽度,需要是2的n次方
线宽度,单位像素,默认值:2
痕迹颜色(RGB值,取值范围0-255)
痕迹距离设置函数,输入参数是路线数组,输出是距起点的痕迹长度数组,单位米
痕迹是否使用消失模式。false 代表使用 traceControl 设置颜色,默认值:false
是否从起点开始处理痕迹,否则从终点开始处理,默认值:true
线样式配置