public class WMTSLayerView extends AbstractTileLayerView
WMTS 图层视图,作为地图视图的子项添加到 MapView
中显示。
WMTS 是 OGC 提出的首个支持 REST 的服务标准,目前为 1.0.0 版本,该服务支持三种请求模式:HTTP KVP(Key-Value Pair)方式、SOAP 方式、REST 方式,SuperMap iClient 7C for Ansroid 支持 HTTP KVP(Key-Value Pair)方式和 REST 方式两种;支持三种功能GetCapabilities(获取服务的元信息)、GetTile(获取切片)、GetFeatureInfo(可选,获取点选的要素信息在 WMTSLayerView 中,默认首先通过 GetCapabilities 获取图层信息,其次通过 GetTile 请求实际瓦片。若想通过 GetTile 直接获取瓦片出图,可将 WMTSLayerView中enableGetCapabilities 属性设置为 false,此时有如下属性为必设:tileMatrixIdentifiers、resolutions、layer、tileMatrixSet、url、 bounds 属性。若使用默认出图方式,即 WMTSLayerView中enableGetCapabilities 属性设置为 true,则layer、tileMatrixSet、url、bounds为必设。
WMTSLayerView 还支持自定义 WMTS 服务,即未(完全)遵循 OGC WMTS 标准比例尺/分辨率数组的 WMTS 服务,如 SuperMap iServer Java 7C 支持使用用户自定义的比例尺集发布 WMTS 服务。同样的,使用自定义 WMTS 服务时,当 WMTSLayerView中enableGetCapabilities 属性设置为 false,tileMatrixIdentifiers、resolutions、layer、tileMatrixSet、url、bounds为必设。当 WMTSLayerView中enableGetCapabilities 属性为 true,layerName、tileMatrixSet、url、bounds、resolutions为必设。
addToNetworkDownload, context, crs, curMapUrl, dpi, isGCSLayer, isLayerInited, layerBounds, layerCacheFileName, layerName, mapView, projection, resolutions, tileCount, totalTileCount, visible, visibleScales, zoomLevel
构造器和说明 |
---|
WMTSLayerView(Context context)
构造函数。
|
WMTSLayerView(Context context, AttributeSet attrs)
构造函数。
|
WMTSLayerView(Context context, AttributeSet attrs, int defStyle)
构造函数。
|
WMTSLayerView(Context context, java.lang.String url, java.lang.String layer, java.lang.String tileMatrixSet)
构造函数。
|
WMTSLayerView(Context context, java.lang.String url, java.lang.String layer, java.lang.String tileMatrixSet, boolean enableGetCapabilities)
构造函数。
|
WMTSLayerView(Context context, java.lang.String url, java.lang.String layer, java.lang.String tileMatrixSet, boolean enableGetCapabilities, double[] resolutions)
构造函数。
|
WMTSLayerView(Context context, java.lang.String url, java.lang.String layer, java.lang.String tileMatrixSet, boolean enableGetCapabilities, double[] resolutions, java.util.List<java.lang.String> tileMatrixIds)
构造函数。
|
限定符和类型 | 方法和说明 |
---|---|
double[] |
getWMTSResolutions() |
void |
initTileContext(Tile tile)
初始化tile瓦片,具体继承类实现该接口。
|
void |
setBounds(BoundingBox boundingBox)
设置wms地图服务的地理范围,其中必须left小于right,bottom小于top.
|
void |
setBounds(double left, double bottom, double right, double top)
设置wms地图服务的地理范围,其中必须left小于right,bottom小于top.
|
void |
setCRS(CoordinateReferenceSystem crs)
设置坐标参考系类对象,用于支持动态投影。
|
void |
setFormat(java.lang.String format)
地图的输出格式。
|
void |
setGCSLayer(boolean isGCSLayer) |
void |
setLayer(java.lang.String layer)
设置图层名
|
void |
setRequestEncoding(java.lang.String requestEncoding)
设置服务请求模式
|
void |
setStyle(java.lang.String style)
设置请求图层的样式列表,图层样式之间以英文逗号分隔。
|
void |
setTileMatrixSet(java.lang.String tileMatrixSet)
设置瓦片矩阵集的唯一标识符,矩阵集名称
|
asyncGetTilesFromCache, buildTile, clearCache, destroy, getBounds, getCRS, getMapView, getResolutionIndex, getResolutions, getScales, getTileCacher, getURL, getZoomLevel, initProjection, isGCSLayer, isInitialized, isVisible, onDraw, setLayerCacheFileName, setOpaqueRate, setURL, setVisible, validateZoomLevel
public WMTSLayerView(Context context)
构造函数。
context
- Activity的上下文。public WMTSLayerView(Context context, AttributeSet attrs)
构造函数。
context
- Activity的上下文。attrs
- 属性信息。public WMTSLayerView(Context context, AttributeSet attrs, int defStyle)
构造函数。
context
- Activity的上下文。attrs
- 属性信息。defStyle
- 风格标识。public WMTSLayerView(Context context, java.lang.String url, java.lang.String layer, java.lang.String tileMatrixSet, boolean enableGetCapabilities, double[] resolutions, java.util.List<java.lang.String> tileMatrixIds)
构造函数。
context
- Activity的上下文。url
- wmts地图服务的 urllayer
- 请求的 WMTS 服务的图层名称tileMatrixSet
- 瓦片矩阵集的唯一标识符,矩阵集enableGetCapabilities
- 是否执行 GetCapabilities 操作,默认为false(建议设置为false,必要时设置为true)tileMatrixIds
- 显示级别名称集合resolutions
- 分辨率数组public WMTSLayerView(Context context, java.lang.String url, java.lang.String layer, java.lang.String tileMatrixSet, boolean enableGetCapabilities, double[] resolutions)
构造函数。
context
- Activity的上下文。url
- wmts地图服务的 urllayer
- 请求的 WMTS 服务的图层名称tileMatrixSet
- 瓦片矩阵集的唯一标识符,矩阵集。enableGetCapabilities
- 是否执行 GetCapabilities 操作,默认为false(建议设置为false,必要时设置为true)resolutions
- 分辨率数组public WMTSLayerView(Context context, java.lang.String url, java.lang.String layer, java.lang.String tileMatrixSet, boolean enableGetCapabilities)
构造函数。
context
- Activity的上下文。url
- wmts地图服务的 urllayer
- 请求的 WMTS 服务的图层名称tileMatrixSet
- 瓦片矩阵集的唯一标识符,矩阵集enableGetCapabilities
- 是否执行 GetCapabilities 操作,默认为false(建议设置为false,必要时设置为true)public WMTSLayerView(Context context, java.lang.String url, java.lang.String layer, java.lang.String tileMatrixSet)
构造函数。
context
- Activity的上下文。url
- wmts地图服务的 urllayer
- 请求的 WMTS 服务的图层名称tileMatrixSet
- 瓦片矩阵集的唯一标识符,矩阵集public void setLayer(java.lang.String layer)
设置图层名
layer
-public void setBounds(double left, double bottom, double right, double top)
设置wms地图服务的地理范围,其中必须left小于right,bottom小于top.
left
- 地理范围左bottom
- 地理范围下right
- 地理范围右top
- 地理范围上public void setBounds(BoundingBox boundingBox)
设置wms地图服务的地理范围,其中必须left小于right,bottom小于top.
boundingBox
- 地理范围public void setFormat(java.lang.String format)
地图的输出格式。WMS 服务器的 capabilities 文档中声明的 GetMap 中的 Format 之一。 如image/png,image/bmp,image/jpeg,image/gif
format
- 输出格式,如image/pngpublic void setStyle(java.lang.String style)
设置请求图层的样式列表,图层样式之间以英文逗号分隔。 STYLES 值与 LAYERS 参数值是一一对应的。图层名称是服务元数据中定义的