# Map This!/Old version

The application supports map tiles compatible with Google Maps' grid (see below for acquisition options).

## Tips & tricks

Here is a few things, not mention in the original README file:
* you can generate maps with negative zoom value with some services, but check the preview to make sure the data is available for your area first.
* you can delete some zoom levels to save space by deleting Nx folders inside your map's folder. You cannot wipeout the 1x (base) zoom folder though.
* Negative zoom works (except for Google Map - which only goes down to 0). In my experience, Google Satellite goes to -3 (to -4 in Vegas), all Local.Live maps go to -2.
* The Google Maps Download.exe will work on its own(icons and resources folders and config.txt should be in the same directory) (just compile a release version which will be marginally faster, or copy the one out of bin/Debug). I will not release "just the exe" since I think it's important for people to have the source and not just run some random application.

# Ready Made Maps

http://www.mediafire.com/?6nlknldk5lj Star Maps - with lat/lon
http://www.mediafire.com/?emnubmdmmyn Subways (New York, London, Moscow, and Toronto) - no lat/lon
http://unlockpsp.net/failai/mapViewer.rar - Lithuanian maps (with mapViewer program)
http://www.in7ane.com/psp/maps_usgs_parks/ USGS topographic maps of US parks
http://www.in7ane.com/psp/maps_various/ Various maps aligned and rendered with MapCruncher
http://www.in7ane.com/psp/maps_russian_topo/ topomaps.ru / topomaps.eu topographic maps aligned and rendered with MapCruncher
http://www.in7ane.com/psp/maps_toporama_canadian_parks/ atlas.nrcan.gc.ca topographic maps of Canadian parks rendered with MapCruncher

# Ready Made POI Files

http://www.dcemu.co.uk/vbulletin/showthread.php?t=33362 UK Speed Cameras (to be rehosted)

# GPSFS

This has not yet been finalized or made it into a release version of Map This!, so just here for reference.
Credit goes to Juanito, who created the original FS draft, thanks.

## Header

48 bytes, all Int64's are signed
| Format | Value | Description |
| char[8] | GPSFSV01 | |
| Int64 | x | from coords.txt |
| Int64 | y | from coords.txt |
| Int64 | basezoom | from coords.txt |
| Int64 | filetype | 0 = png, 1 = jpg |
| Int64 | maxsize | (N) number of tiles (including missing) |
Note: if x and/or y are negative it is interpreted as coords.txt is missing

## Pointers

8 * (N + 1) bytes, all Int64's are signed
| Format | Value | Description |
| Int64 | IDX0 | points (including header byte (48) offset) to first image |
| Int64 | IDX1 | points (including header byte (48) offset) to second image |
| Int64 | IDXN-1 | points (including header byte (48) offset) to last (Nth) image |
| Int64 | IDXN | points to GPSFSOEF marker |
Note from Pontomedon: in maps created with the GMDL (Global Map Download Tool) by in7ane (http://www.in7ane.com/psp/) IDXN actually doesn't point to the GPSFSEOF marker, but instead contains the negative size of the last image (As if there was a (missing) (N+1)th image)

## Notes:

* Number of IDX entries is always fixed and equals to the max number of tiles for given map size.
* This way any IDXn entry is completely defined as offset from the beginning of the file.
* The IDX section cover the most distant zoom tiles first. Here is the example:
IDX0->4x000000
IDX1->4x000001
IDX.->4x015014
IDX.->4x015015 <last tile at this level>
IDX.->1x0000000
IDX.->1x0000001
Note from Pontomedon: This example is a bit confusing, since IDX0 actually points to 1x000000 which is the top left tile in the "most-zoomed-in" zoom-level.
The example should be like: A map with 4 levels (1x, 2x, 4x, 8x) (340 tiles)
IDX0->1x000000
IDX1->1x000001
IDX16->1x001000
IDX17->1x001001
IDX254->1x015014
IDX255->1x015015 <last tile at level 1x>
IDX256->2x000000 <first tile at level 2x>
IDX319->2x007007 <last tile at level 2x>
IDX320->4x000000 <fist tile at level 4x>
IDX335->4x003003 <last tile at level 4x>
IDX336->8x000000 <fist tile at level 8x>
IDX339->8x001001 <last tile at level 8x>
IDX340->GPSFSEOF
* IDX offsets are relative to the beginning of the map file: IDX0 = [00100000] means that the PNG0 starts 100000 bytes from the beginning of the file.
* If a tile is omitted - the corresponding index has a negative number. The absolute value of this entry should be equal to the file size of previous entry. Example:
IDX0 00010000 non-empty PNG 1K size
IDX1 00011000 non-empty PNG 3K size
IDX2 -0003000 empty file
IDX3 -0003000 empty file - don't really care what value is as long as it's negative
IDX4 00014000 non-empty file - size is determined by next index entry

## 5 File Span Change

Changes from the previous format:
There are now 5 files (GPSFS, GPSFS1, GPSFS2, GPSFS3, and GPSFS4) - at this stage latter ones will be missing for a 4 tile map (this may cause problems in Map This! - test).
The IDX fields have been split into IDXfile and IDXidx both being int32's (other numerics stay int64) IDXfile is 0 to 4 IDXidx has the same logic as before EXCEPT it resets to 0 for each new file - so (1) if the next IDX is 0 use file.length instead (2) if you were using idx > 0 to identify existing tiles that needs to be >= 0 now (yes, took me ages to find in my own code).