接口 Map
- 
- 所有超级接口:
 - VectorTileCapabilities
 
- 所有已知实现类:
 - MapImpl
 
public interface Map extends VectorTileCapabilities
地图服务组件接口。
地图服务组件是一类 GIS 服务组件,封装了与地图相关的 GIS 功能。
 
- 
- 
方法概要
方法 限定符和类型 方法和说明 intaddSymbol(java.lang.String mapName, SymbolInfo symbolInfo, ResourceType resourceType)voidclearAllCache()voidclearCache(Rectangle2D bounds)清除指定地图范围的缓存。voidclearCache(Rectangle2D bounds, MapParameter mapParameter, ImageOutputOption outputOption)根据指定地图范围、地图参数和图片输出设置清除对应范围的缓存。QueryResultfindNearest(Geometry geometry, double maxDistance, QueryParameterSet queryParameter, java.lang.String mapName)在指定地图上,查找距离指定几何对象一定容限内的几何对象。java.util.List<ChartFeatureInfoSpec>getChartFeatureInfoSpecs(java.lang.String mapName)海图功能用,获取海图所有物标类型。MapParametergetDefaultMapParameter(java.lang.String mapName)获取默认地图参数。java.util.List<PrjCoordSys>getDynamicPrjCoordsyses(java.lang.String mapName)java.util.List<FieldInfo>getFieldsByLayerName(java.lang.String mapName, LayerFieldsQueryParameter layerFieldsQueryParameter)通过图层查询参数获取图层的fields信息MapImagegetMapImage(MapParameter mapParameter, ImageOutputOption outputOption)根据地图参数、图片输出设置获取地图图片。java.util.List<java.lang.String>getMapNames()获取地图名称列表。MapParametergetMapParameter(java.lang.String mapName)获取指定地图的参数。OverviewgetOverview(MapParameter mapParameter, ImageOutputOption outputOption)根据地图参数以及图片输出设置获取鹰眼。Rectangle2DgetProjectionExtent(java.lang.String mapName)获取当前投影下的范围java.lang.StringgetResource(ResourceParameter resourceParameter)根据资源图片参数获取资源图片。byte[]getResource(ResourceParameter resourceParameter, Point2D[] points)根据资源图片参数获取资源图片。byte[]getResource(java.lang.String mapName, java.lang.String symbolId, OutputFormat format)根据资源图片参数获取资源图片。SymbolInfogetSymbol(java.lang.String mapName, int symbolId, ResourceType resourceType)获取symbol信息。MapImagegetTileImage(MapParameter mapParameter, ImageOutputOption outputOption)根据地图参数、图片输出设置获取地图图片。MapImagegetTrackingLayerImage(MapParameter mapParameter, ImageOutputOption outputOption)根据地图参数、图片输出设置获取 TrackingLayer 的图片。UTFGridResultgetUTFGrid(UTFGridParameter gridParameter)根据地理范围从指定图层中提取UTFGrid JSONObject对象。VectorTileDatagetVectorTile(VectorTileParameter vectorTileParameter)获取矢量地图切片。MeasureResultmeasureArea(java.lang.String mapName, Point2D[] points, MeasureParameter measureParameter)根据地图名称、二维地理坐标点、量算参数进行面积量算。MeasureResultmeasureDistance(java.lang.String mapName, Point2D[] points, MeasureParameter measureParameter)根据地图名称、二维地理坐标点、量算参数进行距离量算。MapImagepan(double offsetX, double offsetY, MapParameter mapParameter, ImageOutputOption outputOption)地图平移。QueryResultqueryByBounds(java.lang.String mapName, Rectangle2D bounds, QueryParameterSet queryParameters)在指定的地图上,查询指定范围内的几何对象,以及外接矩形与指定范围相交的几何对象。QueryResultqueryByDistance(java.lang.String mapName, Geometry geometry, double distance, QueryParameterSet queryParameters)在指定的地图上,查询距离指定几何对象一定范围内的几何对象。QueryResultqueryByGeometry(java.lang.String mapName, Geometry geometry, SpatialQueryMode spatialQueryMode, QueryParameterSet queryParameters)在指定的地图上,查询与指定的几何对象符合某种空间关系和查询条件的几何对象。QueryResultqueryByKeywords(java.lang.String mapName, KeywordsQueryParameterSet queryParameterSet)根据关键字查询地图上的要素。QueryResultqueryBySQL(java.lang.String mapName, QueryParameterSet queryParameters)在指定的地图上,执行 SQL 查询。QueryResultqueryChart(java.lang.String mapName, java.lang.String[] chartLayerNames, ChartQueryParameterSet chartQueryParams)海图功能用,物标属性查询。QueryResultqueryChart(java.lang.String mapName, java.lang.String[] chartLayerNames, ChartQueryParameterSet chartQueryParams, Rectangle2D bounds)海图功能用,物标bounds查询ChartFeatureQueryResultqueryChartFeatureByBounds(java.lang.String mapName, Rectangle2D bounds)MapParametersetDefaultMapParameter(MapParameter mapParameter)设置默认地图参数。booleansupport(java.lang.String mapName, MapCapability capability)判断地图是否支持相应功能。booleanupdateMap(MapParameter mapParameter)永久更新地图状态,会更新到磁盘中进行持久化。voidupdateVectorStyle(java.lang.String mapName, java.lang.String layerName, VectorStyleType type, java.lang.String style)更新指定地图中,指定矢量图层的样式。MapImageviewByBounds(Rectangle2D bounds, MapParameter mapParameter, ImageOutputOption outputOption)根据地理坐标范围显示地图。MapImageviewByScale(Point2D center, double scale, MapParameter mapParameter, ImageOutputOption outputOption)根据指定中心点和比例尺等参数显示地图。MapImageviewEntire(MapParameter mapParameter, ImageOutputOption outputOption)根据地图参数以及图片输出设置进行全幅显示。MapImageviewEntire(java.lang.String layerName, MapParameter mapParameter, ImageOutputOption outputOption)根据地图图层名、地图参数以及图片输出设置进行全幅显示。MapImagezoom(Point2D center, double ratio, MapParameter mapParameter, ImageOutputOption outputOption)根据指定的中心点、缩放比例、地图参数和图片输出设置进行地图缩放。- 
从接口继承的方法 com.supermap.services.components.VectorTileCapabilities
getMVTFonts, getMVTSpriteJson, getMVTSpriteResource, getMVTTile, getVectorStyle, getVectorStyle, listMVTSprites 
 - 
 
 - 
 
