public interface IConfigurationProvider
OpenStreetMapTileProviderConstants
Modifier and Type | Method and Description |
---|---|
Map<String,String> |
getAdditionalHttpRequestProperties()
Enables you to set and get additional HTTP request properties.
|
int |
getAnimationSpeedDefault()
Used during zoom animations
https://github.com/osmdroid/osmdroid/issues/650
|
int |
getAnimationSpeedShort()
Used during zoom animations
https://github.com/osmdroid/osmdroid/issues/650
|
short |
getCacheMapTileCount()
Initial tile cache size (in memory).
|
short |
getCacheMapTileOvershoot()
In memory tile count, used by the tiles overlay
|
long |
getExpirationExtendedDuration()
Returns the amount of time in ms added to server specified tile expiration time
Added as part of issue https://github.com/osmdroid/osmdroid/issues/490
|
Long |
getExpirationOverrideDuration()
Optional period of time in ms that will override any downloaded tile's expiration timestamp
|
long |
getGpsWaitTime()
The time we wait after the last gps location before using a non-gps location.
|
SimpleDateFormat |
getHttpHeaderDateTimeFormat() |
Proxy |
getHttpProxy() |
File |
getOsmdroidBasePath()
Base path for osmdroid files.
|
File |
getOsmdroidTileCache()
by default, maps to getOsmdroidBasePath() + "/tiles"
By default, it is defined in SD card, osmdroid directory.
|
short |
getTileDownloadMaxQueueSize() |
short |
getTileDownloadThreads()
number of tile download threads, conforming to OSM policy:
http://wiki.openstreetmap.org/wiki/Tile_usage_policy
default is 2
|
long |
getTileFileSystemCacheMaxBytes()
default is 600 Mb
|
long |
getTileFileSystemCacheTrimBytes()
When the cache size exceeds maxCacheSize, tiles will be automatically removed to reach this target.
|
short |
getTileFileSystemMaxQueueSize() |
short |
getTileFileSystemThreads()
used for both file system cache and the sqlite cache
|
String |
getUserAgentHttpHeader()
"User-Agent" is the default value and standard used throughout all http servers, unlikely to change
When calling @link
load(Context, SharedPreferences) , it is set to
Context.getPackageName() which is defined your manifest file |
String |
getUserAgentValue() |
boolean |
isDebugMapTileDownloader() |
boolean |
isDebugMapView()
Typically used to enable additional debugging
from
org.osmdroid.views.util.constants.MapViewConstants |
boolean |
isDebugMode()
Typically used to enable additional debugging
from
OpenStreetMapTileProviderConstants |
boolean |
isDebugTileProviders()
Typically used to enable additional debugging
from
OpenStreetMapTileProviderConstants |
boolean |
isMapViewHardwareAccelerated()
default is false
|
boolean |
isMapViewRecyclerFriendly()
If true, the map view will set .setHasTransientState(true) for API 16+ devices.
|
void |
load(Context ctx,
SharedPreferences preferences)
loads the configuration from shared preferences, if the preferences defined in this file are not already
set, them they will be populated with defaults.
|
void |
save(Context ctx,
SharedPreferences preferences)
saves the current configuration to the shared preference location
|
void |
setAnimationSpeedDefault(int durationsMilliseconds)
Used during zoom animations
https://github.com/osmdroid/osmdroid/issues/650
|
void |
setAnimationSpeedShort(int durationsMilliseconds)
Used during zoom animations
https://github.com/osmdroid/osmdroid/issues/650
|
void |
setCacheMapTileCount(short cacheMapTileCount)
Initial tile cache size (in memory).
|
void |
setCacheMapTileOvershoot(short value)
In memory tile count, used by the tiles overlay
|
void |
setDebugMapTileDownloader(boolean debugMapTileDownloader) |
void |
setDebugMapView(boolean debugMapView) |
void |
setDebugMode(boolean debugMode) |
void |
setDebugTileProviders(boolean debugTileProviders) |
void |
setExpirationExtendedDuration(long period)
Optionally extends the amount of time that downloaded tiles remain in the cache beyond either the
server specified expiration time stamp or the default expiration time {
OpenStreetMapTileProviderConstants.DEFAULT_MAXIMUM_CACHED_FILE_AGE } |
void |
setExpirationOverrideDuration(Long period)
Optional period of time in ms that will override any downloaded tile's expiration timestamp
|
void |
setGpsWaitTime(long gpsWaitTime)
The time we wait after the last gps location before using a non-gps location.
|
void |
setHttpHeaderDateTimeFormat(SimpleDateFormat httpHeaderDateTimeFormat) |
void |
setHttpProxy(Proxy httpProxy) |
void |
setMapViewHardwareAccelerated(boolean mapViewHardwareAccelerated)
must be set before the mapview is created or inflated from a layout.
|
void |
setMapViewRecyclerFriendly(boolean enabled)
If true, the map view will set .setHasTransientState(true) for API 16+ devices.
|
void |
setOsmdroidBasePath(File osmdroidBasePath)
Base path for osmdroid files.
|
void |
setOsmdroidTileCache(File osmdroidTileCache)
by default, maps to getOsmdroidBasePath() + "/tiles"
Sets the location where the tile cache is stored.
|
void |
setTileDownloadMaxQueueSize(short tileDownloadMaxQueueSize) |
void |
setTileDownloadThreads(short tileDownloadThreads) |
void |
setTileFileSystemCacheMaxBytes(long tileFileSystemCacheMaxBytes) |
void |
setTileFileSystemCacheTrimBytes(long tileFileSystemCacheTrimBytes) |
void |
setTileFileSystemMaxQueueSize(short tileFileSystemMaxQueueSize) |
void |
setTileFileSystemThreads(short tileFileSystemThreads)
used for both file system cache and the sqlite cache
|
void |
setUserAgentHttpHeader(String userAgentHttpHeader)
"User-Agent" is the default value and standard used throughout all http servers, unlikely to change
When calling @link
load(Context, SharedPreferences) , it is set to
Context.getPackageName() which is defined your manifest file |
void |
setUserAgentValue(String userAgentValue)
Enables you to override the default "osmdroid" value for HTTP user agents.
|
long getGpsWaitTime()
void setGpsWaitTime(long gpsWaitTime)
gpsWaitTime
- boolean isDebugMode()
OpenStreetMapTileProviderConstants
void setDebugMode(boolean debugMode)
boolean isDebugMapView()
org.osmdroid.views.util.constants.MapViewConstants
void setDebugMapView(boolean debugMapView)
boolean isDebugTileProviders()
OpenStreetMapTileProviderConstants
void setDebugTileProviders(boolean debugTileProviders)
boolean isDebugMapTileDownloader()
void setDebugMapTileDownloader(boolean debugMapTileDownloader)
boolean isMapViewHardwareAccelerated()
void setMapViewHardwareAccelerated(boolean mapViewHardwareAccelerated)
default is false
String getUserAgentValue()
void setUserAgentValue(String userAgentValue)
You MUST use this to set the user agent to some value specific to your application.
Typical usage: Context.getApplicationContext().getPackageName();
from OpenStreetMapTileProviderConstants
userAgentValue
- Map<String,String> getAdditionalHttpRequestProperties()
A simple use case would be: Configuration.getInstance().getAdditionalHttpRequestProperties().put("Origin", "http://www.example-social-network.com");
See https://github.com/osmdroid/osmdroid/issues/570
short getCacheMapTileCount()
LRUMapTileCache.ensureCapacity(int)
The tile cache will always be at least 3x3.
from OpenStreetMapTileProviderConstants
used by MapTileCacheMapTileCache
void setCacheMapTileCount(short cacheMapTileCount)
LRUMapTileCache.ensureCapacity(int)
The tile cache will always be at least 3x3.
from OpenStreetMapTileProviderConstants
used by MapTileCachecacheMapTileCount
- MapTileCache
short getTileDownloadThreads()
void setTileDownloadThreads(short tileDownloadThreads)
short getTileFileSystemThreads()
void setTileFileSystemThreads(short tileFileSystemThreads)
tileFileSystemThreads
- short getTileDownloadMaxQueueSize()
void setTileDownloadMaxQueueSize(short tileDownloadMaxQueueSize)
short getTileFileSystemMaxQueueSize()
void setTileFileSystemMaxQueueSize(short tileFileSystemMaxQueueSize)
long getTileFileSystemCacheMaxBytes()
void setTileFileSystemCacheMaxBytes(long tileFileSystemCacheMaxBytes)
long getTileFileSystemCacheTrimBytes()
void setTileFileSystemCacheTrimBytes(long tileFileSystemCacheTrimBytes)
SimpleDateFormat getHttpHeaderDateTimeFormat()
void setHttpHeaderDateTimeFormat(SimpleDateFormat httpHeaderDateTimeFormat)
Proxy getHttpProxy()
void setHttpProxy(Proxy httpProxy)
File getOsmdroidBasePath()
void setOsmdroidBasePath(File osmdroidBasePath)
Default is StorageUtils.getStorage().getAbsolutePath(),"osmdroid", which usually maps to /sdcard/osmdroid
osmdroidBasePath
- File getOsmdroidTileCache()
MapView
}
is created. Changes made after it's creation (either pogrammatic or via layout inflator) have
no effect until the map is restarted or the MapView.setTileProvider(MapTileProviderBase)
is changed or recreated.
Note: basePath and tileCache directories can be changed independently This has no effect on offline archives and can be changed independently
void setOsmdroidTileCache(File osmdroidTileCache)
MapView
}
is created. Changes made after it's creation (either pogrammatic or via layout inflator) have
no effect until the map is restarted or the MapView.setTileProvider(MapTileProviderBase)
is changed or recreated.
This has no effect on offline archives and can be changed independently
osmdroidTileCache
- String getUserAgentHttpHeader()
load(Context, SharedPreferences)
, it is set to
Context.getPackageName()
which is defined your manifest file
made adjustable just in case
from OpenStreetMapTileProviderConstants
void setUserAgentHttpHeader(String userAgentHttpHeader)
load(Context, SharedPreferences)
, it is set to
Context.getPackageName()
which is defined your manifest file
made adjustable just in case
from OpenStreetMapTileProviderConstants
void load(Context ctx, SharedPreferences preferences)
ctx
- preferences
- void save(Context ctx, SharedPreferences preferences)
ctx
- preferences
- long getExpirationExtendedDuration()
void setExpirationExtendedDuration(long period)
OpenStreetMapTileProviderConstants.DEFAULT_MAXIMUM_CACHED_FILE_AGE
}
Note: this setting only controls tiles as they are downloaded. tiles already in the cache are not effected by this setting Added as part of issue https://github.com/osmdroid/osmdroid/issues/490
period
- time in ms, if 0, no additional time to the 'server provided expiration' or the
'default expiration time' is added. If the value is less than 0, 0 will be usedvoid setExpirationOverrideDuration(Long period)
period
- if null, this setting is unset, server value + getExpirationExtendedDuration apply
if not null, this this value is usedLong getExpirationOverrideDuration()
void setAnimationSpeedDefault(int durationsMilliseconds)
durationsMilliseconds
- int getAnimationSpeedDefault()
void setAnimationSpeedShort(int durationsMilliseconds)
durationsMilliseconds
- int getAnimationSpeedShort()
boolean isMapViewRecyclerFriendly()
void setMapViewRecyclerFriendly(boolean enabled)
void setCacheMapTileOvershoot(short value)
value
- TilesOverlay
short getCacheMapTileOvershoot()