SlideShare a Scribd company logo
1 of 100
Download to read offline
MapKit
Carnet de route
François Pignon
Comptable au Ministère des Finances
Jeudi Confession
 Mode Thèmes iDVD activé
Infinite Loop - Cupertino
Yerba Buena Garden - San Francisco
Le Sequoia
 C’est quoi ?
Hauteur : 115,61 m
                             Périmètre(1) : 47 m
                                  Poids : 2 100 t




(1) Mesuré à 1,2 m du sol.
4 033
?
MapKit Framework
Afficher une carte
www.psdgraphics.com
MapKit Framework
MapKit Framework
+   MapKit.framework
+   CoreLocation.framework
Types de carte
MKMapTypeStandard   MKMapTypeSatellite   MKMapTypeHybrid
MKMapTypeStandard    3
MKMapTypeSatellite
MKMapTypeHybrid
#import <UIKit/UIKit.h>
#import <MapKit/MapKit.h>

@interface STSViewController : UIViewController

@end
#import "STSViewController.h"

@interface STSViewController ()
{
  IBOutlet MKMapView *_mapView;
}

@end

@implementation STSViewController

- (void)viewDidLoad {
   [super viewDidLoad];

    [_mapView setMapType:3];
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
   return YES;
}

@end
Simulateur
Appareil
Simulateur


#if TARGET_IPHONE_SIMULATOR


  [_mapView setMapType:MKMapTypeHybrid];


#else


  [_mapView setMapType:3];


#endif


                                            Appareil
Se souvenir de la
dernière position
@property (nonatomic) MKCoordinateRegion region;
- (void)setRegion:(MKCoordinateRegion)region animated:(BOOL)animated;


@property (nonatomic) MKMapRect visibleMapRect;
- (void)setVisibleMapRect:(MKMapRect)mapRect animated:(BOOL)animate;

@protocol MKMapViewDelegate <NSObject>
@optional

- (void)mapView:(MKMapView *)mapView regionDidChangeAnimated:
(BOOL)animated;
#import <UIKit/UIKit.h>
#import <MapKit/MapKit.h>

@interface STSViewController : UIViewController <MKMapViewDelegate>

@end
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{…}

#pragma mark -

- (void)delayedSaveVisibleMapRect {
   MKMapRect tVisibleMapRect=_mapView.visibleMapRect;
   NSString *tString=[NSString stringWithFormat:@"%g|%g|%g|%g",tVisibleMapRect.origin.x,
               tVisibleMapRect.origin.y,
               tVisibleMapRect.size.width,
               tVisibleMapRect.size.height];

    [[NSUserDefaults standardUserDefaults] setObject:tString forKey:STSLastVisibleMapRect];
}

#pragma mark - MKMapView delegate

- (void)mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated {
   [NSObject cancelPreviousPerformRequestsWithTarget:self
                            selector:@selector(delayedSaveVisibleMapRect)
                             object:nil];
   [self performSelector:@selector(delayedSaveVisibleMapRect)
           withObject:nil
           afterDelay:1.0];
}

@end
Indiquer un
emplacement
Annotation
<MKAnnotation>
MKPointAnnotation - le mal aimé
#import <MapKit/MapKit.h>

#import "STSSharedConstants.h"

@interface STSTreeAnnotation : NSObject <MKAnnotation>

@property (nonatomic, readonly) CLLocationCoordinate2D coordinate;
@property (nonatomic, readonly) STSTreeKind treeKind;
@property (nonatomic, readonly,getter=isTreeLogged) BOOL logged;

+ (id)treeAnnotationWithCoordinate:(CLLocationCoordinate2D)inCoordinate treeKind:
(STSTreeKind)inKind logged:(BOOL)inLogged;
- (id)initWithCoordinate:(CLLocationCoordinate2D)inCoordinate treeKind:(STSTreeKind)inKind
logged:(BOOL)inLogged;

@end
#import "STSTreeAnnotation.h"

@interface STSTreeAnnotation ()
{
!   CLLocationCoordinate2D _coordinate;
!   STSTreeKind _treeKind;
!   BOOL _logged;
}

@end

@implementation STSTreeAnnotation

@synthesize coordinate=_coordinate,treeKind=_treeKind,logged=_logged;

+ (id) treeAnnotationWithCoordinate:(CLLocationCoordinate2D)inCoordinate treeKind:
(STSTreeKind)inKind logged:(BOOL)inLogged {
!    return [[[STSTreeAnnotation alloc] initWithCoordinate:inCoordinate
                              treeKind:inKind logged:inLogged] autorelease];
}

