com.supermap.web.mapping
public class TiledWMTSLayer
继承 TiledWMTSLayer Inheritance TiledCachedLayer Inheritance TiledLayer Inheritance ImageLayer Inheritance Layer Inheritance mx.core.UIComponent

WMTS 图层.

该图层属于分块缓存图层(TiledCachedLayer)的一种。
WMTS 是 OGC 提出的首个支持 REST 的服务标准,目前为 1.0.0 版本,该服务支持三种请求模式:HTTP KVP(Key-Value Pair)方式、SOAP 方式、REST 方式,SuperMap iClient 8C for Flash 支持 HTTP KVP(Key-Value Pair)方式和 REST 方式两种;支持三种功能GetCapabilities(获取服务的元信息)、GetTile(获取切片)、GetFeatureInfo(可选,获取点选的要素信息)。

在 TiledWMTSLayer 中,默认首先通过 GetCapabilities 获取图层信息(json 表述),其次通过 GetTile 请求实际瓦片。若想通过 GetTile 直接获取瓦片出图,可将 TiledWMTSLayer::enableGetCapabilities 方法设置为 false,此时有如下属性为必设:tileMatrixIdentifiers、resolutions、layerName、tileMatrixSet、url,需要注意 bounds 属性默认值。
若使用默认出图方式,即 TiledWMTSLayer::enableGetCapabilities 方法设置为 true,则:layerName、tileMatrixSet、url为必设,需要注意 bounds 属性默认值。

TiledWMTSLayer 还支持自定义 WMTS 服务,即未(完全)遵循 OGC WMTS 标准比例尺/分辨率数组的 WMTS 服务,如 SuperMap iServer Java 6R 支持使用用户自定义的比例尺集发布 WMTS 服务。同样的,使用自定义 WMTS 服务时,当 TiledWMTSLayer::enableGetCapabilities 属性为 false,tileMatrixIdentifiers、resolutions、layerName、tileMatrixSet、url 为必设,需要注意 bounds 属性默认值。当 TiledWMTSLayer::enableGetCapabilities 属性为 true,layerName、tileMatrixSet、url 为必设,需要注意 bounds、resolutions属性默认值。
以上有关 bounds、resolutions 默认值请分别参见 bounds、resolutions 属性。

另请参见

bounds
resolutions


公共属性
  属性 定义方
  Inherited bounds : Rectangle2D
当前图层的地理范围,若当前图层为 Map 的第一个图层,且 Map 的 ViewBounds 为 null,则将当前图层的 bounds 作为 Map 的 ViewBounds。一般情况下该属性默认值为(0,0,0,0)。若当前图层为 WMTS 图层(TiledWMTSLayer),则 bounds 的默认值参考 WMTS 标准而定...
Layer
  Inherited CRS : CoordinateReferenceSystem
获取或设置当前图层的坐标参考系( CoordinateReferenceSystem )。默认值为 null。设置 CoordinateReferenceSystem.wkid 属性后,图层将被动态投影至 wkid 所代表的投影坐标系下,若 wkid 小于等于 0 则不进行动态投影...
Layer
    enableGetCapabilities : Boolean
是否执行 GetCapabilities 操作,获取 WMTS 服务的元数据信息,默认值为 true.
TiledWMTSLayer
  Inherited fadeInFrameCount : uint
获取或设置图层在缩放过程中渐显帧数,这样可使缩放过程更加平滑。默认值为4.
TiledLayer
    format : String
请求的瓦片输出格式,默认为 image/png。
TiledWMTSLayer
  Inherited imageFormat : String
获取或设置载入 ImageLayer 的图片格式,默认为 png 格式。
ImageLayer
  Inherited isInResolutionRange : Boolean
[read-only] 判断与当前图层关联的 Map 的分辨率是否在当前图层的最大、最小分辨率范围内。true 表示在最大、最小范围内。
Layer
  Inherited isScaleCentric : Boolean
[read-only] 指示该图层是否有 DPI 值,ture 表示当前图层已根据从 SuperMap iServer 服务端获取的参数计算出 DPI;false 反之。WMS、WMTS 等图层该属性值为 false。DynamicRESTLayer、TiledDynamicRESTLayer 等专门关联 SuperMap iServer 服务的图层该属性为 true。
Layer
    layerName : String
【必设】请求的 WMTS 服务的图层名称。
TiledWMTSLayer
  Inherited loaded : Boolean
[read-only] 若当前图层已加载完闭则返回 true,否则返回 false。
Layer
  Inherited localStorage : LocalStorage
LocalStorage 对象。该属性与 memoryStorageEnabled 属性为 true 时的功能类似,不同之处在于 memoryStorageEnabled 是将地图数据缓存至内存,且浏览器关闭后会被清除;而 localStorage 是将数据缓存至本地磁盘,由用户清除缓存数据...
TiledLayer
  Inherited maxVisibleResolution : Number
当前图层的最大显示分辨率。即当图层缩放至该分辨率时就不能再放大。
Layer
  Inherited memoryStorageEnabled : Boolean
是否使用内存数据。当该属性为 true 时表示在浏览器中浏览地图时,系统内部会自动将地图数据缓存至本地内存中,并读取已有的地图缓存数据。在浏览器未关闭的情况下,内存中的缓存数据会一直存在,用户在浏览地图时一直访问的是本地已缓存的数据,对于重复浏览地图可大幅提升浏览速度;若浏览器关闭,缓存会自动清除。默认值为 false...
TiledLayer
  Inherited metadata : Object
获取或设置当前图层信息,包括图层标题、描述信息、图层所在地图控件名称。
Layer
  Inherited minVisibleResolution : Number
当前图层的最小显示分辨率。即当图层缩放至该分辨率时就不能再缩小。
Layer
  Inherited origin : Point2D
获取或设置分块图层的起点坐标(左上角点).
TiledLayer
    requestEncoding : String
WMTS 服务访问模式,支持 HTTP KVP(Key-Value Pair)和 REST 两种,由 RequestEncoding 枚举类定义。默认为 RequestEncoding.REST。
TiledWMTSLayer
  Inherited resolution : Number
[read-only] 获取当前图层的显示分辨率。
Layer
  Inherited resolutions : Array
获取或设置当前图层的分辨率数组。该属性与 scales 属性选择其中一个设置即可。.
TiledCachedLayer
  Inherited scales : Array
获取或设置当前图层的比例尺数组。该属性与 resolutions 属性选择其中一个设置即可...
TiledCachedLayer
    style : String
当前图层的风格。
TiledWMTSLayer
  Inherited tileBufferCount : int
TiledLayer
    tileMatrixIdentifiers : Array
显示级别名称集合。指定该属性后,地图仅显示与数组中的级别名称对应的某几级...
TiledWMTSLayer
    tileMatrixSet : String
【必设】瓦片矩阵集的唯一标识符,矩阵集...
TiledWMTSLayer
  Inherited tileSize : int
获取或者设置图层分块大小,单位为像素,默认值为 512.
TiledLayer
  Inherited transparent : Boolean
指定图片是否透明显示。
ImageLayer
    url : String
[Override] WMTS 服务地址,如:http://192.168.169.201:8090/iserver/services/maps/wmts100
TiledWMTSLayer
    urls : Array
WMTS 服务地址,如:http://192.168.169.201:8090/iserver/services/maps/wmts100
TiledWMTSLayer
    version : String
WMTS 服务版本,默认值为 1.0.0。
TiledWMTSLayer
  Inherited viewRegion : GeoRegion
获取或设置分块图层的出图控制范围.
TiledLayer
  Inherited visible : Boolean
[Override] 获取或设置当前图层是否可见。
Layer
    wellKnownScaleSet : String
标准比例尺集名称,用于指定 WMTS 服务使用哪种标准。可选值有如下几种:GlobalCRS84Scale、GlobalCRS84Pixel、GoogleCRS84Quad、GoogleMapsCompatible,这四种为 OGC WMTS 标准,若 wellKownScaleSet 值不属于上述四种,则按自定义 WMTS 处理...
TiledWMTSLayer
受保护的属性
  属性 定义方
  Inherited dpi : Number
获取当前图层的扫描精度,即单位面积内的像素的个数...
Layer
  Inherited _urls : Array
TiledLayer
公共方法
  方法 定义方
   
使初始化 TiledWMTSLayer 类的新实例。
TiledWMTSLayer
  Inherited
refresh():void
[Override] 刷新图层,即调用 Layer.invalidateDisplayList() 方法(详情请参见 Flex SDK UIComponent.invalidateDisplayList() 方法),更新 Layer 的显示列表。对于 GraphicsLayer 调用该方法会对 GraphicsLayer 上所有显示对象 Graphic 进行重绘。
TiledLayer
  Inherited
selectUrls(row:int, col:int):String
TiledLayer
受保护的方法
  方法 定义方
  Inherited
addedHandler(event:Event):void
处理 Event.ADDED 事件的侦听器函数。
Layer
  Inherited
[Override] 为当前图层添加事件侦听器,以使侦听器能够接收 ZoomEvent、 ViewBoundsEvent 事件的触发通知。
TiledLayer
  Inherited
draw():void
[Override] 渲染出图,注意:子类必须重写该方法来实现渲染出图。
TiledLayer
   
getTileURL(row:int, col:int, level:int):URLRequest
[Override] 获取指定图片块在服务器端的存放地址。TiledCachedLayer 的子类必须重写该方法来实现此功能。
TiledWMTSLayer
  Inherited
hideHandler(event:FlexEvent):void
[Override] 处理 FlexEvent.HIDE 事件的侦听器函数。
TiledLayer
  Inherited
通过子类调用以更新图层。
Layer
  Inherited
[Override] 删除 Layer 上的所有对象。
TiledLayer
  Inherited
removedHandler(event:Event):void
[Override] 处理 Event.REMOVED 事件的侦听器函数。
TiledLayer
  Inherited
[Override] 移除通过 addMapListeners 添加的事件侦听器。
TiledLayer
  Inherited
setLoaded(value:Boolean):void
设置图层是否加载完闭,会触发 LayerEvent.LOAD 事件。true 表示当前图层已加载完毕。注意:任何继承 Layer 的子类都必须在 Layer 初始化完成之后调用该接口设置对应的图层是否加载完毕。
Layer
  Inherited
showHandler(event:FlexEvent):void
[Override] 处理 FlexEvent.SHOW 事件的侦听器函数。
TiledLayer
  Inherited
[Override] 处理 viewBoundsChanged 事件的侦听器函数。
TiledLayer
  Inherited
[Override] 处理 zoomEnd 事件的侦听器函数。
TiledLayer
  Inherited
[Override] 处理 zoomStart 事件的侦听器函数。
TiledLayer
  Inherited
[Override] 处理 zoomUpdate 事件的侦听器函数。
TiledLayer
事件
  事件 Summary 定义方
  Inherited TiledLayer
  Inherited 当 Layer 的 IsInResolutionRange 属性发生变化时触发该事件。 Layer
  Inherited 当图层初始化完成时触发该事件。 Layer
  Inherited 当载入图层出错时触发该事件。 Layer
  Inherited 当图层最大显示分辨率改变时触发该事件。 Layer
  Inherited 当图层最小显示分辨率改变时触发该事件。 Layer
  Inherited 当完成更新图层时触发该事件。 Layer
  Inherited 当更新图层开始时触发该事件。 Layer
  Inherited 当图层的 visible 属性发生改变时触发该事件。 Layer
属性详细信息
enableGetCapabilities 属性
enableGetCapabilities:Boolean

是否执行 GetCapabilities 操作,获取 WMTS 服务的元数据信息,默认值为 true.

WMTS 服务的元数据主要由 ServiceIdentification、ServiceProvider、OperationsMetadata、Contents 和 Themes 几个元素组成。其中 ServiceIdentification 是对服务的整体介绍;ServiceProvider 是关于服务提供商的信息;OperationsMetadata 描述了当前服务中支持的所有操作(如:GetTile、GetCapabilities、GetFeatureInfo)以及操作请求的 URI;Contents 是对服务中可用图层的整体描述,包括瓦片矩阵集、可操作图层等等;Themes 是描述专题图层的元数据。

