Skip to main content

3D model layer (ModelLayer)

method

addAxesHelper

Add model auxiliary coordinate axes. For specific usage, please refer to Example.

Parameters

NameTypeDescription
groupObject3DRequiredObject3D object.
lengthNumberRequiredThe length of the coordinate axis.

addBatchModel

Similar models are loaded in batches, and the models can be operated in the callback function. For specific usage, refer to Example.

Parameters

NameTypeDescription
optionsObjectRequiredparameter
nametypedefault valuedescription
dataArray[Object]RequiredPoint data. Custom properties can be added.
nametypedescription
coordinateArray[Number]RequiredPoint coordinates, [longitude, latitude, height].
modelObjectRequired3D model resources, support glb, gltf, obj, fbx type loading.
nametypedescription
mtlStringRequiredMaterial file path, only valid when the model format type is "obj".
typeStringRequiredModel format, values ​​are "gltf", "glb", "obj", "fbx".
urlStringRequiredModel file path.
dracoUrlStringoptionalDecompression library file path, only valid when type is "glb" and "gltf".
opacityNumber1optionalOpacity, ranging from 0-1.
scaleNumber1optionalModel scaling.
callbackFunctionoptionalCallback function executed after the model is loaded
nametypedescription
groupObject3DRequiredObject3D object, including a series of methods for operating the model.

addBoxHelper

Add a model outsourcing box. For specific usage, refer to Example.

Parameters

nametypedefault valuedescription
groupObject3DRequiredObject3D object.
colorString#ff0000optionalColor of model outer box.

addCircle

Add a dynamic circle model and return the model group object. For specific usage, please refer to Example.

Parameters

  • Scanning circle/diffusion circle/radar circle/ripple diffusion circle
NameTypeDescription
optionsObjectRequiredparameter
nametypedefault valuedescription
centerArrayRequiredCircle center coordinates, [longitude, latitude, height].
typeStringRequiredCircle type, the values ​​are divided into "scan", "spread", "radar" and "ripple", which represent scanning circle, diffusion circle, radar circle and ripple diffusion.
colorString#FFFFFFoptionalColor value.
opacityNumber1optionalOpacity, ranging from 0-1.
radiusNumber10optionalCircle radius, unit meter, value is a positive number.
segmentNumber256optionalThe number of patches forming a circle.
speedNumber1optionalThe circle changes speed, the value is a positive number.
isCWBooleantrueoptionalWhether it is clockwise, only valid when type is "radar".
turnsNumber8optionalThe number of stripes forming a circle, the value is a positive integer, only valid when type is "ripple".
  • Gradient circle
NameTypeDescription
optionsObjectRequiredparameter
nametypedefault valuedescription
typeStringRequiredCircle type, value is "gradient".
dataArray[Object]RequiredGradient circle attribute, multiple gradient circle data can be added.
nametypedefault valuedescription
centerArrayRequiredCircle center coordinates, [longitude, latitude, height].
radiusNumber10optionalCircle radius, unit meter, value is a positive number.
centerColorString#FF0000optionalCircle center color value.
centerOpacityNumber1.0optionalOpacity of the center of the circle, ranging from 0-1.
edgeColorString#FF0000optionalCircle edge color value.
edgeOpacityNumber0.1optionalCircle edge opacity, ranging from 0-1.

addDynamicWater

Add dynamic water effects. For specific usage, please refer to Example.

Parameters

NameTypeDescription
optionsObjectRequiredparameter
nametypedefault valuedescription
baseTextureStringRequiredBasic texture resource path.
dataStringRequiredWater surface geometry data.
noiseTextureStringRequiredNoise texture resource path.
opacityNumber0.8optionalTransparency.
speedNumber0.01optionalThe speed of water flow.
altitudeNumber0optionalAltitude, in meters.

addFlame

Add flame effect. For specific usage, please refer to Example.

Parameters

NameTypeDescription
optionsObjectRequiredparameter
nametypedescription
coordinateArrayRequiredThe position where the center of the bottom of the flame is placed, in the shape of [longitude, latitude, altitude].
sizeArrayRequiredThe size of the flame, you can specify the size of the three axes of x, y, and z, the unit is meters, the shape is [100,100,100].
imgUrlStringRequiredFire map path.

addFlowLine

Add a pipeline model with flow texture and return the model group object. For specific usage, please refer to Example.

Parameters

  • Round pipeline
