跳到主要内容

添加多段线

在场景中添加多段线。

代码示例
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": 5
},
"geometry": {
"type": "MultiLineString",
"coordinates": [
[
[120.677242645015028, 31.316031839518221],
[120.676500737124741, 31.316249327165423],
[120.67612978317959, 31.316299038557123],
[120.676246160887871, 31.316553809027702],
[120.676282528921689, 31.317050920156543],
[120.67626070810141, 31.317746871328417]
]
]
}
},
{
"type": "Feature",
"properties": {
"id": 1,
"height": 15
},
"geometry": {
"type": "MultiLineString",
"coordinates": [
[
[120.677242645015028, 31.316031839518221],
[120.676500737124741, 31.316249327165423],
[120.67612978317959, 31.316299038557123],
[120.676246160887871, 31.316553809027702],
[120.676282528921689, 31.317050920156543],
[120.67626070810141, 31.317746871328417]
]
]
}
}
]
}

let options = {
type: "static",
color: "#66cc66"
}

mapmostUE.addPolyline(data, options)
效果
show