iOS SDK change log from version 2.0.2 to version 2.1.0

SKBoundingBox class

New APIs:

/** Verifies if a given location is within a bounding box.
@param location The location.
@return The result of the verification(YES if the location is within the bounding box, No otherwise).
*/
- (BOOL)containsLocation:(CLLocationCoordinate2D)location;

/** Returns a newly created bounding box with the given location inside the receiver bounding box.
 @param location The location.
 @return The newly created bounding box object. If the location is already inside the bounding box then the receiver bounding box will be returned.
*/
- (SKBoundingBox *)boundingBoxIncludingLocation:(CLLocationCoordinate2D)location;

/** A newly initialized SKBoundingBox.
 @param region The map region to be converted.
 @param size The size of the SKMapView's frame.
*/
+ (instancetype)boundingBoxForRegion:(SKCoordinateRegion)region inMapViewWithSize:(CGSize)size;

SKDefinitions

  • SKOrientationIndicatorType updated
  • SKOrientationIndicatorNone added to SKOrientationIndicatorType

New Constants:

static const float kMaximumZoomLimit = 19.0f;
static const float kMinimumZoomLimit = 0.0;

SKMapZoomLimits
  • sKMapZoomLimitMin renamed to mapZoomLimitMin
  • sKMapZoomLimitMax renamed to mapZoomLimitMax

SKRoutingErrorCode added

typedef NS_ENUM(NSInteger,SKRoutingErrorCode)
{
    SKRoutingErrorCodeNoResultsFound = 601,
    SKRoutingErrorCodeMissingArgument = 610,
    SKRoutingErrorCodeInvalidArgument = 611,
    SKRoutingErrorCodeUnsupportedServerCommand = 621,
    SKRoutingErrorCodeUnsupportedRequestType = 631,
    SKRoutingErrorCodeSameStartAndDestinationCoordinate = 680,
    SKRoutingErrorCodeInvalidStartCoordinate = 681,
    SKRoutingErrorCodeInvalidDestinationCoordinate = 682,
    SKRoutingErrorCodeCannotBeCalculated = 683,
    SKRoutingErrorCodeInvalidViaPoint = 684,
    SKRoutingErrorCodeInternalError = 690,
    SKRoutingErrorCodeExtComputationCanceled =  901,
    SKRoutingErrorCodeRotueCalculationTurnedOffline = 909,//The app was turned to offline mode, during an online routing
    SKRoutingErrorCodeInternetTurnedOff = 910,
};

SKSearchResultType updated;

SKSearchResultZipCode = 4 added to SKSearchResultType;

SKDrawingOrderType added:

typedef NS_ENUM(NSInteger, SKDrawingOrderType)
{
    SKAnnotationsOverDrawableObjects = 0,
    SKDrawableObjectsOverAnnotations = 1,
};

SKDetectedPOI class

New property:

/** The type of the trackable POI.
 */
@property(nonatomic,assign) SKTrackablePOIType type;

SKMapSettings class

New property:

/** Specifies the drawing order for the drawable objects (e.g. polygons, polylines) and annotations. By default the annotations are rendered over drawable objects
 */
@property(nonatomic,assign) SKDrawingOrderType drawingOrderType;

SKMapsInitSettings class

New API:

/** A newly initialized SKMapsInitSettings.
 */
+ (instancetype)mapsInitSettings;

SKMapsService class

New constant:

/** The key for a notification when the library is initialised. 
*/
extern NSString * const kSKMapsLibraryInitialisedNotification;

SKMapsVersioningManager class

New property:

/** The delegate that must conform to SKMapVersioningDelegate protocol, used for receiving callbacks related to map versioning.
 */
@property(nonatomic,weak) id<SKMapVersioningDelegate> delegate;

Remove constants:

extern NSString * const kSKMapsVersionFileDownloadSuccessNotification;
extern NSString * const kSKMapsVersionFileDownloadTimeOutNotification;
extern NSString * const kSKMapsMetadataLoadedNotification;

SKMapsVersioningDelegate protocol

Added SKMapsVersioningDelegate protocol:

/** Called when a new map version is available on the server.
 @param versioningManager The map versioning manager.
 @param currentMapVersion The map version the library currently uses.
 @param latestMapVersion  The latest available map version.
 */
- (void)mapsVersioningManager:(SKMapsVersioningManager *)versioningManager detectedNewAvailableMapVersion:(NSString *)latestMapVersion currentMapVersion:(NSString *)currentMapVersion;

/** Called when the user has map packages that can be updated.
 @param versioningManager The map versioning manager.
 @param packages The offline packages that are installed on the device.
 @param updatablePackages The installed offline packages that can be updated.
 */
- (void)mapsVersioningManager:(SKMapsVersioningManager *)versioningManager loadedWithOfflinePackages:(NSArray *)packages updatablePackages:(NSArray *)updatablePackages;

