相关代码:
const geojsonLayer = new mars3d.layer.GeoJsonLayer({
data: {
type: "FeatureCollection",
features: [
{
type: "Feature",
geometry: {
type: "MultiLineString",
coordinates: [
[
[121.415473, 29.610703],
[121.627713, 29.513601]
]
]
},
properties: {
gid: "1",
code: "1706687126824"
},
id: "fid-2035db7f_18d593c3350_-7eb7"
}
]
},
symbol: {
type: "rectangle",
styleOptions: {
outline: false,
clampToGround: true,
distanceDisplayCondition: false,
rotationDegree: 0,
materialType: "Text",
materialOptions: {
text: "Mars3D三维可视化平台",
materialType: "Text",
font_family: "楷体",
font_size: 100,
font_weight: "normal",
font_style: "normal",
color: "#FFFF00",
stroke: false,
background: true,
backgroundColor: "rgba(255,255,255,1)",
padding: 5
}
}
},
flyTo: true
})
map.addLayer(geojsonLayer)
实现效果: