Aug
24
2008

Map downloading and packing utility for Map2X

IT

How to use utility map2x-dl for downloading and packing map tiles for Map2X application.

Utility works only with Map2X version 0.0.6, it's useless for newer versions, if you have older version, update.

Source is available for linux users, wget should be included in majority of linux distributions.

Downloaded archive extract into some directory. There will you find 5 files. Copy utility wget.exe into Windows directory, otherwise maps could not be downloaded.

Utility works very simple - in its directory finds file named map.conf, creates directories of map types and downloads map tiles into them. If you choose packing only, you have to supply corresponding directories with map tiles.

Before creating new map always delete everything in program's directory, except those 5 files. It avoids mixing the new map with another else.

Step one: Creating a map

Creating a new map

If you want to create a new map, create map.conf file according to tutorial for map server of your choice and save it to map2x-dl utility. Now run BAT file Download and pack.bat or Download.bat, if you want to pack map tiles later.

Packing already downloaded map

If you want to pack alerady existing map, copy its map.conf file and directories with map tiles to map2x-dlutility. Afterwards run Pack.bat file.

Step two: Copying map to Map2X app

Copying packed map

If you have chosen packing in step one, form directories with map tiles you will need only files with .map extension, you can safely delete the rest. Now create new directory in maps/ directory in Map2X application (to avoid errors, don't use spaces and non-ASCII characters) and copy there directories with packed tiles and map.conf file.

Structure of files in maps/ directory will then look like this:

[maps]
    [package_name]
        [type]
            10.map
            11.map
            12.map
            ...
        [another_type]
            10.map
            11.map
            12.map
            ...
        map.conf
    ...

Copying not packed map

If you don't have packed map and you want to use it, proceed in the same way like above, but copy entire directories with map tiles, don't delete anything..

Structure of files in maps/ directory will look like this:

[maps]
    [package_name]
        [type]
            ...load of
            ...files
            ...
        [another_type]
            ...load of
            ...files
            ...
        map.conf
    ...

Solving problems

Utility will notice if most common errors were found in map.conf file, like badly written coordinates, zoom out of range or missing parameters. If other problems appears or Map2X application won't load the map package, please write a comment down here or notice me on e-mail / jabber.

» Add comment

Discussion: 2 comments

» Reply 25.10.2008 19:07 | Adam K. | web | .map file format?
Hello,

This app looks really cool. Thanks! I hope you have time to resolve the Google format change issue. What is the format of the .map file? Is it an image of some sort? Or multiple zoom level images packed together? If it's straightforward, I was thinking of trying to roll my own for some maps I want.

Thanks again,

-Adam K.
» Reply 30.10.2008 22:11 | Vladimír Vondruš | web | MAP format
I have detailed technical description of this format here, but only in Czech: http://archerfx.cz/...ctu-mapovych-souboru-v-map2x (maybe Google Translate helps this time). I have absolutely no time to work on Map2X, I'm working hard on redesigning web pages of our town and it consumes all my time.

So when I find some free time to play with Map2X, I'll fix the Google issue, translate that article above to English and release a new version. Version without any new features like virtual keyboard, Points of Interest, OpenStreetMap support, only the fix for Google.

Google maps could be now "hacked" into Map2X with some changes of URLs in 'list.lst' files generated by map2x-dl:
- replacing 'zoom=' with 'z='
- reverting the zoom number (0->16, 1->15, 2->14 and so on)

Then downloading the tiles with wget:
wget -nc -i list.lst

Then renaming the files back (Total Commander might help a lot):
- replace 'z=' with 'zoom='
- revert the zoom number back

...and pack the tiles with map2x-dl. But I don't guarantee the fixed version will read this map correctly.