Package 

Interface IConfigurationProvider

    • Method Detail

      • getGpsWaitTime

         abstract long getGpsWaitTime()

        The time we wait after the last gps location before using a non-gps location.was previously at org.osmdroid.util.constants.UtilConstants

      • setGpsWaitTime

         abstract void setGpsWaitTime(long gpsWaitTime)

        The time we wait after the last gps location before using a non-gps location.

      • setDebugMode

         abstract void setDebugMode(boolean debugMode)
      • isDebugMapView

         abstract boolean isDebugMapView()

        Typically used to enable additional debugging

      • setMapViewHardwareAccelerated

         abstract void setMapViewHardwareAccelerated(boolean mapViewHardwareAccelerated)

        must be set before the mapview is created or inflated from a layout.If you're only using single point icons, then you can probably get away with setting this to trueotherwise (using polylines, paths, polygons) set it to false.

        default is false

      • getAdditionalHttpRequestProperties

         abstract Map<String, String> getAdditionalHttpRequestProperties()

        Enables you to set and get additional HTTP request properties. Used when downloading tiles.Mustn't be null, but will be empty in most cases.

        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

      • getTileDownloadThreads

         abstract short getTileDownloadThreads()

        number of tile download threads, conforming to OSM policy:http://wiki.openstreetmap.org/wiki/Tile_usage_policydefault is 2

      • getTileFileSystemThreads

         abstract short getTileFileSystemThreads()

        used for both file system cache and the sqlite cache

      • setTileFileSystemThreads

         abstract void setTileFileSystemThreads(short tileFileSystemThreads)

        used for both file system cache and the sqlite cache

      • getTileFileSystemCacheTrimBytes

         abstract long getTileFileSystemCacheTrimBytes()

        When the cache size exceeds maxCacheSize, tiles will be automatically removed to reach this target. In bytes. Default is 500 Mb.

      • getOsmdroidBasePath

         abstract File getOsmdroidBasePath()

        Base path for osmdroid files. Zip/sqlite/mbtiles/etc files are in this folder.Note: also used for offline tile sources

        If no directory has been set before with setOsmdroidBasePath it triesto automatically detect one. On API>29 and for better results use getOsmdroidBasePath

      • getOsmdroidBasePath

         abstract File getOsmdroidBasePath(Context context)

        Base path for osmdroid files. Zip/sqlite/mbtiles/etc files are in this folder.Note: also used for offline tile sources

        If no directory has been set before with setOsmdroidBasePath it triesto automatically detect one. Passing a context gives better results than getOsmdroidBasePath and is required to find any location on API29.

      • setOsmdroidBasePath

         abstract void setOsmdroidBasePath(File osmdroidBasePath)

        Base path for osmdroid files. Zip/sqlite/mbtiles/etc files are in this folder.Note: also used for offline tile sources

        Default isStorageUtils.getStorage().getAbsolutePath(),"osmdroid", which usually maps to /sdcard/osmdroid

      • getOsmdroidTileCache

         abstract File getOsmdroidTileCache()

        by default, maps to getOsmdroidBasePath() + "/tiles"By default, it is defined in SD card, osmdroid directory.Sets the location where the tile cache is stored. Changes are only in effect when the { } is created. Changes made after it's creation (either pogrammatic or via layout inflator) haveno effect until the map is restarted or the setTileProvider is changed or recreated.

        Note: basePath and tileCache directories can be changed independentlyThis has no effect on offline archives and can be changed independently

        If no directory has been set before with setOsmdroidTileCache it triesto automatically detect one. On API>29 and for better results use getOsmdroidTileCache

      • getOsmdroidTileCache

         abstract File getOsmdroidTileCache(Context context)

        by default, maps to getOsmdroidBasePath() + "/tiles"By default, it is defined in SD card, osmdroid directory.Sets the location where the tile cache is stored. Changes are only in effect when the org.osmdroid.views.MapView}is created. Changes made after it's creation (either pogrammatic or via layout inflator) haveno effect until the map is restarted or the setTileProvider is changed or recreated.

        Note: basePath and tileCache directories can be changed independentlyThis has no effect on offline archives and can be changed independently

        If no directory has been set before with setOsmdroidTileCache it triesto automatically detect one. Passing a context gives better results than getOsmdroidTileCache and is required to find any location on API29.

      • setOsmdroidTileCache

         abstract void setOsmdroidTileCache(File osmdroidTileCache)

        by default, maps to getOsmdroidBasePath() + "/tiles"Sets the location where the tile cache is stored. Changes are only in effect when the @{link org.osmdroid.views.MapView}is created. Changes made after it's creation (either pogrammatic or via layout inflator) haveno effect until the map is restarted or the setTileProvider is changed or recreated.

        This has no effect on offline archives and can be changed independently

      • load

         abstract void load(Context ctx, SharedPreferences preferences)

        loads the configuration from shared preferences, if the preferences defined in this file are not alreadyset, them they will be populated with defaults. This also initializes the tile storage cache tothe largested writable storage partition available.

      • getExpirationExtendedDuration

         abstract long getExpirationExtendedDuration()

        Returns the amount of time in ms added to server specified tile expiration timeAdded as part of issue https://github.com/osmdroid/osmdroid/issues/490

      • setExpirationExtendedDuration

         abstract void setExpirationExtendedDuration(long period)

        Optionally extends the amount of time that downloaded tiles remain in the cache beyond either theserver specified expiration time stamp or the default expiration time {DEFAULT_MAXIMUM_CACHED_FILE_AGE}

        Note: this setting only controls tiles as they are downloaded. tiles already in the cache arenot effected by this settingAdded as part of issue https://github.com/osmdroid/osmdroid/issues/490

        Parameters:
        period - time in ms, if 0, no additional time to the 'server provided expiration' or the'default expiration time' is added.
      • setExpirationOverrideDuration

         abstract void setExpirationOverrideDuration(Long period)

        Optional period of time in ms that will override any downloaded tile's expiration timestamp

        Parameters:
        period - if null, this setting is unset, server value + getExpirationExtendedDuration applyif not null, this this value is used
      • getExpirationOverrideDuration

         abstract Long getExpirationOverrideDuration()

        Optional period of time in ms that will override any downloaded tile's expiration timestamp

      • setAnimationSpeedDefault

         abstract void setAnimationSpeedDefault(int durationsMilliseconds)

        Used during zoom animationshttps://github.com/osmdroid/osmdroid/issues/650

      • getAnimationSpeedDefault

         abstract int getAnimationSpeedDefault()

        Used during zoom animationshttps://github.com/osmdroid/osmdroid/issues/650

      • setAnimationSpeedShort

         abstract void setAnimationSpeedShort(int durationsMilliseconds)

        Used during zoom animationshttps://github.com/osmdroid/osmdroid/issues/650

      • getAnimationSpeedShort

         abstract int getAnimationSpeedShort()

        Used during zoom animationshttps://github.com/osmdroid/osmdroid/issues/650

      • isMapViewRecyclerFriendly

         abstract boolean isMapViewRecyclerFriendly()

        If true, the map view will set .setHasTransientState(true) for API 16+ devices.This is now the default setting. Set to false if this is causing you issues

      • setMapViewRecyclerFriendly

         abstract void setMapViewRecyclerFriendly(boolean enabled)

        If true, the map view will set .setHasTransientState(true) for API 16+ devices.This is now the default setting. Set to false if this is causing you issues

      • setCacheMapTileOvershoot

         abstract void setCacheMapTileOvershoot(short value)

        In memory tile count, used by the tiles overlay

      • getTileGCBulkSize

         abstract int getTileGCBulkSize()

        Tile garbage collection bulk size

      • isEnforceTileSystemBounds

         abstract boolean isEnforceTileSystemBounds()

        Default is false for the DefaultConfigurationProviderIf true and a bounding box is beyond that of the org.osmdroid.util.TileSystem,then an exception is thrown by checks in org.osmdroid.util.BoundingBoxIf false, then no exception is thrown.Historical note. Prior to late Feb 2018, which could have been around v6.0.2,the behavior was to NOT throw an exception, Starting with 6.0.2, it starting throwing.This caused a number of issues when importing content from other sources.July 2022, this method was added to help reduce the pain associated with this withthe default set to false (do not throw).Keep in mind, that coordinates beyond that of the tile system may render inaccurately orhave strange behavior.