C# Class SuperMap.Connector.Map

Map 组件接口,用以访问 SuperMap iServer 地图服务组件中的REST服务,封装了与地图相关的一系列功能。
只能对 SuperMap REST 接口类型服务的访问。 实例化Map对象时需要使用明确的地图服务组件地址(例如:http://localhost:8090/iserver/services/map-world/rest/")
Datei anzeigen Open project: SuperMap/iClient-for-DotNet Class Usage Examples

Public Methods

Method Description
ClearCache ( string mapName, Rectangle2D bounds ) : bool

清除指定地图范围的缓存。

FindNearest ( string mapName, Geometry geometry, double maxDistance, QueryParameterSet queryParameterSet ) : QueryResult

在指定的地图上,查找距离指定几何对象一定距离容限内最近的对象。

FindNearest ( string mapName, Geometry geometry, double maxDistance, QueryParameterSet queryParameterSet, EventHandler completed, EventHandler failed ) : void

使用异步的方式,在指定的地图上,查找距离指定几何对象一定距离容限内最近的对象。

GetDefaultMapParameter ( string mapName ) : MapParameter

获取指定地图名称的默认的地图参数。

GetDefaultMapParameter ( string mapName, bool returnLayers ) : MapParameter

获取指定地图名称的默认的地图参数,可指定是否返回图层信息。

GetDefaultMapParameter ( string mapName, EventHandler completed, EventHandler failed ) : void

使用异步的方式,获取指定地图名称的默认的地图参数。

GetDefaultMapParameter ( string mapName, bool returnLayers, EventHandler completed, EventHandler failed ) : void

使用异步的方式,获取指定地图名称的默认的地图参数,可指定是否返回图层信息。

GetEntireImage ( string mapName, MapParameter mapParameter, ImageOutputOption imageOutputOption ) : MapImage

获取地图的全幅显示图片。

GetEntireImage ( string mapName, string layerName, MapParameter mapParameter, ImageOutputOption imageOutputOption ) : MapImage

根据指定的图层范围获取地图的全幅显示图片。

GetHighlightImage ( string mapName, string queryResultID, Style style, MapParameter mapParameter, ImageOutputOption imageOutputOption ) : MapImage

根据查询结果资源ID,获取查询结果高亮图片,图片只支持PNG格式。

GetMapImage ( string mapName, MapParameter mapParameter, ImageOutputOption imageOutputOption ) : MapImage

根据地图参数、图片输出设置获取地图图片。

GetMapImage ( string mapName, MapParameter mapParameter, ImageOutputOption imageOutputOption, bool returnMapParameter ) : MapImage

根据地图参数、图片输出设置获取地图图片,可设置是否返回当前图片参数信息。

GetMapNames ( ) : List

获取指定服务中的所有的地图名称。

GetMapNames ( EventHandler completed, EventHandler failed ) : void

使用异步的方式,获取指定服务中的所有的地图名称。

GetOverview ( string mapName, MapParameter mapParameter, ImageOutputOption imageOutputOption ) : Overview

获取地图的鹰眼图片。

GetResource ( string mapName, ResourceParameter resourceParameter, ImageOutputOption imageOutputOption ) : ResourceImage

根据资源图片参数获取资源图片。

GetTile ( string mapName, TileInfo tileInfo, ImageOutputOption imageOutputOption ) : MapImage

根据地图分块信息,获取格网图片。

GetTile ( string mapName, TileInfo tileInfo, ImageOutputOption imageOutputOption, MapParameter mapParameter ) : MapImage

根据地图分块信息和地图参数设置,获取格网图片。

Map ( string serviceUrl ) : System

构造函数。

MeasureArea ( string mapName, List point2Ds, Unit unit ) : MeasureAreaResult

根据地图名称、二维地理坐标点、量算单位进行面积量算。

MeasureDistance ( string mapName, List point2Ds, Unit unit ) : MeasureDistanceResult

根据地图名称、二维地理坐标点、量算单位进行距离量算。

QueryByBounds ( string mapName, Rectangle2D bounds, QueryParameterSet queryParameterSet ) : QueryResult

在指定的地图上,查询与指定的矩形范围以及符合某种空间关系和查询条件的几何对象。

QueryByBounds ( string mapName, Rectangle2D bounds, QueryParameterSet queryParameterSet, EventHandler completed, EventHandler failed ) : void

使用异步的方式,在指定的地图上,查询与指定的矩形范围以及符合某种空间关系和查询条件的几何对象。

QueryByDistance ( string mapName, Geometry geometry, double distance, QueryParameterSet queryParameterSet ) : QueryResult

在指定的地图上,查询距离指定几何对象一定范围内的几何对象。

到指定几何对象的一定距离范围,实际是以指定几何对象为中心的一个圆,在这个圆内以及与圆相交的几何对象都能够被查询出来。

QueryByDistance ( string mapName, Geometry geometry, double distance, QueryParameterSet queryParameterSet, EventHandler completed, EventHandler failed ) : void

使用异步的方式查询一定范围内的几何对象。此方法不会阻止调用线程。

QueryByGeometry ( string mapName, Geometry geometry, SpatialQueryMode spatialQueryMode, QueryParameterSet queryParameterSet ) : QueryResult

在指定的地图上,查询与指定的几何对象符合某种空间关系和查询条件的几何对象。

QueryByGeometry ( string mapName, Geometry geometry, SpatialQueryMode spatialQueryMode, QueryParameterSet queryParameterSet, EventHandler completed, EventHandler failed ) : void

使用异步的方式,在指定的地图上,查询与指定的几何对象符合某种空间关系和查询条件的几何对象。

QueryBySQL ( string mapName, QueryParameterSet queryParameterSet ) : QueryResult

在指定的地图上,执行 SQL 查询。

QueryBySQL ( string mapName, QueryParameterSet queryParameterSet, EventHandler completed, EventHandler failed ) : void

使用异步的方式,在指定的地图上,执行 SQL 查询。

Method Details

ClearCache() public method

清除指定地图范围的缓存。
public ClearCache ( string mapName, Rectangle2D bounds ) : bool
mapName string 地图名称。
bounds Rectangle2D 地图范围。
return bool

FindNearest() public method

在指定的地图上,查找距离指定几何对象一定距离容限内最近的对象。
public FindNearest ( string mapName, Geometry geometry, double maxDistance, QueryParameterSet queryParameterSet ) : QueryResult
mapName string 地图名称。
geometry Geometry 几何对象。
maxDistance double 容限距离。
queryParameterSet SuperMap.Connector.Utility.QueryParameterSet 查询参数集。可对某个地图的多个图层进行查询,单个图层的查询参数在queryParameters.queryParams[i]中进行设置。当查询类型为最近地物查询时,查询起始记录位置QueryParameterSet.StartRecord参数不支持。
return SuperMap.Connector.Utility.QueryResult

FindNearest() public method

使用异步的方式,在指定的地图上,查找距离指定几何对象一定距离容限内最近的对象。
public FindNearest ( string mapName, Geometry geometry, double maxDistance, QueryParameterSet queryParameterSet, EventHandler completed, EventHandler failed ) : void
mapName string 地图名称。
geometry Geometry 几何对象。
maxDistance double 容限距离。
queryParameterSet SuperMap.Connector.Utility.QueryParameterSet 查询参数集。可对某个地图的多个图层进行查询,单个图层的查询参数在queryParameters.queryParams[i]中进行设置。当查询类型为最近地物查询时,查询起始记录位置QueryParameterSet.StartRecord参数不支持。
completed EventHandler 在服务端查询完成后时执行的方法。
failed EventHandler 在进行查询时发生异常后执行的方法。
return void

GetDefaultMapParameter() public method

获取指定地图名称的默认的地图参数。
public GetDefaultMapParameter ( string mapName ) : MapParameter
mapName string 地图名称。【必设参数】
return SuperMap.Connector.Utility.MapParameter

GetDefaultMapParameter() public method

获取指定地图名称的默认的地图参数,可指定是否返回图层信息。
public GetDefaultMapParameter ( string mapName, bool returnLayers ) : MapParameter
mapName string 地图名称。【必设参数】
returnLayers bool 是否返回图层信息。
return SuperMap.Connector.Utility.MapParameter

GetDefaultMapParameter() public method

使用异步的方式,获取指定地图名称的默认的地图参数。
public GetDefaultMapParameter ( string mapName, EventHandler completed, EventHandler failed ) : void
mapName string 地图名称。【必设参数】
completed EventHandler 获取默认的地图参数完成后执行的方法。
failed EventHandler 发生异常后执行的方法。
return void

GetDefaultMapParameter() public method

使用异步的方式,获取指定地图名称的默认的地图参数,可指定是否返回图层信息。
public GetDefaultMapParameter ( string mapName, bool returnLayers, EventHandler completed, EventHandler failed ) : void
mapName string 地图名称。【必设参数】
returnLayers bool 是否返回图层信息。
completed EventHandler 获取默认的地图参数完成后执行的方法。
failed EventHandler 发生异常后执行的方法。
return void

GetEntireImage() public method

获取地图的全幅显示图片。
public GetEntireImage ( string mapName, MapParameter mapParameter, ImageOutputOption imageOutputOption ) : MapImage
mapName string 地图名称。
mapParameter SuperMap.Connector.Utility.MapParameter 地图参数。
imageOutputOption SuperMap.Connector.Utility.ImageOutputOption 图片输出设置。
return SuperMap.Connector.Utility.MapImage

GetEntireImage() public method

根据指定的图层范围获取地图的全幅显示图片。
public GetEntireImage ( string mapName, string layerName, MapParameter mapParameter, ImageOutputOption imageOutputOption ) : MapImage
mapName string 地图名称。
layerName string 指定图层,以该图层内容的最小外接矩形作为全幅显示的地理范围。
mapParameter SuperMap.Connector.Utility.MapParameter 地图参数。
imageOutputOption SuperMap.Connector.Utility.ImageOutputOption 图片输出设置。
return SuperMap.Connector.Utility.MapImage

GetHighlightImage() public method

根据查询结果资源ID,获取查询结果高亮图片,图片只支持PNG格式。
public GetHighlightImage ( string mapName, string queryResultID, Style style, MapParameter mapParameter, ImageOutputOption imageOutputOption ) : MapImage
mapName string 地图名称。
queryResultID string 查询结果资源ID。
style Style 高亮风格设置。
mapParameter SuperMap.Connector.Utility.MapParameter 地图参数。
imageOutputOption SuperMap.Connector.Utility.ImageOutputOption 图片输出设置。
return SuperMap.Connector.Utility.MapImage

GetMapImage() public method

根据地图参数、图片输出设置获取地图图片。
public GetMapImage ( string mapName, MapParameter mapParameter, ImageOutputOption imageOutputOption ) : MapImage
mapName string 地图名称。
mapParameter SuperMap.Connector.Utility.MapParameter 地图参数。
imageOutputOption SuperMap.Connector.Utility.ImageOutputOption 图片输出设置。
return SuperMap.Connector.Utility.MapImage

GetMapImage() public method

根据地图参数、图片输出设置获取地图图片,可设置是否返回当前图片参数信息。
public GetMapImage ( string mapName, MapParameter mapParameter, ImageOutputOption imageOutputOption, bool returnMapParameter ) : MapImage
mapName string 地图名称。
mapParameter SuperMap.Connector.Utility.MapParameter 地图参数。
imageOutputOption SuperMap.Connector.Utility.ImageOutputOption 图片输出设置。
returnMapParameter bool 是否返回图片参数信息。
return SuperMap.Connector.Utility.MapImage

GetMapNames() public method

获取指定服务中的所有的地图名称。
public GetMapNames ( ) : List
return List

GetMapNames() public method

使用异步的方式,获取指定服务中的所有的地图名称。
public GetMapNames ( EventHandler completed, EventHandler failed ) : void
completed EventHandler 完成后执行的方法。
failed EventHandler 发生异常后执行的方法。
return void

GetOverview() public method

获取地图的鹰眼图片。
public GetOverview ( string mapName, MapParameter mapParameter, ImageOutputOption imageOutputOption ) : Overview
mapName string 地图名称。
mapParameter SuperMap.Connector.Utility.MapParameter 地图参数。
imageOutputOption SuperMap.Connector.Utility.ImageOutputOption 图片输出设置。
return SuperMap.Connector.Utility.Overview

GetResource() public method

根据资源图片参数获取资源图片。
public GetResource ( string mapName, ResourceParameter resourceParameter, ImageOutputOption imageOutputOption ) : ResourceImage
mapName string 地图名称。
resourceParameter ResourceParameter 资源图片参数,如生成的图片的高度、宽度、类型,资源的类型、风格等。
imageOutputOption SuperMap.Connector.Utility.ImageOutputOption 资源图片输出设置。
return SuperMap.Connector.Utility.ResourceImage

GetTile() public method

根据地图分块信息,获取格网图片。
public GetTile ( string mapName, TileInfo tileInfo, ImageOutputOption imageOutputOption ) : MapImage
mapName string 地图名称。
tileInfo SuperMap.Connector.Utility.TileInfo 地图分块信息。
imageOutputOption SuperMap.Connector.Utility.ImageOutputOption 图片输出设置。
return SuperMap.Connector.Utility.MapImage

GetTile() public method

根据地图分块信息和地图参数设置,获取格网图片。
public GetTile ( string mapName, TileInfo tileInfo, ImageOutputOption imageOutputOption, MapParameter mapParameter ) : MapImage
mapName string 地图名称。
tileInfo SuperMap.Connector.Utility.TileInfo 地图分块信息。
imageOutputOption SuperMap.Connector.Utility.ImageOutputOption 图片输出设置。
mapParameter SuperMap.Connector.Utility.MapParameter 地图参数。
return SuperMap.Connector.Utility.MapImage

Map() public method

构造函数。
参数 serviceUrl 为空时抛出异常。
public Map ( string serviceUrl ) : System
serviceUrl string SuperMap iServer 地图服务组件的URL地址。
return System

MeasureArea() public method

根据地图名称、二维地理坐标点、量算单位进行面积量算。
public MeasureArea ( string mapName, List point2Ds, Unit unit ) : MeasureAreaResult
mapName string 地图名称。【必设参数】
point2Ds List 二维地理坐标点数组。【必设参数】
unit Unit 返回结果的单位。
return SuperMap.Connector.Utility.MeasureAreaResult

MeasureDistance() public method

根据地图名称、二维地理坐标点、量算单位进行距离量算。
public MeasureDistance ( string mapName, List point2Ds, Unit unit ) : MeasureDistanceResult
mapName string 地图名称。
point2Ds List 二维地理坐标点数组。
unit Unit 返回结果的单位。
return SuperMap.Connector.Utility.MeasureDistanceResult

QueryByBounds() public method

在指定的地图上,查询与指定的矩形范围以及符合某种空间关系和查询条件的几何对象。
public QueryByBounds ( string mapName, Rectangle2D bounds, QueryParameterSet queryParameterSet ) : QueryResult
mapName string 地图名称。
bounds Rectangle2D 矩形范围。
queryParameterSet SuperMap.Connector.Utility.QueryParameterSet 查询参数集。可对某个地图的多个图层进行查询,单个图层的查询参数在 queryParameters.queryParams[i] 中进行设置。
return SuperMap.Connector.Utility.QueryResult

QueryByBounds() public method

使用异步的方式,在指定的地图上,查询与指定的矩形范围以及符合某种空间关系和查询条件的几何对象。
public QueryByBounds ( string mapName, Rectangle2D bounds, QueryParameterSet queryParameterSet, EventHandler completed, EventHandler failed ) : void
mapName string 地图名称。
bounds Rectangle2D 矩形范围。
queryParameterSet SuperMap.Connector.Utility.QueryParameterSet 查询参数集。可对某个地图的多个图层进行查询,单个图层的查询参数在 queryParameters.queryParams[i] 中进行设置。
completed EventHandler 委托,它表示在服务端查询完成后执行的方法。
failed EventHandler 类型委托,它表示在进行查询时发生异常后执行的方法。
return void

QueryByDistance() public method

在指定的地图上,查询距离指定几何对象一定范围内的几何对象。
到指定几何对象的一定距离范围,实际是以指定几何对象为中心的一个圆,在这个圆内以及与圆相交的几何对象都能够被查询出来。
public QueryByDistance ( string mapName, Geometry geometry, double distance, QueryParameterSet queryParameterSet ) : QueryResult
mapName string 地图名称。
geometry Geometry 几何对象。
distance double 查询的距离范围。
queryParameterSet SuperMap.Connector.Utility.QueryParameterSet 查询参数集。可对某个地图的多个图层进行查询,单个图层的查询参数在 queryParameters.queryParams[i] 中进行设置。 ///
return SuperMap.Connector.Utility.QueryResult

QueryByDistance() public method

使用异步的方式查询一定范围内的几何对象。此方法不会阻止调用线程。
public QueryByDistance ( string mapName, Geometry geometry, double distance, QueryParameterSet queryParameterSet, EventHandler completed, EventHandler failed ) : void
mapName string 地图名称。
geometry Geometry 几何对象
distance double 查询的距离范围。
queryParameterSet SuperMap.Connector.Utility.QueryParameterSet 查询参数集。可对某个地图的多个图层进行查询,单个图层的查询参数在 queryParameters.queryParams[i] 中进行设置。
completed EventHandler 在服务端查询完成后时执行的方法。
failed EventHandler 在进行查询时发生异常后执行的方法。
return void

QueryByGeometry() public method

在指定的地图上,查询与指定的几何对象符合某种空间关系和查询条件的几何对象。
public QueryByGeometry ( string mapName, Geometry geometry, SpatialQueryMode spatialQueryMode, QueryParameterSet queryParameterSet ) : QueryResult
mapName string 地图名称。
geometry Geometry 几何对象。
spatialQueryMode SpatialQueryMode 空间几何对象间的查询模式 /// 空间几何对象间的查询模式定义了一些几何对象之间的空间位置关系,根据这些空间关系来构建过滤条件执行查询。 /// 例如:查询可被包含在面对象中的空间对象,与面有相离或者相邻关系的空间对象等。 ///
queryParameterSet SuperMap.Connector.Utility.QueryParameterSet 查询参数集。可对某个地图的多个图层进行查询,单个图层的查询参数在queryParameters.queryParams[i]中进行设置。
return SuperMap.Connector.Utility.QueryResult

QueryByGeometry() public method

使用异步的方式,在指定的地图上,查询与指定的几何对象符合某种空间关系和查询条件的几何对象。
public QueryByGeometry ( string mapName, Geometry geometry, SpatialQueryMode spatialQueryMode, QueryParameterSet queryParameterSet, EventHandler completed, EventHandler failed ) : void
mapName string 地图名称。
geometry Geometry 几何对象。
spatialQueryMode SpatialQueryMode 空间几何对象间的查询模式 /// 空间几何对象间的查询模式定义了一些几何对象之间的空间位置关系,根据这些空间关系来构建过滤条件执行查询。 /// 例如:查询可被包含在面对象中的空间对象,与面有相离或者相邻关系的空间对象等。 ///
queryParameterSet SuperMap.Connector.Utility.QueryParameterSet 查询参数集。可对某个地图的多个图层进行查询,单个图层的查询参数在queryParameters.queryParams[i]中进行设置。
completed EventHandler 在服务端查询完成后时执行的方法。
failed EventHandler 在进行查询时发生异常后执行的方法。
return void

QueryBySQL() public method

在指定的地图上,执行 SQL 查询。
public QueryBySQL ( string mapName, QueryParameterSet queryParameterSet ) : QueryResult
mapName string 地图名称。
queryParameterSet SuperMap.Connector.Utility.QueryParameterSet 查询参数集。可对某个地图的多个图层进行查询,单个图层的查询参数在queryParameters.queryParams[i]中进行设置。
return SuperMap.Connector.Utility.QueryResult

QueryBySQL() public method

使用异步的方式,在指定的地图上,执行 SQL 查询。
public QueryBySQL ( string mapName, QueryParameterSet queryParameterSet, EventHandler completed, EventHandler failed ) : void
mapName string 地图名称。
queryParameterSet SuperMap.Connector.Utility.QueryParameterSet 查询参数集。可对某个地图的多个图层进行查询,单个图层的查询参数在queryParameters.queryParams[i]中进行设置。
completed EventHandler 在服务端查询完成后时执行的方法。
failed EventHandler 在进行查询时发生异常后执行的方法。
return void