拦截arcgis js api中的瓦片加载事件

 

var layer = window.map.getLayer("basemap_baseMap_zq");
    			var getUrlOld = layer.getTileUrl;
    			layer.getTileUrl = function(){
    				var ymin = Math.floor(171963.28965  - arguments[1] * window.map.getResolution() * 256);
    				var xmin = Math.floor(arguments[2] * window.map.getResolution() * 256 - 200);
    				var ymax = ymin + window.map.getResolution() * 256;
    				var xmax = xmin + window.map.getResolution() * 256;
    				console.log("x"+arguments[2]+":"+xmin + ",y"+arguments[1]+":" + ymin + ",z:"+arguments[0]+",res:"+window.map.getResolution());
    				getUrlOld.apply(layer,arguments||[])
    			};

 

转载于:https://my.oschina.net/LinBandit/blog/841788

你可能感兴趣的:(拦截arcgis js api中的瓦片加载事件)