| Förstasidan | E-post | Datorrelaterat |
This program is under development and not yet relased. This document is currently a mix of a documentation draft and my own to-do-list.
MyMapGps is an application for GPS-equipped Android devices. The purpose is to be able to use own scanned maps for navigation. (The background history is that I have some paper maps in scale 1:10000 that I would like to be able to use since they are much more detailed than the maps available for my Garmin GPS. So I decided that it would be really nice if I could get these maps into my phone.) Please read the section on map calibration - if you can not provide the needed data for your maps, then the current version of this application will not be useful for you!
The application is intended to be used with the users own image maps. There is no support for online maps etc.
Show current location and direction on map
Zoom and scroll within map
Move and rotate (optional) the map according to the users movement
Save waypoints
Show current location, height, speed, bearing and GPS accuracy.
The current version does not support tracks or routes.
Currently only supports metric units.
Predefined map projection settings for swedish map projections RT90 and SWEREF99. (Custom settings can be entered to use other map projections)
Automatically loads the last used map on application start.
New features will be added based on how much time I feel like spending on this project.
You will need an device with GPS support and Android 1.6 or newer. A minimum screen resulution of 320*480 is recommended. The application has been tested on a LG Optimus One P500 and a LG P990 Optimus 2X, both with Android 2.2. Some additional testing has been done with Android 1.6 in the emulator in the development environment.
The map must be stored in jpg or png format. Try to save the map with the lowest resolution and quality that still looks good. (I recommend to use a map smaller than four megapixels to prevent out-of-memory problems. In Android there is a memory limit for each application, so it is possible to run out of memory even if there is lot of RAM and few other applications running.) The following requirements must also be fullfilled:
The map projection for the map must be known. If it is not one of the predefined map projections you will also need to know the parameters for the map projection.
The scale (meters / pixel) must be known
The image must not be rotated, up on the image must be north according to the current map projection. (That is not quite the same as geographic north!)
The coordinates (according to current map projection) of the upper left corner of the map must be known.
If you want to use another map projection than the pre-defined you will also have to enter some parameters for your map projection:
Central meridian longitude
Central meridian scale factor
False northing
False easting
Note that the map projection parameters must be valid for WGS84, if you use parameters for older systems like Bessel1841 it will result in a mispositioned map. (GRS80 is close enough to WGS84, so that will work fine.)
I will probably add some alternative calibration methods in future versions. However I found that the current one gives a much better result than e.g. moving to a few points and use the GPS coordinates for those points as calibration data. (If your map have grid lines and you do some preparations in Gimp or Photoshop you can achieve a very good result. Otherwise you need to be aware that scanned paper maps will not be perfect. (Paper might shrink differently in different directions and your scanner might skew the image slightly)
It is important to be extremely careful when calibrating a map. Assume that you have a map over a 10*10 km area; that your base coordinates are 10 meters wrong; the map is rotated one degree and the scale is one percent wrong. These errors together might produce an error of up to 300 meters in the map.

The text at the top of the screen shows current information according to the user settings. (Sometimes it will also show map and GPS error information.)
The (scrollable) map will occupy the most of the screen. Your current location and moving direction is indicated by an arrow (if a location has been received from the GPS service and the location is within the map). Depending on your setting the map will either be oriented normally or rotate so that the direction you are moving in becomes up on the screen. The map will scroll automatically to match your movements.
If you have created any waypoint within the visible area they will be indicated with waypoint icons on the map.
Use the zoom buttons to zoom in and out. The center map will make your current location appear in the middle of the screen. If the location is not known or is outside the map then the map will be centered insted. This is useful if you "get lost" when you scroll around.
Use the menu button of your device when you need to change any preference, add a waypoint or switch to another map.



The following preferences can be changed:
Map rotation - Decides if the map will be rotated on screen depending on your current direction. (Default = rotation disabled.)
Minimum move before rotate - The minimum move in meters before a direction change is detected. If you set this to low with respect to the current GPS accuracy the map might rotate in a random way (if rotation is enabled). (Default = 10 meters.)
Custom waypoints directory. You can use your own waypoint icons by selecting a directory where you have put your own icons. (Use "long click" to select a directory when browsing, normal click opens the directory for further browsing.)
Update interval - Time in seconds between location updates. A low interval consumes more battery power. (Default = 10 seconds.)
Information field - Selects which information to show in the text field above the map.

To load and to be able to use a map the following data must be entered:
The image file name.
Map image scale in meters / pixel.
The X and Y map coordinates of the upper left corner of the map image according to the selected map projection. (Note that on maps the X axis is vertical and the Y axis is horizontal.)
The map projection for the map.
The "Browse button" can be used to browse to the wanted map image instead of entering the full path. It also has the advantage that when a previously used map is selected, other fields will be set to the previously used values automatically.

If your map does not use one of the pre-defined map projections you will need to click the "Manage button to add (or edit) a map projection.


You can add (or edit) waypoints. The defult position is the current (or last known) position.


There are 10 different waypoint categories with different icons available. You can specify your own images by specifying a custom waypoint directory in your settings. The application will then look for icons in that directory. (For any category where an icon is not found it will use the default icon.) The icon images must be named according to wpnnn_xx_yy.png, where nnn = category, xx = x insertion point and yy = y insertion point. For example wp000_34_74.png will be used as an icon for the first category (number 0). When it is drawn on the map, the icon will be positioned so that the pixel at x = 34, y = 74 will be placed on the waypoints position on the map.
Do not make your own icons larger than needed. (The icons will be rescaled anyway, so making an icon larger will not make it appear larger in the application.)
Questions, feature requests and bug reports can be sent to mymapgps@ronnyhagerman.com
If you find a bug, please try to provide as much information as possible, like:
What you were doing when the problem occured.
Does the problem occur every time.
Android version.
Phone model.
What map configuration data you have entered.
Map size (in pixels and bytes).
Some things that are currently not supported but that I am planning to add or eventually will add later are:
Support for multi-touch zoom.
Show waypoint information when a waypoint on the map is clicked.
Tracks.
Import / export of data. (Tracks etc. to GPS Exchange Format and complete backup of database.)
Trip measurement.
Average speed.
Show current scale on the screen.
Fix some issues in the user interface.
Possibility to automatically switch maps depending on current location.
Use Google maps or similar when the current location is not within a user map.
Support for non-metric units. (If I get some requests for that, otherwise probably not.)
Show satellite information.
Make it possible to select "geographic north", "magnetic north" or "map projection" for bearing.
Automatic swich of maps would be nice. Requires that maps are split into smaller images so at least four maps can be loaded at the same time without running out of memory. Also dynamically open and close maps in different resolutions depending on zoom level.
Sometimes there will be an out-of-memory exception when using to large maps.(Application memory limit = 16 MB typical, more on some devices. The testmap consumes ~8 of these.) A good fix for this also requires dynamic loading and unloading of smaller images.
Integrate with Google map. That would be really nice because there will always be a map even when outside the user-defined maps. It will also take care of the coordinate transformation calculations (simply use overlays for waypoints etc.). On the other hand it requires that the user-defined maps uses the same map projection as the google maps, is this projection documented somewhere? The projection changes depending on zoom level, so the map images must be generated dynamically. This might be a lot of work and the implementation is sensitive for changes in Google maps.
Have a look at performance issues, there are some calculations that can be moved from onDraw etc. Also do not load waypoints that are not visible. (Does not seem like a problem, but might become if the number of waypoints become very large.)
The layout of the information field needs to be improved.
Not possible to rename waypoint or map projections.
Default waypoint icons looks stretched.
Possible to scroll outside the map. (Use "Center" button if you get lost.)
When swithing on/off map rotation the current view might become outside the map. (Use "Center" button.)
The error messages for invalid input data is not very informative.
Decimal numbers shows as 0.123 even if it should be 0,123 according to the user national settings.
Screen orientation change is currently not supported.
Various minor issues, see "TODO" comments in code.
Make it possible to install to memory card.
Test with coordinates south of equator / west of Greenwich.
The application is written by Ronny Hägerman