Skip to content

Other included layers

nutiteq edited this page Aug 14, 2012 · 3 revisions

Here are some layer class descriptions. Detailed instructions and code samples are yet to be added.

Raster layers

TMSMapLayer

Most common online map layer type, for "google maps" style tiled map sources. You can use it for free providers like OpenStreetMap, MapQuest, also commercial providers like CloudMade, Navteq MapTP. You define base URL for tiles and that's it.

MBTilesMapLayer

Read offline maps from MBTiles format database file via SQLite.

PackagedMapLayer

Put map tiles to /res/raw/tz_x_y.png files for offline usage, so they are bundled with the app. Easy to set up, but there are limits how big .apk file can become (officially 50MB, but many users would already hate so big installer) , so you can put limited number of map tiles there in practise.

StoredMapLayer

Special format coming from the vintage MGMaps application (MGM). Similar to MBTiles in principle, but instead of sqlite uses set of files. Provided for legacy support reasons, for new apps we suggest MBTiles instead.

MapsforgeMapLayer

Experimental layer which uses Mapsforge - free offline vector-based map rendering system as map tile source. As Mapsforge uses efficient vector format for data storage, then data packages are significantly smaller than with e.g. MBTiles, and you have some other vector advantages like possibility to restyle offline maps, and make some queries (e.g. have interactive POI layer) on same dataset.

Vector layers

GeometryLayer

You can add VectorObjects using API calls: Points, Lines, Polygons

GeometryDBLayer

Loads data from Spatialite database file. Supports spatial indexes for large datasets; so it scales to millions of objects quite well. NB! Spatialite library (as native, can be prebuilt package) has to be added to app project to use this, it is not included with the sample project.

MarkerLayer

Special layer to add Markers and DynamicMarkers. Marker is pin on map which is shown as "standing up" in 2.5 view mode

TextLayer

Text objects. It is useful to have base map without labels, and add labels as TextLayer, this way you have texts with correct orientation, when map is rotated.

3D Vector layers

Polygon3DLayer

Can add 3D polygons via API. 3D polygon means polygon with height, it does not support more complex objects. It is useful for rendering simple data, e.g. OpenStreetMap buildings or building footprints from other sources

Polygon3DDbLayer

Load 3D polygons from Spatialite file, where data is given as normal polygons, so just height is applied to them to create 3D look.

NMLModelDbLayer

Load 3D models - real models with textures - from SQLite database in special mobile-optimised 3D format (NML). We have special converter which creates NML files from KMZ (as exported from SketchUp or Google 3D Warehouse). This supports most Collada features like textures, meshes etc.

Own map layer

Last but not least - in application you define own map layer types by extending VectorLayer, RasterLayer or some existing other layer.

Clone this wiki locally