* @private * @function WebMap.prototype.getDataflowInfo * @description 获取数据流服务的参数 * @param {Object} layerInfo - 图层信息 * @param {function} success - 成功回调函数 * @param {function} faild - 失败回调函数
(layerInfo, success, faild)
| 2424 | * @param {function} faild - 失败回调函数 |
| 2425 | */ |
| 2426 | getDataflowInfo(layerInfo, success, faild) { |
| 2427 | let that = this; |
| 2428 | let url = layerInfo.url, |
| 2429 | token; |
| 2430 | url = this.handleJSONSuffix(url); |
| 2431 | let requestUrl = that.getRequestUrl(url, layerInfo.proxy); |
| 2432 | if (layerInfo.credential && layerInfo.credential.token) { |
| 2433 | token = layerInfo.credential.token; |
| 2434 | requestUrl += `?token=${token}`; |
| 2435 | } |
| 2436 | FetchRequest.get(requestUrl, null, { |
| 2437 | withCredentials: that.isCredentail(url, layerInfo.proxy) |
| 2438 | }) |
| 2439 | .then(function (response) { |
| 2440 | return response.json(); |
| 2441 | }) |
| 2442 | .then(function (result) { |
| 2443 | layerInfo.featureType = 'POINT'; |
| 2444 | if (result && result.featureMetaData) { |
| 2445 | layerInfo.featureType = result.featureMetaData.featureType.toUpperCase(); |
| 2446 | } |
| 2447 | layerInfo.wsUrl = result.urls[0].url; |
| 2448 | success(); |
| 2449 | }) |
| 2450 | .catch(function () { |
| 2451 | faild(); |
| 2452 | }); |
| 2453 | } |
| 2454 | |
| 2455 | /** |
| 2456 | * @private |
no test coverage detected