diff --git a/api/iOS/src/MapsWithMeAPI.h b/api/iOS/src/MapsWithMeAPI.h index 3a111c80ef..f11b3a07f6 100644 --- a/api/iOS/src/MapsWithMeAPI.h +++ b/api/iOS/src/MapsWithMeAPI.h @@ -55,6 +55,8 @@ + (MWMPin *) pinFromUrl:(NSURL *)url; // returns NO if MapsWithMe is not installed or outdated version doesn't support API calls + (BOOL) isApiSupported; +// Simply opens MapsWithMe app ++ (BOOL) showMap; // Displays given point on a map, title and id are optional // If id contains valid url, it will be opened from MapsWithMe after selecting "More Details..." for the pin + (BOOL) showLat:(double)lat lon:(double)lon title:(NSString *)optionalTitle id:(NSString *)optionalId; diff --git a/api/iOS/src/MapsWithMeAPI.m b/api/iOS/src/MapsWithMeAPI.m index 8058654301..5bbe4e6b2f 100644 --- a/api/iOS/src/MapsWithMeAPI.m +++ b/api/iOS/src/MapsWithMeAPI.m @@ -127,6 +127,11 @@ static NSString * MWMUrlScheme = @"mapswithme://"; return [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:MWMUrlScheme]]; } ++ (BOOL) showMap +{ + return [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[MWMUrlScheme stringByAppendingFormat:@"map?v=%d", MAPSWITHME_API_VERSION]]]; +} + + (BOOL) showLat:(double)lat lon:(double)lon title:(NSString *)optionalTitle id:(NSString *)optionalId { MWMPin * pin = [[[MWMPin alloc] initWithLat:lat lon:lon title:optionalTitle id:optionalId] autorelease];