hj-gis-sdk 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dev-dist/common.esm.js +6 -0
- package/dev-dist/common.esm.js.map +1 -1
- package/dev-dist/common.js +6 -0
- package/dev-dist/common.js.map +1 -1
- package/dev-dist/types/src/common.d.ts.map +1 -1
- package/dev-dist/weather.esm.js.map +1 -1
- package/dev-dist/weather.js.map +1 -1
- package/dist/types/src/common.d.ts.map +1 -1
- package/index.html +48 -0
- package/package-lock.json +7368 -0
- package/package.json +3 -2
- package/src/common.ts +8 -0
- package/src/weather.ts +1 -1
- package/yarn.lock +3108 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/common.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/common.ts"],"names":[],"mappings":"AAQA,wBAAsB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW;;;GAsC1E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"weather.esm.js","sources":["../src/weather.ts"],"sourcesContent":["import { Addons } from 'hj-gis-sdk'\n\n/// 天气示例\n\nimport { PerspectiveCamera } from 'hj-gis-sdk/addons/camera'\nimport { initializeApp } from './common'\n\nimport GUI from 'lil-gui'\nimport { Logger, LogLevel } from '@epicgames-ps/lib-pixelstreamingcommon-ue5.5'\nLogger.InitLogging(LogLevel.Info, false)\nconst { UERPCNode
|
|
1
|
+
{"version":3,"file":"weather.esm.js","sources":["../src/weather.ts"],"sourcesContent":["import { Addons } from 'hj-gis-sdk'\n\n/// 天气示例\n\nimport { PerspectiveCamera } from 'hj-gis-sdk/addons/camera'\nimport { initializeApp } from './common'\n\nimport GUI from 'lil-gui'\nimport { Logger, LogLevel } from '@epicgames-ps/lib-pixelstreamingcommon-ue5.5'\nLogger.InitLogging(LogLevel.Info, false)\nconst { UERPCNode, WeatherType } = Addons\n\nlet world: InstanceType<typeof Addons.World>\nlet camera: InstanceType<typeof PerspectiveCamera>\n\nlet weatherNode: InstanceType<typeof UERPCNode>\n\nasync function _initializeApp() {\n // const url = `ws://120.27.198.158:9001/player`\n const url = `wss://kdyjs-proxy.metamaker.cn/proxy_gis_sdk`\n const AppElement = document.querySelector('#ue')! as HTMLElement\n let result = await initializeApp(url, AppElement)\n world = result.world\n camera = result.camera\n\n // 加载地图 并 调整 camera 的站位\n await world!.loadLevelByName('plgz')\n camera!.transform.rotation.pitch = -12.259792797845645\n camera!.transform.rotation.yaw = 126.9423080594274\n camera!.transform.rotation.roll = 0.00003001662846458654\n camera!.transform.position.set(\n -234809.24784008358,\n -74593.71088085348,\n 13755.085257765979\n )\n}\n\n// 判断 window 是否初始化完成\nif (document.readyState === 'loading') {\n // 文档正在加载,等待DOMContentLoaded事件\n document.addEventListener('DOMContentLoaded', _initializeApp)\n} else {\n // 文档已经加载完成,直接初始化应用\n _initializeApp()\n}\n\n// 天气处理器类型\nlet weatherHandler: any // 实际类型需要根据项目定义\nconst gui = new GUI()\n\n// 天气配置对象\nconst weatherConfig = {\n type: '' // 默认天气类型\n}\n\n// 天气类型选项\nconst weatherOptions = {\n 晴天: WeatherType.SUNNY,\n 雾天: WeatherType.Foggy,\n 雨天: WeatherType.RAIN,\n 雪天: WeatherType.SNOW\n}\n\n// 添加天气类型下拉菜单\ngui\n .add(weatherConfig, 'type', weatherOptions)\n .name('天气类型')\n .onChange(async (value: string) => {\n // 当选择变化时,根据选择的天气类型调用相应的方法\n switch (value) {\n case WeatherType.SUNNY:\n await world.tools.weather.setWeather(WeatherType.SUNNY)\n break\n case WeatherType.Foggy:\n await world.tools.weather.setWeather(WeatherType.Foggy)\n break\n case WeatherType.RAIN:\n await world.tools.weather.setWeather(WeatherType.RAIN)\n break\n case WeatherType.SNOW:\n await world.tools.weather.setWeather(WeatherType.SNOW)\n break\n default:\n console.log('未知的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AAE,EAAE;CACT,CAAA;AAED;AACA,MAAM,cAAc,GAAG;IACrB,EAAE,EAAE,WAAW,CAAC,KAAK;IACrB,EAAE,EAAE,WAAW,CAAC,KAAK;IACrB,EAAE,EAAE,WAAW,CAAC,IAAI;IACpB,EAAE,EAAE,WAAW,CAAC,IAAI;CACrB,CAAA;AAED;AACA,GAAG;AACA,KAAA,GAAG,CAAC,aAAa,EAAE,MAAM,EAAE,cAAc,CAAC;KAC1C,IAAI,CAAC,MAAM,CAAC;AACZ,KAAA,QAAQ,CAAC,OAAO,KAAa,KAAI;;IAEhC,QAAQ,KAAK;QACX,KAAK,WAAW,CAAC,KAAK;AACpB,YAAA,MAAM,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;YACvD,MAAK;QACP,KAAK,WAAW,CAAC,KAAK;AACpB,YAAA,MAAM,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;YACvD,MAAK;QACP,KAAK,WAAW,CAAC,IAAI;AACnB,YAAA,MAAM,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;YACtD,MAAK;QACP,KAAK,WAAW,CAAC,IAAI;AACnB,YAAA,MAAM,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;YACtD,MAAK;AACP,QAAA;AACE,YAAA,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,KAAK,CAAC,CAAA;KACjC;AACH,CAAC,CAAC"}
|
package/dev-dist/weather.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"weather.js","sources":["../src/weather.ts"],"sourcesContent":["import { Addons } from 'hj-gis-sdk'\n\n/// 天气示例\n\nimport { PerspectiveCamera } from 'hj-gis-sdk/addons/camera'\nimport { initializeApp } from './common'\n\nimport GUI from 'lil-gui'\nimport { Logger, LogLevel } from '@epicgames-ps/lib-pixelstreamingcommon-ue5.5'\nLogger.InitLogging(LogLevel.Info, false)\nconst { UERPCNode
|
|
1
|
+
{"version":3,"file":"weather.js","sources":["../src/weather.ts"],"sourcesContent":["import { Addons } from 'hj-gis-sdk'\n\n/// 天气示例\n\nimport { PerspectiveCamera } from 'hj-gis-sdk/addons/camera'\nimport { initializeApp } from './common'\n\nimport GUI from 'lil-gui'\nimport { Logger, LogLevel } from '@epicgames-ps/lib-pixelstreamingcommon-ue5.5'\nLogger.InitLogging(LogLevel.Info, false)\nconst { UERPCNode, WeatherType } = Addons\n\nlet world: InstanceType<typeof Addons.World>\nlet camera: InstanceType<typeof PerspectiveCamera>\n\nlet weatherNode: InstanceType<typeof UERPCNode>\n\nasync function _initializeApp() {\n // const url = `ws://120.27.198.158:9001/player`\n const url = `wss://kdyjs-proxy.metamaker.cn/proxy_gis_sdk`\n const AppElement = document.querySelector('#ue')! as HTMLElement\n let result = await initializeApp(url, AppElement)\n world = result.world\n camera = result.camera\n\n // 加载地图 并 调整 camera 的站位\n await world!.loadLevelByName('plgz')\n camera!.transform.rotation.pitch = -12.259792797845645\n camera!.transform.rotation.yaw = 126.9423080594274\n camera!.transform.rotation.roll = 0.00003001662846458654\n camera!.transform.position.set(\n -234809.24784008358,\n -74593.71088085348,\n 13755.085257765979\n )\n}\n\n// 判断 window 是否初始化完成\nif (document.readyState === 'loading') {\n // 文档正在加载,等待DOMContentLoaded事件\n document.addEventListener('DOMContentLoaded', _initializeApp)\n} else {\n // 文档已经加载完成,直接初始化应用\n _initializeApp()\n}\n\n// 天气处理器类型\nlet weatherHandler: any // 实际类型需要根据项目定义\nconst gui = new GUI()\n\n// 天气配置对象\nconst weatherConfig = {\n type: '' // 默认天气类型\n}\n\n// 天气类型选项\nconst weatherOptions = {\n 晴天: WeatherType.SUNNY,\n 雾天: WeatherType.Foggy,\n 雨天: WeatherType.RAIN,\n 雪天: WeatherType.SNOW\n}\n\n// 添加天气类型下拉菜单\ngui\n .add(weatherConfig, 'type', weatherOptions)\n .name('天气类型')\n .onChange(async (value: string) => {\n // 当选择变化时,根据选择的天气类型调用相应的方法\n switch (value) {\n case WeatherType.SUNNY:\n await world.tools.weather.setWeather(WeatherType.SUNNY)\n break\n case WeatherType.Foggy:\n await world.tools.weather.setWeather(WeatherType.Foggy)\n break\n case WeatherType.RAIN:\n await world.tools.weather.setWeather(WeatherType.RAIN)\n break\n case WeatherType.SNOW:\n await world.tools.weather.setWeather(WeatherType.SNOW)\n break\n default:\n console.log('未知的天气类型:', value)\n }\n })\n"],"names":["Logger","LogLevel","Addons","initializeApp","GUI"],"mappings":";;;;;;;AASAA,YAAM,CAAC,WAAW,CAACC,cAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;AACxC,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,GAAGC,aAAM,CAAA;AAEzC,IAAI,KAAwC,CAAA;AAC5C,IAAI,MAA8C,CAAA;AAIlD,eAAe,cAAc,GAAA;;IAE3B,MAAM,GAAG,GAAG,CAAA,4CAAA,CAA8C,CAAA;IAC1D,MAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAiB,CAAA;IAChE,IAAI,MAAM,GAAG,MAAMC,oBAAa,CAAC,GAAG,EAAE,UAAU,CAAC,CAAA;AACjD,IAAA,KAAK,GAAG,MAAM,CAAC,KAAK,CAAA;AACpB,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAA;;AAGtB,IAAA,MAAM,KAAM,CAAC,eAAe,CAAC,MAAM,CAAC,CAAA;IACpC,MAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,GAAG,CAAC,kBAAkB,CAAA;IACtD,MAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,GAAG,iBAAiB,CAAA;IAClD,MAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,GAAG,sBAAsB,CAAA;AACxD,IAAA,MA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M,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;YACtD,MAAK;AACP,QAAA;AACE,YAAA,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,KAAK,CAAC,CAAA;KACjC;AACH,CAAC,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/common.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/common.ts"],"names":[],"mappings":"AAQA,wBAAsB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW;;;GAsC1E"}
|
package/index.html
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="zh-CN">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>GIS SDK 示例目录</title>
|
|
7
|
+
<style>
|
|
8
|
+
body {
|
|
9
|
+
font-family: Arial, sans-serif;
|
|
10
|
+
max-width: 800px;
|
|
11
|
+
margin: 0 auto;
|
|
12
|
+
padding: 20px;
|
|
13
|
+
}
|
|
14
|
+
h1 {
|
|
15
|
+
color: #333;
|
|
16
|
+
}
|
|
17
|
+
ul {
|
|
18
|
+
list-style-type: none;
|
|
19
|
+
padding: 0;
|
|
20
|
+
}
|
|
21
|
+
li {
|
|
22
|
+
margin: 10px 0;
|
|
23
|
+
}
|
|
24
|
+
a {
|
|
25
|
+
color: #0000ee;
|
|
26
|
+
text-decoration: underline;
|
|
27
|
+
}
|
|
28
|
+
a:hover {
|
|
29
|
+
color: #0000aa;
|
|
30
|
+
}
|
|
31
|
+
</style>
|
|
32
|
+
</head>
|
|
33
|
+
<body>
|
|
34
|
+
<h1>GIS SDK 示例目录</h1>
|
|
35
|
+
<ul>
|
|
36
|
+
<li><a href="./example/index.html">基础示例</a></li>
|
|
37
|
+
<li><a href="./example/fence.html">围栏示例</a></li>
|
|
38
|
+
<li><a href="./example/heatmap.html">热力图示例</a></li>
|
|
39
|
+
<li><a href="./example/scatter.html">散点图示例</a></li>
|
|
40
|
+
<li><a href="./example/building.html">建筑示例</a></li>
|
|
41
|
+
<li><a href="./example/weather.html">天气与时间示例</a></li>
|
|
42
|
+
<li><a href="./example/measurement.html">测量示例</a></li>
|
|
43
|
+
<li><a href="./example/ghost.html">虚化示例</a></li>
|
|
44
|
+
<li><a href="./example/animation.html">动画示例</a></li>
|
|
45
|
+
<li><a href="./example/keyframe-animation.html">关键帧动画示例</a></li>
|
|
46
|
+
</ul>
|
|
47
|
+
</body>
|
|
48
|
+
</html>
|