/** Called when the map version file was successfully downloaded from the server.
 @param versioningManager The map versioning manager.
 */
- (void)mapsVersioningManagerDownloadedVersionFileSuccessfully:(SKMapsVersioningManager *)versioningManager;

/** Called when the map version file request has timed out.
 @param versioningManager The map versioning manager.
 */
- (void)mapsVersioningManagerVersionFileDownloadDidTimeout:(SKMapsVersioningManager *)versioningManager;

/** Called when the metadata of the map was successfully loaded.
 @param versioningManager The map versioning manager.
 */
- (void)mapsVersioningManagerLoadedMetadata:(SKMapsVersioningManager *)versioningManager;

SKMapView+GPX category

Added SKMapView(GPX) category

/** Loads and parses a GPS data file ( GPX or KML ).
 @param filePath The path to the file.
 @param fileType The type of the file (SKGPXFileType or SKKMLFileType).
 @return Success/Failure of loading the GPS data file.
 */
- (BOOL)loadGPSDataFileAtPath:(NSString *)filePath withType:(GPSDataFileType)fileType;

/** Unloads current GPS Data loaded file.
 */
- (void)unloadCurrentGPSDataFile;

/** Returns the GPX components from the loaded GPX file.
 @param gpxDataComponentType The type of the GPX components to be returned.
 @return An array of SKGPXDataComponent objects.
 */
- (NSArray *)dataComponentsFromLoadedFileWithType:(SKGPXComponentType)gpxDataComponentType;

/** If the current loaded file contains multiple tracks, this method is used to set the main one.
 @param gpxDataComponent The GPX component that will be set as main track.
 */
- (BOOL)setMainGPXDataComponent:(SKGPXDataComponent *)gpxDataComponent;

/** Renders on the map a GPX component from the current loaded GPS data file.
 @param gpxDataComponent The GPX component that will be rendered.
 */
- (BOOL)drawGPXDataComponent:(SKGPXDataComponent *)gpxDataComponent;

/** Renders on the map all the GPX components given from the current loaded GPS data file.
 @param gpxDataComponents The array of GPX components that will be rendered.
 */
- (BOOL)drawGPXDataComponents:(NSArray *)gpxDataComponents;

/**Returns an array with the coordinates of the specified GPX component from the current loaded GPS data file.
 @param gpxDataComponent The gpx component for required locations.
 @return An array of CLLocation objects.
 */
- (NSArray*)locationsForGPXDataComponent:(SKGPXDataComponent *)gpxDataComponent;

/**drawTrackWithCoordinates: draws a track with the coordinates in array adn with a given type and name. The GPX component must be given by the client with the preferred name and type.
 @param trackPoints An array with CLLocation objects.
 @param gpxDataComponent The data component for the given points.
 */
- (void)drawTrackWithCoordinates:(NSArray *)trackPoints andGPXDataComponent:(SKGPXDataComponent *)gpxDataComponent;

/**Renames the given GPX component with the new name.
 @param gpxComponent The gpx component for editing.
 @param newName The string which represents the new name.
 @return YES is renaming was successful, NO otherwise.
 */
- (BOOL)renameComponent:(SKGPXDataComponent *)gpxComponent withNewName:(NSString *)newName;

/**Deletes the given GPX component from the file.
 @param gpxComponent The gpx component for deletion.
 @return YES is deletion was successful, NO otherwise.
 */
- (BOOL)deleteComponent:(SKGPXDataComponent *)gpxComponent;

SKMapView & Style category

The return value of the APIs below from void was changed to BOOL.

/** Sets the map style for all SKMapView instances.
 @param mapStyle The map style to be changed to.
 @return Success or failure of setting the new map style.
 */
+ (BOOL)setMapStyle:(SKMapViewStyle *)mapStyle;

/** Parses a new style JSON file. After the parsing is finished, the kSKMapStyleParsingFinishedNotification is sent.
 @param alternativeStyle The alternative style to be parsed.
 @param asynchronously If YES, the style will be parsed asynchronously, else it will be synchronously.
 @return Success or failure of parsing the new map style. Failure can occur if the style is not valid or if the app is in background.
 */
+ (BOOL)parseAlternativeMapStyle:(SKMapViewStyle *)alternativeStyle asynchronously:(BOOL)asynchronously;

/** Loads a parsed alternative style into memory. The alternative style is set at initialisation, using mapStyleAlternative property of SKMapsInitSettings.
 After loading use useAlternativeMapStyle: method for activating/deactivating the usage of the alternative style.
 @param alternativeStyle  The alternative style to be loaded.
 @return Success or failure of loading the new map style. Failure can occur if the style is not valid or if the app is in background.
 */
