THIS SDK ISDEPRECATED.

We rolled out a new and better SDK for you.

Static Map Image

Allow your user to render a user-defined rectangular image containing a map section.

For more details, please visit Static Map Image documentation

Sample use case 1: Your app is designed to use simple map. You do not want to show the entire map, just some part of it to show and mark something simple. You don’t have to download the whole sdk-maps library which is much heavier compared to this library.

To use this library, add the following dependency to the build.gradle file:

api("com.tomtom.online:sdk-maps-static-image:{libversion}")

Example of displaying a static map:

1StaticImage.builder(getMapApiKey())
2 .center(Locations.AMSTERDAM_LOCATION) //use center or boundingBox
3 .layerBasic() // basic layer is default
4 .styleMain() // main style is default
5 .mapSize(512, 512) // default size in px
6 .png() //png is default
7 .build()
8 .downloadInto(staticMap1)
1StaticImage.builder(mapsApiKey)
2 .center(Locations.AMSTERDAM)
3 .zoom(zoomLevel)
4 .layer(layer)
5 .style(style)
6 .mapSize(DEFAULT_DIMENSION_SIZE, DEFAULT_DIMENSION_SIZE)
7 .png()
8 .build()
9 .downloadInto(targetImageView)

image

Sample image retrieved from the static map service.

image

Examples of static map images.

API Reference

JavaDocStaticImage_2.4.807 (JavaDocStaticImage_2.4.807.zip)