I\'m trying to output a generated image using Play. I\'m not sure if my issue is Play-specific or not. I\'m trying to do the same thing this PHP code does:
There are a number of renderBinary methods, one of which simply takes a File as a parameter. See http://www.playframework.org/documentation/api/1.1/play/mvc/Controller.html#renderBinary(java.io.File)
So, your code needs to be as simple as
public static void map(String building_code, String ts_code) throws IOException {
renderBinary(new File("public/images/maps/" + building_code + "_" + ts_code.charAt(0)));
}