Skip to main content

ModelLayer

method

addBatchModel

Similar models can be loaded in batches, and the models can be operated in the callback function.callback Same as described above. Specific usage referenceExample

parameter

nametypedescribe
optionsObjectRequiredparameter
NameTypeDefaultDescription
dataArray[Object]RequiredPoint data. Custom properties can be added.
nametypedescribe
coordinateArray[Number]RequiredPoint coordinates,[longitude,latitude,high]。
modelObjectRequired3D model resources, supportglb、gltf、obj、fbxType loading.
nametypedescribe
mtlStringRequiredMaterial file path, model format only type for "obj" effective when.
typeStringRequiredModel format, value is "gltf"、"glb"、"obj"、"fbx"。
urlStringRequiredModel file path.
dracoUrlStringOptionalUnzipped library file path, only type for "glb" and "gltf" effective when.
opacityNumber1Optionalopacity, range0-1between.
scaleNumber1OptionalModel scaling.

addCircle

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

parameter

nametypedescribe
optionsObjectRequiredparameter
NameTypeDefaultDescription
centerArrayRequiredcircle center coordinates,[longitude,latitude,high]。
typeStringRequiredCircle type, the value is divided into "scan" 、 "spread" and "radar" Represents scanning circle, diffusion circle and radar circle.
colorString#FFFFFFOptionalcolor value.
isCWBoolentrueOptionalWhether clockwise, only type for "radar" effective when.
opacityNumber1Optionalopacity, range0-1between.
radiusNumber10Optionalcircle radius,The unit is meters and the value is a positive number.
segmentNumber256OptionalThe number of patches that make up a circle, the value is a positive number.
speedNumber3OptionalCircle change speed, the value is a positive number.

addFlowLine

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

parameter

  • circular pipeline
nametypedescribe
optionsObjectRequiredparameter
NameTypeDefaultDescription
dataObjectRequiredPipeline data. Custom properties can be added.
nametypedescribe
coordinateArray[Number]RequiredThe coordinates of the points that make up the pipeline,[[longitude,latitude,high],[longitude,latitude,high]]。
typeStringRequiredCircular nozzle section type, value is "Circle"。
closedBoolenfalseOptionalWhether the pipeline model is closed from end to end.
colorString#FFFFFFOptionalcolor value.
imageStringundefinedOptionalTexture path.
opacityNumber1Optionalopacity, range0-1between.
radiusNumber1OptionalThe radius of the circular nozzle, in meters.
repeatXNumber10OptionalRepeat the number along the pipeline path.
repeatYNumber1OptionalNumber of repetitions around the pipeline direction.
sideStringFrontSideOptionalMaterial map surface settings, three types, "FrontSide" Front, "BackSide" back, "DoubleSide" Double sided.
speedNumber1OptionalPipeline texture flow velocity.
  • Rectangular pipeline
nametypedescribe
optionsObjectRequiredparameter
NameTypeDefaultDescription
dataObjectRequiredPipeline data. Custom properties can be added.
nametypedescribe
coordinateArray[Number]RequiredThe coordinates of the points that make up the pipeline,[[longitude,latitude,high],[longitude,latitude,high]]。
rectangleArrayRequiredThe side length of the rectangular tube mouth, such as [a,b],The unit is meters.
typeStringRequiredRectangular nozzle section type,The value is "Rectangle"。
colorString#FFFFFFOptionalcolor value.
imageStringundefinedOptionalTexture path.
opacityNumber1Optionalopacity, range0-1between.
repeatXNumber10OptionalRepeat the number along the pipeline path.
repeatYNumber1OptionalNumber of repetitions around the pipeline direction.
sideStringFrontSideOptionalMaterial map surface settings, three types, "FrontSide" Front, "BackSide" back, "DoubleSide" Double sided.
speedNumber1OptionalPipeline texture flow velocity.
stepsNumber10OptionalNumber of points used to subdivide the segment along the extruded spline depth, can be compared with repeatX properties are used together.
  • trajectory line
nametypedescribe
optionsObjectRequiredparameter
NameTypeDefaultDescription
dataObjectRequiredline data. Custom properties can be added.
nametypedescribe
coordinateArray[Number]RequiredThe coordinates of the points that make up the pipeline,[[longitude,latitude,high],[longitude,latitude,high]]。
typeStringRequiredTrack line type, value is "trail"。
colorString#003CFFOptionalcolor value.
opacityNumber1OptionalOpacity.
speedNumber3OptionalFlow speed.
widthNumber10Optionalline width.
  • fly line
nametypedescribe
optionsObjectRequiredparameter
NameTypeDefaultDescription
dataObjectRequiredline data. Custom properties can be added.
nametypedescribe
coordinateArray[Number]RequiredThe coordinates of the points that make up the pipeline,[[longitude,latitude,high],[longitude,latitude,high]]。
typeStringRequiredFlying line type, the value is "flow"。
colorString#ffff00Optionalcolor value.
gradientNumber0.02OptionalBackground transparency.
opacityNumber1OptionalOpacity.
percentNumber0.08OptionalThe proportion of mobile parts.
speedNumber3OptionalFlow speed.
widthNumber10Optionalline width.
  • Dynamic pattern lines
nametypedescribe
optionsObjectRequiredparameter
NameTypeDefaultDescription
dataObjectRequiredline data. Custom properties can be added.
nametypedescribe
coordinateArray[Number]RequiredThe coordinates of the points that make up the pipeline,[[longitude,latitude,high],[longitude,latitude,high]]。
imageStringRequiredImage 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 map in the flow direction. The larger the value, the greater the compression strength. The range 0-10。

addGeoFencing

Add a 3D geofence model and return the model group object. Please refer to the specific usage.Example

parameter

nametypedescribe
optionsObjectRequiredparameter
NameTypeDefaultDescription
dataObjectRequiredFence data. Custom properties can be added.
nametypedescribe
coordinateArray[Number]RequiredThe coordinates of the points that make up the fence,[[longitude,latitude,high],[longitude,latitude,high]]。
typeStringRequired3D geofence type, value divided into "diffuse" and "fade" ,Represents the visible and hidden trajectory fence.
colorString#FFFFFFOptionalcolor value.
heightNumber1OptionalFence height.
opacityNumber1Optionalopacity, range0-1between.
speedNumber3.0OptionalThe fence changes speed.

addLines

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

parameter

nametypedescribe
optionsObjectRequiredparameter
NameTypeDefaultDescription
dataArray[Object]Requiredline data. Custom properties can be added.
nametypedescribe
coordinateArray[Number]RequiredThe coordinates of the points that make up the line,[[longitude,latitude,high],[longitude,latitude,high]]。
imageStringRequiredImage resource path, only in type for "image" effective when.
colorString#FFFFFFOptionalcolor value .
opacityNumber1Optionalopacity, range0-1between.
repeatObject{x: 1, y: 1}OptionalPicture atx、yNumber of tiles in the direction, only in type for "image" effective when.
typeStringpipeOptionalThree-dimensional line type, supporting pipelines (pipe)、Solid line (solid)、dotted line(dash)、pattern line (image)type.
widthNumber1/10OptionalLine width, when type for "pipe" , the default is1,Other types default to10。

addMarker

To add 3D point annotations in batches, you need tooptions.funcRenderUsed together, return thedomAn object of element groups, accessible viaremove()Methods for batch removal can be passedupdate()Method to update locations in batches, please refer to the specific usage.Example

parameter

nametypedescribe
optionsObjectRequiredparameter
NameTypeDefaultDescription
dataArrayRequiredLabel data in batches.
nametypedescribe
elementHTMLElementRequiredas a markDOMelement.
positionArrayRequiredMark the point coordinates,[longitude,latitude,high]。
idStringRequiredlabel layerid,only.
avoidanceBoolenfalseOptionalWhether to enable label avoidance.

addModel

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

parameter

nametypedescribe
optionsObjectRequiredparameter
NameTypeDefaultDescription
callbackFunctionOptionalThe callback function executed after the model is loaded.
nametypedescribe
groupObject3DRequiredObject3DObject that contains a series of methods for operating the model.
layerModelLayerRequired3D layer instance.
centerArray[0, 0, 0]OptionalSet the geographical spatial coordinates of the world origin of the 3D model, and use the coordinate systemWGS84coordinate. If setmodels,must be set. example:[lng, lat, height],If defaultheight,Default is0。
modelsArrayOptionalInitial loaded 3D model resources.
nametypedescribe
modelObjectRequiredSingle 3D model resource, supportglb、gltf、obj、fbxType loading.
nametypedescribe
mtlStringRequiredMaterial file path, only type for "obj" effective when.
typeStringRequiredModel format, value is "gltf"、"glb"、"obj"、"fbx"。
urlStringRequiredModel file path.
dracoUrlStringOptionalUnzipped library file path, only type for "glb" and "gltf" effective when.

addModelEffect

Add 3D model special effects, requiring the model to beYThe axis is facing upward, please refer to the specific usage.Example

parameter

nametypedescribe
modelObject3DRequired3D model object.
optionsArray[Object]RequiredModel special effects array, the effects can be superimposed.
nametypedescribe
option1ObjectRequiredparameter
NameTypeDefaultDescription
typeStringRequiredModel gradient type, bottom-up gradient, value is "gradient"。
endColorString#FFFFFFOptionalEnd color value.
percentNumber0.5OptionalGradient scale, range0-1between.
startColorString#040912OptionalStarting color value.
option2ObjectRequiredparameter
NameTypeDefaultDescription
typeStringRequiredThe model’s own sweeping effect type, changing from bottom to top, with a value of "flow"。
colorString#339bf6Optionalcolor value.
percentNumber0.01OptionalThe width of the sweep bar is the proportion of the entire model.
speedNumber3.0OptionalGradient scale.

addModelMercator

Can be loaded in callback function3857Model in the coordinate system and operate the model and parametersmodelscentercallback Same as described above.

addParticle

Load particles and return the model group object.

parameter

nametypedescribe
optionsObjectRequiredparameter
NameTypeDefaultDescription
dataArray[Object]RequiredPoint data. Adding custom attributes is not supported.
nametypedescribe
coordinateArray[Number]RequiredPoint coordinates,[longitude,latitude,high],Only supportsCGCS2000coordinate.
colorStringrgb(255,255,255)Optionalcolor value.
maxPointsNumberOptionalMaximum points, if needed updateParticle To update points, please enter the maximum number of points. The default is all points of the current data.
opacityNumber1.0Optionalopacity, range0-1between.
sizeNumber1Optionalparticle size.

addPoints

Add 3D point models in batches and return model group objects. Please refer to the specific usage.Example

parameter

nametypedescribe
optionsObjectRequiredparameter
NameTypeDefaultDescription
dataArray[Object]RequiredPoint data. Custom properties can be added.
nametypedescribe
coordinateArray[Number]RequiredPoint coordinates,[longitude,latitude,high]。
typeStringRequiredModel format, value is "cube" cube sum "sphere" round ball.
colorString/Number#FFFFFFOptionalColor value, color value accepts string or hexadecimal representation.
opacityNumber1Optionalopacity, range0-1between.
sizeNumber1OptionalThe size, in meters, represents the edge length and radius respectively.

addPolygons

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

parameter

nametypedescribe
optionsObjectRequiredparameter
NameTypeDefaultDescription
dataArray[Object]Requiredsurface data. Custom properties can be added.
nametypedescribe
coordinateArray[Number]RequiredThe coordinates of the points that make up the surface,[[longitude,latitude,high],[longitude,latitude,high]]。
colorString/Number#FFFFFFOptionalColor value, color value accepts string or hexadecimal representation.
opacityNumber1Optionalopacity, range0-1between.
sideStringFrontSideOptionalMaterial map surface settings, three types, "FrontSide" Front, "BackSide" back, "DoubleSide" Double sided.

addPolygonByLine

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

parameter

nametypedescribe
optionsObjectRequiredparameter
NameTypeDefaultDescription
dataArrayRequiredThe coordinates of the points that make up the line,[[longitude,latitude,high],[longitude,latitude,high]]。
heightNumberRequiredPlane lift height.
colorString/Number#FFFFFFOptionalColor value, color value accepts string or hexadecimal representation.
imageStringOptionalTexture path.
opacityNumber1Optionalopacity, range0-1between.

addPyramid

Add a vertebral body model and return the model group object. Please refer to the specific usage.Example

parameter

nametypedescribe
optionsObjectRequiredparameter
NameTypeDefaultDescription
basePointsArrayRequiredPyramid base data, point coordinates that make up the base,[[longitude,latitude,high],[longitude,latitude,high]],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"] ,Represents a color gradient from top to bottom, only accepting a maximum of two colors.
topPointArrayRequiredPyramid vertex data,[longitude,latitude,high]。
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, range0-1between.
sideStringFrontSideOptionalMaterial map surface settings, three types, "FrontSide" Front, "BackSide" back, "DoubleSide" Double sided.

addSphere

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

parameter

nametypedescribe
optionsObjectRequiredparameter
NameTypeDefaultDescription
centerArrayRequiredThe coordinates of the center of the sphere,[longitude,latitude,high]。
colorString#ff0000Optionalcolor value.
hSegmentNumber16OptionalThe number of vertical segments that make up the ball, minimum value is2。
opacityNumber1Optionalopacity, range0-1between.
phiLengthNumber360°OptionalSpecify the horizontal scan angle size.
phiStartNumber0OptionalSpecifies the horizontal starting angle.
radiusNumber10Optionalball radius,The unit is meters.
speedNumber3OptionalThe speed at which ball surface effects change.
thetaLengthNumber180°OptionalSpecify the vertical scan angle size.
thetaStartNumber0OptionalSpecifies the vertical starting angle.
wSegmentNumber32OptionalThe number of horizontal segments that make up the ball, minimum value is3。

changeModelTexture

Modify the texture of the 3D model automatically built in batches. Before modification, you need to set the texture rules. Through the abovesetTextureRules(options)Implementation, specific usage referenceExample

parameter

nametypedescribe
optionsObjectRequiredparameter
nametypedescribe
dataObjectRequiredSet the texture name and corresponding model number data, expressed in the form of key-value pairs.
nametypedescribe
keyStringRequiredSet the texture name, corresponding to setTextureRules(options) in interface textureData of "key" parameter value.
valueArrayRequiredSet the model number array whose texture needs to be changed, expressed in the form of an array, such as[0,10,100],Indicates that the label is the0first, first10and th100model, the texture is modified to key The corresponding texture segmentation block.
modelGroup/MeshRequiredThe model object that needs to be manipulated.

classify3DTiles

Combined with the outer bounding box model, the internal3DtilesSingleton effect, returns the singleton model object, please refer to the specific usage.Example

parameter

nametypedescribe
optionsObjectRequiredparameter
NameTypeDefaultDescription
meshMeshRequiredOuter box model object, creatClassificationBox(options) Return value.
colorString#ff0000OptionalSingletary color values.
opacityNumber0.5OptionalSingletify effect opacity, range0-1between.

creatClassificationBox

Create an outer bounding box model based on the spatial range and return the model object. Please refer to the specific usage.Example

parameter

nametypedescribe
optionsObjectRequiredparameter
NameTypeDefaultDescription
coordinateArray[Number]RequiredThe point coordinates of the outer box in the two-dimensional space,[[longitude,latitude],[longitude,latitude]]。
stretchHeightNumberRequiredThe stretched height of the outer box in the vertical direction, in meters, is a positive number.
baseHeightNumber0OptionalThe starting height of the outer box, in meters, is a positive number.
colorString#ff0000OptionalSingletary color values.

exportModel

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

parameter

nametypedescribe
modelGroupRequiredCorresponding in the model object glb The file is organized so that a single model can be exported at a time.

fadeModels

Realize the model floating up and down animation.

parameter

nametypedescribe
duartionNumberRequiredModel animation duration, in milliseconds.
fromObjectRequiredThe initial state of model motion.
nametypedescribe
heightNumberRequiredThe initial height of model movement.
opacityNumberRequiredModel motion initial transparency.
modelsObject3DRequiredA single model or a group of models.
toObjectRequiredThe end state of model movement.
nametypedescribe
heightNumberRequiredThe end height of model movement.
opacityNumberRequiredModel movement ends transparency.

getIntersectCoordinate

Model surface coordinate picking, the return value is[longitude,latitude,high]Array, please refer to the specific usageExample

parameter

nametypedescribe
dataObjectRequiredyes layer.selectModel(point) Returns the children of the result array, such as layer.selectModel(point)[0]。

getModelCenter

Get the geometric center coordinates of a model or model group,The return value is[longitude,latitude,high]Array, please refer to the specific usageExample

parameter

nametypedescribe
objectObject3DRequiredA model or model group object.

highlightMergeBatchModel

Realize efficient picking and highlighting of 3D models built in automated batches based on mouse click model picking results, and return the number attribute of the picked model. Please refer to the specific usage.Example

parameter

nametypedescribe
optionsObjectRequiredparameter
NameTypeDefaultDescription
intersectObjectRequiredPick up model information, yes layer.selectModel(point) Returns the children of the result array, such as layer.selectModel(point)[0] 。
nameStringRequiredmodelnameProperties contain values ​​that identify the model.
textureStringRequiredTexture map path for model highlighting.
colorStringrgb(231,201,122)OptionalThe color of the model highlight.
faceCountNumber2OptionalNumber of triangles per model.

onAfterRender

Listen to the first rendering completion event of the loaded model. Specific usage referenceExample

parameter

nametypedescribe
groupObject3DRequiredThe model object or model group that needs to be monitored.
isAllBoolenOptionalIndicates whether to monitor the entire group ,This parameter is missing or is false means only monitoring the current screen range group part.

recoveryModelTexture

Restore textures for 3D models built in automated batches.

parameter

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

removeModel

Loaded models can be removed in the callback function.

parameter

nametypedescribe
groupObject3DRequiredModel needs to be removed.

removeModelByAttribute

Remove a single model that has been loaded in the scene based on a certain attribute set by the model. Please refer to the specific usage.Example

parameter

nametypedescribe
keyStringRequiredKey attribute names in the data.
valueStringRequiredThe value corresponding to the key attribute name of the model needs to be removed.

removeModelEffect

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

selectModel

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

parameter

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

setExposure

Set the exposure value in the three-dimensional scene.

parameter

nametypedescribe
exposureNumberRequiredgreater than0exposure value.

setTextureRules

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

parameter

nametypedescribe
optionsObjectRequiredparameter
nametypedescribe
faceCountNumberRequiredNumber of triangles per model.
modelScene/MeshRequiredModel object for binding operations,in the case of Scene type, itschildrenmust contain only one Mesh。
sizeArrayRequiredThe number of row and column numbers that the texture is evenly divided into, expressed in the form of an array, such as[3,3],Indicates that the texture image has3OK3Column splitting.
textureDataObjectRequiredSet the texture name and corresponding texture coordinates, expressed in the form of key-value pairs.
nametypedescribe
keyStringRequiredSet texture name.
valueArrayRequiredSet the texture coordinates, expressed in the form of a two-dimensional array, from left to right, top to bottom, such as[0,0],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.

parameter

nametypedescribe
optionsObjectRequiredparameter
nametypedescribe
nameStringRequiredmodelnameProperties contain values ​​that 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.

updateParticle

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

parameter

nametypedescribe
groupObject3DRequired addParticle return value.
optionsObjectRequiredparameter
NameTypeDefaultDescription
dataArray[Object]RequiredPoint data. Adding custom attributes is not supported.
nametypedescribe
coordinateArray[Number]RequiredPoint coordinates,[longitude,latitude,high],Only supportsCGCS2000coordinate.
colorStringrgb(255,255,255)Optionalcolor value.
opacityNumber1.0Optionalopacity, range0-1between.
sizeNumber1Optionalparticle size.