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
| name | type | describe |
|---|
| options | Object | Requiredparameter| Name | Type | Default | Description |
|---|
| data | Array[Object] | | RequiredPoint data. Custom properties can be added.| name | type | describe |
|---|
| coordinate | Array[Number] | RequiredPoint coordinates,[longitude,latitude,high]。 |
| | model | Object | | Required3D model resources, supportglb、gltf、obj、fbxType loading.| name | type | describe |
|---|
| mtl | String | RequiredMaterial file path, model format only type for "obj" effective when. | | type | String | RequiredModel format, value is "gltf"、"glb"、"obj"、"fbx"。 | | url | String | RequiredModel file path. | | dracoUrl | String | OptionalUnzipped library file path, only type for "glb" and "gltf" effective when. |
| | opacity | Number | 1 | Optionalopacity, range0-1between. | | scale | Number | 1 | OptionalModel scaling. |
|
addCircle
Add a dynamic circle model and return the model group object. Please refer to the specific usage.Example。
parameter
| name | type | describe |
|---|
| options | Object | Requiredparameter| Name | Type | Default | Description |
|---|
| center | Array | | Requiredcircle center coordinates,[longitude,latitude,high]。 | | type | String | | RequiredCircle type, the value is divided into "scan" 、 "spread" and "radar" Represents scanning circle, diffusion circle and radar circle. | | color | String | #FFFFFF | Optionalcolor value. | | isCW | Boolen | true | OptionalWhether clockwise, only type for "radar" effective when. | | opacity | Number | 1 | Optionalopacity, range0-1between. | | radius | Number | 10 | Optionalcircle radius,The unit is meters and the value is a positive number. | | segment | Number | 256 | OptionalThe number of patches that make up a circle, the value is a positive number. | | speed | Number | 3 | OptionalCircle 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
| name | type | describe |
|---|
| options | Object | Requiredparameter| Name | Type | Default | Description |
|---|
| data | Object | | RequiredPipeline data. Custom properties can be added.| name | type | describe |
|---|
| coordinate | Array[Number] | RequiredThe coordinates of the points that make up the pipeline,[[longitude,latitude,high],[longitude,latitude,high]]。 |
| | type | String | | RequiredCircular nozzle section type, value is "Circle"。 | | closed | Boolen | false | OptionalWhether the pipeline model is closed from end to end. | | color | String | #FFFFFF | Optionalcolor value. | | image | String | undefined | OptionalTexture path. | | opacity | Number | 1 | Optionalopacity, range0-1between. | | radius | Number | 1 | OptionalThe radius of the circular nozzle, in meters. | | repeatX | Number | 10 | OptionalRepeat the number along the pipeline path. | | repeatY | Number | 1 | OptionalNumber of repetitions around the pipeline direction. | | side | String | FrontSide | OptionalMaterial map surface settings, three types, "FrontSide" Front, "BackSide" back, "DoubleSide" Double sided. | | speed | Number | 1 | OptionalPipeline texture flow velocity. |
|
| name | type | describe |
|---|
| options | Object | Requiredparameter| Name | Type | Default | Description |
|---|
| data | Object | | RequiredPipeline data. Custom properties can be added.| name | type | describe |
|---|
| coordinate | Array[Number] | RequiredThe coordinates of the points that make up the pipeline,[[longitude,latitude,high],[longitude,latitude,high]]。 |
| | rectangle | Array | | RequiredThe side length of the rectangular tube mouth, such as [a,b],The unit is meters. | | type | String | | RequiredRectangular nozzle section type,The value is "Rectangle"。 | | color | String | #FFFFFF | Optionalcolor value. | | image | String | undefined | OptionalTexture path. | | opacity | Number | 1 | Optionalopacity, range0-1between. | | repeatX | Number | 10 | OptionalRepeat the number along the pipeline path. | | repeatY | Number | 1 | OptionalNumber of repetitions around the pipeline direction. | | side | String | FrontSide | OptionalMaterial map surface settings, three types, "FrontSide" Front, "BackSide" back, "DoubleSide" Double sided. | | speed | Number | 1 | OptionalPipeline texture flow velocity. | | steps | Number | 10 | OptionalNumber of points used to subdivide the segment along the extruded spline depth, can be compared with repeatX properties are used together. |
|
| name | type | describe |
|---|
| options | Object | Requiredparameter| Name | Type | Default | Description |
|---|
| data | Object | | Requiredline data. Custom properties can be added.| name | type | describe |
|---|
| coordinate | Array[Number] | RequiredThe coordinates of the points that make up the pipeline,[[longitude,latitude,high],[longitude,latitude,high]]。 |
| | type | String | | RequiredTrack line type, value is "trail"。 | | color | String | #003CFF | Optionalcolor value. | | opacity | Number | 1 | OptionalOpacity. | | speed | Number | 3 | OptionalFlow speed. | | width | Number | 10 | Optionalline width. |
|
| name | type | describe |
|---|
| options | Object | Requiredparameter| Name | Type | Default | Description |
|---|
| data | Object | | Requiredline data. Custom properties can be added.| name | type | describe |
|---|
| coordinate | Array[Number] | RequiredThe coordinates of the points that make up the pipeline,[[longitude,latitude,high],[longitude,latitude,high]]。 |
| | type | String | | RequiredFlying line type, the value is "flow"。 | | color | String | #ffff00 | Optionalcolor value. | | gradient | Number | 0.02 | OptionalBackground transparency. | | opacity | Number | 1 | OptionalOpacity. | | percent | Number | 0.08 | OptionalThe proportion of mobile parts. | | speed | Number | 3 | OptionalFlow speed. | | width | Number | 10 | Optionalline width. |
|
| name | type | describe |
|---|
| options | Object | Requiredparameter| Name | Type | Default | Description |
|---|
| data | Object | | Requiredline data. Custom properties can be added.| name | type | describe |
|---|
| coordinate | Array[Number] | RequiredThe coordinates of the points that make up the pipeline,[[longitude,latitude,high],[longitude,latitude,high]]。 |
| | image | String | | RequiredImage resource path. | | type | String | | RequiredDynamic pattern line type, value is "image"。 | | color | String | #FFFFFF | Optionalcolor value. | | opacity | String | 1 | OptionalOpacity. | | depthTest | Boolean | true | OptionalWhether to enable depth testing, that is, whether to enable occlusion. | | speed | Number | 3 | OptionalFlow speed. | | width | Number | 10 | Optionalline width. | | textureFactor | Number | 6 | OptionalThe 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
| name | type | describe |
|---|
| options | Object | Requiredparameter| Name | Type | Default | Description |
|---|
| data | Object | | RequiredFence data. Custom properties can be added.| name | type | describe |
|---|
| coordinate | Array[Number] | RequiredThe coordinates of the points that make up the fence,[[longitude,latitude,high],[longitude,latitude,high]]。 |
| | type | String | | Required3D geofence type, value divided into "diffuse" and "fade" ,Represents the visible and hidden trajectory fence. | | color | String | #FFFFFF | Optionalcolor value. | | height | Number | 1 | OptionalFence height. | | opacity | Number | 1 | Optionalopacity, range0-1between. | | speed | Number | 3.0 | OptionalThe fence changes speed. |
|
addLines
Add a three-dimensional line and return the model group object. Please refer to the specific usage.Example。
parameter
| name | type | describe |
|---|
| options | Object | Requiredparameter| Name | Type | Default | Description |
|---|
| data | Array[Object] | | Requiredline data. Custom properties can be added.| name | type | describe |
|---|
| coordinate | Array[Number] | RequiredThe coordinates of the points that make up the line,[[longitude,latitude,high],[longitude,latitude,high]]。 |
| | image | String | | RequiredImage resource path, only in type for "image" effective when. | | color | String | #FFFFFF | Optionalcolor value . | | opacity | Number | 1 | Optionalopacity, range0-1between. | | repeat | Object | {x: 1, y: 1} | OptionalPicture atx、yNumber of tiles in the direction, only in type for "image" effective when. | | type | String | pipe | OptionalThree-dimensional line type, supporting pipelines (pipe)、Solid line (solid)、dotted line(dash)、pattern line (image)type. | | width | Number | 1/10 | OptionalLine 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
| name | type | describe |
|---|
| options | Object | Requiredparameter| Name | Type | Default | Description |
|---|
| data | Array | | RequiredLabel data in batches.| name | type | describe |
|---|
| element | HTMLElement | Requiredas a markDOMelement. | | position | Array | RequiredMark the point coordinates,[longitude,latitude,high]。 |
| | id | String | | Requiredlabel layerid,only. | | avoidance | Boolen | false | OptionalWhether to enable label avoidance. |
|
addModel
You can load the model in meters and manipulate the model in the callback function.
parameter
| name | type | describe |
|---|
| options | Object | Requiredparameter| Name | Type | Default | Description |
|---|
| callback | Function | | OptionalThe callback function executed after the model is loaded.| name | type | describe |
|---|
| group | Object3D | RequiredObject3DObject that contains a series of methods for operating the model. | | layer | ModelLayer | Required3D layer instance. |
| | center | Array | [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。 | | models | Array | | OptionalInitial loaded 3D model resources.| name | type | describe |
|---|
| model | Object | RequiredSingle 3D model resource, supportglb、gltf、obj、fbxType loading.| name | type | describe |
|---|
| mtl | String | RequiredMaterial file path, only type for "obj" effective when. | | type | String | RequiredModel format, value is "gltf"、"glb"、"obj"、"fbx"。 | | url | String | RequiredModel file path. | | dracoUrl | String | OptionalUnzipped 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
| name | type | describe |
|---|
| model | Object3D | Required3D model object. |
| options | Array[Object] | RequiredModel special effects array, the effects can be superimposed.| name | type | describe |
|---|
| option1 | Object | Requiredparameter| Name | Type | Default | Description |
|---|
| type | String | | RequiredModel gradient type, bottom-up gradient, value is "gradient"。 | | endColor | String | #FFFFFF | OptionalEnd color value. | | percent | Number | 0.5 | OptionalGradient scale, range0-1between. | | startColor | String | #040912 | OptionalStarting color value. |
| | option2 | Object | Requiredparameter| Name | Type | Default | Description |
|---|
| type | String | | RequiredThe model’s own sweeping effect type, changing from bottom to top, with a value of "flow"。 | | color | String | #339bf6 | Optionalcolor value. | | percent | Number | 0.01 | OptionalThe width of the sweep bar is the proportion of the entire model. | | speed | Number | 3.0 | OptionalGradient scale. |
|
|
addModelMercator
Can be loaded in callback function3857Model in the coordinate system and operate the model and parametersmodels、center、callback Same as described above.
addParticle
Load particles and return the model group object.
parameter
| name | type | describe |
|---|
| options | Object | Requiredparameter| Name | Type | Default | Description |
|---|
| data | Array[Object] | | RequiredPoint data. Adding custom attributes is not supported.| name | type | describe |
|---|
| coordinate | Array[Number] | RequiredPoint coordinates,[longitude,latitude,high],Only supportsCGCS2000coordinate. |
| | color | String | rgb(255,255,255) | Optionalcolor value. | | maxPoints | Number | | OptionalMaximum points, if needed updateParticle To update points, please enter the maximum number of points. The default is all points of the current data. | | opacity | Number | 1.0 | Optionalopacity, range0-1between. | | size | Number | 1 | Optionalparticle size. |
|
addPoints
Add 3D point models in batches and return model group objects. Please refer to the specific usage.Example。
parameter
| name | type | describe |
|---|
| options | Object | Requiredparameter| Name | Type | Default | Description |
|---|
| data | Array[Object] | | RequiredPoint data. Custom properties can be added.| name | type | describe |
|---|
| coordinate | Array[Number] | RequiredPoint coordinates,[longitude,latitude,high]。 |
| | type | String | | RequiredModel format, value is "cube" cube sum "sphere" round ball. | | color | String/Number | #FFFFFF | OptionalColor value, color value accepts string or hexadecimal representation. | | opacity | Number | 1 | Optionalopacity, range0-1between. | | size | Number | 1 | OptionalThe 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
| name | type | describe |
|---|
| options | Object | Requiredparameter| Name | Type | Default | Description |
|---|
| data | Array[Object] | | Requiredsurface data. Custom properties can be added.| name | type | describe |
|---|
| coordinate | Array[Number] | RequiredThe coordinates of the points that make up the surface,[[longitude,latitude,high],[longitude,latitude,high]]。 |
| | color | String/Number | #FFFFFF | OptionalColor value, color value accepts string or hexadecimal representation. | | opacity | Number | 1 | Optionalopacity, range0-1between. | | side | String | FrontSide | OptionalMaterial 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
| name | type | describe |
|---|
| options | Object | Requiredparameter| Name | Type | Default | Description |
|---|
| data | Array | | RequiredThe coordinates of the points that make up the line,[[longitude,latitude,high],[longitude,latitude,high]]。 | | height | Number | | RequiredPlane lift height. | | color | String/Number | #FFFFFF | OptionalColor value, color value accepts string or hexadecimal representation. | | image | String | | OptionalTexture path. | | opacity | Number | 1 | Optionalopacity, range0-1between. |
|
addPyramid
Add a vertebral body model and return the model group object. Please refer to the specific usage.Example。
parameter
| name | type | describe |
|---|
| options | Object | Requiredparameter| Name | Type | Default | Description |
|---|
| basePoints | Array | | RequiredPyramid base data, point coordinates that make up the base,[[longitude,latitude,high],[longitude,latitude,high]],The points are in clockwise order. | | topColor | Array[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. | | topPoint | Array | | RequiredPyramid vertex data,[longitude,latitude,high]。 | | baseColor | String/Number | | OptionalThe 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. | | opacity | Number | 1 | Optionalopacity, range0-1between. | | side | String | FrontSide | OptionalMaterial 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
| name | type | describe |
|---|
| options | Object | Requiredparameter| Name | Type | Default | Description |
|---|
| center | Array | | RequiredThe coordinates of the center of the sphere,[longitude,latitude,high]。 | | color | String | #ff0000 | Optionalcolor value. | | hSegment | Number | 16 | OptionalThe number of vertical segments that make up the ball, minimum value is2。 | | opacity | Number | 1 | Optionalopacity, range0-1between. | | phiLength | Number | 360° | OptionalSpecify the horizontal scan angle size. | | phiStart | Number | 0 | OptionalSpecifies the horizontal starting angle. | | radius | Number | 10 | Optionalball radius,The unit is meters. | | speed | Number | 3 | OptionalThe speed at which ball surface effects change. | | thetaLength | Number | 180° | OptionalSpecify the vertical scan angle size. | | thetaStart | Number | 0 | OptionalSpecifies the vertical starting angle. | | wSegment | Number | 32 | OptionalThe 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
| name | type | describe |
|---|
| options | Object | Requiredparameter| name | type | describe |
|---|
| data | Object | RequiredSet the texture name and corresponding model number data, expressed in the form of key-value pairs.| name | type | describe |
|---|
| key | String | RequiredSet the texture name, corresponding to setTextureRules(options) in interface textureData of "key" parameter value. | | value | Array | RequiredSet 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. |
| | model | Group/Mesh | RequiredThe 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
| name | type | describe |
|---|
| options | Object | Requiredparameter| Name | Type | Default | Description |
|---|
| mesh | Mesh | | RequiredOuter box model object, creatClassificationBox(options) Return value. | | color | String | #ff0000 | OptionalSingletary color values. | | opacity | Number | 0.5 | OptionalSingletify 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
| name | type | describe |
|---|
| options | Object | Requiredparameter| Name | Type | Default | Description |
|---|
| coordinate | Array[Number] | | RequiredThe point coordinates of the outer box in the two-dimensional space,[[longitude,latitude],[longitude,latitude]]。 | | stretchHeight | Number | | RequiredThe stretched height of the outer box in the vertical direction, in meters, is a positive number. | | baseHeight | Number | 0 | OptionalThe starting height of the outer box, in meters, is a positive number. | | color | String | #ff0000 | OptionalSingletary color values. |
|
exportModel
Export 3D model, please refer to the specific usage.Example。
parameter
| name | type | describe |
|---|
| model | Group | RequiredCorresponding 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
| name | type | describe |
|---|
| duartion | Number | RequiredModel animation duration, in milliseconds. |
| from | Object | RequiredThe initial state of model motion.| name | type | describe |
|---|
| height | Number | RequiredThe initial height of model movement. | | opacity | Number | RequiredModel motion initial transparency. |
|
| models | Object3D | RequiredA single model or a group of models. |
| to | Object | RequiredThe end state of model movement.| name | type | describe |
|---|
| height | Number | RequiredThe end height of model movement. | | opacity | Number | RequiredModel movement ends transparency. |
|
getIntersectCoordinate
Model surface coordinate picking, the return value is[longitude,latitude,high]Array, please refer to the specific usageExample。
parameter
| name | type | describe |
|---|
| data | Object | Requiredyes 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
| name | type | describe |
|---|
| object | Object3D | RequiredA 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
| name | type | describe |
|---|
| options | Object | Requiredparameter| Name | Type | Default | Description |
|---|
| intersect | Object | | RequiredPick up model information, yes layer.selectModel(point) Returns the children of the result array, such as layer.selectModel(point)[0] 。 | | name | String | | RequiredmodelnameProperties contain values that identify the model. | | texture | String | | RequiredTexture map path for model highlighting. | | color | String | rgb(231,201,122) | OptionalThe color of the model highlight. | | faceCount | Number | 2 | OptionalNumber of triangles per model. |
|
onAfterRender
Listen to the first rendering completion event of the loaded model. Specific usage referenceExample。
parameter
| name | type | describe |
|---|
| group | Object3D | RequiredThe model object or model group that needs to be monitored. |
| isAll | Boolen | OptionalIndicates 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
| name | type | describe |
|---|
| model | Group/Mesh | RequiredThe 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
| name | type | describe |
|---|
| group | Object3D | RequiredModel 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
| name | type | describe |
|---|
| key | String | RequiredKey attribute names in the data. |
| value | String | RequiredThe 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
| name | type | describe |
|---|
| point | Object | Requiredscreen coordinates, such as {x: 1152, y: 643} 。 |
| object | Object/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
| name | type | describe |
|---|
| exposure | Number | Requiredgreater than0exposure value. |
setTextureRules
Set the 3D model texture rules for automated batch construction. Please refer to the specific usage.Example。
parameter
| name | type | describe |
|---|
| options | Object | Requiredparameter| name | type | describe |
|---|
| faceCount | Number | RequiredNumber of triangles per model. | | model | Scene/Mesh | RequiredModel object for binding operations,in the case of Scene type, itschildrenmust contain only one Mesh。 | | size | Array | RequiredThe 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. | | textureData | Object | RequiredSet the texture name and corresponding texture coordinates, expressed in the form of key-value pairs.| name | type | describe |
|---|
| key | String | RequiredSet texture name. | | value | Array | RequiredSet 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. |
| | textureUrl | String | RequiredTexture 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
| name | type | describe |
|---|
| options | Object | Requiredparameter| name | type | describe |
|---|
| name | String | RequiredmodelnameProperties contain values that identify the model. | | object | Object | OptionalThe 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
| name | type | describe |
|---|
| group | Object3D | Required addParticle return value. |
| options | Object | Requiredparameter| Name | Type | Default | Description |
|---|
| data | Array[Object] | | RequiredPoint data. Adding custom attributes is not supported.| name | type | describe |
|---|
| coordinate | Array[Number] | RequiredPoint coordinates,[longitude,latitude,high],Only supportsCGCS2000coordinate. |
| | color | String | rgb(255,255,255) | Optionalcolor value. | | opacity | Number | 1.0 | Optionalopacity, range0-1between. | | size | Number | 1 | Optionalparticle size. |
|