Skip to content

Instantly share code, notes, and snippets.

print(getTotalTileCount((13.18178, 77.12267), (13.88948, 78.11077), 8, 10))
zoom = 8, leftBottomTiles = (182, 118), rightTopTiles = (183, 118), tileCount = 2
zoom = 9, leftBottomTiles = (365, 237), rightTopTiles = (367, 236), tileCount = 6
zoom = 10, leftBottomTiles = (731, 474), rightTopTiles = (734, 472), tileCount = 12
20
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)
fun createDummyPath() = arrayListOf(
LatLng(35.12972888243833, 137.30017964781746),
LatLng(35.16003270167863, 137.34192854082988),
LatLng(35.175866072622306, 137.4588457531761),
LatLng(35.098973418374655, 137.55921143244922),
LatLng(35.15312262941834, 137.65852062512363),
LatLng(35.2538363762526, 137.73846100826395),
LatLng(35.199466465206655, 137.92757107763117),
LatLng(35.31736555432611, 137.92545811180227),
LatLng(35.42017123490391, 137.97405622936287),
override fun onCreate(savedInstanceState: Bundle?) {
//map init code..
val path = createDummyPath()
val lineOnMap = showPathOnMap(path)
}
private fun showPathOnMap(path: List<Radio>) : Line {
val lineOptions = LineOptions()
.withLineColor("#3949AB")
override fun onCreate(savedInstanceState: Bundle?) {
//map init code..
val path = createDummyPath()
val lineOnMap = showPathOnMap(path)
v.clearButton.setOnClickListener {
lineManager.delete(lineOnMap)
}
}