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

Method getTileUrl

src/openlayers/mapping/WebMap.js:1843–1858  ·  view source on GitHub ↗

* @private * @function WebMap.prototype.getTileUrl * @description 获取wmts的图层参数。 * @param {Object} getTileArray - 图层信息。 * @param {string} layer - 选择的图层 * @param {string} format - 选择的出图方式 * @param {boolean} isKvp - 是否是kvp方式

(getTileArray, layer, format, isKvp)

Source from the content-addressed store, hash-verified

1841 * @param {boolean} isKvp - 是否是kvp方式
1842 */
1843 getTileUrl(getTileArray, layer, format, isKvp) {
1844 let url;
1845 if (isKvp) {
1846 getTileArray.forEach((data) => {
1847 if (data.Constraint[0].AllowedValues.Value[0].toUpperCase() === 'KVP') {
1848 url = data.href;
1849 }
1850 });
1851 } else {
1852 const reuslt = layer.ResourceURL.filter((resource) => {
1853 return resource.format === format;
1854 });
1855 url = reuslt[0].template;
1856 }
1857 return url;
1858 }
1859
1860 /**
1861 * @private

Callers 8

mockCreateTileFunction · 0.80
getWmtsInfoMethod · 0.80
leaflet.jsFile · 0.80
leaflet-src.jsFile · 0.80

Calls 2

forEachMethod · 0.80
filterMethod · 0.80

Tested by

no test coverage detected