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.原作者链接