一、如果【地块回退】为面, 按"DKMC"字段,在面中心配置符号Pushpin
Await QueuedTask.Run(Sub()
pFeaturelayer = pmap.FindLayers("地块回退").First()
'-----------------唯一值渲染
Dim Fields = New List(Of String) From {"DKMC"} '用于检索唯一值的字段
'将点符号构建为模板符号
Dim pointSym As CIMPointSymbol = SymbolFactory.Instance.ConstructPointSymbol(ColorFactory.Instance.GreenRGB, 16.0, SimpleMarkerStyle.Pushpin)
Dim symbolPointTemplate As CIMSymbolReference = pointSym.MakeSymbolReference()
'构造唯一值呈现器的呈现器定义
Dim uniqueValueRendererDef As UniqueValueRendererDefinition = New UniqueValueRendererDefinition(Fields, symbolPointTemplate)
'创建唯一值呈现器
Dim uniqueValueRenderer As CIMUniqueValueRenderer = pFeaturelayer.CreateRenderer(uniqueValueRendererDef)
pFeaturelayer.SetRenderer(uniqueValueRenderer)
End Sub)
效果:
二、如果【地块回退】为面, 按"DKMC"字段,配置填充色
Await QueuedTask.Run(Sub()
pFeaturelayer = pmap.FindLayers("地块回退").First()
'-----------------唯一值色填充渲染
Dim Fields = New List(Of String) From {"DKTBMC"} '用于检索唯一值的字段
Dim Symbol_ps = New CIMSolidStroke()
With Symbol_ps
.Width = 1.5
.Color = CIMColor.CreateRGBColor(255, 0, 0, 127)
End With
Dim Symbol As CIMPolygonSymbol = SymbolFactory.Instance.ConstructPolygonSymbol(ColorFactory.Instance.GreenRGB, SimpleFillStyle.Solid, Symbol_ps)
Dim symbolPointTemplate As CIMSymbolReference = Symbol.MakeSymbolReference()
'构造唯一值呈现器的呈现器定义
Dim uniqueValueRendererDef As UniqueValueRendererDefinition = New UniqueValueRendererDefinition(Fields, symbolPointTemplate)
'创建唯一值呈现器
Dim uniqueValueRenderer As CIMUniqueValueRenderer = pFeaturelayer.CreateRenderer(uniqueValueRendererDef)
pFeaturelayer.SetRenderer(uniqueValueRenderer)
End Sub)
效果: