CMnGeocoder Class Reference

class CMnGeocoder : public CBase

Both geocoding (address to coordinate) and "reverse geocoding" (coordinate to address) features are provided by this class. Further in documentation they are all referred to as "geocoding" if not specified otherwise.

Geocoding operations are asynchronous, they can be cancelled by Cancel() . However only one asynchronous request can be issued at a time, otherwise client will be panicked with KMnPanicDuplicateRequest.

To create an instance of the class, use NewL or NewChainedL methods. They require an instance of CMnProvider, defined in Map and Navigation Provider Discovery API.

Main methods are FindCoordinateByAddressL (two overloads) and FindAddressByCoordinateL . Other methods define optional information that changes behavior of the class and others help to retrieve results of main methods' execution.

Since
3.1 mnclientlib.dll

Inherits from

Constructor & Destructor Documentation

CMnGeocoder()

CMnGeocoder()[private]

C++ constructor

~CMnGeocoder()

IMPORT_C~CMnGeocoder()

Destructor

Member Functions Documentation

Cancel()

IMPORT_C voidCancel()

ConstructChainedL(CMnProvider &)

voidConstructChainedL(CMnProvider &aProvider)[private]

Parameters

CMnProvider & aProvider

ConstructCommonL(CMnProvider &)

voidConstructCommonL(CMnProvider &aProvider)[private]

Parameters

CMnProvider & aProvider

ConstructNewL(CMnProvider &)

voidConstructNewL(CMnProvider &aProvider)[private]

Parameters

CMnProvider & aProvider

FindAddressByCoordinateL(const CPosLandmark &, TRequestStatus &)

IMPORT_C voidFindAddressByCoordinateL(const CPosLandmark &aLandmark,
TRequestStatus &aRequest
)

Coordinate information from passed landmark will be used. Any other helper information (like coverage radius, existing address information) can also be used. If it is not desired, then this information should be removed from landmark by client.

Only one address will be the result of this operation. If any ambiguities arise during translation, then Provider Application may query user to solve it. Set EOptionDialogDisabled to prevent this. Additional information (other than coordinate) found in landmark cannot be a reason for such a request.

Use RetrieveGeocodingResultL() to retrieve results of the operation.

This method can leave in case of memory lack or other system error. If it leaves, no asynchronous request is outstanding.

panic
"MnClientPanic"-KMnPanicDuplicateRequest New asynchronous request is issued before previous one is completed.

Parameters

const CPosLandmark & aLandmarkLandmark containing address information
TRequestStatus & aRequestContains result of the request, when it is completed. KErrNotFound if given address couldn't be resolved to coordinate (also due to disabling of query dialog). KErrCancel, if user has cancelled the operation. KErrArgument, if input landmark does not contain coordinate information (latitude and longitude are required). KErrNone if request is completed successfully.

FindCoordinateByAddressL(const CPosLandmark &, TRequestStatus &)

IMPORT_C voidFindCoordinateByAddressL(const CPosLandmark &aLandmark,
TRequestStatus &aRequest
)

Address information from passed landmark will be used.

Only one coordinate will be the result of this operation. If any ambiguities arise during translation, then Provider Application may query the user to solve it. Set EOptionDialogDisabled to prevent this.

Use RetrieveGeocodingResultL() to retrieve results of the operation.

This method can leave in case of memory lack or other system error. If it leaves, no asynchronous request is outstanding.

panic
"MnClientPanic"-KMnPanicDuplicateRequest New asynchronous request is issued before previous one is completed.

Parameters

const CPosLandmark & aLandmarkLandmark containing address information
TRequestStatus & aRequestContains result of the request, when it is completed. KErrNotFound if given address couldn't be resolved to coordinate (also due to disabling of query dialog). KErrCancel, if user has cancelled the operation. KErrArgument, if input landmark does not contain address information. KErrNone if request is completed successfully.

FindCoordinateByAddressL(const TDesC &, TRequestStatus &)

IMPORT_C voidFindCoordinateByAddressL(const TDesC &aAddress,
TRequestStatus &aRequest
)

This is the another overload, which accepts address input as plain string.

Only one coordinate will be the result of this operation. If any ambiguities arise during translation, then Provider Application may query the user to solve it. Set EOptionDialogDisabled to prevent this.

Use RetrieveGeocodingResultL() to retrieve results of the operation.

This method can leave in case of memory lack or other system error. If it leaves, no asynchronous request is outstanding.

panic
"MnClientPanic"-KMnPanicDuplicateRequest New asynchronous request is issued before previous one is completed.

Parameters

const TDesC & aAddressPlain address. Format of this string is not defined, this is barely how human user writes addresses down.
TRequestStatus & aRequestContains result of the request, when it is completed. KErrNotFound if given address couldn't be resolved to coordinate (also due to disabling of query dialog). KErrCancel, if user has cancelled the operation. KErrNone if request is completed successfully.

NewChainedL(CMnProvider &)

IMPORT_C CMnGeocoder *NewChainedL(CMnProvider &aProvider)[static]
leave
KErrNotSupported Selected Provider Application does not support CMnProvider::EServiceGeocoding .

Parameters

CMnProvider & aProviderProvider Application to be used for geocoding.

NewL(CMnProvider &)

IMPORT_C CMnGeocoder *NewL(CMnProvider &aProvider)[static]
leave
KErrNotSupported Selected Provider Application does not support CMnProvider::EServiceGeocoding .

Parameters

CMnProvider & aProviderProvider Application to be used for geocoding.

Options()

IMPORT_C TOptionsOptions()const

RemoveExitObserver()

IMPORT_C voidRemoveExitObserver()

RetrieveGeocodingResultL(CPosLandmark &)

IMPORT_C voidRetrieveGeocodingResultL(CPosLandmark &aTargetLandmark)

If last operation result was address then address information in the passed landmark is updated. If last operation result were coordinates, then coordinate information of the landmark is updated. Note that landmark is not stored in any database, client has to do it itself if needed.

Target landmark parameter does not have to be a different landmark then that was passed for geocoding or reverse geocoding. However, all address or coordinate (depending on last operation result type) information will be updated in target landmark.

Issuing next geocoding request discards current result.

leave
KErrNotFound Result is not available.

Parameters

CPosLandmark & aTargetLandmarkThis landmark will be updated according to last operation result.

SetExitObserverL(MAknServerAppExitObserver &)

IMPORT_C voidSetExitObserverL(MAknServerAppExitObserver &aObserver)
leave
KErrAlreadyExists if observer is already set.

Parameters

MAknServerAppExitObserver & aObserverExit observer.

SetOptions(TOptions)

IMPORT_C voidSetOptions(TOptionsaOptions)

Parameters

TOptions aOptionsBitmap of TOption values.

Member Enumerations Documentation

Enum TOption

Enumerators

EOptionNone = 0x00

Default value

EOptionDialogDisabled = 0x01

Defines that no queries to user are allowed during geocoding operations

Member Type Definitions Documentation

Typedef TOptions

typedef TUint32 TOptions

Type for bitmap of TOption values.

Member Data Documentation

CApaServerAppExitMonitor * iExitMonitor

CApaServerAppExitMonitor *iExitMonitor[private]

TOptions iOptions

TOptions iOptions[private]

RMnGeocodingServiceClient * iSession

RMnGeocodingServiceClient *iSession[private]