NameTypeDescription
optionsObjectRequiredparameter
nametypedefault valuedescription
dataObjectRequiredPipeline data. Custom properties can be added.
nametypedescription
coordinateArray[Number]RequiredThe coordinates of the points that make up the pipeline, [[longitude, latitude, height], [longitude, latitude, height]].
typeStringRequiredCircular nozzle section type, value is "Circle".
closedBooleanfalseoptionalWhether the pipeline model is closed from beginning to end.
colorString#FFFFFFoptionalColor value.
imageStringundefinedoptionalTexture path, the length and width are required to be consistent.
opacityNumber1optionalOpacity, ranging from 0-1.
radiusNumber1optionalradius of the circular nozzle, in meters.
repeatXNumber10optionalNumber of repeats along the pipeline path direction.
repeatYNumber1optionalNumber of repetitions around the pipeline direction.
sideStringFrontSideoptionalMaterial map side settings, three types, "FrontSide", "BackSide", "DoubleSide".
speedNumber1optionalPipeline texture flow speed.
  • Rectangular pipeline
NameTypeDescription
optionsObjectRequiredparameter
nametypedefault valuedescription
dataObjectRequiredPipeline data. Custom properties can be added.
nametypedescription
coordinateArray[Number]RequiredThe coordinates of the points that make up the pipeline, [[longitude, latitude, height], [longitude, latitude, height]].
rectangleArrayRequiredThe side length of the rectangular pipe mouth, such as [a,b], in meters.
typeStringRequiredRectangular nozzle section type, value is "Rectangle".
colorString#FFFFFFoptionalColor value.
imageStringundefinedoptionalTexture path.
opacityNumber1optionalOpacity, ranging from 0-1.
repeatXNumber10optionalNumber of repeats along the pipeline path direction.
repeatYNumber1optionalNumber of repetitions around the pipeline direction.
sideStringFrontSideoptionalMaterial map side settings, three types, "FrontSide", "BackSide", "DoubleSide".
speedNumber1optionalPipeline texture flow speed.
stepsNumber10optionalThe number of points used to subdivide the segment deeply along the stretched spline, can be used with the repeatX attribute.
  • Trajectory lines
NameTypeDescription
optionsObjectRequiredparameter
nametypedefault valuedescription
dataObjectRequiredLine data. Custom properties can be added.
nametypedescription
coordinateArray[Number]RequiredThe coordinates of the points that make up the trajectory line, [[longitude, latitude, height], [longitude, latitude, height]].
typeStringRequiredTrail line type, value is "trail".
colorString#003CFFoptionalColor value.
opacityNumber1optionalOpacity.
speedNumber3optionalFlow speed.
widthNumber10optionalLine width.
  • Flying line
NameTypeDescription
optionsObjectRequiredparameter
nametypedefault valuedescription
dataObjectRequiredLine data. Custom properties can be added.
nametypedescription
coordinateArray[Number]RequiredThe point coordinates that make up the flying line, [[longitude, latitude, height], [longitude, latitude, height]].
typeStringRequiredFlying line type, value is "flow".
colorString#ffff00optionalColor value.
gradientNumber0.02optionalBackground transparency.
opacityNumber1optionalOpacity.
percentNumber0.08optionalProportion of the flowing part.
speedNumber3optionalFlow speed.
widthNumber10optionalLine width.
  • Dynamic pattern lines

    For specific usage, please refer to Example.

NameTypeDescription
optionsObjectRequiredparameter
nametypedefault valuedescription
dataObjectRequiredLine data. Custom properties can be added.
nametypedescription
coordinateArray[Number]RequiredThe point coordinates that make up the dynamic pattern line, [[longitude, latitude, height], [longitude, latitude, height]].
imageStringRequiredPicture resource path.
typeStringRequiredDynamic pattern line type, value is "image".
colorString#FFFFFFoptionalColor value.
opacityString1optionalOpacity.
depthTestBooleantrueoptionalWhether to enable depth testing, that is, whether to enable occlusion.
speedNumber3optionalFlow speed.
widthNumber10optionalLine width.
textureFactorNumber6optionalThe compression coefficient of the texture in the flow direction. The larger the value, the greater the compression strength, ranging from 0-10.
towardsStringscreenoptionalFlow line expression, the value is "screen", it always faces the screen, and the value is "ground", it sticks to the ground.

addGeoFencing

Add a 3D geofencing model and return the model group object. For specific usage, please refer to Example.

Parameters

NameTypeDescription
optionsObjectRequiredparameter
nametypedefault valuedescription
dataObjectRequiredFence data. Custom properties can be added.
nametypedescription
coordinateArray[Number]RequiredThe coordinates of the points that make up the fence, [[longitude, latitude, height], [longitude, latitude, height]].
nameStringoptionalFence name.
typeStringRequiredThree-dimensional geofence type, the values ​​are divided into "diffuse", "fade" and "outLine", which represent visible and invisible track fences and outline fences.
colorString#FFFFFFoptionalColor value.
heightNumber1optionalFence height.
opacityNumber1optionalOpacity, ranging from 0-1.
speedNumber3.0optionalFence changing speed.
imageUrlStringoptionalTexture path, only effective when type is "outLine".
imageColorStringrgb(0,255,255)optionalThe color of the texture pattern. It is required that the pattern color in the map is pure white and the background color is pure black. It only takes effect when type is "outLine".
imageSpeedNumber0.0015optionalTexture moving speed, range 0-1, only effective when type is "outLine".
gradientColorStringrgb(0,255,255)optionalThe color of the gradient, only takes effect when type is "outLine".
gradientSpeedNumber0.015optionalGradient color movement speed, only effective when type is "outLine".

addInstancedModel

High-performance loading of similar models in large batches, the model position, color and angle information can be updated through the updateInstancedModel and updateInstancedModelById methods in the callback function. For specific usage, refer to Example.

Parameters

NameTypeDescription
optionsObjectRequiredparameter
nametypedefault valuedescription
dataArray[Object]RequiredPoint coordinate data.
nametypedefault valuedescription
coordinateArray[Number]RequiredPoint coordinates, [longitude, latitude, height].
idStringoptionalUnique identifier information. This parameter is required when used with the updateInstancedModelById method.
colorStringOriginal model coloroptionalColor information of a single model, in the form of "#ffffff".
rotationArray[Number][0,0,0]optionalThe rotation angle of a single model around the coordinate axis, the counterclockwise direction is positive, the angle value range is [0,360], the positive direction of the X-axis is due east, the positive direction of the Y-axis is vertically upward, and the positive direction of the Z-axis is due north.
modelObjectRequired3D model resources.
nametypedescription
typeStringRequiredModel format, values ​​are "gltf", "glb".
urlStringRequiredModel file path.
dracoUrlStringoptionalDecompression library file path.
maxCountNumber99999optionalSet the maximum number of models that can be displayed.
opacityNumber1optionalSet the opacity of the model material, ranging from 0-1.
projectStringundefinedoptionalLoaded 3D model coordinate system. The default coordinate system is meters, and the parameter is set to "3857" when loading the EPSG:3857 coordinate system model.
rotationArray[Number][0,0,0]optionalInitial model rotation parameters, in the form [x,y,z].
scaleNumber1optionalInitial model scaling factor.
callbackFunctionoptionalCallback function executed after the model is loaded
nametypedescription
groupObject3DRequiredObject3D object, update model position information through updateInstancedModel and updateInstancedModelById methods.

addLines

Add a three-dimensional line and return the model group object. For specific usage, please refer to Example.

Parameters

NameTypeDescription
optionsObjectRequiredparameter
nametypedefault valuedescription
dataArray[Object]RequiredLine data. Custom properties can be added.
nametypedescription
coordinateArray[Number]RequiredThe coordinates of the points that make up the line, [[longitude, latitude, height], [longitude, latitude, height]].
imageStringRequiredImage resource path, only valid when type is "image".
colorString#FFFFFFoptionalcolor value.
opacityNumber1optionalOpacity, ranging from 0-1.
repeatObject{x: 1, y: 1}optionalThe number of tiles of the image in the x and y directions, only effective when type is "image".
typeStringpipeoptionalThree-dimensional line type, supporting pipeline (pipe), solid line (solid), dotted line (dash), and pattern line (image) types.
widthNumber1/10optionalLine width, when type is "pipe", the default is 1, other types default to 10.

addMarker

To add 3D point annotations in batches, it needs to be used together with options.funcRender to return an object containing the dom element group of the annotations.

Parameters

NameTypeDescription
optionsObjectRequiredparameter
nametypedefault valuedescription
idStringRequiredThe id of the annotation layer, unique.
dataArrayRequiredBatch label data.
nametypedescription
elementHTMLElementRequiredDOM element as a markup.
positionArrayRequiredMark point coordinates, [longitude, latitude, height].
avoidanceBooleanfalseoptionalWhether to enable label avoidance.
editBooleanfalseoptionalWhen the value is true, the three-dimensional label can be moved by dragging the mouse.
  • Refer to the Create 3D Label example:
    • Can be removed in batches through the remove() method;
    • Locations can be updated in batches through the update() method. Please refer to the specific usage.
  • Refer to the Edit 3D Label example:
    • The editing state can be enabled based on the name through the selectMarkerByName('name') method;
    • The editing on and off status can be set through the setEditable(true)/setEditable(false) method;
    • You can obtain the dragged label position by listening to the marker-drag event.

addMarker3D

To add 3D labels in batches, you need to introduce html2canvas.min.js. For specific usage, please refer to Example.

