利用不同的属性值显示出不同的颜色
在本节中,注意到三维底图既加入了行政边界的矢量要素图层,也加入了场景要素
var countries = new featurelayer({ //各国矢量边界
url:"https://services.arcgis.com/p3eplmys2rvchkjx/arcgis/rest/services/world_countries_(generalized)/featureserver",
renderer:{
type:"simple",
symbol:{
type:"polygon-3d",
symbollayers:[{
type:"fill",
material:{color:[0,0,0,0]},
outline:{color:[4,245,248]}
}]
}
}
});
var layer = new scenelayer({
url:"https://tiles.arcgis.com/tiles/v6zhfr6zdgnzuvg0/arcgis/rest/services/airports_pointscenelayer/sceneserver/layers/0",
renderer:{
type:"simple",
symbol:{
type:"point-3d",
symbollayers:[{
type:"icon",
size:1.7
}]
},
visualvariables:[{
type:"color",
field:"type_airpport",
stops:[{
value:1,
color:[252,12,245]
},{
value:3,
color:[83,0,244]
},{
value:7,
color:[4,245,248]
}]
}]
}
})
var map = new map({
layers:[countries,layer] //哪个图层在第一个,哪一个就覆盖显示
ground:{
opacity:0.6,
surfacecolor:"black"
}
});
var view = new sceneview({
container:"viewdiv",
map:map,
environment:{
starsenabled:false,
atmosphereenabled:false,
background:{
type:"color",
color:"black"
}
}
})
上一篇: 如何渲染数据