@Override public void initTileContext(Tile tile) { // 获取真正的出图层级,因为mapview的层级数是所有图层固定比例尺数组合并的长度 int index = getResolutionIndex(); if (index == -1) { return; } index += this.zOffset; int x = tile.getX(); int y = tile.getY(); int num = Math.abs((x + y) % 8);// tile0...7 String lt = getlayerType(); String proj = getProj(); // String result = "http://tile" + num + ".tianditu.com/DataServer?T=" + lt + "_" + proj + "&X=" + x + "&Y=" + y + "&L=" + index; String result = "http://t" + num + ".tianditu.com/DataServer?T=" + lt + "_" + proj + "&X=" + x + "&Y=" + y + "&L=" + index; // &X=0&Y=0&L=2 // String result = url + "&X=" + x + "&Y=" + y + "&L=" + index; // Log.d(LOG_TAG, "getTileURL:" + result); tile.setUrl(result); }
demo里哪来的tk?