iOS Map

Stevetheipad

  • Posts: 1301
Has anyone worked with a real-world map on mobile? Maybe an iOS map or Google maps?


How would I go about implementing this into my app? I want to show a map of a particular location with a line showing a path and a dot for a "you are here".

mat0pad

  • Posts: 364
For making a path it's very tricky and would probably not be possible without Xcode or just open native map app with scheme. But showing a map can be done  with an extension.

First of you'll need the map kit framework so that should be included in the dependency tag in the .nmml file.

Then the meat of the native iOS could be something like:
Code: [Select]
#import <UIKit/UIKit.h>
#import <MapKit/MapKit.h>

@interface MapSampleViewController : UIViewController
    <MKMapViewDelegate>

- (void)viewDidLoad
{
    [super viewDidLoad];
    _mapView.showsUserLocation = YES;
   
}

^ you show a map with current location
   


                              

Stevetheipad

  • Posts: 1301
For making a path it's very tricky and would probably not be possible without Xcode or just open native map app with scheme. But showing a map can be done  with an extension.

First of you'll need the map kit framework so that should be included in the dependency tag in the .nmml file.

Then the meat of the native iOS could be something like:
Code: [Select]
#import <UIKit/UIKit.h>
#import <MapKit/MapKit.h>

@interface MapSampleViewController : UIViewController
    <MKMapViewDelegate>

- (void)viewDidLoad
{
    [super viewDidLoad];
    _mapView.showsUserLocation = YES;
   
}

^ you show a map with current location

Thanks for the reply!

Looks like I'll be refreshing my Xcode knowledge and building this app with it.