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

Method _createMvtLayer

src/common/mapping/WebMapV2.js:2810–2834  ·  view source on GitHub ↗
(info, layerInfo, featureType)

Source from the content-addressed store, hash-verified

2808 }
2809
2810 _createMvtLayer(info, layerInfo, featureType) {
2811 const style = this._getDataVectorTileStyle(featureType);
2812 const paint = this._transformStyleToMapBoxGl(style, featureType);
2813 let url = info.url + '/tileFeature.mvt';
2814 const origin = mapRepo.CRS.get(this.baseProjection).getOrigin();
2815 const { minzoom, maxzoom } = layerInfo;
2816 url += `?&returnAttributes=true&width=512&height=512&x={x}&y={y}&scale={scale}&origin={x:${origin[0]},y:${origin[1]}}`;
2817 this._addLayer({
2818 id: layerInfo.layerID,
2819 type: style.mbglType,
2820 source: {
2821 type: 'vector',
2822 tiles: [url],
2823 proxy: this.webMapService.handleProxy('image')
2824 },
2825 'source-layer': `${info.datasetName}@${info.datasourceName}`,
2826 paint,
2827 layout: {
2828 visibility: layerInfo.visible ? 'visible' : 'none'
2829 },
2830 minzoom: minzoom || 0,
2831 maxzoom: maxzoom || this.map.getMaxZoom() + 1
2832 });
2833 this._addLayerSucceeded();
2834 }
2835
2836 _getDataVectorTileStyle(featureType) {
2837 const styleParameters = {

Callers 1

_initOverlayLayerMethod · 0.95

Calls 8

_addLayerMethod · 0.95
_addLayerSucceededMethod · 0.95
handleProxyMethod · 0.80
getOriginMethod · 0.45
getMethod · 0.45
getMaxZoomMethod · 0.45

Tested by

no test coverage detected