}
} else {
// Now we should create tiles which are not exist
// Get tileInfo
TileInfo tileInfo = mapService.getMapServiceDesc()
.getTileInfo();
// Get tile create spread and span
int createSpread = tileInfo.getCreateSpread();
int rowMin = (row / createSpread) * createSpread;
int colMin = (col / createSpread) * createSpread;
// Mark these tiles are creating
for (int i = rowMin; i < rowMin + createSpread; i++) {
for (int j = colMin; j < colMin + createSpread; j++) {
monitor.setMapTileCreating(level, i, j);
}
}
String sr = mapService.getMapDesc().getWkid();
int width = tileInfo.getWidth();
int height = tileInfo.getHeight();
double originX = tileInfo.getOriginX();
double originY = tileInfo.getOriginY();
String format = tileInfo.getFormat();
// Get suffix by format
// Use png for default
String suffix = "png";
String lowFormat = format.toLowerCase();
if ("jpg".equals(lowFormat) || "jpeg".equals(lowFormat)) {
suffix = "jpg";
}
// Check if export format support transparent
boolean supportTransparent = false;
if ("png".equals(lowFormat)) {
supportTransparent = true;
}
// Calculate the spread tile bbox
TileLodInfo tileLodInfo = tileInfo.getTileLodInfo(level);
double resolution = tileLodInfo.getResolution();
double deltaX = width * resolution;
double deltaY = height * resolution;
double xmin = originX + deltaX * colMin;
double ymax = originY - deltaY * rowMin;