CartoType C++ API 7.8.2, 2022-03-25
for Windows, Linux, Qt and other platforms supporting C++ development
|
#include <cartotype_framework.h>
Classes | |
class | TParam |
Public Member Functions | |
std::unique_ptr< CFramework > | Copy (TResult &aError, bool aFull=true) const |
TResult | License (const CString &aKey) |
TResult | License (const uint8_t *aKey, size_t aKeyLength) |
std::string | Licensee () const |
std::string | ExpiryDate () const |
std::string | AppBuildDate () const |
uint8_t | License () const |
CString | Copyright () const |
void | SetCopyrightNotice () |
void | SetCopyrightNotice (const CString &aCopyright) |
void | SetLegend (std::unique_ptr< CLegend > aLegend, double aWidth, const char *aUnit, const TExtendedNoticePosition &aPosition) |
void | SetLegend (const CLegend &aLegend, double aWidth, const char *aUnit, const TExtendedNoticePosition &aPosition) |
void | EnableLegend (bool aEnable) |
void | SetScaleBar (bool aMetricUnits, double aWidth, const char *aUnit, const TExtendedNoticePosition &aPosition) |
void | EnableScaleBar (bool aEnable) |
TResult | SetTurnInstructions (bool aMetricUnits, bool aAbbreviate, double aWidth, const char *aUnit, const TExtendedNoticePosition &aPosition, double aTextSize=7, const char *aTextSizeUnit="pt") |
void | EnableTurnInstructions (bool aEnable) |
void | SetTurnInstructionText (const CString &aText) |
CString | TurnInstructionText () |
void | DrawNoticesAutomatically (bool aEnable) |
bool | HasNotices () const |
CPositionedBitmap | GetNoticeBitmap () |
TResult | Configure (const CString &aFilename) |
TResult | LoadMap (const CString &aMapFileName, const std::string *aEncryptionKey=nullptr) |
bool | SetMapsOverlap (bool aEnable) |
TResult | CreateWritableMap (TWritableMapType aType, CString aFileName=nullptr) |
TResult | SaveMap (uint32_t aHandle, const CString &aFileName, TFileType aFileType) |
TResult | ReadMap (uint32_t aHandle, const CString &aFileName, TFileType aFileType) |
TResult | SaveMap (uint32_t aHandle, std::vector< uint8_t > &aData, const TFindParam &aFindParam) |
TResult | ReadMap (uint32_t aHandle, const std::vector< uint8_t > &aData) |
TResult | WriteMapImage (const CString &aFileName, TFileType aFileType, bool aCompress=false) |
bool | MapIsEmpty (uint32_t aHandle) |
size_t | MapCount () const |
uint32_t | MapHandle (size_t aIndex) const |
bool | MapIsWritable (size_t aIndex) const |
std::unique_ptr< CMapMetaData > | MapMetaData (size_t aIndex) const |
TResult | UnloadMapByHandle (uint32_t aHandle) |
TResult | EnableMapByHandle (uint32_t aHandle, bool aEnable) |
TResult | EnableAllMaps () |
uint32_t | GetLastMapHandle () const |
uint32_t | GetMainMapHandle () const |
uint32_t | GetMemoryMapHandle () const |
TResult | LoadFont (const CString &aFontFileName) |
TResult | LoadFont (const uint8_t *aData, size_t aLength, bool aCopyData) |
TResult | SetStyleSheet (const CString &aStyleSheetFileName, size_t aIndex=0) |
TResult | SetStyleSheet (const uint8_t *aData, size_t aLength, size_t aIndex=0) |
TResult | SetStyleSheet (const CStyleSheetData &aStyleSheetData, size_t aIndex=0) |
TResult | SetStyleSheet (const CStyleSheetDataArray &aStyleSheetDataArray, const CVariableDictionary *aStyleSheetVariables=nullptr, const TBlendStyleSet *aBlendStyleSet=nullptr) |
TResult | ReloadStyleSheet (size_t aIndex=0) |
TResult | AppendStyleSheet (const CString &aStyleSheetFileName) |
TResult | AppendStyleSheet (const uint8_t *aData, size_t aLength) |
TResult | DeleteStyleSheet (size_t aIndex) |
std::string | GetStyleSheetText (size_t aIndex) const |
CStyleSheetData | GetStyleSheetData (size_t aIndex) const |
const CStyleSheetDataArray & | GetStyleSheetDataArray () const |
const CVariableDictionary & | GetStyleSheetVariables () const |
bool | SetNightMode (bool aSet) |
TColor | SetNightModeColor (TColor aColor) |
bool | NightMode () const |
TColor | NightModeColor () const |
TBlendStyleSet | SetBlendStyle (const TBlendStyleSet *aBlendStyleSet) |
TBlendStyleSet | BlendStyleSet () const |
TFileLocation | StyleSheetErrorLocation () const |
TResult | Resize (int32_t aViewWidth, int32_t aViewHeight) |
void | SetResolutionDpi (double aDpi) |
double | ResolutionDpi () const |
TResult | SetScaleDenominator (double aScale) |
double | ScaleDenominator () const |
double | MapUnitSize () const |
TResult | SetScaleDenominatorInView (double aScale) |
double | GetScaleDenominatorInView () const |
double | GetDistanceInMeters (double aX1, double aY1, double aX2, double aY2, TCoordType aCoordType) const |
double | ScaleDenominatorFromZoomLevel (double aZoomLevel, int32_t aImageSizeInPixels=256) const |
double | ZoomLevelFromScaleDenominator (double aScaleDenominator, int32_t aImageSizeInPixels=256) const |
void | SetPerspective (bool aSet) |
void | SetPerspective (const TPerspectiveParam &aParam) |
bool | Perspective () const |
TPerspectiveParam | PerspectiveParam () const |
TResult | Zoom (double aZoomFactor) |
TResult | ZoomAt (double aZoomFactor, double aX, double aY, TCoordType aCoordType) |
TResult | Rotate (double aAngle) |
TResult | RotateAt (double aAngle, double aX, double aY, TCoordType aCoordType) |
TResult | SetRotation (double aAngle) |
TResult | SetRotationAt (double aAngle, double aX, double aY, TCoordType aCoordType) |
double | Rotation () const |
TResult | RotateAndZoom (double aAngle, double aZoomFactor, double aX, double aY, TCoordType aCoordType) |
TResult | Pan (int32_t aDx, int32_t aDy) |
TResult | Pan (const TPoint &aFrom, const TPoint &aTo) |
TResult | Pan (double aFromX, double aFromY, TCoordType aFromCoordType, double aToX, double aToY, TCoordType aToCoordType) |
TResult | SetViewCenter (double aX, double aY, TCoordType aCoordType) |
TResult | SetView (double aMinX, double aMinY, double aMaxX, double aMaxY, TCoordType aCoordType, int32_t aMarginInPixels=0, int32_t aMinScaleDenominator=0) |
TResult | SetView (const CMapObject *const *aMapObjectArray, size_t aMapObjectCount, int32_t aMarginInPixels, int32_t aMinScaleDenominator) |
TResult | SetView (const CMapObjectArray &aMapObjectArray, int32_t aMarginInPixels, int32_t aMinScaleDenominator) |
TResult | SetView (const CMapObject &aMapObject, int32_t aMarginInPixels, int32_t aMinScaleDenominator) |
TResult | SetView (const CGeometry &aGeometry, int32_t aMarginInPixels, int32_t aMinScaleDenominator) |
TResult | SetView (const TViewState &aViewState) |
TResult | SetViewToRoute (size_t aRouteIndex, int32_t aMarginInPixels, int32_t aMinScaleDenominator) |
TResult | SetViewToWholeMap () |
TResult | GetView (double &aMinX, double &aMinY, double &aMaxX, double &aMaxY, TCoordType aCoordType) const |
TResult | GetView (TRectFP &aView, TCoordType aCoordType) const |
TResult | GetView (TFixedSizeContourFP< 4, true > &aView, TCoordType aCoordType) const |
TResult | GetMapExtent (double &aMinX, double &aMinY, double &aMaxX, double &aMaxY, TCoordType aCoordType) const |
TResult | GetMapExtent (TRectFP &aMapExtent, TCoordType aCoordType) const |
CString | GetProjectionAsProj4Param () const |
TViewState | ViewState () const |
TResult | SetViewLimits (double aMinScaleDenominator, double aMaxScaleDenominator, const CGeometry &aGeometry) |
TResult | SetViewLimits (double aMinScaleDenominator=0, double aMaxScaleDenominator=0) |
TResult | InsertMapObject (uint32_t aMapHandle, const CString &aLayerName, const CGeometry &aGeometry, const CString &aStringAttributes, uint32_t aIntAttribute, uint64_t &aId, bool aReplace) |
TResult | InsertPointMapObject (uint32_t aMapHandle, const CString &aLayerName, double aX, double aY, TCoordType aCoordType, const CString &aStringAttributes, uint32_t aIntAttribute, uint64_t &aId, bool aReplace) |
TResult | InsertCircleMapObject (uint32_t aMapHandle, const CString &aLayerName, double aCenterX, double aCenterY, TCoordType aCenterCoordType, double aRadius, TCoordType aRadiusCoordType, const CString &aStringAttributes, uint32_t aIntAttribute, uint64_t &aId, bool aReplace) |
TResult | InsertEnvelopeMapObject (uint32_t aMapHandle, const CString &aLayerName, const CGeometry &aGeometry, double aRadius, TCoordType aRadiusCoordType, const CString &aStringAttributes, uint32_t aIntAttribute, uint64_t &aId, bool aReplace) |
TResult | InsertPushPin (double aX, double aY, TCoordType aCoordType, const CString &aStringAttrib, const CString &aColor, int32_t aIconCharacter, uint64_t &aId) |
TResult | InsertCopyOfMapObject (uint32_t aMapHandle, const CString &aLayerName, const CMapObject &aObject, double aEnvelopeRadius, TCoordType aRadiusCoordType, uint64_t &aId, bool aReplace, CString aExtraStringAttributes=nullptr, const uint32_t *aIntAttribute=nullptr) |
TResult | DeleteMapObjects (uint32_t aMapHandle, uint64_t aStartId, uint64_t aEndId, uint64_t &aDeletedCount, CString aCondition=nullptr) |
std::unique_ptr< CMapObject > | LoadMapObject (TResult &aError, uint32_t aMapHandle, uint64_t aId) |
TResult | ReadGpx (uint32_t aMapHandle, const CString &aFileName) |
CGeometry | Range (TResult &aError, const TRouteProfile *aProfile, double aX, double aY, TCoordType aCoordType, double aTimeOrDistance, bool aIsTime) |
CTimeAndDistanceMatrix | TimeAndDistanceMatrix (TResult &aError, const std::vector< TPointFP > &aFrom, const std::vector< TPointFP > &aTo, TCoordType aCoordType) |
TRouteAccess | RouteAccess (TResult &aError, const TPointFP &aPoint, TCoordType aCoordType) |
void | EnableLayer (const CString &aLayerName, bool aEnable) |
bool | LayerIsEnabled (const CString &aLayerName) const |
void | SetDisabledLayers (const std::set< CString > &aLayerNames) |
std::vector< CString > | LayerNames () |
TResult | ConvertCoords (double *aCoordArray, size_t aCoordArraySize, TCoordType aFromCoordType, TCoordType aToCoordType) const |
TResult | ConvertCoords (const TWritableCoordSet &aCoordSet, TCoordType aFromCoordType, TCoordType aToCoordType) const |
template<class T > | |
TResult | ConvertCoords (CGeneralGeometry< T > &aGeometry, TCoordType aToCoordType) |
TResult | ConvertPoint (double &aX, double &aY, TCoordType aFromCoordType, TCoordType aToCoordType) const |
double | PixelsToMeters (double aPixels) const |
double | MetersToPixels (double aMeters) const |
CString | DataSetName () const |
TResult | EditSetWritableMap (uint32_t aMapHandle) |
TResult | EditNewLineObject (const TPointFP &aDisplayPoint) |
TResult | EditNewPolygonObject (const TPointFP &aDisplayPoint) |
TResult | EditMoveCurrentPoint (const TPointFP &aDisplayPoint) |
TResult | EditAddCurrentPoint () |
TResult | EditDeleteCurrentPoint () |
TResult | EditDeleteCurrentObject () |
TResult | EditSelectNearestPoint (const TPointFP &aDisplayPoint, double aRadiusInMillimeters) |
TResult | EditInsertCurrentObject (const CString &aLayer, uint64_t &aId, bool aReplace) |
TResult | EditSetCurrentObjectStringAttribute (const CString &aKey, const CString &aValue) |
TResult | EditSetCurrentObjectIntAttribute (uint32_t aValue) |
TResult | EditGetCurrentObjectAreaAndLength (double &aArea, double &aLength) const |
const TBitmap * | MapBitmap (TResult &aError, bool *aRedrawWasNeeded=nullptr) |
const TBitmap * | LabelBitmap (TResult &aError, bool *aRedrawWasNeeded=nullptr) |
const TBitmap * | MemoryDataBaseMapBitmap (TResult &aError, bool *aRedrawWasNeeded=nullptr) |
void | DrawNotices (CGraphicsContext &aGc) |
void | EnableDrawingMemoryDataBase (bool aEnable) |
void | ForceRedraw () |
bool | ClipBackgroundToMapBounds (bool aEnable) |
bool | DrawBackground (bool aEnable) |
int32_t | SetTileOverSizeZoomLevels (int32_t aLevels) |
TResult | DrawLabelsToLabelHandler (MLabelHandler &aLabelHandler, double aStyleSheetExclusionScale) |
bool | ObjectWouldBeDrawn (TResult &aError, uint64_t aId, TMapObjectType aType, const CString &aLayer, uint32_t aIntAttrib, const CString &aStringAttrib) |
bool | SetDraw3DBuildings (bool aEnable) |
bool | Draw3DBuildings () const |
bool | SetAnimateTransitions (bool aEnable) |
bool | AnimateTransitions () const |
TResult | LoadIcon (const CString &aFileName, const CString &aId, const TPoint &aHotSpot, const TPoint &aLabelPos) |
void | UnloadIcon (const CString &aId) |
CBitmap | TileBitmap (TResult &aError, int32_t aTileSizeInPixels, int32_t aZoom, int32_t aX, int32_t aY, const TTileBitmapParam *aParam=nullptr) |
CBitmap | TileBitmap (TResult &aError, int32_t aTileSizeInPixels, const CString &aQuadKey, const TTileBitmapParam *aParam=nullptr) |
CBitmap | TileBitmap (TResult &aError, int32_t aTileWidth, int32_t aTileHeight, const TRectFP &aBounds, TCoordType aCoordType, const TTileBitmapParam *aParam=nullptr) |
TResult | Find (CMapObjectArray &aObjectArray, const TFindParam &aFindParam) const |
TResult | Find (CMapObjectGroupArray &aObjectGroupArray, const TFindParam &aFindParam) const |
TResult | FindInDisplay (CMapObjectArray &aObjectArray, size_t aMaxObjectCount, double aX, double aY, double aRadius) const |
TResult | FindInLayer (CMapObjectArray &aObjectArray, size_t aMaxObjectCount, const CString &aLayer, double aMinX, double aMinY, double aMaxX, double aMaxY, TCoordType aCoordType) const |
TResult | FindText (CMapObjectArray &aObjectArray, size_t aMaxObjectCount, const CString &aText, TStringMatchMethod aMatchMethod, const CString &aLayers, const CString &aAttribs) const |
TResult | FindAddress (CMapObjectArray &aObjectArray, size_t aMaxObjectCount, const CAddress &aAddress, bool aFuzzy=false) const |
TResult | FindStreetAddresses (CMapObjectArray &aObjectArray, size_t aMaxObjectCount, const CAddress &aAddress, const CGeometry *aClip=nullptr) const |
TResult | FindAddressPart (CMapObjectArray &aObjectArray, size_t aMaxObjectCount, const CString &aText, TAddressPart aAddressPart, bool aFuzzy, bool aIncremental) const |
TResult | FindBuildingsNearStreet (CMapObjectArray &aObjectArray, const CMapObject &aStreet) const |
TResult | FindPolygonsContainingPath (CMapObjectArray &aObjectArray, const CGeometry &aPath, const TFindParam *aParam=nullptr) const |
TResult | FindPointsInPath (CMapObjectArray &aObjectArray, const CGeometry &aPath, const TFindParam *aParam=nullptr) const |
TResult | FindAsync (FindAsyncCallBack aCallBack, const TFindParam &aFindParam, bool aOverride=false) |
TResult | FindAsync (FindAsyncGroupCallBack aCallBack, const TFindParam &aFindParam, bool aOverride=false) |
TResult | FindAddressAsync (FindAsyncCallBack aCallBack, size_t aMaxObjectCount, const CAddress &aAddress, bool aFuzzy=false, bool aOverride=false) |
TResult | GeoCodeSummary (CString &aSummary, const CMapObject &aMapObject) const |
TResult | GeoCodeSummary (CString &aSummary, double aX, double aY, TCoordType aCoordType) const |
TResult | GetAddress (CAddress &aAddress, const CMapObject &aMapObject) const |
TResult | GetAddressFast (CAddress &aAddress, const CMapObject &aMapObject) const |
TResult | GetAddress (CAddress &aAddress, double aX, double aY, TCoordType aCoordType, bool aFullAddress=true) const |
std::vector< int32_t > | GetHeights (TResult &aError, const TCoordSet &aCoordSet, TCoordType aCoordType) const |
void | SetStyleSheetVariable (const CString &aVariableName, const CString &aValue) |
void | SetStyleSheetVariable (const CString &aVariableName, int32_t aValue) |
std::unique_ptr< CGraphicsContext > | CreateGraphicsContext (int32_t aWidth, int32_t aHeight) |
TFont | Font (const TFontSpec &aFontSpec) |
std::shared_ptr< CGraphicsContext > | GetMapGraphicsContext () |
void | SetPreferredRouterType (TRouterType aRouterType) |
TRouterType | PreferredRouterType () const |
TRouterType | ActualRouterType () const |
TResult | StartNavigation (double aStartX, double aStartY, TCoordType aStartCoordType, double aEndX, double aEndY, TCoordType aEndCoordType) |
TResult | StartNavigation (const TRouteCoordSet &aCoordSet) |
TResult | StartNavigation (const TCoordSet &aCoordSet, TCoordType aCoordType) |
void | EndNavigation () |
bool | EnableNavigation (bool aEnable) |
bool | NavigationEnabled () const |
TResult | LoadNavigationData () |
bool | NavigationDataHasGradients () const |
TResult | SetMainProfile (const TRouteProfile &aProfile) |
size_t | BuiltInProfileCount () |
const TRouteProfile * | BuiltInProfile (size_t aIndex) |
TResult | SetBuiltInProfile (size_t aIndex) |
TResult | AddProfile (const TRouteProfile &aProfile) |
TResult | ChooseRoute (size_t aRouteIndex) |
const TRouteProfile * | Profile (size_t aIndex) const |
bool | Navigating () const |
void | AddObserver (std::weak_ptr< MFrameworkObserver > aObserver) |
void | RemoveObserver (std::weak_ptr< MFrameworkObserver > aObserver) |
TPoint | RouteStart () |
TPoint | RouteEnd () |
TResult | DisplayRoute (bool aEnable=true) |
const CRoute * | Route () const |
const CRoute * | Route (size_t aIndex) const |
std::unique_ptr< CRoute > | CreateRoute (TResult &aError, const TRouteProfile &aProfile, const TRouteCoordSet &aCoordSet) |
std::unique_ptr< CRoute > | CreateRoute (TResult &aError, const TRouteProfile &aProfile, const TCoordSet &aCoordSet, TCoordType aCoordType) |
std::unique_ptr< CRoute > | CreateBestRoute (TResult &aError, const TRouteProfile &aProfile, const TRouteCoordSet &aCoordSet, bool aStartFixed, bool aEndFixed, size_t aIterations) |
std::unique_ptr< CRoute > | CreateBestRoute (TResult &aError, const TRouteProfile &aProfile, const TCoordSet &aCoordSet, TCoordType aCoordType, bool aStartFixed, bool aEndFixed, size_t aIterations) |
std::unique_ptr< CRoute > | CreateRouteFromXml (TResult &aError, const TRouteProfile &aProfile, const CString &aFileNameOrData) |
std::unique_ptr< CRoute > | CreateRouteHelper (TResult &aError, bool aBest, const TRouteProfile &aProfile, const TRouteCoordSet &aCoordSet, bool aStartFixed, bool aEndFixed, size_t aIterations) |
std::unique_ptr< CRoute > | CreateRouteHelper (TResult &aError, bool aBest, const TRouteProfile &aProfile, const std::vector< Router::TRoutePointInternal > &aRoutePointArray, bool aStartFixed, bool aEndFixed, size_t aIterations) |
TResult | CreateRouteAsync (RouterAsyncCallBack aCallback, const TRouteProfile &aProfile, const TRouteCoordSet &aCoordSet, bool aOverride=false) |
TResult | CreateBestRouteAsync (RouterAsyncCallBack aCallback, const TRouteProfile &aProfile, const TRouteCoordSet &aCoordSet, bool aStartFixed, bool aEndFixed, size_t aIterations, bool aOverride=false) |
TResult | CreateRouteAsyncHelper (RouterAsyncCallBack aCallback, bool aBest, const TRouteProfile &aProfile, const TRouteCoordSet &aCoordSet, bool aStartFixed, bool aEndFixed, size_t aIterations, bool aOverride=false) |
CString | RouteInstructions (const CRoute &aRoute) const |
TResult | UseRoute (const CRoute &aRoute, bool aReplace) |
TResult | ReadRouteFromXml (const CString &aFileNameOrData, bool aReplace) |
TResult | WriteRouteAsXml (const CRoute &aRoute, const CString &aFileName, TFileType aFileType=TFileType::CTROUTE) const |
TResult | WriteRouteAsXmlString (const CRoute &aRoute, std::string &aXmlString, TFileType aFileType=TFileType::CTROUTE) const |
const CRouteSegment * | CurrentRouteSegment () const |
const CRouteSegment * | NextRouteSegment () const |
size_t | RouteCount () const |
TResult | ReverseRoutes () |
TResult | DeleteRoutes () |
TRouteCreationData | RouteCreationData () const |
TResult | Navigate (const TNavigationData &aNavData) |
const TNavigatorTurn & | FirstTurn () const |
const TNavigatorTurn & | SecondTurn () const |
const TNavigatorTurn & | ContinuationTurn () const |
TNavigationState | NavigationState () const |
void | SetNavigatorParam (const TNavigatorParam &aParam) |
TNavigatorParam | NavigatorParam () const |
void | SetLocationMatchParam (const TLocationMatchParam &aParam) |
TLocationMatchParam | LocationMatchParam () const |
void | SetNavigationMinimumFixDistance (int32_t aMeters) |
void | SetNavigationTimeOffRouteTolerance (int32_t aSeconds) |
void | SetNavigationDistanceOffRouteTolerance (int32_t aMeters) |
void | SetNavigationAutoReRoute (bool aAutoReRoute) |
uint32_t | SetNearbyObjectWarning (TResult &aError, uint32_t aId, const CString &aLayer, const CString &aCondition, double aMaxDistance, size_t aMaxObjectCount) |
uint32_t | SetVehicleTypeWarning (TResult &aError, double aMaxDistance, size_t aMaxObjectCount) |
bool | DeleteNearbyObjectWarning (uint32_t aId) |
bool | ClearNearbyObjectWarnings () |
CMapObjectArray | CopyNearbyObjects () |
double | DistanceToDestination () |
double | EstimatedTimeToDestination () |
void | UseSerializedNavigationData (bool aEnable) |
TResult | FindNearestRoad (TNearestRoadInfo &aInfo, double aX, double aY, TCoordType aCoordType, double aHeadingInDegrees, bool aDisplayPosition) |
TResult | DisplayPositionOnNearestRoad (const TNavigationData &aNavData, TNearestRoadInfo *aInfo=nullptr) |
void | SetVehiclePosOffset (double aXOffset, double aYOffset) |
TResult | SetFollowMode (TFollowMode aFollowMode) |
TFollowMode | FollowMode () const |
TResult | GetNavigationPosition (TPointFP &aPos, TCoordType aCoordType) const |
TResult | GetNavigationData (TNavigationData &aData, double &aHeading) const |
void | SetLocale (const char *aLocale) |
std::string | Locale () const |
void | AppendDistance (MString &aString, double aDistanceInMeters, bool aMetricUnits, bool aAbbreviate=false) const |
CString | DistanceToString (double aDistanceInMeters, bool aMetricUnits, bool aAbbreviate=false) const |
void | AppendTime (MString &aString, double aTimeInSeconds) const |
CString | TimeToString (double aTimeInSeconds) const |
void | SetCase (MString &aString, TLetterCase aCase) |
void | AbbreviatePlacename (MString &aString) |
TResult | AddTrafficInfo (uint64_t &aId, const CTrafficInfo &aTrafficInfo, CLocationRef &aLocationRef) |
double | GetTrafficInfoSpeed (double aX, double aY, TCoordType aCoordType, uint32_t aVehicleTypes) |
TResult | AddPolygonSpeedLimit (uint64_t &aId, const CGeometry &aPolygon, double aSpeed, uint32_t aVehicleTypes) |
TResult | AddLineSpeedLimit (uint64_t &aId, const CGeometry &aLine, double aSpeed, uint32_t aVehicleTypes) |
TResult | AddClosedLineSpeedLimit (uint64_t &aId, const CGeometry &aLine, double aSpeed, uint32_t aVehicleTypes) |
TResult | AddForbiddenArea (uint64_t &aId, const CGeometry &aPolygon) |
TResult | DeleteTrafficInfo (uint64_t aId) |
void | ClearTrafficInfo () |
TResult | WriteTrafficMessageAsXml (MOutputStream &aOutput, const CTrafficInfo &aTrafficInfo, CLocationRef &aLocationRef) |
TResult | WriteLineTrafficMessageAsXml (MOutputStream &aOutput, const CTrafficInfo &aTrafficInfo, const CString &aId, const CRoute &aRoute) |
TResult | WriteClosedLineTrafficMessageAsXml (MOutputStream &aOutput, const CTrafficInfo &aTrafficInfo, const CString &aId, const CRoute &aRoute) |
bool | EnableTrafficInfo (bool aEnable) |
void | StartTracking () |
void | EndTracking () |
void | DeleteTrack () |
bool | Tracking () const |
TResult | DisplayTrack (bool aEnable) |
bool | TrackIsDisplayed () const |
CTrackGeometry | GetTrack () const |
double | TrackLengthInMeters () const |
TResult | WriteTrackAsXml (const CString &aFileName) const |
TResult | WriteTrackAsXmlString (std::string &aXmlString) const |
std::shared_ptr< CMapStyle > | CreateStyleSheet (double aScale) |
std::unique_ptr< CMapStore > | NewMapStore (std::shared_ptr< CMapStyle > aStyleSheet, const TRect &aBounds, bool aUseFastAllocator) |
CMapDataBase & | MainDb () const |
TTransform3D | MapTransform () const |
TTransform | MapTransform2D () const |
TTransform3D | PerspectiveTransform () const |
std::shared_ptr< CEngine > | Engine () const |
CMap & | Map () const |
TColor | OutlineColor () const |
std::unique_ptr< CFramework > | CreateLegendFramework (TResult &aError) |
std::unique_ptr< CBitmap > | CreateBitmapFromSvg (MInputStream &aInputStream, TFileLocation &aErrorLocation, int32_t aForcedWidth=0) |
void | SetUserData (std::shared_ptr< MUserData > aUserData) |
void | SetLabelUpAngleInRadians (double aAngle) |
void | SetLabelUpVector (TPointFP aVector) |
TPointFP | LabelUpVector () const |
size_t | RouteCalculationCost () const |
CMapDrawParam & | MapDrawParam () const |
double | PolygonArea (const TCoordSet &aCoordSet, TCoordType aCoordType) |
double | PolylineLength (const TCoordSet &aCoordSet, TCoordType aCoordType) |
TResult | GetAreaAndLength (const CGeometry &aGeometry, double &aArea, double &aLength) |
TResult | GetContourAreaAndLength (const CGeometry &aGeometry, size_t aContourIndex, double &aArea, double &aLength) |
double | Pixels (double aSize, const char *aUnit) const |
virtual void | OnRoute (const CRoute *) |
virtual void | OnTurn (const TNavigatorTurn &, const TNavigatorTurn *, const TNavigatorTurn *) |
virtual void | OnState (TNavigationState) |
Static Public Member Functions | |
static std::unique_ptr< CFramework > | New (TResult &aError, const CString &aMapFileName, const CString &aStyleSheetFileName, const CString &aFontFileName, int32_t aViewWidth, int32_t aViewHeight, const std::string *aEncryptionKey=nullptr) |
static std::unique_ptr< CFramework > | New (TResult &aError, std::shared_ptr< CFrameworkEngine > aSharedEngine, std::shared_ptr< CFrameworkMapDataSet > aSharedMapDataSet, const CString &aStyleSheetFileName, int32_t aViewWidth, int32_t aViewHeight, const std::string *aEncryptionKey=nullptr) |
static std::unique_ptr< CFramework > | New (TResult &aError, const TParam &aParam) |
Static Public Attributes | |
static constexpr size_t | KDefaultImageCacheSize = 10 * 1024 * 1024 |
static constexpr size_t | KMaxRoutesDisplayed = 16 |
The CFramework class provides a high-level API for CartoType, through which map data can be loaded, maps can be created and viewed, and routing and navigation can be performed.
void CartoType::CFramework::AbbreviatePlacename | ( | MString & | aString | ) |
Abbreviates a string using standard placename abbreviations.
TRouterType CartoType::CFramework::ActualRouterType | ( | ) | const |
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 TRouterType::Default. Route data is loaded either when the first route is constructed, or when LoadNavigationData is called.
TResult CartoType::CFramework::AddClosedLineSpeedLimit | ( | uint64_t & | aId, |
const CGeometry & | aLine, | ||
double | aSpeed, | ||
uint32_t | aVehicleTypes | ||
) |
Add 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.
aId is used to return an identifier for the speed limit, 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(), DeleteTrafficInfo(), and ClearTrafficInfo().
Marks a certain polygon as forbidden for routing.
aId is used to return an identifier for the forbidden area, 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().
TResult CartoType::CFramework::AddLineSpeedLimit | ( | uint64_t & | aId, |
const CGeometry & | aLine, | ||
double | aSpeed, | ||
uint32_t | aVehicleTypes | ||
) |
Add a speed limit in kph, to be used when calculating routes, to a route defined by a series of points.
aId is used to return an identifier for the speed limit, 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', with the integer attribute 0x100 if the driving side is on the right or 0x200 if it is on the left.
See also AddTrafficInfo(), AddClosedLineSpeedLimit(), AddPolygonSpeedlimit(), AddForbiddenArea(), DeleteTrafficInfo(), and ClearTrafficInfo().
void CartoType::CFramework::AddObserver | ( | std::weak_ptr< MFrameworkObserver > | aObserver | ) |
Adds an observer to receive messages about navigation and changes to the style sheet, layers, view, etc. If no observer exists, navigation information can still be obtained by calling FirstTurn, SecondTurn, ContinuationTurn, NavigationState, NavigationPositionKnown and other functions after each call to Navigate.
TResult CartoType::CFramework::AddPolygonSpeedLimit | ( | uint64_t & | aId, |
const CGeometry & | aPolygon, | ||
double | aSpeed, | ||
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.
aId is used to return an identifier for the speed limit, 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, and also pedestrians. 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().
TResult CartoType::CFramework::AddProfile | ( | const TRouteProfile & | aProfile | ) |
Adds a new routing profile. A CFramework object starts life 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 built-in routing profiles (created using makemap /route options ch, cs, ct, tech or tt) because such tables are created using fixed routing profiles which can be set in makemap.
TResult CartoType::CFramework::AddTrafficInfo | ( | uint64_t & | aId, |
const CTrafficInfo & | aTrafficInfo, | ||
CLocationRef & | 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().
aId 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 TRoadOrientation::Forwards and TRoadOrientation::None (which means the same in this context) is supported for iRoadOrientation in aLocationRef.
bool CartoType::CFramework::AnimateTransitions | ( | ) | const |
Returns true if transitions are smoothly animated in graphics-accelerated drawing.
std::string CartoType::CFramework::AppBuildDate | ( | ) | const |
Returns the date on which the application was built in the form YYYY-MM-DD.
void CartoType::CFramework::AppendDistance | ( | MString & | aString, |
double | aDistanceInMeters, | ||
bool | aMetricUnits, | ||
bool | aAbbreviate = false |
||
) | const |
Appends a distance as a string containing locale-dependent words for kilometres, metres, miles and yards.
Load an extra style sheet from a file. Extra style sheets are compiled after the main style sheet.
TResult CartoType::CFramework::AppendStyleSheet | ( | const uint8_t * | aData, |
size_t | aLength | ||
) |
Load an extra style sheet from data in memory. Extra style sheets are compiled after the main style sheet.
void CartoType::CFramework::AppendTime | ( | MString & | aString, |
double | aTimeInSeconds | ||
) | const |
Appends a time duration as a string containing locale-dependent words for hours, minutes and seconds.
TBlendStyleSet CartoType::CFramework::BlendStyleSet | ( | ) | const |
Returns the current blend style set. If there is none, returns an empty blend style set.
const TRouteProfile * CartoType::CFramework::BuiltInProfile | ( | size_t | aIndex | ) |
Returns a built-in routing profile selected by its index, or null if the index is out of range. Routers allowing an arbitrary profile to be set have no built-in profiles. Contraction hierarchy routers have one or more built-in profiles.
size_t CartoType::CFramework::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.
TResult CartoType::CFramework::ChooseRoute | ( | size_t | aRouteIndex | ) |
Chooses one among a set of alternative routes. The index aRouteIndex selects the route: index 0 is the route created from the standard profile set at the time of creating the CNavigator object. Indexes from 1 upwards select routes created using profiles added using AddProfile, in order of their addition.
This function is most appropriately called after calling StartNavigation to create the routes, but before calling Navigate to supply a position.
bool CartoType::CFramework::ClearNearbyObjectWarnings | ( | ) |
Clears all nearby object warnings, and the objects themselves, and returns true if any objects were deleted.
void CartoType::CFramework::ClearTrafficInfo | ( | ) |
Deletes all speed restrictions, forbidden areas and other traffic information.
bool CartoType::CFramework::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.
Configures the CartoType engine by reading an XML configuration file.
const TNavigatorTurn & CartoType::CFramework::ContinuationTurn | ( | ) | const |
When navigating, return any 'ahead' or 'continue' turn before aFirstTurn, so that the user interface can show that no turn is required at the next junction or adjoining minor road. If its type is TTurnType::None there is no such turn. The iDistance member of the turn is the distance from the current position to the continuation turn.
|
inline |
Converts the coordinates of a geometry object between any combination of lat/long, map coordinates and display pixels.
TResult CartoType::CFramework::ConvertCoords | ( | const TWritableCoordSet & | aCoordSet, |
TCoordType | aFromCoordType, | ||
TCoordType | aToCoordType | ||
) | const |
Converts coordinates between any combination of lat/long, map coordinates and display pixels.
TResult CartoType::CFramework::ConvertCoords | ( | double * | aCoordArray, |
size_t | aCoordArraySize, | ||
TCoordType | aFromCoordType, | ||
TCoordType | aToCoordType | ||
) | const |
Converts coordinates between any combination of lat/long, map coordinates and display pixels.
TResult CartoType::CFramework::ConvertPoint | ( | double & | aX, |
double & | aY, | ||
TCoordType | aFromCoordType, | ||
TCoordType | aToCoordType | ||
) | const |
Converts a point between any combination of lat/long, map coordinates and display pixels.
std::unique_ptr< CFramework > CartoType::CFramework::Copy | ( | TResult & | aError, |
bool | aFull = true |
||
) | const |
Create a framework that is a copy of an existing framework, accessing the same maps, fonts and style sheets in a thread-safe way. If aFull is false the copy is being made for graphics-accelerated drawing only, and data not needed for that purpose, such as the full-text index, is not loaded.
CMapObjectArray CartoType::CFramework::CopyNearbyObjects | ( | ) |
Returns copies of all the objects for which nearby object warnings exist.
CString CartoType::CFramework::Copyright | ( | ) | const |
Returns the copyright string stored in the main map database.
std::unique_ptr< CRoute > CartoType::CFramework::CreateBestRoute | ( | TResult & | aError, |
const TRouteProfile & | aProfile, | ||
const TCoordSet & | aCoordSet, | ||
TCoordType | aCoordType, | ||
bool | aStartFixed, | ||
bool | aEndFixed, | ||
size_t | aIterations | ||
) |
A version of CreateBestRoute that takes a TCoordSet and a TCoordType instead of a TRouteCoordSet. The current location match parameters are used.
std::unique_ptr< CRoute > CartoType::CFramework::CreateBestRoute | ( | TResult & | aError, |
const TRouteProfile & | aProfile, | ||
const TRouteCoordSet & | aCoordSet, | ||
bool | aStartFixed, | ||
bool | aEndFixed, | ||
size_t | 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.
If the heading has been supplied by means of one or more calls to Navigate(), and was not supplied in the start coordinates, and aStartFixed is true, it is used to decide the best starting direction for the route.
To use the route for navigation, call the UseRoute() function.
The profile aProfile is used if the current router allows the profile to be set. If not, the current built-in profile is used.
TResult CartoType::CFramework::CreateBestRouteAsync | ( | RouterAsyncCallBack | aCallback, |
const TRouteProfile & | aProfile, | ||
const TRouteCoordSet & | aCoordSet, | ||
bool | aStartFixed, | ||
bool | aEndFixed, | ||
size_t | aIterations, | ||
bool | aOverride = false |
||
) |
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.
std::unique_ptr< CBitmap > CartoType::CFramework::CreateBitmapFromSvg | ( | MInputStream & | aInputStream, |
TFileLocation & | aErrorLocation, | ||
int32_t | aForcedWidth = 0 |
||
) |
Creates a bitmap from SVG code in aInputStream, starting from the current location of MInputStream. Used by the Maps App.
std::unique_ptr< CGraphicsContext > CartoType::CFramework::CreateGraphicsContext | ( | int32_t | aWidth, |
int32_t | aHeight | ||
) |
Create a bitmap graphics context of the specified size in pixels.
std::unique_ptr< CFramework > CartoType::CFramework::CreateLegendFramework | ( | TResult & | aError | ) |
Using this framework as a base, create a framework for drawing map legends. It contains a writable spherical mercator map which is a 20,000km square in map coordinates. It has the same fonts as the base framework.
std::unique_ptr< CRoute > CartoType::CFramework::CreateRoute | ( | TResult & | aError, |
const TRouteProfile & | aProfile, | ||
const TCoordSet & | aCoordSet, | ||
TCoordType | aCoordType | ||
) |
A version of CreateRoute that takes a TCoordSet and a TCoordType instead of a TRouteCoordSet. The current location match parameters are used.
std::unique_ptr< CRoute > CartoType::CFramework::CreateRoute | ( | TResult & | aError, |
const TRouteProfile & | aProfile, | ||
const TRouteCoordSet & | aCoordSet | ||
) |
Creates a route without starting navigation, supplying a route profile and waypoints. If the heading is known it is used to decide the best starting direction for the route.
To use the route for navigation, call the UseRoute() function.
The profile aProfile is used if the current router allows the profile to be set. If not, the current built-in profile is used.
TResult CartoType::CFramework::CreateRouteAsync | ( | RouterAsyncCallBack | aCallback, |
const TRouteProfile & | aProfile, | ||
const TRouteCoordSet & | aCoordSet, | ||
bool | aOverride = false |
||
) |
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.
TResult CartoType::CFramework::CreateRouteAsyncHelper | ( | RouterAsyncCallBack | aCallback, |
bool | aBest, | ||
const TRouteProfile & | aProfile, | ||
const TRouteCoordSet & | aCoordSet, | ||
bool | aStartFixed, | ||
bool | aEndFixed, | ||
size_t | aIterations, | ||
bool | aOverride = false |
||
) |
A helper function used by the CreateRouteAsync functions.
std::unique_ptr< CRoute > CartoType::CFramework::CreateRouteFromXml | ( | TResult & | aError, |
const TRouteProfile & | aProfile, | ||
const CString & | 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.
std::unique_ptr< CRoute > CartoType::CFramework::CreateRouteHelper | ( | TResult & | aError, |
bool | aBest, | ||
const TRouteProfile & | aProfile, | ||
const std::vector< Router::TRoutePointInternal > & | aRoutePointArray, | ||
bool | aStartFixed, | ||
bool | aEndFixed, | ||
size_t | aIterations | ||
) |
A helper function used by the CreateRoute functions.
std::unique_ptr< CRoute > CartoType::CFramework::CreateRouteHelper | ( | TResult & | aError, |
bool | aBest, | ||
const TRouteProfile & | aProfile, | ||
const TRouteCoordSet & | aCoordSet, | ||
bool | aStartFixed, | ||
bool | aEndFixed, | ||
size_t | aIterations | ||
) |
A helper function used by the CreateRoute functions.
std::shared_ptr< CMapStyle > CartoType::CFramework::CreateStyleSheet | ( | double | aScale | ) |
Creates a compile style sheet at the scale denominator aScale. For internal use only.
TResult CartoType::CFramework::CreateWritableMap | ( | TWritableMapType | aType, |
CString | aFileName = nullptr |
||
) |
Creates a writable (editable) map of the specified type and load it. For any map type that requires a file to be created, the file name must be supplied in aFileName.
const CRouteSegment * CartoType::CFramework::CurrentRouteSegment | ( | ) | const |
Return the current route segment, or null if not navigating.
CString CartoType::CFramework::DataSetName | ( | ) | const |
Returns the name of the data in the main map database.
TResult CartoType::CFramework::DeleteMapObjects | ( | uint32_t | aMapHandle, |
uint64_t | aStartId, | ||
uint64_t | aEndId, | ||
uint64_t & | aDeletedCount, | ||
CString | aCondition = nullptr |
||
) |
Deletes map objects with IDs in the range aStartId...aEndId inclusive.
The map from which the objects are deleted is identified by aMapHandle. If aMapHandle is zero the in-memory map used for routing is used.
If aCondition is not empty this function deletes objects satisfying aCondition only.
bool CartoType::CFramework::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.
TResult CartoType::CFramework::DeleteRoutes | ( | ) |
Delete all routes.
TResult CartoType::CFramework::DeleteStyleSheet | ( | size_t | aIndex | ) |
Deletes the style sheet with the specified index. The main style sheet (index 0) may not be deleted. Other style sheets have indexes from 1 up, in the order of loading.
void CartoType::CFramework::DeleteTrack | ( | ) |
Deletes the current track. Does not affect whether tracking is on or off.
TResult CartoType::CFramework::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.
TResult CartoType::CFramework::DisplayPositionOnNearestRoad | ( | const TNavigationData & | aNavData, |
TNearestRoadInfo * | aInfo = nullptr |
||
) |
Moves the current location to the nearest road, using a navigation fix and the current location match parameters, and optionally returns information about it.
TResult CartoType::CFramework::DisplayRoute | ( | bool | aEnable = true | ) |
If aEnable is true, display the current route and a maximum of 2 alternative routes. If not, remove the current route from the display.
TResult CartoType::CFramework::DisplayTrack | ( | bool | aEnable | ) |
Enables or disables displaying the track.
double CartoType::CFramework::DistanceToDestination | ( | ) |
Returns the current distance to the destination in meters, or zero if no route exists.
CString CartoType::CFramework::DistanceToString | ( | double | aDistanceInMeters, |
bool | aMetricUnits, | ||
bool | aAbbreviate = false |
||
) | const |
Returns a distance as a string containing locale-dependent words for kilometres, metres, miles and yards.
bool CartoType::CFramework::Draw3DBuildings | ( | ) | const |
Returns true if buildings are drawn in 3D where data is available.
bool CartoType::CFramework::DrawBackground | ( | bool | aEnable | ) |
Enable or disable drawing the map background. The return value is the previous state.
TResult CartoType::CFramework::DrawLabelsToLabelHandler | ( | MLabelHandler & | aLabelHandler, |
double | aStyleSheetExclusionScale | ||
) |
Draw the labels for the current map view to a label handler. This function is intended to be used by graphics-accelerated rendering.
void CartoType::CFramework::DrawNotices | ( | CGraphicsContext & | aGc | ) |
Draws notices (legend and copyright notice) to a graphics context.
void CartoType::CFramework::DrawNoticesAutomatically | ( | bool | aEnable | ) |
Controls whether notices (the scale bar, legend and copyright notice) are drawn automatically. If not, they can be drawn using DrawNotices.
TResult CartoType::CFramework::EditAddCurrentPoint | ( | ) |
Adds a new point to the editable object by copying the current point.
TResult CartoType::CFramework::EditDeleteCurrentObject | ( | ) |
Deletes the current editable object.
TResult CartoType::CFramework::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.
TResult CartoType::CFramework::EditGetCurrentObjectAreaAndLength | ( | double & | aArea, |
double & | aLength | ||
) | const |
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.
TResult CartoType::CFramework::EditInsertCurrentObject | ( | const CString & | aLayer, |
uint64_t & | aId, | ||
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 in aId.
Moves the editable object's current point if any.
Creates a new editable line object starting at the specified point.
Creates a new editable polygon object starting at the specified point.
TResult CartoType::CFramework::EditSelectNearestPoint | ( | const TPointFP & | aDisplayPoint, |
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.
TResult CartoType::CFramework::EditSetCurrentObjectIntAttribute | ( | uint32_t | aValue | ) |
Sets the integer attribute of the currently edited object.
TResult CartoType::CFramework::EditSetCurrentObjectStringAttribute | ( | const CString & | aKey, |
const CString & | aValue | ||
) |
Sets a string attribute in the currently edited object. If aKey is empty, sets the label. If aValue is empty, deletes the attribute.
TResult CartoType::CFramework::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.
TResult CartoType::CFramework::EnableAllMaps | ( | ) |
Enables all currently loaded maps.
void CartoType::CFramework::EnableDrawingMemoryDataBase | ( | bool | aEnable | ) |
Enables or disables the drawing of the in-memory database when the rest of the map is drawn. The in-memory database is used for the route, its start and end, and the current vehicle position. If drawing the in-memory database is disabled, you can get a separate image containing the objects from the in-memory database by calling MemoryDataBaseMapBitmap.
void CartoType::CFramework::EnableLayer | ( | const CString & | aLayerName, |
bool | aEnable | ||
) |
Enable or disable a named layer. When a layer is disabled it is not drawn but is still searchable.
void CartoType::CFramework::EnableLegend | ( | bool | aEnable | ) |
Enables or disables the drawing of a legend that has been supplied using SetLegend.
TResult CartoType::CFramework::EnableMapByHandle | ( | uint32_t | aHandle, |
bool | aEnable | ||
) |
Enable or disable a map, selecting it by handle.
bool CartoType::CFramework::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.
void CartoType::CFramework::EnableScaleBar | ( | bool | aEnable | ) |
Enables or disables the drawing of a scale bar that has been supplied using SetScaleBar.
bool CartoType::CFramework::EnableTrafficInfo | ( | bool | aEnable | ) |
Enable or disable the use of traffic information when routing. Return the previous state.
void CartoType::CFramework::EnableTurnInstructions | ( | bool | aEnable | ) |
Enables or disables the drawing of a turn instruction notice that has been supplied using SetTurnInstructions.
void CartoType::CFramework::EndNavigation | ( | ) |
Stops navigating. Current routes remain in existence. Navigation can be resumed using StartNavigation or EnableNavigation.
void CartoType::CFramework::EndTracking | ( | ) |
Stops tracking (storing and displaying track points). Does not delete the current track.
|
inline |
Returns the CEngine object used by this framework. For internal use only.
double CartoType::CFramework::EstimatedTimeToDestination | ( | ) |
Returns the estimated time to the destination in seconds, or zero if no route exists.
std::string CartoType::CFramework::ExpiryDate | ( | ) | const |
Returns the expiry date of the license in the form YYYY-MM-DD.
TResult CartoType::CFramework::Find | ( | CMapObjectArray & | aObjectArray, |
const TFindParam & | aFindParam | ||
) | const |
A general search function, allowing any combination of clip rectangle, choice of layers, choice of attributes, text and string match method, and condition. The objects returned are in map coordinates.
TResult CartoType::CFramework::Find | ( | CMapObjectGroupArray & | aObjectGroupArray, |
const TFindParam & | aFindParam | ||
) | const |
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'.
TResult CartoType::CFramework::FindAddress | ( | CMapObjectArray & | aObjectArray, |
size_t | aMaxObjectCount, | ||
const CAddress & | aAddress, | ||
bool | aFuzzy = false |
||
) | const |
Finds an address using structured data.
TResult CartoType::CFramework::FindAddressAsync | ( | FindAsyncCallBack | aCallBack, |
size_t | aMaxObjectCount, | ||
const CAddress & | aAddress, | ||
bool | aFuzzy = false , |
||
bool | aOverride = false |
||
) |
An asynchronous address finding function.
Calls the function 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.
TResult CartoType::CFramework::FindAddressPart | ( | CMapObjectArray & | aObjectArray, |
size_t | aMaxObjectCount, | ||
const CString & | aText, | ||
TAddressPart | aAddressPart, | ||
bool | aFuzzy, | ||
bool | aIncremental | ||
) | const |
Finds part of an address used in a CAddress 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 aMaxObjectCount to a small number that is a suitable number of items to be displayed in a list box on the display, for example 20.
TResult CartoType::CFramework::FindAsync | ( | FindAsyncCallBack | aCallBack, |
const TFindParam & | aFindParam, | ||
bool | aOverride = false |
||
) |
Performs a general find operation asynchronously.
Calls the function 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.
TResult CartoType::CFramework::FindAsync | ( | FindAsyncGroupCallBack | aCallBack, |
const TFindParam & | aFindParam, | ||
bool | aOverride = false |
||
) |
An asynchronous find 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 function 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.
TResult CartoType::CFramework::FindBuildingsNearStreet | ( | CMapObjectArray & | aObjectArray, |
const CMapObject & | aStreet | ||
) | const |
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.
TResult CartoType::CFramework::FindInDisplay | ( | CMapObjectArray & | aObjectArray, |
size_t | aMaxObjectCount, | ||
double | aX, | ||
double | aY, | ||
double | aRadius | ||
) | const |
Finds all objects within aRadius of the point aX,aY 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.
TResult CartoType::CFramework::FindInLayer | ( | CMapObjectArray & | aObjectArray, |
size_t | aMaxObjectCount, | ||
const CString & | aLayer, | ||
double | aMinX, | ||
double | aMinY, | ||
double | aMaxX, | ||
double | aMaxY, | ||
TCoordType | aCoordType | ||
) | const |
Finds all objects in a named layer or list of layers (space or comma separated), within specified bounds.
TResult CartoType::CFramework::FindNearestRoad | ( | TNearestRoadInfo & | aInfo, |
double | aX, | ||
double | aY, | ||
TCoordType | aCoordType, | ||
double | aHeadingInDegrees, | ||
bool | aDisplayPosition | ||
) |
Finds the nearest road to the point (aX,aY), 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.
TResult CartoType::CFramework::FindPointsInPath | ( | CMapObjectArray & | aObjectArray, |
const CGeometry & | aPath, | ||
const TFindParam * | aParam = nullptr |
||
) | const |
Finds all point objects contained in a certain closed path. To set parameters other than the path and the condition of finding points, pass a TFindParam object with your chosen parameters.
TResult CartoType::CFramework::FindPolygonsContainingPath | ( | CMapObjectArray & | aObjectArray, |
const CGeometry & | aPath, | ||
const TFindParam * | aParam = nullptr |
||
) | const |
Finds all polygon objects containing a certain path. To set parameters other than the path and the condition of finding polygons, pass a TFindParam object with your chosen parameters.
TResult CartoType::CFramework::FindStreetAddresses | ( | CMapObjectArray & | aObjectArray, |
size_t | aMaxObjectCount, | ||
const CAddress & | aAddress, | ||
const CGeometry * | aClip = nullptr |
||
) | const |
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.
If no building name is specified, the returned objects are either streets or (to allow for confusion between street names and other low-rank places) farms, hamlets, small localities, neighborhoods, etc.
If the building name is specified, the streets or other objects are first found and buildings near to them are returned. To get all buildings in the selected streets, use '*' as the building name.
TResult CartoType::CFramework::FindText | ( | CMapObjectArray & | aObjectArray, |
size_t | aMaxObjectCount, | ||
const CString & | aText, | ||
TStringMatchMethod | aMatchMethod, | ||
const CString & | aLayers, | ||
const CString & | aAttribs | ||
) | const |
Find objects with attributes matching aText. If aLayers is empty, search all layers, otherwise aLayers is a list of layers separated by spaces or commas. If aAttributes is empty, search all attributes, otherwise aAttributes is a list of attributes separated by spaces or commas; use "$" to indicate the label (the unnamed attribute).
const TNavigatorTurn & CartoType::CFramework::FirstTurn | ( | ) | const |
When navigating, return the first significant turn after the current position, ignoring 'ahead' and 'continue' turns. If its type is TTurnType::None there are no remaining significant turns. The iDistance member of the turn is the distance from the current position to the first turn or the arrival point.
TFollowMode CartoType::CFramework::FollowMode | ( | ) | const |
Return the follow mode, which controls the way the map tracks the user location and heading.
void CartoType::CFramework::ForceRedraw | ( | ) |
Redraws the map after any change which has not been handled automatically.
For example, if hardware graphics acceleration is disabled while a large number of map objects are inserted, call this function after re-enabling hardware graphics acceleration.
If hardware graphics acceleration is not used, call this function if the bitmap has been changed directly, such as by drawing a scale on it.
TResult CartoType::CFramework::GeoCodeSummary | ( | CString & | aSummary, |
const CMapObject & | aMapObject | ||
) | const |
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.
TResult CartoType::CFramework::GeoCodeSummary | ( | CString & | aSummary, |
double | aX, | ||
double | aY, | ||
TCoordType | aCoordType | ||
) | const |
Write 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.
TResult CartoType::CFramework::GetAddress | ( | CAddress & | aAddress, |
const CMapObject & | aMapObject | ||
) | const |
Creates an address for a map object. Calls to this function are limited in number in unlicensed (evaluation) versions of the CartoType library.
TResult CartoType::CFramework::GetAddress | ( | CAddress & | aAddress, |
double | aX, | ||
double | aY, | ||
TCoordType | aCoordType, | ||
bool | aFullAddress = true |
||
) | const |
Creates an address for a point in the map. Calls to this function are limited in number in unlicensed (evaluation) versions of the CartoType library.
If aFullAddress is false, only the building and street are returned, and the function runs faster.
TResult CartoType::CFramework::GetAddressFast | ( | CAddress & | aAddress, |
const CMapObject & | aMapObject | ||
) | const |
Creates an address for a map object, using attributes of the object only. Returns KErrorNotFound if the relevant address parts were not found.
TResult CartoType::CFramework::GetAreaAndLength | ( | const CGeometry & | aGeometry, |
double & | aArea, | ||
double & | aLength | ||
) |
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.
TResult CartoType::CFramework::GetContourAreaAndLength | ( | const CGeometry & | aGeometry, |
size_t | aContourIndex, | ||
double & | aArea, | ||
double & | aLength | ||
) |
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 object are both zero. The area of a line object is zero. This function ignores curves. All points are treated as on-curve.
double CartoType::CFramework::GetDistanceInMeters | ( | double | aX1, |
double | aY1, | ||
double | aX2, | ||
double | aY2, | ||
TCoordType | aCoordType | ||
) | const |
Get the great-circle distance in meters between two points. Uses the WGS84 ellipsoid.
std::vector< int32_t > CartoType::CFramework::GetHeights | ( | TResult & | aError, |
const TCoordSet & | aCoordSet, | ||
TCoordType | aCoordType | ||
) | const |
Returns the heights of a set of points in the specified coordinate type. Heights are returned in metres.
The layer 'terrain-height-metres' is used by preference. It contains heights to metre 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.
uint32_t CartoType::CFramework::GetLastMapHandle | ( | ) | const |
Gets the handle of the map most recently loaded, or created using CreateWritableMap.
uint32_t CartoType::CFramework::GetMainMapHandle | ( | ) | const |
Get the handle of the main map.
TResult CartoType::CFramework::GetMapExtent | ( | double & | aMinX, |
double & | aMinY, | ||
double & | aMaxX, | ||
double & | aMaxY, | ||
TCoordType | aCoordType | ||
) | const |
Gets the combined extent of all loaded maps.
TResult CartoType::CFramework::GetMapExtent | ( | TRectFP & | aMapExtent, |
TCoordType | aCoordType | ||
) | const |
Gets the combined extent of all loaded maps.
std::shared_ptr< CGraphicsContext > CartoType::CFramework::GetMapGraphicsContext | ( | ) |
Get the graphics context used to draw the map so that extra graphics can be drawn.
uint32_t CartoType::CFramework::GetMemoryMapHandle | ( | ) | const |
Get the handle of the in-memory map.
TResult CartoType::CFramework::GetNavigationData | ( | TNavigationData & | aData, |
double & | aHeading | ||
) | const |
Gets the navigation data representing the current position. aHeading is used to return the heading in degrees relative to the local map north, taking the projection into account. It may differ from aData.iCourse.
TResult CartoType::CFramework::GetNavigationPosition | ( | TPointFP & | aPos, |
TCoordType | aCoordType | ||
) | const |
Gets the current position used by the navigation system. This may be an extrapolated position.
CPositionedBitmap CartoType::CFramework::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.
CString CartoType::CFramework::GetProjectionAsProj4Param | ( | ) | const |
Returns the current map projection as a proj.4 parameter string if possible. If not returns the empty string.
double CartoType::CFramework::GetScaleDenominatorInView | ( | ) | const |
Get the denominator of the scale fraction at the center of the view, taking any scale distortion into account.
CStyleSheetData CartoType::CFramework::GetStyleSheetData | ( | size_t | aIndex | ) | const |
Gets a CStyleSheetData object representing the style sheet with the specified index. An index of 0 means the main style sheet. If the index is out of range an empty CStyleSheetData object is returned.
const CStyleSheetDataArray & CartoType::CFramework::GetStyleSheetDataArray | ( | ) | const |
Returns the entire array of style sheets used by this framework.
std::string CartoType::CFramework::GetStyleSheetText | ( | size_t | aIndex | ) | const |
Gets the XML text of the style sheet with the specified index. An index of 0 means the main style sheet. If the index is out of range the empty string is returned.
const CVariableDictionary & CartoType::CFramework::GetStyleSheetVariables | ( | ) | const |
Returns a reference to the dictionary containing the style sheet variables and their values.
CTrackGeometry CartoType::CFramework::GetTrack | ( | ) | const |
Returns the current track as a geometry object with coordinates in degrees. Each segment of the track is a contour in the geometry object.
double CartoType::CFramework::GetTrafficInfoSpeed | ( | double | aX, |
double | aY, | ||
TCoordType | aCoordType, | ||
uint32_t | aVehicleTypes | ||
) |
Returns the minimum speed of any traffic info speed restrictions affecting specified vehicle types, for a route defined by a series of points. Returns 255 if there are no speed restrictions.
TResult CartoType::CFramework::GetView | ( | double & | aMinX, |
double & | aMinY, | ||
double & | aMaxX, | ||
double & | aMaxY, | ||
TCoordType | aCoordType | ||
) | const |
Gets the current view coordinates as a bounding box.
TResult CartoType::CFramework::GetView | ( | TFixedSizeContourFP< 4, true > & | aView, |
TCoordType | aCoordType | ||
) | const |
Gets the current view coordinates as a closed path of four points, which is a rectangle unless perspective mode is turned on, in which case it is a trapezium.
TResult CartoType::CFramework::GetView | ( | TRectFP & | aView, |
TCoordType | aCoordType | ||
) | const |
Gets the current view coordinates as a bounding box.
bool CartoType::CFramework::HasNotices | ( | ) | const |
Returns true if any notices such as a scale bar, legend or copyright notice exist.
TResult CartoType::CFramework::InsertCircleMapObject | ( | uint32_t | aMapHandle, |
const CString & | aLayerName, | ||
double | aCenterX, | ||
double | aCenterY, | ||
TCoordType | aCenterCoordType, | ||
double | aRadius, | ||
TCoordType | aRadiusCoordType, | ||
const CString & | aStringAttributes, | ||
uint32_t | aIntAttribute, | ||
uint64_t & | aId, | ||
bool | aReplace | ||
) |
Inserts a circle map object into one of the maps, identifying it by its handle. If aMapHandle is zero the in-memory map used for routing is used.
The circle is defined by its center and radius, which may be in different coordinate systems. It is often convenient to supply a point in degrees long/lat and its radius in map meters.
This function uses the supplied ID if aId is non-zero, otherwise generates an ID and returns it in aId. It fails if the map database is not writable.
TResult CartoType::CFramework::InsertCopyOfMapObject | ( | uint32_t | aMapHandle, |
const CString & | aLayerName, | ||
const CMapObject & | aObject, | ||
double | aEnvelopeRadius, | ||
TCoordType | aRadiusCoordType, | ||
uint64_t & | aId, | ||
bool | aReplace, | ||
CString | aExtraStringAttributes = nullptr , |
||
const uint32_t * | aIntAttribute = nullptr |
||
) |
Insert an object by copying an existing object. If aEnvelopeRadius is greater than zero, convert the object to an envelope using the specified radius. Use the supplied ID if aId is non-zero, otherwise generate an ID. Return the ID in aId. This function fails if the map is not writable.
The layer of the copied map object is put into the string attribute _copied_from_layer. Extra string attributes can be supplied in aExtraStringAttributes.
TResult CartoType::CFramework::InsertEnvelopeMapObject | ( | uint32_t | aMapHandle, |
const CString & | aLayerName, | ||
const CGeometry & | aGeometry, | ||
double | aRadius, | ||
TCoordType | aRadiusCoordType, | ||
const CString & | aStringAttributes, | ||
uint32_t | aIntAttribute, | ||
uint64_t & | aId, | ||
bool | aReplace | ||
) |
Inserts a map object that is an envelope around some geometry, at a radius of aRadius; it can also be regarded as a stroke drawn along the path with a stroke width of twice aRadius. The geometry and the radius may use different coordinate systems. It is often convenient to supply the geometry in degrees long/lat and its radius in map meters.
The map into which the object is inserted is identified by aMapHandle. If aMapHandle is zero the in-memory map used for routing is used.
This function uses the supplied ID if aId is non-zero, otherwise generates an ID and returns it in aId. It fails if the map database is not writable.
TResult CartoType::CFramework::InsertMapObject | ( | uint32_t | aMapHandle, |
const CString & | aLayerName, | ||
const CGeometry & | aGeometry, | ||
const CString & | aStringAttributes, | ||
uint32_t | aIntAttribute, | ||
uint64_t & | aId, | ||
bool | aReplace | ||
) |
Inserts a map object into one of the writable maps. The type of the map object (point, line or polygon) is deduced from the geometry object. If aMapHandle is zero the in-memory map used for routing is used.
This function uses the supplied ID if aId is non-zero, otherwise generates an ID and returns it in aId. It fails if the map database is not writable.
TResult CartoType::CFramework::InsertPointMapObject | ( | uint32_t | aMapHandle, |
const CString & | aLayerName, | ||
double | aX, | ||
double | aY, | ||
TCoordType | aCoordType, | ||
const CString & | aStringAttributes, | ||
uint32_t | aIntAttribute, | ||
uint64_t & | aId, | ||
bool | aReplace | ||
) |
Inserts a point map object into one of the maps, identifying it by its handle. If aMapHandle is zero the in-memory map used for routing is used.
This function uses the supplied ID if aId is non-zero, otherwise generates an ID and returns it in aId. It fails if the map database is not writable.
TResult CartoType::CFramework::InsertPushPin | ( | double | aX, |
double | aY, | ||
TCoordType | aCoordType, | ||
const CString & | aStringAttrib, | ||
const CString & | aColor, | ||
int32_t | aIconCharacter, | ||
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 and its ID is returned in aId. If aId is non-zero, an existing pushpin with the specified ID, if any exists, is replaced.
const TBitmap * CartoType::CFramework::LabelBitmap | ( | TResult & | aError, |
bool * | aRedrawWasNeeded = nullptr |
||
) |
Gets the bitmap containing the labels, redrawing it first if necessary. If aRedrawWasNeeded is non-null it is used to state whether a redraw was needed.
TPointFP CartoType::CFramework::LabelUpVector | ( | ) | const |
Returns the up direction for labels as a unit vector.
bool CartoType::CFramework::LayerIsEnabled | ( | const CString & | aLayerName | ) | const |
Return the enabled status of a named layer. When a layer is disabled it is not drawn but is still searchable.
std::vector< CString > CartoType::CFramework::LayerNames | ( | ) |
Returns the names of all the layers in the map data.
uint8_t CartoType::CFramework::License | ( | ) | const |
Returns the license level, which is made from these flags: 1 = API is licensed; 2 = graphics acceleration is enabled; 4 = the license has expired.
Supplies a license key to enable the licensed version of the CartoType library.
TResult CartoType::CFramework::License | ( | const uint8_t * | aKey, |
size_t | aKeyLength | ||
) |
Supplies a license key to enable the licensed version of the CartoType library.
std::string CartoType::CFramework::Licensee | ( | ) | const |
Returns the name of the licensee. Returns "no licensee: for evaluation only" if there is no licensee.
Load a font in addition to any fonts already loaded.
TResult CartoType::CFramework::LoadFont | ( | const uint8_t * | aData, |
size_t | aLength, | ||
bool | aCopyData | ||
) |
Loads a font from data in memory. If aCopyData is true, makes a copy of the data and uses the copy, otherwise uses the supplied pointer aData, which must point to data that survives at least as long as the CFramework object exists, or until the font is unloaded.
TResult CartoType::CFramework::LoadIcon | ( | const CString & | aFileName, |
const CString & | aId, | ||
const TPoint & | aHotSpot, | ||
const TPoint & | aLabelPos | ||
) |
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.
TResult CartoType::CFramework::LoadMap | ( | const CString & | aMapFileName, |
const std::string * | aEncryptionKey = nullptr |
||
) |
Loads a map in addition to any maps already loaded. If an encryption key is supplied the map must have been encrypted using this key.
std::unique_ptr< CMapObject > CartoType::CFramework::LoadMapObject | ( | TResult & | aError, |
uint32_t | aMapHandle, | ||
uint64_t | aId | ||
) |
Load a map object, identifying it by its map handle and ID.
TResult CartoType::CFramework::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. Navigation data is loaded in a background thread. The main thread is blocked only if routing is needed before loading has finished.
Navigation data is unloaded when the map data set is changed: that is, when a map is loaded or unloaded.
No error is returned if navigation data has already been loaded.
By default, serialized navigation data is used. That behavior can be changed by calling UseSerializedNavigationData.
std::string CartoType::CFramework::Locale | ( | ) | const |
Return the locale used when getting the names of map objects when routing, geocoding, etc. The returned value is either a null-terminated string, usually a two-letter language identifier like 'en' for English or 'fr' for French, or an empty string meaning 'no locale'.
TLocationMatchParam CartoType::CFramework::LocationMatchParam | ( | ) | const |
Gets the current location match parameters.
|
inline |
Returns the main map database. For internal use only.
|
inline |
Returns the CMap object owned by this framework. For internal use only.
const TBitmap * CartoType::CFramework::MapBitmap | ( | TResult & | aError, |
bool * | aRedrawWasNeeded = nullptr |
||
) |
Gets the bitmap containing the map, redrawing it first if necessary. If aRedrawWasNeeded is non-null, it is used to state whether a redraw was needed.
size_t CartoType::CFramework::MapCount | ( | ) | const |
Returns the number of maps currently loaded, including the main map and the in-memory map.
|
inline |
Returns the current map drawing parameters. For internal use only.
uint32_t CartoType::CFramework::MapHandle | ( | size_t | aIndex | ) | const |
Returns the handle of one of the currently loaded maps. Returns 0 if aIndex is out of range.
bool CartoType::CFramework::MapIsEmpty | ( | uint32_t | aHandle | ) |
Return true if a map, identified by its handle, is known to be empty or does not exist.
bool CartoType::CFramework::MapIsWritable | ( | size_t | aIndex | ) | const |
Returns true if a map, identified by its index, is writable.
std::unique_ptr< CMapMetaData > CartoType::CFramework::MapMetaData | ( | size_t | aIndex | ) | const |
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.
TTransform3D CartoType::CFramework::MapTransform | ( | ) | const |
Returns the transform from map coordinates to pixels, including any perspective transform.
TTransform CartoType::CFramework::MapTransform2D | ( | ) | const |
Returns the transform from map coordinates to 64ths of pixels, not including any perspective transform.
double CartoType::CFramework::MapUnitSize | ( | ) | const |
Return the size of a map unit (a unit in the map coordinate system) in meters.
const TBitmap * CartoType::CFramework::MemoryDataBaseMapBitmap | ( | TResult & | aError, |
bool * | aRedrawWasNeeded = nullptr |
||
) |
Get a bitmap containing a map drawn using objects from the in-memory database only, redrawing it first if necessary. If aRedrawWasNeeded is non-null use it to state whether a redraw was needed.
double CartoType::CFramework::MetersToPixels | ( | double | aMeters | ) | const |
Converts a distance in map meters (projected meters) to pixels.
TResult CartoType::CFramework::Navigate | ( | const TNavigationData & | 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.iValidity is a set of bit flags, ORed together, which determines which of the other parameters are valid. The bit flags are the constants TNavigationData::ETimeValid, TNavigationData::EPositionValid, etc. 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.iTime is the time in seconds. Any consistent time representation may be used (e.g., the unix timestamp format of the time in seconds since midnight, 1st Jan 1970); the absolute time does not matter as long as times can be subtracted to give a difference in seconds.
aNavData.iPosition is the location in degrees latitude and longitude, using the WGS84 datum.
aNavData.iSpeed is the speed in kilometres per hour.
aNavData.iCourse 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.iHeight is the height above sea level in metres.
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.
bool CartoType::CFramework::Navigating | ( | ) | const |
Returns true if navigation is happening, which is true if there is a known route and navigation is enabled.
bool CartoType::CFramework::NavigationDataHasGradients | ( | ) | const |
Returns true if the navigation data for the main map contains gradients.
bool CartoType::CFramework::NavigationEnabled | ( | ) | const |
Returns true if navigation is enabled, false otherwise.
TNavigationState CartoType::CFramework::NavigationState | ( | ) | const |
Return the current navigation state.
TNavigatorParam CartoType::CFramework::NavigatorParam | ( | ) | const |
Gets the current parameters affecting the working of the navigation system.
|
static |
Creates 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. aViewWidth and aViewHeight are the width and height of the map view in pixels.
If an encryption key is supplied the map must have been encrypted using this key.
|
static |
Create a new framework object using a parameter object.
|
static |
Creates a new framework object using a shared engine and shared map data.
aSharedEngine is the shared engine. It may be used with multiple CFramework objects. aSharedMapDataSet is the shared map data set. It may be used with multiple CFramework objects. aMapFileName is the file name of the main map. aStyleSheetFileName is the name of the style sheet file. aViewWidth and aViewHeight are the width and height of the map view in pixels.
If an encryption key is supplied the map must have been encrypted using this key.
std::unique_ptr< CMapStore > CartoType::CFramework::NewMapStore | ( | std::shared_ptr< CMapStyle > | aStyleSheet, |
const TRect & | aBounds, | ||
bool | aUseFastAllocator | ||
) |
Creates a map store using a given style sheet and bounding rectangle. For internal use only.
const CRouteSegment * CartoType::CFramework::NextRouteSegment | ( | ) | const |
Return the next route segment if any, or null if not navigating or the current segment is the last.
bool CartoType::CFramework::NightMode | ( | ) | const |
Returns true if night mode is on.
TColor CartoType::CFramework::NightModeColor | ( | ) | const |
Returns the current night mode color.
bool CartoType::CFramework::ObjectWouldBeDrawn | ( | TResult & | aError, |
uint64_t | aId, | ||
TMapObjectType | aType, | ||
const CString & | aLayer, | ||
uint32_t | aIntAttrib, | ||
const CString & | aStringAttrib | ||
) |
Return true if an object with the given attributes would be drawn. The disabled layers are taken into account, but whether a map is disabled is ignored.
TColor CartoType::CFramework::OutlineColor | ( | ) | const |
Returns the color used for drawing the outline layer (land as opposed to sea), or white if it is not known or null.
Pan (slide) the map so that the former display position aFrom moves to aTo.
TResult CartoType::CFramework::Pan | ( | double | aFromX, |
double | aFromY, | ||
TCoordType | aFromCoordType, | ||
double | aToX, | ||
double | aToY, | ||
TCoordType | aToCoordType | ||
) |
Pan (slide) the map so that the position aFrom moves to aTo, giving the coordinate system of both positions.
TResult CartoType::CFramework::Pan | ( | int32_t | aDx, |
int32_t | aDy | ||
) |
Pans (slides the map) by a certain distance in pixels, horizontally or vertically or both.
bool CartoType::CFramework::Perspective | ( | ) | const |
Returns true if perspective mode is currently selected, false otherwise.
TPerspectiveParam CartoType::CFramework::PerspectiveParam | ( | ) | const |
Returns the current perspective parameters.
TTransform3D CartoType::CFramework::PerspectiveTransform | ( | ) | const |
Returns the perspective transform.
double CartoType::CFramework::Pixels | ( | double | aDimension, |
const char * | aUnit | ||
) | const |
Returns the number of pixels corresponding to a dimension in specified units: pt, pc, cm, mm, or in; null or any other unit means pixels.
double CartoType::CFramework::PixelsToMeters | ( | double | aPixels | ) | const |
Converts a distance in pixels to map meters (projected meters).
double CartoType::CFramework::PolygonArea | ( | const TCoordSet & | aCoordSet, |
TCoordType | aCoordType | ||
) |
Returns the area of a polygon on the surface of the earth in square meters, using the WGS84 ellipsoid.
double CartoType::CFramework::PolylineLength | ( | const TCoordSet & | aCoordSet, |
TCoordType | aCoordType | ||
) |
Returns the length of a polyline on the surface of the earth in meters, using the WGS84 ellipsoid.
TRouterType CartoType::CFramework::PreferredRouterType | ( | ) | const |
Returns the preferred type of router to be used for calculating routes.
const TRouteProfile * CartoType::CFramework::Profile | ( | size_t | aIndex | ) | const |
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.
CGeometry CartoType::CFramework::Range | ( | TResult & | aError, |
const TRouteProfile * | aProfile, | ||
double | aX, | ||
double | aY, | ||
TCoordType | aCoordType, | ||
double | aTimeOrDistance, | ||
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 CGeometry object into the map using InsertMapObject.
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.
TResult CartoType::CFramework::ReadMap | ( | uint32_t | aHandle, |
const CString & | aFileName, | ||
TFileType | aFileType | ||
) |
Reads map data from aFileName in the format given by aFileType and merges it into the map identified by aHandle, which must refer to a writable map database. Only the CTMS (CartoType Map Serialized) and Keyhole Markup Language (KML) formats are supported.
TResult CartoType::CFramework::ReadMap | ( | uint32_t | aHandle, |
const std::vector< uint8_t > & | 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. If aMapHandle is zero it means the in-memory map used for routing.
Read a route from XML (a GPX file or a CartoType route file) and display it. aFileNameOrData is treated as XML data if it starts with a less-than sign.
If aReplace is true, delete all current routes, add the new route and make its profile the current profile. If aReplace is false, append 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.
TResult CartoType::CFramework::ReloadStyleSheet | ( | size_t | aIndex = 0 | ) |
Reload a sheet from the file it was originally loaded from. This function can be used to apply changes after a style sheet is modified. The index aIndex determines which style sheet is reloaded: 0 means the main style sheet, and numbers from 1 up refer to extra style sheets. Only style sheets loaded from files can be reloaded.
void CartoType::CFramework::RemoveObserver | ( | std::weak_ptr< MFrameworkObserver > | aObserver | ) |
Removes an observer.
TResult CartoType::CFramework::Resize | ( | int32_t | aViewWidth, |
int32_t | aViewHeight | ||
) |
Resizes the map, preserving the scale and view center. The height and width are in pixels.
double CartoType::CFramework::ResolutionDpi | ( | ) | const |
Returns the display resolution used by CartoType in dots per inch.
TResult CartoType::CFramework::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.
TResult CartoType::CFramework::Rotate | ( | double | aAngle | ) |
Rotates the map about the center of the display by an angle given in degrees.
TResult CartoType::CFramework::RotateAndZoom | ( | double | aAngle, |
double | aZoomFactor, | ||
double | aX, | ||
double | aY, | ||
TCoordType | aCoordType | ||
) |
Simultaneously rotates and zooms at a certain point given in aCoordType. The rotation is in degrees.
TResult CartoType::CFramework::RotateAt | ( | double | aAngle, |
double | aX, | ||
double | aY, | ||
TCoordType | aCoordType | ||
) |
Rotates the map about a specified point by an angle given in degrees.
double CartoType::CFramework::Rotation | ( | ) | const |
Returns the current rotation angle of the map in degrees.
const CRoute * CartoType::CFramework::Route | ( | ) | const |
Return the current main route, or null if there is none.
const CRoute * CartoType::CFramework::Route | ( | size_t | aIndex | ) | const |
Return any of the current routes, or null if there are none.
TRouteAccess CartoType::CFramework::RouteAccess | ( | TResult & | aError, |
const TPointFP & | aPoint, | ||
TCoordType | 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.
size_t CartoType::CFramework::RouteCalculationCost | ( | ) | const |
Returns an arbitrary number representing the cost of calculating a route. For internal use only.
size_t CartoType::CFramework::RouteCount | ( | ) | const |
Return the number of alternative routes. The return value is zero if no routes have been calculated, or the routes have been deleted.
TRouteCreationData CartoType::CFramework::RouteCreationData | ( | ) | const |
Returns the time it took to create the last route, and other data. Applies only to routes created synchronously, and not to those created via CreateBestRoute.
TPoint CartoType::CFramework::RouteEnd | ( | ) |
If a route exists, return the end of the route in map coordinates, otherwise return (0,0).
Creates route instructions for the current route as a string.
TPoint CartoType::CFramework::RouteStart | ( | ) |
If a route exists, return the start of the route in map coordinates, otherwise return (0,0).
TResult CartoType::CFramework::SaveMap | ( | uint32_t | aHandle, |
std::vector< uint8_t > & | aData, | ||
const TFindParam & | 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 aMapHandle is zero it means the in-memory map used for routing.
double CartoType::CFramework::ScaleDenominator | ( | ) | const |
Return the denominator of the scale fraction. For example, if the scale is 1:50,000 the value 50000 is returned. This is the overall scale of the projection and may be affected by distortion for some projections, particularly Mercator.
To get the true scale in the center of the map view, use GetScaleDenominatorInView.
double CartoType::CFramework::ScaleDenominatorFromZoomLevel | ( | double | aZoomLevel, |
int32_t | aImageSizeInPixels = 256 |
||
) | const |
Calculate 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.).
const TNavigatorTurn & CartoType::CFramework::SecondTurn | ( | ) | const |
When navigating, return any significant turn 100 metres or less after aFirstTurn. If its type is TTurnType::None there is no such turn. The iDistance member of the turn is the distance from the first turn to the second turn.
bool CartoType::CFramework::SetAnimateTransitions | ( | bool | aEnable | ) |
Enables or disables smoothly animated transitions in graphics-accelerated drawing. Returns the previous enabled state.
TBlendStyleSet CartoType::CFramework::SetBlendStyle | ( | const TBlendStyleSet * | 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.
TResult CartoType::CFramework::SetBuiltInProfile | ( | size_t | aIndex | ) |
Selects a built-in routing profile by its index. Routers allowing an arbitrary profile to be set have no built-in profiles. Contraction hierarchy routers have one or more built-in profiles.
void CartoType::CFramework::SetCase | ( | MString & | aString, |
TLetterCase | aCase | ||
) |
Sets the letter case of a string, using the current title-case exception dictionary to prevent words like 'of' being capitalised.
void CartoType::CFramework::SetCopyrightNotice | ( | ) |
Sets the copyright notice displayed at the bottom-right corner of the map to that of the main map database.
void CartoType::CFramework::SetCopyrightNotice | ( | const CString & | aCopyright | ) |
Sets the copyright notice displayed in the bottom-right corner of the map.
void CartoType::CFramework::SetDisabledLayers | ( | const std::set< CString > & | aLayerNames | ) |
Sets the currently disabled layers.
bool CartoType::CFramework::SetDraw3DBuildings | ( | bool | aEnable | ) |
Enables or disables the drawing of 3D buildings where data is available. Returns the previous enabled state.
TResult CartoType::CFramework::SetFollowMode | ( | TFollowMode | aFollowMode | ) |
Set the follow mode, which controls the way the map tracks the user location and heading.
void CartoType::CFramework::SetLabelUpAngleInRadians | ( | double | aAngle | ) |
Sets the up direction for labels using an angle in radians measured clockwise from straight up. If the angle is 0, labels are drawn normally.
void CartoType::CFramework::SetLabelUpVector | ( | TPointFP | aVector | ) |
Sets the up direction for labels using a vector. For example, if the up direction is (0,1) labels are drawn normally. The null vector is converted to (0,1); other values are converted to unit vectors.
void CartoType::CFramework::SetLegend | ( | const CLegend & | aLegend, |
double | aWidth, | ||
const char * | aUnit, | ||
const TExtendedNoticePosition & | aPosition | ||
) |
Sets the legend: any combination of map key, scale and turn instructions. The legend is copied.
void CartoType::CFramework::SetLegend | ( | std::unique_ptr< CLegend > | aLegend, |
double | aWidth, | ||
const char * | aUnit, | ||
const TExtendedNoticePosition & | aPosition | ||
) |
Sets the legend: any combination of map key, scale and turn instructions.
void CartoType::CFramework::SetLocale | ( | const char * | aLocale | ) |
Set the locale used when getting the names of map objects when routing, geocoding, etc. The value of aLocale is usually a two-letter language identifier like 'en' for English or 'fr' for French. Passing an empty or null string sets the locale to 'no locale'.
void CartoType::CFramework::SetLocationMatchParam | ( | const TLocationMatchParam & | aParam | ) |
Sets the current location match parameters. 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.
TResult CartoType::CFramework::SetMainProfile | ( | const TRouteProfile & | aProfile | ) |
Set 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 options ch, cs, ct, tech or tt), 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.
bool CartoType::CFramework::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.
void CartoType::CFramework::SetNavigationAutoReRoute | ( | bool | aAutoReRoute | ) |
Turn auto-re-routing in navigation on or off. By default it is turned on. If not, when re-routing is needed, the navigator state ReRouteNeeded 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.
void CartoType::CFramework::SetNavigationDistanceOffRouteTolerance | ( | int32_t | aMeters | ) |
Set the maximum distance from the route in meters before the vehicle is deemed off-route when navigating.
void CartoType::CFramework::SetNavigationMinimumFixDistance | ( | int32_t | aMeters | ) |
Set the minimum distance between location fixes in meters that is taken as an actual move when navigating.
void CartoType::CFramework::SetNavigationTimeOffRouteTolerance | ( | int32_t | aSeconds | ) |
Set the maximum time off route in seconds before a new route is calculated when navigating.
void CartoType::CFramework::SetNavigatorParam | ( | const TNavigatorParam & | aParam | ) |
Sets parameters affecting the working of the navigation system.
uint32_t CartoType::CFramework::SetNearbyObjectWarning | ( | TResult & | aError, |
uint32_t | aId, | ||
const CString & | aLayer, | ||
const CString & | aCondition, | ||
double | aMaxDistance, | ||
size_t | 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.
bool CartoType::CFramework::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.
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 (alpha = 191).
Roads use the night mode color blended with 50% white, and half the specified blend fraction. This increases contrast between roads and other features.
void CartoType::CFramework::SetPerspective | ( | bool | aSet | ) |
Turns perspective mode on or off.
void CartoType::CFramework::SetPerspective | ( | const TPerspectiveParam & | aParam | ) |
Turns perspective mode on and uses the supplied perspective parameters.
void CartoType::CFramework::SetPreferredRouterType | ( | TRouterType | 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.
void CartoType::CFramework::SetResolutionDpi | ( | double | aDpi | ) |
Sets the display resolution in dots per inch. Call this function to ensure that style sheet dimensions and font sizes given in inches, cm, pt, etc., are correct on the screen.
TResult CartoType::CFramework::SetRotation | ( | double | aAngle | ) |
Sets the map's orientation to an absolute angle given in degrees.
TResult CartoType::CFramework::SetRotationAt | ( | double | aAngle, |
double | aX, | ||
double | aY, | ||
TCoordType | aCoordType | ||
) |
Sets the map's orientation to a rotation about a specified point by an absolute angle given in degrees.
void CartoType::CFramework::SetScaleBar | ( | bool | aMetricUnits, |
double | aWidth, | ||
const char * | aUnit, | ||
const TExtendedNoticePosition & | aPosition | ||
) |
Creates a scale bar in either metric or imperial units, with a specified width and position in the display.
TResult CartoType::CFramework::SetScaleDenominator | ( | double | aScale | ) |
Set the scale, supplying the denominator of the scale fraction. For example, to set the scale to 1:50,000 use the statement SetScaleDenominator(50000).
This function sets the overall scale of the projection and may be affected by distortion for some projections, particularly Mercator.
To set the true scale in the center of the map view, use SetScaleDenominatorInView.
TResult CartoType::CFramework::SetScaleDenominatorInView | ( | double | aScale | ) |
Set the denominator of the scale fraction so that the desired scale applies to the center of the view, taking any scale distortion into account.
TResult CartoType::CFramework::SetStyleSheet | ( | const CString & | aStyleSheetFileName, |
size_t | aIndex = 0 |
||
) |
Set a style sheet by loading it from a file. The index aIndex determines which style sheet to replace: 0 means the main style sheet, and numbers from 1 up refer to extra style sheets.
TResult CartoType::CFramework::SetStyleSheet | ( | const CStyleSheetData & | aStyleSheetData, |
size_t | aIndex = 0 |
||
) |
Sets a style sheet from a CStyleSheetData object. The index aIndex determines which style sheet to replace: 0 means the main style sheet, and numbers from 1 up refer to extra style sheets.
TResult CartoType::CFramework::SetStyleSheet | ( | const CStyleSheetDataArray & | aStyleSheetDataArray, |
const CVariableDictionary * | aStyleSheetVariables = nullptr , |
||
const TBlendStyleSet * | aBlendStyleSet = nullptr |
||
) |
Sets all the style sheets, the style sheet variables, and the blend style. The style sheet variables are not set if aStyleSheetVariables is null.
TResult CartoType::CFramework::SetStyleSheet | ( | const uint8_t * | aData, |
size_t | aLength, | ||
size_t | aIndex = 0 |
||
) |
Set a style sheet by loading it from data in memory. The index aIndex determines which style sheet to replace: 0 means the main style sheet, and numbers from 1 up refer to extra style sheets.
void CartoType::CFramework::SetStyleSheetVariable | ( | const CString & | aVariableName, |
const CString & | aValue | ||
) |
Set a variable used in conditional compilation of the style sheet to a string value.
void CartoType::CFramework::SetStyleSheetVariable | ( | const CString & | aVariableName, |
int32_t | aValue | ||
) |
Set a variable used in conditional compilation of the style sheet to an integer value.
int32_t CartoType::CFramework::SetTileOverSizeZoomLevels | ( | int32_t | aLevels | ) |
Set the number of zoom levels by which to zoom out when creating a tile bitmap returned by TileBitmap().
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.
TResult CartoType::CFramework::SetTurnInstructions | ( | bool | aMetricUnits, |
bool | aAbbreviate, | ||
double | aWidth, | ||
const char * | aWidthUnit, | ||
const TExtendedNoticePosition & | aPosition, | ||
double | aTextSize = 7 , |
||
const char * | aTextSizeUnit = "pt" |
||
) |
Creates turn instructions in either metric or imperial units, with a specified width and position in the display.
void CartoType::CFramework::SetTurnInstructionText | ( | const CString & | 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 text or nullptr. This function has no effect if turn instructions have not been created using SetTurnInstructions, or have been disabled by calling EnableTurnInstructions(false).
|
inline |
Associates arbitrary data with this framework. Used by the Android SDK.
void CartoType::CFramework::SetVehiclePosOffset | ( | double | aXOffset, |
double | aYOffset | ||
) |
Set 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).
uint32_t CartoType::CFramework::SetVehicleTypeWarning | ( | TResult & | aError, |
double | aMaxDistance, | ||
size_t | 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.
TResult CartoType::CFramework::SetView | ( | const CGeometry & | aGeometry, |
int32_t | aMarginInPixels, | ||
int32_t | aMinScaleDenominator | ||
) |
Sets the view to show certain geometry, with a margin in pixels, and at a minimum scale.
TResult CartoType::CFramework::SetView | ( | const CMapObject & | aMapObject, |
int32_t | aMarginInPixels, | ||
int32_t | aMinScaleDenominator | ||
) |
Sets the view to show a single map object, with a margin in pixels, and at a minimum scale.
TResult CartoType::CFramework::SetView | ( | const CMapObject *const * | aMapObjectArray, |
size_t | aMapObjectCount, | ||
int32_t | aMarginInPixels, | ||
int32_t | aMinScaleDenominator | ||
) |
Sets the view to show a group of map objects (which must be in map coordinates), with a margin in pixels, and at a minimum scale. Does nothing if there are no objects.
TResult CartoType::CFramework::SetView | ( | const CMapObjectArray & | aMapObjectArray, |
int32_t | aMarginInPixels, | ||
int32_t | aMinScaleDenominator | ||
) |
Sets the view to show a group of map objects (which must be in map coordinates), with a margin in pixels, and at a minimum scale.
TResult CartoType::CFramework::SetView | ( | const TViewState & | aViewState | ) |
Sets the view to a view state, which specifies the display size, view rectangle, rotation and whether perspective is used.
TResult CartoType::CFramework::SetView | ( | double | aMinX, |
double | aMinY, | ||
double | aMaxX, | ||
double | aMaxY, | ||
TCoordType | aCoordType, | ||
int32_t | aMarginInPixels = 0 , |
||
int32_t | aMinScaleDenominator = 0 |
||
) |
Set 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.
TResult CartoType::CFramework::SetViewCenter | ( | double | aX, |
double | aY, | ||
TCoordType | aCoordType | ||
) |
Set the center of the map to the position (aX,aY), specifying the coordinate type, which may be display pixels, map coordinates or latitude and longitude.
TResult CartoType::CFramework::SetViewLimits | ( | double | aMinScaleDenominator, |
double | aMaxScaleDenominator, | ||
const CGeometry & | 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 geometry object to remove panning limits.
TResult CartoType::CFramework::SetViewLimits | ( | double | aMinScaleDenominator = 0 , |
double | aMaxScaleDenominator = 0 |
||
) |
Sets the limits to zooming and panning so that panning outside the map is prevented.
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 the map.
Use the value zero to remove either or both of the two zoom limits.
TResult CartoType::CFramework::SetViewToRoute | ( | size_t | aRouteIndex, |
int32_t | aMarginInPixels, | ||
int32_t | 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.
TResult CartoType::CFramework::SetViewToWholeMap | ( | ) |
Shows the whole map, zooming out as far as necessary.
TResult CartoType::CFramework::StartNavigation | ( | const TCoordSet & | aCoordSet, |
TCoordType | aCoordType | ||
) |
A version of StartNavigation that takes a TCoordSet and a TCoordType instead of a TRouteCoordSet. The current location match parameters are used.
TResult CartoType::CFramework::StartNavigation | ( | const TRouteCoordSet & | aCoordSet | ) |
Starts navigation through a set of at least two points. If the heading is known from previous navigation fixes, and it is not supplied with the first route point, it is used to decide the best starting direction for the route.
TResult CartoType::CFramework::StartNavigation | ( | double | aStartX, |
double | aStartY, | ||
TCoordType | aStartCoordType, | ||
double | aEndX, | ||
double | aEndY, | ||
TCoordType | aEndCoordType | ||
) |
Starts navigation from a start point to an end point, which may be in different coordinate systems. If the heading is known it is used to decide the best starting direction for the route. The current location match parameters are used.
void CartoType::CFramework::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.
TFileLocation CartoType::CFramework::StyleSheetErrorLocation | ( | ) | const |
Returns location information set by the last style sheet load operation.
CBitmap CartoType::CFramework::TileBitmap | ( | TResult & | aError, |
int32_t | aTileSizeInPixels, | ||
const CString & | aQuadKey, | ||
const TTileBitmapParam * | aParam = nullptr |
||
) |
Returns a bitmap containing a tile of the required coordinates and size, specified using a quad key. aParam controls whether map objects or labels are drawn, and whether labels are passed to an external handler.
CBitmap CartoType::CFramework::TileBitmap | ( | TResult & | aError, |
int32_t | aTileSizeInPixels, | ||
int32_t | aZoom, | ||
int32_t | aX, | ||
int32_t | aY, | ||
const TTileBitmapParam * | aParam = nullptr |
||
) |
Returns a bitmap containing a tile of the required coordinates and size, specified using OpenStreetMap tile coordinates. aParam controls whether map objects or labels are drawn, and whether labels are passed to an external handler.
CBitmap CartoType::CFramework::TileBitmap | ( | TResult & | aError, |
int32_t | aTileWidth, | ||
int32_t | aTileHeight, | ||
const TRectFP & | aBounds, | ||
TCoordType | aCoordType, | ||
const TTileBitmapParam * | aParam = nullptr |
||
) |
Return a bitmap containing a tile of the required coordinates and size, specified using degrees, map coordinates, etc. aParam controls whether map objects or labels are drawn, and whether labels are passed to an external handler.
CTimeAndDistanceMatrix CartoType::CFramework::TimeAndDistanceMatrix | ( | TResult & | aError, |
const std::vector< TPointFP > & | aFrom, | ||
const std::vector< TPointFP > & | aTo, | ||
TCoordType | aCoordType | ||
) |
Returns an object containing route times in seconds and distances in metres from aFrom to all points in aTo. 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.
CString CartoType::CFramework::TimeToString | ( | double | aTimeInSeconds | ) | const |
Returns a time duration as a string containing locale-dependent words for hours, minutes and seconds.
bool CartoType::CFramework::Tracking | ( | ) | const |
Returns true if tracking (storing and displaying track points) is on.
bool CartoType::CFramework::TrackIsDisplayed | ( | ) | const |
Returns true if the track is currently displayed.
double CartoType::CFramework::TrackLengthInMeters | ( | ) | const |
Returns the length of the current track in meters.
CString CartoType::CFramework::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.
void CartoType::CFramework::UnloadIcon | ( | const CString & | aId | ) |
Unload an icon previously loaded using LoadIcon.
TResult CartoType::CFramework::UnloadMapByHandle | ( | uint32_t | aHandle | ) |
Unload a map, selecting it by handle. It is illegal to unload the main map database or the in-memory database.
Use an existing route and display it.
If aReplace is true, delete all current routes, add the new route and make its profile the current profile. If aReplace is false, append the new route to the list of current routes.
Appending a route fails if the new route has a different start and end point from the current routes.
This function resets the navigation state and enables navigation.
void CartoType::CFramework::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.
If, when navigation data is loaded, either (i) the use of serialized data is disabled, or (ii) serialized data is not available, then navigation data is created from all loaded maps, not just the main map.
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.
TViewState CartoType::CFramework::ViewState | ( | ) | const |
Gets the current view state. This state can be saved, then restored using SetView(const TViewState&).
TResult CartoType::CFramework::WriteClosedLineTrafficMessageAsXml | ( | MOutputStream & | aOutput, |
const CTrafficInfo & | aTrafficInfo, | ||
const CString & | aId, | ||
const CRoute & | aRoute | ||
) |
Writes a traffic information message referring to an area defined by a closed line in the road network. The message is written in XML. aOutput is the stream to which the message is written. aTrafficInfo gives the traffic-related information, such as a speed restriction. aId gives the arbitrary identifier of the message. aRoute is a route object describing the line.
TResult CartoType::CFramework::WriteLineTrafficMessageAsXml | ( | MOutputStream & | aOutput, |
const CTrafficInfo & | aTrafficInfo, | ||
const CString & | aId, | ||
const CRoute & | aRoute | ||
) |
Writes a traffic information message referring to a line in the road network. The message is written in XML. aOutput is the stream to which the message is written. aTrafficInfo gives the traffic-related information, such as a speed restriction. aId gives the arbitrary identifier of the message. aRoute is a route object describing the line.
TResult CartoType::CFramework::WriteMapImage | ( | const CString & | aFileName, |
TFileType | aFileType, | ||
bool | aCompress = false |
||
) |
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.
TResult CartoType::CFramework::WriteRouteAsXml | ( | const CRoute & | aRoute, |
const CString & | aFileName, | ||
TFileType | aFileType = TFileType::CTROUTE |
||
) | const |
Write a route as XML in the format selected by aFileType: TFileType::CTROUTE or TFileType::GPX.
TResult CartoType::CFramework::WriteRouteAsXmlString | ( | const CRoute & | aRoute, |
std::string & | aXmlString, | ||
TFileType | aFileType = TFileType::CTROUTE |
||
) | const |
Write a route as an XML string, in the format selected by aFileType: TFileType::CTROUTE or TFileType::GPX.
Writes the current track to a file as XML in GPX format.
TResult CartoType::CFramework::WriteTrackAsXmlString | ( | std::string & | aXmlString | ) | const |
Writes the current track to a string as XML in GPX format.
TResult CartoType::CFramework::WriteTrafficMessageAsXml | ( | MOutputStream & | aOutput, |
const CTrafficInfo & | aTrafficInfo, | ||
CLocationRef & | aLocationRef | ||
) |
Writes a traffic information message. The message is written in XML. aOutput is the stream to which the message is written. aTrafficInfo gives the traffic-related information, such as a speed restriction. aLocationRef gives the location to which the information applies.
TResult CartoType::CFramework::Zoom | ( | double | aZoomFactor | ) |
Zooms in by a specified zoom factor, or zooms out if the zoom factor is less than 1.
TResult CartoType::CFramework::ZoomAt | ( | double | aZoomFactor, |
double | aX, | ||
double | aY, | ||
TCoordType | 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.
double CartoType::CFramework::ZoomLevelFromScaleDenominator | ( | double | aScaleDenominator, |
int32_t | aImageSizeInPixels = 256 |
||
) | const |
Calculate 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.
|
staticconstexpr |
The default size of the cache used by the image server.
|
staticconstexpr |
The maximum number of alternative routes that can be displayed simultaneously.