# Namespace: default

# Table of contents

# Namespaces

# Enumerations

# Classes

# Interfaces

# Type aliases

# Variables

# Functions

# Type aliases

# AnimateMarkerType

Ƭ AnimateMarkerType: "breathingAperture" | "rotatingAperture" | "haloRing" | "diffusedAperture" | "rotatingTextBorder" | "fluorescence"

breathingAperture 呼吸的光圈. rotatingAperture 旋转的光环 haloRing 发光的光环 diffusedAperture 扩散的点 rotatingTextBorder 旋转的文本框 fluorescence 荧光点


# AnimationOps

Ƭ AnimationOps<V>: PlaybackOptions<V> & DecayOptions | KeyframeOptions<V> | SpringOptions

# Type parameters
Name
V

# BackgroundLayerSpecification

Ƭ BackgroundLayerSpecification: object

# Type declaration
Name Type
id string
layout? object
layout.visibility? "visible" | "none"
maxzoom? number
metadata? unknown
minzoom? number
paint? object
paint.background-color? PropertyValueSpecificationEx<ColorSpecification>
paint.background-opacity? PropertyValueSpecificationEx<number>
paint.background-pattern? PropertyValueSpecificationEx<ResolvedImageSpecification>
type "background"

# CameraFunctionSpecificationEx

Ƭ CameraFunctionSpecificationEx<T>: { stops: [number, T][] ; type: "exponential" } | { stops: [number, T][] ; type: "interval" }

# Type parameters
Name
T

# CircleLayerSpecification

Ƭ CircleLayerSpecification: object

# Type declaration
Name Type
filter? FilterSpecification
id string
layout? object
layout.circle-sort-key? DataDrivenPropertyValueSpecification<number>
layout.visibility? "visible" | "none"
maxzoom? number
metadata? unknown
minzoom? number
paint? object
paint.circle-blur? DataDrivenPropertyValueSpecification<number>
paint.circle-color? DataDrivenPropertyValueSpecification<ColorSpecification>
paint.circle-opacity? DataDrivenPropertyValueSpecification<number>
paint.circle-pitch-alignment? PropertyValueSpecificationEx<"map" | "viewport">
paint.circle-pitch-scale? PropertyValueSpecificationEx<"map" | "viewport">
paint.circle-radius? DataDrivenPropertyValueSpecification<number>
paint.circle-stroke-color? DataDrivenPropertyValueSpecification<ColorSpecification>
paint.circle-stroke-opacity? DataDrivenPropertyValueSpecification<number>
paint.circle-stroke-width? DataDrivenPropertyValueSpecification<number>
paint.circle-translate? PropertyValueSpecificationEx<[number, number]>
paint.circle-translate-anchor? PropertyValueSpecificationEx<"map" | "viewport">
source string
source-layer? string
type "circle"

# CircleLayerStyleProp

Ƭ CircleLayerStyleProp: object

# Type declaration
Name Type
circleBlur? DataDrivenPropertyValueSpecification<number>
circleColor? DataDrivenPropertyValueSpecification<ColorSpecification>
circleOpacity? DataDrivenPropertyValueSpecification<number>
circlePitchAlignment? PropertyValueSpecificationEx<"map" | "viewport">
circlePitchScale? PropertyValueSpecificationEx<"map" | "viewport">
circleRadius? DataDrivenPropertyValueSpecification<number>
circleSortKey? DataDrivenPropertyValueSpecification<number>
circleStrokeColor? DataDrivenPropertyValueSpecification<ColorSpecification>
circleStrokeOpacity? DataDrivenPropertyValueSpecification<number>
circleStrokeWidth? DataDrivenPropertyValueSpecification<number>
circleTranslate? PropertyValueSpecificationEx<[number, number]>
circleTranslateAnchor? PropertyValueSpecificationEx<"map" | "viewport">
filter? FilterSpecification
maxzoom? number
metadata? unknown
minzoom? number
source? string
sourceLayer? string
visibility? "visible" | "none"

# ColorSpecification

Ƭ ColorSpecification: string


# CompositeFunctionSpecification

Ƭ CompositeFunctionSpecification<T>: { default?: T ; property: string ; stops: [{ value: number ; zoom: number }, T][] ; type: "exponential" } | { default?: T ; property: string ; stops: [{ value: number ; zoom: number }, T][] ; type: "interval" } | { default?: T ; property: string ; stops: [{ value: string | number | boolean ; zoom: number }, T][] ; type: "categorical" }

# Type parameters
Name
T

# DataDrivenPropertyValueSpecification

Ƭ DataDrivenPropertyValueSpecification<T>: T | CameraFunctionSpecificationEx<T> | SourceFunctionSpecification<T> | CompositeFunctionSpecification<T> | ExpressionSpecificationEx

# Type parameters
Name
T

# Driver

Ƭ Driver: (update: Update) => DriverControls

# Type declaration

▸ (update: Update): DriverControls

# Parameters
Name Type
update Update

Returns: DriverControls


# Easing

Ƭ Easing: (v: number) => number

# Type declaration

▸ (v: number): number

# Parameters
Name Type
v number

Returns: number


# EasingModifier

Ƭ EasingModifier: (easing: Easing) => Easing

# Type declaration

▸ (easing: Easing): Easing

# Parameters
Name Type
easing Easing

Returns: Easing


# ExpressionSpecificationEx

Ƭ ExpressionSpecificationEx: unknown[]


# FillExtrusionLayerSpecification

Ƭ FillExtrusionLayerSpecification: object

# Type declaration
Name Type
filter? FilterSpecification
id string
layout? object
layout.visibility? "visible" | "none"
maxzoom? number
metadata? unknown
minzoom? number
paint? object
paint.fill-extrusion-base? DataDrivenPropertyValueSpecification<number>
paint.fill-extrusion-color? DataDrivenPropertyValueSpecification<ColorSpecification>
paint.fill-extrusion-height? DataDrivenPropertyValueSpecification<number>
paint.fill-extrusion-opacity? PropertyValueSpecificationEx<number>
paint.fill-extrusion-pattern? DataDrivenPropertyValueSpecification<ResolvedImageSpecification>
paint.fill-extrusion-translate? PropertyValueSpecificationEx<[number, number]>
paint.fill-extrusion-translate-anchor? PropertyValueSpecificationEx<"map" | "viewport">
paint.fill-extrusion-vertical-gradient? PropertyValueSpecificationEx<boolean>
source string
source-layer? string
type "fill-extrusion"

# FillExtrusionLayerStyleProp

Ƭ FillExtrusionLayerStyleProp: object

# Type declaration
Name Type
fillExtrusionBase? DataDrivenPropertyValueSpecification<number>
fillExtrusionColor? DataDrivenPropertyValueSpecification<ColorSpecification>
fillExtrusionHeight? DataDrivenPropertyValueSpecification<number>
fillExtrusionOpacity? PropertyValueSpecificationEx<number>
fillExtrusionPattern? DataDrivenPropertyValueSpecification<ResolvedImageSpecification>
fillExtrusionTranslate? PropertyValueSpecificationEx<[number, number]>
fillExtrusionTranslateAnchor? PropertyValueSpecificationEx<"map" | "viewport">
fillExtrusionVerticalGradient? PropertyValueSpecificationEx<boolean>
filter? FilterSpecification
maxzoom? number
metadata? unknown
minzoom? number
source? string
sourceLayer? string
visibility? "visible" | "none"

# FillLayerSpecification

Ƭ FillLayerSpecification: object

# Type declaration
Name Type
filter? FilterSpecification
id string
layout? object
layout.fill-sort-key? DataDrivenPropertyValueSpecification<number>
layout.visibility? "visible" | "none"
maxzoom? number
metadata? unknown
minzoom? number
paint? object
paint.fill-antialias? PropertyValueSpecificationEx<boolean>
paint.fill-color? DataDrivenPropertyValueSpecification<ColorSpecification>
paint.fill-opacity? DataDrivenPropertyValueSpecification<number>
paint.fill-outline-color? DataDrivenPropertyValueSpecification<ColorSpecification>
paint.fill-pattern? DataDrivenPropertyValueSpecification<ResolvedImageSpecification>
paint.fill-translate? PropertyValueSpecificationEx<[number, number]>
paint.fill-translate-anchor? PropertyValueSpecificationEx<"map" | "viewport">
source string
source-layer? string
type "fill"

# FillLayerStyleProp

Ƭ FillLayerStyleProp: object

# Type declaration
Name Type
fillAntialias? PropertyValueSpecificationEx<boolean>
fillColor? DataDrivenPropertyValueSpecification<ColorSpecification>
fillOpacity? DataDrivenPropertyValueSpecification<number>
fillOutlineColor? DataDrivenPropertyValueSpecification<ColorSpecification>
fillPattern? DataDrivenPropertyValueSpecification<ResolvedImageSpecification>
fillSortKey? DataDrivenPropertyValueSpecification<number>
fillTranslate? PropertyValueSpecificationEx<[number, number]>
fillTranslateAnchor? PropertyValueSpecificationEx<"map" | "viewport">
filter? FilterSpecification
maxzoom? number
metadata? unknown
minzoom? number
source? string
sourceLayer? string
visibility? "visible" | "none"

# FilterSpecification

Ƭ FilterSpecification: ["has", string] | ["!has", string] | ["==", string, string | number | boolean] | ["!=", string, string | number | boolean] | [">", string, string | number | boolean] | [">=", string, string | number | boolean] | ["<", string, string | number | boolean] | ["<=", string, string | number | boolean] | (string | FilterSpecification)[]


# FogSpecification

Ƭ FogSpecification: object

# Type declaration
Name Type
color? PropertyValueSpecificationEx<ColorSpecification>
horizon-blend? PropertyValueSpecificationEx<number>
range? PropertyValueSpecificationEx<[number, number]>

# FormattedSpecification

Ƭ FormattedSpecification: string


# GeoJSONSourceSpecification

Ƭ GeoJSONSourceSpecification: object

# Type declaration
Name Type
attribution? string
buffer? number
cluster? boolean
clusterMaxZoom? number
clusterMinPoints? number
clusterProperties? unknown
clusterRadius? number
data? unknown
filter? unknown
generateId? boolean
lineMetrics? boolean
maxzoom? number
promoteId? PromoteIdSpecificationEx
tolerance? number
type "geojson"

# GeoPointLike

Ƭ GeoPointLike: [number, number] | [number, number, number] | GeoPoint | { x: number ; y: number ; z?: number } | { lat: number ; lng: number } | { lat: number ; lon: number }


# HeatmapLayerSpecification

Ƭ HeatmapLayerSpecification: object

# Type declaration
Name Type
filter? FilterSpecification
id string
layout? object
layout.visibility? "visible" | "none"
maxzoom? number
metadata? unknown
minzoom? number
paint? object
paint.heatmap-color? ExpressionSpecificationEx
paint.heatmap-intensity? PropertyValueSpecificationEx<number>
paint.heatmap-opacity? PropertyValueSpecificationEx<number>
paint.heatmap-radius? DataDrivenPropertyValueSpecification<number>
paint.heatmap-weight? DataDrivenPropertyValueSpecification<number>
source string
source-layer? string
type "heatmap"

# HeatmapLayerStyleProp

Ƭ HeatmapLayerStyleProp: object

# Type declaration
Name Type
filter? FilterSpecification
heatmapColor? ExpressionSpecificationEx
heatmapIntensity? PropertyValueSpecificationEx<number>
heatmapOpacity? PropertyValueSpecificationEx<number>
heatmapRadius? DataDrivenPropertyValueSpecification<number>
heatmapWeight? DataDrivenPropertyValueSpecification<number>
maxzoom? number
metadata? unknown
minzoom? number
source? string
sourceLayer? string
visibility? "visible" | "none"

# HillshadeLayerSpecification

Ƭ HillshadeLayerSpecification: object

# Type declaration
Name Type
filter? FilterSpecification
id string
layout? object
layout.visibility? "visible" | "none"
maxzoom? number
metadata? unknown
minzoom? number
paint? object
paint.hillshade-accent-color? PropertyValueSpecificationEx<ColorSpecification>
paint.hillshade-exaggeration? PropertyValueSpecificationEx<number>
paint.hillshade-highlight-color? PropertyValueSpecificationEx<ColorSpecification>
paint.hillshade-illumination-anchor? PropertyValueSpecificationEx<"map" | "viewport">
paint.hillshade-illumination-direction? PropertyValueSpecificationEx<number>
paint.hillshade-shadow-color? PropertyValueSpecificationEx<ColorSpecification>
source string
source-layer? string
type "hillshade"

# HillshadeLayerStyleProp

Ƭ HillshadeLayerStyleProp: object

# Type declaration
Name Type
filter? FilterSpecification
hillshadeAccentColor? PropertyValueSpecificationEx<ColorSpecification>
hillshadeExaggeration? PropertyValueSpecificationEx<number>
hillshadeHighlightColor? PropertyValueSpecificationEx<ColorSpecification>
hillshadeIlluminationAnchor? PropertyValueSpecificationEx<"map" | "viewport">
hillshadeIlluminationDirection? PropertyValueSpecificationEx<number>
hillshadeShadowColor? PropertyValueSpecificationEx<ColorSpecification>
maxzoom? number
metadata? unknown
minzoom? number
source? string
sourceLayer? string
visibility? "visible" | "none"

# IDbPoint

Ƭ IDbPoint: [number, number, number?]

坐标类型接口


# ImageSourceSpecification

Ƭ ImageSourceSpecification: object

# Type declaration
Name Type
coordinates [[number, number], [number, number], [number, number], [number, number]]
type "image"
url string

# LayerCallback

Ƭ LayerCallback: (arg0: {}) => void

# Type declaration

▸ (arg0: {}): void

# Parameters
Name Type
arg0 object

Returns: void


# LayerRef

Ƭ LayerRef: string | string[] | RegExp | (arg0: LayerSpecification) => boolean


# LayerRefFunc

Ƭ LayerRefFunc: (arg0: LayerRef, ...args: any[]) => void

# Type declaration

▸ (arg0: LayerRef, ...args: any[]): void

# Parameters
Name Type
arg0 LayerRef
...args any[]

Returns: void


# LayerRefFunc0

Ƭ LayerRefFunc0: (arg0: LayerRef) => void

# Type declaration

▸ (arg0: LayerRef): void

# Parameters
Name Type
arg0 LayerRef

Returns: void


# LayerRefFunc1

Ƭ LayerRefFunc1<T1>: (arg0: LayerRef, arg1: T1) => void

# Type parameters
Name
T1
# Type declaration

▸ (arg0: LayerRef, arg1: T1): void

# Parameters
Name Type
arg0 LayerRef
arg1 T1

Returns: void


# LayerRefFunc2

Ƭ LayerRefFunc2<T1, T2>: (arg0: LayerRef, arg1: T1, arg2: T2) => void

# Type parameters
Name
T1
T2
# Type declaration

▸ (arg0: LayerRef, arg1: T1, arg2: T2): void

# Parameters
Name Type
arg0 LayerRef
arg1 T1
arg2 T2

Returns: void


# LayerRefFunc3

Ƭ LayerRefFunc3<T1, T2, T3>: (arg0: LayerRef, arg1: T1, arg2: T2, arg3: T3) => void

# Type parameters
Name
T1
T2
T3
# Type declaration

▸ (arg0: LayerRef, arg1: T1, arg2: T2, arg3: T3): void

# Parameters
Name Type
arg0 LayerRef
arg1 T1
arg2 T2
arg3 T3

Returns: void


# LayerSpecification

Ƭ LayerSpecification: FillLayerSpecification | LineLayerSpecification | SymbolLayerSpecification | CircleLayerSpecification | HeatmapLayerSpecification | FillExtrusionLayerSpecification | RasterLayerSpecification | HillshadeLayerSpecification | BackgroundLayerSpecification | SkyLayerSpecification


# LightSpecification

Ƭ LightSpecification: object

# Type declaration
Name Type
anchor? PropertyValueSpecificationEx<"map" | "viewport">
color? PropertyValueSpecificationEx<ColorSpecification>
intensity? PropertyValueSpecificationEx<number>
position? PropertyValueSpecificationEx<[number, number, number]>

# LineLayerSpecification

Ƭ LineLayerSpecification: object

# Type declaration
Name Type
filter? FilterSpecification
id string
layout? object
layout.line-cap? DataDrivenPropertyValueSpecification<"butt" | "round" | "square">
layout.line-join? DataDrivenPropertyValueSpecification<"bevel" | "round" | "miter">
layout.line-miter-limit? PropertyValueSpecificationEx<number>
layout.line-round-limit? PropertyValueSpecificationEx<number>
layout.line-sort-key? DataDrivenPropertyValueSpecification<number>
layout.visibility? "visible" | "none"
maxzoom? number
metadata? unknown
minzoom? number
paint? object
paint.line-blur? DataDrivenPropertyValueSpecification<number>
paint.line-color? DataDrivenPropertyValueSpecification<ColorSpecification>
paint.line-dasharray? DataDrivenPropertyValueSpecification<number[]>
paint.line-gap-width? DataDrivenPropertyValueSpecification<number>
paint.line-gradient? ExpressionSpecificationEx
paint.line-offset? DataDrivenPropertyValueSpecification<number>
paint.line-opacity? DataDrivenPropertyValueSpecification<number>
paint.line-pattern? DataDrivenPropertyValueSpecification<ResolvedImageSpecification>
paint.line-translate? PropertyValueSpecificationEx<[number, number]>
paint.line-translate-anchor? PropertyValueSpecificationEx<"map" | "viewport">
paint.line-width? DataDrivenPropertyValueSpecification<number>
source string
source-layer? string
type "line"

# LineLayerStyleProp

Ƭ LineLayerStyleProp: object

# Type declaration
Name Type
filter? FilterSpecification
lineBlur? DataDrivenPropertyValueSpecification<number>
lineCap? DataDrivenPropertyValueSpecification<"butt" | "round" | "square">
lineColor? DataDrivenPropertyValueSpecification<ColorSpecification>
lineDasharray? DataDrivenPropertyValueSpecification<number[]>
lineGapWidth? DataDrivenPropertyValueSpecification<number>
lineGradient? ExpressionSpecificationEx
lineJoin? DataDrivenPropertyValueSpecification<"bevel" | "round" | "miter">
lineMiterMimit? PropertyValueSpecificationEx<number>
lineOffset? DataDrivenPropertyValueSpecification<number>
lineOpacity? DataDrivenPropertyValueSpecification<number>
linePattern? DataDrivenPropertyValueSpecification<ResolvedImageSpecification>
lineRoundLimit? PropertyValueSpecificationEx<number>
lineSortKey? DataDrivenPropertyValueSpecification<number>
lineTranslate? PropertyValueSpecificationEx<[number, number]>
lineTranslateAnchor? PropertyValueSpecificationEx<"map" | "viewport">
lineWidth? DataDrivenPropertyValueSpecification<number>
maxzoom? number
metadata? unknown
minzoom? number
source? string
sourceLayer? string
visibility? "visible" | "none"

# OffHandler

Ƭ OffHandler: () => void

# Type declaration

▸ (): void

Returns: void


# PromoteIdSpecificationEx

Ƭ PromoteIdSpecificationEx: Record<string, string> | string


# PropName

Ƭ PropName: string


# PropValue

Ƭ PropValue: string | any[] | null | number | {}


# PropertyValueSpecificationEx

Ƭ PropertyValueSpecificationEx<T>: T | CameraFunctionSpecificationEx<T> | ExpressionSpecificationEx

# Type parameters
Name
T

# RasterDEMSourceSpecification

Ƭ RasterDEMSourceSpecification: object

# Type declaration
Name Type
attribution? string
bounds? [number, number, number, number]
encoding? "terrarium" | "mapbox"
maxzoom? number
minzoom? number
tileSize? number
tiles? string[]
type "raster-dem"
url? string
volatile? boolean

# RasterLayerSpecification

Ƭ RasterLayerSpecification: object

# Type declaration
Name Type
filter? FilterSpecification
id string
layout? object
layout.visibility? "visible" | "none"
maxzoom? number
metadata? unknown
minzoom? number
paint? object
paint.raster-brightness-max? PropertyValueSpecificationEx<number>
paint.raster-brightness-min? PropertyValueSpecificationEx<number>
paint.raster-contrast? PropertyValueSpecificationEx<number>
paint.raster-fade-duration? PropertyValueSpecificationEx<number>
paint.raster-hue-rotate? PropertyValueSpecificationEx<number>
paint.raster-opacity? PropertyValueSpecificationEx<number>
paint.raster-resampling? PropertyValueSpecificationEx<"linear" | "nearest">
paint.raster-saturation? PropertyValueSpecificationEx<number>
source string
source-layer? string
type "raster"

# RasterLayerStyleProp

Ƭ RasterLayerStyleProp: object

# Type declaration
Name Type
filter? FilterSpecification
maxzoom? number
metadata? unknown
minzoom? number
rasterBrightnessMax? PropertyValueSpecificationEx<number>
rasterBrightnessMin? PropertyValueSpecificationEx<number>
rasterContrast? PropertyValueSpecificationEx<number>
rasterFadeDuration? PropertyValueSpecificationEx<number>
rasterHueRotate? PropertyValueSpecificationEx<number>
rasterOpacity? PropertyValueSpecificationEx<number>
rasterResampling? PropertyValueSpecificationEx<"linear" | "nearest">
rasterSaturation? PropertyValueSpecificationEx<number>
source? string
sourceLayer? string
visibility? "visible" | "none"

# RasterSourceSpecification

Ƭ RasterSourceSpecification: object

# Type declaration
Name Type
attribution? string
bounds? [number, number, number, number]
maxzoom? number
minzoom? number
scheme? "xyz" | "tms"
tileSize? number
tiles? string[]
type "raster"
url? string
volatile? boolean

# ResolvedImageSpecification

Ƭ ResolvedImageSpecification: string


# SkyLayerSpecification

Ƭ SkyLayerSpecification: object

# Type declaration
Name Type
id string
layout? object
layout.visibility? "visible" | "none"
maxzoom? number
metadata? unknown
minzoom? number
paint? object
paint.sky-atmosphere-color? ColorSpecification
paint.sky-atmosphere-halo-color? ColorSpecification
paint.sky-atmosphere-sun? PropertyValueSpecificationEx<[number, number]>
paint.sky-atmosphere-sun-intensity? number
paint.sky-gradient? ExpressionSpecificationEx
paint.sky-gradient-center? PropertyValueSpecificationEx<[number, number]>
paint.sky-gradient-radius? PropertyValueSpecificationEx<number>
paint.sky-opacity? PropertyValueSpecificationEx<number>
paint.sky-type? PropertyValueSpecificationEx<"gradient" | "atmosphere">
type "sky"

# SourceBoundUtils

Ƭ SourceBoundUtils: MapGlUtils


# SourceFunctionSpecification

Ƭ SourceFunctionSpecification<T>: { default?: T ; property: string ; stops: [number, T][] ; type: "exponential" } | { default?: T ; property: string ; stops: [number, T][] ; type: "interval" } | { default?: T ; property: string ; stops: [string | number | boolean, T][] ; type: "categorical" } | { default?: T ; property: string ; type: "identity" }

# Type parameters
Name
T

# SourceOrData

Ƭ SourceOrData: SourceSpecification | string | GeoJsonGeomertry


# SourceRef

Ƭ SourceRef: LayerRef


# SourceRefFunc0

Ƭ SourceRefFunc0: (arg0: SourceRef) => void

# Type declaration

▸ (arg0: SourceRef): void

# Parameters
Name Type
arg0 SourceRef

Returns: void


# SourceRefFunc1

Ƭ SourceRefFunc1<T1>: (arg0: SourceRef, arg1: T1) => void

# Type parameters
Name
T1
# Type declaration

▸ (arg0: SourceRef, arg1: T1): void

# Parameters
Name Type
arg0 SourceRef
arg1 T1

Returns: void


# SourceRefFunc2

Ƭ SourceRefFunc2<T1, T2>: (arg0: SourceRef, arg1: T1, arg2: T2) => void

# Type parameters
Name
T1
T2
# Type declaration

▸ (arg0: SourceRef, arg1: T1, arg2: T2): void

# Parameters
Name Type
arg0 SourceRef
arg1 T1
arg2 T2

Returns: void


# SourceRefFunc3

Ƭ SourceRefFunc3<T1, T2, T3>: (arg0: SourceRef, arg1: T1, arg2: T2, arg3: T3) => void

# Type parameters
Name
T1
T2
T3
# Type declaration

▸ (arg0: SourceRef, arg1: T1, arg2: T2, arg3: T3): void

# Parameters
Name Type
arg0 SourceRef
arg1 T1
arg2 T2
arg3 T3

Returns: void


# SourceSpecification

Ƭ SourceSpecification: VectorSourceSpecification | RasterSourceSpecification | RasterDEMSourceSpecification | GeoJSONSourceSpecification | VideoSourceSpecification | ImageSourceSpecification


# StyleSpecification

Ƭ StyleSpecification: object

# Type declaration
Name Type
bearing? number
center? number[]
fog? FogSpecification
glyphs? string
layers LayerSpecification[]
light? LightSpecification
metadata? unknown
name? string
pitch? number
sources Record<string, SourceSpecification>
sprite? string
terrain? TerrainSpecificationEx
transition? TransitionSpecification
version 8
zoom? number

# SymbolLayerSpecification

Ƭ SymbolLayerSpecification: object

# Type declaration
Name Type
filter? FilterSpecification
id string
layout? object
layout.icon-allow-overlap? PropertyValueSpecificationEx<boolean>
layout.icon-anchor? DataDrivenPropertyValueSpecification<"center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right">
layout.icon-ignore-placement? PropertyValueSpecificationEx<boolean>
layout.icon-image? DataDrivenPropertyValueSpecification<ResolvedImageSpecification>
layout.icon-keep-upright? PropertyValueSpecificationEx<boolean>
layout.icon-offset? DataDrivenPropertyValueSpecification<[number, number]>
layout.icon-optional? PropertyValueSpecificationEx<boolean>
layout.icon-padding? PropertyValueSpecificationEx<number>
layout.icon-pitch-alignment? PropertyValueSpecificationEx<"map" | "viewport" | "auto">
layout.icon-rotate? DataDrivenPropertyValueSpecification<number>
layout.icon-rotation-alignment? PropertyValueSpecificationEx<"map" | "viewport" | "auto">
layout.icon-size? DataDrivenPropertyValueSpecification<number>
layout.icon-text-fit? PropertyValueSpecificationEx<"none" | "width" | "height" | "both">
layout.icon-text-fit-padding? PropertyValueSpecificationEx<[number, number, number, number]>
layout.symbol-avoid-edges? PropertyValueSpecificationEx<boolean>
layout.symbol-placement? PropertyValueSpecificationEx<"point" | "line" | "line-center">
layout.symbol-sort-key? DataDrivenPropertyValueSpecification<number>
layout.symbol-spacing? PropertyValueSpecificationEx<number>
layout.symbol-z-order? PropertyValueSpecificationEx<"auto" | "viewport-y" | "source">
layout.text-allow-overlap? PropertyValueSpecificationEx<boolean>
layout.text-anchor? DataDrivenPropertyValueSpecification<"center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right">
layout.text-field? DataDrivenPropertyValueSpecification<FormattedSpecification>
layout.text-font? DataDrivenPropertyValueSpecification<string[]>
layout.text-ignore-placement? PropertyValueSpecificationEx<boolean>
layout.text-justify? DataDrivenPropertyValueSpecification<"auto" | "left" | "center" | "right">
layout.text-keep-upright? PropertyValueSpecificationEx<boolean>
layout.text-letter-spacing? DataDrivenPropertyValueSpecification<number>
layout.text-line-height? DataDrivenPropertyValueSpecification<number>
layout.text-max-angle? PropertyValueSpecificationEx<number>
layout.text-max-width? DataDrivenPropertyValueSpecification<number>
layout.text-offset? DataDrivenPropertyValueSpecification<[number, number]>
layout.text-optional? PropertyValueSpecificationEx<boolean>
layout.text-padding? PropertyValueSpecificationEx<number>
layout.text-pitch-alignment? PropertyValueSpecificationEx<"map" | "viewport" | "auto">
layout.text-radial-offset? DataDrivenPropertyValueSpecification<number>
layout.text-rotate? DataDrivenPropertyValueSpecification<number>
layout.text-rotation-alignment? PropertyValueSpecificationEx<"map" | "viewport" | "auto">
layout.text-size? DataDrivenPropertyValueSpecification<number>
layout.text-transform? DataDrivenPropertyValueSpecification<"none" | "uppercase" | "lowercase">
layout.text-variable-anchor? PropertyValueSpecificationEx<("center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right")[]>
layout.text-writing-mode? PropertyValueSpecificationEx<("horizontal" | "vertical")[]>
layout.visibility? "visible" | "none"
maxzoom? number
metadata? unknown
minzoom? number
paint? object
paint.icon-color? DataDrivenPropertyValueSpecification<ColorSpecification>
paint.icon-halo-blur? DataDrivenPropertyValueSpecification<number>
paint.icon-halo-color? DataDrivenPropertyValueSpecification<ColorSpecification>
paint.icon-halo-width? DataDrivenPropertyValueSpecification<number>
paint.icon-opacity? DataDrivenPropertyValueSpecification<number>
paint.icon-translate? PropertyValueSpecificationEx<[number, number]>
paint.icon-translate-anchor? PropertyValueSpecificationEx<"map" | "viewport">
paint.text-color? DataDrivenPropertyValueSpecification<ColorSpecification>
paint.text-halo-blur? DataDrivenPropertyValueSpecification<number>
paint.text-halo-color? DataDrivenPropertyValueSpecification<ColorSpecification>
paint.text-halo-width? DataDrivenPropertyValueSpecification<number>
paint.text-opacity? DataDrivenPropertyValueSpecification<number>
paint.text-translate? PropertyValueSpecificationEx<[number, number]>
paint.text-translate-anchor? PropertyValueSpecificationEx<"map" | "viewport">
source string
source-layer? string
type "symbol"

# SymbolLayerStyleProp

Ƭ SymbolLayerStyleProp: object

# Type declaration
Name Type
filter? FilterSpecification
iconAllowOverlap? PropertyValueSpecificationEx<boolean>
iconAnchor? DataDrivenPropertyValueSpecification<"center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right">
iconColor? DataDrivenPropertyValueSpecification<ColorSpecification>
iconHaloBlur? DataDrivenPropertyValueSpecification<number>
iconHaloColor? DataDrivenPropertyValueSpecification<ColorSpecification>
iconHaloWidth? DataDrivenPropertyValueSpecification<number>
iconIgnorePlacement? PropertyValueSpecificationEx<boolean>
iconImage? DataDrivenPropertyValueSpecification<ResolvedImageSpecification>
iconKeepUpright? PropertyValueSpecificationEx<boolean>
iconOffset? DataDrivenPropertyValueSpecification<[number, number]>
iconOpacity? DataDrivenPropertyValueSpecification<number>
iconOptional? PropertyValueSpecificationEx<boolean>
iconPadding? PropertyValueSpecificationEx<number>
iconPitchAlignment? PropertyValueSpecificationEx<"map" | "viewport" | "auto">
iconRotate? DataDrivenPropertyValueSpecification<number>
iconRotationAlignment? PropertyValueSpecificationEx<"map" | "viewport" | "auto">
iconSize? DataDrivenPropertyValueSpecification<number>
iconTextFit? PropertyValueSpecificationEx<"none" | "width" | "height" | "both">
iconTextFitPadding? PropertyValueSpecificationEx<[number, number, number, number]>
iconTranslate? PropertyValueSpecificationEx<[number, number]>
iconTranslateAnchor? PropertyValueSpecificationEx<"map" | "viewport">
maxzoom? number
metadata? unknown
minzoom? number
source? string
sourceLayer? string
symbolAvoidEdges? PropertyValueSpecificationEx<boolean>
symbolPlacement? PropertyValueSpecificationEx<"point" | "line" | "line-center">
symbolSortKey? DataDrivenPropertyValueSpecification<number>
symbolSpacing? PropertyValueSpecificationEx<number>
symbolZOrder? PropertyValueSpecificationEx<"auto" | "viewport-y" | "source">
textAllowOverlap? PropertyValueSpecificationEx<boolean>
textAnchor? DataDrivenPropertyValueSpecification<"center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right">
textColor? DataDrivenPropertyValueSpecification<ColorSpecification>
textField? DataDrivenPropertyValueSpecification<FormattedSpecification>
textFont? DataDrivenPropertyValueSpecification<string[]>
textHaloBlur? DataDrivenPropertyValueSpecification<number>
textHaloColor? DataDrivenPropertyValueSpecification<ColorSpecification>
textHaloWidth? DataDrivenPropertyValueSpecification<number>
textIgnorePlacement? PropertyValueSpecificationEx<boolean>
textJustify? DataDrivenPropertyValueSpecification<"auto" | "left" | "center" | "right">
textKeepUpright? PropertyValueSpecificationEx<boolean>
textLetterSpacing? DataDrivenPropertyValueSpecification<number>
textLineHeight? DataDrivenPropertyValueSpecification<number>
textMaxAngle? PropertyValueSpecificationEx<number>
textMaxWidth? DataDrivenPropertyValueSpecification<number>
textOffset? DataDrivenPropertyValueSpecification<[number, number]>
textOpacity? DataDrivenPropertyValueSpecification<number>
textOptional? PropertyValueSpecificationEx<boolean>
textPadding? PropertyValueSpecificationEx<number>
textPitchAlignment? PropertyValueSpecificationEx<"map" | "viewport" | "auto">
textRadialOffset? DataDrivenPropertyValueSpecification<number>
textRotate? DataDrivenPropertyValueSpecification<number>
textRotationAlignment? PropertyValueSpecificationEx<"map" | "viewport" | "auto">
textSize? DataDrivenPropertyValueSpecification<number>
textTransform? DataDrivenPropertyValueSpecification<"none" | "uppercase" | "lowercase">
textTranslate? PropertyValueSpecificationEx<[number, number]>
textTranslateAnchor? PropertyValueSpecificationEx<"map" | "viewport">
textVariableAnchor? PropertyValueSpecificationEx<("center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right")[]>
textWritingMode? PropertyValueSpecificationEx<("horizontal" | "vertical")[]>
visibility? "visible" | "none"

# TerrainSpecificationEx

Ƭ TerrainSpecificationEx: object

# Type declaration
Name Type
exaggeration? PropertyValueSpecificationEx<number>
source string

# TransitionSpecification

Ƭ TransitionSpecification: object

# Type declaration
Name Type
delay? number
duration? number

# VectorSourceSpecification

Ƭ VectorSourceSpecification: object

# Type declaration
Name Type
attribution? string
bounds? [number, number, number, number]
maxzoom? number
minzoom? number
promoteId? PromoteIdSpecificationEx
scheme? "xyz" | "tms"
tiles? string[]
type "vector"
url? string
volatile? boolean

# VideoSourceSpecification

Ƭ VideoSourceSpecification: object

# Type declaration
Name Type
coordinates [[number, number], [number, number], [number, number], [number, number]]
type "video"
urls string[]

# mat2dtype

Ƭ mat2dtype: [number, number, number, number, number, number] | Float32Array


# mat2type

Ƭ mat2type: [number, number, number, number] | Float32Array


# mat3type

Ƭ mat3type: [number, number, number, number, number, number, number, number, number] | Float32Array


# mat4type

Ƭ mat4type: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number] | Float32Array


# quattype

Ƭ quattype: [number, number, number, number] | Float32Array


# vec2type

Ƭ vec2type: [number, number] | Float32Array


# vec3type

Ƭ vec3type: [number, number, number] | Float32Array


# vec4type

Ƭ vec4type: [number, number, number, number] | Float32Array

# Variables

# Draw

Const Draw: object

# Type declaration
Name Type Description
Tool (options?: IDrawOptions) => IDrawTool 工具类.
actionDraw (map: any, modename: string, options?: Record<string, any>) => any 绘制动作.
actionDrawCircle (map: any, options?: Record<string, any>) => any 绘制圆动作.
actionDrawLineSting (map: any, options?: Record<string, any>) => any 绘制线动作.
actionDrawPoint (map: any, options?: Record<string, any>) => any 绘制点动作.
actionDrawPolygon (map: any, options?: Record<string, any>) => any 绘制多边形动作.
actionDrawRectangle (map: any, options?: Record<string, any>) => any 绘制矩形动作.
actionDrawSlantRectangle (map: any, options?: Record<string, any>) => any 绘制斜矩形动作.
actionSelect (map: any, draw: any, options?: Record<string, any>) => any 选择实体. 如果只能选择一个实体,options选项请输入selectSingle为true
defaultOptions () => any 缺省配置项.
modes Record<string, any> 模式.

# EPSILON

Const EPSILON: 1e-8= 0.00000001


# EVENTS

Const EVENTS: object

# Type declaration
Name Type
ABORT string
ERROR string
LOAD string
LOAD_END string
LOAD_START string
PROGRESS string
READY_STATE_CHANGE string
TIMEOUT string

# METHODS

Const METHODS: Methods


# httpHelper

Const httpHelper: object

# Type declaration
Name Type
configure (opts: Partial<Config<unknown>>) => void
del (url: string, args?: Partial<Config<unknown>>) => Promise<any>
event object
event.ABORT string
event.ERROR string
event.LOAD string
event.LOAD_END string
event.LOAD_START string
event.PROGRESS string
event.READY_STATE_CHANGE string
event.TIMEOUT string
get (url: string, params?: Record<string, any>, args?: Partial<Config<unknown>>) => Promise<any>
methods Methods
options (url: string, args?: Partial<Config<unknown>>) => Promise<any>
patch (url: string, data: any, args?: Partial<Config<unknown>>) => Promise<any>
post (url: string, data: any, args?: Partial<Config<unknown>>) => Promise<any>
put (url: string, data: any, args?: Partial<Config<unknown>>) => Promise<any>
rqeust (args: Partial<Config<unknown>>) => Promise<any>

# transform

Const transform: object

# Type declaration
Name Type
CRSTypes typeof CRSTypes
EpsgCrsTypes typeof EpsgCrsTypes
convert <T>(input: T | string, crsFrom: (pt: GeoPoint) => GeoPoint | CRSTypes, crsTo?: CRSTypes) => T
getEpsgCode (coordinate: number | [number, number], crs?: EpsgCrsTypes, is3DegreeBelt?: boolean) => { crs: string ; epsg: string ; is3DegreeBelt: boolean ; proj: undefined | string }[]
getEpsgParam (crs: EpsgCrsTypes, lon?: number) => null | { epsg: string ; proj: string }

# Functions

# Graph

Graph(serialized?: Serialized): object

具有深度优先搜索和拓扑排序的图数据结构。

example var graph = Graph() .addEdge("s", "t", 10) .addEdge("s", "y", 5) .addEdge("s", "y", 4) .addEdge("t", "y", 2) .addEdge("y", "t", 3) .addEdge("t", "x", 1) .addEdge("y", "x", 9) .addEdge("y", "z", 2) .addEdge("x", "z", 4) .addEdge("z", "x", 6); var res = graph.shortestPath("s", "z")

# Parameters
Name Type
serialized? Serialized

Returns: object

Name Type
addEdge (u: NodeId, v: NodeId, weight?: EdgeWeight) => { addNode: (node: string) => ...; removeNode: (node: string) => ...; nodes: () => string[]; adjacent: (node: string) => string[]; addEdge: (u: string, v: string, weight?: number | undefined) => ...; ... 12 more ...; deserialize: (serialized: Serialized) => ...; }
addNode (node: NodeId) => { addNode: (node: string) => ...; removeNode: (node: string) => ...; nodes: () => string[]; adjacent: (node: string) => string[]; addEdge: (u: string, v: string, weight?: number | undefined) => ...; ... 12 more ...; deserialize: (serialized: Serialized) => ...; }
adjacent (node: NodeId) => NodeId[]
depthFirstSearch (sourceNodes?: NodeId[], includeSourceNodes: boolean, errorOnCycle: boolean) => string[]
deserialize (serialized: Serialized) => { addNode: (node: string) => ...; removeNode: (node: string) => ...; nodes: () => string[]; adjacent: (node: string) => string[]; addEdge: (u: string, v: string, weight?: number | undefined) => ...; ... 12 more ...; deserialize: (serialized: Serialized) => ...; }
getEdgeWeight (u: NodeId, v: NodeId) => EdgeWeight
hasCycle () => boolean
hasEdge (u: NodeId, v: NodeId) => boolean
indegree (node: NodeId) => number
lowestCommonAncestors (node1: NodeId, node2: NodeId) => string[]
nodes () => NodeId[]
outdegree (node: NodeId) => number
removeEdge (u: NodeId, v: NodeId) => { addNode: (node: string) => ...; removeNode: (node: string) => ...; nodes: () => string[]; adjacent: (node: string) => string[]; addEdge: (u: string, v: string, weight?: number | undefined) => ...; ... 12 more ...; deserialize: (serialized: Serialized) => ...; }
removeNode (node: NodeId) => { addNode: (node: string) => ...; removeNode: (node: string) => ...; nodes: () => string[]; adjacent: (node: string) => string[]; addEdge: (u: string, v: string, weight?: number | undefined) => ...; ... 12 more ...; deserialize: (serialized: Serialized) => ...; }
serialize () => Serialized
setEdgeWeight (u: NodeId, v: NodeId, weight: EdgeWeight) => { addNode: (node: string) => ...; removeNode: (node: string) => ...; nodes: () => string[]; adjacent: (node: string) => string[]; addEdge: (u: string, v: string, weight?: number | undefined) => ...; ... 12 more ...; deserialize: (serialized: Serialized) => ...; }
shortestPath (source: NodeId, destination: NodeId) => string[] & { weight?: number }
topologicalSort (sourceNodes?: NodeId[], includeSourceNodes: boolean) => string[]

# RandomID

RandomID(length?: number): string

生成随机ID

# Parameters
Name Type
length? number

Returns: string


# Scene

Scene(L7: any, map: Map, option?: object): object

L7图层,可参考https://l7.antv.vision/. 返回一个场景对象

# Parameters
Name Type Description
L7 any L7命名空间
map Map
option? object

Returns: object

Name Type
addControl (ctr: any) => void
addFontFace (fontFamily: string, fontPath: string) => void
addIconFont (name: string, fontUnicode: string) => void
addIconFontGlyphs (fontFamily: string, glyphs: any[]) => void
addIconFonts (options: string[][]) => void
addImage (id: string, img: any) => void
addLayer (layer: any) => void
addMarker (marker: any) => void
addMarkerLayer (layer: any) => void
addPopup (popup: any) => void
containerToLngLat (pixel: any) => any
destroy () => void
diasbleShaderPick () => void
enableShaderPick () => void
exportMap (type?: "png" | "jpg") => string
exportPng (type?: "png" | "jpg") => string
fitBounds (bound: any, options?: unknown) => void
getBounds () => any
getCenter (options?: any) => any
getContainer () => null | HTMLElement
getControlByName (name: string) => any
getLayer (id: string) => any
getLayerByName (name: string) => any
getLayers () => any[]
getMapCanvasContainer () => HTMLElement
getMapContainer () => null | HTMLElement
getMapService () => any
getMaxZoom () => number
getMinZoom () => number
getPitch () => number
getPointSizeRange () => Float32Array
getRotation () => number
getServiceContainer () => any
getSize () => [number, number]
getType () => string
getZoom () => number
hasImage (id: string) => boolean
lngLatToContainer (lnglat: any) => any
lngLatToPixel (lnglat: any) => any
off (type: string, handle: (...args: any[]) => void) => void
on (type: string, handle: (...args: any[]) => void) => void
once (type: string, handle: (...args: any[]) => void) => void
panBy (x: number, y: number) => void
panTo (p: any) => void
pixelToLngLat (pixel: any) => any
registerPostProcessingPass (constructor: (...args: any[]) => any, name: string) => void
registerRenderService (render: any) => void
removeAllLayer () => void
removeAllMakers () => void
removeControl (ctr: any) => void
removeImage (id: string) => void
removeLayer (layer: any, parentLayer?: any) => void
removeMarkerLayer (layer: any) => void
render () => void
setBgColor (color: string) => void
setCenter (center: [number, number], options?: any) => void
setEnableRender (flag: boolean) => void
setMapStatus (options: Partial<any>) => void
setMapStyle (style: any) => void
setPitch (pitch: number) => void
setRotation (rotation: number) => void
setZoom (zoom: number) => void
setZoomAndCenter (zoom: number, center: any) => void
zoomIn () => void
zoomOut () => void

# WorkerExpose

WorkerExpose(target: any): void

# Parameters
Name Type
target any

Returns: void


WorkerLink(worker: Worker): any

和一个Worker相关联

# Parameters
Name Type
worker Worker

Returns: any


# WorkerProxy

WorkerProxy(obj: Function | string, funcContext?: Record<string, Function | string>): Function

将独立函数/类移动到工作线程的一种非常简单的方法。 或者,将 worker 中的对象或函数暴露给主线程。 所有调用都是异步的。与 async/await 配合使用效果很好

Example:

function busyAdd(a, b) {
 let st = Date.now();
 while (true) {
   if ((Date.now() - st) > 2000) break;
 }
 return a + b;
}

(async () => {
 let workerAdd = vjmap.WorkerProxy(busyAdd);
 console.log(await workerAdd(10, 20)); //30
 // the busyAdd is executed in a worker so
 // the UI does not get blocked
})();

class Adder {
constructor() {
  this.count = 0;
}
add(a, b) {
 this.count++;
  return a + b;
}
}

(async () => {
let WAdder = vjmap.WorkerProxy(Adder);
let a = await new WAdder(); // instance created/running in worker
console.log(await a.count); // 0
console.log(await a.add(10, 20)); // 30
console.log(await a.count); // 1
})();

// or:
// worker.js

importScripts('https://cdn.jsdelivr.net/npm/moment@2.20.1/moment.min.js', '../dist/workly.js');
function friendlyTime(value) {
return moment(value).calendar(null, {
  sameDay: function (now) {
   if (now - this < 1000 * 60) {
      return "[Just now]";
   } else if (now - this < 1000 * 60 * 60) {
      return "[" + Math.round((now - this) / (1000 * 60)) + " mins ago]";
   } else {
     return '[Today at] LT'
   }
 }
});
}
vjmap.WorkerExpose(friendlyTime);
main.js

(async () => {
let w = vjmap.WorkerProxy("./worker.js");
let now = Date.now();
console.log(now);
console.log(await w(now));
console.log(await w(now - (24 * 60 * 60 * 1000)));
console.log(await w(now - (4 * 24 * 60 * 60 * 1000)));
})();

 function randAdd(a, b) {
     return randInt(a, b)  + 1000; // randInt这个函数是上下文传递进来的
 }

let randAddFunc = vjmap.WorkerProxy(randAdd, {
   randInt: vjmap.randInt // 把主进程库的函数做为上下文传进去
});
console.log(await randAddFunc(100, 300));
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Parameters
Name Type Description
obj Function | string
funcContext? Record<string, Function | string> 函数上下文,如果传入的obj是函数的话,需要把obj中函数里调用的函数名称和函数方法传进来

Returns: Function


# _getEdgeIntersection

_getEdgeIntersection(a: GeoPoint, b: GeoPoint, code: number, bounds: GeoBounds): GeoPoint

# Parameters
Name Type
a GeoPoint
b GeoPoint
code number
bounds GeoBounds

Returns: GeoPoint


# addScript

addScript(scripts: ScriptDefaultOptions | ScriptDefaultOptions[]): Promise<unknown[]>

将脚本注入. 脚本选项信息: strategy: 用于运行 JavaScript 的策略。可以是injectevalhref。默认自动检测. injectLocation: 用于注入资源的位置的 document.querySelector 参数。默认为 head. async: 异步加载脚本 src: 脚本的来源

method

async

example // you can add multiple loads awit addScript([{ src: "https://code.jquery.com/jquery-3.5.0.js" }, { src: "https://code.jquery.com/jquery-3.2.0.js", async: true }, { src: "https://code.jquery.com/jquery-3.3.0.js", async: true, injectLocation: '#main div.test', }, { src: "https://code.jquery.com/jquery-3.4.0.js", strategy: 'eval', }, { // link tag // css autodetected src: "https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.0.2/css/bootstrap-grid.min.css", }])

# Parameters
Name Type Description
scripts ScriptDefaultOptions | ScriptDefaultOptions[] Options for a script

Returns: Promise<unknown[]>


# angle

Const angle(a: Point23D, b?: Point23D): number

# Parameters
Name Type
a Point23D
b Point23D

Returns: number


# animateVectorLayer

Const animateVectorLayer(map: Map, layerId: string, options?: IAnimateVectorLayerOptions, layerType?: number): IAnimateVectorLayerResult

创建矢量图层动画图层

# Parameters
Name Type Default value Description
map Map - 地图对象
layerId string - 矢量图层id
options IAnimateVectorLayerOptions {} 选项
layerType? number - 图层类型 0 线 1 填充 2 符号点

Returns: IAnimateVectorLayerResult


# anticipate

Const anticipate(v: number): number

# Parameters
Name Type
v number

Returns: number


# applyMixins

applyMixins(derivedCtor: any, baseCtors: any[]): void

Copy methods and properties from one prototype into another.

see https://www.typescriptlang.org/docs/handbook/mixins.html

# Parameters
Name Type Description
derivedCtor any Class to mix methods and properties into.
baseCtors any[] Class to take all methods and properties from.

Returns: void


# applyMixinsWithoutProperties

applyMixinsWithoutProperties(derivedCtor: any, baseCtors: any[]): void

Copy methods from one prototype into another.

see https://www.typescriptlang.org/docs/handbook/mixins.html

# Parameters
Name Type Description
derivedCtor any Class to mix methods into.
baseCtors any[] Class to take all methods from.

Returns: void


# applyOffset

Const applyOffset(from: number, to?: number): function

Apply offset A function that, given a value, will get the offset from from and apply it to to

# Parameters
Name Type
from number
to? number

Returns: (v: number) => undefined | number


# attract

Const attract(constant: number, origin: number, v: number): number

# Parameters
Name Type
constant number
origin number
v number

Returns: number


# attractExpo

Const attractExpo(constant: number, origin: number, v: number): number

# Parameters
Name Type
constant number
origin number
v number

Returns: number


# backIn

Const backIn(v: number): number

# Parameters
Name Type
v number

Returns: number


# backInOut

Const backInOut(v: number): number

# Parameters
Name Type
v number

Returns: number


# backOut

Const backOut(v: number): number

# Parameters
Name Type
v number

Returns: number


# bezierCurveToPolyline

bezierCurveToPolyline(bezierCurve: BezierCurve, precision?: number, recursiveCount?: number): CurvePoint[]

description 将 bezierCurve 转换为折线 [理想情况下,计算结果中相邻的两个点的距离等于设置的精度(单位 px)]

# Parameters
Name Type Default value Description
bezierCurve BezierCurve - 贝塞尔曲线
precision number 5 想要的精度(并非总是可以实现)[建议精度 5-10。设置的精度通常是达不到的,除非设置较高的迭代次数,计算成本较高。]
recursiveCount number 0 递归计数

Returns: CurvePoint[]


# bounceIn

Const bounceIn(v: number): number

# Parameters
Name Type
v number

Returns: number


# bounceInOut

Const bounceInOut(p: number): number

# Parameters
Name Type
p number

Returns: number


# bounceOut

Const bounceOut(p: number): number

# Parameters
Name Type
p number

Returns: number


# bufferConvexPolygon

bufferConvexPolygon(ring: GeoPoint[], buffer: number): GeoPoint[]

取一个凸环并通过在其周围应用缓冲区将其向外扩展。 此功能假定环是顺时针缠绕的。

# Parameters
Name Type
ring GeoPoint[]
buffer number

Returns: GeoPoint[]


# buildTopoGraph

buildTopoGraph(lines: { id?: string ; points: GeoPoint[] ; weight?: number }[], precision?: number, hasDirection?: boolean): object

根据多条多段线,建立topo

# Parameters
Name Type Description
lines { id?: string ; points: GeoPoint[] ; weight?: number }[] 坐标,请转成几何坐标,再传入
precision? number 误差,小数点后几位, 以为相同, 如果两个点的坐标距离小于此值,则认为是同一个节点
hasDirection? boolean 是否考虑方向

Returns: object

Name Type
graph object
graph.addEdge (u: NodeId, v: NodeId, weight?: EdgeWeight) => { addNode: (node: string) => ...; removeNode: (node: string) => ...; nodes: () => string[]; adjacent: (node: string) => string[]; addEdge: (u: string, v: string, weight?: number | undefined) => ...; ... 12 more ...; deserialize: (serialized: Serialized) => ...; }
graph.addNode (node: NodeId) => { addNode: (node: string) => ...; removeNode: (node: string) => ...; nodes: () => string[]; adjacent: (node: string) => string[]; addEdge: (u: string, v: string, weight?: number | undefined) => ...; ... 12 more ...; deserialize: (serialized: Serialized) => ...; }
graph.adjacent (node: NodeId) => NodeId[]
graph.depthFirstSearch (sourceNodes?: NodeId[], includeSourceNodes: boolean, errorOnCycle: boolean) => string[]
graph.deserialize (serialized: Serialized) => { addNode: (node: string) => ...; removeNode: (node: string) => ...; nodes: () => string[]; adjacent: (node: string) => string[]; addEdge: (u: string, v: string, weight?: number | undefined) => ...; ... 12 more ...; deserialize: (serialized: Serialized) => ...; }
graph.getEdgeWeight (u: NodeId, v: NodeId) => EdgeWeight
graph.hasCycle () => boolean
graph.hasEdge (u: NodeId, v: NodeId) => boolean
graph.indegree (node: NodeId) => number
graph.lowestCommonAncestors (node1: NodeId, node2: NodeId) => string[]
graph.nodes () => NodeId[]
graph.outdegree (node: NodeId) => number
graph.removeEdge (u: NodeId, v: NodeId) => { addNode: (node: string) => ...; removeNode: (node: string) => ...; nodes: () => string[]; adjacent: (node: string) => string[]; addEdge: (u: string, v: string, weight?: number | undefined) => ...; ... 12 more ...; deserialize: (serialized: Serialized) => ...; }
graph.removeNode (node: NodeId) => { addNode: (node: string) => ...; removeNode: (node: string) => ...; nodes: () => string[]; adjacent: (node: string) => string[]; addEdge: (u: string, v: string, weight?: number | undefined) => ...; ... 12 more ...; deserialize: (serialized: Serialized) => ...; }
graph.serialize () => Serialized
graph.setEdgeWeight (u: NodeId, v: NodeId, weight: EdgeWeight) => { addNode: (node: string) => ...; removeNode: (node: string) => ...; nodes: () => string[]; adjacent: (node: string) => string[]; addEdge: (u: string, v: string, weight?: number | undefined) => ...; ... 12 more ...; deserialize: (serialized: Serialized) => ...; }
graph.shortestPath (source: NodeId, destination: NodeId) => string[] & { weight?: number }
graph.topologicalSort (sourceNodes?: NodeId[], includeSourceNodes: boolean) => string[]
topo any

, lowestCommonAncestors: (node1: NodeId, node2: NodeId) => NodeId[], shortestPath: (source: NodeId, destination: NodeId) => NodeId[] & {weight?: EdgeWeight}, setEdgeWeight: (u: NodeId, v: NodeId, weight: EdgeWeight) => {topologicalSort: (sourceNodes?: NodeId[], includeSourceNodes?: boolean) => ...[], addNode: (node: NodeId) => any, lowestCommonAncestors: (node1: NodeId, node2: NodeId) => ...[], shortestPath: (source: NodeId, destination: NodeId) => ... & ..., setEdgeWeight: (u: NodeId, v: NodeId, weight: EdgeWeight) => any, adjacent: (node: NodeId) => NodeId[], depthFirstSearch: (sourceNodes?: NodeId[], includeSourceNodes?: boolean, errorOnCycle?: boolean) => ...[], hasCycle: () => boolean, getEdgeWeight: (u: NodeId, v: NodeId) => EdgeWeight, serialize: () => Serialized, removeEdge: (u: NodeId, v: NodeId) => any, ...}, adjacent: (node: NodeId) => NodeId[], depthFirstSearch: (sourceNodes?: NodeId[], includeSourceNodes?: boolean, errorOnCycle?: boolean) => NodeId[], hasCycle: () => boolean, getEdgeWeight: (u: NodeId, v: NodeId) => EdgeWeight, serialize: () => Serialized, removeEdge: (u: NodeId, v: NodeId) => {topologicalSort: (sourceNodes?: NodeId[], includeSourceNodes?: boolean) => ...[], addNode: (node: NodeId) => any, lowestCommonAncestors: (node1: NodeId, node2: NodeId) => ...[], shortestPath: (source: NodeId, destination: NodeId) => ... & ..., setEdgeWeight: (u: NodeId, v: NodeId, weight: EdgeWeight) => any, adjacent: (node: NodeId) => NodeId[], depthFirstSearch: (sourceNodes?: NodeId[], includeSourceNodes?: boolean, errorOnCycle?: boolean) => ...[], hasCycle: () => boolean, getEdgeWeight: (u: NodeId, v: NodeId) => EdgeWeight, serialize: () => Serialized, removeEdge: (u: NodeId, v: NodeId) => any, ...}, ...}}}


# buildTransformer

buildTransformer(src: number[], dest: number[]): undefined | number[]

Usage:

const transformer = buildTransformer(
    [10, 44, 100, 44, 100, 300, 10, 300],
    [50, 54, 130, 14, 140, 330, 14, 220]
);
1
2
3
4
# Parameters
Name Type Description
src number[] source four points, [x0, y0, x1, y1, x2, y2, x3, y3]
dest number[] destination four points, [x0, y0, x1, y1, x2, y2, x3, y3]

Returns: undefined | number[]

transformer If fail, return null/undefined.


# buildTransformerMatrix3d

buildTransformerMatrix3d(src: number[], dest: number[]): undefined | string

透视投影转3d css 矩阵 Usage:

const transformer = buildTransformerMatrix3d(
    [10, 44, 100, 44, 100, 300, 10, 300],
    [50, 54, 130, 14, 140, 330, 14, 220]
);
1
2
3
4
# Parameters
Name Type Description
src number[] source four points, [x0, y0, x1, y1, x2, y2, x3, y3]
dest number[] destination four points, [x0, y0, x1, y1, x2, y2, x3, y3]

Returns: undefined | string


# calcPolygonArea

calcPolygonArea(points: GeoPoint[]): number

计算多边形面积

# Parameters
Name Type
points GeoPoint[]

Returns: number


# calculateSignedArea

calculateSignedArea(ring: GeoPoint[]): number

返回多边形的有符号的面积。正区域为外环,具有顺时针绕组。负区域为内环,按逆时针顺序排列。

# Parameters
Name Type
ring GeoPoint[]

Returns: number


# circIn

Const circIn(v: number): number

# Parameters
Name Type
v number

Returns: number


# circInOut

Const circInOut(v: number): number

# Parameters
Name Type
v number

Returns: number


# circOut

Const circOut(v: number): number

# Parameters
Name Type
v number

Returns: number


# clamp

Const clamp(min: number, max: number, v: number): number

# Parameters
Name Type
min number
max number
v number

Returns: number


# clipPolygon

clipPolygon(points: GeoPoint[], bounds: GeoBounds): GeoPoint[]

根据范围裁剪多边形

# Parameters
Name Type
points GeoPoint[]
bounds GeoBounds

Returns: GeoPoint[]


# clipSegment

clipSegment(a: GeoPoint, b: GeoPoint, bounds: GeoBounds): GeoPoint[] | Boolean

根据范围裁剪线段

# Parameters
Name Type
a GeoPoint
b GeoPoint
bounds GeoBounds

Returns: GeoPoint[] | Boolean


# cloneDeep

cloneDeep<T>(obj: T): T

Deep clone of object.

Like JSON.parse(JSON.stringify(obj)), but supports basic javascript types (string, number, object), Date and RegExps and cycles.

Throws error if enounters object with prototype assuming that in general class instances cannot be reliably cloned by generic algorithm.

# Type parameters
Name
T
# Parameters
Name Type
obj T

Returns: T


# closePolygon

closePolygon(points: GeoPoint[]): GeoPoint[]

闭合多边形

# Parameters
Name Type
points GeoPoint[]

Returns: GeoPoint[]

points


# closestPointOnPolyline

closestPointOnPolyline(p: GeoPoint, points: GeoPoint[]): object

点到多段线的最近点

# Parameters
Name Type
p GeoPoint
points GeoPoint[]

Returns: object

Name Type
closestIndex number
closestLength number
closestPoint GeoPoint
closestPrePointDist number

# closestPointOnPolylines

closestPointOnPolylines(p: GeoPoint, lines: GeoPoint[][]): object

点到多条线的最近点

# Parameters
Name Type
p GeoPoint
lines GeoPoint[][]

Returns: object

Name Type
closestIndex number
closestLength number
closestPoint GeoPoint
closestPointIndex number
closestPrePointDist number

# closestPointOnSegment

closestPointOnSegment(p: GeoPoint, p1: GeoPoint, p2: GeoPoint): GeoPoint

点到线段的最近点

# Parameters
Name Type
p GeoPoint
p1 GeoPoint
p2 GeoPoint

Returns: GeoPoint


# coordTransfromByFourParamter

coordTransfromByFourParamter(pt: GeoPoint, param: { dx: number ; dy: number ; rotate: number ; scale: number }): GeoPoint

通过四参数进行坐标转换

# Parameters
Name Type Description
pt GeoPoint
param object 四参数
param.dx number -
param.dy number -
param.rotate number -
param.scale number -

Returns: GeoPoint


# coordTransfromByInvFourParamter

coordTransfromByInvFourParamter(pt: GeoPoint, param: { dx: number ; dy: number ; rotate: number ; scale: number }): GeoPoint

通过四参数反算进行坐标转换

# Parameters
Name Type Description
pt GeoPoint
param object 四参数
param.dx number -
param.dy number -
param.rotate number -
param.scale number -

Returns: GeoPoint


# coordTransfromGetFourParamter

coordTransfromGetFourParamter(srcArr: GeoPoint[], destArr: GeoPoint[], isSetRotateZero: boolean, isConsiderPointOrder?: boolean): object

坐标转换得到四参数

# Parameters
Name Type Description
srcArr GeoPoint[] 原始点数组
destArr GeoPoint[] 目标点数组
isSetRotateZero boolean 是否设置旋转为零,默认false,如果为true,则只考虑平移和缩放
isConsiderPointOrder? boolean 不考虑点的次序(这样旋转角度方向总是上面,在-180,180之间)

Returns: object

Name Type
dx number
dy number
rotate number
scale number

# createAnimateFillLayer

createAnimateFillLayer(map: Map, path: LineGeoJsonInput | LineGeoJsonInput[] | GeoJsonGeomertry | GeoPointLike[] | any, options?: IAnimateFillLayerOptions): ICreateFillAnimateLayerResult

创建多边形动画图层

# Parameters
Name Type Default value Description
map Map - 地图对象
path LineGeoJsonInput | LineGeoJsonInput[] | GeoJsonGeomertry | GeoPointLike[] | any - 线坐标(lngLat)
options IAnimateFillLayerOptions {} 选项

Returns: ICreateFillAnimateLayerResult


# createAnimateImages

createAnimateImages(options?: ICreateAnimateImagesOptions): ImageData[]

创建动画图片集

# Parameters
Name Type Description
options? ICreateAnimateImagesOptions 选项

Returns: ImageData[]


# createAnimateLineLayer

createAnimateLineLayer(map: Map, path: LineGeoJsonInput | LineGeoJsonInput[] | GeoJsonGeomertry | GeoPointLike[] | any, options?: IAnimateLineLayerOptions): ICreateLineAnimateLayerResult

创建多段线动画图层

# Parameters
Name Type Description
map Map 地图对象
path LineGeoJsonInput | LineGeoJsonInput[] | GeoJsonGeomertry | GeoPointLike[] | any 线坐标(lngLat)
options? IAnimateLineLayerOptions 选项

Returns: ICreateLineAnimateLayerResult


# createAnimateSymbolLayer

createAnimateSymbolLayer(map: Map, path: PointGeoJsonInput | PointGeoJsonInput[] | GeoJsonGeomertry | GeoPointLike | any, options?: IAnimateSymbolLayerOptions): ICreateSymbolAnimateLayerResult

创建符号动画图层

# Parameters
Name Type Description
map Map 地图对象
path PointGeoJsonInput | PointGeoJsonInput[] | GeoJsonGeomertry | GeoPointLike | any 符号坐标(lngLat)
options? IAnimateSymbolLayerOptions 选项

Returns: ICreateSymbolAnimateLayerResult


# createAnimation

createAnimation<V>(__namedParameters: any): object

# Type parameters
Name Default
V number
# Parameters
Name Type
__namedParameters any

Returns: object

Name Type
start (reset?: boolean) => void
stop () => void

# createAntPathAnimateImages

createAntPathAnimateImages(options?: ICreateAntPathAnimateLineLayerOptions): ImageData[]

创建蚂蚁线动画图像集

# Parameters
Name Type Description
options? ICreateAntPathAnimateLineLayerOptions 选项

Returns: ImageData[]


# createAntPathAnimateLineLayer

createAntPathAnimateLineLayer(map: Map, path: LineGeoJsonInput | LineGeoJsonInput[] | GeoJsonGeomertry | GeoPointLike[] | any, options?: ICreateAntPathAnimateLineLayerOptions): ICreateLineAnimateLayerResult

创建蚂蚁线动画线图层

# Parameters
Name Type Default value Description
map Map - 地图对象
path LineGeoJsonInput | LineGeoJsonInput[] | GeoJsonGeomertry | GeoPointLike[] | any - 线坐标(lngLat)
options ICreateAntPathAnimateLineLayerOptions {} 选项

Returns: ICreateLineAnimateLayerResult


# createAnticipate

Const createAnticipate(power: number): Easing

# Parameters
Name Type
power number

Returns: Easing


# createArrowAnimateImages

createArrowAnimateImages(options?: ICreateArrowAnimateLineLayerOptions): ImageData[]

创建箭头动画图像集

# Parameters
Name Type Description
options? ICreateArrowAnimateLineLayerOptions 选项

Returns: ImageData[]


# createArrowAnimateLineLayer

createArrowAnimateLineLayer(map: Map, path: LineGeoJsonInput | LineGeoJsonInput[] | GeoJsonGeomertry | GeoPointLike[] | any, options?: ICreateArrowAnimateLineLayerOptions): ICreateLineAnimateLayerResult

创建箭头动画线图层

# Parameters
Name Type Description
map Map 地图对象
path LineGeoJsonInput | LineGeoJsonInput[] | GeoJsonGeomertry | GeoPointLike[] | any 线坐标(lngLat)
options? ICreateArrowAnimateLineLayerOptions 选项

Returns: ICreateLineAnimateLayerResult


# createAttractor

Const createAttractor(alterDisplacement?: Function): function

Creates an attractor that, given a strength constant, origin and value, will calculate value as attracted to origin.

# Parameters
Name Type
alterDisplacement Function

Returns: (constant: number, origin: number, v: number) => number


# createBackIn

Const createBackIn(power: number): Easing

# Parameters
Name Type
power number

Returns: Easing


# createExpoIn

Const createExpoIn(power: number): Easing

# Parameters
Name Type
power number

Returns: Easing


# createFrameAnimation

createFrameAnimation(callback: (status: FrameAnimationStatus) => boolean, fps?: number, stopCallBack?: (status: FrameAnimationStatus) => void): FrameAnimation

创建一个 FrameAnimation 对象来启动和停止你的动画功能.

example const count = 0;

const animation = createFrameAnimation(() => { context.clearRect(0, 0, width, height); context.font = "4rem monospace"; context.textAlign = 'center'; context.fillText(count, width / 2, height / 2);

count++; });

animation.start();

# Parameters
Name Type Description
callback (status: FrameAnimationStatus) => boolean 处理动画的回调,如果返回true,表示结束动画,返回false表示继续动画, .
fps? number 一秒运行多少帧,用来控制速度,如为0,则默认为系统帧率
stopCallBack? (status: FrameAnimationStatus) => void 结束动画的回调,参数表示是取消(true),还是正常结束(false)

Returns: FrameAnimation

| boolean}


# createLineGeoJson

createLineGeoJson(input: LineGeoJsonInput | LineGeoJsonInput[] | GeoJsonGeomertry | GeoPointLike[] | any): GeoJsonGeomertry

创建geoson格式的线

# Parameters
Name Type
input LineGeoJsonInput | LineGeoJsonInput[] | GeoJsonGeomertry | GeoPointLike[] | any

Returns: GeoJsonGeomertry


# createMarker

createMarker(options?: createMarkerOptions): Marker

创建一个Makrer对象,相当于new Marker()

# Parameters
Name Type
options? createMarkerOptions

Returns: Marker


# createObjectOffset

createObjectOffset(): object

Returns: object

Name Type
data (vertices: any) => any
margin (dist: number) => any
offset (dist: number) => any
offsetLines (dist: number) => any
padding (dist: number) => any

# createObjectPolygonUtil

createObjectPolygonUtil(): object

Returns: object

Name Type
diff (polygonA: Number[][], polygonB: Number[][]) => null | Number[][]
intersection (polygonA: Number[][], polygonB: Number[][]) => null | Number[][]
union (polygonA: Number[][], polygonB: Number[][]) => null | Number[][]

# createPointGeoJson

createPointGeoJson(input: PointGeoJsonInput | PointGeoJsonInput[] | GeoJsonGeomertry | GeoPointLike | any): GeoJsonGeomertry

创建geoson格式的点

# Parameters
Name Type
input PointGeoJsonInput | PointGeoJsonInput[] | GeoJsonGeomertry | GeoPointLike | any

Returns: GeoJsonGeomertry


# createPolygonGeoJson

createPolygonGeoJson(input: LineGeoJsonInput | LineGeoJsonInput[] | GeoJsonGeomertry | GeoPointLike[] | any): GeoJsonGeomertry

创建geoson格式的多边形

# Parameters
Name Type
input LineGeoJsonInput | LineGeoJsonInput[] | GeoJsonGeomertry | GeoPointLike[] | any

Returns: GeoJsonGeomertry


# cubicBezier

cubicBezier(mX1: number, mY1: number, mX2: number, mY2: number): any

# Parameters
Name Type
mX1 number
mY1 number
mX2 number
mY2 number

Returns: any


# decay

decay(__namedParameters: DecayOptions): any

# Parameters
Name Type
__namedParameters DecayOptions

Returns: any


# degToRad

degToRad(a: number): number

角度转弧度

# Parameters
Name Type
a number

Returns: number


# degreesToRadians

Const degreesToRadians(degrees: number): number

# Parameters
Name Type
degrees number

Returns: number


# distance

distance<P>(a: P, b: P): number

# Type parameters
Name Type
P number | Point2D | Point3D
# Parameters
Name Type
a P
b P

Returns: number


# easeIn

Const easeIn(v: number): number

# Parameters
Name Type
v number

Returns: number


# easeInOut

Const easeInOut(v: number): number

# Parameters
Name Type
v number

Returns: number


# easeOut

Const easeOut(v: number): number

# Parameters
Name Type
v number

Returns: number


# entColorToHtmlColor

entColorToHtmlColor(color: number | string, darkMode?: boolean, alpha?: number): string

实体颜色转html颜色

# Parameters
Name Type Description
color number | string 实体颜色
darkMode? boolean 样式是否为暗黑框
alpha? number 透明度的值

Returns: string


# equals

equals(a: number, b: number): boolean

Tests whether or not the arguments have approximately the same value, within an absolute or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less than or equal to 1.0, and a relative tolerance is used for larger values)

# Parameters
Name Type Description
a number The first number to test.
b number The second number to test.

Returns: boolean

True if the numbers are approximately equal, false otherwise.


# findShortestPath

findShortestPath(startPoint: GeoPoint, endPoint: GeoPoint, lines: { id?: string ; points: GeoPoint[] ; weight?: number }[], precision?: number, hasDirection?: boolean): { endPoint: { closestIndex: number ; closestLength: number ; closestPoint: GeoPoint ; closestPointIndex: number ; closestPrePointDist: number } ; error: undefined ; route: any[] ; routeDetail: { index: any ; points: any[] ; reverse: boolean = false }[] ; startPoint: { closestIndex: number ; closestLength: number ; closestPoint: GeoPoint ; closestPointIndex: number ; closestPrePointDist: number } } | { endPoint: undefined ; error: any ; route: undefined ; routeDetail: undefined ; startPoint: undefined }

给定所有路线、起始点、终点生成最短路径

# Parameters
Name Type Description
startPoint GeoPoint 起点
endPoint GeoPoint 终点
lines { id?: string ; points: GeoPoint[] ; weight?: number }[] 坐标,请转成几何坐标,再传入
precision? number 误差,小数点后几位, 以为相同, 如果两个点的坐标距离小于此值,则认为是同一个节点
hasDirection? boolean 是否考虑方向

Returns: { endPoint: { closestIndex: number ; closestLength: number ; closestPoint: GeoPoint ; closestPointIndex: number ; closestPrePointDist: number } ; error: undefined ; route: any[] ; routeDetail: { index: any ; points: any[] ; reverse: boolean = false }[] ; startPoint: { closestIndex: number ; closestLength: number ; closestPoint: GeoPoint ; closestPointIndex: number ; closestPrePointDist: number } } | { endPoint: undefined ; error: any ; route: undefined ; routeDetail: undefined ; startPoint: undefined }


# geoBounds

geoBounds(min?: GeoPoint, max?: GeoPoint): GeoBounds

new一个GeoBounds实例

# Parameters
Name Type
min? GeoPoint
max? GeoPoint

Returns: GeoBounds


# geoPoint

geoPoint(input: GeoPointLike): GeoPoint

new一个GeoPoint实例

# Parameters
Name Type
input GeoPointLike

Returns: GeoPoint


# getBezierCurveLength

getBezierCurveLength(bezierCurve: BezierCurve, precision?: number, recursiveCount?: number): number

计算贝塞尔曲线的长度

# Parameters
Name Type Default value Description
bezierCurve BezierCurve - 贝塞尔曲线
precision number 5 需要的计算精度
recursiveCount number 0 迭代次数

Returns: number


# getCircleFeature

getCircleFeature(center: GeoPointLike, radius: number, points?: number, startAngle?: number, endAngle?: number, includeCenterWhenArc?: boolean): GeoJsonGeomertry

得到圆或圆弧的离散化的多边形的geojson的形式

# Parameters
Name Type Default value Description
center GeoPointLike - 中心点
radius number - 半径
points number 360 离散化的个数
startAngle number 0 开始角度
endAngle number 360 结束角度
includeCenterWhenArc boolean true 如果是圆弧时,最后一个点加上中心点

Returns: GeoJsonGeomertry

, type: string, properties: {}}}


# getCirclePolygonCoordinates

getCirclePolygonCoordinates(center: GeoPointLike, radius: number, points?: number, startAngle?: number, endAngle?: number, includeCenterWhenArc?: boolean): number[][]

得到圆或圆弧的离散化的多边形的点

# Parameters
Name Type Default value Description
center GeoPointLike - 中心点
radius number - 半径
points number 360 离散化的个数
startAngle number 0 开始角度
endAngle number 360 结束角度
includeCenterWhenArc boolean true 如果是圆弧时,最后一个点加上中心点

Returns: number[][]


# getEllipseFeature

getEllipseFeature(center: GeoPointLike, majorAxisRadius: number, minorAxisRadius: number, points?: number, startAngle?: number, endAngle?: number, includeCenterWhenArc?: boolean): GeoJsonGeomertry

得到圆或圆弧的离散化的多边形的geojson的形式

# Parameters
Name Type Default value Description
center GeoPointLike - 中心点
majorAxisRadius number - -
minorAxisRadius number - -
points number 360 离散化的个数
startAngle number 0 开始角度
endAngle number 360 结束角度
includeCenterWhenArc boolean true 如果是圆弧时,最后一个点加上中心点

Returns: GeoJsonGeomertry

, type: string, properties: {}}}


# getEllipsePolygonCoordinates

getEllipsePolygonCoordinates(center: GeoPointLike, majorAxisRadius: number, minorAxisRadius: number, points?: number, startAngle?: number, endAngle?: number, includeCenterWhenArc?: boolean): number[][]

得到椭圆或椭圆弧的离散化的多边形的点

# Parameters
Name Type Default value Description
center GeoPointLike - 中心点
majorAxisRadius number - 长轴半径
minorAxisRadius number - 短轴半径
points number 360 离散化的个数
startAngle number 0 开始角度
endAngle number 360 结束角度
includeCenterWhenArc boolean true 如果是椭/圆弧时,最后一个点加上中心点

Returns: number[][]


# getEnvelopBounds

getEnvelopBounds(envelop: string, prj: any): GeoBounds

根据外包矩形创建 GeoBounds.

Example:

const b = vjmap.getEnvelopBounds('POLYGON((3466315.697899 6704304.297588, 3466315.697899 7784496.211226, 4546475.901198 7784496.211226, 4546475.901198 6704304.297588, 3466315.697899 6704304.297588))', prj);
1
# Parameters
Name Type
envelop string
prj any

Returns: GeoBounds


# getGeoBounds

getGeoBounds<T>(data: T | string): GeoBounds

获取一个geojson的范围值

# Type parameters
Name Type
T GeoPoint | Feature<Geometry | GeometryCollection, Properties> | FeatureCollection<Geometry | GeometryCollection, Properties> | Geometry | GeometryCollection | [number, number] | [number, number, number] | { x: number ; y: number ; z?: number } | { lat: number ; lng: number } | { lat: number ; lon: number } | GeoPointLike[]
# Parameters
Name Type Description
data T | string 输入值

Returns: GeoBounds

获取的范围值


# getOptionValue

getOptionValue<T>(a: T): T

Get first defined value.

Specialized "replacement" for a || b || c used frequently to get value from various sources (defaults, configs constants). In contrast to ||, this function provides proper typing for usual use cases (constant as last argument) and correct treatment of null and undefined.

If last parameter is "defined" then return type is T, otherwise return type is T | undefined.

Usage example:

interface Config {
    x?: number;
}
const someConfig: Config = {};
const val: number | undefined = undefined;
const DEFAULT = 5;
const x = getOptionValue(val, someConfig.x, DEFAULT);
    // typeof x === 'number' because DEFAULT is defined
const y = getOptionValue(val, someConfig.x);
    // typeof y === 'number | undefined' because someConfig.x is possibly undefined
# Type parameters
Name
T
# Parameters
Name Type
a T

Returns: T

getOptionValue<T>(a: T | undefined, b: T): T

# Type parameters
Name
T
# Parameters
Name Type
a T | undefined
b T

Returns: T

getOptionValue<T>(a: T | undefined, b: T | undefined, c: T): T

# Type parameters
Name
T
# Parameters
Name Type
a T | undefined
b T | undefined
c T

Returns: T

getOptionValue<T>(a: T | undefined, b: T | undefined, c: T | undefined, d: T): T

# Type parameters
Name
T
# Parameters
Name Type
a T | undefined
b T | undefined
c T | undefined
d T

Returns: T

getOptionValue<T>(...values: (T | undefined)[]): T | undefined

# Type parameters
Name
T
# Parameters
Name Type
...values (T | undefined)[]

Returns: T | undefined


# getTempMapId

getTempMapId(expireTime?: number, isVisible?: boolean): string

获取一个临时的图id(临时图形只会用临时查看,过期会自动删除)

# Parameters
Name Type Description
expireTime? number 临时图形不浏览情况下过期自动删除时间,单位分钟。默认30
isVisible? boolean 是否可见,(可见的话,将可通过ListMaps获取,否则为隐藏图)。默认不可见

Returns: string


# hexToBinStr

hexToBinStr(strHex: string, isPadding?: boolean, reverse?: boolean): string

十六进制字符串转二进制字符串(可用于协同图形,图层开头显示设置的转换)

# Parameters
Name Type Default value Description
strHex string - 十进制的内容
isPadding boolean true 前面是否自动0,默认true
reverse boolean true 结果倒序,默认true

Returns: string


# htmlColorToEntColor

htmlColorToEntColor(color: string): number

html颜色转实体颜色

# Parameters
Name Type Description
color string html

Returns: number


# inertia

inertia(__namedParameters: InertiaOptions): object

# Parameters
Name Type
__namedParameters InertiaOptions

Returns: object

Name Type
stop () => void

# interpolate

interpolate<T>(input: number[], output: T[], __namedParameters?: InterpolateOptions<T>): function

Create a function that maps from a numerical input array to a generic output array.

Accepts:

  • Numbers
  • Colors (hex, hsl, hsla, rgb, rgba)
  • Complex (combinations of one or more numbers or strings)
const mixColor = interpolate([0, 1], ['#fff', '#000'])

mixColor(0.5) // 'rgba(128, 128, 128, 1)'
1
2
3
# Type parameters
Name
T
# Parameters
Name Type Default value
input number[] -
output T[] -
__namedParameters InterpolateOptions<T> {}

Returns: (v: number) => T


# interpolateLineRange

interpolateLineRange(points: GeoPointLike[] | any, number: number, isLngLat?: boolean, offsetDist?: number, minGap?: number, includeSrcPoint?: boolean): any[]

# Parameters
Name Type Default value Description
points GeoPointLike[] | any - 要插值的(多段)线的顶点(输入必须为经纬度).
number number - 沿线插入的点数;这包括端点,并且有效最小值为 2(如果给出较小的数字,则仍将返回端点).
isLngLat boolean false 点坐标序列是否是经纬度坐标
offsetDist number 0 一个可选的垂直距离,用于从线段偏移每个点,否则它会位于.
minGap number 0 在后续插值点之间保持可选的最小间隙;如果一组“number”点的后续点之间的投影间隙低于此值,则“number”将减小到合适的值.
includeSrcPoint boolean true 包括原有点

Returns: any[]


# interpolatePointsByRatio

interpolatePointsByRatio(points: GeoPointLike[] | any, ratio: number, isLngLat?: boolean): any[]

通过比例(0-1)的值,得到坐标序列的点坐标的值

# Parameters
Name Type Default value
points GeoPointLike[] | any -
ratio number -
isLngLat boolean false

Returns: any[]


# isClosedPolygon

isClosedPolygon(points: GeoPoint[]): boolean

多边形是否闭合

# Parameters
Name Type
points GeoPoint[]

Returns: boolean


# isCounterClockwise

isCounterClockwise(a: GeoPoint, b: GeoPoint, c: GeoPoint): boolean

