Inherits from UIViewController
Declared in SCLocationViewerController.h

Overview

Presents the standard C2Call SDK Location Viewer Controller.

Properties

addressLabel

Address Label.

@property (nonatomic, weak) IBOutlet UILabel *addressLabel

Declared In

SCLocationViewerController.h

addressTitle

Address Title.

@property (nonatomic, weak) IBOutlet UILabel *addressTitle

Declared In

SCLocationViewerController.h

addressView

View containing addressTitle; see addressLabel.

@property (nonatomic, weak) IBOutlet UIView *addressView

Discussion

Can be hidden on touch.

Declared In

SCLocationViewerController.h

mapView

MapView; see MKMapView.

@property (nonatomic, weak) IBOutlet MKMapView *mapView

Declared In

SCLocationViewerController.h

Instance Methods

changeMapType:

Changes the MapType; expects an UISegmentedControl as sender.

- (IBAction)changeMapType:(id)sender

Parameters

sender
  • The initiator of the action

Discussion

Default Implementation: switch (sender.selectedSegmentIndex) { case 0: self.mapView.mapType = MKMapTypeStandard; break; case 1: self.mapView.mapType = MKMapTypeSatellite; break; case 2: self.mapView.mapType = MKMapTypeHybrid; break; }

Declared In

SCLocationViewerController.h

focusMap:

Focuses the map region to show your current position and the provided location.

- (IBAction)focusMap:(id)sender

Parameters

sender
  • The initiator of the action

Declared In

SCLocationViewerController.h

openMenu:

Shows the default content menu using SCPopupMenu.

- (IBAction)openMenu:(id)sender

Parameters

sender
  • The initiator of the action

Discussion

Default Implementation:

 SCPopupMenu *cv = [SCPopupMenu popupMenu:self];

NSString *url = nil;
if (self.location.place) {
    url = [self.location.place objectForKey:@"url"];
}

if (self.currentLocation && self.location) {
    [cv addChoiceWithName:NSLocalizedString(@"Show Route", @"Choice Title") andSubTitle:NSLocalizedString(@"Show Route Information in Google Maps", @"Button") andIcon:[UIImage imageNamed:@"ico_navigate"] andCompletion:^{
        NSString *url = @"http://maps.google.com/maps?daddr=%f,%f&saddr=%f,%f";
        url = [NSString stringWithFormat:url, location.locationCoordinate.latitude, location.locationCoordinate.longitude, self.currentLocation.coordinate.latitude, self.currentLocation.coordinate.longitude];

        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
    }];

    if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"navigon://"]]) {
        [cv addChoiceWithName:NSLocalizedString(@"Navigon Mobile Navigator", @"Choice Title") andSubTitle:NSLocalizedString(@"Launch Navigon", @"Button") andIcon:[UIImage imageNamed:@"ico_launch_navigon"] andCompletion:^{
            NSString *url = @"coordinate/%@/%.6f/%.6f";

            NSString *name = self.navigationItem.title;
            if (self.location.place) {
                name = [self.location.place objectForKey:@"name"];
            }
            url = [NSString stringWithFormat:url, name, location.locationCoordinate.longitude, location.locationCoordinate.latitude];
            url = [url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
            url = [NSString stringWithFormat:@"navigon://%@", url];
            DLog(@"openUrl : %@", url);
            [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
        }];
    }

    if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"tomtomhome://"]]) {
        [cv addChoiceWithName:NSLocalizedString(@"TomTom Navigation", @"Choice Title") andSubTitle:NSLocalizedString(@"Launch TomTom", @"Button") andIcon:[UIImage imageNamed:@"ico_launch_tomtom"] andCompletion:^{
            NSString *url = @"tomtomhome://geo:action=show&lat=%.8f&long=%.8f&name=%@";
            NSString *name = self.navigationItem.title;

            if (self.location.place) {
                name = [self.location.place objectForKey:@"name"];
            }

            name = [name stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
            url = [NSString stringWithFormat:url, location.locationCoordinate.latitude, location.locationCoordinate.longitude, name];

            [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
        }];
    }

    if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"com.sygic.aura://"]]) {
        [cv addChoiceWithName:NSLocalizedString(@"Sygic GPS", @"Choice Title") andSubTitle:NSLocalizedString(@"Launch Sygic GPS", @"Button") andIcon:[UIImage imageNamed:@"ico_navigate"] andCompletion:^{
            NSString *url = @"com.sygic.aura://lat=%.6f?lon=%.6f?type=drive";
            url = [NSString stringWithFormat:url, location.locationCoordinate.latitude, location.locationCoordinate.longitude];

            [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
        }];
    }
}


if (url) {
    [cv addChoiceWithName:NSLocalizedString(@"Open Url", @"Choice Title") andSubTitle:NSLocalizedString(@"Open places details", @"Button") andIcon:[UIImage imageNamed:@"ico_open_url"] andCompletion:^{

        [self openBrowserWithUrl:url andTitle:self.location.title];
    }];
}

[cv addCancelWithName:NSLocalizedString(@"Cancel", @"Button") andCompletion:^{}];

[cv showMenu];

Declared In

SCLocationViewerController.h

setLocationForKey:andUser:

Sets the Location to present.

- (void)setLocationForKey:(id)key andUser:(id)user

Parameters

key
  • Rich Media Key for the location
user
  • Name of the user belonging to that location

Declared In

SCLocationViewerController.h