MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / getMapInfo

Method getMapInfo

src/openlayers/mapping/WebMap.js:298–318  ·  view source on GitHub ↗

* @private * @function WebMap.prototype.getMapInfo * @description 获取地图的json信息 * @param {string} url - 请求地图的url

(url)

Source from the content-addressed store, hash-verified

296 * @param {string} url - 请求地图的url
297 */
298 getMapInfo(url) {
299 let that = this,
300 mapUrl = url;
301 if (url.indexOf('.json') === -1) {
302 url = this.handleJSONSuffix(url);
303 //传递过来的url,没有包括.json,在这里加上。
304 mapUrl = url;
305 }
306 FetchRequest.get(that.getRequestUrl(mapUrl), null, {
307 withCredentials: that.isCredentail(mapUrl)
308 })
309 .then(function (response) {
310 return response.json();
311 })
312 .then(function (mapInfo) {
313 that.getMapInfoSuccess(mapInfo);
314 })
315 .catch(function (error) {
316 that.errorCallback && that.errorCallback(error, 'getMapFaild', that.map);
317 });
318 }
319
320 /**
321 * @private

Callers 9

createWebmapMethod · 0.95
MapServiceSpec.jsFile · 0.45
MapServiceSpec.jsFile · 0.45
MapServiceSpec.jsFile · 0.45
MapServiceSpec.jsFile · 0.45

Calls 6

handleJSONSuffixMethod · 0.95
indexOfMethod · 0.80
getRequestUrlMethod · 0.80
isCredentailMethod · 0.80
getMapInfoSuccessMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected