for .net 100.1 如何设置Renderer;如何根据不同的数据产生不同的渲染效果
例如图上的效果,我要根据每个点的数据对它产生不同的渲染效果(自动渲染,不用在添加元素的是时候配置它的Symbol,或者元素数据变化的时候渲染效果自动改变
)
元素的数据应该怎么对应UniqueValue???
)
GraphicsOverlay overlay = new GraphicsOverlay();
UniqueValueRenderer regionRenderer = new UniqueValueRenderer();
SimpleMarkerSymbol pointSymbol1 = new SimpleMarkerSymbol()
{
Color = Colors.Red,
Size = 10,
Style = SimpleMarkerSymbolStyle.Circle
};
SimpleMarkerSymbol pointSymbol2 = new SimpleMarkerSymbol()
{
Color = Colors.Blue,
Size = 10,
Style = SimpleMarkerSymbolStyle.Circle
};
SimpleMarkerSymbol pointSymbol3 = new SimpleMarkerSymbol()
{
Color = Colors.Green,
Size = 10,
Style = SimpleMarkerSymbolStyle.Circle
};
SimpleMarkerSymbol pointSymbol4 = new SimpleMarkerSymbol()
{
Color = Colors.AliceBlue,
Size = 10,
Style = SimpleMarkerSymbolStyle.Circle
};
regionRenderer.FieldNames.Add("pointSymbol");
regionRenderer.UniqueValues.Add(new UniqueValue("Number1", "Number1", pointSymbol1,"1"));
regionRenderer.UniqueValues.Add(new UniqueValue("Number2", "Number2", pointSymbol2, "2"));
regionRenderer.UniqueValues.Add(new UniqueValue("Number3", "Number3", pointSymbol3, "3"));
regionRenderer.DefaultLabel = "null";
regionRenderer.DefaultSymbol = pointSymbol4;
overlay.Renderer = regionRenderer;
MyMapView.GraphicsOverlays.Add(overlay);
//根据这个元素的数据应该怎么对应UniqueValue里面的东西进行不同的渲染
var tmp = new Graphic(new MapPoint(30, 30, SpatialReferences.Wgs84));
overlay.Graphics.Add(tmp);
元素的数据应该怎么对应UniqueValue???
3 个回复
朱新颖
赞同来自: 席西 、谢峥
public Graphic( Geometry geometry, IEnumerable<KeyValuePair<string, Object>> attributes )
席西
赞同来自:
谢峥
赞同来自:
要回复问题请先登录或注册
发起人
相关问题
问题状态