first and foremost I would like to thank you for a great piece of
software. We are a small software company based in Frankfurt, Germany
named SharpMind (www.sharpmind.de) and have tried to build something
similar for an offline map application for the iPhone but without the
route-me code it would have taken us much much longer to complete the
app. Thank you guys. :)
Here is what we have done:
In order to build the offline map application we are storing the map
tiles in an sqlite database and index the tiles using the RMTileKey()
function. The map meta data like the supported zoom levels, the
coverage area and the attribution information is stored as name/value
pairs in a separate table. The database layout is very simple and the
application is still zippy on the iPhone and iPod touch.
For best performance it makes sense to disable the internal route-me
database cache as all tiles are already stored in a database. I have
accomplished this using a routeme.plist file.
The code consists of a custom tile source (RMDBTileSource) and a new
tile image (RMDBTileImage). I've attached a patch to the current 0.5
stable release but also have a working patch for the current trunk
available if there is a need. The RMDBTileSource.m file contains the
documentation of the database layout and the name/value pairs for the
meta data.
To get started you need to create an sqlite db with the two tables
(preferences and tiles) and store the tile images as blobs in the
tiles table and index them with the RMTileKey() function. Then add the
minimun and maximum zoom level as well as the tile size to the
preference table and you're done.
Then take the SimpleMap example and change the viewDidLoad method as
follows
- (void)viewDidLoad {
[super viewDidLoad];
...
RMDBMapSource* dbTilesource = [[[RMDBMapSource alloc]
initWithPath:@"path-to-sqlite-file"] autorelease];
[[[RMMapContents alloc] initWithView:mapView tilesource:dbTilesource]
autorelease];
...
}
That's it!
I hope our code is as useful to you as yours was to us. :)
In addition we're open for development projects and paid work for the
iPhone, Android and Symbian and if you would like to know more about
us you can visit our website at www.sharpmind.de.
Frank Schröder
I've attached the routeme.plist file which you can add to your project
to disable the db caching. Then only the memory cache is active.
The reason I went for an sqlite approach is that we have something
like 70.000 tiles in the database which - at least to me - seem to
many to keep in the file system. There is overhead with each file so
keeping them all in a single sqlite file reduces the size on the disk
dramatically. I have reductions between 30% (310MB vs. 215MB) and 50%
(673MB vs. 275MB). The DB approach also allows for a simple update of
the entire map. Just update the file and you're done. So its mostly
for packaging and management reasons. At the same time it allows us to
store other information in that same database at the same time.
I hope that answers your question.
Frank
Hal
Sent from iPhone, please pardon terseness.
On Jun 28, 2009, at 3:23, Frank Schröder <frank.s...@gmail.com>
wrote:
I've uploaded the patch into the "Files" section under the name route-
me-trunk-db-tilesource-2009-06-28.patch. It is based on the trunk code
from 22 Jun 2009.
Frank
On 28.06.2009, at 17:47, Hal Mueller wrote:
>
> Frank: please post or send the patch for the trunk too.
>
> Hal
>
--
Frank Schröder
frank.s...@gmail.com
working on iPhone osm maps app (Route me).well initialising and downloading online maps was easy but real problem lies in saving the tiles through the code while u are online and reuse them while you are offline.i checked blogs regarding the same but everyone is saving the images externally and importing it in project and then showing them,which is not my requirement.please help me to save the tile image route me picks from online source
here is how i am using online route me maps
-(void) viewDidLoad
{
[RMMapView class];
mapView.contents.tileSource = [[RMOpenStreetMapSource alloc] init];
currentMarker = [[RMMarker alloc]initWithUIImage:[UIImage imageNamed:@"radarLocatorLite.png"] anchorPoint:CGPointMake(0.5, 0.5)];
markerManager = [mapView markerManager];
locationManager.delegate=self;
locationManager.desiredAccuracy = kCLLocationAccuracyBest ;
locationManager.distanceFilter =0;
[mapView.contents setZoom:17.0f];
[markerManager addMarker:currentMarker AtLatLong:currentLocation.coordinate];
[self initCompassView];
[locationManager startUpdatingLocation];
[locationManager startUpdatingHeading];
}
-(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
currentLocation =newLocation;
[mapView moveToLatLong:newLocation.coordinate];
[markerManager moveMarker:currentMarker AtLatLon: newLocation.coordinate];
[currentRoutePath addLineToLatLong:newLocation.coordinate];
[[mapView.contents overlay] addSublayer:currentRoutePath];
// NSLog(@"i reached inside location update%f",currentRoutePath.lineWidth);
working on iPhone osm maps app (Route me).well initialising and downloading online maps was easy but real problem lies in saving the tiles through the code while u are online and reuse them while you are offline.i checked blogs regarding the same but everyone is saving the images externally and importing it in project and then showing them,which is not my requirement.please help me to save the tile image route me picks from online source
--
You received this message because you are subscribed to the Google Groups "route-me" group.
To unsubscribe from this group and stop receiving emails from it, send an email to route-me-map...@googlegroups.com.
To post to this group, send email to route-...@googlegroups.com.
Visit this group at http://groups.google.com/group/route-me-map.
For more options, visit https://groups.google.com/groups/opt_out.