- 
- 
方法详细资料
- 
clearCache
void clearCache(Rectangle2D bounds) throws MapException
清除指定地图范围的缓存。
- 参数:
 bounds- 指定的地图范围。- 抛出:
 MapException- 地图服务组件异常信息。
 
- 
getVectorTile
VectorTileData getVectorTile(VectorTileParameter vectorTileParameter) throws MapException
获取矢量地图切片。
- 参数:
 vectorTileParameter- 矢量地图切片参数。- 返回:
 - 矢量地图切片内容。
 - 抛出:
 MapException
 
- 
updateVectorStyle
void updateVectorStyle(java.lang.String mapName, java.lang.String layerName, VectorStyleType type, java.lang.String style) throws MapException更新指定地图中,指定矢量图层的样式。- 参数:
 mapName- 地图名称。layerName- 图层名称。type- 矢量样式类型。style- 新的样式。- 抛出:
 MapException
 
- 
clearCache
void clearCache(Rectangle2D bounds, MapParameter mapParameter, ImageOutputOption outputOption) throws MapException
根据指定地图范围、地图参数和图片输出设置清除对应范围的缓存。
- 参数:
 bounds- 地图范围。mapParameter- 地图参数。outputOption- 图片输出设置。- 抛出:
 MapException- 地图服务组件异常信息。
 
- 
clearAllCache
void clearAllCache() throws MapException- 抛出:
 MapException
 
- 
getMapNames
java.util.List<java.lang.String> getMapNames()
获取地图名称列表。
- 返回:
 - 地图名称列表。
 
 
- 
getMapParameter
MapParameter getMapParameter(java.lang.String mapName) throws MapException
获取指定地图的参数。
- 参数:
 mapName- 地图名称。- 返回:
 - 地图参数。
 - 抛出:
 MapException- 地图服务组件异常信息。
 
- 
getMapImage
MapImage getMapImage(MapParameter mapParameter, ImageOutputOption outputOption) throws MapException
根据地图参数、图片输出设置获取地图图片。
- 参数:
 mapParameter- 地图参数。outputOption- 图片输出设置。- 返回:
 - 所获取的地图图片对象。
 - 抛出:
 MapException- 地图服务组件异常信息。
 
- 
getTileImage
MapImage getTileImage(MapParameter mapParameter, ImageOutputOption outputOption) throws MapException
根据地图参数、图片输出设置获取地图图片。
- 参数:
 mapParameter- 地图参数。outputOption- 图片输出设置。- 返回:
 - 所获取的地图图片对象。
 - 抛出:
 MapException- 地图服务组件异常信息。
 
