CartoType iOS API 7.8.2, 2022-03-25
for development in Swift and Objective C for iOS and Mac OS
Instance Methods | Class Methods | List of all members
CartoTypeFramework Class Reference

#import <CartoTypeFramework.h>

Inheritance diagram for CartoTypeFramework:

Instance Methods

(id) - initWithMap:andStyle:andFont:andWidth:andHeight:
 
(id) - initWithParam:
 
(void *) - getFramework
 
(id) - copy
 
(CTResult- configure:
 
(CTResult- license:
 
(NSString *) - licensee
 
(NSString *) - expiryDate
 
(NSString *) - appBuildDate
 
(NSString *) - copyright
 
(void) - setCopyrightNotice
 
(void) - setCopyrightNotice:
 
(void) - setLegend:width:unit:extendedPosition:
 
(void) - setLegend:width:unit:position:
 
(void) - enableLegend:
 
(void) - setScaleBar:width:unit:extendedPosition:
 
(void) - setScaleBar:width:unit:position:
 
(void) - enableScaleBar:
 
(CTResult- setTurnInstructions:abbreviate:width:widthUnit:extendedPosition:textSize:textSizeUnit:
 
(CTResult- setTurnInstructions:abbreviate:width:widthUnit:position:textSize:textSizeUnit:
 
(void) - enableTurnInstructions:
 
(void) - setTurnInstructionText:
 
(NSString *) - turnInstructionText
 
(void) - drawNoticesAutomatically:
 
(bool) - hasNotices
 
(CartoTypePositionedBitmap *) - getNoticeBitmap
 
(CTResult- loadMap:
 
(bool) - setMapsOverlap:
 
(CTResult- unloadMapByHandle:
 
(CTResult- createWritableMapOfType:
 
(CTResult- saveMap:fileName:fileType:
 
(CTResult- readMap:fileName:fileType:
 
(NSData *) - saveMap:param:
 
(CTResult- readMap:data:
 
(CTResult- writeMapImage:fileType:compress:
 
(bool) - mapIsEmpty:
 
(void) - enableMap:
 
(void) - disableMap:
 
(uint32_t) - getLastMapHandle
 
(uint32_t) - getMainMapHandle
 
(uint32_t) - getMemoryMapHandle
 
(size_t) - mapCount
 
(CartoTypeMapMetaData *) - mapMetaData:
 
(CTResult- loadFont:
 
(CTResult- setStyleSheet:
 
(CTResult- reloadStyleSheet
 
(CTResult- setMapWidth:andHeight:
 
(void) - setResolutionDpi:
 
(double) - getResolutionDpi
 
(CTResult- setScaleDenominator:
 
(double) - getScaleDenominator
 
(CTResult- setScaleDenominatorInView:
 
(double) - getScaleDenominatorInView
 
(double) - scaleDenominatorFromZoomLevel:forImageSize:
 
(double) - zoomLevelFromScaleDenominator:forImageSize:
 
(double) - getDistanceInMetersFrom:to:coordType:
 
(void) - setPerspective:
 
(void) - setPerspectiveParam:
 
(bool) - getPerspective
 
(CartoTypePerspectiveParam *) - getPerspectiveParam
 
(bool) - setDraw3DBuildings:
 
(bool) - getDraw3DBuildings
 
(bool) - setAnimateTransitions:
 
(bool) - getAnimateTransitions
 
(CTResult- zoom:
 
(CTResult- zoomAt:x:y:coordType:
 
(CTResult- rotate:
 
(CTResult- rotateAt:x:y:coordType:
 
(CTResult- setRotation:
 
(CTResult- setRotationAt:x:y:coordType:
 
(double) - getRotation
 
(CTResult- panX:andY:
 
(CTResult- panFrom:fromCoordType:to:toCoordType:
 
(CTResult- setViewCenter:coordType:
 
(CTResult- setView:coordType:margin:minScale:
 
(CTResult- setView:margin:minScale:
 
(CTResult- setView:
 
(CTResult- setViewToRoute:margin:minScale:
 
(CTResult- setViewToWholeMap
 
(CTResult- setViewLimitsToMinScale:maxScale:panArea:
 
(CTResult- setViewObject:margin:minScale:
 
(CTResult- setViewObjects:margin:minScale:
 
(CTResult- getView:coordType:
 
(CartoTypeViewState *) - getViewState
 
(CTResult- getMapExtent:coordType:
 
(NSString *) - getProjectionAsProj4Param
 
(CTResult- insertMapObject:
 
(CartoTypeIdAndResult- insertPushPin:coordType:stringAttrib:color:iconChar:id:
 
(CartoTypeIdAndResult- insertCopyOfMapObject:map:layerName:radius:radiusCoordType:id:replace:
 
(uint64_t) - deleteObjectsFromMap:fromID:toID:withCondition:
 
(CartoTypeMapObject *) - loadMapObjectFromMap:withID:
 
(CTResult- readGpx:file:
 
(CartoTypeGeometry *) - range:point:coordType:timeOrDistance:isTime:
 
(CartoTypeTimeAndDistanceMatrix *) - timeAndDistanceMatrix:to:
 
(CartoTypeRouteAccess- routeAccess:coordType:
 
(void) - enableLayer:
 
(void) - disableLayer:
 
(bool) - layerIsEnabled:
 
(NSMutableArray< NSString * > *) - getLayerNames
 
(CTResult- convertCoords:to:
 
(CartoTypePointAndResult- convertPoint:from:to:
 
(NSString *) - getDataSetName
 
(double) - pixelsToMeters:
 
(double) - metersToPixels:
 
(CTResult- editSetWritableMap:
 
(CTResult- editNewLineObject:
 
(CTResult- editNewPolygonObject:
 
(CTResult- editMoveCurrentPoint:
 
(CTResult- editAddCurrentPoint
 
(CTResult- editDeleteCurrentPoint
 
(CTResult- editDeleteCurrentObject
 
(CTResult- editSelectNearestPoint:radius:
 
(CartoTypeIdAndResult- editInsertCurrentObjectInLayer:id:replace:
 
(CTResult- editSetCurrentObjectStringAttribute:value:
 
(CTResult- editSetCurrentObjectIntAttribute:
 
(CartoTypeAreaLengthAndResult- editGetCurrentObjectAreaAndLength
 
(CGImageRef) - getMapBitmap
 
(CGImageRef) - getMemoryDataBaseMapBitmap
 
(void) - enableDrawingMemoryDataBase:
 
(CGImageRef) - getTileBitmapWithSize:andZoom:andX:andY:
 
(bool) - clipBackgroundToMapBounds:
 
(int) - setTileOverSizeZoomLevels:
 
(CTResult- loadIcon:id:hotSpot:labelPos:labelMaxlength:
 
(CTResult- find:withParam:
 
(CTResult- findAsync:param:override:
 
(NSMutableArray< CartoTypeMapObjectGroup * > *) - findGroups:
 
(CTResult- findAsyncGroups:param:override:
 
(CTResult- findNearby:POIType:text:location:
 
(CTResult- find:maxItems:address:fuzzy:
 
(CTResult- findAddressAsync:maxItems:address:fuzzy:override:
 
(CTResult- findStreetAddresses:maxItems:address:clip:
 
(CTResult- findInDisplay:maxItems:point:radius:
 
(CTResult- findBuildingsNearStreet:street:
 
(CTResult- findInLayer:maxItems:layer:clip:coordType:
 
(CTResult- findAddressPart:maxItems:text:addressPart:fuzzy:incremental:
 
(CTResult- findPolygonsContainingPath:path:findParam:
 
(CTResult- findPointsInPath:path:findParam:
 
(NSString *) - getGeoCodeSummary:
 
(NSString *) - getGeoCodeSummary:coordType:
 
(CTResult- getAddress:mapObject:
 
(CTResult- getAddressFast:mapObject:
 
(CTResult- getAddress:point:coordType:
 
(double) - getMapObjectArea:
 
(double) - getMapObjectLengthOrPerimeter:
 
(double) - getHeight:coordType:
 
(NSMutableArray< NSNumber * > *) - getHeights:
 
(void) - setStyleSheetVariable:toString:
 
(void) - setStyleSheetVariable:toInt:
 
(bool) - setNightMode:
 
(CartoTypeColor- setNightModeColor:
 
(bool) - getNightMode
 
(CartoTypeColor- getNightModeColor
 
(NSMutableArray< CartoTypeBlendStyle * > *) - setBlendStyle:
 
(NSMutableArray< CartoTypeBlendStyle * > *) - blendStyleSet
 
(void) - setPreferredRouterType:
 
(CartoTypeRouterType- preferredRouterType
 
(CartoTypeRouterType- actualRouterType
 
(CTResult- startNavigationFrom:startCoordType:to:endCoordType:
 
(CTResult- startNavigation:
 
(void) - endNavigation
 
(CartoTypeRoute *) - createRoute:profile:coordSet:
 
(CTResult- createRouteAsync:profile:coordSet:override:
 
(CartoTypeRoute *) - createRouteFromXml:profile:fileNameOrData:
 
(CartoTypeRoute *) - createBestRoute:profile:coordSet:startfixed:endfixed:iterations:
 
(CTResult- createBestRouteAsync:profile:coordSet:startfixed:endfixed:iterations:override:
 
(bool) - enableNavigation:
 
(bool) - navigationEnabled
 
(CTResult- loadNavigationData
 
(CTResult- setMainProfile:
 
(CTResult- setMainProfileType:
 
(CartoTypeRouteProfile *) - getProfile:
 
(int) - builtInProfileCount
 
(CartoTypeRouteProfile *) - getBuiltInProfile:
 
(CTResult- setBuiltInProfile:
 
(CTResult- addProfile:
 
(CTResult- chooseRoute:
 
(bool) - navigating
 
(CartoTypePoint- getRouteStart
 
(CartoTypePoint- getRouteEnd
 
(CTResult- displayRoute:
 
(CartoTypeRoute *) - getRoute
 
(CartoTypeRoute *) - getRouteByIndex:
 
(CartoTypeRouteSegment *) - getCurrentRouteSegment
 
(int) - getRouteCount
 
(CTResult- readRouteFromXml:replace:
 
(NSString *) - getRouteInstructions:
 
(CTResult- useRoute:replace:
 
(CTResult- reverseRoutes
 
(CTResult- deleteRoutes
 
(CTResult- writeRouteAsXml:file:fileType:
 
(NSString *) - writeRouteAsXmlString:fileType:
 
(CTResult- navigate:
 
(void) - getFirstTurn:
 
(void) - getSecondTurn:
 
(void) - getContinuationTurn:
 
(CartoTypeNavigationState- getNavigationState
 
(void) - setNavigationMinimumFixDistance:
 
(void) - setNavigationTimeOffRouteTolerance:
 
(void) - setNavigationDistanceOffRouteTolerance:
 
(void) - setNavigationAutoReRoute:
 
(void) - setNavigatorParam:
 
(CartoTypeNavigatorParam *) - getNavigatorParam
 
(void) - setLocationMatchParam:
 
(CartoTypeLocationMatchParam *) - getLocationMatchParam
 
(uint32_t) - setNearbyObjectWarning:layer:condition:maxDistance:maxObjectCount:
 
(uint32_t) - setVehicleTypeWarning:maxObjectCount:
 
(bool) - deleteNearbyObjectWarning:
 
(bool) - clearNearbyObjectWarnings
 
(NSMutableArray< CartoTypeMapObject * > *) - copyNearbyObjects
 
(double) - getDistanceToDestination
 
(double) - getEstimatedTimeToDestination
 
(void) - useSerializedNavigationData:
 
(CTResult- findNearestRoad:point:coordType:headingInDegrees:displayPosition:
 
(CTResult- displayPositionOnNearestRoad:nearestRoadInfo:
 
(void) - setVehiclePosOffsetX:andY:
 
(CTResult- setFollowMode:
 
(CartoTypeFollowMode- getFollowMode
 
(CTResult- getNavigationPosition:coordType:
 
(void) - setLocale:
 
(NSString *) - locale
 
(NSString *) - distanceToString:metricUnits:abbreviate:
 
(NSString *) - timeToString:
 
(NSString *) - setCase:case:
 
(CartoTypeIdAndResult- addTrafficInfo:trafficInfo:locationRef:
 
(CartoTypeIdAndResult- addPolygonSpeedLimit:polygon:speed:vehicleTypes:
 
(CartoTypeIdAndResult- addLineSpeedLimit:line:speed:vehicleTypes:
 
(CartoTypeIdAndResult- addClosedLineSpeedLimit:line:speed:vehicleTypes:
 
(CartoTypeIdAndResult- addForbiddenArea:polygon:
 
(CTResult- deleteTrafficInfo:
 
(void) - clearTrafficInfo
 
(bool) - enableTrafficInfo:
 
(void) - startTracking
 
(void) - EndTracking
 
(void) - deleteTrack
 
(bool) - tracking
 
(bool) - displayTrack:
 
(CartoTypeGeometry *) - getTrack
 
(double) - trackLengthInMeters
 
(CTResult- writeTrackAsXml:
 
(NSString *) - writeTrackAsXmlString
 
(CartoTypeAreaLengthAndResult- getAreaAndLength:
 
(CartoTypeAreaLengthAndResult- getContourAreaAndLength:contourIndex:
 

Class Methods

(NSString *) + version
 
(NSString *) + build
 
(void) + createProfile:type:
 
(CTResult+ readProfileFromXmlFile:filename:
 
(CTResult+ readProfileFromXmlString:filename:
 
(CTResult+ writeProfileAsXmlFile:filename:
 
(NSString *) + writeProfileAsXmlString:
 
(double) + azimuthInDegreesFrom:to:
 
(CartoTypePoint+ pointAtAzimuthFrom:dir:distance:
 
(double) + greatCircleDistanceInMetersFrom:to:
 
(NSString *) + setAttributeInString:withKey:andValue:
 
(int) + intAttribute:withType:
 
(CartoTypeColor+ makeColorR:G:B:A:
 
(CartoTypeColor+ makeColor:
 
(CartoTypeColor+ setColor:A:
 
(NSString *) + errorString:
 

Detailed Description

A framework for the CartoType map drawing library, encapsulating an engine, map view, style sheet, fonts and map data sources.

Method Documentation

◆ actualRouterType

- (CartoTypeRouterType) actualRouterType

If route data has been loaded for the current map or maps, returns the actual router type in use, which may not be the same as the preferred router type, because some router types are not available for certain types of data.

If the route data has not been loaded, returns RouterTypeDefault. Route data is loaded either when the first route is constructed, or when LoadNavigationData is called.

◆ addClosedLineSpeedLimit:line:speed:vehicleTypes:

- (CartoTypeIdAndResult) addClosedLineSpeedLimit: (uint64_t)  aId
line: (CartoTypeGeometry *)  aLine
speed: (double)  aSpeed
vehicleTypes: (uint32_t)  aVehicleTypes 

Adds a speed limit in kph, to be used when calculating routes, to a polygon which is the interior of a closed line along roads, defined by a series of points.

The objectID field of the return value is used to return an identifier for the information, which can be used when calling deleteTrafficInfo(). If aId is non-zero when passed in, it is used, and any existing object with that ID is replaced, otherwise a new identifier is generated.

aLine is a series of points defining the polygon. The polygon is calculated as the best route through the points, using the route network, so to be certain of specifying the desired polygon you need to supply a point for every junction.

aSpeed is the speed to which travel is restricted in kph. Values of zero or less indicate that the road is closed. Values higher than 255 indicate that there is no speed limit.

aVehicleTypes is a set of flags drawn from the KArc constants, as used in TRouteProfile. If aVehicleTypes is 0, all vehicles are affected. Some useful values are KArcAllVehicles, KArcAllMotorVehicles and KArcBicycleAccessFlag.

A polygon map object representing the speed limit is added to the layer 'traffic'.

See also addTrafficInfo, addLineSpeedLimit, addPolygonSpeedlimit, addForbiddenArea, deleteSpeedLimit, and clearTrafficInfo.

◆ addForbiddenArea:polygon:

- (CartoTypeIdAndResult) addForbiddenArea: (uint64_t)  aId
polygon: (CartoTypeGeometry *)  aPolygon 

Marks a certain polygon as forbidden for routing.

The objectID field of the return value is used to return an identifier for the information, which can be used when calling deleteTrafficInfo(). If aId is non-zero when passed in, it is used, and any existing object with that ID is replaced, otherwise a new identifier is generated.

See also addTrafficInfo, addLineSpeedLimit, addPolygonSpeedLimit, deleteTrafficInfo and clearTrafficInfo.

◆ addLineSpeedLimit:line:speed:vehicleTypes:

- (CartoTypeIdAndResult) addLineSpeedLimit: (uint64_t)  aId
line: (CartoTypeGeometry *)  aLine
speed: (double)  aSpeed
vehicleTypes: (uint32_t)  aVehicleTypes 

Adds a speed limit in kph, to be used when calculating routes, to a route defined by a series of points.

The objectID field of the return value is used to return an identifier for the information, which can be used when calling deleteTrafficInfo(). If aId is non-zero when passed in, it is used, and any existing object with that ID is replaced, otherwise a new identifier is generated.

aLine is a series of points defining the road. The road is calculated as the best route through the points, using the route network, so to be certain of specifying the desired route you need to supply a point for every junction. The points are snapped to the nearest nodes in the route network. This means that at the moment you cannot set a speed limit for a range smaller than an arc between two nodes.

aSpeed is the speed to which travel is restricted in kph. Values of zero or less indicate that the road is closed. Values higher than 255 indicate that there is no speed limit.

aVehicleTypes is a set of flags drawn from the KArc constants, as used in TRouteProfile. If aVehicleTypes is 0, all vehicles are affected. Some useful values are KArcAllVehicles, KArcAllMotorVehicles and KArcBicycleAccessFlag.

A line map object representing the speed limit is added to the layer 'traffic'.

See also addTrafficInfo, addClosedLineSpeedLimit, addPolygonSpeedlimit, addForbiddenArea, deleteTrafficInfo, and clearTrafficInfo.

◆ addPolygonSpeedLimit:polygon:speed:vehicleTypes:

- (CartoTypeIdAndResult) addPolygonSpeedLimit: (uint64_t)  aId
polygon: (CartoTypeGeometry *)  aPolygon
speed: (double)  aSpeed
vehicleTypes: (uint32_t)  aVehicleTypes 

Adds a speed limit in kph, to be used when calculating routes, to all roads in a certain polygon. To specify particular roads, or an area enclosed by roads, use addTrafficInfo. This allows the router to take account of slow-downs caused by traffic density, road works, etc.

The objectID field of the return value is used to return an identifier for the information, which can be used when calling deleteTrafficInfo(). If aId is non-zero when passed in, it is used, and any existing object with that ID is replaced, otherwise a new identifier is generated.

aSpeed is the speed to which travel is restricted, in kph. If aSpeed is zero or less, routing is forbidden in the given polygon.

aVehicleTypes is a set of flags drawn from the KArc constants, as used in TRouteProfile. If aVehicleTypes is 0, all vehicles are affected. Some useful values are KArcAllVehicles, KArcAllMotorVehicles and KArcBicycleAccessFlag.

A polygon map object representing the speed limit is added to the layer 'traffic'.

See also addTrafficInfo, addLineSpeedlimit, addForbiddenArea, deleteTrafficInfo, and clearTrafficInfo.

◆ addProfile:

- (CTResult) addProfile: (CartoTypeRouteProfile *)  aProfile

Adds a new routing profile. A CartoTypeFramework object starts with a single routing profile. Adding new profiles allows several different routes to be calculated for the same start and end point.

This function has no effect if routing is performed on a map with a built-in contraction-hierarchy routing table (created using makemap /route=ch), because such a table is created using one or more fixed routing profiles which can be set in makemap.

◆ addTrafficInfo:trafficInfo:locationRef:

- (CartoTypeIdAndResult) addTrafficInfo: (uint64_t)  aId
trafficInfo: (CartoTypeTrafficInfo *)  aTrafficInfo
locationRef: (CartoTypeLocationRef *)  aLocationRef 

Adds traffic information, such as a speed restriction, prohibition on the use of a route, reduction in the number of lanes, notification of road works, etc. At present only speed restrictions are supported.

This is the general function. See also the specialized functions addPolygonSpeedLimit, addLineSpeedLimit, addClosedLineSpeedLimit and addForbiddenArea.

The objectID field of the return value is used to return an identifier for the information, which can be used when calling deleteTrafficInfo(). If aId is non-zero when passed in, it is used, and any existing object with that ID is replaced, otherwise a new identifier is generated.

aTrafficInfo gives the type of information (speed limit, etc.).

aLocationRef defines the location (area, road, point, etc.). Only the values ERoadOrientationForwards and ERoadOrientationNone (which means the same in this context) is supported for iRoadOrientation in aLocationRef.

◆ appBuildDate

- (NSString *) appBuildDate

Returns the date on which the application was built in the form YYYY-MM-DD.

◆ azimuthInDegreesFrom:to:

+ (double) azimuthInDegreesFrom: (CartoTypePoint aStart
to: (CartoTypePoint aEnd 

Gets the azimuth (direction along a great circle line) from one point to another in degrees, given two lat-long points in degrees.

This function uses the WGS84 ellipsoid.

North is 0 and angles increase clockwise.

◆ blendStyleSet

- (NSMutableArray< CartoTypeBlendStyle * > *) blendStyleSet

Returns the current blend style set. If there is none, returns an empty blend style set.

◆ build

+ (NSString *) build

Returns the current CartoType build as a string.

◆ builtInProfileCount

- (int) builtInProfileCount

Returns the number of built-in routing profiles owned by the router. This function returns zero for routers allowing an arbitrary profile to be set, and one or greater for the contraction hierarchy router, which stores one or more fixed profiles.

◆ chooseRoute:

- (CTResult) chooseRoute: (int)  aRouteIndex

Chooses one among a set of alternative routes. The index aRouteIndex selects the route: index 0 is the route created from the main profile. Indexes from 1 upwards select routes created using profiles added using addProfile, in order of their addition.

Returns CTErrorNotFound if the index refers to a nonexistent route. Returns CTErrorNotNavigating if the framework is not navigating.

This function is most appropriately called after calling startNavigation to create the routes, but before calling navigate to supply a position.

◆ clearNearbyObjectWarnings

- (bool) clearNearbyObjectWarnings

Clears all nearby object warnings, and the objects themselves, and returns true if any objects were deleted.

◆ clearTrafficInfo

- (void) clearTrafficInfo

Deletes all speed restrictions, forbidden areas and other traffic information.

◆ clipBackgroundToMapBounds:

- (bool) clipBackgroundToMapBounds: (bool)  aEnable

Enables or disables clipping the map background to the map bounds.

Use this when creating map tiles to be overlaid on a larger map, so that the background (sea) color does not erase the larger map's graphics. The return value is the previous state.

◆ configure:

- (CTResult) configure: (NSString *)  aConfigFileName

Configures the CartoType framework by reading an XML configuration file.

◆ convertCoords:to:

- (CTResult) convertCoords: (CartoTypeGeometry *)  aGeometry
to: (CartoTypeCoordType aToCoordType 

Converts coordinates in aGeometry to another coordinate type.

◆ convertPoint:from:to:

- (CartoTypePointAndResult) convertPoint: (CartoTypePoint aPoint
from: (CartoTypeCoordType aFromCoordType
to: (CartoTypeCoordType aToCoordType 

Converts a point between any combination of lat/long, map coordinates and display pixels.

◆ copy

- (id) copy

Creates a copy of the framework with the same fonts, maps and style sheets.

◆ copyNearbyObjects

- (NSMutableArray< CartoTypeMapObject * > *) copyNearbyObjects

Returns copies of all the objects for which nearby object warnings exist.

◆ copyright

- (NSString *) copyright

Returns the copyright string stored in the main map database.

◆ createBestRoute:profile:coordSet:startfixed:endfixed:iterations:

- (CartoTypeRoute *) createBestRoute: (CTResult *)  aResult
profile: (CartoTypeRouteProfile *)  aProfile
coordSet: (CartoTypeRouteCoordSet *)  aCoordSet
startfixed: (bool)  aStartFixed
endfixed: (bool)  aEndFixed
iterations: (int)  aIterations 

Creates an optimized route to visit a series of waypoints in any order.

If aStartFixed is true, the first point in the route is always the first point supplied. If aEndFixed is true, the last point in the route is always the last point supplied. To create a circular route starting and ending at a predetermined place, but visiting the other points in any order, set aStartFixed and aEndFixed true, and make the first and last point the same. aIterations is the number of different routes to be tried.

To use the route for navigation, call the useRoute method.

◆ createBestRouteAsync:profile:coordSet:startfixed:endfixed:iterations:override:

- (CTResult) createBestRouteAsync: (id< CartoTypeCreateRouteAsyncProtocol > *)  aCallback
profile: (CartoTypeRouteProfile *)  aProfile
coordSet: (CartoTypeRouteCoordSet *)  aCoordSet
startfixed: (bool)  aStartFixed
endfixed: (bool)  aEndFixed
iterations: (int)  aIterations
override: (bool)  aOverride 

An asynchronous version of CreateBestRoute. Creates a route asynchronously and calls aCallback (from a different thread) with the created route and an error code.

If aOverride is true, any pending asynchronous routing operations that have not yet been started are deleted. Asynchronous routing operations are executed in order.

In Swift you need to use an AutoreleasingUnsafeMutablePointer referring to your callback object, like this:

let p : AutoreleasingUnsafeMutablePointer<CartoTypeCreateRouteAsyncProtocol?> = AutoreleasingUnsafeMutablePointer<CartoTypeCreateRouteAsyncProtocol?>.init(&m_route_handler)
m_framework.createRouteAsync(p, profile: &pr, coordSet: cs, startfixed: true, endfixed: true, iterations: 10, override: false);

◆ createProfile:type:

+ (void) createProfile: (CartoTypeRouteProfile *)  aProfile
type: (CartoTypeRouteProfileType aProfileType 

Creates a route profile of a given type so that it can be modified as desired and then used for routing.

◆ createRoute:profile:coordSet:

- (CartoTypeRoute *) createRoute: (CTResult *)  aResult
profile: (CartoTypeRouteProfile *)  aProfile
coordSet: (CartoTypeRouteCoordSet *)  aCoordSet 

Creates a route without starting navigation.

◆ createRouteAsync:profile:coordSet:override:

- (CTResult) createRouteAsync: (id< CartoTypeCreateRouteAsyncProtocol > *)  aCallback
profile: (CartoTypeRouteProfile *)  aProfile
coordSet: (CartoTypeRouteCoordSet *)  aCoordSet
override: (bool)  aOverride 

Creates a route asynchronously and calls aCallback (from a different thread) with the created route and an error code.

If aOverride is true, any pending asynchronous routing operations that have not yet been started are deleted. Asynchronous routing operations are executed in order.

In Swift you need to use an AutoreleasingUnsafeMutablePointer referring to your callback object, like this:

let p : AutoreleasingUnsafeMutablePointer<CartoTypeCreateRouteAsyncProtocol?> = AutoreleasingUnsafeMutablePointer<CartoTypeCreateRouteAsyncProtocol?>.init(&m_route_handler)
m_framework.createRouteAsync(p, profile: &pr, coordSet: cs, override: false);

◆ createRouteFromXml:profile:fileNameOrData:

- (CartoTypeRoute *) createRouteFromXml: (CTResult *)  aResult
profile: (CartoTypeRouteProfile *)  aProfile
fileNameOrData: (NSString *)  aFileNameOrData 

Creates a route by reading it from XML data in GPX or CartoType route format. If the parameter aFileNameOrData starts with a less-than sign, it is treated as XML data, otherwise it is treated as a filename.

If GPX data contains route elements, the first of them is used; otherwise the first track element is used if any.

The profile is ignored if the data is in CartoType route format, which contains the profile used to create it.

◆ createWritableMapOfType:

- (CTResult) createWritableMapOfType: (CartoTypeWritableMapType aType

Create a writable (editable) map of the specified type and load it.

◆ deleteNearbyObjectWarning:

- (bool) deleteNearbyObjectWarning: (uint32_t)  aId

Deletes the nearby object warning or vehicle type warning with an ID of aId and returns true if any such object existed.

◆ deleteObjectsFromMap:fromID:toID:withCondition:

- (uint64_t) deleteObjectsFromMap: (uint32_t)  aMapHandle
fromID: (uint64_t)  aStartID
toID: (uint64_t)  aEndId
withCondition: (NSString *)  aCondition 

Deletes map objects in the range aStartID...aEndID inclusive from a writable map identified by its handle. If aCondition is non-null only objects satisfying the condition are deleted. The number of objects deleted is returned.

◆ deleteRoutes

- (CTResult) deleteRoutes

Deletes all routes.

◆ deleteTrack

- (void) deleteTrack

Deletes the current track. Does not affect whether tracking is on or off.

◆ deleteTrafficInfo:

- (CTResult) deleteTrafficInfo: (uint64_t)  aId

Deletes traffic information: a speed limit, forbidden area, or other information, referring to it by the ID returned when the restriction was added by AddTrafficInfo(), AddLineSpeedLimit(), AddForbiddenArea(), etc.

Use ClearTrafficInfo() to delete all restrictions and forbidden areas.

◆ disableLayer:

- (void) disableLayer: (NSString *)  aLayerName

Disables the named map layer.

◆ disableMap:

- (void) disableMap: (uint32_t)  aHandle

Disables a map, selecting it by handle.

◆ displayPositionOnNearestRoad:nearestRoadInfo:

- (CTResult) displayPositionOnNearestRoad: (CartoTypeNavigationData *)  aNavData
nearestRoadInfo: (CartoTypeNearestRoadInfo *)  aInfo 

Moves the route position object and the route vector object to the nearest point on a road.

Uses the supplied navigation data and the current location match parameters. If the course (heading) is supplied it is used to choose among roads going in different directions. If aInfo is non-null, it is used to return information about the nearest road. This function can be used whether or not navigation is being performed.

◆ displayRoute:

- (CTResult) displayRoute: (bool)  aEnable

If aEnable is true, displays the current route and up to two alternative routes. If aEnable is false, removes the current route from the display.

◆ displayTrack:

- (bool) displayTrack: (bool)  aEnable

Enables or disables displaying the track. Returns the previous state.

◆ distanceToString:metricUnits:abbreviate:

- (NSString *) distanceToString: (double)  aDistanceInMeters
metricUnits: (bool)  aMetricUnits
abbreviate: (bool)  aAbbreviate 

Returns a distance as a string containing locale-dependent words for kilometres, metres, miles and yards.

◆ drawNoticesAutomatically:

- (void) drawNoticesAutomatically: (bool)  aEnable

Controls whether notices (the scale bar, legend and copyright notice) are drawn automatically. If not, they can be drawn using DrawNotices.

◆ editAddCurrentPoint

- (CTResult) editAddCurrentPoint

Adds a new point to the editable object by copying the current point.

◆ editDeleteCurrentObject

- (CTResult) editDeleteCurrentObject

Deletes the current editable object.

◆ editDeleteCurrentPoint

- (CTResult) editDeleteCurrentPoint

Deletes the editable object's current point unless that would result in a line object of fewer than 2 points, or a polygon object of fewer than 3.

◆ editGetCurrentObjectAreaAndLength

- (CartoTypeAreaLengthAndResult) editGetCurrentObjectAreaAndLength

Returns the area and length of the currently edited object. For line objects returns 0 and the length in meters. For polygon objects returns the area in square meters and the perimeter in meters.

◆ editInsertCurrentObjectInLayer:id:replace:

- (CartoTypeIdAndResult) editInsertCurrentObjectInLayer: (NSString *)  aLayer
id: (uint64_t)  aId
replace: (bool)  aReplace 

Inserts the currently edited object into a chosen layer, converting it from an edited object into an ordinary object. If aId is non-zero and aReplace is true, replaces any existing object with that ID, otherwise creates a new object. The ID of the new object is returned as part of the result.

◆ editMoveCurrentPoint:

- (CTResult) editMoveCurrentPoint: (CartoTypePoint aDisplayPoint

Moves the editable object's current point if any.

◆ editNewLineObject:

- (CTResult) editNewLineObject: (CartoTypePoint aDisplayPoint

Creates a new editable line object starting at the specified point.

◆ editNewPolygonObject:

- (CTResult) editNewPolygonObject: (CartoTypePoint aDisplayPoint

Creates a new editable polygon object starting at the specified point.

◆ editSelectNearestPoint:radius:

- (CTResult) editSelectNearestPoint: (CartoTypePoint aDisplayPoint
radius: (double)  aRadiusInMillimeters 

Selects an editable object by selecting the nearest point of any editable object within a given radius. If the point is not within the given radius of an existing point, creates a new point.

◆ editSetCurrentObjectIntAttribute:

- (CTResult) editSetCurrentObjectIntAttribute: (uint32_t)  aValue

Sets the integer attribute of the currently edited object.

◆ editSetCurrentObjectStringAttribute:value:

- (CTResult) editSetCurrentObjectStringAttribute: (NSString *)  aKey
value: (NSString *)  aValue 

Sets a string attribute in the currently edited object. If aKey is empty, sets the label. If aValue is empty, deletes the attribute.

◆ editSetWritableMap:

- (CTResult) editSetWritableMap: (uint32_t)  aMapHandle

Sets the map used to store editable objects. Does not affect objects already created. If this function is not called, editable objects are stored in the map used for route objects.

◆ enableDrawingMemoryDataBase:

- (void) enableDrawingMemoryDataBase: (bool)  aEnable

Enables or disables drawing objects from the in-memory database (like routes) as part of the main map.

◆ enableLayer:

- (void) enableLayer: (NSString *)  aLayerName

Enables the named map layer.

◆ enableLegend:

- (void) enableLegend: (bool)  aEnable

Enables or disables the drawing of a legend that has been supplied using setLegend.

◆ enableMap:

- (void) enableMap: (uint32_t)  aHandle

Enables a map, selecting it by handle.

◆ enableNavigation:

- (bool) enableNavigation: (bool)  aEnable

Enables or disables navigation. When navigation is disabled, the follow modes work but no navigation is performed even if there is a route. The return value is the previous state.

◆ enableScaleBar:

- (void) enableScaleBar: (bool)  aEnable

Enables or disables the drawing of a scale bar that has been supplied using setScaleBar.

◆ enableTrafficInfo:

- (bool) enableTrafficInfo: (bool)  aEnable

Enables or disables the use of traffic information when routing. Returns the previous state.

◆ enableTurnInstructions:

- (void) enableTurnInstructions: (bool)  aEnable

Enables or disables the drawing of a turn instruction notice that has been supplied using SetTurnInstructions.

◆ endNavigation

- (void) endNavigation

Stops navigating. Current routes remain in existence. Navigation can be resumed using startNavigation or enableNavigation.

◆ EndTracking

- (void) EndTracking

Stops tracking (storing and displaying track points). Does not delete the current track.

◆ errorString:

+ (NSString *) errorString: (uint32_t)  aCode

Returns a string description for an error code.

◆ expiryDate

- (NSString *) expiryDate

Returns the expiry date of the license in the form YYYY-MM-DD.

◆ find:maxItems:address:fuzzy:

- (CTResult) find: (NSMutableArray< CartoTypeMapObject * > *)  aObjectArray
maxItems: (int)  aMaxItems
address: (CartoTypeAddress *)  aAddress
fuzzy: (bool)  aFuzzy 

Finds an address using structured data. At least one of the fields in the CartoTypeAddress object must be filled in. If aFuzzy is true, uses fuzzy matching.

The objects returned are in map coordinates. They are appended to the array aObjectArray, which is not cleared before the search.

aObjectArray contains CartoTypeMapObject objects.

◆ find:withParam:

- (CTResult) find: (NSMutableArray< CartoTypeMapObject * > *)  aObjectArray
withParam: (CartoTypeFindParam *)  aFindParam 

A general search function, allowing any combination of clip rectangle, choice of layers, choice of attributes, text and string match method, and condition.

The returned values are CartoTypeMapObject objects which are placed in the array aObjectArray, which cleared before the search.

aObjectArray contains CartoTypeMapObject objects.

◆ findAddressAsync:maxItems:address:fuzzy:override:

- (CTResult) findAddressAsync: (id< CartoTypeFindAsyncProtocol > *)  aCallback
maxItems: (int)  aMaxItems
address: (CartoTypeAddress *)  aAddress
fuzzy: (bool)  aFuzzy
override: (bool)  aOverride 

Finds an address asynchronously and calls the handler method of the object aCallBack (from a different thread) with the map objects that have been found when the operation has been completed. If aOverride is true, any pending asynchronous find operations that have not yet been started are deleted. Asynchronous find operations are executed in order.

In Swift you need to use an AutoreleasingUnsafeMutablePointer referring to your callback object, like this:

let p : AutoreleasingUnsafeMutablePointer<CartoTypeFindAsyncProtocol?> = AutoreleasingUnsafeMutablePointer<CartoTypeFindAsyncProtocol?>.init(&m_find_handler)
m_framework.findAsync(p, maxItems: 100, address: a, fuzzy: true, override: false)

◆ findAddressPart:maxItems:text:addressPart:fuzzy:incremental:

- (CTResult) findAddressPart: (NSMutableArray< CartoTypeMapObject * > *)  aObjectArray
maxItems: (int)  aMaxItems
text: (NSString *)  aText
addressPart: (CartoTypeAddressPart aAddressPart
fuzzy: (bool)  aFuzzy
incremental: (bool)  aIncremental 

Finds part of an address used in a CartoTypeAddress object, using the same search rules used for finding an entire address. If aIncremental is true, prefix-matching is used and this enables an address dialog to be populated incrementally; in this case it's a good idea to set aMaxItems to a small number that is a suitable number of items to be displayed in a list box on the display, for example 20.

◆ findAsync:param:override:

- (CTResult) findAsync: (id< CartoTypeFindAsyncProtocol > *)  aCallback
param: (CartoTypeFindParam *)  aFindParam
override: (bool)  aOverride 

Performs a general find operation asynchronously and calls the handler method of the object aCallBack (from a different thread) with the map objects that have been found when the operation has been completed. If aOverride is true, any pending asynchronous find operations that have not yet been started are deleted. Asynchronous find operations are executed in order.

In Swift you need to use an AutoreleasingUnsafeMutablePointer referring to your callback object, like this:

let p : AutoreleasingUnsafeMutablePointer<CartoTypeFindAsyncProtocol?> = AutoreleasingUnsafeMutablePointer<CartoTypeFindAsyncProtocol?>.init(&m_find_handler)
m_framework.findAsync(p, param: fp, override: false)

◆ findAsyncGroups:param:override:

- (CTResult) findAsyncGroups: (id< CartoTypeFindAsyncGroupProtocol > *)  aCallback
param: (CartoTypeFindParam *)  aFindParam
override: (bool)  aOverride 

An asynchronous search function to make interactive searching easier.

It returns map objects grouped by names which can be used to identify the groups in a list box. For example, a search for pubs using the word 'Red' as the search term might return one group with the name 'Red Lion' and another group with the name 'Red Cow'.

The handler method of the object aCallback is called (from a different thread) with the map object groups that have been found when the operation has been completed. If aOverride is true, any pending asynchronous find operations that have not yet been started are deleted. Asynchronous find operations are executed in order.

In Swift you need to use an AutoreleasingUnsafeMutablePointer referring to your callback object, like this:

let p : AutoreleasingUnsafeMutablePointer<CartoTypeFindAsyncGroupProtocol?> = AutoreleasingUnsafeMutablePointer<CartoTypeFindAsyncGroupProtocol?>.init(&m_find_group_handler)
m_framework.findAsyncGroups(p, param: fp, override: false)

◆ findBuildingsNearStreet:street:

- (CTResult) findBuildingsNearStreet: (NSMutableArray< CartoTypeMapObject * > *)  aObjectArray
street: (CartoTypeMapObject *)  aStreet 

Finds all the buildings near the map object aStreet, which must be a linear object. In practice, aStreet needs to have a name that is referred to by the addr:street attribute. The buildings returned are those within 50 meters of aStreet, plus those buildings up to 200 meters away with an addr:street attribute matching the street's name.

◆ findGroups:

- (NSMutableArray< CartoTypeMapObjectGroup * > *) findGroups: (CartoTypeFindParam *)  aFindParam

A search function to make interactive searching easier. It returns map objects grouped by names which can be used to identify the groups in a list box. For example, a search for pubs using the word 'Red' as the search term might return one group with the name 'Red Lion' and another group with the name 'Red Cow'.

An array of CartoTypeMapObjectGroup objects is returned, or nil if no objects are found, or a nil or invalid find parameter object is supplied.

◆ findInDisplay:maxItems:point:radius:

- (CTResult) findInDisplay: (NSMutableArray< CartoTypeMapObject * > *)  aObjectArray
maxItems: (int)  aMaxItems
point: (CartoTypePoint aPoint
radius: (double)  aRadius 

Finds all objects within aRadius of the point aPoint on the display. The point and the radius are given in pixels. Unlike the other find functions, this function deals with the graphic representation of objects, so it will work correctly when the user clicks on an icon, but not on the actual location of the object represented by the icon.

◆ findInLayer:maxItems:layer:clip:coordType:

- (CTResult) findInLayer: (NSMutableArray< CartoTypeMapObject * > *)  aObjectArray
maxItems: (int)  aMaxItems
layer: (NSString *)  aLayer
clip: (CartoTypeRect aClip
coordType: (CartoTypeCoordType aCoordType 

Finds all objects in a named layer or list of layers (space or comma separated), within specified bounds.

◆ findNearby:POIType:text:location:

- (CTResult) findNearby: (NSMutableArray< CartoTypeMapObject * > *)  aObjectArray
POIType: (CartoTypePointOfInterestType aPOIType
text: (NSString *)  aText
location: (CartoTypeGeometry *)  aLocation 

A function to find nearby objects. You can also construct a CartoTypeFindParam object from the same parameters, modify them if needed, and call find:withParam.

◆ findNearestRoad:point:coordType:headingInDegrees:displayPosition:

- (CTResult) findNearestRoad: (CartoTypeNearestRoadInfo *)  aInfo
point: (CartoTypePoint aPoint
coordType: (CartoTypeCoordType aCoordType
headingInDegrees: (double)  aHeadingInDegrees
displayPosition: (bool)  aDisplayPosition 

Finds the nearest road to the point aPoint, returns information about it in aInfo, and optionally (if aDisplayPosition is true) sets the current location to that position. Uses the current location match parameters.

Roads are defined as map objects allowed by the current routing filter and main route profile. If aHeadingInDegrees is valid (not negative) it is used to choose among roads going in different directions.

◆ findPointsInPath:path:findParam:

- (CTResult) findPointsInPath: (NSMutableArray< CartoTypeMapObject * > *)  aObjectArray
path: (CartoTypeGeometry *)  aPath
findParam: (CartoTypeFindParam *)  aFindParam 

Finds all point objects contained in a certain closed path. To use standard parameters pass null as aFindParam. To set parameters other than the path and the condition of finding points, pass a CartoTypeFindParam object with your chosen parameters.

◆ findPolygonsContainingPath:path:findParam:

- (CTResult) findPolygonsContainingPath: (NSMutableArray< CartoTypeMapObject * > *)  aObjectArray
path: (CartoTypeGeometry *)  aPath
findParam: (CartoTypeFindParam *)  aFindParam 

Finds all polygon objects containing a certain path. To use standard parameters pass null as aFindParam. To set parameters other than the path and the condition of finding polygons, pass a CartoTypeFindParam object with your chosen parameters.

◆ findStreetAddresses:maxItems:address:clip:

- (CTResult) findStreetAddresses: (NSMutableArray< CartoTypeMapObject * > *)  aObjectArray
maxItems: (int)  aMaxItems
address: (CartoTypeAddress *)  aAddress
clip: (CartoTypeGeometry *)  aClip 

Finds all street addresses matching the supplied parameters.

In the address, only the building, street, locality, admin area, country and postcode are used; the other fields are ignored. One of the special characters '*', indicating a prefix search, or '~', indicating a fuzzy search, may be appended to any address field: for example, a postcode of 9040* searches for all postcodes starting with 9040.

The returned objects are either streets or buildings. If the building is specified, buildings are returned, otherwise streets are returned. To get all buildings in the selected streets, use '*' as the building.

◆ getAddress:mapObject:

- (CTResult) getAddress: (CartoTypeAddress *)  aAddress
mapObject: (CartoTypeMapObject *)  aMapObject 

Creates an address for a map object.

Calls to this function are limited in number in unlicensed (evaluation) versions of the CartoType library.

◆ getAddress:point:coordType:

- (CTResult) getAddress: (CartoTypeAddress *)  aAddress
point: (CartoTypePoint aPoint
coordType: (CartoTypeCoordType aCoordType 

Creates an address for a geographical location.

Calls to this function are limited in number in unlicensed (evaluation) versions of the CartoType library.

◆ getAddressFast:mapObject:

- (CTResult) getAddressFast: (CartoTypeAddress *)  aAddress
mapObject: (CartoTypeMapObject *)  aMapObject 

Creates an address for a map object, using attributes of the object only. Returns KErrorNotFound if the relevant address parts were not found.

◆ getAnimateTransitions

- (bool) getAnimateTransitions

Returns true if transitions are smoothly animated in graphics-accelerated drawing.

◆ getAreaAndLength:

- (CartoTypeAreaLengthAndResult) getAreaAndLength: (CartoTypeGeometry *)  aGeometry

Returns the area and length of a geometry object on the surface of the earth in square meters and meters respectively, using the WGS84 ellipsoid. The area and length of a point object are both zero. The area of a line object is zero. This function ignores curves. All points are treated as on-curve.

◆ getBuiltInProfile:

- (CartoTypeRouteProfile *) getBuiltInProfile: (int)  aIndex

Gets a built-in routing profile selected by its index; returns null if the index is out of range. Routers allowing an arbitrary profile to be set have no built-in profiles. The contraction hierarchy router has one or more built-in profiles.

◆ getContinuationTurn:

- (void) getContinuationTurn: (CartoTypeTurn *)  aTurn

When navigating, returns any 'ahead' or 'continue' turn before the first turn, so that the user interface can show that no turn is required at the next junction or adjoining minor road. If its type is TurnTypeNone there is no such turn. The distance member of the turn is the distance from the current position to the continuation turn. This function does not create aTurn. You need to pass a pointer to a CartoTypeTurn object which you own.

◆ getContourAreaAndLength:contourIndex:

- (CartoTypeAreaLengthAndResult) getContourAreaAndLength: (CartoTypeGeometry *)  aGeometry
contourIndex: (int)  aContourIndex 

Returns the area and length of a contour of a geometry object on the surface of the earth in square meters and meters respectively, using the WGS84 ellipsoid. The area and length of a point are both zero. The area of a line is zero. This function ignores curves. All points are treated as on-curve.

◆ getCurrentRouteSegment

- (CartoTypeRouteSegment *) getCurrentRouteSegment

Returns the current route segment, or null if not navigating.

◆ getDataSetName

- (NSString *) getDataSetName

Returns the name of the data in the main map database.

◆ getDistanceInMetersFrom:to:coordType:

- (double) getDistanceInMetersFrom: (CartoTypePoint aStart
to: (CartoTypePoint aEnd
coordType: (CartoTypeCoordType aCoordType 

Gets the great-circle distance in meters between two points. Uses the WGS84 ellipsoid.

◆ getDistanceToDestination

- (double) getDistanceToDestination

When navigating, returns the current distance to the destination in meters.

◆ getDraw3DBuildings

- (bool) getDraw3DBuildings

Returns true if buildings are drawn in 3D where data is available.

◆ getEstimatedTimeToDestination

- (double) getEstimatedTimeToDestination

When navigating, returns the estimated time to the destination in seconds.

◆ getFirstTurn:

- (void) getFirstTurn: (CartoTypeTurn *)  aTurn

When navigating, returns the first significant turn after the current position, ignoring 'ahead' and 'continue' turns. If its type is TurnTypeNone there are no remaining significant turns. The distance member of the turn is the distance from the current position to the first turn or the arrival point. This function does not create aTurn. You need to pass a pointer to a CartoTypeTurn object which you own.

◆ getFollowMode

- (CartoTypeFollowMode) getFollowMode

Returns the follow mode, which controls the way the map tracks the user location and heading.

◆ getFramework

- (void *) getFramework

Returns a pointer to the underlying C++ CartoType::Framework object. To use it you need to include cartotype_framework.h and cast the returned pointer to CartoType::CFramework*.

◆ getGeoCodeSummary:

- (NSString *) getGeoCodeSummary: (CartoTypeMapObject *)  aMapObject

Returns a string summarizing a geocode for a map object. The summary is a string version of the address returned by GetAddress.

Calls to this function are limited in number in unlicensed (evaluation) versions of the CartoType library.

◆ getGeoCodeSummary:coordType:

- (NSString *) getGeoCodeSummary: (CartoTypePoint aPoint
coordType: (CartoTypeCoordType aCoordType 

Returns a string summarizing a geocode for a geographical location. The summary is a string version of the address returned by GetAddress.

Calls to this function are limited in number in unlicensed (evaluation) versions of the CartoType library.

◆ getHeight:coordType:

- (double) getHeight: (CartoTypePoint aPoint
coordType: (CartoTypeCoordType aCoordType 

Returns the height in meters at a single point, or -32768 if it is unavailable.

The layer 'terrain-height-metres' is used by preference. It contains heights to meter precision. If that layer is not available, the layer 'terrain-height-feet' is used, which contains heights to 100-foot precision.

◆ getHeights:

- (NSMutableArray< NSNumber * > *) getHeights: (CartoTypeGeometry *)  aGeometry

Finds the heights above sea level of the points making up a geometry object. Heights are returned in meters.

The layer 'terrain-height-metres' is used by preference. It contains heights to meter precision. If that layer is not available, the layer 'terrain-height-feet' is used, which contains heights to 100-foot precision.

Unknown heights are set to -32768.

◆ getLastMapHandle

- (uint32_t) getLastMapHandle

Gets the handle of the map most recently loaded, or created using CreateWritableMap.

◆ getLayerNames

- (NSMutableArray< NSString * > *) getLayerNames

Returns the names of the layers in the map as an array of NSString objects.

◆ getLocationMatchParam

- (CartoTypeLocationMatchParam *) getLocationMatchParam

Returns the current location match parameters.

◆ getMainMapHandle

- (uint32_t) getMainMapHandle

Gets the handle of the main map.

◆ getMapBitmap

- (CGImageRef) getMapBitmap

Gets a bitmap containing the current map, redrawing it first if necessary.

◆ getMapExtent:coordType:

- (CTResult) getMapExtent: (CartoTypeRect *)  aExtent
coordType: (CartoTypeCoordType aCoordType 

Gets the extent of the entire map in display pixels, map coordinates or lat/long.

◆ getMapObjectArea:

- (double) getMapObjectArea: (CartoTypeMapObject *)  aMapObject

Gets the area of a map object in square meters. Returns zero for a point object.

◆ getMapObjectLengthOrPerimeter:

- (double) getMapObjectLengthOrPerimeter: (CartoTypeMapObject *)  aMapObject

Gets the length or perimeter of a map object in meters. Returns zero for a point object.

◆ getMemoryDataBaseMapBitmap

- (CGImageRef) getMemoryDataBaseMapBitmap

Gets a bitmap containing objects from the in-memory database only, redrawing it first if necessary.

◆ getMemoryMapHandle

- (uint32_t) getMemoryMapHandle

Gets the handle of the in-memory map used for routes.

◆ getNavigationPosition:coordType:

- (CTResult) getNavigationPosition: (CartoTypePoint *)  aPoint
coordType: (CartoTypeCoordType aCoordType 

Gets the current position used by the navigation system. This may be an extrapolated position.

◆ getNavigationState

- (CartoTypeNavigationState) getNavigationState

Returns the current navigation state.

◆ getNavigatorParam

- (CartoTypeNavigatorParam *) getNavigatorParam

Returns the current parameters affecting how navigation works.

◆ getNightMode

- (bool) getNightMode

Returns true if night mode is set.

◆ getNightModeColor

- (CartoTypeColor) getNightModeColor

Returns the current night mode color.

◆ getNoticeBitmap

- (CartoTypePositionedBitmap *) getNoticeBitmap

Gets a bitmap containing notices (legend, scale bar and copyright notice). Turns off automatic drawing of notices to the map bitmap if it is in effect.

◆ getPerspective

- (bool) getPerspective

Returns true if perspective mode is currently selected, false otherwise.

◆ getPerspectiveParam

- (CartoTypePerspectiveParam *) getPerspectiveParam

Returns the current perspective parameters.

◆ getProfile:

- (CartoTypeRouteProfile *) getProfile: (int)  aIndex

Returns one of the active route profiles, or null if the index is out of range. The index 0 always works, and returns the main profile.

◆ getProjectionAsProj4Param

- (NSString *) getProjectionAsProj4Param

Gets the current map projection as a proj.4 parameter string if possible. If not returns the empty string.

◆ getResolutionDpi

- (double) getResolutionDpi

Gets the display resolution used by CartoType in dots per inch.

◆ getRotation

- (double) getRotation

Returns the current rotation angle of the map in degrees.

◆ getRoute

- (CartoTypeRoute *) getRoute

Returns the current route, or null if there is none.

◆ getRouteByIndex:

- (CartoTypeRoute *) getRouteByIndex: (int)  aIndex

Returns any of the current routes.

◆ getRouteCount

- (int) getRouteCount

Returns the number of alternative routes. Returns 0 if not navigating.

◆ getRouteEnd

- (CartoTypePoint) getRouteEnd

If navigating, gets the end of the route in map coordinates. Returns (0,0) if not navigating.

◆ getRouteInstructions:

- (NSString *) getRouteInstructions: (CartoTypeRoute *)  aRoute

Gets instructions for a route in the language of the current locale.

◆ getRouteStart

- (CartoTypePoint) getRouteStart

If navigating, gets the start of the route in map coordinates. Returns (0,0) if not navigating.

◆ getScaleDenominator

- (double) getScaleDenominator

Returns the denominator of the scale fraction. For example, if the scale is 1:50,000 the value 50000 is returned.

◆ getScaleDenominatorInView

- (double) getScaleDenominatorInView

Returns the denominator of the scale fraction in the center of the view, correcting for distortion introduced by the projection. For example, if the scale is 1:50,000 the value 50000 is returned.

◆ getSecondTurn:

- (void) getSecondTurn: (CartoTypeTurn *)  aTurn

When navigating, returns any significant turn 100 meters or less after the first turrn. If its type is TurnTypeNone there is no such turn. The distance member of the turn is the distance from the first turn to the second turn. This function does not create aTurn. You need to pass a pointer to a CartoTypeTurn object which you own.

◆ getTileBitmapWithSize:andZoom:andX:andY:

- (CGImageRef) getTileBitmapWithSize: (int)  aSize
andZoom: (int)  aZoom
andX: (int)  aX
andY: (int)  aY 

Gets a bitmap containing a tile specified using zoom level, x and y coordinates used as in Google Maps or OpenStreetMap.

This function works properly only if the map uses the Web Mercator projection.

◆ getTrack

- (CartoTypeGeometry *) getTrack

Returns the current track as a geometry object with coordinates in degrees. Each segment of the track is a contour in the geometry object.

◆ getView:coordType:

- (CTResult) getView: (CartoTypeRect *)  aView
coordType: (CartoTypeCoordType aCoordType 

Gets the current view coordinates in display pixels, map coordinates or lat/long.

◆ getViewState

- (CartoTypeViewState *) getViewState

Gets the current view state.

◆ greatCircleDistanceInMetersFrom:to:

+ (double) greatCircleDistanceInMetersFrom: (CartoTypePoint aStart
to: (CartoTypePoint aEnd 

Finds the great-circle distance in meters between two lat-long points in degrees, using the WGS84 ellipsoid.

◆ hasNotices

- (bool) hasNotices

Returns true if any notices such as a scale bar, legend or copyright notice exist.

◆ initWithMap:andStyle:andFont:andWidth:andHeight:

- (id) initWithMap: (NSString *)  aMapFileName
andStyle: (NSString *)  aStyleSheetFileName
andFont: (NSString *)  aFontFileName
andWidth: (int)  aWidth
andHeight: (int)  aHeight 

Initializes a new framework object.

aMapFileName is the file name of the main map. aStyleSheetFileName is the name of the style sheet file. aFontFileName is the name of the first font to be loaded. Other fonts may be loaded at any time. aWidth and aHeight are the width and height of the map in pixels.

Map, style sheet and font file names may be names of resources in the app's resource bundle, with no extension, or ordinary file paths with an extension. When loading resources from bundles, the extensions '.ctm1', '.xml', and '.ttf' are assumed for maps, style sheets and fonts respectively.

◆ initWithParam:

- (id) initWithParam: (CartoTypeFrameworkParam *)  aParam

Initializes a new framework object from a parameter object.

◆ insertCopyOfMapObject:map:layerName:radius:radiusCoordType:id:replace:

- (CartoTypeIdAndResult) insertCopyOfMapObject: (CartoTypeMapObject *)  aObject
map: (uint32_t)  aMapHandle
layerName: (NSString *)  aLayerName
radius: (double)  aRadius
radiusCoordType: (CartoTypeCoordType aRadiusCoordType
id: (uint64_t)  aId
replace: (bool)  aReplace 

Inserts an object by copying an existing object. If aRadius is greater than zero, converts the object to an envelope using the specified radius. Uses the supplied ID if aId is non-zero, otherwise generates an ID. This function fails if the map identified by aMapHandle is not writable. If the supplied ID is that of an existing object, the existing object is replaced if aReplace is true, otherwise the function fails and the result code CTErrorDuplicate is returned. The ID of the new object is returned in the id member of the return value.

◆ insertMapObject:

- (CTResult) insertMapObject: (CartoTypeMapObjectParam *)  aParam

Inserts an object into a writable map.

◆ insertPushPin:coordType:stringAttrib:color:iconChar:id:

- (CartoTypeIdAndResult) insertPushPin: (CartoTypePoint aPoint
coordType: (CartoTypeCoordType aCoordType
stringAttrib: (NSString *)  aStringAttrib
color: (NSString *)  aColor
iconChar: (int)  aIconCharacter
id: (uint64_t)  aId 

Inserts a pushpin: a point object belonging to the 'pushpin' layer. The pushpin is inserted into the built-in modifiable map.

If aColor is not empty it is used as the _color attribute, which, in the standard style sheet, causes the pushpin icon to be drawn in that color instead of the standard color.

If aIconCharacter is not zero it is used to set the _iconText attributes, which, in the standard style sheet, causes that character to be used as an icon. The MapKeyIcons font is supplied with CartoType and contains icons in the private-character range U+E002...U+E0B1.

If aId is zero, a new pushpin is inserted. If aId is non-zero, an existing pushpin with the specified ID, if any exists, is replaced. The ID of the new object is returned in the id member of the return value.

◆ intAttribute:withType:

+ (int) intAttribute: (NSString *)  aThreeLetterCode
withType: (int)  aType 

Constructs an integer attribute from an optional three-letter code, placed in the high 16 bits by encoding each letter in five bits, and a type number placed in the low 16 bits.

The three-letter code is used only if it consists of exactly three lower-case letters in the range a...z.

Three-letter codes are used for mnemonic purposes, as for example "pub" for a public house, and can be tested easily in style sheets.

◆ layerIsEnabled:

- (bool) layerIsEnabled: (NSString *)  aLayerName

Returns true if the named map layer is enabled, false otherwise.

◆ license:

- (CTResult) license: (NSString *)  aKey

Supplies a license key to enable the licensed version of the CartoType library.

◆ licensee

- (NSString *) licensee

Returns the name of the licensee. Returns "no licensee: for evaluation only" if there is no licensee.

◆ loadFont:

- (CTResult) loadFont: (NSString *)  aFontFileName

Loads a font in addition to any fonts already loaded. The font file name may be the name of a resource in the app's resource bundle, with no extension ('.ttf' is assumed), or an ordinary file path with an extension.

◆ loadIcon:id:hotSpot:labelPos:labelMaxlength:

- (CTResult) loadIcon: (NSString *)  aFileName
id: (NSString *)  aId
hotSpot: (CartoTypePoint aHotSpot
labelPos: (CartoTypePoint aLabelPos
labelMaxlength: (int)  aLabelMaxLength 

Loads an icon from a file. It will be used whenever the ID aId is referenced in the style sheet, overriding any icon specified in the style sheet.

The icon file may be in PNG or JPEG format.

aHotSpot is the point, relative to the top left corner of the icon, that should be made to coincide with the point of interest marked by the icon.

aLabelPos is the point, relative to the hot spot, at which the center of the baseline of any label text is placed.

aLabelMaxLength is the maximum length of label text in pixels. Labels too long to be drawn on the icon are drawn next to it.

◆ loadMap:

- (CTResult) loadMap: (NSString *)  aMapFileName

Loads a map in addition to any maps already loaded. The map file name may be the name of a resource in the app's resource bundle, with no extension ('.ctm1' is assumed), or an ordinary file path with an extension.

◆ loadMapObjectFromMap:withID:

- (CartoTypeMapObject *) loadMapObjectFromMap: (uint32_t)  aMapHandle
withID: (uint64_t)  aObjectId 

Loads a map object identified by its map handle and object ID. Returns nil if the object is not found.

◆ loadNavigationData

- (CTResult) loadNavigationData

Loads navigation data for the current map. This function need not be called; if it is not called, navigation data will be loaded automatically when it is first needed. It is provided so that the time overhead of loading navigation data can be incurred at a predictable stage, for example at application startup.

No error is returned if navigation data has already been loaded.

◆ locale

- (NSString *) locale

Gets the locale used for map object names (e.g., road names) in routing and geocoding. If no locale is in use an empty string is returned.

◆ makeColor:

+ (CartoTypeColor) makeColor: (NSString *)  aColor

Constructs a CartoType color value, which is a 32-bit integer, from a string; see the CartoType style sheet documentation for details of the format.

◆ makeColorR:G:B:A:

+ (CartoTypeColor) makeColorR: (int)  aR
G: (int)  aG
B: (int)  aB
A: (int)  aA 

Constructs a CartoType color, represented as a 32-bit integer holding 8 bits each for the red, green, blue and alpha values.

◆ mapCount

- (size_t) mapCount

Returns the number of maps currently loaded, including the main map and the in-memory map database.

◆ mapIsEmpty:

- (bool) mapIsEmpty: (uint32_t)  aHandle

Returns true if a map, identified by its handle, is empty.

◆ mapMetaData:

- (CartoTypeMapMetaData *) mapMetaData: (uint32_t)  aIndex

Returns the metadata for a map, identified by its index, if available. Returns null if no metadata is available. Metadata is currently available only for CTM1 maps.

◆ metersToPixels:

- (double) metersToPixels: (double)  aMeters

Converts a distance in map meters (projected meters) to pixels.

◆ navigate:

- (CTResult) navigate: (CartoTypeNavigationData *)  aNavData

Updates the vehicle position and, if navigating, updates the navigation state.

In order to implement turn-by-turn navigation, you should call navigate at frequent intervals (once per second is good enough) after creating a route using startNavigation, readRouteFromXml, etc.

When not navigating, you may call this function to update the vehicle position if necessary (i.e., if the current follow mode displays the vehicle position: see setFollowMode).

aNavData->validity is a set of bit flags, ORed together, which determines which of the other parameters are valid. The bit flags are the constants KTimeValid, KPositionValid, KSpeedValid, KCourseValid, and KHeightValid. For normal navigation not all the data is necessary: you need supply the time and position only. Other data, if available, helps the navigation system decide which road the vehicle is on, and extrapolate positions. The height (elevation above sea level) is not currently used.

aNavData->time is the time in seconds since midnight, 1st January 1970.

aNavData->longitude and aNavData->latitude are the location in degrees longitude and latitude, using the WGS84 datum.

aNavData->speed is the speed in kilometers per hour.

aNavData->course is the true course in degrees, where 0 is north, and degrees increase clockwise; 90 is east, 180 is south, and 270 is west.

aNavData->height is the height above sea level in meters.

If the position is invalid, navigate guesses the position by extrapolating from the current speed, if known, and the previous position.

After navigate has been called, the map position, rotation or zoom will change according to the current follow mode (see setFollowMode).

If you are not using graphics acceleration you should redraw the map after calling this function.

◆ navigating

- (bool) navigating

Returns true if navigation is happening. This state occurs between calls to startNavigation and endNavigation.

◆ navigationEnabled

- (bool) navigationEnabled

Returns true if navigation is enabled, false otherwise.

◆ panFrom:fromCoordType:to:toCoordType:

- (CTResult) panFrom: (CartoTypePoint aFrom
fromCoordType: (CartoTypeCoordType aFromCoordType
to: (CartoTypePoint aTo
toCoordType: (CartoTypeCoordType aToCoordType 

Pans (slides) the map so that the position aFrom moves to aTo.

◆ panX:andY:

- (CTResult) panX: (int)  aDx
andY: (int)  aDy 

Pans (slides) the map by a certain distance in pixels, horizontally or vertically or both.

◆ pixelsToMeters:

- (double) pixelsToMeters: (double)  aPixels

Converts a distance in pixels to map meters (projected meters).

◆ pointAtAzimuthFrom:dir:distance:

+ (CartoTypePoint) pointAtAzimuthFrom: (CartoTypePoint aPoint
dir: (double)  aDir
distance: (double)  aDistanceInMeters 

Finds the point in degrees at a certain distance and azimuth direction from a starting point. This function uses the WGS84 ellipsoid.

◆ preferredRouterType

- (CartoTypeRouterType) preferredRouterType

Returns the preferred type of router to be used for calculating routes.

◆ range:point:coordType:timeOrDistance:isTime:

- (CartoTypeGeometry *) range: (CartoTypeRouteProfile *)  aProfile
point: (CartoTypePoint aPoint
coordType: (CartoTypeCoordType aCoordType
timeOrDistance: (double)  aTimeOrDistance
isTime: (bool)  aIsTime 

Returns the range: a polygon containing the area reachable within a certain time in seconds or distance in meters.

Uses the supplied route profile if it is non-null, otherwise the current profile. If a time is supplied, the profile's bonuses and penalties are suppressed. If a distance is supplied, shortest routes are used. You can optionally insert the returned CartoTypeGeometry object into the map using insertMapObject.

◆ readGpx:file:

- (CTResult) readGpx: (uint32_t)  aMapHandle
file: (NSString *)  aFileName 

Reads route and track objects from a GPX file and inserts them into the map identified by aMapHandle. This function fails if the map is not writable.

Waypoint objects (wpt) are made into points in the gpx/wpt layer. Route objects (rte) are made into lines in the gpx/rte layer. Track objects (trk) are made into lines in the gpx/trk layer.

◆ readMap:data:

- (CTResult) readMap: (uint32_t)  aHandle
data: (NSData *)  aData 

Reads map data from aData in CTMS format and merges it into the map identified by aHandle, which must refer to a writable map database.

◆ readMap:fileName:fileType:

- (CTResult) readMap: (uint32_t)  aHandle
fileName: (NSString *)  aFileName
fileType: (CartoTypeFileType aFileType 

Reads map data from the format given by aFileType and merges it into the map identified by aHandle. Only writable map databases may be modified in this way. Only the CTMS (CartoType Map Serialized) and Keyhole Markup Language (KML) formats are supported.

◆ readProfileFromXmlFile:filename:

+ (CTResult) readProfileFromXmlFile: (CartoTypeRouteProfile *)  aProfile
filename: (NSString *)  aFileName 

Reads a route profile from a file in XML form.

◆ readProfileFromXmlString:filename:

+ (CTResult) readProfileFromXmlString: (CartoTypeRouteProfile *)  aProfile
filename: (NSString *)  aString 

Reads a route profile from a string in XML form.

◆ readRouteFromXml:replace:

- (CTResult) readRouteFromXml: (NSString *)  aFileNameOrData
replace: (bool)  aReplace 

Reads a route from XML (a GPX file or a CartoType route file) and displays it. aFileNameOrData is treated as XML data if it starts with a less-than sign.

If aReplace is true, deletes all current routes, adds the new route and makes its profile the current profile. If aReplace is false, appends the new route to the list of current routes.

Appending a route fails if the new route has a different start and end point, or intermediate waypoints, from the current routes.

This function resets the navigation state and enables navigation.

◆ reloadStyleSheet

- (CTResult) reloadStyleSheet

Reloads a sheet from the file it was originally loaded from. This function can be used to apply changes after a style sheet is modified.

◆ reverseRoutes

- (CTResult) reverseRoutes

Reverses the order of the current route points, recreates the route or routes, and displays them on the map. The two directions of the same route may not follow the same path because of one-way streets and turn restrictions.

◆ rotate:

- (CTResult) rotate: (double)  aAngle

Rotates the map about its center by an angle in degrees.

◆ rotateAt:x:y:coordType:

- (CTResult) rotateAt: (double)  aAngle
x: (double)  aX
y: (double)  aY
coordType: (CartoTypeCoordType aCoordType 

Rotates the map about a specified point by an angle given in degrees.

◆ routeAccess:coordType:

- (CartoTypeRouteAccess) routeAccess: (CartoTypePoint aPoint
coordType: (CartoTypeCoordType aCoordType 

Returns the accessibility of a point for routing purposes. A point is defined as accessible if it is connected to at least 1000 other route segments.

◆ saveMap:fileName:fileType:

- (CTResult) saveMap: (uint32_t)  aHandle
fileName: (NSString *)  aFileName
fileType: (CartoTypeFileType aFileType 

Saves a map identified by its handle by writing it in the specified format. Only writable map databases may be saved in this way. Only the CTMS (CartoType Map Serialized) and Keyhole Markup Language (KML) formats are supported.

◆ saveMap:param:

- (NSData *) saveMap: (uint32_t)  aHandle
param: (CartoTypeFindParam *)  aFindParam 

Saves selected objects to a map identified by its handle by writing them as an array of bytes in CTMS format. aFindParam can be used to select the objects to be saved. If an error occurs the return value is a single-byte data object containing the error code.

◆ scaleDenominatorFromZoomLevel:forImageSize:

- (double) scaleDenominatorFromZoomLevel: (double)  aZoomLevel
forImageSize: (int)  aImageSizeInPixels 

Calculates the scale denominator at the equator for a certain Open Street Map zoom level (0 maps the length of the equator to aImageSizeInPixels pixels, 1 = half the length of the equator, etc.).

◆ setAnimateTransitions:

- (bool) setAnimateTransitions: (bool)  aSet

Enables or disables smoothly animated transitions in graphics-accelerated drawing. Returns the previous enabled state.

◆ setAttributeInString:withKey:andValue:

+ (NSString *) setAttributeInString: (NSString *)  aString
withKey: (NSString *)  aKey
andValue: (NSString *)  aValue 

Treating a string as a set of map object attributes of the form label|key1=value1|key2=value2| ... |keyN=valueN, where | is character code 0, sets a named attribute. An empty or zero-length name sets the label. An empty or zero-length value deletes a name-value pair.

This function allows you to create a string containing multiple attributes when adding a new map object at run-time.

Any of aString, aKey and aValue may be null.

A new string with the new key-value pair is returned.

◆ setBlendStyle:

- (NSMutableArray< CartoTypeBlendStyle * > *) setBlendStyle: (NSMutableArray< CartoTypeBlendStyle * > *)  aBlendStyleSet

Sets a blend style, or, if aBlendStyleSet is null or empty, removes the current blend style. If night mode is on, night mode is turned off and replaced by the specified blend style or by no blend style. Returns the previous blend style, which is empty if none is in force.

◆ setBuiltInProfile:

- (CTResult) setBuiltInProfile: (int)  aIndex

Selects a built-in routing profile by its index; returns an error code if the index is out of range. Routers allowing an arbitrary profile to be set have no built-in profiles. The contraction hierarchy router has one or more built-in profiles.

◆ setCase:case:

- (NSString *) setCase: (NSString *)  aString
case: (CartoTypeLetterCase aCase 

Sets the letter case of a string.

Supports all UTF-16 characters. Uses the title-case exception dictionary to prevent words like 'of' being capitalised. Returns the modified string. Does not change aString.

◆ setColor:A:

+ (CartoTypeColor) setColor: (CartoTypeColor aColor
A: (int)  aAlpha 

Sets the alpha value of a color and returns the new color value.

◆ setCopyrightNotice

- (void) setCopyrightNotice

Sets the copyright notice displayed at the bottom-right corner of the map to that of the main map database.

◆ setCopyrightNotice:

- (void) setCopyrightNotice: (NSString *)  aCopyright

Sets the copyright notice displayed at the bottom-right corner of the map.

◆ setDraw3DBuildings:

- (bool) setDraw3DBuildings: (bool)  aSet

Enables or disables the drawing of 3D buildings where data is available. Returns the previous enabled state.

◆ setFollowMode:

- (CTResult) setFollowMode: (CartoTypeFollowMode aFollowMode

Sets the follow mode, which controls the way the map tracks the user location and heading.

◆ setLegend:width:unit:extendedPosition:

- (void) setLegend: (CartoTypeLegend *)  aLegend
width: (double)  aWidth
unit: (NSString *)  aUnit
extendedPosition: (CartoTypeExtendedNoticePosition *)  aPosition 

Sets the legend: map key or scale or both.

◆ setLegend:width:unit:position:

- (void) setLegend: (CartoTypeLegend *)  aLegend
width: (double)  aWidth
unit: (NSString *)  aUnit
position: (CartoTypeNoticePosition aPosition 

Sets the legend: map key or scale or both.

◆ setLocale:

- (void) setLocale: (NSString *)  aLocale

Sets the locale used for map object names (e.g., road names) in routing and geocoding. A locale is usually a two-letter language code like "en" (English) or "fr" (French). If the locale is null or empty, standard names are used.

◆ setLocationMatchParam:

- (void) setLocationMatchParam: (CartoTypeLocationMatchParam *)  aParam

Sets the current location match parameters. If aParam is null, default parameters are used. These parameters are used when creating routes in functions which do not receive explicit location match parameters. In functions which do receive location match parameters, any parameters with the value 0 are replaced by the current location match parameters set by this function.

◆ setMainProfile:

- (CTResult) setMainProfile: (CartoTypeRouteProfile *)  aProfile

Sets the main routing profile. If you do not call this function, the standard profile for private car routing is used.

This function has no effect if routing is performed on a map with a built-in contraction-hierarchy routing table (created using makemap /route=ch), because such a table is created using one or more fixed routing profiles which can be set in makemap. Use setBuiltInProfile for contraction hierarchy routing.

◆ setMainProfileType:

- (CTResult) setMainProfileType: (CartoTypeRouteProfileType aProfileType

Sets the main routing profile by type. By default a standard profile for private car routing is used. This function allows it to be changed.

◆ setMapsOverlap:

- (bool) setMapsOverlap: (bool)  aEnable

Determines whether newly loaded maps are allowed to overlap. Non-overlapping maps are clipped against other non-overlapping maps. This function does not affect maps already loaded. Returns the previous state.

◆ setMapWidth:andHeight:

- (CTResult) setMapWidth: (int)  aWidth
andHeight: (int)  aHeight 

Resizes a map, adjusting the projection such that the same map area is visible in the resized map.

◆ setNavigationAutoReRoute:

- (void) setNavigationAutoReRoute: (bool)  aAutoReRoute

Turns auto-re-routing in navigation on or off. By default it is turned on. If not, when re-routing is needed, the navigator state EReRouteNeededState is entered and the route is recalculated the next time a valid location is provided by a call to Navigate. This gives the application time to issue a warning if the routing algorithm is likely to be slow.

◆ setNavigationDistanceOffRouteTolerance:

- (void) setNavigationDistanceOffRouteTolerance: (int)  aMeters

Sets the maximum distance from the route in meters before the vehicle is deemed off-route when navigating.

◆ setNavigationMinimumFixDistance:

- (void) setNavigationMinimumFixDistance: (int)  aMeters

Sets the minimum distance between location fixes in meters that is taken as an actual move when navigating.

◆ setNavigationTimeOffRouteTolerance:

- (void) setNavigationTimeOffRouteTolerance: (int)  aSeconds

Sets the maximum time off route in seconds before a new route is calculated when navigating.

◆ setNavigatorParam:

- (void) setNavigatorParam: (CartoTypeNavigatorParam *)  aParam

Sets parameters affecting how navigation works.

◆ setNearbyObjectWarning:layer:condition:maxDistance:maxObjectCount:

- (uint32_t) setNearbyObjectWarning: (uint32_t)  aId
layer: (NSString *)  aLayer
condition: (NSString *)  aCondition
maxDistance: (double)  aMaxDistance
maxObjectCount: (int)  aMaxObjectCount 

Adds or replaces a nearby object warning. Objects found are added to the 'nearby' layer while the warning is in force. The attribute '_warning=0' is set.

Objects in aLayer, satisfying aCondition if it is not empty, and within aMaxDistance of the current point, are highlighted. The parameter aLayer may contain wild cards or end in a '/' sign.

The parameter aMaxObjectCount is the maximum number of objects to be found, which is clamped to the range 0...1024. If it is zero, the default of 32 is used. If more objects are actually found, the closest ones are used.

If aId is zero, a new warning is created. If aId is non-zero, the existing warning if any with an ID of aId is replaced. The ID of the new or replaced warning is returned. If aMaxDistance, which is in meters, is less than or equal to zero, it is set to the default distance of 1000, or 1km.

Returns 0 if no warning was created, which occurs if aLayer was empty, or the navigation system could not be created.

◆ setNightMode:

- (bool) setNightMode: (bool)  aSet

Sets night mode and returns the previous setting. In night mode the map is shaded dark blue and roads are made brighter than other features.

◆ setNightModeColor:

- (CartoTypeColor) setNightModeColor: (CartoTypeColor aColor

Sets the night mode color, which should be a dark color (although this is not enforced), and returns the previous night mode color.

To set a custom blend fraction, use the alpha value. For example, set the color's alpha value to 153 to blend the night mode color with a style color in the ratio 0.6 : 0.4 (153/255 = 0.6). Use an alpha value of 255 to get the default blend fraction.

Roads use the night mode color blended with 50% white, and half the specified blend fraction. This increases contrast between roads and other features.

◆ setPerspective:

- (void) setPerspective: (bool)  aSet

Turns perspective mode on or off.

◆ setPerspectiveParam:

- (void) setPerspectiveParam: (CartoTypePerspectiveParam *)  aParam

Turns perspective mode on and uses the supplied perspective parameters. Does nothing if aParam is null.

◆ setPreferredRouterType:

- (void) setPreferredRouterType: (CartoTypeRouterType aRouterType

Sets the preferred type of router to be used for calculating routes. Different routers have various advantages and disadvantages, such as using more or less memory, being faster or slower, or producing more useful routes.

Calling this function causes navigation data to be unloaded if the current navigation data uses a different type of router.

◆ setResolutionDpi:

- (void) setResolutionDpi: (double)  aDpi

Sets the display resolution used by CartoType in dots per inch. It has to be set correctly for map scaling and lettering to work properly.

◆ setRotation:

- (CTResult) setRotation: (double)  aAngle

Sets the map's orientation to an absolute angle in degrees.

◆ setRotationAt:x:y:coordType:

- (CTResult) setRotationAt: (double)  aAngle
x: (double)  aX
y: (double)  aY
coordType: (CartoTypeCoordType aCoordType 

Sets the map's orientation to a rotation about a specified point by an absolute angle given in degrees.

◆ setScaleBar:width:unit:extendedPosition:

- (void) setScaleBar: (bool)  aMetricUnits
width: (double)  aWidth
unit: (NSString *)  aUnit
extendedPosition: (CartoTypeExtendedNoticePosition *)  aPosition 

Creates a scale bar in either metric or imperial units (the first argument), with a specified width and position in the display.

◆ setScaleBar:width:unit:position:

- (void) setScaleBar: (bool)  aMetricUnits
width: (double)  aWidth
unit: (NSString *)  aUnit
position: (CartoTypeNoticePosition aPosition 

Creates a scale bar in either metric or imperial units (the first argument), with a specified width and position in the display.

◆ setScaleDenominator:

- (CTResult) setScaleDenominator: (double)  aScale

Sets the scale, supplying the denominator of the scale fraction. For example, to set the scale to 1:50,000 use the statement [my_framework SetScaleDenominator:50000].

◆ setScaleDenominatorInView:

- (CTResult) setScaleDenominatorInView: (double)  aScale

Sets the scale, supplying the denominator of the scale fraction, correcting for distortion introduced by the projection. For example, to set the scale to 1:50,000 use the statement [my_framework SetScaleDenominator:50000].

◆ setStyleSheet:

- (CTResult) setStyleSheet: (NSString *)  aStyleSheetFileName

Sets the current style sheet by loading it from a file. The style sheet file name may be the name of a resource in the app's resource bundle, with no extension ('.xml' is assumed), or an ordinary file path with an extension.

◆ setStyleSheetVariable:toInt:

- (void) setStyleSheetVariable: (NSString *)  aName
toInt: (int)  aValue 

Sets a variable used in conditional compilation of the style sheet to an integer value.

◆ setStyleSheetVariable:toString:

- (void) setStyleSheetVariable: (NSString *)  aName
toString: (NSString *)  aValue 

Sets a variable used in conditional compilation of the style sheet to a string value.

◆ setTileOverSizeZoomLevels:

- (int) setTileOverSizeZoomLevels: (int)  aLevels

Sets the number of zoom levels by which to zoom out when creating a tile bitmap returned by getTileBitmapWithSize.

The number may be 0, 1, or 2. If it is 0, each tile is self-contained. If it is 1, each tile is cut from a larger tile containing four tiles. If it is 2, each tile is cut from a larger tile containing sixteen tiles. The values 1 and 2 are useful in allowing longer labels to be used when creating small tiles; if not, many street labels will not be drawn because the street is cut in two by the tile border and the resulting sections are too short.

The return value is the previous setting.

◆ setTurnInstructions:abbreviate:width:widthUnit:extendedPosition:textSize:textSizeUnit:

- (CTResult) setTurnInstructions: (bool)  aMetricUnits
abbreviate: (bool)  aAbbreviate
width: (double)  aWidth
widthUnit: (NSString *)  aWidthUnit
extendedPosition: (CartoTypeExtendedNoticePosition *)  aPosition
textSize: (double)  aTextSize
textSizeUnit: (NSString *)  aTextSizeUnit 

Creates turn instructions in either metric or imperial units, with a specified text wrap width and position in the display.

◆ setTurnInstructions:abbreviate:width:widthUnit:position:textSize:textSizeUnit:

- (CTResult) setTurnInstructions: (bool)  aMetricUnits
abbreviate: (bool)  aAbbreviate
width: (double)  aWidth
widthUnit: (NSString *)  aWidthUnit
position: (CartoTypeNoticePosition aPosition
textSize: (double)  aTextSize
textSizeUnit: (NSString *)  aTextSizeUnit 

Creates turn instructions in either metric or imperial units, with a specified text wrap width and position in the display.

◆ setTurnInstructionText:

- (void) setTurnInstructionText: (NSString *)  aText

Sets the instruction to be displayed for the current turn, overriding automatically generated instructions. To revert to automatically generated instructions, call this function with empty or null text. This function has no effect if turn instructions have not been created using setTurnInstructions, or have been disabled by calling enableTurnInstructions(false).

◆ setVehiclePosOffsetX:andY:

- (void) setVehiclePosOffsetX: (double)  aXOffset
andY: (double)  aYOffset 

Sets the vehicle position when navigating as an offset from the center of the display, in units of the width and height of the display. For example, to show the vehicle in the middle but three quarters of the way down the display, use (0,0.25).

◆ setVehicleTypeWarning:maxObjectCount:

- (uint32_t) setVehicleTypeWarning: (double)  aMaxDistance
maxObjectCount: (int)  aMaxObjectCount 

Adds a vehicle type warning and returns its ID. Road sections illegal for the current vehicle weight, dimensions or cargo type are found.

Objects found are added to the 'nearby' layer while the warning is in force. The attribute '_warning=1' is set.

The parameter aMaxObjectCount is the maximum number of objects to be found, which is clamped to the range 0...1024. If it is zero, the default of 32 is used. If more objects are actually found, the closest ones are used.

If there is already a vehicle type warning it is replaced by this one.

Returns 0 if no warning was created, which occurs if aLayer was empty, or the navigation system could not be created.

◆ setView:

- (CTResult) setView: (CartoTypeViewState *)  aViewState

Sets the view to the supplied view state.

◆ setView:coordType:margin:minScale:

- (CTResult) setView: (CartoTypeRect aView
coordType: (CartoTypeCoordType aCoordType
margin: (int)  aMarginInPixels
minScale: (int)  aMinScaleDenominator 

Sets the view area of the map. specifying the coordinate type, which may be display pixels, map coordinates or latitude and longitude. The projection is scaled and shifted so that the projected map will contain the specified area.

You can also specify a margin in pixels around the display area, and a minimum scale denominator to ensure that when displaying a small map object the map is not zoomed right in to it.

◆ setView:margin:minScale:

- (CTResult) setView: (CartoTypeGeometry *)  aGeometry
margin: (int)  aMarginInPixels
minScale: (int)  aMinScaleDenominator 

Sets the view to show certain geometry, with a margin in pixels, and at a minimum scale.

◆ setViewCenter:coordType:

- (CTResult) setViewCenter: (CartoTypePoint aCenter
coordType: (CartoTypeCoordType aCoordType 

Sets the center of the map to the position aCenter, specifying the coordinate type, which may be display pixels, map coordinates or latitude and longitude.

◆ setViewLimitsToMinScale:maxScale:panArea:

- (CTResult) setViewLimitsToMinScale: (double)  aMinScaleDenominator
maxScale: (double)  aMaxScaleDenominator
panArea: (CartoTypeGeometry *)  aPanArea 

Sets the limits to zooming and panning.

Zooming is restricted to the range between aMinScaleDenominator and aMaxScaleDenominator, and panning is restricted so that the edges of the display always touch the bounds of aPanArea.

Use the value zero to remove either or both of the two zoom limits. Use an empty (not null) geometry object to remove panning limits. Use a null geometry object to limit panning to the extent of the map.

◆ setViewObject:margin:minScale:

- (CTResult) setViewObject: (CartoTypeMapObject *)  aMapObject
margin: (int)  aMarginInPixels
minScale: (int)  aMinScaleDenominator 

Sets the view to show a single map object, with a margin in pixels, and at a minimum scale.

◆ setViewObjects:margin:minScale:

- (CTResult) setViewObjects: (NSArray< CartoTypeMapObject * > *)  aObjectArray
margin: (int)  aMarginInPixels
minScale: (int)  aMinScaleDenominator 

Sets the view to show a group of map objects, with a margin in pixels, and at a minimum scale.

◆ setViewToRoute:margin:minScale:

- (CTResult) setViewToRoute: (int)  aRouteIndex
margin: (int)  aMarginInPixels
minScale: (int)  aMinScaleDenominator 

Sets the view to one of the current routes, selected by its index (0 means the main route), with a margin in pixels, and at a minimum scale. This function does nothing if the selected route doesn't exist.

◆ setViewToWholeMap

- (CTResult) setViewToWholeMap

Shows the whole map, zooming out as far as necessary.

◆ startNavigation:

- (CTResult) startNavigation: (CartoTypeRouteCoordSet *)  aCoordSet

Starts navigation through a set of at least two points, taken in order, and causes a route to be calculated and displayed.

◆ startNavigationFrom:startCoordType:to:endCoordType:

- (CTResult) startNavigationFrom: (CartoTypePoint aStart
startCoordType: (CartoTypeCoordType aStartCoordType
to: (CartoTypePoint aEnd
endCoordType: (CartoTypeCoordType aEndCoordType 

Starts navigation from a start point to an end point, which may be in different coordinate systems, and causes a route to be calculated and displayed.

◆ startTracking

- (void) startTracking

Starts tracking (storing and displaying track points) and starts a new track segment. If tracking is turned on, a track point is added every time a new position fix is supplied using Navigate, if the position is far enough from the previous track point.

◆ timeAndDistanceMatrix:to:

- (CartoTypeTimeAndDistanceMatrix *) timeAndDistanceMatrix: (CartoTypePointSet *)  aFrom
to: (CartoTypePointSet *)  aTo 

Returns an object containing route times in seconds and distances in metres from aFrom to all points in aTo. The two point sets must use the same coordinate type. If routing fails for any pair of points the time and distance are set to UINT32_MAX. It is legal for aFrom to refer to the same vector as aTo. Times and distances where the start and end point are the same are set to zero.

◆ timeToString:

- (NSString *) timeToString: (double)  aTimeInSeconds

Returns a time duration as a string containing locale-dependent words for hours, minutes and seconds.

◆ tracking

- (bool) tracking

Returns true if tracking (storing and displaying track points) is on.

◆ trackLengthInMeters

- (double) trackLengthInMeters

Returns the length of the current track in meters.

◆ turnInstructionText

- (NSString *) turnInstructionText

Gets the instruction to be displayed for the current turn. This function returns an empty string if turn instructions have not been created using setTurnInstructions.

◆ unloadMapByHandle:

- (CTResult) unloadMapByHandle: (uint32_t)  aHandle

Unloads a map, selecting it by handle. It is illegal to unload the main map database or the in-memory database.

◆ useRoute:replace:

- (CTResult) useRoute: (CartoTypeRoute *)  aRoute
replace: (bool)  aReplace 

Loads an existing route and displays it.

If aReplace is true, deletes all current routes and adds the new route. If aReplace is false, appends the new route to the list of current routes.

Appending a route fails if the new route has a different start and end point, or intermediate waypoints, from the current routes.

This function resets the navigation state.

◆ useSerializedNavigationData:

- (void) useSerializedNavigationData: (bool)  aEnable

Enables or disables the use of serialized navigation data, which is loaded at high speed from the main database. The only disadvantage is that using serialized data means that routing data is not loaded from the auxiliary databases if any.

Serialized data is enabled by default.

This function affects following calls to functions which explicitly load navigation data, or functions which start navigation and thus implicitly load navigation data if it has not already been loaded.

◆ version

+ (NSString *) version

Returns the current CartoType version as a string of the form MAJOR.MINOR.

◆ writeMapImage:fileType:compress:

- (CTResult) writeMapImage: (NSString *)  aFileName
fileType: (CartoTypeFileType aFileType
compress: (bool)  aCompress 

Writes a map image to a file of the specified type. Only the PNG file type is supported. If aCompress is true, uses lossy compression to reduce the file size. For PNG files compression is achieved by palettization.

◆ writeProfileAsXmlFile:filename:

+ (CTResult) writeProfileAsXmlFile: (CartoTypeRouteProfile *)  aProfile
filename: (NSString *)  aFileName 

Writes a route profile to a file in XML form.

◆ writeProfileAsXmlString:

+ (NSString *) writeProfileAsXmlString: (CartoTypeRouteProfile *)  aProfile

Writes a route profile to a string in XML form.

◆ writeRouteAsXml:file:fileType:

- (CTResult) writeRouteAsXml: (CartoTypeRoute *)  aRoute
file: (NSString *)  aFileName
fileType: (CartoTypeFileType aFileType 

Writes a route as XML in the format selected by aFileType: CartoTypeRouteFileType or GpxFileType.

◆ writeRouteAsXmlString:fileType:

- (NSString *) writeRouteAsXmlString: (CartoTypeRoute *)  aRoute
fileType: (CartoTypeFileType aFileType 

Writes a route as an XML string, in the format selected by aFileType: CartoTypeRouteFileType or GpxFileType.

◆ writeTrackAsXml:

- (CTResult) writeTrackAsXml: (NSString *)  aFileName

Writes the current track to a file as XML in GPX format.

◆ writeTrackAsXmlString

- (NSString *) writeTrackAsXmlString

Writes the current track to a string as XML in GPX format.

◆ zoom:

- (CTResult) zoom: (double)  aZoomFactor

Zooms in by a specified zoom factor, or zooms out if the zoom factor is less than 1.

◆ zoomAt:x:y:coordType:

- (CTResult) zoomAt: (double)  aZoomFactor
x: (double)  aX
y: (double)  aY
coordType: (CartoTypeCoordType aCoordType 

Zooms in by a specified zoom factor, or zooms out if the zoom factor is less than 1, centering the zoom at the specified position, so that it remains at the same place on the display. This function does not zoom in beyond the minimum scale denominator (500) or zoom out beyond the maximum scale denominator (1,000,000,000) or beyond a size where the map occupies the whole display.

◆ zoomLevelFromScaleDenominator:forImageSize:

- (double) zoomLevelFromScaleDenominator: (double)  aScaleDenominator
forImageSize: (int)  aImageSizeInPixels 

Calculates the Open Street Map zoom level (0 maps the length of the equator to aImageSizeInPixels pixels, 1 = half the length of the equator, etc.) for a certain scale denominator.


The documentation for this class was generated from the following file: