Extends
Methods
- 
    add(data, fn)
- 
    
    添加一个或多个Polygon3D对象 如何获取自定义材质路径(material)见如下动图: 
  如何获取自定义材质包含的参数请调用如下方法: 
 let res = await fdapi.misc.getMaterial(material);
 let params = res.data[0].params;Parameters:Name Type Description dataobject | array 数据结构,支持对象或数组,对于每一个对象支持以下属性: - 
id (string) 字符串类型的ID 
- 
groupId (string) 可选,Group分组 
- 
userData (string) 可选,用户自定义数据 
- 
coordinates (array) 多边形坐标数组,取值示例 
- 
coordinateType (number) 坐标系类型,取值范围:0为Projection类型,1为WGS84类型,2为火星坐标系(GCJ02),3为百度坐标系(BD09),默认值:0 
- 
color (Color) 颜色值,支持四种格式,取值示例 
- 
height (number) 3D多边形的高度,取值范围:[任意正数] 
- 
intensity (number) 亮度,取值范围:[0~1000] 
- 
viewHeightRange (array) 可见高度范围:[最小可见高度, 远最大可见高度],默认值: [-1000000000, 1000000000] 
- 
style (number) 3DPolygon的样式,参考 Polygon3DStyle
- 
tillingX (number) 可选参数,仅当3DPolygon的样式支持贴图显示时,设置贴图横向平铺,取值范围:[任意数值] 
- 
tillingY (number) 可选参数,仅当3DPolygon的样式支持贴图显示时,设置贴图纵向平铺,取值范围:[任意数值] 
- 
material (string) 可选参数,自定义材质路径,即资源库PAK文件里材质文件的路径,设置自定义材质参数后style相关参数会失效 
- 
scalarParameters (array) 可选参数,仅在设置自定义材质路径后生效,自定义材质数值类型参数,包含name/value键值对的数组,其中value为数值,格式示例:[{"name":"不透明度","value":0.5},{"name":"UV重复","value":1.0}] 
- 
vectorParameters (array) 可选参数,仅在设置自定义材质路径后生效,自定义材质矢量类型参数,包含name/value键值对的数组,其中value为数组,格式示例:[{"name":"color1","value":[1,1,1,1]},{"name":"color2","value":[1,0,0,1]}] 
- 
generateTop (boolean) 可选参数,设置自定义材质路径后生效,是否生成顶面,默认:true 
- 
generateSide (boolean) 可选参数,设置自定义材质路径后生效,是否生成侧面,默认:true 
- 
generateBottom (boolean) 可选参数,设置自定义材质路径后生效,是否生成底面,默认:true 
 fnfunction 可选的回调函数,请参考二次开发:异步接口调用方式 Examplepolygon3d对象示例 let polygon3d = { id: 'polygon3d', coordinates: coordinates, coordinateType: 0, color: [1, 1, 1, 1], height: 50, intensity: 1.0, style: Polygon3DStyle.WaveTransparent, tillingX: 0, tillingY: 0, material: "/JC_CustomAssets/Material/M_material", scalarParameters: [{ "name": "U重复", "value": 0.1 }], vectorParameters: [{ "name": "color", "value": [1,0,0] }], generateTop: true, generateSide: true, generateBottom: true }
- 
- 
    clear(fn)
- 
    
    删除场景中所有的3DPolygon Parameters:Name Type Description fnfunction 可选的回调函数,请参考二次开发:异步接口调用方式 
- 
    delete(ids, fn)
- 
    
    删除一个或多个3DPolygon对象 Parameters:Name Type Description idsstring | array 要删除的3DPolygon对象的ID或者ID数组(可以删除一个或者多个) fnfunction 可选的回调函数,请参考二次开发:异步接口调用方式 
- 
    focus(ids, distance, flyTime, rotation, fn)
- 
    
    自动定位到合适的观察距离 Parameters:Name Type Description idsstring | array 3DPolygon对象的ID或者ID数组 distancenumber 可选参数,观察点距离目标点(被拍摄物体)的距离,取值范围:[0.01~任意正数],如果设置为0或者不设置,系统自动计算 flyTimenumber 可选参数,相机飞行的时间,取值范围:[0~任意正数],单位:秒,默认值2秒 rotationarray 可选参数,相机旋转的欧拉角:[Pitch,Yaw,Roll],数组元素类型:(number),取值范围:Pitch[-90~90] Yaw[-180~180] Roll[0] fnfunction 可选的回调函数,请参考二次开发:异步接口调用方式 
- 
    get(ids, fn)
- 
    
    根据ID获取3DPolygon的详细信息 Parameters:Name Type Description idsstring | array 要获取的3DPolygon对象ID或者ID数组(可以获取一个或者多个) fnfunction 可选的回调函数,请参考二次开发:异步接口调用方式 Example3DPolygon的详细信息 { "id": "1", "groupId": "", "style": 10, "color": [1.000000, 0.000000, 1.000000, 1.000000], "height": 500.000000, "intensity": 4.000000 }
- 
    glow(data)
- 
    
    闪烁 Parameters:Name Type Description dataobject | array 数据结构,支持对象或数组,对于每一个对象支持以下属性: - 
id (string) Polygon3D的ID 
- 
color (Color) 闪烁的颜色,支持四种格式,取值示例 
- 
duration (number) 闪烁持续时间,单位:秒,取值范围:[0.01~任意正数] 
- 
interval (number) 闪烁间隔时间,单位:秒,取值范围:[0.01~任意正数],注意:间隔时间要小于持续闪烁时间 
 
- 
- 
    hide(ids, fn)
- 
    
    隐藏3DPolygon Parameters:Name Type Description idsstring | array 3DPolygon对象的ID或者ID数组 fnfunction 可选的回调函数,请参考二次开发:异步接口调用方式 
- 
    hideAll(fn)
- 
    
    隐藏所有3DPolygon Parameters:Name Type Description fnfunction 可选的回调函数,请参考二次开发:异步接口调用方式 
- 
    highlight(ids, fn)
- 
    
    高亮,目前仅部分样式支持高亮,和材质有关 Parameters:Name Type Description idsstring | array Polygon3D的ID或者ID数组 fnfunction 可选的回调函数,请参考二次开发:异步接口调用方式 
- 
    setColor(id, newColor, fn)
- 
    
    设置颜色 Parameters:Name Type Description idstring Polygon3D的ID newColorColor 新颜色值,支持四种格式,取值示例 fnfunction 可选的回调函数,请参考二次开发:异步接口调用方式 
- 
    setCoordinates(id, newVal, fn)
- 
    
    设置坐标 Parameters:Name Type Description idstring Polygon3D的ID newValarray 新坐标值,取值示例 fnfunction 可选的回调函数,请参考二次开发:异步接口调用方式 
- 
    setHeight(id, newVal, fn)
- 
    
    设置高度 Parameters:Name Type Description idstring Polygon3D的ID newValnumber 新值 fnfunction 可选的回调函数,请参考二次开发:异步接口调用方式 
- 
    setIntensity(id, newVal, fn)
- 
    
    设置亮度 Parameters:Name Type Description idstring Polygon3D的ID newValnumber 新值 fnfunction 可选的回调函数,请参考二次开发:异步接口调用方式 
- 
    setStyle(id, newVal, fn)
- 
    
    设置样式 Parameters:Name Type Description idstring Polygon3D的ID newValnumber 新3DPolygon的样式,参考 Polygon3DStylefnfunction 可选的回调函数,请参考二次开发:异步接口调用方式 
- 
    setTillingX(id, newVal, fn)
- 
    
    设置TillingX Parameters:Name Type Description idstring Polygon3D的ID newValnumber 新值 fnfunction 可选的回调函数,请参考二次开发:异步接口调用方式 
- 
    setTillingY(id, newVal, fn)
- 
    
    设置TillingY Parameters:Name Type Description idstring Polygon3D的ID newValnumber 新值 fnfunction 可选的回调函数,请参考二次开发:异步接口调用方式 
- 
    setViewHeightRange(id, minViewHeight, maxViewHeight, fn)
- 
    
    设置Polygon3D对象的可视高度范围 Parameters:Name Type Description idstring Polygon3D对象的ID minViewHeightnumber 可视高度范围最小值,取值范围:[任意负数~任意正数],单位:米 maxViewHeightnumber 可视高度范围最大值,取值范围:[任意负数~任意正数],单位:米 fnfunction 可选的回调函数,请参考二次开发:异步接口调用方式 
- 
    show(ids, fn)
- 
    
    显示3DPolygon Parameters:Name Type Description idsstring | array 3DPolygon对象的ID或者ID数组 fnfunction 可选的回调函数,请参考二次开发:异步接口调用方式 
- 
    showAll(fn)
- 
    
    显示所有3DPolygon Parameters:Name Type Description fnfunction 可选的回调函数,请参考二次开发:异步接口调用方式 
- 
    stopGlow(ids, fn)
- 
    
    停止闪烁 Parameters:Name Type Description idsstring | array Polygon3D的ID或者ID数组 fnfunction 可选的回调函数,请参考二次开发:异步接口调用方式 
- 
    stopHighlight(ids, fn)
- 
    
    停止高亮 Parameters:Name Type Description idsstring | array Polygon3D的ID或者ID数组 fnfunction 可选的回调函数,请参考二次开发:异步接口调用方式 
- 
    update(data, fn)
- 
    
    修改一个或多个3DPolygon对象 Parameters:Name Type Description dataobject | array 数据结构,请参考add方法 fnfunction 可选的回调函数,请参考二次开发:异步接口调用方式 
- 
    updateBegin()
- 
    
    用于批量多次修改对象的属性 
 在开始修改之前调用updateBegin,然后可以多次调用setXXX方法,最后调用updateEnd提交修改更新数据
 注意:
 updateBegin不是异步调用,不需要await,也没有回调函数参数- Inherited From:
- Overrides:
 Examplefdapi.xxx.updateBegin(); for (let i = 0; i < 1000; i++) { fdapi.xxx.setColor(i, Color.Yellow); } fdapi.xxx.updateEnd(function () { log('update finished!'); });
- 
    updateEnd(fn)
- 
    
    用于批量多次修改对象的属性,与updateBegin配套使用 
 注意:
 updateEnd是异步调用,可以用回调函数也可以awaitParameters:Name Type Description fnfunction 可选的回调函数,请参考二次开发:异步接口调用方式 - Inherited From:
- Overrides:
 



