Class: FdBufferAnalysis

FdTools. FdBufferAnalysis

缓冲分析
通过给定的图形(点/线/面)和半径,统计出缓冲区内的模型部件


new FdBufferAnalysis(viewer [, option] [, type] [, radius] [, positions] [, bufferColor] [, showBuffer] [, highlightColor] [, baseColor] [, showProgress])

Parameters:
Name Type Argument Default Description
viewer Viewer

视景器

option Object <optional>
{}

配置参数,可能包含以下属性:

type String <optional>
'Point'

绘制的缓冲区类型,可选值:'Point', 'Polyline', 'Polygon'

radius Number <optional>
100.0

缓冲半径

positions Array <optional>

点([lon, lat, height])或点组([[lon, lat, height], [lon, lat, height], ...]),格式必须与缓冲区类型对应。不设置时激活点选功能

bufferColor Array <optional>
[255, 255, 0, 0.6]

缓冲区颜色

showBuffer Boolean <optional>
true

是否显示缓冲区

highlightColor Array <optional>
[255, 0, 0, 1.0]

构件高亮颜色

baseColor Array <optional>
[255, 255, 255, 1.0]

构件基本颜色

showProgress Boolean <optional>
true

是否显示分析进度

Example
var ba = new Freedo.FdTools.FdBufferAnalysis(viewer, {
   type: 'Polygon',
   radius: 500,
   showBuffer: true,
   bufferColor: [255, 255, 0, 0.6],
   highlightColor: [255, 0, 0, 1.0],
   baseColor: [255, 255, 255, 1.0]
});

ba.start();

Members


<readonly> option :Object

获取实体的属性数据

Type:
  • Object

positions :Array

缓冲区坐标数组,[longitude, latitude] 或 [[longitude, latitude], ...]

Type:
  • Array

radius :Number

缓冲区半径

Type:
  • Number
Default Value:
  • 100.0

type :String

缓冲区类型,可选值:'Point', 'Polyline', 'Polygon'

Type:
  • String
Default Value:
  • 'Point'

Methods


destroy()

销毁


getData()

获取缓冲区分析数据

Returns:

返回值格式:

 [
   {
     tileset: Freedo.FreedoPModel,
     component: [componentId, ...]
   },
   ...
 ]
Type
Object

hide()

隐藏缓冲区多边形实体对象


highlightComponent()

高亮选中的构件


on(listener [, scope])

注册事件捕捉

Parameters:
Name Type Argument Description
listener FdTools.FdBufferAnalysis~FdBufferAnalysisCallback

当有事件触发时被执行的函数。

scope Object <optional>

listener函数执行时的绑定的对象。

Returns:

返回一个函数,调用该函数可以取消监听。

Type
Freedo.Event~RemoveCallback

reset()

重置


setBaseColor(r, g, b, a)

设置场景模型基本颜色

Parameters:
Name Type Description
r number

颜色R分量,范围0~255

g number

颜色G分量,范围0~255

b number

颜色B分量,范围0~255

a number

透明度,范围0~1


setBufferColor(r, g, b, a)

设置缓冲区颜色

Parameters:
Name Type Description
r number

颜色R分量,范围0~255

g number

颜色G分量,范围0~255

b number

颜色B分量,范围0~255

a number

透明度,范围0~1


setHighlightColor(r, g, b, a)

设置高亮颜色

Parameters:
Name Type Description
r Number

颜色R分量,范围0~255

g Number

颜色G分量,范围0~255

b Number

颜色B分量,范围0~255

a Number

透明度,范围0~1


show()

显示缓冲区多边形实体对象


start()

开始


unhighlightComponent()

取消所有构件的高亮

Type Definitions


FdBufferAnalysisCallback(eventType, eventArg)

Parameters:
Name Type Description
eventType String

事件类型有以下几种:Start / AnaFinished(分析完成)

eventArg Object

AnaFinished 事件返回分析结果