MapType

object MapType(source)

Map type constants for OpenMapView.

Defines 15 map tile styles from various providers. Six map types (including NONE) work without API keys, nine require API keys from third-party providers.

Free Map Types (No API Key Required):

  • NONE: No base map tiles

  • STANDARD: Default OpenStreetMap Mapnik rendering

  • CYCLOSM: Cycling-focused map from OpenStreetMap France

  • HUMANITARIAN: Humanitarian OSM style for emergency response

  • OPNVKARTE: German public transport map

  • OPENTOPOMAP: Free topographic map with contours

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)

  • CARTO_LIGHT: Minimalist light theme for data visualization (requires CARTO API key)

  • CARTO_DARK: Dark theme for night mode (requires CARTO API key)

  • CARTO_VOYAGER: Modern colorful basemap (requires CARTO API key)

  • STAMEN_TONER: High-contrast black and white (requires Stadia Maps API key)

  • STAMEN_WATERCOLOR: Artistic watercolor rendering (requires Stadia Maps 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"/>
<meta-data
android:name="de.afarber.openmapview.CARTO_API_KEY"
android:value="your_key_here"/>
<meta-data
android:name="de.afarber.openmapview.STADIA_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

  • CARTO (CARTO_LIGHT, CARTO_DARK, CARTO_VOYAGER): https://carto.com/basemaps/apikey

  • Free tier: 5,000,000 tiles/month for non-commercial use, 1,000,000 for commercial use

  • Stadia Maps (STAMEN_TONER, STAMEN_WATERCOLOR): https://client.stadiamaps.com/signup/

  • Free tier: 200,000 tiles/month for non-commercial use

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.