2

'route-me' is an iPhone map engine and I want to add my own map source to it. I've got all the map images on my server but I dont know how to add the map source? Any one could help?

3 Answers 3

4

There seems to be two ways to do this:

First, from the documentation:

If you have your own maps, you can use Mapnik as a framework and OpenStreetMap as your host. You can then point to your map with the RMOpenStreetMapsSource class to specify the URL.

Alternatively,

You can use an app for route-this called SimpleMap along with an extension called Map2sqlite. This allows you to use a class caled RMDBTileSource and point to a sqlite DB file of your maps as the source. I found this tidbit on a google groups article covering this topic.

4

google maps in route-me example:

in RegionGmapTile.h

#import <Foundation/Foundation.h>
#import "RMAbstractMercatorWebSource.h"

@interface RegionGmapTile : RMAbstractMercatorWebSource 
{    
}

@end

in RegionGmapTile.m

#import "RegionGmapTile.h"


@implementation RegionGmapTile

-(NSString*) tileURL: (RMTile) tile
{


    NSString* url = [NSString stringWithFormat:@"http://mt0.google.com/vt/lyrs=m@127&x=%d&y=%d&z=%d",tile.x, tile.y,tile.zoom];
    return url;
} 

-(NSString*) uniqueTilecacheKey
{
    return @"NLSHistoricMap";
} 

-(NSString *)shortName
{
    return @"NLS Historic Map";
}
-(NSString *)longDescription
{
    return @"NLS Historic Map Test";
}
-(NSString *)shortAttribution
{
    return @"Google maps";
}
-(NSString *)longAttribution
{
    return @"Google maps";
} 


@end

somwehere in your route-me

[[RMMapContents alloc] initForView:mvMap];

mvMap.contents.tileSource = [[RegionGmapTile alloc] init];

and google maps are shown without any key

2

So, code below should get the job done?

id <RMTileSource> tileSource;
NSURL *mapURL = [NSURL URLWithString:@"myOSM_URL"];
tileSource = [[[RMOpenStreetMapSource alloc] initWithURL:mapURL] autorelease];

Doing this results with error:

-[RMOpenStreetMapSource initWithURL:]: unrecognized selector sent to instance 0x5b0c310

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.