sdk-maps-static-image / com.tomtom.online.sdk.staticimage / StaticImage

StaticImage

open class StaticImage

Static image model. The model of a map image on the server.

Types

Build

interface Build

The support interface for builder.

Builder

open class Builder : StaticImage.NotRequiredStep, StaticImage.RequiredStep, StaticImage.Build

Builder

NotRequiredStep

interface NotRequiredStep : StaticImage.Build

The support interface for builder.

RequiredStep

interface RequiredStep

The support interface for builder.

Properties

EXT_JPEG

static val EXT_JPEG: String

Image format to be returned: jpeg.

EXT_JPG

static val EXT_JPG: String

Image format to be returned: jpg.

EXT_PNG

static val EXT_PNG: String

Image format to be returned: png.

LAYER_BASIC

static val LAYER_BASIC: String

Basic - contains full map data, i.e., polygons, roads, borders, and labels.

LAYER_HYBRID

static val LAYER_HYBRID: String

Hybrid - contains borders, roads, and labels (all the map features, except geographic polygons). It can be overlaid on another map layer (such as satellite imagery) in order to produce a hybrid map.

LAYER_LABELS

static val LAYER_LABELS: String

Labels - only provides label information (the same as the basic map layer). It can be used in situations where traffic tubes or other overlaid information covers labels of the base map layer. The labels are precisely placed in order to align with the labels on the basic layer.

MAX_MAP_SIZE_PIXELS

static val MAX_MAP_SIZE_PIXELS: Int

Max width of the resulting image in pixels.

MIN_MAP_SIZE_PIXELS

static val MIN_MAP_SIZE_PIXELS: Int

Min width of the resulting image in pixels.

PROTOCOL_HTTP

static val PROTOCOL_HTTP: String

A map can by downloaded by the http or https protocol, the default being https.

PROTOCOL_HTTPS

static val PROTOCOL_HTTPS: String

A map can by downloaded by the http or https protocol, the default being https.

STYLE_MAIN

static val STYLE_MAIN: String

Styles define colour schemes. These are general, full-colour schemes with default TomTom colours.

STYLE_NIGHT

static val STYLE_NIGHT: String

Styles define colour schemes. Night is a modification of the main theme, and is changed to be less invasive than main while using it at night.

Functions

builder

open static fun builder(key: String!): StaticImage.RequiredStep!
open static fun builder(key: String!, version: Int): StaticImage.RequiredStep!

Builder of the StaticImage.

download

open fun download(context: Context!, downloadListener: DownloadListener!): Unit

The Method to download an image with a listener. It can be used to download multiple images in the background. It can be called from the main thread.

downloadInto

open fun downloadInto(imageView: ImageView!): Unit

A Method used to download a static image into image view. A Method uses #getDownloader(Context). A Method can be overwritten to provide a custom downloader. It can be called from the main thread.

getBoundingBox

open fun getBoundingBox(): BoundingBox!

The bounding box of the requested map image.

getCenter

open fun getCenter(): LatLng!

The usage of center is mutually exclusive with the usage of boundingBox. If both are used, the service will return an error.

getDownloader

open fun getDownloader(context: Context!): DrawableDownloader

Provides the default image downloader. This Method can be overwritten to provide a custom downloader.

getExt

open fun getExt(): Optional<String!>!

The requested map image format. When this requested format is not set, the default value is used. The default value is #EXT_PNG.

getGeopoliticalView

open fun getGeopoliticalView(): Optional<String!>!

The requested geopolitical view of the map image. When this requested view is not set, the default value is used. The default view is recognised based on the country the Request came from.

getHeightPixels

open fun getHeightPixels(): Optional<Int!>!

The requested map height. When this requested height is not set, the default value is used. The default value is set on the server.

getLayer

open fun getLayer(): Optional<String!>!

The requested map layer. If this layer is not set in the Request, the default value is used. The default value is #LAYER_BASIC.

getProtocol

open fun getProtocol(): String

The requested protocol of the image format. When the requested protocol is not set, the default value is used. The default value is #PROTOCOL_HTTPS.

getStyle

open fun getStyle(): Optional<String!>!

The requested style of the map image. When this requested style is not set, the default value is used. The default value is #STYLE_MAIN.

getURL

open fun getURL(context: Context!): String!

The generated url for a static map. The url can be used to download an image from a user library, for example: picasso.

getVersion

open fun getVersion(): String

getWidthPixels

open fun getWidthPixels(): Optional<Int!>!

The requested map width. When this requested width is not set, the default value is used.

getZoomLevel

open fun getZoomLevel(): Optional<Int!>!

The requested zoom level. When this requested zoom level is not set, the default value is used. The default value is set on the server.

setUrlGenerator

open fun setUrlGenerator(urlGenerator: StaticMapUrlGenerator!): Unit

The default url generator should generate a correct url to the static image map in the TomTom online services. The default implementation is StaticMapNetUrlGenerator.