Google maps grid lines

broken image

The colour and the font size can easily be changed, see definitions at the top of the code block. Grid lines are annotated at the top, bottom, left and right of the viewable area using 12pt san-serif font.

broken image

The code will display one of the following grid sizes depending on the current zoom level : 100m, 1km, 10km, 100km or the MGRS zone. These tiles come in different zoom sets from zoom 0 displaying the whole world in one tile, through to zoom 19 displaying the whole world in 2**19 tiles. If you cannot or do not want to use the leaflet plugin, the following javascript code will draw blue MGRS grid lines on a HTML canvas context which it is assumed already contains a map rendered using slippy map tiles, for example OpenStreetMap.

broken image