MapLibAPI requires three support classes in order to function. The first is a config class called
MapLibInitialConfig, which describes MapLib-specific settings which can only be set at the point of instantiation, not at run-time.
The second one is a drawing context for MapLib. MapLib can use different map renderers for different platforms, and this class encapsulates this behavior. Since it is platform specific, it needs to be instantiated using a factory class which is implemented for the intended platform, for example
GtkFactory for the Linux platform and
WinMobileFactory for Windows Mobile.
The last class deals with the network connection necessary to download maps. This class is called
DBufConnection. If MapLibAPI is intended to be used as a standalone, i.e. without a connection to Nav2API, an instance of such a class can be instantiated using factory methods. The
DBufConnection is then obtained in two steps:
MapLibNetworkContext, for instance by calling
SamsungLiMoFactoryfor SamsungLiMo specific network support or in
SymbianFactoryfor Symbian specific network support.
getConnection()on the network context. Be sure to only release the
MapLibNetworkContextonce MapLib is properly shutdown.
MapLibAPI itself can then be created using
createMapLib() in the factory class, supplying the resulting
If you intend to use MapLibAPI together with Nav2API instead (which is recommended if Nav2API is used), you can get the network connection from Nav2API using the
getDBufConnection() function, once Nav2LibAPI is properly started. Then supply the
DBufConnection from Nav2LibAPI into the
createMapLib() factory function. Once this is done, MapLibAPI must be connected to Nav2LibAPI by calling
Once instantiated, MapLib will need to initialize itself by downloading various information from the server. This process is automatically started after the factory function
createMapLib() is called. It is possible to register a listener to get notified once MapLib is properly started by calling
The core of MapLibAPI consists of various interfaces that are used to interact with a customizable map view.
These are all accessed from the MapLibAPI class, and they all require that MapLibAPI is properly initialized. Notification of this state can be registering a class derived from
The drawing interface is a very simple interface that exposes drawing related operations. It has support for triggering either immediate or delayed redraws of the map.
MapDrawingInterface.h for more information about this API.
The key interface is used to forward key input and pointer events to MapLib, so that it can respond to user input.
MapLibKeyInterface.h for more information about this API.
This class supports various operations on a map, such as zooming, rotating and moving it.
MapOperationInterface.h for more information about this API.
Use this class to configure MapLib to your liking. Here you can enable 3d mode, night mode and other features.
ConfigInterface.h for more information about this API.
This interface can be used to add callbacks that are notified whenever objects are selected on the map.
MapObjectInterface.h for more information about this API.
With this interface you can add custom objects to the map view. Multiple layers are supported.
OverlayInterface.h for more information about this information.
The Nav2API has a main class called Nav2API that holds all the parts of the API. These parts are described in the sections below. A MapLibAPI object can be connected to a Nav2API object using the connectMapLib function in Nav2API, a connected MapLib uses Nav2API for server communication and for storage of settings.
The construction of Nav2API is two phased. First the Nav2API object is made then the asynchronous start function is called with the initialization data and a
Nav2StatusListener object. After the Nav2API has started up, the
Nav2StatusListener is called.
The search is based on two text input fields, what and where, and a selectable region as user input. The selectable regions can be retrieved using the
getTopRegions() function. When the user has made the input it is put into a
SearchQuery object and sent as an asynchronous request using the search function. The result is then received in the
The search result is divided into several
SearchHeadings which in turn contains a list of
SearchItems describes a point hit and
SearchAreas describes a selection of areas to be selected and searched again to get
Previous search inputs are stored in Nav2API and are available through the
getSearchHistory() function. The available
SearchHeadings can be retrieved using the
SearchInterface.h for more information about the Search API.
RouteInterface routes are made from point A to point B. A route can be made using the asynchronous
routeToCoordinate() functions. When the
RouteListener::routeReply() function has been called the route itinerary is available via the getRouteList()
function. The current route in RouteInterface
is used by the NavigationInterface` for turn by turn navigation.
RouteInterface.h for more information about the route API.
NavigationInterface uses the current route in the
RouteInterface to give turn by turn instructions with continuous updates to the
NavigationInterface.h for more information about the Navigation API.
Nav2API provides functionality for favourite management and storage of favourite locations. Each favourite contains information in the form of a name, description, position and some optional additional information.
FavouriteInterface.h for more information about this API.
LocationInterface is the source for position updates from either GPS or Cell ID depending on what service is available.Through this interface it is also possible to do reverse geocoding.
LocationInterface.h for more information about this API.
SettingInterface the Nav2API can be configured while the application is running. There is a group of settings that is for the connected MapLibAPI and the settings are set in the connected MapLibAPI object if one is set. Setting are stored in Nav2API between application restarts.
The following settings are set in the connected MapLibAPI:
SettingsInterface.h for more information about this API.
Here the preferred network link can be set and tested. Depending on the platform the NetworkID can be different identifications like PDP id and API id.
NetworkInterface.h for more information about this API.
Image names from
SearchDescs can be retrieved in this interface. The image name is sent in to the getImage function and received in the
ImageListener when the image is downloaded. Images can be retrieved in a buffer or as a downloaded file.
ImageInterface.h for more information about this API.
The tunnel interface can be used to tunnel data from the server and it can be any kind of data.
TunnelInterface.h for more information about this API.
An interface to control billing transaction and verify a transaction has succeeded completely.
BillingInterface.h for more information about this API.