MTImageSource

class MTImageSource(var identifier: String, url: URL, var coordinates: List<LngLat>) : MTSource

An image source.

The url value contains the image location. The coordinates array contains longitude, latitude pairs for the image corners listed in clockwise order: top left, top right, bottom right, bottom left.

Constructors

constructor(identifier: String, url: URL, coordinates: List<LngLat>)

Properties

Corners of the image in clockwise order starting at top-left.

open override var identifier: String

Unique identifier of a source.

open override val type: MTSourceType

Type of the source.

open override var url: URL?

URL pointing to the source resource.

Functions

fun setCoordinates(coordinates: List<LngLat>, mapViewController: MTMapViewController)

Updates the image corners.

fun updateImage(url: URL, coordinates: List<LngLat>, mapViewController: MTMapViewController)

Updates both the image URL and its corner coordinates atomically.