{"_rev":"2-95d2561f497c4ba1edd68187d7091d29","time":{"created":"2023-10-10T02:08:46.452Z","1.0.0-beta0":"2023-09-25T01:26:51.732Z","modified":"2023-10-10T02:08:46.937Z","1.0.20":"2023-10-10T02:08:46.631Z"},"_id":"51gisapi","name":"51gisapi","dist-tags":{"latest":"1.0.20"},"versions":{"1.0.20":{"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","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"},"gitHead":"3088d80d1d39b2ba6e87c75c325ad4ac1739a931","_id":"51gisapi@1.0.20","_nodeVersion":"20.0.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-tm7ilv95AnRYTcxIt+vu0F6a3DbbjVuuarKuP/3z2Mx7wGHj3BXOGpi+war0yzzFLUtZrflW8EyCJLsRwFJgiA==","shasum":"03dc00632ff7354c43a353e56c86bc25597eca9e","tarball":"https://registry.npmjs.org/51gisapi/-/51gisapi-1.0.20.tgz","fileCount":25,"unpackedSize":151316,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCh/b8GWuovrR4beTdxiJ1+l8Iw0bAUfYH/exuskhBtEAIhANjE4lxfQw2QQEc7gz+fZ05tA+N6ipAdm3HBVeDm45kC"}]},"_npmUser":{"name":"yamazakeylwb","email":"158015268@qq.com"},"directories":{},"maintainers":[{"name":"yamazakeylwb","email":"158015268@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/51gisapi_1.0.20_1696903726453_0.3958092929377095"},"_hasShrinkwrap":false}},"maintainers":[{"name":"yamazakeylwb","email":"158015268@qq.com"}],"description":"GisApi is a gis plugin for WdpApi.","homepage":"http://superapi.51aes.com/","keywords":["51WORLD","51AES","51Cloud","51WDP","51Meet","51Sim","CimApi"],"repository":{"type":"git","url":"http://gitlab.51cloud.local/paas/wdpapi.git"},"author":{"name":"Yamazakey.Luo"},"license":"MIT","readme":"## Introduction\r\n\r\nGisApi is a gis plugin for WdpApi\r\n\r\n\r\n#### Install\r\n```bash\r\n$ npm i gisapi\r\n```\r\n\r\n#### Import\r\n```javascript\r\nimport WdpApi from 'wdpapi'\r\nimport GisApi from 'gisapi'\r\n```\r\n\r\n#### Init\r\n```javascript\r\nconst config = {\r\n    \"id\": \"player\", //[required] Render scene container(DOM node id)\r\n    \"url\": \"http://172.31.19.235:8889/Renderers/Any/order\", //[optional] Cloud rendering service address\r\n    \"order\": \"b96285A3\", //[optional] Rendering order, obtained on the cloud rendering client\r\n    \"resolution\": [3840,2160], //[optional] Set the cloud rendering output resolution[width, height]\r\n    \"debugMode\": \"normal\", //[optional] none: does not print logs, normal: normal logs\r\n    \"keyboard\": { //[optional] keyboard event\r\n        \"normal\": false, //[optional] Keyboard event, exclude F1~F12 [default disabled]\r\n        \"func\": false //[optional] Browser F1 ~ F12 function keys [default disabled]\r\n    }\r\n}\r\nconst App = new WdpApi(config) as GisApi & WdpApi;\r\nApp.Plugin.Install(GisApi).then(r=>{\r\n    App.Renderer.Start().then((res) => {\r\n        if (res.success) {\r\n            App.Renderer.RegisterEvent([\r\n                {\r\n                    name: 'onVideoStreamLoaded', func: function () {\r\n                        // 视频流加载成功\r\n                    }\r\n                }\r\n            ])\r\n        }\r\n    })\r\n});\r\n```\r\n\r\n#### Methods\r\n```javascript\r\n/** 通用 API, 支持3DTiles/WMS/WMTS三种图层及偏移 **/\r\nconst gisLayer = new App['3DTiles/WMS/WMTS']({\r\n    'configs':{\r\n        \"url\": \"https://gis-demo-data.51aes.com:50000/model/GSZ/tileset.json\",\r\n        \"offset\": [ 0, 0, 0 ]\r\n    }\r\n})\r\nconst res = await App.Scene.Add(gisLayer)\r\n\r\ngisLayer.Update(\r\n    {\r\n        'configs':{\r\n            \"offset\": [ 10, 10, 20 ]\r\n        }\r\n    }\r\n)\r\n\r\ngisLayer.Delete()\r\n\r\n/** 请注意以下配置需要专业版支持 **/\r\nconst geoLayerConfig = {\r\n    \"geoLayerUrl\": \"GDAL/bj/BJ_bud_02_Elevation.shp\",\r\n    \"geoLayerType\": \"shp\",\r\n    \"geoLayerParams\":\r\n        {\r\n            \"serviceLayerName\": \"\",\r\n            \"featureType\": \"Polygon\",\r\n            \"needGCJOffset\": false,\r\n            \"batchFeatureNum\": 4000\r\n        },\r\n    \"geoFeatureStyle\":{\r\n        \"styleDesc\": \"Default1\",\r\n        \"bBasedOnTerrain\": false,\r\n        \"PolygonStyle\":\r\n            {\r\n                \"filledColor\": \"#FF0000FF\",\r\n                \"bOutline\": false,\r\n                \"outlineColor\": \"#00C0C8FF\",\r\n                \"outlineWidth\": 200,\r\n                \"bExtrude\": true,\r\n                \"extrudeHeight\": 100,\r\n                \"extrudeHeightField\": \"Elevation\"\r\n            },\r\n        \"lineStyle\":\r\n            {\r\n                \"lineColor\": \"#00C0C8FF\",\r\n                \"lineWidth\": 10,\r\n                \"lineShape\": \"Plane\"\r\n            }\r\n    }\r\n}\r\n\r\n/** 加载矢量图层 **/\r\nconst geoLayer = new App.GeoLayer(geoLayerConfig)\r\nawait App.Scene.Add(geoLayer)\r\n\r\n/** 图层点击事件 **/\r\ngeoLayer.onClick((result: any, obj:any)=>{\r\n    console.log(result, obj)\r\n})\r\n\r\n/** 获取图层信息 **/\r\ngeoLayer.GetGeoLayerInfo()\r\n\r\n/** 执行图层操作 **/\r\ngeoLayer.RunGeoLayerAction({\r\n    \"actionName\": \"\",\r\n    \"featureId\": \"\",\r\n})\r\n\r\n/** 设置图层参考点 **/\r\ngeoLayer.SetLocalGeoreference({\r\n    \"geoReference\": [ 121.46694444000001, 31.235277780000001 ]\r\n})\r\n\r\n/** 设置图层高度 **/\r\ngeoLayer.SetGeoLayerHeight({\r\n    \"geoLayerIndex\": 0,\r\n    \"geoLayerHeightOffset\": 5\r\n})\r\n\r\n/** 设置图层位置 **/\r\ngeoLayer.SetGeoLayerLocation({\r\n    \"geoLayerLocation\": [ 0, 0, 0 ],\r\n})\r\n\r\n/** 获取图层位置 **/\r\ngeoLayer.GetGeoLayerLocation()\r\n```\r\n\r\n#### Stop Rendering\r\n```javascript\r\nApp.Renderer.Stop();\r\n```\r\n\r\n## License\r\n\r\nCopyright (c) 2023-present, 51WORLD\r\n","readmeFilename":"README.md"}