Skip to content

构建信息介绍

通过基础模块的创建场景创建场景我们可以了解到场景的构建提交信息包含sceneId(场景 id,创建时候自己生成 uuid,修改时候使用当前场景 id),projectId(项目 id,项目 id 为空时为创建个人场景;项目 id 不为空时为创建项目场景),dataJson(场景基本信息、以及个图层基本信息),ROOTPATHPAGEPATH(默认传 location.origin),saveType(默认传 1,后续可能会弃用)。

dataJson

dataJson对应是字符串,而字符串中序列化前又包含多个对象,这些对象中包含:

basicInfo

basicInfo(场景基本信息),结构如下:

json
{
  // 场景id
  "sceneId": "03aee685be8a4c989f90adce64575419",
  // 场景名称
  "title": "SDK",
  // 场景关键字
  "keyWord": "",
  // 场景封面图
  "coverImg": "image/bf7d8f39-f3da-44a9-bc2e-a575f6cb3514.jpg",
  // 场景logo图
  "logoImg": "",
  // 场景描述
  "description": "",
  // 场景状态
  "sceneStatus": "2",
  // 视角信息
  "viewPoint": {
    "posx": -2386094.3571853694,
    "posy": 4799212.235909229,
    "posz": 3448211.149137819,
    "upx": 0.24202189221912118,
    "upy": -0.4867847840963128,
    "upz": 0.8393247152675669,
    "directionx": 0.37366371003917936,
    "directiony": -0.7515593186560449,
    "directionz": -0.5436304096911962,
    // 视角截图
    "viewImg": "image/71f4ce98-db6b-419b-8cbc-086b91d83665.jpg"
  },
  // 皮肤id
  "templateId": "3",
  // 创建时间
  "createDate": "2025-01-15 14:20:39"
}

scene

scene(场景中的 gis 数据,利用初始化的实例 viewer.toJson 方法导出),结构如下:

json
{
  "asset": {
    "version": "1.0.0",
    // 更新时间
    "date": "2025-01-22T06:23:20.5840000000025611Z"
  },
  "scene": {
    "properties": {
      // 遮挡检测距离
      "minimumDisableDepthTestDistance": 0,
      // 是否投影
      "shadows": false
    },
    // 影像图层、矢量(shp/cad)
    "imageryLayers": [],
    // 地形图层
    "terrainLayers": [],
    // 实景三维、bim、点云、小品等
    "layers": [],
    // 更新时间
    "date": "2025-01-22T06:18:23.63560000219149515Z"
  },
  // 引擎版本
  "VERSION": "3.0.0.988",
  // 图层树(zTree插件transformToArray方法导出)
  "Tree": []
}

draw

draw(标绘点线面数据利用的 GeoJsonDataSource 的 toGeoJson 方法导出),结构如下:

json
{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "id": "38fae0488134fdf989896d8dc36875f3",
      "visible": true,
      "properties": {
        "des": "",
        "markerType": 1,
        "mediaUrl": "",
        "position": {
          "x": -2386094.3571853708,
          "y": 4799212.235909228,
          "z": 3448211.149137819
        },
        "up": {
          "x": 0.24202189226910442,
          "y": -0.486784784196845,
          "z": 0.8393247151948482
        },
        "direction": {
          "x": 0.3736637100068057,
          "y": -0.7515593185909298,
          "z": -0.5436304098034686
        },
        "viewpointId": "",
        "thumpath": "temp/scene/03aee685be8a4c989f90adce64575419/image/21a1bc53-ada3-4fdd-90ab-5cd061ee2bec.jpg",
        "label": {
          "type": "markerLabel",
          "text": "测试",
          "font": "32px Microsoft YaHei",
          "style": "FILL_AND_OUTLINE",
          "outlineWidth": 6,
          "translucencyByDistance": [150, 1, 150000, 0],
          "horizontalOrigin": "LEFT",
          "pixelOffset": "(15,-15)",
          "disableDepthTestDistance": 0,
          "scale": 0.5,
          "fillColor": "rgb(255,255,255)"
        },
        "billboard": {
          "type": "markerBillboard",
          "image": "http://10.16.30.27/api/admin/static-data/get/marker/GEMarker/red-diamond.png",
          "width": 64,
          "height": 64,
          "disableDepthTestDistance": 0,
          "scale": 0.5,
          "translucencyByDistance": [150, 1, 150000, 0],
          "pixelOffset": "(0,-13)"
        }
      },
      "geometry": {
        "type": "Point",
        "coordinates": [
          120.40864368212571, 31.318284261383557, 34.82049661781336
        ]
      }
    },
    {
      "type": "Feature",
      "id": "1f297dc8-6ff8-4160-86a1-e381e42452ba",
      "visible": true,
      "properties": {
        "position": {
          "x": -2760586.3528155675,
          "y": 4703545.733323306,
          "z": 3296172.194469267
        },
        "up": {
          "x": 0.510057115158925,
          "y": -0.21850711522741076,
          "z": 0.8319233016755513
        },
        "direction": {
          "x": 0.45825204278433,
          "y": -0.7494698401680122,
          "z": -0.47780751769151036
        },
        "title": "普通线",
        "stroke-width": "5",
        "stroke-clampToGround": true,
        "stroke-type": "Color",
        "stroke": "rgb(0,186,255)",
        "stroke-opacity": 1,
        "classificationType": "BOTH"
      },
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [120.40903542199523, 31.318304343117735, 22.906161901827332],
          [120.40912044939887, 31.318533456117933, 5.275440927791752],
          [120.40948901802298, 31.318458708409203, 5.250592928807345]
        ]
      }
    },
    {
      "type": "Feature",
      "id": "99f61b6e-d4e9-4244-a526-181b16f17e0d",
      "visible": true,
      "properties": {
        "position": {
          "x": -2760520.302614396,
          "y": 4703593.177043546,
          "z": 3296134.800409752
        },
        "up": {
          "x": 0.5100559483433221,
          "y": -0.2185039979868502,
          "z": 0.8319248358015026
        },
        "direction": {
          "x": 0.45824380896921973,
          "y": -0.7494792748656087,
          "z": -0.4778006154122268
        },
        "title": "普通面",
        "fill": "rgb(0,186,255)",
        "fill-opacity": 1,
        "stroke-width": 1,
        "stroke-opacity": 1,
        "stroke": "rgb(0,0,0)",
        "classificationType": "BOTH"
      },
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [120.40836912943328, 31.318223149948054, 22.889412186189595],
            [120.40846162486658, 31.318198348130917, 24.454898314426636],
            [120.40844146774708, 31.318169816514093, 5.802177291601299],
            [120.40836613636253, 31.318155806543814, 6.019825730373342],
            [120.40836613636253, 31.318155806543814, 6.019825730373342]
          ]
        ]
      }
    }
  ]
}

drawDetail

drawDetail(标绘点线面挂载的富文本等信息),结构如下:

json
{
  "sceneId": "场景ID",
  "points": [
    {
      "id": "GUID",
      "title": "名称",
      //视角信息
      "viewPoint": {
        "posx": -2765417.4797739666,
        "posy": 4789433.917735196,
        "posz": 3171073.033866435,
        "upx": 0.47948405957855,
        "upy": 0.042675029450645,
        "upz": 0.876512337888898,
        "directionx": 0.578378444536402,
        "directiony": -0.766548590616974,
        "directionz": -0.279072809708834,
        // 视角截图
        "viewImg": "scene/44446d72-0039-443a-bcb0-f20fbe25ca64/image/34546d72-0039-443a-bcb0-f20fbe25ca64.jpg"
      },
      "richText": "<p>哇哇哇哇哇哇哇哇哇哇哇哇</p>"
    }
  ],
  "polylines": [
    // 同points结构
  ],
  "polygons": [
    // 同points结构
  ]
}

monomer

monomer(单体化信息数据利用的 GeoJsonDataSource 的 toGeoJson 方法导出),结构如下:

json
{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "id": "06869cf0-bd7e-45d4-9718-525a074aa6cb",
      "visible": true,
      "properties": {
        "showtype": "1",
        "copyalpha": 1,
        "prop-姓名": "张三",
        "prop-年龄": "23",
        "title": "单体化面",
        "fill": "rgb(0,186,255)",
        "fill-opacity": 1,
        "stroke-width": 1,
        "stroke-opacity": 1,
        "stroke": "rgb(0,0,0)",
        "classificationType": "BOTH"
      },
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [120.40839832794187, 31.319033729661758, 20.59781855452958],
            [120.40840084416045, 31.3189696370502, 25.071984659637472],
            [120.4085527810386, 31.318937328556984, 23.067526013580064],
            [120.4085875800271, 31.318982873126565, 28.544903346174515]
          ]
        ]
      }
    }
  ]
}

push

push(压平数据利用的 GeoJsonDataSource 的 toGeoJson 方法导出),结构如下:

json
{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "id": "3c915fc9-311d-4988-8de3-d56a69adab80",
      "visible": true,
      "properties": {
        "title": "普通面",
        "fill": "rgba(0,186,255,0.5)",
        "fill-opacity": 0.5,
        "stroke-width": 1,
        "stroke-opacity": 1,
        "stroke": "rgb(0,0,0)",
        "classificationType": "BOTH"
      },
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [120.4093582130651, 31.318920250182593, 21.18999999672061],
            [120.40942896061631, 31.319084987555602, 21.189999999486364],
            [120.40917338011725, 31.31910383187706, 21.189999997466415],
            [120.40902788502281, 31.318884194420654, 21.189999999619697]
          ]
        ]
      }
    }
  ]
}

water

water(水面数据利用的 GeoJsonDataSource 的 toGeoJson 方法导出),结构如下:

json
{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      // 水面id
      "id": "84f4a826-f74e-48b0-9160-505e70e21240",
      "visible": true,
      "properties": {
        // 水面宽度
        "waveWidth": "5",
        // 流向
        "flowDirection": "270",
        // 流速
        "flowSpeed": "5",
        // 水面颜色
        "_waterColor": "#006ab4",
        // 透明度
        "alpha": 100,
        // 描述
        "des": "",
        "name": "水面",
        "title": "水面",
        "fill": "rgba(128,255,255,0.01)",
        "fill-opacity": 0.01,
        "stroke-width": 2,
        "stroke-opacity": 1,
        "stroke": "rgb(255,255,0)"
      },
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [120.40974132668664, 31.318178030089232, 25.2000000038985],
            [120.40964966177455, 31.318249615631373, 25.19999999948923],
            [120.40966798309634, 31.31835163384622, 25.199999995664992],
            [120.40977488955357, 31.31831176453898, 25.19999999908407]
          ]
        ]
      }
    }
  ]
}

clip

clip(裁剪数据利用的 GeoJsonDataSource 的 toGeoJson 方法导出),结构如下:

json
{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      // 裁剪面id
      "id": "d8b06d10-1b17-494e-9c52-0cfa6f927d56",
      "visible": true,
      "properties": {
        "name": "裁剪面",
        "cutType": "pit",
        // 裁剪模型id
        "tilesetId": "941e1ca333587061da1603cb334326c1",
        "title": "裁剪面",
        "fill": "rgba(128,255,255,0.01)",
        "fill-opacity": 0.01,
        "stroke-width": 2,
        "stroke-opacity": 1,
        "stroke": "rgb(255,255,0)"
      },
      "geometry": {
        "type": "Polygon",
        // 坐标
        "coordinates": [
          [
            [120.40847006350153, 31.318160482267896, 22.816547848521726],
            [120.40866320632057, 31.318079788286315, 22.134528911238835],
            [120.40863491986138, 31.317960874192114, 28.833658324039906],
            [120.40847253860369, 31.318066293722023, 21.21603383851558]
          ]
        ]
      }
    }
  ]
}

fly

fly(飞行路径数据自己组装结构),结构如下:

json
{
  // 场景id
  "sceneId": "03aee685be8a4c989f90adce64575419",
  "lines": [
    {
      // 飞行路径id
      "id": "d017cd77b134fdf7d7ec214e11dfd25b",
      "title": "飞行路径",
      "sort": "1737526506899",
      "points": [
        {
          "id": "3327ad7bb134fdf7d7ed70899829e13a",
          "title": "视点",
          "sort": "1737526510240",
          "directionx": 0.40907618315442384,
          "directiony": -0.7527329072399452,
          "directionz": 0.5158002004011905,
          "posx": -2386106.9681109465,
          "posy": 4799152.411353623,
          "posz": 3446955.041769709,
          "timeInterval": 2,
          "upx": -0.2161806753087055,
          "upy": 0.4692223911720112,
          "upz": 0.8562104082793506,
          "viewImg": "image/28d2322f-3740-44fd-8902-e32b2126a9ae.jpg"
        },
        {
          "id": "443d791d2134fdf7d7ef564c7a7d1fa1",
          "title": "视点",
          "sort": "1737526515104",
          "directionx": 0.9593689719718902,
          "directiony": -0.272468381827256,
          "directionz": 0.0732949965689025,
          "posx": -2386830.4417831465,
          "posy": 4798510.481849502,
          "posz": 3447541.4583333004,
          "timeInterval": 2,
          "upx": 0.15152142421897702,
          "upy": 0.7166438734837307,
          "upz": 0.6807810342546916,
          "viewImg": "image/3da02fef-af38-4d8a-b935-09909e88824a.jpg"
        },
        {
          "id": "5550b8478134fdf7d7f041d58b9b7424",
          "title": "视点",
          "sort": "1737526517456",
          "directionx": 0.2968261214513067,
          "directiony": 0.2733193626468324,
          "directionz": -0.9149813001512673,
          "posx": -2385870.3528852127,
          "posy": 4797936.5878573805,
          "posz": 3448719.981207508,
          "timeInterval": 2,
          "upx": -0.27886980769780717,
          "upy": 0.9412069042390385,
          "upz": 0.19068611320007944,
          "viewImg": "image/7f11cb8f-796d-4e20-bc0b-4fe746a6e76a.jpg"
        },
        {
          // 视点id
          "id": "86bdeeb3d134fdf7d7f1f079b1d10bd7",
          "title": "视点",
          "sort": "1737526521760",
          "directionx": -0.46730470202506497,
          "directiony": -0.5664005600103377,
          "directionz": -0.6788348260698187,
          "posx": -2385008.028253367,
          "posy": 4799020.540573024,
          "posz": 3448394.619067716,
          "timeInterval": 2,
          "upx": -0.8448009761961206,
          "upy": 0.5124450960874655,
          "upz": 0.1539848502742721,
          // 视角截图
          "viewImg": "image/678e5796-067f-495e-9bac-2ff20781188f.jpg"
        }
      ]
    }
  ]
}

splitscreen

splitscreen(双屏对比数据自己组装结构),结构如下:

json
{
  "sceneId": "03aee685be8a4c989f90adce64575419",
  "screens": [
    {
      // 场景名称
      "title": "333",
      // 主场景id
      "mainSceneId": "03aee685be8a4c989f90adce64575419",
      // 对比场景id
      "contrastSceneId": "8c1ff82a678a4111b6488b66d9f44fe8",
      "contrastSceneTitle": "333",
      // 对比场景封面图
      "contrastSceneCoverImg": "image/9b99d3c1-5461-490f-9968-9e1e29082e32.jpg",
      // 对比场景描述
      "contrastSceneDescription": "",
      "isFromInitList": true
    }
  ]
}

deleteObj

deleteObj(删除对象数据,要删除的不用数据自己组装结构),结构如下:

json
{
  "sceneId": "03aee685be8a4c989f90adce64575419",
  "images": ["image/5732ca42-e7ae-4bfe-9132-587317060e69.jpg"],
  "videos": [],
  "drawDetails": []
}

Released under the MIT License.