MapType

object MapType(source)

Map type constants for OpenMapView.

Defines 15 map tile styles from various providers. Twelve map types work without API keys, three require API keys from third-party providers.

Free Map Types (No API Key Required):

Premium Map Types (API Key Required):

  • CYCLEMAP: Thunderforest cycling map (requires Thunderforest API key)

  • TRANSPORT: Public transport focused map (requires Thunderforest API key)

  • TRANSPORT_DARK: Dark mode public transport map (requires Thunderforest API key)

  • TRACESTRACK_TOPO: Topographic with contours (requires Tracestrack API key)

API Key Configuration

Configure API keys in AndroidManifest.xml:

<meta-data
android:name="de.afarber.openmapview.THUNDERFOREST_API_KEY"
android:value="your_key_here"/>
<meta-data
android:name="de.afarber.openmapview.TRACESTRACK_API_KEY"
android:value="your_key_here"/>

Or programmatically:

ApiKeyManager.setApiKey("thunderforest", "your_key_here")

When an API key is required but not configured, OpenMapView displays the STANDARD map with an overlay indicating the missing key. The map remains interactive.

Obtaining API Keys

  • Thunderforest (CYCLEMAP, TRANSPORT, TRANSPORT_DARK): https://www.thunderforest.com/pricing/

  • Free tier: 150,000 tiles/month

  • Tracestrack (TRACESTRACK_TOPO): https://www.tracestrack.com/en/signup

  • Free tier: 100,000 tiles/month

See also

Properties

Link copied to clipboard
const val CARTO_DARK: Int = 11

Carto Dark - Dark theme basemap for night mode.

Link copied to clipboard
const val CARTO_LIGHT: Int = 10

Carto Light - Minimalist light basemap for data visualization.

Link copied to clipboard
const val CARTO_VOYAGER: Int = 12

Carto Voyager - Modern colorful basemap.

Link copied to clipboard
const val CYCLEMAP: Int = 3

Cycle Map - Thunderforest cycling map.

Link copied to clipboard
const val CYCLOSM: Int = 2

CyclOSM - Cycling-focused map from OpenStreetMap France.

Link copied to clipboard
const val HUMANITARIAN: Int = 7

Humanitarian - HOT style for emergency and disaster response.

Link copied to clipboard
const val NONE: Int = 0

No base map tiles displayed.

Link copied to clipboard
const val OPENTOPOMAP: Int = 9

OpenTopoMap - Free topographic map with elevation contours.

Link copied to clipboard
const val OPNVKARTE: Int = 8

OPNVKarte - German public transport map.

Link copied to clipboard
const val STAMEN_TONER: Int = 13

Stamen Toner - High-contrast black and white map.

Link copied to clipboard
const val STAMEN_WATERCOLOR: Int = 14

Stamen Watercolor - Artistic watercolor rendering.

Link copied to clipboard
const val STANDARD: Int = 1

Standard OpenStreetMap Mapnik rendering (default).

Link copied to clipboard
const val TRACESTRACK_TOPO: Int = 6

Tracestrack Topo - Topographic map with elevation contours.

Link copied to clipboard
const val TRANSPORT: Int = 4

Transport Map - Public transport focused map.

Link copied to clipboard
const val TRANSPORT_DARK: Int = 5

Transport Dark Map - Dark mode public transport map.