Global

Members

constant BaseMapEnums

Preset basemap classes for online basemap components

Properties:
Name Type Default Description
BingMap String BingMap

Bing basemap

TainDiMap String TainDiMap

Tianditu basemap.

OSM String OSM

OSM basemap.

LocalMap String LocalMap

Local image.

GridMap String GridMap

Longitude/Latitude basemap.

SuperMapImagery String SuperMapImagery

SuperMap basemap.

BingMapsApi

The search object item used to set and retrieve the default Bing Maps API key.

BingMapsStyle

Imagery types provided by Bing Maps

Properties:
Name Type Default Description
AERIAL String Aerial

Aerial imagery.

AERIAL_WITH_LABELS String AerialWithLabels

Aerial imagery with road overlay.

AERIAL_WITH_LABELS_ON_DEMAND String AerialWithLabelsOnDemand

Aerial images with road coverage.

ROAD String Road

Roads without additional imagery.

ROAD_ON_DEMAND String RoadOnDemand

Roads without additional images.

CANVAS_DARK String CanvasDark

The dark version of the road map.

CANVAS_LIGHT String CanvasLight

Simplified version of the roadmap.

CANVAS_GRAY String CanvasGray

The grayscale version of the road map.

ORDNANCE_SURVEY String OrdnanceSurvey

Topographic imagery.

COLLINS_BART String CollinsBart

Collins Bart imagery.

BlendEquation

Determines how two pixel values are combined.

Properties:
Name Type Default Description
ADD Number WebGLConstants.FUNC_ADD

Pixel values are added component-wise. This method is used for additive blending of semi-transparent effects.

SUBTRACT Number WebGLConstants.FUNC_SUBTRACT

Pixel values are subtracted component-wise (source - destination). This is used in alpha blending for transparent effects.

REVERSE_SUBTRACT Number WebGLConstants.FUNC_REVERSE_SUBTRACT

Pixel values are subtracted component-wise (destination - source).

MIN Number WebGLConstants.MIN

The pixel value is assigned to the minimum value function (min (source, destination)).

This equation performs operations on the color components of each pixel.

MAX Number WebGLConstants.MAX

The pixel value is passed to the maximum value function (max (source, destination)).

This equation performs operations on the color components of each pixel.

BlendOption

Determines the blending mode for opaque and translucent parts of billboards, points, and labels with the scene.

Properties:
Name Type Default Description
OPAQUE Number 0

Determines that billboards, points, and labels are completely opaque.

TRANSLUCENT Number 1

Billboards, points, and labels in the collection are completely translucent.

OPAQUE_AND_TRANSLUCENT Number 2

Billboards, points, and labels in the collection are a mixture of opaque and translucent.

CameraEventType

Camera interaction class

Properties:
Name Type Default Description
LEFT_DRAG Number 0

Press the left mouse button, then move the mouse and release the button.

RIGHT_DRAG Number 1

Press the right mouse button, then move the mouse and release the button.

MIDDLE_DRAG Number 2

Hold down the middle mouse button, then move the mouse and release the button

WHEEL Number 3

Scroll the middle mouse button.

PINCH Number 4

Two-finger touch on a touch screen.

CategoryFieldName

Feature value field class

Properties:
Name Type Default Description
Elevation String VertexWeight

Point cloud altitude.

Intensity String PointCloudIntensity

Point cloud intensity.

ClassCode String PointCloudClassCode

Point cloud classification.

Offset String VertexOffset

Vertex offset.

Velocity String Velocity

Velocity (2D or 3D velocity) can be used to visualize water flow direction on S3M water surfaces.

CategoryVisibleMode

Visibility mode based on feature value class

Properties:
Name Type Default Description
Hide Number 0

Hidden.

Visible Number 1

Displayed.

ResetAll Number 2

Reset, show all.

ClampMode

Style classes for drawing and measuring geometric objects.

Properties:
Name Type Default Description
Space Number 0

Space mode

Ground Number 1

Ground contact mode

S3mModel Number 2

Paste object mode

Raster Number 3

Rasterization mode

Both Number 4

Ground mounted object mode

See:

ClassificationType

Classification mode classes for terrain and 3D tiles.

Properties:
Name Type Default Description
TERRAIN Number 0

Only terrain will be classified.

CESIUM_3D_TILE Number 1

Only 3D Tiles will be classified.

S3M_TILE Number 2

S3M Tile classification.

BOTH Number 3

Both terrain and 3D Tiles will be classified.

NUMBER_OF_CLASSIFICATION_TYPES 4

ClippingType

Crop mode.

Properties:
Name Type Default Description
KeepOutside Number 1

Trim the interior

KeepInside Number 2

Crop external

ClipPlaneMode

Cross-section mode for clipping planes.

Properties:
Name Type Default Description
NONE Number 0

No cross-section.

COLOR Number 1

Cross-section uses the specified color.

MODEL_COLOR Number 2

Cross-section uses the model's color (not applicable for S3M layers).

ColorBlendMode

Defines different blending mode classes for target color and source color.

Properties:
Name Type Default Description
HIGHLIGHT Number 0

Multiplies the source color by the target color.

REPLACE Number 1

Replaces the source color with the target color.

MIX Number 2

Replaces the source color with the target color.

ColorModulationInfo

When setting a color table using point cloud intensity feature values, the maximum and minimum values in the color table are set based on the maximum and minimum values of point cloud intensity.

ColorStyleObject

Color Style

Properties:
Name Type Default Description
OrigialTexture Number 0

原始纹理模式,显示所有的顶点颜色、材质颜色以及纹理颜色

PureColor Number 1

纯色模式,渲染时忽略顶点颜色和纹理颜色,显示风格上设置的填充色,默认白色

ControlModeObject

Properties:
Name Type Default Description
DESIGN Number 0

屏幕中心

NORMAL Number 1

mouse position

CredentialType

Key Type

Properties:
Name Type Default Description
ISERVER_TOKEN String token

iServer key type.

IPORTAL_KEY String key

iPortal key type.

DrawMode

Drawing Mode Class

Properties:
Name Type Default Description
Point Number 0

plot points

Line Number 1

draw lines

Polygon Number 2

Draw surface

Marker Number 3

draw icons

Box Number 4

Draw Box

Circle Number 5

Draw a circle

See:

FillStyle

S3M layer fill style class

Properties:
Name Type Default Description
Fill Number 0

Fill mode.

WireFrame Number 1

Wireframe mode.

Fill_And_WireFrame Number 2

Fill and wireframe mode.

See:

FlowDirectionDisplayMode

Flow direction representation mode

Properties:
Name Type Default Description
NONE Number 0

Flow direction is not visualized

ARROW Number 1

The flow direction is represented as an arrow

FIXED_SIZE_ARROW Number 2

The flow direction is represented by arrows of fixed length and actual size

FlyInterpolationMode

Camera Flight Interpolation Mode

Properties:
Name Type Default Description
NONE Number 0

No interpolation

CATMULL_ROM Number 1

CatmullRom interpolation

HeightReference

Indicates the position relative to terrain.

Properties:
Name Type Default Description
NONE Number 0

Absolute position.

CLAMP_TO_GROUND Number 1

Clamp to terrain and 3D Tiles models.

RELATIVE_TO_GROUND Number 2

Vertical height relative to terrain and 3D Tiles models.

CLAMP_TO_TERRAIN number 3

Clamp to terrain.

RELATIVE_TO_TERRAIN number 4

Vertical height relative to terrain.

CLAMP_TO_3D_TILE number 5

Clamp to 3D Tiles models.

RELATIVE_TO_3D_TILE number 6

Vertical height relative to 3D Tiles models.

HypsometricSettingEnum

Hypsometric tinting enumeration class

Properties:
Name Type Default Description
DisplayMode Object {"NONE": 0, "FACE": 1, "LINE": 2, "FACE_AND_LINE": 3}

Display mode

AnalysisRegionMode Object {"ARM_NONE": 0, "ARM_ALL": 1, "ARM_REGION": 2}

Analyze the scope mode

FilterMode Object {"LINEAR": 0, "NEAREST": 1}

sampling mode

InstancedType

Instancing class

Properties:
Name Type Default Description
INSTANCED_LAYER Number Instanced_Layer

Instanced layer.

INSTANCED_OBJECT Instanced_Object

Instanced object.

InterpolationType

Interpolation class, default value is Linear

Properties:
Name Type Default Description
Linear Number 0

Linear interpolation.

Acceleration Number 1

Acceleration motion interpolation.

Deceleration Number 2

Deceleration motion interpolation.

CubicSpline Number 3

Cubic spline interpolation.

SmoothStep Number 4

SmoothStep interpolation (y = (3 - 2 * t) * t * t).

LabelStyle

Label drawing mode.

Properties:
Name Type Default Description
FILL Number 0

Fill label text, no outline.

OUTLINE Number 1

Outline label text, no fill.

FILL_AND_OUTLINE Number 2

Fill and outline label text.

See:

LightSourceType

Light source class

Properties:
Name Type Default Description
DIRECTIONAL Number 0

Directional light.

POINT Number 1

Point light.

SPOT Number 2

Spotlight.

HEMISPHERE Number 3

Hemispherical light

LineDisplayType

Occlusion mode

Properties:
Name Type Default Description
OCCLUDED Number 0

Occlusion.

OCCLUDED_TRANSLUCENT Number 1

Occluded parts are semi-transparent.

NON_OCCLUDED Number 2

Not occluded.

LoadingPriorityMode

Load priority mode.

Properties:
Name Type Default Description
Root_Priority Number 0

Layer-first loading mode.

Child_Priority Number 1

Depth-first loading mode.

UsePagedLodInfo Number 2

Load based on spatial index.

Child_Priority_NonLinear Number 3

Depth-first nonlinear switching. When loading large area fine model tiles, selecting this mode can reduce the amount of updates in the distance.

MapMode2D

The operation mode of the map in 2D mode.

Properties:
Name Type Default Description
ROTATE Number 0

A 2D map can rotate around the Z-axis.

INFINITE_SCROLL Number 1

A 2D map can scroll infinitely in the horizontal direction.

MeasureMode

Measurement mode class.

Properties:
Name Type Default Description
Distance Number 0

Distance measurement mode

Area Number 1

面积量算模式

DVH Number 2

Three-component measurement mode (height measurement) for spatial distance, horizontal distance, and vertical distance.

Angle Number 4

Angle measurement mode: Supports azimuth angle (clockwise in due north direction, range 0~360) and elevation angle (upward in horizontal direction, range -90~+90)

See:

MixColorType

Layer Color Blending Mode Class

Properties:
Name Type Default Description
MIX Number 0

Color blending mode.

REPLACE Number 1

Color replacement mode.

ModelAnimationLoop

Determines whether and how to play glTF animations.

Properties:
Name Type Default Description
NONE Number 0

Play once, no loop.

REPEAT Number 1

Loop playback, starts from beginning immediately after stopping.

MIRRORED_REPEAT Number 2

Loop animation, plays forward, then backward, and keeps looping.

See:

ModifyRegionMode

Excavation mode

Properties:
Name Type Default Description
CLIP_INSIDE Number 0

Excavation inside

CLIP_OUTSIDE Number 1

Excavate the exterior

MultiViewportMode

Multi-viewport mode class.

Properties:
Name Type Default Description
NONE Number 0

Single viewport mode.

HORIZONTAL Number 1

Horizontal dual viewport mode.

VERTICAL Number 2

Vertical dual viewport mode.

QUAD Number 3

Quad viewport mode.

TRIPLE Number 4

Triple viewport mode.

VerticalTrisection Number 5

Horizontal triple viewport mode, with three viewports in the same horizontal direction.

FIVE_DIVISIONS Number 6

Five viewport mode.

SIX_DIVISIONS Number 7

Six viewport mode.

SEVEN_DIVISIONS Number 8

Seven viewport mode.

EIGHT_DIVISIONS Number 9

Eight viewport mode.

NINE_DIVISIONS Number 10

Nine viewport mode.

ONE_THREE_THREE_DIVISIONS Number 11

1-3-3形式的7视口模式

PackingRequest

Packaging request encoding method

Properties:
Name Type Default Description
None Number 0

Not packaged, normal request

QuadKey Number 1

Package requests using quadtree encoding method

ParticleModenumber

Rendering mode of individual particles in grid flow field

Properties:
Name Type Default Description
Texture number 0

Texture mode

Point number 1

Point Element Mode

constant PerformancePreferenceMode

Performance preference mode: performance first, effect first

Properties:
Name Type Default Description
Effect Number 0

Effect first

Performance Number 1

Performance first

PixelFormat

The format of pixels, which refers to the number of components in a pixel and the content it represents.

Properties:
Name Type Default Description
DEPTH_COMPONENT Number WebGLConstants.DEPTH_COMPONENT

Pixel format containing depth values.

DEPTH_STENCIL Number WebGLConstants.DEPTH_STENCIL

A pixel format that includes depth and template values, typically used in conjunction with PixelDatatype.UNSIGNED_INT_24_8.

ALPHA Number WebGLConstants.ALPHA

