使用 A-FRAME,您如何使用 Json 文件中的数据并创建新的对象/原语来充当 POIS?
****EXEMPLO JSON:**** ( https://leafletjs.com/examples/geojson/sample-geojson.js )
var lightRailStop = {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"popupContent": "18th & California Light Rail Stop"
},
"geometry": {
"type": "Point",
"coordinates": [-104.98999178409576, 39.74683938093904]
}
},{
"type": "Feature",
"properties": {
"popupContent": "20th & Welton Light Rail Stop"
},
"geometry": {
"type": "Point",
"coordinates": [-104.98689115047453, 39.747924136466565]
}
}
]
};
提取内容所需的 javascript/html 是什么,并使用每个数据创建一个新对象(a-box / a-entity),以便可以在 a-frame VR / AR 中使用?