地图压盖过滤显示选项类,在文本或专题图元素显示较密集的区域,文本之间或专题元素之间会发生相互压盖的现象,该类可以分别控制各种类型的对象的过滤显示情况,进而很好地处理地图中各种类型对象的压盖显示问题。

命名空间:  SuperMap.Mapping
程序集:  SuperMap.Mapping (in SuperMap.Mapping)
版本: dll

语法

C#
public class MapOverlapDisplayedOptions

示例

以下代码示范如何运用该类处理地图中各种类型对象的压盖显示问题。

CopyC#
private static void MapOverlapDisplayedOptionsTest()
{
    //打开工作空间
    String path = @"..\world";
    Workspace workspace = new Workspace();
    WorkspaceConnectionInfo workspaceConnectionInfo = new WorkspaceConnectionInfo(path + "\world.sxwu");
    workspace.Open(workspaceConnectionInfo);

    //获取数据源 获取给定的数据集
    Datasource datasource = workspace.Datasources["world"];
    DatasetVector dataset = (DatasetVector)datasource.Datasets["Capital"];

    MapControl mapControl = new MapControl();
    Map map = mapControl.Map;

    //添加数据集Capital到地图中
    map.Layers.Add(dataset, true);

    //设置重叠时不显示对象
    map.IsOverlapDisplayed = false;

    //构造地图压盖过滤显示选项类
    MapOverlapDisplayedOptions mapOverlapDisplayedOptions = map.OverlapDisplayedOptions;

    //设置点和点压盖时不显示压盖的点对象
    mapOverlapDisplayedOptions.AllowPointOverlap = false;
    //设置各对象之间的压盖间距
    mapOverlapDisplayedOptions.OverlappedSpaceSize = new Size2D(40, 40);

    //设置地图的压盖过滤显示选项
    map.OverlapDisplayedOptions = mapOverlapDisplayedOptions;

    //释放资源
    mapControl.Dispose();
    workspace.Close();
    workspace.Dispose();

继承层次

System..::.Object
  SuperMap.Mapping..::.MapOverlapDisplayedOptions

版本信息

SuperMap iObjects .NET


请参见