|
CartoType API
|
#include <cartotype_map_data.h>
Public Member Functions | |
| virtual CMapDataContext * | NewContext (TResult &aError)=0 |
| void | SetFileInputStream (CFileInputStream *aFileInputStream) |
| const CFileInputStream * | FileInputStream () const |
| const TMapGrid & | Grid () const |
| const TRect & | Extent () const |
| const TRect & | InitialView () const |
| int32 | Layers () const |
| const MString & | DataSetName () const |
| const MString & | Copyright () const |
| const TDataVersion & | DataVersion () const |
| CT_IMPORT int32 | LayerIndex (TResult &aError, const MString &aLayerName) const |
| CMapDataLayer & | Layer (int32 aIndex) |
| const TCoordinateTransform * | Projection () const |
| CT_IMPORT TResult | Find (const TPoint &aPoint, int32 aRadius, CPointerArray< CMapObject > &aObject, int32 aMaxObjects, bool aClearArray) |
| CT_IMPORT TResult | FindInLayer (const MString &aLayer, const TPoint &aPoint, int32 aRadius, CPointerArray< CMapObject > &aObject, int32 aMaxObjects, bool aClearArray) |
| void | SetTile (int32 aZoom, int32 aX, int32 aY) |
| void | GetTile (int32 &aZoom, int32 &aX, int32 &aY) |
Protected Member Functions | |
| void | SetGrid (const TMapGrid &aGrid) |
| void | SetExtent (const TRect &aExtent) |
| void | SetInitialView (const TRect &aInitialView) |
| CT_IMPORT TResult | AppendLayer (CMapDataLayer *aLayer) |
| void | SetDataVersion (const TDataVersion &aDataVersion) |
| TResult | SetDataSetName (const MString &aDataSetName) |
| TResult | SetCopyright (const MString &aCopyright) |
| void | SetProjection (TCoordinateTransform *aProjection) |
A map database object provides access to the data in a single data set. It can create context objects that act as iterators and filters for the data, and supply information about the data set like its spatial extent and the data layers that are present.
| CT_EXPORT TResult CMapDataBase::AppendLayer | ( | CMapDataLayer * | aLayer | ) | [protected] |
Append a layer to to the database, which takes ownership of it. If the layer cannot be stored it is deleted.
| const TRect& CartoType::CMapDataBase::Extent | ( | ) | const [inline] |
Return the extent of the whole of the map data, in coordinates defined by Grid().
| CT_EXPORT TResult CMapDataBase::Find | ( | const TPoint & | aPoint, |
| int32 | aRadius, | ||
| CPointerArray< CMapObject > & | aObject, | ||
| int32 | aMaxObjects, | ||
| bool | aClearArray | ||
| ) |
Find objects within the distance aRadius of aPoint, which is in map coordinates. The objects that are returned are unprojected. The objects are actually within the square centred on aRadius, not the circle, which makes searching easier.
The number of objects returned can be limited by setting aMaxObjects to an appropriate value.
If aClearArray is true the destination array is cleared before the objects are appended.
| CT_EXPORT TResult CMapDataBase::FindInLayer | ( | const MString & | aLayer, |
| const TPoint & | aPoint, | ||
| int32 | aRadius, | ||
| CPointerArray< CMapObject > & | aObject, | ||
| int32 | aMaxObjects, | ||
| bool | aClearArray | ||
| ) |
Find objects in a named layer, within the distance aRadius of aPoint, which is in map coordinates. The objects that are returned are unprojected. The objects are actually within the square centred on aRadius, not the circle, which makes searching easier.
The number of objects in aObject can be limited by setting aMaxObjects to an appropriate value.
If aClearArray is true the destination array is cleared before the objects are appended.
| void CartoType::CMapDataBase::GetTile | ( | int32 & | aZoom, |
| int32 & | aX, | ||
| int32 & | aY | ||
| ) | [inline] |
Get the tile zoom level and coordinates used as a hint to tile-based databases.
| const TRect& CartoType::CMapDataBase::InitialView | ( | ) | const [inline] |
Return the preferred initial displayed area of the map. It is normally the same as the extent of the whole of the data, but may be made smaller to make initial display faster.
Search layer by name and return index.
| const TCoordinateTransform* CartoType::CMapDataBase::Projection | ( | ) | const [inline] |
Return the projection used to convert the original data from latitude and longitude to metres. It is stored in serialized form in the CTM1 data format. If it is not available in the current data, or if the data is in unprojected (latitude and longitude) format, return null.
| void CartoType::CMapDataBase::SetTile | ( | int32 | aZoom, |
| int32 | aX, | ||
| int32 | aY | ||
| ) | [inline] |
Set the tile zoom level and coordinates as a hint to tile-based databases.
1.7.5.1