MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / getDatasources

Method getDatasources

src/openlayers/mapping/WebMap.js:4374–4386  ·  view source on GitHub ↗

* @private * @function WebMap.prototype.getDatasources * @description 获取关系型文件发布的数据服务中数据源的名称 * @param {string} url - 获取数据源信息的url * @returns {Promise } 数据源名称

(url)

Source from the content-addressed store, hash-verified

4372 * @returns {Promise<T | never>} 数据源名称
4373 */
4374 getDatasources(url) {
4375 let requestUrl = this.getRequestUrl(`${url}/data/datasources.json`);
4376 return FetchRequest.get(requestUrl, null, {
4377 withCredentials: this.isCredentail(requestUrl)
4378 })
4379 .then(function (response) {
4380 return response.json();
4381 })
4382 .then(function (datasource) {
4383 let datasourceNames = datasource.datasourceNames;
4384 return datasourceNames[0];
4385 });
4386 }
4387 /**
4388 * @private
4389 * @function WebMap.prototype.getDataService

Calls 3

getRequestUrlMethod · 0.95
isCredentailMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected