CPosLmNearestCriteria Class Reference

class CPosLmNearestCriteria : public CPosLmSearchCriteria

Criterion for finding the landmarks which are closest to a certain coordinate, called "center coordinate".

When using CPosLmNearestCriteria , the matches returned in the search are sorted in ascending distance order if the client does not specify other sort preferences.

By default, this search returns all landmarks in the database, except those which have no coordinates. It is recommended to specify a maximum distance to narrow down the search. This is done by SetMaxDistance .

The client can specify if the coverage radius should be used. If coverage radius is used, the distance to the landmark coverage area border is used instead of the distance to the landmark coverage area center. If the source coordinate is inside the landmark coverage area, the distance is considered zero. By default, the coverage radius is not used.

This criterion is only valid when searching for landmarks, i.e. if it is passed to CPosLandmarkSearch::StartCategorySearchL, the function will fail with error code KErrArgument.

eposlmsearchlib.lib
Since
S60 3.0

Inherits from

Constructor & Destructor Documentation

CPosLmNearestCriteria(TBool)

CPosLmNearestCriteria(TBoolaUseCoverageRadius)[private]

Parameters

TBool aUseCoverageRadius

CPosLmNearestCriteria(const CPosLmNearestCriteria &)

CPosLmNearestCriteria(const CPosLmNearestCriteria &)[private]

Parameters

const CPosLmNearestCriteria &

~CPosLmNearestCriteria()

~CPosLmNearestCriteria()[virtual]

Destructor.

Member Functions Documentation

ConstructL(const TCoordinate &)

voidConstructL(const TCoordinate &aCoordinate)[private]

Parameters

const TCoordinate & aCoordinate

GetCoordinate(TCoordinate &)

IMPORT_C voidGetCoordinate(TCoordinate &aCoordinate)const

Returns the center coordinate of the search.

Parameters

TCoordinate & aCoordinateOn return, contains the center coordinate.

MaxDistance()

IMPORT_C TReal32MaxDistance()const

Returns whether the search should be limited to landmarks which are closer than a maximum distance.

By default the maximum distance is set to NaN which means that the distance is unlimited.

NewLC(const TCoordinate &, TBool)

IMPORT_C CPosLmNearestCriteria *NewLC(const TCoordinate &aCoordinate,
TBoolaUseCoverageRadius = EFalse
)[static]

Two-phased constructor.

Latitude and longitude must be set in the coordinate (not NaN). Altitude is ignored.

panic
"Landmarks Client"-EPosNaNCoordinate Latitude and/or longitude is NaN.

Parameters

const TCoordinate & aCoordinateThe center coordinate of the landmark search.
TBool aUseCoverageRadius = EFalseETrue if coverage radius should be considered in the search.

SetCoordinate(const TCoordinate &)

IMPORT_C voidSetCoordinate(const TCoordinate &aCoordinate)

Set the center coordinate of the search.

Latitude and longitude must be set in the coordinate (not NaN). Altitude is ignored.

panic
"Landmarks Client"-EPosNaNCoordinate Latitude and/or longitude is NaN.

Parameters

const TCoordinate & aCoordinateThe center coordinate of the landmarks search.

SetMaxDistance(TReal32)

IMPORT_C voidSetMaxDistance(TReal32aMaxDistance)

Set a maximum distance for the search.

Only landmarks, which are closer to the center coordinate than the maximum distance are considered matches.

Parameters

TReal32 aMaxDistanceThe maximum distance or NaN if the distance should be unlimited.

SetUseCoverageRadius(TBool)

IMPORT_C voidSetUseCoverageRadius(TBoolaUseCoverageRadius)

Set if coverage radius should be considered in the search.

Parameters

TBool aUseCoverageRadiusETrue if coverage radius should be considered in the search. EFalse otherwise.

UseCoverageRadius()

IMPORT_C TBoolUseCoverageRadius()const

Returns if coverage radius is considered in the search.

operator=(const CPosLmNearestCriteria &)

CPosLmNearestCriteria &operator=(const CPosLmNearestCriteria &)[private]

Parameters

const CPosLmNearestCriteria &

Member Data Documentation

TCoordinate iCenterCoordinate

TCoordinate iCenterCoordinate[private]

TReal32 iMaxDistance

TReal32 iMaxDistance[private]

TBool iUseCoverageRadius

TBool iUseCoverageRadius[private]