Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
方 梦梦
world51tocmap
Commits
f34e539c
Commit
f34e539c
authored
Mar 13, 2025
by
heng.zhang3@inzymeits.com
Browse files
51world示例集合
parent
d4557fba
Changes
226
Expand all
Hide whitespace changes
Inline
Side-by-side
gis_sdk/world51/51gisapi/Plugins/gis/plugins/gis/index.d.ts
0 → 100644
View file @
f34e539c
import
Core
from
"
./core
"
;
import
{
ObjectController
}
from
"
@/modules/common/object-controller
"
;
import
{
IWmsType
}
from
"
@/plugins/gis/modules/module-wms
"
;
import
{
IWmtsType
}
from
"
@/plugins/gis/modules/module-wmts
"
;
import
{
I3DTilesType
}
from
"
@/plugins/gis/modules/module-3DTiles
"
;
type
GisApiType
=
GisApi
;
export
type
{
GisApiType
};
type
WMSWithObjectClass
=
ObjectController
&
IWmsType
;
type
WMTSWithObjectClass
=
ObjectController
&
IWmtsType
;
type
ThreeDTilesObjectClass
=
ObjectController
&
I3DTilesType
;
export
default
class
GisApi
{
obj
:
any
;
Core
:
Core
;
static
instance
:
GisApi
;
WMS
:
new
(
config
:
Record
<
any
,
any
>
)
=>
WMSWithObjectClass
;
WMTS
:
new
(
config
:
Record
<
any
,
any
>
)
=>
WMTSWithObjectClass
;
'
3DTiles
'
:
new
(
config
:
Record
<
any
,
any
>
)
=>
ThreeDTilesObjectClass
;
constructor
(
obj
?:
any
);
static
getInstance
():
GisApi
;
private
OnGeoLayerFeatureClicked
;
install
():
Promise
<
Record
<
'
list
'
,
any
>>
;
}
gis_sdk/world51/51gisapi/Plugins/gis/plugins/gis/modules/module-3DTiles.d.ts
0 → 100644
View file @
f34e539c
import
{
ObjectController
}
from
"
../../../modules/common/object-controller
"
;
import
{
EntityEidType
,
EntityGeometryType
,
BasicInfoAtomType
,
TransformAtomType
}
from
'
../../../../src/modules/common/data-type
'
;
export
interface
I3DTilesType
extends
EntityEidType
,
EntityGeometryType
,
Partial
<
BasicInfoAtomType
>
,
Partial
<
TransformAtomType
>
{
'
configs
'
?:
Partial
<
I3DTilesEntityAtomType
>
;
}
export
interface
I3DTilesEntityAtomType
{
url
:
string
;
offset
?:
any
;
}
export
default
class
ThreeDTiles
{
static
instance
:
ThreeDTiles
;
static
getInstance
(
obj
?:
any
|
undefined
):
ThreeDTiles
;
static
ObjectCore
(
extendClass
:
typeof
ObjectController
):
any
;
}
gis_sdk/world51/51gisapi/Plugins/gis/plugins/gis/modules/module-geoLayer.d.ts
0 → 100644
View file @
f34e539c
import
{
ObjectController
}
from
"
../../../modules/common/object-controller
"
;
import
{
EntityEidType
,
EntityGeometryType
,
BasicInfoAtomType
,
TransformAtomType
}
from
'
../../../../src/modules/common/data-type
'
;
interface
ResultType
{
success
:
boolean
;
message
?:
string
;
result
?:
any
;
}
export
interface
IGeoLayerObjectClass
extends
EntityEidType
,
EntityGeometryType
,
Partial
<
BasicInfoAtomType
>
,
Partial
<
TransformAtomType
>
{
clickFun
:
void
|
undefined
;
configs
:
{
geoLayerUrl
:
string
;
geoLayerType
:
string
;
geoLayerParams
?:
any
;
geoFeatureStyle
?:
any
;
geoLayerSymbol
?:
any
;
};
offset
?:
any
;
GetGeoLayerInfo
():
Promise
<
ResultType
>
;
RunGeoLayerAction
(
opt
:
Record
<
string
,
any
>
):
Promise
<
ResultType
>
;
SetLocalGeoreference
(
opt
:
Record
<
string
,
any
>
):
Promise
<
ResultType
>
;
SetGeoLayerHeight
(
opt
:
Record
<
string
,
any
>
):
Promise
<
ResultType
>
;
SetGeoLayerLocation
(
opt
:
Record
<
string
,
any
>
):
Promise
<
ResultType
>
;
GetGeoLayerLocation
(
opt
:
Record
<
string
,
any
>
):
Promise
<
ResultType
>
;
execute
(
apiName
:
string
,
opt
:
Record
<
string
,
any
>
,
cb
?:
()
=>
void
):
Promise
<
ResultType
>
;
}
export
default
class
GeoLayerObject
{
static
instance
:
GeoLayerObject
;
static
getInstance
(
obj
?:
any
|
undefined
):
GeoLayerObject
;
static
ObjectCore
(
extendClass
:
typeof
ObjectController
):
any
;
}
export
{};
gis_sdk/world51/51gisapi/Plugins/gis/plugins/gis/modules/module-wms.d.ts
0 → 100644
View file @
f34e539c
import
{
ObjectController
}
from
"
../../../modules/common/object-controller
"
;
import
{
EntityEidType
,
EntityGeometryType
,
BasicInfoAtomType
,
TransformAtomType
}
from
'
../../../../src/modules/common/data-type
'
;
export
interface
IWmsType
extends
EntityEidType
,
EntityGeometryType
,
Partial
<
BasicInfoAtomType
>
,
Partial
<
TransformAtomType
>
{
configs
?:
Partial
<
IWmsEntityAtomType
>
;
}
export
interface
IWmsEntityAtomType
{
url
:
string
;
offset
?:
any
;
}
export
default
class
Wms
{
static
instance
:
Wms
;
static
getInstance
(
obj
?:
any
|
undefined
):
Wms
;
static
ObjectCore
(
extendClass
:
typeof
ObjectController
):
any
;
}
gis_sdk/world51/51gisapi/Plugins/gis/plugins/gis/modules/module-wmts.d.ts
0 → 100644
View file @
f34e539c
import
{
ObjectController
}
from
"
../../../modules/common/object-controller
"
;
import
{
EntityEidType
,
EntityGeometryType
,
BasicInfoAtomType
,
TransformAtomType
}
from
'
../../../../src/modules/common/data-type
'
;
export
interface
IWmtsType
extends
EntityEidType
,
EntityGeometryType
,
Partial
<
BasicInfoAtomType
>
,
Partial
<
TransformAtomType
>
{
configs
?:
Partial
<
IWmtsEntityAtomType
>
;
}
export
interface
IWmtsEntityAtomType
{
url
:
string
;
offset
?:
any
;
}
export
default
class
Wmts
{
static
instance
:
Wmts
;
static
getInstance
(
obj
?:
any
|
undefined
):
Wmts
;
static
ObjectCore
(
extendClass
:
typeof
ObjectController
):
any
;
}
gis_sdk/world51/51gisapi/README.md
0 → 100644
View file @
f34e539c
## Introduction
GisApi is a gis plugin for WdpApi
#### Install
```
bash
$
npm i gisapi
```
#### Import
```
javascript
import
WdpApi
from
'
wdpapi
'
import
GisApi
from
'
gisapi
'
```
#### Init
```
javascript
const
config
=
{
"
id
"
:
"
player
"
,
//[required] Render scene container(DOM node id)
"
url
"
:
"
http://172.31.19.235:8889/Renderers/Any/order
"
,
//[optional] Cloud rendering service address
"
order
"
:
"
b96285A3
"
,
//[optional] Rendering order, obtained on the cloud rendering client
"
resolution
"
:
[
3840
,
2160
],
//[optional] Set the cloud rendering output resolution[width, height]
"
debugMode
"
:
"
normal
"
,
//[optional] none: does not print logs, normal: normal logs
"
keyboard
"
:
{
//[optional] keyboard event
"
normal
"
:
false
,
//[optional] Keyboard event, exclude F1~F12 [default disabled]
"
func
"
:
false
//[optional] Browser F1 ~ F12 function keys [default disabled]
}
}
const
App
=
new
WdpApi
(
config
)
as
GisApi
&
WdpApi
;
App
.
Plugin
.
Install
(
GisApi
).
then
(
r
=>
{
App
.
Renderer
.
Start
().
then
((
res
)
=>
{
if
(
res
.
success
)
{
App
.
Renderer
.
RegisterEvent
([
{
name
:
'
onVideoStreamLoaded
'
,
func
:
function
()
{
// 视频流加载成功
}
}
])
}
})
});
```
#### Methods
```
javascript
/** 通用 API, 支持3DTiles/WMS/WMTS三种图层及偏移 **/
const
gisLayer
=
new
App
[
'
3DTiles/WMS/WMTS
'
]({
'
configs
'
:{
"
url
"
:
"
https://gis-demo-data.51aes.com:50000/model/GSZ/tileset.json
"
,
"
offset
"
:
[
0
,
0
,
0
]
}
})
const
res
=
await
App
.
Scene
.
Add
(
gisLayer
)
gisLayer
.
Update
(
{
'
configs
'
:{
"
offset
"
:
[
10
,
10
,
20
]
}
}
)
gisLayer
.
Delete
()
/** 请注意以下配置需要专业版支持 **/
const
geoLayerConfig
=
{
"
geoLayerUrl
"
:
"
GDAL/bj/BJ_bud_02_Elevation.shp
"
,
"
geoLayerType
"
:
"
shp
"
,
"
geoLayerParams
"
:
{
"
serviceLayerName
"
:
""
,
"
featureType
"
:
"
Polygon
"
,
"
needGCJOffset
"
:
false
,
"
batchFeatureNum
"
:
4000
},
"
geoFeatureStyle
"
:{
"
styleDesc
"
:
"
Default1
"
,
"
bBasedOnTerrain
"
:
false
,
"
PolygonStyle
"
:
{
"
filledColor
"
:
"
#FF0000FF
"
,
"
bOutline
"
:
false
,
"
outlineColor
"
:
"
#00C0C8FF
"
,
"
outlineWidth
"
:
200
,
"
bExtrude
"
:
true
,
"
extrudeHeight
"
:
100
,
"
extrudeHeightField
"
:
"
Elevation
"
},
"
lineStyle
"
:
{
"
lineColor
"
:
"
#00C0C8FF
"
,
"
lineWidth
"
:
10
,
"
lineShape
"
:
"
Plane
"
}
}
}
/** 加载矢量图层 **/
const
geoLayer
=
new
App
.
GeoLayer
(
geoLayerConfig
)
await
App
.
Scene
.
Add
(
geoLayer
)
/** 图层点击事件 **/
geoLayer
.
onClick
((
result
:
any
,
obj
:
any
)
=>
{
console
.
log
(
result
,
obj
)
})
/** 获取图层信息 **/
geoLayer
.
GetGeoLayerInfo
()
/** 执行图层操作 **/
geoLayer
.
RunGeoLayerAction
({
"
actionName
"
:
""
,
"
featureId
"
:
""
,
})
/** 设置图层参考点 **/
geoLayer
.
SetLocalGeoreference
({
"
geoReference
"
:
[
121.46694444000001
,
31.235277780000001
]
})
/** 设置图层高度 **/
geoLayer
.
SetGeoLayerHeight
({
"
geoLayerIndex
"
:
0
,
"
geoLayerHeightOffset
"
:
5
})
/** 设置图层位置 **/
geoLayer
.
SetGeoLayerLocation
({
"
geoLayerLocation
"
:
[
0
,
0
,
0
],
})
/** 获取图层位置 **/
geoLayer
.
GetGeoLayerLocation
()
```
#### Stop Rendering
```
javascript
App
.
Renderer
.
Stop
();
```
## License
Copyright (c) 2023-present, 51WORLD
gis_sdk/world51/51gisapi/package.json
0 → 100644
View file @
f34e539c
{
"name"
:
"51gisapi"
,
"version"
:
"1.0.20"
,
"description"
:
"GisApi is a gis plugin for WdpApi."
,
"type"
:
"module"
,
"main"
:
"Plugins/gis/index.js"
,
"types"
:
"Plugins/gis/plugins/gis/index.d.ts"
,
"files"
:
[
"Plugins/**/*"
],
"unpkg"
:
"Plugins/gis/gis.min.js"
,
"homepage"
:
"http://superapi.51aes.com/"
,
"scripts"
:
{
"dev:gis"
:
"rollup -w -c rollup-gis.config.js --environment MODE:dev"
,
"build:gis"
:
"rollup -c rollup-gis.config.js --environment MODE:prod"
},
"repository"
:
{
"type"
:
"git"
,
"url"
:
"http://gitlab.51cloud.local/paas/wdpapi.git"
},
"keywords"
:
[
"51WORLD"
,
"51AES"
,
"51Cloud"
,
"51WDP"
,
"51Meet"
,
"51Sim"
,
"CimApi"
],
"author"
:
{
"name"
:
"Yamazakey.Luo"
},
"license"
:
"MIT"
,
"dependencies"
:
{
"axios"
:
"^0.27.2"
,
"crypto-js"
:
"^4.1.1"
,
"socket.io-client"
:
"^4.5.4"
,
"uuid"
:
"^9.0.0"
,
"webrtc-adapter"
:
"^8.1.2"
},
"devDependencies"
:
{
"@babel/core"
:
"^7.20.12"
,
"@babel/plugin-external-helpers"
:
"^7.18.6"
,
"@babel/plugin-transform-runtime"
:
"^7.19.6"
,
"@babel/preset-env"
:
"^7.20.2"
,
"@rollup/plugin-babel"
:
"^6.0.3"
,
"@rollup/plugin-commonjs"
:
"^24.0.0"
,
"@rollup/plugin-eslint"
:
"^9.0.1"
,
"@rollup/plugin-json"
:
"^6.0.0"
,
"@rollup/plugin-node-resolve"
:
"^15.0.1"
,
"@rollup/plugin-strip"
:
"^3.0.2"
,
"@rollup/plugin-terser"
:
"^0.3.0"
,
"@rollup/plugin-typescript"
:
"^11.0.0"
,
"@typescript-eslint/eslint-plugin"
:
"^5.48.1"
,
"@typescript-eslint/parser"
:
"^5.48.1"
,
"babel-plugin-transform-class-properties"
:
"^6.24.1"
,
"core-js"
:
"^3.27.1"
,
"eslint"
:
"^8.31.0"
,
"prettier"
:
"^2.8.2"
,
"rollup"
:
"^3.9.1"
,
"rollup-plugin-node-builtins"
:
"^2.1.2"
,
"rollup-plugin-node-externals"
:
"^5.1.0"
,
"rollup-plugin-node-globals"
:
"^1.4.0"
,
"tslib"
:
"^2.6.2"
,
"typescript"
:
"^4.9.4"
,
"webpack"
:
"^5.88.2"
,
"webpack-cli"
:
"^5.1.4"
}
}
gis_sdk/world51/51timapi/Plugins/tim/README.md
0 → 100644
View file @
f34e539c
## 介绍
51timapi是一个交通行业的Wdp插件,其运行依赖于wdpapi
#### 安装
```
bash
$
npm i 51timapi
--registry
http://10.100.10.63/
```
#### 引入
```
javascript
import
WdpApi
from
'
wdpapi
'
import
TimApi
from
'
51timapi
'
```
#### 初始化
```
javascript
const
config
=
{
"
id
"
:
"
player
"
,
//[required] Render scene container(DOM node id)
"
url
"
:
"
http://10.66.8.158:8889/Renderers/Any/order
"
,
//[optional] Cloud rendering service address
"
order
"
:
"
cba557541abbdccaed3c2043b7e9db35
"
,
//[optional] Rendering order, obtained on the cloud rendering client
"
resolution
"
:
[
window
.
screen
.
width
,
window
.
screen
.
height
],
//[optional] Set the cloud rendering output resolution[width, height]
"
debugMode
"
:
"
normal
"
,
//[optional] none: does not print logs, normal: normal logs
"
keyboard
"
:
{
//[optional] keyboard event
"
normal
"
:
false
,
//[optional] Keyboard event, exclude F1~F12 [default disabled]
"
func
"
:
false
//[optional] Browser F1 ~ F12 function keys [default disabled]
}
}
const
App
=
new
WdpApi
(
config
)
as
WdpApi
&
TimApi
App
.
Plugin
.
Install
(
TimApi
).
then
(
r
=>
{
App
.
Renderer
.
Start
().
then
((
res
)
=>
{
if
(
res
.
success
)
{
App
.
Renderer
.
RegisterEvent
([
{
name
:
'
onVideoStreamLoaded
'
,
func
:
function
()
{
// 视频流加载成功
}
}
])
}
})
});
/** 停止推流 **/
App
.
Renderer
.
Stop
();
```
#### 加载 Xodr 高精路网
```
javascript
const
TrafficOdRoad
=
new
App
.
TrafficODRoad
({
"
Online
"
:
true
,
// 是否为离线数据
"
AutoFocus
"
:
true
,
// 加载后自动聚焦至路网
"
Url
"
:
"
test.xodr
"
,
// 路网地址
"
Lon
"
:
116.31
,
"
Lat
"
:
31.31
,
"
Height
"
:
20000
})
const
res
=
await
App
.
Scene
.
Add
(
TrafficODRoad
)
/** 更新车流 **/
TrafficODRoad
.
Update
({
"
Url
"
:
"
ws://10.66.9.186:5681/965
"
// 符合规范的websocket链接
})
/** 删除车流 **/
TrafficODRoad
.
Delete
()
```
#### 车流
```
javascript
/** 创建车流 **/
const
TrafficFlow
=
new
App
.
TrafficFlow
({
trafficDataUrl
:
"
ws://10.66.9.186:5681/965
"
// 符合规范的websocket链接
})
const
res
=
await
App
.
Scene
.
Add
(
TrafficFlow
)
/** 更新车流 **/
TrafficFlow
.
Update
({
trafficDataUrl
:
"
ws://10.66.9.186:5681/965
"
// 符合规范的websocket链接
})
/** 删除车流 **/
TrafficFlow
.
Delete
()
/** 获取车流信息 **/
TrafficFlow
.
GetTrafficFlowInfo
()
/** 根据id获取车流中的车辆信息 **/
TrafficFlow
.
GetTrafficVehicleInfo
(
"
v-10
"
)
// v-10为车辆ID
/** 获取全量车辆信息 **/
TrafficFlow
.
GetAllTrafficVehicleInfo
()
// v-10为车辆ID
/** 车流控制 **/
TrafficFlow
.
RunTrafficFlowAction
({
actionName
:
"
Pause
"
//车流暂停:Pause;播放:Play;显示:Show;隐藏:Hide;气泡隐藏:HideBubbles;气泡显示:ShowBubbles;开启点击查询:EnableQuery;关闭点击查询:DisableQuery
})
/** 车流气泡控制 **/
TrafficFlow
.
ToggleBubbles
(
true
)
// 打开ture,关闭 false
/** 车流速度包围盒控制 **/
TrafficFlow
.
ToggleSpeedBox
(
true
)
// 打开ture,关闭 false
/** 设置聚焦显示交通体气泡 **/
TrafficFlow
.
FocusTrafficVehicles
([
"
id1
"
,
"
id2
"
])
//仅显示当前气泡交通体id的气泡。传空数组表示显示所有气泡
/** 获取聚焦显示交通体id **/
TrafficFlow
.
GetFocusedTrafficVehicles
()
/** 创建历史车流(除下列方法外,其他方法同实时车流) **/
const
TrafficHistoryFlow
=
new
App
.
TrafficHistoryFlow
({
trafficDataUrl
:
"
ws://10.66.9.186:5681/965
"
,
// 符合规范的websocket链接
isCompare
:
false
// ture 表示对比车流
})
const
res
=
await
App
.
Scene
.
Add
(
TrafficHistoryFlow
)
/** 历史车流播放控制 **/
TrafficHistoryFlow
.
Play
()
TrafficHistoryFlow
.
Pause
()
TrafficHistoryFlow
.
Stop
()
TrafficHistoryFlow
.
JumpTo
(
100
)
// 跳转到指定时间,车流时间在加载回调中获取
/** 历史车流加载回调 **/
App
.
Scene
.
Covering
.
TrafficFlowHistory
.
OnProcessControlledTrackTime
((
res
)
=>
{
console
.
log
(
"
=============OnProcessControlledTrackTime===========
"
,
res
)
})
/** 交通流统计围栏 **/
const
boundary
=
new
App
.
TrafficFlowBoundary
([
{
"
boundaryId
"
:
"
TestId
"
,
//围界id(自定义)
"
positions
"
:
[
//围界顶点
[
121
,
31
,
0
],
[
121
,
31
,
0
],
[
121
,
31
,
0
]
]
},
{
"
boundaryId
"
:
"
TestId2
"
,
"
positions
"
:
[
[
121
,
31
,
0
],
[
121
,
31
,
0
],
[
121
,
31
,
0
]
]
}
])
const
res
=
await
App
.
Scene
.
Add
(
boundary
)
/**车流**/
App
.
Scene
.
Covering
.
TrafficFlowBoundary
.
OnProcessAlertBoundary
((
res
)
=>
{
console
.
log
(
"
=============OnProcessAlertBoundary===========
"
,
res
)
})
```
#### 相机
```
javascript
/** 点击鼠标跟车 **/
App
.
TrafficCamAPI
.
FollowVehicleByClick
({
clickToFollow
:
true
,
followMode
:
"
Follower
"
//None不跟车,Driver驾驶视角,Follower第三人称跟车视角
})
/** 通过车辆ID跟车 **/
App
.
TrafficCamAPI
.
FollowVehicleByID
({
vehicleId
:
""
,
// 车辆ID
followMode
:
"
Follower
"
//None不跟车,Driver驾驶视角,Follower第三人称跟车视角
})
/** 取消跟车模式 **/
App
.
TrafficCamAPI
.
CancelFollowVehicle
()
/** 加载桩号文件 **/
App
.
TrafficCamAPI
.
LoadTrafficCameraTourData
({
"
url
"
:
"
D:/ZS_1.js
"
,
//桩号文件路径
"
list_id
"
:
"
1
"
// 数据ID
})
/** 场景镜头沿桩号文件漫游 **/
App
.
TrafficCamAPI
.
StartTrafficCameraTour
({
"
list_id
"
:
"
1
"
,
"
start_station_name
"
:
"
ZSK1+181
"
,
//漫游起点桩号 ,可置空,置空时将从距离镜头最近的桩号开始漫游
"
target_station_name
"
:
"
ZSK2+533
"
,
//漫游终点桩号
"
speed
"
:
"
50
"
,
//漫游速度
"
time
"
:
1
,
//总体运动时间(speed缺省时有效)
"
height
"
:
5
,
//镜头高度
"
target_offset
"
:
[
1
,
10
,
20
],
//相对终点桩号的偏移量,单位m,车道方向为x轴正方向,上方为z轴正方向,右手坐标系
"
rotation
"
:
{
//镜头角度
"
pitch
"
:
-
10
,
//俯仰角(0,-90)
"
yaw
"
:
0
//偏航角(车道方向为0度,左负右正)
}
})
/** 漫游开始、暂停 **/
App
.
TrafficCamAPI
.
UpdateTrafficCameraTour
({
"
Mode
"
:
"
Pause
"
//Pause暂停;play开始;stop停止
})
/** 相机变化回调事件 **/
App
.
TrafficCamAPI
.
OnTrafficCamStatusChanged
((
info
)
=>
{
console
.
log
(
info
)
});
```
#### 高精路网热力图
```
javascript
/** 创建高精路网热力图 **/
const
TrafficRoadHeatMap
=
new
App
.
TrafficRoadHeatMap
({
openDriveUrl
:
"
v1.xodr
"
,
//路网文件路径
densitySettings
:
{
mode
:
"
MaxSpeed
"
,
//车道最大速度:MaxSpeed;车道内所有车辆平均速度:AvgSpeed;VehCount:车道上的最大车辆数。
min
:
10
,
//阈值下限。当Mode中的统计类型值小于等于LevelMin值时,热力图显示为绿色。
max
:
100
//阈值上限。当Mode中的统计类型值大于等于LevelMax值时,热力图显示为红色。
},
offset
:[
0
,
0
,
1000
],
//位置偏移 xyz,单位:cm
isVisible
:
false
//是否可见
})
const
res
=
await
App
.
Scene
.
Add
(
TrafficRoadHeatMap
)
/** 更新热力图 **/
TrafficRoadHeatMap
.
Update
({
openDriveUrl
:
"
v1.xodr
"
,
//路网文件路径
densitySettings
:
{
mode
:
"
MaxSpeed
"
,
//车道最大速度:MaxSpeed;车道内所有车辆平均速度:AvgSpeed;VehCount:车道上的最大车辆数。
min
:
10
,
//阈值下限。当Mode中的统计类型值小于等于LevelMin值时,热力图显示为绿色。
max
:
100
//阈值上限。当Mode中的统计类型值大于等于LevelMax值时,热力图显示为红色。
},
offset
:[
0
,
0
,
1000
],
//位置偏移 xyz,单位:cm
isVisible
:
false
//是否可见
})
/** 删除热力图 **/
TrafficRoadHeatMap
.
Delete
()
/** 微观道路热力图 **/
const
TrafficRoadHeatMap
=
new
App
.
TrafficRoadHeatMap
({
openDriveUrl
:
"
v1.xodr
"
,
//路网文件路径
densitySettings
:
{
mode
:
"
MaxSpeed
"
,
//车道最大速度:MaxSpeed;车道内所有车辆平均速度:AvgSpeed;VehCount:车道上的最大车辆数。
min
:
10
,
//阈值下限。当Mode中的统计类型值小于等于LevelMin值时,热力图显示为绿色。
max
:
100
//阈值上限。当Mode中的统计类型值大于等于LevelMax值时,热力图显示为红色。
},
offset
:[
0
,
0
,
1000
],
//位置偏移 xyz,单位:cm
isVisible
:
false
//是否可见
})
const
res
=
await
App
.
Scene
.
Add
(
TrafficRoadHeatMap
)
/** 车道热力图 **/
const
TrafficRoadNetworkHeatMap
=
new
App
.
TrafficRoadNetworkHeatMap
({
"
RoadMeshDataUrl
"
:
"
E://Projects//URP0823//NanNing_ortho1.xodr
"
,
// 路网文件路径
"
HeatMapPointsDataUrl
"
:
"
ws://10.66.8.162:33021/AnalyzeResult
"
,
// 热力图数据地址
"
height
"
:
0.25
,
// 热力图高度
"
compare
"
:
true
// 是否开启对比车流
})
const
res
=
await
App
.
Scene
.
Add
(
TrafficRoadNetworkHeatMap
)
```
#### GeoJson线段热力图
```
javascript
/** 创建GeoJson线段热力图 **/
const
TrafficAnalysis
=
new
App
.
TrafficAnalysis
({
"
roadDataUrl
"
:
"
roadDataUrl
"
,
// Geojson在线请求地址
"
height
"
:
30
,
"
width
"
:
5
,
"
field
"
:
"
fieldKey
"
,
// Geojson中需计算的属性
"
symbolMap
"
:
{
"
0
"
:
"
#00ffff
"
,
"
0.5
"
:
"
#ffff00
"
,
"
1
"
:
"
#ff00ff
"
}
});
const
res
=
await
App
.
Scene
.
Add
(
TrafficRoadHeatMap
)
/** 更新热力图 **/
TrafficAnalysis
.
Update
({
"
height
"
:
30
,
"
width
"
:
5
,
"
field
"
:
"
fieldKey
"
,
// Geojson中需计算的属性
"
symbolMap
"
:
{
"
0
"
:
"
#00ffff
"
,
"
0.5
"
:
"
#ffff00
"
,
"
1
"
:
"
#ff00ff
"
}
})
/** 删除热力图 **/
TrafficAnalysis
.
Delete
()
```
#### 截面流量统计
```
javascript
/** 创建截面流量统计 **/
const
TrafficSectionFlow
=
new
App
.
TrafficSectionFlow
({
startLonLat
:
[],
//截面起点
endLonLat
:
[],
//截面终点
opacity
:
0
,
//透明度,取值范围0到1
hexColor
:
""
,
//颜色,HEX值
height
:
0
//高度
})
const
res
=
await
App
.
Scene
.
Add
(
TrafficSectionFlow
)
/** 获取截面流量统计 **/
TrafficSectionFlow
.
GetSectionFlowStatistics
()
/** 删除截面 **/
TrafficSectionFlow
.
Delete
()
```
#### 全局设置
```
javascript
/** 启用 / 关闭 编辑模式 此模式在下方模型点击回调 OnModelClicked 中有模型信息 **/
App
.
TimGlobal
.
toggleEditMode
(
true
);
/** 启用 / 关闭 Gizmo **/
App
.
TimGlobal
.
toggleGizmo
(
true
);
/** 加载场景 **/
App
.
TimGlobal
.
loadScene
(
'
FS
'
);
// 场景名称
```
#### 模型
```
javascript
/** 模型加载 **/
const
Asset
=
new
App
.
TimAsset
({
"
model
"
:
{
"
sourceType
"
:
"
Imported
"
,
// BuiltIn内置模型, Imported外部导入模型
"
url
"
:
"
http://10.66.8.158:5173/1.fbx
"
// fbx文件地址
},
"
scale
"
:
[
0
,
0
,
0
],
"
location
"
:
[
0
,
0
,
0
],
"
rotation
"
:
[
0
,
0
,
0
]
})
/** 模型更新 **/
Asset
.
Update
({
"
scale
"
:
[
0
,
0
,
0
],
})
/** 模型删除 **/
Asset
.
Delete
()
/** 模型设置自定义属性 **/
App
?.
Scene
.
Covering
.
TimAsset
.
SetCustomProperties
({
"
params
"
:
{
"
customId
"
:
""
,
//自定义ID
"
customProperties
"
:
{
//自定义属性,键值对的key和value可自定义
"
P_A
"
:
1
,
"
D_B
"
:
2
}
},
"
eid
"
:
"
-123456789
"
//eid
})
/** 通过EID查询自定义ID和属性 **/
App
?.
Scene
.
Covering
.
TimAsset
.
GetTimModelInfoByEid
(
eid
)
/** 通过EID控制资产功能 **/
App
?.
Scene
.
Covering
.
TimAsset
.
ModelControl
({
type
:
'
dashboard
'
,
// type类型待定
params
:
{}
// params 格式随type类型变化
})
/** 模型材质替换 **/
App
?.
Scene
.
Covering
.
TimAsset
.
UpdateSelectionMaterial
(
{
"
materialInfo
"
:
{
"
materialParams
"
:
{
"
textures
"
:
{},
"
colors
"
:
{},
"
scalars
"
:
{}
},
"
sourceType
"
:
"
BuiltIn
"
,
"
assetId
"
:
""
,
"
url
"
:
""
}
}
)
/** 模型加载状态回调 **/
App
.
Scene
.
Covering
.
TimAsset
.
OnModelProcessState
(()
=>
{
console
.
log
(
"
=============OnModelProcessState===========
"
)
})
/** 开启编辑状态后的模型点击回调 **/
App
.
Scene
.
Covering
.
TimAsset
.
OnModelProcessState
(()
=>
{
console
.
log
(
"
=============OnModelProcessState===========
"
)
})
/** 加载储存场景 **/
App
?.
Scene
.
Covering
.
TimAsset
.
LoadTimModelScene
()
App
?.
Scene
.
Covering
.
TimAsset
.
SaveTimModelScene
()
App
?.
Scene
.
Covering
.
TimAsset
.
LoadTimModelSceneOnline
()
App
?.
Scene
.
Covering
.
TimAsset
.
SaveTimModelSceneOnline
()
```
## License
Copyright (c) 2023-present, 51WORLD
gis_sdk/world51/51timapi/Plugins/tim/data-tools/handle-atom.d.ts
0 → 100644
View file @
f34e539c
export
declare
const
handleBasicAtom
:
(
oriData
:
Record
<
string
,
any
>
,
paramsData
:
Record
<
string
,
any
>
)
=>
void
;
export
declare
const
handleTransformAtom
:
(
oriData
:
Record
<
string
,
any
>
,
paramsData
:
Record
<
string
,
any
>
)
=>
void
;
export
declare
const
handleVisibleAtom
:
(
oriData
:
Record
<
string
,
any
>
,
paramsData
:
Record
<
string
,
any
>
)
=>
void
;
export
declare
const
handleAtom
:
(
oriData
:
Record
<
string
,
any
>
,
paramsData
:
Record
<
string
,
any
>
)
=>
void
;
gis_sdk/world51/51timapi/Plugins/tim/data-tools/index.d.ts
0 → 100644
View file @
f34e539c
import
{
CoordObjType
,
CoordType
,
RotatorType
,
UndoRedoResultType
}
from
'
../modules/common/data-type
'
;
import
{
ObjectController
}
from
'
../modules/common/object-controller
'
;
export
declare
const
handleSceneChangedData
:
(
data
:
UndoRedoResultType
,
RequestEntity
:
any
,
RegisterObj
:
any
,
ObjectEidMap
:
Map
<
string
,
any
>
)
=>
Promise
<
{
[
key
:
string
]:
any
;
}
>
;
export
declare
const
handleTypeToEidsData
:
<
T
extends
{
eids
:
Array
<
string
>
;
}
>
(
typeToEids
:
Record
<
string
,
T
>
,
RegisterObj
:
any
)
=>
Promise
<
{
[
key
:
string
]:
any
;
}
>
;
export
declare
const
handleOutlinerData
:
(
data
:
Record
<
string
,
{
eids
:
Array
<
string
>
;
}
>
,
RequestEntity
:
any
,
RegisterObj
:
any
)
=>
Promise
<
Record
<
string
,
Array
<
Record
<
string
,
any
>>>>
;
export
declare
const
handleCoordData
:
(
objects
:
ObjectController
,
coord
:
CoordObjType
)
=>
CoordType
;
export
declare
const
handleRotatorData
:
(
objects
:
ObjectController
,
rotator
:
RotatorType
)
=>
RotatorType
;
export
declare
const
findObjectFromListByCustomId
:
<
T
>
(
cids
:
Array
<
string
>
,
eidMap
:
Map
<
string
,
T
>
)
=>
T
[];
export
declare
const
findObjectFromListByEntityName
:
<
T
>
(
entityNames
:
Array
<
string
>
,
eidMap
:
Map
<
string
,
T
>
)
=>
T
[];
gis_sdk/world51/51timapi/Plugins/tim/data-tools/params-rename.d.ts
0 → 100644
View file @
f34e539c
export
declare
const
camelToUnderline
:
(
str
:
string
)
=>
string
;
export
declare
const
underlineToCamel
:
(
str
:
string
)
=>
string
;
gis_sdk/world51/51timapi/Plugins/tim/enum/message-enum.d.ts
0 → 100644
View file @
f34e539c
export
declare
enum
UeMessageEnum
{
API
=
0
,
EVENT
=
1
,
ERROR
=
2
}
export
declare
enum
SelectionEnum
{
Add
=
0
,
Remove
=
1
,
Clear
=
2
}
gis_sdk/world51/51timapi/Plugins/tim/factory/index.d.ts
0 → 100644
View file @
f34e539c
export
declare
const
objectByEid
:
Map
<
string
,
any
>
;
gis_sdk/world51/51timapi/Plugins/tim/index.cjs.js
0 → 100644
View file @
f34e539c
This diff is collapsed.
Click to expand it.
gis_sdk/world51/51timapi/Plugins/tim/index.cjs.js.map
0 → 100644
View file @
f34e539c
This diff is collapsed.
Click to expand it.
gis_sdk/world51/51timapi/Plugins/tim/index.d.ts
0 → 100644
View file @
f34e539c
import
CloudApi
from
'
cloudapi
'
;
import
RendererController
from
'
./modules/renderer-controller
'
;
import
DebugController
from
'
./modules/debug-controller
'
;
import
EnvironmentController
from
'
./modules/environment-controller
'
;
import
SystemController
from
'
./modules/system-controller
'
;
import
ToolsController
from
'
./modules/tools-controller
'
;
import
CustomizeController
from
'
./modules/customize-controller
'
;
import
SettingController
from
'
./modules/setting-controller
'
;
import
DataModelController
from
'
./modules/datamodel-controller
'
;
import
SceneController
from
'
./modules/scene-controller
'
;
import
CameraControlController
from
'
./modules/cameracontrol-controller
'
;
import
CameraPresetController
from
'
./modules/camerapreset-controller
'
;
import
CameraRoamControllerController
from
'
./modules/cameraroam-controller
'
;
import
TransactionController
from
'
./modules/transaction-controller
'
;
import
PluginController
from
'
./modules/plugin-controller
'
;
import
CameraObject
from
'
./modules/camera/index
'
;
import
CameraRoamObject
from
'
./modules/camera-roam/index
'
;
import
PointObject
from
'
./modules/data-model/geometry/point/index
'
;
import
PolylineObject
from
'
./modules/data-model/geometry/polyline/index
'
;
import
Polygon2DObject
from
'
./modules/data-model/geometry/polygon2d/index
'
;
import
RangeObject
from
'
./modules/scene/covering/range/index
'
;
import
PoiObject
from
'
./modules/scene/covering/poi/index
'
;
import
PathObject
from
'
./modules/scene/covering/path/index
'
;
import
HeatMapObject
from
'
./modules/scene/covering/heatmap/index
'
;
import
HighlightAreaObject
from
'
./modules/scene/covering/highlightarea/index
'
;
import
ParticleObject
from
'
./modules/scene/covering/particle/index
'
;
import
Text3DObject
from
'
./modules/scene/covering/text3d/index
'
;
import
ColumnarHeatMapObject
from
'
./modules/scene/covering/columnarheatmap/index
'
;
import
WindowObject
from
'
./modules/scene/covering/window/index
'
;
import
ViewshedObject
from
'
./modules/scene/covering/viewshed/index
'
;
import
ParabolaObject
from
'
./modules/scene/covering/parabola/index
'
;
import
BoundObject
from
'
./modules/scene/covering/bound/index
'
;
import
TilesObject
from
'
./modules/scene/tiles/index
'
;
import
StaticObject
from
'
./modules/scene/model/static/index
'
;
import
HierarchyObject
from
'
./modules/scene/model/hierarchy/index
'
;
import
SkeletalObject
from
'
./modules/scene/model/skeletal/index
'
;
import
SpaceHeatMapObject
from
'
./modules/scene/covering/spaceheatmap/index
'
;
import
RoadHeatMapObject
from
'
./modules/scene/covering/roadheatmap/index
'
;
import
RasterObject
from
'
./modules/scene/covering/raster/index
'
;
import
RealTimeVideoObject
from
'
./modules/scene/covering/realtimevideo/index
'
;
import
GroupObject
from
'
./modules/scene/group/index
'
;
interface
CloudApiType
{
id
:
string
;
lock
?:
boolean
;
fullscreen
?:
boolean
;
debugMode
?:
string
;
resolution
?:
Array
<
number
>
;
keyboard
?:
{
normal
?:
boolean
;
func
?:
boolean
;
};
initLog
?:
boolean
;
rendererMode
?:
string
;
}
interface
InnerType
{
fingerprint
?:
string
;
}
interface
WdpApiType
extends
CloudApiType
,
InnerType
{
url
:
string
;
order
:
string
;
}
export
default
class
WdpApi
extends
CloudApi
{
private
recordMode
;
private
apiInfo
;
private
record
;
private
ws
;
private
_P
;
private
apiRequestMode
;
private
apiRequestURL
;
private
timeoutTime
;
private
ObjectEidMap
;
private
RegisterObj
;
private
url
;
private
order
;
private
UeEvents
;
private
reqMan
;
private
EventList
;
private
RequestEntity
;
Renderer
:
RendererController
;
Debug
:
DebugController
;
Environment
:
EnvironmentController
;
System
:
SystemController
;
Tools
:
ToolsController
;
Customize
:
CustomizeController
;
Setting
:
SettingController
;
DataModel
:
DataModelController
;
Scene
:
SceneController
;
CameraControl
:
CameraControlController
;
CameraPreset
:
CameraPresetController
;
CameraRoamController
:
CameraRoamControllerController
;
Transaction
:
TransactionController
;
Plugin
:
PluginController
;
Camera
:
typeof
CameraObject
;
CameraRoam
:
typeof
CameraRoamObject
;
Point
:
typeof
PointObject
;
Polyline
:
typeof
PolylineObject
;
Polygon2D
:
typeof
Polygon2DObject
;
Range
:
typeof
RangeObject
;
Poi
:
typeof
PoiObject
;
Path
:
typeof
PathObject
;
HeatMap
:
typeof
HeatMapObject
;
HighlightArea
:
typeof
HighlightAreaObject
;
Particle
:
typeof
ParticleObject
;
Text3D
:
typeof
Text3DObject
;
ColumnarHeatMap
:
typeof
ColumnarHeatMapObject
;
Window
:
typeof
WindowObject
;
Viewshed
:
typeof
ViewshedObject
;
Parabola
:
typeof
ParabolaObject
;
Bound
:
typeof
BoundObject
;
Tiles
:
typeof
TilesObject
;
Static
:
typeof
StaticObject
;
Hierarchy
:
typeof
HierarchyObject
;
Skeletal
:
typeof
SkeletalObject
;
SpaceHeatMap
:
typeof
SpaceHeatMapObject
;
RoadHeatMap
:
typeof
RoadHeatMapObject
;
Raster
:
typeof
RasterObject
;
RealTimeVideo
:
typeof
RealTimeVideoObject
;
Group
:
typeof
GroupObject
;
constructor
(
opt
:
WdpApiType
);
private
init
;
private
initLog
;
/**
* @function registerSceneEvent
* @param {Array[{name: string, func: any}]} [events]
* @return {void}
*/
private
registerSceneEvent
;
private
setLogLevel
;
/**
* @function startCloud
* @return {Promise<void>}
*/
private
startCloud
;
private
startCloudByTaskId
;
private
startSocketDebugMode
;
/**
* @function startApi
* @param {any} [data] Json data
* @return {Promise<any>}
*/
private
startApi
;
/**
* @function startApiByObject
* @param {any} [data] Json data
* @return {Promise<any>}
*/
private
startApiByObject
;
/**
* @function handleDataChannelMessage
* @param {any} [data] datachannel data
* @return {void}
*/
private
handleDataChannelMessage
;
/**
* @function handleApiData
* @param {any} [jsonData]
* @return {void}
*/
private
handleApiData
;
/**
* @function handleUEEventData
* @param {any} [jsonData]
* @return {void}
*/
private
handleUEEventData
;
/**
* @function handleErrorData
* @param {any} [jsonData]
* @return {void}
*/
private
handleErrorData
;
/**
* @function handleDefaultData
* @param {any} [jsonData]
* @return {void}
*/
private
handleDefaultData
;
private
OnWdpSceneIsReady
;
private
OnEntityClicked
;
private
OnEntityDbClicked
;
private
OnMouseEnterEntity
;
private
OnMouseOutEntity
;
private
OnEntityNodeSelectionChanged
;
private
OnEntitySelectionChanged
;
private
OnEntityAdded
;
private
OnEntityRemoved
;
private
OnEntityUpdated
;
private
OnWdpSceneChanged
;
}
export
{};
gis_sdk/world51/51timapi/Plugins/tim/index.js
0 → 100644
View file @
f34e539c
This diff is collapsed.
Click to expand it.
gis_sdk/world51/51timapi/Plugins/tim/index.js.map
0 → 100644
View file @
f34e539c
This diff is collapsed.
Click to expand it.
gis_sdk/world51/51timapi/Plugins/tim/index.umd.js
0 → 100644
View file @
f34e539c
This diff is collapsed.
Click to expand it.
gis_sdk/world51/51timapi/Plugins/tim/index.umd.js.map
0 → 100644
View file @
f34e539c
This diff is collapsed.
Click to expand it.
Prev
1
2
3
4
5
6
…
12
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment