CesiumJS JSON-描述图像从信息框中删除属性

时间:2019-07-03 07:20:56

标签: javascript json cesium

我有一个JSON文件,其中包含我需要的所有数据。在此之后,我希望能够从数据库中提取数据。在对我的实体(图像)进行描述后,它将删除属性。其他没有说明的实体正在按原样显示它们。我想念什么?

JSON

  "type": "FeatureCollection",
  "features": [
    { "type": "Feature",
      "geometry": {"type": "Point","coordinates": [80.2066734649931, 13.0187039189613]}, "color":{
        "rgba":[0,0,255,95]},
      "properties": {
        "Name": "Mika",
        "Age": 17,
        "Type": "Policeman",
        "description":"PICTURE:<div><img src='https://image.shutterstock.com/z/stock-photo-british-police-officer-140116003.jpg' height='300' width='300'></img><p></p>"
      }
    },
    { "type": "Feature",
      "geometry": {"type": "Point","coordinates": [ 120.2072495864164, 34.0191043036246]},
      "properties": {
          "Name": "Zika",
          "Age": "Worker"
      }
    },
    { "type": "Feature",
      "geometry": { "type": "Point","coordinates": [ 140.2067574402883, 84.0191983952581]},
      "properties": {
          "Name": "Pera",
          "Age": 23,
          "Type": "Student"
      }
    }
  ]
}

App.js-从JSON加载数据

let data = require('../data.json')
let dataSource = Cesium.GeoJsonDataSource.load(data);
viewer.dataSources.add(dataSource);

我希望信息框中的图像具有名称,年龄和类型。

0 个答案:

没有答案