├── AIMapViewWrapper ├── KML.framework │ ├── Versions │ │ ├── Current │ │ └── A │ │ │ ├── KML │ │ │ ├── Resources │ │ │ ├── Info.plist │ │ │ └── en.lproj │ │ │ │ └── InfoPlist.strings │ │ │ └── Headers │ │ │ ├── KMLConst.h │ │ │ ├── KMLMetadata.h │ │ │ ├── KMLAbstractGeometry.h │ │ │ ├── KMLFolder.h │ │ │ ├── KMLAbstractTimePrimitive.h │ │ │ ├── KMLAbstractSubStyle.h │ │ │ ├── KMLAbstractStyleSelector.h │ │ │ ├── KMLElement.h │ │ │ ├── KMLVec2.h │ │ │ ├── KMLAbstractView.h │ │ │ ├── KMLLineStyle.h │ │ │ ├── KMLLabelStyle.h │ │ │ ├── KMLSimpleData.h │ │ │ ├── KMLScale.h │ │ │ ├── KMLData.h │ │ │ ├── KMLTimeStamp.h │ │ │ ├── KMLPolyStyle.h │ │ │ ├── KMLAbstractObject.h │ │ │ ├── KMLSimpleField.h │ │ │ ├── KMLCoordinate.h │ │ │ ├── KMLDelete.h │ │ │ ├── KMLItemIcon.h │ │ │ ├── KMLChange.h │ │ │ ├── KMLLocation.h │ │ │ ├── KMLPair.h │ │ │ ├── KMLPlacemark.h │ │ │ ├── KMLOrientation.h │ │ │ ├── KMLParser.h │ │ │ ├── KMLCreate.h │ │ │ ├── KMLTimeSpan.h │ │ │ ├── KMLRegion.h │ │ │ ├── KMLViewVolume.h │ │ │ ├── KMLStyle.h │ │ │ ├── KMLIcon.h │ │ │ ├── KMLLatLonBox.h │ │ │ ├── KMLLatLonAltBox.h │ │ │ ├── KMLAlias.h │ │ │ ├── KMLStyleMap.h │ │ │ ├── KMLAbstractContainer.h │ │ │ ├── KMLMultiGeometry.h │ │ │ ├── KMLRoot.h │ │ │ ├── KMLResourceMap.h │ │ │ ├── KMLSchema.h │ │ │ ├── KMLImagePyramid.h │ │ │ ├── KML.h │ │ │ ├── KMLAbstractOverlay.h │ │ │ ├── KMLModel.h │ │ │ ├── KMLUpdate.h │ │ │ ├── KMLAbstractColorStyle.h │ │ │ ├── KMLDocument.h │ │ │ ├── KMLNetworkLink.h │ │ │ ├── KMLSchemaData.h │ │ │ ├── KMLListStyle.h │ │ │ ├── KMLLod.h │ │ │ ├── KMLIconStyle.h │ │ │ ├── KMLLookAt.h │ │ │ ├── KMLPhotoOverlay.h │ │ │ ├── KMLGroundOverlay.h │ │ │ ├── KMLPoint.h │ │ │ ├── KMLNetworkLinkControl.h │ │ │ ├── KMLBalloonStyle.h │ │ │ ├── KMLExtendedData.h │ │ │ ├── KMLCamera.h │ │ │ ├── KMLLineString.h │ │ │ ├── KMLLinearRing.h │ │ │ ├── KMLPolygon.h │ │ │ ├── KMLScreenOverlay.h │ │ │ └── KMLLink.h │ ├── KML │ ├── Headers │ └── Resources ├── en.lproj │ └── InfoPlist.strings ├── Default.png ├── Default@2x.png ├── Default-568h@2x.png ├── resources │ └── images │ │ └── plane.png ├── controller │ ├── AISampleViewController.h │ └── AISampleViewController.m ├── AIAppDelegate.h ├── AIMapViewWrapper-Prefix.pch ├── main.m ├── AIMapViewWrapper │ ├── Routing │ │ ├── AIRoutePath.h │ │ ├── AIRoute.h │ │ ├── AIOverlayRouteView.h │ │ ├── AIRoute.m │ │ ├── AIOverlayRouteView.m │ │ └── AIRoutePath.m │ ├── AIMapViewWrapper.h │ └── AIMapViewWrapper.m ├── AIMapViewWrapper-Info.plist └── AIAppDelegate.m ├── .gitignore └── README.md /AIMapViewWrapper/KML.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/KML: -------------------------------------------------------------------------------- 1 | Versions/Current/KML -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /AIMapViewWrapper/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /AIMapViewWrapper/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocoatoucher/AIMapViewWrapper/HEAD/AIMapViewWrapper/Default.png -------------------------------------------------------------------------------- /AIMapViewWrapper/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocoatoucher/AIMapViewWrapper/HEAD/AIMapViewWrapper/Default@2x.png -------------------------------------------------------------------------------- /AIMapViewWrapper/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocoatoucher/AIMapViewWrapper/HEAD/AIMapViewWrapper/Default-568h@2x.png -------------------------------------------------------------------------------- /AIMapViewWrapper/resources/images/plane.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocoatoucher/AIMapViewWrapper/HEAD/AIMapViewWrapper/resources/images/plane.png -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/KML: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocoatoucher/AIMapViewWrapper/HEAD/AIMapViewWrapper/KML.framework/Versions/A/KML -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocoatoucher/AIMapViewWrapper/HEAD/AIMapViewWrapper/KML.framework/Versions/A/Resources/Info.plist -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Resources/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cocoatoucher/AIMapViewWrapper/HEAD/AIMapViewWrapper/KML.framework/Versions/A/Resources/en.lproj/InfoPlist.strings -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | .DS_Store 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | *.xcworkspace 13 | !default.xcworkspace 14 | xcuserdata 15 | profile 16 | *.moved-aside 17 | DerivedData 18 | .idea/ 19 | -------------------------------------------------------------------------------- /AIMapViewWrapper/controller/AISampleViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // AISampleViewController.h 3 | // AIMapViewWrapper 4 | // 5 | // Created by CocoaToucher on 12/19/12. 6 | // Copyright (c) 2012 CocoaToucher. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AISampleViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLConst.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLConst.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | extern NSString *const kKMLInvalidKMLFormatNotification; 10 | extern NSString *const kKMLDescriptionKey; 11 | -------------------------------------------------------------------------------- /AIMapViewWrapper/AIAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AIAppDelegate.h 3 | // AIMapViewWrapper 4 | // 5 | // Created by CocoaToucher on 12/19/12. 6 | // Copyright (c) 2012 CocoaToucher. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AIAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /AIMapViewWrapper/AIMapViewWrapper-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'AIMapViewWrapper' target in the 'AIMapViewWrapper' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iOS SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /AIMapViewWrapper/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // AIMapViewWrapper 4 | // 5 | // Created by CocoaToucher on 12/19/12. 6 | // Copyright (c) 2012 CocoaToucher. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AIAppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AIAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /AIMapViewWrapper/AIMapViewWrapper/Routing/AIRoutePath.h: -------------------------------------------------------------------------------- 1 | // 2 | // AIRoutePath.h 3 | // AIMapViewWrapper 4 | // 5 | // Created by CocoaToucher on 12/24/12. 6 | // Copyright (c) 2012 CocoaToucher. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AIRoutePath : NSObject 12 | 13 | - (id)initWithKnots:(NSArray *)inKnots; 14 | 15 | @property(nonatomic, readonly) CGPathRef path; 16 | @property(nonatomic, readonly) CGPathRef shadowPath; 17 | @property(nonatomic, readonly) CGFloat totalDistance; 18 | 19 | - (CGPathRef)newTailWithDistance:(CGFloat)inDistance; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLMetadata.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLMetadata.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLElement.h" 11 | 12 | /** *Deprecated in KML 2.2; Use KMLExtendedData instead.* 13 | 14 | The KML Framework follows KML standard specification. 15 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 16 | */ 17 | @interface KMLMetadata : KMLElement 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLAbstractGeometry.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLAbstractGeometry.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractObject.h" 11 | 12 | /** This is an abstract element and cannot be used directly in a KML file. 13 | It provides a placeholder object for all derived Geometry objects. 14 | 15 | The KML Framework follows KML standard specification. 16 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 17 | */ 18 | @interface KMLAbstractGeometry : KMLAbstractObject 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLFolder.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLFolder.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractContainer.h" 11 | 12 | /** A Folder is used to arrange other Features hierarchically (Folders, Placemarks, NetworkLinks, or Overlays). 13 | A Feature is visible only if it and all its ancestors are visible. 14 | 15 | The KML Framework follows KML standard specification. 16 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 17 | */ 18 | @interface KMLFolder : KMLAbstractContainer 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLAbstractTimePrimitive.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLAbstractTimePrimitive.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractObject.h" 11 | 12 | /** This is an abstract element and cannot be used directly in a KML file. 13 | This element is extended by the KMLTimeSpan and KMLTimeStamp elements. 14 | 15 | The KML Framework follows KML standard specification. 16 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 17 | */ 18 | @interface KMLAbstractTimePrimitive : KMLAbstractObject 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLAbstractSubStyle.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLAbstractSubStyle.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractObject.h" 11 | 12 | /** This is an abstract element and cannot be used directly in a KML file. 13 | This element is extended by the KMLBalloonStyle, KMLListStyle and KMLAbstractColorStyle elements. 14 | 15 | The KML Framework follows KML standard specification. 16 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 17 | */ 18 | @interface KMLAbstractSubStyle : KMLAbstractObject 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLAbstractStyleSelector.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLAbstractStyleSelector.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractObject.h" 11 | 12 | /** This is an abstract element and cannot be used directly in a KML file. 13 | It is the base type for the <Style> and <StyleMap> elements. 14 | The StyleMap element selects a style based on the current mode of the Placemark. 15 | An element derived from StyleSelector is uniquely identified by its id and its url. 16 | 17 | The KML Framework follows KML standard specification. 18 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 19 | */ 20 | @interface KMLAbstractStyleSelector : KMLAbstractObject 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLElement.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLElement.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLType.h" 11 | 12 | 13 | /** KMLElement is the root class of KML element hierarchies. 14 | */ 15 | @interface KMLElement : NSObject 16 | 17 | 18 | /// --------------------------------- 19 | /// @name Accessing Element Properties 20 | /// --------------------------------- 21 | 22 | /** A parent KMLElement of the receiver. 23 | */ 24 | @property (unsafe_unretained, nonatomic) KMLElement *parent; 25 | 26 | 27 | /// --------------------------------- 28 | /// @name KML 29 | /// --------------------------------- 30 | 31 | /** Return the KML generated by the receiver. 32 | @return The KML string. 33 | */ 34 | - (NSString *)kml; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLVec2.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLVec2.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLElement.h" 11 | 12 | /** vec2 field type. 13 | 14 | The KML Framework follows KML standard specification. 15 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 16 | */ 17 | @interface KMLVec2 : KMLElement 18 | 19 | 20 | /// --------------------------------- 21 | /// @name Accessing Properties 22 | /// --------------------------------- 23 | 24 | /** x */ 25 | @property (nonatomic, assign) CGFloat x; 26 | 27 | /** y */ 28 | @property (nonatomic, assign) CGFloat y; 29 | 30 | /** xunits */ 31 | @property (nonatomic, assign) KMLUnits xunits; 32 | 33 | /** yunits */ 34 | @property (nonatomic, assign) KMLUnits yunits; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /AIMapViewWrapper/AIMapViewWrapper/Routing/AIRoute.h: -------------------------------------------------------------------------------- 1 | // 2 | // AIRoute.h 3 | // AIMapViewWrapper 4 | // 5 | // Created by CocoaToucher on 12/24/12. 6 | // Copyright (c) 2012 CocoaToucher. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AIRoute : NSObject < MKOverlay > 12 | 13 | /** 14 | inCoordinates array should include at least more than 1 CLLocation object 15 | @param array of CLLocation objects 16 | @returns the route overlay 17 | */ 18 | + (AIRoute *)routeWithCoordinates:(NSArray *)inCoordinates; 19 | 20 | /** 21 | Always returns the coordinate for the center point of boundingMapRect 22 | */ 23 | @property(nonatomic, readonly) CLLocationCoordinate2D coordinate; 24 | 25 | /** 26 | Calculated with coordinates array provided in initialization method 27 | */ 28 | @property(nonatomic, readonly) MKMapRect boundingMapRect; 29 | 30 | /** 31 | Array of CLLocation objects given in class constructor method 32 | */ 33 | @property(nonatomic, strong, readonly) NSArray *coordinates; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLAbstractView.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLAbstractView.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractObject.h" 11 | 12 | @class KMLAbstractTimePrimitive; 13 | 14 | /** This is an abstract element and cannot be used directly in a KML file. 15 | This element is extended by the KMLCamera and KMLLookAt elements. 16 | 17 | The KML Framework follows KML standard specification. 18 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 19 | */ 20 | @interface KMLAbstractView : KMLAbstractObject 21 | 22 | 23 | /// --------------------------------- 24 | /// @name Accessing Properties 25 | /// --------------------------------- 26 | 27 | /** See KMLAbstractTimePrimitive. */ 28 | @property (strong, nonatomic) KMLAbstractTimePrimitive *timePrimitive; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLLineStyle.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLLineStyle.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractColorStyle.h" 11 | 12 | /** Specifies the drawing style (color, color mode, and line width) for all line geometry. 13 | Line geometry includes the outlines of outlined polygons and the extruded "tether" of Placemark icons (if extrusion is enabled). 14 | 15 | The KML Framework follows KML standard specification. 16 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 17 | */ 18 | @interface KMLLineStyle : KMLAbstractColorStyle 19 | 20 | 21 | /// --------------------------------- 22 | /// @name Accessing Properties 23 | /// --------------------------------- 24 | 25 | /** Width of the line, in pixels. */ 26 | @property (nonatomic, assign) CGFloat width; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLLabelStyle.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLLabelStyle.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractColorStyle.h" 11 | 12 | /** Specifies how the <name> of a Feature is drawn in the 3D viewer. 13 | A custom color, color mode, and scale for the label (name) can be specified. 14 | 15 | @warning *Note:* The <labelColor> tag is deprecated. Use <LabelStyle> instead. 16 | 17 | The KML Framework follows KML standard specification. 18 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 19 | */ 20 | @interface KMLLabelStyle : KMLAbstractColorStyle 21 | 22 | 23 | /// --------------------------------- 24 | /// @name Accessing Properties 25 | /// --------------------------------- 26 | 27 | /** Resizes the label. */ 28 | @property (nonatomic, assign) CGFloat scale; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLSimpleData.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLSimpleData.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLElement.h" 11 | 12 | /** This element assigns a value to the custom data field identified by the name attribute. 13 | The type and name of this custom data field are declared in the <Schema> element. 14 | 15 | The KML Framework follows KML standard specification. 16 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 17 | */ 18 | @interface KMLSimpleData : KMLElement 19 | 20 | 21 | /// --------------------------------- 22 | /// @name Accessing Properties 23 | /// --------------------------------- 24 | 25 | /** Name of the SimpleData. */ 26 | @property (strong, nonatomic) NSString *name; 27 | 28 | /** Value of the SimpleData. */ 29 | @property (strong, nonatomic) NSString *value; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLScale.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLScale.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractObject.h" 11 | 12 | /** Scales a model along the x, y, and z axes in the model's coordinate space. 13 | 14 | 15 | 2.5 16 | 2.5 17 | 3.5 18 | 19 | 20 | The KML Framework follows KML standard specification. 21 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 22 | */ 23 | @interface KMLScale : KMLAbstractObject 24 | 25 | 26 | /// --------------------------------- 27 | /// @name Accessing Properties 28 | /// --------------------------------- 29 | 30 | /** x */ 31 | @property (nonatomic, assign) CGFloat x; 32 | 33 | /** y */ 34 | @property (nonatomic, assign) CGFloat y; 35 | 36 | /** z */ 37 | @property (nonatomic, assign) CGFloat z; 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLData.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLData.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLElement.h" 11 | 12 | /** An untyped name/value pair. 13 | 14 | The KML Framework follows KML standard specification. 15 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 16 | */ 17 | @interface KMLData : KMLElement 18 | 19 | 20 | /// --------------------------------- 21 | /// @name Accessing Properties 22 | /// --------------------------------- 23 | 24 | /** Name of the data pair. 25 | 26 | This attribute is used to identify the data pair within the KML file. 27 | */ 28 | @property (strong, nonatomic) NSString *name; 29 | 30 | /** An optional formatted version of name, to be used for display purposes. */ 31 | @property (strong, nonatomic) NSString *displayName; 32 | 33 | /** Value of the data pair. */ 34 | @property (strong, nonatomic) NSString *value; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLTimeStamp.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLTimeStamp.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractTimePrimitive.h" 11 | 12 | /** Represents a single moment in time. 13 | This is a simple element and contains no children. 14 | Its value is a dateTime, specified in XML time (see XML Schema Part 2: Datatypes Second Edition). 15 | The precision of the TimeStamp is dictated by the dateTime value in the <when> element. 16 | 17 | The KML Framework follows KML standard specification. 18 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 19 | */ 20 | @interface KMLTimeStamp : KMLAbstractTimePrimitive 21 | 22 | 23 | /// --------------------------------- 24 | /// @name Accessing Properties 25 | /// --------------------------------- 26 | 27 | /** Specifies a single moment in time. */ 28 | @property (strong, nonatomic) NSDate *when; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLPolyStyle.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLPolyStyle.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractColorStyle.h" 11 | 12 | /** Specifies the drawing style for all polygons, including polygon extrusions (which look like the walls of buildings) and line extrusions (which look like solid fences). 13 | 14 | The KML Framework follows KML standard specification. 15 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 16 | */ 17 | @interface KMLPolyStyle : KMLAbstractColorStyle 18 | 19 | 20 | /// --------------------------------- 21 | /// @name Accessing Properties 22 | /// --------------------------------- 23 | 24 | /** Boolean value. 25 | 26 | Specifies whether to fill the polygon. */ 27 | @property (nonatomic, assign) BOOL fill; 28 | 29 | /** Boolean value. 30 | 31 | Specifies whether to outline the polygon. 32 | Polygon outlines use the current LineStyle. */ 33 | @property (nonatomic, assign) BOOL outline; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLAbstractObject.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLAbstractObject.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLElement.h" 11 | 12 | /** This is an abstract base class and cannot be used directly in a KML file. 13 | It provides the id attribute, which allows unique identification of a KML element, and the targetId attribute, which is used to reference objects that have already been loaded into Google Earth. 14 | The id attribute must be assigned if the Update mechanism is to be used. 15 | 16 | The KML Framework follows KML standard specification. 17 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 18 | */ 19 | @interface KMLAbstractObject : KMLElement 20 | 21 | /// --------------------------------- 22 | /// @name Accessing Properties 23 | /// --------------------------------- 24 | 25 | /** The unique identification of a KML element. */ 26 | @property (strong, nonatomic) NSString *objectID; 27 | 28 | /** This is used to reference objects that have already been loaded into app. */ 29 | @property (strong, nonatomic) NSString *targetID; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLSimpleField.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLSimpleField.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLElement.h" 11 | 12 | /** The declaration of the custom field. 13 | 14 | The KML Framework follows KML standard specification. 15 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 16 | */ 17 | @interface KMLSimpleField : KMLElement 18 | 19 | 20 | /// --------------------------------- 21 | /// @name Accessing Properties 22 | /// --------------------------------- 23 | 24 | /** Type of the field. 25 | 26 | This attribute can be one of the following: 27 | 28 | - string 29 | - int 30 | - uint 31 | - short 32 | - ushort 33 | - float 34 | - double 35 | - bool 36 | */ 37 | @property (strong, nonatomic) NSString *type; 38 | 39 | /** Name of the field. */ 40 | @property (strong, nonatomic) NSString *name; 41 | 42 | /** The name, if any, to be used when the field name is displayed to the Google Earth user. 43 | 44 | Use the [CDATA] element to escape standard HTML markup. */ 45 | @property (strong, nonatomic) NSString *displayName; 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /AIMapViewWrapper/AIMapViewWrapper-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.cocoatoucher.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLCoordinate.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLCoordinate.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLElement.h" 11 | 12 | /** Coordinate type. 13 | 14 | The KML Framework follows KML standard specification. 15 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 16 | */ 17 | @interface KMLCoordinate : KMLElement 18 | 19 | 20 | /// --------------------------------- 21 | /// @name Accessing Properties 22 | /// --------------------------------- 23 | 24 | /** Latitude */ 25 | @property (nonatomic, assign) CGFloat latitude; 26 | 27 | /** Longitude */ 28 | @property (nonatomic, assign) CGFloat longitude; 29 | 30 | /** Altitude */ 31 | @property (nonatomic, assign) CGFloat altitude; 32 | 33 | 34 | /// --------------------------------- 35 | /// @name Initialize Element 36 | /// --------------------------------- 37 | 38 | /** Returns the new receiver of KMLCoordinate. 39 | @param text Four or more tuples, each consisting of floating point values for longitude, latitude, and altitude.Do not include spaces within a tuple. 40 | @return KMLCoordinate. 41 | */ 42 | - (id)initWithText:(NSString *)text; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLDelete.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLDelete.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLElement.h" 11 | 12 | @class KMLAbstractFeature; 13 | 14 | /** Deletes features from a complex element that has already been loaded via a KMLNetworkLink. 15 | The <targetHref> element in KMLUpdate specifies the .kml or .kmz file containing the data to be deleted. 16 | Within that file, the element to be deleted must already have an explicit id defined for it. 17 | The <Delete> element references this id in the targetId attribute. 18 | Child elements for <Delete>, which are the only elements that can be deleted, are Document, Folder, GroundOverlay, Placemark, and ScreenOverlay. 19 | 20 | The KML Framework follows KML standard specification. 21 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 22 | */ 23 | @interface KMLDelete : KMLElement 24 | 25 | 26 | /// --------------------------------- 27 | /// @name Accessing Properties 28 | /// --------------------------------- 29 | 30 | /** The Feature child elements of this element. */ 31 | @property (strong, nonatomic) KMLAbstractFeature *feature; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLItemIcon.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLItemIcon.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractObject.h" 11 | 12 | /** Icon used in the List view that reflects the state of a Folder or Link fetch. 13 | Icons associated with the open and closed modes are used for Folders and Network Links. 14 | Icons associated with the error and fetching0, fetching1, and fetching2 modes are used for Network Links. 15 | 16 | The KML Framework follows KML standard specification. 17 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 18 | */ 19 | @interface KMLItemIcon : KMLAbstractObject 20 | 21 | 22 | /// --------------------------------- 23 | /// @name Accessing Properties 24 | /// --------------------------------- 25 | 26 | /** Specifies the current state of the NetworkLink or Folder. 27 | 28 | Possible values are *open*, *closed*, *error*, *fetching0*, *fetching1*, and *fetching2*. 29 | These values can be combined by inserting a space between two values (no comma). */ 30 | @property (nonatomic, assign) KMLItemIconMode state; 31 | 32 | /** Specifies the URI of the image used in the List View for the Feature. */ 33 | @property (strong, nonatomic) NSString *href; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLChange.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLChange.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLElement.h" 11 | 12 | @class KMLAbstractObject; 13 | 14 | /** Modifies the values in an element that has already been loaded with a KMLNetworkLink. 15 | Within the Change element, the child to be modified must include a targetId attribute that references the original element's id. 16 | This update can be considered a "sparse update": in the modified element, only the values listed in <Change> are replaced; all other values remained untouched. 17 | When <Change> is applied to a set of coordinates, the new coordinates replace the current coordinates. 18 | Children of this element are the element(s) to be modified, which are identified by the targetId attribute. 19 | 20 | The KML Framework follows KML standard specification. 21 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 22 | */ 23 | @interface KMLChange : KMLElement 24 | 25 | 26 | /// --------------------------------- 27 | /// @name Accessing Properties 28 | /// --------------------------------- 29 | 30 | /** The Object child elements of this element. */ 31 | @property (strong, nonatomic) KMLAbstractObject *object; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLLocation.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLLocation.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractObject.h" 11 | 12 | /** Specifies the exact coordinates of the Model's origin in latitude, longitude, and altitude. 13 | Latitude and longitude measurements are standard lat-lon projection with WGS84 datum. 14 | Altitude is distance above the earth's surface, in meters, and is interpreted according to <altitudeMode> or <gx:altitudeMode>. 15 | 16 | 17 | 39.55375305703105 18 | -118.9813220168456 19 | 1223 20 | 21 | 22 | The KML Framework follows KML standard specification. 23 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 24 | */ 25 | @interface KMLLocation : KMLAbstractObject 26 | 27 | 28 | /// --------------------------------- 29 | /// @name Accessing Properties 30 | /// --------------------------------- 31 | 32 | /** Longitude */ 33 | @property (nonatomic, assign) CGFloat longitude; 34 | 35 | /** Latitude */ 36 | @property (nonatomic, assign) CGFloat latitude; 37 | 38 | /** Altitude */ 39 | @property (nonatomic, assign) NSInteger altitude; 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLPair.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLPair.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractObject.h" 11 | 12 | @class KMLStyle; 13 | 14 | /** Defines a key/value pair that maps a mode (normal or highlight) to the predefined <styleUrl>. 15 | 16 | The KML Framework follows KML standard specification. 17 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 18 | */ 19 | @interface KMLPair : KMLAbstractObject 20 | 21 | 22 | /// --------------------------------- 23 | /// @name Accessing Properties 24 | /// --------------------------------- 25 | 26 | /** Identifies the key. */ 27 | @property (strong, nonatomic) NSString *key; 28 | 29 | /** References the style. 30 | 31 | In <styleUrl>, for referenced style elements that are local to the KML document, a simple # referencing is used. 32 | For styles that are contained in external files, use a full URL along with # referencing. 33 | For example: 34 | 35 | 36 | normal 37 | http://myserver.com/populationProject.xml#example_style_off 38 | 39 | */ 40 | @property (strong, nonatomic) NSString *styleUrl; 41 | 42 | /** References the style. 43 | 44 | See KMLStyle.*/ 45 | @property (strong, nonatomic) KMLStyle *style; 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLPlacemark.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLPlacemark.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractFeature.h" 11 | 12 | @class KMLAbstractGeometry; 13 | 14 | /** A Placemark is a Feature with associated Geometry. 15 | In Google Earth, a Placemark appears as a list item in the Places panel. 16 | A Placemark with a Point has an icon associated with it that marks a point on the Earth in the 3D viewer. 17 | (In the Google Earth 3D viewer, a Point Placemark is the only object you can click or roll over. 18 | Other Geometry objects do not have an icon in the 3D viewer. 19 | To give the user something to click in the 3D viewer, you would need to create a MultiGeometry object that contains both a Point and the other Geometry object.) 20 | 21 | The KML Framework follows KML standard specification. 22 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 23 | */ 24 | @interface KMLPlacemark : KMLAbstractFeature 25 | 26 | 27 | /// --------------------------------- 28 | /// @name Accessing Properties 29 | /// --------------------------------- 30 | 31 | /** Returns the KMLAbstractGeometry of this element. 32 | @return The KMLAbstractGeometry object or nil if object not found. 33 | */ 34 | @property (strong, nonatomic) KMLAbstractGeometry *geometry; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLOrientation.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLOrientation.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractObject.h" 11 | 12 | /** Describes rotation of a 3D model's coordinate system to position the object in Google Earth. 13 | 14 | 15 | 45.0 16 | 10.0 17 | 0.0 18 | 19 | 20 | The KML Framework follows KML standard specification. 21 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 22 | */ 23 | @interface KMLOrientation : KMLAbstractObject 24 | 25 | 26 | /// --------------------------------- 27 | /// @name Accessing Properties 28 | /// --------------------------------- 29 | 30 | /** Rotation about the z axis (normal to the Earth's surface). A value of 0 (the default) equals North. 31 | 32 | A positive rotation is clockwise around the z axis and specified in degrees from 0 to 360. */ 33 | @property (nonatomic, assign) CGFloat heading; 34 | 35 | /** Rotation about the x axis. 36 | 37 | A positive rotation is clockwise around the x axis and specified in degrees from 0 to 180. */ 38 | @property (nonatomic, assign) CGFloat tilt; 39 | 40 | /** Rotation about the y axis. 41 | 42 | A positive rotation is clockwise around the y axis and specified in degrees from 0 to 180. */ 43 | @property (nonatomic, assign) CGFloat roll; 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLParser.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLParser.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class KMLRoot; 12 | 13 | 14 | /** Instances of this class parse KML documents. 15 | */ 16 | @interface KMLParser : NSObject 17 | 18 | 19 | /// --------------------------------- 20 | /// @name Parsing 21 | /// --------------------------------- 22 | 23 | /** Parsing the KML content referenced by the given URL. 24 | 25 | @param url An NSURL object specifying a URL. The URL must be fully qualified and refer to a scheme that is supported by the NSURL class. 26 | @return An initialized KMLRoot object or nil if an error occurs. 27 | */ 28 | + (KMLRoot *)parseKMLAtURL:(NSURL *)url; 29 | 30 | /** Parsing the KML content referenced by the given File path. 31 | 32 | @param path The absolute path of the file from which to read KML data. 33 | @return An initialized KMLRoot object or nil if an error occurs. 34 | */ 35 | + (KMLRoot *)parseKMLAtPath:(NSString *)path; 36 | 37 | /** Parsing the KML content referenced by the given KML string. 38 | 39 | @param string The KML string. 40 | @return An initialized KMLRoot object or nil if an error occurs. 41 | */ 42 | + (KMLRoot *)parseKMLWithString:(NSString*)string; 43 | 44 | /** Parsing the KML content referenced by the given data. 45 | 46 | @param data The data from which to read KML data. 47 | @return An initialized KMLRoot object or nil if an error occurs. 48 | */ 49 | + (KMLRoot *)parseKMLWithData:(NSData*)data; 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLCreate.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLCreate.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLElement.h" 11 | 12 | @class KMLAbstractContainer; 13 | 14 | /** Adds new elements to a Folder or Document that has already been loaded via a KMLNetworkLink. 15 | The <targetHref> element in KMLUpdate specifies the URL of the .kml or .kmz file that contained the original Folder or Document. 16 | Within that file, the Folder or Document that is to contain the new data must already have an explicit id defined for it. 17 | This id is referenced as the targetId attribute of the Folder or Document within <Create> that contains the element to be added. 18 | Once an object has been created and loaded into Google Earth, it takes on the URL of the original parent Document of Folder. 19 | To perform subsequent updates to objects added with this Update/Create mechanism, set <targetHref> to the URL of the original Document or Folder (not the URL of the file that loaded the intervening updates). 20 | 21 | The KML Framework follows KML standard specification. 22 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 23 | */ 24 | @interface KMLCreate : KMLElement 25 | 26 | 27 | /// --------------------------------- 28 | /// @name Accessing Properties 29 | /// --------------------------------- 30 | 31 | /** The Container child elements of this element. */ 32 | @property (strong, nonatomic) KMLAbstractContainer *container; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLTimeSpan.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLTimeSpan.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractTimePrimitive.h" 11 | 12 | /** Represents an extent in time bounded by begin and end dateTimes. 13 | If <begin> or <end> is missing, then that end of the period is unbounded (see Example below). 14 | The dateTime is defined according to XML Schema time (see XML Schema Part 2: Datatypes Second Edition). 15 | The value can be expressed as yyyy-mm-ddThh:mm:sszzzzzz, where T is the separator between the date and the time, and the time zone is either Z (for UTC) or zzzzzz, which represents ±hh:mm in relation to UTC. 16 | Additionally, the value can be expressed as a date only. 17 | See KMLTimeStamp for examples. 18 | 19 | The KML Framework follows KML standard specification. 20 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 21 | */ 22 | @interface KMLTimeSpan : KMLAbstractTimePrimitive 23 | 24 | 25 | /// --------------------------------- 26 | /// @name Accessing Properties 27 | /// --------------------------------- 28 | 29 | /** Describes the beginning instant of a time period. 30 | 31 | If absent, the beginning of the period is unbounded. */ 32 | @property (strong, nonatomic) NSDate *begin; 33 | 34 | /** Describes the ending instant of a time period. 35 | 36 | If absent, the end of the period is unbounded. */ 37 | @property (strong, nonatomic) NSDate *end; 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLRegion.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLRegion.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractObject.h" 11 | 12 | @class KMLLatLonAltBox; 13 | @class KMLLod; 14 | 15 | /** A region contains a bounding box (KMLLatLonAltBox) that describes an area of interest defined by geographic coordinates and altitudes. 16 | In addition, a Region contains an LOD (level of detail) extent (KMLLod) that defines a validity range of the associated Region in terms of projected screen size. 17 | A Region is said to be "active" when the bounding box is within the user's view and the LOD requirements are met. 18 | Objects associated with a Region are drawn only when the Region is active. 19 | When the <viewRefreshMode> is onRegion, the Link or Icon is loaded only when the Region is active. 20 | See the "Topics in KML" page on Regions for more details. 21 | In a Container or NetworkLink hierarchy, this calculation uses the Region that is the closest ancestor in the hierarchy. 22 | 23 | The KML Framework follows KML standard specification. 24 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 25 | */ 26 | @interface KMLRegion : KMLAbstractObject 27 | 28 | 29 | /// --------------------------------- 30 | /// @name Accessing Properties 31 | /// --------------------------------- 32 | 33 | /** See KMLLatLonAltBox. */ 34 | @property (strong, nonatomic) KMLLatLonAltBox *latLonAltBox; 35 | 36 | /** See KMLLod. */ 37 | @property (strong, nonatomic) KMLLod *lod; 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLViewVolume.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLViewVolume.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLElement.h" 11 | 12 | /** Defines how much of the current scene is visible. 13 | Specifying the field of view is analogous to specifying the lens opening in a physical camera. 14 | A small field of view, like a telephoto lens, focuses on a small part of the scene. 15 | A large field of view, like a wide-angle lens, focuses on a large part of the scene. 16 | 17 | The KML Framework follows KML standard specification. 18 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 19 | */ 20 | @interface KMLViewVolume : KMLElement 21 | 22 | 23 | /// --------------------------------- 24 | /// @name Accessing Properties 25 | /// --------------------------------- 26 | 27 | /** Angle, in degrees, between the camera's viewing direction and the left side of the view volume. */ 28 | @property (nonatomic, assign) CGFloat leftFov; 29 | 30 | /** Angle, in degrees, between the camera's viewing direction and the right side of the view volume. */ 31 | @property (nonatomic, assign) CGFloat rightFov; 32 | 33 | /** Angle, in degrees, between the camera's viewing direction and the bottom side of the view volume. */ 34 | @property (nonatomic, assign) CGFloat bottomFov; 35 | 36 | /** Angle, in degrees, between the camera's viewing direction and the top side of the view volume. */ 37 | @property (nonatomic, assign) CGFloat topFov; 38 | 39 | /** Measurement in meters along the viewing direction from the camera viewpoint to the PhotoOverlay shape. */ 40 | @property (nonatomic, assign) CGFloat near; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLStyle.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLStyle.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractStyleSelector.h" 11 | 12 | @class KMLIconStyle; 13 | @class KMLLabelStyle; 14 | @class KMLLineStyle; 15 | @class KMLPolyStyle; 16 | @class KMLBalloonStyle; 17 | @class KMLListStyle; 18 | 19 | /** A Style defines an addressable style group that can be referenced by StyleMaps and Features. 20 | Styles affect how Geometry is presented in the 3D viewer and how Features appear in the Places panel of the List view. 21 | Shared styles are collected in a <Document> and must have an id defined for them so that they can be referenced by the individual Features that use them. 22 | 23 | Use an id to refer to the style from a <styleUrl>. 24 | 25 | The KML Framework follows KML standard specification. 26 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 27 | */ 28 | @interface KMLStyle : KMLAbstractStyleSelector 29 | 30 | 31 | /// --------------------------------- 32 | /// @name Accessing Properties 33 | /// --------------------------------- 34 | 35 | /** See KMLIconStyle. */ 36 | @property (strong, nonatomic) KMLIconStyle *iconStyle; 37 | 38 | /** See KMLLabelStyle. */ 39 | @property (strong, nonatomic) KMLLabelStyle *labelStyle; 40 | 41 | /** See KMLLineStyle. */ 42 | @property (strong, nonatomic) KMLLineStyle *lineStyle; 43 | 44 | /** See KMLPolyStyle. */ 45 | @property (strong, nonatomic) KMLPolyStyle *polyStyle; 46 | 47 | /** See KMLBalloonStyle. */ 48 | @property (strong, nonatomic) KMLBalloonStyle *balloonStyle; 49 | 50 | /** See KMLListStyle. */ 51 | @property (strong, nonatomic) KMLListStyle *listStyle; 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLIcon.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLIcon.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractObject.h" 11 | 12 | /** Defines an image associated with an Icon style or overlay. 13 | The required <href> child element defines the location of the image to be used as the overlay or as the icon for the placemark. 14 | This location can either be on a local file system or a remote web server. 15 | The <gx:x>, <gx:y>, <gx:w>, and <gx:h> elements are used to select one icon from an image that contains multiple icons (often referred to as an icon palette. 16 | 17 | The KML Framework follows KML standard specification. 18 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 19 | */ 20 | @interface KMLIcon : KMLAbstractObject 21 | 22 | 23 | /// --------------------------------- 24 | /// @name Accessing Properties 25 | /// --------------------------------- 26 | 27 | /** An HTTP address or a local file specification used to load an icon. */ 28 | @property (strong, nonatomic) NSString *href; 29 | 30 | /** see KMLLink. */ 31 | @property (nonatomic, assign) KMLRefreshMode refreshMode; 32 | 33 | /** see KMLLink. */ 34 | @property (nonatomic, assign) CGFloat refreshInterval; 35 | 36 | /** see KMLLink. */ 37 | @property (nonatomic, assign) KMLViewRefreshMode viewRefreshMode; 38 | 39 | /** see KMLLink. */ 40 | @property (nonatomic, assign) CGFloat viewRefreshTime; 41 | 42 | /** see KMLLink. */ 43 | @property (nonatomic, assign) CGFloat viewBoundScale; 44 | 45 | /** see KMLLink. */ 46 | @property (strong, nonatomic) NSString *viewFormat; 47 | 48 | /** see KMLLink. */ 49 | @property (strong, nonatomic) NSString *httpQuery; 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLLatLonBox.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLLatLonBox.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractObject.h" 11 | 12 | /** Specifies where the top, bottom, right, and left sides of a bounding box for the ground overlay are aligned. 13 | 14 | The KML Framework follows KML standard specification. 15 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 16 | */ 17 | @interface KMLLatLonBox : KMLAbstractObject 18 | 19 | 20 | /// --------------------------------- 21 | /// @name Accessing Properties 22 | /// --------------------------------- 23 | 24 | /** Specifies the latitude of the north edge of the bounding box, in decimal degrees from 0 to ±90. */ 25 | @property (nonatomic, assign) CGFloat north; 26 | 27 | /** Specifies the latitude of the south edge of the bounding box, in decimal degrees from 0 to ±90. */ 28 | @property (nonatomic, assign) CGFloat south; 29 | 30 | /** Specifies the longitude of the east edge of the bounding box, in decimal degrees from 0 to ±180. 31 | 32 | (For overlays that overlap the meridian of 180° longitude, values can extend beyond that range.) */ 33 | @property (nonatomic, assign) CGFloat east; 34 | 35 | /** Specifies the longitude of the west edge of the bounding box, in decimal degrees from 0 to ±180. 36 | (For overlays that overlap the meridian of 180° longitude, values can extend beyond that range.) */ 37 | @property (nonatomic, assign) CGFloat west; 38 | 39 | /** Specifies a rotation of the overlay about its center, in degrees. 40 | 41 | Values can be ±180. The default is 0 (north). 42 | Rotations are specified in a counterclockwise direction. */ 43 | @property (nonatomic, assign) CGFloat rotation; 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLLatLonAltBox.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLLatLonAltBox.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractObject.h" 11 | 12 | /** A bounding box that describes an area of interest defined by geographic coordinates and altitudes. 13 | 14 | The KML Framework follows KML standard specification. 15 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 16 | */ 17 | @interface KMLLatLonAltBox : KMLAbstractObject 18 | 19 | 20 | /// --------------------------------- 21 | /// @name Accessing Properties 22 | /// --------------------------------- 23 | 24 | /** Specifies the latitude of the north edge of the bounding box, in decimal degrees from 0 to ±90. */ 25 | @property (nonatomic, assign) CGFloat north; 26 | 27 | /** Specifies the latitude of the south edge of the bounding box, in decimal degrees from 0 to ±90. */ 28 | @property (nonatomic, assign) CGFloat south; 29 | 30 | /** Specifies the longitude of the east edge of the bounding box, in decimal degrees from 0 to ±180. */ 31 | @property (nonatomic, assign) CGFloat east; 32 | 33 | /** Specifies the longitude of the west edge of the bounding box, in decimal degrees from 0 to ±180. */ 34 | @property (nonatomic, assign) CGFloat west; 35 | 36 | /** Specified in meters (and is affected by the altitude mode specification). */ 37 | @property (nonatomic, assign) CGFloat minAltitude; 38 | 39 | /** Specified in meters (and is affected by the altitude mode specification). */ 40 | @property (nonatomic, assign) CGFloat maxAltitude; 41 | 42 | /** Possible values for <altitudeMode> are *clampToGround*, *relativeToGround*, and *absolute*. 43 | 44 | Also see KMLLatLonBox. */ 45 | @property (nonatomic, assign) KMLAltitudeMode altitudeMode; 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLAlias.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLAlias.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractObject.h" 11 | 12 | /** Contains a mapping from a <sourceHref> to a <targetHref>. 13 | 14 | The KML Framework follows KML standard specification. 15 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 16 | */ 17 | @interface KMLAlias : KMLAbstractObject 18 | 19 | 20 | /// --------------------------------- 21 | /// @name Accessing Properties 22 | /// --------------------------------- 23 | 24 | /** Specifies the texture file to be fetched by Google Earth. 25 | 26 | This reference can be a relative reference to an image file within the .kmz archive, or it can be an absolute reference to the file (for example, a URL) */ 27 | @property (strong, nonatomic) NSString *targetHref; 28 | 29 | /** Is the path specified for the texture file in the Collada .dae file. 30 | 31 | In Google Earth, if this mapping is not supplied, the following rules are used to locate the textures referenced in the Collada (.dae) file: 32 | 33 | - *No path*: If the texture name does not include a path, Google Earth looks for the texture in the same directory as the .dae file that references it. 34 | - *Relative path*: If the texture name includes a relative path (for example, ../images/mytexture.jpg), Google Earth interprets the path as being relative to the .dae file that references it. 35 | - *Absolute path*: If the texture name is an absolute path (c:\mytexture.jpg) or a network path (for example, http://myserver.com/mytexture.jpg), Google Earth looks for the file in the specified location, regardless of where the .dae file is located. 36 | */ 37 | @property (strong, nonatomic) NSString *sourceHref; 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLStyleMap.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLStyleMap.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractStyleSelector.h" 11 | 12 | @class KMLPair; 13 | 14 | /** A <StyleMap> maps between two different Styles. 15 | Typically a <StyleMap> element is used to provide separate normal and highlighted styles for a placemark, so that the highlighted version appears when the user mouses over the icon in Google Earth. 16 | 17 | The KML Framework follows KML standard specification. 18 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 19 | */ 20 | @interface KMLStyleMap : KMLAbstractStyleSelector 21 | 22 | 23 | /// --------------------------------- 24 | /// @name Accessing Properties 25 | /// --------------------------------- 26 | 27 | /** The Pair child elements of this element. */ 28 | @property (strong, nonatomic, readonly) NSArray *pairs; 29 | 30 | 31 | /// --------------------------------- 32 | /// @name Adding Pair 33 | /// --------------------------------- 34 | 35 | /** Inserts a given KMLPair object at the end of the pair array. 36 | @param pair The KMLPair to add to the end of the pair array. 37 | */ 38 | - (void)addPair:(KMLPair *)pair; 39 | 40 | /** Adds the KMLPair objects contained in another given array to the end of the pair array. 41 | @param array An array of KMLPair objects to add to the end of the pair array. 42 | */ 43 | - (void)addPairs:(NSArray *)array; 44 | 45 | 46 | /// --------------------------------- 47 | /// @name Removing Pair 48 | /// --------------------------------- 49 | 50 | /** Removes all occurrences in the pair array of a given KMLPair object. 51 | @param pair The KMLPair object to remove from the pair array. 52 | */ 53 | - (void)removePair:(KMLPair *)pair; 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLAbstractContainer.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLAbstractContainer.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractFeature.h" 11 | 12 | /** This is an abstract element and cannot be used directly in a KML file. 13 | A Container element holds one or more Features and allows the creation of nested hierarchies. 14 | 15 | The KML Framework follows KML standard specification. 16 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 17 | */ 18 | @interface KMLAbstractContainer : KMLAbstractFeature 19 | 20 | 21 | /// --------------------------------- 22 | /// @name Accessing Properties 23 | /// --------------------------------- 24 | 25 | /** The Feature child elements of this element. */ 26 | @property (strong, nonatomic, readonly) NSArray *features; 27 | 28 | 29 | /// --------------------------------- 30 | /// @name Adding Feature 31 | /// --------------------------------- 32 | 33 | /** Inserts a given KMLAbstractFeature object at the end of the feature array. 34 | @param feature The KMLAbstractFeature to add to the end of the feature arrayt. 35 | */ 36 | - (void)addFeature:(KMLAbstractFeature *)feature; 37 | 38 | /** Adds the KMLAbstractFeature objects contained in another given array to the end of the feature array. 39 | @param array An array of KMLAbstractFeature objects to add to the end of the feature array. 40 | */ 41 | - (void)addFeatures:(NSArray *)array; 42 | 43 | 44 | 45 | /// --------------------------------- 46 | /// @name Removing Feature 47 | /// --------------------------------- 48 | 49 | /** Removes all occurrences in the feature array of a given KMLAbstractFeature object. 50 | @param feature The KMLAbstractFeature object to remove from the feature array. 51 | */ 52 | - (void)removeFeature:(KMLAbstractFeature *)feature; 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLMultiGeometry.h: -------------------------------------------------------------------------------- 1 | // 2 | // NAKLMultiGeometry.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractGeometry.h" 11 | 12 | /** A container for zero or more geometry primitives associated with the same feature. 13 | 14 | @warning *Note:* The <GeometryCollection> tag has been deprecated. Use <MultiGeometry> instead. 15 | 16 | The KML Framework follows KML standard specification. 17 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 18 | */ 19 | @interface KMLMultiGeometry : KMLAbstractGeometry 20 | 21 | 22 | /// --------------------------------- 23 | /// @name Accessing Properties 24 | /// --------------------------------- 25 | 26 | /** The Geometry child elements of this element. */ 27 | @property (strong, nonatomic, readonly) NSArray *geometries; 28 | 29 | 30 | /// --------------------------------- 31 | /// @name Adding Geometry 32 | /// --------------------------------- 33 | 34 | /** Inserts a given KMLAbstractGeometry object at the end of the geometry array. 35 | @param geometry The KMLAbstractGeometry to add to the end of the geometry array. 36 | */ 37 | - (void)addGeometry:(KMLAbstractGeometry *)geometry; 38 | 39 | /** Adds the KMLAbstractGeometry objects contained in another given array to the end of the geometry array. 40 | @param array An array of KMLAbstractGeometry objects to add to the end of the geometry array. 41 | */ 42 | - (void)addGeometries:(NSArray *)array; 43 | 44 | 45 | /// --------------------------------- 46 | /// @name Removing Geometry 47 | /// --------------------------------- 48 | 49 | /** Removes all occurrences in the geometry array of a given KMLAbstractGeometry object. 50 | @param geometry The KMLAbstractGeometry object to remove from the geometry array. 51 | */ 52 | - (void)removeGeometry:(KMLAbstractGeometry *)geometry; 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLRoot.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLRoot.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLElement.h" 11 | 12 | @class KMLNetworkLinkControl; 13 | @class KMLAbstractFeature; 14 | @class KMLStyle; 15 | 16 | /** The root element of a KML file.This element is required. 17 | It follows the xml declaration at the beginning of the file. 18 | The hint attribute is used as a signal to Google Earth to display the file as celestial data. 19 | 20 | The <kml> element may also include the namespace for any external XML schemas that are referenced within the file. 21 | 22 | A basic <kml> element contains 0 or 1 Feature and 0 or 1 NetworkLinkControl: 23 | 24 | 25 | ... 26 | 27 | 28 | 29 | The KML Framework follows KML standard specification. 30 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 31 | */ 32 | @interface KMLRoot : KMLElement 33 | 34 | /// --------------------------------- 35 | /// @name Accessing Properties 36 | /// --------------------------------- 37 | 38 | /** The namespace for external XML schemas. */ 39 | @property (strong, nonatomic, readonly) NSString *schema; 40 | 41 | /** The hint attribute is used as a signal to Google Earth to display the file as celestial data. */ 42 | @property (strong, nonatomic) NSString *hint; 43 | 44 | /** The NetworkLinkControl child element of this element. */ 45 | @property (strong, nonatomic) KMLNetworkLinkControl *networkLinkControl; 46 | 47 | /** The Feature child element of this element. */ 48 | @property (strong, nonatomic) KMLAbstractFeature *feature; 49 | 50 | 51 | /// --------------------------------- 52 | /// @name Placemarks 53 | /// --------------------------------- 54 | 55 | /** Return the all plcemarks. 56 | @return The KMLPlacemark objects. 57 | */ 58 | - (NSArray *)placemarks; 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLResourceMap.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLResourceMap.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractObject.h" 11 | 12 | @class KMLAlias; 13 | 14 | /** Specifies 0 or more KMLAlias elements, each of which is a mapping for the texture file path from the original Collada file to the KML or KMZ file that contains the Model. 15 | This element allows you to move and rename texture files without having to update the original Collada file that references those textures. 16 | One <ResourceMap> element can contain multiple mappings from different (source) Collada files into the same (target) KMZ file. 17 | 18 | The KML Framework follows KML standard specification. 19 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 20 | */ 21 | @interface KMLResourceMap : KMLAbstractObject 22 | 23 | 24 | /// --------------------------------- 25 | /// @name Accessing Properties 26 | /// --------------------------------- 27 | 28 | /** The Alias child elements of this element. */ 29 | @property (strong, nonatomic, readonly) NSArray *aliasList; 30 | 31 | 32 | /// --------------------------------- 33 | /// @name Adding Alias 34 | /// --------------------------------- 35 | 36 | /** Inserts a given KMLAlias object at the end of the alias array. 37 | @param alias The KMLAlias to add to the end of the alias array. 38 | */ 39 | - (void)addAlias:(KMLAlias *)alias; 40 | 41 | /** Adds the KMLAlias objects contained in another given array to the end of the alias array. 42 | @param array An array of KMLAlias objects to add to the end of the alias array. 43 | */ 44 | - (void)addAliasList:(NSArray *)array; 45 | 46 | 47 | /// --------------------------------- 48 | /// @name Removing Alias 49 | /// --------------------------------- 50 | 51 | /** Removes all occurrences in the alias array of a given KMLAlias object. 52 | @param alias The KMLAlias object to remove from the alias array. 53 | */ 54 | - (void)removeAlias:(KMLAlias *)alias; 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLSchema.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLSchema.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLElement.h" 11 | 12 | @class KMLSimpleField; 13 | 14 | /** Specifies a custom KML schema that is used to add custom data to KML Features. 15 | <Schema> is always a child of <Document>. 16 | 17 | The KML Framework follows KML standard specification. 18 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 19 | */ 20 | @interface KMLSchema : KMLElement 21 | 22 | 23 | /// --------------------------------- 24 | /// @name Accessing Properties 25 | /// --------------------------------- 26 | 27 | /** The id of schema. 28 | 29 | This attribute is required and must be unique within the KML file. */ 30 | @property (strong, nonatomic) NSString *objectID; 31 | 32 | /** The name of schema. */ 33 | @property (strong, nonatomic) NSString *name; 34 | 35 | /** The SimpleField child elements of this element. */ 36 | @property (strong, nonatomic, readonly) NSArray *simpleFields; 37 | 38 | 39 | /// --------------------------------- 40 | /// @name Adding SimpleField 41 | /// --------------------------------- 42 | 43 | /** Inserts a given KMLSimpleField object at the end of the simpleField array. 44 | @param simpleField The KMLSimpleField to add to the end of the simpleField array. 45 | */ 46 | - (void)addSimpleField:(KMLSimpleField *)simpleField; 47 | 48 | /** Adds the KMLSimpleField objects contained in another given array to the end of the simpleField array. 49 | @param array An array of KMLSimpleField objects to add to the end of the simpleField array. 50 | */ 51 | - (void)addSimpleFields:(NSArray *)array; 52 | 53 | 54 | /// --------------------------------- 55 | /// @name Removing SimpleField 56 | /// --------------------------------- 57 | 58 | /** Removes all occurrences in the simpleField array of a given KMLSimpleField object. 59 | @param simpleField The KMLSimpleField object to remove from the simpleField array. 60 | */ 61 | - (void)removeSimpleField:(KMLSimpleField *)simpleField; 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLImagePyramid.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLImagePyramid.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLElement.h" 11 | 12 | /** For very large images, you'll need to construct an image pyramid, which is a hierarchical set of images, each of which is an increasingly lower resolution version of the original image. 13 | Each image in the pyramid is subdivided into tiles, so that only the portions in view need to be loaded. 14 | Google Earth calculates the current viewpoint and loads the tiles that are appropriate to the user's distance from the image. 15 | As the viewpoint moves closer to the PhotoOverlay, Google Earth loads higher resolution tiles. 16 | Since all the pixels in the original image can't be viewed on the screen at once, this preprocessing allows Google Earth to achieve maximum performance because it loads only the portions of the image that are in view, and only the pixel details that can be discerned by the user at the current viewpoint. 17 | When you specify an image pyramid, you also modify the <href> in the <Icon> element to include specifications for which tiles to load 18 | 19 | The KML Framework follows KML standard specification. 20 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 21 | */ 22 | @interface KMLImagePyramid : KMLElement 23 | 24 | 25 | /// --------------------------------- 26 | /// @name Accessing Properties 27 | /// --------------------------------- 28 | 29 | /** Size of the tiles, in pixels. 30 | 31 | Tiles must be square, and <tileSize> must be a power of 2. 32 | A tile size of 256 (the default) or 512 is recommended. 33 | The original image is divided into tiles of this size, at varying resolutions */ 34 | @property (nonatomic, assign) NSInteger tileSize; 35 | 36 | /** Width in pixels of the original image. */ 37 | @property (nonatomic, assign) NSInteger maxWidth; 38 | 39 | /** Height in pixels of the original image. */ 40 | @property (nonatomic, assign) NSInteger maxHeight; 41 | 42 | /** Specifies where to begin numbering the tiles in each layer of the pyramid. 43 | 44 | A value of lowerLeft specifies that row 1, column 1 of each layer is in the bottom left corner of the grid. */ 45 | @property (nonatomic, assign) KMLGridOrigin gridOrigin; 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KML.h: -------------------------------------------------------------------------------- 1 | // 2 | // KML.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | #import 13 | #import 14 | #import 15 | #import 16 | #import 17 | #import 18 | #import 19 | #import 20 | #import 21 | #import 22 | #import 23 | #import 24 | #import 25 | #import 26 | #import 27 | #import 28 | #import 29 | #import 30 | #import 31 | #import 32 | #import 33 | #import 34 | #import 35 | #import 36 | #import 37 | #import 38 | #import 39 | #import 40 | #import 41 | #import 42 | #import 43 | #import 44 | #import 45 | #import 46 | #import 47 | #import 48 | #import 49 | #import 50 | #import 51 | #import 52 | #import 53 | #import 54 | #import 55 | #import 56 | #import 57 | #import 58 | #import 59 | #import 60 | #import 61 | #import 62 | #import 63 | #import 64 | #import 65 | #import 66 | #import 67 | #import 68 | #import 69 | #import 70 | #import 71 | #import 72 | #import 73 | #import 74 | #import 75 | #import 76 | #import 77 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLAbstractOverlay.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLAbstractOverlay.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractFeature.h" 11 | 12 | @class KMLIcon; 13 | @class KMLExtendedData; 14 | 15 | /** This is an abstract element and cannot be used directly in a KML file. 16 | <Overlay> is the base type for image overlays drawn on the planet surface or on the screen. 17 | <Icon> specifies the image to use and can be configured to reload images based on a timer or by camera changes. 18 | This element also includes specifications for stacking order of multiple overlays and for adding color and transparency values to the base image. 19 | 20 | The KML Framework follows KML standard specification. 21 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 22 | */ 23 | @interface KMLAbstractOverlay : KMLAbstractFeature 24 | 25 | 26 | /// --------------------------------- 27 | /// @name Accessing Properties 28 | /// --------------------------------- 29 | 30 | /** Color values are expressed in hexadecimal notation, including opacity (alpha) values. 31 | 32 | The order of expression is alpha, blue, green, red (aabbggrr). 33 | The range of values for any one color is 0 to 255 (00 to ff). 34 | For opacity, 00 is fully transparent and ff is fully opaque. 35 | For example, if you want to apply a blue color with 50 percent opacity to an overlay, you would specify the following: 36 | <color>7fff0000</color> 37 | 38 | @warning *Note:* The <geomColor> element has been deprecated. Use <color> instead. 39 | */ 40 | @property (strong, nonatomic) NSString *color; 41 | 42 | /** This element defines the stacking order for the images in overlapping overlays. 43 | 44 | Overlays with higher <drawOrder> values are drawn on top of overlays with lower <drawOrder> values. */ 45 | @property (nonatomic, assign) NSInteger drawOrder; 46 | 47 | /** Defines the image associated with the Overlay. 48 | 49 | See also KMLIcon. 50 | The <href> element defines the location of the image to be used as the Overlay. 51 | This location can be either on a local file system or on a web server. 52 | If this element is omitted or contains no <href>, a rectangle is drawn using the color and size defined by the ground or screen overlay. */ 53 | @property (strong, nonatomic) KMLIcon *icon; 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLModel.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractGeometry.h" 11 | 12 | @class KMLLocation; 13 | @class KMLOrientation; 14 | @class KMLScale; 15 | @class KMLLink; 16 | @class KMLResourceMap; 17 | 18 | /** A 3D object described in a COLLADA file (referenced in the <Link> tag). 19 | COLLADA files have a .dae file extension. 20 | Models are created in their own coordinate space and then located, positioned, and scaled in Google Earth. 21 | See the "Topics in KML" page on Models for more detail. 22 | 23 | Google Earth supports the COLLADA common profile, with the following exceptions: 24 | 25 | - Google Earth supports only triangles and lines as primitive types. The maximum number of triangles allowed is 21845. 26 | - Google Earth does not support animation or skinning. 27 | - Google Earth does not support external geometry references. 28 | 29 | The KML Framework follows KML standard specification. 30 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 31 | */ 32 | @interface KMLModel : KMLAbstractGeometry 33 | 34 | 35 | /// --------------------------------- 36 | /// @name Accessing Properties 37 | /// --------------------------------- 38 | 39 | /** Specifies how the <altitude> specified in <Location> is interpreted. 40 | 41 | Possible values are as follows: 42 | 43 | - *clampToGround* - (default) Indicates to ignore the <altitude> specification and place the Model on the ground. 44 | - *relativeToGround* - Interprets the <altitude> as a value in meters above the ground. 45 | - *absolute* - Interprets the <altitude> as a value in meters above sea level. 46 | */ 47 | @property (nonatomic, assign) KMLAltitudeMode altitudeMode; 48 | 49 | /** See KMLLocation. */ 50 | @property (strong, nonatomic) KMLLocation *location; 51 | 52 | /** See KMLOrientation. */ 53 | @property (strong, nonatomic) KMLOrientation *orientation; 54 | 55 | /** See KMLScale. */ 56 | @property (strong, nonatomic) KMLScale *scale; 57 | 58 | /** Specifies the file to load and optional refresh parameters. 59 | 60 | See KMLLink. */ 61 | @property (strong, nonatomic) KMLLink *link; 62 | 63 | /** See KML ResourceMap. */ 64 | @property (strong, nonatomic) KMLResourceMap *resourceMap; 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLUpdate.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLUpdate.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLElement.h" 11 | 12 | @class KMLAbstractObject; 13 | 14 | /** Specifies an addition, change, or deletion to KML data that has already been loaded using the specified URL. 15 | The <targetHref> specifies the .kml or .kmz file whose data (within Google Earth) is to be modified. 16 | <Update> is always contained in a NetworkLinkControl. 17 | Furthermore, the file containing the NetworkLinkControl must have been loaded by a NetworkLink. 18 | See the "Topics in KML" page on Updates for a detailed example of how Update works. 19 | 20 | The KML Framework follows KML standard specification. 21 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 22 | */ 23 | @interface KMLUpdate : KMLElement 24 | 25 | 26 | /// --------------------------------- 27 | /// @name Accessing Properties 28 | /// --------------------------------- 29 | 30 | /** A URL that specifies the .kml or .kmz file whose data (within Google Earth) is to be modified by an KMLUpdate element. 31 | 32 | This KML file must already have been loaded via a KMLNetworkLink. 33 | In that file, the element to be modified must already have an explicit id attribute defined for it. */ 34 | @property (strong, nonatomic) NSString *targetHref; 35 | 36 | /** The Object child elements of this element. */ 37 | @property (strong, nonatomic, readonly) NSArray *objects; 38 | 39 | 40 | /// --------------------------------- 41 | /// @name Adding Object 42 | /// --------------------------------- 43 | 44 | /** Inserts a given KMLAbstractObject object at the end of the object array. 45 | @param object The KMLAbstractObject to add to the end of the object array. 46 | */ 47 | - (void)addObject:(KMLAbstractObject *)object; 48 | 49 | /** Adds the KMLAbstractObject objects contained in another given array to the end of the object array. 50 | @param array An array of KMLAbstractObject objects to add to the end of the object array. 51 | */ 52 | - (void)addObjects:(NSArray *)array; 53 | 54 | 55 | /// --------------------------------- 56 | /// @name Removing Object 57 | /// --------------------------------- 58 | 59 | /** Removes all occurrences in the object array of a given KMLAbstractObject object. 60 | @param object The KMLAbstractObject object to remove from the object array. 61 | */ 62 | - (void)removeObject:(KMLAbstractObject *)object; 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLAbstractColorStyle.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLAbstractColorStyle.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractSubStyle.h" 11 | 12 | /** This is an abstract element and cannot be used directly in a KML file. 13 | It provides elements for specifying the color and color mode of extended style types. 14 | 15 | The KML Framework follows KML standard specification. 16 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 17 | */ 18 | @interface KMLAbstractColorStyle : KMLAbstractSubStyle 19 | 20 | 21 | /// --------------------------------- 22 | /// @name Accessing Properties 23 | /// --------------------------------- 24 | 25 | /** Color and opacity (alpha) values are expressed in hexadecimal notation. 26 | 27 | The range of values for any one color is 0 to 255 (00 to ff). 28 | For alpha, 00 is fully transparent and ff is fully opaque. 29 | The order of expression is aabbggrr, where aa=alpha (00 to ff); bb=blue (00 to ff); gg=green (00 to ff); rr=red (00 to ff). 30 | For example, if you want to apply a blue color with 50 percent opacity to an overlay, you would specify the following: <color>7fff0000</color>, where alpha=0x7f, blue=0xff, green=0x00, and red=0x00. */ 31 | @property (strong, nonatomic) NSString *color; 32 | 33 | /** Values for <colorMode> are *normal* (no effect) and *random*. 34 | 35 | A value of *random* applies a random linear scale to the base <color> as follows. 36 | 37 | - To achieve a truly random selection of colors, specify a base <color> of white (ffffffff). 38 | - If you specify a single color component (for example, a value of ff0000ff for red), random color values for that one component (red) will be selected. In this case, the values would range from 00 (black) to ff (full red). 39 | - If you specify values for two or for all three color components, a random linear scale is applied to each color component, with results ranging from black to the maximum values specified for each component. 40 | - The opacity of a color comes from the alpha component of <color> and is never randomized. 41 | */ 42 | @property (nonatomic, assign) KMLColorMode colorMode; 43 | 44 | 45 | /// --------------------------------- 46 | /// @name UIColor 47 | /// --------------------------------- 48 | 49 | /** Returns The UIColor from color string. 50 | @return UIColor. 51 | */ 52 | - (UIColor *)UIColor; 53 | 54 | /** Set UIColor to color string. 55 | @param color The UIColor. 56 | */ 57 | - (void)setUIColor:(UIColor *)color; 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLDocument.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLDocument.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractContainer.h" 11 | 12 | @class KMLSchema; 13 | 14 | /** A Document is a container for features and styles. 15 | This element is required if your KML file uses shared styles. 16 | It is recommended that you use shared styles, which require the following steps: 17 | 18 | Define all Styles in a Document. Assign a unique ID to each Style. 19 | 20 | Within a given Feature or StyleMap, reference the Style's ID using a <styleUrl> element. 21 | 22 | Note that shared styles are not inherited by the Features in the Document. 23 | 24 | Each Feature must explicitly reference the styles it uses in a <styleUrl> element. 25 | For a Style that applies to a Document (such as ListStyle), the Document itself must explicitly reference the <styleUrl>. 26 | For example: 27 | 28 | 29 | 32 | 33 | ... 34 | 35 | 36 | Do not put shared styles within a Folder. 37 | 38 | The KML Framework follows KML standard specification. 39 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 40 | */ 41 | @interface KMLDocument : KMLAbstractContainer 42 | 43 | 44 | /// --------------------------------- 45 | /// @name Accessing Properties 46 | /// --------------------------------- 47 | 48 | /** The Schema child elements of this element. */ 49 | @property (strong, nonatomic, readonly) NSArray *schemata; 50 | 51 | 52 | /// --------------------------------- 53 | /// @name Adding Schema 54 | /// --------------------------------- 55 | 56 | /** Inserts a given KMLSchema object at the end of the schema array. 57 | @param schema The KMLSchema to add to the end of the schema array. 58 | */ 59 | - (void)addSchema:(KMLSchema *)schema; 60 | 61 | /** Adds the KMLSchema objects contained in another given array to the end of the schema array. 62 | @param array An array of KMLSchema objects to add to the end of the schema array. 63 | */ 64 | - (void)addSchemata:(NSArray *)array; 65 | 66 | 67 | /// --------------------------------- 68 | /// @name Removing Schema 69 | /// --------------------------------- 70 | 71 | /** Removes all occurrences in the schema array of a given KMLSchema object. 72 | @param schema The KMLSchema object to remove from the styleselector array. 73 | */ 74 | - (void)removeSchema:(KMLSchema *)schema; 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLNetworkLink.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLNetworkLink.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractFeature.h" 11 | 12 | @class KMLLink; 13 | 14 | /** References a KML file or KMZ archive on a local or remote network. 15 | Use the KMLLink element to specify the location of the KML file. 16 | Within that element, you can define the refresh options for updating the file, based on time and camera change. 17 | NetworkLinks can be used in combination with Regions to handle very large datasets efficiently. 18 | 19 | The KML Framework follows KML standard specification. 20 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 21 | */ 22 | @interface KMLNetworkLink : KMLAbstractFeature 23 | 24 | /// --------------------------------- 25 | /// @name Accessing Properties 26 | /// --------------------------------- 27 | 28 | /** Boolean value. 29 | 30 | A value of 0 leaves the visibility of features within the control of the Google Earth user. 31 | Set the value to 1 to reset the visibility of features each time the NetworkLink is refreshed. 32 | For example, suppose a Placemark within the linked KML file has <visibility> set to 1 and the NetworkLink has <refreshVisibility> set to 1. 33 | When the file is first loaded into Google Earth, the user can clear the check box next to the item to turn off display in the 3D viewer. 34 | However, when the NetworkLink is refreshed, the Placemark will be made visible again, since its original visibility state was TRUE.*/ 35 | @property (nonatomic, assign) BOOL refreshVisibility; 36 | 37 | /** Boolean value. 38 | 39 | A value of 1 causes Google Earth to fly to the view of the LookAt or Camera in the NetworkLinkControl (if it exists). 40 | If the NetworkLinkControl does not contain an AbstractView element, Google Earth flies to the LookAt or Camera element in the Feature child within the <kml> element in the refreshed file. 41 | If the <kml> element does not have a LookAt or Camera specified, the view is unchanged. 42 | For example, Google Earth would fly to the <LookAt> view of the parent Document, not the <LookAt> of the Placemarks contained within the Document. */ 43 | @property (nonatomic, assign) BOOL flyToView; 44 | 45 | /** (required). See KMLLink. 46 | @warning *tip:* To display the top-level Folder or Document within a Network Link in the List View, assign an ID to the Folder or Document. Without this ID, only the child object names are displayed in the List View. 47 | */ 48 | @property (strong, nonatomic) KMLLink *link; 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLSchemaData.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLSchemaData.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractObject.h" 11 | 12 | @class KMLSimpleData; 13 | 14 | /** This element is used in conjunction with <Schema> to add typed custom data to a KML Feature. 15 | The Schema element (identified by the schemaUrl attribute) declares the custom data type. 16 | The actual data objects ("instances" of the custom data) are defined using the SchemaData element. 17 | 18 | The Schema element is always a child of Document. 19 | The ExtendedData element is a child of the Feature that contains the custom data. 20 | 21 | The KML Framework follows KML standard specification. 22 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 23 | */ 24 | @interface KMLSchemaData : KMLAbstractObject 25 | 26 | 27 | /// --------------------------------- 28 | /// @name Accessing Properties 29 | /// --------------------------------- 30 | 31 | /** The URL of schema. 32 | 33 | The <schemaURL> can be a full URL, a reference to a Schema ID defined in an external KML file, or a reference to a Schema ID defined in the same KML file. 34 | All of the following specifications are acceptable: 35 | 36 | schemaUrl="http://host.com/PlacesIHaveLived.kml#my-schema-id" 37 | 38 | schemaUrl="AnotherFile.kml#my-schema-id" 39 | 40 | schemaUrl="#schema-id" 41 | 42 | */ 43 | @property (strong, nonatomic) NSString *schemaUrl; 44 | 45 | /** The SimpleData child elements of this element. */ 46 | @property (strong, nonatomic, readonly) NSArray *simpleDataList; 47 | 48 | 49 | /// --------------------------------- 50 | /// @name Adding SimpleData 51 | /// --------------------------------- 52 | 53 | /** Inserts a given KMLSimpleData object at the end of the simpleData array. 54 | @param simpleData The KMLSimpleData to add to the end of the simpleData array. 55 | */ 56 | - (void)addSimpleData:(KMLSimpleData *)simpleData; 57 | 58 | /** Adds the KMLSimpleData objects contained in another given array to the end of the simpleData array. 59 | @param array An array of KMLSimpleData objects to add to the end of the simpleData array. 60 | */ 61 | - (void)addSimpleDataList:(NSArray *)array; 62 | 63 | 64 | /// --------------------------------- 65 | /// @name Removing SimpleData 66 | /// --------------------------------- 67 | 68 | /** Removes all occurrences in the simpleData array of a given KMLSimpleData object. 69 | @param simpleData The KMLSimpleData object to remove from the simpleData array. 70 | */ 71 | - (void)removeSimpleData:(KMLSimpleData *)simpleData; 72 | 73 | @end 74 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLListStyle.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLListStyle.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractSubStyle.h" 11 | 12 | @class KMLItemIcon; 13 | 14 | /** Specifies how a Feature is displayed in the list view. 15 | The list view is a hierarchy of containers and children; in Google Earth, this is the Places panel. 16 | 17 | The KML Framework follows KML standard specification. 18 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 19 | */ 20 | @interface KMLListStyle : KMLAbstractSubStyle 21 | 22 | 23 | /// --------------------------------- 24 | /// @name Accessing Properties 25 | /// --------------------------------- 26 | 27 | /** Specifies how a Feature is displayed in the list view. 28 | 29 | Possible values are: 30 | 31 | - *check* (default) - The Feature's visibility is tied to its item's checkbox. 32 | - *radioFolder* - When specified for a Container, only one of the Container's items is visible at a time 33 | - *checkOffOnly* - When specified for a Container or Network Link, prevents all items from being made visible at once—that is, the user can turn everything in the Container or Network Link off but cannot turn everything on at the same time. This setting is useful for Containers or Network Links containing large amounts of data. 34 | - *checkHideChildren* - Use a normal checkbox for visibility but do not display the Container or Network Link's children in the list view. A checkbox allows the user to toggle visibility of the child objects in the viewer. 35 | */ 36 | @property (nonatomic, assign) KMLListItemType listItemType; 37 | 38 | /** Background color for the Snippet. 39 | 40 | Color and opacity values are expressed in hexadecimal notation. 41 | The range of values for any one color is 0 to 255 (00 to ff). 42 | For alpha, 00 is fully transparent and ff is fully opaque. 43 | The order of expression is aabbggrr, where aa=alpha (00 to ff); bb=blue (00 to ff); gg=green (00 to ff); rr=red (00 to ff). 44 | For example, if you want to apply a blue color with 50 percent opacity to an overlay, you would specify the following: <color>7fff0000</color>, where alpha=0x7f, blue=0xff, green=0x00, and red=0x00. */ 45 | @property (strong, nonatomic) NSString *bgColor; 46 | 47 | /** Icon used in the List view that reflects the state of a Folder or Link fetch. 48 | 49 | Icons associated with the open and closed modes are used for Folders and Network Links. 50 | Icons associated with the error and fetching0, fetching1, and fetching2 modes are used for Network Links. */ 51 | @property (strong, nonatomic) KMLItemIcon *itemIcon; 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLLod.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLLod.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractObject.h" 11 | 12 | /** Lod is an abbreviation for Level of Detail. 13 | <Lod> describes the size of the projected region on the screen that is required in order for the region to be considered "active." 14 | Also specifies the size of the pixel ramp used for fading in (from transparent to opaque) and fading out (from opaque to transparent). 15 | See diagram below for a visual representation of these parameters. 16 | 17 | 18 | 256 19 | -1 20 | 0 21 | 0 22 | 23 | 24 | The KML Framework follows KML standard specification. 25 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 26 | */ 27 | @interface KMLLod : KMLAbstractObject 28 | 29 | 30 | /// --------------------------------- 31 | /// @name Accessing Properties 32 | /// --------------------------------- 33 | 34 | /** Measurement in screen pixels that represents the minimum limit of the visibility range for a given Region. 35 | 36 | Google Earth calculates the size of the Region when projected onto screen space. 37 | Then it computes the square root of the Region's area 38 | (if, for example, the Region is square and the viewpoint is directly above the Region, and the Region is not tilted, this measurement is equal to the width of the projected Region). 39 | If this measurement falls within the limits defined by <minLodPixels> and <maxLodPixels> (and if the <LatLonAltBox> is in view), the Region is active. 40 | If this limit is not reached, the associated geometry is considered to be too far from the user's viewpoint to be drawn. 41 | */ 42 | @property (nonatomic, assign) CGFloat minLodPixels; 43 | 44 | /** Measurement in screen pixels that represents the maximum limit of the visibility range for a given Region. 45 | 46 | A value of −1, the default, indicates "active to infinite size." */ 47 | @property (nonatomic, assign) CGFloat maxLodPixels; 48 | 49 | /** Distance over which the geometry fades, from fully opaque to fully transparent. 50 | 51 | This ramp value, expressed in screen pixels, is applied at the minimum end of the LOD (visibility) limits.*/ 52 | @property (nonatomic, assign) CGFloat minFadeExtent; 53 | 54 | /** Distance over which the geometry fades, from fully transparent to fully opaque. 55 | 56 | This ramp value, expressed in screen pixels, is applied at the maximum end of the LOD (visibility) limits. */ 57 | @property (nonatomic, assign) CGFloat maxFadeExtent; 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /AIMapViewWrapper/AIAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AIAppDelegate.m 3 | // AIMapViewWrapper 4 | // 5 | // Created by CocoaToucher on 12/19/12. 6 | // Copyright (c) 2012 CocoaToucher. All rights reserved. 7 | // 8 | 9 | #import "AIAppDelegate.h" 10 | #import "AISampleViewController.h" 11 | 12 | 13 | @implementation AIAppDelegate 14 | 15 | - (void)dealloc 16 | { 17 | #if !(__has_feature(objc_arc)) 18 | [_window release]; 19 | [super dealloc]; 20 | #endif 21 | } 22 | 23 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 24 | { 25 | UIWindow *tWin = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 26 | self.window = tWin; 27 | #if !(__has_feature(objc_arc)) 28 | [tWin release]; 29 | #endif 30 | 31 | AISampleViewController *controller = [[AISampleViewController alloc] init]; 32 | 33 | UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:controller]; 34 | self.window.rootViewController = navigationController; 35 | #if !(__has_feature(objc_arc)) 36 | [controller release]; 37 | [navigationController release]; 38 | #endif 39 | 40 | self.window.backgroundColor = [UIColor whiteColor]; 41 | [self.window makeKeyAndVisible]; 42 | return YES; 43 | } 44 | 45 | - (void)applicationWillResignActive:(UIApplication *)application 46 | { 47 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 48 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 49 | } 50 | 51 | - (void)applicationDidEnterBackground:(UIApplication *)application 52 | { 53 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 54 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 55 | } 56 | 57 | - (void)applicationWillEnterForeground:(UIApplication *)application 58 | { 59 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 60 | } 61 | 62 | - (void)applicationDidBecomeActive:(UIApplication *)application 63 | { 64 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 65 | } 66 | 67 | - (void)applicationWillTerminate:(UIApplication *)application 68 | { 69 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 70 | } 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLIconStyle.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLIconStyle.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractColorStyle.h" 11 | 12 | @class KMLIcon; 13 | @class KMLVec2; 14 | 15 | /** Specifies how icons for point Placemarks are drawn, both in the Places panel and in the 3D viewer of Google Earth. 16 | The <Icon> element specifies the icon image. 17 | The <scale> element specifies the x, y scaling of the icon. 18 | The color specified in the <color> element of <IconStyle> is blended with the color of the <Icon>. 19 | 20 | The KML Framework follows KML standard specification. 21 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 22 | */ 23 | @interface KMLIconStyle : KMLAbstractColorStyle 24 | 25 | 26 | /// --------------------------------- 27 | /// @name Accessing Properties 28 | /// --------------------------------- 29 | 30 | /** Resizes the icon. 31 | 32 | @warning *Note:* The <geomScale> tag has been deprecated. Use <scale> instead. 33 | */ 34 | @property (nonatomic, assign) CGFloat scale; 35 | 36 | /** Direction (that is, North, South, East, West), in degrees. Default=0 (North). 37 | 38 | Values range from 0 to 360 degrees. */ 39 | @property (nonatomic, assign) CGFloat heading; 40 | 41 | /** See KMLIcon. */ 42 | @property (strong, nonatomic) KMLIcon *icon; 43 | 44 | /** Specifies the position within the Icon that is "anchored" to the <Point> specified in the Placemark. 45 | 46 | The x and y values can be specified in three different ways: as pixels (*"pixels"*), as fractions of the icon (*"fraction"*), or as inset pixels (*"insetPixels"*), which is an offset in pixels from the upper right corner of the icon. 47 | The x and y positions can be specified in different ways—for example, x can be in pixels and y can be a fraction. 48 | The origin of the coordinate system is in the lower left corner of the icon. 49 | 50 | - *x* - Either the number of pixels, a fractional component of the icon, or a pixel inset indicating the x component of a point on the icon. 51 | - *y* - Either the number of pixels, a fractional component of the icon, or a pixel inset indicating the y component of a point on the icon. 52 | - *xunits* - Units in which the x value is specified. A value of *fraction* indicates the x value is a fraction of the icon. A value of *pixels* indicates the x value in pixels. A value of *insetPixels* indicates the indent from the right edge of the icon. 53 | - *yunits* - Units in which the y value is specified. A value of *fraction* indicates the y value is a fraction of the icon. A value of *pixels* indicates the y value in pixels. A value of *insetPixels* indicates the indent from the top edge of the icon. 54 | */ 55 | @property (strong, nonatomic) KMLVec2 *hotSpot; 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLLookAt.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLLookAt.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractView.h" 11 | 12 | /** Defines a virtual camera that is associated with any element derived from Feature. 13 | The LookAt element positions the "camera" in relation to the object that is being viewed. 14 | In Google Earth, the view "flies to" this LookAt viewpoint when the user double-clicks an item in the Places panel or double-clicks an icon in the 3D viewer. 15 | 16 | The KML Framework follows KML standard specification. 17 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 18 | */ 19 | @interface KMLLookAt : KMLAbstractView 20 | 21 | 22 | /// --------------------------------- 23 | /// @name Accessing Properties 24 | /// --------------------------------- 25 | 26 | /** Longitude of the point the camera is looking at. Angular distance in degrees, relative to the Prime Meridian. Values west of the Meridian range from −180 to 0 degrees. 27 | 28 | Values east of the Meridian range from 0 to 180 degrees */ 29 | @property (nonatomic, assign) CGFloat longitude; 30 | 31 | /** Latitude of the point the camera is looking at. Degrees north or south of the Equator (0 degrees). 32 | 33 | Values range from −90 degrees to 90 degrees. */ 34 | @property (nonatomic, assign) CGFloat latitude; 35 | 36 | /** Distance from the earth's surface, in meters. 37 | 38 | Interpreted according to the LookAt's altitude mode. */ 39 | @property (nonatomic, assign) CGFloat altitude; 40 | 41 | /** Direction (that is, North, South, East, West), in degrees. Default=0 (North). 42 | 43 | Values range from 0 to 360 degrees. */ 44 | @property (nonatomic, assign) CGFloat heading; 45 | 46 | /** Angle between the direction of the LookAt position and the normal to the surface of the earth. 47 | 48 | Values range from 0 to 90 degrees. Values for <tilt> cannot be negative. 49 | A <tilt> value of 0 degrees indicates viewing from directly above. 50 | A <tilt> value of 90 degrees indicates viewing along the horizon. */ 51 | @property (nonatomic, assign) CGFloat tilt; 52 | 53 | /** Distance in meters from the point specified by <longitude>, <latitude>, and <altitude> to the LookAt position. */ 54 | @property (nonatomic, assign) CGFloat range; 55 | 56 | /** Specifies how the <altitude> specified for the LookAt point is interpreted. Possible values are as follows: 57 | 58 | - *clampToGround* - (default) Indicates to ignore the <altitude> specification and place the LookAt position on the ground. 59 | - *relativeToGround* - Interprets the <altitude> as a value in meters above the ground. 60 | - *absolute* - Interprets the <altitude> as a value in meters above sea level. 61 | */ 62 | @property (nonatomic, assign) KMLAltitudeMode altitudeMode; 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /AIMapViewWrapper/AIMapViewWrapper/Routing/AIOverlayRouteView.h: -------------------------------------------------------------------------------- 1 | // 2 | // AIOverlayRouteView.h 3 | // AIMapViewWrapper 4 | // 5 | // Created by CocoaToucher on 12/23/12. 6 | // Copyright (c) 2012 CocoaToucher. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class AIRoute; 12 | @protocol AIOverlayRouteViewDelegate; 13 | 14 | /** 15 | Custom overlay path view for showing an animated vehicle on a path on MKMapView 16 | */ 17 | @interface AIOverlayRouteView : MKOverlayPathView 18 | 19 | /** 20 | AIOverlayRouteView needs to be initialized with an AIRoute overlay 21 | and an image for the vehicle that will be animated on that route 22 | */ 23 | - (id)initWithRoute:(AIRoute *)route 24 | vehicleImage:(UIImage *)inImage; 25 | 26 | @property(nonatomic, assign, readwrite) id delegate; 27 | 28 | /** 29 | Check if this property is YES before calling startAnimationWithTotalTravelTime:remainingTravelTime: 30 | */ 31 | @property(nonatomic, readonly) BOOL isReadyForAnimation; 32 | 33 | /** 34 | Returns whether the vehicle view has an active position animation 35 | */ 36 | @property(nonatomic, readonly) BOOL isAnimating; 37 | 38 | /** 39 | Velocity value calculated with total and remaining travel times provided with 40 | startAnimationWithTotalTravelTime:remainingTravelTime: method 41 | */ 42 | @property(nonatomic, readonly) double velocity; 43 | 44 | /** 45 | Current coordinate of the vehicle view on its route overlay 46 | Do not rely on this value if the overlay view is not yet drawn, you can check if isReadyForAnimation is YES 47 | */ 48 | @property(nonatomic, readonly) CLLocationCoordinate2D currentVehicleCoordinate; 49 | 50 | /** 51 | Call this method in map view's mapView:regionDidChangeAnimated: method to layout vehicle subview according to appropriate zoomScale of mapView 52 | @param zoomScale, current zoomScale of MKMapView, see AIMapViewWrapper class 53 | */ 54 | - (void)layoutWithZoomScale:(MKZoomScale)zoomScale; 55 | 56 | /** 57 | Start the position animation for vehicle view on the route overlay's path 58 | If isAnimating is YES, or isReadyForAnimation is NO this method does not start an animation 59 | remainingTime should be smaller than or equal to totalTime, otherwise no effect of method 60 | Animation starts from the appropriate section of the total path according to given remainingTime 61 | @param totalTime, total travel time for the vehicle on its path 62 | @param remainingTime, remaining travel time for the vehicle on its path 63 | */ 64 | - (void)startAnimationWithTotalTravelTime:(CFTimeInterval)totalTime 65 | remainingTravelTime:(CFTimeInterval)remainingTime; 66 | 67 | /** 68 | Stops the position animation of vehicle view on the route overlay's path 69 | isAnimating is set to NO after a call to this method 70 | */ 71 | - (void)stopAnimation; 72 | 73 | @end 74 | 75 | @protocol AIOverlayRouteViewDelegate 76 | 77 | /** 78 | AIOverlayRouteView tells the delegate that it is ready for animation after it is partially or completely drawn on the map 79 | Overlay route view's isReadyForAnimation property is set to YES prior to calling this delegate method 80 | This delegate method is called once in the overlay view's lifetime 81 | */ 82 | - (void)overlayRouteViewIsReadyForAnimation:(AIOverlayRouteView *)routeView; 83 | 84 | @end 85 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLPhotoOverlay.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLPhotoOverlay.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractOverlay.h" 11 | 12 | @class KMLViewVolume; 13 | @class KMLImagePyramid; 14 | @class KMLPoint; 15 | 16 | /** The <PhotoOverlay> element allows you to geographically locate a photograph on the Earth and to specify viewing parameters for this PhotoOverlay. 17 | The PhotoOverlay can be a simple 2D rectangle, a partial or full cylinder, or a sphere (for spherical panoramas). 18 | The overlay is placed at the specified location and oriented toward the viewpoint. 19 | 20 | Because <PhotoOverlay> is derived from <Feature>, it can contain one of the two elements derived from <AbstractView>—either <Camera> or <LookAt>. 21 | The Camera (or LookAt) specifies a viewpoint and a viewing direction (also referred to as a view vector). 22 | The PhotoOverlay is positioned in relation to the viewpoint. 23 | Specifically, the plane of a 2D rectangular image is orthogonal (at right angles to) the view vector. 24 | The normal of this plane—that is, its front, which is the part with the photo—is oriented toward the viewpoint. 25 | 26 | The URL for the PhotoOverlay image is specified in the <Icon> tag, which is inherited from <Overlay>. 27 | The <Icon> tag must contain an <href> element that specifies the image file to use for the PhotoOverlay. 28 | In the case of a very large image, the <href> is a special URL that indexes into a pyramid of images of varying resolutions (see KMLImagePyramid). 29 | 30 | For more information, see the "Topics in KML" page on PhotoOverlay. 31 | 32 | The KML Framework follows KML standard specification. 33 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 34 | */ 35 | @interface KMLPhotoOverlay : KMLAbstractOverlay 36 | 37 | /// --------------------------------- 38 | /// @name Accessing Properties 39 | /// --------------------------------- 40 | 41 | /** Adjusts how the photo is placed inside the field of view. 42 | 43 | This element is useful if your photo has been rotated and deviates slightly from a desired horizontal view. */ 44 | @property (nonatomic, assign) CGFloat rotation; 45 | 46 | /** Defines how much of the current scene is visible. 47 | 48 | See KMLViewVolume.*/ 49 | @property (strong, nonatomic) KMLViewVolume *viewVolume; 50 | 51 | /** For very large images, you'll need to construct an image pyramid, which is a hierarchical set of images, each of which is an increasingly lower resolution version of the original image. 52 | 53 | See KMLImagePyramid. 54 | */ 55 | @property (strong, nonatomic) KMLImagePyramid *imagePyramid; 56 | 57 | /** The <Point> element acts as a <Point> inside a <Placemark> element. 58 | 59 | See KMLPoint.*/ 60 | @property (strong, nonatomic) KMLPoint *point; 61 | 62 | /** The PhotoOverlay is projected onto the <shape>. 63 | See KMLShape.*/ 64 | @property (nonatomic, assign) KMLShape shape; 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLGroundOverlay.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLGroundOverlay.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractOverlay.h" 11 | 12 | @class KMLLatLonBox; 13 | 14 | /** This element draws an image overlay draped onto the terrain. 15 | The <href> child of <Icon> specifies the image to be used as the overlay. 16 | This file can be either on a local file system or on a web server. 17 | If this element is omitted or contains no <href>, a rectangle is drawn using the color and LatLonBox bounds defined by the ground overlay. 18 | 19 | The KML Framework follows KML standard specification. 20 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 21 | */ 22 | @interface KMLGroundOverlay : KMLAbstractOverlay 23 | 24 | 25 | /// --------------------------------- 26 | /// @name Accessing Properties 27 | /// --------------------------------- 28 | 29 | /** Specifies the distance above the earth's surface, in meters, and is interpreted according to the altitude mode. */ 30 | @property (nonatomic, assign) NSInteger altitude; 31 | 32 | /** Specifies how the is interpreted. 33 | 34 | Possible values are 35 | 36 | - clampToGround - (default) Indicates to ignore the altitude specification and drape the overlay over the terrain. 37 | - absolute - Sets the altitude of the overlay relative to sea level, regardless of the actual elevation of the terrain beneath the element. For example, if you set the altitude of an overlay to 10 meters with an absolute altitude mode, the overlay will appear to be at ground level if the terrain beneath is also 10 meters above sea level. If the terrain is 3 meters above sea level, the overlay will appear elevated above the terrain by 7 meters. 38 | */ 39 | @property (nonatomic, assign) KMLAltitudeMode altitudeMode; 40 | 41 | /** Specifies where the top, bottom, right, and left sides of a bounding box for the ground overlay are aligned. 42 | 43 | - ** Specifies the latitude of the north edge of the bounding box, in decimal degrees from 0 to ±90. 44 | - ** Specifies the latitude of the south edge of the bounding box, in decimal degrees from 0 to ±90. 45 | - ** Specifies the longitude of the east edge of the bounding box, in decimal degrees from 0 to ±180. (For overlays that overlap the meridian of 180° longitude, values can extend beyond that range.) 46 | - ** Specifies the longitude of the west edge of the bounding box, in decimal degrees from 0 to ±180. (For overlays that overlap the meridian of 180° longitude, values can extend beyond that range.) 47 | - ** Specifies a rotation of the overlay about its center, in degrees. Values can be ±180. The default is 0 (north). Rotations are specified in a counterclockwise direction. 48 | 49 | 50 | 48.25475939255556 51 | 48.25207367852141 52 | -90.86591508839973 53 | -90.8714285289695 54 | 39.37878630116985 55 | 56 | */ 57 | @property (strong, nonatomic) KMLLatLonBox *latLonBox; 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLPoint.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLPoint.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "KMLAbstractGeometry.h" 12 | 13 | @class KMLCoordinate; 14 | 15 | /** A geographic location defined by longitude, latitude, and (optional) altitude. 16 | When a Point is contained by a Placemark, the point itself determines the position of the Placemark's name and icon. 17 | When a Point is extruded, it is connected to the ground with a line. 18 | This "tether" uses the current LineStyle. 19 | 20 | The KML Framework follows KML standard specification. 21 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 22 | */ 23 | @interface KMLPoint : KMLAbstractGeometry 24 | 25 | 26 | /// --------------------------------- 27 | /// @name Accessing Properties 28 | /// --------------------------------- 29 | 30 | /** Boolean value. 31 | 32 | Specifies whether to connect the point to the ground with a line. 33 | To extrude a Point, the value for <altitudeMode> must be either relativeToGround, relativeToSeaFloor, or absolute. 34 | The point is extruded toward the center of the Earth's sphere. */ 35 | @property (nonatomic, assign) BOOL extrude; 36 | 37 | /** Specifies how altitude components in the <coordinates> element are interpreted. 38 | 39 | Possible values are 40 | 41 | - *clampToGround* - (default) Indicates to ignore an altitude specification (for example, in the <coordinates> tag). 42 | - *relativeToGround* - Sets the altitude of the element relative to the actual ground elevation of a particular location. For example, if the ground elevation of a location is exactly at sea level and the altitude for a point is set to 9 meters, then the elevation for the icon of a point placemark elevation is 9 meters with this mode. However, if the same coordinate is set over a location where the ground elevation is 10 meters above sea level, then the elevation of the coordinate is 19 meters. A typical use of this mode is for placing telephone poles or a ski lift. 43 | - *absolute* - Sets the altitude of the coordinate relative to sea level, regardless of the actual elevation of the terrain beneath the element. For example, if you set the altitude of a coordinate to 10 meters with an *absolute* altitude mode, the icon of a point placemark will appear to be at ground level if the terrain beneath is also 10 meters above sea level. If the terrain is 3 meters above sea level, the placemark will appear elevated above the terrain by 7 meters. A typical use of this mode is for aircraft placement. 44 | */ 45 | @property (nonatomic, assign) KMLAltitudeMode altitudeMode; 46 | 47 | /** A single tuple consisting of floating point values for longitude, latitude, and altitude (in that order). 48 | 49 | Longitude and latitude values are in degrees, where 50 | 51 | - longitude ≥ −180 and <= 180 52 | - latitude ≥ −90 and ≤ 90 53 | - altitude values (optional) are in meters above sea level 54 | 55 | Do not include spaces between the three values that describe a coordinate. 56 | */ 57 | @property (strong, nonatomic) KMLCoordinate *coordinate; 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLNetworkLinkControl.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLNetworkLinkControl.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLElement.h" 11 | 12 | @class KMLUpdate; 13 | @class KMLAbstractView; 14 | 15 | /** Controls the behavior of files fetched by a KMLNetworkLink. 16 | 17 | The KML Framework follows KML standard specification. 18 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 19 | */ 20 | @interface KMLNetworkLinkControl : KMLElement 21 | 22 | 23 | /// --------------------------------- 24 | /// @name Accessing Properties 25 | /// --------------------------------- 26 | 27 | /** Specified in seconds, <minRefreshPeriod> is the minimum allowed time between fetches of the file. 28 | 29 | This parameter allows servers to throttle fetches of a particular file and to tailor refresh rates to the expected rate of change to the data. 30 | For example, a user might set a link refresh to 5 seconds, but you could set your minimum refresh period to 3600 to limit refresh updates to once every hour. */ 31 | @property (nonatomic, assign) CGFloat minRefreshPeriod; 32 | 33 | /** Specified in seconds, <maxSessionLength> is the maximum amount of time for which the client NetworkLink can remain connected. 34 | 35 | The default value of -1 indicates not to terminate the session explicitly. */ 36 | @property (nonatomic, assign) CGFloat maxSessionLength; 37 | 38 | /** Use this element to append a string to the URL query on the next refresh of the network link. 39 | 40 | You can use this data in your script to provide more intelligent handling on the server side, including version querying and conditional file delivery. */ 41 | @property (strong, nonatomic) NSString *cookie; 42 | 43 | /** You can deliver a pop-up message, such as usage guidelines for your network link. 44 | 45 | The message appears when the network link is first loaded into Google Earth, or when it is changed in the network link control. */ 46 | @property (strong, nonatomic) NSString *message; 47 | 48 | /** You can control the name of the network link from the server, so that changes made to the name on the client side are overridden by the server. */ 49 | @property (strong, nonatomic) NSString *linkName; 50 | 51 | /** You can control the description of the network link from the server, so that changes made to the description on the client side are overridden by the server. */ 52 | @property (strong, nonatomic) NSString *linkDescription; 53 | 54 | /** You can control the snippet for the network link from the server, so that changes made to the snippet on the client side are overridden by the server. 55 | 56 | <linkSnippet> has a maxLines attribute, an integer that specifies the maximum number of lines to display. */ 57 | @property (strong, nonatomic) NSString *linkSnippet; 58 | 59 | /** You can specify a date/time at which the link should be refreshed. 60 | 61 | This specification takes effect only if the <refreshMode> in <Link> has a value of onExpire. 62 | See <refreshMode> */ 63 | @property (strong, nonatomic) NSDate *expires; 64 | 65 | /** With KMLUpdate, you can specify any number of Change, Create, and Delete tags for a .kml file or .kmz archive that has previously been loaded with a network link. 66 | 67 | See KMLUpdate. */ 68 | @property (strong, nonatomic) KMLUpdate *update; 69 | 70 | /** See KMLAbstractView. */ 71 | @property (strong, nonatomic) KMLAbstractView *abstractView; 72 | 73 | @end 74 | -------------------------------------------------------------------------------- /AIMapViewWrapper/AIMapViewWrapper/Routing/AIRoute.m: -------------------------------------------------------------------------------- 1 | // 2 | // AIRoute.m 3 | // AIMapViewWrapper 4 | // 5 | // Created by CocoaToucher on 12/24/12. 6 | // Copyright (c) 2012 CocoaToucher. All rights reserved. 7 | // 8 | 9 | #import "AIRoute.h" 10 | 11 | @interface AIRoute () 12 | 13 | @property(nonatomic, strong, readwrite) NSArray *coordinates; 14 | @property(nonatomic, readwrite) MKMapRect boundingMapRect; 15 | 16 | @end 17 | 18 | @implementation AIRoute 19 | 20 | + (AIRoute *)routeWithCoordinates:(NSArray *)inCoordinates { 21 | AIRoute *result = [[AIRoute alloc] init]; 22 | #if !(__has_feature(objc_arc)) 23 | [result autorelease]; 24 | #endif 25 | result.coordinates = inCoordinates; 26 | 27 | return result; 28 | } 29 | 30 | - (void)setCoordinates:(NSArray *)coordinates { 31 | if (coordinates != _coordinates) { 32 | #if !(__has_feature(objc_arc)) 33 | [_coordinates release]; 34 | _coordinates = [coordinates retain]; 35 | #else 36 | _coordinates = coordinates; 37 | #endif 38 | } 39 | 40 | CLLocationCoordinate2D leftMostCoordinate = CLLocationCoordinate2DMake(0, 0); 41 | CLLocationCoordinate2D bottomCoordinate = CLLocationCoordinate2DMake(0, 0); 42 | CLLocationCoordinate2D topCoordinate = CLLocationCoordinate2DMake(0, 0); 43 | CLLocationCoordinate2D rightMostCoordinate = CLLocationCoordinate2DMake(0, 0); 44 | 45 | CLLocationDegrees minLat = 90; 46 | CLLocationDegrees minLon = 180; 47 | CLLocationDegrees maxLat = -90; 48 | CLLocationDegrees maxLon = -180; 49 | 50 | for (int idx = 0; idx < _coordinates.count; idx++) { 51 | CLLocation *currentLocation = [_coordinates objectAtIndex:idx]; 52 | 53 | if(currentLocation.coordinate.latitude > maxLat) { 54 | maxLat = currentLocation.coordinate.latitude; 55 | topCoordinate.latitude = maxLat; 56 | topCoordinate.longitude = currentLocation.coordinate.longitude; 57 | } 58 | if(currentLocation.coordinate.latitude < minLat) { 59 | minLat = currentLocation.coordinate.latitude; 60 | bottomCoordinate.latitude = minLat; 61 | bottomCoordinate.longitude = currentLocation.coordinate.longitude; 62 | } 63 | if(currentLocation.coordinate.longitude > maxLon) { 64 | maxLon = currentLocation.coordinate.longitude; 65 | rightMostCoordinate.longitude = maxLon; 66 | rightMostCoordinate.latitude = currentLocation.coordinate.latitude; 67 | } 68 | if(currentLocation.coordinate.longitude < minLon) { 69 | minLon = currentLocation.coordinate.longitude; 70 | leftMostCoordinate.longitude = minLon; 71 | leftMostCoordinate.latitude = currentLocation.coordinate.latitude; 72 | } 73 | } 74 | 75 | CLLocationCoordinate2D upperLeftCoord = CLLocationCoordinate2DMake(topCoordinate.latitude, leftMostCoordinate.longitude); 76 | MKMapPoint upperLeftPoint = MKMapPointForCoordinate(upperLeftCoord); 77 | 78 | CLLocationCoordinate2D bottomRightCoord = CLLocationCoordinate2DMake(bottomCoordinate.latitude, rightMostCoordinate.longitude); 79 | MKMapPoint bottomRightPoint = MKMapPointForCoordinate(bottomRightCoord); 80 | 81 | MKMapRect boundingRect = MKMapRectNull; 82 | boundingRect.origin.x = upperLeftPoint.x; 83 | boundingRect.origin.y = upperLeftPoint.y; 84 | boundingRect.size.width = fabs(upperLeftPoint.x - bottomRightPoint.x); 85 | boundingRect.size.height = fabs(upperLeftPoint.y - bottomRightPoint.y); 86 | self.boundingMapRect = boundingRect; 87 | } 88 | 89 | - (CLLocationCoordinate2D)coordinate { 90 | 91 | MKMapRect boundingRect = [self boundingMapRect]; 92 | MKMapPoint center = MKMapPointMake(boundingRect.origin.x + boundingRect.size.width / 2.0f, boundingRect.origin.y + boundingRect.size.height / 2.0f); 93 | 94 | return MKCoordinateForMapPoint(center); 95 | } 96 | 97 | @end 98 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLBalloonStyle.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLBalloonStyle.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractSubStyle.h" 11 | 12 | /** Specifies how the description balloon for placemarks is drawn. 13 | The <bgColor>, if specified, is used as the background color of the balloon. 14 | See KMLAbstractFeature for a diagram illustrating how the default description balloon appears in Google Earth. 15 | 16 | The KML Framework follows KML standard specification. 17 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 18 | */ 19 | @interface KMLBalloonStyle : KMLAbstractSubStyle 20 | 21 | 22 | /// --------------------------------- 23 | /// @name Accessing Properties 24 | /// --------------------------------- 25 | 26 | /** Background color of the balloon (optional). 27 | 28 | Color and opacity (alpha) values are expressed in hexadecimal notation. 29 | The range of values for any one color is 0 to 255 (00 to ff). 30 | The order of expression is aabbggrr, where aa=alpha (00 to ff); bb=blue (00 to ff); gg=green (00 to ff); rr=red (00 to ff). 31 | For alpha, 00 is fully transparent and ff is fully opaque. 32 | For example, if you want to apply a blue color with 50 percent opacity to an overlay, you would specify the following: <bgColor>7fff0000</bgColor>, where alpha=0x7f, blue=0xff, green=0x00, and red=0x00. 33 | The default is opaque white (ffffffff). 34 | 35 | @warning *Note:* The use of the <color> element within <BalloonStyle> has been deprecated. Use <bgColor> instead. 36 | */ 37 | @property (strong, nonatomic) NSString *bgColor; 38 | 39 | /** Foreground color for text. 40 | 41 | The default is black (ff000000). */ 42 | @property (strong, nonatomic) NSString *textColor; 43 | 44 | /** Text displayed in the balloon. 45 | 46 | If no text is specified, Google Earth draws the default balloon (with the Feature <name> in boldface, the Feature <description>, links for driving directions, a white background, and a tail that is attached to the point coordinates of the Feature, if specified). 47 | You can add entities to the <text> tag using the following format to refer to a child element of Feature: *$[name], $[description], $[address], $[id], $[Snippet]*. 48 | Google Earth looks in the current Feature for the corresponding string entity and substitutes that information in the balloon. 49 | To include To here - From here driving directions in the balloon, use the $[geDirections] tag. 50 | To prevent the driving directions links from appearing in a balloon, include the element with some content, or with $[description] to substitute the basic Feature <description>. 51 | 52 | For example, in the following KML excerpt, *$[name]* and *$[description]* fields will be replaced by the and <description> fields found in the Feature elements that use this BalloonStyle: 53 | 54 | This is $[name], whose description is:
$[description]
55 | */ 56 | @property (strong, nonatomic) NSString *text; 57 | 58 | /** If <displayMode> is default, Google Earth uses the information supplied in <text> to create a balloon. 59 | 60 | If <displayMode> is hide, Google Earth does not display the balloon. 61 | In Google Earth, clicking the List View icon for a Placemark whose balloon's <displayMode> is hide causes Google Earth to fly to the Placemark. */ 62 | @property (nonatomic, assign) KMLDisplayMode displayMode; 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLExtendedData.h: -------------------------------------------------------------------------------- 1 | // 2 | // NAKMMLExtendedData.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLElement.h" 11 | 12 | @class KMLData; 13 | @class KMLSchemaData; 14 | 15 | /** The ExtendedData element offers three techniques for adding custom data to a KML Feature (NetworkLink, Placemark, GroundOverlay, PhotoOverlay, ScreenOverlay, Document, Folder). 16 | These techniques are 17 | 18 | - Adding untyped data/value pairs using the <Data> element (basic) 19 | - Declaring new typed fields using the <Schema> element and then instancing them using the <SchemaData> element (advanced) 20 | - Referring to XML elements defined in other namespaces by referencing the external namespace within the KML file (basic) 21 | 22 | These techniques can be combined within a single KML file or Feature for different pieces of data. 23 | 24 | For more information, see Adding Custom Data in "Topics in KML." 25 | 26 | The KML Framework follows KML standard specification. 27 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 28 | */ 29 | @interface KMLExtendedData : KMLElement 30 | 31 | 32 | /// --------------------------------- 33 | /// @name Accessing Properties 34 | /// --------------------------------- 35 | 36 | /** The Data child elements of this element. */ 37 | @property (strong, nonatomic, readonly) NSArray *dataList; 38 | 39 | /** The SchemaData child elements of this element. */ 40 | @property (strong, nonatomic, readonly) NSArray *schemaDataList; 41 | 42 | 43 | /// --------------------------------- 44 | /// @name Adding Data 45 | /// --------------------------------- 46 | 47 | /** Inserts a given KMLData object at the end of the data array. 48 | @param data The KMLData to add to the end of the data array. 49 | */ 50 | - (void)addData:(KMLData *)data; 51 | 52 | /** Adds the KMLData objects contained in another given array to the end of the data array. 53 | @param array An array of KMLData objects to add to the end of the data array. 54 | */ 55 | - (void)addDataList:(NSArray *)array; 56 | 57 | 58 | /// --------------------------------- 59 | /// @name Removing Data 60 | /// --------------------------------- 61 | 62 | /** Removes all occurrences in the data array of a given KMLData object. 63 | @param data The KMLData object to remove from the data array. 64 | */ 65 | - (void)removeData:(KMLData *)data; 66 | 67 | 68 | /// --------------------------------- 69 | /// @name Adding SchemaData 70 | /// --------------------------------- 71 | 72 | /** Inserts a given KMLSchemaData object at the end of the schemaData array. 73 | @param schemaData The KMLSchemaData to add to the end of the schemaData array. 74 | */ 75 | - (void)addSchemaData:(KMLSchemaData *)schemaData; 76 | 77 | /** Adds the KMLSchemaData objects contained in another given array to the end of the schemaData array. 78 | @param array An array of KMLSchemaData objects to add to the end of the schemaData array. 79 | */ 80 | - (void)addSchemaDataList:(NSArray *)array; 81 | 82 | 83 | /// --------------------------------- 84 | /// @name Removing SchemaData 85 | /// --------------------------------- 86 | 87 | /** Removes all occurrences in the schemaData array of a given KMLSchemaData object. 88 | @param schemaData The KMLSchemaData object to remove from the schemaData array. 89 | */ 90 | - (void)removeSchemaData:(KMLSchemaData *)schemaData; 91 | 92 | @end 93 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #AIMapViewWrapper 2 | 3 | - Use Google maps zoom levels with your MKMapView 4 | - Add path overlay views to your MKMapView with an animated vehicle on it (useful for flight route tracking) 5 | - Get use of some other map view related functions 6 | 7 | #Requirements 8 | 9 | Classes in this project supports both ARC and non-ARC projects 10 | 11 | #Installation 12 | 13 | Add the AIMapViewWrapper folder to your project 14 | 15 | #How to use it? 16 | 17 | ##AIMapViewWrapper - Zoom level 18 | 19 | #import "AIMapViewWrapper.h" 20 | 21 | //create a AIMapViewWrapper instance with your MKMapView object 22 | self.mapWrapper = [[AIMapViewWrapper alloc] initWithMapView:self.mapView]; 23 | 24 | //set a google maps zoom level 25 | //valid zoom level values are between a minimum zoom level and maximum 19 26 | //minimum zoom level changes in accordance with your map view's bounds 27 | self.mapWrapper.zoomLevel = 5; 28 | 29 | //in your MKMapView's delegate method listen for changes in zoomLevel 30 | - (void)mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated { 31 | 32 | self.zoomLevelSlider.value = self.mapWrapper.zoomLevel; 33 | 34 | } 35 | 36 | //become a delegate of your map view wrapper 37 | self.mapWrapper.delegate = self; 38 | 39 | //respond to changes of minimum zoom level that can be set on your MKMapView 40 | - (void)mapViewWrapperMinimumZoomLevelChanged:(AIMapViewWrapper *)wrapper { 41 | 42 | NSInteger zoomLevel = wrapper.zoomLevel; 43 | } 44 | 45 | ##AIOverlayRouteView 46 | 47 | AIOverlayRouteView is a MKOverlayPathView subclass which you can use to add an animated vehicle over a path on your map view 48 | 49 | #import "AIRoute.h" 50 | #import "AIOverlayRouteView.h" 51 | 52 | //Create a AIRoute (a MKOverlay) and add it to your map view 53 | AIRoute *route = [AIRoute routeWithCoordinates:/*array of CLLocation objects*/]; 54 | [self.mapView addOverlay:route]; 55 | 56 | //in your map view's delegate method create an AIOverlayRouteView with the added route overlay 57 | - (MKOverlayView *)mapView:(MKMapView *)mapView viewForOverlay:(id )overlay { 58 | if ([overlay isKindOfClass:[AIRoute class]]) { 59 | AIOverlayRouteView *pathView = [[AIOverlayRouteView alloc] initWithRoute:overlay vehicleImage:[UIImage imageNamed:@"plane.png"]]; 60 | pathView.delegate = self; 61 | pathView.strokeColor = [[UIColor whiteColor] colorWithAlphaComponent:0.7f]; 62 | pathView.lineCap = kCGLineCapRound; 63 | pathView.lineWidth = 6.0f; 64 | 65 | return pathView; 66 | } 67 | return nil; 68 | } 69 | 70 | //in your map view's delegate method call AIOverlayRouteView's layout method for proper subview layout 71 | //using AIMapViewWrapper's zoomScale value 72 | - (void)mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated { 73 | 74 | AIOverlayRouteView *routeView = (AIOverlayRouteView *)[mapView viewForOverlay:self.route]; 75 | 76 | [routeView layoutWithZoomScale:self.mapWrapper.zoomScale]; 77 | } 78 | 79 | //in your AIRouteOverlay delegate method start the vehicle animation 80 | //you can start this animation any time you want after this delegate method is called 81 | - (void)overlayRouteViewIsReadyForAnimation:(AIOverlayRouteView *)routeView { 82 | 83 | //provide animation time intervals 84 | [routeView startAnimationWithTotalTravelTime:40000 85 | remainingTravelTime:20000]; 86 | } 87 | 88 | //you can track the vehicle as its position changes 89 | //with this map view's zoom level focuses on the moving vehicle 90 | self.mapWrapper.trackedRoute = self.route; 91 | 92 | 93 | #Screenshots 94 | 95 | ![Screenshot 1](http://f.cl.ly/items/451S010h260d0b1w032g/1.png) 96 | ![Screenshot 2](http://f.cl.ly/items/3q433Q0L2D1T0G3N0y25/2.png) 97 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLCamera.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLCamera.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractView.h" 11 | 12 | /** Defines the virtual camera that views the scene. 13 | This element defines the position of the camera relative to the Earth's surface as well as the viewing direction of the camera. The camera position is defined by <longitude>, <latitude>, <altitude>, and either <altitudeMode> or <gx:altitudeMode>. 14 | The viewing direction of the camera is defined by <heading>, <tilt>, and <roll>. <Camera> can be a child element of any Feature or of <NetworkLinkControl>. 15 | A parent element cannot contain both a <Camera> and a <LookAt> at the same time. 16 | 17 | <Camera> provides full six-degrees-of-freedom control over the view, so you can position the Camera in space and then rotate it around the X, Y, and Z axes. 18 | Most importantly, you can tilt the camera view so that you're looking above the horizon into the sky. 19 | 20 | <Camera> can also contain a TimePrimitive (<gx:TimeSpan> or <gx:TimeStamp>). 21 | Time values in Camera affect historical imagery, sunlight, and the display of time-stamped features. For more information, read Time with AbstractViews in the *Time and Animation* chapter of the Developer's Guide. 22 | 23 | The KML Framework follows KML standard specification. 24 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 25 | */ 26 | @interface KMLCamera : KMLAbstractView 27 | 28 | 29 | /// --------------------------------- 30 | /// @name Accessing Properties 31 | /// --------------------------------- 32 | 33 | /** Longitude of the virtual camera (eye point). Angular distance in degrees, relative to the Prime Meridian. 34 | 35 | Values west of the Meridian range from −180 to 0 degrees. Values east of the Meridian range from 0 to 180 degrees. */ 36 | @property (nonatomic, assign) CGFloat longitude; 37 | 38 | /** Latitude of the virtual camera. Degrees north or south of the Equator (0 degrees). 39 | 40 | Values range from −90 degrees to 90 degrees.*/ 41 | @property (nonatomic, assign) CGFloat latitude; 42 | 43 | /** Distance of the camera from the earth's surface, in meters. 44 | 45 | Interpreted according to the Camera's <altitudeMode> or <gx:altitudeMode>. */ 46 | @property (nonatomic, assign) CGFloat altitude; 47 | 48 | /** Direction (azimuth) of the camera, in degrees. Default=0 (true North). 49 | 50 | Values range from 0 to 360 degrees. */ 51 | @property (nonatomic, assign) CGFloat heading; 52 | 53 | /** Rotation, in degrees, of the camera around the X axis. 54 | 55 | A value of 0 indicates that the view is aimed straight down toward the earth (the most common case). 56 | A value for 90 for <tilt> indicates that the view is aimed toward the horizon. Values greater than 90 indicate that the view is pointed up into the sky. Values for <tilt> are clamped at +180 degrees. */ 57 | @property (nonatomic, assign) CGFloat tilt; 58 | 59 | /** Rotation, in degrees, of the camera around the *Z* axis. 60 | 61 | Values range from −180 to +180 degrees. */ 62 | @property (nonatomic, assign) CGFloat roll; 63 | 64 | /** Specifies how the <altitude> specified for the Camera is interpreted. 65 | 66 | Possible values are as follows: 67 | 68 | - *relativeToGround* - (default) Interprets the <altitude> as a value in meters above the ground. If the point is over water, the <altitude> will be interpreted as a value in meters above sea level. See <gx:altitudeMode> below to specify points relative to the sea floor. 69 | - *clampToGround* - For a camera, this setting also places the camera relativeToGround, since putting the camera exactly at terrain height would mean that the eye would intersect the terrain (and the view would be blocked). 70 | - *absolute* - Interprets the <altitude> as a value in meters above sea level. 71 | */ 72 | @property (nonatomic, assign) KMLAltitudeMode altitudeMode; 73 | 74 | @end 75 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLLineString.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLLineString.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractGeometry.h" 11 | 12 | @class KMLCoordinate; 13 | 14 | /** Defines a connected set of line segments. 15 | Use KMLLineStyle to specify the color, color mode, and width of the line. 16 | When a LineString is extruded, the line is extended to the ground, forming a polygon that looks somewhat like a wall or fence. 17 | For extruded LineStrings, the line itself uses the current LineStyle, and the extrusion uses the current PolyStyle. 18 | See the KML Tutorial for examples of LineStrings (or paths). 19 | 20 | The KML Framework follows KML standard specification. 21 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 22 | */ 23 | @interface KMLLineString : KMLAbstractGeometry 24 | 25 | 26 | /// --------------------------------- 27 | /// @name Accessing Properties 28 | /// --------------------------------- 29 | 30 | /** Boolean value. 31 | 32 | Specifies whether to connect the LineString to the ground. 33 | To extrude a LineString, the altitude mode must be either relativeToGround, relativeToSeaFloor, or absolute. 34 | The vertices in the LineString are extruded toward the center of the Earth's sphere. */ 35 | @property (nonatomic, assign) BOOL extrude; 36 | 37 | /** Boolean value. 38 | 39 | Specifies whether to allow the LineString to follow the terrain. 40 | To enable tessellation, the altitude mode must be clampToGround or clampToSeaFloor. 41 | Very large LineStrings should enable tessellation so that they follow the curvature of the earth (otherwise, they may go underground and be hidden). */ 42 | @property (nonatomic, assign) BOOL tessellate; 43 | 44 | /** Specifies how altitude components in the element are interpreted. 45 | 46 | Possible values are 47 | 48 | - *clampToGround* - (default) Indicates to ignore an altitude specification (for example, in the tag). 49 | - *relativeToGround* - Sets the altitude of the element relative to the actual ground elevation of a particular location. For example, if the ground elevation of a location is exactly at sea level and the altitude for a point is set to 9 meters, then the elevation for the icon of a point placemark elevation is 9 meters with this mode. However, if the same coordinate is set over a location where the ground elevation is 10 meters above sea level, then the elevation of the coordinate is 19 meters. A typical use of this mode is for placing telephone poles or a ski lift. 50 | - *absolute* - Sets the altitude of the coordinate relative to sea level, regardless of the actual elevation of the terrain beneath the element. For example, if you set the altitude of a coordinate to 10 meters with an absolute altitude mode, the icon of a point placemark will appear to be at ground level if the terrain beneath is also 10 meters above sea level. If the terrain is 3 meters above sea level, the placemark will appear elevated above the terrain by 7 meters. A typical use of this mode is for aircraft placement. 51 | */ 52 | @property (nonatomic, assign) KMLAltitudeMode altitudeMode; 53 | 54 | /** Two or more coordinate tuples, each consisting of floating point values for longitude, latitude, and altitude. 55 | 56 | The altitude component is optional. Insert a space between tuples. 57 | Do not include spaces within a tuple. */ 58 | @property (strong, nonatomic, readonly) NSArray *coordinates; 59 | 60 | 61 | /// --------------------------------- 62 | /// @name Adding StyleSelector 63 | /// --------------------------------- 64 | 65 | /** Inserts a given KMLCoordinate object at the end of the coordinate array. 66 | @param coordinate The KMLCoordinate to add to the end of the coordinate array. 67 | */ 68 | - (void)addCoordinate:(KMLCoordinate *)coordinate; 69 | 70 | /** Adds the KMLCoordinate objects contained in another given array to the end of the coordinate array. 71 | @param array An array of KMLCoordinate objects to add to the end of the coordinate array. 72 | */ 73 | - (void)addCoordinates:(NSArray *)array; 74 | 75 | 76 | /// --------------------------------- 77 | /// @name Removing StyleSelector 78 | /// --------------------------------- 79 | 80 | /** Removes all occurrences in the coordinate array of a given KMLCoordinate object. 81 | @param coordinate The KMLCoordinate object to remove from the coordinate array. 82 | */ 83 | - (void)removeCoordinate:(KMLCoordinate *)coordinate; 84 | 85 | @end 86 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLLinearRing.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLLinearRing.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractGeometry.h" 11 | 12 | @class KMLCoordinate; 13 | 14 | /** Defines a closed line string, typically the outer boundary of a Polygon. 15 | Optionally, a LinearRing can also be used as the inner boundary of a Polygon to create holes in the Polygon. 16 | A Polygon can contain multiple <LinearRing> elements used as inner boundaries. 17 | 18 | @warning *Note:* In Google Earth, a Polygon with an <altitudeMode> of clampToGround follows lines of constant bearing; however, a LinearRing (by itself) with an <altitudeMode> of clampToGround follows great circle lines. 19 | 20 | The KML Framework follows KML standard specification. 21 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 22 | */ 23 | @interface KMLLinearRing : KMLAbstractGeometry 24 | 25 | 26 | /// --------------------------------- 27 | /// @name Accessing Properties 28 | /// --------------------------------- 29 | 30 | /** Boolean value. 31 | 32 | Specifies whether to connect the LinearRing to the ground. 33 | To extrude this geometry, the altitude mode must be either relativeToGround, relativeToSeaFloor, or absolute. 34 | Only the vertices of the LinearRing are extruded, not the center of the geometry. 35 | The vertices are extruded toward the center of the Earth's sphere. */ 36 | @property (nonatomic, assign) BOOL extrude; 37 | 38 | /** Boolean value. 39 | 40 | Specifies whether to allow the LinearRing to follow the terrain. 41 | To enable tessellation, the value for <altitudeMode> must be clampToGround or clampToSeaFloor. 42 | Very large LinearRings should enable tessellation so that they follow the curvature of the earth (otherwise, they may go underground and be hidden). */ 43 | @property (nonatomic, assign) BOOL tessellate; 44 | 45 | /** Specifies how altitude components in the <coordinates> element are interpreted. 46 | 47 | Possible values are 48 | 49 | - *clampToGround* - (default) Indicates to ignore an altitude specification (for example, in the <coordinates> tag). 50 | - *relativeToGround* - Sets the altitude of the element relative to the actual ground elevation of a particular location. For example, if the ground elevation of a location is exactly at sea level and the altitude for a point is set to 9 meters, then the elevation for the icon of a point placemark elevation is 9 meters with this mode. However, if the same coordinate is set over a location where the ground elevation is 10 meters above sea level, then the elevation of the coordinate is 19 meters. A typical use of this mode is for placing telephone poles or a ski lift. 51 | - *absolute* - Sets the altitude of the coordinate relative to sea level, regardless of the actual elevation of the terrain beneath the element. For example, if you set the altitude of a coordinate to 10 meters with an absolute altitude mode, the icon of a point placemark will appear to be at ground level if the terrain beneath is also 10 meters above sea level. If the terrain is 3 meters above sea level, the placemark will appear elevated above the terrain by 7 meters. A typical use of this mode is for aircraft placement. 52 | */ 53 | @property (nonatomic, assign) KMLAltitudeMode altitudeMode; 54 | 55 | /** Four or more tuples, each consisting of floating point values for longitude, latitude, and altitude. 56 | 57 | The altitude component is optional. 58 | Do not include spaces within a tuple. 59 | The last coordinate must be the same as the first coordinate. 60 | Coordinates are expressed in decimal degrees only */ 61 | @property (strong, nonatomic, readonly) NSArray *coordinates; 62 | 63 | 64 | /// --------------------------------- 65 | /// @name Adding StyleSelector 66 | /// --------------------------------- 67 | 68 | /** Inserts a given KMLCoordinate object at the end of the coordinate array. 69 | @param coordinate The KMLCoordinate to add to the end of the coordinate array. 70 | */ 71 | - (void)addCoordinate:(KMLCoordinate *)coordinate; 72 | 73 | /** Adds the KMLCoordinate objects contained in another given array to the end of the coordinate array. 74 | @param array An array of KMLCoordinate objects to add to the end of the coordinate array. 75 | */ 76 | - (void)addCoordinates:(NSArray *)array; 77 | 78 | 79 | /// --------------------------------- 80 | /// @name Removing StyleSelector 81 | /// --------------------------------- 82 | 83 | /** Removes all occurrences in the coordinate array of a given KMLCoordinate object. 84 | @param coordinate The KMLCoordinate object to remove from the coordinate array. 85 | */ 86 | - (void)removeCoordinate:(KMLCoordinate *)coordinate; 87 | 88 | @end 89 | -------------------------------------------------------------------------------- /AIMapViewWrapper/AIMapViewWrapper/AIMapViewWrapper.h: -------------------------------------------------------------------------------- 1 | // 2 | // AIMapViewWrapper.h 3 | // AIMapViewWrapper 4 | // 5 | // Created by CocoaToucher on 12/19/12. 6 | // Copyright (c) 2012 CocoaToucher. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class AIRoute; 12 | @protocol AIMapViewWrapperDelegate; 13 | 14 | extern NSString *AIStringFromMKMapRect(MKMapRect rect); 15 | extern NSString *AIStringFromCLLocationCoordinate2D(CLLocationCoordinate2D coordinate); 16 | 17 | /** 18 | AIMapViewWrapper provides handy functions for MKMapView 19 | like getting and setting a Google maps zoom 20 | getting MKZoomScale from the map view 21 | */ 22 | @interface AIMapViewWrapper : NSObject 23 | 24 | /** 25 | @param map view to be wrapped 26 | */ 27 | - (id)initWithMapView:(MKMapView *)mapView; 28 | 29 | /** 30 | Wrapped map view 31 | */ 32 | @property(nonatomic, strong, readonly) MKMapView *mapView; 33 | 34 | @property(nonatomic, assign) id delegate; 35 | 36 | /** 37 | Google maps zoom level for the map 38 | Apple uses a range between a minZoomLevel(see below) and 19 39 | Zoom level values less than minZoomLevel or bigger than 19 are clamped to these values 40 | Center coordinate of the map doesn't change after zoom level changes 41 | */ 42 | @property(nonatomic) NSUInteger zoomLevel; 43 | 44 | /** 45 | Sets Google maps zoom level of the map view with animation 46 | Center coordinate of the map doesn't change after zoom level changes 47 | @param zoom level 48 | @param animated: YES if the zoom level should be set animated; otherwise, NO. 49 | */ 50 | - (void)setZoomLevel:(NSUInteger)zoomLevel 51 | animated:(BOOL)animated; 52 | 53 | /** 54 | Sets Google maps zoom level of the map view with a center coordinate and animation 55 | @param zoomLevel, desired zoom level 56 | @param inCenter, center coordinate 57 | @param animated, YES if the zoom level should be set animated; otherwise, NO. 58 | */ 59 | - (void)setZoomLevel:(NSUInteger)zoomLevel 60 | withCenterCoordinate:(CLLocationCoordinate2D)inCenter 61 | animated:(BOOL)animated; 62 | 63 | /** 64 | Minimum zoom level value that can be set on map view 65 | Value of this property changes according to the frame size of the map view 66 | */ 67 | @property(nonatomic, readonly) NSUInteger minZoomLevel; 68 | 69 | /** 70 | Zoom scale of the map view that Apple sends as a parameter to drawMapRect:zoomScale:inContext: 71 | and similar methods of its MKOverlayViews 72 | You can use this to layout subviews of your MKOverlayView subclasses 73 | */ 74 | @property(nonatomic, readonly) MKZoomScale zoomScale; 75 | 76 | /** 77 | By setting this property you can track the vehicle on the route of an AIOverlayRouteView 78 | If trackedRoute's overlay route view's isAnimating property is NO, this method does nothing 79 | After trackedRoute is set, a timer with 0.2 sec fixed interval is started to set map view's center coordinate while the vehicle's position is changing 80 | Set to nil or call cancelTracking below to stop tracking 81 | You should make mapViewWrapper stop tracking the route before its owner is deallocated 82 | Map view's user interaction is disabled after a trackedRoute is set, and enabled again once the tracked route is set to nil 83 | */ 84 | @property(nonatomic, strong) AIRoute *trackedRoute; 85 | 86 | /** 87 | Invalidates the route track timer instance and stops updating map view center coordinate 88 | by setting the trackedRoute property to nil 89 | */ 90 | - (void)cancelTrackingRoute; 91 | 92 | /** 93 | Use this method to get the MKMapRect that includes all the given annotations' map rectangles 94 | Then you can use MKMapView's setVisibleMapRect: method to make all these annotations visible on the screen 95 | @param annotations, array of id objects 96 | */ 97 | - (MKMapRect)mapRectThatFitsAnnotations:(NSArray *)annotations; 98 | 99 | /** 100 | If there is only single annotation in the parameter this method zooms map view to level:14 with the single annotation's center coordinate 101 | For multiple annotations it uses mapRectThatFitsAnnotations: method and set's map view's visibleMapRect to the returning value 102 | @param annotations, array of id objects 103 | */ 104 | - (void)zoomToFitMapAnnotations:(NSArray *)annotations 105 | animated:(BOOL)animated; 106 | 107 | /** 108 | This method makes the UIApplication open either Apple maps URL or Google maps URL for directions between two coordinates depending on the iOS version 109 | @param fromCoor, source coordinate 110 | @param toCoor, destination coordinate 111 | */ 112 | - (void)launchDirectionsFromCoordinate:(CLLocationCoordinate2D)fromCoor 113 | toCoordinate:(CLLocationCoordinate2D)toCoor; 114 | 115 | /** 116 | This does the reverse job of MKCoordinateRegionForMapRect() method from MKGeometry 117 | @param region to be converted to MKMapRect 118 | */ 119 | - (MKMapRect)mapRectForCoordinateRegion:(MKCoordinateRegion)region; 120 | 121 | @end 122 | 123 | @protocol AIMapViewWrapperDelegate 124 | 125 | @optional 126 | /** 127 | When map view's frame size changes either via autoresizing or setFrame:, minZoomLevel value changes 128 | Use this delegate method to be informed of this change 129 | */ 130 | - (void)mapViewWrapperMinimumZoomLevelChanged:(AIMapViewWrapper *)wrapper; 131 | 132 | @end 133 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLPolygon.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLPolygon.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractGeometry.h" 11 | 12 | @class KMLLinearRing; 13 | 14 | /** A Polygon is defined by an outer boundary and 0 or more inner boundaries. 15 | The boundaries, in turn, are defined by LinearRings. 16 | When a Polygon is extruded, its boundaries are connected to the ground to form additional polygons, which gives the appearance of a building or a box. 17 | Extruded Polygons use KMLPolyStyle for their color, color mode, and fill. 18 | The <coordinates> for polygons must be specified in counterclockwise order. 19 | Polygons follow the "right-hand rule," which states that if you place the fingers of your right hand in the direction in which the coordinates are specified, your thumb points in the general direction of the geometric normal for the polygon. 20 | (In 3D graphics, the geometric normal is used for lighting and points away from the front face of the polygon.) 21 | Since Google Earth fills only the front face of polygons, you will achieve the desired effect only when the coordinates are specified in the proper order. 22 | Otherwise, the polygon will be gray. 23 | 24 | @warning *Note:* In Google Earth, a Polygon with an <altitudeMode> of clampToGround follows lines of constant bearing; however, a LinearRing (by itself) with an <altitudeMode> of clampToGround follows great circle lines. 25 | 26 | The KML Framework follows KML standard specification. 27 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 28 | */ 29 | @interface KMLPolygon : KMLAbstractGeometry 30 | 31 | 32 | /// --------------------------------- 33 | /// @name Accessing Properties 34 | /// --------------------------------- 35 | 36 | /** Boolean value. 37 | 38 | Specifies whether to connect the Polygon to the ground. 39 | To extrude a Polygon, the altitude mode must be either relativeToGround, relativeToSeaFloor, or absolute. 40 | Only the vertices are extruded, not the geometry itself (for example, a rectangle turns into a box with five faces). 41 | The vertices of the Polygon are extruded toward the center of the Earth's sphere. 42 | */ 43 | @property (nonatomic, assign) BOOL extrude; 44 | 45 | /** This field is not used by Polygon. 46 | 47 | To allow a Polygon to follow the terrain (that is, to enable tessellation) specify an altitude mode of clampToGround or clampToSeaFloor. */ 48 | @property (nonatomic, assign) BOOL tessellate; 49 | 50 | /** Specifies how altitude components in the <coordinates> element are interpreted. 51 | 52 | Possible values are 53 | 54 | - *clampToGround* - (default) Indicates to ignore an altitude specification (for example, in the <coordinates> tag). 55 | - *relativeToGround* - Sets the altitude of the element relative to the actual ground elevation of a particular location. For example, if the ground elevation of a location is exactly at sea level and the altitude for a point is set to 9 meters, then the elevation for the icon of a point placemark elevation is 9 meters with this mode. However, if the same coordinate is set over a location where the ground elevation is 10 meters above sea level, then the elevation of the coordinate is 19 meters. A typical use of this mode is for placing telephone poles or a ski lift. 56 | - *absolute* - Sets the altitude of the coordinate relative to sea level, regardless of the actual elevation of the terrain beneath the element. For example, if you set the altitude of a coordinate to 10 meters with an absolute altitude mode, the icon of a point placemark will appear to be at ground level if the terrain beneath is also 10 meters above sea level. If the terrain is 3 meters above sea level, the placemark will appear elevated above the terrain by 7 meters. A typical use of this mode is for aircraft placement. 57 | */ 58 | @property (nonatomic, assign) KMLAltitudeMode altitudeMode; 59 | 60 | /** Contains a KMLLinearRing element. */ 61 | @property (strong, nonatomic) KMLLinearRing *outerBoundaryIs; 62 | 63 | /** Contains a KMLLinearRing element. 64 | 65 | A Polygon can contain multiple <innerBoundaryIs> elements, which create multiple cut-outs inside the Polygon. */ 66 | @property (strong, nonatomic, readonly) NSArray *innerBoundaryIsList; 67 | 68 | 69 | /// --------------------------------- 70 | /// @name Adding InnerBoundaryIs 71 | /// --------------------------------- 72 | 73 | /** Inserts a given KMLLinearRing object at the end of the InnerBoundaryIs array. 74 | @param object The KMLLinearRing to add to the end of the InnerBoundaryIs array. 75 | */ 76 | - (void)addInnerBoundaryIs:(KMLLinearRing *)object; 77 | 78 | /** Adds the KMLLinearRing objects contained in another given array to the end of the InnerBoundaryIs array. 79 | @param array An array of KMLLinearRing objects to add to the end of the InnerBoundaryIs array. 80 | */ 81 | - (void)addInnerBoundaryIsList:(NSArray *)array; 82 | 83 | 84 | /// --------------------------------- 85 | /// @name Removing InnerBoundaryIs 86 | /// --------------------------------- 87 | 88 | /** Removes all occurrences in the InnerBoundaryIs array of a given KMLLinearRing object. 89 | @param object The KMLLinearRing object to remove from the InnerBoundaryIs array. 90 | */ 91 | - (void)removeInnerBoundaryIs:(KMLLinearRing *)object; 92 | 93 | @end 94 | -------------------------------------------------------------------------------- /AIMapViewWrapper/controller/AISampleViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // AISampleViewController.m 3 | // AIMapViewWrapper 4 | // 5 | // Created by CocoaToucher on 12/19/12. 6 | // Copyright (c) 2012 CocoaToucher. All rights reserved. 7 | // 8 | 9 | #import "AISampleViewController.h" 10 | #import "AIMapViewWrapper.h" 11 | #import 12 | #import "AIOverlayRouteView.h" 13 | #import "AIRoute.h" 14 | #import 15 | #import 16 | 17 | 18 | @interface AISampleViewController () < MKMapViewDelegate, AIMapViewWrapperDelegate, AIOverlayRouteViewDelegate > 19 | 20 | @property(nonatomic, strong) AIMapViewWrapper *mapWrapper; 21 | @property(nonatomic, strong) IBOutlet MKMapView *mapView; 22 | @property(nonatomic, strong) IBOutlet UISlider *zoomSlider; 23 | @property(nonatomic, strong) IBOutlet UILabel *zoomLevelLabel; 24 | @property(nonatomic, strong) AIRoute *route; 25 | @property(nonatomic, strong) UIBarButtonItem *btnTrack; 26 | 27 | - (IBAction)zoomSliderValueChanged:(id)sender; 28 | 29 | - (void)onZoomLevelUpdate; 30 | 31 | - (NSArray *)sampleFlightCoordinates; 32 | 33 | @end 34 | 35 | @implementation AISampleViewController 36 | 37 | - (void)dealloc { 38 | #if !(__has_feature(objc_arc)) 39 | [_mapWrapper cancelTrackingRoute]; 40 | [_mapWrapper release]; 41 | _mapWrapper = nil; 42 | [_mapView release]; 43 | _mapView = nil; 44 | [_zoomSlider release]; 45 | _zoomSlider = nil; 46 | [_zoomLevelLabel release]; 47 | _zoomLevelLabel = nil; 48 | [_route release]; 49 | _route = nil; 50 | [_btnTrack release]; 51 | _btnTrack = nil; 52 | 53 | [super dealloc]; 54 | #endif 55 | } 56 | 57 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 58 | { 59 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 60 | if (self) { 61 | _btnTrack = [[UIBarButtonItem alloc] initWithTitle:@"Track flight" 62 | style:UIBarButtonItemStyleBordered 63 | target:self 64 | action:@selector(onTrack:)]; 65 | [self.navigationItem setRightBarButtonItem:_btnTrack]; 66 | _btnTrack.enabled = NO; 67 | } 68 | return self; 69 | } 70 | 71 | - (void)viewDidLoad 72 | { 73 | [super viewDidLoad]; 74 | 75 | AIMapViewWrapper *tWrapper = [[AIMapViewWrapper alloc] initWithMapView:self.mapView]; 76 | self.mapWrapper = tWrapper; 77 | #if !(__has_feature(objc_arc)) 78 | [tWrapper release]; 79 | #endif 80 | 81 | self.mapView.mapType = MKMapTypeSatellite; 82 | 83 | self.mapWrapper.delegate = self; 84 | 85 | self.route = [AIRoute routeWithCoordinates:[self sampleFlightCoordinates]]; 86 | [self.mapView addOverlay:self.route]; 87 | } 88 | 89 | - (void)viewWillAppear:(BOOL)animated { 90 | self.mapView.centerCoordinate = CLLocationCoordinate2DMake(51.516434, -0.115356); 91 | [self.mapWrapper setZoomLevel:self.mapWrapper.minZoomLevel + 4]; 92 | } 93 | 94 | - (void)onTrack:(id)sender { 95 | if (self.mapWrapper.trackedRoute == nil) { 96 | self.mapWrapper.trackedRoute = self.route; 97 | [self.btnTrack setTitle:@"Stop tracking"]; 98 | self.zoomSlider.userInteractionEnabled = NO; 99 | self.zoomSlider.alpha = 0.5f; 100 | } else { 101 | [self.mapWrapper cancelTrackingRoute]; 102 | [self.btnTrack setTitle:@"Track flight"]; 103 | self.zoomSlider.userInteractionEnabled = YES; 104 | self.zoomSlider.alpha = 1.0f; 105 | } 106 | } 107 | 108 | - (void)didReceiveMemoryWarning 109 | { 110 | [super didReceiveMemoryWarning]; 111 | // Dispose of any resources that can be recreated. 112 | } 113 | 114 | - (void)mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated { 115 | [self onZoomLevelUpdate]; 116 | 117 | AIOverlayRouteView *routeView = (AIOverlayRouteView *)[mapView viewForOverlay:self.route]; 118 | [routeView layoutWithZoomScale:self.mapWrapper.zoomScale]; 119 | } 120 | 121 | - (MKOverlayView *)mapView:(MKMapView *)mapView viewForOverlay:(id )overlay { 122 | if ([overlay isKindOfClass:[AIRoute class]]) { 123 | AIOverlayRouteView *pathView = [[AIOverlayRouteView alloc] initWithRoute:overlay vehicleImage:[UIImage imageNamed:@"plane.png"]]; 124 | pathView.delegate = self; 125 | pathView.strokeColor = [[UIColor whiteColor] colorWithAlphaComponent:0.7f]; 126 | pathView.lineCap = kCGLineCapRound; 127 | pathView.lineWidth = 6.0f; 128 | 129 | #if !(__has_feature(objc_arc)) 130 | [pathView autorelease]; 131 | #endif 132 | 133 | return pathView; 134 | } 135 | return nil; 136 | } 137 | 138 | - (IBAction)zoomSliderValueChanged:(id)sender { 139 | NSUInteger targetZoomLevel = (NSUInteger)roundf(self.zoomSlider.value); 140 | [self.zoomSlider setValue:(CGFloat)targetZoomLevel animated:NO]; 141 | [self.mapWrapper setZoomLevel:targetZoomLevel]; 142 | } 143 | 144 | - (void)onZoomLevelUpdate { 145 | [self.zoomSlider setValue:(CGFloat)self.mapWrapper.zoomLevel animated:NO]; 146 | self.zoomLevelLabel.text = [NSString stringWithFormat:@"zoom level: %d - %d", self.mapWrapper.zoomLevel, 19]; 147 | } 148 | 149 | - (void)mapViewWrapperMinimumZoomLevelChanged:(AIMapViewWrapper *)wrapper { 150 | [self onZoomLevelUpdate]; 151 | } 152 | 153 | - (void)overlayRouteViewIsReadyForAnimation:(AIOverlayRouteView *)routeView { 154 | [routeView startAnimationWithTotalTravelTime:40000 155 | remainingTravelTime:40000]; 156 | _btnTrack.enabled = YES; 157 | } 158 | 159 | - (CLLocation *)locationForLat:(CLLocationDegrees)inLat 160 | lon:(CLLocationDegrees)inLon 161 | altitude:(CLLocationDegrees)altitude { 162 | CLLocation *loc = [[CLLocation alloc] initWithLatitude:inLat 163 | longitude:inLon]; 164 | #if !(__has_feature(objc_arc)) 165 | [loc autorelease]; 166 | #endif 167 | return loc; 168 | } 169 | 170 | - (NSArray *)sampleFlightCoordinates { 171 | NSMutableArray *result = [NSMutableArray array]; 172 | 173 | //sample.kml file is from http://openflights.org 174 | //KML framework didn't quite work for me, there should be a better way to parse these coordinates 175 | 176 | KMLRoot *root = [KMLParser parseKMLAtPath:[[NSBundle mainBundle] pathForResource:@"sample" ofType:@"kml" inDirectory:nil]]; 177 | KMLPlacemark *lgwMbj = [root.placemarks objectAtIndex:21]; 178 | NSArray *rawCoords = [[lgwMbj.geometry.kml substringWithRange:NSMakeRange(88, lgwMbj.geometry.kml.length - 88 - 51)] componentsSeparatedByString:@" "]; 179 | for (NSString *rawCoord in rawCoords) { 180 | NSArray *locComps = [rawCoord componentsSeparatedByString:@","]; 181 | [result addObject:[self locationForLat:[[locComps objectAtIndex:1] doubleValue] 182 | lon:[[locComps objectAtIndex:0] doubleValue] 183 | altitude:[[locComps objectAtIndex:2] doubleValue]]]; 184 | } 185 | 186 | return result; 187 | } 188 | 189 | @end 190 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLScreenOverlay.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLScreenOverlay.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractOverlay.h" 11 | 12 | @class KMLVec2; 13 | 14 | /** This element draws an image overlay fixed to the screen. 15 | Sample uses for ScreenOverlays are compasses, logos, and heads-up displays. 16 | ScreenOverlay sizing is determined by the <size> element. 17 | Positioning of the overlay is handled by mapping a point in the image specified by <overlayXY> to a point on the screen specified by <screenXY>. 18 | Then the image is rotated by <rotation> degrees about a point relative to the screen specified by <rotationXY>. 19 | 20 | The <href> child of <Icon> specifies the image to be used as the overlay. 21 | This file can be either on a local file system or on a web server. 22 | If this element is omitted or contains no <href>, a rectangle is drawn using the color and size defined by the screen overlay. 23 | 24 | The KML Framework follows KML standard specification. 25 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 26 | */ 27 | @interface KMLScreenOverlay : KMLAbstractOverlay 28 | 29 | 30 | /// --------------------------------- 31 | /// @name Accessing Properties 32 | /// --------------------------------- 33 | 34 | /** Specifies a point on (or outside of) the overlay image that is mapped to the screen coordinate (<screenXY>). 35 | 36 | It requires x and y values, and the units for those values. 37 | 38 | The x and y values can be specified in three different ways: as pixels (*"pixels"*), as fractions of the image (*"fraction"*), or as inset pixels (*"insetPixels"*), which is an offset in pixels from the upper right corner of the image. 39 | The x and y positions can be specified in different ways—for example, x can be in pixels and y can be a fraction. 40 | The origin of the coordinate system is in the lower left corner of the image. 41 | 42 | - *x* - Either the number of pixels, a fractional component of the image, or a pixel inset indicating the x component of a point on the overlay image. 43 | - *y* - Either the number of pixels, a fractional component of the image, or a pixel inset indicating the y component of a point on the overlay image. 44 | - *xunits* - Units in which the x value is specified. A value of *"fraction"* indicates the x value is a fraction of the image. A value of *"pixels"* indicates the x value in pixels. A value of *"insetPixels"* indicates the indent from the right edge of the image. 45 | - *yunits* - Units in which the y value is specified. A value of *"fraction"* indicates the y value is a fraction of the image. A value of *"pixels"* indicates the y value in pixels. A value of *"insetPixels"* indicates the indent from the top edge of the image. 46 | 47 | See KMLVec2.*/ 48 | @property (strong, nonatomic) KMLVec2 *overlayXY; 49 | 50 | /** Specifies a point relative to the screen origin that the overlay image is mapped to. 51 | 52 | The x and y values can be specified in three different ways: as pixels (*"pixels"*), as fractions of the screen (*"fraction"*), or as inset pixels (*"insetPixels"*), which is an offset in pixels from the upper right corner of the screen. 53 | The x and y positions can be specified in different ways—for example, x can be in pixels and y can be a fraction. 54 | The origin of the coordinate system is in the lower left corner of the screen. 55 | 56 | - *x* - Either the number of pixels, a fractional component of the screen, or a pixel inset indicating the x component of a point on the screen. 57 | - *y* - Either the number of pixels, a fractional component of the screen, or a pixel inset indicating the y component of a point on the screen. 58 | - *xunits* - Units in which the x value is specified. A value of *"fraction"* indicates the x value is a fraction of the screen. A value of *"pixels"* indicates the x value in pixels. A value of *"insetPixels"* indicates the indent from the right edge of the screen. 59 | - *yunits* - Units in which the y value is specified. A value of *"fraction"* indicates the y value is a fraction of the screen. A value of *"pixels"* indicates the y value in pixels. A value of *"insetPixels"* indicates the indent from the top edge of the screen. 60 | 61 | For example, indicates a point in the middle of the screen. 62 | 63 | Here are some examples: 64 | 65 | Center the image: 66 | 67 | 68 | 69 | 70 | 71 | 72 | Place the image on the top left: 73 | 74 | 75 | 76 | 77 | 78 | 79 | Place the image at the right of the screen: 80 | 81 | 82 | 83 | 84 | 85 | 86 | See KMLVec2.*/ 87 | @property (strong, nonatomic) KMLVec2 *screenXY; 88 | 89 | /** Point relative to the screen about which the screen overlay is rotated. 90 | 91 | See KMLVec2.*/ 92 | @property (strong, nonatomic) KMLVec2 *rotationXY; 93 | 94 | /** Specifies the size of the image for the screen overlay, 95 | 96 | as follows: 97 | 98 | - A value of −1 indicates to use the native dimension 99 | - A value of 0 indicates to maintain the aspect ratio 100 | - A value of n sets the value of the dimension 101 | 102 | For example: 103 | 104 | To force the image to retain its original x and y dimensions, set the values to −1: 105 | 106 | 107 | 108 | To force the image to retain its horizontal dimension, but to take up 20 percent of the vertical screen space: 109 | 110 | 111 | 112 | To force the image to resize to 100px by 500px: 113 | 114 | 115 | 116 | See KMLVec2.*/ 117 | @property (strong, nonatomic) KMLVec2 *size; 118 | 119 | /** Indicates the angle of rotation of the parent object. A value of 0 means no rotation. 120 | 121 | The value is an angle in degrees counterclockwise starting from north. Use ±180 to indicate the rotation of the parent object from 0. 122 | The center of the <rotation>, if not (.5,.5), is specified in <rotationXY>. 123 | */ 124 | @property (nonatomic, assign) CGFloat rotation; 125 | 126 | @end 127 | -------------------------------------------------------------------------------- /AIMapViewWrapper/AIMapViewWrapper/Routing/AIOverlayRouteView.m: -------------------------------------------------------------------------------- 1 | // 2 | // AIOverlayRouteView.m 3 | // AIMapViewWrapper 4 | // 5 | // Created by CocoaToucher on 12/23/12. 6 | // Copyright (c) 2012 CocoaToucher. All rights reserved. 7 | // 8 | 9 | #import "AIOverlayRouteView.h" 10 | #import "AIRoute.h" 11 | #import "AIRoutePath.h" 12 | #import 13 | 14 | 15 | @interface AIOverlayRouteView () 16 | 17 | @property(nonatomic, strong) UIImageView *vehicleView; 18 | @property(nonatomic, strong) AIRoutePath *routePath; 19 | @property(nonatomic, readwrite) BOOL isReadyForAnimation; 20 | @property(nonatomic, readwrite) BOOL isAnimating; 21 | @property(nonatomic, readwrite) CFTimeInterval totalTravelTime; 22 | @property(nonatomic, readwrite) CFTimeInterval remainingTravelTime; 23 | @property(nonatomic) BOOL vehicleScaleInitialized; 24 | @property(nonatomic) MKZoomScale lastZoomScale; 25 | 26 | - (void)startAnimationWithTotalTravelTime:(CFTimeInterval)totalTime 27 | remainingTravelTime:(CFTimeInterval)inRemainingTime; 28 | 29 | @end 30 | 31 | @implementation AIOverlayRouteView 32 | 33 | - (id)initWithRoute:(AIRoute *)route 34 | vehicleImage:(UIImage *)inImage { 35 | self = [super initWithOverlay:route]; 36 | if (self) { 37 | _vehicleView = [[UIImageView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, inImage.size.width, inImage.size.height)]; 38 | _vehicleView.image = inImage; 39 | _vehicleView.alpha = 0.0f; 40 | [self addSubview:_vehicleView]; 41 | } 42 | return self; 43 | } 44 | 45 | - (void)createPath { 46 | AIRoute *route = (AIRoute *)self.overlay; 47 | 48 | NSMutableArray *knots = [NSMutableArray arrayWithCapacity:route.coordinates.count]; 49 | for (int i = 0; i < route.coordinates.count; i++) { 50 | CLLocation *currentLocation = [route.coordinates objectAtIndex:i]; 51 | [knots addObject:[NSValue valueWithCGPoint:[self pointForMapPoint:MKMapPointForCoordinate(currentLocation.coordinate)]]]; 52 | } 53 | 54 | AIRoutePath *tPath = [[AIRoutePath alloc] initWithKnots:knots]; 55 | self.routePath = tPath; 56 | #if !(__has_feature(objc_arc)) 57 | [tPath release]; 58 | #endif 59 | 60 | self.path = self.routePath.path; 61 | 62 | BOOL oldValue = _isReadyForAnimation; 63 | self.isReadyForAnimation = YES; 64 | if (oldValue != _isReadyForAnimation) { 65 | [self.delegate overlayRouteViewIsReadyForAnimation:self]; 66 | 67 | CLLocation *startLocation = [route.coordinates objectAtIndex:0]; 68 | 69 | _vehicleView.layer.position = [self pointForMapPoint:MKMapPointForCoordinate(startLocation.coordinate)]; 70 | } 71 | } 72 | 73 | - (BOOL)canDrawMapRect:(MKMapRect)mapRect 74 | zoomScale:(MKZoomScale)zoomScale { 75 | return YES; 76 | } 77 | 78 | - (void)drawMapRect:(MKMapRect)mapRect zoomScale:(MKZoomScale)zoomScale inContext:(CGContextRef)context { 79 | 80 | CGContextBeginPath(context); 81 | 82 | CGContextAddPath(context, self.routePath.shadowPath); 83 | CGContextSetStrokeColorWithColor(context, [[[UIColor blackColor] colorWithAlphaComponent:0.2f] CGColor]); 84 | CGContextSetLineWidth(context, self.lineWidth / zoomScale); 85 | CGContextSetLineCap(context, self.lineCap); 86 | CGContextStrokePath(context); 87 | 88 | [super drawMapRect:mapRect zoomScale:zoomScale inContext:context]; 89 | } 90 | 91 | - (void)layoutWithZoomScale:(MKZoomScale)zoomScale { 92 | if (zoomScale == self.lastZoomScale) { 93 | self.lastZoomScale = zoomScale; 94 | return; 95 | } 96 | 97 | if (!self.vehicleScaleInitialized) { 98 | self.vehicleView.layer.transform = CATransform3DMakeScale(1.0f / zoomScale, 1.0f / zoomScale, 1.0f); 99 | self.vehicleScaleInitialized = YES; 100 | self.vehicleView.alpha = 1.0f; 101 | return; 102 | } 103 | 104 | CALayer *presentationLayer = (CALayer *)self.vehicleView.layer.presentationLayer; 105 | CATransform3D t = presentationLayer.transform; 106 | 107 | CABasicAnimation *scaleXAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale.x"]; 108 | scaleXAnimation.fromValue = [NSNumber numberWithFloat:sqrtf((t.m11 * t.m11) + (t.m12 * t.m12) + (t.m13 * t.m13))]; 109 | scaleXAnimation.toValue = [NSNumber numberWithFloat:1.0 / zoomScale]; 110 | 111 | CABasicAnimation *scaleYAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale.y"]; 112 | scaleYAnimation.fromValue = [NSNumber numberWithFloat:sqrtf((t.m21 * t.m21) + (t.m22 * t.m22) + (t.m23 * t.m23))]; 113 | scaleYAnimation.toValue = [NSNumber numberWithFloat:1.0 / zoomScale]; 114 | 115 | CAAnimationGroup *animationGroup = [CAAnimationGroup animation]; 116 | animationGroup.duration = 0.1; 117 | animationGroup.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]; 118 | animationGroup.animations = [NSArray arrayWithObjects:scaleXAnimation, scaleYAnimation, nil]; 119 | animationGroup.removedOnCompletion = NO; 120 | animationGroup.fillMode = kCAFillModeForwards; 121 | 122 | [self.vehicleView.layer addAnimation:animationGroup forKey:@"scale"]; 123 | } 124 | 125 | - (double)velocity { 126 | return self.routePath.totalDistance / self.totalTravelTime; 127 | } 128 | 129 | - (void)dealloc { 130 | #if !(__has_feature(objc_arc)) 131 | [_vehicleView release]; 132 | _vehicleView = nil; 133 | [_routePath release]; 134 | _routePath = nil; 135 | 136 | [super dealloc]; 137 | #endif 138 | } 139 | 140 | - (CAKeyframeAnimation *)pathAnimationForPath:(CGPathRef)animationPath 141 | duration:(CFTimeInterval)inDuration 142 | { 143 | CAKeyframeAnimation *pathAnimation; 144 | pathAnimation = [CAKeyframeAnimation animationWithKeyPath:@"position"]; 145 | pathAnimation.removedOnCompletion = NO; 146 | pathAnimation.fillMode = kCAFillModeForwards; 147 | pathAnimation.calculationMode = kCAAnimationPaced; 148 | pathAnimation.path = animationPath; 149 | pathAnimation.rotationMode = kCAAnimationRotateAuto; 150 | pathAnimation.delegate = self; 151 | 152 | pathAnimation.duration = inDuration; 153 | 154 | return pathAnimation; 155 | } 156 | 157 | - (void)animationDidStop:(CAAnimation *)theAnimation finished:(BOOL)flag { 158 | 159 | @synchronized ([self class]) { 160 | CAAnimation *pathAnimation = [self.vehicleView.layer animationForKey:@"pathAnimation"]; 161 | 162 | if (flag == YES && 163 | [pathAnimation isEqual:theAnimation]) { 164 | self.isAnimating = NO; 165 | } 166 | } 167 | } 168 | 169 | - (void)startAnimationWithTotalTravelTime:(CFTimeInterval)totalTime 170 | remainingTravelTime:(CFTimeInterval)remainingTime { 171 | @synchronized ([self class]) { 172 | if (self.isReadyForAnimation == NO) { 173 | return; 174 | } 175 | 176 | if (self.isAnimating == YES) { 177 | return; 178 | } 179 | 180 | CGFloat remainingDistance = (self.routePath.totalDistance * remainingTime) / totalTime; 181 | 182 | if (remainingDistance <= 0.0f) 183 | return; 184 | 185 | CGPathRef subPath = [self.routePath newTailWithDistance:remainingDistance]; 186 | 187 | self.isAnimating = YES; 188 | 189 | [self.vehicleView.layer addAnimation:[self pathAnimationForPath:subPath 190 | duration:remainingTime] 191 | forKey:@"pathAnimation"]; 192 | CGPathRelease(subPath); 193 | } 194 | } 195 | 196 | - (void)stopAnimation { 197 | @synchronized ([self class]) { 198 | [self.vehicleView.layer removeAnimationForKey:@"pathAnimation"]; 199 | self.isAnimating = NO; 200 | } 201 | } 202 | 203 | - (CLLocationCoordinate2D)currentVehicleCoordinate { 204 | @synchronized ([self class]) { 205 | 206 | CALayer *presentationLayer = (CALayer *)self.vehicleView.layer.presentationLayer; 207 | CGPoint currentPoint = presentationLayer.position; 208 | 209 | return MKCoordinateForMapPoint([self mapPointForPoint:currentPoint]); 210 | } 211 | } 212 | 213 | @end 214 | -------------------------------------------------------------------------------- /AIMapViewWrapper/KML.framework/Versions/A/Headers/KMLLink.h: -------------------------------------------------------------------------------- 1 | // 2 | // KMLLink.h 3 | // KML Framework 4 | // 5 | // Created by NextBusinessSystem on 12/04/06. 6 | // Copyright (c) 2012 NextBusinessSystem Co., Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "KMLAbstractObject.h" 11 | 12 | /** <Link> specifies the location of any of the following: 13 | 14 | - KML files fetched by network links 15 | - Image files used in any Overlay (the <Icon> element specifies the image in an Overlay; <Icon> has the same fields as <Link>) 16 | - Model files used in the <Model> element 17 | 18 | The file is conditionally loaded and refreshed, depending on the refresh parameters supplied here. 19 | Two different sets of refresh parameters can be specified: one set is based on time (<refreshMode> and <refreshInterval>) and one is based on the current "camera" view (<viewRefreshMode> and <viewRefreshTime>). 20 | In addition, Link specifies whether to scale the bounding box parameters that are sent to the server (<viewBoundScale> and provides a set of optional viewing parameters that can be sent to the server (<viewFormat>) as well as a set of optional parameters containing version and language information. 21 | 22 | When a file is fetched, the URL that is sent to the server is composed of three pieces of information: 23 | 24 | - the href (Hypertext Reference) that specifies the file to load. 25 | - an arbitrary format string that is created from (a) parameters that you specify in the <viewFormat> element or (b) bounding box parameters (this is the default and is used if no <viewFormat> element is included in the file). 26 | - a second format string that is specified in the <httpQuery> element. 27 | 28 | If the file specified in <href> is a local file, the <viewFormat> and <httpQuery> elements are not used. 29 | 30 | The <Link> element replaces the <Url> element of <NetworkLink> contained in earlier KML releases and adds functionality for the KMLRegion element (introduced in KML 2.1). 31 | In Google Earth releases 3.0 and earlier, the <Link> element is ignored. 32 | 33 | The KML Framework follows KML standard specification. 34 | You can see the Google's KML reference at http://code.google.com/apis/kml/documentation/kmlreference.html 35 | */ 36 | @interface KMLLink : KMLAbstractObject 37 | 38 | 39 | /// --------------------------------- 40 | /// @name Accessing Properties 41 | /// --------------------------------- 42 | 43 | /** A URL (either an HTTP address or a local file specification). 44 | 45 | When the parent of <Link> is a NetworkLink, <href> is a KML file. 46 | When the parent of <Link> is a Model, <href> is a COLLADA file. 47 | When the parent of KMLIcon (same fields as <Link>) is an Overlay, <href> is an image. 48 | Relative URLs can be used in this tag and are evaluated relative to the enclosing KML file. 49 | See KMZ Files for details on constructing relative references in KML and KMZ files. */ 50 | @property (strong, nonatomic) NSString *href; 51 | 52 | /** Specifies a time-based refresh mode, 53 | 54 | which can be one of the following: 55 | 56 | - *onChange* - refresh when the file is loaded and whenever the Link parameters change (the default). 57 | - *onInterval* - refresh every n seconds (specified in <refreshInterval>). 58 | - *onExpire* - refresh the file when the expiration time is reached. If a fetched file has a NetworkLinkControl, the <expires> time takes precedence over expiration times specified in HTTP headers. If no <expires> time is specified, the HTTP max-age header is used (if present). If max-age is not present, the Expires HTTP header is used (if present). (See Section RFC261b of the Hypertext Transfer Protocol - HTTP 1.1 for details on HTTP header fields.) 59 | */ 60 | @property (nonatomic, assign) KMLRefreshMode refreshMode; 61 | 62 | /** Indicates to refresh the file every n seconds. */ 63 | @property (nonatomic, assign) CGFloat refreshInterval; 64 | 65 | /** Specifies how the link is refreshed when the "camera" changes. 66 | 67 | Can be one of the following: 68 | 69 | - *never* (default) - Ignore changes in the view. Also ignore <viewFormat> parameters, if any. 70 | - *onStop* - Refresh the file n seconds after movement stops, where n is specified in <viewRefreshTime>. 71 | - *onRequest* - Refresh the file only when the user explicitly requests it. (For example, in Google Earth, the user right-clicks and selects Refresh in the Context menu.) 72 | - *onRegion* - Refresh the file when the Region becomes active. See KMLRegion. 73 | */ 74 | @property (nonatomic, assign) KMLViewRefreshMode viewRefreshMode; 75 | 76 | /** After camera movement stops, specifies the number of seconds to wait before refreshing the view. 77 | 78 | (See <viewRefreshMode> and *onStop* above.) */ 79 | @property (nonatomic, assign) CGFloat viewRefreshTime; 80 | 81 | /** Scales the BBOX parameters before sending them to the server. 82 | 83 | A value less than 1 specifies to use less than the full view (screen). 84 | A value greater than 1 specifies to fetch an area that extends beyond the edges of the current view. */ 85 | @property (nonatomic, assign) CGFloat viewBoundScale; 86 | 87 | /** Specifies the format of the query string that is appended to the Link's <href> before the file is fetched. 88 | 89 | (If the <href> specifies a local file, this element is ignored.) 90 | 91 | If you specify a <viewRefreshMode> of onStop and do not include the <viewFormat> tag in the file, the following information is automatically appended to the query string: 92 | 93 | - *BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]* 94 | 95 | This information matches the Web Map Service (WMS) bounding box specification. 96 | 97 | If you specify an empty <viewFormat> tag, no information is appended to the query string. 98 | 99 | You can also specify a custom set of viewing parameters to add to the query string. If you supply a format string, it is used *instead of* the BBOX information. 100 | If you also want the BBOX information, you need to add those parameters along with the custom parameters. 101 | 102 | You can use any of the following parameters in your format string (and Google Earth will substitute the appropriate current value at the time it creates the query string): 103 | 104 | - *[lookatLon], [lookatLat]* - longitude and latitude of the point that <LookAt> is viewing 105 | - *[lookatRange], [lookatTilt], [lookatHeading]* - values used by the <LookAt> element (see descriptions of <range>, <tilt>, and <heading> in KMLLookAt) 106 | - *[lookatTerrainLon], [lookatTerrainLat], [lookatTerrainAlt]* - point on the terrain in degrees/meters that <LookAt> is viewing 107 | - *[cameraLon], [cameraLat], [cameraAlt]* - degrees/meters of the eyepoint for the camera 108 | - *[horizFov], [vertFov]* - horizontal, vertical field of view for the camera 109 | - *[horizPixels], [vertPixels]* - size in pixels of the 3D viewer 110 | - *[terrainEnabled]* - indicates whether the 3D viewer is showing terrain 111 | */ 112 | @property (strong, nonatomic) NSString *viewFormat; 113 | 114 | /** Appends information to the query string, based on the parameters specified. 115 | 116 | (Google Earth substitutes the appropriate current value at the time it creates the query string.) 117 | The following parameters are supported: 118 | 119 | - *[clientVersion]* 120 | - *[kmlVersion]* 121 | - *[clientName]* 122 | - *[language]* 123 | */ 124 | @property (strong, nonatomic) NSString *httpQuery; 125 | 126 | @end 127 | -------------------------------------------------------------------------------- /AIMapViewWrapper/AIMapViewWrapper/AIMapViewWrapper.m: -------------------------------------------------------------------------------- 1 | // 2 | // AIMapViewWrapper.m 3 | // AIMapViewWrapper 4 | // 5 | // Created by CocoaToucher on 12/19/12. 6 | // Copyright (c) 2012 CocoaToucher. All rights reserved. 7 | // 8 | 9 | #import "AIMapViewWrapper.h" 10 | #import 11 | #import "AIOverlayRouteView.h" 12 | #import "AIRoute.h" 13 | 14 | NSString *AIStringFromMKMapRect(MKMapRect rect) { 15 | return [NSString stringWithFormat:@"{{%f, %f}, {%f, %f}}", rect.origin.x, rect.origin.y, rect.size.width, rect.size.height]; 16 | }; 17 | 18 | NSString *AIStringFromCLLocationCoordinate2D(CLLocationCoordinate2D coordinate) { 19 | return [NSString stringWithFormat:@"{%f, %f}", coordinate.latitude, coordinate.longitude]; 20 | } 21 | 22 | @interface AIMapViewWrapper () 23 | 24 | @property(nonatomic) MKMapRect maxWorldRect; 25 | @property(nonatomic) NSUInteger minZoomLevel; 26 | @property(nonatomic, assign) NSTimer *routeTrackTimer; 27 | @property(nonatomic) CGRect mapFrame; 28 | 29 | - (void)updateMaxWorldRect; 30 | 31 | @end 32 | 33 | @implementation AIMapViewWrapper 34 | 35 | - (id)initWithMapView:(MKMapView *)mapView { 36 | self = [super init]; 37 | if (self) { 38 | #if !(__has_feature(objc_arc)) 39 | _mapView = [mapView retain]; 40 | #else 41 | _mapView = mapView; 42 | #endif 43 | 44 | [_mapView addObserver:self 45 | forKeyPath:@"frame" 46 | options:NSKeyValueObservingOptionNew 47 | context:nil]; 48 | 49 | _mapFrame = _mapView.frame; 50 | [self updateMaxWorldRect]; 51 | } 52 | return self; 53 | } 54 | 55 | - (void)dealloc { 56 | [_mapView removeObserver:self 57 | forKeyPath:@"frame"]; 58 | #if !(__has_feature(objc_arc)) 59 | [_mapView release]; 60 | _mapView = nil; 61 | [_trackedRoute release]; 62 | _trackedRoute = nil; 63 | 64 | [super dealloc]; 65 | #endif 66 | } 67 | 68 | - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { 69 | 70 | if (!CGSizeEqualToSize(self.mapView.frame.size, self.mapFrame.size)) { 71 | self.mapFrame = self.mapView.frame; 72 | [self updateMaxWorldRect]; 73 | } 74 | } 75 | 76 | - (void)updateMaxWorldRect { 77 | double minZoomLevel = 1; 78 | while ((256 * pow(2, minZoomLevel)) < self.mapView.bounds.size.width * 2.0) { 79 | minZoomLevel += 1; 80 | } 81 | 82 | MKMapRect maxWorldRect = MKMapRectNull; 83 | maxWorldRect.origin.x = 0.0; 84 | maxWorldRect.origin.y = 0.0; 85 | maxWorldRect.size.width = (self.mapView.bounds.size.width * MKMapSizeWorld.width / (256.0 * pow(2, minZoomLevel))); 86 | maxWorldRect.size.height = maxWorldRect.size.width * (self.mapView.bounds.size.height / self.mapView.bounds.size.width); 87 | self.maxWorldRect = maxWorldRect; 88 | 89 | if (minZoomLevel != self.minZoomLevel) { 90 | self.minZoomLevel = minZoomLevel; 91 | [self.delegate mapViewWrapperMinimumZoomLevelChanged:self]; 92 | } else { 93 | self.minZoomLevel = minZoomLevel; 94 | } 95 | } 96 | 97 | - (MKMapRect)mapRectForCoordinateRegion:(MKCoordinateRegion)region { 98 | MKMapRect result = MKMapRectNull; 99 | 100 | CLLocationCoordinate2D topLeftCoord = CLLocationCoordinate2DMake(-1.0 * (region.center.latitude - region.span.latitudeDelta / 2.0), region.center.longitude - region.span.longitudeDelta / 2.0); 101 | CLLocationCoordinate2D bottomRightCoord = CLLocationCoordinate2DMake(-1.0 * (region.center.latitude + region.span.latitudeDelta / 2.0), region.center.longitude + region.span.longitudeDelta / 2.0); 102 | MKMapPoint topLeftPoint = MKMapPointForCoordinate(topLeftCoord); 103 | MKMapPoint bottomRightPoint = MKMapPointForCoordinate(bottomRightCoord); 104 | 105 | result.origin.x = topLeftPoint.x; 106 | result.origin.y = topLeftPoint.y; 107 | result.size.width = bottomRightPoint.x - topLeftPoint.x; 108 | result.size.height = bottomRightPoint.y - topLeftPoint.y; 109 | 110 | return result; 111 | } 112 | 113 | - (MKMapRect)mapRectWithZoomLevel:(NSUInteger)zoomLevel 114 | centerCoordinate:(CLLocationCoordinate2D)inCenter { 115 | double zoomScale = 1 / pow(2, zoomLevel); 116 | 117 | double scaledWidth = self.maxWorldRect.size.width * zoomScale; 118 | double scaledHeight = self.maxWorldRect.size.height * zoomScale; 119 | 120 | //arrange center 121 | MKMapPoint centerPoint = MKMapPointForCoordinate(inCenter); 122 | 123 | double scaledOriginX = centerPoint.x - (scaledWidth / 2.0); 124 | double scaledOriginY = centerPoint.y - (scaledHeight / 2.0); 125 | 126 | return MKMapRectMake(scaledOriginX, scaledOriginY, scaledWidth, scaledHeight); 127 | } 128 | 129 | #pragma mark - 130 | #pragma mark Public methods 131 | 132 | - (NSUInteger)zoomLevel { 133 | MKMapRect visibleRect = self.mapView.visibleMapRect; 134 | 135 | double zoomScale = visibleRect.size.width / self.maxWorldRect.size.width; 136 | zoomScale = MIN(zoomScale, 1.0); 137 | 138 | NSUInteger result = round(log10(1 / zoomScale) / log10(2)); 139 | 140 | return result + self.minZoomLevel; 141 | } 142 | 143 | - (void)setZoomLevel:(NSUInteger)zoomLevel { 144 | [self setZoomLevel:zoomLevel 145 | animated:NO]; 146 | } 147 | 148 | - (void)setZoomLevel:(NSUInteger)zoomLevel 149 | animated:(BOOL)animated 150 | { 151 | [self setZoomLevel:zoomLevel 152 | withCenterCoordinate:self.mapView.centerCoordinate 153 | animated:animated]; 154 | } 155 | 156 | - (void)setZoomLevel:(NSUInteger)zoomLevel 157 | withCenterCoordinate:(CLLocationCoordinate2D)inCenter 158 | animated:(BOOL)animated { 159 | NSInteger converted = zoomLevel - self.minZoomLevel; 160 | zoomLevel = MAX(converted, 0); 161 | zoomLevel = MIN(zoomLevel, 19 - self.minZoomLevel); 162 | 163 | MKMapRect newRect = [self mapRectWithZoomLevel:zoomLevel 164 | centerCoordinate:inCenter]; 165 | 166 | [self.mapView setVisibleMapRect:newRect animated:animated]; 167 | } 168 | 169 | - (MKZoomScale)zoomScale { 170 | @synchronized ([self class]) { 171 | CGFloat minZoomLevel = log10f((self.mapView.bounds.size.width * 2.0) / 256) / log10f(2); 172 | 173 | MKMapRect visibleRect = self.mapView.visibleMapRect; 174 | 175 | CGFloat zoomScale = visibleRect.size.width / (MKMapSizeWorld.width / 2.0f); 176 | 177 | CGFloat result = log10f(1 / zoomScale) / log10f(2); 178 | 179 | return 1.0f / (powf(2.0f, 20.0f - (result + minZoomLevel))); 180 | } 181 | } 182 | 183 | - (MKMapRect)mapRectThatFitsAnnotations:(NSArray *)annotations { 184 | MKMapRect fitRect = MKMapRectNull; 185 | 186 | for (id annotation in annotations) { 187 | 188 | UIView *annotationView = [self.mapView viewForAnnotation:annotation]; 189 | 190 | MKCoordinateRegion viewRegion = [self.mapView convertRect:annotationView.frame toRegionFromView:self.mapView]; 191 | 192 | MKMapRect annotationRect = [self mapRectForCoordinateRegion:viewRegion]; 193 | 194 | if (MKMapRectIsNull(fitRect)) { 195 | fitRect = annotationRect; 196 | } else { 197 | fitRect = MKMapRectUnion(fitRect, annotationRect); 198 | } 199 | } 200 | 201 | return [self.mapView mapRectThatFits:fitRect]; 202 | } 203 | 204 | - (void)zoomToFitMapAnnotations:(NSArray *)annotations 205 | animated:(BOOL)animated { 206 | 207 | if (annotations.count == 0) 208 | return; 209 | 210 | if (annotations.count == 1) { 211 | id annotation = [annotations objectAtIndex:0]; 212 | 213 | [self setZoomLevel:14 214 | withCenterCoordinate:annotation.coordinate 215 | animated:YES]; 216 | 217 | return; 218 | } 219 | 220 | MKMapRect zoomRect = MKMapRectNull; 221 | for (id annotation in annotations) { 222 | 223 | UIView *annotationView = [self.mapView viewForAnnotation:annotation]; 224 | 225 | //convert annotation coordinates to pixel point in map 226 | MKMapPoint annotationPoint = MKMapPointForCoordinate(annotation.coordinate); 227 | 228 | MKMapRect pointRect = MKMapRectMake(annotationPoint.x - floorf(annotationView.bounds.size.width / 2.0f), annotationPoint.y - (annotationView.bounds.size.height), annotationView.bounds.size.width, annotationView.bounds.size.height); 229 | if (MKMapRectIsNull(zoomRect)) { 230 | zoomRect = pointRect; 231 | } else { 232 | zoomRect = MKMapRectUnion(zoomRect, pointRect); 233 | } 234 | } 235 | 236 | [self.mapView setVisibleMapRect:zoomRect 237 | animated:YES]; 238 | } 239 | 240 | 241 | - (void)launchDirectionsFromCoordinate:(CLLocationCoordinate2D)fromCoor 242 | toCoordinate:(CLLocationCoordinate2D)toCoor { 243 | NSString *mapsDomain = @"maps.apple.com"; 244 | if ([[[UIDevice currentDevice] systemVersion] doubleValue] < 6.0) { 245 | mapsDomain = @"maps.google.com"; 246 | } 247 | 248 | NSString *urlStr = [[NSString stringWithFormat:@"http://%@/maps?saddr=%f,%f&daddr=%f,%f", 249 | mapsDomain, 250 | fromCoor.latitude, 251 | fromCoor.longitude, 252 | toCoor.latitude, 253 | toCoor.longitude] 254 | stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; 255 | 256 | NSURL *mapsURL = [NSURL URLWithString:urlStr]; 257 | 258 | [[UIApplication sharedApplication] openURL:mapsURL]; 259 | } 260 | 261 | #pragma mark - 262 | #pragma mark Route tracking 263 | - (void)cancelTrackingRoute { 264 | self.trackedRoute = nil; 265 | } 266 | 267 | - (void)setTrackedRoute:(AIRoute *)trackedRoute { 268 | if (trackedRoute != _trackedRoute) { 269 | #if !(__has_feature(objc_arc)) 270 | [_trackedRoute release]; 271 | _trackedRoute = [trackedRoute retain]; 272 | #else 273 | _trackedRoute = trackedRoute; 274 | #endif 275 | } 276 | 277 | [_routeTrackTimer invalidate]; 278 | _routeTrackTimer = nil; 279 | self.mapView.userInteractionEnabled = YES; 280 | 281 | if (_trackedRoute) { 282 | self.mapView.userInteractionEnabled = NO; 283 | 284 | AIOverlayRouteView *routeView = (AIOverlayRouteView *)[self.mapView viewForOverlay:(id)_trackedRoute]; 285 | 286 | [self setZoomLevel:13.0 287 | withCenterCoordinate:[routeView currentVehicleCoordinate] 288 | animated:NO]; 289 | 290 | self.routeTrackTimer = [NSTimer timerWithTimeInterval:0.2 291 | target:self 292 | selector:@selector(onTrackRoute:) 293 | userInfo:nil 294 | repeats:YES]; 295 | [[NSRunLoop currentRunLoop] addTimer:self.routeTrackTimer forMode:NSRunLoopCommonModes]; 296 | [self onTrackRoute:self.routeTrackTimer]; 297 | } 298 | } 299 | 300 | - (void)onTrackRoute:(NSTimer *)inTimer { 301 | AIOverlayRouteView *routeView = (AIOverlayRouteView *)[self.mapView viewForOverlay:(id)self.trackedRoute]; 302 | CLLocationCoordinate2D currentCoordinate = [routeView currentVehicleCoordinate]; 303 | 304 | [self.mapView setCenterCoordinate:currentCoordinate animated:YES]; 305 | 306 | if (routeView.isAnimating == NO) { 307 | [_routeTrackTimer invalidate]; 308 | _routeTrackTimer = nil; 309 | self.mapView.userInteractionEnabled = YES; 310 | } 311 | } 312 | 313 | @end 314 | -------------------------------------------------------------------------------- /AIMapViewWrapper/AIMapViewWrapper/Routing/AIRoutePath.m: -------------------------------------------------------------------------------- 1 | // 2 | // AIRoutePath.m 3 | // AIMapViewWrapper 4 | // 5 | // Created by CocoaToucher on 12/24/12. 6 | // Copyright (c) 2012 CocoaToucher. All rights reserved. 7 | // 8 | 9 | #import "AIRoutePath.h" 10 | 11 | double distanceBetweenPoints(CGPoint point1, CGPoint point2) { 12 | return sqrt(pow(point1.x - point2.x, 2) + pow(point1.y - point2.y, 2)); 13 | }; 14 | 15 | CGFloat angleBetweenPoints(CGPoint point1, CGPoint point2) { 16 | return atan2f(point2.y - point1.y, point2.x - point1.x); 17 | }; 18 | 19 | static CGPathRef createShadowPathWithPath(CGPathRef path, CGFloat radians) { 20 | CGPoint originalEndPoint = CGPathGetCurrentPoint(path); 21 | 22 | CGRect bounds = CGPathGetBoundingBox(path); 23 | CGPoint center = CGPointMake(CGRectGetMidX(bounds), CGRectGetMidY(bounds)); 24 | CGAffineTransform transform = CGAffineTransformIdentity; 25 | transform = CGAffineTransformTranslate(transform, center.x, center.y); 26 | transform = CGAffineTransformRotate(transform, radians); 27 | transform = CGAffineTransformTranslate(transform, -center.x, -center.y); 28 | 29 | CGPathRef rotatedPath = CGPathCreateCopyByTransformingPath(path, &transform); 30 | 31 | transform = CGAffineTransformMakeScale(1.0, 0.8); 32 | 33 | CGPathRef scaledPath = CGPathCreateCopyByTransformingPath(rotatedPath, &transform); 34 | CGPathRelease(rotatedPath); 35 | 36 | transform = CGAffineTransformIdentity; 37 | transform = CGAffineTransformTranslate(transform, center.x, center.y); 38 | transform = CGAffineTransformRotate(transform, -radians); 39 | transform = CGAffineTransformTranslate(transform, -center.x, -center.y); 40 | 41 | CGPathRef normalizedPath = CGPathCreateCopyByTransformingPath(scaledPath, &transform); 42 | CGPathRelease(scaledPath); 43 | 44 | CGPoint currentEndPoint = CGPathGetCurrentPoint(normalizedPath); 45 | 46 | transform = CGAffineTransformIdentity; 47 | transform = CGAffineTransformTranslate(transform, originalEndPoint.x - currentEndPoint.x, originalEndPoint.y - currentEndPoint.y); 48 | 49 | CGPathRef result = CGPathCreateCopyByTransformingPath(normalizedPath, &transform); 50 | CGPathRelease(normalizedPath); 51 | 52 | return result; 53 | } 54 | 55 | @interface AIRoutePath () 56 | 57 | @property(nonatomic, strong, readwrite) NSArray *knots; 58 | @property(nonatomic, strong, readwrite) NSArray *firstCPs; 59 | @property(nonatomic, strong, readwrite) NSArray *secondCPs; 60 | @property(nonatomic, readwrite) CGPathRef path; 61 | @property(nonatomic, readwrite) CGPathRef shadowPath; 62 | @property(nonatomic, readwrite) CGFloat totalDistance; 63 | 64 | @end 65 | 66 | @implementation AIRoutePath 67 | 68 | - (void)dealloc { 69 | #if !(__has_feature(objc_arc)) 70 | CGPathRelease(_path); 71 | _path = nil; 72 | CGPathRelease(_shadowPath); 73 | _shadowPath = nil; 74 | [_knots release]; 75 | _knots = nil; 76 | [_firstCPs release]; 77 | _firstCPs = nil; 78 | [_secondCPs release]; 79 | _secondCPs = nil; 80 | [super dealloc]; 81 | #endif 82 | } 83 | 84 | - (id)initWithKnots:(NSArray *)inKnots { 85 | self = [super init]; 86 | if (self) { 87 | #if !(__has_feature(objc_arc)) 88 | _knots = [inKnots retain]; 89 | #else 90 | _knots = inKnots; 91 | #endif 92 | 93 | if (_knots.count > 1) { 94 | 95 | NSArray *controlPoints = [AIRoutePath curveControlPointsForKnots:_knots]; 96 | #if !(__has_feature(objc_arc)) 97 | _firstCPs = [[controlPoints objectAtIndex:0] retain]; 98 | _secondCPs = [[controlPoints objectAtIndex:1] retain]; 99 | #else 100 | _firstCPs = [controlPoints objectAtIndex:0]; 101 | _secondCPs = [controlPoints objectAtIndex:1]; 102 | #endif 103 | 104 | CGMutablePathRef path = CGPathCreateMutable(); 105 | CGPoint startPoint = [[_knots objectAtIndex:0] CGPointValue]; 106 | CGPathMoveToPoint(path, nil, startPoint.x, startPoint.y); 107 | 108 | CGFloat totalDistance = 0.0f; 109 | 110 | CGPoint lastEndPoint = startPoint; 111 | for (int i = 0; i < [_firstCPs count]; i++) { 112 | CGPoint nextPoint = [[_knots objectAtIndex:i + 1] CGPointValue]; 113 | 114 | CGPoint firstCP = [[_firstCPs objectAtIndex:i] CGPointValue]; 115 | CGPoint secondCP = [[_secondCPs objectAtIndex:i] CGPointValue]; 116 | 117 | CGFloat distance1 = distanceBetweenPoints(lastEndPoint, firstCP); 118 | CGFloat distance2 = distanceBetweenPoints(firstCP, secondCP); 119 | CGFloat distance3 = distanceBetweenPoints(secondCP, nextPoint); 120 | 121 | CGFloat circleDistance = distance1 + distance2 + distance3; 122 | totalDistance += circleDistance; 123 | 124 | if (distance1 / circleDistance < 0.2 || 125 | distance2 / circleDistance < 0.2 || 126 | distance3 / circleDistance < 0.2) { 127 | 128 | CGPathAddLineToPoint(path, nil, nextPoint.x, nextPoint.y); 129 | 130 | lastEndPoint = nextPoint; 131 | 132 | continue; 133 | } 134 | 135 | CGPathAddCurveToPoint(path, nil, firstCP.x, firstCP.y, secondCP.x, secondCP.y, nextPoint.x, nextPoint.y); 136 | 137 | lastEndPoint = nextPoint; 138 | } 139 | 140 | _totalDistance = totalDistance; 141 | 142 | _path = path; 143 | 144 | _shadowPath = createShadowPathWithPath(path, -angleBetweenPoints(lastEndPoint, startPoint)); 145 | } 146 | } 147 | return self; 148 | } 149 | 150 | - (CGPathRef)newTailWithDistance:(CGFloat)inDistance { 151 | CGMutablePathRef path = CGPathCreateMutable(); 152 | 153 | CGFloat consumedDistance = self.totalDistance - inDistance; 154 | 155 | CGFloat currentDistance = 0.0f; 156 | 157 | BOOL pathStarted = NO; 158 | 159 | CGPoint startPoint = [[self.knots objectAtIndex:0] CGPointValue]; 160 | CGPoint lastEndPoint = startPoint; 161 | 162 | for (int i = 0; i < [self.firstCPs count]; i++) { 163 | CGPoint firstCP = [[self.firstCPs objectAtIndex:i] CGPointValue]; 164 | CGPoint secondCP = [[self.secondCPs objectAtIndex:i] CGPointValue]; 165 | 166 | CGPoint nextPoint = [[self.knots objectAtIndex:i + 1] CGPointValue]; 167 | 168 | if (!pathStarted && currentDistance >= consumedDistance) { 169 | pathStarted = YES; 170 | CGPathMoveToPoint(path, nil, lastEndPoint.x, lastEndPoint.y); 171 | } 172 | 173 | CGFloat distance1 = distanceBetweenPoints(lastEndPoint, firstCP); 174 | CGFloat distance2 = distanceBetweenPoints(firstCP, secondCP); 175 | CGFloat distance3 = distanceBetweenPoints(secondCP, nextPoint); 176 | CGFloat circleDistance = distance1 + distance2 + distance3; 177 | 178 | if (pathStarted) { 179 | 180 | if (distance1 / circleDistance < 0.2 || 181 | distance2 / circleDistance < 0.2 || 182 | distance3 / circleDistance < 0.2) { 183 | 184 | CGPathAddLineToPoint(path, nil, nextPoint.x, nextPoint.y); 185 | } else { 186 | CGPathAddCurveToPoint(path, nil, firstCP.x, firstCP.y, secondCP.x, secondCP.y, nextPoint.x, nextPoint.y); 187 | } 188 | } 189 | 190 | currentDistance += circleDistance; 191 | 192 | lastEndPoint = nextPoint; 193 | } 194 | 195 | return path; 196 | } 197 | 198 | //Original implementation of this method is from: 199 | //http://www.codeproject.com/Articles/31859/Draw-a-Smooth-Curve-through-a-Set-of-2D-Points-wit 200 | + (NSArray *)curveControlPointsForKnots:(NSArray *)knots { 201 | NSMutableArray *firstControlPoints = [NSMutableArray array]; 202 | NSMutableArray *secondControlPoints = [NSMutableArray array]; 203 | NSArray *result = [NSArray arrayWithObjects:firstControlPoints, secondControlPoints, nil]; 204 | 205 | int n = knots.count - 1; 206 | if (n < 1) 207 | return nil; 208 | 209 | if (n == 1) 210 | { // Special case: Bezier curve should be a straight line. 211 | 212 | // 3P1 = 2P0 + P3 213 | CGPoint firstPoint = [[knots objectAtIndex:0] CGPointValue]; 214 | CGPoint secondPoint = [[knots objectAtIndex:1] CGPointValue]; 215 | 216 | CGFloat firstX = (2 * firstPoint.x + secondPoint.x) / 3; 217 | CGFloat firstY = (2 * firstPoint.y + secondPoint.y) / 3; 218 | 219 | CGPoint firstControlPoint = CGPointMake(firstX, firstY); 220 | [firstControlPoints addObject:[NSValue valueWithCGPoint:firstControlPoint]]; 221 | 222 | // P2 = 2P1 – P0 223 | CGFloat secondX = 2 * firstControlPoint.x - firstPoint.x; 224 | CGFloat secondY = 2 * firstControlPoint.y - firstPoint.y; 225 | CGPoint secondControlPoint = CGPointMake(secondX, secondY); 226 | [secondControlPoints addObject:[NSValue valueWithCGPoint:secondControlPoint]]; 227 | 228 | return result; 229 | } 230 | 231 | // Calculate first Bezier control points 232 | // Right hand side vector 233 | double *rhs = (double *)malloc(n * sizeof(double)); 234 | 235 | // Set right hand side X values 236 | for (int i = 1; i < n - 1; ++i) { 237 | CGPoint currentPoint = [[knots objectAtIndex:i] CGPointValue]; 238 | CGPoint nextPoint = [[knots objectAtIndex:i + 1] CGPointValue]; 239 | rhs[i] = 4 * currentPoint.x + 2 * nextPoint.x; 240 | } 241 | 242 | CGPoint firstPoint = [[knots objectAtIndex:0] CGPointValue]; 243 | CGPoint secondPoint = [[knots objectAtIndex:1] CGPointValue]; 244 | 245 | rhs[0] = firstPoint.x + 2 * secondPoint.x; 246 | rhs[n - 1] = (8 * [[knots objectAtIndex:n - 1] CGPointValue].x + [[knots objectAtIndex:n] CGPointValue].x) / 2.0; 247 | 248 | // Get first control points X-values 249 | double *x = [self firstControlPoints:rhs length:n]; 250 | 251 | // Set right hand side Y values 252 | for (int i = 1; i < n - 1; ++i) { 253 | CGPoint currentPoint = [[knots objectAtIndex:i] CGPointValue]; 254 | CGPoint nextPoint = [[knots objectAtIndex:i + 1] CGPointValue]; 255 | rhs[i] = 4 * currentPoint.y + 2 * nextPoint.y; 256 | } 257 | 258 | rhs[0] = firstPoint.y + 2 * secondPoint.y; 259 | rhs[n - 1] = (8 * [[knots objectAtIndex:n - 1] CGPointValue].y + [[knots objectAtIndex:n] CGPointValue].y) / 2.0; 260 | // Get first control points Y-values 261 | double *y = [self firstControlPoints:rhs length:n]; 262 | free(rhs); 263 | 264 | // Fill output arrays. 265 | for (int i = 0; i < n; ++i) 266 | { 267 | // First control point 268 | CGPoint newPoint = CGPointMake(x[i], y[i]); 269 | [firstControlPoints addObject:[NSValue valueWithCGPoint:newPoint]]; 270 | 271 | // Second control point 272 | if (i < n - 1) { 273 | CGPoint nextPoint = [[knots objectAtIndex:i + 1] CGPointValue]; 274 | newPoint = CGPointMake(2 * nextPoint.x - x[i + 1], 2 * nextPoint.y - y[i + 1]); 275 | [secondControlPoints addObject:[NSValue valueWithCGPoint:newPoint]]; 276 | } else { 277 | CGPoint lastPoint = [[knots objectAtIndex:n] CGPointValue]; 278 | newPoint = CGPointMake((lastPoint.x + x[n - 1]) / 2, (lastPoint.y + y[n - 1]) / 2); 279 | [secondControlPoints addObject:[NSValue valueWithCGPoint:newPoint]]; 280 | } 281 | } 282 | 283 | free(x); 284 | free(y); 285 | 286 | return result; 287 | } 288 | 289 | //Original implementation of this method is from: 290 | //http://www.codeproject.com/Articles/31859/Draw-a-Smooth-Curve-through-a-Set-of-2D-Points-wit 291 | + (double *)firstControlPoints:(double *)rhs length:(int)n { 292 | double *x = (double *)malloc(n * sizeof(double)); // Solution vector. 293 | double *tmp = (double *)malloc(n * sizeof(double)); // Temp workspace. 294 | 295 | double b = 2.0; 296 | x[0] = rhs[0] / b; 297 | for (int i = 1; i < n; i++) // Decomposition and forward substitution. 298 | { 299 | tmp[i] = 1 / b; 300 | b = (i < n - 1 ? 4.0 : 3.5) - tmp[i]; 301 | x[i] = (rhs[i] - x[i - 1]) / b; 302 | } 303 | for (int i = 1; i < n; i++) 304 | x[n - i - 1] -= tmp[n - i] * x[n - i]; // Backsubstitution. 305 | 306 | free(tmp); 307 | 308 | return x; 309 | } 310 | 311 | @end 312 | --------------------------------------------------------------------------------