mars3d实现省界线宽度>市界线宽度效果
【代码】mars3d实现省界线宽度>市界线宽度效果。
·
效果图:

实现代码:
export function showChinaLine() {
map.basemap = 2017
graphicLayer = new mars3d.layer.GeoJsonLayer({
name: "全国省界",
url: "https://data.mars3d.cn/file/geojson/areas/420000_full.json",
format: simplifyGeoJSON,
symbol: {
type: "polylineP",
styleOptions: {
width: 2,
color: "rgba(255,255,255,0.3) ",
label: {
text: "{name}",
position: "{center}", // 省会位置center
font_size: 30,
color: "#ffffff",
outline: true,
outlineColor: "#000000",
scaleByDistance: true,
scaleByDistance_far: 60000000,
scaleByDistance_farValue: 0.2,
scaleByDistance_near: 1000000,
scaleByDistance_nearValue: 1,
distanceDisplayCondition: true,
distanceDisplayCondition_far: 10000000,
distanceDisplayCondition_near: 100000,
setHeight: 10000
}
}
},
flyTo: true
})
map.addLayer(graphicLayer)
const graphic = new mars3d.layer.GeoJsonLayer({
name: "全国省界",
url: "https://data.mars3d.cn/file/geojson/areas/420000.json",
format: simplifyGeoJSON,
symbol: {
type: "polyline",
styleOptions: {
color: "rgba(255,255,255,0.3)",
width: 4,
opacity: 0.8,
}
},
flyTo: true
})
map.addLayer(graphic)
}
对应链接:
更多推荐




所有评论(0)