当该属性值为 false 时,则当前 WMTS 图层的 resolutions 和 tileMatrixIdentifiers,且两个数组中的元素必须是一一对应的。


Implementation
    public function get enableGetCapabilities():Boolean
    public function set enableGetCapabilities(value:Boolean):void

另请参见

format 属性  
format:String

请求的瓦片输出格式,默认为 image/png。


Implementation
    public function get format():String
    public function set format(value:String):void
layerName 属性  
layerName:String

【必设】请求的 WMTS 服务的图层名称。


Implementation
    public function get layerName():String
    public function set layerName(value:String):void
requestEncoding 属性  
requestEncoding:String

WMTS 服务访问模式,支持 HTTP KVP(Key-Value Pair)和 REST 两种,由 RequestEncoding 枚举类定义。默认为 RequestEncoding.REST。


Implementation
    public function get requestEncoding():String
    public function set requestEncoding(value:String):void

另请参见

com.supermap.web.mapping.OGC.WMTS.RequestEncoding
style 属性  
style:String

当前图层的风格。


Implementation
    public function get style():String
    public function set style(value:String):void
tileMatrixIdentifiers 属性  
tileMatrixIdentifiers:Array

显示级别名称集合。指定该属性后,地图仅显示与数组中的级别名称对应的某几级...

显示级别名称可在 WMTS 服务描述文件中获取,如下图所示,为“世界地图”在“GlobalCRS84Scale”比例尺集的标准下包含的所有级别,级别名称如红框所示:

若 tileMatrixIdentifiers = ["1","2"]; 则仅显示名称为“1”、“2”的级别。


Implementation
    public function get tileMatrixIdentifiers():Array
    public function set tileMatrixIdentifiers(value:Array):void
tileMatrixSet 属性  
tileMatrixSet:String

【必设】瓦片矩阵集的唯一标识符,矩阵集...

如下图所示,在 WMTS 描述文件中每个

对应一个或多个矩阵集,用户选择其一即可:


Implementation
    public function get tileMatrixSet():String
    public function set tileMatrixSet(value:String):void
url 属性  
url:String[Override]

WMTS 服务地址,如:http://192.168.169.201:8090/iserver/services/maps/wmts100


Implementation
    public function get url():String
    public function set url(value:String):void
urls 属性  
urls:Array

WMTS 服务地址,如:http://192.168.169.201:8090/iserver/services/maps/wmts100


Implementation
    public function get urls():Array
    public function set urls(value:Array):void
version 属性  
version:String

WMTS 服务版本,默认值为 1.0.0。


Implementation
    public function get version():String
    public function set version(value:String):void
wellKnownScaleSet 属性  
wellKnownScaleSet:String

标准比例尺集名称,用于指定 WMTS 服务使用哪种标准。可选值有如下几种:GlobalCRS84Scale、GlobalCRS84Pixel、GoogleCRS84Quad、GoogleMapsCompatible,这四种为 OGC WMTS 标准,若 wellKownScaleSet 值不属于上述四种,则按自定义 WMTS 处理...

当 enableGetCapabilities 属性为 true 时,默认情况下首先会根据 tileMatrixSet 属性自动读取 WMTS 描述文件中的 WellKnownScaleSet 标识,如下图所示:

若用户指定了 wellKownScaleSet 值,则以用户为准。
若用户未设置,且 WMTS 描述文件中不存在 WellKnownScaleSet 标识,则按自定义 WMTS 处理。

当 enableGetCapabilities 属性为 false 时,wellKownScaleSet 为必设,否则按自定义 WMTS 处理。


Implementation
    public function get wellKnownScaleSet():String
    public function set wellKnownScaleSet(value:String):void

另请参见

构造函数详细信息
TiledWMTSLayer () 构造函数
public function TiledWMTSLayer()

使初始化 TiledWMTSLayer 类的新实例。

方法详细描述
getTileURL () 方法
override protected function getTileURL(row:int, col:int, level:int):URLRequest

获取指定图片块在服务器端的存放地址。TiledCachedLayer 的子类必须重写该方法来实现此功能。

参数

row:int
 
col:int
 
level:int

返回
URLRequest