sdk-maps / com.tomtom.online.sdk.map / MapView / <init>

<init>

MapView(@NonNull context: Context)

Default constructor that uses context to inflate view and create map database. Constructor also creates TomtomMap with default configuration.

Parameters

context - Context: view context.

MapView(@NonNull context: Context, @NonNull styleUrl: String)

Custom constructor to provide custom style url. Custom style url can be pass from http server or application assets.

Parameters

context - Context: view context.

styleUrl - String: protocol://style.url.json

MapView(@NonNull context: Context, @Nullable attrs: AttributeSet?)

Custom constructor to provide custom set of attributes.

Parameters

context - Context: view context.

attrs - AttributeSet?: set of custom attributes.

MapView(@NonNull context: Context, keys: MutableMap<String!, String!>!)

Custom constructor to provide online API keys dynamically. Keys provided within the map will override any keys set in the AndroidManifest.xml Constructor also creates TomtomMap with default configuration.

Parameters

context - Context: view context

keys - MutableMap<String!, String!>!: map containing api key values for "OnlineMaps.Key" & "OnlineTraffic.Key"

MapView(@NonNull context: Context, keys: MutableMap<String!, String!>!, @NonNull styleUrl: String)

Custom constructor to provide online API keys dynamically together with a custom style url. Custom style url can be pass from http server or application assets.

Parameters

context - Context: view context

keys - MutableMap<String!, String!>!: map containing api key values for "OnlineMaps.Key" & "OnlineTraffic.Key"

styleUrl - String: protocol://style.url.json

MapView(@NonNull context: Context, mapProperties: MapProperties!)

Custom constructor to provide online API keys dynamically together with a custom style url. Custom style url can be pass from http server or application assets.

Parameters

context - Context: view context

mapProperties - MapProperties!: map configuration

MapView(@NonNull context: Context, @Nullable attrs: AttributeSet?, defStyleAttr: Int)

Custom constructor to provide custom set of attributes and a reference to default style resource.

Parameters

context - Context: view context.

attrs - AttributeSet?: set of custom attributes.

defStyleAttr - Int: attribute that contains a reference to a style resource, that supplies default values for styled attributes. Should be different than 0 in this constructor, otherwise use MapView#MapView(Context, AttributeSet).