SuperMap.Connector.Map.QueryByBounds C# (CSharp) Method

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
        public QueryResult QueryByBounds(string mapName, Rectangle2D bounds, QueryParameterSet queryParameterSet)
        {
            return _mapProvider.QueryByBounds(mapName, bounds, queryParameterSet);
        }

Same methods

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

Usage Example

Example #1
0
 public void QueryByBoundsTest_Error()
 {
     Map map = new Map("http://" + ip + ":8090/iserver/services/map-world/rest");
     QueryParameterSet queryParameterSet = new QueryParameterSet();
     queryParameterSet.ExpectCount = 20;
     queryParameterSet.QueryOption = QueryOption.ATTRIBUTE;
     queryParameterSet.QueryParams = new QueryParameter[1];
     queryParameterSet.QueryParams[0] = new QueryParameter("ContinentLabelError@World");
     queryParameterSet.ReturnContent = true;
     Rectangle2D bounds = new Rectangle2D();
     bounds.LeftBottom = new Point2D(0, 0);
     bounds.RightTop = new Point2D(100, 100);
     QueryResult qr = null;
     try
     {
         qr = map.QueryByBounds("世界地图", bounds, queryParameterSet);
     }
     catch (ServiceException e)
     {
         Assert.AreEqual(e.Message, "查询目标图层不存在。(ContinentLabelError@World)");
     }
 }
All Usage Examples Of SuperMap.Connector.Map::QueryByBounds