I want to add marker on my geoposition. That’s what i did:
<code>mapFragment.getMapAsync { tomtomMap: TomTomMap ->
val loc:GeoPoint = tomtommap.currentLocation!!.position
val markerOptions =
MarkerOptions(
coordinate = loc,
tag = "Tag",
pinImage = ImageFactory.fromResource(R.drawable.children),
pinIconImage = ImageFactory.fromResource(R.drawable.children),
)
tomtomMap.addMarker(markerOptions)
}
</code>
<code>mapFragment.getMapAsync { tomtomMap: TomTomMap ->
val loc:GeoPoint = tomtommap.currentLocation!!.position
val markerOptions =
MarkerOptions(
coordinate = loc,
tag = "Tag",
pinImage = ImageFactory.fromResource(R.drawable.children),
pinIconImage = ImageFactory.fromResource(R.drawable.children),
)
tomtomMap.addMarker(markerOptions)
}
</code>
mapFragment.getMapAsync { tomtomMap: TomTomMap ->
val loc:GeoPoint = tomtommap.currentLocation!!.position
val markerOptions =
MarkerOptions(
coordinate = loc,
tag = "Tag",
pinImage = ImageFactory.fromResource(R.drawable.children),
pinIconImage = ImageFactory.fromResource(R.drawable.children),
)
tomtomMap.addMarker(markerOptions)
}
Also I changed MarkerOptions pinImage and pinIconImage from type Image? to Int so I should put one of images from drawable. Maybe thats the issue?
That’s how MarkerOptions look now:
<code>data class MarkerOptions(
val coordinate: GeoPoint,
val pinImage: Int,
val pinIconImage: Int,
val shieldImage: Image? = null,
val tag: String? = null,
val label: Label? = null,
val balloonText: String = ""
)
</code>
<code>data class MarkerOptions(
val coordinate: GeoPoint,
val pinImage: Int,
val pinIconImage: Int,
val shieldImage: Image? = null,
val tag: String? = null,
val label: Label? = null,
val balloonText: String = ""
)
</code>
data class MarkerOptions(
val coordinate: GeoPoint,
val pinImage: Int,
val pinIconImage: Int,
val shieldImage: Image? = null,
val tag: String? = null,
val label: Label? = null,
val balloonText: String = ""
)
And thats how it looked:
<code>data class MarkerOptions(
val coordinate: GeoPoint,
val pinImage: Image,
val pinIconImage: Image? = null,
val shieldImage: Image? = null,
val tag: String? = null,
val label: Label? = null,
val balloonText: String = ""
)
</code>
<code>data class MarkerOptions(
val coordinate: GeoPoint,
val pinImage: Image,
val pinIconImage: Image? = null,
val shieldImage: Image? = null,
val tag: String? = null,
val label: Label? = null,
val balloonText: String = ""
)
</code>
data class MarkerOptions(
val coordinate: GeoPoint,
val pinImage: Image,
val pinIconImage: Image? = null,
val shieldImage: Image? = null,
val tag: String? = null,
val label: Label? = null,
val balloonText: String = ""
)
I wasn`t able to input Image type in MarkerOptions, that’s why I changed types