//设置3D图层 tileLayer = new BMap.TileLayer({isTransparentPng: true}); tileLayer.getTilesUrl = function(tileCoord, zoom) { if(zoom==19) { //alert('您好!你是非vip会员,不能查看大图!'); //map.setZoom(18); var x = tileCoord.x-103632; var y = 34183-tileCoord.y; } else if(zoom==18) { var x = tileCoord.x-51816; var y = 17091-tileCoord.y; } else if(zoom==17) { var x = tileCoord.x-25908; var y = 8545-tileCoord.y; } else if(zoom==16) { var x = tileCoord.x-12954; var y = 4272-tileCoord.y; } var url= '/statics/mapdata/tiles/' + zoom + '/' + x + ',' + y + '.png'; //异步检测是否存在图片文件 var xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); xmlhttp.open("GET",url,false); xmlhttp.send(); if(xmlhttp.readyState==4){ if(xmlhttp.status==200) return url; else if(xmlhttp.status==404) return '/statics/mapdata/tiles/error.png'; } }