指示提供的点是按逆时针(真)还是顺时针(假)顺序排列

# Parameters
Name Type
a GeoPoint
b GeoPoint
c GeoPoint

Returns: boolean


# isGeoPointLike

isGeoPointLike(geoPoint: any): geoPoint is GeoPointLike

A GeoPointLike object, an array of two numbers representing longitude and latitude, or an object with lng and lat or lon and lat properties.

Example:

const center = { lat: 53.3, lng: 13.4 };
mapView.geoCenter = GeoCoordinates.fromLatLng(center);
1
2
# Parameters
Name Type
geoPoint any

Returns: geoPoint is GeoPointLike


# isPoint

Const isPoint(point: Object): point is Point23D

# Parameters
Name Type
point Object

Returns: point is Point23D


# isPoint3D

Const isPoint3D(point: Point23D): point is Point3D

# Parameters
Name Type
point Point23D

Returns: point is Point3D


# isPointInPolygon

Const isPointInPolygon(pos: GeoPoint, polygon: GeoPoint[]): boolean

判断点是否在多边形内。

# Parameters
Name Type Description
pos GeoPoint
polygon GeoPoint[] 多边形坐标

Returns: boolean


# isZero

isZero(value: number, precision?: number): boolean

判断是否为零

# Parameters
Name Type Description
value number
precision? number 精度,缺省1e-6

Returns: boolean


# kebabCase

Const kebabCase(s: any): any

# Parameters
Name Type
s any

Returns: any


# keyframes

keyframes<V>(__namedParameters: KeyframeOptions): any

# Type parameters
Name
V
# Parameters
Name Type
__namedParameters KeyframeOptions

Returns: any


# lineSplit

lineSplit(line: GeoPoint[], splitLine: GeoPoint[], dotErr?: number): GeoPoint[][]

线被另外一条线分开多条线段,返回新的线段

# Parameters
Name Type Description
line GeoPoint[]
splitLine GeoPoint[]
dotErr? number 允许误差的小数点后几位,默认6位

Returns: GeoPoint[][]


# linear

Const linear(v: number): number

# Parameters
Name Type
v number

Returns: number


# metersPerPixel

metersPerPixel(zoomLevel: number, latitude?: number): number

求不同级级别下,每米表示多少像素

# Parameters
Name Type Description
zoomLevel number 级别从0表示
latitude? number 纬度

Returns: number


# mirrorEasing

Const mirrorEasing(easing: Easing): Easing

# Parameters
Name Type
easing Easing

Returns: Easing


# mix

Const mix(from: number, to: number, progress: number): number

# Parameters
Name Type
from number
to number
progress number

Returns: number


# mixColor

Const mixColor(from: any, to: any): function

# Parameters
Name Type
from any
to any

Returns: (v: number) => any


# mixComplex

Const mixComplex(origin: string, target: string): MixComplex

# Parameters
Name Type
origin string
target string

Returns: MixComplex


# multiLineSplit

multiLineSplit(lines: GeoPoint[][], dotErr?: number): GeoPoint[][]

多条线之间根据交点相互分开,返回相交后的所有线段,请确保每条线段不要自相交

# Parameters
Name Type Description
lines GeoPoint[][]
dotErr? number 允许误差的小数点后几位,默认6位

Returns: GeoPoint[][]


# offsetPointLine

offsetPointLine(points: GeoPoint[], distance: number): any[]

# Parameters
Name Type
points GeoPoint[]
distance number

Returns: any[]


# offsetPoints

offsetPoints(pts: GeoPointLike[], options: { offset: number ; smoothFactor?: number }): any[]

# Parameters
Name Type
pts GeoPointLike[]
options object
options.offset number
options.smoothFactor? number

Returns: any[]


# openMapDarkStyle

openMapDarkStyle(): IMapStyleParam

打开地图的深色背景样式,值为 {backcolor: 0}

Returns: IMapStyleParam


# openMapLightStyle

openMapLightStyle(): IMapStyleParam

打开地图的浅色色背景样式,值为 {backcolor: 0xFFFFFF}

Returns: IMapStyleParam


# pick

pick<T, K>(object: T, props: K[]): Pick<T, K>

Pick props from `object.

Runtime version of Pick<T,K>.

# Type parameters
Name Type
T object
K string | number | symbol
# Parameters
Name Type
object T
props K[]

Returns: Pick<T, K>


# pipe

Const pipe(...transformers: Function[]): Function

# Parameters
Name Type
...transformers Function[]

Returns: Function


# pixelValue

pixelValue(meters: number, zoomLevel: number, latitude?: number): number

不同级别下根据米数来求像素值

# Parameters
Name Type Description
meters number
zoomLevel number 级别从0表示
latitude? number 纬度

Returns: number


# pointFromVector

Const pointFromVector(origin: Point2D, angle: number, distance: number): object

# Parameters
Name Type
origin Point2D
angle number
distance number

Returns: object

Name Type
x number
y number

# pointToSegmentDistance

pointToSegmentDistance(p: GeoPoint, p1: GeoPoint, p2: GeoPoint): number

点到线段的距离

# Parameters
Name Type
p GeoPoint
p1 GeoPoint
p2 GeoPoint

Returns: number


# polygonCentroid

polygonCentroid(vertices: GeoPoint[]): GeoPoint

根据 [x,y] 坐标列表计算多边形的质心。

# Parameters
Name Type Description
vertices GeoPoint[] 顶点坐标

Returns: GeoPoint


# polygonIsClockwise

polygonIsClockwise(points: GeoPoint[]): boolean

根据格林公式判断多边形是否为顺时针

# Parameters
Name Type
points GeoPoint[]

Returns: boolean

false:逆时针


# polylineMarginToPolygon

polylineMarginToPolygon(pts: GeoPointLike[], options: { arcSegments?: number ; offset: number ; smoothFactor?: number }): any

把多段线往外扩展成多边形

# Parameters
Name Type
pts GeoPointLike[]
options object
options.arcSegments? number
options.offset number
options.smoothFactor? number

Returns: any


# polylineToBezierCurve

polylineToBezierCurve(polyline: CurvePoint[], close?: boolean, offsetA?: number, offsetB?: number): BezierCurve

description 将折线转换为贝塞尔曲线

# Parameters
Name Type Default value Description
polyline CurvePoint[] - 组成折线的一组点
close boolean false 闭合曲线
offsetA number 0.25 光滑程度A
offsetB number 0.25 光滑程度B

Returns: BezierCurve

一组贝塞尔曲线(无效输入将返回false)


# progress

Const progress(from: number, to: number, value: number): number

# Parameters
Name Type
from number
to number
value number

Returns: number


# radToDeg

radToDeg(a: number): number

弧度转角度

# Parameters
Name Type
a number

Returns: number


# radiansToDegrees

Const radiansToDegrees(radians: number): number

# Parameters
Name Type
radians number

Returns: number


# randInt

randInt(n: number, m: number): number

生成一个区间的随机总数

# Parameters
Name Type
n number
m number

Returns: number


# randomColor

randomColor(): string

生成随机颜色

Returns: string


# reverseEasing

Const reverseEasing(easing: Easing): Easing

# Parameters
Name Type
easing Easing

Returns: Easing


# segmentIntersect

segmentIntersect(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, x4: number, y4: number): { ratio: undefined ; result: string = "COLINEAR"; status: boolean = false; x: undefined ; y: undefined } | { ratio: number ; result: undefined = "COLINEAR"; status: boolean = true; x: number ; y: number }

线段相交

# Parameters
Name Type
x1 number
y1 number
x2 number
y2 number
x3 number
y3 number
x4 number
y4 number

Returns: { ratio: undefined ; result: string = "COLINEAR"; status: boolean = false; x: undefined ; y: undefined } | { ratio: number ; result: undefined = "COLINEAR"; status: boolean = true; x: number ; y: number }

| {result: string, status: boolean} | {x: number, y: number, status: boolean, ratio: number} | {result: string, status: boolean}}


# simplify

simplify(points: GeoPoint[], tolerance?: number): GeoPoint[]

简化点坐标

# Parameters
Name Type
points GeoPoint[]
tolerance? number

Returns: GeoPoint[]


# smooth

Const smooth(strength?: number): function

# Parameters
Name Type Default value
strength number 50

Returns: (v: number) => number


# smoothFrame

Const smoothFrame(prevValue: number, nextValue: number, duration: number, smoothing?: number): number

# Parameters
Name Type Default value
prevValue number -
nextValue number -
duration number -
smoothing number 0

Returns: number


# snap

Const snap(points: number | number[]): function

# Parameters
Name Type
points number | number[]

Returns: (v: number) => undefined | number


# spring

spring(__namedParameters: SpringOptions): any

This is based on the spring implementation of Wobble https://github.com/skevy/wobble

# Parameters
Name Type
__namedParameters SpringOptions

Returns: any


# steps

Const steps(steps: number, direction?: Direction): Easing

# Parameters
Name Type Default value
steps number -
direction Direction "end"

Returns: Easing


# syncMaps

syncMaps(...args: Map[]): function

同步两张地图的移动。

# Parameters
Name Type
...args Map[]

Returns: () => void


# toDecimal

Const toDecimal(num: number, precision?: number): number

# Parameters
Name Type Default value
num number -
precision number 2

Returns: number


# toRadian

toRadian(a: number): number

Convert Degree To Radian

# Parameters
Name Type Description
a number Angle in Degrees

Returns: number


# upperCamelCase

Const upperCamelCase(s: any): any

# Parameters
Name Type
s any

Returns: any


# utf8ToUnicode

utf8ToUnicode(strUtf8: string): string

utf8转unicode

# Parameters
Name Type Description
strUtf8 string utf8的内容

Returns: string


# vectorContour

vectorContour(featureCollection: FeatureCollection, weight: string, breaks: number[], params?: { alpha?: number ; canvas?: HTMLCanvasElement ; colors?: string[] ; extent?: [number, number, number, number] ; model?: "exponential" | "gaussian" | "spherical" ; sigma2?: number ; width?: number ; xlim?: number ; ylim?: number }): object

生成矢量等值面

# Parameters
Name Type Description
featureCollection FeatureCollection -
weight string -
breaks number[] -
params? object params:{ model:'exponential','gaussian','spherical',三选一,默认exponential sigma2: 0, // sigma2是σ²,对应高斯过程的方差参数,也就是这组数据z的距离,方差参数σ²的似然性反映了高斯过程中的误差,并应手动设置。一般设置为 0 ,其他数值设了可能会出空白图 alpha: 100, // Alpha α对应方差函数的先验值,此参数可能控制钻孔扩散范围,越小范围越大,少量点效果明显,但点多了且分布均匀以后改变该数字即基本无效果了,默认设置为100 canvas: HTMLCanvasElement, // 如果要渲染到画布上填这个 xlim: number, // canvas有效 ylim: number, // canvas有效 colors:string[] // canvas有效 等值面分级区间 width: number // 生成等值线宽度参数。像素长度。默认200。宽度值越大,绘制越精确,但也会导致速度变慢,内存占用越多 }
params.alpha? number -
params.canvas? HTMLCanvasElement -
params.colors? string[] -
params.extent? [number, number, number, number] -
params.model? "exponential" | "gaussian" | "spherical" -
params.sigma2? number -
params.width? number -
params.xlim? number -
params.ylim? number -

Returns: object

Name Type
alg? any
contour? FeatureCollection
grid? object
grid.grid number[]
grid.m number
grid.n number
grid.x_resolution number
grid.xlim number
grid.y_resolution number
grid.ylim number
grid.zlim number
variogram? any

# velocityPerFrame

velocityPerFrame(xps: number, frameDuration: number): number

# Parameters
Name Type
xps number
frameDuration number

Returns: number


# velocityPerSecond

velocityPerSecond(velocity: number, frameDuration: number): number

# Parameters
Name Type
velocity number
frameDuration number

Returns: number


# wrap

Const wrap(min: number, max: number, v: number): number

# Parameters
Name Type
min number
max number
v number

Returns: number

vjmap / Exports / default / quat