- 
getResource
java.lang.String getResource(ResourceParameter resourceParameter) throws MapException
根据资源图片参数获取资源图片。
- 参数:
 resourceParameter- 资源图片参数,如生成的图片的高度、宽度、类型,资源的类型、风格等。- 返回:
 - 资源图片地址。
 - 抛出:
 MapException- 地图服务组件异常信息。
 
- 
getResource
byte[] getResource(ResourceParameter resourceParameter, Point2D[] points) throws MapException
根据资源图片参数获取资源图片。- 参数:
 resourceParameter- 资源图片参数,如生成的图片的高度、宽度、类型,资源的类型、风格等。points- 绘制资源图片时用的点- 返回:
 - 图片对应的二进制流。
 - 抛出:
 MapException- 地图服务组件异常信息。
 
- 
getResource
byte[] getResource(java.lang.String mapName, java.lang.String symbolId, OutputFormat format) throws MapException根据资源图片参数获取资源图片。- 参数:
 symbolId- 符号idformat- 符号的格式- 返回:
 - 图片对应的二进制流。
 - 抛出:
 MapException- 地图服务组件异常信息。
 
- 
measureDistance
MeasureResult measureDistance(java.lang.String mapName, Point2D[] points, MeasureParameter measureParameter) throws MapException
根据地图名称、二维地理坐标点、量算参数进行距离量算。
- 参数:
 mapName- 地图名称。points- 二维地理坐标点数组。measureParameter- 量算参数,如地图的比例尺、地图的图幅范围等。- 返回:
 - 量算结果对象。
 - 抛出:
 MapException- 地图服务组件异常信息。
 
- 
measureArea
MeasureResult measureArea(java.lang.String mapName, Point2D[] points, MeasureParameter measureParameter) throws MapException
根据地图名称、二维地理坐标点、量算参数进行面积量算。
- 参数:
 mapName- 地图名称。points- 二维地理坐标点数组。measureParameter- 量算参数,如地图的比例尺、地图的图幅范围等。- 返回:
 - 量算结果对象。
 - 抛出:
 MapException- 地图服务组件异常信息。
 
- 
queryByDistance
QueryResult queryByDistance(java.lang.String mapName, Geometry geometry, double distance, QueryParameterSet queryParameters) throws MapException
在指定的地图上,查询距离指定几何对象一定范围内的几何对象。
到指定几何对象的一定距离范围,实际是以指定几何对象为中心的一个圆,在这个圆内以及与圆相交的几何对象都能够被查询出来。
- 参数:
 mapName- 地图名称。geometry- 几何对象。distance- 查询的距离范围,单位同当前地图对应的数据集坐标单位(coordUnit)。queryParameters- 查询参数集。可对某个地图的多个图层进行查询,单个图层的查询参数在queryParameters.queryParams[i]中进行设置。- 返回:
 - 查询结果对象。
 - 抛出:
 MapException- 地图服务组件异常信息。
 
- 
queryByGeometry
QueryResult queryByGeometry(java.lang.String mapName, Geometry geometry, SpatialQueryMode spatialQueryMode, QueryParameterSet queryParameters) throws MapException
在指定的地图上,查询与指定的几何对象符合某种空间关系和查询条件的几何对象。
- 参数:
 mapName- 地图名称。geometry- 几何对象。该几何对象仅包含空间信息、形状信息等,并不包括属性信息。spatialQueryMode- 空间几何对象间的查询模式。空间几何对象间的查询模式定义了一些几何对象之间的空间位置关系,根据这些空间关系来构建过滤条件执行查询。例如:查询可被包含在面对象中的空间对象,与面有相离或者相邻关系的空间对象等。queryParameters- 查询参数集。可对某个地图的多个图层进行查询,单个图层的查询参数在queryParameters.queryParams[i]中进行设置。- 返回:
 - 查询结果对象。
 - 抛出:
 MapException- 地图服务组件异常信息。
 
- 
queryBySQL
QueryResult queryBySQL(java.lang.String mapName, QueryParameterSet queryParameters) throws MapException
在指定的地图上,执行 SQL 查询。
- 参数:
 mapName- 地图名称。queryParameters- 查询参数集。可对某个地图的多个图层进行查询,单个图层的查询参数在queryParameters.queryParams[i]中进行设置。- 返回:
 - 查询结果对象。
 - 抛出:
 MapException- 地图服务组件异常信息。
 
- 
queryByBounds
QueryResult queryByBounds(java.lang.String mapName, Rectangle2D bounds, QueryParameterSet queryParameters) throws MapException
在指定的地图上,查询指定范围内的几何对象,以及外接矩形与指定范围相交的几何对象。
- 参数:
 mapName- 地图名称。bounds- 指定的查询范围。queryParameters- 查询参数集。可对某个地图的多个图层进行查询,单个图层的查询参数在queryParameters.queryParams[i]中进行设置。- 返回:
 - 查询结果对象。
 - 抛出:
 MapException- 地图服务组件异常信息。
 
- 
setDefaultMapParameter
MapParameter setDefaultMapParameter(MapParameter mapParameter) throws MapException
设置默认地图参数。
- 参数:
 mapParameter- 地图参数,如地图名称、地图的比例尺、地图图层、地图的图幅范围等。- 返回:
 - 地图参数对象。
 - 抛出:
 MapException- 地图服务组件异常信息。
 
- 
getDefaultMapParameter
MapParameter getDefaultMapParameter(java.lang.String mapName) throws MapException
获取默认地图参数。
- 参数:
 mapName- 地图名称。- 返回:
 - 地图参数对象。
 - 抛出:
 MapException- 地图服务组件异常信息。
 
- 
pan
MapImage pan(double offsetX, double offsetY, MapParameter mapParameter, ImageOutputOption outputOption) throws MapException
地图平移。
- 参数:
 offsetX- 在横坐标方向的地理坐标偏移量。offsetY- 在纵坐标方向的地理坐标偏移量。mapParameter- 地图参数。outputOption- 图片输出设置。- 返回:
 - 地图图片对象。
 - 抛出:
 MapException- 地图服务组件异常信息。
 
- 
viewByBounds
MapImage viewByBounds(Rectangle2D bounds, MapParameter mapParameter, ImageOutputOption outputOption) throws MapException
根据地理坐标范围显示地图。
- 参数:
 bounds- 地理坐标范围。mapParameter- 地图参数。outputOption- 图片输出设置。- 返回:
 - 地图图片对象。
 - 抛出:
 MapException- 地图服务组件异常信息。
 
- 
viewByScale
MapImage viewByScale(Point2D center, double scale, MapParameter mapParameter, ImageOutputOption outputOption) throws MapException
根据指定中心点和比例尺等参数显示地图。
- 参数:
 center- 中心点。scale- 比例尺。mapParameter- 地图参数。outputOption- 图片输出设置。- 返回:
 - 地图图片对象。
 - 抛出:
 MapException- 地图服务组件异常信息。
 
- 
zoom
MapImage zoom(Point2D center, double ratio, MapParameter mapParameter, ImageOutputOption outputOption) throws MapException
根据指定的中心点、缩放比例、地图参数和图片输出设置进行地图缩放。
- 参数:
 center- 中心点。ratio- 缩放的比例。mapParameter- 地图参数。outputOption- 图片输出设置。- 返回:
 - 地图图片对象。
 - 抛出:
 MapException- 地图服务组件异常信息。
 
- 
viewEntire
MapImage viewEntire(MapParameter mapParameter, ImageOutputOption outputOption) throws MapException
根据地图参数以及图片输出设置进行全幅显示。
- 参数:
 mapParameter- 地图参数。outputOption- 图片输出设置。- 返回:
 - 地图图片对象。
 - 抛出:
 MapException- 地图服务组件异常信息。
 
- 
getTrackingLayerImage
MapImage getTrackingLayerImage(MapParameter mapParameter, ImageOutputOption outputOption) throws MapException
根据地图参数、图片输出设置获取 TrackingLayer 的图片。
- 参数:
 mapParameter- 地图参数。outputOption- 图片输出设置。- 返回:
 - 地图图片对象。
 - 抛出:
 MapException- 地图服务组件异常信息。
 
- 
findNearest
QueryResult findNearest(Geometry geometry, double maxDistance, QueryParameterSet queryParameter, java.lang.String mapName) throws MapException
在指定地图上,查找距离指定几何对象一定容限内的几何对象。
当限制了返回几何对象个数(由
QueryParameterSet.expectCount指定)时,查询结果为查询总记录中距离指定中心最近的expectCount个地物,这expectCount个地物按无序排列。- 参数:
 geometry- 几何对象。maxDistance- 容限范围,单位同当前地图对应的数据集坐标单位(coordUnit)。queryParameter- 查询参数集。可对某个地图的多个图层进行查询,单个图层的查询参数在queryParameters.queryParams[i]中进行设置。mapName- 地图名称。- 返回:
 - 查询结果对象。
 - 抛出:
 MapException- 地图服务组件异常信息。
 
- 
viewEntire
MapImage viewEntire(java.lang.String layerName, MapParameter mapParameter, ImageOutputOption outputOption) throws MapException
根据地图图层名、地图参数以及图片输出设置进行全幅显示。
参数中指定的图层名称是指以该图层内容的最小外接矩形作为全幅显示的地理范围。
- 参数:
 layerName- 地图图层名,即以该图层的最小外接矩形作为全幅显示的地理范围。mapParameter- 地图参数。outputOption- 图片输出设置。- 返回:
 - 地图对象。
 - 抛出:
 MapException- 显示过程出错抛出地图服务组件异常。
 
- 
getOverview
Overview getOverview(MapParameter mapParameter, ImageOutputOption outputOption) throws MapException
根据地图参数以及图片输出设置获取鹰眼。
- 参数:
 mapParameter- 地图参数。outputOption- 图片输出设置。- 返回:
 - 鹰眼对象。
 - 抛出:
 MapException- 地图服务组件异常信息。
 
- 
getDynamicPrjCoordsyses
java.util.List<PrjCoordSys> getDynamicPrjCoordsyses(java.lang.String mapName) throws MapException
- 抛出:
 MapException
 
- 
getChartFeatureInfoSpecs
java.util.List<ChartFeatureInfoSpec> getChartFeatureInfoSpecs(java.lang.String mapName) throws MapException
海图功能用,获取海图所有物标类型。- 抛出:
 MapException
 
- 
queryChart
QueryResult queryChart(java.lang.String mapName, java.lang.String[] chartLayerNames, ChartQueryParameterSet chartQueryParams) throws MapException
海图功能用,物标属性查询。- 抛出:
 MapException
 
- 
queryChart
QueryResult queryChart(java.lang.String mapName, java.lang.String[] chartLayerNames, ChartQueryParameterSet chartQueryParams, Rectangle2D bounds) throws MapException
海图功能用,物标bounds查询- 抛出:
 MapException
 
- 
getUTFGrid
UTFGridResult getUTFGrid(UTFGridParameter gridParameter) throws MapException
根据地理范围从指定图层中提取UTFGrid JSONObject对象。- 参数:
 gridParameter- UTFGrid请求参数。- 返回:
 - UTFGrid对应JSONObject对象。
 - 抛出:
 MapException- 地图服务组件异常信息。
 
- 
support
boolean support(java.lang.String mapName, MapCapability capability)判断地图是否支持相应功能。- 参数:
 mapName- 地图名。capability- 功能类型。- 返回:
 - 返回true表示支持该功能;返回false表示不支持该功能。
 - 从以下版本开始:
 - 7.0.1
 
 
- 
queryByKeywords
QueryResult queryByKeywords(java.lang.String mapName, KeywordsQueryParameterSet queryParameterSet) throws MapException
根据关键字查询地图上的要素。- 参数:
 mapName- 地图名。queryParameterSet- 查询参数集合。- 返回:
 - 抛出:
 MapException
 
- 
updateMap
boolean updateMap(MapParameter mapParameter) throws MapException
永久更新地图状态,会更新到磁盘中进行持久化。- 参数:
 mapParameter- 要更新的地图状态。- 返回:
 - 是否更新成功。
 - 抛出:
 MapException
 
- 
getProjectionExtent
Rectangle2D getProjectionExtent(java.lang.String mapName)
获取当前投影下的范围
- 参数:
 mapName-- 返回:
 - 从以下版本开始:
 - 9.1.0
 
 
- 
getFieldsByLayerName
java.util.List<FieldInfo> getFieldsByLayerName(java.lang.String mapName, LayerFieldsQueryParameter layerFieldsQueryParameter)
通过图层查询参数获取图层的fields信息- 参数:
 mapName- 地图名称,用于获取对应的providerlayerFieldsQueryParameter- 查询参数。- 返回:
 - fields列表
 
 
- 
getSymbol
SymbolInfo getSymbol(java.lang.String mapName, int symbolId, ResourceType resourceType)
获取symbol信息。- 参数:
 symbolId- 符号id- 返回:
 - symbol信息。
 - 抛出:
 MapException- 地图服务组件异常信息。
 
- 
queryChartFeatureByBounds
ChartFeatureQueryResult queryChartFeatureByBounds(java.lang.String mapName, Rectangle2D bounds) throws MapException
- 抛出:
 MapException
 
- 
addSymbol
int addSymbol(java.lang.String mapName, SymbolInfo symbolInfo, ResourceType resourceType) 
 - 
 
 -