Api Key Manager
Manages API keys for third-party tile providers.
Some map types (CYCLEMAP, TRANSPORT, TRANSPORT_DARK, TRACESTRACK_TOPO) require API keys from tile providers. Keys can be configured in two ways:
1. AndroidManifest.xml (Recommended):
<application>
<meta-data
android:name="de.afarber.openmapview.THUNDERFOREST_API_KEY"
android:value="your_thunderforest_key_here"/>
<meta-data
android:name="de.afarber.openmapview.TRACESTRACK_API_KEY"
android:value="your_tracestrack_key_here"/>
</application>Content copied to clipboard
2. Programmatically (Runtime):
ApiKeyManager.setApiKey("thunderforest", "your_key_here")
ApiKeyManager.setApiKey("tracestrack", "your_key_here")Content copied to clipboard
API keys set programmatically override keys from the manifest.
Provider Names
"thunderforest"- For CYCLEMAP, TRANSPORT, and TRANSPORT_DARK map types"tracestrack"- For TRACESTRACK_TOPO map type
Obtaining API Keys
Thunderforest: https://www.thunderforest.com/pricing/ (Free: 150k tiles/month)
Tracestrack: https://www.tracestrack.com/en/signup (Free tier available)