添加地理围栏
在场景中添加地理围栏。
代码示例
// 注:目前只支持渲染features[0]这个多边形,数组中其它的多边形不渲染
let data = {
"type": "FeatureCollection",
"name": "test",
"crs": {"type": "name", "properties": {"name": "urn:ogc:def:crs:OGC:1.3:CRS84"}},
"features": [
{
"type": "Feature", "properties": {"id": 1,"height":0}, "geometry": {
"type": "MultiPolygon",
"coordinates": [[[[120.711625761972059, 31.319903719752887], [120.710521432941903, 31.318671510113795], [120.711558149990637, 31.318190173844027], [120.712820240310805, 31.318170920342073], [120.714127405285268, 31.318517482775142], [120.713947106668101, 31.320173263462038], [120.711625761972059, 31.319903719752887]]]]
}
}
]
}
let options = {
"extrudeHeight": 100, // 单位米
"extrudeColor": "#291fba",
"groundColor": "#66b4cc"
}
mapmostUE.addFencing("test", data, options);
效果