Parameters

NameTypeDescription
optionsObjectRequiredparameter
nametypedefault valuedescription
dataArrayRequiredArray of label position, id and orientation.
nametypedefault valuedescription
coordinateArrayRequiredThe coordinates of the label, in the form: [longitude, latitude, height].
idStringoptionalAttribute information of the label.
rotationOffsetNumber0optionalIndicates the angle between the front direction of the three-dimensional label and the north direction in the horizontal direction, ranging from -180 to 180, with counterclockwise being the positive direction.
elementHTMLElementRequiredCustomized dom element. The larger the resolution of the dom element, the clearer the label.
widthNumberRequiredThe width of the label, in meters.
heightNumberRequiredThe width of the label, in meters.
depthTestBooleantrueoptionalWhether to enable depth testing.
callbackFunctionoptionalCallback function executed after loading is completed.
nametypedescription
groupObject3DRequiredObject3D object, which can be combined with the renderMarker3D and getMarker3DId interfaces to realize the function of 3D labels always facing the screen and obtaining bound attribute information.

addModel

You can load the model in meters and manipulate the model in the callback function.

Parameters

nametypedefault valuedescription
modelsArrayRequiredInitially loaded 3D model resource.
nametypedescription
modelObjectRequiredSingle 3D model resource supports loading of glb, gltf, obj, and fbx types.
nametypedescription
mtlStringRequiredMaterial file path, only valid when type is "obj".
typeStringRequiredModel format, values ​​are "gltf", "glb", "obj", "fbx".
urlStringRequiredModel file path.
dracoUrlStringoptionalDecompression library file path, only valid when type is "glb" and "gltf".
ktx2ParseUrlStringoptional
KTX 2.0 texture decompression library file path, only valid when type is "glb" and "gltf". Specific reference example Loading 3D model with KTX 2.0 texture .
centerArray[0, 0, 0]optionalSet the geospatial coordinates of the world origin of the 3D model. The coordinate system uses WGS84 coordinates. Required if models are set. Example: [lng, lat, height], if height is default, the default is 0.
callbackFunctionoptionalThe callback function executed after the model is loaded, usage: "callback: function (group, layer) {}".
nametypedescription
groupObject3DRequiredObject3D object, which contains a series of methods for operating the model.
layerModelLayerRequired3D layer instance.

addModelEffect

To add 3D model special effects, the model is required to face the Y axis upward. For specific usage, please refer to Example.

Parameters

NameTypeDescription
modelObject3DRequiredThree-dimensional model object.
optionsArray[Object]RequiredModel special effects array, the effects can be superimposed.
nametypedescription
option1ObjectRequiredparameter
nametypedefault valuedescription
typeStringRequiredModel gradient type, bottom-up gradient, value is "gradient".
endColorString#FFFFFFoptionalEnd color value.
percentNumber0.5optionalGradient scale, ranging from 0-1.
startColorString#040912optionalStart color value.
option2ObjectRequiredparameter
nametypedefault valuedescription
typeStringRequiredThe model’s own sweeping effect type changes from bottom to top, and the value is "flow".
colorString#339bf6optionalColor value.
percentNumber0.01optionalThe proportion of the width of the sweeping bar to the entire model.
speedNumber3.0optionalSweeping bar movement speed.

addModelMercator

You can load the model in the 3857 coordinate system and operate the model in the callback function. The parameters models, center, and callback are consistent with the description above.

addParticle

Load particles and return the model group object.

Parameters

NameTypeDescription
optionsObjectRequiredparameter
nametypedefault valuedescription
dataArray[Object]RequiredPoint data. Adding custom attributes is not supported.
nametypedescription
coordinateArray[Number]RequiredPoint coordinates, [longitude, latitude, altitude], only supports CGCS2000 coordinates.
colorStringrgb(255,255,255)optionalColor value.
maxPointsNumberoptionalMaximum number of points. If you need to use updateParticle to update the number of points, please enter the maximum number of points. The default is all points of the current data.
opacityNumber1.0optionalOpacity, ranging from 0-1.
sizeNumber1optionalParticle size.

addPoints

Add 3D point models in batches and return model group objects. For specific usage, please refer to Example.

Parameters

NameTypeDescription
optionsObjectRequiredparameter
nametypedefault valuedescription
dataArray[Object]RequiredPoint data. Custom properties can be added.
nametypedescription
coordinateArray[Number]RequiredPoint coordinates, [longitude, latitude, height].
typeStringRequiredModel format, the values ​​are "cube" cube and "sphere" sphere.
colorString/Number#FFFFFFoptionalColor value, the color value accepts string or hexadecimal representation.
opacityNumber1optionalOpacity, ranging from 0-1.
sizeNumber1optionalSize, in meters, representing edge length and radius respectively.

addPolygons

Add a three-dimensional surface and return the model group object. For specific usage, please refer to Example.

Parameters

NameTypeDescription
optionsObjectRequiredparameter
nametypedefault valuedescription
dataArray[Object]RequiredFacial data. Custom properties can be added.
nametypedescription
coordinateArray[Number]RequiredThe coordinates of the points that make up the surface, [[longitude, latitude, height], [longitude, latitude, height]].
colorString/Number#FFFFFFoptionalColor value, the color value accepts string or hexadecimal representation.
opacityNumber1optionalOpacity, ranging from 0-1.
sideStringFrontSideoptionalMaterial map side settings, three types, "FrontSide" front, "BackSide" back, "DoubleSide" double-sided.

addPolygonByLine

Add a three-dimensional plane and return the model group object. For specific usage, please refer to Example.

Parameters

NameTypeDescription
optionsObjectRequiredparameter
nametypedefault valuedescription
dataArrayRequiredThe point coordinates that make up the line, [[longitude, latitude, height], [longitude, latitude, height]].
heightNumberRequiredPlane elevation height.
colorString/Number#FFFFFFoptionalColor value, color value accepts string or hexadecimal representation.
imageStringoptionalTexture path.
opacityNumber1optionalOpacity, ranging from 0-1.

addPyramid

Add the cone model and return the model group object. For specific usage, please refer to Example.

Parameters

NameTypeDescription
optionsObjectRequiredparameter
nametypedefault valuedescription
basePointsArrayRequiredPyramid base data, point coordinates that make up the base, [[Longitude, Latitude, Height], [Longitude, Latitude, Height]], the points are in clockwise order.
topColorArray[String/Number]RequiredPyramid side color array, the color value accepts string or hexadecimal representation, such as ["#FFFF00", "#00FF00"], which represents the color gradient from top to bottom, and only accepts two colors at most.
topPointArrayRequiredPyramid vertex data, [longitude, latitude, height].
baseColorString/NumberoptionalThe color value of the pyramid base. The color value accepts string or hexadecimal representation, such as "#FFFFFF" or 0xFFFFFF. If not set, the bottom will be transparent and invisible by default.
opacityNumber1optionalOpacity, ranging from 0-1.
sideStringFrontSideoptionalMaterial map side settings, three types, "FrontSide" front, "BackSide" back, "DoubleSide" double-sided.

addRainSystem

Adding rain animation can be removed in batches through the remove() method, and other parameters except the bounds parameter can be updated in batches through the update(options) method. For specific usage, please refer to Example.

Parameters

NameTypeDescription
optionsObjectRequiredparameter
nametypedefault valuedescription
boundsArrayRequiredThe geographical range of the rain animation, represented by the longitude and latitude of the southwest and northeast corners, in the form of [[120.661, 31.299],[120.701, 31.311]].
topNumber1000optionalThe maximum height when it starts to rain, in meters.
countNumber2000optionalNumber of raindrops.
sizeNumber1.0optionalA multiple of the raindrop length, such as 1.5 means 1.5 times the existing effect.
speedNumber1.0optionalA multiple of the falling speed of raindrops, such as 1.5 means 1.5 times the existing effect.
opacityNumber0.8optionalRaindrop opacity, ranging from 0-1.
colorString#AAAAEEoptionalRaindrop color value.

addSnowSystem

Add snow animation, which can be removed in batches through the remove() method. Other parameters except the bounds parameter can be updated in batches through the update(options) method. For specific usage, please refer to Example.

Parameters

NameTypeDescription
optionsObjectRequiredparameter
nametypedefault valuedescription
boundsArrayRequiredThe geographical range of the snow animation, represented by the longitude and latitude of the southwest and northeast corners, in the shape of [[120.661, 31.299],[120.701, 31.311]].
topNumber1000optionalThe maximum height where snow starts to fall, in meters.
countNumber2000optionalNumber of snowflakes.
sizeNumber40optionalA multiple of the snowflake length, such as 1.5 means 1.5 times the existing effect.
speedNumber1.0optionalA multiple of the snowflake falling speed, such as 1.5 means 1.5 times the existing effect.
opacityNumber0.8optionalSnowflake opacity, ranging from 0-1.
colorString#FFFFFFoptionalSnowflake color value.

addSphere

Add a special effect ball model and return the model object. For specific usage, please refer to Example.

Parameters

NameTypeDescription
optionsObjectRequiredparameter
nametypedefault valuedescription
centerArrayRequiredCoordinates of the center of the sphere, [longitude, latitude, height].
colorString#ff0000optionalColor value.
hSegmentNumber16optionalThe number of vertical segments that make up the ball, the minimum value is 2.
opacityNumber1optionalOpacity, ranging from 0-1.
phiLengthNumber360°optionalSpecify the horizontal scanning angle size.
phiStartNumber0optionalSpecify the horizontal starting angle.
radiusNumber10optionalSphere radius, unit meter.
speedNumber3optionalHow fast the ball surface effect changes.
thetaLengthNumber180°optionalSpecify the vertical scanning angle size.
thetaStartNumber0optionalSpecify the vertical starting angle.
wSegmentNumber32optionalThe number of horizontal segments that make up the ball, the minimum value is 3.

addTextMarker

Add text labels. For specific usage, refer to Example.

Parameters

NameTypeDescription
optionsObjectRequiredparameter
nametypedefault valuedescription
dataArrayRequiredData parameters of the text label.
nametypedefault valuedescription
coordinateArrayRequiredThe position coordinate of the text label, in the form: [longitude, latitude, height].
textStringRequiredThe text content of the text label.
angleArray[0, 0, 0]optionalThe rotation angle of the text label, rotate around the X, Y, and Z axes respectively, with clockwise rotation as positive. In the scene, the positive direction of the X axis is due east, the positive direction of the Y axis is due south, and the positive direction of the Z axis is vertically upward.
colorString#000000optionalThe color of the text content font.
fontFamilyStringsans-serifoptionalType of text content font, supports CSS font type name.
fontSizeNumber10optionalThe size of the text content font.
letterSpacingNumber0optionalThe spacing between text content fonts.
typeStringhorizontaloptionalThe direction of the text label, the values ​​​​are "horizontal" and "vertical" represent horizontal and vertical respectively.

addTrackLines

Add people flow trajectory lines. For specific usage, refer to Example.

Parameters

NameTypeDescription
optionsObjectRequiredparameter
nametypedefault valuedescription
dataArrayRequiredCoordinate data that constitutes the trajectory line. Each trajectory line is composed of one coordinate point as a circle, two coordinate points as a line segment, and three or more coordinate points as a line segment or curve. See below for specific data format.
rangeArrayRequiredThe track line displays the area range, in the form of [[longitude, latitude], [longitude, latitude],...].
heightNumber0optionalThe track line displays the height of the plane, in meters.
resolutionNumber1024optionalCanvas width resolution, the larger the track line, the clearer it will be.
trackWidthNumber6optionalThe width of the track line is related to the resolution. The greater the resolution, the smaller the displayed line width.
trackColorString#63E8FFoptionalThe color of the track line.
callbackFunctionoptionalCallback function executed after the trajectory line is loaded.
nametypedescription
updateTrackLinesFunctionoptionalUpdate track line method, the parameter is data, and the description is consistent with the above data.
//Trajectory line data composed of one coordinate point
let data1 = [
[
[120, 30]
],
[
[120, 31]
],
......
]

//Trajectory line data composed of two coordinate points
let data2 = [
[
[120, 30],
[120, 31]
],
[
[121, 31],
[121, 30]
],
......
]

//Trajectory line data composed of three or more coordinate points
let data3 = [
[
[120, 30],
[120, 31]
[120, 32],
......
],
[
[121, 31],
[121, 30],
[121, 32],
......
],
......
]

changeModelTexture

Modify the 3D model texture of automated batch construction. Before modification, you need to set the texture rules. This is achieved through the above setTextureRules(options). For specific usage, please refer to Example.

Parameters

NameTypeDescription
optionsObjectRequiredparameter
nametypedescription
dataObjectRequiredSet the texture name and corresponding model number data, expressed in the form of key-value pairs.
nametypedescription
keyStringRequiredSet the texture name, corresponding to the "key" parameter value of textureData in the setTextureRules(options) interface.
valueArrayRequiredSet the model number array whose texture needs to be changed, expressed in array form such as [0,10,100], indicating the models labeled 0th, 10th, and 100th. The texture is modified to the texture segmentation block corresponding to key.
modelGroup/MeshRequiredThe model object that needs to be operated.

exportModel

Export the 3D model. For specific usage, please refer to Example.

Parameters

NameTypeDescription
modelGroupRequiredThe organizational structure of the corresponding glb file in the model object. A single model can be exported at a time.

fadeModels

Realize the model floating up and down animation.

Parameters

NameTypeDescription
duartionNumberRequiredModel animation duration, in milliseconds.
fromObjectRequiredInitial state of model motion.
nametypedescription
heightNumberRequiredInitial height of model movement.
opacityNumberRequiredInitial transparency of model movement.
modelsObject3DRequiredSingle model or model group.
toObjectRequiredModel movement end state.
nametypedescription
heightNumberRequiredModel movement end height.
opacityNumberRequiredModel movement ends transparency.

getInstancedModelId

Select the instantiated model based on the screen coordinates, and the return value is the id attribute information bound to the instantiated model. For specific usage, please refer to Example.

Parameters

NameTypeDescription
pointObjectRequiredScreen coordinates, such as {x: 1152, y: 643}.
objectObject3DRequiredThe model object returned by the addInstancedModel interface callback.

getIntersectCoordinate

Model surface coordinate picking, the return value is an array of [longitude, latitude, height], for specific usage, please refer to Example.

Parameters

NameTypeDescription
dataObjectRequired is a sub-item of the result array returned by layer.selectModel(point), such as layer.selectModel(point)[0].

getMarker3DId

Get the id attribute of the 3D label based on the screen coordinates. For specific usage, please refer to Example.

Parameters

NameTypeDescription
pointObjectRequiredScreen coordinates, in the form {x: 1152, y: 643}.
groupsObject/Array[Object]RequiredThe group returned in the addMarker3D interface callback function, or an array containing multiple groups.

getModelCenter

Get the geometric center coordinates of a model or model group. The return value is an array of [longitude, latitude, height]. For specific usage, please refer to Example.

Parameters

NameTypeDescription
objectObject3DRequiredModel or model group object.

highlightMergeBatchModel

Efficient picking and highlighting of 3D models built in automated batches are implemented based on the mouse click model picking results, and the number attribute of the picked model is returned. For specific usage, please refer to Example.

Parameters

NameTypeDescription
optionsObjectRequiredparameter
nametypedefault valuedescription
intersectObjectRequiredPick up model information, which is a sub-item of the result array returned by layer.selectModel(point), such as layer.selectModel(point)[0].
nameStringRequiredThe name attribute of the model contains a value, which is used to identify the model.
textureStringRequiredThe texture map path highlighted by the model.
colorStringrgb(231,201,122)optionalThe color of the model highlight.
faceCountNumber2optionalThe number of triangles in each model.

onAfterRender

Listen to the first rendering completion event of the loaded model. For specific usage, refer to Example.

Parameters

NameTypeDescription
groupObject3DRequiredThe model object or model group that needs to be monitored.
isAllBooleanoptionalIndicates whether to monitor the entire group. When this parameter is missing or false, it indicates that only the group part within the current screen range is monitored.

outlineModel

Model outline highlighting, the highlighting effects of the same layer are mutually exclusive. For specific usage, please refer to Example.

Parameters

NameTypeDescription
objectsObject3DRequiredModel object or model group.
optionsObjectoptionalparameter
nametypedefault valuedescription
scopeStringdefaultoptionalModel highlighting range, optional values ​​are: "layer": the entire modelLayer, "model": model file, such as glb, "default": the passed in object itself.
edgeStrengthNumber3.0optionalContour strength coefficient.
edgeGlowNumber0.0optionalOutline luminescence coefficient.
edgeColorNumber#ffff00optionalOutline color.
enableFillColorBooleantrueoptionalWhether the outline is filled with color.
fillColorOpacityNumber0.2optionalThe fill color opacity inside the outline.

recoveryModelTexture

Restore textures for 3D models built in automated batches.

Parameters

NameTypeDescription
modelGroup/MeshRequiredThe model object that needs to be operated comes from the model value in the above changeModelTexture(options) interface.

removeModel

Loaded models can be removed in the callback function.

Parameters

NameTypeDescription
groupObject3DRequiredThe model that needs to be removed.

removeModelByAttribute

Remove a single loaded model in the scene based on an attribute set by the model. For specific usage, please refer to Example.

Parameters

NameTypeDescription
keyStringRequiredThe name of the key attribute in the data.
valueStringRequiredThe value corresponding to the key attribute name of the model needs to be removed.

removeModelEffect

Remove the 3D model special effects. For specific usage, please refer to Example.

renderMarker3D

Render three-dimensional labels in real time so that they always face the screen. For specific usage, please refer to Example.

Parameters

NameTypeDescription
groupsObject/Array[Object]RequiredThe group returned in the addMarker3D interface callback function, or an array containing multiple groups.

selectModel

Select a model based on screen coordinates, and the return value is an array of selectable model information.

Parameters

NameTypeDescription
pointObjectRequiredScreen coordinates, such as {x: 1152, y: 643}.
objectObject/Array[Object]optionalSpecify the pickup range, which can be a model object or a model group. If no parameters are specified, it defaults to all models in the scene.

setRenderPassSync

