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

MapFragment

open class MapFragment : Fragment

Fragment is the simplest way to place a map in an application. It is a wrapper around a map view that handles 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 Bundle when creating fragment.

STYLE_URL_KEY

static val STYLE_URL_KEY: String

Key used to store style URL in Bundle when creating 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

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.