Fixed back urls for different guides - they will be taken automatically from plist for each guide

This commit is contained in:
Alexander Zolotarev 2013-09-26 20:20:38 +03:00
parent 7946212ea5
commit d61a2194cd
3 changed files with 8 additions and 2 deletions

View file

@ -16,7 +16,8 @@ from strip_function import *
def insertMapLink(soup, lat, lon, title, pageId):
hrefLink = "mapswithme://map?v=1&ll=%s,%s&n=%s&id=%s&backurl=guideswithme&appname=Guide%%20With%%20Me" % (lat, lon, urllib.quote(title), pageId)
# backurl and appname are automatically added in iOS code
hrefLink = "mapswithme://map?v=1&ll=%s,%s&n=%s&id=%s" % (lat, lon, urllib.quote(title), pageId)
mapTag = BeautifulSoup().new_tag("a", href=hrefLink)
mapTag["class"] = "geolink"
soup.body.insert(0, mapTag)

View file

@ -213,8 +213,11 @@ shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherG
if (0 != [str rangeOfString:@"mapswithme" options:NSCaseInsensitiveSearch].location)
return NO;
NSString * newUrl = [str stringByAppendingFormat:@"&backurl=%@&appname=%@",
[MWMApi detectBackUrlScheme],
[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"]];
if ([MWMApi isApiSupported])
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:newUrl]];
else
[MWMApi showMapsWithMeIsNotInstalledDialog];
return YES;

View file

@ -69,4 +69,6 @@
// Set value = YES if you want to open pin URL on balloon click, default value is NO
+(void) setOpenUrlOnBalloonClick:(BOOL)value;
+ (NSString *) detectBackUrlScheme;
@end