Skip to content

Instantly share code, notes, and snippets.

@kuwapa
Last active April 29, 2022 08:55
Show Gist options
  • Save kuwapa/f2deca85fca4aac0d3bec9a9f07a78e9 to your computer and use it in GitHub Desktop.
Save kuwapa/f2deca85fca4aac0d3bec9a9f07a78e9 to your computer and use it in GitHub Desktop.
private val mapView: MapView by lazy { v.mapView }
private lateinit var lineManager: LineManager
private lateinit var map: MapboxMap
private val v: ActivityMainBinding by lazy {
ActivityTsasBinding.inflate(layoutInflater)
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Mapbox.getInstance(this)
setContentView(v.root)
mapView.onCreate(savedInstanceState)
mapView.getMapAsync {
map = it
mapboxMap.setStyle(Style.OUTDOORS) {
lineManager = LineManager(mapView, map, map.style!!)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment