Kosmos/Kosmos And MGMaps
Since Kosmos v2.2 it is possible to generate map tiles that can be used in Mobile GMaps (MGMaps) Java Midlet (J2ME) mapping application on mobile phones. MGMaps is a free application for showing Web maps from various sources (OpenStreetMap, Yahoo, MSN and more). The default behavior is to download map tiles on demand, but the user can also download them manually and store them in the phone’s memory.
The basic steps of showing your own Kosmos maps on MGMaps are:
- Prepare a Kosmos project with the map data you need.
- Generate map tiles.
- Upload them to your phone.
- Set MGMaps to use your maps.
- That's it!
MGMaps already provides access to Osmarender and Mapnik map tiles, but they either have to be downloaded on demand (thus using the mobile network which can be expensive and slow) or by mass-downloading map tiles using 3rd party software.
On the other hand the method described on this page has several advantages:
- You have all your maps stored on directly your phone, so no mobile network is needed to access them.
- You do not overload OSM servers by mass-downloading tiles.
- It provides a way to have maps customized to your needs on your phone to help you with the navigation (MGMaps can connect to a GPS receiver) - I personally use it when hiking, since it allows me to display relief contours and more hiking-oriented map features.
However, be aware that map tiles can use up a lot of disk/card space on your phone. So it's advisable to map only the areas you need. You can also limit how many zoom levels to map - each zoom level takes around 4 times as much space as the level before it.
Step 1: Preparing The Map
You can prepare the map by running the Kosmos GUI, adding/downloading the OSM data, optionally generating additional features like relief contours, shaded reliefs and Web maps and saving the whole project on the disk. You can also define your own rendering rules or use any of the existing ones. See Kosmos main page for more info.
For the purpose of this short manual, we will use the "Isle of Wight" sample map provided in the Kosmos ZIP file.
Step 2: Generating Map Tiles
Go to the Kosmos\Console subdirectory and enter the following text in the command line:
Kosmos.Console.exe tilegen "..\Samples\Isle of Wight\Isle of Wight.kpr" 50.5 -1.75 51 -1 0 15 -mgm tiles Osmarender
This command will generate MGMaps tiles for the sample project, from the zoom level 0 to the zoom level 15. The tiles will be stored in the tiles subdirectory. They will act as if they were mass-downloaded from the Osmarender map server (since MGMaps currently does not have a Kosmos map type we could use).
Step 3: Transferring Tiles To The Phone
NOTE: The procedure described here works for my SonyEricsson P1i mobile phone, but it should be similar with other phones. If you have any problems please visit the MGMaps forum.
Connect the phone to your computer. Copy the files from the tiles directory on your computer to somewhere on your phone (I copied it to phone's memory stick, under the Documents directory).
Step 4: Setting Up MGMaps
- Start the MGMaps application on your phone.
- Go to the MGMaps Menu.
- Choose Settings.
- Choose Map Types and make sure Osmarender map type is turned on.
- Save and then choose Map Browsing.
- Check Stored Maps and Offline Mode options.
- Set the Storage Path to the path of your copied tiles. You have to point to the inner tiles/MGMapsCache directory.
- Save the settings. You will probably need restart the MGMaps application.
- After returning to the application's map view, select the Osmarender map type and move to the Isle Of Wight.
- You should be able to see the Kosmos map!