本文整理汇总了C#中GraphicsLayer.ChangeRenderer方法的典型用法代码示例。如果您正苦于以下问题:C# GraphicsLayer.ChangeRenderer方法的具体用法?C# GraphicsLayer.ChangeRenderer怎么用?C# GraphicsLayer.ChangeRenderer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GraphicsLayer
的用法示例。
在下文中一共展示了GraphicsLayer.ChangeRenderer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ApplyDefaultRenderer
//private void ApplyLayerTransperancyBasedOfGeometryType(GraphicsLayer glayer, GeometryType geometryType)
//{
// if (glayer != null)
// {
// switch (geometryType)
// {
// case GeometryType.Point:
// glayer.Opacity = 1.0;
// break;
// case GeometryType.Polyline:
// glayer.Opacity = 1.0;
// break;
// case GeometryType.Polygon:
// glayer.Opacity = 0.5; // for polygons, we make it semi-transparent
// break;
// }
// }
//}
private void ApplyDefaultRenderer(GraphicsLayer gLayer, GeometryType geometryType)
{
if (gLayer == null && Symbology == null)
return;
SymbolDescription desc = null;
if (geometryType == GeometryType.MultiPoint) // Treat MultiPoint as point for looking up default symbol
geometryType = GeometryType.Point;
if (Symbology.DefaultSymbols.TryGetValue(geometryType, out desc))
{
if (desc != null && desc.Symbol != null)
{
Symbol symbol = desc.Symbol.CloneSymbol();
if (symbol != null)
gLayer.ChangeRenderer(symbol);
}
}
}
示例2: assignNewRendererToLayer
private static void assignNewRendererToLayer(GraphicsLayer graphicsLayer, IRenderer newRenderer)
{
if (graphicsLayer == null)
return;
if (newRenderer == null)
{
newRenderer = graphicsLayer.CreateDefaultRenderer();
}
// Assign the renderer to the layer (potentially need to clear out FeatureSymbol)
graphicsLayer.ChangeRenderer(newRenderer);
}