共计 919 个字符,预计需要花费 3 分钟才能阅读完成。
arcgis for js 等级着色
1. 依据公布的数据设置多种 symbol 款式
let less35 = {type: "simple-fill", // autocasts as new SimpleFillSymbol()
color: "#38627a",
style: "solid",
outline: {
width: 0.2,
color: [255, 255, 255, 0.5]
}
}
let less36 = {type: "simple-fill", // autocasts as new SimpleFillSymbol()
color: "#FF66CC",
style: "solid",
outline: {
width: 0.2,
color: 'red'
}
}
2. 创立一个 renderer, 设置要害 id(就是依据哪个字段进行分等级,我这里抉择的是 OBJECTID_1), 接入之前创立款式并且依据值分等级
let render2 = {
type:'class-breaks',
field: "OBJECTID_1",
classBreakInfos: [
{
minValue: 0,
maxValue: 1000,
symbol: less35,
label: "< 35%" // label for symbol in legend
},
{
minValue: 1000,
maxValue: 2000000.3499,
symbol: less36,
label: "< 35%" // label for symbol in legend
}
]
}
3. 于 featureLayer 中应用,不晓得的能够看我另外的文章
layerValue = new FeatureLayer({
renderer:render2,
id: "tempLyasdr",
url:
"http://*****:6080/arcgis/rest/services/*****/ShpDynamicWorkspace/MapServer/dynamicLayer",
dynamicDataSource: {
type: "data-layer",
dataSource: {
type: "table",
workspaceId: "*****",
// dataSourceName: "*****.shp",
},
},
});
4. 原作者链接
正文完