Set whether the rendering queue synchronization parameter is turned on.

Parameters

NameTypeDescription
renderPassSyncBooleanRequiredSuitable for loading and displaying underground 3D models. When this parameter is turned on, the opaque material model will be rendered before the translucent surface to achieve the correct three-dimensional space effect. However, the rendering performance in this mode will be affected to a certain extent.

setTextureRules

Set the 3D model texture rules for automated batch construction. For specific usage, please refer to Example.

Parameters

NameTypeDescription
optionsObjectRequiredparameter
nametypedescription
faceCountNumberRequiredThe number of triangles in each model.
modelScene/MeshRequiredThe model object of the binding operation, if it is of Scene type, must contain only one Mesh in its children.
sizeArrayRequiredThe number of rows and columns of uniformly divided texture textures, expressed in the form of an array, such as [3,3], indicating that the texture image has a division of 3 rows and 3 columns.
textureDataObjectRequiredSet the texture name and corresponding texture coordinates, expressed in the form of key-value pairs.
nametypedescription
keyStringRequiredSet the texture name.
valueArrayRequiredSet texture coordinates, expressed in the form of a two-dimensional array, from left to right, top to bottom, such as [0,0], which represents the texture segmentation block in the first row and first column.
textureUrlStringRequiredTexture map path. The texture storage rules must be uniformly divided image resources, and the divided block in the upper left corner must be the texture corresponding to the model itself.

unhighlightMergeBatchModel

Remove highlighting for automated batch build models.

Parameters

NameTypeDescription
optionsObjectRequiredparameter
nametypedescription
nameStringRequiredThe name attribute of the model contains a value, which is used to identify the model.
objectObjectoptionalThe range of the model level where the highlight effect is removed can be used to quickly locate the level. If not set, it will be searched in the entire scene.

unOutlineModel

Cancel model outline highlighting. For specific usage, refer to Example.

updateInstancedModel

Large batches of models are updated as a whole, and the overall effect will be cleared before updating. It is suitable for rapid updating and display of large batches of scattered data. This interface is used in conjunction with addInstancedModel. For specific usage, refer to Example.

Parameters

NameTypeDescription
optionsObjectRequiredparameter
nametypedefault valuedescription
dataArray[Object]RequiredPoint coordinate data.
nametypedefault valuedescription
coordinateArray[Number]RequiredPoint coordinates, [longitude, latitude, height].
idStringoptionalUnique identifier information.
colorStringOriginal model coloroptionalColor information of a single model, in the form of "#ffffff".
rotationArray[Number][0,0,0]optionalThe rotation angle of a single model around the coordinate axis, the counterclockwise direction is positive, the angle value range is [0,360], the positive direction of the X-axis is due east, the positive direction of the Y-axis is vertically upward, and the positive direction of the Z-axis is due north.
modelObject3DRequiredThe model object returned by the addInstancedModel interface callback.
scaleNumber1optionalModel scaling factor.

updateInstancedModelById

Change the attribute information of a single model based on Id, including position, color and angle. It is suitable for model single operation and supports model color restoration. This interface can be used in conjunction with addInstancedModel. For specific usage, refer to Example.

Parameters

NameTypeDescription
optionsObjectRequiredparameter
nametypedefault valuedescription
dataArray[Object]RequiredPoint coordinate data.
nametypedescription
idStringRequiredUnique identifier information, which is the corresponding id in the addInstancedModel interface.
coordinateArray[Number]RequiredPoint coordinates, [longitude, latitude, height].
colorString/nulloptionalColor information of a single model, in the form of "#ffffff" or null. When the parameter is null, the color is the original color of the model.
rotationArray[Number]optionalThe rotation angle of a single model around the coordinate axis, the counterclockwise direction is positive, the angle value range is [0,360], the positive direction of the X-axis is due east, the positive direction of the Y-axis is vertically upward, and the positive direction of the Z-axis is due north.
scaleNumberoptionalModel scaling factor.
modelObject3DRequiredThe model object returned by the addInstancedModel interface callback.
clearColorBooleantrueoptionalWhether to clear the set model color.

updateParticle

Update particles. You can update particle coordinates, size, transparency and color. For specific usage, please refer to Example.

Parameters

NameTypeDescription
groupObject3DRequired The return value of addParticle.
optionsObjectRequiredparameter
nametypedefault valuedescription
dataArray[Object]RequiredPoint data. Adding custom attributes is not supported.
nametypedescription
coordinateArray[Number]RequiredPoint coordinates, [longitude, latitude, height].
colorStringrgb(255,255,255)optionalColor value.
opacityNumber1.0optionalOpacity, ranging from 0-1.
sizeNumber1optionalParticle size.