OGCConnector

OGC服务连接器基类,用于连接和解析各种OGC标准服务

abstractnew CooWasm.OGCConnector(props)

创建OGC服务连接器

Name Type Description
props Object

包含如下属性的Object:

Name Type Description
url String

服务地址

serviceType EnumOGCType

服务类型

version String

服务版本

Members

readonlyserviceType : EnumOGCType

服务类型 (WMS/WMTS)

url : String

服务地址

version : String

服务版本

Methods

protected_buildUrl(params)String

构建请求URL,附加服务类型和版本参数

Name Type Description
params Object

请求参数

Returns:

完整的请求URL

abstractprotected_extractLayers(capabilities)Array

从能力文档中提取图层信息

Name Type Description
capabilities Object

能力文档对象

Returns:

图层信息数组

protected_findLayerByName(layers, layerName)Object|null

在图层列表中查找指定名称的图层

Name Type Description
layers Array

图层列表

layerName String

图层名称

Returns:

图层信息对象

protected_getElementText(node, tagName)String|null

获取XML节点中指定元素的文本内容

Name Type Description
node Element

父节点

tagName String

子节点标签名

Returns:

文本内容

protected_parseXML(text)Document

解析XML文本

Name Type Description
text String

XML文本

Returns:

XML文档对象

protected_request(url, callback)

执行HTTP请求

Name Type Description
url String

请求URL

callback function

回调函数,参数为(error, response)

abstractgetCapabilities(callback)

获取服务能力信息

Name Type Description
callback function

回调函数,参数为(error, capabilities)

getLayerInfo(layerName, callback)

获取图层详细信息

Name Type Description
layerName String

图层名称

callback function

回调函数,参数为(error, layerInfo)

getLayers(callback)

获取图层名称列表

Name Type Description
callback function

回调函数,参数为(error, layerNames)

getLayersInfo(callback)

获取完整的图层信息对象列表

Name Type Description
callback function

回调函数,参数为(error, layerInfos)