Package-level declarations

Types

Link copied to clipboard
class GeoEngine
Link copied to clipboard
open class GridState
Link copied to clipboard
data class PositionedString(val text: String, val location: LngLatAlt? = null, val earcon: String? = null, val type: AudioType = AudioType.STANDARD, val heading: Double? = null)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
data class StreetPreviewChoice(val heading: Double, val name: String, val route: List<LngLatAlt>)
Link copied to clipboard
data class StreetPreviewState(val enabled: StreetPreviewEnabled = StreetPreviewEnabled.OFF, val choices: List<StreetPreviewChoice> = emptyList())
Link copied to clipboard
data class TextForFeature(val text: String = "", val generic: Boolean = false)
Link copied to clipboard
enum TreeId : Enum<TreeId>
Link copied to clipboard
class UserGeometry(val location: LngLatAlt = LngLatAlt(), var phoneHeading: Double? = null, val fovDistance: Double = 50.0, val inVehicle: Boolean = false, val inMotion: Boolean = false, val speed: Double = 0.0, headingMode: UserGeometry.HeadingMode = HeadingMode.CourseAuto, travelHeading: Double? = null, headHeading: Double? = null, inStreetPreview: Boolean = false)

UserGeometry contains all of the data relating to the location and motion of the user. It's aim is to reduces the number of arguments to many of the API calls and to concentrate some of the logic around heading choice.

Properties

Link copied to clipboard
Link copied to clipboard

The default tile server is the one out in the cloud where the tile JSON is at: https://server/protomaps.json

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
const val SOUNDSCAPE_TILE_BACKEND: Boolean = false

The zoom level and grid size are constant. When using soundscape-backend these will be 16 and 3, but if we switch to using protobuf tiles they will be 15 and 2.

Link copied to clipboard

Functions

Link copied to clipboard
fun formatDistance(distance: Double, localizedContext: Context): String

We're going to round metric as documented for iOS: For metric units, we round all distances less than 1000 meters to the nearest 5 meters and all distances over 1000 meters to the nearest 50 meters.

Link copied to clipboard
fun getTextForFeature(localizedContext: Context, feature: Feature): TextForFeature

getNameForFeature returns text describing the feature for callouts. Usually it returns a name or if it doesn't have one then a localized description of the type of feature it is e.g. bike parking, or style. Some types of Feature have more info e.g. bus stops and railway stations

Link copied to clipboard
fun localReverseGeocode(location: LngLatAlt, gridState: GridState, localizedContext: Context): LocationDescription?
Link copied to clipboard
fun reverseGeocode(userGeometry: UserGeometry, gridState: GridState, localizedContext: Context): PositionedString

Reverse geocodes a location into 1 of 4 possible states