Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMMapLauncher/CMMapLauncher.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ typedef NS_ENUM(NSUInteger, CMMapApp) {
CMMapAppTheTransitApp, // The Transit App
CMMapAppWaze, // Waze
CMMapAppYandex, // Yandex Navigator
CMMapAppTomTom, // TomTom
};

@interface CMMapLauncher : NSObject
Expand Down
7 changes: 7 additions & 0 deletions CMMapLauncher/CMMapLauncher.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ + (NSString *)urlPrefixForMapApp:(CMMapApp)mapApp {
case CMMapAppYandex:
return @"yandexnavi://";

case CMMapAppTomTom:
return @"tomtomhome://";

default:
return nil;
}
Expand Down Expand Up @@ -182,6 +185,10 @@ + (BOOL)launchMapApp:(CMMapApp)mapApp
url = [NSString stringWithFormat:@"yandexnavi://build_route_on_map?lat_to=%f&lon_to=%f&lat_from=%f&lon_from=%f", end.coordinate.latitude, end.coordinate.longitude, start.coordinate.latitude, start.coordinate.longitude];
}
return [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
} else if (mapApp == CMMapAppTomTom) {
NSString *url = nil;
url = [NSString stringWithFormat:@"tomtomhome:geo:action=navigateto&lat=%f&long=%f&name=%@", end.coordinate.latitude, end.coordinate.longitude, [end.name stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
return [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
}

return NO;
Expand Down