I'm possibly a bit out of my league here, but ready to get my hands dirty. I want to generate map tiles for a MGRS grid graticule similar to http://tiles.mapbox.com/mapbox/map/afghanistan-mgrs.
I need to create a function that takes a map boundary (probably something like two lat,lng pairs for the map corners) and the output image dimensions and returns an image. I'm looking at using Proj4 to convert map coordinates to pixel coordinates. I'm looking for some open source or starter code for calculating the MGRS grid lines. Most libraries I've seen are for translating a single coordinate which is fine for calculating the grid cell, but I'm not sure how to get the grid cell boundaries/plot the grid lines.
I'm looking at this for a mobile application so something in Java or C/Objective-C is my end goal.
Can someone give me a push in the right direction?
UPDATE
Refining my requirements a bit here...
I need to create a function that returns a 256x256 image given lat,lng boundary and zoom level. The zoom is a standard slippy map like zoom where the lowest zoom level is 1 which as 1 256x256 tile for the entire world and zoom level 2 has 4 tiles, and so on. For each tile and corresponding zoom level, I would like to draw the MGRS grid graticule boundaries and add a MGRS center label at the center of the MGRS grid cell.