sdk-maps / com.tomtom.online.sdk.map / MapFragment

MapFragment

open class MapFragment : Fragment, SnapshotService

Fragment is the simplest way to place a map in an application. It is a wrapper around a map view that handles the map lifecycle.

Constructors

<init>

MapFragment()

Empty constructor

Properties

MAP_DYNAMIC_KEY

static val MAP_DYNAMIC_KEY: String

Key used to store dynamic keys set in the Bundle when creating a fragment.

STYLE_URL_KEY

static val STYLE_URL_KEY: String

Key used to store the style URL in a Bundle when creating a fragment.

Functions

getAsyncMap

open fun getAsyncMap(callback: OnMapReadyCallback): Unit

Sets a callback which will be triggered when the map instance is ready to use. The callback will be executed in the main thread.

newInstance

open static fun newInstance(): MapFragment

Create new instance of MapFragment.

open static fun newInstance(keys: HashMap<String!, String!>!): MapFragment

Create new instance of MapFragment with dynamic API Keys

open static fun newInstance(styleUrl: String!): MapFragment

Create new instance of MapFragment with custom style.

open static fun newInstance(keys: HashMap<String!, String!>!, styleUrl: String!): MapFragment

Create new instance of MapFragment with dynamic API Keys and custom style.

open static fun newInstance(mapProperties: MapProperties!): MapFragment

Create new instance of MapFragment with desired initial properties.

onActivityCreated

open fun onActivityCreated(savedInstanceState: Bundle?): Unit

onCreate

open fun onCreate(savedInstanceState: Bundle?): Unit

onCreateView

open fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View?

onDestroy

open fun onDestroy(): Unit

onInflate

open fun onInflate(context: Context!, attrs: AttributeSet!, savedInstanceState: Bundle!): Unit

onPause

open fun onPause(): Unit

onResume

open fun onResume(): Unit

onSaveInstanceState

open fun onSaveInstanceState(outState: Bundle): Unit

onStart

open fun onStart(): Unit

onStop

open fun onStop(): Unit

parseAttrs

open fun parseAttrs(context: Context!, attrs: AttributeSet!): Unit

setMapBackgroundColor

open fun setMapBackgroundColor(mapBackgroundColor: Int): Unit

Set map background color

setSnapshotter

open fun setSnapshotter(snapshotter: Snapshotter): Unit

Method that allows the change of an implementation of Snapshotter.

setZOrderMediaOverlay

open fun setZOrderMediaOverlay(zOrderOnTop: Boolean): Unit

Control whether the map surface view's surface is placed on top of another regular surface view in the window (but still behind the window itself). This is typically used to place mini map on top of an underlying map surface view.

takeSnapshot

open fun takeSnapshot(callback: SnapshotCallback): Unit

Take a snapshot of the Map. The result will be delivered by SnapshotCallback.