+ (BOOL)loadAlternativeMapStyle:(SKMapViewStyle *)alternativeStyle;

SKMapView class

New APIs:

/** Animates the center of the map to a certain location.
 @param location The location to be centered.
 @param duration The duration of the animation, in seconds.
 */
- (void)animateToLocation:(CLLocationCoordinate2D)location withDuration:(float)duration;

/** Brings a previously added annotation in front of the others.
 @param annotation The the annotation to be brought in front.
 @return Success/failure of bringing the annotation in the front.
 */
- (BOOL)bringToFrontAnnotation:(SKAnnotation*)annotation;

/** Updates a previously added annotation on the map. The annotation will be updated with the new properties.
 @param annotation Annotation to be updated. For further details see SKAnnotation.
 @return Success/failure of updating the annotation.
 */
- (BOOL)updateAnnotation:(SKAnnotation*)annotation;

Updated APIs:

1. The type of the padding parameter was changed from double to CGSize:

/** Sets the visible region of the map so that a provided coordinate bounding box will be visible.
 @param boundingBox The bounding box to be fitted.
 @param padding Padding in pixels width (from left and right of the screen), height (from top and bottom of the screen)
 */
- (void)fitBounds:(SKBoundingBox *)boundingBox withPadding:(CGSize)padding;

2. The renderMapImageInBoundingBox static method was changed to instance method

/** Generates a PNG image on the disk, with the map from the provided bounding box. This will be done asynchronously, and mapViewDidFinishRenderingImageInBoundingBox: will be called when the operation is finished.
 @param boundingBox The bounding box of the generated map.
 @param imagePath The path on the disk where the image should be generated.
 @param size The desired size of the image.
 */
- (void)renderMapImageInBoundingBox:(SKBoundingBox *)boundingBox toPath:(NSString *)imagePath withSize:(CGSize)size;

SKMapViewDelegate protocol

New callbacks:

/** Called when one of the overlays is tapped.
 @param mapView The map view.
 @param overlayId The identifier of the overlay.
 @param location The location where the tap occured.
 */
- (void)mapView:(SKMapView*)mapView didSelectOverlayWithId:(int)overlayId atLocation:(CLLocationCoordinate2D)location;

/** Called when the asynchronous rendering of a map image in a file did finish.
 @param mapView The map view.
 */
- (void)mapViewDidFinishRenderingImageInBoundingBox:(SKMapView*)mapView;

SKNavigationDelegate protocol

New callback:

/** Called when the current or next advice instruction is changed.
 @param routingService The routing service.
 @param currentAdviceInstruction The instruction of the current advice.
 @param nextAdviceInstruction The instruction of the next advice.
 */
- (void)routingService:(SKRoutingService*)routingService didChangeCurrentAdviceInstruction:(NSString*)currentAdviceInstruction nextAdviceInstruction:(NSString*)nextAdviceInstruction;

SKOfflinePackagesManager class

New API:

/** URL of the maps JSON for the given version. The version has to be a string ("version" property of a SKVersionInformation).
 @param version Map version for the maps JSON. If the parameter is nil, the current version of the map will be used.
 @return The URL to the maps JSON for the desired version.
 */
- (NSString*)mapsJSONURLForVersion:(NSString*)version;

SKPOITrackerDataSource protocol

Updated callbacks:
The poiType parameter was added to the callback

/** Provides SKTrackablePOI objects to the SKPOITracker. It will be called based on the parameters set to the startPOITrackerWithRadius:refreshMargin: of the SKPOITracker.
 @param poiTracker The POI tracker.
 @param location The center coordinate of the area where SKTrackablePOI objects are requested.
 @param radius The radius of the area where SKTrackablePOI objects are requested, previously set when starting the SKPOITracker.
 @param poiType The type of the POIs.
 @return An array of SKTrackablePOI objects, that can be detected in the requested area.
 */
- (NSArray *)poiTracker:(SKPOITracker *)poiTracker trackablePOIsAroundLocation:(CLLocationCoordinate2D)location inRadius:(int)radius withType:(int)poiType;

SKPOITrackerDelegate protocol

Updated callback:
The type parameter was added to the callback

/** Starts the POIs detection. The detection process can be customised using custom detection rules. The detection works during a navigation session only. Check the SKRoutingService for further details.
@param radius The radius of the POI coverage area. The dataSource will have to provide POIs in this radius when needed.
@param refreshMargin The percentage of outer coverage area that triggers a refresh when reached, using the dataSource. Has to be in the [ 0.0, 0.5 ] interval.
@param poiTypes An array of NSNumber objects, indicating the types of POIs which should be detected. The trackablePOIsAroundLocation:inRadius:withType datasource will be called for each type from the array.
@return Success/failure of starting the tracker.
*/
- (BOOL)startPOITrackerWithRadius:(int)radius refreshMargin:(double)refreshMargin forPOITypes:(NSArray*)poiTypes;

