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

Method _createZXYLayer

src/common/mapping/WebMapV2.js:812–824  ·  view source on GitHub ↗
(layerInfo, addedCallback)

Source from the content-addressed store, hash-verified

810 }
811
812 _createZXYLayer(layerInfo, addedCallback) {
813 const { url, subdomains, layerID, name, visible, tileSize, resolutions, origin, minZoom: minzoom, maxZoom: maxzoom, mapBounds } = layerInfo;
814 const urls = (subdomains && subdomains.length) ? subdomains.map(item => url.replace('{s}', item)) : [url];
815 const layerId = layerID || name;
816 const isSupport = this._isSupportZXYTileLayer({ resolutions, tileSize, origin });
817 if (isSupport) {
818 const bounds = this._getSourceBounds(mapBounds);
819 this._addBaselayer({ url: urls, layerID: layerId, visibility: visible, minzoom, maxzoom, bounds, isIserver: false, tileSize });
820 } else {
821 this.fire('xyztilelayernotsupport', { error: `The resolutions or origin of layer ${name} on XYZ Tile does not match the map`, error_code: 'XYZ_TILE_LAYER_NOT_SUPPORTED', layer: layerInfo});
822 }
823 addedCallback && addedCallback();
824 }
825 _getSourceBounds(mapBounds) {
826 if(!mapBounds) {
827 return;

Callers 1

_initBaseLayerMethod · 0.95

Calls 5

_getSourceBoundsMethod · 0.95
_addBaselayerMethod · 0.95
mapMethod · 0.80
fireMethod · 0.45

Tested by

no test coverage detected