Interface HeatmapOptions

热力图参数

interface HeatmapOptions {
    boundScale?: number;
    bounds?: [[number, number], [number, number]];
    canvasSize?: number;
    clipPolygon?: [number, number][];
    data: {
        point: [number, number];
        value: number;
    }[];
    heightRatio?: number;
    max?: number;
    min?: number;
    mode3D?: boolean;
    segment?: number;
    style?: {
        backgroundColor?: string;
        blur?: number;
        gradient?: {
            [key: string]: string;
        };
        maxOpacity?: number;
        minOpacity?: number;
        opacity?: number;
        radius?: number;
        scaleRadius?: boolean;
    };
}

Properties

boundScale?: number
bounds?: [[number, number], [number, number]]

边界范围 [[minx, minz],[maxx, maxz]]

canvasSize?: number

画布大小

clipPolygon?: [number, number][]

裁剪多边形

data: {
    point: [number, number];
    value: number;
}[]

数据项

Type declaration

  • point: [number, number]

    点坐标 x,z

  • value: number

heightRatio?: number

3d热力图时高度比例 默认10

max?: number
min?: number
mode3D?: boolean

3d热力图模式

segment?: number

3d热力图平面分割数 默认50

style?: {
    backgroundColor?: string;
    blur?: number;
    gradient?: {
        [key: string]: string;
    };
    maxOpacity?: number;
    minOpacity?: number;
    opacity?: number;
    radius?: number;
    scaleRadius?: boolean;
}

样式

Type declaration

  • Optional backgroundColor?: string

    A background color string in form of hexcode, color name, or rgb(a)

  • Optional blur?: number

    The blur factor that will be applied to all datapoints. The higher the blur factor is, the smoother the gradients will be Default value: 0.85

  • Optional gradient?: {
        [key: string]: string;
    }

    An object that represents the gradient. Syntax: {[key: number in range [0,1]]: color} Default value: { 0.25: "rgb(0,0,255)", 0.55: "rgb(0,255,0)", 0.85: "yellow", 1.0: "rgb(255,0,0)"}

    • [key: string]: string
  • Optional maxOpacity?: number

    The maximal opacity the highest value in the heatmap will have. (will be overridden if opacity set) Default value: 0.6

  • Optional minOpacity?: number

    The minimum opacity the lowest value in the heatmap will have (will be overridden if opacity set)

  • Optional opacity?: number

    A global opacity for the whole heatmap. This overrides maxOpacity and minOpacity if set Default value: 0.6

  • Optional radius?: number

    The radius each datapoint will have (if not specified on the datapoint itself) Default value: 40

  • Optional scaleRadius?: boolean

    Scales the radius based on map zoom.