SKPOITracker class

Updated APIs:
The poiTypes parameter was added to the method:

/** Starts the POIs detection. The detection process can be customised using custom detection rules. The detection works during a navigation session only. Check the SKRoutingService for further details.
@param radius The radius of the POI coverage area. The dataSource will have to provide POIs in this radius when needed.
@param refreshMargin The percentage of outer coverage area that triggers a refresh when reached, using the dataSource. Has to be in the [ 0.0, 0.5 ] interval.
@param poiTypes An array of NSNumber objects, indicating the types of POIs which should be detected. The trackablePOIsAroundLocation:inRadius:withType datasource will be called for each type from the array.
@return Success/failure of starting the tracker.
*/
- (BOOL)startPOITrackerWithRadius:(int)radius refreshMargin:(double)refreshMargin forPOITypes:(NSArray*)poiTypes;

SKPolyline class

New property:

/** The width of the backgrund line. Should be a value in [ 1, 10 ] interval.
 */
@property(nonatomic,assign) int backgroundLineWidth;

SKRouteAlternativeSettings class

New properties:

/** The number of alternative routes that are calculated in this mode. Default is 1.
 */
@property(nonatomic, assign) int numberOfRoutes;

/** Indicates whether to use the roads' slopes when calculating the route.
 */
@property(nonatomic, assign) BOOL useSlopes;

/** Indicates whether to avoid toll roads when calculating the route.
 */
@property(nonatomic, assign) BOOL avoidTollRoads;

/** Indicates whether to avoid highways (Motorways & Motorway links) when calculating the route.
 */
@property(nonatomic, assign) BOOL avoidHighways;

/** Indicates whether to avoid ferry lines when calculating the route.
 */
@property(nonatomic, assign) BOOL avoidFerryLines;

/** Indicates whether to avoid roads that make the user walk along his bike when calculating the route.
 */
@property(nonatomic, assign) BOOL avoidBicycleWalk;

/** Indicates whether to avoid roads that make the user carry his bike when calculating the route.
 */
@property(nonatomic, assign) BOOL avoidBicycleCarry;

SKRouteSettings class

New properties:

/** Indicates whether to avoid roads that make the user walk along his bike when calculating the route.
 */
@property(nonatomic, assign) BOOL avoidBicycleWalk;

/** Indicates whether to avoid roads that make the user carry his bike when calculating the route.
 */
@property(nonatomic, assign) BOOL avoidBicycleCarry;

SKRouteState class

New properties:

/** The instruction of the current advice.
 */
@property(nonatomic, strong) NSString *currentAdviceInstruction;

/** The instruction of the next advice.
 */
@property(nonatomic, strong) NSString *nextAdviceInstruction;

SKRoutingDelegate protocol

Updated callbacks:

/** Called when the route cannot be calculated.
  @param routingService The routing service.
  @param errorCode The status code of the failure.
 */
- (void)routingService:(SKRoutingService *)routingService didFailWithErrorCode:(SKRoutingErrorCode)errorCode;

The timeInterval parameter was added to the callback

/** Called during the route calculation process. If the route cannot be calculated because of a connectivity issue, this callback can be used to control the retry mechanism. Id it's not implemented the route calculation will be retried until successful.
 @param routingService The routing service.
 @param timeInterval The time interval since the route calculation is hanging in seconds.
 @return A boolean value which indicates if the route calculation should be retried.
 */
- (BOOL)routingServiceShouldRetryCalculatingRoute:(SKRoutingService *)routingService withRouteHangingTime:(int)timeInterval;

SKRoutingService class

New property:

/** An array of SKVisualAdviceConfiguration objects used for configuring the color of the advisor images in different countries and streets.
 */
@property(nonatomic,strong) NSArray *visualAdviceConfigurations;

SKVisualAdviceConfiguration class

New class:

/** The SKVisualAdviceConfiguration is used to store the colors of a generated visual advice image
 */
@interface SKVisualAdviceConfiguration : NSObject

Properties & Methods:

/** The code of the country.
 */
@property(nonatomic, strong) NSString *countryCode;

/** The type of the street.
 */
@property(nonatomic, assign) SKStreetType streetType;

/** The color of the allowed street.
 */
@property(nonatomic, strong) UIColor *allowedStreetColor;

/** The color of the forbidden street.
 */
@property(nonatomic, strong) UIColor *forbiddenStreetColor;

/** The color of the route's street.
 */
@property(nonatomic, strong) UIColor *routeStreetColor;

/** The background color of the visual advice.
 */
@property(nonatomic, strong) UIColor *backgroundColor;

/** A newly initialized SKVisualAdviceConfiguration.
 */
+ (instancetype)visualAdviceColor;