Pixel format containing alpha channel.

RGB Number WebGLConstants.RGB

A pixel format that includes red, green, and blue channels.

RG number WebGLConstants.RG

A pixel format that includes red and green channels.

RGBA Number WebGLConstants.RGBA

A pixel format that includes red, green, blue, and alpha channels.

LUMINANCE Number WebGLConstants.LUMINANCE

Pixel format containing brightness (intensity) channels.

LUMINANCE_ALPHA Number WebGLConstants.LUMINANCE_ALPHA

A pixel format that includes brightness (intensity) and alpha channels.

RGB_DXT1 Number WebGLConstants.COMPRESSED_RGB_S3TC_DXT1_EXT

A pixel format containing red, green, and blue channels, compressed by DXT1.

RGBA_DXT1 Number WebGLConstants.COMPRESSED_RGBA_S3TC_DXT1_EXT

A pixel format containing red, green, blue, and alpha channels, compressed by DXT1.

RGBA_DXT3 Number WebGLConstants.COMPRESSED_RGBA_S3TC_DXT3_EXT

A pixel format containing red, green, blue, and alpha channels, compressed by DXT3.

RGBA_DXT5 Number WebGLConstants.COMPRESSED_RGBA_S3TC_DXT5_EXT

A pixel format containing red, green, blue, and alpha channels, compressed by DXT5.

RGB_PVRTC_4BPPV1 Number WebGLConstants.COMPRESSED_RGB_PVRTC_4BPPV1_IMG

A pixel format containing red, green, and blue channels, compressed by PVR 4bpp.

RGB_PVRTC_2BPPV1 Number WebGLConstants.COMPRESSED_RGB_PVRTC_2BPPV1_IMG

A pixel format containing red, green, and blue channels, compressed by PVR 2bpp.

RGBA_PVRTC_4BPPV1 Number WebGLConstants.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG

A pixel format containing red, green, blue, and alpha channels, compressed by PVR 4bpp.

RGBA_PVRTC_2BPPV1 Number WebGLConstants.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG

A pixel format containing red, green, blue, and alpha channels, compressed by PVR 2bpp.

RGBA_ASTC Number WebGLConstants.COMPRESSED_RGBA_ASTC_4x4_WEBGL

A pixel format containing red, green, and blue channels, compressed by ASTC.

RGB_ETC1 Number WebGLConstants.COMPRESSED_RGB_ETC1_WEBGL

A pixel format containing red, green, and blue channels, compressed by ETC1.

RGB8_ETC2 Number WebGLConstants.COMPRESSED_RGB8_ETC2

A pixel format containing red, green, and blue channels, compressed by ETC2.

RGBA8_ETC2_EAC Number WebGLConstants.COMPRESSED_RGBA8_ETC2_EAC

A pixel format containing red, green, and blue channels, compressed by ETC2 EAC.

RGBA_BC7 Number WebGLConstants.COMPRESSED_RGBA_BPTC_UNORM

A pixel format containing red, green, and blue channels, compressed by BC7.

RG_INTEGER number WebGLConstants.RG_INTEGER

A pixel format containing red and green channels as integers.

componentsLength
validate
isColorFormat
isDepthFormat
isCompressedFormat
isDXTFormat
isPVRTCFormat
isETC1Format
compressedTextureSizeInBytes
textureSizeInBytes
alignmentInBytes
createTypedArray
flipY

PositionMode

Position Mode

Properties:
Name Type Default Description
Disjoint Number 0

separation

Intersects Number 1

intersect

Contains Number 2

contain.

ProjectionName

Projection Name

Properties:
Name Type Default Description
TMERC String tmerc

Transverse Mercator projection (Gaussian Kruger)

ALBERS String aea

Albers projection

LCC String lcc

Lambert positive axis isometric cone projection

UTM String utm

Isometric transverse cutting cylindrical projection

Quality

The quality of a heatmap is represented by its texture resolution.

Properties:
Name Type Default Description
LOW Number 1024

Low quality.

MEDIUM Number 2048

Medium quality, default.

HIGH Number 4096

High quality.

RasterGeometryType

Real-time rasterized geometry classes

Properties:
Name Type Default Description
POLYLINE Number 0

Polyline.

POLYGON Number 1

Polygon.

POLYGON_HOLE Number 2

Polygon with holes (if an original polygon has holes, its outer boundary points and holes need to be drawn separately).

RequestType

Identifies request classes (for finer logging and prioritization).

Properties:
Name Type Default Description
TERRAIN Number 0

Terrain request.

IMAGERY Number 1

Imagery request.

TILES3D Number 2

3D Tiles request.

OTHER Number 3

Other requests.

PACK Number 4

Group request.

BLOCK Number 5

Block request.

BLOCKPACK Number 6

Make a block request.

RotationOriginnumber

Rotation origin type

Properties:
Name Type Default Description
CENTER number 0

Model center point

APEX number 1

Cone vertex

S3MCompressType

S3M texture compression type

Properties:
Name Type Default Description
encNONE 0

非压缩

enrS3TCDXTN 14

DXT压缩

enrPVRTPF_PVRTC2 19

PVR压缩-IOS设备

enrPVRTPF_PVRTC 20

PVR压缩-IOS设备

enrPVRTPF_PVRTC_4bpp 21

PVR压缩-IOS设备

enrPVRTPF_ETC1 22

ETC压缩-安卓设备

ScanEffectMode

Scanline effect mode class.

Properties:
Name Type Default Description
CIRCLE String {"programDefines": "CIRCLE"}

Circular scan mode.

LINE String {"programDefines": "LINE"}

Linear scan mode.

SceneMode

View mode class.

Properties:
Name Type Default Description
MORPHING Number 0

3D to 2D switch.

COLUMBUS_VIEW Number 1

2.5D view mode.

SCENE2D Number 2

2D view mode.

SCENE3D Number 3

3D view mode.

SelectColorTypeObject

Properties:
Name Type Default Description
MIX Number 0

Model texture and color mixed display.

REPLACE Number 1

Solid color display.

SILHOUETTE Number 2

Outline mode.

ALWAYS_SHOW_SILHOUETTE Number 3

Outline mode without occlusion.

SILHOUETTE_EDGE Number 4

Outer contour illumination mode.

WIREFRAME Number 5

Selected model outline highlight mode.

ServerType

Service Type

Properties:
Name Type Default Description
ISERVER String ISERVER

ISERVER

IPORTAL String IPORTAL

IPORTAL

ONLINE String ONLINE

ONLINE

ShadowMode

Specifies whether the object casts or receives shadows from light sources when shadows are enabled.

Properties:
Name Type Default Description
DISABLED Number 0

This object does not cast or receive shadows.

ENABLED Number 1

This object receives or casts shadows.

CAST_ONLY Number 2

This object only casts shadows.

RECEIVE_ONLY Number 3

This object only receives shadows

NUMBER_OF_SHADOW_MODES 4

SHADOWTYPE

S3M layer shadow type

Properties:
Name Type Default Description
NONE Number 0

关闭阴影

SELECTION Number 1

仅选中对象开启阴影

ALL Number 2

所有对象开启阴影

SplitDirectionObject

Roller blind direction

Properties:
Name Type Default Description
NONE Number 0

禁用卷帘

LEFT Number 1

屏蔽卷帘左边

RIGHT Number 2

屏蔽卷帘右边

TOP Number -1

屏蔽卷帘上边

BOTTOM Number -2

屏蔽卷帘下边

StopPlayMode

Site Mode Class

Properties:
Name Type Default Description
StopPause String StopPause

Normal Mode

StopAround String StopAround

Site surround mode

See:

constant SunLightAnalysisMode

Sunlight analysis mode class

Properties:
Name Type Default Description
SunlightDuration number 0

Sunlight duration.

ShadowDuration number 1

Shadow duration.

TurningMode

Camera flight turning mode class

Properties:
Name Type Default Description
Smoothly Number 0

Smooth turns

Directly Number 1

Turn directly

UrlTypeObject

S3M layer requests data format

Properties:
Name Type Default Description
REST Number 0
KEY_VALUE Number 1

ViewDomeType

Openness display class

Properties:
Name Type Default Description
VISIBLEDOME number 0

Visible part.

HIDDENDOME number 1

Hidden part.

ALLDOME number 2

Show all.

VolumeRenderMode

Real-time rasterized geometry classes

Properties:
Name Type Default Description
VolumeRendering Number 0

Volume.

Slice Number 1

Clipping plane.

ContourValue Number 2

Isosurface.

VolumetricCloudsQuality

Volume cloud mass enumeration class

Properties:
Name Type Default Description
Low Number 0

Low quality

Middle Number 1

regular quality

High Number 2

High quality

WalkingMode

Camera mode class

Properties:
Name Type Default Description
NONE Number 0

Default mode, third-person camera mode 0.

ByKeyboard Number 1

Keyboard-driven first-person camera mode 1.

WaterbodySize

Set water area category

Properties:
Name Type Default Description
SMALL Number 0

Suitable for smaller water areas with a range of 50 * 50 unit meters and an enumeration value of 0.

MEDIUM Number 1

Suitable for medium water areas with a range of 100 * 100 unit meters and an enumeration value of 1.

LARGE Number 2

Suitable for a wide range of water areas with a unit meter of 1000 * 1000 and an enumeration value of 2.

WaterMode

Flood analysis (connectivity) class (supported data: terrain and models, requires DSM dataset published as data service).

Properties:
Name Type Default Description
Clamp Number 0

Clamp to ground.

Absolute Number 1

Absolute water surface height.

WaveStrength

Water ripple intensity class

Properties:
Name Type Default Description
CALM Number 0

Calm.

SLIGHT Number 1

Slight ripples.

MILD Number 2

Medium ripple.

MODERATE Number 3

Large ripples.

WindingOrder

Model rendering mode class

Properties:
Name Type Default Description
CLOCKWISE String WebGLConstants.CW

Front-face (clockwise) rendering.

COUNTER_CLOCKWISE String WebGLConstants.CCW

Front-face (counter-clockwise) rendering.

NONE String WebGLConstants.NONE

Double-sided rendering.

validate

WireFrameType

S3M layer model wireframe mode class

Properties:
Name Type Default Description
Triangle Number 0

Triangle wireframe mode (effective when no border type is set during desktop tile generation).

Quad Number 1

Quadrilateral wireframe mode (requires checking 'with wireframe' during desktop tile generation).

Sketch Number 2

Sketch wireframe mode (requires checking 'with wireframe' during desktop tile generation).

EffectOutline Number 3

Effect border line (requires checking 'with wireframe' during desktop tile generation).

Methods

processGeoJsonObject(){promise}

Processing GeoJSON objects

Returns:
Type Description
promise

Type Definitions

EntityTypestring

  • USER:用户
  • DEPARTMENT:部门
  • IPORTALGROUP:群组
  • ROLE:角色
Default Value:
USER

FieldInfoObject

Define the structure of object attribute information.

Properties:
Name Type Description
alias string optional

property alias

isRequired Boolean optional

Is it a required field

isSystem Boolean optional

Is it a system field

name string optional

Attribute Name

size number optional

Length of attribute value

type string optional

Type of attribute value

fieldValueObject

Define the structure of object return property values.

Properties:
Name Type Description
values array optional

Attribute value array

indexs array optional

Index of layer attribute information corresponding to attribute values

PermissionTypestring

  • SEARCH:搜索权限
  • READ:读取权限
  • READWRITE:读写权限
  • DOWNLOAD:下载权限
Default Value:
SEARCH

RequestParametersobject

添加一个自定义资源加载函数,当使用以自定义 URL 方案开头的 URL 时会调用该函数。 下面的示例将在样式定义中 sources 列表定义的 custom:// URL 时触发。 传入的函数将接收请求参数,并应返回结果资源, 例如 pbf 矢量瓦片(未压缩),以 ArrayBuffer 形式表示。

Properties:
Name Type Description
请求url string
请求头定义 object
请求方法 string

'GET' | 'POST' | 'PUT'.

请求体 string
返回的响应体类型 string

'string' | 'json' | 'arrayBuffer'.

Example
```js
// 这将使用 fetch API 获取文件(这显然不是一个有趣的示例...)
vectorTilesMapSetting.addProtocol({
  customProtocol: 'custom',
  loadFn: async (params) => {
    const t = await fetch(`https://${params.url.split("://")[1]}`);
    if (t.status == 200) {
      const buffer = await t.arrayBuffer();
      return {data: buffer}
    } else {
      throw new Error(`Tile fetch error: ${t.statusText}`);
    }
  }
});
// 以下是尝试加载瓦片时返回错误的示例
VectorTilesMapSetting.addProtocol({
  customProtocol: 'custom2',
  loadFn: async (params, abortController) => {
    throw new Error('someErrorMessage');
  }
});
```

SnappingResultObject

定义捕捉返回结果结构。

Properties:
Name Type Description
layerName String optional

Layer Name

objectId number optional

对象ID

candidate Cartesian3 optional

捕捉的顶点的位置(世界坐标系)

vertexId number | null optional

顶点ID