You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

преди 2 години
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478
  1. ---
  2. sidebar: auto
  3. ---
  4. # Analysis 🌎
  5. ## DC.Measure
  6. > viewer measure
  7. ### example
  8. ```js
  9. viewer.use(new DC.Measure())
  10. ```
  11. ### creation
  12. - **_constructor()_**
  13. - returns `measure`
  14. ### methods
  15. - **_angle([options])_**
  16. - parameters
  17. - `{Object} options`
  18. - returns `this`
  19. - **_area([options])_**
  20. - parameters
  21. - `{Object} options`
  22. - returns `this`
  23. - **_areaSurface([options])_**
  24. - parameters
  25. - `{Object} options`
  26. - returns `this`
  27. - **_distance([options])_**
  28. - parameters
  29. - `{Object} options`
  30. - returns `this`
  31. - **_distanceSurface([options])_**
  32. - parameters
  33. - `{Object} options`
  34. - returns `this`
  35. - **_heading([options])_**
  36. - parameters
  37. - `{Object} options`
  38. - returns `this`
  39. - **_height([options])_**
  40. - parameters
  41. - `{Object} options`
  42. - returns `this`
  43. - **_triangleHeight([options])_**
  44. - parameters
  45. - `{Object} options`
  46. - returns `this`
  47. - **_activate(type,[options])_**
  48. - parameters
  49. - `{String} type`
  50. - `{Object} options`
  51. - returns `this`
  52. ```json
  53. // options(optional)
  54. {
  55. "icon_center": "**.png",
  56. "icon_anchor": "**.png",
  57. "icon_midAnchor": "**.png",
  58. "icon_size": [12, 12],
  59. "clampToModel": false
  60. }
  61. ```
  62. - **_deactivate()_**
  63. - returns `this`
  64. ## DC.Analysis
  65. > Viewer analysis
  66. ### example
  67. ```js
  68. viewer.use(new DC.Analysis())
  69. ```
  70. ### creation
  71. - **_constructor()_**
  72. - returns `analysis`
  73. ### methods
  74. - **_contourLine(lineColor, lineWidth, lineSpacing)_**
  75. Contour Line Analysis
  76. - parameters
  77. - `{Color} lineColor`
  78. - `{Number} lineWidth`
  79. - `{Number} lineSpacing`
  80. - returns `this`
  81. - **_shadows(startTime, multiplier)_**
  82. Daylight Analysis
  83. - parameters
  84. - `{Date} startTime`
  85. - `{Number} multiplier`
  86. - returns `this`
  87. - **_sightLine(startPosition, endPosition, excludes, lerpNum)_**
  88. Through-view analysis (line)
  89. - parameters
  90. - `{Position|Array|String|Object} startPosition`
  91. - `{Position|Array|String|Object} endPosition`
  92. - `{Array<Overlay>} excludes`
  93. - `{Number} lerpNum`: Number of Interpolation, default: 10, the larger the number the more accurate, and at the same time the amount of calculation will increase
  94. - returns `this`
  95. - **_sightCircle(center, radius, excludes, lerpNum)_**
  96. Through-view analysis (circle)
  97. - parameters
  98. - `{Position|Array|String|Object} center`
  99. - `{Number} radius`
  100. - `{Array<Overlay>} excludes`
  101. - `{Number} lerpNum`: Number of Interpolation, default: 10, the larger the number the more accurate, and at the same time the amount of calculation will increase
  102. - returns `this`
  103. - **_viewshed(position, radius, fov, aspectRatio, options)_**
  104. View-Shed Analysis
  105. - parameters
  106. - `{Position|Array|String|Object} position`
  107. - `{Number} radius`
  108. - `{Number} fov`
  109. - `{Number} aspectRatio`
  110. - `{Object} options`
  111. - returns `this`
  112. ```json
  113. //options(optional)
  114. {
  115. "mixNum":1,
  116. "visibleColor":DC.Color.GREEN,
  117. "disVisibleColor":DC.Color.RED,
  118. "showHelp": false,
  119. "gridColor": DC.Color.YELLOW,
  120. "lineColor": DC.Color.YELLOW.withAlpha(0.3)
  121. }
  122. ```
  123. - **_deactivate([type])_**
  124. - parameters
  125. - `{String} type`:Refer to `DC.AnalysisType`. When the type is empty, all analyses will be deactivated
  126. - returns `this`
  127. ## DC.CameraVideoLayer
  128. > Inherited from [Layer](../layer/#layer)
  129. ### example
  130. ```js
  131. let layer = new DC.CameraVideoLayer('id')
  132. viewer.addLayer(layer)
  133. ```
  134. ### creation
  135. - **_constructor(id)_**
  136. - parameters
  137. - `{String} id`
  138. - returns `videoLayer`
  139. ### methods
  140. - **_showHelp(show, videoOverlay, color)_**
  141. - parameters
  142. - `{Boolean} show`
  143. - `{Overlay} videoOverlay`
  144. - `{Color} color`
  145. - returns `this`
  146. ## DC.CameraVideo
  147. > Inherited from [Overlay](../overlay/#overlay)
  148. ### example
  149. ```js
  150. let position = new DC.Position(120, 20, 200, -20, 19)
  151. let videoEl = new document.getElementById('video')
  152. let cameraVideo = new DC.CameraVideo(position, videoEl)
  153. layer.addOverlay(cameraVideo)
  154. ```
  155. ### creation
  156. - **_constructor(position, video,[maskUrl])_**
  157. - parameters
  158. - `{Position} position`
  159. - `{Element} video`
  160. - `{String} [maskUrl]`
  161. - returns `cameraVideo`
  162. ### properties
  163. - `{Position} position`
  164. - `{Element} video`
  165. - `{String} maskUrl`
  166. ### methods
  167. - **_setStyle(style)_**
  168. - parameters
  169. - `{Object} style`
  170. - returns `this`
  171. ```json
  172. // style(optional)
  173. {
  174. "fov": 60,
  175. "near": 1,
  176. "far": 5000,
  177. "aspectRatio": 1,
  178. "alpha": 1,
  179. "clearBlack": true,
  180. "disViewColor": DC.Color.WHITE
  181. }
  182. ```
  183. ## DC.PlaneVideoLayer
  184. > Inherited from [Layer](../layer/#layer)
  185. ### example
  186. ```js
  187. let layer = new DC.PlaneVideoLayer('id')
  188. viewer.addLayer(layer)
  189. ```
  190. ### creation
  191. - **_constructor(id)_**
  192. - parameters
  193. - `{String} id`
  194. - returns `videoLayer`
  195. ### methods
  196. - **_showHelp(show, videoOverlay, color)_**
  197. - parameters
  198. - `{Boolean} show`
  199. - `{Overlay} videoOverlay`
  200. - `{Color} color`
  201. - returns `this`
  202. ## DC.PlaneVideo
  203. > Inherited from [Overlay](../overlay/#overlay)
  204. ### example
  205. ```js
  206. let position = new DC.Position(120, 20, 200, -20, 19)
  207. let videoEl = new document.getElementById('video')
  208. let cameraVideo = new DC.PlaneVideo(position, videoEl)
  209. layer.addOverlay(cameraVideo)
  210. ```
  211. ### creation
  212. - **_constructor(position, video)_**
  213. - parameters
  214. - `{Position} position`
  215. - `{Element} video`
  216. - returns `cameraVideo`
  217. ### properties
  218. - `{Position} position`
  219. - `{Element} video`
  220. ### methods
  221. - **_setStyle(style)_**
  222. - parameters
  223. - `{Object} style`
  224. - returns `this`
  225. ```json
  226. // style(optional)
  227. {
  228. "fov": 60,
  229. "near": 1,
  230. "far": 5000,
  231. "aspectRatio": 1
  232. }
  233. ```
  234. ## DC.GeoTools
  235. > Geometry Tool
  236. ### example
  237. ```js
  238. let coords = DC.GeoTools.pointBuffer(
  239. '120.71259021075333,31.22148081085083',
  240. 100
  241. )
  242. let coords1 = DC.GeoTools.polygonBuffer(
  243. '120.71259021075333,31.22148081085083;120.71611354431036,31.221447256684566;120.7140691869497,31.21875584696343',
  244. 150
  245. )
  246. ```
  247. ### static methods
  248. - **_pointBuffer(position, radius, steps)_**
  249. - parameters
  250. - `{Array|String|Position} position`
  251. - `{Number} radius`
  252. - `{Number} steps` default:8
  253. - returns `array`
  254. - **_polylineBuffer(positions, radius, steps)_**
  255. - parameters
  256. - `{Array|String|Array<Position>} positions`
  257. - `{Number} radius`
  258. - `{Number} steps` default:8
  259. - returns `array`
  260. - **_polygonBuffer(positions, radius, steps)_**
  261. - parameters
  262. - `{Array|String|Array<Position>} positions`
  263. - `{Number} radius`
  264. - `{Number} steps` default:8
  265. - returns `array`
  266. - **_transformPolylineScale(positions, factor)_**
  267. - parameters
  268. - `{Array|String|Array<Position>} positions`
  269. - `{Number} factor`
  270. - returns `array`
  271. - **_transformPolygonScale(positions, factor)_**
  272. - parameters
  273. - `{Array|String|Array<Position>} positions`
  274. - `{Number} factor`
  275. - returns `array`
  276. - **_transformPolylineRotate(positions, angle)_**
  277. - parameters
  278. - `{Array|String|Array<Position>} positions`
  279. - `{Number} angle`
  280. - returns `array`
  281. - **_transformPolygonRotate(positions, angle)_**
  282. - parameters
  283. - `{Array|String|Array<Position>} positions`
  284. - `{Number} angle`
  285. - returns `array`
  286. ## DC.GlobClipping
  287. > Glob Clipping
  288. ### example
  289. ```js
  290. let globClipping = new DC.GlobClipping(viewer)
  291. ```
  292. ### creation
  293. - **_constructor(viewer,[options])_**
  294. - parameters
  295. - `{Viewer} viewer`
  296. - `{Object} options`
  297. - returns `globClipping`
  298. ```json
  299. // options(optional)
  300. {
  301. "edgeWidth": 0,
  302. "edgeColor": DC.Color.WHITE
  303. }
  304. ```
  305. ### properties
  306. - `{Array<Position>} positions`
  307. - `{Number} distance`
  308. - `{Boolean} enable`
  309. - `{String} state` **_`readonly`_**
  310. ## DC.TerrainClipping
  311. > Terrain Clipping
  312. ### example
  313. ```js
  314. let terrainClipping = new DC.TerrainClipping(viewer)
  315. ```
  316. ### creation
  317. - **_constructor(viewer,[options])_**
  318. - parameters
  319. - `{Viewer} viewer`
  320. - `{Object} options`
  321. - returns `terrainClipping`
  322. ```json
  323. // options(optional)
  324. {
  325. "edgeWidth": 0,
  326. "edgeColor": DC.Color.WHITE,
  327. "lerpInterval": 50,
  328. "bottomImage": "",
  329. "sideImage": ""
  330. }
  331. ```
  332. ### properties
  333. - `{Array<Position>} positions`
  334. - `{Number} height`
  335. - `{Boolean} enable`
  336. - `{String} state` **_`readonly`_**