Reputation: 4237
From iPhone app I developing right now, I want to be able to launch external Yandex Maps app (if it installed on the device, of cause), with destination geo location as a parameter.
Is it possible to do and how?
EDIT: Also, how I can know whether Yandex Maps app installed on device?
Thanks!
Upvotes: 0
Views: 1508
Reputation: 186
This must work.
if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"yandexmaps://test"]])
{
CLLocationCoordinate2D location; // Any location
NSString *yaMapsString = [NSString stringWithFormat:@"yandexmaps://maps.yandex.ru/?pt=%f,%f&ll=%f,%f", location.longitude, location.latitude, location.longitude, location.latitude];
NSURL *yamapsUrl = [NSURL URLWithString:yaMapsString];
[[UIApplication sharedApplication] openURL:yamapsUrl];
}
Upvotes: 0
Reputation: 10313
Try these schemes
yandexmaps://maps.yandex.ru/?ll=37.5959049,55.7390474&z=12
yandexmaps://maps.yandex.ru/?pt=37.5959049,55.7390474
ll
- map center, pt
- pin location
Upvotes: 2