User:Idun Midgardsormr/sandbox/Ideas

Ideas Scratchpad
No code here, just somewhere to jot down ideas as I get them!

Area hilite for maps
Many in-game and site references refer to maps and give a grid square (or a series of grids) such as D-5 or L-4 - M-6. The idea here is to provide a way of presenting a map which would hilite these squares without obscuring the detail in them.

Given that:
 * All maps are the same size and have the same coordinates
 * All map coordinates follow the same pattern, with 15 letters (A-O) across the top and 15 numbers (1-15) down the side
 * The border where the letters and numbers are given is a constant size relative to the size of the map
 * Standard map size is 501x501px, and maximum normally displayable is 2x this size

Steps:
 * Calculate the offset for the top left corner of each of the 225 possible squares (15x15) and assign each a code (A1 thru O15)
 * Create a transparent shaded image which can be overlayed on a single square at the maximum resolution
 * Create a template to display the requested map at a requested size
 * Create a sub-template which will accept the map scale and up to 225 coordinates as parameters and will return the code to overlay the scaled transparency on those squares not specifically listed. For coding purposes, it will be necessary to do this in a single pass since template recursion is limited.
 * Optional: The sub-template should accept a range of values if possible within the coding functionality

Objective:
 * Display the requested map, at the requested scale, and "shade" the non-required areas of the map leaving the specified areas "clean" and therefore make them stand out from the rest.
 * Leave the border area of the map "clean" so that the coordinates can be easily read
 * Permit this map to be used in conjunction with Template:Zone Map so that labels or links can be applied
 * Allow for calling an imagemap-type sub-template to apply labels or links to areas

See also:
 * The chessboard layout at http://en.wikipedia.org/wiki/Template:Chess_diagram shows an 8x8 square in which the colors are flipped on alternate squares giving a standard chessboard layout. This modified version would use a similar technique by either overlaying the image or not as specified in the calling code.