ServiceSelect 服务选择
MapGIS服务选择组件。
<mapgis-service-select></mapgis-service-select>
基本用法
传入服务根地址
传入服务根地址和服务类型
API
属性
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|---|---|---|---|---|
| defaultSupportedServiceProtocolTypes | 默认的支持协议的服务类型列表 | ServiceTypeItem[] | ||
| defaultThirdPartyServiceTypes | 默认的三方服务类型列表 | ServiceTypeItem[] | ||
| serviceRootUrl | 服务根地址,形如:http(s)://<server>:<port>/igs/rest/services | string | ||
| serviceRootToken | 服务根令牌 | string | ||
| serviceType | 服务类型,来自于@mapgis/webclient-common中LayerType的常量值 | string | ||
| serviceUrl | 服务地址 | string | ||
| tokenKey | 令牌字段名 | string | ||
| tokenValue | 令牌值 | string | ||
| tokenAttachType | 令牌位置,可取值url(查询参数)、header(请求头) | url|header | url | |
| showMode | 服务类型显示模式,可取值2D、3D、all | 2D|3D|all | all | |
| supportThirdPartyServices | 是否支持第三方服务,第三方服务无法从服务器选择,只能输入 | boolean | false | |
| dropdownWidth | 服务选择下拉框宽度,单位像素 | number |
事件
| 事件名称 | 说明 | 回调参数 | 版本 |
|---|---|---|---|
| serviceChange | 服务变化 | serviceInfo |
ServiceTypeItem
javascript
export interface ServiceTypeItem {
type: string // LayerType,来自于@mapgis/webclient-common
label: string // 服务类型名称
template: string // 服务地址模板
protocol?: string // 服务协议类型
originalServiceType?: string // 原始服务类型
'2D': boolean // 是否支持2D
'3D': boolean // 是否支持3D
}ServiceInfo
javascript
{
serviceRootUrl
serviceRootToken
serviceType
serviceUrl
tokenKey
tokenValue
tokenAttachType
suggestServiceName
isServiceUrlValid
}