Skip to content

Instantly share code, notes, and snippets.

View franciscojma86's full-sized avatar

Francisco Magdaleno franciscojma86

View GitHub Profile
@franciscojma86
franciscojma86 / MKSnapshotter
Last active July 7, 2020 00:22
MKSnapshotter Implementation
#import "MyViewController.h"
#import <MapKit/MapKit.h>
@interface MyViewController ()
@property (weak, nonatomic) IBOutlet UIImageView *mapImageView;
@end
//helper method to get the rect in the map for an array of points
MKMapRect MapRectBoundingMapPoints(MKMapPoint points[], NSUInteger pointCount){
double minX = INFINITY, maxX = -INFINITY, minY = INFINITY, maxY = -INFINITY;
#import <Foundation/Foundation.h>
@class MapDirectionsHelper;
@protocol MapDirectionsHelperDelegate
@optional
-(void)mapDirectionsHelper:(MapDirectionsHelper *)sender didGetRoute:(MKRoute *)route;
-(void)mapDirectionsHelper:(MapDirectionsHelper *)sender didFailToGetRoute:(NSError *)error;
-(void)mapDirectionsHelper:(MapDirectionsHelper *)sender didGetRouteETA:(NSTimeInterval)eta;
-(void)mapDirectionsHelper:(MapDirectionsHelper *)sender didFailToGetRouteETA:(NSError *)error;