class CMnMapView : public CBase |
The ShowMapL() method allows to show map of some area, which can be specified by SetMapAreaL() . ShowCurrentLocationL() opens a map with current location in the center. SelectFromMapL() allows to ask user to select some location from the map. Client can request that some landmarks should be drawn on the map, when it is shown, by using AddLandmarksToShowL. Subsequent calls to this method will add landmarks to show list. To reset the list, call ResetLandmarksToShow .
Two overloads of AddLandmarksToShowL exist for linked and not linked landmarks. The linked landmark is the one, which has its landmark ID set. Linked landmarks are sent to Provider Application along with their landmark database URI, which allows Provider Application to get full category information of the landmark.
To create an instance of the class, use NewL or NewChainedL methods. They require instance of CMnProvider , defined in Map and Navigation Provider Discovery API.
Asynchronous operations can be cancelled by Cancel() . Only one asynchronous request can be issued at a time, otherwise client will be panicked with KMnPanicDuplicateRequest.
Private Member Functions | |
---|---|
CMnMapView () | |
CMnMapView (const CMnMapView &) | |
void | ConstructChainedL ( CMnProvider &) |
void | ConstructCommonL ( CMnProvider &) |
void | ConstructNewL ( CMnProvider &) |
HBufC * | LoadResourceTextL ( RFs &, const TDesC &, TInt ) |
void | PostConstructL () |
CMnMapView & | operator= (const CMnMapView &) |
Public Member Enumerations | |
---|---|
enum | TCurrentLocationOption { ECurrentLocationDisabled , ECurrentLocationEnabled , ECurrentLocationShowAlways } |
enum | TOption { EOptionNone , EOptionRestrictSelection } |
enum | TSelectionResultType { ESelectionNone , ESelectionFreeLandmark , ESelectionLandmarkIndex , ESelectionLinkedLandmark } |
Public Member Type Definitions | |
---|---|
typedef | TUint32 TOptions |
Private Attributes | |
---|---|
TCoordinate | iCentralPoint |
TCurrentLocationOption | iCurrentLocationOption |
HBufC * | iDefaultRequestText |
CApaServerAppExitMonitor * | iExitMonitor |
TOptions | iOptions |
TReal | iRadius |
RMnMapViewServiceClient * | iSession |
CMnMapView | ( | const CMnMapView & | ) | [private] |
const CMnMapView & |
IMPORT_C void | AddLandmarksToShowL | ( | const TDesC & | aDatabaseUri, |
RArray < TPosLmItemId > & | aLandmarkIds | |||
) |
Landmarks are passed along with URL of the database, where they reside. This allows to utilize category information from landmarks. If landmarks from several databases shall be shown, call this method for every such database. All landmarks are added to a single list. To clear that list, call ResetLandmarksToShow() .
const TDesC & aDatabaseUri | A database, to which belong landmarks, listed in aLandmarkIds parameter. |
RArray < TPosLmItemId > & aLandmarkIds | IDs of landmarks to add to show list. |
IMPORT_C void | AddLandmarksToShowL | ( | RPointerArray < CPosLandmark > & | aLandmarks | ) |
Landmarks are passed as instances. This variant is for passing landmarks, which are not stored in databases.
All landmarks are added to a single list. To clear that list, call ResetLandmarksToShow() .
With large amount of landmarks, it is recommended to use overload, which accepts linked landmarks, if possible.
RPointerArray < CPosLandmark > & aLandmarks | Array of landmarks to add to show list. |
IMPORT_C void | AddLandmarksToShowL | ( | RArray < TPtrC8 > & | aPackedLandmarks | ) |
Landmarks are passed as packed instances (see PosLandmarkSeriazation from Landmarks API). This overload is for passing landmarks, which are not stored in databases. It is more efficient than AddLandmarksToShowL( RPointerArray<CPosLandmark>& ) in terms of memory usage, if client already possess landmarks in packed form.
All landmarks are added to a single list. To clear that list, call ResetLandmarksToShow() .
With large amount of landmarks, it is recommended to use overload, which accepts linked landmarks, if possible.
void | ConstructChainedL | ( | CMnProvider & | aProvider | ) | [private] |
CMnProvider & aProvider |
void | ConstructCommonL | ( | CMnProvider & | aProvider | ) | [private] |
CMnProvider & aProvider |
void | ConstructNewL | ( | CMnProvider & | aProvider | ) | [private] |
CMnProvider & aProvider |
HBufC * | LoadResourceTextL | ( | RFs & | aFsSession, |
const TDesC & | aRscFile, | |||
TInt | aResourceId | |||
) | [private] |
IMPORT_C CMnMapView * | NewChainedL | ( | CMnProvider & | aProvider | ) | [static] |
CMnProvider & aProvider | Provider Application to be used for showing map. |
IMPORT_C CMnMapView * | NewL | ( | CMnProvider & | aProvider | ) | [static] |
CMnProvider & aProvider | Provider Application to be used for showing map. |
IMPORT_C CPosLandmark * | RetrieveSelectionResultL | ( | ) |
IMPORT_C void | RetrieveSelectionResultL | ( | TInt & | aLandmarkIndex | ) |
TInt & aLandmarkIndex | Index of a landmark passed as instance, which has been selected. |
IMPORT_C void | RetrieveSelectionResultL | ( | TPosLmItemId & | aLandmarkId, |
HBufC *& | aDatabaseUri | |||
) |
TPosLmItemId & aLandmarkId | On return, ID of selected landmark in the database, specified by aDatabaseUri. |
HBufC *& aDatabaseUri | On return, URI of the database of selected landmark. Client takes ownership. |
IMPORT_C void | SelectFromMapL | ( | TRequestStatus & | aStatus | ) |
If EOptionsRestrictSelection option is set, then user can select only those landmarks, which are specified with one of AddLandmarksToShowL overrides. Otherwise any location is allowed to be selected.
User is shown a view with default selection request text. This text can be overridden with SetCustomRequestTextL() .
See SelectionResultType() for how to retrieve selection result.
This is asynchronous request and can be cancelled with Cancel() .
This method can leave in case of memory lack or other system error. If it leaves, no asynchronous request is outstanding.
TRequestStatus & aStatus | Status of asynchronous operation. Contains error code, when request is completed: KErrNone, if user has made selection, KErrCancel - if request is cancelled, or user refused to make selection. KErrArgument if no landmarks to be shown are specified and ERestrictSelection is set. Otherwise any of system-wide error codes. |
IMPORT_C void | SetCurrentLocationOption | ( | TCurrentLocationOption | aCurrentLocationOption | ) |
TCurrentLocationOption aCurrentLocationOption | One of TCurrentLocationOption values. |
IMPORT_C void | SetCustomRequestTextL | ( | const TDesC & | aCustomText | ) |
If not specified, than default request text will be used (as defined in UI specification). New setting will have effect only for next map display request.
const TDesC & aCustomText | Text to be shown as selection request to user. |
IMPORT_C void | SetExitObserverL | ( | MAknServerAppExitObserver & | aObserver | ) |
MAknServerAppExitObserver & aObserver | Exit observer. |
IMPORT_C void | SetMapAreaL | ( | const TCoordinate & | aCentralPoint, |
TReal | aRadius | |||
) |
const TCoordinate & aCentralPoint | Point on the Earth to be shown in the center of map view. This setting is ignored, when ShowCurrentLocationL() is called. |
TReal aRadius | Radius in meters of the area around central point, which should be visible, when map is shown. If this setting is too small, then Provider Application selects smallest possible radius (maximum zoom). If NaN, then Provider Application automatically selects appropriate zoom. This setting is ignored if ECurrentLocationShowAlways is set. |
IMPORT_C void | SetOptions | ( | TOptions | aOptions | ) |
TOptions aOptions | Bitmap of TOption values. |
IMPORT_C void | ShowCurrentLocationL | ( | ) |
This method completes as soon as request reaches Provider Application. Map is shown then in Provider Application's process.
Same options are applied to this method as to ShowMapL() (with the exception that area center point is ignored)
IMPORT_C void | ShowMapL | ( | ) |
This method completes as soon as request reaches Provider Application. Map is shown then in Provider Application's process.
If map area is specified by SetMapAreaL() , then this area of map will be visible, when it is shown. Otherwise, if only list of landmarks to show is specified, then area covering all landmarks is visible. If Current Location Option is set to ECurrentLocationShowAlways , then it may modify visible area.
If neither area nor landmarks are specified, and current location option is not "always", then simply last shown map (as determined by selected provider application) is shown. If map was never shown before, then Provider Application shows map from its default position.
CMnMapView & | operator= | ( | const CMnMapView & | ) | [private] |
const CMnMapView & |
ECurrentLocationDisabled |
Current location is not shown (default). |
ECurrentLocationEnabled |
Current location is shown only if it's within visible area |
ECurrentLocationShowAlways |
Current location is visible always. Provider Application selects appropriate zoom (and position, if area center is not specified) to make sure current location is visible. |
EOptionNone |
Default value |
EOptionRestrictSelection |
Defines that only landmarks specified by AddLandmarksToShowL are allowed to be selected by user. |
ESelectionNone |
Undefined result |
ESelectionFreeLandmark |
Free location has been selected. Use RetrieveSelectionResultL() to get result of selection. |
ESelectionLandmarkIndex |
One of landmarks passed by instance has been selected. Use RetrieveSelectionResultL(TInt&) to get result of selection. |
ESelectionLinkedLandmark |
One of landmarks passed as landmark ID and database URI has been selected. Use RetrieveSelectionResultL(TPosLmItemId&, HBufC*&) to get result of selection. |
TCurrentLocationOption | iCurrentLocationOption | [private] |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.