Package com.mapbox.maps.extension.style.image

Types

ImageExtensionImpl
Link copied to clipboard

Concrete implementation of ImagePlugin, the plugin is used to add an image to be used in the style.

ImageNinePatchExtensionImpl
Link copied to clipboard

Concrete implementation of ImagePlugin (see ImageExtensionImpl) but taking 9-patch Bitmap in order to calculate stretchX, stretchY and paddings automatically.

NinePatchImage
Link copied to clipboard
data class NinePatchImage(internalImage: Image, stretchX: List<ImageStretches>, stretchY: List<ImageStretches>, imageContent: ImageContent)

Data class describing 9-patch bitmap.

Functions

addImage
Link copied to clipboard
fun StyleInterface.addImage(image: StyleContract.StyleImageExtension)

Extension function to add an image provided by the Style Extension to the Style.

addImage9Patch
Link copied to clipboard
fun StyleInterface.addImage9Patch(image: StyleContract.StyleImageExtension)

Extension function to add 9-patch image provided by the Style Extension to the Style.

fun StyleInterface.addImage9Patch(imageId: String, bitmap: Bitmap, scale: Float = pixelRatio, sdf: Boolean = false): Expected<String, None>

Adds an 9-patch image to be used in the style. X-stretches, Y-stretches and padding will be calculated from Bitmap.getNinePatchChunk.

image
Link copied to clipboard
fun image(imageId: String, block: ImageExtensionImpl.Builder.() -> Unit): ImageExtensionImpl

DSL function for ImageExtensionImpl.

image9Patch
Link copied to clipboard
fun image9Patch(imageId: String, bitmap: Bitmap, block: ImageNinePatchExtensionImpl.Builder.() -> Unit? = null): ImageNinePatchExtensionImpl

DSL function for ImageNinePatchExtensionImpl.

parse9PatchBitmap
Link copied to clipboard
fun Bitmap.parse9PatchBitmap(): NinePatchImage

Utility function returning NinePatchImage from a given Bitmap.