- (id) initWithCoordinate:(CLLocationCoordinate2D)inCoordinate treeKind:(STSTreeKind)inKind
logged:(BOOL)inLogged {
!     self=[super init];
!
!     if (self!=nil) {
!     ! _coordinate=inCoordinate;
!     ! _treeKind=inKind;
!     ! _logged=inLogged;
#import "STSViewController.h"
#import "STSTreeAnnotation.h"

#import <CoreLocation/CoreLocation.h>

@interface STSViewController ()
{
  IBOutlet MKMapView *_mapView;
}

- (void)delayedSaveVisibleMapRect;

@end


NSString * const STSLastVisibleMapRect=@"LastVisibleMapRect";

@implementation STSViewController

- (void)viewDidLoad {
   [super viewDidLoad];

  /* Set Map Type to Terrain */

  [_mapView setMapType:3];

  /* Restore (approximately) the visible map rect */

  NSString *tString=[[NSUserDefaults standardUserDefaults]
MKAnnotationView


MKPinAnnotationView
MKPinAnnotationColorRed      MKPinAnnotationColorGreen




MKPinAnnotationColorPurple
MKPinAnnotationColorRed




MKPinAnnotationColorPurple
#import "STSViewController.h"
#import "STSTreeAnnotation.h"

#import <CoreLocation/CoreLocation.h>

@interface STSViewController ()
{
  IBOutlet MKMapView *_mapView;
}

- (void)delayedSaveVisibleMapRect;

@end


NSString * const STSLastVisibleMapRect=@"LastVisibleMapRect";
NSString * const STSTreeAnnotationIdentifier=@"STSTreeAnnotationIdentifier";

@implementation STSViewController

- (void)viewDidLoad
{…}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{…}

#pragma mark -

- (void)delayedSaveVisibleMapRect
Sequoia Sempervirens       Metasequoia




Sequoiadendron Giganteum        Abattu
Sequoia Sempervirens                       Metasequoia




                       Sequoiadendron Giganteum          Abattu
CoreImage
#import <MapKit/MapKit.h>

#import "STSSharedConstants.h"

#import "STSTreeAnnotation.h"

@interface STSPinAnnotationView : MKPinAnnotationView

- (id)initWithAnnotation:(STSTreeAnnotation *) inTreeAnnotation reuseIdentifier:(NSString
*)reuseIdentifier;

@end
- (id)initWithAnnotation:(STSTreeAnnotation *)inTreeAnnotation reuseIdentifier:(NSString
*)reuseIdentifier {
    self=[super initWithAnnotation:inTreeAnnotation reuseIdentifier:reuseIdentifier];

    if (self!=nil) {
        if ([inTreeAnnotation isTreeLogged]==YES) {
            self.pinColor=MKPinAnnotationColorRed;
        }
        else {
            switch([inTreeAnnotation treeKind]) {
               case STSTreeKindSequoiadendronGiganteum:
                  self.pinColor=MKPinAnnotationColorGreen;
                  break;

                case STSTreeKindSequoiaSempervirens:
                  self.pinColor=MKPinAnnotationColorPurple;
                  break;

                case STSTreeKindMetasequoia:
                  self.pinColor=MKPinAnnotationColorGreen;
                  break;
            }
        }

        [super setImage:[self image]];
    }

    return self;
}
#import "STSViewController.h"
#import "STSTreeAnnotation.h"
#import "STSPinAnnotationView.h"

#import <CoreLocation/CoreLocation.h>

@interface STSViewController ()
{
  IBOutlet MKMapView *_mapView;
}

- (void)delayedSaveVisibleMapRect;

@end

NSString * const STSLastVisibleMapRect=@"LastVisibleMapRect";
NSString * const
STSTreeAnnotationSequoiadendronIdentifier=@"TreeAnnotationSequoiadendronIdentifier";
NSString * const
STSTreeAnnotationSempervirensIdentifier=@"TreeAnnotationSempervirensIdentifier";
NSString * const
STSTreeAnnotationMetasequoiaIdentifier=@"TreeAnnotationMetasequoiaIdentifier";

@implementation STSViewController

- (void)viewDidLoad
{…}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
WTF?!#
}

+ (UIImage *)imageForTreeKind:(STSTreeKind)treeKind logged:(BOOL)logged {
   UIImage *tImage=nil;

    if (logged==YES) {
        tImage=[UIImage imageNamed:@"loggedPin"];
    }
    else {
               MKPinAnnotationColorRed
        switch(treeKind) {
           case STSTreeKindSequoiadendronGiganteum:
             tImage=[UIImage imageNamed:@"sequoiadendronPin"];
             break;

            case STSTreeKindSequoiaSempervirens:
              tImage=[UIImage imageNamed:@"sempervirensPin"];
              break;
                MKPinAnnotationColorPurple
            case STSTreeKindMetasequoia:
              tImage=[UIImage imageNamed:@"metasequoiaPin"];
              break;
        }
    }

    return tImage;
}

#pragma mark -

- (id)initWithAnnotation:(STSTreeAnnotation *)annotation reuseIdentifier:(NSString
*)reuseIdentifier {
#import "STSViewController.h"
#import "STSTreeAnnotation.h"
#import "STSTreeAnnotationView.h"

#import <CoreLocation/CoreLocation.h>

@interface STSViewController ()
{          MKPinAnnotationColorRed
  IBOutlet MKMapView *_mapView;
}

- (void)delayedSaveVisibleMapRect;

@end

           MKPinAnnotationColorPurple
NSString * const STSLastVisibleMapRect=@"LastVisibleMapRect";
NSString * const STSTreeAnnotationViewIdentifier=@"TreeAnnotationViewIdentifier";

@implementation STSViewController

- (void)viewDidLoad
{…}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{…}

#pragma mark -
Délimiter une région
Overlays
MKCircle       MKPolyline       MKPolygon
MKCircleView   MKPolylineView   MKPolygonView
Données
Géographiques
www.gitesdegaule.fr/KaraMeLise/
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.2">
<Document>
   <name><![CDATA[Val-d'Oise (95)]]></name>
   <Style id="gitesdegaule.fr">
      <LineStyle>
         <color>cc2d3939</color>
         <width>3</width>
      </LineStyle>
      <PolyStyle>
         <color>804d4def</color>
      </PolyStyle>
   </Style>
   <Placemark id="val-doise">
      <name><![CDATA[Val-d'Oise (95)]]></name>
      <styleUrl>#gitesdegaule.fr</styleUrl>
      <Polygon>
         <outerBoundaryIs>
             <LinearRing>
                <tessellate>1</tessellate>
                <coordinates>
                   2.20056187,48.90881128,250
                </coordinates>
             </LinearRing>
         </outerBoundaryIs>
      </Polygon>
   </Placemark>
</Document>
</kml>
2.20056187,48.90881128
> awk 'NR%2==0' input output
#import <MapKit/MapKit.h>

@interface STSPolygonWrapper : NSObject <MKOverlay>

@property (nonatomic, readonly) CLLocationCoordinate2D coordinate;
@property (nonatomic, readonly) MKMapRect boundingMapRect;
@property (nonatomic, retain) MKPolygon *polygon;

+ (STSPolygonWrapper *)polygonWrapperWithContentsOfURL:(NSURL *)inURL;
- (id)initWithContentsOfURL:(NSURL *)inURL;

- (BOOL)intersectsMapRect:(MKMapRect)inMapRect;

@end
#import "STSPolygonWrapper.h"

@interface STSPolygonWrapper ()
{
!   MKPolygon * _polygon;
}

@end

@implementation STSPolygonWrapper

@synthesize polygon=_polygon;

+ (STSPolygonWrapper *)polygonWrapperWithContentsOfURL:(NSURL *)inURL {
!   STSPolygonWrapper *tPolygonWrapper=nil;
!
!   if (inURL!=nil)
     tPolygonWrapper=[[STSPolygonWrapper alloc] initWithContentsOfURL:inURL];
!
!   return [tPolygonWrapper autorelease];
}

- (id)initWithContentsOfURL:(NSURL *)inURL {
!     self=[super init];
!
!     if (self!=nil) {
!     ! NSString *tRawCoordinates;
!     !
#import "STSViewController.h"
#import "STSTreeAnnotation.h"
#import "STSTreeAnnotationView.h"
#import "STSPolygonWrapper.h"

#import <CoreLocation/CoreLocation.h>

@interface STSViewController ()
{…}

- (void)delayedSaveVisibleMapRect;

@end


NSString * const STSLastVisibleMapRect=@"LastVisibleMapRect";
NSString * const STSTreeAnnotationViewIdentifier=@"TreeAnnotationViewIdentifier";

@implementation STSViewController

- (void)viewDidLoad {
   [super viewDidLoad];

  /* Set Map Type to Terrain */

  [_mapView setMapType:3];

  /* Restore (approximately) the visible map rect */
Naviguer
Tap & Gestures
UIView ≠ UIView
#import <MapKit/MapKit.h>

#define STSMAPVIEW_TRACKING_MODE_NORMAL!            0
#define STSMAPVIEW_TRACKING_MODE_SPECIAL!           1

@interface STSMapView : MKMapView
{
!   NSInteger _trackingMode;
!   NSArray *_cachedOriginalRecognizers;
}

@property (nonatomic) NSInteger trackingMode;

@end

@protocol STSMapViewDelegate <MKMapViewDelegate>

- (void) mapView:(STSMapView *)inMapView handleZoomInRequestAtPoint:(CGPoint)inPoint;
- (void) mapView:(STSMapView *)inMapView handleZoomOutRequestAtPoint:(CGPoint)inPoint;

@end
#import "STSMapView.h"

@implementation STSMapView

@synthesize trackingMode=_trackingMode;

- (void) dealloc {
!    [_cachedOriginalRecognizers release];
!
!    [super dealloc];
}

#pragma mark -

- (void) setTrackingMode:(NSInteger)inMode {
!    if (_trackingMode!=inMode) {
!    ! if (inMode==STSMAPVIEW_TRACKING_MODE_NORMAL) {
!    ! !
         self.zoomEnabled=YES;
         self.scrollEnabled=YES;

        if (_cachedOriginalRecognizers!=nil) {
!   !   ! ! self.gestureRecognizers=_cachedOriginalRecognizers;
!   !   ! !
!   !   ! ! [_cachedOriginalRecognizers release];
!   !   ! !
!   !   ! ! _cachedOriginalRecognizers=nil;
!   !   ! }
!   !   }
!   !   else {
#import <MapKit/MapKit.h>

@interface STSPolygonWrapper : NSObject <MKOverlay>

@property (nonatomic, readonly) CLLocationCoordinate2D coordinate;
@property (nonatomic, readonly) MKMapRect boundingMapRect;
@property (nonatomic) BOOL contours;
@property (nonatomic, retain) MKPolygon * polygon;
@property (nonatomic, retain) NSString * label;

+ (STSPolygonWrapper *)polygonWrapperWithContentsOfURL:(NSURL *)inURL label:(NSString
*)inLabel;
- (id)initWithContentsOfURL:(NSURL *) inURL label:(NSString *)inLabel;

- (BOOL)containsPoint:(CLLocationCoordinate2D)inCoordinate;
- (BOOL)intersectsMapRect:(MKMapRect)inMapRect;

@end
#import "STSPolygonWrapper.h"

@interface STSPolygonWrapper ()
{
!   MKPolygon * _polygon;
!   CGMutablePathRef _pathRef;
!   BOOL _contours;
    NSString * _label;
}

@end

@implementation STSPolygonWrapper

@synthesize polygon=_polygon,contours=_contours,label=_label;

+ (STSPolygonWrapper *)polygonWrapperWithContentsOfURL:(NSURL *)inURL label:(NSString
*)inLabel {
!    STSPolygonWrapper * tPolygonWrapper=nil;
!
!    if (inURL!=nil)
      tPolygonWrapper=[[STSPolygonWrapper alloc] initWithContentsOfURL:inURL
                                         label:inLabel];
!
!    return [tPolygonWrapper autorelease];
}

- (id)initWithContentsOfURL:(NSURL *)inURL label:(NSString *)inLabel {
!     self=[super init];
#import <UIKit/UIKit.h>
#import <MapKit/MapKit.h>
#import "STSMapView.h"

@interface STSViewController : UIViewController <STSMapViewDelegate>

@end
#import "STSViewController.h"
#import "STSPolygonWrapper.h"

#import <CoreLocation/CoreLocation.h>

@interface STSViewController ()
{
  IBOutlet STSMapView *_mapView;

    NSMutableArray *_overlays;
    STSPolygonWrapper *_overlay;
}

- (void)delayedSaveVisibleMapRect;

@end


NSString * const STSLastVisibleMapRect=@"LastVisibleMapRect";

@implementation STSViewController

- (void)viewDidLoad {
   [super viewDidLoad];

    /* Set Map Type to Terrain */

    [_mapView setMapType:3];
Cluster
applidium.com/en/news/too_many_pins_on_your_map/
Références

WWDC sessions
 2009 : Session 118 - Embedding Maps in iPhone Applications
 2010 : Session 127 - Customizing Maps with Overlays
 2011 : Session 111 - Visualizing Information Geographically with Map Kit
 2012 : Session 300 - Getting Around With Map Kit

KML
        Régions : www.gitesdegaule.fr/KaraMeLise/
 Déparetements : git.piprime.fr Git - php/pi-google-maps-api.git/
                 tree - pi-google-maps-api/res/france/regions/
Références

Sample Code
  s.sudre.free.fr/Stuff/CocoaHeads/STSimplified-CocoaHeads.zip
www.sequoias.eu
QA
 &

More Related Content

What's hot

Workshop 5: JavaScript testing
Workshop 5: JavaScript testingWorkshop 5: JavaScript testing
Workshop 5: JavaScript testingVisual Engineering
 
Compose Async with RxJS
Compose Async with RxJSCompose Async with RxJS
Compose Async with RxJSKyung Yeol Kim
 
Reactive Programming Patterns with RxSwift
Reactive Programming Patterns with RxSwiftReactive Programming Patterns with RxSwift
Reactive Programming Patterns with RxSwiftFlorent Pillet
 
EcmaScript 6 - The future is here
EcmaScript 6 - The future is hereEcmaScript 6 - The future is here
EcmaScript 6 - The future is hereSebastiano Armeli
 
FalsyValues. Dmitry Soshnikov - ECMAScript 6
FalsyValues. Dmitry Soshnikov - ECMAScript 6FalsyValues. Dmitry Soshnikov - ECMAScript 6
FalsyValues. Dmitry Soshnikov - ECMAScript 6Dmitry Soshnikov
 
ReactiveCocoa Goodness - Part I of II
ReactiveCocoa Goodness - Part I of IIReactiveCocoa Goodness - Part I of II
ReactiveCocoa Goodness - Part I of IImanuelmaly
 
Callbacks and control flow in Node js
Callbacks and control flow in Node jsCallbacks and control flow in Node js
Callbacks and control flow in Node jsThomas Roch
 
Avoiding Callback Hell with Async.js
Avoiding Callback Hell with Async.jsAvoiding Callback Hell with Async.js
Avoiding Callback Hell with Async.jscacois
 
Object-Oriented Javascript
Object-Oriented JavascriptObject-Oriented Javascript
Object-Oriented Javascriptkvangork
 
Think Async: Asynchronous Patterns in NodeJS
Think Async: Asynchronous Patterns in NodeJSThink Async: Asynchronous Patterns in NodeJS
Think Async: Asynchronous Patterns in NodeJSAdam L Barrett
 
Node Boot Camp
Node Boot CampNode Boot Camp
Node Boot CampTroy Miles
 
ReactiveCocoa in Practice
ReactiveCocoa in PracticeReactiveCocoa in Practice
ReactiveCocoa in PracticeOutware Mobile
 
Asynchronous programming done right - Node.js
Asynchronous programming done right - Node.jsAsynchronous programming done right - Node.js
Asynchronous programming done right - Node.jsPiotr Pelczar
 
Cascadia.js: Don't Cross the Streams
Cascadia.js: Don't Cross the StreamsCascadia.js: Don't Cross the Streams
Cascadia.js: Don't Cross the Streamsmattpodwysocki
 
Angular and The Case for RxJS
Angular and The Case for RxJSAngular and The Case for RxJS
Angular and The Case for RxJSSandi Barr
 

What's hot (20)

Workshop 5: JavaScript testing
Workshop 5: JavaScript testingWorkshop 5: JavaScript testing
Workshop 5: JavaScript testing
 
Compose Async with RxJS
Compose Async with RxJSCompose Async with RxJS
Compose Async with RxJS
 
Reactive Programming Patterns with RxSwift
Reactive Programming Patterns with RxSwiftReactive Programming Patterns with RxSwift
Reactive Programming Patterns with RxSwift
 
EcmaScript 6 - The future is here
EcmaScript 6 - The future is hereEcmaScript 6 - The future is here
EcmaScript 6 - The future is here
 
FalsyValues. Dmitry Soshnikov - ECMAScript 6
FalsyValues. Dmitry Soshnikov - ECMAScript 6FalsyValues. Dmitry Soshnikov - ECMAScript 6
FalsyValues. Dmitry Soshnikov - ECMAScript 6
 
ReactiveCocoa Goodness - Part I of II
ReactiveCocoa Goodness - Part I of IIReactiveCocoa Goodness - Part I of II
ReactiveCocoa Goodness - Part I of II
 
ES6: The Awesome Parts
ES6: The Awesome PartsES6: The Awesome Parts
ES6: The Awesome Parts
 
Oop assignment 02
Oop assignment 02Oop assignment 02
Oop assignment 02
 
IoT Best practices
 IoT Best practices IoT Best practices
IoT Best practices
 
ECMAScript 6
ECMAScript 6ECMAScript 6
ECMAScript 6
 
Callbacks and control flow in Node js
Callbacks and control flow in Node jsCallbacks and control flow in Node js
Callbacks and control flow in Node js
 
Avoiding Callback Hell with Async.js
Avoiding Callback Hell with Async.jsAvoiding Callback Hell with Async.js
Avoiding Callback Hell with Async.js
 
Object-Oriented Javascript
Object-Oriented JavascriptObject-Oriented Javascript
Object-Oriented Javascript
 
Think Async: Asynchronous Patterns in NodeJS
Think Async: Asynchronous Patterns in NodeJSThink Async: Asynchronous Patterns in NodeJS
Think Async: Asynchronous Patterns in NodeJS
 
Node Boot Camp
Node Boot CampNode Boot Camp
Node Boot Camp
 
ReactiveCocoa in Practice
ReactiveCocoa in PracticeReactiveCocoa in Practice
ReactiveCocoa in Practice
 
New Design of OneRing
New Design of OneRingNew Design of OneRing
New Design of OneRing
 
Asynchronous programming done right - Node.js
Asynchronous programming done right - Node.jsAsynchronous programming done right - Node.js
Asynchronous programming done right - Node.js
 
Cascadia.js: Don't Cross the Streams
Cascadia.js: Don't Cross the StreamsCascadia.js: Don't Cross the Streams
Cascadia.js: Don't Cross the Streams
 
Angular and The Case for RxJS
Angular and The Case for RxJSAngular and The Case for RxJS
Angular and The Case for RxJS
 

Viewers also liked

Keeping Track of Moving Things: MapKit and CoreLocation in Depth
Keeping Track of Moving Things: MapKit and CoreLocation in DepthKeeping Track of Moving Things: MapKit and CoreLocation in Depth
Keeping Track of Moving Things: MapKit and CoreLocation in DepthGeoffrey Goetz
 
Getting Oriented with MapKit: Everything you need to get started with the new...
Getting Oriented with MapKit: Everything you need to get started with the new...Getting Oriented with MapKit: Everything you need to get started with the new...
Getting Oriented with MapKit: Everything you need to get started with the new...John Wilker
 
Introduction to MapKit
Introduction to MapKitIntroduction to MapKit
Introduction to MapKitRob C
 
The 5 Core Components of Effective Digital Marketing...
The 5 Core Components of Effective Digital Marketing...The 5 Core Components of Effective Digital Marketing...
The 5 Core Components of Effective Digital Marketing...Paul Battrick
 
5 Realms for Learning iOS Development
5 Realms for Learning iOS Development5 Realms for Learning iOS Development
5 Realms for Learning iOS Developmentirving-ios-jumpstart
 
Core Location and Map Kit: Bringing Your Own Maps [Voices That Matter: iPhone...
Core Location and Map Kit: Bringing Your Own Maps [Voices That Matter: iPhone...Core Location and Map Kit: Bringing Your Own Maps [Voices That Matter: iPhone...
Core Location and Map Kit: Bringing Your Own Maps [Voices That Matter: iPhone...Chris Adamson
 
MapKit na prática: Desenvolvendo um aplicativo iOS que exibe Pontos de Intere...
MapKit na prática: Desenvolvendo um aplicativo iOS que exibe Pontos de Intere...MapKit na prática: Desenvolvendo um aplicativo iOS que exibe Pontos de Intere...
MapKit na prática: Desenvolvendo um aplicativo iOS que exibe Pontos de Intere...Juliana Chahoud
 

Viewers also liked (8)

Keeping Track of Moving Things: MapKit and CoreLocation in Depth
Keeping Track of Moving Things: MapKit and CoreLocation in DepthKeeping Track of Moving Things: MapKit and CoreLocation in Depth
Keeping Track of Moving Things: MapKit and CoreLocation in Depth
 
Getting Oriented with MapKit: Everything you need to get started with the new...
Getting Oriented with MapKit: Everything you need to get started with the new...Getting Oriented with MapKit: Everything you need to get started with the new...
Getting Oriented with MapKit: Everything you need to get started with the new...
 
Introduction to MapKit
Introduction to MapKitIntroduction to MapKit
Introduction to MapKit
 
The 5 Core Components of Effective Digital Marketing...
The 5 Core Components of Effective Digital Marketing...The 5 Core Components of Effective Digital Marketing...
The 5 Core Components of Effective Digital Marketing...
 
5 Realms for Learning iOS Development
5 Realms for Learning iOS Development5 Realms for Learning iOS Development
5 Realms for Learning iOS Development
 
Glympse Map Kit
Glympse Map KitGlympse Map Kit
Glympse Map Kit
 
Core Location and Map Kit: Bringing Your Own Maps [Voices That Matter: iPhone...
Core Location and Map Kit: Bringing Your Own Maps [Voices That Matter: iPhone...Core Location and Map Kit: Bringing Your Own Maps [Voices That Matter: iPhone...
Core Location and Map Kit: Bringing Your Own Maps [Voices That Matter: iPhone...
 
MapKit na prática: Desenvolvendo um aplicativo iOS que exibe Pontos de Intere...
MapKit na prática: Desenvolvendo um aplicativo iOS que exibe Pontos de Intere...MapKit na prática: Desenvolvendo um aplicativo iOS que exibe Pontos de Intere...
MapKit na prática: Desenvolvendo um aplicativo iOS que exibe Pontos de Intere...
 

Similar to Map kit light

Get the Most Out of iOS 11 with Visual Studio Tools for Xamarin
Get the Most Out of iOS 11 with Visual Studio Tools for XamarinGet the Most Out of iOS 11 with Visual Studio Tools for Xamarin
Get the Most Out of iOS 11 with Visual Studio Tools for XamarinXamarin
 
Agile Iphone Development
Agile Iphone DevelopmentAgile Iphone Development
Agile Iphone DevelopmentGiordano Scalzo
 
Your Second iPhone App - Code Listings
Your Second iPhone App - Code ListingsYour Second iPhone App - Code Listings
Your Second iPhone App - Code ListingsVu Tran Lam
 
連邦の白いヤツ 「Objective-C」
連邦の白いヤツ 「Objective-C」連邦の白いヤツ 「Objective-C」
連邦の白いヤツ 「Objective-C」matuura_core
 
in this assignment you are asked to write a simple driver program an.pdf
in this assignment you are asked to write a simple driver program an.pdfin this assignment you are asked to write a simple driver program an.pdf
in this assignment you are asked to write a simple driver program an.pdfmichardsonkhaicarr37
 
Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...
Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...
Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...DroidConTLV
 
Object-Oriented JavaScript
Object-Oriented JavaScriptObject-Oriented JavaScript
Object-Oriented JavaScriptkvangork
 
groovy databases
groovy databasesgroovy databases
groovy databasesPaul King
 
Vavr Java User Group Rheinland
Vavr Java User Group RheinlandVavr Java User Group Rheinland
Vavr Java User Group RheinlandDavid Schmitz
 
Synchronizing without internet - Multipeer Connectivity (iOS)
Synchronizing without internet - Multipeer Connectivity (iOS)Synchronizing without internet - Multipeer Connectivity (iOS)
Synchronizing without internet - Multipeer Connectivity (iOS)Jorge Maroto
 
Mashup caravan android-talks
Mashup caravan android-talksMashup caravan android-talks
Mashup caravan android-talkshonjo2
 
You will learn RxJS in 2017
You will learn RxJS in 2017You will learn RxJS in 2017
You will learn RxJS in 2017名辰 洪
 

Similar to Map kit light (20)

Get the Most Out of iOS 11 with Visual Studio Tools for Xamarin
Get the Most Out of iOS 11 with Visual Studio Tools for XamarinGet the Most Out of iOS 11 with Visual Studio Tools for Xamarin
Get the Most Out of iOS 11 with Visual Studio Tools for Xamarin
 
Agile Iphone Development
Agile Iphone DevelopmentAgile Iphone Development
Agile Iphone Development
 
Iphone course 2
Iphone course 2Iphone course 2
Iphone course 2
 
Your Second iPhone App - Code Listings
Your Second iPhone App - Code ListingsYour Second iPhone App - Code Listings
Your Second iPhone App - Code Listings
 
連邦の白いヤツ 「Objective-C」
連邦の白いヤツ 「Objective-C」連邦の白いヤツ 「Objective-C」
連邦の白いヤツ 「Objective-C」
 
in this assignment you are asked to write a simple driver program an.pdf
in this assignment you are asked to write a simple driver program an.pdfin this assignment you are asked to write a simple driver program an.pdf
in this assignment you are asked to write a simple driver program an.pdf
 
Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...
Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...
Tricks to Making a Realtime SurfaceView Actually Perform in Realtime - Maarte...
 
Day 1
Day 1Day 1
Day 1
 
React native tour
React native tourReact native tour
React native tour
 
Object-Oriented JavaScript
Object-Oriented JavaScriptObject-Oriented JavaScript
Object-Oriented JavaScript
 
groovy databases
groovy databasesgroovy databases
groovy databases
 
Fact, Fiction, and FP
Fact, Fiction, and FPFact, Fiction, and FP
Fact, Fiction, and FP
 
Java and xml
Java and xmlJava and xml
Java and xml
 
iOS
iOSiOS
iOS
 
Vavr Java User Group Rheinland
Vavr Java User Group RheinlandVavr Java User Group Rheinland
Vavr Java User Group Rheinland
 
Synchronizing without internet - Multipeer Connectivity (iOS)
Synchronizing without internet - Multipeer Connectivity (iOS)Synchronizing without internet - Multipeer Connectivity (iOS)
Synchronizing without internet - Multipeer Connectivity (iOS)
 
Mashup caravan android-talks
Mashup caravan android-talksMashup caravan android-talks
Mashup caravan android-talks
 
Functions
FunctionsFunctions
Functions
 
You will learn RxJS in 2017
You will learn RxJS in 2017You will learn RxJS in 2017
You will learn RxJS in 2017
 
Mobile Web 5.0
Mobile Web 5.0Mobile Web 5.0
Mobile Web 5.0
 

More from CocoaHeads France

More from CocoaHeads France (20)

Mutation testing for a safer Future
Mutation testing for a safer FutureMutation testing for a safer Future
Mutation testing for a safer Future
 
iOS App Group for Debugging
iOS App Group for DebuggingiOS App Group for Debugging
iOS App Group for Debugging
 
Asynchronous swift
Asynchronous swiftAsynchronous swift
Asynchronous swift
 
Visual accessibility in iOS11
Visual accessibility in iOS11Visual accessibility in iOS11
Visual accessibility in iOS11
 
My script - One year of CocoaHeads
My script - One year of CocoaHeadsMy script - One year of CocoaHeads
My script - One year of CocoaHeads
 
Ui testing dealing with push notifications
Ui testing dealing with push notificationsUi testing dealing with push notifications
Ui testing dealing with push notifications
 
CONTINUOUS DELIVERY WITH FASTLANE
CONTINUOUS DELIVERY WITH FASTLANECONTINUOUS DELIVERY WITH FASTLANE
CONTINUOUS DELIVERY WITH FASTLANE
 
L'intégration continue avec Bitrise
L'intégration continue avec BitriseL'intégration continue avec Bitrise
L'intégration continue avec Bitrise
 
Super combinators
Super combinatorsSuper combinators
Super combinators
 
Design like a developer
Design like a developerDesign like a developer
Design like a developer
 
Handle the error
Handle the errorHandle the error
Handle the error
 
Quoi de neuf dans iOS 10.3
Quoi de neuf dans iOS 10.3Quoi de neuf dans iOS 10.3
Quoi de neuf dans iOS 10.3
 
SwiftyGPIO
SwiftyGPIOSwiftyGPIO
SwiftyGPIO
 
Présentation de HomeKit
Présentation de HomeKitPrésentation de HomeKit
Présentation de HomeKit
 
Programme MFI retour d'expérience
Programme MFI retour d'expérienceProgramme MFI retour d'expérience
Programme MFI retour d'expérience
 
How to communicate with Smart things?
How to communicate with Smart things?How to communicate with Smart things?
How to communicate with Smart things?
 
Build a lego app with CocoaPods
Build a lego app with CocoaPodsBuild a lego app with CocoaPods
Build a lego app with CocoaPods
 
Let's migrate to Swift 3.0
Let's migrate to Swift 3.0Let's migrate to Swift 3.0
Let's migrate to Swift 3.0
 
Project Entourage
Project EntourageProject Entourage
Project Entourage
 
What's new in iOS9
What's new in iOS9What's new in iOS9
What's new in iOS9
 

Recently uploaded

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 

Map kit light

  • 2. François Pignon Comptable au Ministère des Finances
  • 3. Jeudi Confession Mode Thèmes iDVD activé
  • 4. Infinite Loop - Cupertino
  • 5. Yerba Buena Garden - San Francisco
  • 7. Hauteur : 115,61 m Périmètre(1) : 47 m Poids : 2 100 t (1) Mesuré à 1,2 m du sol.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12. 4 033
  • 13.
  • 14. ?
  • 17.
  • 18.
  • 19.
  • 23. + MapKit.framework + CoreLocation.framework
  • 24.
  • 26. MKMapTypeStandard MKMapTypeSatellite MKMapTypeHybrid
  • 27. MKMapTypeStandard 3 MKMapTypeSatellite MKMapTypeHybrid
  • 28.
  • 29. #import <UIKit/UIKit.h> #import <MapKit/MapKit.h> @interface STSViewController : UIViewController @end
  • 30. #import "STSViewController.h" @interface STSViewController () { IBOutlet MKMapView *_mapView; } @end @implementation STSViewController - (void)viewDidLoad { [super viewDidLoad]; [_mapView setMapType:3]; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; } @end
  • 31.
  • 34. Simulateur #if TARGET_IPHONE_SIMULATOR [_mapView setMapType:MKMapTypeHybrid]; #else [_mapView setMapType:3]; #endif Appareil
  • 35. Se souvenir de la dernière position
  • 36. @property (nonatomic) MKCoordinateRegion region; - (void)setRegion:(MKCoordinateRegion)region animated:(BOOL)animated; @property (nonatomic) MKMapRect visibleMapRect; - (void)setVisibleMapRect:(MKMapRect)mapRect animated:(BOOL)animate; @protocol MKMapViewDelegate <NSObject> @optional - (void)mapView:(MKMapView *)mapView regionDidChangeAnimated: (BOOL)animated;
  • 37. #import <UIKit/UIKit.h> #import <MapKit/MapKit.h> @interface STSViewController : UIViewController <MKMapViewDelegate> @end
  • 38. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {…} #pragma mark - - (void)delayedSaveVisibleMapRect { MKMapRect tVisibleMapRect=_mapView.visibleMapRect; NSString *tString=[NSString stringWithFormat:@"%g|%g|%g|%g",tVisibleMapRect.origin.x, tVisibleMapRect.origin.y, tVisibleMapRect.size.width, tVisibleMapRect.size.height]; [[NSUserDefaults standardUserDefaults] setObject:tString forKey:STSLastVisibleMapRect]; } #pragma mark - MKMapView delegate - (void)mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated { [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(delayedSaveVisibleMapRect) object:nil]; [self performSelector:@selector(delayedSaveVisibleMapRect) withObject:nil afterDelay:1.0]; } @end
  • 41.
  • 43. #import <MapKit/MapKit.h> #import "STSSharedConstants.h" @interface STSTreeAnnotation : NSObject <MKAnnotation> @property (nonatomic, readonly) CLLocationCoordinate2D coordinate; @property (nonatomic, readonly) STSTreeKind treeKind; @property (nonatomic, readonly,getter=isTreeLogged) BOOL logged; + (id)treeAnnotationWithCoordinate:(CLLocationCoordinate2D)inCoordinate treeKind: (STSTreeKind)inKind logged:(BOOL)inLogged; - (id)initWithCoordinate:(CLLocationCoordinate2D)inCoordinate treeKind:(STSTreeKind)inKind logged:(BOOL)inLogged; @end
  • 44. #import "STSTreeAnnotation.h" @interface STSTreeAnnotation () { ! CLLocationCoordinate2D _coordinate; ! STSTreeKind _treeKind; ! BOOL _logged; } @end @implementation STSTreeAnnotation @synthesize coordinate=_coordinate,treeKind=_treeKind,logged=_logged; + (id) treeAnnotationWithCoordinate:(CLLocationCoordinate2D)inCoordinate treeKind: (STSTreeKind)inKind logged:(BOOL)inLogged { ! return [[[STSTreeAnnotation alloc] initWithCoordinate:inCoordinate treeKind:inKind logged:inLogged] autorelease]; } - (id) initWithCoordinate:(CLLocationCoordinate2D)inCoordinate treeKind:(STSTreeKind)inKind logged:(BOOL)inLogged { ! self=[super init]; ! ! if (self!=nil) { ! ! _coordinate=inCoordinate; ! ! _treeKind=inKind; ! ! _logged=inLogged;
  • 45. #import "STSViewController.h" #import "STSTreeAnnotation.h" #import <CoreLocation/CoreLocation.h> @interface STSViewController () { IBOutlet MKMapView *_mapView; } - (void)delayedSaveVisibleMapRect; @end NSString * const STSLastVisibleMapRect=@"LastVisibleMapRect"; @implementation STSViewController - (void)viewDidLoad { [super viewDidLoad]; /* Set Map Type to Terrain */ [_mapView setMapType:3]; /* Restore (approximately) the visible map rect */ NSString *tString=[[NSUserDefaults standardUserDefaults]
  • 46.
  • 48. MKPinAnnotationColorRed MKPinAnnotationColorGreen MKPinAnnotationColorPurple
  • 50. #import "STSViewController.h" #import "STSTreeAnnotation.h" #import <CoreLocation/CoreLocation.h> @interface STSViewController () { IBOutlet MKMapView *_mapView; } - (void)delayedSaveVisibleMapRect; @end NSString * const STSLastVisibleMapRect=@"LastVisibleMapRect"; NSString * const STSTreeAnnotationIdentifier=@"STSTreeAnnotationIdentifier"; @implementation STSViewController - (void)viewDidLoad {…} - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {…} #pragma mark - - (void)delayedSaveVisibleMapRect
  • 51.
  • 52.
  • 53. Sequoia Sempervirens Metasequoia Sequoiadendron Giganteum Abattu
  • 54. Sequoia Sempervirens Metasequoia Sequoiadendron Giganteum Abattu
  • 56. #import <MapKit/MapKit.h> #import "STSSharedConstants.h" #import "STSTreeAnnotation.h" @interface STSPinAnnotationView : MKPinAnnotationView - (id)initWithAnnotation:(STSTreeAnnotation *) inTreeAnnotation reuseIdentifier:(NSString *)reuseIdentifier; @end
  • 57. - (id)initWithAnnotation:(STSTreeAnnotation *)inTreeAnnotation reuseIdentifier:(NSString *)reuseIdentifier { self=[super initWithAnnotation:inTreeAnnotation reuseIdentifier:reuseIdentifier]; if (self!=nil) { if ([inTreeAnnotation isTreeLogged]==YES) { self.pinColor=MKPinAnnotationColorRed; } else { switch([inTreeAnnotation treeKind]) { case STSTreeKindSequoiadendronGiganteum: self.pinColor=MKPinAnnotationColorGreen; break; case STSTreeKindSequoiaSempervirens: self.pinColor=MKPinAnnotationColorPurple; break; case STSTreeKindMetasequoia: self.pinColor=MKPinAnnotationColorGreen; break; } } [super setImage:[self image]]; } return self; }
  • 58. #import "STSViewController.h" #import "STSTreeAnnotation.h" #import "STSPinAnnotationView.h" #import <CoreLocation/CoreLocation.h> @interface STSViewController () { IBOutlet MKMapView *_mapView; } - (void)delayedSaveVisibleMapRect; @end NSString * const STSLastVisibleMapRect=@"LastVisibleMapRect"; NSString * const STSTreeAnnotationSequoiadendronIdentifier=@"TreeAnnotationSequoiadendronIdentifier"; NSString * const STSTreeAnnotationSempervirensIdentifier=@"TreeAnnotationSempervirensIdentifier"; NSString * const STSTreeAnnotationMetasequoiaIdentifier=@"TreeAnnotationMetasequoiaIdentifier"; @implementation STSViewController - (void)viewDidLoad {…} - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
  • 59.
  • 61.
  • 62. } + (UIImage *)imageForTreeKind:(STSTreeKind)treeKind logged:(BOOL)logged { UIImage *tImage=nil; if (logged==YES) { tImage=[UIImage imageNamed:@"loggedPin"]; } else { MKPinAnnotationColorRed switch(treeKind) { case STSTreeKindSequoiadendronGiganteum: tImage=[UIImage imageNamed:@"sequoiadendronPin"]; break; case STSTreeKindSequoiaSempervirens: tImage=[UIImage imageNamed:@"sempervirensPin"]; break; MKPinAnnotationColorPurple case STSTreeKindMetasequoia: tImage=[UIImage imageNamed:@"metasequoiaPin"]; break; } } return tImage; } #pragma mark - - (id)initWithAnnotation:(STSTreeAnnotation *)annotation reuseIdentifier:(NSString *)reuseIdentifier {
  • 63. #import "STSViewController.h" #import "STSTreeAnnotation.h" #import "STSTreeAnnotationView.h" #import <CoreLocation/CoreLocation.h> @interface STSViewController () { MKPinAnnotationColorRed IBOutlet MKMapView *_mapView; } - (void)delayedSaveVisibleMapRect; @end MKPinAnnotationColorPurple NSString * const STSLastVisibleMapRect=@"LastVisibleMapRect"; NSString * const STSTreeAnnotationViewIdentifier=@"TreeAnnotationViewIdentifier"; @implementation STSViewController - (void)viewDidLoad {…} - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {…} #pragma mark -
  • 64.
  • 65.
  • 67.
  • 68.
  • 70. MKCircle MKPolyline MKPolygon MKCircleView MKPolylineView MKPolygonView
  • 73.
  • 74. <?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://earth.google.com/kml/2.2"> <Document> <name><![CDATA[Val-d'Oise (95)]]></name> <Style id="gitesdegaule.fr"> <LineStyle> <color>cc2d3939</color> <width>3</width> </LineStyle> <PolyStyle> <color>804d4def</color> </PolyStyle> </Style> <Placemark id="val-doise"> <name><![CDATA[Val-d'Oise (95)]]></name> <styleUrl>#gitesdegaule.fr</styleUrl> <Polygon> <outerBoundaryIs> <LinearRing> <tessellate>1</tessellate> <coordinates> 2.20056187,48.90881128,250 </coordinates> </LinearRing> </outerBoundaryIs> </Polygon> </Placemark> </Document> </kml>
  • 76.
  • 77. > awk 'NR%2==0' input output
  • 78. #import <MapKit/MapKit.h> @interface STSPolygonWrapper : NSObject <MKOverlay> @property (nonatomic, readonly) CLLocationCoordinate2D coordinate; @property (nonatomic, readonly) MKMapRect boundingMapRect; @property (nonatomic, retain) MKPolygon *polygon; + (STSPolygonWrapper *)polygonWrapperWithContentsOfURL:(NSURL *)inURL; - (id)initWithContentsOfURL:(NSURL *)inURL; - (BOOL)intersectsMapRect:(MKMapRect)inMapRect; @end
  • 79. #import "STSPolygonWrapper.h" @interface STSPolygonWrapper () { ! MKPolygon * _polygon; } @end @implementation STSPolygonWrapper @synthesize polygon=_polygon; + (STSPolygonWrapper *)polygonWrapperWithContentsOfURL:(NSURL *)inURL { ! STSPolygonWrapper *tPolygonWrapper=nil; ! ! if (inURL!=nil) tPolygonWrapper=[[STSPolygonWrapper alloc] initWithContentsOfURL:inURL]; ! ! return [tPolygonWrapper autorelease]; } - (id)initWithContentsOfURL:(NSURL *)inURL { ! self=[super init]; ! ! if (self!=nil) { ! ! NSString *tRawCoordinates; ! !
  • 80. #import "STSViewController.h" #import "STSTreeAnnotation.h" #import "STSTreeAnnotationView.h" #import "STSPolygonWrapper.h" #import <CoreLocation/CoreLocation.h> @interface STSViewController () {…} - (void)delayedSaveVisibleMapRect; @end NSString * const STSLastVisibleMapRect=@"LastVisibleMapRect"; NSString * const STSTreeAnnotationViewIdentifier=@"TreeAnnotationViewIdentifier"; @implementation STSViewController - (void)viewDidLoad { [super viewDidLoad]; /* Set Map Type to Terrain */ [_mapView setMapType:3]; /* Restore (approximately) the visible map rect */
  • 81.
  • 82.
  • 83.
  • 85.
  • 86.
  • 89. #import <MapKit/MapKit.h> #define STSMAPVIEW_TRACKING_MODE_NORMAL! 0 #define STSMAPVIEW_TRACKING_MODE_SPECIAL! 1 @interface STSMapView : MKMapView { ! NSInteger _trackingMode; ! NSArray *_cachedOriginalRecognizers; } @property (nonatomic) NSInteger trackingMode; @end @protocol STSMapViewDelegate <MKMapViewDelegate> - (void) mapView:(STSMapView *)inMapView handleZoomInRequestAtPoint:(CGPoint)inPoint; - (void) mapView:(STSMapView *)inMapView handleZoomOutRequestAtPoint:(CGPoint)inPoint; @end
  • 90. #import "STSMapView.h" @implementation STSMapView @synthesize trackingMode=_trackingMode; - (void) dealloc { ! [_cachedOriginalRecognizers release]; ! ! [super dealloc]; } #pragma mark - - (void) setTrackingMode:(NSInteger)inMode { ! if (_trackingMode!=inMode) { ! ! if (inMode==STSMAPVIEW_TRACKING_MODE_NORMAL) { ! ! ! self.zoomEnabled=YES; self.scrollEnabled=YES; if (_cachedOriginalRecognizers!=nil) { ! ! ! ! self.gestureRecognizers=_cachedOriginalRecognizers; ! ! ! ! ! ! ! ! [_cachedOriginalRecognizers release]; ! ! ! ! ! ! ! ! _cachedOriginalRecognizers=nil; ! ! ! } ! ! } ! ! else {
  • 91. #import <MapKit/MapKit.h> @interface STSPolygonWrapper : NSObject <MKOverlay> @property (nonatomic, readonly) CLLocationCoordinate2D coordinate; @property (nonatomic, readonly) MKMapRect boundingMapRect; @property (nonatomic) BOOL contours; @property (nonatomic, retain) MKPolygon * polygon; @property (nonatomic, retain) NSString * label; + (STSPolygonWrapper *)polygonWrapperWithContentsOfURL:(NSURL *)inURL label:(NSString *)inLabel; - (id)initWithContentsOfURL:(NSURL *) inURL label:(NSString *)inLabel; - (BOOL)containsPoint:(CLLocationCoordinate2D)inCoordinate; - (BOOL)intersectsMapRect:(MKMapRect)inMapRect; @end
  • 92. #import "STSPolygonWrapper.h" @interface STSPolygonWrapper () { ! MKPolygon * _polygon; ! CGMutablePathRef _pathRef; ! BOOL _contours; NSString * _label; } @end @implementation STSPolygonWrapper @synthesize polygon=_polygon,contours=_contours,label=_label; + (STSPolygonWrapper *)polygonWrapperWithContentsOfURL:(NSURL *)inURL label:(NSString *)inLabel { ! STSPolygonWrapper * tPolygonWrapper=nil; ! ! if (inURL!=nil) tPolygonWrapper=[[STSPolygonWrapper alloc] initWithContentsOfURL:inURL label:inLabel]; ! ! return [tPolygonWrapper autorelease]; } - (id)initWithContentsOfURL:(NSURL *)inURL label:(NSString *)inLabel { ! self=[super init];
  • 93. #import <UIKit/UIKit.h> #import <MapKit/MapKit.h> #import "STSMapView.h" @interface STSViewController : UIViewController <STSMapViewDelegate> @end
  • 94. #import "STSViewController.h" #import "STSPolygonWrapper.h" #import <CoreLocation/CoreLocation.h> @interface STSViewController () { IBOutlet STSMapView *_mapView; NSMutableArray *_overlays; STSPolygonWrapper *_overlay; } - (void)delayedSaveVisibleMapRect; @end NSString * const STSLastVisibleMapRect=@"LastVisibleMapRect"; @implementation STSViewController - (void)viewDidLoad { [super viewDidLoad]; /* Set Map Type to Terrain */ [_mapView setMapType:3];
  • 97. Références WWDC sessions 2009 : Session 118 - Embedding Maps in iPhone Applications 2010 : Session 127 - Customizing Maps with Overlays 2011 : Session 111 - Visualizing Information Geographically with Map Kit 2012 : Session 300 - Getting Around With Map Kit KML Régions : www.gitesdegaule.fr/KaraMeLise/ Déparetements : git.piprime.fr Git - php/pi-google-maps-api.git/ tree - pi-google-maps-api/res/france/regions/
  • 98. Références Sample Code s.sudre.free.fr/Stuff/CocoaHeads/STSimplified-CocoaHeads.zip
  • 100. QA &